diff --git a/FIX_REVIEW_ISSUES.md b/FIX_REVIEW_ISSUES.md new file mode 100644 index 0000000000..406de956a1 --- /dev/null +++ b/FIX_REVIEW_ISSUES.md @@ -0,0 +1,120 @@ +# Fix Review Issues + +You are a PhD-level mathematician and Lean 4 expert. Your task is to fix all issues identified in a review for Erdős Problem **NUM**. + +## Inputs + +- **Review:** `ai-review/NUM.md` +- **Lean file:** `FormalConjectures/ErdosProblems/NUM.lean` +- **Library:** `FormalConjecturesForMathlib/` (shared definitions to reuse) +- **Website:** `https://www.erdosproblems.com/NUM` (detailed problem info — variants, context, related problems) +- **LaTeX source:** `https://www.erdosproblems.com/latex/NUM` (authoritative source for citations — most complete bibliographic data) + +## Instructions + +Read the review at `ai-review/NUM.md` in full. Then implement **all** fixes described below, working through each section in order. After completing all sections, run the verification checklist. + +--- + +### Section 1: Code Reuse + +If the review identifies local definitions that duplicate library code: + +1. Find the library equivalent mentioned in the review (search Mathlib and `FormalConjecturesForMathlib/` only — do **not** look at other Erdős problem files). +2. Read both the local definition and the library version. Confirm they are semantically equivalent or that the library version is strictly better. +3. Delete the local definition(s). +4. Add the necessary `import` statement(s) and `open` declarations. +5. Rewrite the theorem statement(s) to use the library definitions. +6. Ensure the file still compiles (`sorry` proofs are fine — the goal is correct *statements*, not proofs). + +If the review says "No issues" or the section has no actionable recommendations, skip this section. + +**Important constraints:** +- Only import definitions that already exist in Mathlib or `FormalConjecturesForMathlib/`. Do **not** look at other Erdős problem files for code to reuse, and do **not** create new definitions in the library. +- Preserve the existing `ErdosNUM` namespace. Every problem file uses a `namespace ErdosNUM` / `end ErdosNUM` block — do not remove or rename it, even if the local definitions it originally scoped are deleted. + +--- + +### Section 2: Citations + +If the review identifies citation issues: + +1. Fetch `https://www.erdosproblems.com/latex/NUM` to get the LaTeX source with exact citations. This is the **most complete source** for bibliographic data (titles, journals, volumes, pages). You may also fetch `https://www.erdosproblems.com/NUM` for additional context, but the LaTeX endpoint has the most complete citation details. Do not search the web or use any other sources. +2. When extracting citations from the LaTeX source, convert LaTeX-encoded names to plain text (e.g., `Erd\H{o}s` → `Erdős`, `Szemer\'edi` → `Szemerédi`, `Tur\'an` → `Turán`). +3. For each citation issue flagged in the review: + - **Missing reference:** Add it to the module docstring in the standard format: `[TAG] Last, F., Last, F., _Title_. Journal **vol** (year), pages.` + - **Incomplete reference:** Expand it with title, journal, volume, and page numbers from the LaTeX source. + - **Tag mismatch:** Standardize the tag to match other files that cite the same paper. Search the codebase for the same author/year to find the canonical tag. +4. If the review mentions missing OEIS sequences or other cross-references from the website, add them to the docstring. + +If the review says "No issues" or the section has no actionable recommendations, skip this section. + +--- + +### Section 3: Variants + +If the review identifies missing variants that should be formalized: + +1. For each variant the review recommends adding: + - Write a new theorem statement with an appropriate name (e.g., `erdos_NUM_upper`, `erdos_NUM_variant`). + - Include a docstring explaining what the variant captures and its relationship to the main problem. + - Use `sorry` for the proof. + - Reuse existing definitions (library or local) — do not introduce new definitions unless necessary. +2. Only add variants that the review **explicitly recommends** formalizing. Do not invent new variants. + +If the review says "No issues", the section has no actionable recommendations, or variants are described as "optional", skip this section. + +--- + +### Section 4: Readability + +If the review identifies readability improvements: + +1. Apply each specific recommendation (e.g., renaming variables, using standard Lean/Mathlib idioms like `Odd k` instead of `k % 2 = 1`, replacing `p.1`/`p.2` with named projections). +2. Do **not** make readability changes that conflict with Section 1 fixes (e.g., don't improve a local definition that you already deleted and replaced with a library version). +3. Improve docstrings only if the review specifically requests it. + +If the review says "No issues" or the section has no actionable recommendations, skip this section. + +--- + +### Section 5: Formalizability + +This section is informational. **No code changes needed** unless the review explicitly identifies an encoding issue that should be fixed (e.g., "the formalization encodes X but should encode Y"). In that case, fix the encoding in the theorem statement. + +--- + +### Section 6: Correctness + +If the review identifies correctness issues: + +1. **This is the highest priority section.** Correctness fixes take precedence over all other changes. +2. For each issue flagged: + - Read the review's explanation of why the current formalization is incorrect. + - Identify the correct mathematical formulation (the review will typically describe it). + - Rewrite the affected definition(s) and/or theorem statement(s). + - If the fix involves switching to a library definition (overlapping with Section 1), ensure the library version is mathematically correct per the review's analysis. +3. If the review says "Correct and complete" or equivalent, no changes needed. + +--- + +## Verification Checklist + +After implementing all fixes, verify each item: + +1. **Compiles:** Run `lake build FormalConjectures/ErdosProblems/NUM.lean` and confirm it compiles (with `sorry` proofs — warnings are OK, errors are not). +2. **Code reuse:** Grep the file for any local definitions the review said to remove. Confirm they are gone. +3. **Citations:** Re-read the module docstring. Confirm all references from the website are present with full bibliographic details. +4. **Variants:** If variants were added, confirm each has a docstring and compiles. +5. **Correctness:** If correctness issues were flagged, re-read the rewritten theorem statement and confirm it matches the review's recommended fix. +6. **No regressions:** Ensure no other files that import this one are broken. Search for `import FormalConjectures.ErdosProblems.NUM` across the codebase. + +If compilation fails, diagnose and fix the error. Common issues: +- Missing imports (add `import` statements) +- Missing `open` declarations (add `open` for namespaces used) +- Type mismatches from switching definitions (adjust the theorem statement to match library types) +- Name clashes (use fully qualified names or adjust `open`/`namespace`) + +## Output + +When done, report a summary of changes made per section (1-6) and the result of each verification checklist item. diff --git a/FormalConjectures/ErdosProblems/1000.lean b/FormalConjectures/ErdosProblems/1000.lean new file mode 100644 index 0000000000..d92896e2c8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1000.lean @@ -0,0 +1,68 @@ +/- +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 1000 + +*Reference:* [erdosproblems.com/1000](https://www.erdosproblems.com/1000) + +Let $A = \{n_1 < n_2 < \cdots\}$ be an infinite sequence of integers, and let $\varphi_A(k)$ +count the number of $1 \leq m \leq n_k$ such that the fraction $m/n_k$ does not have +denominator $n_j$ for $j < k$ when written in lowest form; equivalently, +$n_k / \gcd(m, n_k) \neq n_j$ for all $1 \leq j < k$. + +Is there a sequence $A$ such that +$$\lim_{N \to \infty} \frac{1}{N} \sum_{k \leq N} \frac{\varphi_A(k)}{n_k} = 0?$$ + +Erdős believed no such sequence exists. This was solved by Haight [Ha] who +proved that such a sequence does exist (contrary to Erdős' expectations). + +[Er64b] Erdős, P., _Some problems in number theory_. 1964. + +[Ha] Haight, J. A., _A linear programming problem_. 1979. +-/ + +open Finset Filter + +namespace Erdos1000 + +/-- For a strictly increasing sequence $a : \mathbb{N} \to \mathbb{N}$ of positive integers, +$\varphi_A(k)$ counts the number of $1 \leq m \leq a(k)$ such that +$a(k) / \gcd(m, a(k)) \neq a(j)$ for all $j < k$. -/ +noncomputable def phiA (a : ℕ → ℕ) (k : ℕ) : ℕ := + ((Finset.Icc 1 (a k)).filter (fun m => + ∀ j < k, (a k) / Nat.gcd m (a k) ≠ a j)).card + +/-- +Erdős Problem 1000 [Er64b]: + +There exists a strictly increasing sequence $A = \{n_1 < n_2 < \cdots\}$ of positive +integers such that the Cesàro mean of $\varphi_A(k)/n_k$ tends to $0$: +$$\lim_{N \to \infty} \frac{1}{N} \sum_{k \leq N} \frac{\varphi_A(k)}{n_k} = 0.$$ + +Proved by Haight [Ha]. +-/ +@[category research solved, AMS 11] +theorem erdos_1000 : answer(True) ↔ + ∃ a : ℕ → ℕ, StrictMono a ∧ (∀ i, 0 < a i) ∧ + Filter.Tendsto + (fun N : ℕ => (∑ k ∈ Finset.range N, (phiA a k : ℝ) / (a k : ℝ)) / (N : ℝ)) + Filter.atTop (nhds 0) := by + sorry + +end Erdos1000 diff --git a/FormalConjectures/ErdosProblems/1001.lean b/FormalConjectures/ErdosProblems/1001.lean new file mode 100644 index 0000000000..0b39dd1928 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1001.lean @@ -0,0 +1,97 @@ +/- +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 1001 + +*Reference:* [erdosproblems.com/1001](https://www.erdosproblems.com/1001) + +Let $S(N, A, c)$ be the Lebesgue measure of the set of $\alpha \in (0,1)$ such that +$|\alpha - x/y| < A/y^2$ +for some $N \leq y \leq cN$ and $\gcd(x,y) = 1$. Does +$\lim_{N \to \infty} S(N, A, c) = f(A, c)$ +exist? What is its explicit form? + +A problem of Erdős, Szüsz, and Turán [EST58], who proved the formula +$f(A, c) = 12A \log c / \pi^2$ +when $0 < A < c/(1 + c^2)$. + +The existence of the limit was proved by Kesten and Sós [KeSo66]. +Alternative, more explicit proofs were given by Boca [Bo08] and +Xiong–Zaharescu [XiZa06]. + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[EST58] Erdős, P., Szüsz, P., and Turán, P., _Remarks on the theory of +diophantine approximation_. Colloq. Math. (1958), 119–126. + +[KeSo66] Kesten, H. and Sós, V. T., _On two problems of Erdős, Szüsz and +Turán concerning diophantine approximations_. Acta Arith. (1966/67), 183–192. + +[Bo08] Boca, F. P., _A problem of Erdős, Szüsz and Turán concerning +Diophantine approximations_. Int. J. Number Theory (2008), 691–708. + +[XiZa06] Xiong, M. and Zaharescu, A., _A problem of Erdős-Szüsz-Turán on +Diophantine approximation_. Acta Arith. (2006), 163–177. +-/ + +open MeasureTheory Set Filter + +namespace Erdos1001 + +/-- The set of $\alpha \in (0,1)$ approximable by a coprime fraction $x/y$ + with $N \leq y \leq cN$ to within $A/y^2$. -/ +noncomputable def approxSet (N : ℕ) (A c : ℝ) : Set ℝ := + {α : ℝ | α ∈ Ioo 0 1 ∧ + ∃ (x : ℤ) (y : ℕ), N ≤ y ∧ (y : ℝ) ≤ c * N ∧ + Nat.Coprime (Int.natAbs x) y ∧ + |α - (x : ℝ) / (y : ℝ)| < A / ((y : ℝ) ^ 2)} + +/-- $S(N, A, c)$ is the Lebesgue measure of the approximation set. -/ +noncomputable def sMeasure (N : ℕ) (A c : ℝ) : ℝ := + (volume (approxSet N A c)).toReal + +/-- +Erdős Problem 1001 [Er64b]: + +For all $A > 0$ and $c > 1$, the limit $\lim_{N \to \infty} S(N, A, c)$ exists. + +Proved by Kesten and Sós [KeSo66]. +-/ +@[category research solved, AMS 11 28] +theorem erdos_1001 : answer(True) ↔ + ∀ (A c : ℝ), 0 < A → 1 < c → + ∃ L : ℝ, Tendsto (fun N : ℕ => sMeasure N A c) atTop (nhds L) := by + sorry + +/-- +Erdős Problem 1001 — EST58 explicit formula [EST58]: + +When $0 < A < c/(1 + c^2)$, the limit $f(A, c) = 12A \log c / \pi^2$. + +Proved by Erdős, Szüsz, and Turán. +-/ +@[category research solved, AMS 11 28] +theorem erdos_1001_explicit_formula : + ∀ (A c : ℝ), 0 < A → 1 < c → A < c / (1 + c ^ 2) → + Tendsto (fun N : ℕ => sMeasure N A c) atTop + (nhds (12 * A * Real.log c / Real.pi ^ 2)) := by + sorry + +end Erdos1001 diff --git a/FormalConjectures/ErdosProblems/1002.lean b/FormalConjectures/ErdosProblems/1002.lean new file mode 100644 index 0000000000..c67047c498 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1002.lean @@ -0,0 +1,70 @@ +/- +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 1002 + +*Reference:* [erdosproblems.com/1002](https://www.erdosproblems.com/1002) + +For any $0 < \alpha < 1$, let +$$f(\alpha, n) = \frac{1}{\log n} \sum_{1 \le k \le n} \left(\frac{1}{2} - \{\alpha k\}\right)$$ +where $\{\cdot\}$ denotes the fractional part. + +Does $f(\alpha, n)$ have an asymptotic distribution function? In other words, is there +a non-decreasing function $g$ such that $g(-\infty) = 0$, $g(\infty) = 1$, and +$$\lim_{n \to \infty} |\{\alpha \in (0,1) : f(\alpha,n) \le c\}| = g(c)$$ +where $|\cdot|$ denotes Lebesgue measure? + +Kesten [Ke60] proved the analogous result with an additional shift $\beta$: +if $f(\alpha, \beta, n) = \frac{1}{\log n} \sum_{k=1}^n \left(\frac{1}{2} - \{\beta + \alpha k\}\right)$, +then $f(\alpha, \beta, n)$ has asymptotic distribution function +$g(c) = \frac{1}{\pi} \int_{-\infty}^{\rho c} \frac{1}{1+t^2} \, dt$ +where $\rho > 0$ is an explicit constant. +-/ + +open Finset Filter MeasureTheory + +namespace Erdos1002 + +/-- The function $f(\alpha, n) = \frac{1}{\log n} \sum_{k=1}^{n} \left(\frac{1}{2} - \{\alpha k\}\right)$, +where $\{\cdot\}$ denotes the fractional part. -/ +noncomputable def erdosF (α : ℝ) (n : ℕ) : ℝ := + (∑ k ∈ Finset.Icc 1 n, ((1 : ℝ) / 2 - Int.fract (α * ↑k))) / Real.log ↑n + +/-- +Erdős Problem 1002 [Er64b]: + +Does the function $f(\alpha, n) = \frac{1}{\log n} \sum_{k=1}^n \left(\frac{1}{2} - \{\alpha k\}\right)$ +have an asymptotic distribution function? That is, is there a non-decreasing function +$g : \mathbb{R} \to \mathbb{R}$ with $g(-\infty) = 0$ and $g(\infty) = 1$ such that for every +$c \in \mathbb{R}$, +$$\lim_{n \to \infty} \mu(\{\alpha \in (0,1) : f(\alpha,n) \le c\}) = g(c)$$ +where $\mu$ is Lebesgue measure. +-/ +@[category research open, AMS 11 28] +theorem erdos_1002 : answer(sorry) ↔ + ∃ g : ℝ → ℝ, Monotone g ∧ + Filter.Tendsto g Filter.atBot (nhds 0) ∧ + Filter.Tendsto g Filter.atTop (nhds 1) ∧ + ∀ c : ℝ, Filter.Tendsto + (fun n : ℕ => + (volume (Set.Ioo (0 : ℝ) 1 ∩ {α : ℝ | erdosF α n ≤ c})).toReal) + Filter.atTop (nhds (g c)) := by + sorry + +end Erdos1002 diff --git a/FormalConjectures/ErdosProblems/1005.lean b/FormalConjectures/ErdosProblems/1005.lean new file mode 100644 index 0000000000..61e7218b1d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1005.lean @@ -0,0 +1,80 @@ +/- +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 1005 + +*Reference:* [erdosproblems.com/1005](https://www.erdosproblems.com/1005) + +Let $a_1/b_1, a_2/b_2, \ldots$ be the Farey fractions of order $n \geq 4$. Let $f(n)$ be +the largest integer such that for all pairs of indices $k < l$ with $l \leq k + f(n)$, +the fractions $a_k/b_k$ and $a_l/b_l$ are "similarly ordered": +$(a_k - a_l)(b_k - b_l) \geq 0$. + +[Er43] Erdős, P., *A note on Farey series*. +Quarterly Journal of Mathematics, Oxford Series (1943), 82–85. + +[Ma42] Mayer, A. E., *A mean value theorem concerning Farey series*. +Quarterly Journal of Mathematics, Oxford Series (1942), 48–57. + +[vD25b] van Doorn, W., *Improved bounds for the Mayer-Erdős phenomenon on similarly ordered +Farey fractions*. arXiv:2509.00121 (2025). + +OEIS sequence: A386893. +-/ + +open Filter Finset + +namespace Erdos1005 + +/-- The Farey fractions of order $n$: all reduced fractions $a/b \in [0,1]$ with +$b \leq n$, as a sorted list of rationals. -/ +def fareyFractions (n : ℕ) : List ℚ := + ((Finset.Icc 1 n).biUnion fun b => + ((Finset.range (b + 1)).filter fun a => Nat.Coprime a b).image + fun (a : ℕ) => (a : ℚ) / (b : ℚ)).sort (· ≤ ·) + +/-- Two Farey fractions $p = a_1/b_1$ and $q = a_2/b_2$ (in lowest terms) are +similarly ordered if $(a_1 - a_2)(b_1 - b_2) \geq 0$. -/ +def similarlyOrdered (p q : ℚ) : Prop := + (p.num - q.num) * ((p.den : ℤ) - q.den) ≥ 0 + +/-- $f(n)$: the largest $d$ such that for all pairs of indices $i < j$ with $j \leq i + d$ +in the Farey sequence of order $n$, the fractions are similarly ordered. -/ +noncomputable def fareySimOrderFn (n : ℕ) : ℕ := + sSup {d : ℕ | ∀ i j : ℕ, i < j → j ≤ i + d → + ∀ (hi : i < (fareyFractions n).length) (hj : j < (fareyFractions n).length), + similarlyOrdered ((fareyFractions n).get ⟨i, hi⟩) ((fareyFractions n).get ⟨j, hj⟩)} + +/-- +Erdős Problem 1005 [Er43]: + +There exists a constant $c > 0$ such that $f(n)/n \to c$ as $n \to \infty$, where $f(n)$ is +the largest window size for similarly ordered consecutive Farey fractions of +order $n$. + +van Doorn [vD25b] proved $(1/12 - o(1))n \leq f(n) \leq n/4 + O(1)$ and conjectures +$c = 1/4$. +-/ +@[category research open, AMS 11] +theorem erdos_1005 : + ∃ c : ℝ, c > 0 ∧ + Tendsto (fun n : ℕ => (fareySimOrderFn n : ℝ) / (n : ℝ)) atTop (nhds c) := by + sorry + +end Erdos1005 diff --git a/FormalConjectures/ErdosProblems/1006.lean b/FormalConjectures/ErdosProblems/1006.lean new file mode 100644 index 0000000000..9031f70204 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1006.lean @@ -0,0 +1,100 @@ +/- +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 1006 + +*Reference:* [erdosproblems.com/1006](https://www.erdosproblems.com/1006) + +Let $G$ be a graph with girth $> 4$. Can the edges of $G$ always be oriented so that the +resulting directed graph is acyclic, and reversing any single edge also leaves it acyclic? +Originally due to Ore (cited in [Er71]). Ore gave a counterexample with girth 4; +Gallai observed the Grötzsch graph also fails. Disproved by Nešetřil and Rödl [NeRo78b]. + +[Er71] Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969), pp. 97–109, 1971. + +[Er76b] Erdős, P., *Problems in combinatorial and graph theory* (1976). + +[NeRo78b] Nešetřil, J. and Rödl, V., *On a probabilistic graph-theoretical method*. +Proceedings of the American Mathematical Society, pp. 417–421, 1978. +-/ + +open SimpleGraph + +namespace Erdos1006 + +variable {V : Type*} + +/-- An orientation of a simple graph $G$: a relation `dir` on $V$ such that for each +edge $\{u, v\}$, exactly one of `dir u v` or `dir v u` holds, and `dir` only +relates adjacent vertices. -/ +structure Orientation (G : SimpleGraph V) where + dir : V → V → Prop + adj_of_dir : ∀ u v, dir u v → G.Adj u v + dir_of_adj : ∀ u v, G.Adj u v → dir u v ∨ dir v u + antisymm : ∀ u v, dir u v → ¬dir v u + +/-- An orientation is acyclic if the transitive closure of its direction relation +is irreflexive (equivalently, there are no directed cycles). -/ +def Orientation.IsAcyclic {G : SimpleGraph V} (o : Orientation G) : Prop := + ∀ v, ¬Relation.TransGen o.dir v v + +/-- The relation obtained by flipping one directed edge $(a \to b)$ to $(b \to a)$, +keeping all other directed edges the same. -/ +def flipDir (dir : V → V → Prop) (a b : V) : V → V → Prop := + fun u v => (u = b ∧ v = a ∧ dir a b) ∨ (dir u v ∧ ¬(u = a ∧ v = b)) + +/-- An orientation is robustly acyclic if it is acyclic and reversing any +single directed edge also yields an acyclic relation. -/ +def Orientation.IsRobustlyAcyclic {G : SimpleGraph V} (o : Orientation G) : Prop := + o.IsAcyclic ∧ + ∀ a b, o.dir a b → + ∀ v, ¬Relation.TransGen (flipDir o.dir a b) v v + +/-- +Erdős Problem 1006 (disproved) [Er71][Er76b]: + +Let $G$ be a graph with girth $> 4$ (i.e., $G$ contains no cycles of length $3$ or $4$). +Can the edges of $G$ always be directed such that there is no directed cycle, and +reversing the direction of any edge also creates no directed cycle? + +This was disproved by Nešetřil and Rödl [NeRo78b], who proved that for every +integer $g$, there is a graph $G$ with girth $g$ such that every orientation of $G$ either +contains a directed cycle or contains a cycle obtained by reversing one edge. +-/ +@[category research solved, AMS 5] +theorem erdos_1006 : answer(False) ↔ + ∀ (V : Type*) (G : SimpleGraph V), 5 ≤ G.egirth → + ∃ o : Orientation G, o.IsRobustlyAcyclic := by + sorry + +/-- +Variant of Erdős Problem 1006 (Nešetřil–Rödl [NeRo78b]): + +For every integer $g$, there exists a graph $G$ with girth $\ge g$ such that no orientation of +$G$ is robustly acyclic. This strengthens the original problem by showing that high girth alone +never suffices. +-/ +@[category research solved, AMS 5] +theorem erdos_1006_arbitrary_girth : answer(False) ↔ + ∀ (g : ℕ) (V : Type*) (G : SimpleGraph V), g ≤ G.egirth → + ∃ o : Orientation G, o.IsRobustlyAcyclic := by + sorry + +end Erdos1006 diff --git a/FormalConjectures/ErdosProblems/1007.lean b/FormalConjectures/ErdosProblems/1007.lean new file mode 100644 index 0000000000..974b2ac3c2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1007.lean @@ -0,0 +1,108 @@ +/- +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 1007 + +*Reference:* [erdosproblems.com/1007](https://www.erdosproblems.com/1007) + +The dimension of a graph $G$ is the minimal $n$ such that $G$ can be embedded in +$\mathbb{R}^n$ such that every edge of $G$ is a unit line segment (adjacent vertices are at +Euclidean distance exactly $1$, and non-adjacent vertices are not). This notion +was defined by Erdős, Harary, and Tutte. The problem was posed by Erdős to +Soifer in January 1992. + +[So09e] Soifer, A., *The Mathematical Coloring Book*, Springer, 2009. + +[Ho13] House, R. F., *A 4-dimensional graph has at least 9 edges*. +Discrete Mathematics **313** (2013), 1783–1789. + +[ChNo16] Chaffee, J. and Noble, M., *Dimension 4 and dimension 5 graphs with +minimum edge set*. Australasian Journal of Combinatorics **64** (2016), 327–333. +-/ + +open SimpleGraph + +namespace Erdos1007 + +/-- A unit-distance representation of a simple graph $G$ in $\mathbb{R}^n$: an injective map +from vertices to Euclidean $n$-space such that adjacency is equivalent to +distance exactly $1$. Injectivity is needed to prevent collapsing distinct +non-adjacent vertices to the same point (the adjacency biconditional alone does +not rule this out). -/ +def IsUnitDistRep {V : Type*} (G : SimpleGraph V) (n : ℕ) + (f : V → EuclideanSpace ℝ (Fin n)) : Prop := + Function.Injective f ∧ + ∀ u v, G.Adj u v ↔ dist (f u) (f v) = 1 + +/-- A graph admits a unit-distance representation in $\mathbb{R}^n$. -/ +def HasUnitDistRep {V : Type*} (G : SimpleGraph V) (n : ℕ) : Prop := + ∃ f : V → EuclideanSpace ℝ (Fin n), IsUnitDistRep G n f + +/-- +Erdős Problem 1007 [So09e]: + +The smallest number of edges in a graph of dimension exactly $4$ is $9$, where the +dimension of a graph is the minimal $n$ for a unit-distance representation in $\mathbb{R}^n$. + +This is achieved uniquely by $K_{3,3}$. Proved by House [Ho13], with an alternative +proof by Chaffee and Noble [ChNo16]. +-/ +@[category research solved, AMS 5 51] +theorem erdos_1007 : + -- There exists a graph of dimension exactly 4 with 9 edges + (∃ (V : Type) (_ : Fintype V) (_ : DecidableEq V) (G : SimpleGraph V) + (_ : DecidableRel G.Adj), + HasUnitDistRep G 4 ∧ ¬HasUnitDistRep G 3 ∧ G.edgeFinset.card = 9) ∧ + -- Every graph of dimension exactly 4 has at least 9 edges + (∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) + [DecidableRel G.Adj], + HasUnitDistRep G 4 → ¬HasUnitDistRep G 3 → 9 ≤ G.edgeFinset.card) := by + sorry + +/-- +Uniqueness variant of Erdős Problem 1007 [Ho13]: + +Any graph of dimension exactly $4$ with exactly $9$ edges is isomorphic to $K_{3,3}$. +-/ +@[category research solved, AMS 5 51] +theorem erdos_1007_unique (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (h4 : HasUnitDistRep G 4) (h3 : ¬HasUnitDistRep G 3) + (hedge : G.edgeFinset.card = 9) : + Nonempty (G ≃g completeBipartiteGraph (Fin 3) (Fin 3)) := by + sorry + +/-- +Dimension-5 analogue of Erdős Problem 1007 [ChNo16]: + +The smallest number of edges in a graph of dimension exactly $5$ is $15$. +-/ +@[category research solved, AMS 5 51] +theorem erdos_1007_dim5 : + -- There exists a graph of dimension exactly 5 with 15 edges + (∃ (V : Type) (_ : Fintype V) (_ : DecidableEq V) (G : SimpleGraph V) + (_ : DecidableRel G.Adj), + HasUnitDistRep G 5 ∧ ¬HasUnitDistRep G 4 ∧ G.edgeFinset.card = 15) ∧ + -- Every graph of dimension exactly 5 has at least 15 edges + (∀ (V : Type) [Fintype V] [DecidableEq V] (G : SimpleGraph V) + [DecidableRel G.Adj], + HasUnitDistRep G 5 → ¬HasUnitDistRep G 4 → 15 ≤ G.edgeFinset.card) := by + sorry + +end Erdos1007 diff --git a/FormalConjectures/ErdosProblems/1008.lean b/FormalConjectures/ErdosProblems/1008.lean new file mode 100644 index 0000000000..31eba340ef --- /dev/null +++ b/FormalConjectures/ErdosProblems/1008.lean @@ -0,0 +1,71 @@ +/- +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 1008 + +*Reference:* [erdosproblems.com/1008](https://www.erdosproblems.com/1008) + +[CFS14b] Conlon, D., Fox, J., and Sudakov, B., _Large subgraphs without complete bipartite +graphs_. arXiv:1401.6711 (2014). + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proceedings of Conference, Oxford, 1969) +(1971), 97-109. + +Additional thanks to Zach Hunter (simple proof in comments) and Boris Alexeev. +-/ + +open SimpleGraph Classical + +namespace Erdos1008 + +/-- A simple graph contains a 4-cycle ($C_4$) if there exist four vertices + $a, b, c, d$ forming the cycle $a$-$b$-$c$-$d$-$a$. Only two distinctness + conditions ($a \ne c$ and $b \ne d$) are needed; the other four follow from + irreflexivity of `SimpleGraph.Adj`. -/ +def ContainsCycleFour {V : Type*} (G : SimpleGraph V) : Prop := + ∃ a b c d : V, a ≠ c ∧ b ≠ d ∧ + G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a + +/-- A simple graph is $C_4$-free if it contains no 4-cycle as a subgraph. -/ +def CycleFourFree {V : Type*} (G : SimpleGraph V) : Prop := + ¬ContainsCycleFour G + +/-- +Erdős Problem 1008 (Proved by Conlon, Fox, and Sudakov [CFS14b]): +There exists an absolute constant $c > 0$ such that every graph with $m$ edges +contains a $C_4$-free subgraph with at least $c \cdot m^{2/3}$ edges. + +Originally asked by Bollobás and Erdős with $m^{3/4}$ in place of $m^{2/3}$, +but Folkman showed the $m^{3/4}$ version is false (counterexample: $K_{n,n^2}$). +Erdős [Er71] revised the conjecture to $m^{2/3}$, noting $\gg m^{1/2}$ is trivial. +Erdős also noted in a footnote that Szemerédi proved this conjecture, but gave +no reference. +-/ +@[category research solved, AMS 5] +theorem erdos_1008 : + ∃ c : ℝ, c > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + ∃ H : SimpleGraph (Fin n), + H ≤ G ∧ + CycleFourFree H ∧ + c * (G.edgeFinset.card : ℝ) ^ ((2 : ℝ) / 3) ≤ (H.edgeFinset.card : ℝ) := by + sorry + +end Erdos1008 diff --git a/FormalConjectures/ErdosProblems/1009.lean b/FormalConjectures/ErdosProblems/1009.lean new file mode 100644 index 0000000000..fe56938c59 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1009.lean @@ -0,0 +1,68 @@ +/- +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 1009 + +*Reference:* [erdosproblems.com/1009](https://www.erdosproblems.com/1009) + +Is it true that, for every $c > 0$, there exists $f(c)$ such that every graph on $n$ +vertices with at least $\lfloor n^2/4 \rfloor + k$ edges, where $k < cn$, contains at least +$k - f(c)$ many edge-disjoint triangles? + +Erdős proved this for $c < 1/2$. Sauer showed $f(2) \geq 1$. This was proved in +general by Győri [Gy88] who showed $f(c) \ll c^2$, and also that $f(c) = 0$ if +$c < 2$ for odd $n$ or $c < 3/2$ for even $n$. + +[Er71] Erdős, P., _Some problems in graph theory_, 1971. + +[Gy88] Győri, E., _On the number of edge-disjoint triangles in graphs of given size_, +Combinatorica, 1988. +-/ + +open SimpleGraph Classical + +namespace Erdos1009 + +/-- A graph `G` on `n` vertices contains a collection of `t` edge-disjoint triangles. -/ +def HasEdgeDisjointTriangles {n : ℕ} (G : SimpleGraph (Fin n)) (t : ℕ) : Prop := + ∃ (tri : Fin t → Fin 3 → Fin n), + (∀ i, Function.Injective (tri i)) ∧ + (∀ i (j k : Fin 3), j ≠ k → G.Adj (tri i j) (tri i k)) ∧ + (∀ i₁ i₂, i₁ ≠ i₂ → + ∀ (j₁ k₁ : Fin 3), j₁ ≠ k₁ → + ∀ (j₂ k₂ : Fin 3), j₂ ≠ k₂ → + ¬((tri i₁ j₁ = tri i₂ j₂ ∧ tri i₁ k₁ = tri i₂ k₂) ∨ + (tri i₁ j₁ = tri i₂ k₂ ∧ tri i₁ k₁ = tri i₂ j₂))) + +/-- +Erdős Problem 1009 [Er71, p.98]: + +For every $c > 0$, there exists $f(c)$ such that every graph on $n$ vertices with at +least $\lfloor n^2/4 \rfloor + k$ edges, where $k < cn$, contains at least $k - f(c)$ +many edge-disjoint triangles. Proved by Győri [Gy88]. +-/ +@[category research solved, AMS 5] +theorem erdos_1009 : answer(True) ↔ + ∀ c : ℝ, c > 0 → + ∃ f : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + ∀ k : ℕ, (k : ℝ) < c * (n : ℝ) → + G.edgeFinset.card ≥ n ^ 2 / 4 + k → + HasEdgeDisjointTriangles G (k - f) := by sorry + +end Erdos1009 diff --git a/FormalConjectures/ErdosProblems/101.lean b/FormalConjectures/ErdosProblems/101.lean new file mode 100644 index 0000000000..1c2320ab41 --- /dev/null +++ b/FormalConjectures/ErdosProblems/101.lean @@ -0,0 +1,110 @@ +/- +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 101 + +*Reference:* [erdosproblems.com/101](https://www.erdosproblems.com/101) + +Given $n$ points in $\mathbb{R}^2$ with no five collinear, the number of lines containing at +least four of the points is $o(n^2)$. This carries a \$100 prize. + +Under the no-five-collinear hypothesis, "at least four" and "exactly four" are equivalent, +since no line can contain five or more points. + +Grünbaum [Gr76] constructed examples with $\gg n^{3/2}$ four-rich lines (no five collinear), +leading Erdős to initially guess $n^{3/2}$ as the correct order. Solymosi and Stojaković +[SoSt13] constructed point sets with no five collinear and $\geq n^{2 - O(1/\sqrt{\log n})}$ +lines containing exactly four points, disproving Erdős's guess and showing the bound is +essentially tight. + +This is a special case of Problem #588 (with $k = 4$). See also Problem #102 and Problem #669. + +OEIS: [A006065](https://oeis.org/A006065). + +[BGS74] Burr, S. A., Grünbaum, B., and Sloane, N. J. A., _The orchard problem_. +Geometriae Dedicata (1974), 397–424. + +[FuPa84] Füredi, Z. and Palásti, I., _Arrangements of lines with a large number of +triangles_. Proc. Amer. Math. Soc. (1984), 561–566. + +[Gr76] Grünbaum, B., _New views on some old questions of combinatorial geometry_. +Colloquio Internazionale sulle Teorie Combinatorie (Roma, 1973), Tomo I (1976), 451–468. + +[SoSt13] Solymosi, J. and Stojaković, M., _Many collinear k-tuples with no k+1 collinear +points_. Discrete Comput. Geom. (2013), 811–820. + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985), 167–177. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44–48. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium 107 (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. +-/ + +namespace Erdos101 + +/-- +A finite point set in $\mathbb{R}^2$ has no five collinear points if every five-element subset +is not collinear (i.e., no line contains five or more of the points). +-/ +def NoFiveCollinear (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = 5 → ¬Collinear ℝ (S : Set (EuclideanSpace ℝ (Fin 2))) + +/-- +The number of $4$-rich lines: the number of distinct affine lines in $\mathbb{R}^2$ that +contain at least four points from $P$. + +An affine line is a $1$-dimensional affine subspace (`Module.finrank` of its +direction submodule equals $1$). +-/ +noncomputable def fourRichLineCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + 4 ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} + +/-- +Erdős Problem #101: Given $n$ points in $\mathbb{R}^2$, no five of which are collinear, +the number of lines containing at least four of the points is $o(n^2)$. + +Formally: for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$ and every +set $P$ of $n$ points in $\mathbb{R}^2$ with no five collinear, the count of $4$-rich lines +is at most $\varepsilon \cdot n^2$. +-/ +@[category research open, AMS 5 52] +theorem erdos_101 : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + NoFiveCollinear P → + (fourRichLineCount P : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +end Erdos101 diff --git a/FormalConjectures/ErdosProblems/1010.lean b/FormalConjectures/ErdosProblems/1010.lean new file mode 100644 index 0000000000..e78ffb2d61 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1010.lean @@ -0,0 +1,57 @@ +/- +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 1010 + +*Reference:* [erdosproblems.com/1010](https://www.erdosproblems.com/1010) + +Rademacher proved that every graph on $n$ vertices with $\lfloor n^2/4 \rfloor + 1$ +edges contains at least $\lfloor n/2 \rfloor$ triangles. Erdős [Er62d] proved this +for $t < cn$ for some constant $c > 0$. + +This was proved independently by Lovász and Simonovits [LoSi76] and Nikiforov and +Khadzhiivanov [NiKh81]. +-/ + +open SimpleGraph + +namespace Erdos1010 + +/-- The number of triangles (3-cliques) in a simple graph on `Fin n`. -/ +noncomputable def triangleCount {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + Nat.card {s : Finset (Fin n) // G.IsNClique 3 s} + +/-- +Erdős Problem 1010 [Er62d]: + +Let $t < \lfloor n/2 \rfloor$. Every graph on $n$ vertices with +$\lfloor n^2/4 \rfloor + t$ edges contains at least $t \cdot \lfloor n/2 \rfloor$ +triangles. + +Proved independently by Lovász–Simonovits [LoSi76] and +Nikiforov–Khadzhiivanov [NiKh81]. +-/ +@[category research solved, AMS 5] +theorem erdos_1010 (n : ℕ) (t : ℕ) (ht : t < n / 2) + (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (hedge : G.edgeFinset.card ≥ n ^ 2 / 4 + t) : + triangleCount G ≥ t * (n / 2) := by + sorry + +end Erdos1010 diff --git a/FormalConjectures/ErdosProblems/1011.lean b/FormalConjectures/ErdosProblems/1011.lean new file mode 100644 index 0000000000..f4d1378ce0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1011.lean @@ -0,0 +1,80 @@ +/- +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 1011 + +*Reference:* [erdosproblems.com/1011](https://www.erdosproblems.com/1011) + +Let $f_r(n)$ be minimal such that every graph on $n$ vertices with $\geq f_r(n)$ +edges and chromatic number $\geq r$ contains a triangle. Determine $f_r(n)$. + +Turán's theorem implies $f_2(n) = \lfloor n^2/4 \rfloor + 1$. +Erdős and Gallai [Er62d] proved $f_3(n) = \lfloor (n-1)^2/4 \rfloor + 2$. +Ren, Wang, Wang, and Yang [RWWY24] proved $f_4(n) = \lfloor (n-3)^2/4 \rfloor + 6$ +for $n \geq 150$. + +Simonovits [Si74] showed $f_r(n) = n^2/4 - g(r)/2 \cdot n + O(1)$, where $g(r)$ is +the largest $m$ such that any triangle-free graph with chromatic number $\geq r$ +requires removing at least $m$ vertices to become bipartite. + +The best known bounds on $g(r)$ are +$(1/2 - o(1)) r^2 \log r \leq g(r) \leq (2 + o(1)) r^2 \log r$. +The lower bound follows from Davies–Illingworth [DaIl22], and the upper bound from +Hefty–Horn–King–Pfender [HHKP25]. + +[Er62d] Erdős, P., _On a theorem of Rademacher-Turán_. Illinois J. Math. **6** (1962), 122–127. +[Si74] Simonovits, M., _Extremal graph problems with symmetrical extremal graphs. +Additional chromatic conditions_. Discrete Math. **7** (1974), 349–376. +[DaIl22] Davies, E., Illingworth, F., _The χ-Ramsey problem for triangle-free graphs_. +SIAM J. Discrete Math. (2022), 1124–1134. +[HHKP25] Hefty, L., Horn, P., King, R. and Pfender, F., _Improving R(3,k) in +just two bites_. arXiv:2510.19718 (2025). +[RWWY24] Ren, S., Wang, J., Wang, S. and Yang, W., _Extremal triangle-free graphs +with chromatic number at least four_. arXiv:2404.07486 (2024). +-/ + +open SimpleGraph Filter + +namespace Erdos1011 + +/-- $f_r(n)$ is the minimum number of edges $m$ such that every graph on $n$ vertices +with at least $m$ edges and chromatic number $\geq r$ contains a triangle ($3$-clique). -/ +noncomputable def minTriangleEdges (r n : ℕ) : ℕ := + sInf {m : ℕ | ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard ≥ m → (r : ℕ∞) ≤ G.chromaticNumber → ¬G.CliqueFree 3} + +/-- +**Erdős Problem 1011** [Si74] — Simonovits asymptotic (solved): + +For every $r \geq 2$ there exist $g_r \in \mathbb{R}$ and $C \geq 0$ such that, for all +sufficiently large $n$, +$$|f_r(n) - (n^2 / 4 - g_r / 2 \cdot n)| \leq C.$$ + +This formalizes the solved Simonovits asymptotic, not the full open problem of +determining $g_r$ precisely; the best known bounds give $g_r \asymp r^2 \log r$. +-/ +@[category research solved, AMS 5] +theorem erdos_1011 : + ∀ r : ℕ, r ≥ 2 → + ∃ (g_r : ℝ) (C : ℝ), 0 ≤ C ∧ + ∀ᶠ n in atTop, + |(minTriangleEdges r n : ℝ) - ((n : ℝ) ^ 2 / 4 - g_r / 2 * (n : ℝ))| ≤ C := by + sorry + +end Erdos1011 diff --git a/FormalConjectures/ErdosProblems/1012.lean b/FormalConjectures/ErdosProblems/1012.lean new file mode 100644 index 0000000000..e87281171d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1012.lean @@ -0,0 +1,75 @@ +/- +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 1012 + +*Reference:* [erdosproblems.com/1012](https://www.erdosproblems.com/1012) + +Let $k \geq 0$. Let $f(k)$ be the least integer such that every graph on $n \geq f(k)$ +vertices with at least $\binom{n-k-1}{2} + \binom{k+2}{2} + 1$ edges contains a cycle +of length $n-k$. Determine or estimate $f(k)$. + +Erdős [Er62e] proved that $f(k)$ exists for all $k \geq 0$ (see also [Er71, p.98]). +Ore [Or61] proved $f(0) = 1$ (every graph on $n \geq 1$ vertices with at least +$\binom{n-1}{2} + 2$ edges contains a Hamiltonian cycle). +Bondy [Bo71b] proved $f(1) = 1$. + +Woodall [Wo72] proved that every graph on $n \geq 2k+3$ vertices with at least +$\binom{n-k-1}{2} + \binom{k+2}{2} + 1$ edges contains a cycle of length $\ell$ for all +$3 \leq \ell \leq n-k$. This settles the question completely with $f(k) = 2k + 3$. + +[Er62e] Erdős, P., _Remarks on a paper of Pósa_. Magyar Tudományos Akadémia Matematikai +Kutató Intézet Közleményei (1962), 227–229. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proceedings of Conference, Oxford, 1969) +(1971), 97–109. + +[Or61] Ore, O., _Arc coverings of graphs_. Annali di Matematica Pura ed Applicata, 4th +series (1961), 315–321. + +[Bo71b] Bondy, J. A., _Large cycles in graphs_. Discrete Mathematics (1971/72), 121–132. + +[Wo72] Woodall, D. R., _Sufficient conditions for circuits in graphs_. Proceedings of the +London Mathematical Society, 3rd series (1972), 739–755. +-/ + +open SimpleGraph + +namespace Erdos1012 + +/-- +Erdős Problem 1012 [Er62e] (solved by Woodall [Wo72]): + +For every $k \geq 0$ and $n \geq 2k + 3$, every simple graph on $n$ vertices with at least +$\binom{n-k-1}{2} + \binom{k+2}{2} + 1$ edges contains a cycle of length $\ell$ for every +$3 \leq \ell \leq n - k$. + +In particular, taking $\ell = n - k$, this answers Erdős' original question with +$f(k) = 2k + 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_1012 (k n : ℕ) (hn : n ≥ 2 * k + 3) + (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (hedge : G.edgeFinset.card ≥ Nat.choose (n - k - 1) 2 + Nat.choose (k + 2) 2 + 1) + (l : ℕ) (hl₁ : 3 ≤ l) (hl₂ : l ≤ n - k) : + ∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = l := by + sorry + +end Erdos1012 diff --git a/FormalConjectures/ErdosProblems/1013.lean b/FormalConjectures/ErdosProblems/1013.lean new file mode 100644 index 0000000000..b392b0c055 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1013.lean @@ -0,0 +1,67 @@ +/- +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 1013 + +Is it true that the ratio $h_3(k+1)/h_3(k)$ tends to 1, where $h_3(k)$ is the minimum number of +vertices of a triangle-free graph with chromatic number $k$? + +Related problems: #920 (generalization to $K_r$-free graphs), #1104 (dual formulation). + +OEIS: [A292528](https://oeis.org/A292528). + +*Reference:* [erdosproblems.com/1013](https://www.erdosproblems.com/1013) + +[Er71] Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*. + +[GrYa68] Graver, J., Yackel, J., _Some graph theoretic results associated with Ramsey's theorem_. +Journal of Combinatorial Theory (1968), 125–175. +-/ + +open SimpleGraph + +namespace Erdos1013 + +/-- $h_3(k)$ is the minimum number of vertices $n$ such that there exists a +triangle-free graph on $n$ vertices with chromatic number exactly $k$. -/ +noncomputable def h3 (k : ℕ) : ℕ := + sInf {n : ℕ | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.chromaticNumber = (k : ℕ∞)} + +/-- +Erdős Problem 1013 [Er71]: + +$$\lim_{k \to \infty} \frac{h_3(k+1)}{h_3(k)} = 1,$$ + +where $h_3(k)$ is the minimum number of vertices of a triangle-free graph with +chromatic number $k$. + +Formulated as: for every $\varepsilon > 0$, there exists $K_0$ such that for all $k \geq K_0$, +$\left| \frac{h_3(k+1)}{h_3(k)} - 1 \right| \leq \varepsilon$. + +Note: this would follow from the known asymptotic bounds +$(1/2 - o(1))k^2 \log k \leq h_3(k) \leq (1 + o(1))k^2 \log k$ (see Problem 1104). +-/ +@[category research open, AMS 5] +theorem erdos_1013 : + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + |(h3 (k + 1) : ℝ) / (h3 k : ℝ) - 1| ≤ ε := by + sorry + +end Erdos1013 diff --git a/FormalConjectures/ErdosProblems/1014.lean b/FormalConjectures/ErdosProblems/1014.lean new file mode 100644 index 0000000000..1168dd7c62 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1014.lean @@ -0,0 +1,59 @@ +/- +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 1014 + +Erdős conjectured that for fixed $k \geq 3$, the ratio of consecutive Ramsey numbers +$R(k, l+1) / R(k, l)$ tends to $1$ as $l \to \infty$. + +See also problems [544] and [1030]. + +*Reference:* [erdosproblems.com/1014](https://www.erdosproblems.com/1014) + +[Er71] Erdős, P., _Topics in combinatorial analysis_, pp. 95-99, 1971. +-/ + +open SimpleGraph + +namespace Erdos1014 + +/-- The Ramsey number $R(k, l)$: the minimum $N$ such that every simple graph on $N$ +vertices contains either a $k$-clique or an independent set of size $l$ +(equivalently, an $l$-clique in the complement). -/ +noncomputable def ramseyR (k l : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree l} + +/-- +Erdős Problem 1014 [Er71, p.99]: + +For fixed $k \geq 3$, +$$\lim_{l \to \infty} R(k, l+1) / R(k, l) = 1,$$ +where $R(k, l)$ is the Ramsey number. + +Formulated as: for every $\varepsilon > 0$, there exists $L_0$ such that for all $l \geq L_0$, +$|R(k, l+1) / R(k, l) - 1| \leq \varepsilon$. +-/ +@[category research open, AMS 5] +theorem erdos_1014 (k : ℕ) (hk : k ≥ 3) : + ∀ ε : ℝ, ε > 0 → + ∃ L₀ : ℕ, ∀ l : ℕ, l ≥ L₀ → + |(ramseyR k (l + 1) : ℝ) / (ramseyR k l : ℝ) - 1| ≤ ε := by + sorry + +end Erdos1014 diff --git a/FormalConjectures/ErdosProblems/1015.lean b/FormalConjectures/ErdosProblems/1015.lean new file mode 100644 index 0000000000..274873a85a --- /dev/null +++ b/FormalConjectures/ErdosProblems/1015.lean @@ -0,0 +1,108 @@ +/- +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 1015 + +*Reference:* [erdosproblems.com/1015](https://www.erdosproblems.com/1015) + +Let $f(t, n)$ be minimal such that, in any two-colouring of the edges of $K_n$, +the vertices can be covered by vertex-disjoint monochromatic copies of $K_t$ +(not necessarily the same colour) with at most $f(t, n)$ vertices remaining. + +A question of Moon [Mo66b], who proved that $f(3, n) = 4$ for $n \geq 8$. +Erdős notes that $f(t) \ll 4^t$, by comparing to the Ramsey number $R(t)$. + +Burr, Erdős, and Spencer [BES75] proved that, for $n$ sufficiently large +depending on $t$, +$$ +f(t, n) = R(t, t-1) + x(t, n), +$$ +where $0 \leq x(t, n) < t$ is such that $n + 1 \equiv R(t, t-1) + x \pmod{t}$. + +[Er71] Erdős, P., _Topics in combinatorial analysis_, pp. 95-99, 1971. + +[Mo66b] Moon, J.W., _Disjoint triangles in chromatic graphs_. Math. Mag. (1966), 259-261. + +[BES75] Burr, S.A., Erdős, P., Spencer, J.H., _Ramsey theorems for multiple copies of graphs_. +Trans. Amer. Math. Soc. (1975), 87-99. +-/ + +open Finset + +namespace Erdos1015 + +/-- A set $S$ of vertices in `Fin n` is a monochromatic clique of colour $b$ +under the edge-colouring $c$ if every pair of distinct vertices in $S$ +has colour $b$. -/ +def IsMonoClique (n : ℕ) (c : Fin n → Fin n → Bool) (S : Finset (Fin n)) + (b : Bool) : Prop := + ∀ i ∈ S, ∀ j ∈ S, i ≠ j → c i j = b + +/-- The minimum number of leftover vertices $f(t, n)$: the smallest $r$ such +that for every symmetric 2-colouring of the edges of $K_n$, one can find +pairwise disjoint monochromatic $K_t$'s covering all but at most $r$ +vertices. -/ +noncomputable def minLeftover (t n : ℕ) : ℕ := + -- The infimum over r of: for every symmetric 2-colouring, one can cover + -- all but at most r vertices by pairwise disjoint monochromatic K_t's. + sInf {r : ℕ | ∀ (c : Fin n → Fin n → Bool), (∀ i j, c i j = c j i) → + ∃ (cliques : Finset (Finset (Fin n))), + (∀ S ∈ cliques, S.card = t) ∧ + (∀ S ∈ cliques, ∃ b : Bool, IsMonoClique n c S b) ∧ + (∀ S₁ ∈ cliques, ∀ S₂ ∈ cliques, S₁ ≠ S₂ → Disjoint S₁ S₂) ∧ + (Finset.univ \ cliques.biUnion id).card ≤ r} + +/-- The 2-colour Ramsey number $R(s, t)$: the minimum $N$ such that every +symmetric 2-colouring of the edges of $K_N$ contains a monochromatic +clique of size $s$ in one colour or of size $t$ in the other. -/ +noncomputable def ramseyNumber₂ (s t : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Bool), (∀ i j, c i j = c j i) → + (∃ S : Finset (Fin N), S.card = s ∧ IsMonoClique N c S false) ∨ + (∃ S : Finset (Fin N), S.card = t ∧ IsMonoClique N c S true)} + +/-- +Erdős Problem 1015 [Er71]: + +For all $t \geq 3$, for $n$ sufficiently large depending on $t$, the minimum number +of leftover vertices when partitioning any 2-colouring of $K_n$ into +vertex-disjoint monochromatic $K_t$'s is exactly +$$ +f(t, n) = R(t, t-1) + x, +$$ +where $x \in \{0, \ldots, t-1\}$ satisfies $n + 1 \equiv R(t, t-1) + x \pmod{t}$. + +Proved by Burr, Erdős, and Spencer [BES75]. +-/ +@[category research solved, AMS 5] +theorem erdos_1015 (t : ℕ) (ht : t ≥ 3) : + ∃ N₀ : ℕ, ∀ n ≥ N₀, + minLeftover t n = + ramseyNumber₂ t (t - 1) + (n + 1 - ramseyNumber₂ t (t - 1)) % t := by + sorry + +/-- +Moon's result [Mo66b]: for $n \geq 8$, the minimum number of leftover vertices +when covering a 2-coloured $K_n$ by vertex-disjoint monochromatic triangles is +exactly 4. +-/ +@[category research solved, AMS 5] +theorem erdos_1015_moon (n : ℕ) (hn : n ≥ 8) : minLeftover 3 n = 4 := by + sorry + +end Erdos1015 diff --git a/FormalConjectures/ErdosProblems/1016.lean b/FormalConjectures/ErdosProblems/1016.lean new file mode 100644 index 0000000000..7ea962d962 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1016.lean @@ -0,0 +1,130 @@ +/- +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 1016 + +*Reference:* [erdosproblems.com/1016](https://www.erdosproblems.com/1016) + +Let $h(n)$ be minimal such that there is a graph on $n$ vertices with $n + h(n)$ +edges which contains a cycle on $k$ vertices, for all $3 \leq k \leq n$. Such graphs +are called pancyclic. Estimate $h(n)$. In particular, is it true that +$$h(n) \geq \log_2 n + \log^* n - O(1),$$ +where $\log^* n$ is the iterated logarithmic function? + +A problem of Bondy [Bo71], who claimed a proof (without details) of +$$\log_2(n-1) - 1 \leq h(n) \leq \log_2 n + \log^* n + O(1).$$ +Erdős [Er71] believed the upper bound is closer to the truth. Griffin [Gr13] gave +the first proof of the lower bound. George, Khodkar, and Wallis [GKW16] gave the +first published proof of the upper bound. + +OEIS: [A105206](https://oeis.org/A105206) + +[Bo71] Bondy, J.A., _Pancyclic graphs. I_. J. Combinatorial Theory Ser. B (1971), 80–84. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97–109. + +[Gr13] Griffin, S., _Minimal Pancyclicity_. arXiv:1312.0274 (2013). + +[GKW16] George, J.C., Khodkar, A., Wallis, W.D., _Pancyclic and bipancyclic graphs_. +(2016), xii+108. +-/ + +open Finset Classical + +namespace Erdos1016 + +/-- A simple graph on `Fin n` contains a simple cycle of length $k$ (for $k \geq 3$) + if there is an injective map from `Fin k` into the vertices such that + consecutive vertices in the cycle map to adjacent vertices. + The injectivity requirement ensures this is a simple cycle. -/ +def ContainsCycle {n : ℕ} (G : SimpleGraph (Fin n)) (k : ℕ) (hk : k ≥ 3) : Prop := + ∃ f : Fin k → Fin n, Function.Injective f ∧ + ∀ i : Fin k, G.Adj (f i) (f ⟨(i.val + 1) % k, Nat.mod_lt _ (by omega)⟩) + +/-- A graph on `Fin n` is pancyclic if it contains cycles of every length + from $3$ to $n$. -/ +def IsPancyclic {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ k (hk : k ≥ 3), k ≤ n → ContainsCycle G k hk + +/-- The minimum excess edges $h(n)$ for a pancyclic graph: the smallest $h$ such + that there exists a pancyclic graph on $n$ vertices with $n + h$ edges. + Note: for $n < 3$, no graph is pancyclic, so the set is empty and + `sInf ∅ = 0` in `ℕ`. The theorems below restrict to $n \geq 3$. -/ +noncomputable def pancyclicExcess (n : ℕ) : ℕ := + sInf {h : ℕ | ∃ G : SimpleGraph (Fin n), + G.edgeFinset.card = n + h ∧ IsPancyclic G} + +/-- Auxiliary definition for the iterated logarithm with explicit fuel. + The fuel parameter is needed for structural recursion in Lean, even though + `Nat.log 2` strictly decreases on inputs `≥ 2`. Using `n` as fuel suffices + since `Nat.log 2 n < n` for all `n ≥ 2`. -/ +def iteratedLog₂Aux : ℕ → ℕ → ℕ + | _, 0 => 0 + | _, 1 => 0 + | 0, _ + 2 => 0 + | fuel + 1, n + 2 => 1 + iteratedLog₂Aux fuel (Nat.log 2 (n + 2)) + +/-- The iterated logarithm $\log^*(n)$ (base $2$). -/ +def iteratedLog₂ (n : ℕ) : ℕ := iteratedLog₂Aux n n + +/-- +Erdős Problem 1016 [Er71]: + +The minimum number of edges beyond $n$ needed for a pancyclic graph on $n$ +vertices satisfies $h(n) \geq \lfloor\log_2 n\rfloor + \log^* n - O(1)$. + +Formulated as: there exists a constant $C$ such that for all $n \geq 3$, +$h(n) + C \geq \lfloor\log_2 n\rfloor + \log^* n$. +-/ +@[category research open, AMS 5] +theorem erdos_1016 : answer(sorry) ↔ + ∃ C : ℕ, ∀ n, n ≥ 3 → + pancyclicExcess n + C ≥ Nat.log 2 n + iteratedLog₂ n := by + sorry + +/-- +Erdős Problem 1016 — upper bound [Bo71] [GKW16]: + +Bondy claimed, and George–Khodkar–Wallis proved, that +$h(n) \leq \lfloor\log_2 n\rfloor + \log^* n + O(1)$. + +Formulated as: there exists a constant $C$ such that for all $n \geq 3$, +$\lfloor\log_2 n\rfloor + \text{iteratedLog}_2(n) \leq \text{pancyclicExcess}(n) + C$ +is *not* needed — rather, the excess itself is at most +$\lfloor\log_2 n\rfloor + \log^* n + C$. +-/ +@[category research solved, AMS 5] +theorem erdos_1016_upper : + ∃ C : ℕ, ∀ n, n ≥ 3 → + pancyclicExcess n ≤ Nat.log 2 n + iteratedLog₂ n + C := by + sorry + +/-- +Erdős Problem 1016 — Griffin's lower bound [Gr13]: + +Griffin proved $h(n) \geq \lfloor\log_2(n-1)\rfloor - 1$ for all $n \geq 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_1016_lower : + ∀ n, n ≥ 3 → + pancyclicExcess n + 1 ≥ Nat.log 2 (n - 1) := by + sorry + +end Erdos1016 diff --git a/FormalConjectures/ErdosProblems/1017.lean b/FormalConjectures/ErdosProblems/1017.lean new file mode 100644 index 0000000000..70c6d8b489 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1017.lean @@ -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 1017 + +*Reference:* [erdosproblems.com/1017](https://www.erdosproblems.com/1017) + +Let $f(n,k)$ be such that every graph on $n$ vertices and $k$ edges can be +partitioned into at most $f(n,k)$ edge-disjoint complete graphs. Estimate +$f(n,k)$ for $k > n^2/4$. + +The function $f(n,k)$ is sometimes called the clique partition number. + +Erdős, Goodman, and Pósa [EGP66] proved that $f(n,k) \le \lfloor n^2/4 \rfloor$ for all $k$ +(and in fact edges and triangles suffice), which is best possible in general, +as witnessed by a complete bipartite graph. Erdős [Er71] asks whether this +bound can be sharpened when $k > n^2/4$. + +Lovász [Lo68] proved that every graph on $n$ vertices and $k$ edges can be expressed +as a union of $\binom{n}{2} - k + t$ complete graphs, where $t$ is maximal such that +$t^2 - t \le \binom{n}{2} - k$. + +Győri and Keszegh [GyKe17] proved that every $K_4$-free graph with $n$ vertices and +$\lfloor n^2/4 \rfloor + m$ edges contains $m$ pairwise edge-disjoint triangles. + +[EGP66] Erdős, P., Goodman, A. W., and Pósa, L., _The representation of a graph by set +intersections_. Canadian Journal of Mathematics 18 (1966), 106-112. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109. + +[Lo68] Lovász, L., _On covering of graphs_. Theory of Graphs (Proc. Colloq., Tihany, 1966) +(1968), 231-236. + +[GyKe17] Győri, E. and Keszegh, B., _On the number of edge-disjoint triangles in K₄-free +graphs_. Combinatorica **37** (2017), 1113-1124. +-/ + +open SimpleGraph Finset Filter + +namespace Erdos1017 + +/-- +Erdős Problem 1017 [Er71]: + +Erdős asks whether the clique partition number $f(n,k)$ can be improved +below $\lfloor n^2/4 \rfloor$ when the number of edges $k$ exceeds $n^2/4$. +-/ +@[category research open, AMS 5] +theorem erdos_1017 : answer(sorry) ↔ + ∀ᶠ n in atTop, + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + G.edgeFinset.card > n ^ 2 / 4 → + ∃ (k : ℕ) (parts : Fin k → Finset (Sym2 (Fin n))), + k < n ^ 2 / 4 ∧ + (∀ i j : Fin k, i ≠ j → Disjoint (parts i) (parts j)) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i) ∧ + (∀ i : Fin k, ∃ (S : Finset (Fin n)), + G.IsClique (↑S : Set (Fin n)) ∧ + parts i = S.offDiag.image (Quot.mk _)) := by + sorry + +/-- +Erdős–Goodman–Pósa theorem [EGP66]: + +Every simple graph on $n$ vertices can be decomposed into at most +$\lfloor n^2/4 \rfloor$ edge-disjoint complete subgraphs. +-/ +@[category research solved, AMS 5] +theorem erdos_1017.variants.erdos_goodman_posa : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + ∃ (k : ℕ) (parts : Fin k → Finset (Sym2 (Fin n))), + k ≤ n ^ 2 / 4 ∧ + (∀ i j : Fin k, i ≠ j → Disjoint (parts i) (parts j)) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i) ∧ + (∀ i : Fin k, ∃ (S : Finset (Fin n)), + G.IsClique (↑S : Set (Fin n)) ∧ + parts i = S.offDiag.image (Quot.mk _)) := by + sorry + +end Erdos1017 diff --git a/FormalConjectures/ErdosProblems/1018.lean b/FormalConjectures/ErdosProblems/1018.lean new file mode 100644 index 0000000000..2bf427325e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1018.lean @@ -0,0 +1,79 @@ +/- +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 1018 + +*Reference:* [erdosproblems.com/1018](https://www.erdosproblems.com/1018) + +For every ε > 0, there exists a constant C such that every simple graph on n vertices with at +least ⌈n^{1+ε}⌉ edges contains an induced subgraph on at most C vertices which is non-planar. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109. + +[KoPy88] Kostochka, A. and Pyber, L., _Small topological complete subgraphs of "dense" graphs_. +Combinatorica (1988), 83-86. +-/ + +open SimpleGraph Finset + +namespace Erdos1018 + +/-- A simple graph is planar if it admits a topological embedding into the +plane without edge crossings. -/ +opaque IsPlanar {V : Type*} [Fintype V] (_ : SimpleGraph V) : Prop + +/-- +Erdős Problem 1018 [Er71]: + +For every $\varepsilon > 0$, there exists a constant $C$ (depending on $\varepsilon$) and a +threshold $N_0$ such that, for all $n \ge N_0$, every simple graph on $n$ vertices with at +least $\lceil n^{1+\varepsilon} \rceil$ edges contains an induced subgraph on at most $C$ vertices +which is non-planar. + +Solved by Kostochka and Pyber [KoPy88]. +-/ +@[category research solved, AMS 5] +theorem erdos_1018 : + ∀ ε : ℝ, ε > 0 → + ∃ (C N₀ : ℕ), ∀ n : ℕ, n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + G.edgeFinset.card ≥ ⌈(n : ℝ) ^ (1 + ε)⌉₊ → + ∃ S : Finset (Fin n), S.card ≤ C ∧ + ¬ IsPlanar (G.induce (↑S : Set (Fin n))) := by + sorry + +/-- +Erdős observed that $C_\varepsilon \to \infty$ as $\varepsilon \to 0$: any function $f$ witnessing +the main statement for all $\varepsilon > 0$ must satisfy $f(\varepsilon) \to \infty$ as +$\varepsilon \to 0^+$. +-/ +@[category research solved, AMS 5] +theorem erdos_1018_C_tends_to_infinity : + ∀ f : ℝ → ℕ, (∀ ε > 0, ∀ᶠ n in Filter.atTop, + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + G.edgeFinset.card ≥ ⌈(n : ℝ) ^ (1 + ε)⌉₊ → + ∃ S : Finset (Fin n), S.card ≤ f ε ∧ + ¬ IsPlanar (G.induce (↑S : Set (Fin n)))) → + Filter.Tendsto f (nhdsWithin 0 (Set.Ioi 0)) Filter.atTop := by + sorry + +end Erdos1018 diff --git a/FormalConjectures/ErdosProblems/1019.lean b/FormalConjectures/ErdosProblems/1019.lean new file mode 100644 index 0000000000..b78b5f146d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1019.lean @@ -0,0 +1,71 @@ +/- +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 1019 + +Does every graph on $n$ vertices with at least $\lfloor n^2/4 \rfloor + \lfloor (n+1)/2 \rfloor$ +edges contain a saturated (maximal) planar subgraph on more than 3 vertices? + +*Reference:* [erdosproblems.com/1019](https://www.erdosproblems.com/1019) + +[Er64f] Erdős, P., _On extremal problems of graphs and generalized graphs_. Israel J. Math. **2** +(1964), 183–190. + +[Er69c] Erdős, P., _Über die in Graphen enthaltenen saturierten planaren Graphen_. +Mathematische Nachrichten (1969), 13–17. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proceedings of Conference, Oxford, 1969) +(1971), 97–109. +-/ + +open SimpleGraph Finset + +namespace Erdos1019 + +/-- A graph is planar if it can be embedded in the plane without edge crossings. +Mathlib does not yet have a formalization of graph planarity; we axiomatize it +here as an opaque predicate. -/ +opaque IsPlanar {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop + +/-- +Erdős Problem 1019 [Er64f, Er69c, Er71]: + +Every graph on $n \geq 4$ vertices with at least +$\lfloor n^2/4 \rfloor + \lfloor (n+1)/2 \rfloor$ edges contains a maximal planar subgraph +(planar with exactly $3k - 6$ edges) on some $k > 3$ vertices. + +Proved by Simonovits. +-/ +@[category research solved, AMS 5] +theorem erdos_1019 : + answer(True) ↔ + ∀ n : ℕ, n ≥ 4 → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + G.edgeFinset.card ≥ n ^ 2 / 4 + (n + 1) / 2 → + ∃ (k : ℕ) (_ : k > 3) (H : SimpleGraph (Fin k)) + (dH : DecidableRel H.Adj) (f : Fin k → Fin n), + haveI := dH; + Function.Injective f ∧ + (IsPlanar H ∧ H.edgeFinset.card = 3 * k - 6) ∧ + ∀ u v, H.Adj u v → G.Adj (f u) (f v) := by + sorry + +end Erdos1019 diff --git a/FormalConjectures/ErdosProblems/102.lean b/FormalConjectures/ErdosProblems/102.lean new file mode 100644 index 0000000000..d617a194cd --- /dev/null +++ b/FormalConjectures/ErdosProblems/102.lean @@ -0,0 +1,102 @@ +/- +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 102 + +*Reference:* [erdosproblems.com/102](https://www.erdosproblems.com/102) + +Erdős–Purdy conjecture: if an $n$-point set in $\mathbb{R}^2$ determines at least $cn^2$ lines +each containing more than three points, then some line must contain an unbounded number of +points as $n \to \infty$. + +It is not even known whether $h_c(n) \geq 5$ (see Problem 101). + +Erdős originally conjectured the stronger bound $h_c(n) \gg_c n^{1/2}$, but this was disproven +by Hunter using point sets in $\{1, \ldots, m\}^d$ projected to $\mathbb{R}^2$, which shows +$h_c(n) \ll n^{1/\log(1/c)}$. It is easy to see that $h_c(n) \ll_c n^{1/2}$. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44-48. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Congressus Numerantium 107 (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. +-/ + +namespace Erdos102 + +/-- +The number of distinct affine lines in $\mathbb{R}^2$ that contain at least $4$ points from $P$ +(i.e., more than $3$ points, as in the problem statement). +-/ +noncomputable def fourPlusRichLineCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + 4 ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} + +/-- +Erdős Problem 102 (Erdős–Purdy): + +For fixed $c > 0$, let $h_c(n)$ denote the largest integer $h$ such that: for every +$n$-point set $P$ in $\mathbb{R}^2$ with at least $c \cdot n^2$ lines each containing more than $3$ points +of $P$, some line contains at least $h$ points of $P$. (In other words, $h_c(n)$ is the +minimum, over all such configurations $P$, of the maximum collinearity.) + +The conjecture is that $h_c(n) \to \infty$ as $n \to \infty$, i.e., for each fixed $c > 0$ and +each $M \in \mathbb{N}$, there exists $N$ such that for all $n \geq N$, every $n$-point configuration +with at least $c \cdot n^2$ four-rich lines must contain some line with at least $M$ points. +-/ +@[category research open, AMS 5 52] +theorem erdos_102 : + ∀ c : ℝ, c > 0 → + ∀ M : ℕ, + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + c * (n : ℝ) ^ 2 ≤ (fourPlusRichLineCount P : ℝ) → + ∃ L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)), + Module.finrank ℝ L.direction = 1 ∧ + M ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L} := by + sorry + +/-- +Erdős Problem 102 (stronger conjecture, disproven): + +Erdős originally conjectured that $h_c(n) \gg_c n^{1/2}$, i.e., for each fixed $c > 0$ there +exists a constant $C > 0$ such that for all sufficiently large $n$, every $n$-point configuration +in $\mathbb{R}^2$ with at least $c \cdot n^2$ four-rich lines must contain some line with at least +$C \cdot n^{1/2}$ points. This was disproven by Zach Hunter, who showed that point sets in +$\{1, \ldots, m\}^d$ projected to $\mathbb{R}^2$ yield $h_c(n) \ll n^{1/\log(1/c)}$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_102_strong_conjecture_false : + ¬ (∀ c : ℝ, c > 0 → + ∃ C : ℝ, C > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + c * (n : ℝ) ^ 2 ≤ (fourPlusRichLineCount P : ℝ) → + ∃ L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)), + Module.finrank ℝ L.direction = 1 ∧ + C * (n : ℝ) ^ (1/2 : ℝ) ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}) := by + sorry + +end Erdos102 diff --git a/FormalConjectures/ErdosProblems/1020.lean b/FormalConjectures/ErdosProblems/1020.lean new file mode 100644 index 0000000000..2166d0a421 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1020.lean @@ -0,0 +1,73 @@ +/- +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 1020 + +Conjecture on the maximum number of edges in an $r$-uniform hypergraph on $n$ vertices +containing no matching of size $k$ (the Erdős Matching Conjecture). + +The two terms in the conjectured maximum correspond to two extremal constructions: +(1) taking all $r$-subsets of a fixed set of $rk - 1$ vertices (clique construction), and +(2) taking all $r$-subsets that intersect a fixed set of $k - 1$ vertices (star/covering +construction). + +*Reference:* [erdosproblems.com/1020](https://www.erdosproblems.com/1020) + +[Er65d] Erdős, P., *A problem on independent r-tuples*, Ann. Univ. Sci. Budapest. Eötvös Sect. +Math. 8 (1965), 93–95. + +[Er71] Erdős, P., *Topics in combinatorial analysis*, Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. +-/ + +open Finset + +namespace Erdos1020 + +/-- An $r$-uniform hypergraph on vertex set `Fin n`: every edge has exactly $r$ vertices. -/ +def IsRUniform {n : ℕ} (H : Finset (Finset (Fin n))) (r : ℕ) : Prop := + ∀ e ∈ H, e.card = r + +/-- A matching of size $k$ in a hypergraph: $k$ pairwise vertex-disjoint edges. -/ +def HasMatching {n : ℕ} (H : Finset (Finset (Fin n))) (k : ℕ) : Prop := + ∃ M : Finset (Finset (Fin n)), M ⊆ H ∧ M.card = k ∧ + ∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ ≠ e₂ → Disjoint e₁ e₂ + +/-- `maxEdgesNoMatching n r k` is the maximum number of edges in an $r$-uniform hypergraph +on $n$ vertices that contains no matching of size $k$. -/ +noncomputable def maxEdgesNoMatching (n r k : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : Finset (Finset (Fin n)), + IsRUniform H r ∧ ¬HasMatching H k ∧ H.card = m} + +/-- +Erdős Problem 1020 (Erdős Matching Conjecture) [Er65d], [Er71, p.103]: + +For all $r \geq 3$, the maximum number of edges in an $r$-uniform hypergraph on $n$ vertices +containing no matching of size $k$ equals +$$ + \max\left(\binom{rk-1}{r},\; \binom{n}{r} - \binom{n-k+1}{r}\right). +$$ +-/ +@[category research open, AMS 5] +theorem erdos_1020 (n r k : ℕ) (hr : r ≥ 3) (hk : k ≥ 1) : + maxEdgesNoMatching n r k = + max (Nat.choose (r * k - 1) r) (Nat.choose n r - Nat.choose (n - k + 1) r) := by + sorry + +end Erdos1020 diff --git a/FormalConjectures/ErdosProblems/1021.lean b/FormalConjectures/ErdosProblems/1021.lean new file mode 100644 index 0000000000..98fba498f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1021.lean @@ -0,0 +1,117 @@ +/- +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 1021 + +*Reference:* [erdosproblems.com/1021](https://www.erdosproblems.com/1021) + +Is it true that, for every $k \ge 3$, there is a constant $c_k > 0$ such that +$$\mathrm{ex}(n, G_k) \ll n^{3/2 - c_k},$$ +where $G_k$ is the 1-subdivision of $K_k$: the bipartite graph between +$\{y_1, \ldots, y_k\}$ and $\{z_1, \ldots, z_{\binom{k}{2}}\}$, with each $z_j$ joined to a +unique pair of $y_i$? + +A conjecture of Erdős and Simonovits [Er71, p.103][Er74c, p.79]. Erdős [Er64c] +proved $\mathrm{ex}(n, C_6) \ll n^{1+1/3}$; this was also proved by +Bondy–Simonovits [BoSi74]. The general conjecture was proved by Conlon and Lee +[CoLe21] with $c_k = 6^{-k}$, later improved to $c_k = 1/(4k-6)$ by +Janzer [Ja19]. + +[Er64c] Erdős, P., _On extremal problems of graphs and generalized graphs_. +Israel J. Math. 2 (1964), 183–190. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proceedings of Conference, Oxford, 1969) +(1971), 97–109. + +[BoSi74] Bondy, J.A. and Simonovits, M., _Cycles of even length in graphs_. +J. Combin. Theory Ser. B 16 (1974), 97–105. + +[CoLe21] Conlon, D. and Lee, J., _On the extremal number of subdivisions_. +Int. Math. Res. Not. IMRN (2021), 9122–9145. + +[Ja19] Janzer, O., _Improved bounds for the extremal number of subdivisions_. +Electron. J. Combin. 26 (2019), Paper No. 3.3, 6 pp. +-/ + +open SimpleGraph Classical + +namespace Erdos1021 + +/-- Adjacency in the 1-subdivision of $K_k$. Vertices are "original" (`Fin k`) or +"edge" (`{(i, j) : i < j}`). Each edge-vertex is adjacent to exactly its two +original endpoints. -/ +def subdivKAdj (k : ℕ) : + Fin k ⊕ {p : Fin k × Fin k // p.1 < p.2} → + Fin k ⊕ {p : Fin k × Fin k // p.1 < p.2} → Prop + | .inl a, .inr ⟨⟨i, j⟩, _⟩ => a = i ∨ a = j + | .inr ⟨⟨i, j⟩, _⟩, .inl a => a = i ∨ a = j + | _, _ => False + +/-- The 1-subdivision of $K_k$. The vertex set is the disjoint union of the +$k$ original vertices and the $\binom{k}{2}$ edge-subdivision vertices. +Each edge-vertex is adjacent to exactly the two endpoints of its +corresponding edge in $K_k$. -/ +def subdivisionKComplete (k : ℕ) : + SimpleGraph (Fin k ⊕ {p : Fin k × Fin k // p.1 < p.2}) where + Adj := subdivKAdj k + symm := by + intro v w h + rcases v with a | ⟨⟨i, j⟩, hij⟩ <;> rcases w with b | ⟨⟨i', j'⟩, hij'⟩ <;> exact h + loopless := fun v h => by rcases v with a | ⟨⟨i, j⟩, hij⟩ <;> exact h + +/-- A graph $G$ contains $H$ as a subgraph if there is an injective vertex map +that sends edges to edges. -/ +def containsSubgraph {V W : Type*} (G : SimpleGraph V) + (H : SimpleGraph W) : Prop := + ∃ f : W → V, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v) + +/-- +Erdős Problem 1021 [Er71, p.103][Er74c, p.79]: + +For every $k \ge 3$, there exists $c_k > 0$ and $C > 0$ such that every $n$-vertex +graph not containing the 1-subdivision of $K_k$ as a subgraph has at most +$C \cdot n^{3/2 - c_k}$ edges. + +Proved by Conlon and Lee [CoLe21] with $c_k = 6^{-k}$. Improved to +$c_k = 1/(4k-6)$ by Janzer [Ja19]. +-/ +@[category research solved, AMS 5] +theorem erdos_1021 : answer(True) ↔ + ∀ (k : ℕ), k ≥ 3 → + ∃ (c : ℝ), c > 0 ∧ ∃ (C : ℝ), C > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + ¬containsSubgraph G (subdivisionKComplete k) → + (G.edgeFinset.card : ℝ) ≤ C * (n : ℝ) ^ ((3 : ℝ) / 2 - c) := by sorry + +/-- +The special case $k = 3$ of Erdős Problem 1021: the 1-subdivision of $K_3$ is +the 6-cycle $C_6$. Bondy and Simonovits [BoSi74] proved that +$\mathrm{ex}(n, C_6) \le C \cdot n^{1 + 1/3}$, giving $c_3 = 1/6$ (since +$3/2 - 1/6 = 4/3 = 1 + 1/3$). This is much stronger than the general bound +$c_k = 6^{-k}$ of Conlon–Lee. +-/ +@[category research solved, AMS 5] +theorem erdos_1021_C6 : + ∃ (C : ℝ), C > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + ¬containsSubgraph G (subdivisionKComplete 3) → + (G.edgeFinset.card : ℝ) ≤ C * (n : ℝ) ^ ((4 : ℝ) / 3) := by sorry + +end Erdos1021 diff --git a/FormalConjectures/ErdosProblems/1022.lean b/FormalConjectures/ErdosProblems/1022.lean new file mode 100644 index 0000000000..5391fd9d6f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1022.lean @@ -0,0 +1,63 @@ +/- +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 1022 + +*Reference:* [erdosproblems.com/1022](https://www.erdosproblems.com/1022) + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109. + +[Lo68] Lovász, L., _On covering of graphs_. Theory of Graphs (Proc. Colloq., Tihany, 1966) +(1968), 231-236. + +[Wo13b] Wood, D.R., _Hypergraph colouring and degeneracy_. arXiv:1310.2972 (2013). +-/ + +open Finset Filter + +namespace Erdos1022 + +/-- A finite set family has **property B** (is 2-colorable) if there exists + a 2-coloring of the ground set such that no edge is monochromatic: + every edge contains elements of both colors. -/ +def HasPropertyB {n : ℕ} (F : Finset (Finset (Fin n))) : Prop := + ∃ f : Fin n → Bool, ∀ e ∈ F, (∃ v ∈ e, f v = true) ∧ (∃ v ∈ e, f v = false) + +/-- +**Erdős Problem 1022** [Er71, p.105]: + +There does NOT exist a function $c : \mathbb{N} \to \mathbb{R}$ with +$c(t) \to \infty$ as $t \to \infty$ such that the following holds: for every +$t$ and every finite hypergraph $\mathcal{F}$ on $n$ vertices, if all edges +have size $\geq t$ and for every vertex set $X$ the number of edges contained +in $X$ is $< c(t) \cdot |X|$, then $\mathcal{F}$ has property B. + +Disproved by Wood [Wo13b]. +-/ +@[category research solved, AMS 5] +theorem erdos_1022 : answer(False) ↔ + ∃ (c : ℕ → ℝ), Tendsto c atTop atTop ∧ + ∀ (t : ℕ) (n : ℕ) (F : Finset (Finset (Fin n))), + (∀ e ∈ F, t ≤ e.card) → + (∀ X : Finset (Fin n), + ((F.filter (fun e => e ⊆ X)).card : ℝ) ≤ c t * (X.card : ℝ)) → + HasPropertyB F := by sorry + +end Erdos1022 diff --git a/FormalConjectures/ErdosProblems/1023.lean b/FormalConjectures/ErdosProblems/1023.lean new file mode 100644 index 0000000000..5e12627fd0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1023.lean @@ -0,0 +1,88 @@ +/- +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 1023 + +Erdős asked for the asymptotic behaviour of the maximum size of a union-free family of subsets +of an n-element set, conjecturing that it is asymptotic to $c \cdot 2^n / \sqrt{n}$ for some +constant $c > 0$. + +*Reference:* [erdosproblems.com/1023](https://www.erdosproblems.com/1023) + +Note: The original source [Er71] contains a typographical error (exponent $3/2$ instead of $1/2$). + +Contributors: Stijn Cambie, Zach Hunter. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969), 1971, pp. 97-109. + +[Kl71] Kleitman, D., _Collections of subsets containing no two sets and their union_. +Proc. LA Meeting AMS (1971), 153-155. +-/ + +open Finset Filter + +open scoped Topology + +namespace Erdos1023 + +/-- A family $\mathcal{F}$ of subsets of $\operatorname{Fin}(n)$ is *union-free* if no member of + $\mathcal{F}$ equals the union of some non-empty sub-collection of other members. -/ +def IsUnionFreeFamily {n : ℕ} (𝓕 : Finset (Finset (Fin n))) : Prop := + ∀ A ∈ 𝓕, ∀ S ⊆ 𝓕.erase A, S.Nonempty → S.sup id ≠ A + +/-- $F(n)$ is the maximum cardinality of a union-free family of subsets of + $\operatorname{Fin}(n)$. -/ +noncomputable def unionFreeMax (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ 𝓕 : Finset (Finset (Fin n)), IsUnionFreeFamily 𝓕 ∧ 𝓕.card = k} + +/-- +Erdős Problem 1023 [Er71, p. 105]: + +There exists a constant $c > 0$ such that $F(n) \sim c \cdot 2^n / \sqrt{n}$, where $F(n)$ +is the maximum size of a union-free family of subsets of $\{1, \ldots, n\}$. + +Formulated as: $\lim_{n \to \infty} F(n) \cdot \sqrt{n} \,/\, (c \cdot 2^n) = 1$. + +Erdős and Kleitman proved that $F(n) \asymp 2^n / \sqrt{n}$. Zach Hunter observes that the +answer follows from the solution to Problem 447 [Kl71], which implies +$F(n) \sim \binom{n}{\lfloor n/2 \rfloor}$. +-/ +@[category research solved, AMS 5] +theorem erdos_1023 : + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun n : ℕ => (unionFreeMax n : ℝ) * Real.sqrt (↑n) / (c * (2 : ℝ) ^ n)) + atTop (nhds 1) := by + sorry + +/-- +Stronger form of Erdős Problem 1023, making the connection to Problem 447 explicit: + +$F(n) \sim \binom{n}{\lfloor n/2 \rfloor}$, i.e., the ratio $F(n) / \binom{n}{\lfloor n/2 \rfloor}$ +tends to $1$. This pins down the constant $c = \sqrt{2/\pi}$ via Stirling's approximation. +-/ +@[category research solved, AMS 5] +theorem erdos_1023_central_binomial : + Tendsto + (fun n : ℕ => (unionFreeMax n : ℝ) / (Nat.choose n (n / 2) : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos1023 diff --git a/FormalConjectures/ErdosProblems/1024.lean b/FormalConjectures/ErdosProblems/1024.lean new file mode 100644 index 0000000000..dc950d4272 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1024.lean @@ -0,0 +1,90 @@ +/- +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 1024 + +*Reference:* [erdosproblems.com/1024](https://www.erdosproblems.com/1024) + +Let $f(n)$ be such that every $3$-uniform linear hypergraph on $n$ vertices contains +an independent set on $f(n)$ vertices. + +A hypergraph is linear if $|A \cap B| \leq 1$ for all edges $A$ and $B$. An independent +set of vertices is one which contains no edges. A $3$-uniform linear hypergraph +is sometimes called a partial Steiner triple system. + +A question of Erdős [Er71, p.106], who proved $n^{1/2} \ll f(n) \ll n^{2/3}$. +Phelps and Rödl [PhRo86] proved $f(n) \asymp (n \log n)^{1/2}$. + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[PhRo86] Phelps, K. T. and Rödl, V., _Steiner triple systems with minimum independence +number_. Ars Combin. 21 (1986), 167–172. +-/ + +open Finset + +namespace Erdos1024 + +/-- A $3$-uniform hypergraph on `Fin n`: a family of $3$-element subsets. -/ +structure Hypergraph3Uniform (n : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = 3 + +/-- A $3$-uniform hypergraph is *linear* if any two distinct edges share + at most one vertex. -/ +def Hypergraph3Uniform.IsLinear {n : ℕ} (H : Hypergraph3Uniform n) : Prop := + ∀ e₁ ∈ H.edges, ∀ e₂ ∈ H.edges, e₁ ≠ e₂ → (e₁ ∩ e₂).card ≤ 1 + +/-- A set $S$ of vertices is *independent* in $H$ if no edge of $H$ is + contained in $S$. -/ +def Hypergraph3Uniform.IsIndependent {n : ℕ} (H : Hypergraph3Uniform n) + (S : Finset (Fin n)) : Prop := + ∀ e ∈ H.edges, ¬(e ⊆ S) + +/-- The independence number of $H$: the maximum size of an independent set. -/ +noncomputable def Hypergraph3Uniform.independenceNumber {n : ℕ} + (H : Hypergraph3Uniform n) : ℕ := + sSup {k : ℕ | ∃ S : Finset (Fin n), H.IsIndependent S ∧ S.card = k} + +/-- `linearHypergraphIndNum n` is the minimum independence number over all + $3$-uniform linear hypergraphs on $n$ vertices, i.e. the largest $f$ such + that every such hypergraph has an independent set of size at least $f$. -/ +noncomputable def linearHypergraphIndNum (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ H : Hypergraph3Uniform n, H.IsLinear ∧ + H.independenceNumber = k} + +/-- +Erdős Problem 1024 (solved by Phelps–Rödl [PhRo86]): + +$f(n) \asymp (n \log n)^{1/2}$, where $f(n)$ is the minimum independence number over +all $3$-uniform linear hypergraphs on $n$ vertices. + +There exist constants $C_1, C_2 > 0$ and $N_0$ such that for all $n \geq N_0$, +$$C_1 \sqrt{n \log n} \leq f(n) \leq C_2 \sqrt{n \log n}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_1024 : + ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C₁ * Real.sqrt (↑n * Real.log ↑n) ≤ ↑(linearHypergraphIndNum n) ∧ + ↑(linearHypergraphIndNum n) ≤ C₂ * Real.sqrt (↑n * Real.log ↑n) := by + sorry + +end Erdos1024 diff --git a/FormalConjectures/ErdosProblems/1025.lean b/FormalConjectures/ErdosProblems/1025.lean new file mode 100644 index 0000000000..d003297bb7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1025.lean @@ -0,0 +1,93 @@ +/- +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 1025 + +*Reference:* [erdosproblems.com/1025](https://www.erdosproblems.com/1025) + +Let $f$ be a function from all pairs of elements in $\{1,\ldots,n\}$ to $\{1,\ldots,n\}$ such +that $f(x,y) \neq x$ and $f(x,y) \neq y$ for all $x,y$. We call $X \subseteq \{1,\ldots,n\}$ +independent if whenever $x,y \in X$ we have $f(x,y) \notin X$. + +Let $g(n)$ be such that, in every function $f$, there is an independent set of +size at least $g(n)$. Estimate $g(n)$. + +A question of Erdős and Hajnal [ErHa58] (see also [Er71, p.106]), who proved +$n^{1/3} \ll g(n) \ll (n \log n)^{1/2}$. +Spencer [Sp72] proved $g(n) \gg n^{1/2}$. +Conlon, Fox, and Sudakov [CFS16] proved $g(n) \ll n^{1/2}$. +Thus $g(n) = \Theta(\sqrt{n})$. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97–109. + +[ErHa58] Erdős, P. and Hajnal, A., _On the structure of set-mappings_. Acta Math. Acad. +Sci. Hungar. **9** (1958), 111–133. + +[Sp72] Spencer, J., _Turán's theorem for k-graphs_. Discrete Math. **2** (1972), 183–186. + +[CFS16] Conlon, D., Fox, J., and Sudakov, B., _Short proofs of some extremal results II_. +J. Combin. Theory Ser. B **121** (2016), 173–196. +-/ + +open Finset + +namespace Erdos1025 + +/-- A pair function on `Fin n` assigns to each pair of distinct elements +a third element different from both. -/ +def IsValidPairFunction (n : ℕ) (f : Fin n → Fin n → Fin n) : Prop := + ∀ x y : Fin n, x ≠ y → f x y ≠ x ∧ f x y ≠ y + +/-- A set $S \subseteq \operatorname{Fin} n$ is independent with respect to $f$ if for all +distinct $x, y \in S$, we have $f(x,y) \notin S$. -/ +def IsIndependentPairSet (n : ℕ) (f : Fin n → Fin n → Fin n) + (S : Finset (Fin n)) : Prop := + ∀ x ∈ S, ∀ y ∈ S, x ≠ y → f x y ∉ S + +/-- +Erdős Problem 1025, lower bound (Spencer [Sp72]): + +For every valid pair function $f$ on $\operatorname{Fin} n$, there exists an independent set +of size at least $C \cdot \sqrt{n}$, for some absolute constant $C > 0$. +-/ +@[category research solved, AMS 5] +theorem erdos_1025 : + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, ∀ f : Fin n → Fin n → Fin n, + IsValidPairFunction n f → + ∃ S : Finset (Fin n), IsIndependentPairSet n f S ∧ + (S.card : ℝ) ≥ C * Real.sqrt n := by + sorry + +/-- +Erdős Problem 1025, upper bound (Conlon–Fox–Sudakov [CFS16]): + +There exists a constant $C > 0$ such that for all sufficiently large $n$, +there exists a valid pair function $f$ on $\operatorname{Fin} n$ for which every independent +set has size at most $C \cdot \sqrt{n}$. +-/ +@[category research solved, AMS 5] +theorem erdos_1025.variants.upper_bound : + ∃ C : ℝ, C > 0 ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ f : Fin n → Fin n → Fin n, IsValidPairFunction n f ∧ + ∀ S : Finset (Fin n), IsIndependentPairSet n f S → + (S.card : ℝ) ≤ C * Real.sqrt n := by + sorry + +end Erdos1025 diff --git a/FormalConjectures/ErdosProblems/1026.lean b/FormalConjectures/ErdosProblems/1026.lean new file mode 100644 index 0000000000..0c36c213ba --- /dev/null +++ b/FormalConjectures/ErdosProblems/1026.lean @@ -0,0 +1,86 @@ +/- +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 1026 + +*Reference:* [erdosproblems.com/1026](https://www.erdosproblems.com/1026) + +Let $x_1, \ldots, x_n$ be a sequence of distinct real numbers. Determine +$\max(\sum x_{i_r})$, where the maximum is taken over all monotonic subsequences. + +The precise formulation (van Doorn): What is the largest constant $c$ such that, +for all sequences of $n$ real numbers $x_1, \ldots, x_n$, +$$\max(\sum x_{i_r}) > (c - o(1)) \cdot \frac{1}{\sqrt{n}} \cdot \sum x_i$$ +where the maximum is over all monotonic subsequences? + +Cambie conjectured the stronger statement: if $x_1, \ldots, x_{k^2}$ are distinct +positive real numbers with $\sum x_i = 1$, then there is always a monotonic +subsequence with sum at least $1/k$. This shows $c = 1$. + +This was proved by Tidor, Wang, and Yang [TWY16], and is also implicit in +work of Wagner [Wa17]. It has been formalised in Lean. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97–109. + +[TWY16] Tidor, J., Wang, V., and Yang, B., _1-color avoiding paths, special tournaments, +and incidence geometry_. arXiv:1608.04153 (2016). + +[Wa17] Wagner, A. Z., _Large subgraphs in rainbow-triangle free colorings_. J. Graph Theory +(2017), 141–148. +-/ + +open Finset + +namespace Erdos1026 + +/-- A set of indices forms an increasing subsequence of $x$ if for all +pairs of indices in the set, the one with larger index has larger value. -/ +def IsIncreasingSubseq {n : ℕ} (x : Fin n → ℝ) (S : Finset (Fin n)) : Prop := + ∀ i ∈ S, ∀ j ∈ S, i < j → x i < x j + +/-- A set of indices forms a decreasing subsequence of $x$ if for all +pairs of indices in the set, the one with larger index has smaller value. -/ +def IsDecreasingSubseq {n : ℕ} (x : Fin n → ℝ) (S : Finset (Fin n)) : Prop := + ∀ i ∈ S, ∀ j ∈ S, i < j → x i > x j + +/-- A set of indices forms a monotone subsequence if it is either +increasing or decreasing. -/ +def IsMonotoneSubseq {n : ℕ} (x : Fin n → ℝ) (S : Finset (Fin n)) : Prop := + IsIncreasingSubseq x S ∨ IsDecreasingSubseq x S + +/-- +Erdős Problem 1026 (Cambie's conjecture, proved by Tidor–Wang–Yang [TWY16]): + +If $x_1, \ldots, x_{k^2}$ are distinct positive real numbers summing to $1$, then +there exists a monotone subsequence whose sum is at least $1/k$. + +This is a weighted form of the Erdős–Szekeres theorem. +-/ +@[category research solved, AMS 5] +theorem erdos_1026 (k : ℕ) (hk : k ≥ 1) + (x : Fin (k ^ 2) → ℝ) + (hx_pos : ∀ i, x i > 0) + (hx_inj : Function.Injective x) + (hx_sum : ∑ i, x i = 1) : + ∃ S : Finset (Fin (k ^ 2)), IsMonotoneSubseq x S ∧ + ∑ i ∈ S, x i ≥ 1 / (k : ℝ) := by + sorry + +end Erdos1026 diff --git a/FormalConjectures/ErdosProblems/1027.lean b/FormalConjectures/ErdosProblems/1027.lean new file mode 100644 index 0000000000..bbaf86a4d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1027.lean @@ -0,0 +1,70 @@ +/- +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 1027 + +*Reference:* [erdosproblems.com/1027](https://www.erdosproblems.com/1027) + +Let $c > 0$, and let $n$ be sufficiently large depending on $c$. Suppose that $\mathcal{F}$ is a +family of at most $c \cdot 2^n$ many finite sets of size $n$. Let +$X = \bigcup_{A \in \mathcal{F}} A$. + +Must there exist $\gg_c 2^{|X|}$ many sets $B \subset X$ which intersect every set in +$\mathcal{F}$, yet contain none of them? + +Note: The existence of a single such set $B$ is equivalent to $\mathcal{F}$ having Property B +(see Problem 901). This problem asks for a quantitative strengthening. + +This was proved in the affirmative by Koishi Chan, with contributions from Stijn Cambie. + +[Er64e] Erdős, P., _On a combinatorial problem. II_. Acta Mathematica Academiae Scientiarum +Hungaricae **15** (1964), 445–447. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97–109. +-/ + +open Finset + +namespace Erdos1027 + +/-- +Erdős Problem 1027: +For every $c > 0$, there exist $\delta > 0$ and $N_0$ such that for all $n \geq N_0$, +for any family $\mathcal{F}$ of finite sets each of size $n$ with +$|\mathcal{F}| \leq c \cdot 2^n$, letting $X = \bigcup \mathcal{F}$, the number of subsets +$B$ of $X$ that intersect every member of $\mathcal{F}$ but contain none of them is at least +$\delta \cdot 2^{|X|}$. +-/ +@[category research solved, AMS 5] +theorem erdos_1027 : + answer(True) ↔ + ∀ c : ℝ, c > 0 → + ∃ δ : ℝ, δ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ F : Finset (Finset ℕ), + (∀ A ∈ F, A.card = n) → + (F.card : ℝ) ≤ c * (2 : ℝ) ^ n → + let X := F.biUnion id + ((X.powerset.filter (fun B => + (∀ A ∈ F, (A ∩ B).Nonempty) ∧ + (∀ A ∈ F, ¬(A ⊆ B)))).card : ℝ) ≥ δ * (2 : ℝ) ^ X.card := by + sorry + +end Erdos1027 diff --git a/FormalConjectures/ErdosProblems/1028.lean b/FormalConjectures/ErdosProblems/1028.lean new file mode 100644 index 0000000000..e68b60b83a --- /dev/null +++ b/FormalConjectures/ErdosProblems/1028.lean @@ -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 + +/-! +# Erdős Problem 1028 + +*Reference:* [erdosproblems.com/1028](https://www.erdosproblems.com/1028) + +Let $H(n) = \min_f \max_{X \subseteq \{1,\ldots,n\}} \left|\sum_{x \neq y \in X} f(x,y)\right|$, +where $f$ ranges over all functions $f\colon \{1,\ldots,n\}^2 \to \{-1,1\}$. Estimate $H(n)$. + +Erdős [Er63d] proved $n/4 \le H(n)$ and Erdős [Er71, p.107] proved $H(n) \ll n^{3/2}$. +Erdős and Spencer [ErSp71] proved that $H(n) \gg n^{3/2}$. + +Together these give $H(n) = \Theta(n^{3/2})$. + +[Er63d] Erdős, P., _On combinatorial questions connected with a theorem of Ramsey and van +der Waerden_, Mat. Lapok (1963), 29–37. + +[Er71] Erdős, P., _Topics in combinatorial analysis_, Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[ErSp71] Erdős, P., Spencer, J., _Imbalances in k-colorations_, Networks (1971/72), 379–385. +-/ + +open Finset + +namespace Erdos1028 + +/-- The discrepancy sum of a $\pm 1$ function $f$ over a subset $X$ of $\operatorname{Fin}(n)$: +$\sum_{x \neq y \in X} f(x, y)$ over ordered pairs with $x \neq y$. -/ +def discrepancySum (n : ℕ) (f : Fin n → Fin n → ℤ) (X : Finset (Fin n)) : ℤ := + X.sum fun x => (X.filter (· ≠ x)).sum fun y => f x y + +/-- +Erdős Problem 1028 [Er63d][ErSp71]: + +$H(n) = \Theta(n^{3/2})$, where +$H(n) = \min_f \max_{X \subseteq \{1,\ldots,n\}} \left|\sum_{x \neq y \in X} f(x,y)\right|$ +and $f$ ranges over all $\pm 1$ valued functions on pairs. + +This is equivalent to two bounds: +- Lower bound (Erdős–Spencer [ErSp71]): every $\pm 1$ function $f$ has some subset $X$ + with discrepancy at least $C_1 \cdot n^{3/2}$. +- Upper bound (Erdős [Er63d]): there exists a $\pm 1$ function $f$ such that all subsets + have discrepancy at most $C_2 \cdot n^{3/2}$. +-/ +@[category research solved, AMS 5] +theorem erdos_1028 : + ∃ C₁ C₂ : ℝ, C₁ > 0 ∧ C₂ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + -- Lower bound: every ±1 function has a subset with large discrepancy + (∀ f : Fin n → Fin n → ℤ, (∀ i j, f i j = 1 ∨ f i j = -1) → + ∃ X : Finset (Fin n), + C₁ * (n : ℝ) ^ ((3 : ℝ) / 2) ≤ |(discrepancySum n f X : ℝ)|) ∧ + -- Upper bound: there exists a ±1 function with all discrepancies bounded + (∃ f : Fin n → Fin n → ℤ, (∀ i j, f i j = 1 ∨ f i j = -1) ∧ + ∀ X : Finset (Fin n), + |(discrepancySum n f X : ℝ)| ≤ C₂ * (n : ℝ) ^ ((3 : ℝ) / 2)) := by + sorry + +end Erdos1028 diff --git a/FormalConjectures/ErdosProblems/1029.lean b/FormalConjectures/ErdosProblems/1029.lean new file mode 100644 index 0000000000..820b30d613 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1029.lean @@ -0,0 +1,63 @@ +/- +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.Combinatorics.Ramsey + +/-! +# Erdős Problem 1029 + +*Reference:* [erdosproblems.com/1029](https://www.erdosproblems.com/1029) + +If $R(k)$ is the diagonal Ramsey number for $K_k$, the minimal $n$ such that every +2-colouring of the edges of $K_n$ contains a monochromatic copy of $K_k$, then +$$ + R(k) / (k \cdot 2^{k/2}) \to \infty. +$$ + +Erdős and Szekeres [ErSz35] proved $k \cdot 2^{k/2} \ll R(k) \leq \binom{2k-1}{k-1}$. +The probabilistic method gives $R(k) \geq (1+o(1)) \cdot \frac{1}{\sqrt{2}\, e} \cdot k \cdot 2^{k/2}$, +improved by Spencer [Sp75] to $R(k) \geq (1+o(1)) \cdot \frac{\sqrt{2}}{e} \cdot k \cdot 2^{k/2}$. + +[ErSz35] Erdős, P. and Szekeres, G., *A combinatorial problem in geometry*, Compositio Math. 2 (1935), 463–470. + +[Sp75] Spencer, J., *Ramsey's theorem — a new lower bound*, J. Combin. Theory Ser. A 18 (1975), 108–115. + +[Er93] Erdős, P., *On some of my favourite theorems* (1993). +-/ + +open Finset Combinatorics + +namespace Erdos1029 + +/-- +Erdős Problem 1029 [Er93, p.337]: + +$R(k) / (k \cdot 2^{k/2}) \to \infty$ as $k \to \infty$. + +Formulated as: for every $C > 0$, there exists $K_0$ such that for all $k \geq K_0$, +$R(k) \geq C \cdot k \cdot 2^{k/2}$. + +Here $R(k)$ is the diagonal Ramsey number, expressed as `hypergraphRamsey 2 k`. +-/ +@[category research open, AMS 5] +theorem erdos_1029 : + ∀ C : ℝ, C > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (hypergraphRamsey 2 k : ℝ) ≥ C * (k : ℝ) * (2 : ℝ) ^ ((k : ℝ) / 2) := by + sorry + +end Erdos1029 diff --git a/FormalConjectures/ErdosProblems/103.lean b/FormalConjectures/ErdosProblems/103.lean new file mode 100644 index 0000000000..78feacbcb9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/103.lean @@ -0,0 +1,95 @@ +/- +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 103 + +*References:* +* [erdosproblems.com/103](https://www.erdosproblems.com/103) +* [Er94b] Erdős, P., _Some problems in number theory, combinatorics and combinatorial geometry_. + Math. Pannon. (1994), 261–269. + +Related: Problem #99. + +Let $h(n)$ count the number of incongruent $n$-point configurations in $\mathbb{R}^2$ that +minimize the diameter subject to all pairwise distances being $\geq 1$. Does $h(n) \to \infty$? +-/ + +open Set Metric + +namespace Erdos103 + +/-- +A finite set of points in $\mathbb{R}^2$ is unit-separated if all pairwise distances +between distinct points are at least $1$. +-/ +def IsUnitSeparated (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ p ∈ A, ∀ q ∈ A, p ≠ q → dist p q ≥ 1 + +/-- +Two finite point sets in $\mathbb{R}^2$ are congruent if there is an isometric equivalence of +$\mathbb{R}^2$ mapping one to the other (i.e., one can be obtained from the other by a +rigid motion). +-/ +def AreCongruent (A B : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ f : EuclideanSpace ℝ (Fin 2) ≃ᵢ EuclideanSpace ℝ (Fin 2), + A.image (f : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2)) = B + +/-- +Erdős Problem #103: +Let $h(n)$ count the number of incongruent sets of $n$ points in $\mathbb{R}^2$ which minimize +the diameter subject to the constraint that $d(x,y) \geq 1$ for all distinct points +$x$, $y$. Is it true that $h(n) \to \infty$ as $n \to \infty$? + +The formulation uses an existential quantification over $M$ pairwise non-congruent +minimal-diameter configurations, following the pattern of Problem 668, to avoid +the `Set.ncard` pitfall (which returns 0 for infinite sets). + +It is not even known whether $h(n) \geq 2$ for all sufficiently large $n$. +-/ +@[category research open, AMS 52] +theorem erdos_103 : answer(sorry) ↔ + ∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (As : Fin M → Finset (EuclideanSpace ℝ (Fin 2))), + (∀ i, (As i).card = n ∧ IsUnitSeparated (As i) ∧ + IsMinOn (fun B : Finset (EuclideanSpace ℝ (Fin 2)) => + diam (B : Set (EuclideanSpace ℝ (Fin 2)))) + {B | B.card = n ∧ IsUnitSeparated B} (As i)) ∧ + (∀ i j, i ≠ j → ¬AreCongruent (As i) (As j)) := by + sorry + +/-- +Weaker variant of Erdős Problem #103: Are there at least two incongruent minimal-diameter +unit-separated $n$-point configurations for all sufficiently large $n$? +-/ +@[category research open, AMS 52] +theorem erdos_103_at_least_two : answer(sorry) ↔ + ∀ᶠ n in Filter.atTop, + ∃ (A B : Finset (EuclideanSpace ℝ (Fin 2))), + A.card = n ∧ IsUnitSeparated A ∧ + IsMinOn (fun C : Finset (EuclideanSpace ℝ (Fin 2)) => + diam (C : Set (EuclideanSpace ℝ (Fin 2)))) + {C | C.card = n ∧ IsUnitSeparated C} A ∧ + B.card = n ∧ IsUnitSeparated B ∧ + IsMinOn (fun C : Finset (EuclideanSpace ℝ (Fin 2)) => + diam (C : Set (EuclideanSpace ℝ (Fin 2)))) + {C | C.card = n ∧ IsUnitSeparated C} B ∧ + ¬AreCongruent A B := by + sorry + +end Erdos103 diff --git a/FormalConjectures/ErdosProblems/1030.lean b/FormalConjectures/ErdosProblems/1030.lean new file mode 100644 index 0000000000..59c4493057 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1030.lean @@ -0,0 +1,88 @@ +/- +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 1030 + +*Reference:* [erdosproblems.com/1030](https://www.erdosproblems.com/1030) + +If $R(k,l)$ is the Ramsey number then prove the existence of some $c > 0$ such that +$$ + \lim_{k \to \infty} \frac{R(k+1, k)}{R(k, k)} > 1 + c. +$$ + +A problem of Erdős and Sós, who could not even prove whether +$R(k+1,k) - R(k,k) > k^c$ for any $c > 1$. + +Burr, Erdős, Faudree, and Schelp [BEFS89] proved that +$R(k+1,k) - R(k,k) \geq 2k - 5$. + +See also problems [544](https://www.erdosproblems.com/544) and +[1014](https://www.erdosproblems.com/1014). + +OEIS: [A000791](https://oeis.org/A000791), [A059442](https://oeis.org/A059442). + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), 97–132, p. 339. + +[BEFS89] Burr, S.A., Erdős, P., Faudree, R.J., and Schelp, R.H., +_On the difference between consecutive Ramsey numbers_. Utilitas Math. (1989), 115–118. +-/ + +open SimpleGraph + +namespace Erdos1030 + +/-- The Ramsey number $R(k, l)$: the minimum $N$ such that every simple graph on $N$ + vertices contains either a $k$-clique or an independent set of size $l$ + (equivalently, an $l$-clique in the complement). -/ +noncomputable def ramseyR (k l : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree l} + +/-- +Erdős Problem 1030 [Er93, p. 339]: + +There exists $c > 0$ such that +$$ + \lim_{k \to \infty} \frac{R(k+1, k)}{R(k, k)} > 1 + c. +$$ + +Formulated as: there exist $c > 0$ and $K_0$ such that for all $k \geq K_0$, +$R(k+1, k) / R(k, k) \geq 1 + c$. +-/ +@[category research open, AMS 5] +theorem erdos_1030 : + ∃ c : ℝ, c > 0 ∧ + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (ramseyR (k + 1) k : ℝ) / (ramseyR k k : ℝ) ≥ 1 + c := by + sorry + +/-- +Weaker variant of Erdős Problem 1030 [Er93, p. 339]: + +There exists $c > 1$ such that $R(k+1,k) - R(k,k) > k^c$ for all sufficiently large $k$. + +Erdős and Sós could not even prove this weaker statement. +-/ +@[category research open, AMS 5] +theorem erdos_1030_weak : + ∃ c : ℝ, c > 1 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (ramseyR (k + 1) k : ℝ) - (ramseyR k k : ℝ) > (k : ℝ) ^ c := by + sorry + +end Erdos1030 diff --git a/FormalConjectures/ErdosProblems/1031.lean b/FormalConjectures/ErdosProblems/1031.lean new file mode 100644 index 0000000000..a71b4f3921 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1031.lean @@ -0,0 +1,61 @@ +/- +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 1031 + +*Reference:* [erdosproblems.com/1031](https://www.erdosproblems.com/1031) + +A question of Erdős, Fajtlowicz, and Staton [Er93, p.340]. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae **16** (1993), 333–350. + +[PrRo99] Prömel, H.J. and Rödl, V., _Non-Ramsey graphs are c log n-universal_. +J. Combin. Theory Ser. A (1999), 379–384. +-/ + +open scoped Topology Real + +namespace Erdos1031 + +/-- +**Erdős Problem 1031** [Er93, p.340]: + +If $G$ is a graph on $n$ vertices with no clique and no independent set of size +$\geq 10 \log n$, then $G$ contains an induced regular subgraph on $\geq c \log n$ vertices +(for some absolute constant $c > 0$) that is neither empty nor complete. + +This was proved by Prömel and Rödl [PrRo99], who showed the stronger result +that for any $c > 0$, if $G$ contains no trivial subgraph on $\geq c \log n$ vertices +then $G$ contains all graphs with $O_c(\log n)$ vertices as induced subgraphs. +-/ +@[category research solved, AMS 5] +theorem erdos_1031 : + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), ∀ _ : DecidableRel G.Adj, + G.CliqueFree ⌈10 * Real.log (↑n)⌉₊ → + Gᶜ.CliqueFree ⌈10 * Real.log (↑n)⌉₊ → + ∃ S : Finset (Fin n), + (S.card : ℝ) ≥ c * Real.log (↑n) ∧ + ∃ d : ℕ, d ≥ 1 ∧ d + 1 < S.card ∧ + ∀ v ∈ S, (S.filter (G.Adj v)).card = d := by + sorry + +end Erdos1031 diff --git a/FormalConjectures/ErdosProblems/1032.lean b/FormalConjectures/ErdosProblems/1032.lean new file mode 100644 index 0000000000..9e48a2a4eb --- /dev/null +++ b/FormalConjectures/ErdosProblems/1032.lean @@ -0,0 +1,85 @@ +/- +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 1032 + +*Reference:* [erdosproblems.com/1032](https://www.erdosproblems.com/1032) + +Erdős asked whether there exists a constant $c > 0$ such that for arbitrarily large $n$, +there is a $4$-chromatic critical graph on $n$ vertices with minimum degree at least $c \cdot n$. + +- [Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. + Quaestiones Mathematicae **16** (1993), 333–350. +- [Si72] Simonovits, M., _On colour-critical graphs_. Studia Scientiarum Mathematicarum + Hungarica (1972), 67–81. +- [To72] Toft, B., _Two theorems on critical 4-chromatic graphs_. Studia Scientiarum + Mathematicarum Hungarica (1972), 83–89. +- [Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §3.60. + +See also problems 917 and 944. +-/ + +open SimpleGraph + +namespace Erdos1032 + +/-- +A simple graph $G$ is $k$-critical if its chromatic number equals $k$ and for every +edge $e$, the graph obtained by deleting $e$ has chromatic number strictly less +than $k$. +-/ +def IsCritical {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + G.chromaticNumber = (k : ℕ∞) ∧ ∀ e ∈ G.edgeSet, G.IsCriticalEdge e + +/-- +**Erdős Problem 1032** [Er93, p.341]: + +Is there a constant $c > 0$ such that for arbitrarily large $n$, there exists +a $4$-chromatic critical graph on $n$ vertices with minimum degree at least $c \cdot n$? + +Known results: +- Simonovits [Si72] and Toft [To72] independently constructed $4$-chromatic + critical graphs with minimum degree $\gg n^{1/3}$. +- Dirac gave an example of a $6$-chromatic critical graph with minimum degree $> n/2$. +- This problem is also open for $5$-chromatic critical graphs. +-/ +@[category research open, AMS 5] +theorem erdos_1032 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ + ∃ (G : SimpleGraph (Fin n)) (_ : DecidableRel G.Adj), + IsCritical G 4 ∧ (G.minDegree : ℝ) ≥ c * (n : ℝ) := by + sorry + +/-- +**Erdős Problem 1032 (5-chromatic variant)**: + +Is there a constant $c > 0$ such that for arbitrarily large $n$, there exists +a $5$-chromatic critical graph on $n$ vertices with minimum degree at least $c \cdot n$? + +This variant is also mentioned as open in [Er93, p.341]. +-/ +@[category research open, AMS 5] +theorem erdos_1032.variants.five_chromatic : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ + ∃ (G : SimpleGraph (Fin n)) (_ : DecidableRel G.Adj), + IsCritical G 5 ∧ (G.minDegree : ℝ) ≥ c * (n : ℝ) := by + sorry + +end Erdos1032 diff --git a/FormalConjectures/ErdosProblems/1033.lean b/FormalConjectures/ErdosProblems/1033.lean new file mode 100644 index 0000000000..cece7123e7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1033.lean @@ -0,0 +1,63 @@ +/- +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 1033 + +*Reference:* [erdosproblems.com/1033](https://www.erdosproblems.com/1033) + +Let $h(n)$ be such that every graph on $n$ vertices with more than $n^2/4$ edges +contains a triangle whose vertices have degrees summing to at least $h(n)$. +Estimate $h(n)$. In particular, is it true that +$$h(n) \geq (2(\sqrt{3} - 1) - o(1))n?$$ + +Erdős and Laskar [ErLa85] proved $2(\sqrt{3} - 1)n \geq h(n) \geq (1+c)n$ for some $c > 0$. +The lower bound was improved to $(21/16)n$ by Fan [Fa88]. + +[Er93] Erdős, P., _On some of my favourite theorems_ (1993). + +[ErLa85] Erdős, P. and Laskar, R., _A note on the size of a chordal subgraph_. +Congr. Numer. (1985), 81–86. + +[Fa88] Fan, G., _Degree sum for a triangle in a graph_. +J. Graph Theory (1988), 249–263. +-/ + +open SimpleGraph Finset + +namespace Erdos1033 + +/-- +**Erdős Problem 1033** [Er93, p.344]: + +For every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, every graph on +$n$ vertices with more than $n^2/4$ edges contains a triangle whose vertices have +degrees summing to at least $(2(\sqrt{3} - 1) - \varepsilon) \cdot n$. +-/ +@[category research open, AMS 5] +theorem erdos_1033 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.edgeFinset.card > n ^ 2 / 4 → + ∃ u v w : Fin n, G.Adj u v ∧ G.Adj v w ∧ G.Adj u w ∧ + (G.degree u + G.degree v + G.degree w : ℝ) ≥ + (2 * (Real.sqrt 3 - 1) - ε) * (n : ℝ) := by + sorry + +end Erdos1033 diff --git a/FormalConjectures/ErdosProblems/1034.lean b/FormalConjectures/ErdosProblems/1034.lean new file mode 100644 index 0000000000..7f9c8a1a0e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1034.lean @@ -0,0 +1,65 @@ +/- +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 1034 + +A conjecture of Erdős and Faudree, and a stronger version of Problem #905. +Erdős asked whether every dense graph (with more than $n^2/4$ edges) contains a triangle +whose vertices have many common neighbors — specifically, more than $(1/2 - \varepsilon)n$ +vertices each adjacent to at least two of the triangle's vertices. + +*Reference:* [erdosproblems.com/1034](https://www.erdosproblems.com/1034) + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae (1993), 333–350. +-/ + +open Classical SimpleGraph Finset + +namespace Erdos1034 + +/-- The number of vertices in a graph adjacent to at least two of three +given vertices $u$, $v$, $w$. -/ +noncomputable def adjToAtLeastTwoOfTriangle {n : ℕ} (G : SimpleGraph (Fin n)) + (u v w : Fin n) : ℕ := + (Finset.univ.filter fun x : Fin n => + (G.Adj x u ∧ G.Adj x v) ∨ (G.Adj x v ∧ G.Adj x w) ∨ (G.Adj x u ∧ G.Adj x w)).card + +/-- +**Erdős Problem 1034** (Disproved) [Er93, p. 344]: + +For every $\varepsilon > 0$, does there exist $N_0$ such that for all $n \ge N_0$, every graph on +$n$ vertices with more than $n^2 / 4$ edges contains a triangle $\{u, v, w\}$ such that +more than $(1/2 - \varepsilon) \cdot n$ vertices are each adjacent to at least two of $u$, $v$, $w$? + +Disproved by Ma and Tang, who construct a graph with $n$ vertices and +$> n^2 / 4$ edges in which every triangle has at most $(2 - \sqrt{5/2} + o(1))n$ +vertices adjacent to at least two of its vertices ($2 - \sqrt{5/2} \approx 0.4189$). +-/ +@[category research solved, AMS 5] +theorem erdos_1034 : answer(False) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.edgeFinset.card > n ^ 2 / 4 → + ∃ u v w : Fin n, G.Adj u v ∧ G.Adj v w ∧ G.Adj u w ∧ + (adjToAtLeastTwoOfTriangle G u v w : ℝ) > (1 / 2 - ε) * (n : ℝ) := by + sorry + +end Erdos1034 diff --git a/FormalConjectures/ErdosProblems/1035.lean b/FormalConjectures/ErdosProblems/1035.lean new file mode 100644 index 0000000000..1d3f52b8ef --- /dev/null +++ b/FormalConjectures/ErdosProblems/1035.lean @@ -0,0 +1,74 @@ +/- +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 1035 + +*Reference:* [erdosproblems.com/1035](https://www.erdosproblems.com/1035) + +Is there a constant $c > 0$ such that every graph on $2^n$ vertices with minimum degree +$> (1 - c) \cdot 2^n$ contains the $n$-dimensional hypercube $Q_n$ as a subgraph? + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae **16** (1993), 333–350. +-/ + +open SimpleGraph Finset + +namespace Erdos1035 + +/-- The $n$-dimensional hypercube graph $Q_n$: vertices are functions `Fin n → Bool`, +and two vertices are adjacent iff they differ in exactly one coordinate. -/ +def hypercubeGraph (n : ℕ) : SimpleGraph (Fin n → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm u v := by + rintro ⟨hne, hcard⟩ + refine ⟨hne.symm, ?_⟩ + have heq : (Finset.univ.filter fun i => v i ≠ u i) = + (Finset.univ.filter fun i => u i ≠ v i) := + Finset.filter_congr (fun i _ => ne_comm) + rw [heq] + exact hcard + loopless v h := h.1 rfl + +/-- An injective graph homomorphism from $H$ to $G$: $G$ contains a copy of $H$ +as a subgraph. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- +Erdős Conjecture (Problem 1035) [Er93, p.345]: + +Is there a constant $c > 0$ such that every graph on $2^n$ vertices with +minimum degree $> (1 - c) \cdot 2^n$ contains the $n$-dimensional hypercube $Q_n$? + +Formulated as: there exists $c > 0$ such that for all $n$ and for every graph $G$ +on $2^n$ vertices, if every vertex has degree $> (1 - c) \cdot 2^n$, then $G$ contains +a copy of $Q_n$ as a subgraph. +-/ +@[category research open, AMS 5] +theorem erdos_1035 : answer(sorry) ↔ + (∃ c : ℝ, c > 0 ∧ + ∀ n : ℕ, + ∀ (G : SimpleGraph (Fin (2 ^ n))) [DecidableRel G.Adj], + (∀ v : Fin (2 ^ n), + (G.degree v : ℝ) > (1 - c) * (2 ^ n : ℝ)) → + ContainsSubgraph G (hypercubeGraph n)) := by + sorry + +end Erdos1035 diff --git a/FormalConjectures/ErdosProblems/1036.lean b/FormalConjectures/ErdosProblems/1036.lean new file mode 100644 index 0000000000..f5be8b87ae --- /dev/null +++ b/FormalConjectures/ErdosProblems/1036.lean @@ -0,0 +1,70 @@ +/- +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 1036 + +*Reference:* [erdosproblems.com/1036](https://www.erdosproblems.com/1036) + +A question of Erdős and Rényi. Proved by Shelah [Sh98]. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), p.346. + +[Sh98] Shelah, S., _Erdős and Rényi conjecture_. J. Combin. Theory Ser. A 82 (1998), no. 2, +179–185. + +[AlHa91] Alon, N. and Hajnal, A., _Ramsey graphs contain many distinct induced subgraphs_. +Graphs Combin. (1991), 1–6. + +[ErHa89b] Erdős, P. and Hajnal, A., _On the number of distinct induced subgraphs of a graph_. +Discrete Math. (1989), 145–154. +-/ + +open SimpleGraph Finset + +namespace Erdos1036 + +/-- +**Erdős Problem 1036** (Proved by Shelah [Sh98]) [Er93, p.346]: + +For every $c > 0$, there exist $\delta > 0$ and $N_0$ such that for all $n \geq N_0$, if $G$ is a +graph on $n$ vertices with no clique and no independent set of size greater than +$c \cdot \log n$, then $G$ has at least $2^{\delta n}$ pairwise non-isomorphic induced subgraphs. + +Here "trivial graph" means empty (independent set) or complete (clique), and +$\log$ denotes the natural logarithm. +-/ +@[category research solved, AMS 5] +theorem erdos_1036 : + answer(True) ↔ + ∀ c : ℝ, c > 0 → + ∃ δ : ℝ, δ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ c * Real.log n) → + (∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ c * Real.log n) → + ∃ F : Finset (Finset (Fin n)), + (F.card : ℝ) ≥ (2 : ℝ) ^ (δ * (n : ℝ)) ∧ + ∀ S ∈ F, ∀ T ∈ F, S ≠ T → + ¬Nonempty (G.induce (↑S : Set (Fin n)) ≃g G.induce (↑T : Set (Fin n))) := by + sorry + +end Erdos1036 diff --git a/FormalConjectures/ErdosProblems/1037.lean b/FormalConjectures/ErdosProblems/1037.lean new file mode 100644 index 0000000000..80db74bfd2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1037.lean @@ -0,0 +1,73 @@ +/- +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 1037 + +*Reference:* [erdosproblems.com/1037](https://www.erdosproblems.com/1037) + +Let $G$ be a graph on $n$ vertices in which every degree occurs at most twice, +and the number of distinct degrees is $> (\frac{1}{2} + \varepsilon)n$. Must $G$ +contain a trivial (empty or complete) subgraph of size 'much larger' than +$\log n$? + +A question of Chen and Erdős [Er93, p.347]. The answer is no — Cambie, Chan, +Hunter, and Sawhney gave a construction of a graph on $n$ vertices with at least +$\frac{3}{4}n$ distinct degrees, every degree appears at most twice, and the +largest trivial subgraph has size $O(\log n)$. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős +is eighty, Vol. 2 (Keszthely, 1993), 97–132. +-/ + +open SimpleGraph Finset + +namespace Erdos1037 + +/-- +**Erdős Problem 1037** (Disproved by Cambie, Chan, Hunter, Sawhney) [Er93, p.347]: + +Let $G$ be a graph on $n$ vertices in which every degree occurs at most twice, +and the number of distinct degrees is $> (1/2 + \varepsilon) \cdot n$. Must $G$ +contain a trivial (empty or complete) subgraph of size much larger than +$\log n$? + +The answer is no. Cambie, Chan, and Hunter gave a construction where the +largest trivial subgraph has size $O(\log n)$. +-/ +@[category research solved, AMS 5] +theorem erdos_1037 : + answer(False) ↔ + (∀ ε : ℝ, ε > 0 → + ∀ C : ℝ, C > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + ∀ _ : DecidableRel G.Adj, + -- Every degree occurs at most twice + (∀ d : ℕ, (Finset.univ.filter (fun v => G.degree v = d)).card ≤ 2) → + -- The number of distinct degrees is > (1/2 + ε) · n + ((Finset.univ.image (fun v => G.degree v)).card : ℝ) > + (1 / 2 + ε) * (n : ℝ) → + -- G contains a clique or independent set of size > C · log n + (∃ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) ∧ + (S.card : ℝ) > C * Real.log n) ∨ + (∃ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) ∧ + (S.card : ℝ) > C * Real.log n)) := by + sorry + +end Erdos1037 diff --git a/FormalConjectures/ErdosProblems/1039.lean b/FormalConjectures/ErdosProblems/1039.lean new file mode 100644 index 0000000000..072961c7c1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1039.lean @@ -0,0 +1,70 @@ +/- +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 1039 + +*Reference:* [erdosproblems.com/1039](https://www.erdosproblems.com/1039) + +Let $f(z) = \prod_{i=1}^{n} (z - z_i) \in \mathbb{C}[z]$ with $|z_i| \le 1$ for all $i$. Let +$\rho(f)$ be the radius of the largest disc contained in $\{z : |f(z)| < 1\}$. + +Is it true that $\rho(f) \gg 1/n$? + +A problem of Erdős, Herzog, and Piranian [EHP58, p.134]. + +Known results: +- $f(z) = z^n - 1$ gives $\rho(f) \le \pi/(2n)$ +- Pommerenke [Po61] proved $\rho(f) \ge 1/(2en^2)$ +- Krishnapur, Lundberg, Ramachandran [KLR25] proved $\rho(f) \gg 1/(n\sqrt{\log n})$ + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., _Metric properties of polynomials_. J. Analyse +Math. 6 (1958), 125-148. + +[Po61] Pommerenke, Ch., _On metric properties of complex polynomials_. Michigan Math. J. 8 (1961), +97–115. + +[KLR25] Krishnapur, M., Lundberg, E., and Ramachandran, K., _On the area of polynomial +lemniscates_. arXiv:2503.18270 (2025). +-/ + +open Polynomial Classical + +namespace Erdos1039 + +/-- The sublevel radius $\rho(f)$: the supremum of radii $r > 0$ such that some open +disc of radius $r$ is contained in $\{z : \|f(z)\| < 1\}$. -/ +noncomputable def sublevelRadius (f : Polynomial ℂ) : ℝ := + sSup {r : ℝ | r > 0 ∧ ∃ c : ℂ, Metric.ball c r ⊆ {z : ℂ | ‖f.eval z‖ < 1}} + +/-- +Erdős Problem 1039 [EHP58, p.134]: + +For monic complex polynomials of degree $n \ge 1$ with all roots in the closed +unit disk, the sublevel radius $\rho(f)$ is at least $C/n$ for some absolute +constant $C > 0$. +-/ +@[category research open, AMS 30] +theorem erdos_1039 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∀ (n : ℕ) (f : Polynomial ℂ), + 1 ≤ n → f.Monic → f.natDegree = n → + (∀ z ∈ f.roots, ‖z‖ ≤ 1) → + sublevelRadius f ≥ C / (n : ℝ) := by + sorry + +end Erdos1039 diff --git a/FormalConjectures/ErdosProblems/104.lean b/FormalConjectures/ErdosProblems/104.lean new file mode 100644 index 0000000000..7395fa1429 --- /dev/null +++ b/FormalConjectures/ErdosProblems/104.lean @@ -0,0 +1,89 @@ +/- +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 104 + +*Reference:* [erdosproblems.com/104](https://www.erdosproblems.com/104) + +Given $n$ points in $\mathbb{R}^2$, the number of unit circles containing at least three of +the points is $o(n^2)$. Erdős offered £100 for a proof or disproof that the answer is +$O(n^{3/2})$. Elekes [El84] constructed configurations achieving $\gg n^{3/2}$ three-rich unit +circles, and Harborth–Mengersen [HaMe86] proved an upper bound of $n(n-1)/3$. + +See also Problem 506 and Problem 831. OEIS: A003829. + +[Er75h] Erdős, P., _Some problems on elementary geometry_. Australian Mathematical Society +Gazette (1975), 2–3. + +[Er81d] Erdős, P., _Some applications of graph theory and combinatorial methods to number +theory and geometry_. Algebraic Methods in Graph Theory, Vol. I, II (Szeged, 1978) (1981), +137–148. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44–48. + +[HaMe86] Harborth, H. and Mengersen, I., _Point sets with many unit circles_. Discrete +Mathematics (1986), 193–197. + +[El84] Elekes, G., _n points in the plane can determine n^{3/2} unit circles_. Combinatorica +(1984), 131. +-/ + +namespace Erdos104 + +/-- +The number of distinct unit circles in $\mathbb{R}^2$ that contain at least three points +from $P$. A unit circle is uniquely determined by its center (since the radius +is fixed at $1$), so two unit circles are distinct iff they have different centers. +-/ +noncomputable def threeRichUnitCircleCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {c : EuclideanSpace ℝ (Fin 2) | + 3 ≤ Set.ncard {p ∈ (↑P : Set _) | dist p c = 1}} + +/-- +Given $n$ points in $\mathbb{R}^2$, the number of distinct unit circles containing at least +three points is $o(n^2)$. + +Formally: for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$ and every +set $P$ of $n$ points in $\mathbb{R}^2$, the number of unit circles (of radius $1$) that each +contain at least $3$ points of $P$ is at most $\varepsilon \cdot n^2$. +-/ +@[category research open, AMS 52] +theorem erdos_104 : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + (threeRichUnitCircleCount P : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +/-- +A stronger variant of Erdős Problem 104: the number of unit circles containing at least three +points from an $n$-point configuration is $O(n^{3/2})$. Elekes [El84] showed a lower bound of +$\Omega(n^{3/2})$, so this would be tight. Erdős offered £100 for a proof or disproof. +-/ +@[category research open, AMS 52] +theorem erdos_104_upper : + ∃ C : ℝ, C > 0 ∧ + ∀ (n : ℕ) (P : Finset (EuclideanSpace ℝ (Fin 2))), + P.card = n → + (threeRichUnitCircleCount P : ℝ) ≤ C * (n : ℝ) ^ (3 / 2 : ℝ) := by + sorry + +end Erdos104 diff --git a/FormalConjectures/ErdosProblems/1040.lean b/FormalConjectures/ErdosProblems/1040.lean new file mode 100644 index 0000000000..5ec9c3400b --- /dev/null +++ b/FormalConjectures/ErdosProblems/1040.lean @@ -0,0 +1,116 @@ +/- +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 1040 + +*Reference:* [erdosproblems.com/1040](https://www.erdosproblems.com/1040) + +Let $F \subseteq \mathbb{C}$ be a closed infinite set, and let $\mu(F)$ be the infimum of +$|\{z : |f(z)| < 1\}|$ (Lebesgue measure), as $f$ ranges over all polynomials of +the shape $\prod(z - z_i)$ with $z_i \in F$. + +Is $\mu(F) = 0$ whenever the transfinite diameter of $F$ is $\geq 1$? + +The transfinite diameter (logarithmic capacity) of $F$ is defined by +$$\rho(F) = \lim_{n \to \infty} \sup_{z_1,\ldots,z_n \in F} \left(\prod_{i p.1 < p.2)).prod + (fun p => ‖z p.1 - z p.2‖) + +/-- The $n$-th transfinite diameter of $F \subseteq \mathbb{C}$: +$d_n(F) = \sup_{z_1,\ldots,z_n \in F} \left(\prod_{i nthTransfiniteDiam F n)) + +/-- The sublevel set measure $\mu(F, \mu)$: infimum of $\mu(\{z : \|f(z)\| < 1\})$ over +all monic polynomials with roots in $F$. Uses `Fin (n+1)` to ensure at least +one root. -/ +noncomputable def sublevelMeasure (F : Set ℂ) (μ : Measure ℂ) : ℝ≥0∞ := + ⨅ (n : ℕ) (z : Fin (n + 1) → ℂ) (_ : ∀ i, z i ∈ F), + μ {w : ℂ | ‖(univ : Finset (Fin (n + 1))).prod (fun i => w - z i)‖ < 1} + +/-- +Erdős Problem 1040 [EHP58, p.135]: + +Is it true that for every closed infinite set $F \subseteq \mathbb{C}$ with transfinite +diameter $\geq 1$, the infimum of the Lebesgue measure of $\{z : |f(z)| < 1\}$ +over monic polynomials with all roots in $F$ is zero? +-/ +@[category research open, AMS 28 30] +theorem erdos_1040 : answer(sorry) ↔ + ∀ (F : Set ℂ), IsClosed F → F.Infinite → transfiniteDiameter F ≥ 1 → + ∀ (μ : Measure ℂ) [μ.IsAddHaarMeasure], sublevelMeasure F μ = 0 := by + sorry + +/-- +Erdős Problem 1040, partial result [EHP58]: + +Erdős, Herzog, and Piranian showed that the answer to Problem 1040 is affirmative +when $F$ is a closed disc or a line segment with transfinite diameter $\geq 1$. +That is, for such $F$, the infimum $\mu(F) = 0$. +-/ +@[category research solved, AMS 28 30] +theorem erdos_1040_disc (c : ℂ) (r : ℝ) (hr : r > 0) + (hd : transfiniteDiameter (Metric.closedBall c r) ≥ 1) : + ∀ (μ : Measure ℂ) [μ.IsAddHaarMeasure], + sublevelMeasure (Metric.closedBall c r) μ = 0 := by + sorry + +/-- +Erdős Problem 1040, partial result [EHP58]: + +Erdős, Herzog, and Piranian showed that $\mu(F) = 0$ when $F$ is a line segment +(i.e., a closed interval in $\mathbb{C}$) with transfinite diameter $\geq 1$. +-/ +@[category research solved, AMS 28 30] +theorem erdos_1040_segment (a b : ℂ) (hab : a ≠ b) + (hd : transfiniteDiameter (Set.image (fun t : ℝ => (1 - ↑t) * a + ↑t * b) (Set.Icc 0 1)) ≥ 1) : + ∀ (μ : Measure ℂ) [μ.IsAddHaarMeasure], + sublevelMeasure (Set.image (fun t : ℝ => (1 - ↑t) * a + ↑t * b) (Set.Icc 0 1)) μ = 0 := by + sorry + +end Erdos1040 diff --git a/FormalConjectures/ErdosProblems/1042.lean b/FormalConjectures/ErdosProblems/1042.lean new file mode 100644 index 0000000000..b2ef22b5af --- /dev/null +++ b/FormalConjectures/ErdosProblems/1042.lean @@ -0,0 +1,103 @@ +/- +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 1042 + +*Reference:* [erdosproblems.com/1042](https://www.erdosproblems.com/1042) + +A problem of Erdős, Herzog, and Piranian on the number of connected components +of sublevel sets of monic polynomials with roots in a closed set of prescribed +transfinite diameter. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., _Metric properties of +polynomials_, J. Analyse Math. 6 (1958), 125-148. + +[GhRa24] Ghosh, S. and Ramachandran, D., solved both parts of this problem. +-/ + +open Classical Filter Finset + +namespace Erdos1042 + +/-- The product of pairwise distances $\prod_{i p.1 < p.2)).prod + (fun p => ‖z p.1 - z p.2‖) + +/-- The $n$-th transfinite diameter of $F \subseteq \mathbb{C}$: +$$d_n(F) = \sup_{z_1,\ldots,z_n \in F} \left(\prod_{i nthTransfiniteDiam F n)) + +/-- The sublevel set $\{z : \|\prod_i(z - z_i)\| < 1\}$ of a monic polynomial with +given roots. -/ +def sublevelSet {n : ℕ} (z : Fin n → ℂ) : Set ℂ := + {w : ℂ | ‖(univ : Finset (Fin n)).prod (fun i => w - z i)‖ < 1} + +/-- +Erdős Problem 1042, existence [GhRa24]: + +There exists a closed set $F \subset \mathbb{C}$ with transfinite diameter $1$, not contained in +any closed disc of radius $1$, and for infinitely many $n$ there exist $z_1,\ldots,z_n \in F$ +such that $\{z : |\prod(z - z_i)| < 1\}$ has exactly $n$ connected components. +-/ +@[category research solved, AMS 30 31] +theorem erdos_1042 : + ∃ (F : Set ℂ), IsClosed F ∧ transfiniteDiameter F = 1 ∧ + (¬∃ c : ℂ, F ⊆ Metric.closedBall c 1) ∧ + Set.Infinite {n : ℕ | ∃ z : Fin n → ℂ, (∀ i, z i ∈ F) ∧ + Nat.card (ConnectedComponents ↥(sublevelSet z)) = n} := by + sorry + +/-- +Erdős Problem 1042, upper bound [GhRa24]: + +If $F \subset \mathbb{C}$ is closed with $0 < \text{transfinite diameter} < 1$, then there exists +$c > 0$ (depending on $F$) such that for all $n$ and all $z_1,\ldots,z_n \in F$, the number of +connected components of $\{z : |\prod(z - z_i)| < 1\}$ is at most $(1-c) \cdot n$. +-/ +@[category research solved, AMS 30 31] +theorem erdos_1042.variants.upper_bound (F : Set ℂ) (hF : IsClosed F) + (hd_pos : transfiniteDiameter F > 0) (hd_lt : transfiniteDiameter F < 1) : + ∃ c : ℝ, c > 0 ∧ ∀ (n : ℕ) (z : Fin n → ℂ), (∀ i, z i ∈ F) → + (Nat.card (ConnectedComponents ↥(sublevelSet z)) : ℝ) ≤ (1 - c) * n := by + sorry + +/-- +Erdős Problem 1042, connected unique component [GhRa24]: + +If $F \subset \mathbb{C}$ is closed, connected, and has transfinite diameter at most $1/4$, then +for all $n$ and all $z_1,\ldots,z_n \in F$, the sublevel set $\{z : |\prod(z - z_i)| < 1\}$ has +exactly one connected component. +-/ +@[category research solved, AMS 30 31] +theorem erdos_1042.variants.connected_unique_component (F : Set ℂ) (hF : IsClosed F) + (hconn : IsConnected F) (hd : transfiniteDiameter F ≤ 1 / 4) : + ∀ (n : ℕ) (z : Fin n → ℂ), (∀ i, z i ∈ F) → + Nat.card (ConnectedComponents ↥(sublevelSet z)) = 1 := by + sorry + +end Erdos1042 diff --git a/FormalConjectures/ErdosProblems/1044.lean b/FormalConjectures/ErdosProblems/1044.lean new file mode 100644 index 0000000000..066e4974b6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1044.lean @@ -0,0 +1,83 @@ +/- +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 1044 + +*Reference:* [erdosproblems.com/1044](https://www.erdosproblems.com/1044) + +Let $f(z) = \prod_{i=1}^{n} (z - z_i)$ be a monic polynomial with all roots in the closed unit +disk. If $\Lambda(f)$ is the maximum of the lengths of the boundaries of the connected components +of $\{z : |f(z)| < 1\}$, determine the infimum of $\Lambda(f)$ over all such $f$. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, +J. Analyse Math. 6 (1958), 125–148. +-/ + +open Complex Polynomial MeasureTheory + +namespace Erdos1044 + +/-- +The sublevel set $\{z \in \mathbb{C} \mid \|f(z)\| < 1\}$ for a function $f : \mathbb{C} \to \mathbb{C}$. +-/ +noncomputable def lemniscateSublevel (f : ℂ → ℂ) : Set ℂ := + {z : ℂ | ‖f z‖ < 1} + +/-- +$\Lambda(f)$: the supremum of the 1-dimensional Hausdorff measures of the frontiers +of the connected components of $\{z \in \mathbb{C} \mid \|f(z)\| < 1\}$. A connected component +containing $x$ in the sublevel set $S$ is `connectedComponentIn S x`. + +Note: this computes a supremum (`sSup`), not a literal maximum. For polynomial lemniscates +the number of connected components is finite, so the supremum is attained. +-/ +noncomputable def maxBoundaryLength (f : ℂ → ℂ) : ℝ := + sSup {ℓ : ℝ | ∃ x ∈ lemniscateSublevel f, + ℓ = (Measure.hausdorffMeasure 1 + (frontier (connectedComponentIn (lemniscateSublevel f) x))).toReal} + +/-- +Erdős Problem 1044 (Erdős–Herzog–Piranian [EHP58]): + +Let $f(z) = \prod_{i=1}^{n} (z - z_i) \in \mathbb{C}[z]$ where $|z_i| \leq 1$ for all $i$. If $\Lambda(f)$ +is the maximum of the lengths of the boundaries of the connected components +of $\{z : |f(z)| < 1\}$, then the infimum of $\Lambda(f)$ over all such $f$ equals $2$. + +Resolved by Tang, who proved that the infimum of $\Lambda(f)$ over all such $f$ is $2$. +-/ +@[category research solved, AMS 30] +theorem erdos_1044 : + sInf {L : ℝ | ∃ (f : Polynomial ℂ), f.Monic ∧ (∀ z, f.IsRoot z → ‖z‖ ≤ 1) ∧ + L = maxBoundaryLength (fun z => Polynomial.eval z f)} = answer((2 : ℝ)) := by + sorry + +/-- +Tang's conjecture: For fixed degree $n \geq 1$, the infimum of $\Lambda(f)$ over all monic +polynomials of degree $n$ with roots in the closed unit disk is attained by $f_n(z) = z^n - 1$. +Tang has verified this for $n = 1$ and $n = 2$. +-/ +@[category research open, AMS 30] +theorem erdos_1044_variant (n : ℕ) (hn : 1 ≤ n) : + maxBoundaryLength (fun z => Polynomial.eval z (X ^ n - 1 : Polynomial ℂ)) = + sInf {L : ℝ | ∃ (f : Polynomial ℂ), f.Monic ∧ f.natDegree = n ∧ + (∀ z, f.IsRoot z → ‖z‖ ≤ 1) ∧ + L = maxBoundaryLength (fun z => Polynomial.eval z f)} := by + sorry + +end Erdos1044 diff --git a/FormalConjectures/ErdosProblems/1045.lean b/FormalConjectures/ErdosProblems/1045.lean new file mode 100644 index 0000000000..39e154c532 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1045.lean @@ -0,0 +1,88 @@ +/- +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 1045 + +*Reference:* [erdosproblems.com/1045](https://www.erdosproblems.com/1045) + +Let $z_1, \ldots, z_n \in \mathbb{C}$ with $|z_i - z_j| \le 2$ for all $i, j$, and +$$\Delta(z_1, \ldots, z_n) = \prod_{i \neq j} |z_i - z_j|.$$ + +What is the maximum possible value of $\Delta$? Is it maximised by taking the $z_i$ +to be the vertices of a regular polygon inscribed in a circle of diameter $2$? + +A problem of Erdős, Herzog, and Piranian [EHP58]. Pommerenke [Po61] proved +the upper bound $\Delta \le 2^{O(n)} n^n$. Hu and Tang found counterexamples for +$n = 4$ and $n = 6$. Cambie showed that the regular polygon does not maximise +$\Delta$ for any even $n \ge 4$. Cambie, Dong, and Tang gave better constructions. +Sothanaphan [So25] proved a lower bound $\liminf (\max \Delta / n^n) \ge C \approx 1.0378$. +The question remains open for odd $n$. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., _Metric properties of polynomials_, +J. Analyse Math. **6** (1958), 125–148. + +[Po61] Pommerenke, Ch., _On metric properties of complex polynomials_, +Michigan Math. J. (1961), 97–115. + +[So25] Sothanaphan, N., _An improved lower bound to Erdős' problem concerning +products of distances for fixed diameter_, arXiv:2512.14251 (2025). +-/ + +open Complex Finset BigOperators + +namespace Erdos1045 + +/-- The product $\Delta(z) = \prod_{i \neq j} \|z_i - z_j\|$ for a configuration +$z : \mathrm{Fin}\; n \to \mathbb{C}$. -/ +noncomputable def erdosDelta (n : ℕ) (z : Fin n → ℂ) : ℝ := + ∏ i : Fin n, ∏ j : Fin n, if i ≠ j then ‖z i - z j‖ else 1 + +/-- The vertices of a regular $n$-gon inscribed in the unit circle (diameter $2$). -/ +noncomputable def regularNGon (n : ℕ) : Fin n → ℂ := + fun k => exp (ofReal (2 * Real.pi * (k.val : ℝ) / (n : ℝ)) * I) + +/-- +Erdős Problem 1045 [EHP58]: + +Is it true that for all $n \ge 1$ and all $z_1, \ldots, z_n \in \mathbb{C}$ with +$|z_i - z_j| \le 2$, the product $\Delta(z_1, \ldots, z_n) = \prod_{i \neq j} |z_i - z_j|$ +is maximised when the $z_i$ are the vertices of a regular $n$-gon inscribed in a circle +of diameter $2$? + +This has been disproved for all even $n \ge 4$ (Hu–Tang, Cambie). +-/ +@[category research solved, AMS 30] +theorem erdos_1045 : answer(False) ↔ + ∀ (n : ℕ) (_ : n ≥ 1) (z : Fin n → ℂ) (_ : ∀ i j : Fin n, ‖z i - z j‖ ≤ 2), + erdosDelta n z ≤ erdosDelta n (regularNGon n) := by + sorry + +/-- +The conjecture remains open for odd $n$: for all odd $n \ge 1$ and all +$z_1, \ldots, z_n \in \mathbb{C}$ with $|z_i - z_j| \le 2$, is $\Delta$ maximised by the +regular $n$-gon? +-/ +@[category research open, AMS 30] +theorem erdos_1045.variants.odd : answer(sorry) ↔ + ∀ (n : ℕ) (_ : n ≥ 1) (_ : Odd n) (z : Fin n → ℂ) + (_ : ∀ i j : Fin n, ‖z i - z j‖ ≤ 2), + erdosDelta n z ≤ erdosDelta n (regularNGon n) := by + sorry + +end Erdos1045 diff --git a/FormalConjectures/ErdosProblems/1046.lean b/FormalConjectures/ErdosProblems/1046.lean new file mode 100644 index 0000000000..bbd35e1de0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1046.lean @@ -0,0 +1,86 @@ +/- +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 1046 + +*Reference:* [erdosproblems.com/1046](https://www.erdosproblems.com/1046) + +A problem of Erdős, Herzog, and Piranian [EHP58]. The answer is yes, +proved by Pommerenke [Po59]. Their additional conjecture that the width of +$\{ z : |f(z)| \leq 1 \}$ is always at most $2$ was disproved by Pommerenke. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, +J. Analyse Math. 6 (1958), 125-148. + +[Po59] Pommerenke, Ch., *Über die Kapazität ebener Kontinuen*, +Math. Ann. 139 (1959), 64-75. +-/ + +open Complex Polynomial Metric Set + +namespace Erdos1046 + +/-- +Erdős Problem 1046 [EHP58, p. 143]: + +For any monic polynomial $f \in \mathbb{C}[x]$, if the set +$E = \{ z \in \mathbb{C} : \|f(z)\| < 1 \}$ is connected, then $E$ is contained in a +closed disc of radius $2$. + +Proved by Pommerenke [Po59]. +-/ +@[category research solved, AMS 30] +theorem erdos_1046 : answer(True) ↔ + ∀ (f : Polynomial ℂ), f.Monic → + let E := {z : ℂ | ‖Polynomial.eval z f‖ < 1} + IsConnected E → + ∃ c : ℂ, E ⊆ closedBall c 2 := by + sorry + +/-- +Strengthening of Erdős Problem 1046: Pommerenke [Po59] proved that the center of the +containing disc of radius $2$ can be taken to be the centroid (arithmetic mean) of the +roots of $f$, i.e., $\frac{z_1 + \cdots + z_n}{n}$. +-/ +@[category research solved, AMS 30] +theorem erdos_1046_centroid : + ∀ (f : Polynomial ℂ), f.Monic → + let E := {z : ℂ | ‖Polynomial.eval z f‖ < 1} + IsConnected E → + E ⊆ closedBall (f.roots.sum / (f.natDegree : ℂ)) 2 := by + sorry + +/-- +Width conjecture from [EHP58]: Erdős, Herzog, and Piranian conjectured that if +$\{ z : |f(z)| \leq 1 \}$ is connected, then its width is at most $2$. This was disproved +by Pommerenke [Po59], who gave an example with width $> \sqrt{3} \cdot 2^{1/3} \approx 2.18$. + +The width of a planar set $S$ is the infimum over unit directions $u$ of +$\sup_{z_1, z_2 \in S} |\operatorname{Re}((z_1 - z_2) \cdot \bar{u})|$. +-/ +@[category research solved, AMS 30] +theorem erdos_1046_width : answer(False) ↔ + ∀ (f : Polynomial ℂ), f.Monic → + let E := {z : ℂ | ‖Polynomial.eval z f‖ ≤ 1} + IsConnected E → + ∃ u : ℂ, ‖u‖ = 1 ∧ ∀ z₁ ∈ E, ∀ z₂ ∈ E, + |((z₁ - z₂) * starRingEnd ℂ u).re| ≤ 2 := by + sorry + +end Erdos1046 diff --git a/FormalConjectures/ErdosProblems/1047.lean b/FormalConjectures/ErdosProblems/1047.lean new file mode 100644 index 0000000000..33011e6cac --- /dev/null +++ b/FormalConjectures/ErdosProblems/1047.lean @@ -0,0 +1,69 @@ +/- +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 1047 + +*Reference:* [erdosproblems.com/1047](https://www.erdosproblems.com/1047) + +Let $f \in \mathbb{C}[x]$ be a monic polynomial with $m$ distinct roots, and let $c > 0$ be a +constant small enough such that $\{ z : |f(z)| \leq c \}$ has $m$ distinct connected +components. Must all these components be convex? + +A question of Grunsky, reported by Erdős, Herzog, and Piranian [EHP58, p.145]. + +The answer is no, as shown by Pommerenke [Po61], who proved that for +$f(z) = z^k(z-a)$ with $k$ sufficiently large and $a$ close to $(1+1/k)k^{1/(k+1)}$, +the set $\{ z : |f(z)| \leq 1 \}$ has two components and the one containing $0$ is +not convex. + +Goodman [Go66] gave further examples, including $(z^2+1)(z-2)^2$ with explicit $c$. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., _Metric properties of polynomials_. J. Analyse +Math. 6 (1958), 125-148. + +[Po61] Pommerenke, Ch., _On metric properties of complex polynomials_. Michigan Math. J. 8 (1961), +97–115. + +[Go66] Goodman, A. W., _On the convexity of the level curves of a polynomial_. Proc. Amer. Math. +Soc. 17 (1966), 358-361. +-/ + +open Complex Polynomial Set + +namespace Erdos1047 + +/-- +Erdős Problem 1047 (Grunsky's question, [EHP58, p.145]): + +For a monic polynomial $f \in \mathbb{C}[x]$ with $m$ distinct roots and $c > 0$ such that +the sublevel set $S = \{ z : \|f(z)\| \leq c \}$ has exactly $m$ connected components, +must all these components be convex? + +Answered in the negative by Pommerenke [Po61]. +-/ +@[category research solved, AMS 30 52] +theorem erdos_1047 : answer(False) ↔ + ∀ (f : Polynomial ℂ), f.Monic → + ∀ (c : ℝ), c > 0 → + let S := {z : ℂ | ‖Polynomial.eval z f‖ ≤ c} + Set.ncard (connectedComponentIn S '' S) = f.roots.toFinset.card → + ∀ x ∈ S, Convex ℝ (connectedComponentIn S x) := by + sorry + +end Erdos1047 diff --git a/FormalConjectures/ErdosProblems/1048.lean b/FormalConjectures/ErdosProblems/1048.lean new file mode 100644 index 0000000000..1138c36177 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1048.lean @@ -0,0 +1,59 @@ +/- +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 1048 + +Erdős, Herzog, and Piranian asked whether, for a monic polynomial over ℂ with all roots in a +disk of radius r < 2, the sublevel set {z : |f(z)| < 1} must contain a connected component of +diameter greater than 2 − r. Pommerenke disproved this for r > 1. + +*Reference:* [erdosproblems.com/1048](https://www.erdosproblems.com/1048) + +[EHP58] Erdős, P., Herzog, F. and Piranian, G., *Metric properties of polynomials*, +J. Analyse Math. 6 (1958), 125-148. + +[Po61] Pommerenke, Ch., *On metric properties of complex polynomials*, +Michigan Math. J. 8 (1961), 97-115. +-/ + +open Polynomial Metric + +namespace Erdos1048 + +/-- +Erdős Problem 1048 [EHP58, p.142] (disproved by Pommerenke [Po61]): + +If $f \in \mathbb{C}[x]$ is a monic polynomial with all roots satisfying $|z| \leq r$ for some +$r < 2$, must $\{ z : |f(z)| < 1 \}$ have a connected component with diameter $> 2 - r$? + +Pommerenke [Po61] proved the answer is no for $r > 1$, showing that if +$f(z) = z^n - r^n$ then $\{ z : |f(z)| \leq 1 \}$ has $n$ connected components, all with +diameter $\to 0$ as $n \to \infty$. + +For $0 < r \leq 1$, the answer is yes (also Pommerenke [Po61]). +-/ +@[category research solved, AMS 30] +theorem erdos_1048 : answer(False) ↔ + ∀ (r : ℝ), 0 < r → r < 2 → ∀ (f : Polynomial ℂ), f.Monic → + (∀ z ∈ f.roots, ‖z‖ ≤ r) → + let S := {z : ℂ | ‖Polynomial.eval z f‖ < 1} + ∃ z ∈ S, 2 - r < diam (connectedComponentIn S z) := by + sorry + +end Erdos1048 diff --git a/FormalConjectures/ErdosProblems/105.lean b/FormalConjectures/ErdosProblems/105.lean new file mode 100644 index 0000000000..f40c26a211 --- /dev/null +++ b/FormalConjectures/ErdosProblems/105.lean @@ -0,0 +1,72 @@ +/- +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 105 + +*Reference:* [erdosproblems.com/105](https://www.erdosproblems.com/105) + +Erdős–Purdy conjecture (disproved, $50 prize): given $n$ points in $\mathbb{R}^2$, not all +collinear, and a disjoint set of $n - 3$ points, must there exist a line through at least two +of the first set that avoids the second? Counterexamples were found by Xichuan. + +Beck [Be83] and Szemerédi–Trotter [SzTr83] proved the analogous statement holds when +$|B| = cn$ for a constant $c > 0$ (see Problem #211). + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium 107 (1995). + +[ErPu95] Erdős, P. and Purdy, G., _Two combinatorial problems in the plane_. +Discrete & Computational Geometry (1995), 441–443. + +[Be83] Beck, J., _On the lattice property of the plane and some problems of Dirac, +Motzkin and Erdős in combinatorial geometry_. Combinatorica 3 (1983), 281–297. + +[SzTr83] Szemerédi, E. and Trotter, W.T., _Extremal problems in discrete geometry_. +Combinatorica 3 (1983), 381–392. +-/ + +namespace Erdos105 + +/-- +Erdős Problem \#105 (Erdős–Purdy): +Let $A, B \subset \mathbb{R}^2$ be disjoint finite sets with $|A| = n$ and $|B| = n - 3$, +with not all of $A$ contained on a single line. The conjecture asks whether +there must exist a line containing at least two points from $A$ and no points +from $B$. + +Note: This conjecture has been disproved. Xichuan found three explicit +counterexamples. It remains open whether the result holds with $n - 4$ (or +more generally with $n - O(1)$ or $(1 - o(1))n$ points in $B$). +The condition $n - 2$ is known to fail via a construction of Hickerson. +-/ +@[category research solved, AMS 5 52] +theorem erdos_105 : answer(False) ↔ + ∀ n : ℕ, 3 ≤ n → + ∀ A B : Finset (EuclideanSpace ℝ (Fin 2)), + A.card = n → + B.card = n - 3 → + Disjoint A B → + ¬ Collinear ℝ (A : Set (EuclideanSpace ℝ (Fin 2))) → + ∃ L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)), + Module.finrank ℝ L.direction = 1 ∧ + 2 ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (A : Set _) ∧ p ∈ L} ∧ + ∀ p : EuclideanSpace ℝ (Fin 2), p ∈ (B : Set _) → p ∉ L := by + sorry + +end Erdos105 diff --git a/FormalConjectures/ErdosProblems/1050.lean b/FormalConjectures/ErdosProblems/1050.lean new file mode 100644 index 0000000000..5779c430b0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1050.lean @@ -0,0 +1,83 @@ +/- +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 1050 + +*Reference:* [erdosproblems.com/1050](https://www.erdosproblems.com/1050) + +Is $\sum_{n=1}^{\infty} \frac{1}{2^n - 3}$ irrational? + +Erdős [Er48] proved that $\sum 1/(2^n - 1) = \sum \tau(n)/2^n$ is irrational (where +$\tau(n)$ is the divisor function). He notes [Er88c] that $\sum 1/(2^n + t)$ should be +transcendental for every integer $t$ (with the obvious exception $t = 0$). + +This was proved by Borwein [Bo91], who more generally proved that, for any +integer $q \geq 2$ and rational $r \neq 0$ (distinct from $-q^n$ for all $n \geq 1$), the +series $\sum_{n=1}^{\infty} 1/(q^n + r)$ is irrational. + +[Er48] Erdős, P., _On arithmetical properties of Lambert series_. J. Indian Math. Soc. (N.S.) +(1948), 63-66. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er88c] Erdős, P., _On the irrationality of certain series: problems and results_. New advances +in transcendence theory (Durham, 1986) (1988), 102-109. + +[Bo91] Borwein, P., _On the irrationality of $\sum(1/(q^n+r))$_. J. Number Theory (1991), +253-259. +-/ + +namespace Erdos1050 + +/-- +Erdős Problem 1050 [ErGr80, p.62] [Er88c, p.102]: + +The sum $\sum_{n=1}^{\infty} \frac{1}{2^n - 3}$ is irrational. + +Proved by Borwein [Bo91]. +-/ +@[category research solved, AMS 11 40] +theorem erdos_1050 : answer(True) ↔ + Irrational (∑' (n : ℕ+), (1 : ℝ) / ((2 : ℝ) ^ (n : ℕ) - 3)) := by + sorry + +/-- +Borwein's general irrationality result [Bo91]: for any integer $q \geq 2$ and rational +$r \neq 0$ (with $r \neq -q^n$ for all $n \geq 1$), the series +$\sum_{n=1}^{\infty} 1/(q^n + r)$ is irrational. +-/ +@[category research solved, AMS 11 40] +theorem erdos_1050.variants.borwein_general (q : ℤ) (r : ℚ) (hq : q ≥ 2) (hr : r ≠ 0) + (hqr : ∀ n : ℕ+, (r : ℝ) ≠ -(q : ℝ) ^ (n : ℕ)) : + Irrational (∑' n : ℕ+, 1 / ((q : ℝ) ^ (n : ℕ) + (r : ℝ))) := by + sorry + +/-- +Erdős conjectured [Er88c] that $\sum 1/(2^n + t)$ should be transcendental for every +nonzero integer $t$ (with $t \neq -2^n$ for all $n \geq 1$). Borwein [Bo91] proved +irrationality but the transcendence question remains open. +-/ +@[category research open, AMS 11 40] +theorem erdos_1050.variants.transcendence : + answer(sorry) ↔ ∀ t : ℤ, t ≠ 0 → (∀ n : ℕ+, (t : ℝ) ≠ -(2 : ℝ) ^ (n : ℕ)) → + Transcendental ℚ (∑' n : ℕ+, 1 / ((2 : ℝ) ^ (n : ℕ) + (t : ℝ))) := by + sorry + +end Erdos1050 diff --git a/FormalConjectures/ErdosProblems/1053.lean b/FormalConjectures/ErdosProblems/1053.lean new file mode 100644 index 0000000000..4244c2eab6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1053.lean @@ -0,0 +1,68 @@ +/- +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 1053 + +*Reference:* [erdosproblems.com/1053](https://www.erdosproblems.com/1053) + +Call a number $k$-perfect if $\sigma(n) = kn$, where $\sigma(n)$ is the sum of the divisors +of $n$. Must $k = o(\log \log n)$? + +A question of Erdős, as reported in problem B2 of Guy's collection. Guy also notes that it has +been suggested that there may be only finitely many $k$-perfect numbers with $k \geq 3$. The +largest known $k$-value for which a $k$-perfect number has been discovered is $k = 11$. + +[Gu04] Guy, R., *Unsolved Problems in Number Theory*, 3rd edition, Springer, 2004. +-/ + +open scoped ArithmeticFunction.sigma +open Real + +namespace Erdos1053 + +/-- A natural number $n$ is $k$-perfect if $n \geq 1$ and $\sigma(n) = k \cdot n$. -/ +def IsMultiplyPerfect (n k : ℕ) : Prop := + n ≥ 1 ∧ σ 1 n = k * n + +/-- +Erdős Problem 1053 [Gu04]: + +If $n$ is a $k$-perfect number ($\sigma(n) = kn$), must $k = o(\log \log n)$ as $n \to \infty$ +among multiply perfect numbers? + +Equivalently: for every $\varepsilon > 0$, the set of multiply perfect numbers $n$ +with $\sigma(n)/n \geq \varepsilon \cdot \log(\log(n))$ is finite. +-/ +@[category research open, AMS 11] +theorem erdos_1053 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + Set.Finite {n : ℕ | ∃ k : ℕ, IsMultiplyPerfect n k ∧ + (k : ℝ) ≥ ε * Real.log (Real.log (n : ℝ))} := by + sorry + +/-- +A stronger variant suggested by Guy [Gu04]: there are only finitely many $k$-perfect numbers +with $k \geq 3$. This implies the main conjecture `erdos_1053`. +-/ +@[category research open, AMS 11] +theorem erdos_1053_variant : answer(sorry) ↔ + Set.Finite {n : ℕ | ∃ k : ℕ, k ≥ 3 ∧ IsMultiplyPerfect n k} := by + sorry + +end Erdos1053 diff --git a/FormalConjectures/ErdosProblems/1057.lean b/FormalConjectures/ErdosProblems/1057.lean new file mode 100644 index 0000000000..9a169cd903 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1057.lean @@ -0,0 +1,89 @@ +/- +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.Nat.Prime.Composite + +/-! +# Erdős Problem 1057 + +*Reference:* [erdosproblems.com/1057](https://www.erdosproblems.com/1057) + +Let $C(x)$ count the number of Carmichael numbers in $[1, x]$. Is it true that +$C(x) = x^{1-o(1)}$? + +A Carmichael number is a composite $n > 1$ such that $a^n \equiv a \pmod{n}$ for all $a$. +By Korselt's criterion, this is equivalent to $n$ being squarefree, composite, +and $p - 1 \mid n - 1$ for all primes $p \mid n$. + +Alford, Granville, and Pomerance [AGP94] proved $C(x) \to \infty$ and $C(x) > x^{2/7}$. +Harman [Ha08] improved the lower bound to $C(x) > x^{0.33336704}$. +Lichtman [Li22] further improved this to $C(x) > x^{0.3389}$. + +Erdős [Er56c] proved $C(x) < x \exp(-c \log x \log \log \log x / \log \log x)$ for some $c > 0$. +Pomerance [Po89] gave the heuristic that +$C(x) = x \exp(-(1+o(1)) \log x \log \log \log x / \log \log x)$. + +This is problem A13 in Guy's collection [Gu04]. See also OEIS A006931. + +[AGP94] Alford, W. R., Granville, A., and Pomerance, C., _There are infinitely many Carmichael +numbers_. Annals of Mathematics (2) (1994), 703–722. + +[Er56c] Erdős, P., _On pseudoprimes and Carmichael numbers_. Publ. Math. Debrecen (1956), +201–206. + +[Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), xviii+437. + +[Ha08] Harman, G., _Watt's mean value theorem and Carmichael numbers_. International Journal of +Number Theory (2008), 241–248. + +[Li22] Lichtman, J. D., _Primes in arithmetic progressions to large moduli and shifted primes +without large prime factors_. arXiv:2211.09641 (2022). + +[Po89] Pomerance, C., _Two methods in elementary analytic number theory_. (1989), 135–161. +-/ + +open Finset Filter Real Classical + +namespace Erdos1057 + +/-- A natural number $n$ is a Carmichael number if $n$ is composite, +$n$ is squarefree, and $p - 1 \mid n - 1$ for every prime $p$ dividing $n$. +(This is Korselt's criterion.) -/ +def IsCarmichael (n : ℕ) : Prop := + n.Composite ∧ Squarefree n ∧ ∀ p : ℕ, p.Prime → p ∣ n → (p - 1) ∣ (n - 1) + +/-- $C(x)$ counts the number of Carmichael numbers in $\{1, \ldots, x\}$. -/ +noncomputable def carmichaelCount (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter (fun n => IsCarmichael n)).card + +/-- +Erdős Problem 1057 [Er56c]: + +Is it true that $C(x) = x^{1-o(1)}$? That is, does $\log C(x) / \log x \to 1$ +as $x \to \infty$? + +This asks whether the Carmichael counting function grows almost as fast +as $x$ itself, in the sense that the exponent approaches 1. +-/ +@[category research open, AMS 11] +theorem erdos_1057 : answer(sorry) ↔ + Tendsto + (fun x : ℕ => Real.log (carmichaelCount x : ℝ) / Real.log (x : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos1057 diff --git a/FormalConjectures/ErdosProblems/1058.lean b/FormalConjectures/ErdosProblems/1058.lean new file mode 100644 index 0000000000..9886cbbe77 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1058.lean @@ -0,0 +1,65 @@ +/- +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 1058 + +*Reference:* [erdosproblems.com/1058](https://www.erdosproblems.com/1058) + +Let $2 = p_1 < p_2 < \cdots$ be the sequence of prime numbers. Are there only +finitely many $n$ such that $n \in [p_{k-1}, p_k)$ and the only primes dividing +$n! + 1$ are $p_k$ and $p_{k+1}$? + +A conjecture of Erdős and Stewart, as reported in problem A2 of Guy's +collection [Gu04]. The only known cases are $n = 1, 2, 3, 4, 5$. + +Luca [Lu01] proved that indeed these are the only solutions. + +[Gu04] Guy, R., _Unsolved Problems in Number Theory_, 3rd ed. Springer, 2004. + +[Lu01] Luca, F., _On a conjecture of Erdős and Stewart_, Math. Comp. 70 (2001), +893–896. +-/ + +namespace Erdos1058 + +/-- +Erdős Problem 1058 (Erdős–Stewart conjecture): + +There are only finitely many natural numbers $n$ such that every prime +divisor of $n! + 1$ belongs to $\{q, r\}$, where $q$ is the smallest prime +greater than $n$ and $r$ is the smallest prime greater than $q$. + +Equivalently, if $p_{k-1} \le n < p_k$ in the sequence of primes, +then $n! + 1$ has no prime factor other than $p_k$ and $p_{k+1}$. + +Proved by Luca [Lu01] (2001): the only solutions are $n = 1, 2, 3, 4, 5$. +-/ +@[category research solved, AMS 11] +theorem erdos_1058 : + answer(True) ↔ + Set.Finite {n : ℕ | ∃ (q r : ℕ), + -- q is the smallest prime strictly greater than n + Nat.Prime q ∧ n < q ∧ (∀ p, Nat.Prime p → n < p → q ≤ p) ∧ + -- r is the next prime after q + Nat.Prime r ∧ q < r ∧ (∀ p, Nat.Prime p → q < p → r ≤ p) ∧ + -- every prime factor of n! + 1 is either q or r + (n.factorial + 1).primeFactors ⊆ {q, r}} := by + sorry + +end Erdos1058 diff --git a/FormalConjectures/ErdosProblems/106.lean b/FormalConjectures/ErdosProblems/106.lean new file mode 100644 index 0000000000..36e46c0474 --- /dev/null +++ b/FormalConjectures/ErdosProblems/106.lean @@ -0,0 +1,172 @@ +/- +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 106 + +*Reference:* [erdosproblems.com/106](https://www.erdosproblems.com/106) + +Draw $n$ non-overlapping squares (possibly rotated) inside the unit square. Let $f(n)$ be +the maximum total side length. Is $f(k^2 + 1) = k$ for every positive integer $k$? + +## References + +* [Er94b] Erdős, P., _Some problems in number theory, combinatorics and combinatorial + geometry_. Math. Pannon. **5** (1994), 261–269. +* [ErSo95] Erdős, P., Soifer, A., _Squares in a square_. Geombinatorics **4** (1995), + 110–114. +* [Ha84] Halász, S., _Packing a convex domain with similar convex domains_. J. Combin. + Theory Ser. A **37** (1984), 85–90. +* [CaSt05] Campbell, C., Staton, W., _A square-packing problem of Erdős_. Amer. Math. + Monthly **112** (2005), 165–167. +* [Pr08] Praton, I., _Packing squares in a square_. Math. Mag. **81** (2008), 358–361. +* [BKU24] Baek, J., Koizumi, J., Ueoro, T., _A note on the Erdős conjecture about + square packing_. arXiv:2411.07274 (2024). +* [Ra26] Raj Singh, A., _On a square packing conjecture of Erdős_. arXiv:2601.22163 + (2026). +-/ + +open BigOperators Real + +namespace Erdos106 + +/-- +A square placement in $\mathbb{R}^2$: a center point, a positive side length, and a +rotation angle (in radians) measuring how far the square is rotated from +the standard axis-aligned orientation. +-/ +structure SquarePlacement where + center : ℝ × ℝ + side : ℝ + angle : ℝ + side_pos : 0 < side + +/-- +The closed region occupied by a square placement. A point $p$ lies in the +region iff, when translated so the center is at the origin and then rotated +by $-\mathrm{angle}$, its coordinates both lie in $[-\mathrm{side}/2, \mathrm{side}/2]$. +-/ +noncomputable def SquarePlacement.region (sq : SquarePlacement) : Set (ℝ × ℝ) := + {p : ℝ × ℝ | + let u := (p.1 - sq.center.1) * cos sq.angle + (p.2 - sq.center.2) * sin sq.angle + let v := -(p.1 - sq.center.1) * sin sq.angle + (p.2 - sq.center.2) * cos sq.angle + |u| ≤ sq.side / 2 ∧ |v| ≤ sq.side / 2} + +/-- +The open interior of a square placement (strict inequalities). +-/ +noncomputable def SquarePlacement.sqInterior (sq : SquarePlacement) : Set (ℝ × ℝ) := + {p : ℝ × ℝ | + let u := (p.1 - sq.center.1) * cos sq.angle + (p.2 - sq.center.2) * sin sq.angle + let v := -(p.1 - sq.center.1) * sin sq.angle + (p.2 - sq.center.2) * cos sq.angle + |u| < sq.side / 2 ∧ |v| < sq.side / 2} + +/-- +The unit square $[0,1]^2 \subseteq \mathbb{R}^2$. +-/ +def unitSquare : Set (ℝ × ℝ) := + {p : ℝ × ℝ | 0 ≤ p.1 ∧ p.1 ≤ 1 ∧ 0 ≤ p.2 ∧ p.2 ≤ 1} + +/-- +A valid configuration of $n$ squares inside the unit square: +1. Each square's closed region is contained in the unit square. +2. No two distinct squares share an interior point (their open interiors + are disjoint). +-/ +def IsValidSquareConfig (n : ℕ) (config : Fin n → SquarePlacement) : Prop := + (∀ i : Fin n, (config i).region ⊆ unitSquare) ∧ + (∀ i j : Fin n, i ≠ j → Disjoint (config i).sqInterior (config j).sqInterior) + +/-- +$f(n)$ is the supremum of the total side-length sum over all valid configurations +of $n$ (possibly rotated) squares inside the unit square with pairwise disjoint +interiors. +-/ +noncomputable def f (n : ℕ) : ℝ := + sSup {s : ℝ | ∃ config : Fin n → SquarePlacement, + IsValidSquareConfig n config ∧ s = ∑ i : Fin n, (config i).side} + +/-- +Erdős Problem 106: + +Draw $n$ squares (not necessarily axis-aligned) inside the unit square $[0,1]^2$ +with no two squares sharing a common interior point. Let $f(n)$ be the maximum +possible sum of the side-lengths of the squares. + +**Conjecture**: $f(k^2 + 1) = k$ for every positive integer $k$. + +Background: +- It follows easily from the Cauchy–Schwarz inequality that $f(k^2) = k$. +- The lower bound $f(k^2 + 1) \geq k$ is elementary: subdivide $[0,1]^2$ into $k^2$ + squares of side $1/k$, then replace any one of them by two squares of side + $1/(2k)$; the total side-length is $(k^2 - 1)/k + 2 \cdot 1/(2k) = k$. +- The conjecture asserts that this lower bound is tight: no configuration of + $k^2 + 1$ squares can exceed the total side-length $k$ achievable with $k^2$ squares. +- Baek, Koizumi, and Ueoro [BKU24] proved the axis-aligned variant: if all + squares are required to have sides parallel to the coordinate axes, then the + supremum equals $k$. +- Praton [Pr08] proved that the full conjecture (determining $f(n)$ for all $n$) is + equivalent to $f(k^2 + 1) = k$. +- Raj Singh [Ra26] proved that $f(k^2+1) = k$ for all $k$ is equivalent to + $f(k^2+1) = k$ for infinitely many $k$. +-/ +@[category research open, AMS 52] +theorem erdos_106 : + answer(sorry) ↔ ∀ k : ℕ, 0 < k → f (k ^ 2 + 1) = (k : ℝ) := by + sorry + +/-- +A valid axis-aligned configuration of $n$ squares inside the unit square: each square +has rotation angle $0$ (sides parallel to the coordinate axes), each square's closed +region is contained in the unit square, and distinct squares have disjoint open interiors. +-/ +def IsValidAxisAlignedConfig (n : ℕ) (config : Fin n → SquarePlacement) : Prop := + (∀ i : Fin n, (config i).angle = 0) ∧ IsValidSquareConfig n config + +/-- +$g(n)$ is the supremum of the total side-length sum over all valid axis-aligned +configurations of $n$ squares inside the unit square with pairwise disjoint interiors. +-/ +noncomputable def g (n : ℕ) : ℝ := + sSup {s : ℝ | ∃ config : Fin n → SquarePlacement, + IsValidAxisAlignedConfig n config ∧ s = ∑ i : Fin n, (config i).side} + +/-- +Axis-aligned variant of Erdős Problem 106, proved by Baek, Koizumi, and Ueoro [BKU24]: +if all $n$ squares are required to have sides parallel to the coordinate axes, then +$g(k^2 + 1) = k$ for every positive integer $k$. They also proved the more general +result $g(k^2 + 2c + 1) = k + c/k$ for $-k < c < k$. +-/ +@[category research solved, AMS 52] +theorem erdos_106_axis_aligned : + ∀ k : ℕ, 0 < k → g (k ^ 2 + 1) = (k : ℝ) := by + sorry + +/-- +Praton's equivalence [Pr08]: the conjecture $f(k^2 + 2c + 1) = k + c/k$ for all +positive integers $k$ and all integers $-k < c < k$ is equivalent to the special +case $f(k^2 + 1) = k$ for all positive integers $k$. +-/ +@[category research solved, AMS 52] +theorem erdos_106_praton_equivalence : + (∀ k : ℕ, 0 < k → f (k ^ 2 + 1) = (k : ℝ)) ↔ + (∀ k : ℕ, 0 < k → ∀ c : ℤ, -↑k < c → c < ↑k → + f (k ^ 2 + (2 * c + 1).toNat) = (k : ℝ) + (c : ℝ) / (k : ℝ)) := by + sorry + +end Erdos106 diff --git a/FormalConjectures/ErdosProblems/1066.lean b/FormalConjectures/ErdosProblems/1066.lean new file mode 100644 index 0000000000..b4873e4a36 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1066.lean @@ -0,0 +1,80 @@ +/- +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 1066 + +*Reference:* [erdosproblems.com/1066](https://www.erdosproblems.com/1066) + +Let $G$ be a graph given by $n$ points in $\mathbb{R}^2$, where any two distinct points are +at least distance $1$ apart, and we draw an edge between two points if they are +distance $1$ apart. + +Let $g(n)$ be maximal such that any such graph always has an independent set on +at least $g(n)$ vertices. Estimate $g(n)$, or perhaps $\lim g(n)/n$. + +Such graphs are always planar. The current record bounds are +$$\frac{8}{31}n \leq g(n) \leq \frac{5}{16}n.$$ +The lower bound is due to Swanepoel [Sw02] and the upper bound to Pach and +Tóth [PaTo96]. + +[Sw02] Swanepoel, K., *Independence numbers of planar contact graphs*. +Discrete & Computational Geometry 28 (2002), 649-670. + +[PaTo96] Pach, J. and Tóth, G., *On the independence number of coin graphs*. +Geombinatorics 6 (1996), 30-33. +-/ + +namespace Erdos1066 + +/-- +**Erdős Problem 1066**, lower bound [Sw02]: + +For every $n \geq 1$ and every injective placement of $n$ points in $\mathbb{R}^2$ with all +pairwise distances $\geq 1$, there exists a set of at least $\frac{8}{31}n$ points with +no two at distance exactly $1$ (an independent set in the unit distance graph). +-/ +@[category research solved, AMS 5 52] +theorem erdos_1066 (n : ℕ) (hn : n ≥ 1) + (f : Fin n → EuclideanSpace ℝ (Fin 2)) + (hf_inj : Function.Injective f) + (hf_min : ∀ i j : Fin n, i ≠ j → dist (f i) (f j) ≥ 1) : + ∃ S : Finset (Fin n), + (S.card : ℝ) ≥ 8 / 31 * (n : ℝ) ∧ + ∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1 := by + sorry + +/-- +**Erdős Problem 1066**, upper bound [PaTo96]: + +For all sufficiently large $n$, there exists an injective placement of $n$ points +in $\mathbb{R}^2$ with all pairwise distances $\geq 1$ such that every independent set in the +unit distance graph has size at most $\frac{5}{16}n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1066.variants.upper_bound : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ f : Fin n → EuclideanSpace ℝ (Fin 2), + Function.Injective f ∧ + (∀ i j : Fin n, i ≠ j → dist (f i) (f j) ≥ 1) ∧ + ∀ S : Finset (Fin n), + (∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1) → + (S.card : ℝ) ≤ 5 / 16 * (n : ℝ) := by + sorry + +end Erdos1066 diff --git a/FormalConjectures/ErdosProblems/1069.lean b/FormalConjectures/ErdosProblems/1069.lean new file mode 100644 index 0000000000..3dad04933b --- /dev/null +++ b/FormalConjectures/ErdosProblems/1069.lean @@ -0,0 +1,65 @@ +/- +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 1069 + +*Reference:* [erdosproblems.com/1069](https://www.erdosproblems.com/1069) + +Given any $n$ points in $\mathbb{R}^2$, the number of $k$-rich lines (lines containing +$\ge k$ of the points) is $\ll n^2 / k^3$, provided $k \le \sqrt{n}$. + +Conjectured by Erdős, Croft, and Purdy [Er87b]. Proved by Szemerédi and Trotter [SzTr83]. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_, +Intuitive geometry (Siófok, 1985), 1987, pp. 167–177. (see p. 169) + +[SzTr83] Szemerédi, E. and Trotter, W.T., _Extremal problems in discrete geometry_, +Combinatorica 3 (1983), 381–392. +-/ + +open scoped Classical + +namespace Erdos1069 + +/-- A line in $\mathbb{R}^2$ (represented as `Fin 2 → ℝ`): a set of the form +$\{p + t \cdot d \mid t \in \mathbb{R}\}$ for some point $p$ and nonzero direction $d$. -/ +def IsLine (L : Set (Fin 2 → ℝ)) : Prop := + ∃ (p d : Fin 2 → ℝ), d ≠ 0 ∧ L = {q : Fin 2 → ℝ | ∃ t : ℝ, q = p + t • d} + +/-- The number of $k$-rich lines determined by a finite point set $S \subseteq \mathbb{R}^2$: +lines containing at least $k$ points of $S$. -/ +noncomputable def numKRichLines (S : Finset (Fin 2 → ℝ)) (k : ℕ) : ℕ := + Set.ncard {L : Set (Fin 2 → ℝ) | IsLine L ∧ k ≤ (S.filter (· ∈ L)).card} + +/-- +Erdős Problem 1069 (Szemerédi–Trotter theorem) [Er87b], [SzTr83]: + +There exists a constant $C > 0$ such that for any finite set $S$ of $n$ points in $\mathbb{R}^2$ +and any integer $k$ with $2 \le k$ and $k^2 \le n$, the number of lines containing at +least $k$ points of $S$ is at most $C \cdot n^2 / k^3$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1069 : + ∃ C : ℝ, C > 0 ∧ + ∀ (S : Finset (Fin 2 → ℝ)) (k : ℕ), + 2 ≤ k → (k : ℝ) ^ 2 ≤ (S.card : ℝ) → + (numKRichLines S k : ℝ) ≤ C * (S.card : ℝ) ^ 2 / (k : ℝ) ^ 3 := by + sorry + +end Erdos1069 diff --git a/FormalConjectures/ErdosProblems/1070.lean b/FormalConjectures/ErdosProblems/1070.lean new file mode 100644 index 0000000000..33549f9fce --- /dev/null +++ b/FormalConjectures/ErdosProblems/1070.lean @@ -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 1070 + +*Reference:* [erdosproblems.com/1070](https://www.erdosproblems.com/1070) + +Let $f(n)$ be maximal such that, given any $n$ points in $\mathbb{R}^2$, there exist $f(n)$ +points such that no two are distance $1$ apart. Estimate $f(n)$. In particular, +is it true that $f(n) \geq n/4$? + +In other words, estimate the minimal independence number of a unit distance +graph with $n$ vertices. + +The Moser spindle shows $f(n) \leq (2/7)n \approx 0.285n$. Croft [Cr67] gave the +best-known lower bound of $f(n) \geq 0.22936n$, using the density approach of +Larman and Rogers [LaRo72]. Matolcsi, Ruzsa, Varga, and Zsámboki [MRVZ23] +improved the upper bound to $f(n) \leq (1/4 + o(1))n$. Ambrus, Csiszárik, +Matolcsi, Varga, and Zsámboki [ACMVZ23] showed that the density $m_1 \leq 0.247$, +so the density approach alone cannot achieve $f(n) \geq n/4$. + +[Er87b] Erdős, P., _Some problems on number theory, combinatorics and geometry_, 1987. + +[Cr67] Croft, H. T., _Incidence incidents_, Eureka (1967), 22–26. + +[LaRo72] Larman, D. G. and Rogers, C. A., _The realization of distances within sets in +Euclidean space_. Mathematika 19 (1972), 1–24. + +[ACMVZ23] Ambrus, G., Csiszárik, A., Matolcsi, M., Varga, D., and Zsámboki, P., +_The density of planar sets avoiding unit distances_, 2023. + +[MRVZ23] Matolcsi, M., Ruzsa, I. Z., Varga, D., and Zsámboki, P., +_The fractional chromatic number of the plane is at least 4_, 2023. +-/ + +namespace Erdos1070 + +/-- +**Erdős Problem #1070**, main conjecture [Er87b]: + +Is it true that for every $n \geq 1$ and every placement of $n$ points in $\mathbb{R}^2$, +there exists a subset of at least $n/4$ points with no two at distance exactly $1$ +(an independent set in the unit distance graph)? +-/ +@[category research open, AMS 5 52] +theorem erdos_1070 : answer(sorry) ↔ + ∀ (n : ℕ), n ≥ 1 → ∀ (f : Fin n → EuclideanSpace ℝ (Fin 2)), + ∃ S : Finset (Fin n), + (S.card : ℝ) ≥ (n : ℝ) / 4 ∧ + ∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1 := by + sorry + +/-- +**Erdős Problem #1070**, lower bound [Cr67]: + +For every $n \geq 1$ and every placement of $n$ points in $\mathbb{R}^2$, there exists a subset +of at least $0.22936n$ points with no two at distance exactly $1$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1070.variants.lower_bound (n : ℕ) (hn : n ≥ 1) + (f : Fin n → EuclideanSpace ℝ (Fin 2)) : + ∃ S : Finset (Fin n), + (S.card : ℝ) ≥ 22936 / 100000 * (n : ℝ) ∧ -- 0.22936 + ∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1 := by + sorry + +/-- +**Erdős Problem #1070**, upper bound (Moser spindle): + +For all sufficiently large $n$, there exists a placement of $n$ points in $\mathbb{R}^2$ +such that every independent set in the unit distance graph has size at most +$(2/7)n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1070.variants.upper_bound : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ f : Fin n → EuclideanSpace ℝ (Fin 2), + ∀ S : Finset (Fin n), + (∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1) → + (S.card : ℝ) ≤ 2 / 7 * (n : ℝ) := by + sorry + +end Erdos1070 diff --git a/FormalConjectures/ErdosProblems/1075.lean b/FormalConjectures/ErdosProblems/1075.lean new file mode 100644 index 0000000000..936b77dfe5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1075.lean @@ -0,0 +1,91 @@ +/- +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 1075 + +For every $r \geq 3$, there exists $c_r > r^{-r}$ such that for any $\varepsilon > 0$, if $n$ is +sufficiently large, any $r$-uniform hypergraph on $n$ vertices with at least +$(1+\varepsilon)(n/r)^r$ edges contains a subgraph on $m$ vertices with at least $c_r m^r$ edges, +where $m \to \infty$ as $n \to \infty$. + +*References:* +- [Er74c] Erdős, P., _Extremal problems on graphs and hypergraphs_. (1974), p.80. +- [Er64f] Erdős, P., _On extremal problems of graphs and generalized graphs_. Israel J. Math. **2** + (1964), 183-190. +- [erdosproblems.com/1075](https://www.erdosproblems.com/1075) +-/ + +open Finset + +namespace Erdos1075 + +/-- An $r$-uniform hypergraph on $n$ vertices. -/ +structure UniformHypergraph (n r : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = r + +/-- The subhypergraph of $H$ induced by a vertex set $S$: all edges entirely within $S$. +Returns the edge set (as a `Finset`) rather than a `UniformHypergraph`. -/ +def UniformHypergraph.inducedSubgraph {n r : ℕ} + (H : UniformHypergraph n r) (S : Finset (Fin n)) : + Finset (Finset (Fin n)) := + H.edges.filter (fun e => e ⊆ S) + +/-- +Erdős Problem 1075: + +For every $r \geq 3$, there exists $c_r > r^{-r}$ such that for any $\varepsilon > 0$, +for any target size $M$, for all sufficiently large $n$, any $r$-uniform hypergraph +on $n$ vertices with at least $(1+\varepsilon)(n/r)^r$ edges contains a vertex subset $S$ +with $|S| \geq M$ and at least $c_r \cdot |S|^r$ edges within $S$. + +The condition "$m \to \infty$ as $n \to \infty$" is captured by the universal quantifier over $M$: +for every $M$, eventually (for large $n$) we can find a subgraph on $\geq M$ vertices. +-/ +@[category research open, AMS 5] +theorem erdos_1075 (r : ℕ) (hr : r ≥ 3) : + ∃ c_r : ℝ, c_r > 1 / (r : ℝ) ^ r ∧ + ∀ ε : ℝ, ε > 0 → + ∀ M : ℕ, + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ H : UniformHypergraph n r, + (H.edges.card : ℝ) ≥ (1 + ε) * ((n : ℝ) / r) ^ r → + ∃ S : Finset (Fin n), + S.card ≥ M ∧ + ((H.inducedSubgraph S).card : ℝ) ≥ c_r * (S.card : ℝ) ^ r := by + sorry + +/-- +Erdős [Er64f] proved that the conclusion of Problem 1075 holds with the weaker density constant +$c_r = r^{-r}$ when the edge threshold is strengthened to $\varepsilon n^r$ (instead of +$(1+\varepsilon)(n/r)^r$). This is a solved, weaker variant of the main conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_1075_erdos_1964 (r : ℕ) (hr : r ≥ 3) : + ∀ ε : ℝ, ε > 0 → + ∀ M : ℕ, + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ H : UniformHypergraph n r, + (H.edges.card : ℝ) ≥ ε * (n : ℝ) ^ r → + ∃ S : Finset (Fin n), + S.card ≥ M ∧ + ((H.inducedSubgraph S).card : ℝ) ≥ (1 / (r : ℝ) ^ r) * (S.card : ℝ) ^ r := by + sorry + +end Erdos1075 diff --git a/FormalConjectures/ErdosProblems/1076.lean b/FormalConjectures/ErdosProblems/1076.lean new file mode 100644 index 0000000000..dce2686aab --- /dev/null +++ b/FormalConjectures/ErdosProblems/1076.lean @@ -0,0 +1,96 @@ +/- +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 1076 + +*Reference:* [erdosproblems.com/1076](https://www.erdosproblems.com/1076) + +Let $k \geq 5$ and let $\mathcal{F}_k$ be the family of all 3-uniform hypergraphs with $k$ +vertices and $k - 2$ edges. Is it true that $\mathrm{ex}_3(n, \mathcal{F}_k) \sim n^2 / 6$? + +A question of Brown, Erdős, and Sós [BES73] who proved this is true for $k = 4$, +and that for all $k \geq 4$, $\mathrm{ex}_3(n, \mathcal{F}_k) \asymp_k n^2$. +Erdős [Er74c] presents the conjecture with a supporting theorem. + +The asymptotic version was proved independently by Bohman and Warnke [BoWa19] +and Glock, Kühn, Lo, and Osthus [GKLO20]. + +This is related to Problem #207, which is an essentially stronger version. + +[BES73] Brown, W.G., Erdős, P., and Sós, V.T., *Some extremal problems on r-graphs* (1973), 53–63. + +[Er74c] Erdős, P., *Extremal problems on graphs and hypergraphs*. (1974), 75–84. + +[BoWa19] Bohman, T. and Warnke, L., *Large girth approximate Steiner triple systems*. +J. London Math. Soc. (2) (2019), 895–913. + +[GKLO20] Glock, S., Kühn, D., Lo, A., and Osthus, D., +*On a conjecture of Erdős on locally sparse Steiner triple systems*. +Combinatorica (2020), 363–403. +-/ + +open Finset + +namespace Erdos1076 + +/-- A 3-uniform hypergraph on $n$ vertices. -/ +structure Hypergraph3 (n : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = 3 + +/-- A 3-uniform hypergraph $G$ on $k$ vertices is a subhypergraph of $H$ on $n$ vertices +if there is an injection from $\mathrm{Fin}(k)$ to $\mathrm{Fin}(n)$ mapping every edge of +$G$ to an edge of $H$. -/ +def IsSubhypergraph {k n : ℕ} (G : Hypergraph3 k) (H : Hypergraph3 n) : Prop := + ∃ f : Fin k → Fin n, Function.Injective f ∧ + ∀ e ∈ G.edges, e.image f ∈ H.edges + +/-- $\mathcal{F}_k$: the family of all 3-uniform hypergraphs with $k$ vertices and exactly +$k - 2$ edges. -/ +def familyF (k : ℕ) : Set (Hypergraph3 k) := + {G | G.edges.card = k - 2} + +/-- $H$ is $\mathcal{F}_k$-free if it contains no subhypergraph from $\mathcal{F}_k$. -/ +def IsFkFree {n : ℕ} (k : ℕ) (H : Hypergraph3 n) : Prop := + ∀ G : Hypergraph3 k, G ∈ familyF k → ¬IsSubhypergraph G H + +/-- The extremal number $\mathrm{ex}_3(n, \mathcal{F}_k)$: the maximum number of edges in an +$\mathcal{F}_k$-free 3-uniform hypergraph on $n$ vertices. -/ +noncomputable def ex3 (n k : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : Hypergraph3 n, IsFkFree k H ∧ H.edges.card = m} + +/-- +Erdős Problem 1076 [BES73]: + +For all $k \geq 5$, $\mathrm{ex}_3(n, \mathcal{F}_k) \sim n^2 / 6$. + +Formalized as: for every $\varepsilon > 0$, for sufficiently large $n$, +$(1 - \varepsilon) \cdot n^2 / 6 \leq \mathrm{ex}_3(n, \mathcal{F}_k) +\leq (1 + \varepsilon) \cdot n^2 / 6$. +-/ +@[category research solved, AMS 5] +theorem erdos_1076 : answer(True) ↔ + ∀ k : ℕ, k ≥ 5 → + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (1 - ε) * ((n : ℝ) ^ 2 / 6) ≤ (ex3 n k : ℝ) ∧ + (ex3 n k : ℝ) ≤ (1 + ε) * ((n : ℝ) ^ 2 / 6) := by + sorry + +end Erdos1076 diff --git a/FormalConjectures/ErdosProblems/1078.lean b/FormalConjectures/ErdosProblems/1078.lean new file mode 100644 index 0000000000..3c47f89a30 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1078.lean @@ -0,0 +1,71 @@ +/- +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 1078 + +*Reference:* [erdosproblems.com/1078](https://www.erdosproblems.com/1078) + +If $G$ is an $r$-partite graph with $n$ vertices in each part and minimum degree at least +$(r - 3/2 - \varepsilon) \cdot n$, must $G$ contain a transversal copy of $K_r$? + +[BES75b] Bollobás, B., Erdős, P., and Szemerédi, E., proved that the threshold +$r - 3/2$ is best possible. + +[Ha01] Haxell, P., proved the conjecture. + +[HaSz06] Haxell, P. and Szabó, T., proved the sharp threshold of +$(r-1)n - \lceil sn/(2s-1) \rceil$ where $s = \lfloor r/2 \rfloor$. +-/ + +open SimpleGraph + +namespace Erdos1078 + +/-- An $r$-partite graph on vertex set `Fin r × Fin n`: no edges within any part. -/ +def IsMultipartite {r n : ℕ} (G : SimpleGraph (Fin r × Fin n)) : Prop := + ∀ (i : Fin r) (a b : Fin n), ¬G.Adj (i, a) (i, b) + +/-- A transversal clique in an $r$-partite graph: a choice of one vertex from each +part such that all chosen vertices are pairwise adjacent. This corresponds +to a copy of $K_r$ in an $r$-partite graph. -/ +def HasTransversalClique {r n : ℕ} (G : SimpleGraph (Fin r × Fin n)) : Prop := + ∃ f : Fin r → Fin n, ∀ i j : Fin r, i ≠ j → G.Adj (i, f i) (j, f j) + +/-- +Erdős Problem 1078 [BES75b, Ha01]: + +For all $r \geq 2$, for every $\varepsilon > 0$, there exists $n_0$ such that for all +$n \geq n_0$, every $r$-partite graph $G$ with $n$ vertices in each part and minimum degree +$\geq (r - 3/2 - \varepsilon) \cdot n$ contains a transversal clique $K_r$. + +Bollobás, Erdős, and Szemerédi [BES75b] proved that $r - 3/2$ is best possible. +Proved by Haxell [Ha01]. The sharp threshold of $(r-1)n - \lceil sn/(2s-1) \rceil$ +where $s = \lfloor r/2 \rfloor$ was proved by Haxell and Szabó [HaSz06]. +-/ +@[category research solved, AMS 5] +theorem erdos_1078 (r : ℕ) (hr : r ≥ 2) : + ∀ ε : ℝ, ε > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ (G : SimpleGraph (Fin r × Fin n)) [DecidableRel G.Adj], + IsMultipartite G → + (∀ v : Fin r × Fin n, (G.degree v : ℝ) ≥ ((r : ℝ) - 3 / 2 - ε) * (n : ℝ)) → + HasTransversalClique G := by + sorry + +end Erdos1078 diff --git a/FormalConjectures/ErdosProblems/1079.lean b/FormalConjectures/ErdosProblems/1079.lean new file mode 100644 index 0000000000..a82308446a --- /dev/null +++ b/FormalConjectures/ErdosProblems/1079.lean @@ -0,0 +1,101 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Extremal.Basic + +/-! +# Erdős Problem 1079 + +*Reference:* [erdosproblems.com/1079](https://www.erdosproblems.com/1079) + +Let $r \geq 4$. If $G$ is a graph on $n$ vertices with at least $\operatorname{ex}(n; K_r)$ edges +then must $G$ contain a vertex with degree $d \gg_r n$ whose neighbourhood contains at least +$\operatorname{ex}(d; K_{r-1})$ edges? + +As Erdős [Er75] says 'if true this would be a nice generalisation of Turán's theorem'. + +This is true (unless $G$ is itself the Turán graph), proved by Bollobás and Thomason [BoTh81]. +Bondy [Bo83b] showed that if $G$ has $> \operatorname{ex}(n; K_r)$ edges then the corresponding +vertex can be chosen to be of maximum degree in $G$. + +[Er75] Erdős, P., _Some recent progress on extremal problems in graph theory_. Congressus +Numerantium (1975), 3–14. + +[BoTh81] Bollobás, B., Thomason, A., _Dense neighbourhoods and Turán's theorem_. Journal of +Combinatorial Theory, Series B (1981), 111–114. + +[Bo83b] Bondy, J. A., _Large dense neighbourhoods and Turán's theorem_. Journal of Combinatorial +Theory, Series B (1983), 109–111. +-/ + +open SimpleGraph Finset + +namespace Erdos1079 + +/-- The number of edges of $G$ both of whose endpoints lie in a set $S$. + Counts pairs $(i, j)$ in $S$ with $i < j$ and `G.Adj i j`. -/ +noncomputable def neighborhoodEdgeCount {n : ℕ} + (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (S : Finset (Fin n)) : ℕ := + (Finset.univ.filter (fun p : Fin n × Fin n => + p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2 ∧ G.Adj p.1 p.2)).card + +/-- +Erdős Problem 1079 [Er75]: + +Let $r \geq 4$. If $G$ is a graph on $n$ vertices with at least $\operatorname{ex}(n; K_r)$ edges +then $G$ must contain a vertex $v$ with degree $d \gg_r n$ whose neighbourhood contains +at least $\operatorname{ex}(d; K_{r-1})$ edges. + +Formalized as: for every $r \geq 4$, there exists $c > 0$ and $n_0$ such that for all +$n \geq n_0$ and all graphs $G$ on $n$ vertices with at least $\operatorname{ex}(n; K_r)$ edges, +there exists a vertex $v$ with degree $d \geq cn$ and at least +$\operatorname{ex}(d; K_{r-1})$ edges among the neighbors of $v$. + +Proved by Bollobás and Thomason [BoTh81]. +-/ +@[category research solved, AMS 5] +theorem erdos_1079 : answer(True) ↔ + ∀ r : ℕ, r ≥ 4 → + ∃ c : ℝ, c > 0 ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.edgeFinset.card ≥ extremalNumber n (⊤ : SimpleGraph (Fin r)) → + ∃ v : Fin n, + (G.degree v : ℝ) ≥ c * (n : ℝ) ∧ + neighborhoodEdgeCount G (G.neighborFinset v) ≥ + extremalNumber (G.degree v) (⊤ : SimpleGraph (Fin (r - 1))) := by + sorry + +/-- +Bondy's strengthening of Erdős Problem 1079 [Bo83b]: + +If $r \geq 4$ and $G$ is a graph on $n$ vertices with strictly more than +$\operatorname{ex}(n; K_r)$ edges, then a vertex of maximum degree in $G$ has at least +$\operatorname{ex}(d; K_{r-1})$ edges in its neighbourhood, where $d$ is that maximum degree. +-/ +@[category research solved, AMS 5] +theorem erdos_1079_bondy_strengthening : + ∀ r : ℕ, r ≥ 4 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.edgeFinset.card > extremalNumber n (⊤ : SimpleGraph (Fin r)) → + ∀ v : Fin n, (∀ w : Fin n, G.degree w ≤ G.degree v) → + neighborhoodEdgeCount G (G.neighborFinset v) ≥ + extremalNumber (G.degree v) (⊤ : SimpleGraph (Fin (r - 1))) := by + sorry + +end Erdos1079 diff --git a/FormalConjectures/ErdosProblems/1081.lean b/FormalConjectures/ErdosProblems/1081.lean new file mode 100644 index 0000000000..fd7b9b0db2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1081.lean @@ -0,0 +1,74 @@ +/- +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 1081 + +*Reference:* [erdosproblems.com/1081](https://www.erdosproblems.com/1081) + +Let $A(x)$ count the number of $n \leq x$ which are the sum of two squarefull numbers +(a number $m$ is squarefull if $p \mid m$ implies $p^2 \mid m$). Is it true that +$A(x) \sim c \cdot x / \sqrt{\log x}$ for some $c > 0$? + +This was disproved by Odoni [Od81]. See also Problem #940. + +[Er76e] Erdős, P. + +[Od81] Odoni, R. W. K., _A problem of Erdős on sums of two squarefull numbers_. +Acta Arith. (1981), 145–162. + +[BaBr94] Baker, R. C., Brüdern, J., _On sums of two squarefull numbers_. +Math. Proc. Cambridge Philos. Soc. (1994), 1–5. + +[Bl04] Blomer, V., _Binary quadratic forms with large discriminants and sums of two +squareful numbers_. J. Reine Angew. Math. (2004), 213–234. + +[BlGr06] Blomer, V., Granville, A., _Estimates for representation numbers of quadratic +forms_. Duke Math. J. (2006), 261–302. +-/ + +open Filter Classical + +namespace Erdos1081 + +/-- A natural number is expressible as the sum of two squarefull (powerful) numbers. -/ +def IsSumOfTwoSquarefull (n : ℕ) : Prop := + ∃ a b : ℕ, 0 < a ∧ Nat.Powerful a ∧ 0 < b ∧ Nat.Powerful b ∧ n = a + b + +/-- $A(x)$: the count of natural numbers $n$ in $[1, x]$ that are sums of two +squarefull numbers. -/ +noncomputable def countA (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter (fun n => IsSumOfTwoSquarefull n)).card + +/-- +Erdős Problem 1081 [Er76e] (DISPROVED): + +Is it true that there exists $c > 0$ such that $A(x) \sim c \cdot x / \sqrt{\log x}$, i.e., +$$A(x) \cdot \sqrt{\log x} / x \to c \text{ as } x \to \infty?$$ + +This was disproved by Odoni [Od81]. +-/ +@[category research solved, AMS 11] +theorem erdos_1081 : answer(False) ↔ + ∃ c : ℝ, c > 0 ∧ + Tendsto (fun x : ℕ => + (countA x : ℝ) * Real.sqrt (Real.log (x : ℝ)) / (x : ℝ)) + atTop (nhds c) := by + sorry + +end Erdos1081 diff --git a/FormalConjectures/ErdosProblems/1082.lean b/FormalConjectures/ErdosProblems/1082.lean index 8d206e8600..fcdbe46c09 100644 --- a/FormalConjectures/ErdosProblems/1082.lean +++ b/FormalConjectures/ErdosProblems/1082.lean @@ -19,6 +19,19 @@ import FormalConjectures.Util.ProblemImports # Erdős Problem 1082 *Reference:* [erdosproblems.com/1082](https://www.erdosproblems.com/1082) + +A conjecture attributed to Szemerédi. Szemerédi proved the weaker result with ⌊n/2⌋ replaced +by n/3, and also showed that if no k points are collinear then some point determines ≫ n/k +distinct distances. This proof is unpublished but appears in [Er75f]. + +Related problems: 89, 93, 660, 982. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 101. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167–177. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, 1997. -/ namespace Erdos1082 diff --git a/FormalConjectures/ErdosProblems/1083.lean b/FormalConjectures/ErdosProblems/1083.lean new file mode 100644 index 0000000000..739e04adfa --- /dev/null +++ b/FormalConjectures/ErdosProblems/1083.lean @@ -0,0 +1,76 @@ +/- +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 1083 + +*Reference:* [erdosproblems.com/1083](https://www.erdosproblems.com/1083) + +Let $d \geq 3$, and let $f_d(n)$ be the minimal $m$ such that every set of $n$ points +in $\mathbb{R}^d$ determines at least $m$ distinct distances. Is it true that +$f_d(n) = n^{2/d - o(1)}$? + +Erdős [Er46b] proved $n^{1/d} \ll_d f_d(n) \ll_d n^{2/d}$, the upper bound +construction being given by a set of lattice points. + +[Er46b] Erdős, P., _On sets of distances of $n$ points_. Amer. Math. Monthly (1946), 248-250. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 101. + +[CEGSW90] Clarkson, K. L., Edelsbrunner, H., Guibas, L. J., Sharir, M., Welzl, E., +_Combinatorial complexity bounds for arrangements of curves and spheres_. +Discrete Comput. Geom. (1990), 99-160. + +[APST04] Aronov, B., Pach, J., Sharir, M., Tardos, G., +_Distinct distances in three and higher dimensions_. +Combin. Probab. Comput. (2004), 283-293. + +[SoVu08] Solymosi, J., Vu, V. H., _Near optimal bounds for the Erdős distinct +distances problem in high dimensions_. Combinatorica (2008), 113-125. +-/ + +namespace Erdos1083 + +/-- The number of distinct pairwise distances determined by a finite point set +in $\mathbb{R}^d$. -/ +noncomputable def distinctDistanceCount {d : ℕ} (P : Finset (EuclideanSpace ℝ (Fin d))) : ℕ := + Set.ncard {r : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ r = dist p q} + +/-- $f_d(n)$: the minimal number of distinct distances determined by any set of +$n$ points in $\mathbb{R}^d$. -/ +noncomputable def minDistinctDistances (d : ℕ) (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ (P : Finset (EuclideanSpace ℝ (Fin d))), + P.card = n ∧ distinctDistanceCount P = m} + +/-- +**Erdős Problem 1083** [Er46b][Er75f, p.101]: + +For all $d \geq 3$ and $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$f_d(n) \geq n^{2/d - \varepsilon}$. + +This is the conjectured lower bound part of $f_d(n) = n^{2/d - o(1)}$. +The matching upper bound $f_d(n) \ll_d n^{2/d}$ was proved by Erdős via +lattice points. +-/ +@[category research open, AMS 52] +theorem erdos_1083 (d : ℕ) (hd : d ≥ 3) (ε : ℝ) (hε : ε > 0) : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (minDistinctDistances d n : ℝ) ≥ (n : ℝ) ^ ((2 : ℝ) / d - ε) := by + sorry + +end Erdos1083 diff --git a/FormalConjectures/ErdosProblems/1086.lean b/FormalConjectures/ErdosProblems/1086.lean new file mode 100644 index 0000000000..4bcb4a1b05 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1086.lean @@ -0,0 +1,89 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 1086 + +*Reference:* [erdosproblems.com/1086](https://www.erdosproblems.com/1086) + +Let $g(n)$ be minimal such that any set of $n$ points in $\mathbb{R}^2$ contains the vertices +of at most $g(n)$ many triangles with the same area. Equivalently, how many triangles of area $1$ +can a set of $n$ points in $\mathbb{R}^2$ determine? This question is attributed to Oppenheim. + +Erdős and Purdy [ErPu71] proved $n^2 \log \log n \ll g(n) \ll n^{5/2}$ and believed the lower +bound to be closer to the truth. Pach and Sharir [PaSh92] improved the upper bound. Dumitrescu, +Sharir, and Tóth [DST09] and Apfelbaum and Sharir [ApSh10] made further improvements. The best +known upper bound is $g(n) \ll n^{20/9}$ by Raz and Sharir [RaSh17]. + +Related problems: [#90](https://www.erdosproblems.com/90), +[#755](https://www.erdosproblems.com/755). + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 104. + +[ErPu71] Erdős, P. and Purdy, G., _Some extremal problems in geometry_. J. Combin. Theory +Ser. A (1971), 246–252. + +[PaSh92] Pach, J. and Sharir, M., _Repeated angles in the plane and related problems_. J. Combin. +Theory Ser. A (1992), 12–22. + +[DST09] Dumitrescu, A., Sharir, M., and Tóth, Cs. D., _Extremal problems on triangle areas in +two and three dimensions_. J. Combin. Theory Ser. A (2009), 1177–1198. + +[ApSh10] Apfelbaum, R. and Sharir, M., _An improved bound on the number of unit area triangles_. +Discrete Comput. Geom. (2010), 753–761. + +[Ap13] Apfelbaum, R., _Geometric Incidences and Repeated Configurations_. Ph.D. Dissertation, +Tel Aviv University, 2013. + +[RaSh17] Raz, O. E. and Sharir, M., _The number of unit-area triangles in the plane: theme +and variations_. Combinatorica (2017), 1221–1240. +-/ + +open EuclideanGeometry + +namespace Erdos1086 + +/-- The number of ordered triples of distinct points from $S \subseteq \mathbb{R}^2$ that form +a triangle with area exactly $A$. Each unordered triangle is counted $6$ times +(once per ordering of its vertices). -/ +noncomputable def countTrianglesWithArea (S : Finset ℝ²) (A : ℝ) : ℕ := + ((S ×ˢ (S ×ˢ S)).filter (fun (p, q, r) => + p ≠ q ∧ p ≠ r ∧ q ≠ r ∧ |triangle_area p q r| = A)).card + +/-- +Erdős Problem 1086 (Erdős–Purdy conjecture on equal-area triangles) [ErPu71]: + +For every $\varepsilon > 0$, there exists $C > 0$ such that for every finite set $S$ of +points in $\mathbb{R}^2$ and every area $A$, the number of triangles with area $A$ +determined by $S$ is at most $C \cdot |S|^{2+\varepsilon}$. + +This formalizes the belief of Erdős and Purdy that $g(n) \ll n^{2+\varepsilon}$, +where $g(n)$ is the maximum number of triangles of the same area in any +set of $n$ points. The statement uses ordered triples, so the constant $C$ +absorbs the factor of $6$. +-/ +@[category research open, AMS 5 52] +theorem erdos_1086 : + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∀ (S : Finset ℝ²) (A : ℝ), + (countTrianglesWithArea S A : ℝ) ≤ C * (S.card : ℝ) ^ (2 + ε) := by + sorry + +end Erdos1086 diff --git a/FormalConjectures/ErdosProblems/1087.lean b/FormalConjectures/ErdosProblems/1087.lean new file mode 100644 index 0000000000..7b14a0fa49 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1087.lean @@ -0,0 +1,68 @@ +/- +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 1087 + +Estimate the number of degenerate 4-element subsets of an $n$-point set in the plane, +where a 4-element subset is degenerate if some two distinct pairs determine the same distance. + +*Reference:* [erdosproblems.com/1087](https://www.erdosproblems.com/1087) + +[ErPu71] Erdős, P. and Purdy, G., _Some extremal problems in geometry_. + Journal of Combinatorial Theory, Series A (1971), 246–252. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 104. +-/ + +open Classical + +namespace Erdos1087 + +/-- A 4-element point set in $\mathbb{R}^2$ has a repeated distance if there exist two distinct + unordered pairs of points determining the same distance. -/ +def HasRepeatedDistance (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, ∃ d ∈ S, + a ≠ b ∧ c ≠ d ∧ (a ≠ c ∨ b ≠ d) ∧ (a ≠ d ∨ b ≠ c) ∧ dist a b = dist c d + +/-- The number of "degenerate" 4-element subsets (those with a repeated distance) + of a point set $P$ in $\mathbb{R}^2$. -/ +noncomputable def degenerateQuadrupleCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + ((P.powersetCard 4).filter HasRepeatedDistance).card + +/-- +Erdős Problem 1087 (Erdős–Purdy [ErPu71]): + +Let $f(n)$ be minimal such that every set of $n$ points in $\mathbb{R}^2$ contains at most $f(n)$ +"degenerate" 4-element subsets, where a 4-element subset is degenerate if some two +distinct pairs determine the same distance. Is it true that $f(n) \leq n^{3+o(1)}$? + +Known bounds: $n^3 \log n \ll f(n) \ll n^{7/2}$. + +Formally: for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$ and every set $P$ +of $n$ points in $\mathbb{R}^2$, the number of degenerate quadruples is at most $n^{3+\varepsilon}$. +-/ +@[category research open, AMS 5 52] +theorem erdos_1087 : answer(sorry) ↔ + ∀ (ε : ℝ), 0 < ε → ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + (degenerateQuadrupleCount P : ℝ) ≤ (n : ℝ) ^ ((3 : ℝ) + ε) := by + sorry + +end Erdos1087 diff --git a/FormalConjectures/ErdosProblems/1088.lean b/FormalConjectures/ErdosProblems/1088.lean new file mode 100644 index 0000000000..fcc09990f4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1088.lean @@ -0,0 +1,90 @@ +/- +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 1088 + +*Reference:* [erdosproblems.com/1088](https://www.erdosproblems.com/1088) + +Let $f_d(n)$ be the minimal $m$ such that any set of $m$ points in $\mathbb{R}^d$ contains +a set of $n$ points such that any two determined distances are distinct. +Estimate $f_d(n)$. In particular, is it true that, for fixed $n \geq 3$, +$f_d(n) = 2^{o(d)}$? + +A problem of Erdős [Er75f]. It is easy to prove that $f_d(n) \leq n^{O_d(1)}$. +Erdős claimed that he and Straus proved $f_d(n) \leq c_n^d$ for some constant $c_n > 0$. + +When $d = 1$, $f_1(n) \asymp n^2$ (see Problem 530). When $n = 3$, +$f_d(3) = d^2/2 + O(d)$ (see Problem 503). Specific known values include +$f_2(3) = 7$ (Erdős) and $f_3(3) = 9$ (Croft [Cr62]). + +[Er75f] Erdős, P., _On some problems of elementary and combinatorial geometry_. +Ann. Mat. Pura Appl. (4) (1975), 99-108. + +[Cr62] Croft, H. T., _9-point and 7-point configurations in 3-space_. +Proc. London Math. Soc. (3) (1962), 400-424. +-/ + +namespace Erdos1088 + +/-- A finite set of points in a metric space has all pairwise distances +distinct if no two distinct unordered pairs determine the same distance: +whenever $\operatorname{dist}(a, b) = \operatorname{dist}(c, d)$ with $a \neq b$ and $c \neq d$, the pairs +$\{a, b\}$ and $\{c, d\}$ must coincide. -/ +def AllPairwiseDistinctDists {α : Type*} [MetricSpace α] + (S : Finset α) : Prop := + ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, ∀ d ∈ S, + a ≠ b → c ≠ d → dist a b = dist c d → + (a = c ∧ b = d) ∨ (a = d ∧ b = c) + +/-- $f_d(n)$ is the minimal $m$ such that any set of at least $m$ points in $\mathbb{R}^d$ +contains a subset of $n$ points with all pairwise distances distinct. -/ +noncomputable def erdosF (d n : ℕ) : ℕ := + sInf {m : ℕ | ∀ (S : Finset (EuclideanSpace ℝ (Fin d))), + S.card ≥ m → + ∃ T : Finset (EuclideanSpace ℝ (Fin d)), + T ⊆ S ∧ T.card = n ∧ AllPairwiseDistinctDists T} + +/-- +Erdős Problem 1088 [Er75f]: + +For fixed $n \geq 3$, $f_d(n) = 2^{o(d)}$ as $d \to \infty$. That is, for every $\varepsilon > 0$, +there exists $D_0$ such that for all $d \geq D_0$, $f_d(n) \leq 2^{\varepsilon \cdot d}$. +-/ +@[category research open, AMS 5 52] +theorem erdos_1088 : + answer(sorry) ↔ + ∀ (n : ℕ), n ≥ 3 → + ∀ ε : ℝ, ε > 0 → + ∃ D₀ : ℕ, ∀ d : ℕ, d ≥ D₀ → + (erdosF d n : ℝ) ≤ (2 : ℝ) ^ (ε * (d : ℝ)) := by + sorry + +/-- $f_2(3) = 7$: the minimum number of points in $\mathbb{R}^2$ that guarantees a subset +of $3$ points with all pairwise distances distinct is $7$. Due to Erdős. -/ +@[category research solved, AMS 5 52] +theorem erdos_1088_f2_3 : erdosF 2 3 = 7 := by + sorry + +/-- $f_3(3) = 9$: the minimum number of points in $\mathbb{R}^3$ that guarantees a subset +of $3$ points with all pairwise distances distinct is $9$. Due to Croft [Cr62]. -/ +@[category research solved, AMS 5 52] +theorem erdos_1088_f3_3 : erdosF 3 3 = 9 := by + sorry + +end Erdos1088 diff --git a/FormalConjectures/ErdosProblems/1089.lean b/FormalConjectures/ErdosProblems/1089.lean new file mode 100644 index 0000000000..9fef956051 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1089.lean @@ -0,0 +1,78 @@ +/- +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 1089 + +*Reference:* [erdosproblems.com/1089](https://www.erdosproblems.com/1089) + +Let $g_d(n)$ be minimal such that every collection of $g_d(n)$ points in $\mathbb{R}^d$ +determines at least $n$ distinct distances. Does $\lim_{d \to \infty} g_d(n) / d^{n-1}$ +exist for all $n \geq 2$? The answer is yes, and the limit equals $1/(n-1)!$. + +[BBS83] Bannai, E., Bannai, E., and Stanton, D., _An upper bound for the cardinality of an +$s$-distance subset in real Euclidean space. II_. Combinatorica (1983), 147–152. + +[Cr62] Croft, H. T., _9-point and 7-point configurations in 3-space_. +Proc. London Math. Soc. (3) (1962), 400-424. + +[Er75f] Erdős, P., _On some problems of elementary and combinatorial geometry_. +Ann. Mat. Pura Appl. (4) (1975), 99-108. + +[Fe26] T. Feng et al, _Semi-Autonomous Mathematics Discovery with Gemini: A Case Study on the +Erdős Problems_. arXiv:2601.22401 (2026). +-/ + +open Classical Finset Filter + +namespace Erdos1089 + +/-- The set of distinct distances determined by a finite set of points +in $d$-dimensional Euclidean space. -/ +noncomputable def distinctDistances {d : ℕ} (S : Finset (EuclideanSpace ℝ (Fin d))) : Finset ℝ := + S.offDiag.image (fun pq => dist pq.1 pq.2) + +/-- The number of distinct distances determined by a finite set of points. -/ +noncomputable def distinctDistanceCount {d : ℕ} (S : Finset (EuclideanSpace ℝ (Fin d))) : ℕ := + (distinctDistances S).card + +/-- $g_d(n)$ is the minimal number of points in $\mathbb{R}^d$ such that any collection of +that many points determines at least $n$ distinct distances. -/ +noncomputable def g (d n : ℕ) : ℕ := + sInf {m : ℕ | ∀ (S : Finset (EuclideanSpace ℝ (Fin d))), S.card ≥ m → + distinctDistanceCount S ≥ n} + +/-- +Erdős Problem 1089 (Kelly's question, resolved): +Let $g_d(n)$ be minimal such that every collection of $g_d(n)$ points in $\mathbb{R}^d$ determines +at least $n$ distinct distances. The limit $\lim_{d \to \infty} g_d(n) / d^{n-1}$ exists and +equals $1/(n-1)!$ for all $n \geq 2$. + +The lower bound $\binom{d+1}{n-1} + 1 \leq g_d(n)$ is due to Aletheia-Zomlefer [Fe26] +and the upper bound $g_d(n) \leq \binom{d+n-1}{n-1} + 1$ is due to Bannai, Bannai, +and Stanton [BBS83]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_1089 : + answer(True) ↔ + ∀ (n : ℕ), 2 ≤ n → + Tendsto (fun d : ℕ => (g d n : ℝ) / (d : ℝ) ^ (n - 1)) + atTop (nhds (1 / (Nat.factorial (n - 1) : ℝ))) := by + sorry + +end Erdos1089 diff --git a/FormalConjectures/ErdosProblems/1090.lean b/FormalConjectures/ErdosProblems/1090.lean new file mode 100644 index 0000000000..54a663cca4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1090.lean @@ -0,0 +1,52 @@ +/- +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 1090 + +*Reference:* [erdosproblems.com/1090](https://www.erdosproblems.com/1090) + +Let $k \geq 3$. Does there exist a finite set $A \subset \mathbb{R}^2$ such that, in any +2-colouring of $A$, there exists a line which contains at least $k$ points from $A$, and all the +points of $A$ on the line have the same colour? + +[Er75f] Erdős, P., *On some problems of elementary and combinatorial geometry*. Annali di Matematica Pura ed Applicata (4) (1975), 99–108. +-/ + +namespace Erdos1090 + +/-- +Let $k \geq 3$. Does there exist a finite set $A \subset \mathbb{R}^2$ such that, in any +2-colouring of $A$, there exists a line which contains at least $k$ points from $A$, and all the +points of $A$ on the line have the same colour? + +The answer is yes. Erdős [Er75f, p.106] notes that Graham and Selfridge proved the +case $k = 3$. Zach Hunter observed that for sufficiently large $n$, a generic projection +of $[k]^n$ into $\mathbb{R}^2$ has this property, by the Hales–Jewett theorem. +-/ +@[category research solved, AMS 5 51] +theorem erdos_1090 : answer(True) ↔ ∀ (k : ℕ), k ≥ 3 → + ∃ A : Finset (EuclideanSpace ℝ (Fin 2)), + ∀ c : EuclideanSpace ℝ (Fin 2) → Fin 2, + ∃ L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)), + Module.finrank ℝ L.direction = 1 ∧ + k ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (A : Set _) ∧ p ∈ L} ∧ + ∃ color : Fin 2, ∀ p ∈ (A : Set _), p ∈ L → c p = color := by + sorry + +end Erdos1090 diff --git a/FormalConjectures/ErdosProblems/1091.lean b/FormalConjectures/ErdosProblems/1091.lean new file mode 100644 index 0000000000..d6c6d1cdf1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1091.lean @@ -0,0 +1,85 @@ +/- +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 1091 + +*Reference:* [erdosproblems.com/1091](https://www.erdosproblems.com/1091) + +[La79] Larson — proved that $K_4$-free graphs with chromatic number $4$ contain an odd cycle +with at least one diagonal. + +[Vo82] Voss — strengthened Larson's result to at least two diagonals. + +[Er76c] Erdős, P., *Problems in combinatorics and graph theory* (1976). +-/ + +open SimpleGraph Classical Filter + +namespace Erdos1091 + +/-- A graph $G$ contains an odd cycle with at least $d$ diagonals. + +An odd cycle of length $2m+3$ ($\geq 3$) is given by an injective map $f : \text{Fin}(2m+3) \to V$ +where consecutive vertices (cyclically) are adjacent in $G$. A diagonal is an edge +of $G$ between two cycle vertices that are not consecutive in the cycle. -/ +noncomputable def HasOddCycleWithDiagonals {V : Type*} (G : SimpleGraph V) (d : ℕ) : Prop := + ∃ (m : ℕ) (f : Fin (2 * m + 3) → V), + Function.Injective f ∧ + (∀ i : Fin (2 * m + 3), + G.Adj (f i) (f ⟨(i.val + 1) % (2 * m + 3), Nat.mod_lt _ (by omega)⟩)) ∧ + d ≤ (Finset.univ.filter (fun p : Fin (2 * m + 3) × Fin (2 * m + 3) => + p.1.val < p.2.val ∧ + G.Adj (f p.1) (f p.2) ∧ + p.2.val ≠ (p.1.val + 1) % (2 * m + 3) ∧ + p.1.val ≠ (p.2.val + 1) % (2 * m + 3))).card + +/-- +Erdős Problem 1091 (proved by Voss [Vo82]): + +Let $G$ be a $K_4$-free graph with chromatic number $4$. Then $G$ contains an odd cycle +with at least two diagonals. + +Erdős originally asked about one diagonal, proved by Larson [La79]. The +pentagonal wheel shows that three diagonals cannot be guaranteed. +-/ +@[category research solved, AMS 5] +theorem erdos_1091 (n : ℕ) (G : SimpleGraph (Fin n)) + (hK4 : G.CliqueFree 4) (hχ : G.chromaticNumber = (4 : ℕ∞)) : + HasOddCycleWithDiagonals G 2 := by + sorry + +/-- +Erdős Problem 1091, open variant [Er76c, p.4]: + +Is there a function $f : \mathbb{N} \to \mathbb{N}$ with $f(r) \to \infty$ such that every graph +$G$ with chromatic number $4$, in which every induced subgraph on $\leq r$ vertices has +chromatic number $\leq 3$, contains an odd cycle with at least $f(r)$ diagonals? +-/ +@[category research open, AMS 5] +theorem erdos_1091.variants.unbounded_diagonals : + answer(sorry) ↔ + ∃ f : ℕ → ℕ, Tendsto f atTop atTop ∧ + ∀ (r n : ℕ) (G : SimpleGraph (Fin n)), + G.chromaticNumber = (4 : ℕ∞) → + (∀ S : Finset (Fin n), S.card ≤ r → + (G.induce (↑S : Set (Fin n))).chromaticNumber ≤ (3 : ℕ∞)) → + HasOddCycleWithDiagonals G (f r) := by + sorry + +end Erdos1091 diff --git a/FormalConjectures/ErdosProblems/1096.lean b/FormalConjectures/ErdosProblems/1096.lean new file mode 100644 index 0000000000..5c0bc35c4a --- /dev/null +++ b/FormalConjectures/ErdosProblems/1096.lean @@ -0,0 +1,69 @@ +/- +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 1096 + +*Reference:* [erdosproblems.com/1096](https://www.erdosproblems.com/1096) + +For $1 < q < 1 + \varepsilon$ with $\varepsilon$ sufficiently small, consider the sums +$\sum_{i \in S} q^i$ over all finite $S \subseteq \mathbb{N}$, ordered by size. Is it true +that the gaps between consecutive elements tend to zero? + +[EJK90] Erdős, P., Joó, I., and Komornik, V., *Characterization of the unique expansions +$1 = \sum q^{-n_i}$ and related problems*, Bull. Soc. Math. France (1990). + +[GWNT91] Great Western Number Theory Problem Session (1991). +-/ + +open Finset + +namespace Erdos1096 + +/-- The set of all numbers expressible as $\sum_{i \in S} q^i$ for some finite set +$S \subseteq \mathbb{N}$. -/ +noncomputable def powerSumSet (q : ℝ) : Set ℝ := + {x : ℝ | ∃ S : Finset ℕ, x = S.sum (fun i => q ^ i)} + +/-- +Erdős Problem 1096 [EJK90, GWNT91]: + +Let $1 < q < 1 + \varepsilon$ and consider the set of numbers of the form $\sum_{i \in S} q^i$ +(for all finite $S \subseteq \mathbb{N}$), ordered by size as $0 = x_1 < x_2 < \cdots$. + +Is it true that, provided $\varepsilon > 0$ is sufficiently small, $x_{k+1} - x_k \to 0$? + +Equivalently: there exists $\varepsilon > 0$ such that for all $q \in (1, 1+\varepsilon)$, the +gaps between consecutive elements of the power sum set tend to zero. We formalize this as: +for every $\delta > 0$, every sufficiently large element of the set has a successor +in the set within distance $\delta$. + +Erdős and Joó speculate that the threshold may be $q_0 \approx 1.3247$, the real root +of $x^3 = x + 1$, i.e., the smallest Pisot–Vijayaraghavan number. +-/ +@[category research open, AMS 11] +theorem erdos_1096 : + answer(sorry) ↔ + ∃ ε : ℝ, 0 < ε ∧ + ∀ q : ℝ, 1 < q → q < 1 + ε → + ∀ δ : ℝ, 0 < δ → + ∃ M : ℝ, ∀ x ∈ powerSumSet q, M ≤ x → + ∃ y ∈ powerSumSet q, x < y ∧ y - x < δ := by + sorry + +end Erdos1096 diff --git a/FormalConjectures/ErdosProblems/1098.lean b/FormalConjectures/ErdosProblems/1098.lean new file mode 100644 index 0000000000..244b8fc4e4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1098.lean @@ -0,0 +1,61 @@ +/- +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 1098 + +If the non-commuting graph of a group $G$ (with an edge between $g$ and $h$ iff $gh \neq hg$) +contains no infinite complete subgraph, then there is a finite bound on the size of its complete +subgraphs. Proved by Neumann, who showed this holds iff the centre of $G$ has finite index. + +*Reference:* [erdosproblems.com/1098](https://www.erdosproblems.com/1098) + +[Ne76] Neumann, B.H., _A problem of Paul Erdős on groups_, J. Austral. Math. Soc. Ser. A +21 (1976), 467-472. +-/ + +open SimpleGraph + +namespace Erdos1098 + +/-- The non-commuting graph of a group $G$ has vertices the elements of $G$, +with an edge between $g$ and $h$ if and only if they do not commute ($gh \neq hg$). -/ +def nonCommutingGraph (G : Type*) [Group G] : SimpleGraph G where + Adj g h := g * h ≠ h * g + symm := by intro _ _ hab; exact Ne.symm hab + loopless := by intro a hab; exact hab rfl + +/-- +Erdős Problem 1098 (Proved by Neumann [Ne76]): +Let $G$ be a group and $\Gamma(G)$ be the non-commuting graph, with vertices the elements +of $G$ and an edge between $g$ and $h$ if and only if $gh \neq hg$. If $\Gamma$ contains no +infinite complete subgraph (i.e., no infinite set of pairwise non-commuting +elements), then there is a finite bound on the size of complete subgraphs of $\Gamma$. + +This formalizes the forward direction of Neumann's result. The full result also +establishes that $\Gamma$ contains no infinite complete subgraph if and only if +the centre of $G$ has finite index, and if the centre has index $n$ then $\Gamma$ +contains no complete subgraph on more than $n$ vertices. +-/ +@[category research solved, AMS 5 20] +theorem erdos_1098 (G : Type*) [Group G] : + (¬ ∃ S : Set G, S.Infinite ∧ (nonCommutingGraph G).IsClique S) → + (∃ n : ℕ, ∀ S : Finset G, (nonCommutingGraph G).IsClique (S : Set G) → S.card ≤ n) := by + sorry + +end Erdos1098 diff --git a/FormalConjectures/ErdosProblems/1099.lean b/FormalConjectures/ErdosProblems/1099.lean new file mode 100644 index 0000000000..d87cd75b76 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1099.lean @@ -0,0 +1,93 @@ +/- +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 1099 + +*Reference:* [erdosproblems.com/1099](https://www.erdosproblems.com/1099) + +Let $1 = d_1 < \cdots < d_{\tau(n)} = n$ be the divisors of $n$, and for $\alpha > 1$ let +$$h_\alpha(n) = \sum_i \left(\frac{d_{i+1}}{d_i} - 1\right)^\alpha.$$ + +Is it true that $\liminf_{n \to \infty} h_\alpha(n) \ll_\alpha 1$? + +Erdős [Er81h] remarks that $n!$ or $\mathrm{lcm}\{1, \ldots, n\}$ would be good candidates. +The $\liminf$ is trivially $\geq 1$ (considering the term $i = 1$). + +Proved by Vose [Vo84] who constructed a specific sequence achieving bounded $h_\alpha(n)$. +It remains open whether $n!$ or $\mathrm{lcm}\{1, \ldots, n\}$ satisfy this property. + +This resembles the function $G(n) = \sum_i d_i / d_{i+1}$ considered in problem \#673. + +[Er81h] Erdős, P., _Some problems and results in number theory_. + +[Vo84] Vose, M. D., _Integers with consecutive divisors in small ratio_, J. Number Theory (1984). +-/ + +open Classical Finset Real + +namespace Erdos1099 + +/-- The sorted list of divisors of $n$ in increasing order. -/ +def sortedDivisors (n : ℕ) : List ℕ := + (Nat.divisors n).sort (· ≤ ·) + +/-- $h_\alpha(n) = \sum_i (d_{i+1}/d_i - 1)^\alpha$ where $d_1 < \cdots < d_{\tau(n)}$ are the +divisors of $n$ in increasing order. -/ +noncomputable def hAlpha (α : ℝ) (n : ℕ) : ℝ := + let ds := sortedDivisors n + ((ds.zip ds.tail).map (fun p => ((p.2 : ℝ) / (p.1 : ℝ) - 1) ^ α)).sum + +/-- +Erdős Problem 1099 (Proved by Vose [Vo84]): + +For every $\alpha > 1$, there exists a constant $C$ (depending on $\alpha$) such that +$h_\alpha(n) \leq C$ for infinitely many $n$, i.e., $\liminf_{n \to \infty} h_\alpha(n)$ +is finite. + +Formally: for every $\alpha > 1$, there exists $C$ such that for every $N$, there +exists $n \geq N$ with $h_\alpha(n) \leq C$. +-/ +@[category research solved, AMS 11] +theorem erdos_1099 : answer(True) ↔ + ∀ α : ℝ, α > 1 → ∃ C : ℝ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ hAlpha α n ≤ C := by + sorry + +/-- +Is $h_\alpha(n!)$ bounded for each $\alpha > 1$? + +Erdős [Er81h] suggested that $n!$ would be a good candidate for achieving bounded +$h_\alpha$. This remains open. +-/ +@[category research open, AMS 11] +theorem erdos_1099_factorial : answer(sorry) ↔ + ∀ α : ℝ, α > 1 → ∃ C : ℝ, ∀ n : ℕ, hAlpha α n.factorial ≤ C := by + sorry + +/-- +Is $h_\alpha(\mathrm{lcm}\{1, \ldots, n\})$ bounded for each $\alpha > 1$? + +Erdős [Er81h] suggested that $\mathrm{lcm}\{1, \ldots, n\}$ would be a good candidate for +achieving bounded $h_\alpha$. This remains open. +-/ +@[category research open, AMS 11] +theorem erdos_1099_lcm : answer(sorry) ↔ + ∀ α : ℝ, α > 1 → ∃ C : ℝ, ∀ n : ℕ, hAlpha α ((Finset.Icc 1 n).lcm id) ≤ C := by + sorry + +end Erdos1099 diff --git a/FormalConjectures/ErdosProblems/110.lean b/FormalConjectures/ErdosProblems/110.lean new file mode 100644 index 0000000000..f0a7c1bde1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/110.lean @@ -0,0 +1,71 @@ +/- +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 110 + +*Reference:* [erdosproblems.com/110](https://www.erdosproblems.com/110) + +Is there a function $F$ such that every graph with chromatic number $\aleph_1$ has, for all +large $n$, a subgraph with chromatic number $n$ on at most $F(n)$ vertices? Disproved: +Lambie-Hanson constructed a ZFC counterexample. + +[dBEr51] de Bruijn, N. G. and Erdős, P., _A colour problem for infinite graphs and a problem in +the theory of relations_. Indag. Math. (1951), 369–373. + +[EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., _On almost bipartite large chromatic graphs_. +Theory and Practice of Combinatorics (1982), 117–123. + +[Er95d] Erdős, P., _On some problems in combinatorial set theory_. Publ. Inst. Math. (Beograd) +(N.S.) (1995), 61–65. + +[KoSh05] Komjáth, P. and Shelah, S., _Finite subgraphs of uncountably chromatic graphs_. +J. Graph Theory (2005), 28–38. + +[La20] Lambie-Hanson, C., _On the growth rate of chromatic numbers of finite subgraphs_. +Advances in Mathematics (2020), 107176. +-/ + +open SimpleGraph Cardinal + +namespace Erdos110 + +/-- +Erdős-Hajnal-Szemerédi Conjecture (Problem #110): +Is there some function $F : \mathbb{N} \to \mathbb{N}$ such that every graph $G$ with chromatic +number $\aleph_1$ has, for all sufficiently large $n$, a subgraph with chromatic number $n$ on at +most $F(n)$ vertices? + +Conjectured by Erdős, Hajnal, and Szemerédi [EHS82]. +The analogous statement fails for graphs of chromatic number $\aleph_0$. +Shelah [KoSh05] proved it is consistent with ZFC that the answer is no. +Lambie-Hanson [La20] constructed a ZFC counterexample, so the conjecture is **false**. +-/ +@[category research solved, AMS 3 5] +theorem erdos_110 : answer(False) ↔ + ∃ F : ℕ → ℕ, + ∀ (V : Type*) (G : SimpleGraph V), + G.chromaticCardinal = aleph 1 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ H : G.Subgraph, + H.verts.Finite ∧ + H.verts.ncard ≤ F n ∧ + H.coe.chromaticNumber = ↑n := by + sorry + +end Erdos110 diff --git a/FormalConjectures/ErdosProblems/1100.lean b/FormalConjectures/ErdosProblems/1100.lean new file mode 100644 index 0000000000..9b29ad3a06 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1100.lean @@ -0,0 +1,112 @@ +/- +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 1100 + +*Reference:* [erdosproblems.com/1100](https://www.erdosproblems.com/1100) + +[ErHa78] Erdős, P. and Hall, R. R., _On some unconventional problems on the divisors of +integers_. J. Austral. Math. Soc. Ser. A (1978), 479–485. + +[Er81h] Erdős, P., _Some problems and results on additive and multiplicative number theory_. +Analytic number theory (Philadelphia, Pa., 1980) (1981), 171–182. + +If $1 = d_1 < \cdots < d_{\tau(n)} = n$ are the divisors of $n$, let $\tau^\perp(n)$ count the +number of $i$ for which $\gcd(d_i, d_{i+1}) = 1$. + +Part 1: Is it true that $\tau^\perp(n)/\omega(n) \to \infty$ for almost all $n$? + +Part 2: Is it true that $\tau^\perp(n) < \exp((\log n)^{o(1)})$ for all $n$? +Equivalently, for every $\varepsilon > 0$ and sufficiently large $n$, +$\tau^\perp(n) < \exp((\log n)^\varepsilon)$. + +Part 3: Let $g(k) = \max$ over squarefree $n$ with $\omega(n) = k$ of $\tau^\perp(n)$. +Determine the growth of $g(k)$. Erdős and Simonovits proved +$(\sqrt{2} + o(1))^k < g(k) < (2 - c)^k$ for some constant $c > 0$. +-/ + +open Finset Real + +namespace Erdos1100 + +/-- The sorted list of divisors of $n$ in increasing order. -/ +def sortedDivisors (n : ℕ) : List ℕ := + (Nat.divisors n).sort (· ≤ ·) + +/-- $\tau^\perp(n)$: the number of indices $i$ such that $\gcd(d_i, d_{i+1}) = 1$, +where $d_1 < \cdots < d_{\tau(n)}$ are the divisors of $n$ in increasing order. -/ +def tauPerp (n : ℕ) : ℕ := + let ds := sortedDivisors n + ((ds.zip ds.tail).filter (fun p => Nat.gcd p.1 p.2 == 1)).length + +/-- +Erdős Problem 1100, Part 1: +Is it true that $\tau^\perp(n)/\omega(n) \to \infty$ for almost all $n$? That is, for every +bound $M$, the natural density of $\{n : \tau^\perp(n) \le M \cdot \omega(n)\}$ is zero. +-/ +@[category research open, AMS 11] +theorem erdos_1100 : + answer(sorry) ↔ + ∀ M : ℕ, ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (((Finset.range N).filter (fun n => + tauPerp n ≤ M * n.primeFactors.card)).card : ℝ) / (N : ℝ) < ε := by + sorry + +/-- +Erdős Problem 1100, Part 2: +Is it true that for every $\varepsilon > 0$, for all sufficiently large $n$, +$\tau^\perp(n) < \exp((\log n)^\varepsilon)$? +This formalizes the conjecture that $\tau^\perp(n) < \exp((\log n)^{o(1)})$. +-/ +@[category research open, AMS 11] +theorem erdos_1100.variants.part2 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (tauPerp n : ℝ) < Real.exp ((Real.log (n : ℝ)) ^ ε) := by + sorry + +/-- +Erdős Problem 1100, Part 3 (upper bound, proved by Erdős–Simonovits): +There exists $c > 0$ such that for all sufficiently large $k$, every squarefree $n$ +with $\omega(n) = k$ satisfies $\tau^\perp(n) < (2 - c)^k$. +-/ +@[category research solved, AMS 11] +theorem erdos_1100.variants.part3_upper : + ∃ c : ℝ, c > 0 ∧ + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + ∀ n : ℕ, Squarefree n → n.primeFactors.card = k → + (tauPerp n : ℝ) < (2 - c) ^ k := by + sorry + +/-- +Erdős Problem 1100, Part 3 (lower bound, proved by Erdős–Simonovits): +For every $\varepsilon > 0$ and sufficiently large $k$, there exists a squarefree $n$ with +$\omega(n) = k$ and $\tau^\perp(n) > (\sqrt{2} - \varepsilon)^k$. +-/ +@[category research solved, AMS 11] +theorem erdos_1100.variants.part3_lower : + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + ∃ n : ℕ, Squarefree n ∧ n.primeFactors.card = k ∧ + (tauPerp n : ℝ) > (Real.sqrt 2 - ε) ^ k := by + sorry + +end Erdos1100 diff --git a/FormalConjectures/ErdosProblems/1103.lean b/FormalConjectures/ErdosProblems/1103.lean new file mode 100644 index 0000000000..1546fb36f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1103.lean @@ -0,0 +1,61 @@ +/- +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 1103 + +*Reference:* [erdosproblems.com/1103](https://www.erdosproblems.com/1103) + +Let $A = \{a_0 < a_1 < a_2 < \cdots\}$ be an infinite sequence of positive integers such that +every element of the sumset $A + A$ is squarefree. How fast must $A$ grow? + +Erdős notes there exists such a sequence which grows exponentially, but does not +expect such a sequence of polynomial growth to exist. + +van Doorn and Tao [vDTa25] showed $a_j > 0.24\, j^{4/3}$ for all $j$, and that there +exists such a sequence with $a_j < \exp(5j / \log j)$ for all large $j$. + +[Er81h] Erdős, P., _Some applications of graph theory and combinatorial methods to number theory +and geometry_ (1981). + +[Ko04] Konyagin, S. V., _Problems of the set of square-free numbers_. Izv. Ross. Akad. Nauk +Ser. Mat. (2004), 63–90. + +[vDTa25] van Doorn, F. and Tao, T., _Sumsets of squarefree numbers_ (2025). +-/ + +namespace Erdos1103 + +/-- +Erdős Problem 1103 [Er81h, p.180]: + +For any strictly increasing sequence $a : \mathbb{N} \to \mathbb{N}$ such that $a(i) + a(j)$ is +squarefree for all $i, j$, the sequence must grow super-polynomially: for every $C > 0$, we have +$a(j) > j^C$ for all sufficiently large $j$. +-/ +@[category research open, AMS 11] +theorem erdos_1103 + (a : ℕ → ℕ) + (ha_strict_mono : StrictMono a) + (ha_sumset_sqfree : ∀ i j : ℕ, Squarefree (a i + a j)) : + ∀ C : ℝ, C > 0 → + ∃ N : ℕ, ∀ j : ℕ, j ≥ N → + (j : ℝ) ^ C < (a j : ℝ) := by + sorry + +end Erdos1103 diff --git a/FormalConjectures/ErdosProblems/1109.lean b/FormalConjectures/ErdosProblems/1109.lean new file mode 100644 index 0000000000..f08e1ad87e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1109.lean @@ -0,0 +1,88 @@ +/- +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 1109 + +*Reference:* [erdosproblems.com/1109](https://www.erdosproblems.com/1109) + +[ErSa87] Erdős, P. and Sárközy, A., _On divisibility properties of integers of the form +a + a'_. Acta Math. Hungar. (1987), 117–122. + +[Sa92c] Sárközy, G. N., _On a problem of P. Erdős_. Acta Math. Hungar. (1992), 271–282. + +[Gy01] Gyarmati, K., _On divisibility properties of integers of the form ab + 1_. Period. Math. +Hungar. (2001), 71–79. + +[Ko04] Konyagin, S. V., _Problems of the set of square-free numbers_. Izv. Ross. Akad. Nauk +Ser. Mat. (2004), 63–90. + +OEIS: A392164, A392165 +-/ + +open Finset Pointwise Real + +namespace Erdos1109 + +/-- +Let $f(N)$ be the size of the largest subset $A \subseteq \{1, \ldots, N\}$ such that every +$n \in A + A$ is squarefree. Is it true that $f(N) \leq (\log N)^{O(1)}$? + +Formalized as: there exist constants $C > 0$ and $k > 0$ such that for all +sufficiently large $N$, every subset $A \subseteq \{1, \ldots, N\}$ whose sumset $A + A$ is +entirely squarefree satisfies $|A| \leq C \cdot (\log N)^k$. + +First studied by Erdős and Sárközy [ErSa87], who proved +$$\log N \ll f(N) \ll N^{3/4} \cdot \log N.$$ +Konyagin [Ko04] improved this to +$$(\log \log N) \cdot (\log N)^2 \ll f(N) \ll N^{11/15 + o(1)}.$$ + +See also `erdos_1103` for the infinite analogue; upper bounds for this problem directly +imply lower bounds for Problem 1103. +-/ +@[category research open, AMS 5 11] +theorem erdos_1109 : + answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ k : ℕ, 0 < k ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∀ n ∈ A + A, Squarefree n) → + (A.card : ℝ) ≤ C * (Real.log N) ^ k := by + sorry + +/-- +Weaker variant of `erdos_1109`: is $f(N) \leq N^{o(1)}$, i.e., does $f(N)$ grow +sub-polynomially? This asks whether for every $\varepsilon > 0$, we have +$f(N) \leq N^\varepsilon$ for all sufficiently large $N$. + +This is implied by the stronger polylogarithmic conjecture `erdos_1109`, but may be +more tractable. +-/ +@[category research open, AMS 5 11] +theorem erdos_1109_subpolynomial : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∀ n ∈ A + A, Squarefree n) → + (A.card : ℝ) ≤ (N : ℝ) ^ ε := by + sorry + +end Erdos1109 diff --git a/FormalConjectures/ErdosProblems/111.lean b/FormalConjectures/ErdosProblems/111.lean new file mode 100644 index 0000000000..6762ad8bf9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/111.lean @@ -0,0 +1,94 @@ +/- +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 111 + +*Reference:* [erdosproblems.com/111](https://www.erdosproblems.com/111) + +Does there exist a graph with chromatic number $\aleph_1$ such that every $n$-vertex induced +subgraph can be made bipartite by deleting $O(n^{1+\varepsilon})$ edges for every +$\varepsilon > 0$? + +[EHS82] Erdős, P., Hajnal, A. and Szemerédi, E., _On almost bipartite large chromatic +graphs_. Annals of Discrete Mathematics, 12 (1982), 117-123. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica, 1 (1981), 25-42. + +[Er87] Erdős, P., _Some problems on finite and infinite graphs_. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[Er97d] Erdős, P., _Some of my new and almost new problems and results in +combinatorics and graph theory_ (1997). + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) + +See also Problem 74. +-/ + +open SimpleGraph Cardinal + +namespace Erdos111 + +/-- +The minimum number of edges that must be deleted from a finite graph $H$ to make +it bipartite (i.e., properly 2-colorable). +-/ +noncomputable def minEdgeDeletionsForBipartite {W : Type*} [Fintype W] + (H : SimpleGraph W) : ℕ := + sInf {k : ℕ | ∃ H' : SimpleGraph W, + H' ≤ H ∧ + Nonempty (H'.Coloring (Fin 2)) ∧ + (H.edgeSet \ H'.edgeSet).ncard = k} + +/-- +For a graph $G$ and $n \in \mathbb{N}$, $h(G, n)$ is the maximum, over all $n$-vertex +induced subgraphs $H$ of $G$, of the minimum number of edges that must be deleted +from $H$ to make it bipartite. +-/ +noncomputable def maxMinEdgeDeletionsForBipartite {V : Type*} (G : SimpleGraph V) (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ (S : Finset V), + S.card = n ∧ + k = minEdgeDeletionsForBipartite (G.induce (S : Set V))} + +/-- +There exists a graph $G$ with chromatic number $\aleph_1$ such that +$h(G, n) \ll n^{1+\varepsilon}$ for every $\varepsilon > 0$. + +- For every $G$ with chromatic number $\aleph_1$, $h(G, n) \gg n$, since $G$ must + contain $\aleph_1$ many vertex-disjoint odd cycles of some fixed length $2r+1$. +- Erdős–Hajnal–Szemerédi [EHS82] proved there exists $G$ with chromatic number + $\aleph_1$ satisfying $h(G, n) \ll n^{3/2}$. +- Erdős [Er81] conjectured this upper bound can be improved: there should exist $G$ + with chromatic number $\aleph_1$ such that $h(G, n) \ll n^{1+\varepsilon}$ for + every $\varepsilon > 0$. +-/ +@[category research open, AMS 5] +theorem erdos_111 : answer(sorry) ↔ + ∃ (V : Type*) (G : SimpleGraph V), + G.chromaticCardinal = aleph 1 ∧ + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, (maxMinEdgeDeletionsForBipartite G n : ℝ) ≤ C * (n : ℝ) ^ (1 + ε) := by + sorry + +end Erdos111 diff --git a/FormalConjectures/ErdosProblems/1110.lean b/FormalConjectures/ErdosProblems/1110.lean new file mode 100644 index 0000000000..5f0e3bdc99 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1110.lean @@ -0,0 +1,84 @@ +/- +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 1110 + +*Reference:* [erdosproblems.com/1110](https://www.erdosproblems.com/1110) + +Let $p > q \geq 2$ be two coprime integers. We call $n$ *representable* if it is the sum of +integers of the form $p^k q^l$, none of which divide each other. + +If $\{p,q\} \neq \{2,3\}$ then what can be said about the density of non-representable numbers? +Are there infinitely many coprime non-representable numbers? + +[ErLe96] Erdős, P. and Lewin, M., _$d$-complete sequences of integers_. Math. Comp. (1996), +837-840. Proved that there are finitely many non-representable numbers if and only if +$\{p,q\} = \{2,3\}$. + +[YuCh22] Yu, W.-X. and Chen, Y.-G., _On a conjecture of Erdős and Lewin_. J. Number Theory +(2022), 763-778. Proved that the set of representable numbers has density zero for many cases, +and that there are infinitely many coprime non-representable numbers for most parameter choices. +Some cases remain open. + +[YaZh25] Yang, Q.-H. and Zhao, L., _A conjecture of Yu and Chen related to the Erdős-Lewin +theorem_. Acta Arith. (2025), 277-286. Improved lower bounds on the growth rate. +-/ + +open Finset Classical + +namespace Erdos1110 + +/-- A natural number $m$ is a $(p,q)$-power if $m = p^a \cdot q^b$ for some $a, b \geq 0$. -/ +def IsPQPower (p q m : ℕ) : Prop := + ∃ a b : ℕ, m = p ^ a * q ^ b + +/-- A natural number $n$ is $(p,q)$-representable if $n$ equals the sum of a nonempty finite set +of numbers of the form $p^a \cdot q^b$, where no element divides another. -/ +def IsRepresentable (p q n : ℕ) : Prop := + ∃ S : Finset ℕ, S.Nonempty ∧ + (∀ m ∈ S, IsPQPower p q m) ∧ + IsAntichain (· ∣ ·) (S : Set ℕ) ∧ + S.sum id = n + +/-- +Erdős Problem 1110 [ErLe96]: + +For coprime integers $p > q \geq 2$ with $\{p,q\} \neq \{2,3\}$, there are infinitely many +non-representable numbers that are coprime to $p \cdot q$. + +Since $p > q \geq 2$ and $p, q$ are coprime, the only excluded case is $p = 3, q = 2$. +-/ +@[category research open, AMS 11] +theorem erdos_1110 : answer(sorry) ↔ + ∀ p q : ℕ, 2 ≤ q → q < p → Nat.Coprime p q → + ¬(p = 3 ∧ q = 2) → + Set.Infinite {n : ℕ | ¬IsRepresentable p q n ∧ Nat.Coprime n (p * q)} := by + sorry + +/-- +Erdős-Lewin theorem [ErLe96]: The set of non-representable numbers is finite if and only if +$\{p,q\} = \{2,3\}$ (i.e., $p = 3, q = 2$ given our convention $p > q$). +-/ +@[category research solved, AMS 11] +theorem erdos_1110_erdos_lewin : + ∀ p q : ℕ, 2 ≤ q → q < p → Nat.Coprime p q → + (Set.Finite {n : ℕ | ¬IsRepresentable p q n} ↔ (p = 3 ∧ q = 2)) := by + sorry + +end Erdos1110 diff --git a/FormalConjectures/ErdosProblems/1111.lean b/FormalConjectures/ErdosProblems/1111.lean new file mode 100644 index 0000000000..f764e4f297 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1111.lean @@ -0,0 +1,78 @@ +/- +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 1111 + +*Reference:* [erdosproblems.com/1111](https://www.erdosproblems.com/1111) + +For any $t, c \geq 1$, does there exist $d$ such that every finite graph with chromatic +number at least $d$ and clique number less than $t$ contains two anticomplete vertex sets +each with chromatic number at least $c$? + +[ElEr85] El-Zahar, M. and Erdős, P., *On the existence of two nonneighboring +subgraphs in a graph*. Combinatorica **5** (1985), 295–300. + +[Er85b] Erdős, P., *Problems and results on chromatic numbers in finite and infinite +graphs*. Graph theory with applications to algorithms and computer science +(Kalamazoo, Mich., 1984) (1985), 201–213. + +[Wa80b] Wagon, S., *A bound on the chromatic number of graphs without certain +induced subgraphs*. J. Combin. Theory Ser. B **29** (1980), 345–346. + +[NSS24] Nguyen, T., Scott, A. and Seymour, P., *On a problem of El-Zahar and +Erdős*. J. Combin. Theory Ser. B **165** (2024), 211–222. +-/ + +open SimpleGraph Classical + +namespace Erdos1111 + +/-- Two disjoint sets of vertices $A$, $B$ are anticomplete in $G$ if there are no edges +between any vertex in $A$ and any vertex in $B$. -/ +def Anticomplete {V : Type*} (G : SimpleGraph V) (A B : Set V) : Prop := + Disjoint A B ∧ ∀ a ∈ A, ∀ b ∈ B, ¬G.Adj a b + +/-- +Erdős Problem 1111 [ElEr85]: + +If $t, c \geq 1$ then there exists $d \geq 1$ such that if $G$ is a finite graph with +$\chi(G) \geq d$ and $\omega(G) < t$, then there exist anticomplete sets +$A, B \subseteq V(G)$ with $\chi(G[A]) \geq c$ and $\chi(G[B]) \geq c$. + +Two disjoint vertex sets $A$, $B$ are anticomplete if there are no edges between them. +$\chi$ denotes the chromatic number and $\omega$ the clique number. The condition +$\omega(G) < t$ is expressed as `G.CliqueFree t` (no clique of size $t$ exists). + +El Zahar and Erdős show it suffices to consider $t \leq c$. Let $d(t,c)$ be the minimal +such $d$. Known bounds include $d(t,2) \leq \binom{t}{2}+1$ (via Wagon [Wa80b]) and +$d(3,3) \leq 8$. +-/ +@[category research open, AMS 5] +theorem erdos_1111 (t c : ℕ) (ht : 1 ≤ t) (hc : 1 ≤ c) : + ∃ d : ℕ, 1 ≤ d ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (d : ℕ∞) ≤ G.chromaticNumber → + G.CliqueFree t → + ∃ (A B : Set (Fin n)), + Anticomplete G A B ∧ + (c : ℕ∞) ≤ (G.induce A).chromaticNumber ∧ + (c : ℕ∞) ≤ (G.induce B).chromaticNumber := by + sorry + +end Erdos1111 diff --git a/FormalConjectures/ErdosProblems/1112.lean b/FormalConjectures/ErdosProblems/1112.lean new file mode 100644 index 0000000000..09f9f6c834 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1112.lean @@ -0,0 +1,140 @@ +/- +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 1112 + +*Reference:* [erdosproblems.com/1112](https://www.erdosproblems.com/1112) + +Define $r_k(d_1, d_2)$ to be the smallest integer $r$ such that for any lacunary sequence $B$ +with ratio $\geq r$, there exists a sequence $A$ with consecutive gaps in $[d_1, d_2]$ whose +$k$-fold sumset avoids $B$. The problem asks whether $r_k(d_1, d_2)$ exists for $k \geq 3$. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathématique (1980), p. 18. + +[BHJ97] Bollobás, B., Hegyvári, N., Jin, G., _On a problem of Erdős and Graham_. Discrete +Mathematics (1997), 253–257. + +[Ch00] Chen, Y.-G., _On sums and intersects of sequences_. Discrete Mathematics (2000), 351–354. + +[TaYa21] Tang, M., Yang, Q.-H., _On a problem of Erdős and Graham_. Publicationes Mathematicae +Debrecen (2021), 485–493. +-/ + +namespace Erdos1112 + +/-- The $k$-fold sumset of a set $S$ of natural numbers: all sums $s_1 + \cdots + s_k$ +with each $s_i \in S$. Defined recursively: $0S = \{0\}$, +$(k+1)S = \{a + b \mid a \in S,\, b \in kS\}$. -/ +def kFoldSumset : ℕ → Set ℕ → Set ℕ + | 0, _ => {0} + | k + 1, S => {n | ∃ a ∈ S, ∃ b ∈ kFoldSumset k S, n = a + b} + +/-- +Erdős Problem 1112 [ErGr80, p. 18]: + +Define $r_k(d_1, d_2)$ to be the smallest integer $r$ (if it exists) such that for any +lacunary sequence $B = \{b_1 < b_2 < \cdots\}$ of positive integers with +$b_{i+1} \geq r \cdot b_i$, there exists a sequence $A = \{a_1 < a_2 < \cdots\}$ of +positive integers with $d_1 \leq a_{i+1} - a_i \leq d_2$ for all $i$, and +$(kA) \cap B = \emptyset$, where $kA$ is the $k$-fold sumset. + +The universal statement — that $r_k(d_1, d_2)$ exists for all $1 \leq d_1 < d_2$ and +$k \geq 3$ — is false. Bollobás, Hegyvári, and Jin [BHJ97] showed that $r_3(2,3)$ does +not exist, so the answer is `False`. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1112 : answer(False) ↔ + ∀ (d₁ d₂ : ℕ), 1 ≤ d₁ → d₁ < d₂ → + ∀ (k : ℕ), 3 ≤ k → + ∃ (r : ℕ), ∀ (B : ℕ → ℕ), StrictMono B → (∀ i, 0 < B i) → + (∀ i, r * B i ≤ B (i + 1)) → + ∃ (A : ℕ → ℕ), StrictMono A ∧ (∀ i, 0 < A i) ∧ + (∀ i, d₁ ≤ A (i + 1) - A i) ∧ + (∀ i, A (i + 1) - A i ≤ d₂) ∧ + ∀ n, n ∈ kFoldSumset k (Set.range A) → n ∉ Set.range B := by + sorry + +/-- +$r_3(2,3)$ does not exist [BHJ97]: for any ratio $r$, there exists a lacunary sequence $B$ +with $b_{i+1} \geq r \cdot b_i$ such that $(A + A + A) \cap B \neq \emptyset$ for every +sequence $A$ with gaps in $[2,3]$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1112.variants.r3_2_3_nonexistence : + ∀ (r : ℕ), ∃ (B : ℕ → ℕ), StrictMono B ∧ (∀ i, 0 < B i) ∧ + (∀ i, r * B i ≤ B (i + 1)) ∧ + ∀ (A : ℕ → ℕ), StrictMono A → (∀ i, 0 < A i) → + (∀ i, 2 ≤ A (i + 1) - A i) → + (∀ i, A (i + 1) - A i ≤ 3) → + ∃ n, n ∈ kFoldSumset 3 (Set.range A) ∧ n ∈ Set.range B := by + sorry + +/-- +$r_2(a, b) \leq 2$ for all integers $1 \leq a < b$ with $b \neq 2a$ [Ch00]: the $2$-fold +sumset of a sequence with gaps in $[a, b]$ can always avoid any lacunary sequence with +ratio $\geq 2$, provided $b \neq 2a$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1112.variants.r2_upper (a b : ℕ) (ha : 1 ≤ a) (hab : a < b) + (hne : b ≠ 2 * a) : + ∀ (B : ℕ → ℕ), StrictMono B → (∀ i, 0 < B i) → + (∀ i, 2 * B i ≤ B (i + 1)) → + ∃ (A : ℕ → ℕ), StrictMono A ∧ (∀ i, 0 < A i) ∧ + (∀ i, a ≤ A (i + 1) - A i) ∧ + (∀ i, A (i + 1) - A i ≤ b) ∧ + ∀ n, n ∈ kFoldSumset 2 (Set.range A) → n ∉ Set.range B := by + sorry + +/-- +$r_2(2, 3) = 2$ [ErGr80], [BHJ97]: the smallest lacunary ratio ensuring avoidance for +$2$-fold sumsets with gaps in $[2, 3]$ is exactly $2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1112.variants.r2_2_3 : + (∀ (B : ℕ → ℕ), StrictMono B → (∀ i, 0 < B i) → + (∀ i, 2 * B i ≤ B (i + 1)) → + ∃ (A : ℕ → ℕ), StrictMono A ∧ (∀ i, 0 < A i) ∧ + (∀ i, 2 ≤ A (i + 1) - A i) ∧ + (∀ i, A (i + 1) - A i ≤ 3) ∧ + ∀ n, n ∈ kFoldSumset 2 (Set.range A) → n ∉ Set.range B) ∧ + (∃ (B : ℕ → ℕ), StrictMono B ∧ (∀ i, 0 < B i) ∧ + (∀ i, 1 * B i ≤ B (i + 1)) ∧ + ∀ (A : ℕ → ℕ), StrictMono A → (∀ i, 0 < A i) → + (∀ i, 2 ≤ A (i + 1) - A i) → + (∀ i, A (i + 1) - A i ≤ 3) → + ∃ n, n ∈ kFoldSumset 2 (Set.range A) ∧ n ∈ Set.range B) := by + sorry + +/-- +$r_2(a, 2a) \geq 2$ for all positive integers $a$ [Ch00]: for any sequence with gaps in +$[a, 2a]$, a lacunary sequence with ratio $1$ (i.e., no lacunary growth requirement) can +intersect its $2$-fold sumset. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1112.variants.r2_2a_lower (a : ℕ) (ha : 1 ≤ a) : + ∃ (B : ℕ → ℕ), StrictMono B ∧ (∀ i, 0 < B i) ∧ + (∀ i, 1 * B i ≤ B (i + 1)) ∧ + ∀ (A : ℕ → ℕ), StrictMono A → (∀ i, 0 < A i) → + (∀ i, a ≤ A (i + 1) - A i) → + (∀ i, A (i + 1) - A i ≤ 2 * a) → + ∃ n, n ∈ kFoldSumset 2 (Set.range A) ∧ n ∈ Set.range B := by + sorry + +end Erdos1112 diff --git a/FormalConjectures/ErdosProblems/1113.lean b/FormalConjectures/ErdosProblems/1113.lean new file mode 100644 index 0000000000..66d02851f8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1113.lean @@ -0,0 +1,80 @@ +/- +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 1113 + +Are there Sierpiński numbers for which no finite covering set of primes exists? + +*Reference:* [erdosproblems.com/1113](https://www.erdosproblems.com/1113) + +*Related problems:* #203, #276 + +*OEIS:* [A076336](https://oeis.org/A076336) + +[Si60] Sierpiński, W., _Sur un problème concernant les nombres k·2ⁿ+1_. Elem. Math. **15** +(1960), 73–74. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Iz95] Izotov, A., _A note on Sierpinski numbers_. Fibonacci Quart. **33** (1995), 206–207. + +[Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), xviii+437. + +[FFK08] Filaseta, M., Finch, C., and Kozek, M., _On powers associated with Sierpiński numbers, +Riesel numbers, and Polignac's conjecture_. J. Number Theory **128** (2008), 1916–1940. +-/ + +namespace Erdos1113 + +/-- A positive odd integer $m$ is a *Sierpiński number* if $2^k \cdot m + 1$ is composite +for all $k \geq 0$. -/ +def IsSierpinskiNumber (m : ℕ) : Prop := + 0 < m ∧ ¬ 2 ∣ m ∧ ∀ k : ℕ, ¬ Nat.Prime (2 ^ k * m + 1) + +/-- A finite set of primes $P$ is a *covering set* for $m$ if every $2^k \cdot m + 1$ is +divisible by some prime $p \in P$. -/ +def HasFiniteCoveringSet (m : ℕ) (P : Finset ℕ) : Prop := + (∀ p ∈ P, Nat.Prime p) ∧ ∀ k : ℕ, ∃ p ∈ P, p ∣ (2 ^ k * m + 1) + +/-- +Are there Sierpiński numbers with no finite covering set of primes? [ErGr80, p.27] + +Erdős and Graham conjectured the answer is yes, since otherwise this would imply there +are infinitely many Fermat primes. Izotov [Iz95] proved that $m = 734110615000775^4$ is +a Sierpiński number, and Filaseta, Finch, and Kozek [FFK08] gave a detailed argument that +it has no finite covering set. +-/ +@[category research open, AMS 11] +theorem erdos_1113 : answer(sorry) ↔ + ∃ m : ℕ, IsSierpinskiNumber m ∧ ∀ P : Finset ℕ, ¬ HasFiniteCoveringSet m P := by + sorry + +/-- +Filaseta, Finch, and Kozek [FFK08] conjectured that every Sierpiński number is either a +perfect power or has a finite covering set of primes. This is a refinement of the original +question: it predicts that Sierpiński numbers without covering sets exist, but only among +perfect powers. +-/ +@[category research open, AMS 11] +theorem erdos_1113_variant : (∀ m : ℕ, IsSierpinskiNumber m → + (∃ b k : ℕ, 1 < k ∧ m = b ^ k) ∨ (∃ P : Finset ℕ, HasFiniteCoveringSet m P)) := by + sorry + +end Erdos1113 diff --git a/FormalConjectures/ErdosProblems/1114.lean b/FormalConjectures/ErdosProblems/1114.lean new file mode 100644 index 0000000000..4b22e616fc --- /dev/null +++ b/FormalConjectures/ErdosProblems/1114.lean @@ -0,0 +1,65 @@ +/- +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 1114 + +*Reference:* [erdosproblems.com/1114](https://www.erdosproblems.com/1114) + +[Ba60b] Bálint, E., _Proof of a conjecture of P. Erdős_. Mathematikai Lapok (1960), 33–40. + +[Lo76] Lorch, L., _Some monotonicity properties of polynomials with equally spaced zeros_. +Acta Mathematica Academiae Scientiarum Hungaricae (1976), 293–300. + +The conjecture was proved by Bálint [Ba60b]. Bálint gives no source for the conjecture — +presumably it was from Erdős in personal communication. Generalizations were provided +by Lorch [Lo76]. +-/ + +open scoped BigOperators +open Polynomial Finset + +namespace Erdos1114 + +/-- +Erdős Problem 1114 (proved by Balint [Ba60b]): + +Let $f(x) \in \mathbb{R}[x]$ be a polynomial whose $(n+1)$ roots are all real, distinct, and +form an arithmetic progression: $a, a+d, a+2d, \ldots, a+nd$ for some $a \in \mathbb{R}$, $d > 0$. +By Rolle's theorem, $f'(x)$ has $n$ distinct real zeros $b_0 < b_1 < \cdots < b_{n-1}$ +in the interval $(a, a+nd)$. + +The conjecture (now proved) states that the differences between consecutive +zeros of $f'(x)$ are monotonically increasing from the midpoint towards the +endpoints. By symmetry of the arithmetic progression, the zeros of $f'$ are +symmetric about the center point, so it suffices to state the monotonicity +for the right half: for indices $i, j$ with $\lfloor(n-1)/2\rfloor \leq i < j$ and $j+1 < n$, +we have $b_{i+1} - b_i \leq b_{j+1} - b_j$. +-/ +@[category research solved, AMS 26] +theorem erdos_1114 (n : ℕ) (hn : 2 ≤ n) (a d : ℝ) (hd : 0 < d) : + let f := ∏ i ∈ range (n + 1), (X - C (a + ↑i * d)) + ∃ b : ℕ → ℝ, + (∀ i j, i < n → j < n → i < j → b i < b j) ∧ + (∀ j, j < n → (derivative f).IsRoot (b j)) ∧ + (∀ x : ℝ, (derivative f).IsRoot x → ∃ j, j < n ∧ b j = x) ∧ + ∀ i j, (n - 1) / 2 ≤ i → i < j → j + 1 < n → + b (i + 1) - b i ≤ b (j + 1) - b j := by + sorry + +end Erdos1114 diff --git a/FormalConjectures/ErdosProblems/1115.lean b/FormalConjectures/ErdosProblems/1115.lean new file mode 100644 index 0000000000..59605d73f5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1115.lean @@ -0,0 +1,95 @@ +/- +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 1115 + +*Reference:* [erdosproblems.com/1115](https://www.erdosproblems.com/1115) + +Let $f(z)$ be an entire function of finite order, and let $\Gamma$ be a rectifiable path +on which $f(z) \to \infty$. Let $\ell(r)$ be the length of $\Gamma$ in the disc $|z| < r$. +Can such a path $\Gamma$ always be found with $\ell(r) \ll r$? + +[GoEr79] Gol'dberg, A. A. and Eremenko, A. È., *Asymptotic curves of entire functions of +finite order*. Mat. Sb. (N.S.) (1979), 555–581, 647. + +[Ha60] Hayman, W. K., *Defective values and asymptotic paths*. Matematika (1960), 21–27. + +[Ha60b] Hayman, W. K., *Slowly growing integral and subharmonic functions*. Comment. Math. +Helv. (1960), 75–84. + +[Ha74] Hayman, W. K., *Research problems in function theory: new problems* (1974), 155–180. +-/ + +open Complex Filter Topology Set MeasureTheory + +namespace Erdos1115 + +/-- An entire function: differentiable everywhere on $\mathbb{C}$. -/ +def IsEntire (f : ℂ → ℂ) : Prop := Differentiable ℂ f + +/-- An entire function has finite order: there exists $\rho \geq 0$ such that + $|f(z)| \leq \exp(C \cdot |z|^\rho)$ for all sufficiently large $|z|$. -/ +def HasFiniteOrder (f : ℂ → ℂ) : Prop := + ∃ ρ : ℝ, 0 ≤ ρ ∧ ∃ (C R : ℝ), 0 < R ∧ + ∀ z : ℂ, R ≤ ‖z‖ → ‖f z‖ ≤ Real.exp (C * ‖z‖ ^ ρ) + +/-- An arc-length parameterized rectifiable path in $\mathbb{C}$ going to infinity. + The parameter $t$ represents arc length from the start. -/ +structure ArcLengthPath where + toFun : ℝ → ℂ + continuous' : Continuous toFun + /-- The path goes to infinity: $|\gamma(t)| \to \infty$ as $t \to \infty$. -/ + tendsToInfinity : Tendsto (fun t => ‖toFun t‖) atTop atTop + /-- Parameterized by arc length: the variation on $[0, T]$ equals $T$. -/ + isArcLength : ∀ T : ℝ, 0 ≤ T → eVariationOn toFun (Icc 0 T) = ENNReal.ofReal T + +/-- $f(z) \to \infty$ along a path $\gamma$. -/ +def TendsToInfinityAlong (f : ℂ → ℂ) (γ : ArcLengthPath) : Prop := + Tendsto (fun t => ‖f (γ.toFun t)‖) atTop atTop + +/-- The arc length of an arc-length parameterized path $\gamma$ inside the closed disk + of radius $r$. For arc-length parameterization, this equals the Lebesgue measure + of $\{t \geq 0 : |\gamma(t)| \leq r\}$. -/ +noncomputable def pathLengthInDisk (γ : ArcLengthPath) (r : ℝ) : ℝ := + (volume (({t : ℝ | 0 ≤ t ∧ ‖γ.toFun t‖ ≤ r}) : Set ℝ)).toReal + +/-- +Erdős Problem 1115 (Disproved by Gol'dberg and Eremenko [GoEr79]): + +Let $f(z)$ be an entire function of finite order, and let $\Gamma$ be a rectifiable path +on which $f(z) \to \infty$. Let $\ell(r)$ be the length of $\Gamma$ in the disc $|z| < r$. + +Can such a path $\Gamma$ always be found with $\ell(r) \ll r$? + +Disproved: Gol'dberg and Eremenko showed that for any $\varphi(r) \to \infty$ there is an +entire function $f$ with $\log M(r) \ll \varphi(r)(\log r)^2$ such that there is no path +$\Gamma$ on which $f(z) \to \infty$ and $\ell(r) \ll r$. They also construct such functions +of any prescribed finite order in $[0, \infty)$. + +Formally: there exists an entire function of finite order such that for every +arc-length parameterized path to infinity on which $f \to \infty$, $\ell(r)$ is not $O(r)$. +-/ +@[category research solved, AMS 30] +theorem erdos_1115 : answer(False) ↔ + ∀ f : ℂ → ℂ, IsEntire f → HasFiniteOrder f → + ∃ γ : ArcLengthPath, TendsToInfinityAlong f γ ∧ + ∃ (C R : ℝ), ∀ r : ℝ, R ≤ r → pathLengthInDisk γ r ≤ C * r := by + sorry + +end Erdos1115 diff --git a/FormalConjectures/ErdosProblems/1116.lean b/FormalConjectures/ErdosProblems/1116.lean new file mode 100644 index 0000000000..3d88e5c7f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1116.lean @@ -0,0 +1,68 @@ +/- +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 1116 + +*Reference:* [erdosproblems.com/1116](https://www.erdosproblems.com/1116) + +For a meromorphic function $f$, let $n(r,a)$ count the number of roots of $f(z) = a$ +in the disc $|z| < r$. Does there exist a meromorphic (or entire) $f$ such that +for every $a \neq b$, $\limsup_{r\to\infty} n(r,a)/n(r,b) = \infty$? +This is Problem 1.25 in [Ha74], attributed to Erdős. +Solved affirmatively by Gol'dberg [Go78] and Toppila [To76]. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ (1974), 155–180. + +[Go78] Gol'dberg, A. A., _Counting functions of sequences of a-points for entire functions_. +Sibirsk. Mat. Zh. (1978), 28–36. + +[To76] Toppila, S., _On the counting function for the a-values of a meromorphic function_. +Ann. Acad. Sci. Fenn. Ser. A I Math. (1976), 565–572. +-/ + +open Complex Set + +namespace Erdos1116 + +/-- The counting function $n(r, a, f)$: the number of solutions to $f(z) = a$ +in the open disk $\{z \in \mathbb{C} \mid \|z\| < r\}$. Uses `Set.ncard` (natural cardinality). -/ +noncomputable def rootCount (f : ℂ → ℂ) (r : ℝ) (a : ℂ) : ℕ := + Set.ncard {z : ℂ | f z = a ∧ ‖z‖ < r} + +/-- +Erdős Problem 1116 (Solved by Gol'dberg [Go78] and Toppila [To76]): + +For a meromorphic function $f$, let $n(r,a)$ count the number of roots of $f(z) = a$ +in the disc $|z| < r$. Does there exist a meromorphic (or entire) $f$ such that +for every $a \neq b$, $\limsup_{r\to\infty} n(r,a)/n(r,b) = \infty$? + +Gol'dberg and Toppila independently constructed entire functions with this property. + +The $\limsup = \infty$ condition is expressed multiplicatively: for every $M$ and $R$, +there exists $r > R$ with $n(r,a) > M \cdot n(r,b)$. +-/ +@[category research solved, AMS 30] +theorem erdos_1116 : answer(True) ↔ + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ + ∀ a b : ℂ, a ≠ b → + ∀ (M : ℝ) (R : ℝ), ∃ r : ℝ, r > R ∧ + M * (rootCount f r b : ℝ) < (rootCount f r a : ℝ) := by + sorry + +end Erdos1116 diff --git a/FormalConjectures/ErdosProblems/1117.lean b/FormalConjectures/ErdosProblems/1117.lean new file mode 100644 index 0000000000..62dfb08f19 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1117.lean @@ -0,0 +1,90 @@ +/- +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 1117 + +*Reference:* [erdosproblems.com/1117](https://www.erdosproblems.com/1117) + +For an entire function $f$ which is not a monomial, let $\nu(r)$ count the number of points +on the circle $|z| = r$ where $|f(z)|$ attains its maximum. Is it possible that +$\liminf_{r \to \infty} \nu(r) = \infty$? + +This is Problem 2.16 from [Ha74]. + +[Ha74] Hayman, W. K., *Research problems in function theory: new problems* (1974), 155–180. + +[HePi68] Herzog, F. and Piranian, G., *The counting function for points of maximum modulus* +(1968), 240–243. + +[GlPa24] Glücksam, A. and Pardo-Simón, L., *An approximate solution to Erdős' maximum modulus +points problem*. J. Math. Anal. Appl. (2024), Paper No. 127768, 20. +-/ + +open Complex Set + +namespace Erdos1117 + +/-- A function $f : \mathbb{C} \to \mathbb{C}$ is a monomial if $f(z) = c \cdot z^n$ for some +constant $c$ and natural number $n$. -/ +def IsMonomial (f : ℂ → ℂ) : Prop := + ∃ (c : ℂ) (n : ℕ), ∀ z, f z = c * z ^ n + +/-- The maximum modulus of $f$ on the circle of radius $r$: +$M(r) = \sup\{\|f(z)\| : \|z\| = r\}$. -/ +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} + +/-- $\nu(r)$ counts the number of $z$ with $\|z\| = r$ achieving the maximum modulus +of $f$. This is finite when $f$ is entire and not a monomial. -/ +noncomputable def nu (f : ℂ → ℂ) (r : ℝ) : ℕ := + Set.ncard {z : ℂ | ‖z‖ = r ∧ ‖f z‖ = maxModulus f r} + +/-- +Erdős Problem 1117 [Ha74] + +Let $f(z)$ be an entire function which is not a monomial. Let $\nu(r)$ count the +number of $z$ with $|z| = r$ such that $|f(z)| = \max_{|z|=r} |f(z)|$. +(This is a finite quantity if $f$ is not a monomial.) + +Is it possible for $\liminf_{r \to \infty} \nu(r) = \infty$? + +The analogous question for $\limsup$ was answered affirmatively by Herzog and +Piranian [HePi68]. The $\liminf$ question remains open. An 'approximate' +affirmative answer is given by Glücksam and Pardo-Simón [GlPa24]. +-/ +@[category research open, AMS 30] +theorem erdos_1117 : answer(sorry) ↔ + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ ¬IsMonomial f ∧ + ∀ N : ℕ, ∃ R : ℝ, ∀ r : ℝ, R ≤ r → N ≤ nu f r := by + sorry + +/-- +Erdős Problem 1117 — Limsup variant [HePi68] + +The analogous question for $\limsup$: does there exist an entire non-monomial function $f$ +such that $\limsup_{r \to \infty} \nu(r) = \infty$? This was answered affirmatively by +Herzog and Piranian [HePi68]. +-/ +@[category research solved, AMS 30] +theorem erdos_1117_limsup : + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ ¬IsMonomial f ∧ + ∀ N : ℕ, ∃ r : ℝ, N ≤ nu f r := by + sorry + +end Erdos1117 diff --git a/FormalConjectures/ErdosProblems/1118.lean b/FormalConjectures/ErdosProblems/1118.lean new file mode 100644 index 0000000000..af585eb918 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1118.lean @@ -0,0 +1,87 @@ +/- +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 1118 + +*Reference:* [erdosproblems.com/1118](https://www.erdosproblems.com/1118) + +This is Problem 2.40 in [Ha74]. + +Let $f(z)$ be a non-constant entire function and let $E(c) = \{z : |f(z)| > c\}$. If $E(c)$ has +finite measure for some $c > 0$, what is the minimum growth rate of $f$? Moreover, must there +exist $c' < c$ such that $E(c')$ also has finite measure? + +[Ha74] Hayman, W. K., *Research problems in function theory: new problems* (1974), 155–180. + +[Ca77] Camera, G., *On the minimum rate of growth of certain classes on integral and subharmonic +functions*, PhD Thesis, Imperial College, University of London (1977). + +[Go79b] Gol'dberg, A. A., *Sets on which the modulus of an entire function has a lower bound*, +Sibirsk. Mat. Zh. (1979), 512–518, 691. +-/ + +open Complex Set MeasureTheory + +namespace Erdos1118 + +/-- The maximum modulus of $f$ on the circle of radius $r$: +$M(r) = \sup\{\|f(z)\| : \|z\| = r\}$. -/ +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} + +/-- The exceedance set $E(c) = \{z \in \mathbb{C} \mid \|f(z)\| > c\}$. -/ +def exceedanceSet (f : ℂ → ℂ) (c : ℝ) : Set ℂ := + {z : ℂ | c < ‖f z‖} + +/-- +Erdős Problem 1118 — Hayman's conjecture, proved by Camera [Ca77] +and Gol'dberg [Go79b]: + +Let $f(z)$ be a non-constant entire function such that for some $c > 0$, the set +$E(c) = \{z : |f(z)| > c\}$ has finite (Lebesgue) measure. Then +$$\int_0^\infty \frac{r}{\log \log M(r)} \, dr < \infty$$ +where $M(r) = \max_{|z|=r} |f(z)|$. This growth condition is best possible. +-/ +@[category research solved, AMS 28 30] +theorem erdos_1118 (f : ℂ → ℂ) (hf : Differentiable ℂ f) + (hnc : ∃ z : ℂ, f z ≠ f 0) + (c : ℝ) (hc : 0 < c) + (hfin : volume (exceedanceSet f c) < ⊤) : + IntegrableOn (fun r => r / Real.log (Real.log (maxModulus f r))) + (Ioi 0) volume := by + sorry + +/-- +Erdős Problem 1118 — Negative answer to the second question, due to Gol'dberg [Go79b]: + +There exists a non-constant entire function $f$ and $c > 0$ such that $E(c)$ has finite +measure, but $E(c')$ has infinite measure for all $0 < c' < c$. + +Gol'dberg proved that $T = \{c > 0 : |E(c)| < \infty\}$ can equal $[m, \infty)$ or +$(m, \infty)$ for any $m > 0$. +-/ +@[category research solved, AMS 28 30] +theorem erdos_1118.variants.negative_answer : + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ (∃ z : ℂ, f z ≠ f 0) ∧ + ∃ c : ℝ, 0 < c ∧ + volume (exceedanceSet f c) < ⊤ ∧ + ∀ c' : ℝ, 0 < c' → c' < c → volume (exceedanceSet f c') = ⊤ := by + sorry + +end Erdos1118 diff --git a/FormalConjectures/ErdosProblems/1119.lean b/FormalConjectures/ErdosProblems/1119.lean new file mode 100644 index 0000000000..1c945da1a3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1119.lean @@ -0,0 +1,69 @@ +/- +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 1119 + +*Reference:* [erdosproblems.com/1119](https://www.erdosproblems.com/1119) + +Let $\mathfrak{m}$ be an infinite cardinal with +$\aleph_0 < \mathfrak{m} < \mathfrak{c}$. If a family of entire functions takes at most +$\mathfrak{m}$ distinct values at every point of $\mathbb{C}$, must the family contain at most +$\mathfrak{m}$ distinct functions? This generalizes Wetzel's problem and is independent of ZFC. + +[Er64g] Erdős, P., *An interpolation problem associated with the continuum hypothesis*, +Michigan Math. J. 11 (1964), 9–10. + +[Ha74] Hayman, W. K., *Research problems in function theory: new problems*, 1974, 155–180. + +[KuSh17] Kumar, A. and Shelah, S., *On a question about families of entire functions*, +Fund. Math. 239 (2017), 279–288. + +[ScWe24] Schilhan, J. and Weinert, T., *Wetzel families and the continuum*, +J. London Math. Soc. (2) (2024), e12918. +-/ + +open Cardinal Classical Set + +namespace Erdos1119 + +/-- +Erdős Problem 1119 (Independent of ZFC) [Ha74]: + +Let $\mathfrak{m}$ be an infinite cardinal with +$\aleph_0 < \mathfrak{m} < \mathfrak{c} = 2^{\aleph_0}$. Let $\{f_\alpha\}$ be a family of +entire functions such that, for every $z_0 \in \mathbb{C}$, the set $\{f_\alpha(z_0)\}$ of +values has at most $\mathfrak{m}$ distinct elements. Must the family of distinct functions +have cardinality at most $\mathfrak{m}$? + +This generalizes Wetzel's problem. Erdős [Er64g] proved that for the countable case +($\aleph_0$ values), the answer is yes if $\mathfrak{c} > \aleph_1$ and no if +$\mathfrak{c} = \aleph_1$. +Kumar–Shelah [KuSh17] showed the answer can be yes (with $\mathfrak{m} = \aleph_1$, +$\mathfrak{c} = \aleph_2$), while Schilhan–Weinert [ScWe24] showed it can be no. +-/ +@[category research solved, AMS 3 30] +theorem erdos_1119 : answer(sorry) ↔ + ∀ (𝔪 : Cardinal), ℵ₀ < 𝔪 → 𝔪 < Cardinal.continuum → + ∀ (ι : Type) (f : ι → ℂ → ℂ), + (∀ i, Differentiable ℂ (f i)) → + (∀ z : ℂ, Cardinal.mk ↥(range (fun i => f i z)) ≤ 𝔪) → + Cardinal.mk ↥(range f) ≤ 𝔪 := by + sorry + +end Erdos1119 diff --git a/FormalConjectures/ErdosProblems/112.lean b/FormalConjectures/ErdosProblems/112.lean new file mode 100644 index 0000000000..4d20040e41 --- /dev/null +++ b/FormalConjectures/ErdosProblems/112.lean @@ -0,0 +1,154 @@ +/- +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 112 + +*Reference:* [erdosproblems.com/112](https://www.erdosproblems.com/112) + +A problem of Erdős and Rado on directed Ramsey numbers $k(n,m)$: the minimal $k$ such that +any directed graph on $k$ vertices must contain either an independent set of size $n$ or a +transitive tournament of size $m$. Determine $k(n,m)$. + +[ErRa67] Erdős, P. and Rado, R., _Partition relations and transitivity domains of binary +relations_, J. London Math. Soc. (1967), 624–633. + +[LaMi97] Larson, J. and Mitchell, W., _On a problem of Erdős and Rado_, Ann. Comb. (1997), +245–252. +-/ + +namespace Erdos112 + +/-- An oriented graph on vertex type $V$: an irreflexive, antisymmetric binary relation +representing directed edges ($\mathrm{adj}(u, v)$ means there is a directed edge from $u$ to $v$). +Each pair of distinct vertices has at most one directed edge between them. -/ +structure Digraph (V : Type*) where + adj : V → V → Prop + loopless : ∀ v, ¬ adj v v + antisymm : ∀ u v, adj u v → ¬ adj v u + +/-- An independent set in a directed graph: a set $S$ of vertices with no directed +edges between any two of its members (in either direction). -/ +def Digraph.IsIndepSet {V : Type*} (G : Digraph V) (S : Finset V) : Prop := + ∀ u ∈ S, ∀ v ∈ S, ¬ G.adj u v + +/-- A transitive tournament on vertex set $S$ in directed graph $G$: there is a bijection +$f : \mathrm{Fin}(|S|) \to S$ such that $G.\mathrm{adj}(f(i), f(j))$ holds +if and only if $i < j$. This encodes a total ordering of $S$ compatible with the +edge relation. -/ +def Digraph.IsTransTournament {V : Type*} (G : Digraph V) (S : Finset V) : Prop := + ∃ f : Fin S.card → {x : V // x ∈ S}, Function.Bijective f ∧ + ∀ i j : Fin S.card, G.adj (f i : V) (f j : V) ↔ i < j + +/-- The directed Ramsey number $k(n,m)$: the minimal $k$ such that every directed graph +on $k$ vertices contains either an independent set of size $n$ or a transitive +tournament of size $m$. -/ +noncomputable def dirRamseyNum (n m : ℕ) : ℕ := + sInf {k : ℕ | ∀ (V : Type) [Fintype V], Fintype.card V = k → + ∀ G : Digraph V, + (∃ S : Finset V, S.card = n ∧ G.IsIndepSet S) ∨ + (∃ S : Finset V, S.card = m ∧ G.IsTransTournament S)} + +/-- +Erdős Problem 112: Determine the directed Ramsey number $k(n,m)$. +The exact value is still open. +-/ +@[category research open, AMS 5] +theorem erdos_112 : + ∀ n m : ℕ, 2 ≤ n → 2 ≤ m → + dirRamseyNum n m = answer(sorry) := by + sorry + +/-- +Erdős–Rado upper bound [ErRa67]: +$$k(n,m) \leq \frac{2^{m-1} (n-1)^m + n - 2}{2n - 3}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_112.variants.erdos_rado_upper_bound : + ∀ n m : ℕ, 2 ≤ n → 2 ≤ m → + dirRamseyNum n m ≤ (2 ^ (m - 1) * (n - 1) ^ m + n - 2) / (2 * n - 3) := by + sorry + +/-- +Larson–Mitchell bound [LaMi97]: $k(n, 3) \leq n^2$. +-/ +@[category research solved, AMS 5] +theorem erdos_112.variants.larson_mitchell : + ∀ n : ℕ, 2 ≤ n → + dirRamseyNum n 3 ≤ n ^ 2 := by + sorry + +/-- The classical 2-color graph Ramsey number $R(n, m)$: the minimal $k$ such that every +2-coloring of the edges of $K_k$ contains either a red clique of size $n$ or a blue clique +of size $m$. -/ +noncomputable def graphRamseyNum (n m : ℕ) : ℕ := + sInf {k : ℕ | ∀ (c : Fin k → Fin k → Bool), + (∃ S : Finset (Fin k), S.card = n ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → c u v = true) ∨ + (∃ S : Finset (Fin k), S.card = m ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → c u v = false)} + +/-- The 3-color graph Ramsey number $R(a, b, c)$: the minimal $k$ such that every +3-coloring of the edges of $K_k$ contains a monochromatic clique of size $a$, $b$, or $c$ +in the respective color. -/ +noncomputable def graphRamseyNum3 (a b c : ℕ) : ℕ := + sInf {k : ℕ | ∀ (col : Fin k → Fin k → Fin 3), + (∃ S : Finset (Fin k), S.card = a ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col u v = 0) ∨ + (∃ S : Finset (Fin k), S.card = b ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col u v = 1) ∨ + (∃ S : Finset (Fin k), S.card = c ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col u v = 2)} + +/-- +Ramsey number sandwich (Hunter): $R(n,m) \leq k(n,m) \leq R(n,m,m)$, where $R$ is the +classical graph Ramsey number and $R(n,m,m)$ is the 3-color Ramsey number. The lower bound +holds because any undirected graph can be oriented, and the upper bound holds because the +three options for each pair of vertices (no edge, forward edge, backward edge) correspond +to a 3-coloring. +-/ +@[category research solved, AMS 5] +theorem erdos_112.variants.ramsey_sandwich : + ∀ n m : ℕ, 2 ≤ n → 2 ≤ m → + graphRamseyNum n m ≤ dirRamseyNum n m ∧ + dirRamseyNum n m ≤ graphRamseyNum3 n m m := by + sorry + +/-- A directed path on vertex set $S$ in directed graph $G$: there is a bijection +$f : \mathrm{Fin}(|S|) \to S$ such that $G.\mathrm{adj}(f(i), f(i+1))$ holds for all +consecutive indices. Unlike a transitive tournament, only consecutive vertices need to +be connected. -/ +def Digraph.IsDirectedPath {V : Type*} (G : Digraph V) (S : Finset V) : Prop := + ∃ f : Fin S.card → {x : V // x ∈ S}, Function.Bijective f ∧ + ∀ i : Fin S.card, ∀ h : (i : ℕ) + 1 < S.card, + G.adj (f i : V) (f ⟨i + 1, h⟩ : V) + +/-- The directed path Ramsey number: the minimal $k$ such that every directed graph on $k$ +vertices contains either an independent set of size $n$ or a directed path of size $m$. -/ +noncomputable def dirPathRamseyNum (n m : ℕ) : ℕ := + sInf {k : ℕ | ∀ (V : Type) [Fintype V], Fintype.card V = k → + ∀ G : Digraph V, + (∃ S : Finset V, S.card = n ∧ G.IsIndepSet S) ∨ + (∃ S : Finset V, S.card = m ∧ G.IsDirectedPath S)} + +/-- +Hunter–Steiner result: replacing "transitive tournament" with "directed path" in the +definition of $k(n,m)$ yields the exact answer $k(n,m) = (n-1)(m-1) + 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_112.variants.hunter_steiner : + ∀ n m : ℕ, 2 ≤ n → 2 ≤ m → + dirPathRamseyNum n m = (n - 1) * (m - 1) + 1 := by + sorry + +end Erdos112 diff --git a/FormalConjectures/ErdosProblems/1120.lean b/FormalConjectures/ErdosProblems/1120.lean new file mode 100644 index 0000000000..3b6aa281cc --- /dev/null +++ b/FormalConjectures/ErdosProblems/1120.lean @@ -0,0 +1,69 @@ +/- +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 1120 + +For a monic polynomial of degree $n$ with all roots in the unit disk, consider the lemniscate set +$E = \{z : |f(z)| \leq 1\}$. Erdős conjectured that the worst-case shortest path length in $E$ +from the origin to the unit circle tends to infinity with $n$. + +See also Erdős Problem 1041 (paths connecting roots within lemniscate sets). + +*Reference:* [erdosproblems.com/1120](https://www.erdosproblems.com/1120) + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ (1974), 155–180. +-/ + +open Complex Polynomial Set + +namespace Erdos1120 + +/-- The lemniscate (sublevel) set of a polynomial $f$: $\{z \in \mathbb{C} : \|f(z)\| \leq 1\}$. -/ +noncomputable def lemniscateSet (f : Polynomial ℂ) : Set ℂ := + {z : ℂ | ‖f.eval z‖ ≤ 1} + +/-- +Erdős Problem 1120 [Ha74, Problem 4.22]: + +Let $f \in \mathbb{C}[z]$ be a monic polynomial of degree $n$, all of whose roots satisfy +$|z| \leq 1$. Let $E = \{z : |f(z)| \leq 1\}$. The worst-case shortest length of a path in $E$ +joining $z = 0$ to $|z| = 1$ tends to infinity with $n$. + +Erdős wrote "presumably this tends to infinity with $n$, but not too fast." +The trivial lower bound is $1$ (achieved by $f(z) = z^n$). Clunie and Netanyahu +showed that a path always exists joining $z = 0$ to $|z| = 1$ in $E$. + +Formally: for every $C > 0$, there exists $N$ such that for all $n \geq N$, there exists a +monic polynomial $f$ of degree $n$ with all roots in the closed unit disk, such that +every continuous path $\gamma : [0,1] \to E$ from $0$ to the unit circle has arc length $\geq C$. +-/ +@[category research open, AMS 30] +theorem erdos_1120 : + ∀ C : ℝ, C > 0 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ f : Polynomial ℂ, f.Monic ∧ f.natDegree = n ∧ + (∀ z ∈ f.roots, ‖z‖ ≤ 1) ∧ + ∀ γ : ℝ → ℂ, Continuous γ → + (∀ t ∈ Icc (0 : ℝ) 1, γ t ∈ lemniscateSet f) → + γ 0 = 0 → + ‖γ 1‖ = 1 → + ENNReal.ofReal C ≤ eVariationOn γ (Icc (0 : ℝ) 1) := by + sorry + +end Erdos1120 diff --git a/FormalConjectures/ErdosProblems/1121.lean b/FormalConjectures/ErdosProblems/1121.lean new file mode 100644 index 0000000000..50cb8f1c8a --- /dev/null +++ b/FormalConjectures/ErdosProblems/1121.lean @@ -0,0 +1,88 @@ +/- +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 1121 + +If circles in the plane with radii $r_1, \ldots, r_n$ cannot be separated into two non-empty +groups by a line disjoint from all of them, then they can be covered by a single circle of radius +$r = \sum r_i$. + +*Reference:* [erdosproblems.com/1121](https://www.erdosproblems.com/1121) + +[GoGo45] Goodman, A. W. and Goodman, R. E., *A circle covering theorem*, +American Mathematical Monthly 52 (1945), 494-498. +-/ + +open scoped BigOperators + +namespace Erdos1121 + +/-- +Erdős Problem #1121 (proved by Goodman and Goodman [GoGo45]): + +If $C_1, \ldots, C_n$ are circles in $\mathbb{R}^2$ with radii $r_1, \ldots, r_n$ such that no +line disjoint from all the circles divides them into two non-empty sets, then the circles can be +covered by a circle of radius $r = \sum r_i$. + +A line in $\mathbb{R}^2$ is parameterized by a unit normal vector $v$ and offset $d$, defining +$\ell = \{x : \langle x, v \rangle = d\}$. The closed disk $\bar{B}(c_i, r_i)$ is disjoint from +$\ell$ when $|\langle c_i, v \rangle - d| > r_i$. The non-separability condition says that whenever +all disks are disjoint from a line, they all lie on the same side. +-/ +@[category research solved, AMS 52] +theorem erdos_1121 + (n : ℕ) + (center : Fin n → EuclideanSpace ℝ (Fin 2)) + (radius : Fin n → ℝ) + (hr : ∀ i, 0 < radius i) + (hns : ∀ (v : EuclideanSpace ℝ (Fin 2)) (d : ℝ), + ‖v‖ = 1 → + (∀ i, |@inner ℝ _ _ (center i) v - d| > radius i) → + (∀ i j, @inner ℝ _ _ (center i) v > d ↔ @inner ℝ _ _ (center j) v > d)) : + ∃ p : EuclideanSpace ℝ (Fin 2), + ∀ i, dist (center i) p + radius i ≤ ∑ j : Fin n, radius j := by + sorry + +/-- +Higher-dimensional generalization of Erdős Problem #1121: + +The Goodman–Goodman result generalizes to $\mathbb{R}^d$: if $n$ closed balls in $\mathbb{R}^d$ +with radii $r_1, \ldots, r_n$ cannot be separated into two non-empty groups by a hyperplane +disjoint from all of them, then they can be covered by a single ball of radius $\sum r_i$. + +A hyperplane in $\mathbb{R}^d$ is parameterized by a unit normal vector $v$ and offset $d$, +defining $H = \{x : \langle x, v \rangle = d\}$. The non-separability condition is the same as +in the planar case. +-/ +@[category research solved, AMS 52] +theorem erdos_1121_generalized + (d : ℕ) + (n : ℕ) + (center : Fin n → EuclideanSpace ℝ (Fin d)) + (radius : Fin n → ℝ) + (hr : ∀ i, 0 < radius i) + (hns : ∀ (v : EuclideanSpace ℝ (Fin d)) (δ : ℝ), + ‖v‖ = 1 → + (∀ i, |@inner ℝ _ _ (center i) v - δ| > radius i) → + (∀ i j, @inner ℝ _ _ (center i) v > δ ↔ @inner ℝ _ _ (center j) v > δ)) : + ∃ p : EuclideanSpace ℝ (Fin d), + ∀ i, dist (center i) p + radius i ≤ ∑ j : Fin n, radius j := by + sorry + +end Erdos1121 diff --git a/FormalConjectures/ErdosProblems/1122.lean b/FormalConjectures/ErdosProblems/1122.lean new file mode 100644 index 0000000000..9496b55a60 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1122.lean @@ -0,0 +1,59 @@ +/- +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 + +/-! +# Erdős Problem 1122 + +If $f : \mathbb{N} \to \mathbb{R}$ is an additive function such that the set +$\{n : f(n+1) < f(n)\}$ has natural density zero, then $f(n) = c \cdot \log(n)$ +for some constant $c$. + +*Reference:* [erdosproblems.com/1122](https://www.erdosproblems.com/1122) + +See also Erdős Problem 491 for the stronger hypothesis $|f(n+1) - f(n)| < c$. + +[Er46] Erdős, P., _On the distribution function of additive functions_, Ann. of Math. (2) 47 +(1946), 1-20. + +[Ma22] Mangerel, A. P., _Additive functions in short intervals, gaps and a conjecture of Erdős_. +Ramanujan J. (2022), 1023-1090. +-/ + +namespace Erdos1122 + +/-- +Let $f : \mathbb{N} \to \mathbb{R}$ be an additive function (i.e., $f(ab) = f(a) + f(b)$ whenever +$\gcd(a,b) = 1$). Let $A = \{n \geq 1 : f(n+1) < f(n)\}$. +If $|A \cap [1,X]| = o(X)$ (the set $A$ has natural density zero), then +$f(n) = c \cdot \log(n)$ for some $c \in \mathbb{R}$. + +Erdős proved that $f(n) = c \cdot \log(n)$ if $A$ is empty, or if $f(n+1) - f(n) = o(1)$ [Er46]. +Partial progress was made by Mangerel [Ma22], who proved this under the stronger bound +$|A \cap [1,X]| \ll X / (\log X)^{2+c}$ for some $c > 0$, with restrictions on the values of +$g(p)$. +-/ +@[category research open, AMS 11] +theorem erdos_1122 + (f : ℕ → ℝ) + (hf_add : ∀ a b : ℕ, Nat.Coprime a b → f (a * b) = f a + f b) + (hA : Set.HasDensity {n : ℕ | f (n + 1) < f n} 0) : + ∃ c : ℝ, ∀ n : ℕ, 1 ≤ n → f n = c * Real.log (n : ℝ) := by + sorry + +end Erdos1122 diff --git a/FormalConjectures/ErdosProblems/1123.lean b/FormalConjectures/ErdosProblems/1123.lean new file mode 100644 index 0000000000..8b66a3f933 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1123.lean @@ -0,0 +1,108 @@ +/- +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 + +/-! +# Erdős Problem 1123 + +*Reference:* [erdosproblems.com/1123](https://www.erdosproblems.com/1123) + +A problem of Erdős and Ulam. Let $B_1$ be the Boolean algebra of sets of integers modulo sets +of density $0$ and let $B_2$ be the Boolean algebra of sets modulo sets of logarithmic +density $0$. Are $B_1$ and $B_2$ isomorphic? Erdős offered $100 for a proof or disproof. + +This is independent of ZFC: Just and Krawczyk [JuKr84] proved under the continuum hypothesis +that $B_1 \cong B_2$, while Farah [Fa00] proved under OCA + MA that $B_1 \not\cong B_2$. + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[VMR80] van Douwen, E., Monk, J. and Rubin, M., _Some questions about Boolean algebras_. +Algebra Universalis **10** (1980), 220-243. + +[JuKr84] Just, W. and Krawczyk, A., _On certain Boolean algebras $\mathcal{P}(\omega)/I$_. +Trans. Amer. Math. Soc. **285** (1984), 411-429. + +[ARS85] Abraham, U., Rubin, M. and Shelah, S., _On the consistency of some partition theorems +for continuous colorings, and the structure of $\aleph_1$-dense real order types_. +Ann. Pure Appl. Logic (1985), 123-206. + +[Fa00] Farah, I., _Analytic quotients: theory of liftings for quotients over analytic ideals +on the integers_. Mem. Amer. Math. Soc. (2000), xvi+177. +-/ + +open Filter Classical + +namespace Erdos1123 + +/-- Two sets of naturals are equivalent mod natural-density-$0$ sets +iff their symmetric difference has natural density zero. -/ +def NatDensityEquiv (A B : Set ℕ) : Prop := + Set.HasDensity (symmDiff A B) 0 + +/-- Two sets of naturals are equivalent mod log-density-$0$ sets +iff their symmetric difference has logarithmic density zero. -/ +def LogDensityEquiv (A B : Set ℕ) : Prop := + Set.HasLogDensity (symmDiff A B) 0 + +/-- Natural density equivalence is an equivalence relation. -/ +axiom natDensityEquiv_equivalence : Equivalence NatDensityEquiv + +/-- Logarithmic density equivalence is an equivalence relation. -/ +axiom logDensityEquiv_equivalence : Equivalence LogDensityEquiv + +/-- The equivalence relation on $\operatorname{Set} \mathbb{N}$ given by natural density zero. -/ +def natDensitySetoid : Setoid (Set ℕ) where + r := NatDensityEquiv + iseqv := natDensityEquiv_equivalence + +/-- The equivalence relation on $\operatorname{Set} \mathbb{N}$ given by logarithmic density zero. -/ +def logDensitySetoid : Setoid (Set ℕ) where + r := LogDensityEquiv + iseqv := logDensityEquiv_equivalence + +/-- $B_1$: the Boolean algebra of sets of integers modulo sets of natural density $0$. -/ +def BoolAlgModNatDensity : Type := Quotient natDensitySetoid + +/-- $B_2$: the Boolean algebra of sets of integers modulo sets of logarithmic density $0$. -/ +def BoolAlgModLogDensity : Type := Quotient logDensitySetoid + +/-- The quotient of sets of integers by natural density zero sets forms a Boolean algebra. -/ +axiom instBooleanAlgebraBoolAlgModNatDensity : BooleanAlgebra BoolAlgModNatDensity + +/-- The quotient of sets of integers by logarithmic density zero sets forms a Boolean algebra. -/ +axiom instBooleanAlgebraBoolAlgModLogDensity : BooleanAlgebra BoolAlgModLogDensity + +noncomputable instance : BooleanAlgebra BoolAlgModNatDensity := + instBooleanAlgebraBoolAlgModNatDensity +noncomputable instance : BooleanAlgebra BoolAlgModLogDensity := + instBooleanAlgebraBoolAlgModLogDensity + +/-- +A problem of Erdős and Ulam. Let $B_1$ be the Boolean algebra of sets of integers modulo sets +of density $0$ and let $B_2$ be the Boolean algebra of sets modulo sets of logarithmic +density $0$. Is $B_1$ isomorphic to $B_2$? + +This is independent of ZFC. Just and Krawczyk [JuKr84] proved under the continuum hypothesis +that $B_1 \cong B_2$. Farah [Fa00] proved under OCA + MA that $B_1 \not\cong B_2$. +-/ +@[category research open, AMS 06 11] +theorem erdos_1123 : + answer(sorry) ↔ Nonempty (BoolAlgModNatDensity ≃o BoolAlgModLogDensity) := by + sorry + +end Erdos1123 diff --git a/FormalConjectures/ErdosProblems/1124.lean b/FormalConjectures/ErdosProblems/1124.lean new file mode 100644 index 0000000000..b326c3eb21 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1124.lean @@ -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 +import FormalConjecturesForMathlib.Geometry.«2d» + +open scoped EuclideanGeometry + +/-! +# Erdős Problem 1124 + +Can a square and a circle of the same area be decomposed into a finite number of +congruent parts? (Tarski's circle-squaring problem.) + +*Reference:* [erdosproblems.com/1124](https://www.erdosproblems.com/1124) + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[La90b] Laczkovich, M., _Equidecomposability and discrepancy; a solution of Tarski's +circle-squaring problem_. J. Reine Angew. Math. **404** (1990), 77-117. +-/ + +namespace Erdos1124 + +/-- The unit square $[0,1]^2$ in $\mathbb{R}^2$. -/ +noncomputable def unitSquare : Set ℝ² := + {p | ∀ i, 0 ≤ p i ∧ p i ≤ 1} + +/-- +Erdős Problem 1124 (Tarski's circle-squaring problem, proved): + +Can a square and a circle of the same area be decomposed into a finite number +of congruent parts? + +A problem of Tarski [Er81b, p.30], which Erdős described as 'a very beautiful +problem...if it were my problem I would offer \$1000 for it'. + +Laczkovich [La90b] proved that this is possible using translations only. + +Formally: the unit square and the closed disk of radius $1/\sqrt{\pi}$ (both having area $1$) +can be partitioned into finitely many pieces such that corresponding pieces are +congruent (related by isometries of $\mathbb{R}^2$). +-/ +@[category research solved, AMS 28 51] +theorem erdos_1124 : answer(True) ↔ + ∃ (n : ℕ), + ∃ (pieces_sq pieces_disk : Fin n → Set ℝ²), + -- The pieces partition the unit square + (⋃ i, pieces_sq i) = unitSquare ∧ + (∀ i j, i ≠ j → Disjoint (pieces_sq i) (pieces_sq j)) ∧ + -- The pieces partition the closed disk of radius 1/√π (same area as unit square) + (⋃ i, pieces_disk i) = + Metric.closedBall (0 : ℝ²) (1 / Real.sqrt Real.pi) ∧ + (∀ i j, i ≠ j → Disjoint (pieces_disk i) (pieces_disk j)) ∧ + -- Corresponding pieces are congruent (related by an isometry) + (∀ i, ∃ f : ℝ² → ℝ², + Isometry f ∧ f '' (pieces_sq i) = pieces_disk i) := by + sorry + +/-- +Erdős Problem 1124, translations-only variant (Laczkovich's actual result): + +Laczkovich [La90b] proved the stronger result that the decomposition can be achieved +using translations alone, not just arbitrary isometries. This variant captures the +full strength of his theorem. + +Formally: the unit square and the closed disk of radius $1/\sqrt{\pi}$ can be partitioned +into finitely many pieces such that each piece of the square is mapped to the +corresponding piece of the disk by a translation. +-/ +@[category research solved, AMS 28 51] +theorem erdos_1124_translations : answer(True) ↔ + ∃ (n : ℕ), + ∃ (pieces_sq pieces_disk : Fin n → Set ℝ²), + -- The pieces partition the unit square + (⋃ i, pieces_sq i) = unitSquare ∧ + (∀ i j, i ≠ j → Disjoint (pieces_sq i) (pieces_sq j)) ∧ + -- The pieces partition the closed disk of radius 1/√π (same area as unit square) + (⋃ i, pieces_disk i) = + Metric.closedBall (0 : ℝ²) (1 / Real.sqrt Real.pi) ∧ + (∀ i j, i ≠ j → Disjoint (pieces_disk i) (pieces_disk j)) ∧ + -- Corresponding pieces are related by translations + (∀ i, ∃ v : ℝ², (· + v) '' (pieces_sq i) = pieces_disk i) := by + sorry + +end Erdos1124 diff --git a/FormalConjectures/ErdosProblems/1125.lean b/FormalConjectures/ErdosProblems/1125.lean new file mode 100644 index 0000000000..c41a1570d3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1125.lean @@ -0,0 +1,52 @@ +/- +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 1125 + +*Reference:* [erdosproblems.com/1125](https://www.erdosproblems.com/1125) + +If $f : \mathbb{R} \to \mathbb{R}$ satisfies $2f(x) \leq f(x+h) + f(x+2h)$ for every $x \in \mathbb{R}$ +and $h > 0$, must $f$ be monotonic? + +[Ke69] Kemperman, J.H.B., _On the regularity of generalized convex functions_. +Trans. Amer. Math. Soc. (1969), 69-93. + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[La84] Laczkovich, M., _On Kemperman's inequality 2f(x)≤f(x+h)+f(x+2h)_. +Colloq. Math. (1984), 109-115. +-/ + +namespace Erdos1125 + +/-- +Let $f : \mathbb{R} \to \mathbb{R}$ be such that $2f(x) \leq f(x+h) + f(x+2h)$ for every +$x \in \mathbb{R}$ and $h > 0$. Then $f$ must be monotonic. + +A problem of Kemperman [Ke69], who proved it is true if $f$ is measurable. +Laczkovich [La84] solved it in the affirmative. +-/ +@[category research solved, AMS 26] +theorem erdos_1125 : + ∀ f : ℝ → ℝ, + (∀ x : ℝ, ∀ h : ℝ, h > 0 → 2 * f x ≤ f (x + h) + f (x + 2 * h)) → + Monotone f ∨ Antitone f := by + sorry + +end Erdos1125 diff --git a/FormalConjectures/ErdosProblems/1126.lean b/FormalConjectures/ErdosProblems/1126.lean new file mode 100644 index 0000000000..2606465614 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1126.lean @@ -0,0 +1,54 @@ +/- +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 1126 + +If `f(x+y) = f(x) + f(y)` for almost all `x, y ∈ ℝ`, then there exists an additive function `g` +such that `f = g` almost everywhere. + +*Reference:* [erdosproblems.com/1126](https://www.erdosproblems.com/1126) + +[Er60c] Erdős, P. (c. 1960). Original problem source. + +[dB66] de Bruijn, N.G., _On almost additive functions_. Colloq. Math. (1966), 59-63. + +[Ju65] Jurkat, W.B., _On Cauchy's functional equation_. Proc. Amer. Math. Soc. 16 (1965), +683-686. +-/ + +open MeasureTheory + +namespace Erdos1126 + +/-- +Erdős Problem #1126 (proved independently by de Bruijn [dB66] and Jurkat [Ju65]): + +If $f(x+y) = f(x) + f(y)$ for almost all $x, y \in \mathbb{R}$ then there exists a function $g$ +such that $g(x+y) = g(x) + g(y)$ for all $x, y \in \mathbb{R}$ and $f(x) = g(x)$ for almost +all $x$. +-/ +@[category research solved, AMS 28 39] +theorem erdos_1126 (f : ℝ → ℝ) + (hf : ∀ᵐ p : ℝ × ℝ ∂(volume.prod volume), f (p.1 + p.2) = f p.1 + f p.2) : + ∃ g : ℝ → ℝ, + (∀ x y : ℝ, g (x + y) = g x + g y) ∧ + (∀ᵐ x ∂volume, f x = g x) := by + sorry + +end Erdos1126 diff --git a/FormalConjectures/ErdosProblems/1127.lean b/FormalConjectures/ErdosProblems/1127.lean new file mode 100644 index 0000000000..77adabcb04 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1127.lean @@ -0,0 +1,57 @@ +/- +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 1127 + +*Reference:* [erdosproblems.com/1127](https://www.erdosproblems.com/1127) + +[ErKa43] Erdős, P. and Kakutani, S., *On non-denumerable graphs*, Bull. Amer. Math. Soc. 49 +(1943), 457-461. + +[Da72] Davies, R. O., *Partitioning the plane into denumerably many sets without repeated +distances*, Proc. Cambridge Philos. Soc. 72 (1972), 179-183. + +[Ku87] Kunen, K., *Partitioning Euclidean space*, Math. Proc. Cambridge Philos. Soc. 102 (1987), +379-383. + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. +-/ + +namespace Erdos1127 + +/-- +Can $\mathbb{R}^n$ be decomposed into countably many sets, such that within each set all the +pairwise distances are distinct? + +This is a problem of Erdős [Er81b, p.31]. It is true assuming the continuum hypothesis +for $n = 1$ (Erdős-Kakutani [ErKa43]), for $n = 2$ (Davies [Da72]), and for all $n$ +(Kunen [Ku87]). The dependence on the continuum hypothesis is necessary by a result of +Erdős and Hajnal. +-/ +@[category research solved, AMS 3 5] +theorem erdos_1127 : answer(sorry) ↔ + ∀ n : ℕ, ∃ f : EuclideanSpace ℝ (Fin n) → ℕ, + ∀ a b c d : EuclideanSpace ℝ (Fin n), + f a = f b → f a = f c → f a = f d → + a ≠ b → c ≠ d → + dist a b = dist c d → + ({a, b} : Set (EuclideanSpace ℝ (Fin n))) = {c, d} := by + sorry + +end Erdos1127 diff --git a/FormalConjectures/ErdosProblems/1128.lean b/FormalConjectures/ErdosProblems/1128.lean new file mode 100644 index 0000000000..83871ec603 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1128.lean @@ -0,0 +1,53 @@ +/- +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 1128 + +Erdős and Hajnal asked whether any 2-colouring of the product of three sets of cardinality ℵ₁ +must contain a monochromatic countably infinite sub-product. This was disproved by Prikry and +Mills (1978). + +*Reference:* [erdosproblems.com/1128](https://www.erdosproblems.com/1128) + +[Er81b] Erdős, P., *Problems and results on finite and infinite combinatorial analysis*, p.33. +-/ + +open Cardinal + +namespace Erdos1128 + +/-- +A problem of Erdős and Hajnal [Er81b,p.33]. Let $A$, $B$, $C$ be three sets of cardinality +$\aleph_1$. Is it true that, in any $2$-colouring of $A \times B \times C$, there must exist +$A_1 \subset A$, $B_1 \subset B$, $C_1 \subset C$, all of cardinality $\aleph_0$, such that +$A_1 \times B_1 \times C_1$ is monochromatic? + +The answer is no. This was disproved by Prikry and Mills in 1978 +(unpublished), as reported by Todorčević and Komjáth. +-/ +@[category research solved, AMS 3 5] +theorem erdos_1128 : answer(False) ↔ + ∀ (α β γ : Type) (_ : #α = aleph 1) (_ : #β = aleph 1) (_ : #γ = aleph 1) + (f : α × β × γ → Fin 2), + ∃ (A₁ : Set α) (B₁ : Set β) (C₁ : Set γ), + #A₁ = aleph 0 ∧ #B₁ = aleph 0 ∧ #C₁ = aleph 0 ∧ + ∃ c : Fin 2, ∀ a ∈ A₁, ∀ b ∈ B₁, ∀ z ∈ C₁, f (a, b, z) = c := by + sorry + +end Erdos1128 diff --git a/FormalConjectures/ErdosProblems/1129.lean b/FormalConjectures/ErdosProblems/1129.lean new file mode 100644 index 0000000000..8cbb01619d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1129.lean @@ -0,0 +1,113 @@ +/- +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 1129 + +Erdős and Bernstein conjectured that the nodes minimising the Lebesgue constant for +Lagrange interpolation on $[-1,1]$ are unique and characterised by equioscillation of +the Lebesgue function. This was proved by Kilgore and de Boor–Pinkus. + +*Reference:* [erdosproblems.com/1129](https://www.erdosproblems.com/1129) + +[Ki77] Kilgore, T. A., *Optimization of the norm of the Lagrange interpolation operator*, +Bull. Amer. Math. Soc. **83** (1977), 1069-1071. + +[KiCh76] Kilgore, T. A. and Cheney, E. W., *A theorem on interpolation in Haar subspaces*, +Aequationes Math. (1976), 391-400. + +[dBPi78] de Boor, C. and Pinkus, A., *Proof of the conjectures of Bernstein and Erdős +concerning the optimal nodes for polynomial interpolation*, J. Approx. Theory (1978), +289-303. +-/ + +open Finset +open scoped BigOperators + +namespace Erdos1129 + +/-- The Lagrange basis polynomial $\ell_k(x)$ for nodes indexed by $\mathrm{Fin}\; n$. + $\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$ -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (k : Fin n) (x : ℝ) : ℝ := + ∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) + +/-- The Lebesgue function: $L(x) = \sum_k |\ell_k(x)|$ -/ +noncomputable def lebesgueFunction {n : ℕ} (nodes : Fin n → ℝ) (x : ℝ) : ℝ := + ∑ k, |lagrangeBasis nodes k x| + +/-- The Lebesgue constant: $\Lambda(\mathrm{nodes}) = \sup_{x \in [-1,1]} \sum_k |\ell_k(x)|$ -/ +noncomputable def lebesgueConstant {n : ℕ} (nodes : Fin n → ℝ) : ℝ := + sSup ((lebesgueFunction nodes) '' (Set.Icc (-1 : ℝ) 1)) + +/-- Nodes are valid: strictly increasing and in $[-1, 1]$. -/ +def ValidNodes {n : ℕ} (nodes : Fin n → ℝ) : Prop := + StrictMono nodes ∧ ∀ i, nodes i ∈ Set.Icc (-1 : ℝ) 1 + +/-- The boundary sequence for the equioscillation property: $-1$, then the $n$ nodes + in order, then $1$, giving $n + 2$ points partitioning $[-1, 1]$ into $n + 1$ + subintervals. -/ +noncomputable def boundary {n : ℕ} (nodes : Fin n → ℝ) : Fin (n + 2) → ℝ := + fun i => + if h₁ : i.val = 0 then -1 + else if h₂ : i.val ≤ n then nodes ⟨i.val - 1, by omega⟩ + else 1 + +/-- The local maximum of the Lebesgue function on the $i$-th subinterval + $[b_i, b_{i+1}]$ of the partition induced by the nodes. -/ +noncomputable def localMax {n : ℕ} (nodes : Fin n → ℝ) (i : Fin (n + 1)) : ℝ := + sSup ((lebesgueFunction nodes) '' + (Set.Icc (boundary nodes ⟨i.val, by omega⟩) + (boundary nodes ⟨i.val + 1, by omega⟩))) + +/-- The equioscillation property: the local maximum of the Lebesgue function is the + same on each of the $n + 1$ subintervals $[b_i, b_{i+1}]$. -/ +def HasEquioscillation {n : ℕ} (nodes : Fin n → ℝ) : Prop := + ∀ i j : Fin (n + 1), localMax nodes i = localMax nodes j + +/-- +Erdős Problem 1129 (Proved by Kilgore [Ki77] and de Boor–Pinkus [dBPi78]): + +For $x_1, \ldots, x_n \in [-1,1]$, let +$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$ +be the Lagrange basis polynomials and +$\Lambda = \max_{x \in [-1,1]} \sum_k |\ell_k(x)|$ the Lebesgue constant. +Erdős and Bernstein conjectured that the minimising nodes are unique +and characterised by the equioscillation property: if +$-1 = x_0 < x_1 < \cdots < x_n < x_{n+1} = 1$ then +$\max_{x \in [x_i, x_{i+1}]} \sum_k |\ell_k(x)|$ is the same for all $0 \leq i \leq n$. + +Kilgore proved $\Lambda$ is minimised if and only if equioscillation holds. +De Boor and Pinkus proved the minimising configuration is unique. +-/ +@[category research solved, AMS 41] +theorem erdos_1129 (n : ℕ) (hn : 2 ≤ n) : + ∃ opt : Fin n → ℝ, ValidNodes opt ∧ + -- opt achieves the minimum Lebesgue constant + (∀ nodes : Fin n → ℝ, ValidNodes nodes → + lebesgueConstant opt ≤ lebesgueConstant nodes) ∧ + -- the minimiser is unique (among strictly increasing configurations) + (∀ nodes : Fin n → ℝ, ValidNodes nodes → + lebesgueConstant nodes = lebesgueConstant opt → nodes = opt) ∧ + -- the minimiser satisfies the equioscillation property + HasEquioscillation opt ∧ + -- converse: equioscillation characterises the minimiser (Kilgore) + (∀ nodes : Fin n → ℝ, ValidNodes nodes → HasEquioscillation nodes → + lebesgueConstant nodes = lebesgueConstant opt) := by + sorry + +end Erdos1129 diff --git a/FormalConjectures/ErdosProblems/113.lean b/FormalConjectures/ErdosProblems/113.lean new file mode 100644 index 0000000000..5011238881 --- /dev/null +++ b/FormalConjectures/ErdosProblems/113.lean @@ -0,0 +1,86 @@ +/- +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 113 + +*Reference:* [erdosproblems.com/113](https://www.erdosproblems.com/113) + +Erdős–Simonovits conjecture (disproved by Janzer): is it true that for a bipartite graph $G$, +the Turán number satisfies $\mathrm{ex}(n; G) \ll n^{3/2}$ if and only if $G$ is 2-degenerate? + +[ErSi84] Erdős, P. and Simonovits, M., *Cube-supersaturated graphs and related problems*, +Progress in graph theory (Waterloo, Ont., 1982), Academic Press, Toronto, ON, 1984, 203–218. + +[Er93] Erdős, P., *Some of my favorite solved and unsolved problems in graph theory*. +Quaestiones Mathematicae **16** (1993), 333–350. + +[Ja23b] Janzer, O., *Disproof of a conjecture of Erdős and Simonovits on the Turán number +of graphs with minimum degree 3*. International Mathematics Research Notices (2023), 8478–8494. +-/ + +open SimpleGraph + +namespace Erdos113 + +/-- An injective graph homomorphism from $H$ to $F$; witnesses that $F$ contains a +subgraph isomorphic to $H$. -/ +def ContainsSubgraph {V U : Type*} (F : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → F.Adj (f u) (f v) + +/-- The Turán number $\operatorname{ex}(n; H)$: the maximum number of edges in a simple graph +on $n$ vertices that contains no copy of $H$ as a subgraph. -/ +noncomputable def turanNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ ¬ContainsSubgraph F H ∧ F.edgeFinset.card = m} + +/-- A graph $G$ is 2-degenerate if every non-empty finite set of vertices contains +a vertex with at most 2 neighbors within that set. Equivalently, $G$ has no +induced subgraph with minimum degree at least 3. -/ +def IsTwoDegenerateGraph {V : Type*} (G : SimpleGraph V) : Prop := + ∀ (S : Set V), S.Finite → S.Nonempty → + ∃ v ∈ S, (G.neighborSet v ∩ S).ncard ≤ 2 + +/-- +Erdős–Simonovits Conjecture (Problem #113) [ErSi84]: +For a bipartite graph $G$ on a finite vertex set, the Turán number satisfies +$$ + \operatorname{ex}(n; G) \ll n^{3/2} +$$ +if and only if $G$ is 2-degenerate (i.e., $G$ has no induced subgraph with minimum +degree at least 3). + +Here $\operatorname{ex}(n; G) \ll n^{3/2}$ means there exists a constant $C > 0$ such that +$\operatorname{ex}(n; G) \leq C \cdot n^{3/2}$ for all $n$. + +DISPROVED by Janzer [Ja23b]: for any $\varepsilon > 0$, there exists a 3-regular bipartite +graph $H$ such that $\operatorname{ex}(n; H) \ll n^{4/3 + \varepsilon}$. Since a 3-regular graph is not +2-degenerate but its Turán number is still $o(n^{3/2})$, the "only if" direction +($\operatorname{ex}(n; G) \ll n^{3/2} \to G$ is 2-degenerate) fails. +-/ +@[category research solved, AMS 5] +theorem erdos_113 : answer(False) ↔ + ∀ (U : Type*) (G : SimpleGraph U) [Fintype U] [DecidableRel G.Adj], + Nonempty (G.Coloring (Fin 2)) → + (IsTwoDegenerateGraph G ↔ + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, + (turanNumber G n : ℝ) ≤ C * (n : ℝ) ^ (3 / 2 : ℝ)) := by + sorry + +end Erdos113 diff --git a/FormalConjectures/ErdosProblems/1130.lean b/FormalConjectures/ErdosProblems/1130.lean new file mode 100644 index 0000000000..a462671ff2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1130.lean @@ -0,0 +1,97 @@ +/- +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 1130 + +For nodes $x_1, \ldots, x_n \in [-1,1]$, consider the Lebesgue function +$\Lambda(x) = \sum_k |\ell_k(x)|$ of Lagrange interpolation, where $\ell_k$ +are the Lagrange basis polynomials. Partition $[-1,1]$ by $-1 = x_0 < x_1 +< \cdots < x_n < x_{n+1} = 1$ and let $\Upsilon(x_1, \ldots, x_n)$ be the +minimum over subintervals of the maximum of $\Lambda$. The conjecture asks +whether $\Upsilon(x_1, \ldots, x_n) \ll \log n$. + +*Reference:* [erdosproblems.com/1130](https://www.erdosproblems.com/1130) + +[Er47] Erdős, P., _Some remarks on polynomials_. Bull. Amer. Math. Soc. (1947), +1169-1176. + +[dBPi78] de Boor, C. and Pinkus, A., _Proof of the conjectures of Bernstein +and Erdős concerning the optimal nodes for polynomial interpolation_, +J. Approx. Theory (1978), 289-303. +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos1130 + +/-- The Lagrange basis polynomial $\ell_k(x)$ for nodes indexed by `Fin n`. +$$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$$ -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (k : Fin n) (x : ℝ) : ℝ := + ∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) + +/-- The Lebesgue function: $\Lambda(x) = \sum_k |\ell_k(x)|$ -/ +noncomputable def lebesgueFunction {n : ℕ} (nodes : Fin n → ℝ) (x : ℝ) : ℝ := + ∑ k, |lagrangeBasis nodes k x| + +/-- Nodes are valid: strictly increasing and in $[-1, 1]$. -/ +def ValidNodes {n : ℕ} (nodes : Fin n → ℝ) : Prop := + StrictMono nodes ∧ ∀ i, nodes i ∈ Set.Icc (-1 : ℝ) 1 + +/-- The boundary sequence: $-1$, then the $n$ nodes in order, then $1$, +giving $n + 2$ points partitioning $[-1, 1]$ into $n + 1$ subintervals. -/ +noncomputable def boundary {n : ℕ} (nodes : Fin n → ℝ) : Fin (n + 2) → ℝ := + fun i => + if h₁ : i.val = 0 then -1 + else if h₂ : i.val ≤ n then nodes ⟨i.val - 1, by omega⟩ + else 1 + +/-- The supremum of the Lebesgue function on the $i$-th subinterval +$[\text{boundary}(i), \text{boundary}(i+1)]$. -/ +noncomputable def localMax {n : ℕ} (nodes : Fin n → ℝ) (i : Fin (n + 1)) : ℝ := + sSup ((lebesgueFunction nodes) '' + (Set.Icc (boundary nodes ⟨i.val, by omega⟩) + (boundary nodes ⟨i.val + 1, by omega⟩))) + +/-- +Proved by de Boor and Pinkus [dBPi78]. + +For $x_1, \ldots, x_n \in [-1,1]$, let +$\ell_k(x) = \prod_{i \neq k} (x - x_i)/(x_k - x_i)$ be the Lagrange basis +polynomials (fundamental functions of Lagrange interpolation), satisfying +$\ell_k(x_k) = 1$ and $\ell_k(x_i) = 0$ for $i \neq k$. + +Set $x_0 = -1$ and $x_{n+1} = 1$. Define +$$\Upsilon(x_1, \ldots, x_n) = \min_{0 \le i \le n} \max_{x \in [x_i, x_{i+1}]} \sum_k |\ell_k(x)|.$$ + +The conjecture asks: is $\Upsilon(x_1, \ldots, x_n) \ll \log n$? + +This is true. It follows from the equioscillation result (Erdős Problem 1129) +and the work of de Boor and Pinkus that +$\Upsilon(x_1, \ldots, x_n) \le \frac{2}{\pi} \log n + O(1)$. +-/ +@[category research solved, AMS 41] +theorem erdos_1130 : answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ ∀ (n : ℕ), n ≥ 2 → + ∀ (nodes : Fin n → ℝ), ValidNodes nodes → + ∃ i : Fin (n + 1), localMax nodes i ≤ C * Real.log n := by + sorry + +end Erdos1130 diff --git a/FormalConjectures/ErdosProblems/1131.lean b/FormalConjectures/ErdosProblems/1131.lean new file mode 100644 index 0000000000..daaf736c17 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1131.lean @@ -0,0 +1,94 @@ +/- +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 1131 + +*Reference:* [erdosproblems.com/1131](https://www.erdosproblems.com/1131) + +For $x_1, \ldots, x_n \in [-1,1]$, define the Lagrange basis polynomials +$$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i},$$ +so that $\ell_k(x_k) = 1$ and $\ell_k(x_i) = 0$ for $i \neq k$. + +What is the minimal value of +$$I(x_1, \ldots, x_n) = \int_{-1}^{1} \sum_k |\ell_k(x)|^2 \, dx?$$ + +In particular, is it true that $\min I = 2 - (1 + o(1)) / n$? + +Fejér [Fe32] showed that the roots of the integral of the Legendre polynomial +minimize $\max_{x \in [-1,1]} \sum_k |\ell_k(x)|^2$. Erdős [Er61] conjectured +that these nodes also minimize the $L^2$ functional $I$, but Szabados [Sz66] +disproved this for all $n > 3$. + +[ESVV94] Erdős, P., Szabados, J., Varma, A.K., and Vértesi, P., +_On an interpolation theoretical extremal problem_. +Studia Sci. Math. Hungar. (1994), 55–60. Proved that +$2 - O((\log n)^2 / n) \le \min I \le 2 - 2/(2n-1)$, +where the upper bound is witnessed by the roots of the integral of the +Legendre polynomial. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +6 (1961), p. 221. + +[Fe32] Fejér, L., _Bestimmung derjenigen Abszissen eines Intervalles, für welche die +Quadratsumme der Grundfunktionen der Lagrangeschen Interpolation im Intervalle ein +möglichst kleines Maximum besitzt_. Ann. Scuola Norm. Sup. Pisa Cl. Sci. (2) (1932), +263–276. + +[Sz66] Szabados, J., _On a problem of P. Erdős_. Acta Math. Acad. Sci. Hungar. +(1966), 155–157. +-/ + +open MeasureTheory Finset Filter BigOperators + +namespace Erdos1131 + +/-- The Lagrange basis polynomial $\ell_k(x)$ for nodes `nodes : Fin n → ℝ` at index $k$: +$$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}.$$ -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (k : Fin n) (x : ℝ) : ℝ := + ∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) + +/-- The $L^2$ functional $I(x_1, \ldots, x_n) = \int_{-1}^{1} \sum_k \ell_k(x)^2 \, dx$. -/ +noncomputable def lagrangeL2 {n : ℕ} (nodes : Fin n → ℝ) : ℝ := + ∫ x in (-1 : ℝ)..1, ∑ k : Fin n, lagrangeBasis nodes k x ^ 2 + +/-- The minimum of the $L^2$ functional over all choices of $n$ distinct nodes in $[-1, 1]$. +The nodes are required to be distinct (`Function.Injective nodes`) so that the +Lagrange basis polynomials are well-defined. -/ +noncomputable def minLagrangeL2 (n : ℕ) : ℝ := + sInf {v : ℝ | ∃ nodes : Fin n → ℝ, + Function.Injective nodes ∧ + (∀ i, nodes i ∈ Set.Icc (-1 : ℝ) 1) ∧ + v = lagrangeL2 nodes} + +/-- +Erdős Problem 1131: For $x_1, \ldots, x_n \in [-1,1]$, let +$\ell_k(x) = \prod_{i \neq k} (x - x_i)/(x_k - x_i)$ be the Lagrange basis polynomials. +The conjecture asks whether the minimum of +$I(x_1, \ldots, x_n) = \int_{-1}^{1} \sum_k |\ell_k(x)|^2 \, dx$ satisfies +$\min I = 2 - (1 + o(1))/n$, i.e., $n \cdot (2 - \min I) \to 1$ as $n \to \infty$. + +See [ESVV94] for the best known bounds. +-/ +@[category research open, AMS 41] +theorem erdos_1131 : + answer(sorry) ↔ + Tendsto (fun n : ℕ => (n : ℝ) * (2 - minLagrangeL2 n)) atTop (nhds 1) := by + sorry + +end Erdos1131 diff --git a/FormalConjectures/ErdosProblems/1132.lean b/FormalConjectures/ErdosProblems/1132.lean new file mode 100644 index 0000000000..3c3a0f469f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1132.lean @@ -0,0 +1,112 @@ +/- +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 1132 + +*Reference:* [erdosproblems.com/1132](https://www.erdosproblems.com/1132) + +For $x_1, \ldots, x_n \in [-1,1]$, define the Lagrange basis polynomials +$$ + \ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}, +$$ +so that $\ell_k(x_k) = 1$ and $\ell_k(x_i) = 0$ for $i \neq k$. + +Let $x_1, x_2, \ldots \in [-1,1]$ be an infinite sequence, and let +$$ + L_n(x) = \sum_{1 \leq k \leq n} |\ell_k(x)|, +$$ +where each $\ell_k(x)$ is defined with respect to $x_1, \ldots, x_n$. + +Bernstein [Be31] proved that the set of $x \in (-1,1)$ for which the limsup +condition $\limsup_{n \to \infty} L_n(x) / \log n \geq 2/\pi$ holds is everywhere dense. +Erdős [Er61c] proved that for any fixed nodes, $\max_{x \in [-1,1]} L_n(x) > (2/\pi) \log n - O(1)$. + +[Er67,p.68] Erdős, P., _Some recent results on extremal problems in graph theory. Results_, + Theory of Graphs (Internat. Sympos., Rome, 1966) (1967), 117–123. + +[Er61c] Erdős, P., _Problems and results on the theory of interpolation. II_, + Acta Math. Acad. Sci. Hungar. (1961), 235–244. + +[Be31] Bernstein, S., _Sur la limitation des valeurs d'un polynome $P_n(x)$ de degré $n$ sur + tout un segment par ses valeurs en $(n+1)$ points du segment_, Izv. Akad. Nauk. SSSR (1931), + 1025–1050. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §2.43. +-/ + +open Finset Filter MeasureTheory +open scoped BigOperators + +namespace Erdos1132 + +/-- The Lagrange basis polynomial $\ell_k(x)$ for nodes indexed by $\operatorname{Fin} n$. +$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$ -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (k : Fin n) (x : ℝ) : ℝ := + ∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) + +/-- The Lebesgue function: $L_n(x) = \sum_k |\ell_k(x)|$ -/ +noncomputable def lebesgueFunction {n : ℕ} (nodes : Fin n → ℝ) (x : ℝ) : ℝ := + ∑ k, |lagrangeBasis nodes k x| + +/-- The first $n$ elements of an infinite sequence, viewed as $\operatorname{Fin} n \to \mathbb{R}$. -/ +noncomputable def firstN (seq : ℕ → ℝ) (n : ℕ) : Fin n → ℝ := fun i => seq i.val + +/-- $L_n(x)$: the Lebesgue function using the first $n$ points of the sequence. -/ +noncomputable def L (seq : ℕ → ℝ) (n : ℕ) (x : ℝ) : ℝ := + lebesgueFunction (firstN seq n) x + +/-- A sequence is valid for interpolation: values in $[-1,1]$ and pairwise distinct. -/ +def ValidSeq (seq : ℕ → ℝ) : Prop := + Function.Injective seq ∧ ∀ i, seq i ∈ Set.Icc (-1 : ℝ) 1 + +/-- +Erdős Problem 1132 (Part 1): + +For any infinite sequence $x_1, x_2, \ldots \in [-1,1]$ of distinct points, must there +exist $x \in (-1,1)$ and a constant $C$ such that $L_n(x) > \frac{2}{\pi} \log n - C$ for +infinitely many $n$? +-/ +@[category research open, AMS 26 41] +theorem erdos_1132 : answer(sorry) ↔ + ∀ (seq : ℕ → ℝ), ValidSeq seq → + ∃ x ∈ Set.Ioo (-1 : ℝ) 1, ∃ C : ℝ, + ∃ᶠ n in atTop, + L seq n x > (2 / Real.pi) * Real.log (n : ℝ) - C := by + sorry + +/-- +Erdős Problem 1132 (Part 2): + +For any infinite sequence $x_1, x_2, \ldots \in [-1,1]$ of distinct points, is it true that +$\limsup_{n \to \infty} L_n(x) / \log n \geq \frac{2}{\pi}$ +for almost all $x \in (-1,1)$? + +Bernstein [Be31] proved that the set of $x \in (-1,1)$ satisfying this limsup +condition is everywhere dense. +-/ +@[category research open, AMS 26 41] +theorem erdos_1132.variants.part2 : answer(sorry) ↔ + ∀ (seq : ℕ → ℝ), ValidSeq seq → + ∀ᵐ x ∂(volume.restrict (Set.Ioo (-1 : ℝ) 1)), + ∀ c < 2 / Real.pi, + ∃ᶠ n in atTop, L seq n x / Real.log (n : ℝ) ≥ c := by + sorry + +end Erdos1132 diff --git a/FormalConjectures/ErdosProblems/1133.lean b/FormalConjectures/ErdosProblems/1133.lean new file mode 100644 index 0000000000..04f5870414 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1133.lean @@ -0,0 +1,58 @@ +/- +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 1133 + +*Reference:* [erdosproblems.com/1133](https://www.erdosproblems.com/1133) + +[Er67] Erdős, P., _Problems and results on the convergence and divergence properties of the +Lagrange interpolation polynomials and some extremal problems_. Mathematica (Cluj) (1967), 65–73. + +Erdős proved that, for any $C > 0$, there exists $\varepsilon > 0$ such that if $n$ is sufficiently +large and $m = \lfloor(1+\varepsilon)n\rfloor$ then for any $x_1, \ldots, x_m \in [-1,1]$ there is +a polynomial $P$ of degree $n$ such that $|P(x_i)| \le 1$ for $1 \le i \le m$ and +$\max_{x \in [-1,1]} |P(x)| > C$. +The conjectured statement would also imply this, but Erdős said he could not even prove +it for $m = n$. +-/ + +open Polynomial Finset Set + +namespace Erdos1133 + +/-- +Erdős Problem 1133: +Let $C > 0$. There exists $\varepsilon > 0$ such that for sufficiently large $n$, for any +$x_1, \ldots, x_n \in [-1,1]$ there exist $y_1, \ldots, y_n \in [-1,1]$ such that any polynomial +$P$ of degree $< (1+\varepsilon)n$ that agrees with $y_i$ at $x_i$ for at least $(1-\varepsilon)n$ +indices $i$ must satisfy $\max_{x \in [-1,1]} |P(x)| > C$. +-/ +@[category research open, AMS 41] +theorem erdos_1133 : + ∀ C : ℝ, C > 0 → + ∃ ε : ℝ, ε > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ x : Fin n → ℝ, (∀ i, x i ∈ Icc (-1 : ℝ) 1) → + ∃ y : Fin n → ℝ, (∀ i, y i ∈ Icc (-1 : ℝ) 1) ∧ + ∀ P : Polynomial ℝ, (P.natDegree : ℝ) < (1 + ε) * n → + ((univ.filter (fun i : Fin n => P.eval (x i) = y i)).card : ℝ) ≥ (1 - ε) * n → + ∃ t ∈ Icc (-1 : ℝ) 1, |P.eval t| > C := by + sorry + +end Erdos1133 diff --git a/FormalConjectures/ErdosProblems/1134.lean b/FormalConjectures/ErdosProblems/1134.lean new file mode 100644 index 0000000000..17cc21177f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1134.lean @@ -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 +import FormalConjecturesForMathlib.Data.Set.Density + +/-! +# Erdős Problem 1134 + +*Reference:* [erdosproblems.com/1134](https://www.erdosproblems.com/1134) + +Let $A \subseteq \mathbb{N}$ be the smallest set which contains $1$ and is closed under the +operations $x \mapsto 2x+1$, $x \mapsto 3x+1$, and $x \mapsto 6x+1$. Does $A$ have positive +lower density? + +This was disproved by Crampin and Hilton, who showed that +$|A \cap [1,X]| \ll X^{\tau+o(1)}$ where $\tau \approx 0.900626 < 1$ is the unique positive +root of $6^{-\tau} + \sum_{k \geq 0} (3 \cdot 2^k)^{-\tau} = 1$. In particular, $A$ has +density $0$. + +OEIS: [A185661](https://oeis.org/A185661) + +[Gu83b] Guy, R. K., _Unsolved Problems: Don't Try to Solve These Problems_. American Mathematical +Monthly (1983), 35-41. + +[Gu04] Guy, R. K., _Unsolved problems in number theory_ (2004), xviii+437. + +[Kl82] Klarner, D. A., _A sufficient condition for certain semigroups to be free_. Journal of +Algebra (1982), 140-148. + +[KlRa74] Klarner, D. A. and Rado, R., _Arithmetic properties of certain recursively defined sets_. +Pacific Journal of Mathematics (1974), 445-463. + +[La16] Lagarias, J. C., _Erdős, Klarner, and the $3x+1$ problem_. Amer. Math. Monthly (2016), +753-776. +-/ + +open Filter + +open scoped Topology + +namespace Erdos1134 + +/-- The set $A$ from Erdős Problem 1134: the smallest subset of $\mathbb{N}$ containing $1$ +and closed under $x \mapsto 2x+1$, $x \mapsto 3x+1$, and $x \mapsto 6x+1$. -/ +inductive InSet : ℕ → Prop where + | base : InSet 1 + | step2 (n : ℕ) : InSet n → InSet (2 * n + 1) + | step3 (n : ℕ) : InSet n → InSet (3 * n + 1) + | step6 (n : ℕ) : InSet n → InSet (6 * n + 1) + +/-- The set $A$ from Problem 1134 as a `Set ℕ`. -/ +def A : Set ℕ := {n : ℕ | InSet n} + +/-- +Erdős Problem 1134 [La16][KlRa74][Kl82][Gu83b][Gu04]: + +Let $A \subseteq \mathbb{N}$ be the smallest set containing $1$ and closed under $x \mapsto 2x+1$, +$x \mapsto 3x+1$, and $x \mapsto 6x+1$. Does $A$ have positive lower density? + +Disproved (answered in the negative) by Crampin and Hilton, who showed +$|A \cap [1,X]| \ll X^{\tau+o(1)}$ where $\tau \approx 0.900626 < 1$. +-/ +@[category research solved, AMS 11] +theorem erdos_1134 : A.lowerDensity = 0 := by sorry + +/-- Klarner's variant from Erdős Problem 1134: + +Consider the smallest set $B \subseteq \mathbb{N}$ containing $0$ and closed under $x \mapsto 2x$, +$x \mapsto 3x+2$, and $x \mapsto 6x+3$. Does $B$ have positive density? + +This variant, attributed to Klarner, remains open. It appears as Problem E36 in Guy's collection +and is discussed in Section 8.9 of Lagarias [La16]. -/ +inductive InSetKlarner : ℕ → Prop where + | base : InSetKlarner 0 + | step2 (n : ℕ) : InSetKlarner n → InSetKlarner (2 * n) + | step3 (n : ℕ) : InSetKlarner n → InSetKlarner (3 * n + 2) + | step6 (n : ℕ) : InSetKlarner n → InSetKlarner (6 * n + 3) + +/-- The set $B$ from Klarner's variant as a `Set ℕ`. -/ +def B : Set ℕ := {n : ℕ | InSetKlarner n} + +@[category research open, AMS 11] +theorem erdos_1134_variant_klarner : answer(sorry) ↔ B.HasPosDensity := by sorry + +end Erdos1134 diff --git a/FormalConjectures/ErdosProblems/1136.lean b/FormalConjectures/ErdosProblems/1136.lean new file mode 100644 index 0000000000..56e09d03aa --- /dev/null +++ b/FormalConjectures/ErdosProblems/1136.lean @@ -0,0 +1,80 @@ +/- +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 + +/-! +# Erdős Problem 1136 + +*Reference:* [erdosproblems.com/1136](https://www.erdosproblems.com/1136) + +Does there exist $A \subseteq \mathbb{N}$ with lower density $> 1/3$ such that $a + b \neq 2^k$ +for any $a, b \in A$ and $k \geq 0$? + +A question asked by Erdős at the DMV conference in Berlin 1987. Achieving density $1/3$ is trivial, +taking $A$ to be all multiples of $3$. + +Müller [Mu11] settled this question in the affirmative: one can take $A$ to be the set of all +integers congruent to $3 \cdot 2^i \pmod{2^{i+2}}$ for any $i \geq 0$, which has density $1/2$. +Müller also proved this is best possible, in that such $A$ has lower density at most $1/2$. + +[Mu11] Müller, H., *Über ein additiv-zahlentheoretisches Problem von P. Erdős*. +Mitteilungen der Mathematischen Gesellschaft in Hamburg (2011), 75–78. +-/ + +open Classical + +namespace Erdos1136 + +/-- A set $A \subseteq \mathbb{N}$ is power-of-2 sum-free if no two elements (not necessarily + distinct) sum to a power of $2$. -/ +def PowerOfTwoSumFree (A : Set ℕ) : Prop := + ∀ a b : ℕ, a ∈ A → b ∈ A → ∀ k : ℕ, a + b ≠ 2 ^ k + +/-- +Erdős Problem 1136 (Proved by Müller [Mu11]): +There exists $A \subseteq \mathbb{N}$ with lower density strictly greater than $1/3$ such that +no two elements of $A$ sum to a power of $2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1136 : answer(True) ↔ + ∃ (A : Set ℕ), + PowerOfTwoSumFree A ∧ + 1/3 < Set.lowerDensity A := by + sorry + +/-- +Müller's explicit construction [Mu11]: the set of all integers congruent to $3 \cdot 2^i +\pmod{2^{i+2}}$ for some $i \geq 0$ is power-of-2 sum-free and has density $1/2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1136_construction : + let A := {n : ℕ | ∃ i : ℕ, n % 2 ^ (i + 2) = 3 * 2 ^ i} + PowerOfTwoSumFree A ∧ + Set.lowerDensity A = 1/2 := by + sorry + +/-- +Müller's optimality result [Mu11]: no power-of-2 sum-free set can have lower density +exceeding $1/2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_1136_upper : + ∀ A : Set ℕ, PowerOfTwoSumFree A → Set.lowerDensity A ≤ 1/2 := by + sorry + +end Erdos1136 diff --git a/FormalConjectures/ErdosProblems/1138.lean b/FormalConjectures/ErdosProblems/1138.lean new file mode 100644 index 0000000000..9d36b8919e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1138.lean @@ -0,0 +1,64 @@ +/- +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.NumberTheory.PrimeGap + +/-! +# Erdős Problem 1138 + +*Reference:* [erdosproblems.com/1138](https://www.erdosproblems.com/1138) + +Is the expected asymptotic formula for the number of primes in short intervals of length +proportional to the maximal prime gap valid? Specifically, for $x/2 < y < x$ and $C > 1$, +is $\pi(y + Cd) - \pi(y) \sim Cd / \log y$, where $d$ is the maximal prime gap below $x$? + +[Va99] Vardi, I., 1.3. +-/ + +namespace Erdos1138 + +/-- The maximal gap between consecutive primes up to $x$. +For each index $k$ with the $k$-th prime (0-indexed) less than $x$, +compute the gap to the next prime and take the maximum. +Returns $0$ when there are no primes less than $x$. -/ +noncomputable def maxPrimeGap (x : ℕ) : ℕ := + (Finset.range (Nat.primeCounting' x)).sup primeGap + +/-- +Erdős Problem 1138 [Va99, 1.3]: + +Let $x/2 < y < x$ and $C > 1$. If $d = \max_{p_n < x} (p_{n+1} - p_n)$ is the maximal +prime gap below $x$, where $p_n$ denotes the $n$-th prime, then is it true that +$$\pi(y + Cd) - \pi(y) \sim Cd / \log y?$$ + +In other words, the expected asymptotic formula for the number of primes in the +interval $[y, y + Cd]$ holds. This is a combination of two well-studied problems: +finding the minimum $h$ for which $\pi(y + h) - \pi(y) \sim h / \log y$, and understanding +the maximal prime gap $d$. The conjectured size of $d$ is $\approx (\log x)^2$, which is far +below the $h$ obtainable even assuming the Riemann hypothesis. +-/ +@[category research open, AMS 11] +theorem erdos_1138 : answer(sorry) ↔ + ∀ (C : ℝ), 1 < C → ∀ (ε : ℝ), 0 < ε → + ∃ N : ℕ, ∀ x : ℕ, N ≤ x → + ∀ y : ℕ, x < 2 * y → y < x → + |((Nat.primeCounting (y + ⌊C * (maxPrimeGap x : ℝ)⌋₊) : ℝ) - + (Nat.primeCounting y : ℝ)) / + (C * (maxPrimeGap x : ℝ) / Real.log (y : ℝ)) - 1| < ε := by + sorry + +end Erdos1138 diff --git a/FormalConjectures/ErdosProblems/114.lean b/FormalConjectures/ErdosProblems/114.lean new file mode 100644 index 0000000000..3adab61a41 --- /dev/null +++ b/FormalConjectures/ErdosProblems/114.lean @@ -0,0 +1,135 @@ +/- +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 114 + +*Reference:* [erdosproblems.com/114](https://www.erdosproblems.com/114) + +Erdős–Herzog–Piranian conjecture: the arc length of the level curve +$\{z \in \mathbb{C} : |p(z)| = 1\}$ of a monic polynomial of degree $n$ is maximized when +$p(z) = z^n - 1$. + +Also appears as Problem 4.10 in [Ha74], attributed to Erdős. + +[EHP58] Erdős, P., Herzog, F. and Piranian, G., _Metric properties of polynomials_, +J. Analyse Math. 6 (1958), 125–148. + +[Po59] Pommerenke, Ch., _On some problems by Erdős, Herzog and Piranian_, +Michigan Math. J. 6 (1959), 221–225. + +[Po61] Pommerenke, Ch., _On metric properties of complex polynomials_, +Michigan Math. J. 8 (1961), 97–115. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_, (1974), 155–180. + +[Va99] _Some of Paul's favorite problems_, Booklet, Conference "Paul Erdős and his +mathematics", Budapest, July 1999. +-/ + +open scoped ENNReal + +open Polynomial MeasureTheory + +namespace Erdos114 + +/-- The unit level curve of a complex polynomial $p$: the set of $z \in \mathbb{C}$ with +$|p(z)| = 1$. -/ +def levelCurveUnit (p : Polynomial ℂ) : Set ℂ := + {z : ℂ | ‖p.eval z‖ = 1} + +/-- The arc length of a subset of $\mathbb{C}$, given by the 1-dimensional Hausdorff measure. -/ +noncomputable def arcLength (S : Set ℂ) : ℝ≥0∞ := + Measure.hausdorffMeasure 1 S + +/-- +Erdős–Herzog–Piranian Conjecture (Problem #114) [EHP58]: +If $p(z) \in \mathbb{C}[z]$ is a monic polynomial of degree $n \geq 1$, then the length of the +curve $\{z \in \mathbb{C} : |p(z)| = 1\}$ is maximized when $p(z) = z^n - 1$. + +That is, for every monic polynomial $p$ of degree $n$, +$$\mathrm{length}(\{z : |p(z)| = 1\}) \leq \mathrm{length}(\{z : |z^n - 1| = 1\}).$$ + +Known partial results: +- The curve for $p(z) = z^n - 1$ has length $2n + O(1)$, so the conjecture implies + the maximal length $f(n)$ satisfies $f(n) = 2n + O(1)$. +- Pommerenke (1961) [Po61]: $f(n) \ll n^2$. +- Dolzhenko (1961): $f(n) \leq 4\pi n$. +- Borwein (1995): $f(n) \ll n$. +- Eremenko–Hayman (1999): $f(n) \leq 9.173n$; full conjecture holds for $n = 2$. +- Vayman (1999) [Va99]: asked whether $f(n) \leq 2n + O(1)$. +- Danchenko (2007): $f(n) \leq 2\pi n$. +- Fryntov–Nazarov (2009): $f(n) \leq 2n + O(n^{7/8})$; $z^n - 1$ is a local maximiser. +- Tao (2025): $z^n - 1$ is the unique maximiser (up to rotation and translation) for all + sufficiently large $n$. +-/ +@[category research open, AMS 30] +theorem erdos_114 : + ∀ n : ℕ, 1 ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + arcLength (levelCurveUnit p) ≤ + arcLength (levelCurveUnit ((X : Polynomial ℂ) ^ n - 1)) := by + sorry + +/-- +Tao (2025) [Ta25]: The Erdős–Herzog–Piranian conjecture holds for all sufficiently large $n$. +That is, there exists $N$ such that for all $n \geq N$ and all monic polynomials $p$ of degree $n$, +the arc length of $\{z : |p(z)| = 1\}$ is at most that of $\{z : |z^n - 1| = 1\}$. +-/ +@[category research solved, AMS 30] +theorem erdos_114_large_n : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + arcLength (levelCurveUnit p) ≤ + arcLength (levelCurveUnit ((X : Polynomial ℂ) ^ n - 1)) := by + sorry + +/-- +Eremenko–Hayman (1999) [ErHa99]: The Erdős–Herzog–Piranian conjecture holds for $n = 2$. +-/ +@[category research solved, AMS 30] +theorem erdos_114_deg_two : + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = 2 → + arcLength (levelCurveUnit p) ≤ + arcLength (levelCurveUnit ((X : Polynomial ℂ) ^ 2 - 1)) := by + sorry + +/-- +Fryntov–Nazarov (2009) [FrNa09]: For all monic polynomials $p$ of degree $n$, the arc length +of $\{z : |p(z)| = 1\}$ is at most $2n + O(n^{7/8})$. +-/ +@[category research solved, AMS 30] +theorem erdos_114_upper_bound : + ∃ C : ℝ, ∀ n : ℕ, 1 ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + arcLength (levelCurveUnit p) ≤ ENNReal.ofReal (2 * n + C * n ^ (7 / 8 : ℝ)) := by + sorry + +/-- +Pommerenke (1959) [Po59]: If $p$ is a monic polynomial of degree $n$ and the sublevel set +$\{z : |p(z)| < 1\}$ is connected, then the arc length of $\{z : |p(z)| = 1\}$ is at least $2\pi$. +-/ +@[category research solved, AMS 30] +theorem erdos_114_pommerenke_lower_bound : + ∀ n : ℕ, 1 ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + IsConnected {z : ℂ | ‖p.eval z‖ < 1} → + ENNReal.ofReal (2 * Real.pi) ≤ arcLength (levelCurveUnit p) := by + sorry + +end Erdos114 diff --git a/FormalConjectures/ErdosProblems/1140.lean b/FormalConjectures/ErdosProblems/1140.lean new file mode 100644 index 0000000000..a6b896d53f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1140.lean @@ -0,0 +1,58 @@ +/- +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 1140 + +Are there infinitely many $n$ such that $n - 2x^2$ is prime for all $x$ with $2x^2 < n$? + +*Reference:* [erdosproblems.com/1140](https://www.erdosproblems.com/1140) + +[Va99] Vaughan, R. C., *The Hardy-Littlewood Method*, 2nd ed., 1997. + +[EpGi10] Epure, R. and Gica, A., _Principal quadratic real fields in connection with some +additive problems_. Bull. Math. Soc. Sci. Math. Roumanie (N.S.) (2010), 251–259. + +[MoWi89] Mollin, R. A. and Williams, H. C., _Period four and real quadratic fields of class +number one_. Proc. Japan Acad. Ser. A Math. Sci. (1989), 89–93. +-/ + +namespace Erdos1140 + +/-- The property that $n - 2x^2$ is prime for all $x$ with $2x^2 < n$. -/ +def AllShiftsArePrime (n : ℕ) : Prop := + ∀ x : ℕ, 2 * x ^ 2 < n → Nat.Prime (n - 2 * x ^ 2) + +/-- +Erdős Problem #1140 [Va99, 1.5] (Disproved): + +Do there exist infinitely many $n$ such that $n - 2x^2$ is prime for all $x$ +with $2x^2 < n$? + +The known such $n$ are $2, 5, 7, 13, 31, 61, 181, 199$. Epure and Gica [EpGi10] +proved that the only such $n \equiv 1 \pmod{4}$ are $5, 13, 61, 181$, and the only +such $n \equiv 3 \pmod{4}$ are $7, 31, 199$ (with at most one exception, +using [MoWi89]). +This implies that, with at most one exception, the list above is complete. +-/ +@[category research solved, AMS 11] +theorem erdos_1140 : + answer(False) ↔ Set.Infinite {n : ℕ | AllShiftsArePrime n} := by + sorry + +end Erdos1140 diff --git a/FormalConjectures/ErdosProblems/1142.lean b/FormalConjectures/ErdosProblems/1142.lean index 2d87d5a753..a8ea6d998d 100644 --- a/FormalConjectures/ErdosProblems/1142.lean +++ b/FormalConjectures/ErdosProblems/1142.lean @@ -24,8 +24,14 @@ import FormalConjectures.Util.ProblemImports - [A039669](https://oeis.org/A039669) - [Va99] Various, Some of Paul's favorite problems. Booklet produced for the conference "Paul Erdős and his mathematics", Budapest, July 1999 (1999). -- [MiWe69] Mientka, W. E. and Weitzenkamp, R. C., On f-plentiful numbers, Journal of - Combinatorial Theory, Volume 7, Issue 4, December 1969, pages 374-377. +- [MiWe69] Mientka, W. E. and Weitzenkamp, R. C., _On f-plentiful numbers_, Journal of + Combinatorial Theory, Volume 7, Issue 4, December 1969, pages 374–377. +- [Va73] Vaughan, R. C., _Some applications of Montgomery's sieve_, Journal of Number Theory + **5** (1973), 64–79. +- [Gu04] Guy, R., _Unsolved Problems in Number Theory_, 3rd ed. Springer, 2004, Problem A19. + +See also [Erdős Problem #236](https://www.erdosproblems.com/236) for the related conjecture that +the number of $1 < 2^k < n$ for which $n - 2^k$ is prime is $o(\log n)$. -/ @@ -47,6 +53,8 @@ def Erdos1142Prop (n : ℕ) : Prop := Are there infinitely many $n > 2$ such that $n - 2^k$ is prime for all $k \geq 1$ with $2^k < n$? The only known such $n$ are $4, 7, 15, 21, 45, 75, 105$ (OEIS [A039669](https://oeis.org/A039669)). +The problem remains open; Vaughan [Va73] proved an upper bound showing qualifying $n$ are +extremely sparse, suggesting the answer may be "no". -/ @[category research open, AMS 11] theorem erdos_1142 : diff --git a/FormalConjectures/ErdosProblems/1143.lean b/FormalConjectures/ErdosProblems/1143.lean new file mode 100644 index 0000000000..dc1b38004b --- /dev/null +++ b/FormalConjectures/ErdosProblems/1143.lean @@ -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 + +/-! +# Erdős Problem 1143 + +Estimate $F_k(p_1, \ldots, p_u)$, the minimum count of multiples of at least one given prime +in any interval of $k$ consecutive integers, particularly for $k = \alpha \cdot p_u$ +with $\alpha > 2$. + +*Reference:* [erdosproblems.com/1143](https://www.erdosproblems.com/1143) + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §1.8. + +See also: Erdős Problem 970 (Jacobsthal's function), which is closely related. +-/ + +open Finset + +namespace Erdos1143 + +/-- Count of integers in $\{n+1, \ldots, n+k\}$ divisible by at least one element of $S$. -/ +def countDivisible (S : Finset ℕ) (k n : ℕ) : ℕ := + ((Icc (n + 1) (n + k)).filter (fun m => ∃ p ∈ S, p ∣ m)).card + +/-- $F_k(S)$ is the minimum, over all starting points $n$, of the count of integers in +$\{n+1, \ldots, n+k\}$ divisible by at least one element of $S$. -/ +noncomputable def F_k (S : Finset ℕ) (k : ℕ) : ℕ := + iInf (countDivisible S k) + +/-- +Erdős Problem 1143 [Va99, 1.8]: + +Let $p_1 < \cdots < p_u$ be primes and $k \geq 1$. Define $F_k(p_1, \ldots, p_u)$ to be the +minimum, over all starting points $n \geq 0$, of the count of integers in +$\{n+1, \ldots, n+k\}$ that are divisible by at least one $p_i$. + +Estimate $F_k(p_1, \ldots, p_u)$, particularly in the range $k = \alpha \cdot p_u$ +for constant $\alpha > 2$. + +Erdős and Selfridge found the exact bound when $2 < \alpha < 3$. +For $\alpha > 3$, very little is known. + +We formalize a sieve lower bound: for any finite set of primes $S$, +every interval of $k$ consecutive positive integers contains at least +$$k \cdot \left(1 - \prod_{p \in S}\left(1 - \frac{1}{p}\right)\right) - 2^{|S|}$$ +multiples of some element of $S$. +The error term $2^{|S|}$ arises from truncated inclusion-exclusion, where each of the +$2^{|S|}$ subsets of $S$ contributes at most $1$ to the rounding error. +The open problem is to determine sharper estimates, particularly +the exact value of $F_k$ for $\alpha > 3$. +-/ +@[category research open, AMS 11] +theorem erdos_1143 (S : Finset ℕ) (hS : ∀ p ∈ S, Nat.Prime p) + (hne : S.Nonempty) (k : ℕ) (hk : 0 < k) : + ∀ n : ℕ, + (countDivisible S k n : ℝ) ≥ + (k : ℝ) * (1 - S.prod (fun p => (1 - 1 / (p : ℝ)))) - (2 : ℝ) ^ S.card := by + sorry + +end Erdos1143 diff --git a/FormalConjectures/ErdosProblems/1144.lean b/FormalConjectures/ErdosProblems/1144.lean new file mode 100644 index 0000000000..96a626a318 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1144.lean @@ -0,0 +1,80 @@ +/- +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 1144 + +Let $f$ be a random completely multiplicative function, where for each prime $p$ we independently +choose $f(p) \in \{-1, 1\}$ uniformly at random. Is it true that the limsup of +$\sum_{m \leq N} f(m) / \sqrt{N}$ is infinite with probability 1? + +*Reference:* [erdosproblems.com/1144](https://www.erdosproblems.com/1144) + +[Va99] Montgomery, H.L. and Vaughan, R.C., *Multiplicative Number Theory I: Classical Theory*. +Cambridge Studies in Advanced Mathematics, Cambridge University Press, 2007. + +[At25] Atherfold, C., *Almost sure bounds for weighted sums of Rademacher random multiplicative +functions*. arXiv:2501.11076, 2025. +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators + +namespace Erdos1144 + +/-- A random variable is Rademacher distributed: takes values $\pm 1$ with equal probability. -/ +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} + +/-- The random *completely* multiplicative function built from Rademacher signs at primes. +For $n \geq 1$: $f(n) = \prod_{p \in \operatorname{primeFactors}(n)} \varepsilon(p)^{v_p(n)}$. +For $n = 0$: $f(0) = 0$. +This is completely multiplicative (as opposed to merely multiplicative, cf. Problem 520). -/ +noncomputable def randMultFun {Ω : Type*} (ε : ℕ → Ω → ℝ) (ω : Ω) (n : ℕ) : ℝ := + if n = 0 then 0 + else ∏ p ∈ n.factorization.support, (ε p ω) ^ (n.factorization p) + +/-- The partial sum $\sum_{m=1}^{N} f(m)$. -/ +noncomputable def partialSum {Ω : Type*} (ε : ℕ → Ω → ℝ) (ω : Ω) (N : ℕ) : ℝ := + ∑ m ∈ Finset.Icc 1 N, randMultFun ε ω m + +/-- +Erdős Problem 1144 [Va99, 1.11]: + +Let $f$ be a random completely multiplicative function, where for each prime $p$ +we independently choose $f(p) \in \{-1, 1\}$ uniformly at random. Is it true that +$$\limsup_{N \to \infty} \frac{\sum_{m \leq N} f(m)}{\sqrt{N}} = \infty$$ +with probability 1? + +This model is sometimes called a Rademacher random multiplicative function. +Atherfold [At25] proved that, almost surely, +$$\sum_{m \leq N} f(m) \ll N^{1/2} (\log N)^{1+o(1)}.$$ +-/ +@[category research open, AMS 11 60] +theorem erdos_1144 : + answer(sorry) ↔ + ∀ (Ω : Type*) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (ε : ℕ → Ω → ℝ), + (∀ k, IsRademacher μ (ε k)) → + iIndepFun ε μ → + (∀ᵐ ω ∂μ, ∀ C : ℝ, + ∃ᶠ N in atTop, + partialSum ε ω N > C * Real.sqrt (N : ℝ)) := by + sorry + +end Erdos1144 diff --git a/FormalConjectures/ErdosProblems/1145.lean b/FormalConjectures/ErdosProblems/1145.lean index 54967b2fca..cd97b51a48 100644 --- a/FormalConjectures/ErdosProblems/1145.lean +++ b/FormalConjectures/ErdosProblems/1145.lean @@ -15,7 +15,6 @@ limitations under the License. -/ import FormalConjectures.Util.ProblemImports -import FormalConjectures.ErdosProblems.«28» /-! # Erdős Problem 1145 @@ -66,7 +65,9 @@ theorem erdos_1145 : answer(sorry) ↔ Erdos1145Prop := by A stronger form of [erdosproblems.com/28]. -/ @[category test, AMS 11] -theorem erdos_1145.test_implies_erdos_28 : Erdos1145Prop → type_of% Erdos28.erdos_28 := by +theorem erdos_1145.test_implies_erdos_28 : Erdos1145Prop → + ∀ (A : Set ℕ), (A + A)ᶜ.Finite → + limsup (fun (n : ℕ) => (sumRep A n : ℕ∞)) atTop = (⊤ : ℕ∞) := by delta sumRep intro h1145 s hs rcases hs.exists_le with ⟨m, hm⟩ diff --git a/FormalConjectures/ErdosProblems/1146.lean b/FormalConjectures/ErdosProblems/1146.lean new file mode 100644 index 0000000000..9691b4de11 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1146.lean @@ -0,0 +1,79 @@ +/- +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 Mathlib.Algebra.Group.Pointwise.Set.Basic + +/-! +# Erdős Problem 1146 + +Erdős asked whether the set of 3-smooth numbers {2^m · 3^n : m, n ≥ 0} is an essential component +with respect to Schnirelmann density. 3-smooth numbers are not lacunary, so Ruzsa's result +that lacunary sets cannot be essential components (see Problem 37) does not rule them out; +this makes them "the simplest set with a chance" to be an essential component. + +*Reference:* [erdosproblems.com/1146](https://www.erdosproblems.com/1146) + +*See also:* Problem 37. + +[Va99] Ruzsa, I. Z., *Sumsets and structure*, Combinatorial Number Theory and Additive +Group Theory (1999). + +[Ru99] Ruzsa, I., *Erdős and the Integers*. Journal of Number Theory (1999), 115-163. +-/ + +open Classical +open scoped Pointwise + +namespace Erdos1146 + +/-- +The Schnirelmann density of a set $A \subseteq \mathbb{N}$, defined as +$$d_s(A) = \inf_{n \geq 1} \frac{|A \cap \{1,\ldots,n\}|}{n}.$$ +-/ +noncomputable def schnirelmannDensity (A : Set ℕ) : ℝ := + ⨅ n : ℕ+, (((Finset.Icc 1 (n : ℕ)).filter (· ∈ A)).card : ℝ) / ((n : ℕ) : ℝ) + +/-- +A set $A \subseteq \mathbb{N}$ is an essential component if $d_s(A + B) > d_s(B)$ for every +$B \subseteq \mathbb{N}$ with $0 < d_s(B) < 1$, where $d_s$ is the Schnirelmann density. +-/ +def IsEssentialComponent (A : Set ℕ) : Prop := + ∀ (B : Set ℕ), 0 < schnirelmannDensity B → schnirelmannDensity B < 1 → + schnirelmannDensity (A + B) > schnirelmannDensity B + +/-- +The set of 3-smooth numbers: $\{2^m \cdot 3^n \mid m, n \geq 0\}$. +-/ +def smoothNumbers23 : Set ℕ := + {k | ∃ m n : ℕ, k = 2 ^ m * 3 ^ n} + +/-- +Erdős Problem 1146 [Va99, 1.19]: +Is the set $B = \{2^m \cdot 3^n : m, n \geq 0\}$ an essential component? + +A set $A \subseteq \mathbb{N}$ is an essential component if $d_s(A + B) > d_s(B)$ for every +$B \subseteq \mathbb{N}$ with $0 < d_s(B) < 1$, where $d_s$ is the Schnirelmann density. + +Ruzsa states: "The simplest set with a chance to be an essential component is +the collection of numbers in the form $2^m \cdot 3^n$ and Erdős often asked whether +it is an essential component or not." +-/ +@[category research open, AMS 11] +theorem erdos_1146 : answer(sorry) ↔ IsEssentialComponent smoothNumbers23 := by + sorry + +end Erdos1146 diff --git a/FormalConjectures/ErdosProblems/1147.lean b/FormalConjectures/ErdosProblems/1147.lean new file mode 100644 index 0000000000..e8a7f6e888 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1147.lean @@ -0,0 +1,81 @@ +/- +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.Combinatorics.Additive.Basis + +/-! +# Erdős Problem 1147 + +Is the set of natural numbers $n \ge 1$ with $\lVert \alpha n^2 \rVert < 1 / \log n$ an additive +basis of order $2$ for every irrational $\alpha > 0$? Disproved by Konieczny. + +*Reference:* [erdosproblems.com/1147](https://www.erdosproblems.com/1147) + +[Va99] Vaughan, R.C., *The Hardy-Littlewood method*, 2nd edition, Cambridge University Press, +1997. + +[Ko16b] Konieczny, J., *Sets of recurrence as bases for the positive integers*. Acta Arithmetica +(2016), 309–338. +-/ + +open Set Filter + +namespace Erdos1147 + +/-- The distance of a real number from the nearest integer. -/ +noncomputable def distNearestInt (x : ℝ) : ℝ := + min (Int.fract x) (1 - Int.fract x) + +/-- The set $A(\alpha) = \{ n \ge 1 : \lVert \alpha n^2 \rVert < 1 / \log n \}$. -/ +noncomputable def setA (α : ℝ) : Set ℕ := + {n : ℕ | n ≥ 1 ∧ distNearestInt (α * (↑n) ^ 2) < 1 / Real.log (↑n)} + +/-- The set $A(\alpha, \varepsilon) = \{ n \ge 1 : \lVert \alpha n^2 \rVert < \varepsilon(n) \}$ +for a general threshold function $\varepsilon$. -/ +noncomputable def setAGen (α : ℝ) (ε : ℕ → ℝ) : Set ℕ := + {n : ℕ | n ≥ 1 ∧ distNearestInt (α * (↑n) ^ 2) < ε n} + +/-- +Erdős Problem 1147 [Va99, 1.21]: + +Let $\alpha > 0$ be an irrational number. Is the set +$$A = \{ n \ge 1 : \lVert \alpha n^2 \rVert < 1 / \log n \},$$ +where $\lVert \cdot \rVert$ denotes the distance to the nearest integer, an additive basis +of order $2$? + +This was disproved by Konieczny [Ko16b]. In particular, for $\alpha = \sqrt{2}$, +the set $A$ is not an additive basis of order $2$. +-/ +@[category research solved, AMS 11] +theorem erdos_1147 : answer(False) ↔ + ∀ α : ℝ, Irrational α → α > 0 → + (setA α).IsAsymptoticAddBasisOfOrder 2 := by + sorry + +/-- +Generalization of Erdős Problem 1147 [Ko16b]: + +For any function $\varepsilon(n) \to 0$, the set +$A = \{ n \ge 1 : \lVert \alpha n^2 \rVert < \varepsilon(n) \}$ is not an additive basis +of order $2$ for almost every $\alpha > 0$. +-/ +@[category research solved, AMS 11] +theorem erdos_1147_general (ε : ℕ → ℝ) (hε : Tendsto (fun n => ε n) atTop (nhds 0)) : + ∀ᵐ α : ℝ, α > 0 → ¬(setAGen α ε).IsAsymptoticAddBasisOfOrder 2 := by + sorry + +end Erdos1147 diff --git a/FormalConjectures/ErdosProblems/1149.lean b/FormalConjectures/ErdosProblems/1149.lean new file mode 100644 index 0000000000..bf23f05f06 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1149.lean @@ -0,0 +1,56 @@ +/- +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 1149 + +*Reference:* [erdosproblems.com/1149](https://www.erdosproblems.com/1149) + +[Va99] Vardi, I., *Computational Recreations in Mathematica* (1999), Problem 1.34. + +[BeRi17] Bergelson, V. and Richter, F. K., *Dynamical generalizations of the prime +number theorem and disjointness of additive and multiplicative semigroup actions* (2017). +-/ + +open Finset Filter Real Classical + +open scoped Topology + +namespace Erdos1149 + +/-- +Erdős Problem 1149 [Va99, 1.34]: + +Let $\alpha > 0$ be a real number, not an integer. The natural density of integers +$n \geq 1$ for which $\gcd(n, \lfloor n^\alpha \rfloor) = 1$ equals $6/\pi^2$. + +The constant $6/\pi^2 = 1/\zeta(2)$ is the "probability" that two random integers +are coprime, so this says $n$ and $\lfloor n^\alpha \rfloor$ behave like independent +random integers with respect to coprimality when $\alpha$ is not an integer. + +This was proved by Bergelson and Richter [BeRi17]. +-/ +@[category research solved, AMS 11] +theorem erdos_1149 (α : ℝ) (hα_pos : 0 < α) (hα_not_int : ∀ k : ℤ, (k : ℝ) ≠ α) : + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n => + Nat.Coprime n (⌊(n : ℝ) ^ α⌋₊))).card : ℝ) / (x : ℝ)) + atTop (nhds (6 / Real.pi ^ 2)) := by + sorry + +end Erdos1149 diff --git a/FormalConjectures/ErdosProblems/115.lean b/FormalConjectures/ErdosProblems/115.lean new file mode 100644 index 0000000000..d1c14102d5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/115.lean @@ -0,0 +1,70 @@ +/- +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 115 + +*Reference:* [erdosproblems.com/115](https://www.erdosproblems.com/115) + +If the lemniscate $\{z : |p(z)| \leq 1\}$ of a degree-$n$ polynomial is connected, then +$|p'(z)| \leq (1/2 + o(1)) n^2$ on it. Proved by Eremenko and Lempert. + +[Er61, Er90] Early formulations by Erdős. +[ErLe94] Eremenko, A. and Lempert, L., _An extremal problem for polynomials_. + Proc. Amer. Math. Soc. 122 (1994), 191–193. +[Po59a] Pommerenke, Ch., _On the derivative of a polynomial_. + Michigan Math. J. 6 (1959), 373–375. +-/ + +open Polynomial + +namespace Erdos115 + +/-- The lemniscate of a complex polynomial $p$: the sublevel set +$\{z \in \mathbb{C} : |p(z)| \leq 1\}$. -/ +def lemniscate (p : Polynomial ℂ) : Set ℂ := + {z : ℂ | ‖p.eval z‖ ≤ 1} + +/-- +Erdős Conjecture (Problem #115) [Er61, Er90], proved by Eremenko–Lempert [ErLe94]: + +If $p(z)$ is a monic polynomial of degree $n$ such that $\{z \in \mathbb{C} : |p(z)| \leq 1\}$ +is connected, then +$$\max \{ |p'(z)| : z \in \mathbb{C},\, |p(z)| \leq 1 \} \leq (1/2 + o(1))\, n^2.$$ + +That is, for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$, every +monic polynomial $p$ of degree $n$ whose lemniscate is connected satisfies +$|p'(z)| \leq (1/2 + \varepsilon)\, n^2$ for all $z$ in the lemniscate. + +Erdős originally conjectured the bound $n^2/2$ exactly (without the $o(1)$), but Szabados +observed that the stronger form fails. Pommerenke [Po59a] proved the weaker bound +$(e/2)\, n^2$. The monicness hypothesis is essential: without it, Chebyshev polynomials +$T_n$ provide a counterexample, since $|T_n'(1)| = n^2$ while $\{z : |T_n(z)| \leq 1\}$ +is connected. +-/ +@[category research solved, AMS 30] +theorem erdos_115 : + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + IsConnected (lemniscate p) → + ∀ z : ℂ, z ∈ lemniscate p → + ‖(derivative p).eval z‖ ≤ (1 / 2 + ε) * (n : ℝ) ^ 2 := by + sorry + +end Erdos115 diff --git a/FormalConjectures/ErdosProblems/1151.lean b/FormalConjectures/ErdosProblems/1151.lean new file mode 100644 index 0000000000..f513cb8afc --- /dev/null +++ b/FormalConjectures/ErdosProblems/1151.lean @@ -0,0 +1,90 @@ +/- +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 1151 + +*Reference:* [erdosproblems.com/1151](https://www.erdosproblems.com/1151) + +Let $\mathcal{L}^n f(x) = \sum_{i} f(a_i) \ell_i(x)$ be the Lagrange interpolation +polynomial of degree $n-1$ agreeing with $f$ at the $n$ Chebyshev nodes. + +Erdős [Er41] proved that for $x = \cos(\pi p/q)$ with $p, q$ odd, there is a continuous +$f$ with $\lim_{n \to \infty} \mathcal{L}^n f(x) = \infty$. In [Er43] he claims +(without proof) that for any closed set $A$ there exists continuous $f$ achieving $A$ +as the limit set. + +[Er41] Erdős, P., _On divergence properties of the Lagrange interpolation parabolas_. +Annals of Mathematics, Series 2 (1941), 309–315. + +[Er43] Erdős, P., _A note on Farey series_. Quarterly Journal of Mathematics, Oxford +Series (1943), 82–85. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics," Budapest, July 1999. +-/ + +open Classical Finset BigOperators Filter + +open scoped Topology + +namespace Erdos1151 + +/-- The $k$-th Chebyshev node of order $n$ (0-indexed): +$\cos((2k + 1)\pi / (2n))$ for $k = 0, \ldots, n-1$. -/ +noncomputable def chebyshevNode (n : ℕ) (k : Fin n) : ℝ := + Real.cos ((2 * (k : ℝ) + 1) * Real.pi / (2 * (n : ℝ))) + +/-- The Lagrange basis polynomial $\ell_i(x) = \prod_{j \neq i} (x - x_j)/(x_i - x_j)$. -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (i : Fin n) (x : ℝ) : ℝ := + ∏ j ∈ Finset.univ.erase i, (x - nodes j) / (nodes i - nodes j) + +/-- The Lagrange interpolation of $f$ at the given nodes, evaluated at $x$: +$L(x) = \sum_i f(x_i) \cdot \ell_i(x)$. -/ +noncomputable def lagrangeInterp {n : ℕ} (nodes : Fin n → ℝ) (f : ℝ → ℝ) (x : ℝ) : ℝ := + ∑ i : Fin n, f (nodes i) * lagrangeBasis nodes i x + +/-- +Erdős Problem 1151 [Va99, 2.41]: +For any $x \in [-1,1]$ and any closed $A \subseteq [-1,1]$, there exists a continuous +function $f$ such that $A$ is the set of cluster points of the Lagrange interpolation +polynomials $L^n f(x)$ at the Chebyshev nodes as $n \to \infty$. +-/ +@[category research open, AMS 26 41] +theorem erdos_1151 (x : ℝ) (hx : x ∈ Set.Icc (-1 : ℝ) 1) + (A : Set ℝ) (hA : IsClosed A) (hAsub : A ⊆ Set.Icc (-1 : ℝ) 1) : + ∃ f : ℝ → ℝ, Continuous f ∧ + {y | MapClusterPt y atTop (fun n => lagrangeInterp (chebyshevNode (n + 1)) f x)} = A := by + sorry + +/-- +Variant of Erdős Problem 1151 restricted to the special points from [Er41]: +For $x = \cos(\pi p / q)$ with $p, q$ odd positive integers and any closed +$A \subseteq [-1,1]$, there exists a continuous function $f$ such that $A$ is +the set of cluster points of the Lagrange interpolation polynomials at the +Chebyshev nodes. This is the more conservative reading of Erdős's claim in [Er43]. +-/ +@[category research open, AMS 26 41] +theorem erdos_1151_variant (p q : ℕ) (hp : Odd p) (hq : Odd q) (hq_pos : 0 < q) + (A : Set ℝ) (hA : IsClosed A) (hAsub : A ⊆ Set.Icc (-1 : ℝ) 1) : + let x := Real.cos (↑p * Real.pi / ↑q) + ∃ f : ℝ → ℝ, Continuous f ∧ + {y | MapClusterPt y atTop (fun n => lagrangeInterp (chebyshevNode (n + 1)) f x)} = A := by + sorry + +end Erdos1151 diff --git a/FormalConjectures/ErdosProblems/1152.lean b/FormalConjectures/ErdosProblems/1152.lean new file mode 100644 index 0000000000..ecece30c01 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1152.lean @@ -0,0 +1,71 @@ +/- +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 1152 + +*Reference:* [erdosproblems.com/1152](https://www.erdosproblems.com/1152) + +For $n \geq 1$ fix some sequence of $n$ distinct numbers +$x_{1,n}, \ldots, x_{n,n} \in [-1,1]$. Let $\varepsilon = \varepsilon(n) \to 0$. + +Does there always exist a continuous function $f : [-1,1] \to \mathbb{R}$ such that if +$p_n$ is a sequence of polynomials, with degrees $\deg p_n < (1 + \varepsilon(n))n$, such +that $p_n(x_{k,n}) = f(x_{k,n})$ for all $1 \leq k \leq n$, then $p_n(x) \not\to f(x)$ +for almost all $x \in [-1,1]$? + +Erdős, Kroó, and Szabados [EKS89] proved that if $\varepsilon > 0$ is fixed (does not +$\to 0$), then there exist sequences $x_{i,j}$ such that for any continuous function $f$, +there exists a sequence of polynomials $p_n$ with $\deg p_n < (1+\varepsilon)n$ interpolating +$f$ at $x_{k,n}$, and $p_n(x) \to f(x)$ uniformly for all $x \in [-1,1]$. + +[EKS89] Erdős, P., Kroó, A., and Szabados, J., _On convergent interpolatory polynomials_ +(1989). + +[Va99] Vértesi, P., _Classical (unweighted) and weighted interpolation_ (1999). +-/ + +open Filter Polynomial MeasureTheory Set + +namespace Erdos1152 + +/-- +Erdős Problem 1152 [Va99, 2.42]: + +For any triangular array of distinct interpolation nodes in $[-1,1]$ and any function +$\varepsilon(n) \to 0$, there exists a continuous function $f : [-1,1] \to \mathbb{R}$ +such that every sequence of polynomials $p_n$ with $\deg p_n < (1 + \varepsilon(n))n$ +interpolating $f$ at the nodes fails to converge to $f$ for almost every $x \in [-1,1]$. +-/ +@[category research open, AMS 41] +theorem erdos_1152 : answer(sorry) ↔ + ∀ (x : (n : ℕ) → Fin n → ℝ), + (∀ n, ∀ k : Fin n, x n k ∈ Icc (-1 : ℝ) 1) → + (∀ n, Function.Injective (x n)) → + ∀ (ε : ℕ → ℝ), + (∀ n, 0 < ε n) → + Tendsto ε atTop (nhds 0) → + ∃ f : ℝ → ℝ, ContinuousOn f (Icc (-1) 1) ∧ + ∀ p : ℕ → Polynomial ℝ, + (∀ n, n ≥ 1 → ((p n).natDegree : ℝ) < (1 + ε n) * n) → + (∀ n, ∀ k : Fin n, (p n).eval (x n k) = f (x n k)) → + ∀ᵐ t ∂(volume.restrict (Icc (-1 : ℝ) 1)), + ¬Tendsto (fun n => (p n).eval t) atTop (nhds (f t)) := by + sorry + +end Erdos1152 diff --git a/FormalConjectures/ErdosProblems/1153.lean b/FormalConjectures/ErdosProblems/1153.lean new file mode 100644 index 0000000000..24c3059565 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1153.lean @@ -0,0 +1,87 @@ +/- +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 1153 + +*Reference:* [erdosproblems.com/1153](https://www.erdosproblems.com/1153) + +For $x_1, \ldots, x_n \in [-1,1]$, define the Lagrange basis polynomials +$$\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i},$$ +so that $\ell_k(x_k) = 1$ and $\ell_k(x_i) = 0$ for $i \neq k$. + +Let $\lambda(x) = \sum_k |\ell_k(x)|$ (the Lebesgue function). + +Is it true that, for any fixed $-1 \leq a < b \leq 1$, +$$\max_{x \in [a,b]} \lambda(x) > \left(\frac{2}{\pi} - o(1)\right) \log n?$$ + +Bernstein [Be31] proved this for $a = -1$ and $b = 1$, and Erdős [Er61c] improved this to +$\max_{x \in [-1,1]} \lambda(x) > \frac{2}{\pi} \log n - O(1)$. +This is best possible, since taking the $x_i$ as the roots of the $n$th Chebyshev +polynomial yields $\max_{x \in [-1,1]} \lambda(x) < \frac{2}{\pi} \log n + O(1)$. + +The conjecture asks whether the same lower bound (up to $o(1)$ in the coefficient) +holds when the maximum is restricted to any subinterval $[a,b] \subseteq [-1,1]$. + +See also related problems [#1129](https://www.erdosproblems.com/1129) and +[#1132](https://www.erdosproblems.com/1132). + +[Er61c] Erdős, P., _Problems and results on the theory of interpolation. II_, + Acta Math. Acad. Sci. Hungar. (1961), 235–244. + +[Be31] Bernstein, S., _Sur la limitation des valeurs d'un polynome $P_n(x)$ de degré $n$ sur + tout un segment par ses valeurs en $(n+1)$ points du segment_, Izv. Akad. Nauk. SSSR (1931), + 1025–1050. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §2.44. +-/ + +open Finset BigOperators Set + +namespace Erdos1153 + +/-- The Lagrange basis polynomial $\ell_k(x)$ for nodes indexed by $\mathrm{Fin}\, n$. +$\ell_k(x) = \prod_{i \neq k} (x - x_i) / (x_k - x_i)$. -/ +noncomputable def lagrangeBasis {n : ℕ} (nodes : Fin n → ℝ) (k : Fin n) (x : ℝ) : ℝ := + ∏ i ∈ univ.erase k, (x - nodes i) / (nodes k - nodes i) + +/-- The Lebesgue function: $\lambda(x) = \sum_k |\ell_k(x)|$. -/ +noncomputable def lebesgueFunction {n : ℕ} (nodes : Fin n → ℝ) (x : ℝ) : ℝ := + ∑ k, |lagrangeBasis nodes k x| + +/-- +Erdős Problem 1153: + +For any fixed $-1 \leq a < b \leq 1$ and any $\varepsilon > 0$, there exists $N$ such that +for all $n \geq N$, for any choice of $n$ distinct nodes $x_1, \ldots, x_n \in [-1,1]$, +$$\max_{x \in [a,b]} \sum_k |\ell_k(x)| > \left(\frac{2}{\pi} - \varepsilon\right) \log n.$$ +-/ +@[category research solved, AMS 41] +theorem erdos_1153 : answer(True) ↔ + ∀ a b : ℝ, a < b → -1 ≤ a → b ≤ 1 → + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ nodes : Fin n → ℝ, + Function.Injective nodes → + (∀ i, nodes i ∈ Icc (-1 : ℝ) 1) → + ∃ x ∈ Icc a b, + lebesgueFunction nodes x > (2 / Real.pi - ε) * Real.log (n : ℝ) := by + sorry + +end Erdos1153 diff --git a/FormalConjectures/ErdosProblems/1154.lean b/FormalConjectures/ErdosProblems/1154.lean new file mode 100644 index 0000000000..447e1d447d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1154.lean @@ -0,0 +1,53 @@ +/- +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 1154 + +*Reference:* [erdosproblems.com/1154](https://www.erdosproblems.com/1154) + +Does there exist, for every α ∈ [0,1], a subring of ℝ with Hausdorff dimension α? + +[Er79h] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), p. 119. + +[Va99] Varga, R.S., _Scientific Computation on Mathematical Problems and Conjectures_, 1999. +-/ + +open MeasureTheory + +namespace Erdos1154 + +/-- +Erdős Problem #1154 [Er79h, p.119]: + +Does there exist, for every $\alpha \in [0,1]$, a subring of $\mathbb{R}$ with Hausdorff +dimension $\alpha$? + +Erdős and Volkmann proved the analogous result for subgroups of $\mathbb{R}$. +Falconer showed that any subring with Hausdorff dimension $\alpha \in (1/2,1)$ cannot be +Borel or Suslin. Edgar and Miller proved that any Borel or analytic subring of $\mathbb{R}$ +either has Hausdorff dimension $0$ or equals $\mathbb{R}$. Mauldin proved the result for +subfields assuming the continuum hypothesis. +-/ +@[category research open, AMS 13 28] +theorem erdos_1154 : answer(sorry) ↔ + ∀ (α : ℝ), 0 ≤ α → α ≤ 1 → + ∃ S : Subring ℝ, dimH (↑S : Set ℝ) = ENNReal.ofReal α := by + sorry + +end Erdos1154 diff --git a/FormalConjectures/ErdosProblems/1155.lean b/FormalConjectures/ErdosProblems/1155.lean new file mode 100644 index 0000000000..2ee83aeb5f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1155.lean @@ -0,0 +1,108 @@ +/- +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 1155 + +*Reference:* [erdosproblems.com/1155](https://www.erdosproblems.com/1155) + +Construct a random graph on $n$ vertices in the following way: begin with the complete graph +$K_n$. At each stage, choose uniformly a random triangle in the graph and delete all the edges +of this triangle. Repeat until the graph is triangle-free. If $f(n)$ is the number of edges +remaining, is it true that $\mathbb{E}[f(n)] \asymp n^{3/2}$ and that $f(n) \ll n^{3/2}$ +almost surely? + +A problem of Bollobás and Erdős [Bo98, p.231][Va99, 3.61]. + +Bohman, Frieze, and Lubetzky [BFL15] proved that $f(n) = n^{3/2 + o(1)}$ a.s. + +[Bo98] Bollobás, B., _Modern Graph Theory_, Graduate Texts in Mathematics 184, Springer (1998). + +[Va99] Vu, V. H. (1999), 3.61. + +[Gr97] Grable, D. A., _On random greedy triangle packing_, Electronic Journal of +Combinatorics 4 (1997), Research Paper 11. + +[BFL15] Bohman, T., Frieze, A., and Lubetzky, E., _Random triangle removal_, +Advances in Mathematics 280 (2015), 379--438. +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos1155 + +/-- The triangle removal process on $K_n$: starting from the complete graph on $n$ + vertices, repeatedly choose a uniformly random triangle and remove all three + of its edges, until the graph is triangle-free. + + `triangleRemovalExpectedEdges n` is $\mathbb{E}[f(n)]$, the expected number of edges + remaining when the process terminates. -/ +opaque triangleRemovalExpectedEdges (n : ℕ) : ℝ + +/-- The probability that the number of edges remaining after the triangle + removal process on $K_n$ satisfies a given predicate $P$. -/ +opaque triangleRemovalEdgeProb (n : ℕ) (P : ℕ → Prop) : ℝ + +/-- +Erdős Problem #1155, Part 1 [Bo98, p.231]: + +$\mathbb{E}[f(n)] \asymp n^{3/2}$, i.e., there exist constants $c_1, c_2 > 0$ such that for all +sufficiently large $n$, $c_1 \cdot n^{3/2} \leq \mathbb{E}[f(n)] \leq c_2 \cdot n^{3/2}$. +-/ +@[category research open, AMS 5 60] +theorem erdos_1155 : answer(sorry) ↔ + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + c₁ * (n : ℝ) ^ ((3 : ℝ) / 2) ≤ triangleRemovalExpectedEdges n ∧ + triangleRemovalExpectedEdges n ≤ c₂ * (n : ℝ) ^ ((3 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem #1155, Part 2 [Bo98, p.231]: + +$f(n) \ll n^{3/2}$ almost surely, i.e., there exists $C > 0$ such that with +probability tending to $1$, $f(n) \leq C \cdot n^{3/2}$. +-/ +@[category research open, AMS 5 60] +theorem erdos_1155.variants.almost_sure : answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ + Tendsto (fun n : ℕ => + triangleRemovalEdgeProb n (fun k => (k : ℝ) ≤ C * (n : ℝ) ^ ((3 : ℝ) / 2))) + atTop (nhds 1) := by + sorry + +/-- +Erdős Problem #1155, Variant (Bohman–Frieze–Lubetzky [BFL15]): + +$f(n) = n^{3/2 + o(1)}$ almost surely, i.e., for every $\varepsilon > 0$, the probability that +$n^{3/2 - \varepsilon} \leq f(n) \leq n^{3/2 + \varepsilon}$ tends to $1$ as $n \to \infty$. +This strengthens Part 2 by providing a matching almost-sure lower bound. +-/ +@[category research solved, AMS 5 60] +theorem erdos_1155.variants.bfl15 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + Tendsto (fun n : ℕ => + triangleRemovalEdgeProb n (fun k => + (n : ℝ) ^ ((3 : ℝ) / 2 - ε) ≤ (k : ℝ) ∧ + (k : ℝ) ≤ (n : ℝ) ^ ((3 : ℝ) / 2 + ε))) + atTop (nhds 1) := by + sorry + +end Erdos1155 diff --git a/FormalConjectures/ErdosProblems/1156.lean b/FormalConjectures/ErdosProblems/1156.lean new file mode 100644 index 0000000000..1a8a468e61 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1156.lean @@ -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 1156 + +*Reference:* [erdosproblems.com/1156](https://www.erdosproblems.com/1156) + +Let $G$ be a random graph on $n$ vertices, in which every edge is included +independently with probability $1/2$ (the Erdős–Rényi model $G(n, 1/2)$). + +Bollobás [Bo88] proved that $\chi(G) \sim n / (2 \log_2 n)$ with high probability. +Shamir and Spencer [ShSp87] proved concentration within $o(\sqrt{n})$. +Heckel and Riordan [HeRi23] proved concentration cannot be within $n^c$ for $c < 1/2$. + +[AlSp92] Alon, N. and Spencer, J., _The Probabilistic Method_, Wiley, 1992. + +[AlSp16] Alon, N. and Spencer, J. H., _The Probabilistic Method_, 4th ed., Wiley, 2016. + +[Bo88] Bollobás, B., _The chromatic number of random graphs_. Combinatorica (1988), 49–55. + +[He21] Heckel, A., _Non-concentration of the chromatic number of a random graph_. +J. Amer. Math. Soc. (2021), 245–260. + +[HeRi23] Heckel, A. and Riordan, O., _How does the chromatic number of a random graph vary?_ +J. Lond. Math. Soc. (2) (2023), 1769–1815. + +[Sc17] Scott, A., _On the concentration of the chromatic number of random graphs_. +arXiv:0806.0178 (2017). + +[ShSp87] Shamir, E. and Spencer, J., _Sharp concentration of the chromatic number on random +graphs $G_{n,p}$_. Combinatorica (1987), 121–129. + +[Va99] Vu, V. H. (1999), 3.64. +-/ + +open Filter + +open scoped Topology + +namespace Erdos1156 + +/-- The probability that the chromatic number of a uniformly random graph +$G(n, 1/2)$ on $n$ vertices satisfies predicate $P$. Here $G(n, 1/2)$ is the +Erdős–Rényi model where each edge is included independently with +probability $1/2$, equivalently the uniform distribution over all simple +graphs on $n$ labelled vertices. -/ +opaque chromaticNumberProb (n : ℕ) (P : ℕ → Prop) : ℝ + +/-- +Erdős Problem 1156, Part 1 [AlSp92]: + +There exists a constant $C$ such that $\chi(G(n, 1/2))$ is almost surely concentrated +on at most $C$ values. That is, for every $\varepsilon > 0$ and all sufficiently large $n$, +there is a set $S$ of at most $C$ natural numbers with +$\mathbb{P}(\chi(G) \in S) \geq 1 - \varepsilon$. +-/ +@[category research open, AMS 5 60] +theorem erdos_1156 : + ∃ C : ℕ, ∀ ε : ℝ, 0 < ε → + ∀ᶠ n in atTop, + ∃ S : Finset ℕ, S.card ≤ C ∧ + chromaticNumberProb n (· ∈ S) ≥ 1 - ε := by + sorry + +/-- +Erdős Problem 1156, Part 2 [AlSp92] [Va99]: + +There exists a function $\omega : \mathbb{N} \to \mathbb{R}$ with $\omega(n) \to \infty$ such that +for every function $f : \mathbb{N} \to \mathbb{R}$, for all sufficiently large $n$, +$$ +\mathbb{P}(|\chi(G) - f(n)| < \omega(n)) < 1/2. +$$ +That is, the chromatic number cannot be concentrated in any interval of width +$2\omega(n)$ with probability $\geq 1/2$. +-/ +@[category research open, AMS 5 60] +theorem erdos_1156.variants.anticoncentration : + ∃ ω : ℕ → ℝ, Tendsto ω atTop atTop ∧ + ∀ f : ℕ → ℝ, ∀ᶠ n in atTop, + chromaticNumberProb n (fun k => |(k : ℝ) - f n| < ω n) < 1 / 2 := by + sorry + +end Erdos1156 diff --git a/FormalConjectures/ErdosProblems/1157.lean b/FormalConjectures/ErdosProblems/1157.lean new file mode 100644 index 0000000000..c8cd332077 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1157.lean @@ -0,0 +1,87 @@ +/- +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 1157 + +*Reference:* [erdosproblems.com/1157](https://www.erdosproblems.com/1157) + +Let $r \geq 2$. Let $F$ be the family of all $r$-uniform hypergraphs with $k$ vertices +and $s$ edges. Determine $\mathrm{ex}_r(n, F)$. + +Here $\mathrm{ex}_r(n, F) = f_r(n; k, s)$, the maximum number of edges in an $r$-uniform +hypergraph on $n$ vertices such that no $k$ vertices span $s$ or more edges. + +Known lower bound (Brown, Erdős, Sós [BES73]): for all $k > r$ and $s > 1$, +$$f_r(n; k, s) \gg n^{(rs-k)/(s-1)}.$$ + +The general conjecture of Brown, Erdős, and Sós is that, for all $r > t \geq 2$ +and $s \geq 3$, +$$f_r(n; k, s) = o(n^t)$$ +whenever $k \geq (r - t)s + t + 1$. + +The case $t = 2$ is problem [1178]. The case $r = 3$, $k = 6$, $s = 3$ is problem [716] +(proved by Ruzsa–Szemerédi). The case $r = 3$ and $k = s + 2$ is problem [1076]. + +[BES73] Brown, W.G., Erdős, P., and Sós, V.T., _Some extremal problems on r-graphs_. +New Directions in the Theory of Graphs (1973), 53–63. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §3.64. +-/ + +open Finset + +namespace Erdos1157 + +/-- An $r$-uniform hypergraph on $n$ vertices: a family of $r$-element subsets of +$\operatorname{Fin}(n)$. -/ +structure UniformHypergraph (r n : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = r + +/-- The number of edges of $H$ spanned by a set $S$ of vertices. -/ +def edgesSpannedBy {r n : ℕ} (H : UniformHypergraph r n) (S : Finset (Fin n)) : ℕ := + (H.edges.filter (· ⊆ S)).card + +/-- $H$ is $(k,s)$-free if no set of $k$ vertices spans $s$ or more edges. -/ +def IsFree {r n : ℕ} (H : UniformHypergraph r n) (k s : ℕ) : Prop := + ∀ S : Finset (Fin n), S.card = k → edgesSpannedBy H S < s + +/-- $f_r(n; k, s)$: the maximum number of edges in an $r$-uniform $(k,s)$-free +hypergraph on $n$ vertices. -/ +noncomputable def extremalNumber (r n k s : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : UniformHypergraph r n, IsFree H k s ∧ H.edges.card = m} + +/-- +Erdős Problem #1157 — Brown–Erdős–Sós Conjecture (general form) [BES73, Va99]: + +For all $r > t \geq 2$, $s \geq 3$, and $k \geq (r - t) \cdot s + t + 1$, we have +$$f_r(n; k, s) = o(n^t),$$ +i.e., for every $\varepsilon > 0$, for all sufficiently large $n$, +$$f_r(n; k, s) \leq \varepsilon \cdot n^t.$$ +-/ +@[category research open, AMS 5] +theorem erdos_1157 (r t : ℕ) (hr : r > t) (ht : t ≥ 2) + (s : ℕ) (hs : s ≥ 3) (k : ℕ) (hk : k ≥ (r - t) * s + t + 1) : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (extremalNumber r n k s : ℝ) ≤ ε * (n : ℝ) ^ t := by + sorry + +end Erdos1157 diff --git a/FormalConjectures/ErdosProblems/1158.lean b/FormalConjectures/ErdosProblems/1158.lean new file mode 100644 index 0000000000..24b4260cda --- /dev/null +++ b/FormalConjectures/ErdosProblems/1158.lean @@ -0,0 +1,75 @@ +/- +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 1158 + +Erdős asks whether the extremal number for complete $t$-partite $t$-uniform hypergraphs satisfies +$\mathrm{ex}_t(n, K_t(r)) \geq n^{t - r^{1-t} - o(1)}$. + +*Reference:* [erdosproblems.com/1158](https://www.erdosproblems.com/1158) + +[Er64f] Erdős, P., _On extremal problems of graphs and generalized graphs_. Israel J. Math. 2 +(1964), 183-190. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §3.65. +-/ + +namespace Erdos1158 + +/-- A $t$-uniform hypergraph on $\operatorname{Fin}(n)$: every edge has exactly $t$ vertices. -/ +def IsUniformHypergraph (t : ℕ) {n : ℕ} (E : Finset (Finset (Fin n))) : Prop := + ∀ e ∈ E, e.card = t + +/-- A $t$-uniform hypergraph $E$ on $\operatorname{Fin}(n)$ contains a copy of the complete +$t$-partite $t$-uniform hypergraph $K_t(r)$ if there exist $t$ pairwise disjoint vertex classes, +each of size $r$, such that every transversal forms an edge of $E$. -/ +def HasKtrCopy (t r : ℕ) {n : ℕ} (E : Finset (Finset (Fin n))) : Prop := + ∃ classes : Fin t → Finset (Fin n), + (∀ i, (classes i).card = r) ∧ + (∀ i j, i ≠ j → Disjoint (classes i) (classes j)) ∧ + (∀ f : Fin t → Fin n, (∀ i, f i ∈ classes i) → + Finset.image f Finset.univ ∈ E) + +/-- +**Erdős Problem 1158** [Va99, 3.65]: + +Let $K_t(r)$ be the complete $t$-partite $t$-uniform hypergraph with $r$ vertices in +each class. Is it true that $\mathrm{ex}_t(n, K_t(r)) \geq n^{t - r^{1-t} - o(1)}$ for all $t, r$? + +Erdős [Er64f] proved that +$n^{t - O(r^{1-t})} \leq \mathrm{ex}_t(n, K_t(r)) \ll n^{t - r^{1-t}}$. +This is only known when $t = 2$ and $2 \leq r \leq 3$. The case $t = 2$ is problem \#714. + +Formally: for all $t \geq 2$, $r \geq 2$, and $\varepsilon > 0$, for sufficiently large $n$, +there exists a $t$-uniform hypergraph on $n$ vertices with no $K_t(r)$ copy and at least +$n^{t - r^{1-t} - \varepsilon}$ edges. +-/ +@[category research open, AMS 5] +theorem erdos_1158 : answer(sorry) ↔ + ∀ (t r : ℕ), 2 ≤ t → 2 ≤ r → + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ E : Finset (Finset (Fin n)), + IsUniformHypergraph t E ∧ + ¬HasKtrCopy t r E ∧ + (E.card : ℝ) ≥ (n : ℝ) ^ ((t : ℝ) - (r : ℝ) ^ (1 - (t : ℝ)) - ε) := by + sorry + +end Erdos1158 diff --git a/FormalConjectures/ErdosProblems/1159.lean b/FormalConjectures/ErdosProblems/1159.lean new file mode 100644 index 0000000000..00ac6b542b --- /dev/null +++ b/FormalConjectures/ErdosProblems/1159.lean @@ -0,0 +1,78 @@ +/- +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 1159 + +*Reference:* [erdosproblems.com/1159](https://www.erdosproblems.com/1159) + +Determine whether there exists a constant $C > 1$ such that every finite projective plane +has a blocking set where no line is hit more than $C$ times. A blocking set is a set of +points that meets every line. + +Erdős [Er81] posed the stronger question for all pairwise balanced block designs, not just +projective planes. See also Problem #664 for a related (stronger) variant. + +Erdős, Silverman, and Stein [ESS83] proved this is true with +$|S \cap \ell| \ll \log n$ for all lines $\ell$ (where $n$ is the order of the projective +plane). + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[ESS83] Erdős, P., Silverman, R., Stein, A., _Intersection properties of families +containing sets of nearly the same size_, Ars Combinatoria (1983), 247–259. + +[Va99] Vardy, A. +-/ + +open Configuration Classical Finset + +namespace Erdos1159 + +/-- +Erdős Problem 1159 [Va99, 4.70]: + +Does there exist an absolute constant $C > 1$ such that every finite projective plane +has a set of points $S$ meeting every line in at least $1$ and at most $C$ points? +-/ +@[category research open, AMS 5 51] +theorem erdos_1159 : answer(sorry) ↔ + ∃ C : ℕ, 1 < C ∧ + ∀ (P L : Type) [Membership P L] [Fintype P] [Fintype L] + [Configuration.ProjectivePlane P L], + ∃ S : Finset P, + ∀ l : L, 1 ≤ (S.filter (fun p => p ∈ l)).card ∧ + (S.filter (fun p => p ∈ l)).card ≤ C := by + sorry + +/-- +Erdős–Silverman–Stein [ESS83] proved that every finite projective plane of order $n$ has a +blocking set $S$ such that $|S \cap \ell| \ll \log n$ for all lines $\ell$. +-/ +@[category research solved, AMS 5 51] +theorem erdos_1159_ess_log_bound : + ∃ C : ℝ, 0 < C ∧ + ∀ (P L : Type) [Membership P L] [Fintype P] [Fintype L] + (pp : Configuration.ProjectivePlane P L), + ∃ S : Finset P, + ∀ l : L, 1 ≤ (S.filter (fun p => p ∈ l)).card ∧ + (S.filter (fun p => p ∈ l)).card ≤ ⌈C * Real.log pp.order⌉₊ := by + sorry + +end Erdos1159 diff --git a/FormalConjectures/ErdosProblems/116.lean b/FormalConjectures/ErdosProblems/116.lean new file mode 100644 index 0000000000..0f129d36bd --- /dev/null +++ b/FormalConjectures/ErdosProblems/116.lean @@ -0,0 +1,108 @@ +/- +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 116 + +*Reference:* [erdosproblems.com/116](https://www.erdosproblems.com/116) + +Erdős–Herzog–Piranian conjecture (proved): if all roots of a degree-$n$ polynomial lie in the +unit disk, the area of $\{z : |p(z)| < 1\}$ is at least $n^{-O(1)}$. Settled by Krishnapur, +Lundberg, and Ramachandran. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, J. Analyse +Math. 6 (1958), 125–148. + +[Er61] Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[Po61] Pommerenke, Ch., *On metric properties of complex polynomials*, Michigan Math. J. 8 (1961), +97–115. + +[Po28] Pólya, G., *Beitrag zur Verallgemeinerung des Verzerrungssatzes auf mehrfach +zusammenhängende Gebiete*, S.-B. Preuss. Akad. Wiss. (1928), 228–232, 280–282. + +[Wa88] Wagner, G., *On the area of lemniscate domains*, J. Analyse Math. 50 (1988), 159–167. + +[KLR25] Krishnapur, M., Lundberg, E., and Ramachandran, K., *On the area of polynomial +lemniscates*, arXiv:2503.18270, 2025. +-/ + +open scoped ENNReal + +open Polynomial MeasureTheory + +namespace Erdos116 + +/-- The lemniscate interior of a complex polynomial $p$: + the open sublevel set $\{z \in \mathbb{C} : |p(z)| < 1\}$. -/ +def lemniscateInterior (p : Polynomial ℂ) : Set ℂ := + {z : ℂ | ‖p.eval z‖ < 1} + +/-- +Erdős–Herzog–Piranian Conjecture (Problem #116) [EHP58, Er61]: + +Let $p(z) = \prod_i (z - z_i)$ be a polynomial of degree $n \ge 1$ with all roots $z_i$ +in the closed unit disk ($|z_i| \le 1$). Then the 2D Lebesgue measure (area) of +the lemniscate interior $\{z \in \mathbb{C} : |p(z)| < 1\}$ satisfies +$$ + |\{z : |p(z)| < 1\}| \gg n^{-O(1)}. +$$ + +That is, there exist universal constants $\kappa > 0$ and $\delta > 0$ such that for all $n \ge 1$ +and all such polynomials, the area is at least $\delta \cdot n^{-\kappa}$. + +The lower bound $\gg n^{-4}$ follows from a result of Pommerenke [Po61]. +The stronger lower bound $\gg (\log n)^{-1}$ was proved by Krishnapur, Lundberg, +and Ramachandran [KLR25], which in particular settles this conjecture. + +Pólya [Po28] showed the area is always at most $\pi$, with equality only when all +roots are equal. Wagner [Wa88] showed the existence of polynomials with measure +$\ll_\varepsilon (\log \log n)^{-1/2+\varepsilon}$, providing a near-tight upper bound. +-/ +@[category research solved, AMS 28 30] +theorem erdos_116 : answer(True) ↔ + ∃ (κ δ : ℝ), 0 < δ ∧ 0 < κ ∧ + ∀ (n : ℕ), 1 ≤ n → + ∀ (roots : Fin n → ℂ), (∀ i, ‖roots i‖ ≤ 1) → + ENNReal.ofReal (δ * (n : ℝ) ^ (-κ)) ≤ + volume (lemniscateInterior (∏ i : Fin n, (X - C (roots i)))) := by + sorry + +/-- +Stronger logarithmic lower bound for the lemniscate area (Problem #116) [KLR25]: + +Krishnapur, Lundberg, and Ramachandran proved that the area of the lemniscate interior +$\{z : |p(z)| < 1\}$ of a degree-$n$ monic polynomial with roots in the unit disk satisfies +$$ + |\{z : |p(z)| < 1\}| \gg (\log n)^{-\gamma} +$$ +for some universal constant $\gamma > 0$. In fact, they show $\gamma = 1$ suffices. +This is strictly stronger than the polynomial bound `erdos_116` and captures +the main result of [KLR25]. +-/ +@[category research solved, AMS 28 30] +theorem erdos_116_log_lower_bound : + ∃ (γ δ : ℝ), 0 < δ ∧ 0 < γ ∧ + ∀ (n : ℕ), 2 ≤ n → + ∀ (roots : Fin n → ℂ), (∀ i, ‖roots i‖ ≤ 1) → + ENNReal.ofReal (δ * (Real.log n) ^ (-γ)) ≤ + volume (lemniscateInterior (∏ i : Fin n, (X - C (roots i)))) := by + sorry + +end Erdos116 diff --git a/FormalConjectures/ErdosProblems/1160.lean b/FormalConjectures/ErdosProblems/1160.lean new file mode 100644 index 0000000000..156b46ba3d --- /dev/null +++ b/FormalConjectures/ErdosProblems/1160.lean @@ -0,0 +1,88 @@ +/- +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 1160 + +*Reference:* [erdosproblems.com/1160](https://www.erdosproblems.com/1160) + +If $g(n)$ denotes the number of groups of order $n$, then $g(n) \le g(2^m)$ for all $n \le 2^m$. + +[Va99] Vaughan, R.C., _Problems in combinatorial number theory_, 1999. + +[BNV07] Blackburn, S.R., Neumann, P.M. and Venkataraman, G., _Enumeration of finite groups_, +Cambridge Tracts in Mathematics, 2007, xii+281 pp. + +[Pa03] Pantelidakis, I., _On the Number of Non-isomorphic Groups of the Same Order_, +DPhil Thesis, University of Oxford, 2003. +-/ + +open Classical + +namespace Erdos1160 + +/-- Two group structures on the same type are isomorphic if there exists +a multiplicative equivalence between them. -/ +def GroupStructIso (n : ℕ) (G₁ G₂ : Group (Fin n)) : Prop := + Nonempty (@MulEquiv (Fin n) (Fin n) G₁.toMul G₂.toMul) + +/-- Group isomorphism is an equivalence relation on group structures on $\operatorname{Fin}(n)$. -/ +instance groupStructSetoid (n : ℕ) : Setoid (Group (Fin n)) where + r := GroupStructIso n + iseqv := by + refine ⟨?_, ?_, ?_⟩ + · intro G + exact ⟨@MulEquiv.refl (Fin n) G.toMul⟩ + · intro G₁ G₂ ⟨e⟩ + exact ⟨@MulEquiv.symm (Fin n) (Fin n) G₁.toMul G₂.toMul e⟩ + · intro G₁ G₂ G₃ ⟨e₁⟩ ⟨e₂⟩ + exact ⟨@MulEquiv.trans (Fin n) (Fin n) (Fin n) G₁.toMul G₂.toMul G₃.toMul e₁ e₂⟩ + +/-- The number of isomorphism classes of groups of order $n$ (OEIS A000001). +Defined as the cardinality of group structures on $\operatorname{Fin}(n)$ modulo isomorphism. -/ +noncomputable def numGroupsOfOrder (n : ℕ) : ℕ := + Nat.card (Quotient (groupStructSetoid n)) + +/-- +Erdős Problem 1160 [Va99, 5.71]: + +Let $g(n)$ denote the number of groups of order $n$. If $n \le 2^m$ then $g(n) \le g(2^m)$. + +This conjecture states that among all $n \le 2^m$, the value $g(n)$ is maximized +at $n = 2^m$ (i.e., powers of 2 have the most groups of any order up to that +point). Listed as Question 22.16 in [BNV07], attributed to Erdős and Higman. +-/ +@[category research open, AMS 20] +theorem erdos_1160 (n m : ℕ) (h : n ≤ 2 ^ m) : + numGroupsOfOrder n ≤ numGroupsOfOrder (2 ^ m) := by + sorry + +/-- +A stronger variant of Erdős Problem 1160, listed as Question 22.18 in [BNV07]: + +The sum $\sum_{n < 2^m} g(n) \le g(2^m)$ for all sufficiently large $m$ (perhaps $m \ge 7$). + +This asserts that $g(2^m)$ dominates not just each individual $g(n)$ for $n \le 2^m$, +but the entire sum of all $g(n)$ for $n < 2^m$. +-/ +@[category research open, AMS 20] +theorem erdos_1160_sum_variant (m : ℕ) : + ∑ n ∈ Finset.range (2 ^ m), numGroupsOfOrder n ≤ numGroupsOfOrder (2 ^ m) := by + sorry + +end Erdos1160 diff --git a/FormalConjectures/ErdosProblems/1161.lean b/FormalConjectures/ErdosProblems/1161.lean new file mode 100644 index 0000000000..325a97829e --- /dev/null +++ b/FormalConjectures/ErdosProblems/1161.lean @@ -0,0 +1,88 @@ +/- +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 1161 + +*Reference:* [Va99, 5.72], [erdosproblems.com/1161](https://www.erdosproblems.com/1161) + +Let $f_k(n)$ count the number of elements of $S_n$ (the symmetric group) of +order $k$. For which values of $k$ will $f_k(n)$ be maximal? + +Beker [Be25d] proved that +$$\max_{k \geq 1} f_k(n) \sim (n-1)!,$$ +and characterized the maximizing values of $k$: for all large $n$, +$f_k(n) = (n-1)!$ if and only if $k \geq 1$ is minimal such that +$\operatorname{lcm}(1,\ldots,n-k) \mid k$. + +[Va99] Vardi, I., *Computational Recreations in Mathematica* (1999). +[Be25d] Beker, A., _The most probable order of a random permutation_. arXiv:2510.11698 (2025). +-/ + +open Finset Equiv + +namespace Erdos1161 + +/-- $f_k(n)$: the number of permutations in $S_n$ whose order equals $k$. -/ +noncomputable def countPermsOfOrder (n k : ℕ) : ℕ := + ((Finset.univ : Finset (Equiv.Perm (Fin n))).filter (fun σ => orderOf σ = k)).card + +/-- +Erdős Problem 1161 — asymptotic magnitude (Solved by Beker [Be25d]): + +Let $f_k(n)$ count the number of elements of $S_n$ of order $k$. Beker proved that +$\max_{k \geq 1} f_k(n) \sim (n-1)!$, i.e., the maximum over $k$ of the number of +permutations of order $k$ is asymptotic to $(n-1)!$. + +This formalizes only the asymptotic magnitude result. The characterization of which +values of $k$ achieve the maximum is formalized separately in `erdos_1161_characterization`. + +Formalized as: for every $\varepsilon > 0$, for all sufficiently large $n$, +(1) there exists $k \geq 1$ with $f_k(n) \geq (1 - \varepsilon) \cdot (n-1)!$, and +(2) for all $k$, $f_k(n) \leq (1 + \varepsilon) \cdot (n-1)!$. +-/ +@[category research solved, AMS 5 20] +theorem erdos_1161 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (∃ k : ℕ, k ≥ 1 ∧ + (countPermsOfOrder n k : ℝ) ≥ (1 - ε) * ((n - 1).factorial : ℝ)) ∧ + (∀ k : ℕ, + (countPermsOfOrder n k : ℝ) ≤ (1 + ε) * ((n - 1).factorial : ℝ)) := by + sorry + +/-- +Erdős Problem 1161 — characterization of maximizing $k$ (Solved by Beker [Be25d]): + +Beker proved that for all sufficiently large $n$, $f_k(n) = (n-1)!$ if and only if +$k \geq 1$ is the minimal value such that $\operatorname{lcm}(1, \ldots, n-k) \mid k$. + +This complements `erdos_1161` which establishes the asymptotic magnitude +$\max_{k \geq 1} f_k(n) \sim (n-1)!$. +-/ +@[category research solved, AMS 5 20] +theorem erdos_1161_characterization : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ∀ k : ℕ, + (countPermsOfOrder n k = (n - 1).factorial) ↔ + (k ≥ 1 ∧ + (Finset.lcm (Finset.range (n - k)) (· + 1)) ∣ k ∧ + ∀ j : ℕ, j ≥ 1 → j < k → + ¬((Finset.lcm (Finset.range (n - j)) (· + 1)) ∣ j)) := by + sorry + +end Erdos1161 diff --git a/FormalConjectures/ErdosProblems/1162.lean b/FormalConjectures/ErdosProblems/1162.lean new file mode 100644 index 0000000000..8b11eea117 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1162.lean @@ -0,0 +1,63 @@ +/- +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 1162 + +*Reference:* [erdosproblems.com/1162](https://www.erdosproblems.com/1162) + +Give an asymptotic formula for the number of subgroups of $S_n$. +Is there a statistical theorem on their order? + +A problem of Erdős and Turán [Va99, 5.73]. + +Let $f(n)$ count the number of subgroups of $S_n$. +Pyber [Py93] proved that $\log f(n) \asymp n^2$. +Roney-Dougal and Tracey [RoTr25] proved that $\log f(n) = (\tfrac{1}{16} + o(1))n^2$. + +See also Erdős Problem 1163 for a formalization of the "statistical theorem on subgroup orders" aspect. + +[Va99] Vardi, I., *Computational Recreations in Mathematica* (1999). +[Py93] Pyber, L., _Asymptotic results for permutation groups_ (1993), 197–219. +[RoTr25] Roney-Dougal, C., Tracey, G., _Subgroups of symmetric groups: enumeration and asymptotic properties_. arXiv:2503.05416 (2025). +-/ + +open Filter Real + +namespace Erdos1162 + +/-- The number of subgroups of the symmetric group $S_n$. -/ +noncomputable def numSubgroups (n : ℕ) : ℕ := + Nat.card (Subgroup (Equiv.Perm (Fin n))) + +/-- +Erdős Problem 1162 (partially resolved by Roney-Dougal and Tracey [RoTr25]): + +$\log_2 f(n) / n^2 \to \tfrac{1}{16}$ as $n \to \infty$, where $f(n)$ is the number of +subgroups of $S_n$. Equivalently, $\ln f(n) / n^2 \to (\ln 2)/16$. + +The full problem, asking for an asymptotic formula for $f(n)$ and a statistical +theorem on the orders of subgroups, remains open. +-/ +@[category research solved, AMS 20] +theorem erdos_1162 : + Tendsto (fun n : ℕ => Real.log (numSubgroups n : ℝ) / ((n : ℝ) ^ 2)) + atTop (nhds (Real.log 2 / 16)) := by + sorry + +end Erdos1162 diff --git a/FormalConjectures/ErdosProblems/1163.lean b/FormalConjectures/ErdosProblems/1163.lean new file mode 100644 index 0000000000..28ef2a92c2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1163.lean @@ -0,0 +1,60 @@ +/- +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 1163 + +*Reference:* [erdosproblems.com/1163](https://www.erdosproblems.com/1163) + +Describe (by statistical means) the arithmetic structure of the orders of +subgroups of $S_n$. A concrete interpretation: the proportion of divisors of +$n!$ that are orders of subgroups of $S_n$ tends to $0$ as $n \to \infty$. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the +conference "Paul Erdős and his mathematics", Budapest (1999). +-/ + +open Equiv Classical + +namespace Erdos1163 + +/-- A natural number $m$ is a subgroup order of $S_n$ if there exists a subgroup +of the symmetric group `Perm (Fin n)` with exactly $m$ elements. -/ +def IsSubgroupOrderOfSn (n m : ℕ) : Prop := + ∃ H : Subgroup (Perm (Fin n)), Nat.card H = m + +/-- +Erdős Problem 1163 (Erdős and Turán) [Va99, 5.74]: +Describe (by statistical means) the arithmetic structure of the orders of +subgroups of $S_n$. + +The original problem is acknowledged as ambiguous. A concrete +interpretation: as $n \to \infty$, the proportion of divisors of $n!$ that are orders +of subgroups of $S_n$ tends to $0$. By Lagrange's theorem, every subgroup order +divides $n!$, but the set of subgroup orders becomes a vanishingly small +fraction of all divisors. +-/ +@[category research open, AMS 5 20] +theorem erdos_1163 : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n ≥ N, + ((n.factorial.divisors.filter (fun m => IsSubgroupOrderOfSn n m)).card : ℝ) < + ε * (n.factorial.divisors.card : ℝ) := by + sorry + +end Erdos1163 diff --git a/FormalConjectures/ErdosProblems/1164.lean b/FormalConjectures/ErdosProblems/1164.lean new file mode 100644 index 0000000000..123f87a0de --- /dev/null +++ b/FormalConjectures/ErdosProblems/1164.lean @@ -0,0 +1,107 @@ +/- +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 1164 + +*Reference:* [erdosproblems.com/1164](https://www.erdosproblems.com/1164) + +Let $S_n$ denote a simple random walk on $\mathbb{Z}^2$ starting at the origin, and let $R_n$ +be the largest integer such that the walk visits every lattice point within distance $R_n$ of the +origin in its first $n$ steps. Is it true that $\log R_n \asymp \sqrt{\log n}$ almost surely? + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §6.76. + +[Re90] Révész, P., _Random walk in random and nonrandom environments_, World Scientific, 1990. + +[DPRZ04] Dembo, A., Peres, Y., Rosen, J. and Zeitouni, O., _Cover times for Brownian motion +and random walks in two dimensions_, Annals of Mathematics **160** (2004), 433–464. +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators + +namespace Erdos1164 + +variable {Ω : Type*} [MeasurableSpace Ω] + +/-- A step distribution for a simple random walk on $\mathbb{Z}^2$: the random variable takes +values in $\{(1,0), (-1,0), (0,1), (0,-1)\}$ each with equal probability. -/ +def IsUniformStep (μ : Measure Ω) (X : Ω → ℤ × ℤ) : Prop := + (∀ ω, X ω ∈ ({((1 : ℤ), 0), (-1, 0), (0, 1), (0, -1)} : Set (ℤ × ℤ))) ∧ + μ {ω | X ω = (1, 0)} = μ {ω | X ω = (-1, 0)} ∧ + μ {ω | X ω = (-1, 0)} = μ {ω | X ω = (0, 1)} ∧ + μ {ω | X ω = (0, 1)} = μ {ω | X ω = (0, -1)} + +/-- Position of the random walk at time $n$: $S_n = X_0 + X_1 + \cdots + X_{n-1}$, +starting at the origin $S_0 = (0, 0)$. -/ +def walkPosition (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : ℤ × ℤ := + ∑ i ∈ Finset.range n, X i ω + +/-- The covering radius $R_n(\omega)$: the largest $R \in \mathbb{N}$ such that every lattice +point $(a, b) \in \mathbb{Z}^2$ with $a^2 + b^2 \le R^2$ is visited by the walk within its +first $n$ steps. -/ +noncomputable def coveringRadius (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : ℕ := + sSup {R : ℕ | ∀ (a b : ℤ), a ^ 2 + b ^ 2 ≤ ↑R ^ 2 → + ∃ k, k ≤ n ∧ walkPosition X ω k = (a, b)} + +/-- +Erdős Problem 1164 (Erdős–Taylor) [Va99, 6.76]: + +Let $R_n$ be the maximal integer such that almost every random walk from the origin +in $\mathbb{Z}^2$ visits every $x \in \mathbb{Z}^2$ with $\|x\| \le R_n$ in at most $n$ steps. +Is it true that $\log R_n \asymp \sqrt{\log n}$? + +That is, there exist constants $c_1, c_2 > 0$ such that almost surely, for all +sufficiently large $n$: +$$c_1 \cdot \sqrt{\log n} \le \log R_n \le c_2 \cdot \sqrt{\log n}.$$ + +Proved independently by Révész [Re90] and Kesten. The stronger conjecture +$$\lim P((\log R_n)^2 / \log n \le x) = e^{-4x} \quad \text{for all } x > 0$$ +was proved by Dembo, Peres, Rosen, and Zeitouni [DPRZ04]. +-/ +@[category research solved, AMS 60] +theorem erdos_1164 : answer(True) ↔ + ∀ (Ω : Type*) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (X : ℕ → Ω → ℤ × ℤ), + (∀ i, IsUniformStep μ (X i)) → iIndepFun X μ → + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∀ᵐ ω ∂μ, ∀ᶠ (n : ℕ) in atTop, + c₁ * Real.sqrt (Real.log (n : ℝ)) ≤ Real.log (coveringRadius X ω n : ℝ) ∧ + Real.log (coveringRadius X ω n : ℝ) ≤ c₂ * Real.sqrt (Real.log (n : ℝ)) := by + sorry + +/-- +Erdős Problem 1164 — Stronger distributional result [DPRZ04]: + +Dembo, Peres, Rosen, and Zeitouni proved the stronger conjecture that +$$\lim_{n \to \infty} \mathbb{P}\left(\frac{(\log R_n)^2}{\log n} \le x\right) = e^{-4x}$$ +for all $x > 0$. This subsumes the original asymptotic statement `erdos_1164`. +-/ +@[category research solved, AMS 60] +theorem erdos_1164_strong : + ∀ (Ω : Type*) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (X : ℕ → Ω → ℤ × ℤ), + (∀ i, IsUniformStep μ (X i)) → iIndepFun X μ → + ∀ x : ℝ, 0 < x → + Filter.Tendsto (fun n : ℕ => + (μ {ω | (Real.log (coveringRadius X ω n : ℝ)) ^ 2 / Real.log (n : ℝ) ≤ x}).toReal) + Filter.atTop (nhds (Real.exp (-4 * x))) := by + sorry + +end Erdos1164 diff --git a/FormalConjectures/ErdosProblems/1165.lean b/FormalConjectures/ErdosProblems/1165.lean new file mode 100644 index 0000000000..676d6a1fbb --- /dev/null +++ b/FormalConjectures/ErdosProblems/1165.lean @@ -0,0 +1,102 @@ +/- +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 1165 + +*Reference:* [erdosproblems.com/1165](https://www.erdosproblems.com/1165) + +Given a random walk on $\mathbb{Z}^2$, the *favourite sites* $F(n)$ are those visited the +maximum number of times up to step $n$. Tóth proved that $|F(n)| = r$ occurs only finitely +often almost surely for every $r \ge 4$, and Hao–Li–Okada–Zheng proved that $|F(n)| = 3$ +occurs infinitely often almost surely. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §6.77. + +[To01] Tóth, B., _No more than three favorite sites for simple random walk_. +Ann. Probab. (2001), 484–503. + +[HLOZ24] Hao, C., Li, X., Okada, I., Zheng, Y., _Favorite sites for simple random walk +in two and more dimensions_. arXiv:2409.00995 (2024). +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators + +namespace Erdos1165 + +variable {Ω : Type*} [MeasurableSpace Ω] + +/-- A step distribution for a simple random walk on $\mathbb{Z}^2$: the random variable takes +values in $\{(1,0), (-1,0), (0,1), (0,-1)\}$ each with equal probability. -/ +def IsUniformStep (μ : Measure Ω) (X : Ω → ℤ × ℤ) : Prop := + (∀ ω, X ω ∈ ({((1 : ℤ), 0), (-1, 0), (0, 1), (0, -1)} : Set (ℤ × ℤ))) ∧ + μ {ω | X ω = (1, 0)} = μ {ω | X ω = (-1, 0)} ∧ + μ {ω | X ω = (-1, 0)} = μ {ω | X ω = (0, 1)} ∧ + μ {ω | X ω = (0, 1)} = μ {ω | X ω = (0, -1)} + +/-- Position of the random walk at time $n$: $S_n = X_0 + X_1 + \cdots + X_{n-1}$, +starting at the origin $S_0 = (0, 0)$. -/ +def walkPosition (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : ℤ × ℤ := + ∑ i ∈ Finset.range n, X i ω + +/-- The local time (visit count) at site $x$ up to time $n$: +$f_n(x) = |\{k : 0 \le k \le n \mid S_k = x\}|$. -/ +def localTime (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) (x : ℤ × ℤ) : ℕ := + ((Finset.range (n + 1)).filter (fun k => walkPosition X ω k = x)).card + +/-- The set of sites visited by the walk up to time $n$. -/ +def visitedSites (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : Finset (ℤ × ℤ) := + (Finset.range (n + 1)).image (fun k => walkPosition X ω k) + +/-- The maximum local time at time $n$: +$\max_y f_n(y)$, the maximum number of visits to any single site. -/ +def maxLocalTime (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : ℕ := + (visitedSites X ω n).sup (localTime X ω n) + +/-- The set of favourite sites at time $n$: +$F(n) = \{x \in \text{visited sites} : f_n(x) = \max_y f_n(y)\}$. -/ +def favouriteSites (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : Finset (ℤ × ℤ) := + (visitedSites X ω n).filter (fun x => localTime X ω n x = maxLocalTime X ω n) + +/-- +Erdős Problem 1165 (Erdős–Révész) [Va99, 6.77]: + +Given a random walk $s_0, s_1, \ldots$ in $\mathbb{Z}^2$, starting at the origin, let $f_n(x)$ +count the number of $0 \le k \le n$ such that $s_k = x$. Let +$F(n) = \{x : f_n(x) = \max_y f_n(y)\}$ be the set of 'favourite sites'. + +Tóth [To01] proved that $|F(n)| = r$ occurs only finitely often almost surely for all $r \ge 4$. +Hao, Li, Okada, and Zheng [HLOZ24] proved that $|F(n)| = 3$ occurs infinitely often almost surely. +-/ +@[category research solved, AMS 60] +theorem erdos_1165 + {μ : Measure Ω} [IsProbabilityMeasure μ] + {X : ℕ → Ω → ℤ × ℤ} + (hStep : ∀ i, IsUniformStep μ (X i)) + (hIndep : iIndepFun X μ) : + -- Part 1: |F(n)| = 3 infinitely often, almost surely + (∀ᵐ ω ∂μ, ∃ᶠ (n : ℕ) in atTop, + (favouriteSites X ω n).card = 3) ∧ + -- Part 2: |F(n)| = r for r ≥ 4 happens only finitely often, almost surely + (∀ r : ℕ, r ≥ 4 → + ∀ᵐ ω ∂μ, ¬∃ᶠ (n : ℕ) in atTop, + (favouriteSites X ω n).card = r) := by + sorry + +end Erdos1165 diff --git a/FormalConjectures/ErdosProblems/1166.lean b/FormalConjectures/ErdosProblems/1166.lean new file mode 100644 index 0000000000..06862fa5de --- /dev/null +++ b/FormalConjectures/ErdosProblems/1166.lean @@ -0,0 +1,105 @@ +/- +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 1166 + +*Reference:* [erdosproblems.com/1166](https://www.erdosproblems.com/1166) + +For a simple random walk on $\mathbb{Z}^2$, a *favourite site* at time $k$ is a site with the +maximum number of visits up to time $k$. The problem asks whether the cumulative number of +distinct favourite sites $\left|\bigcup_{k \le n} F(k)\right|$ is bounded by a power of $\log n$ +almost surely, for all but finitely many $n$. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §6.78. + +[ErTa60] Erdős, P. and Taylor, S. J., *Some problems concerning the structure of random walk +paths*, Acta Math. Acad. Sci. Hungar. 11, 137–162, 1960. +-/ + +open MeasureTheory ProbabilityTheory Filter Finset + +open scoped BigOperators + +namespace Erdos1166 + +variable {Ω : Type*} [MeasurableSpace Ω] + +/-- A step distribution for a simple random walk on $\mathbb{Z}^2$: the random variable takes + values in $\{(1,0), (-1,0), (0,1), (0,-1)\}$ each with equal probability. -/ +def IsUniformStep (μ : Measure Ω) (X : Ω → ℤ × ℤ) : Prop := + (∀ ω, X ω ∈ ({((1 : ℤ), 0), (-1, 0), (0, 1), (0, -1)} : Set (ℤ × ℤ))) ∧ + μ {ω | X ω = (1, 0)} = μ {ω | X ω = (-1, 0)} ∧ + μ {ω | X ω = (-1, 0)} = μ {ω | X ω = (0, 1)} ∧ + μ {ω | X ω = (0, 1)} = μ {ω | X ω = (0, -1)} + +/-- Position of the random walk at time $n$: $S_n = X_0 + X_1 + \cdots + X_{n-1}$, + starting at the origin $S_0 = (0, 0)$. -/ +def walkPosition (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : ℤ × ℤ := + ∑ i ∈ Finset.range n, X i ω + +/-- The local time (visit count) at site $x$ up to time $k$: + $f_k(x) = |\{l : 0 \le l \le k \mid S_l = x\}|$. -/ +def localTime (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (k : ℕ) (x : ℤ × ℤ) : ℕ := + ((Finset.range (k + 1)).filter (fun l => walkPosition X ω l = x)).card + +/-- The set of sites visited by the walk up to time $k$. -/ +def visitedSites (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (k : ℕ) : Finset (ℤ × ℤ) := + (Finset.range (k + 1)).image (fun l => walkPosition X ω l) + +/-- The maximum local time at time $k$: + $\max_y f_k(y)$, the maximum number of visits to any single site. -/ +def maxLocalTime (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (k : ℕ) : ℕ := + (visitedSites X ω k).sup (localTime X ω k) + +/-- The set of favourite sites at time $k$: + $F(k) = \{x \in \text{visited sites} : f_k(x) = \max_y f_k(y)\}$. -/ +def favouriteSites (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (k : ℕ) : Finset (ℤ × ℤ) := + (visitedSites X ω k).filter (fun x => localTime X ω k x = maxLocalTime X ω k) + +/-- The cumulative set of favourite sites up to time $n$: + $\bigcup_{k \le n} F(k)$, the set of all sites that were ever a favourite site. -/ +def cumulativeFavouriteSites (X : ℕ → Ω → ℤ × ℤ) (ω : Ω) (n : ℕ) : Finset (ℤ × ℤ) := + (Finset.range (n + 1)).biUnion (fun k => favouriteSites X ω k) + +/-- +Erdős Problem 1166 (Erdős–Révész) [Va99, 6.78]: + +Given a random walk $s_0, s_1, \ldots$ in $\mathbb{Z}^2$, starting at the origin, let $f_k(x)$ +count the number of $0 \le l \le k$ such that $s_l = x$. Let +$F(k) = \{x : f_k(x) = \max_y f_k(y)\}$ be the set of 'favourite sites'. Is it true that +$$\left|\bigcup_{k \le n} F(k)\right| \le (\log n)^{O(1)}$$ +almost surely, for all but finitely many $n$? + +This is true: almost surely $\left|\bigcup_{k \le n} F(k)\right| \ll (\log n)^2$, which follows +from the fact that almost surely $|F(n)| \le 3$ for all large $n$ (see Erdős Problem 1165) and +the result of Erdős and Taylor [ErTa60] that the maximum number of visits to any fixed point +by time $n$ is $\ll (\log n)^2$. +-/ +@[category research solved, AMS 60] +theorem erdos_1166 : answer(True) ↔ + ∀ (Ω : Type*) [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] + (X : ℕ → Ω → ℤ × ℤ), + (∀ i, IsUniformStep μ (X i)) → + iIndepFun X μ → + ∃ C : ℕ, ∀ᵐ ω ∂μ, ∀ᶠ (n : ℕ) in atTop, + ((cumulativeFavouriteSites X ω n).card : ℝ) ≤ Real.log (n : ℝ) ^ C := by + sorry + +end Erdos1166 diff --git a/FormalConjectures/ErdosProblems/1167.lean b/FormalConjectures/ErdosProblems/1167.lean new file mode 100644 index 0000000000..ff595efdc2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1167.lean @@ -0,0 +1,57 @@ +/- +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 1167 + +*Reference:* [erdosproblems.com/1167](https://www.erdosproblems.com/1167) + +A problem of Erdős, Hajnal, and Rado on cardinal partition relations: +does the stepping-up lemma hold for partition relations, i.e., does +$2^\lambda \to (\kappa_\alpha + 1)^{r+1}$ imply $\lambda \to (\kappa_\alpha)^r$ +for $r \geq 2$ and $\lambda$ infinite? + +[Va99] Vaughan, J., *Small uncountable cardinals and topology*. Open Problems in Topology (1999). +-/ + +open Cardinal + +namespace Erdos1167 + +/-- The cardinal partition relation $\kappa \to (\text{targets}(\alpha))_{\alpha : \iota}^r$: + for every coloring of the $r$-element subsets of a $\kappa$-sized set with colors from $\iota$, + there exists a color $i$ and a monochromatic subset of cardinality $\geq \text{targets}(i)$. -/ +def CardinalPartitionRel (κ : Cardinal) {ι : Type*} (targets : ι → Cardinal) + (r : ℕ) : Prop := + ∀ (S : Type*) [DecidableEq S] (_ : #S = κ) (c : Finset S → ι), + ∃ (i : ι) (H : Set S), + Cardinal.mk H ≥ targets i ∧ + ∀ s : Finset S, s.card = r → (↑s : Set S) ⊆ H → c s = i + +/-- **Erdős Problem 1167** [Va99, 7.79] (Erdős–Hajnal–Rado): + For $r \geq 2$ and $\lambda$ infinite, does + $2^\lambda \to (\kappa_\alpha + 1)^{r+1}$ imply $\lambda \to (\kappa_\alpha)^r$? -/ +@[category research open, AMS 3 5] +theorem erdos_1167 : answer(sorry) ↔ + ∀ {ι : Type*} (κ : ι → Cardinal) (lam : Cardinal) (r : ℕ), + r ≥ 2 → ℵ₀ ≤ lam → + CardinalPartitionRel ((2 : Cardinal) ^ lam) (fun α => κ α + 1) (r + 1) → + CardinalPartitionRel lam κ r := by + sorry + +end Erdos1167 diff --git a/FormalConjectures/ErdosProblems/1168.lean b/FormalConjectures/ErdosProblems/1168.lean new file mode 100644 index 0000000000..b28db733d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1168.lean @@ -0,0 +1,60 @@ +/- +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 1168 + +*Reference:* [erdosproblems.com/1168](https://www.erdosproblems.com/1168) + +A problem of Erdős, Hajnal, and Rado on the negative partition relation +$\aleph_{\omega+1} \nrightarrow (\aleph_{\omega+1}, 3, \ldots, 3)_{\aleph_0}^2$ +without assuming the generalised continuum hypothesis. + +[Va99] Vaughan, J., *Small uncountable cardinals and topology*. Open Problems in Topology (1999). +-/ + +open Cardinal Ordinal + +namespace Erdos1168 + +/-- +Erdős Problem 1168 [Va99, 7.80]: + +The negative partition relation +$\aleph_{\omega+1} \nrightarrow (\aleph_{\omega+1}, 3, \ldots, 3)_{\aleph_0}^2$: +for any type $\alpha$ of cardinality $\aleph_{\omega+1}$, there exists a coloring of unordered +pairs of elements of $\alpha$ with countably many colors (indexed by $\mathbb{N}$) such that: +- No set of cardinality $\aleph_{\omega+1}$ is monochromatic in color $0$ +- No triple is monochromatic in any color $n \geq 1$ +-/ +@[category research open, AMS 3 5] +theorem erdos_1168 : + ∀ (α : Type*) (_ : #α = ℵ_ (ω + 1)), + ∃ (c : α → α → ℕ), + -- The coloring is symmetric + (∀ a b, c a b = c b a) ∧ + -- No monochromatic set of cardinality ℵ_{ω+1} for color 0 + (∀ S : Set α, #S = ℵ_ (ω + 1) → + ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ c a b ≠ 0) ∧ + -- No monochromatic triple for any color n ≥ 1 + (∀ (n : ℕ), n ≥ 1 → + ∀ a b d : α, a ≠ b → a ≠ d → b ≠ d → + ¬(c a b = n ∧ c a d = n ∧ c b d = n)) := by + sorry + +end Erdos1168 diff --git a/FormalConjectures/ErdosProblems/1169.lean b/FormalConjectures/ErdosProblems/1169.lean new file mode 100644 index 0000000000..68b8a77380 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1169.lean @@ -0,0 +1,84 @@ +/- +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 1169 + +Erdős and Hajnal asked whether for all finite $k < \omega$, the ordinal partition +relation $\omega_1^2 \to (\omega_1^2, k)^2$ fails. + +Hajnal proved this holds assuming the Continuum Hypothesis. The problem is +independent of ZFC: it is consistent with ZFC but not provable from ZFC alone. + +See also Problem 592 (a related question concerning countable ordinals) +and Problem 1172 (which uses the same `OrdinalPartitionPair` definition). + +*Reference:* [erdosproblems.com/1169](https://www.erdosproblems.com/1169) + +[Va99] Hajnal, A. and Larson, J., _Partition relations_. Handbook of Set Theory (2010), §7.85. + +[Ha71] Hajnal, A., _A negative partition relation_. Proceedings of the National Academy of + Sciences U.S.A. (1971), 142–144. +-/ + +open Ordinal Cardinal + +namespace Erdos1169 + +/-- $\omega_1$, the first uncountable ordinal. -/ +noncomputable def omega1 : Ordinal := (aleph 1).ord + +/-- The ordinal partition relation $\alpha \to (\beta, \gamma)^2$ for 2-colorings of pairs. + For every 2-coloring of the pairs of ordinals below $\alpha$, there is either + a homogeneous set of order type $\beta$ in color 0, or a homogeneous set of + order type $\gamma$ in color 1. Formalized via strictly monotone embeddings: + a subset of order type $\beta$ corresponds to a strictly monotone function + from $\{x \mid x < \beta\}$ to $\{x \mid x < \alpha\}$. -/ +def OrdinalPartitionPair (α β γ : Ordinal) : Prop := + ∀ f : {x : Ordinal // x < α} → {x : Ordinal // x < α} → Bool, + (∃ g : {x : Ordinal // x < β} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < β}, i < j → f (g i) (g j) = true) ∨ + (∃ g : {x : Ordinal // x < γ} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < γ}, i < j → f (g i) (g j) = false) + +/-- +Erdős Problem #1169 [Va99, 7.85] (Erdős and Hajnal): + +Is it true that, for all finite $k \geq 3$, +$$\omega_1^2 \not\to (\omega_1^2, k)^2?$$ + +That is, for every natural number $k \geq 3$, there exists a 2-coloring of the pairs +of ordinals below $\omega_1^2$ such that no subset of order type $\omega_1^2$ is monochromatic +in the first color and no subset of order type $k$ is monochromatic in the +second color. + +Hajnal proved this holds assuming the Continuum Hypothesis [Ha71]. +The problem is independent of ZFC: consistent with ZFC but not provable +from ZFC alone. + +The restriction to $k \geq 3$ is necessary because the partition relation +$\omega_1^2 \to (\omega_1^2, k)^2$ holds trivially for $k \leq 2$. +-/ +@[category research open, AMS 3 5] +theorem erdos_1169 : answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → ¬ OrdinalPartitionPair (omega1 ^ 2) (omega1 ^ 2) (↑k) := by + sorry + +end Erdos1169 diff --git a/FormalConjectures/ErdosProblems/117.lean b/FormalConjectures/ErdosProblems/117.lean new file mode 100644 index 0000000000..6349702960 --- /dev/null +++ b/FormalConjectures/ErdosProblems/117.lean @@ -0,0 +1,85 @@ +/- +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 117 + +*Reference:* [erdosproblems.com/117](https://www.erdosproblems.com/117) + +Let $h(n)$ be the least $k$ such that every group where each subset of more than $n$ elements +contains two distinct commuting elements can be covered by $k$ abelian subgroups. Pyber proved +$c_1^n < h(n) < c_2^n$ for constants $c_2 > c_1 > 1$. + +[Er90] Erdős, P., *Some of my favourite unsolved problems*. A tribute to Paul Erdős (1990), +467-478. + +[Er97f] Erdős, P., *Some unsolved problems*. Combinatorics, geometry and probability +(Cambridge, 1993) (1997), 1-10. + +[Va99,5.75] Varopoulos, N. (1999), Problem 5.75. + +[Py87] Pyber, L., *The number of pairwise noncommuting elements and the index of the centre in +a finite group*. J. London Math. Soc. (2) 35 (1987), 287-295. + +See also: Erdős Problem 1098 (non-commuting graph formulation). +-/ + +namespace Erdos117 + +/-- A group $G$ satisfies the $n$-commuting property if every finite subset of size +greater than $n$ contains two distinct elements $x \neq y$ with $xy = yx$. -/ +def HasNCommutingProperty (n : ℕ) (G : Type*) [Group G] : Prop := + ∀ (S : Finset G), n < S.card → + ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ Commute x y + +/-- A group $G$ can be covered by at most $k$ Abelian subgroups: there exist $k$ subgroups +$H_0, \ldots, H_{k-1}$ (possibly with repetition), each of which is abelian, whose union +is all of $G$. -/ +def CoveredByAbelianSubgroups (k : ℕ) (G : Type*) [Group G] : Prop := + ∃ (H : Fin k → Subgroup G), + (∀ i, IsMulCommutative (H i)) ∧ + ∀ g : G, ∃ i, g ∈ H i + +/-- $h(n)$ is the least $k$ such that every group satisfying the $n$-commuting property +can be covered by at most $k$ Abelian subgroups. -/ +noncomputable def erdosH (n : ℕ) : ℕ := + sInf {k : ℕ | ∀ (G : Type) [Group G], + HasNCommutingProperty n G → CoveredByAbelianSubgroups k G} + +/-- +Erdős Problem 117 [Er90, Er97f, Va99]: + +Let $h(n)$ be minimal such that any group $G$ satisfying the property that every +subset of more than $n$ elements contains distinct commuting elements $x \neq y$ +($xy = yx$) can be covered by at most $h(n)$ Abelian subgroups. + +Estimate $h(n)$ as well as possible. + +Pyber [Py87] proved there exist constants $c_2 > c_1 > 1$ such that +$$c_1^n < h(n) < c_2^n.$$ +The lower bound $c_1^n < h(n)$ was already known to Isaacs [Er97f]. +The precise exponential growth rate of $h(n)$ remains open. +-/ +@[category research solved, AMS 20] +theorem erdos_117 : + ∃ c₁ c₂ : ℝ, 1 < c₁ ∧ c₁ < c₂ ∧ + ∀ n : ℕ, 1 ≤ n → + c₁ ^ n < (erdosH n : ℝ) ∧ (erdosH n : ℝ) < c₂ ^ n := by + sorry + +end Erdos117 diff --git a/FormalConjectures/ErdosProblems/1170.lean b/FormalConjectures/ErdosProblems/1170.lean new file mode 100644 index 0000000000..5ddfbaeb23 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1170.lean @@ -0,0 +1,78 @@ +/- +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 1170 + +*Reference:* [erdosproblems.com/1170](https://www.erdosproblems.com/1170) + +Erdős asked whether it is consistent that the ordinal partition relation +$\omega_2 \to (\alpha)^2_2$ holds for every $\alpha < \omega_2$. + +- [Va99] Section 7.86. +- [La82] Laver, R., _An (ℵ₂, ℵ₂, ℵ₀)-saturated ideal on ω₁_ (1982), 173–180. +- [FoHa03] Foreman, M. and Hajnal, A., _A partition relation for successors of large cardinals_, + Math. Ann. (2003), 583–623. + +Known partial results: +- [La82] Laver proved the consistency of $\omega_2 \to (\omega_1 \cdot 2 + 1, \alpha)^2$ + for all $\alpha < \omega_2$. +- [FoHa03] Foreman–Hajnal proved the consistency of + $\omega_2 \to (\omega_1^2 + 1, \alpha)^2$ for all $\alpha < \omega_2$. +-/ + +open Ordinal Cardinal + +namespace Erdos1170 + +/-- $\omega_2$, the second uncountable ordinal (initial ordinal of cardinality $\aleph_2$). -/ +noncomputable def omega2 : Ordinal := (aleph 2).ord + +/-- The ordinal partition relation $\kappa \to (\alpha)^2_2$: for every 2-coloring of increasing +pairs of ordinals below $\kappa$, there exists a monochromatic set of order type $\alpha$. +Formalized via strictly monotone embeddings: a subset of order type $\alpha$ corresponds +to a strictly monotone function from $\{x \mid x < \alpha\}$ to $\{x \mid x < \kappa\}$. -/ +def OrdinalPartition (κ α : Ordinal) : Prop := + ∀ f : {x : Ordinal // x < κ} → {x : Ordinal // x < κ} → Bool, + ∃ (c : Bool) (g : {x : Ordinal // x < α} → {x : Ordinal // x < κ}), + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < α}, i < j → f (g i) (g j) = c + +/-- +Is it consistent that $\omega_2 \to (\alpha)^2_2$ for every $\alpha < \omega_2$? + +The arrow notation $\kappa \to (\alpha)^2_2$ denotes the ordinal partition relation: for every +2-coloring of pairs of ordinals below $\kappa$, there exists a monochromatic set of +order type $\alpha$. + +This is a consistency question: is there a model of ZFC in which this holds? +We formalize the property itself. + +Known partial results: +- Laver [La82] proved the consistency of $\omega_2 \to (\omega_1 \cdot 2 + 1, \alpha)^2$ + for all $\alpha < \omega_2$. +- Foreman–Hajnal [FoHa03] proved the consistency of + $\omega_2 \to (\omega_1^2 + 1, \alpha)^2$ for all $\alpha < \omega_2$. +-/ +@[category research open, AMS 3 5] +theorem erdos_1170 : answer(sorry) ↔ + ∀ α : Ordinal, α < omega2 → + OrdinalPartition omega2 α := by + sorry + +end Erdos1170 diff --git a/FormalConjectures/ErdosProblems/1171.lean b/FormalConjectures/ErdosProblems/1171.lean new file mode 100644 index 0000000000..3d29b2e593 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1171.lean @@ -0,0 +1,75 @@ +/- +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 1171 + +*Reference:* [erdosproblems.com/1171](https://www.erdosproblems.com/1171) + +Erdős asked whether for all finite $k$, the ordinal partition relation +$\omega_1^2 \to (\omega_1 \cdot \omega, 3, \ldots, 3)^2_{k+1}$ holds — that is, every +$(k+1)$-coloring of pairs below $\omega_1^2$ yields either a homogeneous set of order type +$\omega_1 \cdot \omega$ for the first color or a monochromatic triple for some other color. + +- [Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §7.84. +- [Ba89b] Baumgartner, J. E., _Remarks on partition ordinals_ (1989), 5–17. +-/ + +open Ordinal Cardinal + +namespace Erdos1171 + +/-- $\omega_1$, the first uncountable ordinal. -/ +noncomputable def omega1 : Ordinal := (aleph 1).ord + +/-- The multi-color ordinal partition relation +$\alpha \to (\beta_0, \beta_1, \ldots, \beta_1)^2$ with $(k+1)$ colors, +where $\beta_1$ appears $k$ times. +For every $(k+1)$-coloring of pairs of ordinals below $\alpha$, either +there is a homogeneous set of order type $\beta_0$ for color $0$, or there exists some +color $c > 0$ with a homogeneous set of order type $\beta_1$. -/ +def OrdinalPartitionMulticolor (α : Ordinal) (k : ℕ) (target₀ target_rest : Ordinal) : Prop := + ∀ f : {x : Ordinal // x < α} → {x : Ordinal // x < α} → Fin (k + 1), + (∃ g : {x : Ordinal // x < target₀} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < target₀}, i < j → f (g i) (g j) = 0) ∨ + (∃ c : Fin (k + 1), 0 < c.val ∧ + ∃ g : {x : Ordinal // x < target_rest} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < target_rest}, i < j → f (g i) (g j) = c) + +/-- +Erdős Problem 1171 [Va99, 7.84]: + +Is it true that, for all finite $k < \omega$, +$\omega_1^2 \to (\omega_1 \cdot \omega, 3, \ldots, 3)^2_{k+1}$? + +That is, for every $(k+1)$-coloring of pairs of ordinals below $\omega_1^2$, either +there is a homogeneous set of order type $\omega_1 \cdot \omega$ for the first color, or +there is a monochromatic triple for one of the remaining $k$ colors. + +Baumgartner [Ba89b] proved that, assuming a form of Martin's axiom, +$\omega_1 \cdot \omega \to (\omega_1 \cdot \omega, 3)^2$. +-/ +@[category research open, AMS 3 5] +theorem erdos_1171 : answer(sorry) ↔ ∀ k : ℕ, + OrdinalPartitionMulticolor (omega1 ^ 2) k (omega1 * omega0) 3 := by + sorry + +end Erdos1171 diff --git a/FormalConjectures/ErdosProblems/1172.lean b/FormalConjectures/ErdosProblems/1172.lean new file mode 100644 index 0000000000..76709047d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1172.lean @@ -0,0 +1,125 @@ +/- +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 1172 + +*Reference:* [erdosproblems.com/1172](https://www.erdosproblems.com/1172) + +Establish whether certain ordinal partition relations hold under the Generalized Continuum +Hypothesis or the Continuum Hypothesis. A problem of Erdős and Hajnal. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the +conference "Paul Erdős and his mathematics", Budapest (1999). + +[ErRa56] Erdős, P. and Rado, R., _A partition calculus in set theory_. +Bulletin of the American Mathematical Society (1956), 427–489. +-/ + +open Ordinal Cardinal + +namespace Erdos1172 + +/-- $\omega_1$, the first uncountable ordinal. -/ +noncomputable def omega1 : Ordinal := (aleph 1).ord + +/-- $\omega_2$, the second uncountable ordinal. -/ +noncomputable def omega2 : Ordinal := (aleph 2).ord + +/-- $\omega_3$, the third uncountable ordinal. -/ +noncomputable def omega3 : Ordinal := (aleph 3).ord + +/-- The ordinal partition relation $\alpha \to (\beta, \gamma)^2$ for 2-colorings of pairs. + For every 2-coloring of the pairs of ordinals below $\alpha$, there is either + a homogeneous set of order type $\beta$ in color true, or a homogeneous set of + order type $\gamma$ in color false. Formalized via strictly monotone embeddings: + a subset of order type $\beta$ corresponds to a strictly monotone function + from $\{x \mid x < \beta\}$ to $\{x \mid x < \alpha\}$. -/ +def OrdinalPartitionPair (α β γ : Ordinal) : Prop := + ∀ f : {x : Ordinal // x < α} → {x : Ordinal // x < α} → Bool, + (∃ g : {x : Ordinal // x < β} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < β}, i < j → f (g i) (g j) = true) ∨ + (∃ g : {x : Ordinal // x < γ} → {x : Ordinal // x < α}, + StrictMono g ∧ + ∀ i j : {x : Ordinal // x < γ}, i < j → f (g i) (g j) = false) + +/-- The Generalized Continuum Hypothesis: $2^{\aleph_o} = \aleph_{o+1}$ for all ordinals $o$. -/ +def GCH : Prop := ∀ o : Ordinal.{0}, (2 : Cardinal.{0}) ^ aleph o = aleph (o + 1) + +/-- The Continuum Hypothesis: $2^{\aleph_0} = \aleph_1$. -/ +def CH : Prop := (2 : Cardinal.{0}) ^ aleph 0 = aleph 1 + +/-- +Erdős Problem 1172, Part 1 [Va99, 7.87]: + +Assuming the Generalized Continuum Hypothesis, establish whether +$$\omega_3 \to (\omega_2, \omega_1 + 2)^2.$$ + +This is an open problem of Erdős and Hajnal. The right-hand side may have +been filled in incorrectly due to a truncated photocopy of the source [Va99]. +-/ +@[category research open, AMS 3 5] +theorem erdos_1172 : answer(sorry) ↔ (GCH → + OrdinalPartitionPair omega3 omega2 (omega1 + 2)) := by + sorry + +/-- +Erdős Problem 1172, Part 2 [Va99, 7.87]: + +Assuming the Generalized Continuum Hypothesis, establish whether +$$\omega_3 \to (\omega_2 + \omega_1, \omega_2 + \omega)^2.$$ + +This is an open problem of Erdős and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1172.variants.gch_partition_2 : answer(sorry) ↔ (GCH → + OrdinalPartitionPair omega3 (omega2 + omega1) (omega2 + omega0)) := by + sorry + +/-- +Erdős Problem 1172, Part 3 [Va99, 7.87]: + +Assuming the Generalized Continuum Hypothesis, establish whether +$$\omega_2 \to (\omega_1^{\omega+2} + 2, \omega_1 + 2)^2.$$ + +This is an open problem of Erdős and Hajnal. The right-hand side may have +been filled in incorrectly due to a truncated photocopy of the source [Va99]. +-/ +@[category research open, AMS 3 5] +theorem erdos_1172.variants.gch_partition_3 : answer(sorry) ↔ (GCH → + OrdinalPartitionPair omega2 (omega1 ^ (omega0 + 2) + 2) (omega1 + 2)) := by + sorry + +/-- +Erdős Problem 1172, Part 4 [Va99, 7.87]: + +Assuming the Continuum Hypothesis, establish whether +$$\omega_2 \to (\omega_1 + \omega)^2_2.$$ + +That is, for every 2-coloring of the pairs of ordinals below $\omega_2$, there exists +a monochromatic homogeneous set of order type $\omega_1 + \omega$. + +This is an open problem of Erdős and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1172.variants.ch_partition : answer(sorry) ↔ (CH → + OrdinalPartitionPair omega2 (omega1 + omega0) (omega1 + omega0)) := by + sorry + +end Erdos1172 diff --git a/FormalConjectures/ErdosProblems/1173.lean b/FormalConjectures/ErdosProblems/1173.lean new file mode 100644 index 0000000000..7ed68264d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1173.lean @@ -0,0 +1,81 @@ +/- +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 1173 + +*Reference:* [erdosproblems.com/1173](https://www.erdosproblems.com/1173) + +[Ko25b] Koepke, P., Problem 35. + +[Va99] Vaughan, J.E., _Small uncountable cardinals and topology_. Open Problems in +Topology (1999), §7.88. + +A problem of Erdős and Hajnal. +-/ + +open Ordinal Cardinal + +namespace Erdos1173 + +/-- The Generalized Continuum Hypothesis: $2^{\aleph_\alpha} = \aleph_{\alpha+1}$ for all +ordinals $\alpha$. -/ +def GCH : Prop := ∀ o : Ordinal.{0}, (2 : Cardinal.{0}) ^ aleph o = aleph (o + 1) + +/-- $\omega_{\omega+1}$, the initial ordinal of $\aleph_{\omega+1}$. -/ +noncomputable def omegaOmega1 : Ordinal := (aleph (ω + 1)).ord + +/-- A set $H \subseteq \omega_{\omega+1}$ is free for $f$ if for all $\alpha \in H$, +$f(\alpha) \cap H \subseteq \{\alpha\}$, +i.e., $\alpha \notin f(\beta)$ for all distinct $\alpha, \beta \in H$. -/ +def IsFreeSet (f : {α : Ordinal // α < omegaOmega1} → Set {α : Ordinal // α < omegaOmega1}) + (H : Set {α : Ordinal // α < omegaOmega1}) : Prop := + ∀ α ∈ H, f α ∩ H ⊆ {α} + +/-- +Erdős Problem 1173 [Ko25b, Problem 35] [Va99, 7.88]: + +Assuming the Generalised Continuum Hypothesis, let +$f : \omega_{\omega+1} \to [\omega_{\omega+1}]^{\leq \aleph_\omega}$ +be a set mapping such that $|f(\alpha) \cap f(\beta)| < \aleph_\omega$ for all +$\alpha \neq \beta$. +Does there exist a free set of cardinality $\aleph_{\omega+1}$? + +Here $\omega_{\omega+1} = (\aleph_{\omega+1}).\mathrm{ord}$ is the initial ordinal of +$\aleph_{\omega+1}$, elements are ordinals $\alpha < \omega_{\omega+1}$, and a free set $H$ +satisfies $f(\alpha) \cap H \subseteq \{\alpha\}$ for all $\alpha \in H$. +The cardinality comparison uses `Cardinal.lift` to reconcile universe levels: +subsets of $\{\alpha : \mathrm{Ordinal} \mid \alpha < \omega_{\omega+1}\}$ live in `Type 1`, +while `aleph` lives in `Cardinal.{0}`; `Cardinal.lift.{1,0}` embeds `Cardinal.{0}` into +`Cardinal.{1}`. + +A problem of Erdős and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1173 : answer(sorry) ↔ + ∀ (h : GCH) + (f : {α : Ordinal // α < omegaOmega1} → Set {α : Ordinal // α < omegaOmega1}) + (hf : ∀ α : {x : Ordinal // x < omegaOmega1}, + Cardinal.mk ↥(f α) ≤ Cardinal.lift.{1, 0} (aleph ω)) + (hfI : ∀ α β : {x : Ordinal // x < omegaOmega1}, α ≠ β → + Cardinal.mk ↥(f α ∩ f β) < Cardinal.lift.{1, 0} (aleph ω)), + ∃ H : Set {α : Ordinal // α < omegaOmega1}, + IsFreeSet f H ∧ Cardinal.lift.{1, 0} (aleph (ω + 1)) ≤ Cardinal.mk ↥H := by + sorry + +end Erdos1173 diff --git a/FormalConjectures/ErdosProblems/1174.lean b/FormalConjectures/ErdosProblems/1174.lean new file mode 100644 index 0000000000..14f513536f --- /dev/null +++ b/FormalConjectures/ErdosProblems/1174.lean @@ -0,0 +1,73 @@ +/- +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 1174 + +*Reference:* [erdosproblems.com/1174](https://www.erdosproblems.com/1174) + +A problem of Erdős and Hajnal on graph colourings and cliques. +Shelah proved that a graph with either property can consistently exist. + +[Va99] Vardi, I. (ed.), *Problems from the Erdős problem collection*, §7.91 (1999). +-/ + +open Cardinal SimpleGraph + +namespace Erdos1174 + +/-- +Erdős Problem 1174, Part 1 [Va99, §7.91]: + +Does there exist a graph $G$ with no $K_4$ (no 4-clique) such that for every +edge colouring of $G$ with countably many colours ($\mathbb{N}$), some monochromatic +$K_3$ (a 3-clique whose three edges all receive the same colour) exists in $G$? + +This is an open problem of Erdős and Hajnal. Shelah proved that such a graph +can consistently exist (i.e., its existence is consistent with ZFC). +-/ +@[category research open, AMS 3 5] +theorem erdos_1174 : answer(sorry) ↔ + ∃ (V : Type) (G : SimpleGraph V), + (∀ S : Finset V, ¬G.IsNClique 4 S) ∧ + ∀ (col : Sym2 V → ℕ), + ∃ (S : Finset V) (c : ℕ), G.IsNClique 3 S ∧ + ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col s(u, v) = c := by + sorry + +/-- +Erdős Problem 1174, Part 2 [Va99, §7.91]: + +Does there exist a graph $G$ with no $K_{\aleph_1}$ (no clique of cardinality +$\geq \aleph_1$) such that for every edge colouring of $G$ with countably many colours +($\mathbb{N}$), some monochromatic $K_{\aleph_0}$ exists — that is, a clique of cardinality +$\geq \aleph_0$ whose edges all receive the same colour? + +This is an open problem of Erdős and Hajnal. Shelah proved that such a graph +can consistently exist (i.e., its existence is consistent with ZFC). +-/ +@[category research open, AMS 3 5] +theorem erdos_1174.variants.infinite_clique : answer(sorry) ↔ + ∃ (V : Type) (G : SimpleGraph V), + (¬∃ S : Set V, aleph 1 ≤ Cardinal.mk ↥S ∧ G.IsClique S) ∧ + ∀ (col : Sym2 V → ℕ), + ∃ (S : Set V) (c : ℕ), aleph 0 ≤ Cardinal.mk ↥S ∧ G.IsClique S ∧ + ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col s(u, v) = c := by + sorry + +end Erdos1174 diff --git a/FormalConjectures/ErdosProblems/1175.lean b/FormalConjectures/ErdosProblems/1175.lean new file mode 100644 index 0000000000..2637bccfd5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1175.lean @@ -0,0 +1,56 @@ +/- +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 1175 + +*Reference:* [erdosproblems.com/1175](https://www.erdosproblems.com/1175) + +For an uncountable cardinal κ, must there exist a cardinal λ such that every graph with +chromatic number λ contains a triangle-free subgraph with chromatic number κ? + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §7.92. +-/ + +open Cardinal SimpleGraph + +namespace Erdos1175 + +/-- +Erdős Problem 1175 [Va99, 7.92]: + +Let $\kappa$ be an uncountable cardinal. Must there exist a cardinal $\lambda$ such that +every graph with chromatic number $\lambda$ contains a triangle-free subgraph +with chromatic number $\kappa$? + +Here `G.chromaticCardinal` is the minimal cardinality of a color set admitting a proper +coloring of $G$. Triangle-free means `G.CliqueFree 3` (no 3-clique, i.e., no triangle). +The subgraph relation $H \leq G$ holds when every edge of $H$ is also an edge of $G$. + +Shelah proved that a negative answer is consistent if $\kappa = \lambda = \aleph_1$. +-/ +@[category research open, AMS 3 5] +theorem erdos_1175 : answer(sorry) ↔ + ∀ κ : Cardinal.{0}, aleph 1 ≤ κ → + ∃ mu : Cardinal.{0}, + ∀ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = mu → + ∃ H : SimpleGraph V, H ≤ G ∧ H.CliqueFree 3 ∧ H.chromaticCardinal = κ := by + sorry + +end Erdos1175 diff --git a/FormalConjectures/ErdosProblems/1177.lean b/FormalConjectures/ErdosProblems/1177.lean new file mode 100644 index 0000000000..98ae5064ab --- /dev/null +++ b/FormalConjectures/ErdosProblems/1177.lean @@ -0,0 +1,138 @@ +/- +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 1177 + +*Reference:* [erdosproblems.com/1177](https://www.erdosproblems.com/1177) + +Let $G$ be a finite $3$-uniform hypergraph, and let $F_G(\kappa)$ denote the collection of +$3$-uniform hypergraphs with chromatic number $\kappa$ not containing $G$. + +A problem of Erdős, Galvin, and Hajnal. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §7.94. +-/ + +open Cardinal + +namespace Erdos1177 + +/-- A proper coloring of a $3$-uniform hypergraph with vertex type $V$ using colors from $\alpha$ + is a function $c : V \to \alpha$ such that no hyperedge is monochromatic: for every edge $e$ + there exist two vertices in $e$ assigned different colors. -/ +def IsProperHypergraphColoring {V α : Type*} (edges : Set (Finset V)) (c : V → α) : Prop := + ∀ e ∈ edges, ∃ v ∈ e, ∃ w ∈ e, c v ≠ c w + +/-- A $3$-uniform hypergraph (on vertex type $V$, with edge set `edges`) has cardinal chromatic + number $\kappa$ if $\kappa$ is the least cardinality of a color set admitting a proper coloring: + - there exists a proper coloring with a color set of cardinality $\le \kappa$, and + - every proper coloring requires a color set of cardinality $\ge \kappa$. -/ +def HasHypergraphChromaticNumber {V : Type} (edges : Set (Finset V)) (κ : Cardinal.{0}) : Prop := + (∃ (α : Type), #α ≤ κ ∧ ∃ c : V → α, IsProperHypergraphColoring edges c) ∧ + ∀ (α : Type), (∃ c : V → α, IsProperHypergraphColoring edges c) → κ ≤ #α + +/-- $H$ is $G$-free if there is no injective map $f : V_G \to V_H$ sending every edge of $G$ to an + edge of $H$ (i.e., $G$ does not embed as a sub-hypergraph of $H$). Each edge of $G$ maps to + an edge of $H$ via $f$ when the image of the edge under $f$ equals an edge of $H$ as a + set. -/ +def IsFreeOf {VG VH : Type*} (edgesG : Set (Finset VG)) (edgesH : Set (Finset VH)) : Prop := + ¬ ∃ f : VG → VH, Function.Injective f ∧ + ∀ e ∈ edgesG, ∃ e' ∈ edgesH, (↑e' : Set VH) = f '' (↑e : Set VG) + +/-- +Erdős Problem 1177, Part 1 [Va99, 7.94]: + +Let $G$ be a finite $3$-uniform hypergraph. If $F_G(\aleph_1)$ is non-empty (i.e., there exists +a $G$-free $3$-uniform hypergraph with chromatic number $\aleph_1$), then there exists +$X \in F_G(\aleph_1)$ with vertex set of cardinality at most $2^{2^{\aleph_0}}$. + +A problem of Erdős, Galvin, and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1177 + {VG : Type} [Fintype VG] (edgesG : Set (Finset VG)) + (edgesG_finite : edgesG.Finite) (hG : ∀ e ∈ edgesG, e.card = 3) + (h : ∃ (VH : Type) (edgesH : Set (Finset VH)), + (∀ e ∈ edgesH, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesH (aleph 1) ∧ + IsFreeOf edgesG edgesH) : + ∃ (VH : Type) (edgesH : Set (Finset VH)), + (∀ e ∈ edgesH, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesH (aleph 1) ∧ + IsFreeOf edgesG edgesH ∧ + #VH ≤ (2 : Cardinal.{0}) ^ (2 : Cardinal.{0}) ^ aleph 0 := by + sorry + +/-- +Erdős Problem 1177, Part 2 [Va99, 7.94]: + +Let $G$ and $H$ be finite $3$-uniform hypergraphs. If $F_G(\aleph_1)$ and $F_H(\aleph_1)$ are both +non-empty, then $F_G(\aleph_1) \cap F_H(\aleph_1)$ is non-empty: there exists a $3$-uniform +hypergraph with chromatic number $\aleph_1$ that contains neither $G$ nor $H$ as a +sub-hypergraph. + +A problem of Erdős, Galvin, and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1177.variants.intersection + {VG : Type} [Fintype VG] (edgesG : Set (Finset VG)) + (edgesG_finite : edgesG.Finite) (hG : ∀ e ∈ edgesG, e.card = 3) + {VH : Type} [Fintype VH] (edgesH : Set (Finset VH)) + (edgesH_finite : edgesH.Finite) (hH : ∀ e ∈ edgesH, e.card = 3) + (hFG : ∃ (W : Type) (edgesW : Set (Finset W)), + (∀ e ∈ edgesW, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesW (aleph 1) ∧ + IsFreeOf edgesG edgesW) + (hFH : ∃ (W : Type) (edgesW : Set (Finset W)), + (∀ e ∈ edgesW, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesW (aleph 1) ∧ + IsFreeOf edgesH edgesW) : + ∃ (W : Type) (edgesW : Set (Finset W)), + (∀ e ∈ edgesW, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesW (aleph 1) ∧ + IsFreeOf edgesG edgesW ∧ IsFreeOf edgesH edgesW := by + sorry + +/-- +Erdős Problem 1177, Part 3 [Va99, 7.94]: + +Let $G$ be a finite $3$-uniform hypergraph. If $\kappa$ and $\mu$ are uncountable cardinals +(both $\ge \aleph_1$) and $F_G(\kappa)$ is non-empty, then $F_G(\mu)$ is non-empty: the existence +of a $G$-free $3$-uniform hypergraph with chromatic number $\kappa$ implies the existence of one +with chromatic number $\mu$. + +A problem of Erdős, Galvin, and Hajnal. +-/ +@[category research open, AMS 3 5] +theorem erdos_1177.variants.cardinal_transfer + {VG : Type} [Fintype VG] (edgesG : Set (Finset VG)) + (edgesG_finite : edgesG.Finite) (hG : ∀ e ∈ edgesG, e.card = 3) + (κ μ : Cardinal.{0}) (hκ : aleph 1 ≤ κ) (hμ : aleph 1 ≤ μ) + (h : ∃ (W : Type) (edgesW : Set (Finset W)), + (∀ e ∈ edgesW, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesW κ ∧ + IsFreeOf edgesG edgesW) : + ∃ (W : Type) (edgesW : Set (Finset W)), + (∀ e ∈ edgesW, e.card = 3) ∧ + HasHypergraphChromaticNumber edgesW μ ∧ + IsFreeOf edgesG edgesW := by + sorry + +end Erdos1177 diff --git a/FormalConjectures/ErdosProblems/1178.lean b/FormalConjectures/ErdosProblems/1178.lean new file mode 100644 index 0000000000..2161b66c64 --- /dev/null +++ b/FormalConjectures/ErdosProblems/1178.lean @@ -0,0 +1,89 @@ +/- +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 1178 + +*Reference:* [erdosproblems.com/1178](https://www.erdosproblems.com/1178) + +For $r, e \geq 3$, determine the minimal $d$ such that the $r$-uniform Turán number +$\operatorname{ex}_r(n; d, e) = o(n^2)$ as $n \to \infty$. The conjecture is that this +minimal $d$ equals $(r-2) \cdot e + 3$. + +[BES73] Brown, W.G., Erdős, P., and Sós, V.T., *Some extremal problems on r-graphs*. +1973, pp. 53–63. + +[Er75b] Erdős, P., *Problems and results in combinatorial number theory*. Journées +Arithmétiques de Bordeaux (1974), 1975, pp. 295–310. + +[RuSz78] Ruzsa, I.Z. and Szemerédi, E., *Triple systems with no six points carrying +three triangles*. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), +Vol. II, Colloq. Math. Soc. János Bolyai 18, North-Holland, 1978, pp. 939–945. + +[EFR86] Erdős, P., Frankl, P., Rödl, V., *The asymptotic number of graphs not containing +a fixed subgraph and a problem for hypergraphs having no exponent*. Graphs and +Combinatorics (1986), pp. 113–121. +-/ + +open Filter Asymptotics + +namespace Erdos1178 + +/-- An $r$-uniform hypergraph on vertex type $V$ is a set of $r$-element subsets of $V$. -/ +def IsRUniform (r : ℕ) {V : Type*} (E : Finset (Finset V)) : Prop := + ∀ e ∈ E, e.card = r + +/-- There exist $d$ vertices spanning at least $e$ edges from $E$. -/ +def ContainsConfig (d e n : ℕ) (E : Finset (Finset (Fin n))) : Prop := + ∃ S : Finset (Fin n), S.card = d ∧ e ≤ (E.filter (fun edge => edge ⊆ S)).card + +/-- The $r$-uniform Turán number $\operatorname{ex}_r(n; d, e)$: the maximum number of edges in an +$r$-uniform hypergraph on $n$ vertices that contains no $r$-uniform sub-hypergraph +on $d$ vertices with $e$ edges (i.e., avoids the Brown-Erdős-Sós family $F_r(d,e)$). -/ +noncomputable def turanNumber (r n d e : ℕ) : ℕ := + sSup {m : ℕ | ∃ E : Finset (Finset (Fin n)), + IsRUniform r E ∧ ¬ ContainsConfig d e n E ∧ E.card = m} + +/-- The minimal $d$ such that the $r$-uniform Turán number +$\operatorname{ex}_r(n; d, e) = o(n^2)$ as $n \to \infty$. -/ +noncomputable def minD (r e : ℕ) : ℕ := + sInf {d : ℕ | (fun n : ℕ => (turanNumber r n d e : ℝ)) =o[atTop] + (fun n : ℕ => (n : ℝ) ^ 2)} + +/-- +Erdős Problem 1178 [BES73] [Er75b] [Er81]: + +For $r, e \geq 3$, the minimal $d$ such that the $r$-uniform Turán number +$\operatorname{ex}_r(n, F) = o(n^2)$ (where $F$ is the family of all $r$-uniform hypergraphs +on $d$ vertices with $e$ edges) equals $(r-2) \cdot e + 3$. + +Here `turanNumber r n d e` is the maximum number of edges in an $r$-uniform hypergraph +on $n$ vertices avoiding all configurations on $d$ vertices with $e$ edges: formally, there +is no $d$-element set $S \subseteq \operatorname{Fin} n$ with $e$ or more $r$-uniform edges +in $S$. `minD r e` is the least such $d$. + +Brown, Erdős, and Sós [BES73] proved the lower bound $d_r(e) \geq (r-2) \cdot e + 3$. +Ruzsa and Szemerédi [RuSz78] proved $d_3(3) = 6$. +Erdős, Frankl, and Rödl [EFR86] proved the case $e = 3$: $d_r(3) = 3(r-2)+3$ for all $r \geq 3$. +-/ +@[category research open, AMS 5] +theorem erdos_1178 (r e : ℕ) (hr : 3 ≤ r) (he : 3 ≤ e) : + minD r e = (r - 2) * e + 3 := by + sorry + +end Erdos1178 diff --git a/FormalConjectures/ErdosProblems/1179.lean b/FormalConjectures/ErdosProblems/1179.lean new file mode 100644 index 0000000000..fc3d7cd19c --- /dev/null +++ b/FormalConjectures/ErdosProblems/1179.lean @@ -0,0 +1,117 @@ +/- +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 1179 + +*Reference:* [erdosproblems.com/1179](https://www.erdosproblems.com/1179) + +Let $0 < \varepsilon < 1$ and let $g_\varepsilon(N)$ be the minimal $k$ such that if $G$ is an +abelian group of size $N$ and $A \subseteq G$ is a uniformly random subset of size $k$, and +$$F_A(g) = \#\{S \subseteq A : g = \sum_{x \in S} x\},$$ +then, with probability $\to 1$ as $N \to \infty$, +$$|F_A(g) - 2^k/N| \leq \varepsilon \cdot 2^k/N$$ +for all $g \in G$. Estimate $g_\varepsilon(N)$; in particular, is it true that for all +$\varepsilon > 0$, +$$g_\varepsilon(N) = (1 + o_\varepsilon(1)) \log_2 N?$$ + +It is trivial that $g_\varepsilon(N) \geq \log_2 N$. Erdős and Rényi proved +$g_\varepsilon(N) \leq (2 + o(1)) \log_2 N + O_\varepsilon(1)$, and Erdős and Hall improved +this to +$$g_\varepsilon(N) \leq (1 + O_\varepsilon(\log \log \log N / \log \log N)) \log_2 N.$$ + +Related: [Erdős Problem 543](https://www.erdosproblems.com/543). + +A problem of Erdős. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., 1971) +(1973), 117-138. + +[ErRe65] Erdős, P. and Rényi, A., *Probabilistic methods in group theory*. J. Analyse Math. +(1965), 127-138. + +[ErHa76] Erdős, P. and Hall, R. R., *Probabilistic methods in group theory. II*. Houston J. Math. +(1976), 173-180. +-/ + +open Filter + +open scoped Topology Real + +namespace Erdos1179 + +/-- For a finite abelian group $G$, a subset $A \subseteq G$, and element $g \in G$, +$F_A(g) = \#\{S \subseteq A : \sum_{x \in S} x = g\}$ counts the subsets of $A$ (including +$\emptyset$) whose element-sum equals $g$. -/ +def subsetSumCount {G : Type*} [AddCommGroup G] [DecidableEq G] + (A : Finset G) (g : G) : ℕ := + (A.powerset.filter (fun S => S.sum id = g)).card + +/-- A $k$-subset $A$ of a finite abelian group $G$ of size $N$ is +$\varepsilon$-approximation-uniform if the subset-sum counts are uniformly close to their +"expected" value $2^k/N$: +$$|F_A(g) - 2^k/N| \leq \varepsilon \cdot 2^k/N \quad \text{for all } g \in G.$$ -/ +def IsApproxUniform {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] + (ε : ℝ) (A : Finset G) : Prop := + let N : ℕ := Fintype.card G + let k : ℕ := A.card + ∀ g : G, |((subsetSumCount A g : ℝ) - (2 : ℝ) ^ k / N)| ≤ ε * (2 : ℝ) ^ k / N + +/-- The fraction of $k$-subsets $A$ of a finite abelian group $G$ that are +$\varepsilon$-approximation-uniform. This models the probability that a uniformly random +$k$-subset satisfies the approximation. -/ +noncomputable def goodFraction {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] + (ε : ℝ) (k : ℕ) : ℝ := + let all := (Finset.univ : Finset G).powersetCard k + let good := @Finset.filter (Finset G) (fun A => IsApproxUniform ε A) (Classical.decPred _) all + good.card / all.card + +/-- $g_\varepsilon(N)$ is the minimal $k$ such that for every finite abelian group $G$ of order +$N$, the fraction of $k$-subsets that are $\varepsilon$-approximation-uniform is at least +$1 - 1/N$. This captures the condition "with probability $\to 1$ as $N \to \infty$" for +each $N$. -/ +noncomputable def gEps (ε : ℝ) (N : ℕ) : ℕ := + sInf {k : ℕ | ∀ (G : Type) [hG : AddCommGroup G] [hF : Fintype G] [hD : DecidableEq G], + Fintype.card G = N → + @goodFraction G hG hF hD ε k ≥ 1 - 1 / (N : ℝ)} + +/-- +Erdős Problem 1179: + +For all $0 < \varepsilon < 1$, $g_\varepsilon(N) = (1 + o_\varepsilon(1)) \log_2 N$ as +$N \to \infty$, i.e., $g_\varepsilon(N) / \log_2 N \to 1$ as $N \to \infty$. + +Here $g_\varepsilon(N)$ is the minimal $k$ such that for every abelian group $G$ of order $N$, +at least a $(1 - 1/N)$ fraction of all $k$-subsets $A$ of $G$ satisfy +$$|F_A(g) - 2^k/N| \leq \varepsilon \cdot 2^k/N \quad \text{for all } g \in G,$$ +where $F_A(g) = \#\{S \subseteq A : \sum_{x \in S} x = g\}$. + +The lower bound $g_\varepsilon(N) \geq \log_2 N$ is trivial. +Erdős and Rényi [ErRe65] proved $g_\varepsilon(N) \leq (2 + o(1)) \log_2 N + O_\varepsilon(1)$. +Erdős and Hall [ErHa76] proved +$g_\varepsilon(N) \leq (1 + O_\varepsilon(\log \log \log N / \log \log N)) \log_2 N$. +-/ +@[category research solved, AMS 5 60] +theorem erdos_1179 : answer(True) ↔ + ∀ ε : ℝ, 0 < ε → ε < 1 → + Tendsto (fun N : ℕ => (gEps ε N : ℝ) / Real.logb 2 N) + atTop (nhds 1) := by + sorry + +end Erdos1179 diff --git a/FormalConjectures/ErdosProblems/118.lean b/FormalConjectures/ErdosProblems/118.lean new file mode 100644 index 0000000000..d19a1d6139 --- /dev/null +++ b/FormalConjectures/ErdosProblems/118.lean @@ -0,0 +1,116 @@ +/- +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 118 + +*Reference:* [erdosproblems.com/118](https://www.erdosproblems.com/118) + +Erdős–Hajnal conjecture on partition ordinals (disproved): if $\alpha \to (\alpha, 3)^2$, does +$\alpha \to (\alpha, n)^2$ hold for all $n \geq 3$? Independently disproved by Schipperus and +Darby. + +[Er87] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. + +[Er90] Erdős, P., *Some of my favourite problems in number theory, combinatorics, and geometry*. + +[Er95d] Erdős, P., *Problems and results on finite and infinite combinatorial analysis*. + +[Er97f] Erdős, P., *Some problems on finite and infinite graphs*. + +[Sc99] Schipperus, R., *Countable partition ordinals*, PhD thesis, University of Colorado +at Boulder, 1999. + +[Sc10] Schipperus, R., *Countable partition ordinals*, Ann. Pure Appl. Logic 161 (2010), +no. 10, 1195–1215. + +[Da99] Darby, C., *Negative partition relations for ordinals $\omega^{\omega^\alpha}$*, +J. Combin. Theory Ser. B (1999), 205–222. + +[La00] Larson, J.A., *An ordinal partition avoiding pentagrams*, J. Symbolic Logic (2000), +969–978. + +[HST10] Hajnal, A. and Larson, J.A., *Partition relations*, in: Handbook of Set Theory, +Springer, 2010. + +See also Erdős problems 590, 591, 592. +-/ + +open Ordinal + +namespace Erdos118 + +/-- The "underlying type" of ordinal $\alpha$: the set of all ordinals strictly less +than $\alpha$, linearly ordered by the natural ordering on ordinals. -/ +abbrev OrdinalSet (α : Ordinal) := {a : Ordinal // a < α} + +/-- The ordinal partition relation $\alpha \to (\beta, \gamma)^2$: +every $2$-coloring of the pairs of elements of $\alpha$ (viewed as the set of +ordinals less than $\alpha$) contains either: +- an order-embedded copy of $\beta$ whose pairs are all colored $0$ (red), or +- an order-embedded copy of $\gamma$ whose pairs are all colored $1$ (blue). + +Here a "copy of $\beta$" is given by an order embedding +$e : \operatorname{OrdinalSet}(\beta) \hookrightarrow \operatorname{OrdinalSet}(\alpha)$, +and monochromaticity means $f(e(i), e(j)) = c$ for all $i < j$. -/ +def OrdPartition (α β γ : Ordinal) : Prop := + ∀ (f : OrdinalSet α → OrdinalSet α → Fin 2), + (∃ e : OrdinalSet β ↪o OrdinalSet α, + ∀ i j : OrdinalSet β, i < j → f (e i) (e j) = 0) ∨ + (∃ e : OrdinalSet γ ↪o OrdinalSet α, + ∀ i j : OrdinalSet γ, i < j → f (e i) (e j) = 1) + +/-- +Erdős–Hajnal Conjecture on Partition Ordinals (Problem 118) +[Er87, Er90, Er95d, Er97f] — **DISPROVED** + +An ordinal $\alpha$ is called a *partition ordinal* if $\alpha \to (\alpha, 3)^2$, i.e., every +$2$-coloring of pairs from a linearly ordered set of order type $\alpha$ contains either +a monochromatic copy of $\alpha$ in color $0$ (red) or a monochromatic triangle $K_3$ in +color $1$ (blue). + +Erdős and Hajnal conjectured that for every partition ordinal $\alpha$ and every $n \geq 3$, +we also have $\alpha \to (\alpha, n)^2$. + +This conjecture is FALSE, as independently shown by Schipperus [Sc99] (published in +[Sc10]) and Darby [Da99]. For example, Larson [La00] showed that $\omega^{\omega^2}$ is a +partition ordinal — i.e., $\omega^{\omega^2} \to (\omega^{\omega^2}, 3)^2$ holds — but +$\omega^{\omega^2} \to (\omega^{\omega^2}, 5)^2$ fails. + +See also Hajnal–Larson, Chapter 2.9 of [HST10] for background and proof sketches. +-/ +@[category research solved, AMS 3 5] +theorem erdos_118 : answer(False) ↔ ∀ (α : Ordinal), OrdPartition α α 3 → + ∀ n : ℕ, 3 ≤ n → OrdPartition α α (↑n) := by + sorry + +/-- +Explicit counterexample to the Erdős–Hajnal conjecture (Problem 118): +$\omega^{\omega^2} \to (\omega^{\omega^2}, 3)^2$ holds (i.e., $\omega^{\omega^2}$ is a +partition ordinal), but $\omega^{\omega^2} \to (\omega^{\omega^2}, 5)^2$ fails. + +This was shown by Larson [La00] (the partition ordinal property) and the failure for $n = 5$ +follows from the counterexamples of Schipperus [Sc99, Sc10] and Darby [Da99]. +-/ +@[category research solved, AMS 3 5] +theorem erdos_118_counterexample : + OrdPartition (ω ^ (ω ^ 2)) (ω ^ (ω ^ 2)) 3 ∧ + ¬ OrdPartition (ω ^ (ω ^ 2)) (ω ^ (ω ^ 2)) 5 := by + sorry + +end Erdos118 diff --git a/FormalConjectures/ErdosProblems/121.lean b/FormalConjectures/ErdosProblems/121.lean new file mode 100644 index 0000000000..7fe40a0700 --- /dev/null +++ b/FormalConjectures/ErdosProblems/121.lean @@ -0,0 +1,106 @@ +/- +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 121 + +*Reference:* [erdosproblems.com/121](https://www.erdosproblems.com/121) + +Let $F_k(N)$ be the size of the largest subset of $\{1, \ldots, N\}$ with no $k$ distinct +elements whose product is a perfect square. Erdős–Sós–Sárközy conjectured +$F_{2k+1}(N) = (1 - o(1))N$ for $k \geq 2$; disproved by Tao, who showed $F_k(N) \leq +(1 - c_k)N$ for all $k \geq 4$. + +[Er94b] [Er97] [Er97e] [Er98] Erdős, P., various problems papers. + +[ESS95] Erdős, P., Sárközy, A., and Sós, V. T., _On product representations of powers. I_. +European Journal of Combinatorics (1995), 567-588. + +[Er38] Erdős, P., _On sequences of integers no one of which divides the product of two others +and on related problems_. Tomsk. Gos. Univ. Ucen Zap. (1938), 74-82. + +[GrSo01] Granville, A. and Soundararajan, K., _The spectrum of multiplicative functions_. +Annals of Mathematics (2) (2001), 407-470. + +[Ta24] Tao, T., _On product representations of squares_. arXiv:2405.11610 (2024). +-/ + +open scoped BigOperators + +open Filter + +namespace Erdos121 + +/-- A finset $A$ has the property that no $k$ distinct elements have a product that is +a perfect square. -/ +def NoKSquareProduct (k : ℕ) (A : Finset ℕ) : Prop := + ∀ B : Finset ℕ, B ⊆ A → B.card = k → ¬IsSquare (∏ b ∈ B, b) + +/-- $F(k, N)$ is the size of the largest subset $A$ of $\{1, \ldots, N\}$ such that +no $k$ distinct elements of $A$ have a product that is a perfect square. -/ +noncomputable def F (k N : ℕ) : ℕ := + sSup {m : ℕ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ A.card = m ∧ NoKSquareProduct k A} + +/-- +Erdős Problem #121 [Er94b, Er97, Er97e, Er98] — DISPROVED + +Let $F_k(N)$ be the size of the largest $A \subseteq \{1,\ldots,N\}$ such that the product +of no $k$ distinct elements of $A$ is a perfect square. + +Conjectured by Erdős, Sós, and Sárközy [ESS95]: Is $F_{2k+1}(N) = (1 - o(1)) N$ for all +$k \geq 2$? Answered in the negative by Tao [Ta24]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_121 : answer(False) ↔ + ∀ k : ℕ, 2 ≤ k → + Tendsto (fun N => (F (2 * k + 1) N : ℝ) / (N : ℝ)) atTop (nhds 1) := by + sorry + +/-- +Tao [Ta24] proved that for any $k \geq 4$ there exists a constant $c_k > 0$ such that +$F_k(N) \leq (1 - c_k + o(1)) N$, disproving the conjecture for all odd $k \geq 5$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_121.variants.tao_upper_bound : + ∀ k : ℕ, 4 ≤ k → + ∃ c : ℝ, 0 < c ∧ + ∀ ε : ℝ, 0 < ε → + ∀ᶠ N : ℕ in atTop, (F k N : ℝ) ≤ (1 - c + ε) * N := by + sorry + +/-- +Erdős–Sós–Sárközy [ESS95] proved that $F_2(N) = (6/\pi^2 + o(1)) N$. +That is, the largest subset of $\{1, \ldots, N\}$ with no two distinct elements whose product +is a perfect square has asymptotic density $6/\pi^2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_121.variants.F2_asymptotic : + Tendsto (fun N => (F 2 N : ℝ) / (N : ℝ)) atTop (nhds (6 / Real.pi ^ 2)) := by + sorry + +/-- +Erdős–Sós–Sárközy [ESS95] proved that $F_3(N) = (1 - o(1)) N$. +That is, almost all of $\{1, \ldots, N\}$ can be taken while avoiding three distinct elements +whose product is a perfect square. +-/ +@[category research solved, AMS 5 11] +theorem erdos_121.variants.F3_asymptotic : + Tendsto (fun N => (F 3 N : ℝ) / (N : ℝ)) atTop (nhds 1) := by + sorry + +end Erdos121 diff --git a/FormalConjectures/ErdosProblems/122.lean b/FormalConjectures/ErdosProblems/122.lean new file mode 100644 index 0000000000..bfc07c0140 --- /dev/null +++ b/FormalConjectures/ErdosProblems/122.lean @@ -0,0 +1,103 @@ +/- +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 + +/-! +# Erdős Problem 122 + +*Reference:* [erdosproblems.com/122](https://www.erdosproblems.com/122) + +For which arithmetic functions $f$ is it true that the count of $n$ with $n + f(n)$ in a +short interval $(x, x + F(x))$, divided by $F(x)$, is unbounded? Erdős–Pomerance–Sárközy +proved this for $f = \tau$ (divisor count) and $f = \omega$ (distinct prime factor count). + +[Er97] Erdős, P., *Some of my new and almost new problems and results in combinatorial +number theory* (1997). + +[Er97e] Erdős, P., *Some problems and results on combinatorial number theory* (1997). + +[EPS97] Erdős, P., Pomerance, C., and Sárközy, A., *On locally repeated values of certain +arithmetic functions, III* (1997). +-/ + +open scoped Classical ArithmeticFunction.sigma + +open Filter + +namespace Erdos122 + +/-- The count of natural numbers $n$ such that $n + f(n)$ falls in the open real +interval $(x, x + F(x))$. Since $n \le n + f(n) < x + F(x)$ requires $n < x + F(x)$, +it suffices to search $n$ in the range $[0, x + \lceil F(x) \rceil]$. -/ +noncomputable def shiftCount (f : ℕ → ℕ) (F : ℕ → ℝ) (x : ℕ) : ℕ := + ((Finset.range (x + ⌈F x⌉₊ + 1)).filter + (fun (n : ℕ) => (x : ℝ) < (n : ℝ) + (f n : ℝ) ∧ + (n : ℝ) + (f n : ℝ) < (x : ℝ) + F x)).card + +/-- $f(n)/F(n) \to 0$ for almost all $n$ in the natural-density sense: +for every $\varepsilon > 0$, the set $\{n : f(n)/F(n) \ge \varepsilon\}$ has natural +density zero. -/ +def AlmostAllRatioVanishes (f : ℕ → ℕ) (F : ℕ → ℝ) : Prop := + ∀ ε : ℝ, 0 < ε → Set.HasDensity {n : ℕ | ε ≤ (f n : ℝ) / F n} 0 + +/-- The Erdős-122 property of $f$: for any positive $F$ with $f(n)/F(n) \to 0$ +in natural density, the ratio $\#\{n \in \mathbb{N} : n+f(n) \in (x, x+F(x))\} / F(x)$ +is unbounded as $x \to \infty$ (equivalently, its limsup equals $+\infty$). -/ +def HasErdos122Property (f : ℕ → ℕ) : Prop := + ∀ F : ℕ → ℝ, (∀ n, 0 < F n) → AlmostAllRatioVanishes f F → + ∀ C : ℝ, ∃ᶠ x : ℕ in atTop, C < (shiftCount f F x : ℝ) / F x + +/-- +Erdős Problem #122 [Er97, Er97e, EPS97] + +For which number-theoretic functions $f : \mathbb{N} \to \mathbb{N}$ is it true that for any +positive function $F : \mathbb{N} \to \mathbb{R}$ satisfying $f(n)/F(n) \to 0$ for almost all $n$ +(in the natural density sense), there are infinitely many $x$ for which +$$\#\{n \in \mathbb{N} : n + f(n) \in (x, x + F(x))\} / F(x) \to \infty?$$ + +Erdős, Pomerance, and Sárközy [EPS97] proved that this holds when: +- $f(n) = \tau(n)$ = number of divisors of $n$, and +- $f(n) = \omega(n)$ = number of distinct prime divisors of $n$. + +Erdős believed the property to be FALSE for: +- $f(n) = \varphi(n)$ (Euler's totient function), and +- $f(n) = \sigma(n)$ (sum of divisors). + +The full characterization of which $f$ satisfy `HasErdos122Property` remains open. +The theorem below records the two proved instances. +-/ +@[category research solved, AMS 11] +theorem erdos_122 : + HasErdos122Property (fun n => (Nat.divisors n).card) ∧ + HasErdos122Property (fun n => n.primeFactors.card) := by + sorry + +/-- +Erdős conjectured that `HasErdos122Property` is FALSE for Euler's totient function $\varphi$. +-/ +@[category research open, AMS 11] +theorem erdos_122_totient : ¬ HasErdos122Property Nat.totient := by sorry + +/-- +Erdős conjectured that `HasErdos122Property` is FALSE for the sum-of-divisors function $\sigma$. +Here $\sigma_1(n)$ denotes $\sum_{d \mid n} d$. +-/ +@[category research open, AMS 11] +theorem erdos_122_sigma : ¬ HasErdos122Property (fun n => σ 1 n) := by sorry + +end Erdos122 diff --git a/FormalConjectures/ErdosProblems/127.lean b/FormalConjectures/ErdosProblems/127.lean new file mode 100644 index 0000000000..eb96ea3287 --- /dev/null +++ b/FormalConjectures/ErdosProblems/127.lean @@ -0,0 +1,117 @@ +/- +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 127 + +*Reference:* [erdosproblems.com/127](https://www.erdosproblems.com/127) + +Let $f(m)$ be the excess of the maximum bipartite subgraph size over the Edwards bound +$m/2 + (\sqrt{8m+1} - 1)/8$. Is $f(m)$ unbounded? Proved by Alon. + +[Ed73] Edwards, C.S., _Some extremal properties of bipartite subgraphs_, +Canadian Journal of Mathematics (1973). + +[Al96] Alon, N., _Bipartite subgraphs_, Combinatorica 16 (1996), 301–311. +-/ + +open Real Filter + +namespace Erdos127 + +/-- +For a finite simple graph $G$ and a vertex subset $S$, the cut defined by $S$ +consists of edges with exactly one endpoint in $S$. We count these as ordered pairs +$(v, w)$ with $v \in S$, $w \notin S$, and $v \sim w$; since the adjacency relation +is symmetric and $S$ and $S^c$ are disjoint, each undirected cut edge is counted exactly +once (from its $S$-side endpoint). +-/ +noncomputable def cutSize {V : Type*} [DecidableEq V] [Fintype V] + (G : SimpleGraph V) [DecidableRel G.Adj] (S : Finset V) : ℕ := + ((Finset.univ ×ˢ Finset.univ).filter fun p : V × V => + p.1 ∈ S ∧ p.2 ∉ S ∧ G.Adj p.1 p.2).card + +/-- +The maximum bipartite subgraph size of $G$: the maximum over all vertex bipartitions +$(S, S^c)$ of the number of edges crossing the cut. This equals the maximum number of +edges in any bipartite subgraph of $G$ (the max-cut). +-/ +noncomputable def maxBipartiteSubgraphSize {V : Type*} [DecidableEq V] [Fintype V] + (G : SimpleGraph V) [DecidableRel G.Adj] : ℕ := + Finset.univ.sup (cutSize G) + +/-- +The Edwards lower bound: every graph with $m$ edges has a bipartite subgraph of size at +least $m/2 + (\sqrt{8m+1} - 1)/8$. Proved by Edwards [Ed73]. +-/ +noncomputable def edwardsLB (m : ℕ) : ℝ := + (m : ℝ) / 2 + (Real.sqrt (8 * (m : ℝ) + 1) - 1) / 8 + +/-- +$f(m)$ is the maximal value $r$ such that every finite simple graph with $m$ edges has a +bipartite subgraph with at least $\operatorname{edwardsLB}(m) + r$ edges. Equivalently, +$f(m)$ is the infimum over all finite simple graphs $G$ with exactly $m$ edges of the excess +$$\operatorname{maxBipartiteSubgraphSize}(G) - \operatorname{edwardsLB}(m).$$ + +Edwards [Ed73] proved $f(m) \geq 0$ for all $m$. Note that +$f\left(\binom{n}{2}\right) = 0$, achieved by $K_n$. +-/ +noncomputable def f (m : ℕ) : ℝ := + sInf {r : ℝ | ∃ (V : Type) (_ : Fintype V) (_ : DecidableEq V) + (G : SimpleGraph V) (_ : DecidableRel G.Adj), + G.edgeFinset.card = m ∧ r = (maxBipartiteSubgraphSize G : ℝ) - edwardsLB m} + +/-- +Erdős Problem 127 (Erdős–Kohayakawa–Gyárfás; solved by Alon [Al96]): +Let $f(m)$ be maximal such that every graph with $m$ edges contains a bipartite subgraph with +at least $m/2 + (\sqrt{8m+1} - 1)/8 + f(m)$ edges. +There exists an infinite sequence of integers $(m_i)$ with $m_i \to \infty$ such that +$f(m_i) \to \infty$. + +Edwards [Ed73] proved $f(m) \geq 0$ for all $m$. +Alon [Al96] proved this in the affirmative: $f(n^2/2) \gg n^{1/2}$. +Alon [Al96] also showed the upper bound $f(m) \ll m^{1/4}$ for all $m$. +-/ +@[category research solved, AMS 5] +theorem erdos_127 : answer(True) ↔ + ∃ (seq : ℕ → ℕ), StrictMono seq ∧ + Filter.Tendsto (fun i => f (seq i)) Filter.atTop Filter.atTop := by + sorry + +/-- +Alon's lower bound [Al96]: $f(n^2/2) \gg n^{1/2}$, i.e., there exists a constant $c > 0$ such +that for all sufficiently large $n$, $f(\lfloor n^2/2 \rfloor) \geq c \sqrt{n}$. +This is the quantitative content of Alon's proof that $f$ is unbounded. +-/ +@[category research solved, AMS 5] +theorem erdos_127_alon_lower_bound : + ∃ c : ℝ, c > 0 ∧ ∀ᶠ n : ℕ in Filter.atTop, + f (n ^ 2 / 2) ≥ c * Real.sqrt (n : ℝ) := by + sorry + +/-- +Alon's upper bound [Al96]: $f(m) \ll m^{1/4}$, i.e., there exists a constant $C > 0$ such +that $f(m) \leq C \cdot m^{1/4}$ for all $m$. +-/ +@[category research solved, AMS 5] +theorem erdos_127_alon_upper_bound : + ∃ C : ℝ, C > 0 ∧ ∀ m : ℕ, + f m ≤ C * (m : ℝ) ^ (1 / 4 : ℝ) := by + sorry + +end Erdos127 diff --git a/FormalConjectures/ErdosProblems/129.lean b/FormalConjectures/ErdosProblems/129.lean new file mode 100644 index 0000000000..50bbbd3df7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/129.lean @@ -0,0 +1,109 @@ +/- +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 129 + +*Reference:* [erdosproblems.com/129](https://www.erdosproblems.com/129) + +Let $R(n; k, r)$ be the smallest $N$ such that if the edges of $K_N$ are $r$-coloured +then there is a set of $n$ vertices which does not contain a copy of $K_k$ in at +least one of the $r$ colours. Erdős and Gyárfás conjectured that there exists a +constant $C = C(r) > 1$ such that $R(n; 3, r) < C^{\sqrt{n}}$. + +As pointed out by Antonio Girao, the problem as stated is easily +disproved. A probabilistic argument shows $R(n; 3, 2) \geq C^n$ for some $C > 1$, +contradicting the claimed bound. The correct formulation is unclear. + +[Er97b] Erdős, P. and Gyárfás, A., *A variant of the classical Ramsey problem*, +Combinatorica **17** (1997), 459–467. +-/ + +namespace Erdos129 + +/-- An $r$-edge-coloring of the complete graph $K_N$: a function that assigns a +color in $\operatorname{Fin} r$ to each ordered pair of vertices. +Note: this allows coloring of self-loops ($\chi\, x\, x$), which is semantically +meaningless for $K_N$ but harmless since `IsMonoKkFree` only examines pairs +with $x \ne y$. -/ +def EdgeColoring (N r : ℕ) : Type := Fin N → Fin N → Fin r + +/-- A vertex set $S$ is monochromatic-$K_k$-free in color $c$ under coloring $\chi$ if +there is no $k$-element subset of $S$ in which every pair of distinct vertices +receives color $c$. -/ +def IsMonoKkFree {N r : ℕ} (χ : EdgeColoring N r) (c : Fin r) + (k : ℕ) (S : Finset (Fin N)) : Prop := + ∀ T : Finset (Fin N), T ⊆ S → T.card = k → + ∃ x ∈ T, ∃ y ∈ T, x ≠ y ∧ χ x y ≠ c + +/-- The generalized Ramsey number $R(n; k, r)$: the smallest $N$ such that for +every symmetric $r$-coloring of the edges of $K_N$ (i.e., $\chi\, x\, y = \chi\, y\, x$), +there exists a set of $n$ vertices and a color $c$ such that the set is +$K_k$-free in color $c$. -/ +noncomputable def multicolorRamseyNum (n k r : ℕ) : ℕ := + sInf {N : ℕ | ∀ (χ : EdgeColoring N r), (∀ x y, χ x y = χ y x) → + ∃ (S : Finset (Fin N)) (c : Fin r), + S.card = n ∧ IsMonoKkFree χ c k S} + +/-- +Erdős–Gyárfás Conjecture (Problem 129) [Er97b]: +For every $r \geq 1$, does there exist a constant $C = C(r) > 1$ such that +$R(n; 3, r) < C^{\sqrt{n}}$ for all positive integers $n$? + +The conjecture is **disproved** (`answer(False)`): as observed by Antonio Girao, +a probabilistic coloring of $K_N$ (each edge independently uniformly at random +in $r$ colors) shows $R(n; 3, 2) \geq C^n$ for some $C > 1$, which grows faster +than $C^{\sqrt{n}}$, contradicting the conjectured upper bound. +-/ +@[category research solved, AMS 5] +theorem erdos_129 : answer(False) ↔ + ∀ r : ℕ, 1 ≤ r → + ∃ C : ℝ, 1 < C ∧ + ∀ n : ℕ, (multicolorRamseyNum n 3 r : ℝ) < C ^ Real.sqrt (n : ℝ) := by + sorry + +/-- +Lower bound proved by Erdős and Gyárfás [Er97b]: for every $r \geq 1$, +there exists a constant $C = C(r) > 1$ such that $R(n; 3, r) > C^{\sqrt{n}}$ +for all positive integers $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_129_lower_bound : + ∀ r : ℕ, 1 ≤ r → + ∃ C : ℝ, 1 < C ∧ + ∀ n : ℕ, C ^ Real.sqrt (n : ℝ) < (multicolorRamseyNum n 3 r : ℝ) := by + sorry + +/-- +Generalized Erdős–Gyárfás conjecture [Er97b]: for all $r, k \geq 2$, +there exist constants $C_1, C_2 > 1$ (depending only on $r$) such that +$C_1^{n^{1/(k-1)}} < R(n; k, r) < C_2^{n^{1/(k-1)}}$. +The status of this generalized conjecture is unclear given the issues with +the $k = 3$ upper bound. +-/ +@[category research open, AMS 5] +theorem erdos_129_general_bounds : + ∀ r : ℕ, 2 ≤ r → ∀ k : ℕ, 2 ≤ k → + ∃ C₁ C₂ : ℝ, 1 < C₁ ∧ 1 < C₂ ∧ + ∀ n : ℕ, C₁ ^ (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 1)) + < (multicolorRamseyNum n k r : ℝ) + ∧ (multicolorRamseyNum n k r : ℝ) + < C₂ ^ (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 1)) := by + sorry + +end Erdos129 diff --git a/FormalConjectures/ErdosProblems/130.lean b/FormalConjectures/ErdosProblems/130.lean new file mode 100644 index 0000000000..0990c5e821 --- /dev/null +++ b/FormalConjectures/ErdosProblems/130.lean @@ -0,0 +1,78 @@ +/- +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 130 + +*Reference:* [erdosproblems.com/130](https://www.erdosproblems.com/130) + +Related to [Problem 213](https://www.erdosproblems.com/213). + +Let $A \subseteq \mathbb{R}^2$ be an infinite set with no three collinear and no four concyclic +points. Can the integer-distance graph on $A$ (adjacent iff at integer distance) have infinite +chromatic number? + +[Er97b] Erdős, P., _Some old and new problems in various branches of combinatorics_, +Discrete Mathematics (1997), 227-231. + +[AnEr45] Anning, N.H. and Erdős, P., _Integral distances_, Bull. Amer. Math. Soc. (1945), +598-600. +-/ + +open SimpleGraph EuclideanGeometry + +namespace Erdos130 + +/-- A point set $A \subseteq \mathbb{R}^2$ is in Erdős general position if no three distinct +points of $A$ are collinear, and no four distinct points of $A$ are concyclic. -/ +def ErdosGeneralPosition (A : Set ℝ²) : Prop := + NonTrilinear A ∧ + (∀ Q : Set ℝ², Q ⊆ A ∧ Q.ncard = 4 → ¬ EuclideanGeometry.Cospherical Q) + +/-- The integer-distance graph on a point set $A \subseteq \mathbb{R}^2$: vertices are points +of $A$, and two distinct points are adjacent if and only if their Euclidean distance +is a positive integer. -/ +noncomputable def intDistGraph (A : Set ℝ²) : + SimpleGraph ↥A where + Adj p q := (p : ℝ²) ≠ q ∧ + ∃ n : ℕ, 0 < n ∧ dist (p : ℝ²) (q : ℝ²) = n + symm := fun _p _q ⟨hne, n, hn, hd⟩ => + ⟨hne.symm, n, hn, by rw [_root_.dist_comm]; exact hd⟩ + loopless := fun _ ⟨hne, _⟩ => hne rfl + +/-- +Erdős Problem 130 [Er97b] (asked by Andrásfai and Erdős): +Let $A \subseteq \mathbb{R}^2$ be an infinite set with no three points collinear and no four +points concyclic. Consider the integer-distance graph $G$ on $A$, where two distinct points +are adjacent if and only if their Euclidean distance is a positive integer. + +Can the chromatic number of $G$ be infinite? + +Note: The clique number is always finite. The Anning–Erdős theorem [AnEr45] +shows that any infinite set of points in the plane with all pairwise integer +distances must be collinear; since $A$ has no three collinear points, $A$ contains +no infinite complete subgraph. +-/ +@[category research open, AMS 5 51] +theorem erdos_130 : answer(sorry) ↔ + ∃ (A : Set ℝ²), + A.Infinite ∧ ErdosGeneralPosition A ∧ + (intDistGraph A).chromaticNumber = ⊤ := by + sorry + +end Erdos130 diff --git a/FormalConjectures/ErdosProblems/131.lean b/FormalConjectures/ErdosProblems/131.lean new file mode 100644 index 0000000000..670ebf048f --- /dev/null +++ b/FormalConjectures/ErdosProblems/131.lean @@ -0,0 +1,107 @@ +/- +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 131 + +*Reference:* [erdosproblems.com/131](https://www.erdosproblems.com/131) + +Let $F(N)$ be the maximal size of $A \subseteq \{1, \ldots, N\}$ such that no $a \in A$ divides +the sum of any distinct elements of $A \setminus \{a\}$. Estimate $F(N)$. + +The specific question "is $F(N) > N^{1/2 - o(1)}$?" has been answered NO by +Pham and Zakharov, who proved $F(N) \leq N^{1/4 + o(1)}$ via non-averaging sets +(see also Problem 186 for non-averaging sets). +The correct growth rate of $F(N)$ remains open. + +Known bounds: +- Straus: $F(N) > \exp((\sqrt{2/\log 2}+o(1))\sqrt{\log N})$ +- Csaba [Er97b]: $F(N) \gg N^{1/5}$ +- Erdős–Lev–Rauzy–Sándor–Sárközy [ELRSS99]: $F(N) < 3N^{1/2} + 1$ +- Pham–Zakharov [PhZa24]: $F(N) \leq N^{1/4 + o(1)}$ + +OEIS: [A068063](https://oeis.org/A068063) + +[Er75b] Erdős, P., *Problems and results on combinatorial number theory III*. +Journées Arithmétiques de Bordeaux (1975), 295–310. + +[Er97b] Erdős, P., *Some of my new and almost new problems and results in combinatorial +number theory*. Discrete Mathematics (1997), 227–231. + +[ELRSS99] Erdős, P., Lev, V., Rauzy, G., Sándor, C., Sárközy, A., *Greedy algorithm, +arithmetic progressions, subset sums and divisibility*. Discrete Mathematics (1999), 119–135. + +[PhZa24] Pham, H. T., Zakharov, D., *Sharp bound for the Erdős-Straus non-averaging set +problem*. arXiv:2410.14624 (2024). + +[Gu04] Guy, R., *Unsolved Problems in Number Theory*, 3rd ed. Springer, 2004, Problem C16. +-/ + +open Filter + +namespace Erdos131 + +/-- A finite set $A \subseteq \mathbb{N}$ is *non-dividing* if for every $a \in A$ and every +nonempty $S \subseteq A \setminus \{a\}$, the element $a$ does not divide $\sum_{s \in S} s$. -/ +def IsNonDividing (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A.erase a → S.Nonempty → ¬(a ∣ S.sum id) + +/-- $F(N)$ is the maximal cardinality of a non-dividing subset of $\{1, \ldots, N\}$. -/ +noncomputable def erdos131F (N : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ IsNonDividing A ∧ A.card = k} + +/-- +Erdős Problem 131 [Er75b, Er97b]: +Let $F(N)$ be the maximal size of a non-dividing subset of $\{1, \ldots, N\}$. +The open problem is to determine the correct polynomial growth rate of $F(N)$. + +Known bounds: +- $F(N) \gg N^{1/5}$ (Csaba, cited in [Er97b]) +- $F(N) \leq N^{1/4 + o(1)}$ (Pham–Zakharov [PhZa24], via non-averaging sets) + +This conjecture asserts that the Pham–Zakharov upper bound is essentially tight: +$F(N) \geq N^{1/4 - \varepsilon}$ for any $\varepsilon > 0$ and all sufficiently large $N$. +-/ +@[category research open, AMS 5 11] +theorem erdos_131 : + ∀ ε : ℝ, 0 < ε → + ∀ᶠ N : ℕ in atTop, (erdos131F N : ℝ) ≥ (N : ℝ) ^ ((1 : ℝ) / 4 - ε) := by + sorry + +/-- +Pham–Zakharov upper bound [PhZa24]: $F(N) \leq N^{1/4 + \varepsilon}$ for any $\varepsilon > 0$ +and all sufficiently large $N$. This is a proven result, established via the connection +to non-averaging sets (see Problem 186). +-/ +@[category research solved, AMS 5 11] +theorem erdos_131_upper : + ∀ ε : ℝ, 0 < ε → + ∀ᶠ N : ℕ in atTop, (erdos131F N : ℝ) ≤ (N : ℝ) ^ ((1 : ℝ) / 4 + ε) := by + sorry + +/-- +Csaba's lower bound (cited in [Er97b]): $F(N) \geq c \cdot N^{1/5}$ for some constant $c > 0$ +and all sufficiently large $N$. This is a proven result. +-/ +@[category research solved, AMS 5 11] +theorem erdos_131_lower : + ∃ c : ℝ, 0 < c ∧ + ∀ᶠ N : ℕ in atTop, (erdos131F N : ℝ) ≥ c * (N : ℝ) ^ ((1 : ℝ) / 5) := by + sorry + +end Erdos131 diff --git a/FormalConjectures/ErdosProblems/132.lean b/FormalConjectures/ErdosProblems/132.lean new file mode 100644 index 0000000000..fd0cb2d71d --- /dev/null +++ b/FormalConjectures/ErdosProblems/132.lean @@ -0,0 +1,138 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 132 + +*Reference:* [erdosproblems.com/132](https://www.erdosproblems.com/132) + +Let $A \subset \mathbb{R}^2$ be a set of $n$ points. Must there be two +distances which occur at least once but between at most $n$ pairs of points? +Must the number of such distances tend to infinity as $n \to \infty$? + +Asked by Erdős and Pach. A "limited-occurrence distance" for $A$ is a value +$d > 0$ such that the number of ordered pairs $(x, y)$ with $x \neq y$ in $A$ +and $\mathrm{dist}(x, y) = d$ is between $1$ and $2n = 2|A|$ inclusive. +(Equivalently, the distance is achieved by at most $n$ unordered pairs.) + +Hopf and Pannwitz [HoPa34] proved that the largest distance between points +of $A$ can occur at most $n$ unordered pairs (i.e., at most $2n$ ordered +pairs), making it a limited-occurrence distance whenever it is realized. +The question is whether a *second* such distance must also always exist. + +Erdős believed that for $n \geq 5$ there must always exist at least two +limited-occurrence distances. Erdős and Fishburn [ErFi95] proved this for +$n = 5$ and $n = 6$. Clemen, Dumitrescu, and Liu [CDL25] proved it for +point sets in convex position. + +Erdős offered $100 for "any nontrivial result" [Er97e]. + +[Er84c] Erdős, P., *Some old and new problems in combinatorial geometry*, +Convexity and graph theory (Jerusalem, 1981), 1984, pp. 129–136. + +[ErPa90] Erdős, P. and Pach, J., *Variations on the theme of repeated distances*, +Combinatorica (1990). + +[HoPa34] Hopf, H. and Pannwitz, E., *Aufgabe Nr. 167*, +Jahresbericht der Deutschen Mathematiker-Vereinigung **43** (1934), p. 114. + +[ErFi95] Erdős, P. and Fishburn, P., *Multiplicities of interpoint distances in finite +planar sets*, Discrete Applied Mathematics (1995), pp. 141–147. + +[Er97b] Erdős, P., *Some of my favourite problems which recently have been solved*, +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). + +[Er97e] Erdős, P., *Some of my favourite unsolved problems*, +Mathematics in Japan (1997), pp. 527–537. + +[CDL25] Clemen, F., Dumitrescu, A., and Liu, D., *On multiplicities of interpoint +distances*, arXiv:2505.04283 (2025). + +See also Problems #223, #756, and #957. +-/ + +open Classical EuclideanGeometry + +namespace Erdos132 + +/-- For a finite point set $A \subseteq \mathbb{R}^2$ and a real value $d$, +the number of ordered pairs $(x, y)$ with $x \neq y$ in $A$ at +Euclidean distance $d$. -/ +noncomputable def pairCount (A : Finset ℝ²) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card + +/-- A distance $d$ is a *limited-occurrence distance* for $A$ if it is +achieved by at least one but at most $2|A|$ ordered pairs of distinct +points of $A$ (equivalently, at most $|A|$ unordered pairs). -/ +def IsLimitedOccurrence (A : Finset ℝ²) (d : ℝ) : Prop := + 0 < pairCount A d ∧ pairCount A d ≤ 2 * A.card + +/-- The set of all limited-occurrence distances for $A$. -/ +noncomputable def limitedOccurrences (A : Finset ℝ²) : Set ℝ := + {d : ℝ | IsLimitedOccurrence A d} + +/-- +Erdős Problem 132, Part 1 [Er84c, ErPa90, ErFi95]: +For any set $A$ of $n \geq 5$ points in the plane $\mathbb{R}^2$, there +must exist at least two distinct limited-occurrence distances. +-/ +@[category research open, AMS 5 52] +theorem erdos_132 : + answer(sorry) ↔ + ∀ A : Finset ℝ², 5 ≤ A.card → + 2 ≤ Set.ncard (limitedOccurrences A) := by + sorry + +/-- +Erdős Problem 132, Part 2 [Er84c, ErPa90]: +The number of limited-occurrence distances must tend to infinity with $n$. +For every $k$, there exists $N$ such that any set $A$ of at least $N$ points +in $\mathbb{R}^2$ has at least $k$ limited-occurrence distances. +-/ +@[category research open, AMS 5 52] +theorem erdos_132.variants.tend_to_infinity : + answer(sorry) ↔ + ∀ k : ℕ, ∃ N : ℕ, ∀ A : Finset ℝ², N ≤ A.card → + k ≤ Set.ncard (limitedOccurrences A) := by + sorry + +/-- +Erdős Problem 132, Convex Position Variant [CDL25]: +For any set $A$ of $n \geq 5$ points in convex position in the plane, there +exist at least two limited-occurrence distances. Proved by Clemen, Dumitrescu, +and Liu (2025). +-/ +@[category research solved, AMS 5 52] +theorem erdos_132.variants.convex_position : + ∀ A : Finset ℝ², 5 ≤ A.card → ConvexIndep (↑A : Set ℝ²) → + 2 ≤ Set.ncard (limitedOccurrences A) := by + sorry + +/-- +Erdős Problem 132, Small Cases [ErFi95]: +For any set $A$ of exactly $5$ or $6$ points in the plane, there exist at +least two limited-occurrence distances. Proved by Erdős and Fishburn (1995). +-/ +@[category research solved, AMS 5 52] +theorem erdos_132.variants.small_cases (A : Finset ℝ²) + (hA : A.card = 5 ∨ A.card = 6) : + 2 ≤ Set.ncard (limitedOccurrences A) := by + sorry + +end Erdos132 diff --git a/FormalConjectures/ErdosProblems/133.lean b/FormalConjectures/ErdosProblems/133.lean new file mode 100644 index 0000000000..188b9c687e --- /dev/null +++ b/FormalConjectures/ErdosProblems/133.lean @@ -0,0 +1,144 @@ +/- +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 133 + +*Reference:* [erdosproblems.com/133](https://www.erdosproblems.com/133) + +Let $f(n)$ be minimal such that every triangle-free graph $G$ with $n$ vertices +and diameter $2$ contains a vertex with degree $\geq f(n)$. + +Does $f(n)/\sqrt{n}\to \infty$? This was asked by Erdős [Er97b]. The answer is +**No**: $f(n) = \Theta(\sqrt{n})$. + +Key results: +- Lower bound: $f(n) \geq \lfloor\sqrt{n-1}\rfloor$ from the Moore bound. +- [HaSe84] Hanson–Seyffarth: $f(n) \leq (\sqrt{2}+o(1))\sqrt{n}$. +- [FuSe94] Füredi–Seress: $f(n) \leq (\frac{2}{\sqrt{3}}+o(1))\sqrt{n}$. +- [HaLe18] Haviv–Levy: alternative construction of symmetric complete sum-free sets. +- The precise asymptotic constant is unknown; Alon conjectures $f(n) \sim \sqrt{n}$. + +## References + +[Er97b] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). + +[HaSe84] Hanson, D., Seyffarth, K., _k-saturated graphs of prescribed maximum degree_. +Congressus Numerantium (1984), 169-182. + +[FuSe94] Füredi, Z., Seress, Á., _Maximal triangle-free graphs with restrictions on the degrees_. +Journal of Graph Theory (1994), 11-24. + +[HaLe18] Haviv, I., Levy, D., _Symmetric complete sum-free sets in cyclic groups_. +Israel Journal of Mathematics (2018), 931-956. +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos133 + +/-- A graph has diameter at most $2$ if every pair of distinct vertices is +either directly adjacent or has a common neighbor. -/ +def HasDiameterAtMostTwo {V : Type*} (G : SimpleGraph V) : Prop := + ∀ u v : V, u ≠ v → G.Adj u v ∨ ∃ w : V, G.Adj u w ∧ G.Adj w v + +/-- $f(n)$ is the largest $k$ such that every triangle-free graph on $n$ vertices +with diameter at most $2$ contains a vertex of degree at least $k$. Equivalently, +it is the minimum of the maximum degree over all such graphs. -/ +noncomputable def erdos133_f (n : ℕ) : ℕ := + sSup { k : ℕ | ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.CliqueFree 3 → HasDiameterAtMostTwo G → + ∃ v : Fin n, k ≤ G.degree v } + +/-- +Erdős Problem 133 (Main question, DISPROVED [HaSe84]): +The conjecture "$f(n)/\sqrt{n} \to \infty$" is false. +The Hanson–Seyffarth construction shows $f(n) = O(\sqrt{n})$, so the ratio +$f(n)/\sqrt{n}$ remains bounded. +-/ +@[category research solved, AMS 5] +theorem erdos_133 : answer(False) ↔ + Tendsto (fun n : ℕ => (erdos133_f n : ℝ) / Real.sqrt n) atTop atTop := by + sorry + +/-- +Erdős Problem 133 (Moore bound lower bound [Er97b]): +$f(n) \geq \lfloor\sqrt{n-1}\rfloor$ for all $n \geq 1$. + +Proof sketch: a graph with max degree $d$ and diameter $\leq 2$ has at most +$1 + d + d(d-1) = d^2+1$ vertices. Hence if $G$ is triangle-free on $n$ +vertices with diameter $\leq 2$ and max degree $d$, then $n \leq d^2+1$, +giving $d \geq \sqrt{n-1}$. +-/ +@[category research solved, AMS 5] +theorem erdos_133.variants.lower_bound (n : ℕ) (hn : 1 ≤ n) : + Nat.sqrt (n - 1) ≤ erdos133_f n := by + sorry + +/-- +Erdős Problem 133 (Hanson–Seyffarth upper bound [HaSe84]): +$f(n) \leq (\sqrt{2} + o(1))\sqrt{n}$. + +For every $\varepsilon > 0$ and all sufficiently large $n$, there exists a +triangle-free graph on $n$ vertices with diameter $\leq 2$ and max degree +$\leq (\sqrt{2} + \varepsilon)\sqrt{n}$. The construction is a Cayley graph on +$\mathbb{Z}/n\mathbb{Z}$ with a symmetric complete sum-free generating set of +size $\sim \sqrt{n}$. +-/ +@[category research solved, AMS 5] +theorem erdos_133.variants.hanson_seyffarth : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (erdos133_f n : ℝ) ≤ (Real.sqrt 2 + ε) * Real.sqrt n := by + sorry + +/-- +Erdős Problem 133 (Füredi–Seress improvement [FuSe94]): +$f(n) \leq (\frac{2}{\sqrt{3}} + o(1))\sqrt{n}$. +-/ +@[category research solved, AMS 5] +theorem erdos_133.variants.furedi_seress : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (erdos133_f n : ℝ) ≤ (2 / Real.sqrt 3 + ε) * Real.sqrt n := by + sorry + +/-- +Erdős Problem 133 (DISPROVED [HaSe84]): +The ratio $f(n)/\sqrt{n}$ remains bounded, i.e., $f(n) = O(\sqrt{n})$. +-/ +@[category research solved, AMS 5] +theorem erdos_133.variants.ratio_bounded : + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + (erdos133_f n : ℝ) ≤ C * Real.sqrt n := by + sorry + +/-- +Erdős Problem 133 (Open — precise asymptotics): +Both the lower bound $f(n) \geq (1 - o(1))\sqrt{n}$ and the upper bound +$f(n) \leq (\frac{2}{\sqrt{3}} + o(1))\sqrt{n}$ are known, but the precise +asymptotic constant is unknown. Alon conjectures $f(n) \sim \sqrt{n}$, i.e., +$f(n)/\sqrt{n} \to 1$. +-/ +@[category research open, AMS 5] +theorem erdos_133.variants.alon_conjecture : + Tendsto (fun n : ℕ => (erdos133_f n : ℝ) / Real.sqrt n) atTop (nhds 1) := by + sorry + +end Erdos133 diff --git a/FormalConjectures/ErdosProblems/134.lean b/FormalConjectures/ErdosProblems/134.lean new file mode 100644 index 0000000000..d72262e0d3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/134.lean @@ -0,0 +1,91 @@ +/- +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 134 + +*Reference:* [erdosproblems.com/134](https://www.erdosproblems.com/134) + +Let $\varepsilon, \delta > 0$ and $n$ be sufficiently large in terms of $\varepsilon$ and $\delta$. +Let $G$ be a triangle-free graph on $n$ vertices with maximum degree $< n^{1/2 - \varepsilon}$. + +Can $G$ be made into a triangle-free graph with diameter $2$ by adding at most $\delta n^2$ edges? + +Asked by Erdős and Gyárfás, who proved this is the case when $G$ has maximum degree +$\ll \log n / \log \log n$. A construction of Simonovits shows the conjecture fails if the +maximum degree bound is relaxed to $\leq Cn^{1/2}$ for a large enough constant $C$. + +Proved in the affirmative by Alon [Al94]: a triangle-free graph on $n$ vertices with +maximum degree $< n^{1/2 - \varepsilon}$ can be made into a triangle-free graph with diameter $2$ +by adding at most $O(n^{2 - \varepsilon})$ edges. + +[Al94] Alon, N., _Explicit Ramsey graphs and orthonormal labelings_ (1994). + +[Er97b] Erdős, P., _Some old and new problems in various branches of combinatorics_ (1997). + +See also Problem 618. +-/ + +open Filter + +namespace Erdos134 + +/-- A graph has diameter at most $2$ if every pair of distinct vertices is +either adjacent or shares a common neighbor. -/ +def HasDiameterAtMostTwo {V : Type*} (G : SimpleGraph V) : Prop := + ∀ u v : V, u ≠ v → G.Adj u v ∨ ∃ w : V, G.Adj u w ∧ G.Adj w v + +/-- +Erdős Problem 134 [Er97b] (proved by Alon [Al94]): + +For every $\varepsilon, \delta > 0$ and all sufficiently large $n$, every triangle-free graph on +$n$ vertices with maximum degree $< n^{1/2 - \varepsilon}$ can be extended to a triangle-free +graph with diameter $\leq 2$ by adding at most $\delta n^2$ edges. +-/ +@[category research solved, AMS 5] +theorem erdos_134 : + answer(True) ↔ + ∀ ε δ : ℝ, 0 < ε → 0 < δ → ∀ᶠ n : ℕ in atTop, + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + (∀ v : Fin n, (G.degree v : ℝ) < (n : ℝ) ^ ((1 : ℝ) / 2 - ε)) → + ∃ H : SimpleGraph (Fin n), + G ≤ H ∧ H.CliqueFree 3 ∧ HasDiameterAtMostTwo H ∧ + (H.edgeFinset.card : ℝ) - (G.edgeFinset.card : ℝ) ≤ δ * (n : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 134 (Alon's strong form [Al94]): + +For every $\varepsilon > 0$ there exists $C > 0$ such that for all sufficiently large $n$, +every triangle-free graph on $n$ vertices with maximum degree $< n^{1/2 - \varepsilon}$ +can be extended to a triangle-free graph with diameter $\leq 2$ by adding at +most $C \cdot n^{2 - \varepsilon}$ edges. +-/ +@[category research solved, AMS 5] +theorem erdos_134.variants.alon_strong_form : + ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + (∀ v : Fin n, (G.degree v : ℝ) < (n : ℝ) ^ ((1 : ℝ) / 2 - ε)) → + ∃ H : SimpleGraph (Fin n), + G ≤ H ∧ H.CliqueFree 3 ∧ HasDiameterAtMostTwo H ∧ + (H.edgeFinset.card : ℝ) - (G.edgeFinset.card : ℝ) ≤ C * (n : ℝ) ^ (2 - ε) := by + sorry + +end Erdos134 diff --git a/FormalConjectures/ErdosProblems/135.lean b/FormalConjectures/ErdosProblems/135.lean new file mode 100644 index 0000000000..114f36291a --- /dev/null +++ b/FormalConjectures/ErdosProblems/135.lean @@ -0,0 +1,89 @@ +/- +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.Geometry.«2d» + +open scoped EuclideanGeometry + +/-! +# Erdős Problem 135 + +*Reference:* [erdosproblems.com/135](https://www.erdosproblems.com/135) + +Erdős and Gyárfás conjectured that any set of $n$ points in the plane where every +$4$ points determine at least $5$ distinct distances must have $\gg n^2$ total distinct +distances. This was disproved by Tao (2024). Erdős offered a $250 prize for this problem. + +[Er97b] Erdős, P., _Some old and new problems in various branches of combinatorics_, +Discrete Mathematics (1997), pp. 227–231. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), pp. 527–533. + +[Ta24c] Tao, T., _A counterexample to the Erdős–Gyárfás conjecture on distances_ (2024). +-/ + +namespace Erdos135 + +/-- A finite point set $A \subseteq \mathbb{R}^2$ satisfies the "four-point, five-distance" property +if every $4$-element subset determines at least $5$ distinct pairwise distances. -/ +def FourPointFiveDist (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ A → S.card = 4 → 5 ≤ EuclideanGeometry.distinctDistances S + +/-- +Erdős–Gyárfás Conjecture (Problem 135) [Er97b, p. 231] [Er97e, p. 531]: +Let $A \subseteq \mathbb{R}^2$ be a set of $n$ points such that any $4$ points determine at least +$5$ distinct distances. Must $A$ determine $\gg n^2$ many distances? + +The conjecture asserts YES: there exists an absolute constant $c > 0$ such that +every finite $A \subseteq \mathbb{R}^2$ with the four-point-five-distance property satisfies +$|\text{distinct distances of } A| \geq c \cdot n^2$. + +This was answered in the NEGATIVE by Tao [Ta24c], who constructed for any +large $n$ a set of $n$ points where any $4$ points determine at least $5$ distinct +distances, yet the number of distinct distances is $O(n^2 / \sqrt{\log n})$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_135 : + answer(False) ↔ + ∃ c : ℝ, 0 < c ∧ + ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + FourPointFiveDist A → + c * (A.card : ℝ) ^ 2 ≤ (EuclideanGeometry.distinctDistances A : ℝ) := by + sorry + +/-- +Stronger Erdős–Gyárfás Conjecture (Problem 135) [Er97b, p. 231]: +Erdős made a stronger conjecture: any set $A$ of $n$ points in the plane with the +four-point-five-distance property must contain a subset of $\gg n$ points where all +pairwise distances are distinct. This is strictly stronger than `erdos_135` and is +also false (disproved by Tao [Ta24c], since the weaker version already fails). +-/ +@[category research solved, AMS 5 52] +theorem erdos_135_strong : + answer(False) ↔ + ∃ c : ℝ, 0 < c ∧ + ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + FourPointFiveDist A → + ∃ B : Finset (EuclideanSpace ℝ (Fin 2)), + B ⊆ A ∧ + c * (A.card : ℝ) ≤ (B.card : ℝ) ∧ + EuclideanGeometry.distinctDistances B = B.card * (B.card - 1) / 2 := by + sorry + +end Erdos135 diff --git a/FormalConjectures/ErdosProblems/136.lean b/FormalConjectures/ErdosProblems/136.lean new file mode 100644 index 0000000000..6350b5a5e1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/136.lean @@ -0,0 +1,96 @@ +/- +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 136 + +*Reference:* [erdosproblems.com/136](https://www.erdosproblems.com/136) + +Let $f(n)$ be the smallest number of colours required to colour the edges of $K_n$ +such that every $K_4$ contains at least 5 colours. Determine the size of $f(n)$. + +Asked by Erdős and Gyárfás [Er97b], who proved that $\frac{5}{6}(n-1) < f(n) < n$ and that +$f(9) = 8$. Erdős believed the upper bound is closer to the truth. In fact the +lower bound is: Bennett, Cushman, Dudek, and Pralat [BCDP22] proved that +$f(n) \sim \frac{5}{6}n$. Joos and Mubayi [JoMu22] found a shorter proof. + +[Er97b] Erdős, P. and Gyárfás, A., *A variant of the classical Ramsey problem*, +Combinatorica **17** (1997), 459–467. + +[BCDP22] Bennett, P., Cushman, R., Dudek, A., and Pralat, P., +*The Erdős–Gyárfás function f(n,4,5) = 5/6 n + o(n) — so Gyárfás was right*, +arXiv:2207.02920 (2022). + +[JoMu22] Joos, F. and Mubayi, D., *Ramsey theory constructions from hypergraph matchings*, +arXiv:2208.12563 (2022). +-/ + +open Classical Filter + +namespace Erdos136 + +/-- An edge coloring of $K_n$ with colors from $\operatorname{Fin} k$, represented as a function +on unordered pairs of vertices via `Sym2`. -/ +def EdgeColoring (n k : ℕ) : Type := Sym2 (Fin n) → Fin k + +/-- The set of distinct colors used on edges within vertex subset $S$ +under coloring $\chi$, computed over the unordered pairs of distinct vertices in $S$. -/ +noncomputable def edgeColors {n k : ℕ} (χ : EdgeColoring n k) + (S : Finset (Fin n)) : Finset (Fin k) := + (S.offDiag.image (fun p => Sym2.mk p)).image χ + +/-- A coloring $\chi$ of $K_n$ is $K_4$-five-colored if every 4-element vertex subset +has at least 5 distinct colors on its edges. -/ +def IsK4FiveColored {n k : ℕ} (χ : EdgeColoring n k) : Prop := + ∀ S : Finset (Fin n), S.card = 4 → 5 ≤ (edgeColors χ S).card + +/-- $f(n)$: the minimum number of colors $k$ for which there exists a +$K_4$-five-colored edge coloring of $K_n$. -/ +noncomputable def f (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ χ : EdgeColoring n k, IsK4FiveColored χ} + +/-- +Erdős Problem 136 – asymptotic result +(Bennett–Cushman–Dudek–Pralat [BCDP22]; shorter proof by Joos–Mubayi [JoMu22]): +$f(n) \sim \frac{5}{6}n$. That is, for every $\varepsilon > 0$ and all sufficiently large $n$, +$|f(n) / n - 5/6| < \varepsilon$. +-/ +@[category research solved, AMS 5] +theorem erdos_136 : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + |(f n : ℝ) / (n : ℝ) - 5 / 6| < ε := by + sorry + +/-- +Erdős–Gyárfás bounds [Er97b]: +For all sufficiently large $n$, $\frac{5}{6}(n-1) < f(n) < n$. +-/ +@[category research solved, AMS 5] +theorem erdos_136.variants.bounds : + ∀ᶠ n : ℕ in atTop, + (5 : ℝ) / 6 * ((n : ℝ) - 1) < (f n : ℝ) ∧ (f n : ℝ) < (n : ℝ) := by + sorry + +/-- +Special value: $f(9) = 8$, proved by Erdős and Gyárfás [Er97b]. +-/ +@[category research solved, AMS 5] +theorem erdos_136.variants.f9 : f 9 = 8 := by + sorry + +end Erdos136 diff --git a/FormalConjectures/ErdosProblems/140.lean b/FormalConjectures/ErdosProblems/140.lean new file mode 100644 index 0000000000..191fe928d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/140.lean @@ -0,0 +1,80 @@ +/- +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 140 + +*Reference:* [erdosproblems.com/140](https://www.erdosproblems.com/140) + +Let $r_3(N)$ denote the size of the largest subset of $\{1, \ldots, N\}$ that contains no +non-trivial $3$-term arithmetic progression. Is it true that $r_3(N) \ll N / (\log N)^C$ for +every $C > 0$? + +See also OEIS [A003002](https://oeis.org/A003002). + +[ErGr80, p.11] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathématique (1980). + +[Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*. +Combinatorica (1981), 25-42. + +[Er97c] Erdős, P. (1997). + +[KeMe23] Kelley, Z. and Meka, R., *Strong Bounds for 3-Progressions*. arXiv:2302.05537 (2023). +-/ + +open Real Filter + +namespace Erdos140 + +noncomputable abbrev r := Set.IsAPOfLengthFree.maxCard + +/-- +Erdős Problem 140 [ErGr80, p.11, Er81, Er97c]: +Let $r_3(N)$ be the size of the largest subset of $\{1, \ldots, N\}$ containing no +non-trivial $3$-term arithmetic progression. Then $r_3(N) \ll N / (\log N)^C$ +for every $C > 0$. + +Formally: for every $C > 0$ there exists a constant $K > 0$ such that +$$r_3(N) \leq K \cdot N / (\log N)^C$$ +for all sufficiently large $N$. + +Proved by Kelley and Meka [KeMe23]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_140 : + ∀ C : ℝ, 0 < C → + ∃ K : ℝ, 0 < K ∧ + ∀ᶠ N : ℕ in atTop, + (r 3 N : ℝ) ≤ K * (N : ℝ) / (Real.log (N : ℝ)) ^ C := by + sorry + +/-- +Erdős Problem 140 — Kelley–Meka bound [KeMe23]: +There exists an absolute constant $c > 0$ such that +$$r_3(N) \leq N \cdot \exp(-c \cdot (\log N)^{1/12}).$$ +This is the quantitative bound actually proved by Kelley and Meka, which implies `erdos_140`. +-/ +@[category research solved, AMS 5 11] +theorem erdos_140_kelley_meka : + ∃ c : ℝ, 0 < c ∧ + ∀ᶠ N : ℕ in atTop, + (r 3 N : ℝ) ≤ (N : ℝ) * Real.exp (-c * (Real.log (N : ℝ)) ^ ((1 : ℝ) / 12)) := by + sorry + +end Erdos140 diff --git a/FormalConjectures/ErdosProblems/144.lean b/FormalConjectures/ErdosProblems/144.lean new file mode 100644 index 0000000000..cb1c3d86f5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/144.lean @@ -0,0 +1,73 @@ +/- +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 + +/-! +# Erdős Problem 144 + +*Reference:* [erdosproblems.com/144](https://www.erdosproblems.com/144) + +[Er61, Er77c, Er79, Er79e, ErGr80, Er81h, Er82e, Er85e, Er97c, Er98] Erdős, P., various papers. + +[ErHa79] Erdős, P. and Hall, R. R., *The propinquity of divisors*, Bull. London Math. Soc. +(1979), 304–307. + +[MaTe84] Maier, H. and Tenenbaum, G., *On the set of divisors of an integer*, Invent. Math. **76** +(1984), 121–128. + +*Related problems:* [449](https://www.erdosproblems.com/449), +[884](https://www.erdosproblems.com/884) + +*OEIS:* [A005279](https://oeis.org/A005279) +-/ + +namespace Erdos144 + +/-- A positive integer $n$ has two divisors $d_1, d_2$ with $d_1 < d_2 < 2d_1$. -/ +def HasCloseDivisorPair (n : ℕ) : Prop := + ∃ d₁ d₂ : ℕ, d₁ ∣ n ∧ d₂ ∣ n ∧ d₁ < d₂ ∧ d₂ < 2 * d₁ + +/-- +Erdős Problem 144 [Er61, Er77c, Er79, Er79e, ErGr80, Er81h, Er82e, Er85e, Er97c, Er98]: +The density of integers which have two divisors $d_1, d_2$ such that $d_1 < d_2 < 2d_1$ +exists and is equal to $1$. + +Formally, writing $A(N)$ for the number of integers $n$ with $1 \le n \le N$ which have +two divisors $d_1 < d_2 < 2d_1$, we have $A(N)/N \to 1$ as $N \to \infty$. + +Proved by Maier and Tenenbaum [MaTe84]. +-/ +@[category research solved, AMS 11] +theorem erdos_144 : + {n : ℕ | HasCloseDivisorPair n}.HasDensity 1 := by + sorry + +/-- +Erdős Problem 144, generalized [MaTe84]: +For any constant $c > 1$, the density of integers which have two divisors +$d_1, d_2$ such that $d_1 < d_2 < c \cdot d_1$ exists and is equal to $1$. + +This is the stronger result proved by Maier and Tenenbaum, generalizing the +original problem where $c = 2$. +-/ +@[category research solved, AMS 11] +theorem erdos_144_generalized (c : ℝ) (hc : 1 < c) : + {n : ℕ | ∃ d₁ d₂ : ℕ, d₁ ∣ n ∧ d₂ ∣ n ∧ d₁ < d₂ ∧ (d₂ : ℝ) < c * d₁}.HasDensity 1 := by + sorry + +end Erdos144 diff --git a/FormalConjectures/ErdosProblems/146.lean b/FormalConjectures/ErdosProblems/146.lean new file mode 100644 index 0000000000..778ed0fa35 --- /dev/null +++ b/FormalConjectures/ErdosProblems/146.lean @@ -0,0 +1,81 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Extremal.Basic + +/-! +# Erdős Problem 146 + +Erdős and Simonovits conjectured that the Turán number of any $r$-degenerate bipartite +graph $H$ satisfies $\text{ex}(n; H) = O(n^{2 - 1/r})$. + +See also problems #113 and #147 for related conjectures on Turán numbers of degenerate +bipartite graphs. + +*Reference:* [erdosproblems.com/146](https://www.erdosproblems.com/146) + +[ErSi84] Erdős, P. and Simonovits, M., *Cube-supersaturated graphs and related +problems*, Progress in graph theory (Waterloo, Ont., 1982), Academic Press, +Toronto, ON, 1984, 203-218. + +[Er91] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and +differences*. Mathematics of Ramsey theory, Algorithms Combin., 5 (1990), 12-28. + +[Er93] Erdős, P., *Some of my favorite solved and unsolved problems in graph theory*. +Quaestiones Mathematicae **16** (1993), 333–350. + +[Er97c] Erdős, P., *Some recent problems and results in graph theory*. Discrete Math. +**164** (1997), 81–85. + +[AKS03] Alon, N., Krivelevich, M., and Sudakov, B., *Turán numbers of bipartite +graphs and related Ramsey-type questions*, Combinatorics, Probability and +Computing 12 (2003), no. 5-6, 477-494. +-/ + +open SimpleGraph + +namespace Erdos146 + +/-- A graph $G$ is $r$-degenerate if every non-empty finite set of vertices contains +a vertex with at most $r$ neighbors within that set. Equivalently, every induced +subgraph of $G$ has minimum degree at most $r$. -/ +def IsRDegenerateGraph {V : Type*} (G : SimpleGraph V) (r : ℕ) : Prop := + ∀ (S : Set V), S.Finite → S.Nonempty → + ∃ v ∈ S, (G.neighborSet v ∩ S).ncard ≤ r + +/-- +Erdős-Simonovits Conjecture (Problem #146) [ErSi84]: +If $H$ is a bipartite graph that is $r$-degenerate (i.e., every induced subgraph of $H$ +has minimum degree at most $r$), then +$$\text{ex}(n; H) \ll n^{2 - 1/r}.$$ +That is, there exists a constant $C > 0$ such that $\text{ex}(n; H) \leq C \cdot n^{2 - 1/r}$ +for all $n \geq 1$. + +This is open even for $r = 2$. Alon, Krivelevich, and Sudakov [AKS03] proved the +weaker bound $\text{ex}(n; H) \ll n^{2 - 1/(4r)}$. +-/ +@[category research open, AMS 5] +theorem erdos_146 : + ∀ (r : ℕ), 1 ≤ r → + ∀ (U : Type*) (H : SimpleGraph U) [Fintype U] [DecidableRel H.Adj], + Nonempty (H.Coloring (Fin 2)) → + IsRDegenerateGraph H r → + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → + (extremalNumber n H : ℝ) ≤ C * (n : ℝ) ^ ((2 : ℝ) - 1 / (r : ℝ)) := by + sorry + +end Erdos146 diff --git a/FormalConjectures/ErdosProblems/147.lean b/FormalConjectures/ErdosProblems/147.lean new file mode 100644 index 0000000000..830550c474 --- /dev/null +++ b/FormalConjectures/ErdosProblems/147.lean @@ -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 Mathlib.Combinatorics.SimpleGraph.Extremal.Basic + +/-! +# Erdős Problem 147 + +*Reference:* [erdosproblems.com/147](https://www.erdosproblems.com/147) + +See also problems #113, #146, and #714 for related conjectures on Turán numbers of +bipartite graphs. + +[ErSi84] Erdős, P. and Simonovits, M., _Cube-supersaturated graphs and related problems_, +Progress in graph theory (Waterloo, Ont., 1982), Academic Press, Toronto, ON, 1984, 203–218. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae **16** (1993), 333–350. + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Ja23] Janzer, O., _Rainbow Turán number of even cycles, repeated patterns and blow-ups +of cycles_. Israel J. Math. (2023), 813–840. + +[Ja23b] Janzer, O., _Disproof of a conjecture of Erdős and Simonovits on the Turán number +of graphs with minimum degree 3_. Int. Math. Res. Not. IMRN (2023), 8478–8494. +-/ + +open SimpleGraph + +namespace Erdos147 + +/-- +Erdős Problem 147 [ErSi84]: +If $H$ is a bipartite graph with minimum degree $r$ (i.e., every vertex of $H$ has +degree at least $r$, where $r \geq 2$), is it true that there exists +$\varepsilon = \varepsilon(H) > 0$ such that +$$ +\mathrm{ex}(n; H) \gg n^{2 - 1/(r-1) + \varepsilon}? +$$ +That is, do there exist constants $C > 0$ and $N_0 \in \mathbb{N}$ such that for all $n \geq N_0$: +$$ +\mathrm{ex}(n; H) \geq C \cdot n^{2 - 1/(r-1) + \varepsilon}? +$$ + +This conjecture was **disproved**: Janzer [Ja23] disproved it for even $r \geq 4$, and +[Ja23b] disproved it for $r = 3$, constructing for any $\delta > 0$ a $3$-regular bipartite +graph $H$ with $\mathrm{ex}(n; H) \ll n^{4/3 + \delta}$. +-/ +@[category research solved, AMS 5] +theorem erdos_147 : answer(False) ↔ + ∀ (r : ℕ), 2 ≤ r → + ∀ (U : Type*) (H : SimpleGraph U) [Fintype U] [DecidableRel H.Adj], + Nonempty (H.Coloring (Fin 2)) → + (∀ v : U, r ≤ H.degree v) → + ∃ ε : ℝ, 0 < ε ∧ + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * (n : ℝ) ^ ((2 : ℝ) - 1 / ((r : ℝ) - 1) + ε) ≤ (extremalNumber n H : ℝ) := by + sorry + +end Erdos147 diff --git a/FormalConjectures/ErdosProblems/148.lean b/FormalConjectures/ErdosProblems/148.lean new file mode 100644 index 0000000000..789a746ba8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/148.lean @@ -0,0 +1,95 @@ +/- +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 148 + +*Reference:* [erdosproblems.com/148](https://www.erdosproblems.com/148) + +Let $F(k)$ be the number of solutions to $1 = 1/n_1 + \cdots + 1/n_k$ where +$1 \le n_1 < n_2 < \cdots < n_k$ are distinct positive integers. +Find good estimates for $F(k)$. + +The current best known bounds are +$$2^{c^{k/\log k}} \le F(k) \le c_0^{(1/5 + o(1)) \cdot 2^k}$$ +where $c > 0$ is some absolute constant and $c_0 = 1.26408\cdots$ is the Vardi constant. +The lower bound is due to Konyagin [Ko14] and the upper bound to +Elsholtz and Planitzer [ElPl21]. + +[Ko14] Konyagin, S., _On the number of representations of an integer as a sum of distinct +unit fractions_, 2014. + +[ElPl21] Elsholtz, C. and Planitzer, S., _The number of solutions of the Erdős–Straus +equation and sums of $k$ unit fractions_, Proc. R. Soc. Edinb. A Math. (2021). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_, Monographies de L'Enseignement Mathématique (1980). + +Related OEIS sequences: [A076393](https://oeis.org/A076393), +[A006585](https://oeis.org/A006585). +-/ + +open BigOperators Real Filter + +namespace Erdos148 + +/-- $F(k)$ is the number of $k$-element sets of positive integers +whose unit fractions sum to $1$: $1/n_1 + \cdots + 1/n_k = 1$. -/ +noncomputable def egyptianFractionCount (k : ℕ) : ℕ := + Set.ncard {S : Finset ℕ | S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = 1} + +/-- Konyagin lower bound [Ko14]: +There exists an absolute constant $c > 0$ such that +$2^{c^{k/\log k}} \le F(k)$ for all sufficiently large $k$. -/ +@[category research solved, AMS 11] +theorem erdos_148.variants.konyagin_lower_bound : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + (2 : ℝ) ^ (c ^ ((k : ℝ) / Real.log k)) ≤ + (egyptianFractionCount k : ℝ) := by + sorry + +/-- Elsholtz–Planitzer upper bound [ElPl21]: +There exists a constant $c_0 > 1$ (the Vardi constant, $c_0 \approx 1.26408$) such that +for every $\varepsilon > 0$, $F(k) \le c_0^{(1/5 + \varepsilon) \cdot 2^k}$ for all +sufficiently large $k$. -/ +@[category research solved, AMS 11] +theorem erdos_148.variants.elsholtz_planitzer_upper_bound : + ∃ c₀ : ℝ, 1 < c₀ ∧ ∀ ε : ℝ, 0 < ε → ∀ᶠ k : ℕ in atTop, + (egyptianFractionCount k : ℝ) ≤ + c₀ ^ ((1 / 5 + ε) * (2 : ℝ) ^ (k : ℕ)) := by + sorry + +/-- Erdős Problem 148 [ErGr80, p. 32]: +Find good estimates for $F(k)$, the number of representations of $1$ +as a sum of exactly $k$ distinct unit fractions. + +The open problem is to close the gap between the known bounds. This +conjecture asserts that the correct order of magnitude is exponential +in $2^k$: there exist constants $c_1, c_2 > 1$ such that +$c_1^{2^k} \le F(k) \le c_2^{2^k}$ for all sufficiently large $k$. +In particular, the Konyagin lower bound should be improvable to +exponential in $2^k$ to match the Elsholtz–Planitzer upper bound. -/ +@[category research open, AMS 11] +theorem erdos_148 : + ∃ c₁ c₂ : ℝ, 1 < c₁ ∧ 1 < c₂ ∧ ∀ᶠ k : ℕ in atTop, + c₁ ^ ((2 : ℝ) ^ (k : ℕ)) ≤ (egyptianFractionCount k : ℝ) ∧ + (egyptianFractionCount k : ℝ) ≤ c₂ ^ ((2 : ℝ) ^ (k : ℕ)) := by + sorry + +end Erdos148 diff --git a/FormalConjectures/ErdosProblems/149.lean b/FormalConjectures/ErdosProblems/149.lean new file mode 100644 index 0000000000..cf0f60390b --- /dev/null +++ b/FormalConjectures/ErdosProblems/149.lean @@ -0,0 +1,84 @@ +/- +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 149 + +The Erdős–Nešetřil conjecture states that the strong chromatic index of any graph with +maximum degree Δ is at most 5Δ²/4. + +*Reference:* [erdosproblems.com/149](https://www.erdosproblems.com/149) + +[ErNe85] Erdős, P. and Nešetřil, J., proposed at a seminar in Prague (1985). +-/ + +open SimpleGraph + +namespace Erdos149 + +/-- A set $S$ of edges of $G$ is strongly independent if for any two distinct edges +$e_1, e_2 \in S$, every endpoint $u$ of $e_1$ and every endpoint $v$ of $e_2$ satisfy +$u \neq v$ and $\neg G.\text{Adj}\; u\; v$. Equivalently, $S$ is an independent set in $L(G)^2$ +(the square of the line graph of $G$). +See also `strongChromaticIndex`, which inlines this condition. -/ +def IsStronglyIndepEdgeSet {V : Type*} (G : SimpleGraph V) + (S : Set (Sym2 V)) : Prop := + S ⊆ G.edgeSet ∧ + ∀ e₁ ∈ S, ∀ e₂ ∈ S, e₁ ≠ e₂ → + ∀ u ∈ e₁, ∀ v ∈ e₂, u ≠ v ∧ ¬G.Adj u v + +/-- The strong chromatic index $\chi'_s(G)$: the minimum number of strongly +independent edge sets needed to partition the edges of $G$. Equivalently, +this is the chromatic number of $L(G)^2$, the square of the line graph. -/ +noncomputable def strongChromaticIndex {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | ∃ (c : G.edgeSet → Fin k), + ∀ (e₁ e₂ : G.edgeSet), c e₁ = c e₂ → e₁ ≠ e₂ → + ∀ u ∈ (e₁ : Sym2 V), ∀ v ∈ (e₂ : Sym2 V), u ≠ v ∧ ¬G.Adj u v} + +/-- Erdős–Nešetřil Strong Edge Coloring Conjecture (Erdős Problem 149) [ErNe85]: +For any finite graph $G$ with maximum degree $\Delta$, +$$ + \chi'_s(G) \leq \frac{5}{4} \Delta^2, +$$ +i.e. the edge set of $G$ can be partitioned into at most $\frac{5}{4}\Delta^2$ strongly +independent edge sets. This bound is sharp: a blowup of $C_5$ with $\Delta = 2k$ +requires exactly $5k^2 = \frac{5}{4}\Delta^2$ strong colors. -/ +@[category research open, AMS 5] +theorem erdos_149 : + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj], + (strongChromaticIndex G : ℝ) ≤ (5 / 4 : ℝ) * (G.maxDegree : ℝ) ^ 2 := by + sorry + +/-- Precise Erdős–Nešetřil Conjecture for odd maximum degree (Erdős Problem 149) [ErNe85]: +For any finite graph $G$ with odd maximum degree $\Delta = 2k + 1$, +$$ + \chi'_s(G) \leq 5k^2 + 4k + 1 = \frac{5\Delta^2 - 2\Delta + 1}{4}. +$$ +This is strictly stronger than the uniform $\frac{5}{4}\Delta^2$ bound (see `erdos_149`) +when $\Delta$ is odd, improving the bound by $k = (\Delta - 1) / 2$. -/ +@[category research open, AMS 5] +theorem erdos_149_odd : + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj], + Odd G.maxDegree → + (strongChromaticIndex G : ℝ) ≤ + (5 * (G.maxDegree : ℝ) ^ 2 - 2 * (G.maxDegree : ℝ) + 1) / 4 := by + sorry + +end Erdos149 diff --git a/FormalConjectures/ErdosProblems/15.lean b/FormalConjectures/ErdosProblems/15.lean new file mode 100644 index 0000000000..2f61004810 --- /dev/null +++ b/FormalConjectures/ErdosProblems/15.lean @@ -0,0 +1,129 @@ +/- +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 15 + +*Reference:* [erdosproblems.com/15](https://www.erdosproblems.com/15) + +Is the alternating series $\sum_{n=1}^{\infty} (-1)^n \cdot n / p_n$ convergent, where $p_n$ +denotes the $n$-th prime? Tao [Ta23] has proved convergence assuming a strong form of the +Hardy–Littlewood prime tuples conjecture. + +Erdős also conjectured [Er98]: +- $\sum (-1)^n / (n(p_{n+1} - p_n))$ converges, +- $\sum (-1)^n / (p_{n+1} - p_n)$ diverges, +- $\sum (-1)^n / (n(p_{n+1} - p_n)(\log\log n)^c)$ converges for all $c > 0$. + +Weisenberg showed that Zhang's result [Zh14] on bounded prime gaps implies the second variant +diverges, and argued the series is unbounded in at least one direction under Hardy–Littlewood. +Erdős–Nathanson and Sawhney proved absolute convergence of the third variant for $c > 2$. + +[Er97] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_ (1997). + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). + +[Er98] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_. Number theory (Eger, 1996) (1998), 169–180. + +[Ta23] Tao, T., _The convergence of an alternating series of Erdős, assuming the +Hardy-Littlewood prime tuples conjecture_. arXiv:2308.07205 (2023). + +[Zh14] Zhang, Y., _Bounded gaps between primes_. Ann. of Math. (2) **179** (2014), 1121–1174. +-/ + +open Filter + +open scoped BigOperators Topology + +namespace Erdos15 + +/-- +Is it true that the alternating series +$$\sum_{n=1}^{\infty} (-1)^n \cdot \frac{n}{p_n}$$ +converges, where $p_n$ denotes the $n$-th prime? + +This is an open problem. Tao [Ta23] has proved convergence assuming a strong form +of the Hardy–Littlewood prime tuples conjecture. + +We state convergence as: the sequence of partial sums +$$S_N = \sum_{n=1}^{N} (-1)^n \cdot \frac{n}{p_n}$$ +converges to a real limit $L$. + +Using 0-indexed `Nat.nth Nat.Prime`, the $n$-th term ($n : \mathbb{N}$, 0-indexed) is +$(-1)^{n+1} \cdot (n+1) / p_{n+1}$, corresponding to the 1-indexed mathematical term. +-/ +@[category research open, AMS 11 40] +theorem erdos_15 : answer(sorry) ↔ ∃ L : ℝ, + Tendsto + (fun N : ℕ => ∑ n ∈ Finset.range N, + (-1 : ℝ) ^ (n + 1) * ((n + 1 : ℝ) / (Nat.nth Nat.Prime n : ℝ))) + atTop (nhds L) := by + sorry + +/-- +**Variant 1** [Er98]: Does the alternating series +$$\sum_{n=1}^{\infty} (-1)^n \cdot \frac{1}{n(p_{n+1} - p_n)}$$ +converge? Erdős conjectured it does. + +We use 0-indexed `primeGap n = p_{n+1} - p_n` and shift the summation index by 1. +The sum starts at $n = 1$ (0-indexed) to avoid division by zero at $n = 0$. +-/ +@[category research open, AMS 11 40] +theorem erdos_15.variants.convergence_gap_weighted : answer(sorry) ↔ ∃ L : ℝ, + Tendsto + (fun N : ℕ => ∑ n ∈ Finset.range N, + (-1 : ℝ) ^ (n + 1) * (1 / ((n + 1 : ℝ) * (primeGap (n + 1) : ℝ)))) + atTop (nhds L) := by + sorry + +/-- +**Variant 2** [Er98]: Does the alternating series +$$\sum_{n=1}^{\infty} (-1)^n \cdot \frac{1}{p_{n+1} - p_n}$$ +diverge? Erdős conjectured it does. + +Weisenberg showed that Zhang's result [Zh14] on bounded prime gaps implies this series diverges. +-/ +@[category research open, AMS 11 40] +theorem erdos_15.variants.divergence_gap : answer(sorry) ↔ ¬∃ L : ℝ, + Tendsto + (fun N : ℕ => ∑ n ∈ Finset.range N, + (-1 : ℝ) ^ (n + 1) * (1 / (primeGap (n + 1) : ℝ))) + atTop (nhds L) := by + sorry + +/-- +**Variant 3** [Er98]: Does the alternating series +$$\sum_{n=1}^{\infty} (-1)^n \cdot \frac{1}{n(p_{n+1} - p_n)(\log\log n)^c}$$ +converge for all $c > 0$? Erdős conjectured it does. + +Erdős–Nathanson and Sawhney proved absolute convergence for $c > 2$. +The sum starts at $n = 3$ (0-indexed $n = 2$) to ensure $\log\log n > 0$. +-/ +@[category research open, AMS 11 40] +theorem erdos_15.variants.convergence_loglog : answer(sorry) ↔ + ∀ c : ℝ, c > 0 → ∃ L : ℝ, + Tendsto + (fun N : ℕ => ∑ n ∈ Finset.range N, + (-1 : ℝ) ^ (n + 3) * + (1 / ((n + 3 : ℝ) * (primeGap (n + 3) : ℝ) * (Real.log (Real.log (n + 3 : ℝ))) ^ c))) + atTop (nhds L) := by + sorry + +end Erdos15 diff --git a/FormalConjectures/ErdosProblems/150.lean b/FormalConjectures/ErdosProblems/150.lean new file mode 100644 index 0000000000..60ef65d7b6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/150.lean @@ -0,0 +1,113 @@ +/- +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 150 + +*Reference:* [erdosproblems.com/150](https://www.erdosproblems.com/150) + +A minimal vertex cut of a graph is a minimal set of vertices whose removal +disconnects the graph. Let $c(n)$ be the maximum number of minimal vertex cuts a +graph on $n$ vertices can have. Does $c(n)^{1/n} \to \alpha$ for some $\alpha < 2$? + +Asked by Erdős and Nešetřil, who also ask whether $c(3m+2) = 3^m$. Seymour +observed that $c(3m+2) \geq 3^m$ via $m$ independent paths of length $4$ joining +two vertices. + +Proved by Bradač [Br24]: the limit $\alpha = \lim c(n)^{1/n}$ exists and +$\alpha \leq 2^{H(1/3)} = 1.8899\ldots < 2$, where $H(\cdot)$ is the binary entropy +function. This confirms the conjecture. Bradač conjectures the true value is +$\alpha = 3^{1/3}$. + +[Er88] Erdős, P., _Problems and results in combinatorics and graph theory_. + +[Br24] Bradač, D., _The number of minimal vertex separators_. +-/ + +open SimpleGraph Real Filter + +namespace Erdos150 + +/-- A set $S$ of vertices is a vertex separator of $G$ if $S$ is a proper subset +of $V$ and the subgraph induced by the complement $V \setminus S$ is not connected. -/ +def IsVertexSeparator {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + S ≠ Finset.univ ∧ ¬(G.induce ((S : Set (Fin n))ᶜ)).Connected + +/-- $S$ is a minimal vertex cut (minimal vertex separator) of $G$ if $S$ is a +vertex separator and no proper subset of $S$ is also a vertex separator. -/ +def IsMinimalVertexCut {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + IsVertexSeparator G S ∧ + ∀ T : Finset (Fin n), T ⊂ S → ¬IsVertexSeparator G T + +/-- The number of minimal vertex cuts of $G$. -/ +noncomputable def numMinimalVertexCuts {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + Set.ncard { S : Finset (Fin n) | IsMinimalVertexCut G S } + +/-- $c(n)$ is the maximum number of minimal vertex cuts over all connected simple +graphs on $n$ vertices. -/ +noncomputable def c (n : ℕ) : ℕ := + sSup { k : ℕ | ∃ G : SimpleGraph (Fin n), G.Connected ∧ + numMinimalVertexCuts G = k } + +/-- +Erdős Problem 150 [Er88] (asked by Erdős and Nešetřil): +Let $c(n)$ be the maximum number of minimal vertex cuts in a graph on $n$ vertices. +Does $c(n)^{1/n} \to \alpha$ for some $\alpha < 2$? + +Proved by Bradač [Br24]: the limit $\alpha = \lim c(n)^{1/n}$ exists and +$\alpha \leq 2^{H(1/3)} = 1.8899\ldots < 2$, where $H(\cdot)$ is the binary entropy +function. Seymour's construction gives $c(3m+2) \geq 3^m$, so +$\alpha \geq 3^{1/3} \approx 1.442$. Bradač conjectures that the true value is +$\alpha = 3^{1/3}$. +-/ +@[category research solved, AMS 5] +theorem erdos_150 : answer(True) ↔ + ∃ α : ℝ, α < 2 ∧ + Tendsto (fun n : ℕ => (c n : ℝ) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds α) := by + sorry + +/-- +Seymour's lower bound: the graph of $m$ independent paths of length $4$ joining +two vertices shows $c(3m+2) \geq 3^m$. +-/ +@[category research solved, AMS 5] +theorem erdos_150_seymour_lower_bound (m : ℕ) : + c (3 * m + 2) ≥ 3 ^ m := by + sorry + +/-- +Erdős–Nešetřil exact conjecture: $c(3m+2) = 3^m$. This is stronger than the +asymptotic statement of Problem 150 and remains open. +-/ +@[category research open, AMS 5] +theorem erdos_150_exact : answer(sorry) ↔ + ∀ m : ℕ, c (3 * m + 2) = 3 ^ m := by + sorry + +/-- +Bradač's conjecture on the exact value of $\alpha$: the limit +$\lim c(n)^{1/n} = 3^{1/3}$, matching Seymour's lower bound. +-/ +@[category research open, AMS 5] +theorem erdos_150_bradac_alpha : answer(sorry) ↔ + Tendsto (fun n : ℕ => (c n : ℝ) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds ((3 : ℝ) ^ ((1 : ℝ) / 3))) := by + sorry + +end Erdos150 diff --git a/FormalConjectures/ErdosProblems/151.lean b/FormalConjectures/ErdosProblems/151.lean new file mode 100644 index 0000000000..0cba8a6381 --- /dev/null +++ b/FormalConjectures/ErdosProblems/151.lean @@ -0,0 +1,78 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 151 + +Erdős and Gallai conjectured that the clique transversal number of any graph on $n$ vertices +is at most $n - H(n)$, where $H(n)$ is the minimum independence number over all triangle-free +graphs on $n$ vertices. + +This appears as Problem 1 in [EGT92]. The general behaviour of $\tau(G)$ is the subject of +Problem 610. + +*Reference:* [erdosproblems.com/151](https://www.erdosproblems.com/151) + +[Er88] Erdős, P., _Problems and results in combinatorial analysis and graph theory_. +Discrete Mathematics **72** (1988), 81-92. + +[EGT92] Erdős, P., Gallai, T. and Tuza, Zs., _Covering the cliques of a graph with vertices_. +Discrete Mathematics **108** (1992), 279-289. +-/ + +open SimpleGraph + +namespace Erdos151 + +/-- $S$ is a maximal clique of $G$ (represented as a `Finset`): it is a clique and +no vertex outside $S$ can be added while preserving the clique property. -/ +def IsMaximalCliqueFS {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + G.IsClique (S : Set (Fin n)) ∧ + ∀ v : Fin n, v ∉ S → ¬G.IsClique (↑(insert v S) : Set (Fin n)) + +/-- $T$ is a clique transversal of $G$ if $T$ has non-empty intersection with every +maximal clique of $G$ that has at least $2$ vertices. -/ +def IsCliqueTransversal {n : ℕ} (G : SimpleGraph (Fin n)) (T : Finset (Fin n)) : Prop := + ∀ S : Finset (Fin n), IsMaximalCliqueFS G S → 2 ≤ S.card → (T ∩ S).Nonempty + +/-- The clique transversal number $\tau(G)$: the minimum cardinality of a clique +transversal of $G$. -/ +noncomputable def cliqueTransversalNumber {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf { k : ℕ | ∃ T : Finset (Fin n), IsCliqueTransversal G T ∧ T.card = k } + +/-- $H(n)$ is maximal such that every triangle-free graph on $n$ vertices contains +an independent set of size $H(n)$; equivalently, $H(n)$ is the minimum +independence number over all triangle-free graphs on $n$ vertices. -/ +noncomputable def H (n : ℕ) : ℕ := + sInf { k : ℕ | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.indepNum = k } + +/-- +Erdős Problem 151 [Er88, p.82] [EGT92, p.280] (problem of Erdős and Gallai): +If $G$ is a graph on $n$ vertices then $\tau(G) \leq n - H(n)$, +where $\tau(G)$ is the clique transversal number of $G$ and $H(n)$ is the maximum $k$ +such that every triangle-free graph on $n$ vertices contains an independent set +of size $k$. +-/ +@[category research open, AMS 5] +theorem erdos_151 : answer(sorry) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + cliqueTransversalNumber G ≤ n - H n := by + sorry + +end Erdos151 diff --git a/FormalConjectures/ErdosProblems/154.lean b/FormalConjectures/ErdosProblems/154.lean new file mode 100644 index 0000000000..b3e598f94b --- /dev/null +++ b/FormalConjectures/ErdosProblems/154.lean @@ -0,0 +1,79 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 154 + +*Reference:* [erdosproblems.com/154](https://www.erdosproblems.com/154) + +Let $A \subset \{1, \ldots, N\}$ be a Sidon set with $|A| \sim N^{1/2}$. +Must the sumset $A + A$ be well-distributed over all small moduli? + +[ESS94] Erdős, P. and Sárközy, A. and Sós, V. T., _On Sum Sets of Sidon Sets, I_. + Journal of Number Theory (1994), 329–347. + +[Li98] Lindström, B., _Well distribution of Sidon sets in residue classes_. + J. Number Theory (1998), 197–200. + +[Ko99] Kolountzakis, M. N., _On the uniform distribution in residue classes of dense sets + of integers with distinct sums_. J. Number Theory (1999), 147–153. +-/ + +open Filter + +open scoped Topology Real Pointwise + +namespace Erdos154 + +/-- The fraction of elements in a finite set of naturals that are congruent to $r$ modulo $m$. -/ +noncomputable def modFraction (m r : ℕ) (S : Finset ℕ) : ℝ := + ((S.filter (fun n => n % m = r)).card : ℝ) / (S.card : ℝ) + +/-- +Erdős Problem \#154 [ESS94]: + +Let $A \subset \{1, \ldots, N\}$ be a Sidon set with $|A| \sim N^{1/2}$. Must $A + A$ be +well-distributed over all small moduli? In particular, must about half +the elements of $A + A$ be even and half odd? + +Proved in the affirmative. Lindström [Li98] showed that $A$ itself is +well-distributed modulo small integers (e.g. $|A \cap \{\text{evens}\}| \approx |A|/2$), +subsequently strengthened by Kolountzakis [Ko99]. The extension to $A + A$ +follows immediately from the Sidon property: if $A$ has $e$ even and $o$ odd +elements, then $A + A$ has exactly $e(e+1)/2 + o(o+1)/2$ even elements +and $eo$ odd elements (all distinct by the Sidon property), and the +distribution is approximately $1/2$ each when $e \approx o \approx |A|/2$. + +Formalized as: for any sequence $(A_n)_n$ of Sidon sets $A_n \subset \{0, \ldots, n\}$ +with $|A_n| / \sqrt{n} \to 1$ as $n \to \infty$, and any fixed modulus $m \geq 1$ and +residue $0 \leq r < m$, the fraction of elements of $A_n + A_n$ in residue +class $r \bmod m$ tends to $1/m$. Here $A_n + A_n$ denotes the pointwise sumset. +-/ +@[category research solved, AMS 5 11] +theorem erdos_154 : answer(True) ↔ + ∀ (A : ℕ → Finset ℕ), + (∀ n, IsSidon (↑(A n) : Set ℕ)) → + (∀ n, (A n) ⊆ Finset.range (n + 1)) → + Tendsto (fun n => ((A n).card : ℝ) / Real.sqrt n) atTop (𝓝 1) → + ∀ (m : ℕ), 1 ≤ m → + ∀ r < m, + Tendsto (fun n => modFraction m r (A n + A n)) atTop (𝓝 (1 / (m : ℝ))) := by + sorry + +end Erdos154 diff --git a/FormalConjectures/ErdosProblems/156.lean b/FormalConjectures/ErdosProblems/156.lean new file mode 100644 index 0000000000..c01b516e3a --- /dev/null +++ b/FormalConjectures/ErdosProblems/156.lean @@ -0,0 +1,92 @@ +/- +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 156 + +*Reference:* [erdosproblems.com/156](https://www.erdosproblems.com/156) + +A question of Erdős, Sárközy, and Sós [ESS94]. Ruzsa [Ru98b] constructed a maximal Sidon set +of size $\ll (N \log N)^{1/3}$, but whether $O(N^{1/3})$ is achievable remains open. + +See also Problem 340, which concerns the greedy Sidon sequence specifically. + +OEIS: [A382397](https://oeis.org/A382397) + +[ESS94] Erdős, P., Sárközy, A., and Sós, V. T., _On Sum Sets of Sidon Sets, I_. +Journal of Number Theory (1994), 329–347. + +[Ru98b] Ruzsa, I. Z., _A small maximal Sidon set_. Ramanujan Journal (1998), 55–58. +-/ + +open Filter Set + +open scoped Topology Real + +namespace Erdos156 + +/-- +Erdős–Sárközy–Sós Conjecture (Problem 156) [ESS94]: + +Does there exist a maximal Sidon set $A \subset \{1, \ldots, N\}$ of size $O(N^{1/3})$? + +The greedy algorithm produces a maximal Sidon set of size $\gg N^{1/3}$ (this is known). +Ruzsa [Ru98b] constructed a maximal Sidon set of size $\ll (N \log N)^{1/3}$, which is +close but does not reach $O(N^{1/3})$. + +Formalized as: there exists a constant $C > 0$ such that for all sufficiently large $N$, +there exists a maximal Sidon set $A \subseteq \{1, \ldots, N\}$ with +$|A| \leq C \cdot N^{1/3}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_156 : answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ + ∀ᶠ N : ℕ in atTop, + ∃ A : Set ℕ, A.IsMaximalSidonSetIn N ∧ + (A.ncard : ℝ) ≤ C * (N : ℝ) ^ ((1 : ℝ) / 3) := by + sorry + +/-- +Ruzsa's upper bound (Problem 156) [Ru98b]: + +Ruzsa constructed a maximal Sidon set of size $O((N \log N)^{1/3})$. This is the best +known upper bound on the minimum size of a maximal Sidon set in $\{1, \ldots, N\}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_156_ruzsa_upper : + ∃ C : ℝ, 0 < C ∧ + ∀ᶠ N : ℕ in atTop, + ∃ A : Set ℕ, A.IsMaximalSidonSetIn N ∧ + (A.ncard : ℝ) ≤ C * ((N : ℝ) * Real.log N) ^ ((1 : ℝ) / 3) := by + sorry + +/-- +Lower bound on maximal Sidon sets (Problem 156): + +Every maximal Sidon set in $\{1, \ldots, N\}$ has size $\gg N^{1/3}$. This is a known result +(the greedy algorithm witnesses this, but the bound holds for all maximal Sidon sets). +-/ +@[category research solved, AMS 5 11] +theorem erdos_156_lower : + ∃ C : ℝ, 0 < C ∧ + ∀ᶠ N : ℕ in atTop, + ∀ A : Set ℕ, A.IsMaximalSidonSetIn N → + C * (N : ℝ) ^ ((1 : ℝ) / 3) ≤ (A.ncard : ℝ) := by + sorry + +end Erdos156 diff --git a/FormalConjectures/ErdosProblems/157.lean b/FormalConjectures/ErdosProblems/157.lean new file mode 100644 index 0000000000..ed39472f65 --- /dev/null +++ b/FormalConjectures/ErdosProblems/157.lean @@ -0,0 +1,59 @@ +/- +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.Combinatorics.Basic +import FormalConjecturesForMathlib.Combinatorics.Additive.Basis + +/-! +# Erdős Problem 157 + +*Reference:* [erdosproblems.com/157](https://www.erdosproblems.com/157) + +Erdős, Sárközy, and Sós asked whether there exists an infinite Sidon set that is also an +asymptotic basis of order 3. This was answered affirmatively by Pilatte. + +[ESS94] Erdős, P., Sárközy, A. and Sós, V. T., *On sum sets of Sidon sets*. J. Number Theory +(1994). + +[Er94b] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. +Matematiche (Catania) (1994). + +[Pi23] Pilatte, C., *Sidon sets are asymptotic bases of order 3*. (2023). +-/ + +open Filter Set + +namespace Erdos157 + +/-- +Erdős Problem 157 [ESS94, Er94b]: + +Does there exist an infinite Sidon set which is an asymptotic basis of order $3$? + +A set $A \subseteq \mathbb{N}$ is a Sidon set if all pairwise sums $a + b$ ($a, b \in A$) +are distinct. A set $A$ is an asymptotic basis of order $3$ if every sufficiently large +integer is the sum of $3$ elements from $A$. + +Answered YES by Pilatte [Pi23]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_157 : + answer(True) ↔ + ∃ A : Set ℕ, A.Infinite ∧ IsSidon A ∧ Set.IsAsymptoticAddBasisOfOrder A 3 := by + sorry + +end Erdos157 diff --git a/FormalConjectures/ErdosProblems/159.lean b/FormalConjectures/ErdosProblems/159.lean new file mode 100644 index 0000000000..a0095960cc --- /dev/null +++ b/FormalConjectures/ErdosProblems/159.lean @@ -0,0 +1,79 @@ +/- +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 159 + +Is there some constant $c > 0$ such that $R(C_4, K_n) \ll n^{2-c}$? + +*Reference:* [erdosproblems.com/159](https://www.erdosproblems.com/159) + +[Er78] Erdős, P., *Problems and results in combinatorial analysis and combinatorial number +theory*, Proceedings of the Ninth Southeastern Conference on Combinatorics, Graph Theory, and +Computing (1978), 29–40. + +[Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*, +Combinatorica 1 (1981), 25–42. + +[Er84d] Erdős, P., *On some problems in graph theory, combinatorial analysis and +combinatorial number theory*. + +[EFRS78] Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., +*On cycle-complete graph Ramsey numbers*, J. Graph Theory 2 (1978), 53–64. + +[Sp77] Spencer, J., *Asymptotic lower bounds for Ramsey functions*, Discrete Math. +**20** (1977), 69–76. +-/ + +open SimpleGraph + +namespace Erdos159 + +/-- The graph Ramsey number $R(C_4, K_n)$: the minimum $N$ such that every simple + graph $G$ on $N$ vertices either contains a copy of $C_4$ as a subgraph, or the + complement $G^c$ contains a copy of $K_n$ (i.e., $G$ has an independent set of + size $n$). -/ +noncomputable def ramseyC4Kn (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + (cycleGraph 4).IsContained G ∨ (⊤ : SimpleGraph (Fin n)).IsContained Gᶜ} + +/-- +Erdős Conjecture (Problem 159) [Er78, Er81, Er84d]: + +There exists a constant $c > 0$ such that $R(C_4, K_n) \ll n^{2-c}$, i.e., +$R(C_4, K_n) = O(n^{2-c})$ as $n \to \infty$. + +The Ramsey number $R(C_4, K_n)$ is the minimum $N$ such that every 2-colouring +of the edges of $K_N$ contains a monochromatic $C_4$ in one colour or a +monochromatic $K_n$ in the other colour. + +The current bounds are: +$$n^{3/2} / (\log n)^{3/2} \ll R(C_4, K_n) \ll n^2 / (\log n)^2,$$ +where the upper bound is due to Szemerédi [EFRS78] and the lower bound +to Spencer [Sp77]. Improving the upper bound to $n^{2-c}$ for any fixed +$c > 0$ remains open. +-/ +@[category research open, AMS 5] +theorem erdos_159 : + ∃ c : ℝ, 0 < c ∧ + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (ramseyC4Kn n : ℝ) ≤ C * (n : ℝ) ^ (2 - c) := by + sorry + +end Erdos159 diff --git a/FormalConjectures/ErdosProblems/16.lean b/FormalConjectures/ErdosProblems/16.lean new file mode 100644 index 0000000000..0fcc5387ab --- /dev/null +++ b/FormalConjectures/ErdosProblems/16.lean @@ -0,0 +1,67 @@ +/- +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 +import FormalConjecturesForMathlib.Combinatorics.AP.Basic + +/-! +# Erdős Problem 16 + +*Reference:* [erdosproblems.com/16](https://www.erdosproblems.com/16) + +Erdős [Er50] showed that the set of odd integers not of the form $2^k + p$ (with $p$ prime) +contains an infinite arithmetic progression, and asked whether this set is the union of an +infinite AP and a density-zero set. Chen [Ch23] proved it is not. + +[Er50] Erdős, P., _On integers of the form $2^k + p$ and some related problems_. Summa Brasil. +Math. **2** (1950), 113–123. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (1995), 167–189. + +[Ch23] Chen, Y.-G., _A conjecture of Erdős on $p+2^k$_. arXiv:2312.04120 (2023). + +OEIS: [A006285](https://oeis.org/A006285) — Odd numbers not of the form $2^k + p$. +-/ + +namespace Erdos16 + +/-- +The set of odd positive integers that cannot be expressed as $2^k + p$ for any +non-negative integer $k$ and any prime $p$. +-/ +def oddNotPowerOfTwoPlusPrime : Set ℕ := + {n : ℕ | Odd n ∧ ∀ (k : ℕ) (p : ℕ), Nat.Prime p → n ≠ 2 ^ k + p} + +/-- +The set of odd integers not of the form $2^k + p$ (where $p$ is prime and $k \geq 0$) +is **not** the union of an infinite arithmetic progression and a set of natural density zero. + +Erdős [Er95, p.167] asked whether this set equals $AP \cup D$ for some infinite arithmetic +progression $AP$ and density-zero set $D$, calling the conjecture 'rather silly'. Using covering +congruences, Erdős [Er50] showed this set contains an infinite arithmetic progression. +Chen [Ch23] resolved the question negatively. +-/ +@[category research solved, AMS 11] +theorem erdos_16 : answer(False) ↔ + ∃ (AP D : Set ℕ), + AP.IsAPOfLength ⊤ ∧ + D.HasDensity 0 ∧ + oddNotPowerOfTwoPlusPrime = AP ∪ D := by + sorry + +end Erdos16 diff --git a/FormalConjectures/ErdosProblems/161.lean b/FormalConjectures/ErdosProblems/161.lean new file mode 100644 index 0000000000..f6420d49e7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/161.lean @@ -0,0 +1,80 @@ +/- +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 161 + +Erdős conjectured that for $t$-uniform hypergraph 2-colourings, the balanced-colouring threshold +$F^{(t)}(n,\alpha)$ grows polynomially in $\log n$ for any $\alpha > 0$, in contrast with the +iterated-logarithm growth at $\alpha = 0$. + +Erdős offered a $500 prize for resolving this problem. + +See also Problem 562 (conjectured asymptotics for $F^{(t)}(n,0)$) and Problem 563 (the case +$t = 2$). + +*Reference:* [erdosproblems.com/161](https://www.erdosproblems.com/161) + +[Er90b] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and +differences_. Mathematics of Ramsey theory, Algorithms Combin. 5 (1990), 12-28. + +[CFS11] Conlon, D., Fox, J., and Sudakov, B., _Large almost monochromatic subsets in +hypergraphs_. Israel J. Math. (2011), 423-432. +-/ + +open Finset Real + +namespace Erdos161 + +/-- A 2-colouring $c$ of the $t$-element subsets of $\text{Fin}(n)$ is $\alpha$-balanced at +threshold $m$ if for every subset $X \subseteq \text{Fin}(n)$ with $|X| \geq m$, each colour class +contains at least $\alpha \binom{|X|}{t}$ many $t$-element subsets of $X$. -/ +def IsBalancedColouring (n t m : ℕ) (α : ℝ) (c : Finset (Fin n) → Bool) : Prop := + ∀ X : Finset (Fin n), m ≤ X.card → + ∀ b : Bool, + α * (Nat.choose X.card t : ℝ) ≤ + (((X.powersetCard t).filter (fun S => c S = b)).card : ℝ) + +/-- $F^{(t)}(n, \alpha)$ is the smallest $m$ such that there exists a 2-colouring of the +$t$-element subsets of $[n]$ that is $\alpha$-balanced at threshold $m$. -/ +noncomputable def fBalanced (t n : ℕ) (α : ℝ) : ℕ := + sInf { m : ℕ | ∃ c : Finset (Fin n) → Bool, IsBalancedColouring n t m α c } + +/-- +Erdős Conjecture (Problem 161) [Er90b, p.21]: + +For any $t \geq 2$ and $0 < \alpha < 1/2$, the function $F^{(t)}(n, \alpha)$ is bounded by a +polynomial in $\log n$. Specifically, there exist constants $C > 0$ and $D > 0$ +(depending on $t$ and $\alpha$) such that $F^{(t)}(n, \alpha) \leq C \cdot (\log n)^D$ for all +sufficiently large $n$. + +This captures Erdős's conjecture that "the jump occurs all in one step at $0$": +for $\alpha > 0$, $F^{(t)}(n, \alpha)$ grows polynomially in $\log n$, contrasting with the +much slower iterated-logarithm growth $F^{(t)}(n, 0) \approx \log_{t-1}(n)$. +-/ +@[category research open, AMS 5] +theorem erdos_161 : + ∀ t : ℕ, 2 ≤ t → + ∀ α : ℝ, 0 < α → α < 1 / 2 → + ∃ C : ℝ, 0 < C ∧ + ∃ D : ℝ, 0 < D ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (fBalanced t n α : ℝ) ≤ C * (Real.log (n : ℝ)) ^ D := by + sorry + +end Erdos161 diff --git a/FormalConjectures/ErdosProblems/162.lean b/FormalConjectures/ErdosProblems/162.lean new file mode 100644 index 0000000000..8bcb3a2b80 --- /dev/null +++ b/FormalConjectures/ErdosProblems/162.lean @@ -0,0 +1,71 @@ +/- +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 162 + +For a 2-colouring of the edges of $K_n$, let $F(n, \alpha)$ be the smallest $m$ such that every +subset of size at least $m$ has both colour classes containing more than an $\alpha$ fraction of its +edges. Erdős conjectured that $F(n, \alpha) \sim c_\alpha \log n$ for a constant $c_\alpha > 0$. + +*Reference:* [erdosproblems.com/162](https://www.erdosproblems.com/162) + +[Er90b] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and differences_. +Mathematics of Ramsey theory, Algorithms and Combinatorics, 5 (1990), Springer, Berlin, 12-28. +-/ + +open Finset Real + +namespace Erdos162 + +/-- A 2-colouring $c$ of the edges (2-element subsets) of $\operatorname{Fin}(n)$ is +$\alpha$-balanced at threshold $m$ if for every subset $X \subseteq \operatorname{Fin}(n)$ +with $|X| \geq m$, each colour class contains more than $\alpha \binom{|X|}{2}$ +edges within $X$. -/ +def IsEdgeBalanced (n m : ℕ) (α : ℝ) (c : Finset (Fin n) → Bool) : Prop := + ∀ X : Finset (Fin n), m ≤ X.card → + ∀ b : Bool, + α * (Nat.choose X.card 2 : ℝ) < + (((X.powersetCard 2).filter (fun S => c S = b)).card : ℝ) + +/-- $F(n, \alpha)$ is the smallest threshold $m$ such that there exists a 2-colouring +of the edges of $K_n$ that is $\alpha$-balanced at threshold $m$. -/ +noncomputable def F (n : ℕ) (α : ℝ) : ℕ := + sInf { m : ℕ | ∃ c : Finset (Fin n) → Bool, IsEdgeBalanced n m α c } + +/-- +Erdős Conjecture (Problem 162) [Er90b, p.21]: + +For every fixed $0 < \alpha < 1/2$, $F(n, \alpha) \sim c_\alpha \log n$ for some +constant $c_\alpha > 0$. That is, the ratio $F(n, \alpha) / \log n$ converges to a positive +constant $c_\alpha$ as $n \to \infty$. + +This sharpens the known bound $F(n, \alpha) = \Theta(\log n)$ (established via the +probabilistic method) to an exact asymptotic with a well-defined constant. +-/ +@[category research open, AMS 5] +theorem erdos_162 : + ∀ α : ℝ, 0 < α → α < 1 / 2 → + ∃ c : ℝ, 0 < c ∧ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (c - ε) * Real.log (n : ℝ) ≤ (F n α : ℝ) ∧ + (F n α : ℝ) ≤ (c + ε) * Real.log (n : ℝ) := by + sorry + +end Erdos162 diff --git a/FormalConjectures/ErdosProblems/163.lean b/FormalConjectures/ErdosProblems/163.lean new file mode 100644 index 0000000000..43b5a1736c --- /dev/null +++ b/FormalConjectures/ErdosProblems/163.lean @@ -0,0 +1,78 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 163 + +*Reference:* [erdosproblems.com/163](https://www.erdosproblems.com/163) + +The Burr-Erdős conjecture: For any $d \geq 1$, if $H$ is a graph on $n$ vertices such +that every subgraph of $H$ contains a vertex of degree at most $d$ (i.e., $H$ is +$d$-degenerate), then $R(H) \leq C_d \cdot n$ for some constant $C_d$ depending only on $d$. + +Proved by Lee [Le17], who showed $R(H) \leq 2^{2^{O(d)}} \cdot n$. + +[BuEr75] Burr, S. A. and Erdős, P., _On the magnitude of generalized Ramsey numbers for graphs_. +Infinite and finite sets, Vol. 1 (1975), 214–240. + +[Er82e] Erdős, P., _Problems and results on finite and infinite graphs_. Recent advances +in graph theory (Proc. Second Czechoslovak Sympos., Prague, 1982). + +[Le17] Lee, C., _Ramsey numbers of degenerate graphs_. Ann. of Math. **186** (2017), 791–829. + +See also Problem 800, which is a special case of this conjecture. +-/ + +open SimpleGraph Finset + +namespace Erdos163 + +/-- A simple graph $H$ on a finite vertex type is $d$-degenerate if every nonempty + subset $S$ of vertices contains a vertex $v$ with at most $d$ neighbours in $S$. -/ +def IsDDegenerate {V : Type*} [Fintype V] [DecidableEq V] + (H : SimpleGraph V) [DecidableRel H.Adj] (d : ℕ) : Prop := + ∀ S : Finset V, S.Nonempty → + ∃ v ∈ S, (S.filter (H.Adj v)).card ≤ d + +/-- The diagonal Ramsey number $R(H)$: the minimum $N$ such that for every simple + graph $G$ on $\operatorname{Fin} N$, either $G$ or $G^c$ contains a copy of $H$. -/ +noncomputable def ramseyDiag {U : Type*} (H : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + H.IsContained G ∨ H.IsContained Gᶜ} + +/-- +Erdős Problem 163 [BuEr75, Er82e] — The Burr-Erdős Conjecture: + +For every $d \geq 1$, there exists a constant $C_d > 0$ such that for every +$d$-degenerate graph $H$ on $n$ vertices, $R(H, H) \leq C_d \cdot n$. + +Equivalently, if $H$ is the union of $c$ forests then $R(H) \leq C_c \cdot n$. + +Proved by Lee [Le17], who showed $R(H) \leq 2^{2^{O(d)}} \cdot n$. +-/ +@[category research solved, AMS 5] +theorem erdos_163 : + ∀ d : ℕ, 1 ≤ d → + ∃ C : ℝ, 0 < C ∧ + ∀ (n : ℕ) (H : SimpleGraph (Fin n)) [DecidableRel H.Adj], + IsDDegenerate H d → + (ramseyDiag H : ℝ) ≤ C * (n : ℝ) := by + sorry + +end Erdos163 diff --git a/FormalConjectures/ErdosProblems/164.lean b/FormalConjectures/ErdosProblems/164.lean new file mode 100644 index 0000000000..f8edaa5442 --- /dev/null +++ b/FormalConjectures/ErdosProblems/164.lean @@ -0,0 +1,71 @@ +/- +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 164 + +*Reference:* [erdosproblems.com/164](https://www.erdosproblems.com/164) + +[Er35] Erdős, P., *Note on sequences of integers no one of which is divisible by any other*. +J. London Math. Soc. (1935), 126-128. + +[Er76g] Erdős, P., *Problems and results on combinatorial number theory* (1976). + +[Er86] Erdős, P., *Some problems and results on combinatorial number theory* (1986). + +[Li23] Lichtman, J.D., *A proof of the Erdős primitive set conjecture*. +arXiv:2202.02384 (2023). + +[Va99] §1.12. +-/ + +open Real + +namespace Erdos164 + +/-- +The Erdős primitive set conjecture (Problem 164) [Er76g, Er86]: + +For any primitive set $A \subseteq \{2, 3, 4, \ldots\}$ of natural numbers (i.e., an antichain +under divisibility), we have +$$\sum_{n \in A} \frac{1}{n \cdot \log n} \leq \sum_{p \text{ prime}} \frac{1}{p \cdot \log p}.$$ + +That is, the sum $\sum \frac{1}{n \log n}$ over any primitive set is maximised when +the set is the set of all primes. + +Proved by Lichtman [Li23]. +-/ +@[category research solved, AMS 11] +theorem erdos_164 : + ∀ A : Set ℕ, IsAntichain (· ∣ ·) A → A ⊆ {n : ℕ | 2 ≤ n} → + ∑' n : A, (1 : ℝ) / (((n : ℕ) : ℝ) * Real.log ((n : ℕ) : ℝ)) ≤ + ∑' p : {p : ℕ | Nat.Prime p}, (1 : ℝ) / (((p : ℕ) : ℝ) * Real.log ((p : ℕ) : ℝ)) := by + sorry + +/-- +Erdős [Er35] proved that for any primitive set $A \subseteq \{2, 3, 4, \ldots\}$, +the sum $\sum_{n \in A} \frac{1}{n \log n}$ converges. This is a prerequisite for the +main conjecture `erdos_164`. +-/ +@[category research solved, AMS 11] +theorem erdos_164_convergence : + ∀ A : Set ℕ, IsAntichain (· ∣ ·) A → A ⊆ {n : ℕ | 2 ≤ n} → + Summable (fun n : A => (1 : ℝ) / (((n : ℕ) : ℝ) * Real.log ((n : ℕ) : ℝ))) := by + sorry + +end Erdos164 diff --git a/FormalConjectures/ErdosProblems/165.lean b/FormalConjectures/ErdosProblems/165.lean new file mode 100644 index 0000000000..8cc7c12f09 --- /dev/null +++ b/FormalConjectures/ErdosProblems/165.lean @@ -0,0 +1,116 @@ +/- +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 165 + +*Reference:* [erdosproblems.com/165](https://www.erdosproblems.com/165) + +Give an asymptotic formula for $R(3,k)$. Prize: $250. + +$R(3,k)$ is the Ramsey number: the minimum $N$ such that every simple graph +on $N$ vertices contains either a triangle ($3$-clique) or an independent set +of size $k$ (equivalently, a $k$-clique in the complement). + +It is known that for some constant $c > 0$ and large $k$: +$$ + (c + o(1)) \frac{k^2}{\log k} \leq R(3,k) \leq (1 + o(1)) \frac{k^2}{\log k} +$$ + +The upper bound is due to Shearer [Sh83], improving Ajtai–Komlós–Szemerédi +[AKS80]. The lower bound has been progressively improved: Kim [Ki95] showed +$c \geq 1/162$, Fiz Pontiveros–Griffiths–Morris [PGM20] and Bohman–Keevash +[BoKe21] improved this to $c \geq 1/4$, Campos–Jenssen–Michelen–Sahasrabudhe +[CJMS25] to $c \geq 1/3$, and Hefty–Horn–King–Pfender [HHKP25] to +$c \geq 1/2$. The conjectured asymptotic is +$R(3,k) \sim \frac{1}{2} \frac{k^2}{\log k}$. + +Related problems: 544, 986, 1013. OEIS: [A000791](https://oeis.org/A000791). + +[AKS80] Ajtai, M., Komlós, J. and Szemerédi, E., _A note on Ramsey numbers_. +J. Combin. Theory Ser. A **29** (1980), 354-360. + +[Sh83] Shearer, J. B., _A note on the independence number of triangle-free +graphs_. Discrete Math. **46** (1983), 83-87. + +[Ki95] Kim, J. H., _The Ramsey number R(3,t) has order of magnitude t²/log t_. +Random Structures and Algorithms (1995), 173-207. + +[PGM20] Fiz Pontiveros, G., Griffiths, S. and Morris, R., _The triangle-free +process and the Ramsey number R(3,k)_. Mem. Amer. Math. Soc. (2020). + +[BoKe21] Bohman, T. and Keevash, P., _Dynamic concentration of the +triangle-free process_. Random Structures Algorithms (2021), 221-293. + +[CJMS25] Campos, M., Jenssen, M., Michelen, M. and Sahasrabudhe, J., +_A new lower bound for the Ramsey numbers R(3,k)_. arXiv:2505.13371 (2025). + +[HHKP25] Hefty, L., Horn, P., King, R. and Pfender, F., _Improving R(3,k) in +just two bites_. arXiv:2510.19718 (2025). + +[Er61] Erdős, P. (1961). [Er71] Erdős, P. (1971). [Er78] Erdős, P. (1978). +[Er90b] Erdős, P. (1990). [Er93] Erdős, P. (1993). [Er97c] Erdős, P. (1997). +-/ + +open SimpleGraph Real + +namespace Erdos165 + +/-- The Ramsey number $R(3,k)$: the minimum $N$ such that every simple graph +on $N$ vertices contains either a triangle ($3$-clique) or an independent +set of size $k$ (a $k$-clique in the complement). -/ +noncomputable def ramseyR3 (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree k} + +/-- +Erdős Conjecture (Problem 165) [Er61, Er71, Er90b, Er93, Er97c]: + +There exists a constant $c > 0$ such that $R(3,k) \sim c \cdot k^2 / \log k$, i.e., +for all $\varepsilon > 0$ and all sufficiently large $k$: +$$ + (c - \varepsilon) \cdot \frac{k^2}{\log k} \leq R(3,k) \leq (c + \varepsilon) \cdot \frac{k^2}{\log k}. +$$ + +The conjectured value is $c = 1/2$. +-/ +@[category research open, AMS 5] +theorem erdos_165 : answer(sorry) ↔ + ∃ c : ℝ, 0 < c ∧ ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + (c - ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) ≤ (ramseyR3 k : ℝ) ∧ + (ramseyR3 k : ℝ) ≤ (c + ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) := by + sorry + +/-- +Erdős Problem 165 — conjectured value $c = 1/2$: + +$R(3,k) \sim \frac{1}{2} \frac{k^2}{\log k}$, i.e., for all $\varepsilon > 0$ +and all sufficiently large $k$: +$$ + (1/2 - \varepsilon) \cdot \frac{k^2}{\log k} \leq R(3,k) \leq (1/2 + \varepsilon) \cdot \frac{k^2}{\log k}. +$$ +-/ +@[category research open, AMS 5] +theorem erdos_165_conjectured_value : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + (1 / 2 - ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) ≤ (ramseyR3 k : ℝ) ∧ + (ramseyR3 k : ℝ) ≤ (1 / 2 + ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) := by + sorry + +end Erdos165 diff --git a/FormalConjectures/ErdosProblems/166.lean b/FormalConjectures/ErdosProblems/166.lean new file mode 100644 index 0000000000..5be20fb890 --- /dev/null +++ b/FormalConjectures/ErdosProblems/166.lean @@ -0,0 +1,106 @@ +/- +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 166 + +*Reference:* [erdosproblems.com/166](https://www.erdosproblems.com/166) + +Prove that $R(4,k) \gg k^3 / (\log k)^{O(1)}$. + +$R(4,k)$ is the Ramsey number: the minimum $N$ such that every simple graph +on $N$ vertices contains either a $4$-clique or an independent set of size $k$ +(equivalently, a $k$-clique in the complement). + +Ajtai, Komlós, and Szemerédi [AKS80] proved the upper bound +$R(4,k) \ll k^3 / (\log k)^2$. +Spencer [Sp77] proved $R(4,k) \gg (k \log k)^{5/2}$. +Mattheus and Verstraëte [MaVe23] proved $R(4,k) \gg k^3 / (\log k)^4$, +resolving this conjecture. + +[AKS80] Ajtai, M., Komlós, J., and Szemerédi, E., *A note on Ramsey numbers*, +J. Combin. Theory Ser. A **29** (1980), 354–360. + +[Sp77] Spencer, J., *Asymptotic lower bounds for Ramsey functions*, Discrete Math. +**20** (1977), 69–76. + +[MaVe23] Mattheus, S. and Verstraëte, J., *The asymptotics of $r(4,t)$*, +Ann. of Math. **199** (2024), 919–941. + +[Er90b, Er91, Er93, Er97c] Various papers of Erdős posing and discussing this problem. + +See also Problem 986 for the general conjecture on $R(k,n)$, of which this is the $k = 4$ case. + +OEIS: [A059442](https://oeis.org/A059442) +-/ + +open SimpleGraph Real + +namespace Erdos166 + +/-- The Ramsey number $R(4,k)$: the minimum $N$ such that every simple graph +on $N$ vertices contains either a $4$-clique or an independent set of +size $k$ (a $k$-clique in the complement). -/ +noncomputable def ramseyR4 (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 4 ∨ ¬Gᶜ.CliqueFree k} + +/-- +Erdős Problem 166 [Er90b, Er91, Er93, Er97c]: + +There exist constants $C > 0$ and $\alpha \in \mathbb{N}$ such that for all sufficiently large $k$, +$$ + R(4,k) \geq C \cdot k^3 / (\log k)^\alpha. +$$ + +In asymptotic notation: $R(4,k) \gg k^3 / (\log k)^{O(1)}$. + +This was proved by Mattheus and Verstraëte [MaVe23], who showed +$R(4,k) \gg k^3 / (\log k)^4$. +-/ +@[category research solved, AMS 5] +theorem erdos_166 : + ∃ C : ℝ, 0 < C ∧ + ∃ α : ℕ, + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ α) ≤ (ramseyR4 k : ℝ) := by + sorry + +/-- +Mattheus and Verstraëte [MaVe23] proved the specific bound $R(4,k) \gg k^3 / (\log k)^4$, +resolving Erdős Problem 166 with exponent $\alpha = 4$. +-/ +@[category research solved, AMS 5] +theorem erdos_166_mattheus_verstraete : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ 4) ≤ (ramseyR4 k : ℝ) := by + sorry + +/-- +Ajtai, Komlós, and Szemerédi [AKS80] proved the upper bound $R(4,k) \ll k^3 / (\log k)^2$, +i.e., there exists a constant $C > 0$ such that $R(4,k) \leq C \cdot k^3 / (\log k)^2$ +for all sufficiently large $k$. +-/ +@[category research solved, AMS 5] +theorem erdos_166_upper_bound : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + (ramseyR4 k : ℝ) ≤ C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ 2) := by + sorry + +end Erdos166 diff --git a/FormalConjectures/ErdosProblems/167.lean b/FormalConjectures/ErdosProblems/167.lean new file mode 100644 index 0000000000..4d6913ce8b --- /dev/null +++ b/FormalConjectures/ErdosProblems/167.lean @@ -0,0 +1,73 @@ +/- +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 167 + +*Reference:* [erdosproblems.com/167](https://www.erdosproblems.com/167) + +Tuza's conjecture (1981): If $G$ is a finite simple graph whose maximum number +of pairwise edge-disjoint triangles (the triangle packing number $\nu(G)$) is at +most $k$, then $G$ can be made triangle-free by removing at most $2k$ edges (the +triangle covering number $\tau(G)$ is at most $2k$). + +Equivalently: $\tau(G) \leq 2 \cdot \nu(G)$ for every finite graph $G$. + +It is trivial that $\tau(G) \leq 3 \cdot \nu(G)$. The examples of $K_4$ and $K_5$ show that +$2k$ would be best possible. Haxell [Ha99] improved the trivial bound to +$(3 - 3/23 + o(1))k$. Kahn and Park [KaPa22] proved this for random graphs. + +[Ha99] Haxell, P. E., _Packing and covering triangles in graphs_. Discrete Math. 195 (1999), 251–254. + +[KaPa22] Kahn, J. and Park, J., _Tuza's conjecture for random graphs_. Random Structures & Algorithms 61 (2022), 235–249. + +[Er88] Erdős, P., _Problems and results on chromatic numbers in finite and infinite graphs_. Graph theory with applications to algorithms and computer science (1985), 201–213. +-/ + +open SimpleGraph Finset + +namespace Erdos167 + +/-- +Erdős Conjecture (Problem 167) — Tuza's Conjecture [Er88]: + +For any finite simple graph $G$, if the maximum number of pairwise edge-disjoint +triangles in $G$ is at most $k$, then $G$ can be made triangle-free by removing at +most $2k$ edges. + +Two triangles (3-cliques) are edge-disjoint iff their vertex sets share at most +one vertex, since in a triangle every pair of vertices forms an edge. + +The hypothesis states that every family of pairwise edge-disjoint triangles +has size at most $k$. The conclusion states that there exists a subgraph $H \leq G$ +that is triangle-free, obtained by removing at most $2k$ edges from $G$. +-/ +@[category research open, AMS 5] +theorem erdos_167 : answer(sorry) ↔ + ∀ {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ), + (∀ (T : Finset (Finset V)), + (∀ t ∈ T, G.IsNClique 3 t) → + (∀ t₁ ∈ T, ∀ t₂ ∈ T, t₁ ≠ t₂ → (t₁ ∩ t₂).card ≤ 1) → + T.card ≤ k) → + ∃ (H : SimpleGraph V), + H ≤ G ∧ + H.CliqueFree 3 ∧ + (G.edgeSet \ H.edgeSet).ncard ≤ 2 * k := by sorry + +end Erdos167 diff --git a/FormalConjectures/ErdosProblems/169.lean b/FormalConjectures/ErdosProblems/169.lean new file mode 100644 index 0000000000..06a9ede28b --- /dev/null +++ b/FormalConjectures/ErdosProblems/169.lean @@ -0,0 +1,124 @@ +/- +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 169 + +Let $f(k)$ denote the supremum of $\sum_{n \in A} 1/n$ over all sets $A$ of positive +integers containing no $k$-term arithmetic progression. Is +$\lim_{k \to \infty} f(k) / \log W(k) = \infty$, where $W(k)$ is the $k$-th van der +Waerden number? + +Berlekamp [Be68] proved $f(k) \geq (\log 2 / 2) k$. Gerver [Ge77] improved this to +$f(k) \geq (1 - o(1)) k \log k$. It is trivial that $f(k) / \log W(k) \geq 1/2$, but +improving this constant is open. + +Gerver also proved that Problem 3 (if $\sum 1/n$ diverges then $A$ contains arbitrarily +long APs) is equivalent to $f(k)$ being finite for all $k$. + +## References + +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial + number theory*. Monographies de L'Enseignement Mathematique (1980). +- [Be68] Berlekamp, E. R., *A construction for partitions which avoid long arithmetic + progressions*. Canad. Math. Bull. (1968), 409-414. +- [Ge77] Gerver, J. L., *The sum of the reciprocals of a set of integers with no + arithmetic progression of k terms*. Proc. Amer. Math. Soc. (1977), 211-214. +- [Wr84] Wróblewski, J., *A nonaveraging set of integers with a large sum of + reciprocals*. Math. Comp. (1984), 261-262. +- [Wa25] Walker, A., *Integer sets of large harmonic sum which avoid long arithmetic + progressions*. arXiv:2203.06045 (2025). + +*Reference:* [erdosproblems.com/169](https://www.erdosproblems.com/169) +-/ + +open Finset BigOperators Real + +namespace Erdos169 + +/-- A finset of natural numbers is $k$-AP-free if it contains no arithmetic +progression of length $k$ with positive common difference. -/ +def IsAPFree (k : ℕ) (A : Finset ℕ) : Prop := + ¬∃ a d : ℕ, 0 < d ∧ ∀ i : ℕ, i < k → a + i * d ∈ A + +/-- The van der Waerden property: every $2$-coloring of $\{0, \ldots, N-1\}$ contains +a monochromatic $k$-term arithmetic progression. The coloring is defined on all of `ℕ`, +but only values in `{0, …, N-1}` matter since all AP terms satisfy `a + i * d < N`. -/ +def VDWProperty (k N : ℕ) : Prop := + ∀ f : ℕ → Bool, ∃ a d : ℕ, 0 < d ∧ a + (k - 1) * d < N ∧ + ∀ i : ℕ, i < k → f (a + i * d) = f a + +/-- Van der Waerden's theorem guarantees the existence of $W(k)$ for all $k$. -/ +@[category graduate, AMS 5] +lemma vdw_exists (k : ℕ) : ∃ N, VDWProperty k N := by sorry + +open Classical in +/-- The van der Waerden number $W(k)$: the smallest $N$ such that any $2$-coloring +of $\{0, \ldots, N-1\}$ contains a monochromatic $k$-term AP. -/ +noncomputable def vanDerWaerdenNumber (k : ℕ) : ℕ := + Nat.find (vdw_exists k) + +/-- +Erdős Problem 169: +Let $k \geq 3$ and $f(k)$ be the supremum of $\sum_{n \in A} 1/n$ over all sets $A$ of +positive integers containing no $k$-term arithmetic progression. + +Is $\lim_{k \to \infty} f(k) / \log W(k) = \infty$, where $W(k)$ is the van der Waerden +number? + +This is formalized as: for every constant $C > 0$, for all sufficiently large $k$, +there exists a finite AP-free set $A$ of positive integers whose reciprocal sum +exceeds $C \cdot \log W(k)$. +-/ +@[category research open, AMS 5 11] +theorem erdos_169 : answer(sorry) ↔ + ∀ C : ℝ, 0 < C → ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → + ∃ A : Finset ℕ, (∀ n ∈ A, 0 < n) ∧ IsAPFree k A ∧ + C * Real.log (↑(vanDerWaerdenNumber k) : ℝ) < + ∑ n ∈ A, (1 : ℝ) / (↑n : ℝ) := by + sorry + +/-- +Gerver's lower bound [Ge77]: $f(k) \geq (1 - o(1)) k \log k$. + +Formalized as: for every $\varepsilon > 0$, for all sufficiently large $k$, there exists a +finite AP-free set of positive integers whose reciprocal sum exceeds $(1 - \varepsilon) k \log k$. +-/ +@[category graduate, AMS 5 11] +theorem erdos_169_gerver_lower_bound : + ∀ ε : ℝ, 0 < ε → ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → + ∃ A : Finset ℕ, (∀ n ∈ A, 0 < n) ∧ IsAPFree k A ∧ + (1 - ε) * (↑k : ℝ) * Real.log (↑k : ℝ) < + ∑ n ∈ A, (1 : ℝ) / (↑n : ℝ) := by + sorry + +/-- +Equivalence with Erdős Problem 3 (Gerver [Ge77]): +$f(k)$ is finite for all $k$ if and only if every set $A \subseteq \mathbb{N}^+$ with +$\sum_{n \in A} 1/n = \infty$ contains arbitrarily long arithmetic progressions. +-/ +@[category graduate, AMS 5 11] +theorem erdos_169_equiv_problem3 : + (∀ k : ℕ, ∃ B : ℝ, ∀ A : Finset ℕ, (∀ n ∈ A, 0 < n) → IsAPFree k A → + ∑ n ∈ A, (1 : ℝ) / (↑n : ℝ) ≤ B) ↔ + (∀ A : Set ℕ, (∀ n ∈ A, 0 < n) → + (¬ Summable fun a : A ↦ (1 : ℝ) / (↑(a : ℕ) : ℝ)) → + ∀ k : ℕ, ∃ a d : ℕ, 0 < d ∧ ∀ i : ℕ, i < k → a + i * d ∈ A) := by + sorry + +end Erdos169 diff --git a/FormalConjectures/ErdosProblems/171.lean b/FormalConjectures/ErdosProblems/171.lean new file mode 100644 index 0000000000..d505eb7038 --- /dev/null +++ b/FormalConjectures/ErdosProblems/171.lean @@ -0,0 +1,80 @@ +/- +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 171 + +*Reference:* [erdosproblems.com/171](https://www.erdosproblems.com/171) + +The density Hales-Jewett theorem: for every $\varepsilon > 0$ and integer $t \geq 1$, if $N$ is +sufficiently large and $A$ is a subset of $[t]^N$ of size at least $\varepsilon \cdot t^N$ then $A$ +must contain a combinatorial line. + +A combinatorial line in $[t]^N$ is a set $\{p_1, \ldots, p_t\}$ where there is a +non-empty set $S$ of "active" coordinates such that for each active coordinate $j$, +the $j$-th coordinate of $p_i$ is $i$, and for each inactive coordinate $j$, all points +share the same constant value. + +This was proved by Furstenberg and Katznelson [FuKa91]. A new elementary proof +with quantitative bounds was given by the Polymath project [Po12]. + +[FuKa91] Furstenberg, H. and Katznelson, Y., _A density version of the Hales-Jewett theorem_. +J. Anal. Math. 57 (1991), 64-119. + +[Po12] Polymath, D.H.J., _A new proof of the density Hales-Jewett theorem_. +Ann. of Math. 175 (2012), 1283-1327. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory: some problems on additive number theory_. (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +See also OEIS sequence [A156989](https://oeis.org/A156989). +-/ + +namespace Erdos171 + +/-- A combinatorial line in $[t]^N$ is a family of $t$ points parametrized by $\operatorname{Fin} t$, +determined by a non-empty set $S$ of "active" coordinates and fixed values $c$ +for inactive coordinates. The $i$-th point has coordinate $j$ equal to $i$ if $j$ is +active, and equal to $c(j)$ if $j$ is inactive. -/ +def IsCombinatorialLine (t N : ℕ) (P : Fin t → (Fin N → Fin t)) : Prop := + ∃ (S : Finset (Fin N)), S.Nonempty ∧ + ∃ (c : Fin N → Fin t), ∀ (i : Fin t) (j : Fin N), + P i j = if j ∈ S then i else c j + +/-- +Erdős Problem 171 (Density Hales-Jewett theorem) [ErGr79, ErGr80]: + +For every $\varepsilon > 0$ and integer $t \geq 1$, there exists $N_0$ such that for all +$N \geq N_0$, every subset $A$ of $[t]^N$ with $|A| \geq \varepsilon \cdot t^N$ contains a +combinatorial line. +-/ +@[category research solved, AMS 5] +theorem erdos_171 : + ∀ (t : ℕ), 1 ≤ t → + ∀ (ε : ℝ), 0 < ε → + ∃ (N₀ : ℕ), ∀ (N : ℕ), N₀ ≤ N → + ∀ (A : Finset (Fin N → Fin t)), + (A.card : ℝ) ≥ ε * (t : ℝ) ^ N → + ∃ (P : Fin t → (Fin N → Fin t)), + IsCombinatorialLine t N P ∧ ∀ (i : Fin t), P i ∈ A := by + sorry + +end Erdos171 diff --git a/FormalConjectures/ErdosProblems/173.lean b/FormalConjectures/ErdosProblems/173.lean new file mode 100644 index 0000000000..4a282826c5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/173.lean @@ -0,0 +1,124 @@ +/- +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 173 + +*Reference:* [erdosproblems.com/173](https://www.erdosproblems.com/173) + +In any 2-colouring of $\mathbb{R}^2$, for all but at most one triangle $T$ (up to congruence), +there is a monochromatic congruent copy of $T$. + +For some colourings a single equilateral triangle has to be excluded (considering +the colouring by alternating strips). Shader [Sh76] proved this is true for any +single right-angled triangle. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 108. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory: some problems on additive number theory_ (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_, Monographies de L'Enseignement Mathematique (1980). + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Sh76] Shader, L., _All right triangles are Ramsey in ℝ²!_, Journal of Combinatorial Theory, +Series A (1976), 385–389. +-/ + +namespace Erdos173 + +/-- Squared Euclidean distance between two points in $\mathbb{R}^2$. -/ +noncomputable def euclideanDistSq (p q : ℝ × ℝ) : ℝ := + (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 + +/-- The multiset of squared side lengths of a triangle. Two triangles are congruent + (by SSS) iff their squared side length multisets are equal. -/ +noncomputable def triangleSideSqs (p₁ p₂ p₃ : ℝ × ℝ) : Multiset ℝ := + ↑[euclideanDistSq p₁ p₂, euclideanDistSq p₂ p₃, euclideanDistSq p₁ p₃] + +/-- A triangle is non-degenerate if its vertices are not collinear. -/ +def TriangleNonDegenerate (p₁ p₂ p₃ : ℝ × ℝ) : Prop := + (p₂.1 - p₁.1) * (p₃.2 - p₁.2) - (p₃.1 - p₁.1) * (p₂.2 - p₁.2) ≠ 0 + +/-- +Erdős Conjecture (Problem 173) [Er75f, ErGr79, ErGr80, Er83c]: + +In any 2-colouring of $\mathbb{R}^2$, for all but at most one triangle $T$ (up to congruence), +there is a monochromatic congruent copy of $T$. + +Equivalently: if two non-degenerate triangles both fail to have any monochromatic +congruent copy under some 2-colouring, then they must be congruent. +-/ +@[category research open, AMS 5 51] +theorem erdos_173 : + ∀ f : ℝ × ℝ → Bool, + ∀ p₁ p₂ p₃ q₁ q₂ q₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ → + TriangleNonDegenerate q₁ q₂ q₃ → + (∀ a₁ a₂ a₃ : ℝ × ℝ, triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ → + ¬(f a₁ = f a₂ ∧ f a₂ = f a₃)) → + (∀ b₁ b₂ b₃ : ℝ × ℝ, triangleSideSqs b₁ b₂ b₃ = triangleSideSqs q₁ q₂ q₃ → + ¬(f b₁ = f b₂ ∧ f b₂ = f b₃)) → + triangleSideSqs p₁ p₂ p₃ = triangleSideSqs q₁ q₂ q₃ := by + sorry + +/-- A triangle with vertices `p₁`, `p₂`, `p₃` is right-angled if the dot product at + some vertex is zero (i.e., two sides meeting at that vertex are perpendicular). + The three vertices are also required to be distinct. -/ +def IsRightTriangle (p₁ p₂ p₃ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₂ ≠ p₃ ∧ p₁ ≠ p₃ ∧ + ((p₂.1 - p₁.1) * (p₃.1 - p₁.1) + (p₂.2 - p₁.2) * (p₃.2 - p₁.2) = 0 ∨ + (p₁.1 - p₂.1) * (p₃.1 - p₂.1) + (p₁.2 - p₂.2) * (p₃.2 - p₂.2) = 0 ∨ + (p₁.1 - p₃.1) * (p₂.1 - p₃.1) + (p₁.2 - p₃.2) * (p₂.2 - p₃.2) = 0) + +/-- +Shader's theorem [Sh76]: Every non-degenerate right-angled triangle is Ramsey in ℝ². + +In any 2-colouring of ℝ², for every non-degenerate right-angled triangle, there exists +a monochromatic congruent copy. This is a proved special case of Erdős Problem 173. +-/ +@[category research solved, AMS 5 51] +theorem erdos_173_right_triangles : + ∀ f : ℝ × ℝ → Bool, + ∀ p₁ p₂ p₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ → + IsRightTriangle p₁ p₂ p₃ → + ∃ a₁ a₂ a₃ : ℝ × ℝ, + triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ ∧ + f a₁ = f a₂ ∧ f a₂ = f a₃ := by + sorry + +/-- +There exists a 2-colouring of ℝ² and a non-degenerate triangle such that no +monochromatic congruent copy of that triangle exists. This shows that the +"at most one" exclusion in Erdős Problem 173 is tight — the equilateral triangle +can be excluded using the alternating-strips colouring. +-/ +@[category research solved, AMS 5 51] +theorem erdos_173_equilateral_excluded : + ∃ f : ℝ × ℝ → Bool, + ∃ p₁ p₂ p₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ ∧ + ∀ a₁ a₂ a₃ : ℝ × ℝ, + triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ → + ¬(f a₁ = f a₂ ∧ f a₂ = f a₃) := by + sorry + +end Erdos173 diff --git a/FormalConjectures/ErdosProblems/174.lean b/FormalConjectures/ErdosProblems/174.lean new file mode 100644 index 0000000000..f8a1c1e515 --- /dev/null +++ b/FormalConjectures/ErdosProblems/174.lean @@ -0,0 +1,137 @@ +/- +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 174 + +*Reference:* [erdosproblems.com/174](https://www.erdosproblems.com/174) + +A finite set $A \subset \mathbb{R}^n$ is called Ramsey if, for any $k \geq 1$, there exists some +$d = d(A,k)$ such that in any $k$-colouring of $\mathbb{R}^d$ there exists a monochromatic +copy of $A$. Characterise the Ramsey sets in $\mathbb{R}^n$. + +Erdős, Graham, Montgomery, Rothschild, Spencer, and Straus [EGMRSS73] proved +that every Ramsey set is 'spherical': it lies on the surface of some sphere. +Graham has conjectured that every spherical set is Ramsey, which would give a +complete characterisation. + +Leader, Russell, and Walters [LRW12] proposed a competing conjecture: a set is +Ramsey if and only if it is 'subtransitive' — embeddable in a higher-dimensional +set on which isometries act transitively. If true, this would refute Graham's +conjecture, as subtransitivity is strictly stronger than sphericality. + +Known Ramsey sets include vertices of $k$-dimensional rectangles [EGMRSS73], +non-degenerate simplices [FrRo90], trapezoids [Kr92], and regular +polygons/polyhedra [Kr91]. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 108. + +[EGMRSS73] Erdős, P., Graham, R. L., Montgomery, P., Rothschild, B. L., Spencer, J., and +Straus, E. G., _Euclidean Ramsey theorems_, J. Combin. Theory Ser. A (1973), 341–363. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory: some problems on additive number theory_ (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_, Monographies de L'Enseignement Mathematique (1980). + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[FrRo90] Frankl, P. and Rödl, V., _A partition property of simplices in Euclidean space_, +J. Amer. Math. Soc. (1990), 1–7. + +[Kr91] Kříž, I., _Permutation groups in Euclidean Ramsey theory_, Proc. Amer. Math. Soc. (1991), +899–907. + +[Kr92] Kříž, I., _All trapezoids are Ramsey_, Discrete Math. (1992), 59–62. + +[LRW12] Leader, I., Russell, P. A., and Walters, M., _Transitive sets in Euclidean Ramsey +theory_, J. Combin. Theory Ser. A **119** (2012), 382–396. +-/ + +namespace Erdos174 + +/-- A finite subset $A$ of $\mathbb{R}^n$ is Euclidean Ramsey if for every $k \geq 1$, there +exists $d$ such that any $k$-coloring of $\mathbb{R}^d$ contains a monochromatic +isometric copy of $A$ (i.e., a copy obtained by a distance-preserving map). -/ +def IsEuclideanRamsey (n : ℕ) (A : Finset (EuclideanSpace ℝ (Fin n))) : Prop := + ∀ k : ℕ, 0 < k → + ∃ d : ℕ, ∀ f : EuclideanSpace ℝ (Fin d) → Fin k, + ∃ φ : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin d), + Isometry φ ∧ + ∃ c : Fin k, ∀ a ∈ A, f (φ a) = c + +/-- A finite set in $\mathbb{R}^n$ is spherical if all its points lie on the surface +of some sphere (are equidistant from some center point). -/ +def IsSpherical (n : ℕ) (A : Finset (EuclideanSpace ℝ (Fin n))) : Prop := + ∃ (center : EuclideanSpace ℝ (Fin n)) (r : ℝ), + ∀ a ∈ A, dist a center = r + +/-- +Erdős Problem 174 / Graham's Conjecture: +A finite set $A \subset \mathbb{R}^n$ is Ramsey if and only if it is spherical. + +The forward direction (Ramsey $\to$ spherical) was proved by Erdős, Graham, +Montgomery, Rothschild, Spencer, and Straus [EGMRSS73]. + +The reverse direction (spherical $\to$ Ramsey) is Graham's open conjecture. +-/ +@[category research open, AMS 5 52] +theorem erdos_174 : + ∀ n : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin n)), + IsEuclideanRamsey n A ↔ IsSpherical n A := by + sorry + +/-- +Erdős Problem 174 (forward direction): +Every Euclidean Ramsey set is spherical. This is a theorem of Erdős, Graham, +Montgomery, Rothschild, Spencer, and Straus [EGMRSS73], and is the known +direction of Graham's conjecture. +-/ +@[category research solved, AMS 5 52] +theorem erdos_174_ramsey_implies_spherical : + ∀ n : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin n)), + IsEuclideanRamsey n A → IsSpherical n A := by + sorry + +/-- A finite set in $\mathbb{R}^n$ is subtransitive if it can be isometrically embedded +into some finite set $X$ in a higher-dimensional Euclidean space on which the +isometry group acts transitively (i.e., for any two points of $X$, some isometry +of the ambient space maps $X$ to itself carrying one point to the other). -/ +def IsSubtransitive (n : ℕ) (A : Finset (EuclideanSpace ℝ (Fin n))) : Prop := + ∃ d : ℕ, ∃ X : Finset (EuclideanSpace ℝ (Fin d)), + ∃ φ : EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin d), + Isometry φ ∧ (∀ a ∈ A, φ a ∈ X) ∧ + ∀ x ∈ X, ∀ y ∈ X, + ∃ R : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d), + Isometry R ∧ R x = y ∧ ∀ z ∈ (X : Set (EuclideanSpace ℝ (Fin d))), R z ∈ X + +/-- +Leader-Russell-Walters conjecture [LRW12]: A finite set $A \subset \mathbb{R}^n$ is +Euclidean Ramsey if and only if it is subtransitive. This is a competing +characterisation to Graham's conjecture (`erdos_174`); subtransitivity is strictly +stronger than sphericality, so if this conjecture is true then Graham's conjecture +is false. +-/ +@[category research open, AMS 5 52] +theorem erdos_174_lrw_conjecture : + ∀ n : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin n)), + IsEuclideanRamsey n A ↔ IsSubtransitive n A := by + sorry + +end Erdos174 diff --git a/FormalConjectures/ErdosProblems/175.lean b/FormalConjectures/ErdosProblems/175.lean new file mode 100644 index 0000000000..56d0fd8f31 --- /dev/null +++ b/FormalConjectures/ErdosProblems/175.lean @@ -0,0 +1,56 @@ +/- +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 175 + +*Reference:* [erdosproblems.com/175](https://www.erdosproblems.com/175) + +Show that, for any $n \geq 5$, the binomial coefficient $\binom{2n}{n}$ is not squarefree. + +It is easy to see that $4 \mid \binom{2n}{n}$ except when $n = 2^k$, and hence it suffices +to prove this when $n$ is a power of $2$. + +Proved by Sárközy [Sa85] for all sufficiently large $n$, and independently by +Granville and Ramaré [GrRa96] and Velammal [Ve95] for all $n \geq 5$. + +[Sa85] Sárközy, A., *On divisors of binomial coefficients, I*. J. Number Theory **20** (1985), 70-80. + +[GrRa96] Granville, A. and Ramaré, O., *Explicit bounds on exponential sums and the scarcity of squarefree binomial coefficients*. Mathematika **43** (1996), 73-107. + +[Ve95] Velammal, G., *Is the binomial coefficient $\binom{2n}{n}$ squarefree?*. Hardy-Ramanujan J. **18** (1995), 23-45. + +[Er79] Erdős, P., *Some unconventional problems in number theory*. Acta Math. Acad. Sci. Hungar. **33** (1979), 71-80. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980). +-/ + +namespace Erdos175 + +/-- +Erdős Problem 175 [Er79, p.67] [ErGr80, p.71]: +For any $n \geq 5$, the central binomial coefficient $\binom{2n}{n}$ is not squarefree. +That is, there exists some prime $p$ such that $p^2$ divides $\binom{2n}{n}$. +-/ +@[category research solved, AMS 11] +theorem erdos_175 : + ∀ n : ℕ, 5 ≤ n → ¬Squarefree n.centralBinom := by + sorry + +end Erdos175 diff --git a/FormalConjectures/ErdosProblems/176.lean b/FormalConjectures/ErdosProblems/176.lean new file mode 100644 index 0000000000..1a8621fffa --- /dev/null +++ b/FormalConjectures/ErdosProblems/176.lean @@ -0,0 +1,107 @@ +/- +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 176 + +*Reference:* [erdosproblems.com/176](https://www.erdosproblems.com/176) + +Let $N(k, \ell)$ be the minimal $N$ such that for any $f : \{1,\ldots,N\} \to \{-1,1\}$, +there must exist a $k$-term arithmetic progression $P$ such that +$|\sum_{n \in P} f(n)| \geq \ell$. + +Is it true that for any $c > 0$ there exists some $C > 1$ such that +$N(k, ck) \leq C^k$? What about $N(k, 2) \leq C^k$ or $N(k, \sqrt{k}) \leq C^k$? + +When $\ell = k$, $N(k, k)$ is the van der Waerden number $W(k)$. + +[Er63d] Erdős, P., _On combinatorial questions connected with a theorem of Ramsey and +van der Waerden_. Mat. Lapok (1963), 29-37. + +[Er65b] Erdős, P., _Extremal problems in number theory_ (1965). + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117-138. + +[Er74b] Erdős, P., _Problems and results on combinatorial number theory_. + +[Er75b] Erdős, P., _Problems and results on combinatorial number theory III_. Number +Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976) (1975). + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory I_. Enseign. Math. (1979). + +[Er80] Erdős, P., _A survey of problems in combinatorial number theory_. Ann. Discrete +Math. (1980), 89-115. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980), p.15. + +[Sp73] Spencer, J., _Problems 185_. Bull. Canad. Math. Soc. (1973). +-/ + +open Finset BigOperators Real + +namespace Erdos176 + +/-- The arithmetic progression discrepancy number $N(k, \ell)$: the minimal $N$ such +that for every $f : \{1,\ldots,N\} \to \{-1,1\}$, there exists a $k$-term arithmetic +progression $a, a+d, \ldots, a+(k-1)d$ with $d \geq 1$ and all terms in $\{1,\ldots,N\}$ +such that $|\sum_i f(a + id)| \geq \ell$. -/ +noncomputable def discrepancyAPNumber (k : ℕ) (ℓ : ℝ) : ℕ := + sInf { N : ℕ | ∀ f : ℕ → ℤ, + (∀ n, 1 ≤ n → n ≤ N → (f n = 1 ∨ f n = -1)) → + ∃ a d : ℕ, 0 < d ∧ 1 ≤ a ∧ a + (k - 1) * d ≤ N ∧ + ℓ ≤ |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| } + +/-- +Erdős Conjecture (Problem 176) [Er65b, Er73, ErGr80]: +For any $c > 0$, there exists some $C > 1$ such that $N(k, ck) \leq C^k$. +-/ +@[category research open, AMS 5 11] +theorem erdos_176 : + answer(sorry) ↔ + ∀ c : ℝ, 0 < c → + ∃ C : ℝ, 1 < C ∧ + ∀ k : ℕ, (discrepancyAPNumber k (c * ↑k) : ℝ) ≤ C ^ k := by + sorry + +/-- +Erdős Conjecture (Problem 176, variant) [Er65b, Er73, ErGr80]: +There exists some $C > 1$ such that $N(k, 2) \leq C^k$. +-/ +@[category research open, AMS 5 11] +theorem erdos_176.variants.constant_discrepancy : + answer(sorry) ↔ + ∃ C : ℝ, 1 < C ∧ + ∀ k : ℕ, (discrepancyAPNumber k 2 : ℝ) ≤ C ^ k := by + sorry + +/-- +Erdős Conjecture (Problem 176, variant) [Er65b, Er73, ErGr80]: +There exists some $C > 1$ such that $N(k, \sqrt{k}) \leq C^k$. +-/ +@[category research open, AMS 5 11] +theorem erdos_176.variants.sqrt_discrepancy : + answer(sorry) ↔ + ∃ C : ℝ, 1 < C ∧ + ∀ k : ℕ, (discrepancyAPNumber k (Real.sqrt ↑k) : ℝ) ≤ C ^ k := by + sorry + +end Erdos176 diff --git a/FormalConjectures/ErdosProblems/177.lean b/FormalConjectures/ErdosProblems/177.lean new file mode 100644 index 0000000000..753cba68fd --- /dev/null +++ b/FormalConjectures/ErdosProblems/177.lean @@ -0,0 +1,101 @@ +/- +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 177 + +*Reference:* [erdosproblems.com/177](https://www.erdosproblems.com/177) + +Find the smallest $h(d)$ such that there exists a function $f : \mathbb{N} \to \{-1, 1\}$ +such that, for every $d \geq 1$, +$$ + \max_{P_d} \left| \sum_{n \in P_d} f(n) \right| \leq h(d), +$$ +where $P_d$ ranges over all finite arithmetic progressions with common difference $d$. + +Known bounds: +- Lower: $h(d) \gg d^{1/2}$ (Roth [Ro64]) +- Upper: $h(d) \leq d^{8+\varepsilon}$ is achievable for every $\varepsilon > 0$ (Beck [Be17]) +- Van der Waerden's theorem implies $h(d) \to \infty$. +- Cantor, Erdős, Schreiber, and Straus proved $h(d) \ll d!$. + +[Er66] Erdős, P., *Remarks on number theory. V. Extremal problems in number theory. II*. +Mat. Lapok (1966), 135–155. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117–138. + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory I*. Enseign. Math. (1979). + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ro64] Roth, K. F., *Remark concerning integer sequences*, Acta Arithmetica 9 (1964), 257–260. + +[Be17] Beck, J., *A discrepancy problem: balancing infinite dimensional vectors*. Number +theory—Diophantine problems, uniform distribution and applications (2017), 61–82. +-/ + +open Finset BigOperators Real + +namespace Erdos177 + +/-- +Erdős Problem 177: Find the smallest function $h(d)$ such that there exists +a $\pm 1$ coloring $f$ of $\mathbb{N}$ where for every $d \geq 1$, the discrepancy over +any finite arithmetic progression with common difference $d$ is at most $h(d)$. +-/ +@[category research open, AMS 5 11] +theorem erdos_177 : + ∃ f : ℕ → ℤ, (∀ n, f n = 1 ∨ f n = -1) ∧ + ∀ d : ℕ, 0 < d → ∀ a k : ℕ, 0 < k → + |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| ≤ (answer(sorry) : ℕ → ℝ) d := by sorry + +/-- +Erdős Problem 177 — Lower bound (Roth [Ro64]): +For any $\pm 1$ coloring of $\mathbb{N}$ and any $d \geq 1$, there exists a finite arithmetic +progression of common difference $d$ with discrepancy at least $c \cdot \sqrt{d}$. +That is, $h(d) \gg d^{1/2}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_177.variants.lower : + ∃ c : ℝ, 0 < c ∧ ∀ f : ℕ → ℤ, + (∀ n, f n = 1 ∨ f n = -1) → + ∀ d : ℕ, 0 < d → + ∃ a k : ℕ, 0 < k ∧ + c * Real.sqrt (↑d) ≤ |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| := by + sorry + +/-- +Erdős Problem 177 — Upper bound (Beck [Be17]): +For every $\varepsilon > 0$, there exists a $\pm 1$ coloring $f$ of $\mathbb{N}$ such that for every +$d \geq 1$ and every finite arithmetic progression of common difference $d$ with $k$ terms, +$\left| \sum f \right| \leq d^{8+\varepsilon}$. That is, $h(d) \leq d^{8+\varepsilon}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_177.variants.upper : + ∀ ε : ℝ, 0 < ε → + ∃ f : ℕ → ℤ, + (∀ n, f n = 1 ∨ f n = -1) ∧ + ∀ d : ℕ, 0 < d → ∀ a k : ℕ, 0 < k → + |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| ≤ (↑d : ℝ) ^ ((8 : ℝ) + ε) := by + sorry + +end Erdos177 diff --git a/FormalConjectures/ErdosProblems/178.lean b/FormalConjectures/ErdosProblems/178.lean new file mode 100644 index 0000000000..c327d96407 --- /dev/null +++ b/FormalConjectures/ErdosProblems/178.lean @@ -0,0 +1,87 @@ +/- +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 178 + +*Reference:* [erdosproblems.com/178](https://www.erdosproblems.com/178) + +Let $A_1, A_2, \ldots$ be an infinite collection of infinite sets of integers, +say $A_i = \{a_{i1} < a_{i2} < \cdots\}$. Does there exist some +$f : \mathbb{N} \to \{-1, 1\}$ such that +$$\max_{m,\; 1 \leq i \leq d} \left|\sum_{1 \leq j \leq m} f(a_{ij})\right| \ll_d 1$$ +for all $d \geq 1$? + +Erdős remarked "it seems certain that the answer is affirmative". This was proved by +Beck [Be81]. Beck [Be17] later proved that one can replace $\ll_d 1$ with +$\ll d^{4+\varepsilon}$ for any $\varepsilon > 0$. + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory. I*. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathématique (1980). + +[Be81] Beck, J., *Balancing families of integer sequences*. +Combinatorica (1981), 209–216. + +[Be17] Beck, J., *A discrepancy problem: balancing infinite dimensional vectors*. Number +theory—Diophantine problems, uniform distribution and applications (2017), 61–82. +-/ + +open Finset BigOperators + +namespace Erdos178 + +/-- +Erdős Problem 178 [ErGr79, ErGr80]: +Given any infinite sequence of infinite subsets of $\mathbb{N}$ (each represented by +its strictly increasing enumeration $a(i, \cdot) : \mathbb{N} \to \mathbb{N}$), there exists a +coloring $f : \mathbb{N} \to \mathbb{Z}$ with $f(n) \in \{-1, 1\}$ such that for each $d$, the partial +sums of $f$ along the first $d$ sequences are uniformly bounded by a constant +depending only on $d$. + +Proved by Beck [Be81]. +-/ +@[category research solved, AMS 5] +theorem erdos_178 : + answer(True) ↔ + ∀ a : ℕ → ℕ → ℕ, (∀ i, StrictMono (a i)) → + ∃ f : ℕ → ℤ, (∀ n, f n = 1 ∨ f n = -1) ∧ + ∀ d : ℕ, ∃ C : ℤ, 0 < C ∧ + ∀ m i, i < d → |∑ j ∈ Finset.range m, f (a i j)| ≤ C := by + sorry + +/-- +Erdős Problem 178 — Beck's refinement [Be17]: +Beck proved the stronger result that the bound constant can be taken to grow +polynomially in $d$: for every $\varepsilon > 0$, the partial sums can be bounded +by $C \cdot d^{4+\varepsilon}$ for some absolute constant $C > 0$. +-/ +@[category research solved, AMS 5] +theorem erdos_178_beck_refinement : + answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∀ a : ℕ → ℕ → ℕ, (∀ i, StrictMono (a i)) → + ∃ f : ℕ → ℤ, (∀ n, f n = 1 ∨ f n = -1) ∧ + ∃ C : ℝ, 0 < C ∧ + ∀ d m i, i < d → + (|∑ j ∈ Finset.range m, f (a i j)| : ℝ) ≤ C * (↑d) ^ ((4 : ℝ) + ε) := by + sorry + +end Erdos178 diff --git a/FormalConjectures/ErdosProblems/179.lean b/FormalConjectures/ErdosProblems/179.lean new file mode 100644 index 0000000000..5920882017 --- /dev/null +++ b/FormalConjectures/ErdosProblems/179.lean @@ -0,0 +1,115 @@ +/- +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.Combinatorics.AP.Basic + +/-! +# Erdős Problem 179 + +For integers $1 \leq k < \ell$, let $F_k(N, \ell)$ denote the minimum number of $k$-term +arithmetic progressions that an $N$-element subset of $\mathbb{N}$ must contain in order to +guarantee an $\ell$-term arithmetic progression. The problem asks whether +$F_3(N, 4) = o(N^2)$. + +*Reference:* [erdosproblems.com/179](https://www.erdosproblems.com/179) + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[Er75b] Erdős, P., _Problems and results on combinatorial number theory III_. Number +Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976) (1975). + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory I_. Enseign. Math. (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[FoPo20] Fox, J. and Pohoata, C., _Sets without k-term progressions can have many shorter +progressions_. arXiv:1908.09905 (2020). + +[LSS24] Leng, J., Sah, A. and Sawhney, M., _Improved bounds for Szemerédi's theorem_. +arXiv:2402.17995 (2024). +-/ + +open Finset + +namespace Erdos179 + +/-- +The number of $k$-term arithmetic progressions in $A$, counted as pairs $(a, d)$ +with $d \geq 1$ such that $a + i \cdot d \in A$ for all $0 \leq i < k$. +-/ +def numAP (A : Finset ℕ) (k : ℕ) : ℕ := + if h : A.Nonempty then + let M := A.max' h + ((Finset.Icc 0 M ×ˢ Finset.Icc 1 M).filter + fun p => ∀ i ∈ Finset.range k, p.1 + i * p.2 ∈ A).card + else 0 + +/-- +Let $1 \leq k < \ell$ be integers and define $F_k(N, \ell)$ to be the minimum number of +$k$-term arithmetic progressions that an $N$-element set $A \subseteq \mathbb{N}$ must contain to +guarantee an $\ell$-term arithmetic progression. Is it true that $F_3(N, 4) = o(N^2)$? + +Proved by Fox and Pohoata [FoPo20]. +-/ +@[category research solved, AMS 5] +theorem erdos_179 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, A.card = N → + (numAP A 3 : ℝ) ≥ ε * (N : ℝ) ^ 2 → + ∃ s ⊆ (↑A : Set ℕ), s.IsAPOfLength 4 := by + sorry + +/-- +For every $\ell > 3$, $\lim_{N \to \infty} \log F_3(N, \ell) / \log N = 2$. +The nontrivial direction: for every $\varepsilon > 0$, for sufficiently large $N$, +there exists an $N$-element set with at least $N^{2 - \varepsilon}$ three-term arithmetic +progressions but no $\ell$-term arithmetic progression. + +Proved by Fox and Pohoata [FoPo20]. +-/ +@[category research solved, AMS 5] +theorem erdos_179.variants.part2 : + ∀ ℓ : ℕ, ℓ > 3 → ∀ ε : ℝ, ε > 0 → ε < 2 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∃ A : Finset ℕ, A.card = N ∧ + (numAP A 3 : ℝ) ≥ (N : ℝ) ^ (2 - ε) ∧ + ¬∃ s ⊆ (↑A : Set ℕ), s.IsAPOfLength ℓ := by + sorry + +/-- +For every $\ell > 3$, $F_3(N, \ell) = o(N^2)$: for every $\varepsilon > 0$, for sufficiently +large $N$, any $N$-element set with at least $\varepsilon N^2$ three-term arithmetic progressions +must contain an $\ell$-term arithmetic progression. + +This generalizes the main theorem `erdos_179` (the $\ell = 4$ case) to all fixed $\ell > 3$, +completing the upper bound direction of question 2 from the website. + +Proved by Fox and Pohoata [FoPo20]. +-/ +@[category research solved, AMS 5] +theorem erdos_179.variants.part3 : + ∀ ℓ : ℕ, ℓ > 3 → ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, A.card = N → + (numAP A 3 : ℝ) ≥ ε * (N : ℝ) ^ 2 → + ∃ s ⊆ (↑A : Set ℕ), s.IsAPOfLength ℓ := by + sorry + +end Erdos179 diff --git a/FormalConjectures/ErdosProblems/18.lean b/FormalConjectures/ErdosProblems/18.lean new file mode 100644 index 0000000000..fe16a5348c --- /dev/null +++ b/FormalConjectures/ErdosProblems/18.lean @@ -0,0 +1,112 @@ +/- +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 18 + +*Reference:* [erdosproblems.com/18](https://www.erdosproblems.com/18) + +We call $m$ *practical* if every integer $1 \leq n < m$ is the sum of distinct divisors +of $m$. If $m$ is practical, let $h(m)$ be the least $k$ such that every $1 \leq n < m$ +is the sum of at most $k$ distinct divisors of $m$. + +Three questions: +1. Are there infinitely many practical $m$ such that $h(m) < (\log \log m)^{O(1)}$? +2. Is it true that $h(n!) < n^{o(1)}$? +3. Or perhaps even $h(n!) < (\log n)^{O(1)}$? + +Known: Erdős showed $h(n!) < n$. Vose [Vo85] proved infinitely many practical $m$ with +$h(m) \ll (\log m)^{1/2}$. Erdős offered \$250 for a proof or disproof of whether +$h(n!) < (\log n)^{O(1)}$ [Er81h, p.172]. + +Related problems: [erdosproblems.com/304](https://www.erdosproblems.com/304), +[erdosproblems.com/825](https://www.erdosproblems.com/825). + +OEIS: [A005153](https://oeis.org/A005153) — practical numbers. + +## References + +- [Er74b] Erdős, P. (1974). +- [Er79] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. **52** (1979), 67–70. +- [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). +- [Er81h] Erdős, P., _Some problems and results on additive and multiplicative number theory_. Analytic number theory (Philadelphia, Pa., 1980) (1981), 171–182. +- [Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. Combinatorics '94 (Catania), Congressus Numerantium **107** (1995). +- [Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. Analytic number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. +- [Er98] Erdős, P., _Some of my new and almost new problems and results in combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. +- [Vo85] Vose, Michael D., _Egyptian fractions_. Bull. London Math. Soc. (1985), 21–24. +-/ + +open Real Filter + +namespace Erdos18 + +/-- $m$ is practical if every integer $1 \leq n < m$ can be represented as a sum + of distinct divisors of $m$. -/ +def IsPractical (m : ℕ) : Prop := + ∀ n : ℕ, 1 ≤ n → n < m → + ∃ S : Finset ℕ, S ⊆ Nat.divisors m ∧ S.sum id = n + +/-- For a practical number $m$, $\mathrm{practicalH}(m)$ is the minimum $k$ such that every + integer $1 \leq n < m$ can be expressed as the sum of at most $k$ distinct + divisors of $m$. -/ +noncomputable def practicalH (m : ℕ) : ℕ := + sInf {k : ℕ | ∀ n : ℕ, 1 ≤ n → n < m → + ∃ S : Finset ℕ, S ⊆ Nat.divisors m ∧ S.card ≤ k ∧ S.sum id = n} + +/-- +Erdős Problem 18 [Er74b, Er79, ErGr80, Er81h (p.172), Er95, Er96b, Er98]: + +Conjecture (1): There are infinitely many practical $m$ such that +$h(m) < (\log \log m)^{O(1)}$, i.e., there exists a constant $C > 0$ such that +infinitely many practical $m$ satisfy $h(m) < (\log \log m)^C$. +-/ +@[category research open, AMS 11] +theorem erdos_18 : + ∃ C : ℝ, 0 < C ∧ + ∀ N : ℕ, ∃ m : ℕ, m ≥ N ∧ IsPractical m ∧ + (practicalH m : ℝ) < (Real.log (Real.log (m : ℝ))) ^ C := by + sorry + +/-- +Erdős Problem 18 [Er74b, Er79, ErGr80, Er81h (p.172), Er95, Er96b, Er98]: + +Conjecture (2): $h(n!) < n^{o(1)}$, i.e., for every $\varepsilon > 0$, for all +sufficiently large $n$, $h(n!) < n^\varepsilon$. +-/ +@[category research open, AMS 11] +theorem erdos_18.variants.factorial_subpolynomial : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + (practicalH n.factorial : ℝ) < (n : ℝ) ^ ε := by + sorry + +/-- +Erdős Problem 18 [Er74b, Er79, ErGr80, Er81h (p.172), Er95, Er96b, Er98]: + +Conjecture (3): $h(n!) < (\log n)^{O(1)}$, i.e., there exists a constant $C > 0$ +such that for all sufficiently large $n$, $h(n!) < (\log n)^C$. + +Erdős offered \$250 for a proof or disproof of this statement [Er81h, p.172]. +-/ +@[category research open, AMS 11] +theorem erdos_18.variants.factorial_polylog : + answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + (practicalH n.factorial : ℝ) < (Real.log (n : ℝ)) ^ C := by + sorry + +end Erdos18 diff --git a/FormalConjectures/ErdosProblems/180.lean b/FormalConjectures/ErdosProblems/180.lean new file mode 100644 index 0000000000..f86658b2c0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/180.lean @@ -0,0 +1,85 @@ +/- +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 180 + +Asks whether for every finite family of graphs, some member's Turán number is within a +constant factor of the family's Turán number. + +*Reference:* [erdosproblems.com/180](https://www.erdosproblems.com/180) + +See also Problem 575 for the bipartite refinement of this problem. + +Note: The website marks this problem as OPEN, possibly because the "real" open question is the +bipartite refinement (Problem 575). The literal statement formalized here is disproved by the +Hunter counterexample described below. + +[ErSi82] Erdős, P. and Simonovits, M., _Compactness results in extremal graph theory_, +Combinatorica **2** (1982), 275-288. +-/ + +namespace Erdos180 + +/-- An injective graph homomorphism from $H$ to $G$: $G$ contains a copy of $H$ as a +subgraph. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán number $\operatorname{ex}(n; H)$: the maximum number of edges in a simple graph +on $n$ vertices that contains no copy of $H$ as a subgraph. -/ +noncomputable def turanNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ ¬ContainsSubgraph F H ∧ F.edgeFinset.card = m} + +/-- The Turán number for a family $\operatorname{ex}(n; \mathcal{F})$: the maximum number of +edges in a simple graph on $n$ vertices that contains no copy of any member of the family +$\mathcal{F}$ as a subgraph. The family is given as a function from a finite index type +$\iota$ to finite graphs $\text{SimpleGraph}(\text{Fin}(k_i))$. -/ +noncomputable def turanNumberFamily + {ι : Type*} [Fintype ι] + {k : ι → ℕ} (H : (i : ι) → SimpleGraph (Fin (k i))) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ (∀ i : ι, ¬ContainsSubgraph F (H i)) ∧ F.edgeFinset.card = m} + +/-- +Erdős Problem 180 [ErSi82]: + +Is it true that if $\mathcal{F}$ is a finite set of finite graphs, then there exists some +$G \in \mathcal{F}$ such that +$$\operatorname{ex}(n; G) \leq C \cdot \operatorname{ex}(n; \mathcal{F})$$ +for some constant $C$ depending on $\mathcal{F}$ and all $n \geq 1$? + +This has been disproved by a folklore counterexample (Hunter): if +$\mathcal{F} = \{H_1, H_2\}$ where $H_1$ is a star and $H_2$ is a matching (both with +$\geq 2$ edges), then $\operatorname{ex}(n; \mathcal{F}) \ll 1$ but +$\operatorname{ex}(n; H_i) \asymp n$ for $1 \leq i \leq 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_180 : answer(False) ↔ + ∀ (ι : Type) [Fintype ι] [Nonempty ι] + (k : ι → ℕ) (H : (i : ι) → SimpleGraph (Fin (k i))), + ∃ i : ι, + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (turanNumber (H i) n : ℝ) ≤ C * (turanNumberFamily H n : ℝ) := by + sorry + +end Erdos180 diff --git a/FormalConjectures/ErdosProblems/181.lean b/FormalConjectures/ErdosProblems/181.lean new file mode 100644 index 0000000000..c16e814043 --- /dev/null +++ b/FormalConjectures/ErdosProblems/181.lean @@ -0,0 +1,93 @@ +/- +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 181 + +Burr and Erdős conjectured that the Ramsey number of the $n$-dimensional hypercube +graph $Q_n$ is at most linear in $2^n$, i.e., $R(Q_n) \ll 2^n$. + +*Reference:* [erdosproblems.com/181](https://www.erdosproblems.com/181) + +[BuEr75] Burr, S. A. and Erdős, P., *On the magnitude of generalized Ramsey numbers for graphs*. +Infinite and finite sets, Vol. 1 (1975), 214–240. + +[Er93] Erdős, P., *Some of my favorite solved and unsolved problems in graph theory*. +Quaestiones Mathematicae **16** (1993), 333–350. + +[Ti22] Tikhomirov, K., *A remark on the Ramsey number of the hypercube*. arXiv:2208.14568 (2022). +-/ + +open SimpleGraph Finset + +namespace Erdos181 + +/-- The $n$-dimensional hypercube graph $Q_n$: vertices are functions +$\operatorname{Fin} n \to \operatorname{Bool}$, and two vertices are adjacent iff they differ +in exactly one coordinate. -/ +def hypercubeGraph (n : ℕ) : SimpleGraph (Fin n → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm u v := by + rintro ⟨hne, hcard⟩ + refine ⟨hne.symm, ?_⟩ + have heq : (Finset.univ.filter fun i => v i ≠ u i) = + (Finset.univ.filter fun i => u i ≠ v i) := + Finset.filter_congr (fun i _ => ne_comm) + rw [heq] + exact hcard + loopless := fun v ⟨hne, _⟩ => hne rfl + +/-- An injective graph homomorphism from $H$ to $G$: $G$ contains a (not necessarily +induced) copy of $H$ as a subgraph. -/ +def ContainsCopy {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The diagonal Ramsey number $R(H)$: the minimum $N$ such that for every simple +graph $G$ on $\operatorname{Fin} N$, either $G$ or $G^c$ contains a copy of $H$. -/ +noncomputable def ramseyDiag {U : Type*} (H : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + ContainsCopy G H ∨ ContainsCopy Gᶜ H} + +/-- +Erdős Problem 181 [BuEr75]: + +Let $Q_n$ be the $n$-dimensional hypercube graph. Prove that +$$R(Q_n) \ll 2^n,$$ +i.e., there exists a constant $C > 0$ such that $R(Q_n) \leq C \cdot 2^n$ for all $n \geq 1$. +-/ +@[category research open, AMS 5] +theorem erdos_181 : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (ramseyDiag (hypercubeGraph n) : ℝ) ≤ C * (2 ^ n : ℝ) := by + sorry + +/-- +Tikhomirov (2022) [Ti22] proved that $R(Q_n) \ll 2^{(2-c)n}$ for some constant $c > 0$. +This is the best known upper bound toward Erdős Problem 181, improving over +the trivial $R(Q_n) \leq R(2^n) \leq 4^{2^n}$. +-/ +@[category research solved, AMS 5] +theorem erdos_181_tikhomirov : + ∃ c : ℝ, 0 < c ∧ + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (ramseyDiag (hypercubeGraph n) : ℝ) ≤ C * (2 : ℝ) ^ ((2 - c) * n) := by + sorry + +end Erdos181 diff --git a/FormalConjectures/ErdosProblems/182.lean b/FormalConjectures/ErdosProblems/182.lean new file mode 100644 index 0000000000..d6d8fde481 --- /dev/null +++ b/FormalConjectures/ErdosProblems/182.lean @@ -0,0 +1,148 @@ +/- +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 182 + +*Reference:* [erdosproblems.com/182](https://www.erdosproblems.com/182) + +Let $k \geq 3$. What is the maximum number of edges that a graph on $n$ vertices can +contain if it does not have a $k$-regular subgraph? Is it $\ll n^{1+o(1)}$? + +Asked by Erdős and Sauer [Er75] [Er78] [Er81]. Resolved by Janzer and Sudakov [JaSu23], who +proved that there exists some $C = C(k) > 0$ such that any graph on $n$ vertices with at +least $C \cdot n \cdot \log(\log(n))$ edges contains a $k$-regular subgraph. + +A construction due to Pyber, Rödl, and Szemerédi [PRS95] shows that this +bound is best possible up to the value of the constant $C(k)$. Chakraborti, Janzer, +Methuku, and Montgomery [CJMM24b] proved that $C(k) \ll k^2$, which is best possible +up to absolute constants. + +Erdős offered a $100 prize in [Er78] for the case $k = 3$. + +[Er75] Erdős, P., _Some recent progress on extremal problems in graph theory_, + Congressus Numerantium (1975), 3–14. + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial + number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, + Graph Theory, and Computing (1978), 29–40. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica 1 (1981), 25–42. + +[JaSu23] Janzer, O. and Sudakov, B., _Resolution of the Erdős–Sauer problem on + regular subgraphs_, Forum Math. Pi (2023), Paper No. e19, 13. + +[PRS95] Pyber, L., Rödl, V., and Szemerédi, E., _Dense graphs without 3-regular + subgraphs_, J. Combin. Theory Ser. B 63 (1995), 41–54. + +[CJMM24b] Chakraborti, D., Janzer, O., Methuku, A., and Montgomery, R., + _Regular subgraphs at every density_, arXiv:2411.11785 (2024). +-/ + +open SimpleGraph + +namespace Erdos182 + +/-- $G$ contains a $k$-regular subgraph: there exists a nonempty finite graph $H$ that +is $k$-regular (every vertex has degree exactly $k$) and admits an injective +graph homomorphism into $G$. -/ +def ContainsKRegularSubgraph {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (U : Type) (fU : Fintype U) (_ : Nonempty U) (H : SimpleGraph U) (dH : DecidableRel H.Adj), + haveI := fU; haveI := dH; + H.IsRegularOfDegree k ∧ + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- +Erdős Problem 182 (Erdős–Sauer conjecture) [Er75] [Er81]: + +For every $k \geq 3$, there exists a constant $C > 0$ such that for all sufficiently +large $n$, every simple graph on $n$ vertices with at least $C \cdot n \cdot \log(\log(n))$ +edges contains a $k$-regular subgraph. + +Proved by Janzer and Sudakov [JaSu23]. +-/ +@[category research solved, AMS 5] +theorem erdos_182 : + ∀ k : ℕ, 3 ≤ k → + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, + ∀ (n : ℕ), n₀ ≤ n → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ C * (n : ℝ) * Real.log (Real.log (n : ℝ)) → + ContainsKRegularSubgraph G k := by + sorry + +/-- +Erdős Problem 182 — quantitative bound on $C(k)$ [CJMM24b]: + +Chakraborti, Janzer, Methuku, and Montgomery proved that the constant $C(k)$ in the +Janzer–Sudakov theorem can be taken to satisfy $C(k) \ll k^2$, which is best possible +up to absolute constants. +-/ +@[category research solved, AMS 5] +theorem erdos_182_quantitative : + ∃ A : ℝ, 0 < A ∧ ∃ n₀ : ℕ, + ∀ k : ℕ, 3 ≤ k → + ∀ n : ℕ, n₀ ≤ n → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ A * (k : ℝ) ^ 2 * n * Real.log (Real.log n) → + ContainsKRegularSubgraph G k := by + sorry + +/-- +Erdős Problem 182 — lower bound (Pyber–Rödl–Szemerédi) [PRS95]: + +For every $k \geq 3$, there exist graphs on $n$ vertices with $\Omega(n \cdot \log \log n)$ +edges containing no $k$-regular subgraph. This shows the Janzer–Sudakov upper bound +is tight up to the constant. +-/ +@[category research solved, AMS 5] +theorem erdos_182_lower : + ∀ k : ℕ, 3 ≤ k → + ∃ C : ℝ, 0 < C ∧ + ∀ n₀ : ℕ, ∃ n : ℕ, n₀ ≤ n ∧ + ∃ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ C * n * Real.log (Real.log n) ∧ + ¬ContainsKRegularSubgraph G k := by + sorry + +/-- +Erdős Problem 182 — connected variant (Szemerédi) [Er75]: + +Let $F(n,k)$ be the minimum number of edges that guarantees a *connected* $k$-regular +subgraph. Erdős proved $F(n,3) \ll n^{5/3}$. This variant requires the $k$-regular +subgraph to be connected, which is a strictly stronger condition. +-/ +@[category research open, AMS 5] +theorem erdos_182_connected : + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, + ∀ n : ℕ, n₀ ≤ n → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ C * (n : ℝ) ^ ((5 : ℝ) / 3) → + ∃ (U : Type) (fU : Fintype U) (_ : Nonempty U) (H : SimpleGraph U) + (dH : DecidableRel H.Adj), + haveI := fU; haveI := dH; + H.IsRegularOfDegree 3 ∧ H.Connected ∧ + ∃ f : U → Fin n, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) := by + sorry + +end Erdos182 diff --git a/FormalConjectures/ErdosProblems/183.lean b/FormalConjectures/ErdosProblems/183.lean new file mode 100644 index 0000000000..e519e23ca1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/183.lean @@ -0,0 +1,101 @@ +/- +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 183 + +Erdős asked whether the limit of R(3;k)^{1/k} exists, where R(3;k) is the multicolor Ramsey +number for triangles — the minimum n such that every k-colouring of the edges of Kₙ contains a +monochromatic triangle. + +*Reference:* [erdosproblems.com/183](https://www.erdosproblems.com/183) + +See also Problem 483. + +OEIS: [A003323](https://oeis.org/A003323) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[ACPPRT21] Ageron, R., Casteras, P., Pellerin, T., Portella, Y., Rimmel, A., Tomasik, J., +_New lower bounds for Schur and weak Schur numbers_. arXiv:2112.03175 (2021). + +[Ex94] Exoo, G., _A lower bound for Schur numbers and multicolor Ramsey numbers_. Electronic +Journal of Combinatorics (1994). + +[FrSw00] Fredricksen, H., Sweet, M. M., _Symmetric sum-free partitions and lower bounds for +Schur numbers_. Electronic Journal of Combinatorics (2000), Research Paper 32, 9. +-/ + +open Filter + +open scoped Topology + +namespace Erdos183 + +/-- The multicolor Ramsey number $R(3;k)$: the minimum $n$ such that every +$k$-colouring of the edges of $K_n$ contains a monochromatic triangle. +A $k$-colouring is a symmetric function $c : \operatorname{Fin} n \to \operatorname{Fin} n \to \operatorname{Fin} k$, +and a monochromatic triangle is three pairwise distinct vertices +whose three edges all receive the same colour. -/ +noncomputable def multicolorRamseyTriangle (k : ℕ) : ℕ := + sInf {n : ℕ | ∀ (c : Fin n → Fin n → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a b d : Fin n), a ≠ b ∧ a ≠ d ∧ b ≠ d ∧ + c a b = c a d ∧ c a b = c b d} + +/-- +Erdős Problem 183 [Er61]: + +Let $R(3;k)$ be the minimal $n$ such that if the edges of $K_n$ are coloured with +$k$ colours then there must exist a monochromatic triangle. The limit +$$\lim_{k \to \infty} R(3;k)^{1/k}$$ +exists. + +The best upper bound is $R(3;k) \le \lceil e \cdot k! \rceil$, and the best lower bound is +$R(3;k) \ge 380^{k/5} - O(1)$ [ACPPRT21], giving $R(3;k)^{1/k} \ge 380^{1/5} \approx 3.2806$. +-/ +@[category research open, AMS 5] +theorem erdos_183 : + ∃ L : ℝ, + Tendsto (fun k : ℕ => (multicolorRamseyTriangle k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by + sorry + +/-- +Known upper bound: $R(3;k) \le \lceil e \cdot k! \rceil$, following from the recurrence +$R(3;k) \le 2 + k(R(3;k-1)-1)$. +-/ +@[category research solved, AMS 5] +theorem erdos_183_upper (k : ℕ) : + multicolorRamseyTriangle k ≤ ⌈Real.exp 1 * ↑(Nat.factorial k)⌉₊ := by + sorry + +/-- +Lower bound on the limit: if $L = \lim_{k \to \infty} R(3;k)^{1/k}$ exists, then +$L \ge 380^{1/5} \approx 3.2806$, following from the known lower bound +$R(3;k) \ge 380^{k/5} - O(1)$ [ACPPRT21]. +-/ +@[category research solved, AMS 5] +theorem erdos_183_lower_bound (L : ℝ) + (hL : Tendsto (fun k : ℕ => (multicolorRamseyTriangle k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L)) : + L ≥ (380 : ℝ) ^ ((1 : ℝ) / 5) := by + sorry + +end Erdos183 diff --git a/FormalConjectures/ErdosProblems/184.lean b/FormalConjectures/ErdosProblems/184.lean new file mode 100644 index 0000000000..0e46415490 --- /dev/null +++ b/FormalConjectures/ErdosProblems/184.lean @@ -0,0 +1,75 @@ +/- +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 184 + +*Reference:* [erdosproblems.com/184](https://www.erdosproblems.com/184) + +Any graph on $n$ vertices can be decomposed into $O(n)$ many edge-disjoint cycles +and edges. + +Conjectured by Erdős and Gallai [EGP66], who proved that $O(n \log n)$ many cycles +and edges suffice. The best bound is due to Bucić and Montgomery [BM22], who +prove that $O(n \log^* n)$ suffice. Conlon, Fox, and Sudakov [CFS14] proved that +$O_\varepsilon(n)$ cycles and edges suffice if $G$ has minimum degree at least +$\varepsilon n$. The graph $K_{3,n-3}$ shows that at least $(1+c)n$ parts are +needed for some constant $c > 0$. + +See also Problem 583 (decomposition into paths) and Problem 1017 (decomposition +into complete graphs). + +[EGP66] Erdős, P. and Gallai, T., _On the maximal number of vertices representing +the edges of a graph_, 1966. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial +analysis_. Combinatorial Mathematics and its Applications (1971), 97-109. + +[BM22] Bucić, M. and Montgomery, R., _Towards the Erdős-Gallai cycle decomposition +conjecture_. arXiv:2211.07689 (2022). + +[CFS14] Conlon, D., Fox, J., and Sudakov, B., _Cycle packing_. Random Structures +Algorithms (2014), 608-626. +-/ + +open SimpleGraph + +namespace Erdos184 + +/-- +Erdős Problem 184 (Erdős-Gallai conjecture) [EGP66, Er71, Er76, Er81, Er83b]: + +There exists a constant $C > 0$ such that for every $n$ and every simple graph $G$ on +$n$ vertices, the edge set of $G$ can be partitioned into at most $C \cdot n$ parts, where +each part is either a single edge or the edge set of a cycle in $G$. +-/ +@[category research open, AMS 5] +theorem erdos_184 : + ∃ C : ℝ, 0 < C ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + ∃ (k : ℕ) (parts : Fin k → Finset (Sym2 (Fin n))), + (k : ℝ) ≤ C * (n : ℝ) ∧ + (∀ i j : Fin k, i ≠ j → Disjoint (parts i) (parts j)) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i) ∧ + (∀ i : Fin k, + (∃ e, parts i = {e}) ∨ + (∃ (u : Fin n) (w : G.Walk u u), w.IsCycle ∧ w.edges.toFinset = parts i)) := by + sorry + +end Erdos184 diff --git a/FormalConjectures/ErdosProblems/185.lean b/FormalConjectures/ErdosProblems/185.lean new file mode 100644 index 0000000000..ffb7aadc5f --- /dev/null +++ b/FormalConjectures/ErdosProblems/185.lean @@ -0,0 +1,75 @@ +/- +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 185 + +*Reference:* [erdosproblems.com/185](https://www.erdosproblems.com/185) + +Let $f_3(n)$ be the maximal size of a subset of $\{0,1,2\}^n$ which contains no three +points on a line. Is it true that $f_3(n) = o(3^n)$? + +Originally considered by Moser. It is trivial that $f_3(n) \ge R_3(3^n)$, the maximal +size of a subset of $\{1,\ldots,3^n\}$ without a three-term arithmetic progression. +Moser showed that $f_3(n) \gg 3^n / \sqrt{n}$. The answer is yes, which is a corollary of +the density Hales-Jewett theorem, proved by Furstenberg and Katznelson [FuKa91]. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117-138. + +[FuKa91] Furstenberg, H. and Katznelson, Y., *A density version of the Hales-Jewett +theorem*. J. Anal. Math. 57 (1991), 64-119. + +OEIS: [A003142](https://oeis.org/A003142) +-/ + +namespace Erdos185 + +/-- A combinatorial line in $\{0,1,2\}^n$ consists of three points parameterized by +$j \in \{0,1,2\}$, such that there exists a nonempty set $S$ of "active" coordinates +where the $j$-th point has value $j$ at each active coordinate, and all three points +agree at non-active coordinates. -/ +def IsCombinatorialLine (n : ℕ) (p : Fin 3 → (Fin n → Fin 3)) : Prop := + ∃ (S : Finset (Fin n)), S.Nonempty ∧ + ∃ (c : Fin n → Fin 3), + ∀ (j : Fin 3) (i : Fin n), + p j i = if i ∈ S then j else c i + +/-- +Erdős Problem 185 (Density Hales-Jewett for $k=3$) [Er73]: + +For every $\varepsilon > 0$, there exists $N$ such that for all $n \ge N$, every subset +$A \subseteq \{0,1,2\}^n$ of size $|A| > \varepsilon \cdot 3^n$ contains a combinatorial +line (three points on a line). + +Equivalently, the maximum size $f_3(n)$ of a line-free subset of $\{0,1,2\}^n$ satisfies +$f_3(n) = o(3^n)$. +-/ +@[category research solved, AMS 5] +theorem erdos_185 : + answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ A : Finset (Fin n → Fin 3), + (A.card : ℝ) > ε * (3 : ℝ) ^ n → + ∃ p : Fin 3 → (Fin n → Fin 3), + IsCombinatorialLine n p ∧ ∀ j : Fin 3, p j ∈ A := by + sorry + +end Erdos185 diff --git a/FormalConjectures/ErdosProblems/186.lean b/FormalConjectures/ErdosProblems/186.lean new file mode 100644 index 0000000000..b72b35612e --- /dev/null +++ b/FormalConjectures/ErdosProblems/186.lean @@ -0,0 +1,97 @@ +/- +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 186 + +*Reference:* [erdosproblems.com/186](https://www.erdosproblems.com/186) + +Let $F(N)$ be the maximal size of $A \subseteq \{1, \ldots, N\}$ which is 'non-averaging', so that +no $n \in A$ is the arithmetic mean of at least two other distinct elements in $A$. +What is the order of growth of $F(N)$? + +Originally due to Straus. It is known that +$N^{1/4} \ll F(N) \ll N^{1/4+o(1)}$. +The lower bound is due to Bosznay [Bo89] and the upper bound to Pham and +Zakharov [PhZa24], improving an earlier bound of Conlon, Fox, and Pham [CFP23]. +The original upper bound of Erdős and Sárközy [ErSa90] was $\ll (N \log N)^{1/2}$. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. + +[Er75b] Erdős, P., *Problems and results on combinatorial number theory II*. + +[Er77c] Erdős, P., *Problems and results on combinatorial number theory III*. + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Bo89] Bosznay, Á. P., *On the lower estimation of non-averaging sets*. +Acta Mathematica Hungarica (1989), 155-157. + +[ErSa90] Erdős, P. and Sárközy, A., *On a problem of Straus*. +Disorder in Physical Systems (1990), 55-66. + +[CFP23] Conlon, D., Fox, J., and Pham, H. T., *Homogeneous structures in subset sums +and non-averaging sets*. arXiv:2311.01416 (2023). + +[PhZa24] Pham, H. T. and Zakharov, D., *Sharp bound for the Erdős-Straus non-averaging +set problem*. arXiv:2410.14624 (2024). + +[Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437. + +See also: [Erdős Problem 789](https://www.erdosproblems.com/789). +-/ + +open Filter + +namespace Erdos186 + +/-- A finite set of natural numbers $A$ is *non-averaging* if no element $a \in A$ is + the arithmetic mean of two or more distinct elements in $A \setminus \{a\}$. Equivalently, + for every $a \in A$ and every $S \subseteq A \setminus \{a\}$ with $|S| \geq 2$, + we have $|S| \cdot a \neq \sum S$. -/ +def IsNonAveraging (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A.erase a → 2 ≤ S.card → S.card * a ≠ S.sum id + +/-- $F(N)$ is the maximal cardinality of a non-averaging subset of $\{1, \ldots, N\}$. -/ +noncomputable def nonAvgMax (N : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ IsNonAveraging A ∧ A.card = k} + +/-- +Erdős Problem 186 [Er73, Er75b, Er77c, ErGr79, ErGr80]: + +The maximal size $F(N)$ of a non-averaging subset of $\{1, \ldots, N\}$ satisfies +$F(N) = N^{1/4+o(1)}$, i.e., for every $\varepsilon > 0$, +$$N^{1/4-\varepsilon} \leq F(N) \leq N^{1/4+\varepsilon}$$ +for all sufficiently large $N$. + +The lower bound $N^{1/4} \ll F(N)$ is due to Bosznay [Bo89], and the upper bound +$F(N) \ll N^{1/4+o(1)}$ is due to Pham and Zakharov [PhZa24]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_186 : + ∀ ε : ℝ, 0 < ε → + ∀ᶠ N : ℕ in atTop, + (N : ℝ) ^ ((1 : ℝ) / 4 - ε) ≤ (nonAvgMax N : ℝ) ∧ + (nonAvgMax N : ℝ) ≤ (N : ℝ) ^ ((1 : ℝ) / 4 + ε) := by + sorry + +end Erdos186 diff --git a/FormalConjectures/ErdosProblems/187.lean b/FormalConjectures/ErdosProblems/187.lean new file mode 100644 index 0000000000..3e5b1b78c1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/187.lean @@ -0,0 +1,80 @@ +/- +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 187 + +*Reference:* [erdosproblems.com/187](https://www.erdosproblems.com/187) + +Find the best function $f(d)$ such that, in any 2-colouring of the integers, +at least one colour class contains an arithmetic progression with common +difference $d$ of length $f(d)$ for infinitely many $d$. + +Originally asked by Cohen. Erdős observed that colouring according to whether +$\{\sqrt{2} \cdot n\} < 1/2$ or not implies $f(d) \ll d$ (using the fact that +$\|\sqrt{2} \cdot q\| \gg 1/q$ for all $q$, where $\|x\|$ is the distance to the +nearest integer). Beck [Be80] improved this using the probabilistic method, +constructing a colouring that shows $f(d) \le (1+o(1))\log_2 d$. Van der Waerden's +theorem implies $f(d) \to \infty$ is necessary. + +[Be80] Beck, J., *A remark concerning arithmetic progressions*. J. Combin. Theory +Ser. A (1980), 376-379. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, +Colo., 1971) (1973), 117-138. + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory: van der Waerden's theorem and related topics*. Enseign. Math. (1979). + +[ErGr80, p.17] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Real + +namespace Erdos187 + +/-- A 2-colouring $\chi : \mathbb{Z} \to \text{Bool}$ has a monochromatic arithmetic progression of +length $k$ with common difference $d$: there exist a starting point $a \in \mathbb{Z}$ and +a colour $c$ such that $\chi(a + i \cdot d) = c$ for all $0 \le i < k$. -/ +def HasMonoAP (χ : ℤ → Bool) (d : ℕ) (k : ℕ) : Prop := + ∃ a : ℤ, ∃ c : Bool, ∀ i : ℕ, i < k → χ (a + ↑i * ↑d) = c + +/-- +Erdős Problem 187 [Er73, ErGr79, ErGr80]: + +There exists an absolute constant $c > 0$ such that, for any 2-colouring +$\chi : \mathbb{Z} \to \text{Bool}$, there are infinitely many positive integers $d$ for which $\chi$ +has a monochromatic arithmetic progression with common difference $d$ and +length at least $c \cdot \log(d)$. + +The upper bound direction is known: Beck [Be80] showed there exists a +2-colouring such that the longest monochromatic AP with common difference +$d$ has length at most $(1+o(1)) \cdot \log_2(d)$. So the best $f(d)$ is $\Theta(\log d)$ +if this conjecture holds. +-/ +@[category research open, AMS 5 11] +theorem erdos_187 : + ∃ c : ℝ, 0 < c ∧ + ∀ χ : ℤ → Bool, + ∀ N : ℕ, ∃ d : ℕ, N < d ∧ + ∃ k : ℕ, c * Real.log ↑d ≤ ↑k ∧ HasMonoAP χ d k := by + sorry + +end Erdos187 diff --git a/FormalConjectures/ErdosProblems/19.lean b/FormalConjectures/ErdosProblems/19.lean new file mode 100644 index 0000000000..b3f7c75ae1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/19.lean @@ -0,0 +1,89 @@ +/- +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 19 + +*Reference:* [erdosproblems.com/19](https://www.erdosproblems.com/19) + +If $G$ is an edge-disjoint union of $n$ copies of $K_n$, then $\chi(G) = n$. + +Conjectured by Erdős, Faber, and Lovász in 1972. Proved for all sufficiently +large $n$ by Kang, Kelly, Kühn, Methuku, and Osthus; the remaining small cases +are decidable (resolved up to a finite check). + +[KKKMO21] Kang, D.Y., Kelly, T., Kühn, D., Methuku, A. and Osthus, D., +_A proof of the Erdős–Faber–Lovász conjecture_. Annals of Mathematics **198** (2023), 537–618. +-/ + +open SimpleGraph + +namespace Erdos19 + +/-- +**Erdős–Faber–Lovász Conjecture** (Erdős Problem 19): + +If $G$ is an edge-disjoint union of $n$ copies of $K_n$, then $\chi(G) = n$. + +We formalize "$G$ is an edge-disjoint union of $n$ copies of $K_n$" as: there +exist $n$ cliques (vertex sets), each of size $n$, such that +- each clique is a complete subgraph of $G$ (an $n$-clique), +- any two distinct cliques share at most one vertex (equivalently, they are + edge-disjoint, since two shared vertices would force a shared edge), and +- every edge of $G$ lies in some clique. + +Proved for all sufficiently large $n$ by [KKKMO21]. +-/ +@[category research solved, AMS 5] +theorem erdos_19 (n : ℕ) (hn : 2 ≤ n) + {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (cliques : Fin n → Finset V) + -- Each clique is a copy of $K_n$ in $G$ + (hclique : ∀ i : Fin n, G.IsNClique n (cliques i)) + -- Any two distinct cliques share at most one vertex (edge-disjointness) + (hpairwise : ∀ i j : Fin n, i ≠ j → ((cliques i) ∩ (cliques j)).card ≤ 1) + -- Every edge of $G$ lies in some clique + (hcover : ∀ u v : V, G.Adj u v → ∃ i : Fin n, u ∈ cliques i ∧ v ∈ cliques i) : + G.chromaticNumber = n := by + sorry + +/-- +**Erdős–Füredi Conjecture** (variant of Erdős Problem 19): + +If $G$ is a union of $n$ copies of $K_n$ where any two distinct copies share at most $k$ +vertices, then $\chi(G) \leq k \cdot n$. + +This generalizes the Erdős–Faber–Lovász conjecture (which is the $k = 1$ case with equality). +Proved for all sufficiently large $n$ by [KKKMO21]. +-/ +@[category research solved, AMS 5] +theorem erdos_19_erdos_furedi (n k : ℕ) (hn : 2 ≤ n) + {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (cliques : Fin n → Finset V) + -- Each clique is a copy of K_n in G + (hclique : ∀ i : Fin n, G.IsNClique n (cliques i)) + -- Any two distinct cliques share at most k vertices + (hpairwise : ∀ i j : Fin n, i ≠ j → ((cliques i) ∩ (cliques j)).card ≤ k) + -- Every edge of G lies in some clique + (hcover : ∀ u v : V, G.Adj u v → ∃ i : Fin n, u ∈ cliques i ∧ v ∈ cliques i) : + G.chromaticNumber ≤ k * n := by + sorry + +end Erdos19 diff --git a/FormalConjectures/ErdosProblems/190.lean b/FormalConjectures/ErdosProblems/190.lean new file mode 100644 index 0000000000..70a4b64f2f --- /dev/null +++ b/FormalConjectures/ErdosProblems/190.lean @@ -0,0 +1,85 @@ +/- +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 190 + +*Reference:* [erdosproblems.com/190](https://www.erdosproblems.com/190) + +Let $H(k)$ be the smallest $N$ such that in any finite colouring of $\{1,\ldots,N\}$ +(into any number of colours) there is always either a monochromatic $k$-term +arithmetic progression or a rainbow arithmetic progression (i.e. all +elements are different colours). Estimate $H(k)$. Is it true that +$H(k)^{1/k}/k \to \infty$ as $k \to \infty$? + +This type of problem belongs to 'canonical' Ramsey theory. The existence +of $H(k)$ follows from Szemerédi's theorem, and it is easy to show that +$H(k)^{1/k} \to \infty$. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory: van der Waerden's theorem and related topics_. Enseign. Math. (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique (1980). +-/ + +open Filter Real + +namespace Erdos190 + +/-- A colouring $\chi : \mathbb{N} \to \mathbb{N}$ has a monochromatic $k$-term arithmetic +progression within $\{1,\ldots,N\}$: there exist $a \geq 1$ and $d \geq 1$ such that +$a, a+d, \ldots, a+(k-1) \cdot d$ are all in $\{1,\ldots,N\}$ and all share the same colour. -/ +def HasMonoAP (χ : ℕ → ℕ) (N k : ℕ) : Prop := + ∃ a d : ℕ, 0 < d ∧ 1 ≤ a ∧ a + (k - 1) * d ≤ N ∧ + ∀ i : ℕ, i < k → χ (a + i * d) = χ a + +/-- A colouring $\chi : \mathbb{N} \to \mathbb{N}$ has a rainbow $3$-term arithmetic +progression within $\{1,\ldots,N\}$: there exist $a \geq 1$ and $d \geq 1$ such that +$a, a+d, a+2d$ are all in $\{1,\ldots,N\}$ and their colours are pairwise distinct. -/ +def HasRainbowAP (χ : ℕ → ℕ) (N : ℕ) : Prop := + ∃ a d : ℕ, 0 < d ∧ 1 ≤ a ∧ a + 2 * d ≤ N ∧ + χ a ≠ χ (a + d) ∧ χ a ≠ χ (a + 2 * d) ∧ χ (a + d) ≠ χ (a + 2 * d) + +/-- $H(k)$ is the smallest $N$ such that any colouring of $\{1,\ldots,N\}$ contains +either a monochromatic $k$-term AP or a rainbow $3$-term AP. -/ +noncomputable def H (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ χ : ℕ → ℕ, HasMonoAP χ N k ∨ HasRainbowAP χ N} + +/-- +Erdős Problem 190 [ErGr79, ErGr80]: + +Is it true that $H(k)^{1/k}/k \to \infty$ as $k \to \infty$, where $H(k)$ is the smallest $N$ +such that any finite colouring of $\{1,\ldots,N\}$ always contains either a monochromatic +$k$-term arithmetic progression or a rainbow arithmetic progression? +-/ +@[category research open, AMS 5] +theorem erdos_190 : answer(sorry) ↔ + Tendsto (fun k : ℕ => (H k : ℝ) ^ ((1 : ℝ) / (k : ℝ)) / (k : ℝ)) atTop atTop := by + sorry + +/-- +Known weaker result: $H(k)^{1/k} \to \infty$ as $k \to \infty$ (without the additional +division by $k$). This is described as "easy to show" on the website. +-/ +@[category research solved, AMS 5] +theorem erdos_190_weaker : + Tendsto (fun k : ℕ => (H k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) atTop atTop := by + sorry + +end Erdos190 diff --git a/FormalConjectures/ErdosProblems/191.lean b/FormalConjectures/ErdosProblems/191.lean new file mode 100644 index 0000000000..3b309180fa --- /dev/null +++ b/FormalConjectures/ErdosProblems/191.lean @@ -0,0 +1,69 @@ +/- +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 191 + +*Reference:* [erdosproblems.com/191](https://www.erdosproblems.com/191) + +A 2-colouring of pairs is modeled as a `SimpleGraph` on $\mathbb{N}$ (edges = colour 1, +non-edges = colour 2). A monochromatic set is a clique in either $G$ or its +complement $G^c$. + +The answer is yes, proved by Rödl [Ro03]. Conlon, Fox, and Sudakov [CFS13] +proved the optimal quantitative bound: in any 2-colouring one can find such $X$ +with $\sum 1/\log x \geq c \cdot \log \log \log n$. + +[ErGr79] Erdős, P. and Graham, R., 1979. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in +combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er81] Erdős, P., 1981. + +[Er82e] Erdős, P., 1982. + +[Ro03] Rödl, V., _On homogeneous sets of positive integers_. +J. Combin. Theory Ser. A (2003), 229-240. + +[CFS13] Conlon, D., Fox, J., and Sudakov, B., _Two extensions of Ramsey's theorem_. +Duke Math. J. (2013), 2903-2927. +-/ + +open SimpleGraph Real BigOperators + +namespace Erdos191 + +/-- +Erdős Problem 191 [ErGr79, ErGr80, Er81, Er82e]: +For any $C > 0$, if $n$ is sufficiently large (depending on $C$), then in any +2-colouring of the pairs from $\{2, \ldots, n\}$, there exists a monochromatic +set $X \subseteq \{2, \ldots, n\}$ with $\sum_{x \in X} 1 / \log x \geq C$. +-/ +@[category research solved, AMS 5] +theorem erdos_191 : + answer(True) ↔ + ∀ C : ℝ, C > 0 → + ∃ N : ℕ, ∀ n ≥ N, + ∀ G : SimpleGraph ℕ, + ∃ X : Finset ℕ, X ⊆ Finset.Icc 2 n ∧ + (G.IsClique (X : Set ℕ) ∨ Gᶜ.IsClique (X : Set ℕ)) ∧ + C ≤ ∑ x ∈ X, (1 : ℝ) / Real.log (x : ℝ) := by + sorry + +end Erdos191 diff --git a/FormalConjectures/ErdosProblems/192.lean b/FormalConjectures/ErdosProblems/192.lean new file mode 100644 index 0000000000..4c2da90cf1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/192.lean @@ -0,0 +1,84 @@ +/- +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 192 + +*Reference:* [erdosproblems.com/192](https://www.erdosproblems.com/192) + +Let $A = \{a_1, a_2, \ldots\} \subset \mathbb{R}^d$ be an infinite sequence such that +$a_{i+1} - a_i$ is a positive unit vector (i.e. of the form $(0,\ldots,1,\ldots,0)$). For which +$d$ must $A$ contain a three-term arithmetic progression? + +This is equivalent to the following question about abelian squares: for which $d$ does every +infinite word over a $d$-letter alphabet contain an abelian square (a pair of consecutive blocks +that are permutations of each other)? + +The answer is: true for $d \le 3$, false for $d \ge 4$. + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ke92] Keränen, V., *Abelian squares are avoidable on 4 letters*. Automata, languages and +programming (Vienna, 1992), Lecture Notes in Comput. Sci. 623, Springer (1992), 41–52. + +[FiPu23] Fici, G. and Puzynina, S., *Abelian combinatorics on words: a survey*. Comput. Sci. +Rev. (2023), Paper No. 100532. +-/ + +namespace Erdos192 + +/-- An infinite word $w : \mathbb{N} \to \alpha$ contains an abelian square if there exist +a starting position $i$ and a block length $n \ge 1$ such that the multiset +of characters in positions $i, \ldots, i+n-1$ equals the multiset of characters +in positions $i+n, \ldots, i+2n-1$. -/ +def HasAbelianSquare {α : Type*} (w : ℕ → α) : Prop := + ∃ i n : ℕ, 0 < n ∧ + (Finset.range n).val.map (fun j => w (i + j)) = + (Finset.range n).val.map (fun j => w (i + n + j)) + +/-- +Erdős Problem 192, Part 1 [ErGr80]: +Every infinite word over a 3-letter alphabet contains an abelian square. +Equivalently, any infinite sequence in $\mathbb{R}^3$ with unit-vector steps must +contain a three-term arithmetic progression. + +In fact, any finite word of length $\ge 7$ over $\{0,1,2\}$ contains an abelian square. +-/ +@[category research solved, AMS 5] +theorem erdos_192 : + ∀ w : ℕ → Fin 3, HasAbelianSquare w := by + sorry + +/-- +Erdős Problem 192, Part 2 [ErGr80]: +There exists an infinite word over a 4-letter alphabet with no abelian square. +Equivalently, there exists an infinite sequence in $\mathbb{R}^4$ with unit-vector steps +that contains no three-term arithmetic progression. + +Proved by Keränen [Ke92]. +-/ +@[category research solved, AMS 5] +theorem erdos_192.variants.four_letters : + ∃ w : ℕ → Fin 4, ¬HasAbelianSquare w := by + sorry + +end Erdos192 diff --git a/FormalConjectures/ErdosProblems/193.lean b/FormalConjectures/ErdosProblems/193.lean new file mode 100644 index 0000000000..9e7dbf6e09 --- /dev/null +++ b/FormalConjectures/ErdosProblems/193.lean @@ -0,0 +1,84 @@ +/- +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 193 + +*Reference:* [erdosproblems.com/193](https://www.erdosproblems.com/193) + +Let $S \subseteq \mathbb{Z}^3$ be a finite set and let $A = \{a_1, a_2, \ldots\} \subset \mathbb{Z}^3$ +be an infinite $S$-walk, so that $a_{i+1} - a_i \in S$ for all $i$. Must $A$ contain three +collinear points? + +Originally conjectured by Gerver and Ramsey [GeRa79], who showed that the answer is yes for +$\mathbb{Z}^2$, and for $\mathbb{Z}^3$ that the largest number of collinear points can be bounded. + +See also OEIS sequence A231255. + +[GeRa79] Gerver, J. and Ramsey, L. T., _On certain sequences of lattice points_. +Pacific J. Math. (1979), 357-363. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory: some problems on additive number theory_. (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +namespace Erdos193 + +/-- Three points in $\mathbb{Z}^3$ are collinear if the difference vectors from the first +to the other two are linearly dependent over $\mathbb{Z}$ (equivalently, over $\mathbb{Q}$). -/ +def Collinear3 (p q r : Fin 3 → ℤ) : Prop := + ∃ a b : ℤ, (a ≠ 0 ∨ b ≠ 0) ∧ ∀ k : Fin 3, a * (q k - p k) = b * (r k - p k) + +/-- +Erdős Problem 193 [ErGr80]: +Let $S \subseteq \mathbb{Z}^3$ be a finite set and let $a : \mathbb{N} \to \mathbb{Z}^3$ be an +injective $S$-walk (i.e. $a(i+1) - a(i) \in S$ for all $i$, visiting infinitely many distinct +points). Then the range of $a$ must contain three collinear points. +-/ +@[category research open, AMS 5] +theorem erdos_193 : answer(sorry) ↔ + ∀ (S : Finset (Fin 3 → ℤ)) (a : ℕ → (Fin 3 → ℤ)), + Function.Injective a → + (∀ i, a (i + 1) - a i ∈ S) → + ∃ i j k : ℕ, i < j ∧ j < k ∧ Collinear3 (a i) (a j) (a k) := by + sorry + +/-- Three points in $\mathbb{Z}^2$ are collinear if the difference vectors from the first +to the other two are linearly dependent over $\mathbb{Z}$ (equivalently, over $\mathbb{Q}$). -/ +def Collinear3_2D (p q r : Fin 2 → ℤ) : Prop := + ∃ a b : ℤ, (a ≠ 0 ∨ b ≠ 0) ∧ ∀ k : Fin 2, a * (q k - p k) = b * (r k - p k) + +/-- +Erdős Problem 193, $\mathbb{Z}^2$ case [GeRa79]: +For any finite step set $S \subseteq \mathbb{Z}^2$ and any injective $S$-walk +$a : \mathbb{N} \to \mathbb{Z}^2$, the range of $a$ must contain three collinear points. +This was proved by Gerver and Ramsey, who also conjectured the analogous result for +$\mathbb{Z}^3$ (the main open problem `erdos_193`). +-/ +@[category research solved, AMS 5] +theorem erdos_193_Z2 : + ∀ (S : Finset (Fin 2 → ℤ)) (a : ℕ → (Fin 2 → ℤ)), + Function.Injective a → + (∀ i, a (i + 1) - a i ∈ S) → + ∃ i j k : ℕ, i < j ∧ j < k ∧ Collinear3_2D (a i) (a j) (a k) := by + sorry + +end Erdos193 diff --git a/FormalConjectures/ErdosProblems/199.lean b/FormalConjectures/ErdosProblems/199.lean new file mode 100644 index 0000000000..8b24ff6b30 --- /dev/null +++ b/FormalConjectures/ErdosProblems/199.lean @@ -0,0 +1,67 @@ +/- +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 199 + +*Reference:* [erdosproblems.com/199](https://www.erdosproblems.com/199) + +If $A \subset \mathbb{R}$ does not contain a 3-term arithmetic progression then must +$\mathbb{R} \setminus A$ contain an infinite arithmetic progression? + +The answer is no, as shown by Baumgartner [Ba75] (whose construction uses +the axiom of choice to provide a basis for $\mathbb{R}$ over $\mathbb{Q}$). + +[Er75b] Erdős, P., _Problems and results on combinatorial number theory II_. + +[ErGr79] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory: some problems on additive number theory_ (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Ba75] Baumgartner, J.E., _Partitioning vector spaces_. J. Combinatorial Theory Ser. A (1975), +231-233. +-/ + +namespace Erdos199 + +/-- A set $A \subseteq \mathbb{R}$ contains a 3-term arithmetic progression if there exist +$a, d \in \mathbb{R}$ with $d \neq 0$ such that $a, a + d, a + 2d \in A$. -/ +def HasThreeTermAP (A : Set ℝ) : Prop := + ∃ a d : ℝ, d ≠ 0 ∧ a ∈ A ∧ (a + d) ∈ A ∧ (a + 2 * d) ∈ A + +/-- A set $S \subseteq \mathbb{R}$ contains an infinite arithmetic progression if there exist +$a, d \in \mathbb{R}$ with $d \neq 0$ such that $a + n \cdot d \in S$ for all $n : \mathbb{N}$. -/ +def HasInfiniteAP (S : Set ℝ) : Prop := + ∃ a d : ℝ, d ≠ 0 ∧ ∀ n : ℕ, (a + ↑n * d) ∈ S + +/-- +Erdős Problem 199 [Er75b, ErGr79, ErGr80] (DISPROVED): + +If $A \subset \mathbb{R}$ does not contain a 3-term arithmetic progression, must +$\mathbb{R} \setminus A$ contain an infinite arithmetic progression? + +Baumgartner [Ba75] showed the answer is no, using the axiom of choice +to construct a counterexample via a Hamel basis for $\mathbb{R}$ over $\mathbb{Q}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_199 : answer(False) ↔ ∀ A : Set ℝ, ¬HasThreeTermAP A → HasInfiniteAP Aᶜ := by + sorry + +end Erdos199 diff --git a/FormalConjectures/ErdosProblems/2.lean b/FormalConjectures/ErdosProblems/2.lean new file mode 100644 index 0000000000..0c32d7bbe0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/2.lean @@ -0,0 +1,84 @@ +/- +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 2 + +*Reference:* [erdosproblems.com/2](https://www.erdosproblems.com/2) + +Erdős asked whether the smallest modulus of a covering system can be arbitrarily large. +Hough [Ho15] showed the answer is no; the best bounds are due to Balister, Bollobás, +Morris, Sahasrabudhe, and Tiba [BBMST22]. + +Related OEIS sequence: [A160559](https://oeis.org/A160559). + +[Ho15] Hough, R. D., _Solution of the minimum modulus problem for covering systems_. +Ann. of Math. (2) **181** (2015), no. 1, 361–382. + +[FFKPY07] Filaseta, M., Ford, K., Konyagin, S., Pomerance, C., and Yu, G., _Sieving by +large integers and covering systems of congruences_. J. Amer. Math. Soc. **20** (2007), +no. 2, 495–517. + +[BBMST22] Balister, P., Bollobás, B., Morris, R., Sahasrabudhe, J., and Tiba, M., +_On the Erdős covering problem: the density of the uncovered set_. Inventiones +mathematicae (2022), 377–414. + +[Ow14] Owens, T., _A covering system with minimum modulus 42_. Thesis, Brigham Young +University (2014). +-/ + +namespace Erdos2 + +/-- +Erdős asked whether the smallest modulus of a covering system can be arbitrarily +large (he expected the answer to be yes). Hough [Ho15], building on work of +Filaseta, Ford, Konyagin, Pomerance, and Yu [FFKPY07], showed the answer is **no**: +every covering system has smallest modulus at most $10^{16}$. Balister, Bollobás, +Morris, Sahasrabudhe, and Tiba [BBMST22] gave a simpler proof and improved the +bound to $616000$. The best known lower bound is $42$, due to Owens [Ow14]. + +Formally: there exists an absolute constant $B$ such that every covering system +of $\mathbb{Z}$ contains a congruence whose modulus is at most $B$. +-/ +@[category research solved, AMS 11] +theorem erdos_2 : + ∃ B : ℕ, ∀ c : CoveringSystem ℤ, + ∃ i, ∃ m : ℕ, c.moduli i = Ideal.span {(m : ℤ)} ∧ m ≤ B := by + sorry + +/-- +Balister, Bollobás, Morris, Sahasrabudhe, and Tiba [BBMST22] proved that every covering +system has a modulus at most $616000$. This is the best known explicit upper bound. +-/ +@[category research solved, AMS 11] +theorem erdos_2_upper : + ∀ c : CoveringSystem ℤ, + ∃ i, ∃ m : ℕ, c.moduli i = Ideal.span {(m : ℤ)} ∧ m ≤ 616000 := by + sorry + +/-- +Owens [Ow14] constructed a covering system whose minimum modulus is $42$. This is the +best known lower bound for the minimum modulus of a covering system. +-/ +@[category research solved, AMS 11] +theorem erdos_2_lower : + ∃ c : CoveringSystem ℤ, + ∀ i, ∃ m : ℕ, c.moduli i = Ideal.span {(m : ℤ)} ∧ 42 ≤ m := by + sorry + +end Erdos2 diff --git a/FormalConjectures/ErdosProblems/201.lean b/FormalConjectures/ErdosProblems/201.lean new file mode 100644 index 0000000000..6a4acbec53 --- /dev/null +++ b/FormalConjectures/ErdosProblems/201.lean @@ -0,0 +1,74 @@ +/- +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 201 + +*Reference:* [erdosproblems.com/201](https://www.erdosproblems.com/201) + +Let $G_k(N)$ be such that any set of $N$ integers contains a subset of +size at least $G_k(N)$ which does not contain a $k$-term arithmetic +progression. Let $R_k(N)$ be the size of the largest subset of +$\{1,\ldots,N\}$ without a $k$-term arithmetic progression. + +It is trivial that $G_k(N) \leq R_k(N)$. Komlós, Sulyok, and Szemerédi +[KSS75] showed that $R_k(N) \ll_k G_k(N)$. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117-138. + +[Er75b] Erdős, P., *Problems and results on combinatorial number theory III*. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1975). + +[ErGr79] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory I*. Enseign. Math. (1979). + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ri69] Riddell, J., *On sets of numbers containing no l terms in arithmetic progression*. +Nieuw Arch. Wisk. (3) **17** (1969), 204-209. + +[KSS75] Komlós, J., Sulyok, M. and Szemerédi, E., *Linear problems in combinatorial number +theory*. Acta Math. Acad. Sci. Hungar. **26** (1975), 113-121. +-/ + +open Classical + +namespace Erdos201 + +/-- +Erdős Problem #201 [Er73, Er75b, ErGr79, ErGr80]: + +Is it true that $\lim_{N \to \infty} R_3(N) / G_3(N) = 1$? + +Since $G_k(N) \leq R_k(N)$ always holds, the conjecture is equivalent to: +for every $\varepsilon > 0$, for all sufficiently large $N$, every set of $N$ integers +contains a $3$-AP-free subset of size at least $(1 - \varepsilon) \cdot R_3(N)$. +-/ +@[category research open, AMS 5] +theorem erdos_201 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ S : Finset ℤ, S.card = N → + ∃ T ⊆ S, (↑T : Set ℤ).IsAPOfLengthFree 3 ∧ + (1 - ε) * ((Finset.Icc (1 : ℤ) (N : ℤ)).maxAPFreeCard 3 : ℝ) ≤ (T.card : ℝ) := by + sorry + +end Erdos201 diff --git a/FormalConjectures/ErdosProblems/202.lean b/FormalConjectures/ErdosProblems/202.lean new file mode 100644 index 0000000000..e0f3b5b4f5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/202.lean @@ -0,0 +1,95 @@ +/- +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 202 + +*Reference:* [erdosproblems.com/202](https://www.erdosproblems.com/202) + +Let $n_1 < \cdots < n_r \leq N$ with associated $a_i \pmod{n_i}$ such that the congruence +classes are disjoint (every integer is $\equiv a_i \pmod{n_i}$ for at most one $i$). +How large can $r$ be in terms of $N$? + +Let $f(N)$ denote the maximum such $r$. Erdős and Stein conjectured $f(N) = o(N)$, +proved by Erdős and Szemerédi [ErSz68], who showed +$N / \exp((\log N)^{1/2+\varepsilon}) \ll f(N) < N / (\log N)^c$. + +Croot [Cr03b] improved this to $N / L(N)^{\sqrt{2}+o(1)} < f(N) < N / L(N)^{1/6-o(1)}$, +and Chen [Ch05] further tightened the bounds. + +The best known bounds, due to de la Bretèche, Ford, and Vandehey [BFV13], are: +$$N / L(N)^{1+o(1)} < f(N) < N / L(N)^{\sqrt{3}/2+o(1)}$$ +where $L(N) = \exp(\sqrt{\log N \cdot \log \log N})$. + +They conjecture the lower bound is the truth, i.e., $f(N) = N / L(N)^{1+o(1)}$. + +OEIS: [A389975](https://oeis.org/A389975) + +[ErSz68] Erdős, P. and Szemerédi, E., _On a problem of P. Erdős and S. Stein_. +Acta Arithmetica **14** (1968), 85–90. + +[Cr03b] Croot III, E. S., _On non-intersecting arithmetic progressions_. +Acta Arithmetica **110** (2003), 233–238. + +[Ch05] Chen, Y.-G., _On disjoint arithmetic progressions_. +Acta Arithmetica **118** (2005), 143–148. + +[BFV13] de la Bretèche, R., Ford, K., and Vandehey, J., +_On non-intersecting arithmetic progressions_. Acta Arithmetica **157** (2013), 381–392. + +[Er61, Er65, Er65b, Er73, Er77c, ErGr80, Va99] — see +[erdosproblems.com/202](https://www.erdosproblems.com/202) for full references. +-/ + +open Filter + +namespace Erdos202 + +/-- A system of congruence classes with distinct positive moduli at most $N$ is +*pairwise disjoint* if no integer belongs to more than one class. +Each element $(n, a)$ represents the congruence class +$\{x \in \mathbb{Z} : x \equiv a \pmod{n}\}$. -/ +def IsPairwiseDisjointSystem (S : Finset (ℕ × ℤ)) (N : ℕ) : Prop := + (∀ p ∈ S, 1 ≤ p.1 ∧ p.1 ≤ N) ∧ + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → p.1 ≠ q.1) ∧ + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → + ∀ x : ℤ, ¬(x ≡ p.2 [ZMOD p.1] ∧ x ≡ q.2 [ZMOD q.1])) + +/-- +Erdős Problem 202 (de la Bretèche–Ford–Vandehey conjecture) — OPEN. +[Er61, Er65, Er65b, Er73, Er77c, ErGr80, Va99]: + +The maximum number $f(N)$ of pairwise disjoint congruence classes with distinct +moduli at most $N$ satisfies $f(N) \leq N / L(N)^{1-\varepsilon}$ for every +$\varepsilon > 0$ and all sufficiently large $N$, where +$L(N) = \exp(\sqrt{\log N \cdot \log \log N})$. + +Combined with the proved lower bound $f(N) \geq N / L(N)^{1+\varepsilon}$ [BFV13], this +gives the conjectured asymptotics $f(N) = N / L(N)^{1+o(1)}$. +-/ +@[category research open, AMS 11] +theorem erdos_202 : + let L := fun N : ℝ => Real.exp (Real.sqrt (Real.log N * Real.log (Real.log N))) + ∀ ε : ℝ, ε > 0 → + ∀ᶠ N : ℕ in atTop, + ∀ S : Finset (ℕ × ℤ), + IsPairwiseDisjointSystem S N → + (S.card : ℝ) ≤ (N : ℝ) / L (N : ℝ) ^ (1 - ε) := by + sorry + +end Erdos202 diff --git a/FormalConjectures/ErdosProblems/205.lean b/FormalConjectures/ErdosProblems/205.lean new file mode 100644 index 0000000000..2c72bfcd8b --- /dev/null +++ b/FormalConjectures/ErdosProblems/205.lean @@ -0,0 +1,84 @@ +/- +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 205 + +*Reference:* [erdosproblems.com/205](https://www.erdosproblems.com/205) + +Erdős and Graham asked whether all sufficiently large $n$ can be written as $n = 2^k + m$ for some +$k \geq 0$, where $m$ has fewer than $\log(\log(m))$ prime factors counted with multiplicity. This +was disproved. + +See also Problem 851 for the related question using distinct prime factors. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ro34] Romanoff, N. P., _Über einige Sätze der additiven Zahlentheorie_. +Math. Ann. (1934), 668-678. +-/ + +open Real +open scoped ArithmeticFunction.Omega + +namespace Erdos205 + +/-- +Erdős Problem 205 (Disproved) [ErGr80, p.28]: + +Erdős and Graham asked whether all sufficiently large $n$ can be written as +$2^k + m$ for some $k \geq 0$, where $\Omega(m) < \log(\log(m))$. Here $\Omega(m)$ is the number +of prime divisors of $m$ counted with multiplicity. + +The answer is no (`answer(False)`): there are infinitely many counterexamples. +-/ +@[category research solved, AMS 11] +theorem erdos_205 : answer(False) ↔ + (∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ k : ℕ, 2 ^ k ≤ n ∧ + (Ω (n - 2 ^ k) : ℝ) < + Real.log (Real.log ((n - 2 ^ k : ℕ) : ℝ))) := by + sorry + +/-- +Variant of Erdős Problem 205: whether the weaker bound $\Omega(m) < \varepsilon \log(\log(m))$ +for some $\varepsilon > 0$ suffices for all sufficiently large $n = 2^k + m$. +-/ +@[category research open, AMS 11] +theorem erdos_205_epsilon_variant : answer(sorry) ↔ + (∃ ε : ℝ, 0 < ε ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ k : ℕ, 2 ^ k ≤ n ∧ + (Ω (n - 2 ^ k) : ℝ) < + ε * Real.log (Real.log ((n - 2 ^ k : ℕ) : ℝ))) := by + sorry + +/-- +Variant of Erdős Problem 205: whether there exist arbitrarily large *odd* integers $n$ such that +for all $k$ with $2^k \leq n$, $\Omega(n - 2^k) \geq \log(\log(n - 2^k))$. Known counterexamples +to the original conjecture are divisible by large powers of 2. +-/ +@[category research open, AMS 11] +theorem erdos_205_odd_variant : answer(sorry) ↔ + (∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ Odd n ∧ + ∀ k : ℕ, 2 ^ k ≤ n → + Real.log (Real.log ((n - 2 ^ k : ℕ) : ℝ)) ≤ + (Ω (n - 2 ^ k) : ℝ)) := by + sorry + +end Erdos205 diff --git a/FormalConjectures/ErdosProblems/206.lean b/FormalConjectures/ErdosProblems/206.lean new file mode 100644 index 0000000000..682b769c12 --- /dev/null +++ b/FormalConjectures/ErdosProblems/206.lean @@ -0,0 +1,112 @@ +/- +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 206 + +*Reference:* [erdosproblems.com/206](https://www.erdosproblems.com/206) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Ko24b] Kovač, V., _On eventually greedy best underapproximations by Egyptian fractions_ (2024). +-/ + +open scoped BigOperators + +open MeasureTheory + +namespace Erdos206 + +/-- +The sum of unit fractions with denominators from a finset of naturals: +$\sum_{m \in S} 1/m$. +-/ +noncomputable def unitFracSum (S : Finset ℕ) : ℝ := + ∑ m ∈ S, (1 : ℝ) / (m : ℝ) + +/-- +$R_n(x)$: the maximal sum of $n$ distinct unit fractions (with positive integer +denominators) that is strictly less than $x$. +-/ +noncomputable def bestUnderapprox (n : ℕ) (x : ℝ) : ℝ := + sSup {s : ℝ | ∃ S : Finset ℕ, S.card = n ∧ (∀ m ∈ S, 0 < m) ∧ + s = unitFracSum S ∧ s < x} + +/-- +A real number $x > 0$ is "eventually greedy" if there exists $N_0$ such that for +all $n \geq N_0$, every set $S$ of $n$ distinct positive integers achieving $R_n(x)$ can +be extended to achieve $R_{n+1}(x)$ by adding the smallest eligible new +denominator. +-/ +def IsEventuallyGreedy (x : ℝ) : Prop := + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∀ S : Finset ℕ, + S.card = n → + (∀ m ∈ S, 0 < m) → + unitFracSum S < x → + unitFracSum S = bestUnderapprox n x → + ∃ k : ℕ, 0 < k ∧ k ∉ S ∧ + unitFracSum S + (1 : ℝ) / (k : ℝ) < x ∧ + unitFracSum S + (1 : ℝ) / (k : ℝ) = bestUnderapprox (n + 1) x ∧ + (∀ j : ℕ, 0 < j → j ∉ S → + unitFracSum S + (1 : ℝ) / (j : ℝ) < x → k ≤ j) + +/-- +Erdős Problem 206 (Disproved by Kovač [Ko24b]): + +Let $x > 0$ be a real number. For any $n \geq 1$ let $R_n(x)$ be the maximal sum of $n$ +distinct unit fractions which is $< x$. Erdős and Graham asked whether, for +almost all $x$, the best underapproximations are eventually constructed in a +greedy fashion: $R_{n+1}(x) = R_n(x) + 1/m$ where $m$ is the smallest new +denominator keeping the sum below $x$. + +Kovač proved this is false — the set of $x \in (0,\infty)$ for which the best +underapproximations are eventually greedy has Lebesgue measure zero. + +We formalize Kovač's result (the negation of the original conjecture). +-/ +@[category research solved, AMS 11 28] +theorem erdos_206 : + volume {x : ℝ | 0 < x ∧ IsEventuallyGreedy x} = 0 := by + sorry + +/-- +Erdős Problem 206 — Variant (Curtiss [Cu22]): + +The greedy property holds for $x = 1$: the best underapproximations of $1$ by sums of +distinct unit fractions are eventually constructed greedily. +-/ +@[category research solved, AMS 11 28] +theorem erdos_206_unit : IsEventuallyGreedy 1 := by + sorry + +/-- +Erdős Problem 206 — Open Variant: + +It remains open whether the greedy property holds for every rational $x > 0$. +Kovač's measure-zero result [Ko24b] does not resolve this, as the set of rationals +has measure zero. Positive results are known for $x = 1$ (Curtiss), $x = 1/m$ +(Erdős [Er50b]), and $x = a/b$ when $a \mid (b+1)$ (Nathanson [Na23]). +-/ +@[category research open, AMS 11 28] +theorem erdos_206_rational : + ∀ q : ℚ, 0 < q → IsEventuallyGreedy (q : ℝ) := by + sorry + +end Erdos206 diff --git a/FormalConjectures/ErdosProblems/207.lean b/FormalConjectures/ErdosProblems/207.lean new file mode 100644 index 0000000000..7a7d8c8a0f --- /dev/null +++ b/FormalConjectures/ErdosProblems/207.lean @@ -0,0 +1,75 @@ +/- +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 207 + +*Reference:* [erdosproblems.com/207](https://www.erdosproblems.com/207) + +For any $g \geq 2$, if $n$ is sufficiently large and $n \equiv 1, 3 \pmod{6}$, then there +exists a Steiner triple system on $n$ vertices with girth greater than $g$ — that is, +a $3$-uniform hypergraph where every pair of vertices is in exactly one edge, and +any $j$ edges (for $2 \leq j \leq g$) span at least $j + 3$ vertices. + +The congruence condition $n \equiv 1, 3 \pmod{6}$ is the necessary and sufficient +divisibility condition for a Steiner triple system on $n$ points to exist. + +[Er76] Erdős, P., _Problems and results in graph theory and combinatorics_ (1976). + +[KSSS22b] Kwan, M., Sah, A., Sawhney, M., and Simkin, M., _High-girth Steiner +triple systems_ (2022). +-/ + +namespace Erdos207 + +/-- A set of hyperedges forms a Steiner triple system: each edge has exactly $3$ + vertices, and every pair of distinct vertices appears in exactly one edge. -/ +def IsSteinerTripleSystem {n : ℕ} (edges : Finset (Finset (Fin n))) : Prop := + (∀ e ∈ edges, e.card = 3) ∧ + (∀ u v : Fin n, u ≠ v → ∃! e, e ∈ edges ∧ u ∈ e ∧ v ∈ e) + +/-- A hypergraph has girth greater than `g` if any `j` edges (for `2 ≤ j ≤ g`) + span at least `j + 3` vertices. -/ +def HasGirthGreaterThan {n : ℕ} (edges : Finset (Finset (Fin n))) (g : ℕ) : Prop := + ∀ j : ℕ, 2 ≤ j → j ≤ g → + ∀ S : Finset (Finset (Fin n)), S ⊆ edges → S.card = j → + j + 3 ≤ (S.biUnion id).card + +/-- +Erdős Problem 207 [Er76] [KSSS22b]: + +For any $g \geq 2$, if $n$ is sufficiently large and $n \equiv 1$ or $3 \pmod{6}$, there exists +a Steiner triple system on $n$ vertices such that any $j$ edges (for $2 \leq j \leq g$) +span at least $j + 3$ vertices. + +The girth condition forbids short "cycles" in the hypergraph: any collection of +$j$ edges (for $2 \leq j \leq g$) must contain at least $j + 3$ distinct vertices. + +Proved by Kwan, Sah, Sawhney, and Simkin [KSSS22b]. +-/ +@[category research solved, AMS 5] +theorem erdos_207 : + ∀ g : ℕ, 2 ≤ g → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (n % 6 = 1 ∨ n % 6 = 3) → + ∃ edges : Finset (Finset (Fin n)), + IsSteinerTripleSystem edges ∧ + HasGirthGreaterThan edges g := by + sorry + +end Erdos207 diff --git a/FormalConjectures/ErdosProblems/209.lean b/FormalConjectures/ErdosProblems/209.lean new file mode 100644 index 0000000000..86c6998fcb --- /dev/null +++ b/FormalConjectures/ErdosProblems/209.lean @@ -0,0 +1,127 @@ +/- +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 209 + +Must every finite collection of $d \geq 4$ non-parallel lines in $\mathbb{R}^2$, with no point +having $4$ or more lines passing through it, contain a Gallai triangle (three lines whose three +pairwise intersection points are each ordinary)? + +Disproved by Füredi–Palásti [FuPa84] for $d$ not divisible by $9$, and by Escudero [Es16] for +all $d \geq 4$. See also Problem 960. + +*Reference:* [erdosproblems.com/209](https://www.erdosproblems.com/209) + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. + +[ErPu95b] Erdős, P. and Purdy, G., _Extremal problems in combinatorial geometry_. +Handbook of Combinatorics (1995). + +[FuPa84] Füredi, Z. and Palásti, I., _Arrangements of lines with a large number of triangles_. +Proc. Amer. Math. Soc. **92** (1984), 561–566. + +[Es16] Escudero, J. G., _Gallai triangles in configurations of lines in the projective plane_. +C. R. Math. Acad. Sci. Paris **354** (2016), 551–554. +-/ + +open Classical + +namespace Erdos209 + +/-- Points in the Euclidean plane $\mathbb{R}^2$. -/ +abbrev Point2 := EuclideanSpace ℝ (Fin 2) + +/-- An affine subspace of $\mathbb{R}^2$ is a line if it has dimension $1$. -/ +noncomputable def IsLine (L : AffineSubspace ℝ Point2) : Prop := + Module.finrank ℝ L.direction = 1 + +/-- Two affine subspaces are parallel if they have the same direction. -/ +def AreParallel (L₁ L₂ : AffineSubspace ℝ Point2) : Prop := + L₁.direction = L₂.direction + +/-- The number of lines from $A$ passing through a point $p$. -/ +noncomputable def pointMultiplicity (A : Finset (AffineSubspace ℝ Point2)) (p : Point2) : ℕ := + (A.filter (fun L => p ∈ L)).card + +/-- A point is ordinary if exactly $2$ lines from $A$ pass through it. -/ +noncomputable def IsOrdinaryPoint (A : Finset (AffineSubspace ℝ Point2)) (p : Point2) : Prop := + pointMultiplicity A p = 2 + +/-- A Gallai (ordinary) triangle: three lines forming a triangle with +all three vertices being ordinary points. -/ +noncomputable def HasGallaiTriangle (A : Finset (AffineSubspace ℝ Point2)) : Prop := + ∃ L₁ ∈ A, ∃ L₂ ∈ A, ∃ L₃ ∈ A, + L₁ ≠ L₂ ∧ L₂ ≠ L₃ ∧ L₁ ≠ L₃ ∧ + ∃ p₁₂ p₂₃ p₁₃ : Point2, + p₁₂ ∈ L₁ ∧ p₁₂ ∈ L₂ ∧ + p₂₃ ∈ L₂ ∧ p₂₃ ∈ L₃ ∧ + p₁₃ ∈ L₁ ∧ p₁₃ ∈ L₃ ∧ + p₁₂ ≠ p₂₃ ∧ p₂₃ ≠ p₁₃ ∧ p₁₂ ≠ p₁₃ ∧ + IsOrdinaryPoint A p₁₂ ∧ IsOrdinaryPoint A p₂₃ ∧ IsOrdinaryPoint A p₁₃ + +/-- +Must every finite collection of $d \geq 4$ non-parallel lines in $\mathbb{R}^2$, with no point +having $4$ or more lines passing through it, contain a Gallai triangle (three lines whose three +pairwise intersection points are each ordinary)? + +Disproved by Füredi–Palásti for $d$ not divisible by $9$, and by Escudero for all $d \geq 4$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_209 : answer(False) ↔ + ∀ d : ℕ, d ≥ 4 → + ∀ A : Finset (AffineSubspace ℝ Point2), + A.card = d → + (∀ L ∈ A, IsLine L) → + (∀ L₁ ∈ A, ∀ L₂ ∈ A, L₁ ≠ L₂ → ¬AreParallel L₁ L₂) → + (∀ p : Point2, pointMultiplicity A p ≤ 3) → + HasGallaiTriangle A := by + sorry + +/-- +Stronger disproof due to Escudero [Es16]: for *every* $d \geq 4$, there exists a line +arrangement of $d$ non-parallel lines with no point of multiplicity $\geq 4$ and no Gallai +triangle. This is stronger than the main `erdos_209` statement, which only asserts the existence +of *some* such $d$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_209_strong : ∀ d : ℕ, d ≥ 4 → + ∃ A : Finset (AffineSubspace ℝ Point2), + A.card = d ∧ + (∀ L ∈ A, IsLine L) ∧ + (∀ L₁ ∈ A, ∀ L₂ ∈ A, L₁ ≠ L₂ → ¬AreParallel L₁ L₂) ∧ + (∀ p : Point2, pointMultiplicity A p ≤ 3) ∧ + ¬HasGallaiTriangle A := by + sorry + +/-- +Füredi–Palásti partial result [FuPa84]: for $d \geq 4$ with $d$ not divisible by $9$, there +exists a line arrangement of $d$ non-parallel lines with no point of multiplicity $\geq 4$ and +no Gallai triangle. +-/ +@[category research solved, AMS 5 52] +theorem erdos_209_furedi_palasti (d : ℕ) (hd : d ≥ 4) (h9 : ¬(9 ∣ d)) : + ∃ A : Finset (AffineSubspace ℝ Point2), + A.card = d ∧ + (∀ L ∈ A, IsLine L) ∧ + (∀ L₁ ∈ A, ∀ L₂ ∈ A, L₁ ≠ L₂ → ¬AreParallel L₁ L₂) ∧ + (∀ p : Point2, pointMultiplicity A p ≤ 3) ∧ + ¬HasGallaiTriangle A := by + sorry + +end Erdos209 diff --git a/FormalConjectures/ErdosProblems/21.lean b/FormalConjectures/ErdosProblems/21.lean new file mode 100644 index 0000000000..be773d26d1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/21.lean @@ -0,0 +1,106 @@ +/- +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 21 + +*Reference:* [erdosproblems.com/21](https://www.erdosproblems.com/21) + +Let $f(n)$ be the minimum size of an intersecting family of $n$-element sets such that every +set of size at most $n-1$ is disjoint from at least one member. Erdős and Lovász [ErLo75] +conjectured $f(n) = O(n)$, proved by Kahn [Ka94]. + +[ErLo75] Erdős, P. and Lovász, L., _Problems and results on 3-chromatic hypergraphs and some +related questions_. Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on +his 60th birthday), Vol. II (1975), 609–627. + +[Ka92b] Kahn, J., _On a problem of Erdős and Lovász: random lines in a projective plane_. +Combinatorica **12** (1992), 417–423. + +[Ka94] Kahn, J., _On a problem of Erdős and Lovász II: $n(r) = O(r)$_. J. Amer. Math. Soc. **7** +(1994), no. 1, 125–143. + +[Tr14] Tripathi, A., _A result on intersecting families with maximum transversal size_. +Preprint (2014), arXiv:1409.4610. + +[BaWa21] Barát, J. and Wanless, I. M., _Intersecting and 2-intersecting hypergraphs with maximal +covering number_. J. Combin. Des. **29** (2021), no. 3, 260–286. + +See also OEIS sequence [A391599](https://oeis.org/A391599). +-/ + +namespace Erdos21 + +/-- +A family $F$ of $n$-element subsets of $\mathbb{N}$ is intersecting if every two members +of $F$ have non-empty intersection. +-/ +def IsIntersectingNFamily (F : Finset (Finset ℕ)) (n : ℕ) : Prop := + (∀ A ∈ F, A.card = n) ∧ (∀ A ∈ F, ∀ B ∈ F, (A ∩ B).Nonempty) + +/-- +A family $F$ of $n$-sets covers all small sets if every set $S$ with $|S| \leq n - 1$ +is disjoint from at least one member of $F$. +-/ +def CoversAllSmallSets (F : Finset (Finset ℕ)) (n : ℕ) : Prop := + ∀ S : Finset ℕ, S.card ≤ n - 1 → ∃ A ∈ F, Disjoint S A + +/-- +$f(n)$ is the minimal size of an intersecting family of $n$-sets that covers +all sets of size at most $n - 1$. +-/ +noncomputable def erdosLovaszF (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ F : Finset (Finset ℕ), + F.card = k ∧ IsIntersectingNFamily F n ∧ CoversAllSmallSets F n} + +/-- +Let $f(n)$ be the minimal size of an intersecting family $F$ of $n$-element sets such that any +set $S$ with $|S| \leq n - 1$ is disjoint from at least one $A \in F$. Then $f(n) \ll n$, i.e., +there exist constants $C > 0$ and $N_0$ such that $f(n) \leq C \cdot n$ for all $n \geq N_0$. + +Erdős and Lovász [ErLo75] proved $(8/3)n - 3 \leq f(n) \ll n^{3/2} \log n$. +Kahn [Ka92b] improved the upper bound to $f(n) \ll n \log n$. +Kahn [Ka94] proved $f(n) \ll n$, settling the conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_21 : answer(True) ↔ + (∃ C : ℝ, 0 < C ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (erdosLovaszF n : ℝ) ≤ C * n) := by + sorry + +/-- +The Erdős–Lovász lower bound [ErLo75]: $f(n) \geq \lceil (8/3)n - 3 \rceil$ for all $n \geq 1$. +This was proved in the same paper that introduced the conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_21_lower_bound : + ∀ n : ℕ, 1 ≤ n → (8 / 3 : ℝ) * n - 3 ≤ (erdosLovaszF n : ℝ) := by + sorry + +/-- +Conjectured exact asymptotics: $f(n) = 3n + O(1)$, i.e., there exists a constant $C$ +such that $|f(n) - 3n| \leq C$ for all sufficiently large $n$. This is a stronger +conjecture than the $f(n) = O(n)$ bound proved by Kahn [Ka94]. +-/ +@[category research open, AMS 5] +theorem erdos_21_exact_asymptotics : answer(True) ↔ + (∃ C : ℝ, ∀ n : ℕ, 1 ≤ n → + |(erdosLovaszF n : ℝ) - 3 * n| ≤ C) := by + sorry + +end Erdos21 diff --git a/FormalConjectures/ErdosProblems/210.lean b/FormalConjectures/ErdosProblems/210.lean new file mode 100644 index 0000000000..28b3d26675 --- /dev/null +++ b/FormalConjectures/ErdosProblems/210.lean @@ -0,0 +1,127 @@ +/- +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 210 + +Let $f(n)$ denote the minimum number of ordinary lines determined by $n$ +non-collinear points in the plane. Erdős asked whether $f(n) \to \infty$ and +how fast it grows. + +Motzkin proved that $f(n) \to \infty$ and conjectured $f(n) \geq n/2$ for +$n \geq 13$. Kelly and Moser proved $f(n) \geq 3n/7$, Csima and Sawyer improved +this to $f(n) \geq 6n/13$ for $n \geq 8$, and Green and Tao proved +$f(n) \geq n/2$ for sufficiently large $n$, resolving the conjecture of Motzkin. + +## References + +* [Mo51] Motzkin, Th., _The lines and planes connecting the points of a finite + set_. Transactions of the American Mathematical Society **70** (1951), 451–464. +* [KeMo58] Kelly, L. M. and Moser, W. O. J., _On the number of ordinary lines + determined by n points_. Canadian Journal of Mathematics **10** (1958), 210–219. +* [CsSa93] Csima, J. and Sawyer, E. T., _There exist 6n/13 ordinary points_. + Discrete & Computational Geometry **9** (1993), 187–202. +* [GrTa13] Green, B. and Tao, T., _On sets defining few ordinary lines_. + Discrete & Computational Geometry **50** (2013), 409–468. + +## See also + +* OEIS sequence [A003034](https://oeis.org/A003034) + +*Reference:* [erdosproblems.com/210](https://www.erdosproblems.com/210) +-/ + +open Classical + +namespace Erdos210 + +/-- Points in the Euclidean plane $\mathbb{R}^2$. -/ +abbrev Point2 := EuclideanSpace ℝ (Fin 2) + +/-- Point $r$ lies on the line through distinct points $p$ and $q$. -/ +def LiesOnLine (p q r : Point2) : Prop := + ∃ t : ℝ, r - p = t • (q - p) + +/-- A finite set of points is not all collinear: there exist three +non-collinear points in $S$. -/ +def NotAllCollinear (S : Finset Point2) : Prop := + ∃ p ∈ S, ∃ q ∈ S, ∃ r ∈ S, p ≠ q ∧ p ≠ r ∧ q ≠ r ∧ ¬LiesOnLine p q r + +/-- An ordered pair $(p, q)$ determines an ordinary line for $S$ if $p \neq q$, +both lie in $S$, and no third point of $S$ lies on the line through $p$ and $q$. -/ +def IsOrdinaryPair (S : Finset Point2) (p q : Point2) : Prop := + p ∈ S ∧ q ∈ S ∧ p ≠ q ∧ ∀ r ∈ S, r ≠ p → r ≠ q → ¬LiesOnLine p q r + +/-- The number of ordinary lines determined by $S$. +Counts ordered pairs forming ordinary lines and divides by $2$. +This is exact because `IsOrdinaryPair S p q ↔ IsOrdinaryPair S q p` +(the collinearity condition is symmetric when `p ≠ q`), so each ordinary +line contributes exactly two ordered pairs. -/ +noncomputable def ordinaryLineCount (S : Finset Point2) : ℕ := + ((S ×ˢ S).filter (fun pq => IsOrdinaryPair S pq.1 pq.2)).card / 2 + +/-- +Let $f(n)$ be minimal such that for any $n$ points in $\mathbb{R}^2$, not all on a line, +there are at least $f(n)$ ordinary lines (lines containing exactly $2$ of the +points). Green and Tao [GrTa13] proved that $f(n) \geq n/2$ for all sufficiently +large $n$, resolving the conjecture of Motzkin and strengthening earlier results +of Motzkin [Mo51] ($f(n) \to \infty$), Kelly–Moser [KeMo58] ($f(n) \geq 3n/7$), +and Csima–Sawyer [CsSa93] ($f(n) \geq 6n/13$). +-/ +@[category research solved, AMS 5 52] +theorem erdos_210 : + ∃ N₀ : ℕ, ∀ (S : Finset Point2), + S.card ≥ N₀ → + NotAllCollinear S → + ordinaryLineCount S ≥ S.card / 2 := by + sorry + +/-- +The **Sylvester–Gallai theorem**: any finite set of at least 3 non-collinear +points in the plane determines at least one ordinary line. This is the base +case $f(n) \geq 1$ of the ordinary lines problem. +-/ +@[category research solved, AMS 5 52] +theorem erdos_210_sylvester_gallai : + ∀ (S : Finset Point2), S.card ≥ 3 → + NotAllCollinear S → + ordinaryLineCount S ≥ 1 := by + sorry + +/-- +**Motzkin's theorem** [Mo51]: the number of ordinary lines $f(n) \to \infty$ +as $n \to \infty$. This was the first resolution of Erdős's question of whether +$f(n) \to \infty$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_210_motzkin : + ∀ K : ℕ, ∃ N₀ : ℕ, ∀ (S : Finset Point2), + S.card ≥ N₀ → NotAllCollinear S → ordinaryLineCount S ≥ K := by + sorry + +/-- +**Kelly–Moser bound** [KeMo58]: any set of $n \geq 3$ non-collinear points +determines at least $3n/7$ ordinary lines. This bound is tight for $n = 7$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_210_kelly_moser : + ∀ (S : Finset Point2), S.card ≥ 3 → + NotAllCollinear S → ordinaryLineCount S ≥ 3 * S.card / 7 := by + sorry + +end Erdos210 diff --git a/FormalConjectures/ErdosProblems/211.lean b/FormalConjectures/ErdosProblems/211.lean new file mode 100644 index 0000000000..2e3e44da4d --- /dev/null +++ b/FormalConjectures/ErdosProblems/211.lean @@ -0,0 +1,120 @@ +/- +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 211 + +*Reference:* [erdosproblems.com/211](https://www.erdosproblems.com/211) + +Let $1 \leq k < n$. Given $n$ points in $\mathbb{R}^2$, at most $n - k$ on any line, +there are $\gg kn$ many lines which contain at least two points. + +Proved by Beck [Be83] and Szemerédi–Trotter [SzTr83]. + +In particular, given any $2n$ points with at most $n$ on a line there +are $\gg n^2$ many lines formed by the points. + +Erdős conjectured that the bound might be sharpened to $\geq (1 + o(1)) kn / 6$ lines, +though he acknowledged this "perhaps is too optimistic." + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 105. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. + +[Be83] Beck, J., _On the lattice property of the plane and some problems of Dirac, +Motzkin and Erdős in combinatorial geometry_. Combinatorica 3 (1983), 281-297. + +[SzTr83] Szemerédi, E. and Trotter, W.T., _Extremal problems in discrete geometry_. +Combinatorica 3 (1983), 381-392. + +[BGS74] Burr, S. A., Grünbaum, B., and Sloane, N. J. A., _The orchard problem_. +Geometriae Dedicata (1974), 397–424. + +[FuPa84] Füredi, Z. and Palásti, I., _Arrangements of lines with a large number of +triangles_. Proc. Amer. Math. Soc. **92** (1984), 561–566. +-/ + +open Classical + +namespace Erdos211 + +/-- The number of points in $S$ on the line through $p$ and $q$, +where the line is defined as the affine span of $\{p, q\}$. -/ +noncomputable def pointsOnLine (S : Finset (EuclideanSpace ℝ (Fin 2))) + (p q : EuclideanSpace ℝ (Fin 2)) : ℕ := + (S.filter (fun r => r ∈ affineSpan ℝ ({p, q} : Set (EuclideanSpace ℝ (Fin 2))))).card + +/-- The number of distinct lines containing at least two points of $S$, +where lines are represented as affine subspaces via `affineSpan`. -/ +noncomputable def lineCount (S : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + (((S ×ˢ S).filter (fun pq => pq.1 ≠ pq.2)).image + (fun pq => affineSpan ℝ ({pq.1, pq.2} : Set (EuclideanSpace ℝ (Fin 2))))).card + +/-- +Erdős Problem 211 (Proved by Beck [Be83] and Szemerédi–Trotter [SzTr83]) +[Er75f] [Er81] [Er83c] [Er84]: + +There exists an absolute constant $C > 0$ such that for any finite set $S$ +of points in $\mathbb{R}^2$ with $|S| = n$, if $1 \leq k < n$ and at most $n - k$ points +of $S$ lie on any single line, then the number of distinct lines containing +at least two points of $S$ is at least $C \cdot k \cdot n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_211 : + ∃ C : ℝ, C > 0 ∧ + ∀ (S : Finset (EuclideanSpace ℝ (Fin 2))) (k : ℕ), + 1 ≤ k → + k < S.card → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k) → + (lineCount S : ℝ) ≥ C * ↑k * ↑S.card := by + sorry + +/-- +Erdős Problem 211, special case $k = n$: given $2n$ points with at most $n$ on +any line, there are $\gg n^2$ distinct lines. This corresponds to setting $k = n$ +in a set of $2n$ points in the main theorem. +-/ +@[category research solved, AMS 5 52] +theorem erdos_211_special : + ∃ C : ℝ, C > 0 ∧ + ∀ (S : Finset (EuclideanSpace ℝ (Fin 2))) (n : ℕ), + S.card = 2 * n → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ n) → + (lineCount S : ℝ) ≥ C * ↑n ^ 2 := by + sorry + +/-- +Erdős Problem 211, sharpened conjecture: the constant in the lower bound +can be taken as $(1/6 - \varepsilon)$ for sufficiently large point sets. +Erdős himself described this as possibly "too optimistic." +-/ +@[category research open, AMS 5 52] +theorem erdos_211_sharp : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ (S : Finset (EuclideanSpace ℝ (Fin 2))) (k : ℕ), + S.card ≥ N₀ → 1 ≤ k → k < S.card → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k) → + (lineCount S : ℝ) ≥ (1/6 - ε) * ↑k * ↑S.card := by + sorry + +end Erdos211 diff --git a/FormalConjectures/ErdosProblems/214.lean b/FormalConjectures/ErdosProblems/214.lean new file mode 100644 index 0000000000..225e129cc3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/214.lean @@ -0,0 +1,90 @@ +/- +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 214 + +Let $S \subset \mathbb{R}^2$ be such that no two points in $S$ are distance $1$ apart. +Must the complement of $S$ contain four points which form a unit square? + +*Reference:* [erdosproblems.com/214](https://www.erdosproblems.com/214) + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Ju79] Juhász, R., _Ramsey type theorems in the plane_. Journal of Combinatorial Theory, Series A +**27** (1979), 152–160. +-/ + +namespace Erdos214 + +/-- +Four points in $\mathbb{R}^2$ form a "unit square" if, when taken in cyclic order +$a \to b \to c \to d$, all four sides have length $1$ and both diagonals have length $\sqrt{2}$. +The four points must also be pairwise distinct. +-/ +def IsUnitSquare (a b c d : EuclideanSpace ℝ (Fin 2)) : Prop := + a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ + dist a b = 1 ∧ dist b c = 1 ∧ dist c d = 1 ∧ dist d a = 1 ∧ + dist a c = Real.sqrt 2 ∧ dist b d = Real.sqrt 2 + +/-- +Let $S \subset \mathbb{R}^2$ be such that no two points in $S$ are distance $1$ apart. +Then the complement of $S$ must contain four points which form a unit square. + +This was proved by Juhász [Ju79], who showed more generally that the complement of $S$ +must contain a congruent copy of any set of four points. +-/ +@[category research solved, AMS 52] +theorem erdos_214 : + ∀ (S : Set (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1) → + ∃ a b c d : EuclideanSpace ℝ (Fin 2), + a ∈ Sᶜ ∧ b ∈ Sᶜ ∧ c ∈ Sᶜ ∧ d ∈ Sᶜ ∧ + IsUnitSquare a b c d := by + sorry + +/-- +Juhász's general theorem: if $S \subset \mathbb{R}^2$ is such that no two points in $S$ are +distance $1$ apart, then for any set of four points $P$, the complement of $S$ contains a +congruent copy of $P$. This is strictly stronger than `erdos_214`, which only asserts the +existence of a unit square in the complement. +-/ +@[category research solved, AMS 52] +theorem erdos_214_general : + ∀ (S : Set (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1) → + ∀ (P : Fin 4 → EuclideanSpace ℝ (Fin 2)), + ∃ f : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2), + Isometry f ∧ ∀ i, f (P i) ∈ Sᶜ := by + sorry + +/-- +Does Juhász's result extend to five-point configurations? That is, if $S \subset \mathbb{R}^2$ +has no two points at unit distance, must the complement of $S$ contain a congruent copy of +every set of five points? This remains open. +-/ +@[category research open, AMS 52] +theorem erdos_214_five_points : + ∀ (S : Set (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1) → + ∀ (P : Fin 5 → EuclideanSpace ℝ (Fin 2)), + ∃ f : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2), + Isometry f ∧ ∀ i, f (P i) ∈ Sᶜ := by + sorry + +end Erdos214 diff --git a/FormalConjectures/ErdosProblems/215.lean b/FormalConjectures/ErdosProblems/215.lean new file mode 100644 index 0000000000..1983798ad0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/215.lean @@ -0,0 +1,59 @@ +/- +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 215 + +*Reference:* [erdosproblems.com/215](https://www.erdosproblems.com/215) + +Does there exist a set $S \subseteq \mathbb{R}^2$ such that every set congruent to $S$ +contains exactly one point of $\mathbb{Z}^2$? The answer is yes, proved by Jackson and +Mauldin [JaMa02] using the axiom of choice. + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[JaMa02] Jackson, S. and Mauldin, R.D., _On a lattice problem of H. Steinhaus_, Journal of the +American Mathematical Society 15 (2002), 817-856. +-/ + +namespace Erdos215 + +/-- +The integer lattice $\mathbb{Z}^2 \subseteq \mathbb{R}^2$: points whose coordinates are all +integers. +-/ +def IntLattice : Set (EuclideanSpace ℝ (Fin 2)) := + {p | ∀ i : Fin 2, ∃ n : ℤ, p i = ↑n} + +/-- +Erdős Problem 215 (Steinhaus Problem): +Does there exist $S \subseteq \mathbb{R}^2$ such that every set congruent to $S$ +(that is, $S$ after some isometry) contains exactly one point from $\mathbb{Z}^2$? + +The answer is yes, proved by Jackson and Mauldin [JaMa02]. +Their construction depends on the axiom of choice. +-/ +@[category research solved, AMS 52] +theorem erdos_215 : answer(True) ↔ + ∃ (S : Set (EuclideanSpace ℝ (Fin 2))), + ∀ (f : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2)), + Isometry f → + ∃! p, p ∈ f '' S ∧ p ∈ IntLattice := by + sorry + +end Erdos215 diff --git a/FormalConjectures/ErdosProblems/216.lean b/FormalConjectures/ErdosProblems/216.lean new file mode 100644 index 0000000000..f9fdab72a0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/216.lean @@ -0,0 +1,120 @@ +/- +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 216 + +*Reference:* [erdosproblems.com/216](https://www.erdosproblems.com/216) + +Does $g(k)$ exist for all $k \geq 3$, where $g(k)$ is the smallest $N$ such that any set of $N$ +points in general position in $\mathbb{R}^2$ contains an empty convex $k$-gon? + +This is a variant of the "happy ending problem" +([Problem 107](https://www.erdosproblems.com/107)), which asks the same question without the +empty interior restriction. + +[Er78c] Erdős, P. (1978). + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[Er82e] Erdős, P., _Problems and results on finite and infinite graphs_. Recent advances +in graph theory (Proc. Second Czechoslovak Sympos., Prague, 1982). + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[Ha78] Harborth, H., _Konvexe Fünfecke in ebenen Punktmengen_. Elem. Math. 33 (1978), 116-118. + +[Ho83] Horton, J. D., _Sets with no empty convex 7-gons_. Canad. Math. Bull. 26 (1983), 482-484. + +[Ni07] Nicolás, C. M., _The empty hexagon theorem_. Discrete Comput. Geom. 38 (2007), 389-397. + +[Ge08] Gerken, T., _Empty convex hexagons in planar point sets_. Discrete Comput. Geom. 39 (2008), +239-272. + +[HeSc24] Heule, M. J. H. and Scheucher, M., _Happy ending: An empty hexagon in every set of 30 +points_. J. ACM 71 (2024). + +OEIS: [A381776](https://oeis.org/A381776) +-/ + +open Set EuclideanGeometry + +namespace Erdos216 + +/-- +A point set $S$ contains an empty convex $k$-gon if there exists a subset $T \subseteq S$ +of exactly $k$ points such that: +1. $T$ is in convex position (the $k$ points form the vertices of a convex polygon), and +2. no other point of $S$ lies in the interior of the convex hull of $T$. +-/ +def HasEmptyConvexKGon (S : Finset ℝ²) (k : ℕ) : Prop := + ∃ T : Finset ℝ², T ⊆ S ∧ T.card = k ∧ + ConvexIndep (↑T : Set ℝ²) ∧ + ∀ p ∈ S, p ∉ T → p ∉ interior (convexHull ℝ (↑T : Set ℝ²)) + +/-- +Let $g(k)$ be the smallest integer $N$ (if it exists) such that any set of $N$ +points in general position in $\mathbb{R}^2$ contains an empty convex $k$-gon (a convex +$k$-gon with no point of the set in its interior). Does $g(k)$ exist for +all $k \geq 3$? + +Known results: +- $g(3) = 3$ (trivial) and $g(4) = 5$ (Erdős). +- $g(5) = 10$ (Harborth [Ha78]). +- $g(6)$ exists (Nicolás [Ni07], Gerken [Ge08]), and $g(6) = 30$ + (Heule–Scheucher [HeSc24]). +- DISPROVED for $k \geq 7$: Horton [Ho83] constructed arbitrarily large point + sets in general position with no empty convex $7$-gon, so $g(k)$ does not + exist for $k \geq 7$. +-/ +@[category research solved, AMS 52] +theorem erdos_216 : answer(False) ↔ + ∀ k : ℕ, 3 ≤ k → + ∃ N : ℕ, ∀ (S : Finset ℝ²), + NonTrilinear (↑S : Set ℝ²) → N ≤ S.card → + HasEmptyConvexKGon S k := by + sorry + +/-- +Horton [Ho83] showed that for $k \geq 7$, there exist arbitrarily large point +sets in general position with no empty convex $k$-gon. Thus $g(k)$ does not +exist for $k \geq 7$. +-/ +@[category research solved, AMS 52] +theorem erdos_216_horton : ∀ k : ℕ, 7 ≤ k → ∀ N : ℕ, + ∃ S : Finset ℝ², + NonTrilinear (↑S : Set ℝ²) ∧ N ≤ S.card ∧ ¬HasEmptyConvexKGon S k := by + sorry + +/-- +The existence of $g(6)$ was independently proved by Nicolás [Ni07] and +Gerken [Ge08]. The exact value $g(6) = 30$ was determined by +Heule and Scheucher [HeSc24]. +-/ +@[category research solved, AMS 52] +theorem erdos_216_g6 : + ∃ N : ℕ, ∀ (S : Finset ℝ²), + NonTrilinear (↑S : Set ℝ²) → N ≤ S.card → + HasEmptyConvexKGon S 6 := by + sorry + +end Erdos216 diff --git a/FormalConjectures/ErdosProblems/217.lean b/FormalConjectures/ErdosProblems/217.lean new file mode 100644 index 0000000000..8808803731 --- /dev/null +++ b/FormalConjectures/ErdosProblems/217.lean @@ -0,0 +1,87 @@ +/- +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 217 + +*Reference:* [erdosproblems.com/217](https://www.erdosproblems.com/217) + +For which $n$ are there $n$ points in $\mathbb{R}^2$, no three on a line and no four on a +circle, which determine $n-1$ distinct distances and so that (in some ordering +of the distances) the $i$-th distance occurs $i$ times? + +An example with $n=4$ is an isosceles triangle with the point in the centre. +Erdős originally believed this was impossible for $n \geq 5$, but Pomerance +constructed a set with $n = 5$, and Palásti proved such sets exist for all $n \leq 8$. +Erdős believed this is impossible for all sufficiently large $n$. + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Er87b, p.167] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167-177. + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). +-/ + +open EuclideanGeometry + +namespace Erdos217 + +/-- Four points in $\mathbb{R}^2$ are concyclic if they are all equidistant from some center. -/ +def Concyclic4 (p₁ p₂ p₃ p₄ : EuclideanSpace ℝ (Fin 2)) : Prop := + ∃ (c : EuclideanSpace ℝ (Fin 2)) (r : ℝ), + dist p₁ c = r ∧ dist p₂ c = r ∧ dist p₃ c = r ∧ dist p₄ c = r + +/-- A finite point set in $\mathbb{R}^2$ has no four concyclic points. -/ +def NoFourConcyclic (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ p₁ ∈ S, ∀ p₂ ∈ S, ∀ p₃ ∈ S, ∀ p₄ ∈ S, + p₁ ≠ p₂ → p₁ ≠ p₃ → p₁ ≠ p₄ → p₂ ≠ p₃ → p₂ ≠ p₄ → p₃ ≠ p₄ → + ¬Concyclic4 p₁ p₂ p₃ p₄ + +/-- A set $S$ of $n$ points has the distance multiplicity property if there exist $n-1$ +distinct pairwise distances such that (in some ordering) the $j$-th distance +occurs exactly $j$ times as an unordered pair. We count ordered pairs from +`S.offDiag`, so the $j$-th distance yields $2(j+1)$ ordered pairs (since +`Fin (n-1)` is 0-indexed). -/ +def HasDistanceMultiplicityProperty (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ (distances : Fin (S.card - 1) → ℝ), + Function.Injective distances ∧ + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → ∃ i, dist p q = distances i) ∧ + (∀ i : Fin (S.card - 1), + (S.offDiag.filter (fun pq => dist pq.1 pq.2 = distances i)).card = 2 * (i.val + 1)) + +/-- +Erdős Conjecture (Problem 217) [Er83c, Er87b, p.167, Er97e]: + +For all sufficiently large $n$, there does not exist a set of $n$ points in $\mathbb{R}^2$, +no three on a line and no four on a circle, which determine $n-1$ distinct +distances such that (in some ordering) the $i$-th distance occurs exactly $i$ times. + +Known: such configurations exist for all $n \leq 8$ (Palásti). Erdős conjectured +this is impossible for all sufficiently large $n$. +-/ +@[category research open, AMS 5 52] +theorem erdos_217 : + ∃ N₀ : ℕ, ∀ (S : Finset (EuclideanSpace ℝ (Fin 2))), + N₀ ≤ S.card → + NonTrilinear (↑S : Set ℝ²) → + NoFourConcyclic S → + ¬HasDistanceMultiplicityProperty S := by + sorry + +end Erdos217 diff --git a/FormalConjectures/ErdosProblems/22.lean b/FormalConjectures/ErdosProblems/22.lean new file mode 100644 index 0000000000..8f66fc3925 --- /dev/null +++ b/FormalConjectures/ErdosProblems/22.lean @@ -0,0 +1,70 @@ +/- +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 + +open SimpleGraph + +/-! +# Erdős Problem 22 + +*Reference:* [erdosproblems.com/22](https://www.erdosproblems.com/22) + +Let $\varepsilon > 0$ and $n$ be sufficiently large depending on $\varepsilon$. Is there a graph on +$n$ vertices with $\geq n^2/8$ many edges which contains no $K_4$ such that the largest +independent set has size at most $\varepsilon n$? + +Equivalently: $\mathrm{rt}(n; 4, \varepsilon n) \geq n^2/8$ for sufficiently large $n$, where +$\mathrm{rt}(n; k, \ell)$ is the Ramsey–Turán number. + +Conjectured by Bollobás and Erdős [BoEr76], who proved the existence of such a graph with +$(1/8 + o(1))n^2$ many edges. Proved by Fox, Loh, and Zhao [FLZ15], who showed that for every +$n \geq 1$ there exists a $K_4$-free graph on $n$ vertices with $\geq n^2/8$ edges and +independence number $\ll (\log \log n)^{3/2} / (\log n)^{1/2} \cdot n$. + +[BoEr76] Bollobás, B. and Erdős, P., _On a Ramsey–Turán type problem_. J. Combin. Theory Ser. B (1976), 166-168. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[FLZ15] Fox, J., Loh, P.-S., and Zhao, Y., _The critical window for the classical Ramsey–Turán problem_. Combinatorica (2015), 435-476. + +See also Erdős Problem 615. +-/ + +namespace Erdos22 + +/-- +**Erdős Problem 22** (Bollobás–Erdős Conjecture on Ramsey–Turán numbers, +proved by Fox, Loh, and Zhao [FLZ15]): + +For every $\varepsilon > 0$, for all sufficiently large $n$, there exists a graph $G$ on $n$ +vertices such that: +- $G$ has at least $n^2/8$ edges, +- $G$ contains no $K_4$ (no clique of size 4), +- every independent set in $G$ has size at most $\varepsilon \cdot n$. +-/ +@[category research solved, AMS 5] +theorem erdos_22 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ G : SimpleGraph (Fin n), + (n : ℝ) ^ 2 / 8 ≤ (G.edgeFinset.card : ℝ) ∧ + G.CliqueFree 4 ∧ + (∀ s : Finset (Fin n), G.IsIndepSet ↑s → (s.card : ℝ) ≤ ε * (n : ℝ)) := by + sorry + +end Erdos22 diff --git a/FormalConjectures/ErdosProblems/220.lean b/FormalConjectures/ErdosProblems/220.lean new file mode 100644 index 0000000000..abe6dbe5c3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/220.lean @@ -0,0 +1,85 @@ +/- +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 220 + +Is it true that the sum of squared gaps between consecutive totatives of $n$ is +$O(n^2 / \varphi(n))$? + +*Reference:* [erdosproblems.com/220](https://www.erdosproblems.com/220) + +[MoVa86] Montgomery, H.L. and Vaughan, R.C., _On the distribution of reduced residues_, 1986. +-/ + +open Finset + +namespace Erdos220 + +/-- The sum of squared consecutive gaps in a sorted list of natural numbers. -/ +def sumSquaredGaps : List ℕ → ℕ + | [] => 0 + | [_] => 0 + | a :: b :: rest => (b - a) ^ 2 + sumSquaredGaps (b :: rest) + +/-- The totatives of $n$ listed in increasing order: all $m$ with $1 \le m < n$ +and $\gcd(m, n) = 1$. -/ +def sortedTotatives (n : ℕ) : List ℕ := + ((Finset.range n).filter (fun m => 0 < m ∧ Nat.Coprime m n)).sort (· ≤ ·) + +/-- +Erdős Problem 220 [Er40, Er55c, Er57, Er61, Er65b, Er73, Er79, ErGr80, Er81k, Er85c]: + +Let $n \ge 1$ and $A = \{a_1 < \cdots < a_{\varphi(n)}\} = \{1 \le m < n : \gcd(m,n) = 1\}$ be the +totatives of $n$ listed in increasing order. Is it true that +$$\sum_{1 \le k < \varphi(n)} (a_{k+1} - a_k)^2 \ll n^2 / \varphi(n)?$$ + +The answer is yes, as proved by Montgomery and Vaughan [MoVa86], who showed +the more general result that for any $\gamma \ge 1$, +$$\sum_{1 \le k < \varphi(n)} (a_{k+1} - a_k)^\gamma \ll n^\gamma / \varphi(n)^{\gamma-1}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_220 : + answer(True) ↔ + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (sumSquaredGaps (sortedTotatives n) : ℝ) ≤ C * (n : ℝ) ^ 2 / (Nat.totient n : ℝ) := by + sorry + +/-- The sum of consecutive gaps raised to a real power `γ` in a sorted list of natural numbers. -/ +noncomputable def sumGapPowers (γ : ℝ) : List ℕ → ℝ + | [] => 0 + | [_] => 0 + | a :: b :: rest => ((b - a : ℕ) : ℝ) ^ γ + sumGapPowers γ (b :: rest) + +/-- +Montgomery–Vaughan generalization of Erdős Problem 220 [MoVa86]: + +For any `γ ≥ 1`, the sum of `γ`-th powers of consecutive gaps between totatives of `n` +is `O(n^γ / φ(n)^{γ-1})`. The case `γ = 2` is the original Erdős Problem 220. +-/ +@[category research solved, AMS 11] +theorem erdos_220_general : + ∀ γ : ℝ, 1 ≤ γ → + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + sumGapPowers γ (sortedTotatives n) ≤ + C * (n : ℝ) ^ γ / (Nat.totient n : ℝ) ^ (γ - 1) := by + sorry + +end Erdos220 diff --git a/FormalConjectures/ErdosProblems/221.lean b/FormalConjectures/ErdosProblems/221.lean new file mode 100644 index 0000000000..9d5d37098c --- /dev/null +++ b/FormalConjectures/ErdosProblems/221.lean @@ -0,0 +1,84 @@ +/- +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 221 + +Is there a set $A \subseteq \mathbb{N}$ with $|A \cap \{1, \ldots, N\}| \ll N / \log N$ +such that every sufficiently large integer can be written as $2^k + a$ for some +$k \geq 0$ and $a \in A$? + +The answer is yes. Lorentz [Lo54] first proved a weaker result with +$|A \cap \{1, \ldots, N\}| \ll N \cdot \log\log N / \log N$. Ruzsa [Ru72] proved the full +result with an elegant construction. Ruzsa [Ru01] later constructed an exact additive +complement achieving $|A \cap \{1, \ldots, N\}| \sim N / \log_2 N$, which is asymptotically +best possible. + +## References + +[Lo54] Lorentz, G. G., _On a problem of additive number theory_. +Proc. Amer. Math. Soc. **5** (1954), 838–841. + +[Ru72] Ruzsa, I., _On a problem of P. Erdős_. +Canad. Math. Bull. **15** (1972), 309–310. + +[Ru01] Ruzsa, I. Z., _Additive completion of lacunary sequences_. +Combinatorica **21** (2001), 279–291. + +*Reference:* [erdosproblems.com/221](https://www.erdosproblems.com/221) +-/ + +open scoped Classical +open Finset Real + +namespace Erdos221 + +/-- +Is there a set $A \subseteq \mathbb{N}$ such that +$|A \cap \{1, \ldots, N\}| \ll N / \log N$ and every sufficiently large integer can be +written as $2^k + a$ for some $k \geq 0$ and $a \in A$? + +The answer is yes, proved by Ruzsa [Ru72]. Lorentz [Lo54] had previously proved a weaker +result with $|A \cap \{1, \ldots, N\}| \ll N \cdot \log\log N / \log N$. +-/ +@[category research solved, AMS 11] +theorem erdos_221 : + answer(True) ↔ + ∃ (A : Set ℕ), + (∃ (C : ℝ), C > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ C * ↑N / Real.log ↑N) ∧ + (∃ M : ℕ, ∀ n : ℕ, M ≤ n → ∃ k : ℕ, ∃ a ∈ A, n = 2 ^ k + a) := by + sorry + +/-- +Ruzsa [Ru01] constructed an exact additive complement of the powers of 2 achieving +the asymptotically optimal counting bound: there exists a set $A \subseteq \mathbb{N}$ such that +$|A \cap \{1, \ldots, N\}| \sim N / \log_2 N$ as $N \to \infty$, and every sufficiently large +integer can be written as $2^k + a$ for some $k \geq 0$ and $a \in A$. This is best possible +since the number of powers of 2 up to $N$ is $\sim \log_2 N$. +-/ +@[category research solved, AMS 11] +theorem erdos_221_optimal : + ∃ (A : Set ℕ), + (Filter.Tendsto (fun N : ℕ => + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) / (↑N / Real.logb 2 ↑N)) + Filter.atTop (nhds 1)) ∧ + (∃ M : ℕ, ∀ n : ℕ, M ≤ n → ∃ k : ℕ, ∃ a ∈ A, n = 2 ^ k + a) := by + sorry + +end Erdos221 diff --git a/FormalConjectures/ErdosProblems/222.lean b/FormalConjectures/ErdosProblems/222.lean new file mode 100644 index 0000000000..a54134d4e6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/222.lean @@ -0,0 +1,116 @@ +/- +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 222 + +*Reference:* [erdosproblems.com/222](https://www.erdosproblems.com/222) + +Let $n_1 < n_2 < \cdots$ be the sequence of integers which are the sum of two +squares. Explore the behaviour of the consecutive differences $n_{k+1} - n_k$. + +## References + +- [Er51] Erdős, P., _Some problems and results in elementary number theory_. + Publ. Math. Debrecen (1951), 103–109. +- [Er57] Erdős, P., _Some unsolved problems_, 1957. +- [Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató + Int. Közl. **6** (1961), 221–254. +- [BaCh47] Bambah, R. P. and Chowla, S., _On numbers which can be expressed + as a sum of two squares_. Proc. Nat. Inst. Sci. India (1947), 101–103. +- [Ri82] Richards, I., _On the gaps between numbers which are sums of two + squares_. Adv. in Math. (1982), 1–2. +- [DEKKM22] Dietmann, R., Elsholtz, C., Kalmynin, A., Konyagin, S., and + Maynard, J., _Longer Gaps Between Values of Binary Quadratic Forms_. + International Mathematics Research Notices (2023), 10313–10349. + +## OEIS + +- [A256435](https://oeis.org/A256435) Differences of consecutive integers + that are sums of two squares. +-/ + +open Filter + +namespace Erdos222 + +/-- A natural number is a sum of two squares if it can be written as $a^2 + b^2$ +for some natural numbers $a$ and $b$. -/ +def IsSumOfTwoSquares (n : ℕ) : Prop := + ∃ a b : ℕ, n = a ^ 2 + b ^ 2 + +/-- The $k$-th element (0-indexed) of the increasing enumeration of natural +numbers that are sums of two squares: $0, 1, 2, 4, 5, 8, 9, 10, 13, \ldots$ -/ +noncomputable def sumTwoSqSeq (k : ℕ) : ℕ := + Nat.nth IsSumOfTwoSquares k + +/-- +Bambah–Chowla (1947) upper bound on gaps in the sum-of-two-squares sequence [BaCh47]: +the consecutive differences satisfy $n_{k+1} - n_k \ll n_k^{1/4}$, +i.e. there exists a constant $C > 0$ such that eventually +$n_{k+1} - n_k \leq C \cdot n_k^{1/4}$. +-/ +@[category research solved, AMS 11] +theorem erdos_222 : + ∃ C : ℝ, C > 0 ∧ ∀ᶠ k in atTop, + ((sumTwoSqSeq (k + 1) : ℝ) - (sumTwoSqSeq k : ℝ)) ≤ + C * (sumTwoSqSeq k : ℝ) ^ ((1 : ℝ) / 4) := by + sorry + +/-- +Richards (1982) lower bound on gaps in the sum-of-two-squares sequence [Ri82]: +for every $\delta > 0$, there are infinitely many $k$ such that +$n_{k+1} - n_k \geq (1/4 - \delta) \cdot \log n_k$. + +This is equivalent to $\limsup_{k \to \infty} (n_{k+1} - n_k) / \log n_k \geq 1/4$. +-/ +@[category research solved, AMS 11] +theorem erdos_222.variants.lower_bound : + ∀ δ : ℝ, δ > 0 → ∃ᶠ k in atTop, + ((sumTwoSqSeq (k + 1) : ℝ) - (sumTwoSqSeq k : ℝ)) ≥ + (1 / 4 - δ) * Real.log (sumTwoSqSeq k : ℝ) := by + sorry + +/-- +Erdős's lower bound on gaps in the sum-of-two-squares sequence [Er51]: +there exist infinitely many $k$ such that +$n_{k+1} - n_k \gg \frac{\log n_k}{\sqrt{\log \log n_k}}$, +i.e. there exists a constant $C > 0$ such that for infinitely many $k$, +$n_{k+1} - n_k \geq C \cdot \frac{\log n_k}{\sqrt{\log \log n_k}}$. +-/ +@[category research solved, AMS 11] +theorem erdos_222.variants.erdos_lower_bound : + ∃ C : ℝ, C > 0 ∧ ∃ᶠ k in atTop, + ((sumTwoSqSeq (k + 1) : ℝ) - (sumTwoSqSeq k : ℝ)) ≥ + C * (Real.log (sumTwoSqSeq k : ℝ) / + Real.sqrt (Real.log (Real.log (sumTwoSqSeq k : ℝ)))) := by + sorry + +/-- +Dietmann–Elsholtz–Kalmynin–Konyagin–Maynard (2022) improvement [DEKKM22]: +the limsup of $(n_{k+1} - n_k) / \log n_k$ is at least $0.868\ldots$, +improving the constant $1/4$ from Richards [Ri82]. +-/ +@[category research solved, AMS 11] +theorem erdos_222.variants.dekkm22_lower_bound : + ∀ δ : ℝ, δ > 0 → ∃ᶠ k in atTop, + ((sumTwoSqSeq (k + 1) : ℝ) - (sumTwoSqSeq k : ℝ)) ≥ + (0.868 - δ) * Real.log (sumTwoSqSeq k : ℝ) := by + sorry + +end Erdos222 diff --git a/FormalConjectures/ErdosProblems/223.lean b/FormalConjectures/ErdosProblems/223.lean new file mode 100644 index 0000000000..817c543f9a --- /dev/null +++ b/FormalConjectures/ErdosProblems/223.lean @@ -0,0 +1,154 @@ +/- +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 223 + +*Reference:* [erdosproblems.com/223](https://www.erdosproblems.com/223) + +Let $d \geq 2$ and $n \geq 2$. Let $f_d(n)$ be maximal such that there exists +some set of $n$ points $A \subseteq \mathbb{R}^d$, with diameter $1$, in which +the distance $1$ occurs between $f_d(n)$ many pairs of points in $A$. +Estimate $f_d(n)$. + +Originally a conjecture of Vázsonyi [Er46b]. + +Known results: +- Hopf and Pannwitz [HoPa34] proved $f_2(n) = n$. +- Grünbaum [Gr56], Heppes [He56], and Strasziewicz [St57] showed $f_3(n) = 2n - 2$. +- Erdős [Er60b] proved that for $d \geq 4$, + $f_d(n) = \left(\frac{p-1}{2p} + o(1)\right) n^2$ where $p = \lfloor d/2 \rfloor$. +- Swanepoel [Sw09] gave exact values for all $d \geq 4$ and sufficiently large $n$. + +Related problems: #132, #1084. + +## References + +[Er46b] Erdős, P., _On sets of distances of n points_, American Mathematical Monthly (1946), +248–250. + +[Er57] Erdős, P., _Some unsolved problems_, 1957. + +[Er60b] Erdős, P., _On sets of distances of n points in Euclidean space_, Magyar Tudományos +Akadémia Matematikai Kutatóintézet Közleményei (1960), 165–169. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 102. + +[Gr56] Grünbaum, B., _A proof of Vázsonyi's conjecture_, Bulletin of the Research Council +of Israel, Section A (1956), 77–78. + +[He56] Heppes, A., _Beweis einer Vermutung von A. Vázsonyi_, Acta Mathematica Academiae +Scientiarum Hungaricae (1956), 463–466. + +[HoPa34] Hopf, H., Pannwitz, E., _Aufgabe 167_, Jahresbericht der Deutschen +Mathematiker-Vereinigung (1934), 114. + +[St57] Straszewicz, S., _Sur un problème géométrique de P. Erdős_, Bulletin of the Polish +Academy of Sciences, Class III (1957), 39–40. + +[Sw09] Swanepoel, K. J., _Unit distances and diameters in Euclidean spaces_, Discrete & +Computational Geometry (2009), 1–27. +-/ + +open Classical +open scoped EuclideanGeometry + +namespace Erdos223 + +/-- +Erdős Problem 223 ($d \geq 4$), upper bound — Erdős [Er60b]: +For $d \geq 4$, let $p = \lfloor d/2 \rfloor$. For every $\varepsilon > 0$, for sufficiently +large $n$, any $n$ points in $\mathbb{R}^d$ of diameter $\leq 1$ have at most +$\left(\frac{p-1}{2p} + \varepsilon\right) n^2$ unit-distance pairs. +-/ +@[category research solved, AMS 52] +theorem erdos_223 (d : ℕ) (hd : 4 ≤ d) (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ (A : Finset (ℝ^ d)), + N₀ ≤ A.card → + (∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) → + let p := d / 2 + (unitDistNum A : ℝ) ≤ + ((↑p - 1) / (2 * ↑p) + ε) * (A.card : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 223 ($d \geq 4$), lower bound — Erdős [Er60b]: +For $d \geq 4$, let $p = \lfloor d/2 \rfloor$. For every $\varepsilon > 0$, for sufficiently +large $n$, there exist $n$ points in $\mathbb{R}^d$ of diameter $\leq 1$ with at least +$\left(\frac{p-1}{2p} - \varepsilon\right) n^2$ unit-distance pairs. +-/ +@[category research solved, AMS 52] +theorem erdos_223.variants.d_ge4_lower (d : ℕ) (hd : 4 ≤ d) (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ A : Finset (ℝ^ d), + A.card = n ∧ + (∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) ∧ + let p := d / 2 + ((↑p - 1) / (2 * ↑p) - ε) * (n : ℝ) ^ 2 ≤ (unitDistNum A : ℝ) := by + sorry + +/-- +Erdős Problem 223 ($d = 2$), Hopf–Pannwitz [HoPa34]: +Among $n$ points in $\mathbb{R}^2$ with all pairwise distances $\leq 1$, the distance $1$ +occurs between at most $n$ pairs. +-/ +@[category research solved, AMS 52] +theorem erdos_223.variants.d2_upper (A : Finset (EuclideanSpace ℝ (Fin 2))) + (hdiam : ∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) : + unitDistNum A ≤ A.card := by + sorry + +/-- +Erdős Problem 223 ($d = 2$), tightness: +For every $n \geq 3$, there exist $n$ points in $\mathbb{R}^2$ with diameter $1$ and +exactly $n$ pairs at distance $1$. +-/ +@[category research solved, AMS 52] +theorem erdos_223.variants.d2_tight (n : ℕ) (hn : 3 ≤ n) : + ∃ A : Finset (EuclideanSpace ℝ (Fin 2)), + A.card = n ∧ + (∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) ∧ + unitDistNum A = n := by + sorry + +/-- +Erdős Problem 223 ($d = 3$), Grünbaum–Heppes–Strasziewicz [Gr56, He56, St57]: +Among $n \geq 2$ points in $\mathbb{R}^3$ with all pairwise distances $\leq 1$, the distance $1$ +occurs between at most $2n - 2$ pairs. +-/ +@[category research solved, AMS 52] +theorem erdos_223.variants.d3_upper (A : Finset (EuclideanSpace ℝ (Fin 3))) + (hdiam : ∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) + (hcard : 2 ≤ A.card) : + unitDistNum A ≤ 2 * A.card - 2 := by + sorry + +/-- +Erdős Problem 223 ($d = 3$), tightness: +For every $n \geq 2$, there exist $n$ points in $\mathbb{R}^3$ with diameter $1$ and +exactly $2n - 2$ pairs at distance $1$. +-/ +@[category research solved, AMS 52] +theorem erdos_223.variants.d3_tight (n : ℕ) (hn : 2 ≤ n) : + ∃ A : Finset (EuclideanSpace ℝ (Fin 3)), + A.card = n ∧ + (∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1) ∧ + unitDistNum A = 2 * n - 2 := by + sorry + +end Erdos223 diff --git a/FormalConjectures/ErdosProblems/224.lean b/FormalConjectures/ErdosProblems/224.lean new file mode 100644 index 0000000000..536902ad57 --- /dev/null +++ b/FormalConjectures/ErdosProblems/224.lean @@ -0,0 +1,58 @@ +/- +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 224 + +*Reference:* [erdosproblems.com/224](https://www.erdosproblems.com/224) + +If $A \subseteq \mathbb{R}^d$ is any set of $2^d + 1$ points then some three +points in $A$ determine an obtuse angle. + +## Known results + +- For $d = 2$ this is trivial. +- For $d = 3$ there is an unpublished proof by Kuiper and Boerdijk. +- The general case was proved by Danzer and Grünbaum [DaGr62]. + +[Er57] Erdős, P., _Some unsolved problems_, 1957. + +[Er61, p.244] Erdős, P., _Some unsolved problems_, Magyar Tud. Akad. Mat. Kutató +Int. Közl. 6 (1961), 221–254. + +[DaGr62] Danzer, L. and Grünbaum, B., _Über zwei Probleme bezüglich konvexer +Körper von P. Erdős und von V.L. Klee_, Math. Z. 79 (1962), 95–99. +-/ + +namespace Erdos224 + +/-- +Erdős Problem 224 (Danzer–Grünbaum [DaGr62]): +Any set of at least $2^d + 1$ points in $\mathbb{R}^d$ contains three distinct +points $a$, $b$, $c$ such that the angle at $b$ is obtuse +(i.e., $\langle a - b, c - b \rangle < 0$). +-/ +@[category research solved, AMS 52] +theorem erdos_224 (d : ℕ) (A : Finset (EuclideanSpace ℝ (Fin d))) + (hA : 2 ^ d + 1 ≤ A.card) : + ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, + a ≠ b ∧ b ≠ c ∧ a ≠ c ∧ + @inner ℝ _ _ (a - b) (c - b) < 0 := by + sorry + +end Erdos224 diff --git a/FormalConjectures/ErdosProblems/225.lean b/FormalConjectures/ErdosProblems/225.lean new file mode 100644 index 0000000000..40299eb497 --- /dev/null +++ b/FormalConjectures/ErdosProblems/225.lean @@ -0,0 +1,75 @@ +/- +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 225 + +*Reference:* [erdosproblems.com/225](https://www.erdosproblems.com/225) + +Let $f(\theta) = \sum_{k=0}^{n} c_k e^{ik\theta}$ be a trigonometric polynomial all of whose +roots are real (equivalently, the polynomial $P(z) = \sum c_k z^k$ has all roots on +the unit circle), with $\max_{\theta \in [0,2\pi]} |f(\theta)| = 1$. Then +$\int_0^{2\pi} |f(\theta)| \, d\theta \leq 4$. + +This was proved independently by Kristiansen [Kr74] (for real $c_k$) and +Saff and Sheil-Small [SaSh74] (for complex $c_k$). The original proof of +Kristiansen contained an error which was later fixed in [Kr76]. + +[Er40b, Er57, Er61] Erdős, P., original references. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ (1974), pp. 155–180, +Problem 4.20. + +[Kr74] Kristiansen, G. K., _Proof of an inequality for trigonometric polynomials_. +Proceedings of the American Mathematical Society (1974), pp. 49–57. + +[Kr76] Kristiansen, G. K., _Erratum to 'Proof of a polynomial conjecture'_. +Proceedings of the American Mathematical Society (1976), p. 377. + +[SaSh74] Saff, E. B. and Sheil-Small, T., _Coefficient and integral mean estimates for algebraic +and trigonometric polynomials with restricted zeros_. Journal of the London Mathematical +Society (2) (1974/75), pp. 16–22. +-/ + +open Finset BigOperators MeasureTheory + +namespace Erdos225 + +/-- A trigonometric polynomial: $f(\theta) = \sum_{k=0}^{n} c_k e^{ik\theta}$. -/ +noncomputable def trigPoly (n : ℕ) (c : ℕ → ℂ) (θ : ℝ) : ℂ := + ∑ k ∈ range (n + 1), c k * Complex.exp (↑k * ↑θ * Complex.I) + +/-- +Erdős Problem 225 [Er40b, Er57, Er61, Ha74]: + +If $f(\theta) = \sum_{k=0}^{n} c_k e^{ik\theta}$ is a trigonometric polynomial whose +associated algebraic polynomial $P(z) = \sum c_k z^k$ has all roots on the +unit circle, and $\max_\theta |f(\theta)| = 1$, then +$\int_0^{2\pi} |f(\theta)| \, d\theta \leq 4$. +-/ +@[category research solved, AMS 42] +theorem erdos_225 (n : ℕ) (c : ℕ → ℂ) + (hn : 0 < n) + (hlead : c n ≠ 0) + (hroots : ∀ z : ℂ, (∑ k ∈ range (n + 1), c k * z ^ k) = 0 → ‖z‖ = 1) + (hbound : ∀ θ : ℝ, ‖trigPoly n c θ‖ ≤ 1) + (hattained : ∃ θ : ℝ, ‖trigPoly n c θ‖ = 1) : + ∫ θ in (0 : ℝ)..(2 * Real.pi), ‖trigPoly n c θ‖ ≤ 4 := by + sorry + +end Erdos225 diff --git a/FormalConjectures/ErdosProblems/226.lean b/FormalConjectures/ErdosProblems/226.lean new file mode 100644 index 0000000000..7d31029fe9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/226.lean @@ -0,0 +1,75 @@ +/- +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 226 + +Is there an entire non-linear function $f$ such that, for all $x \in \mathbb{R}$, $x$ is +rational if and only if $f(x)$ is? + +*Reference:* [erdosproblems.com/226](https://www.erdosproblems.com/226) + +[Er57] Erdős, P., _Some unsolved problems_, 1957. + +[BaSc70] Barth, K.F. and Schneider, W.J., _Entire functions mapping countable dense subsets +of the reals onto each other monotonically_, J. London Math. Soc. (2) 2 (1970), 620–626. + +[BaSc71] Barth, K.F. and Schneider, W.J., _Entire functions mapping arbitrary countable +dense sets and their complements onto each other_, J. London Math. Soc. (2) 4 (1971), +482–488. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ (1974), 155–180. +-/ + +namespace Erdos226 + +/-- +Erdős Problem #226 [Er57] — SOLVED + +Is there an entire non-linear function $f$ such that, for all $x \in \mathbb{R}$, $x$ is +rational if and only if $f(x)$ is? + +Solved by Barth and Schneider [BaSc70], who proved that if $A, B \subset \mathbb{R}$ are +countable dense sets then there exists a transcendental entire function $f$ such that +$f(z) \in B$ if and only if $z \in A$. In [BaSc71] they proved the same result for +countable dense subsets of $\mathbb{C}$. +-/ +@[category research solved, AMS 30] +theorem erdos_226 : answer(True) ↔ + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ + (¬∃ a b : ℂ, ∀ z, f z = a * z + b) ∧ + (∀ x : ℝ, (∃ q : ℚ, (q : ℝ) = x) ↔ ∃ q : ℚ, (q : ℂ) = f ↑x) := by + sorry + +/-- +Erdős Problem #226 (general variant) [BaSc70] + +If $A, B \subseteq \mathbb{R}$ are two countable dense sets, does there exist an entire function +such that $f(A) = B$? Barth and Schneider [BaSc70] proved that such an entire function exists +and can be chosen to be transcendental. The main problem `erdos_226` is the special case +$A = B = \mathbb{Q}$. +-/ +@[category research solved, AMS 30] +theorem erdos_226_general (A B : Set ℝ) (hA : A.Countable) (hB : B.Countable) + (hAd : Dense A) (hBd : Dense B) : + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ + (¬∃ a b : ℂ, ∀ z, f z = a * z + b) ∧ + (∀ x : ℝ, x ∈ A ↔ f ↑x ∈ ((↑) : ℝ → ℂ) '' B) := by + sorry + +end Erdos226 diff --git a/FormalConjectures/ErdosProblems/227.lean b/FormalConjectures/ErdosProblems/227.lean new file mode 100644 index 0000000000..b28c9f8eb8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/227.lean @@ -0,0 +1,106 @@ +/- +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 227 + +Let $f = \sum a_n z^n$ be an entire function which is not a polynomial. Is it true that if +the limit of the ratio of the maximum term to the maximum modulus exists, then it must be $0$? +This was disproved by Clunie and Hayman [ClHa64], who showed the limit can take any value +in $[0, 1/2]$. Clunie (unpublished) proved the statement does hold when all coefficients +$a_n \geq 0$. + +See also Problem 513. + +*Reference:* [erdosproblems.com/227](https://www.erdosproblems.com/227) + +[Er57] Erdős, P., _Some unsolved problems_, 1957. +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), 221–254. +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. **27** (1982), 163–176. +[ClHa64] Clunie, J. and Hayman, W. K., _The maximum term of a power series_. +J. Analyse Math. (1964), 143–186. +-/ + +open Complex Filter + +open scoped Topology + +namespace Erdos227 + +/-- +The maximum term of a power series with coefficients $a$ at radius $r$: +$\mu(r) = \sup_n \|a_n\| \cdot r^n$ +-/ +noncomputable def maxTerm (a : ℕ → ℂ) (r : ℝ) : ℝ := + ⨆ n : ℕ, ‖a n‖ * r ^ n + +/-- +The maximum modulus of $f$ on the circle of radius $r$: +$M(r) = \sup\{\|f(z)\| \mid \|z\| = r\}$ +-/ +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} + +/-- +Erdős Problem 227 (Disproved): +Let $f = \sum a_n z^n$ be an entire function which is not a polynomial. Is it true that if +$$\lim_{r \to \infty} \frac{\max_n |a_n| r^n}{\max_{|z|=r} |f(z)|}$$ +exists then it must be $0$? + +This was disproved by Clunie and Hayman [ClHa64], who showed that the limit can take +any value in $[0, 1/2]$. +-/ +@[category research solved, AMS 30] +theorem erdos_227 : answer(False) ↔ + ∀ (f : ℂ → ℂ) (a : ℕ → ℂ), + (∀ z : ℂ, HasSum (fun n => a n * z ^ n) (f z)) → + (∀ N : ℕ, ∃ n, N < n ∧ a n ≠ 0) → + ∀ L : ℝ, Tendsto (fun r => maxTerm a r / maxModulus f r) atTop (𝓝 L) → + L = 0 := by + sorry + +/-- +Clunie (unpublished) proved that when all coefficients are non-negative ($a_n \geq 0$), +the original statement does hold: the limit must be $0$. +-/ +@[category research solved, AMS 30] +theorem erdos_227_nonneg_coefficients : + ∀ (f : ℂ → ℂ) (a : ℕ → ℂ), + (∀ z : ℂ, HasSum (fun n => a n * z ^ n) (f z)) → + (∀ N : ℕ, ∃ n, N < n ∧ a n ≠ 0) → + (∀ n, 0 ≤ (a n).re ∧ (a n).im = 0) → + ∀ L : ℝ, Tendsto (fun r => maxTerm a r / maxModulus f r) atTop (𝓝 L) → + L = 0 := by + sorry + +/-- +Clunie and Hayman [ClHa64] showed that the limit of the ratio of the maximum term to the +maximum modulus can take any value in $[0, 1/2]$. +-/ +@[category research solved, AMS 30] +theorem erdos_227_achievable_values : + ∀ L ∈ Set.Icc (0 : ℝ) (1 / 2), + ∃ (f : ℂ → ℂ) (a : ℕ → ℂ), + (∀ z : ℂ, HasSum (fun n => a n * z ^ n) (f z)) ∧ + (∀ N : ℕ, ∃ n, N < n ∧ a n ≠ 0) ∧ + Tendsto (fun r => maxTerm a r / maxModulus f r) atTop (𝓝 L) := by + sorry + +end Erdos227 diff --git a/FormalConjectures/ErdosProblems/230.lean b/FormalConjectures/ErdosProblems/230.lean new file mode 100644 index 0000000000..1f40a847f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/230.lean @@ -0,0 +1,79 @@ +/- +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 230 + +*Reference:* [erdosproblems.com/230](https://www.erdosproblems.com/230) + +Let $P(z) = \sum_{k=1}^{n} a_k z^k$ with $a_k \in \mathbb{C}$ and $|a_k| = 1$ for all $k$. +Does there exist a constant $c > 0$ such that, for $n \geq 2$, +$$\max_{|z|=1} |P(z)| \geq (1+c)\sqrt{n}?$$ + +The lower bound of $\sqrt{n}$ is trivial from Parseval's theorem. + +DISPROVED: Kahane [Ka80] constructed 'ultraflat' polynomials with unimodular +coefficients such that $|P(z)| = (1+o(1))\sqrt{n}$ uniformly on the unit circle. +Bombieri and Bourgain [BoBo09] later improved the error term. + +[Er57] Erdős, P., _Some unsolved problems_, 1957, p. 297. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), p. 248. + +[Er80h] Erdős, P., 1980, p. 385. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ +(1974), 155–180. (Problem 4.31; described as a conjecture of Erdős and Newman.) + +[Ka80] Kahane, J.-P., _Sur les polynômes à coefficients unimodulaires_. +Bull. London Math. Soc. (1980), 321–342. + +[Ko80] Körner, T. W., _On a polynomial of Byrnes_. Bull. London Math. Soc. +(1980), 219–224. + +[BoBo09] Bombieri, E. and Bourgain, J., _On Kahane's ultraflat polynomials_. +J. Eur. Math. Soc. (JEMS) (2009), 627–703. +-/ + +open Finset BigOperators + +namespace Erdos230 + +/-- +Erdős Problem 230 [Er57, Er61, Er80h] (DISPROVED): + +The original conjecture asked whether there exists $c > 0$ such that every +polynomial $P(z) = \sum_{k=1}^{n} a_k z^k$ with unimodular coefficients +($|a_k| = 1$) satisfies $\max_{|z|=1} |P(z)| \geq (1+c)\sqrt{n}$. + +Kahane [Ka80] disproved this by constructing 'ultraflat' polynomials where +$|P(z)| = (1+o(1))\sqrt{n}$ uniformly on the unit circle. + +The RHS formalizes the original yes/no question; `answer(False)` records that +the answer is negative (disproved by Kahane). +-/ +@[category research solved, AMS 42] +theorem erdos_230 : answer(False) ↔ + ∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 2 ≤ n → + ∀ a : Fin n → ℂ, (∀ k : Fin n, ‖a k‖ = 1) → + ∃ z : ℂ, ‖z‖ = 1 ∧ + (1 + c) * Real.sqrt ↑n ≤ ‖∑ k : Fin n, a k * z ^ (k.val + 1)‖ := by + sorry + +end Erdos230 diff --git a/FormalConjectures/ErdosProblems/231.lean b/FormalConjectures/ErdosProblems/231.lean new file mode 100644 index 0000000000..69a0c88f7e --- /dev/null +++ b/FormalConjectures/ErdosProblems/231.lean @@ -0,0 +1,88 @@ +/- +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 231 + +*Reference:* [erdosproblems.com/231](https://www.erdosproblems.com/231) + +Let $S$ be a string of length $2^k$ formed from an alphabet of $k$ characters. +Must $S$ contain an abelian square: two consecutive blocks $x$ and $y$ such that +$y$ is a permutation of $x$? + +Erdős initially conjectured the answer is yes for all $k \ge 2$, but this was +disproved for $k \ge 4$. Keränen [Ke92] constructed an infinite word over +$\{1,2,3,4\}$ with no abelian square, giving a negative answer for all $k \ge 4$. + +The answer is: +- Yes for $k \le 3$ (any word of length $\ge 7$ over $3$ letters contains an + abelian square) +- No for $k \ge 4$ + +[Er57] Erdős, P., _Some unsolved problems_, 1957. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), 221–254. + +[Ke92] Keränen, V., _Abelian squares are avoidable on 4 letters_. Automata, Languages +and Programming (Vienna, 1992), Lecture Notes in Comput. Sci. 623, Springer (1992), +41–52. + +[FiPu23] Fici, G. and Puzynina, S., _Abelian combinatorics on words: a survey_. +Comput. Sci. Rev. (2023), Paper No. 100532. +-/ + +namespace Erdos231 + +/-- A list contains an abelian square if there exist two consecutive blocks of +equal positive length that are permutations of each other. -/ +def ContainsAbelianSquare {α : Type*} (w : List α) : Prop := + ∃ i n : ℕ, 0 < n ∧ i + 2 * n ≤ w.length ∧ + List.Perm ((w.drop i).take n) ((w.drop (i + n)).take n) + +/-- +Must every string of length $2^k$ over an alphabet of $k \ge 2$ characters +contain an abelian square? The answer is no in general: the conjecture holds for +$k \le 3$ but is disproved by Keränen [Ke92] for $k \ge 4$. +-/ +@[category research solved, AMS 5] +theorem erdos_231 : answer(False) ↔ + ∀ k, 2 ≤ k → ∀ w : List (Fin k), w.length = 2 ^ k → + ContainsAbelianSquare w := by + sorry + +/-- +For $k \le 3$ (with $k \ge 2$), every string of length $2^k$ over $k$ +characters contains an abelian square. +-/ +@[category research solved, AMS 5] +theorem erdos_231.variants.small_alphabet (k : ℕ) (hk : 2 ≤ k) (hk3 : k ≤ 3) + (w : List (Fin k)) (hw : w.length = 2 ^ k) : + ContainsAbelianSquare w := by + sorry + +/-- +For $k \ge 4$, there exists a string of length $2^k$ over $k$ characters with +no abelian square, disproving the original conjecture. See [Ke92]. +-/ +@[category research solved, AMS 5] +theorem erdos_231.variants.large_alphabet (k : ℕ) (hk : 4 ≤ k) : + ∃ w : List (Fin k), w.length = 2 ^ k ∧ ¬ContainsAbelianSquare w := by + sorry + +end Erdos231 diff --git a/FormalConjectures/ErdosProblems/232.lean b/FormalConjectures/ErdosProblems/232.lean new file mode 100644 index 0000000000..98f2a2e96f --- /dev/null +++ b/FormalConjectures/ErdosProblems/232.lean @@ -0,0 +1,82 @@ +/- +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 232 + +*Reference:* [erdosproblems.com/232](https://www.erdosproblems.com/232) + +For $A \subseteq \mathbb{R}^2$ we define the upper density as +$$\bar{\delta}(A) = \limsup_{R\to\infty} \frac{\lambda(A \cap B_R)}{\lambda(B_R)},$$ +where $\lambda$ is the Lebesgue measure and $B_R$ is the ball of radius $R$. + +Estimate $m_1 = \sup \bar{\delta}(A)$, where $A$ ranges over all measurable subsets of +$\mathbb{R}^2$ without two points distance $1$ apart. In particular, is $m_1 \le 1/4$? + +Originally a question of Moser [Mo66]. The trivial upper bound is $m_1 \le 1/2$, +since for any unit vector $u$ the sets $A$ and $A + u$ must be disjoint. +A lower bound of $m_1 \ge \pi/(8\sqrt{3}) \approx 0.2267$ comes from the union of open +circular discs of radius $1/2$ at a regular hexagonal lattice. +Croft [Cr67] gave a small improvement to $m_1 \ge 0.22936$. + +Proved by Ambrus, Csiszárik, Matolcsi, Varga, and Zsámboki [ACMVZ23], +who showed $m_1 \le 0.247 < 1/4$. + +[Mo66] Moser, L., *Problem 10*, Canad. Math. Bull. 9 (1966). + +[Er85] Erdős, P., *Problems and results in combinatorial geometry*, 1985, p. 4. + +[Cr67] Croft, H. T., *Incidence incidents*, Eureka (1967), 22–26. + +[ACMVZ23] Ambrus, G., Csiszárik, A., Matolcsi, M., Varga, D., and Zsámboki, P., +*The density of planar sets avoiding unit distances*, 2023. +-/ + +open MeasureTheory Metric + +namespace Erdos232 + +/-- A set in a metric space is *unit-distance-free* if no two points in the set +are exactly distance $1$ apart. -/ +def IsUnitDistanceFree {X : Type*} [PseudoMetricSpace X] (A : Set X) : Prop := + ∀ x ∈ A, ∀ y ∈ A, dist x y ≠ 1 + +/-- +Erdős Problem 232 [Er85, p.4] (PROVED): + +For every measurable unit-distance-free set $A \subseteq \mathbb{R}^2$, the upper density +$$\limsup_{R\to\infty} \frac{\lambda(A \cap B_R)}{\lambda(B_R)} \le \frac{1}{4}.$$ + +Formalized as: for every $\varepsilon > 0$, for all sufficiently large $R$, the density +ratio $\lambda(A \cap B_R) / \lambda(B_R) \le 1/4 + \varepsilon$. This is equivalent to the +$\limsup$ being at most $1/4$. + +Proved by Ambrus–Csiszárik–Matolcsi–Varga–Zsámboki [ACMVZ23] who showed +the stronger bound $m_1 \le 0.247$. +-/ +@[category research solved, AMS 28 52] +theorem erdos_232 : answer(True) ↔ + ∀ (A : Set (EuclideanSpace ℝ (Fin 2))), + MeasurableSet A → IsUnitDistanceFree A → + ∀ ε : ℝ, 0 < ε → + ∃ R₀ : ℝ, 0 < R₀ ∧ ∀ R : ℝ, R₀ ≤ R → + (volume (A ∩ Metric.ball (0 : EuclideanSpace ℝ (Fin 2)) R)).toReal / + (volume (Metric.ball (0 : EuclideanSpace ℝ (Fin 2)) R)).toReal ≤ 1 / 4 + ε := by + sorry + +end Erdos232 diff --git a/FormalConjectures/ErdosProblems/235.lean b/FormalConjectures/ErdosProblems/235.lean new file mode 100644 index 0000000000..792767960d --- /dev/null +++ b/FormalConjectures/ErdosProblems/235.lean @@ -0,0 +1,97 @@ +/- +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 235 + +*Reference:* [erdosproblems.com/235](https://www.erdosproblems.com/235) + +Let $N_k = p_1 \cdots p_k$ be the $k$-th primorial and let $a_1 < \cdots < a_{\varphi(N_k)}$ +be the integers less than $N_k$ coprime to $N_k$. Erdős conjectured that the fraction of +consecutive gaps $a_{i+1} - a_i \le c \cdot N_k / \varphi(N_k)$ tends to a limit that is a +continuous function of $c$. This was proved by Hooley. + +See also Problem 234, which is a more difficult variant using actual primes instead of primorials. + +[Er55c] Erdős, P., _Some problems on number theory_ (1955). + +[Ho65] Hooley, C., _On the difference between consecutive numbers prime to n. II_. +Publ. Math. Debrecen (1965), 39–49. +-/ + +open Filter Nat Classical + +open scoped BigOperators + +namespace Erdos235 + +/-- The $k$-th primorial: product of the first $k$ primes ($p_1 \cdot p_2 \cdots p_k$). -/ +noncomputable def primorial (k : ℕ) : ℕ := ∏ i ∈ Finset.range k, nth Nat.Prime i + +/-- The sorted list of natural numbers less than $n$ that are coprime to $n$. -/ +def sortedTotatives (n : ℕ) : List ℕ := + ((Finset.range n).filter (fun a => Nat.Coprime a n)).sort (· ≤ ·) + +/-- Count consecutive gaps $\le$ threshold in a sorted list of naturals. -/ +noncomputable def countSmallGaps : List ℕ → ℝ → ℕ + | [], _ => 0 + | [_], _ => 0 + | a :: b :: rest, threshold => + (if ((b : ℝ) - (a : ℝ)) ≤ threshold then 1 else 0) + countSmallGaps (b :: rest) threshold + +/-- The fraction of consecutive gaps among reduced residues $\bmod N_k$ +that are at most $c \cdot N_k / \varphi(N_k)$. -/ +noncomputable def gapFraction (k : ℕ) (c : ℝ) : ℝ := + let Nk := primorial k + let residues := sortedTotatives Nk + let threshold := c * (Nk : ℝ) / (Nat.totient Nk : ℝ) + (countSmallGaps residues threshold : ℝ) / (Nat.totient Nk : ℝ) + +/-- +Erdős Problem 235 [Er55c] (proved by Hooley [Ho65]): + +Let $N_k = 2 \cdot 3 \cdots p_k$ (the $k$-th primorial) and let +$a_1 < a_2 < \cdots < a_{\varphi(N_k)}$ be the integers less than $N_k$ coprime to $N_k$. +Then for any $c \ge 0$, the limit +$$ +\lim_{k \to \infty} \frac{\#\{i : a_i - a_{i-1} \le c \cdot N_k / \varphi(N_k)\}}{\varphi(N_k)} +$$ +exists and defines a continuous function of $c$. + +Hooley proved that the limiting distribution is exponential: $f(c) = 1 - e^{-c}$. +-/ +@[category research solved, AMS 11] +theorem erdos_235 : + ∃ f : ℝ → ℝ, Continuous f ∧ + ∀ c : ℝ, 0 ≤ c → + Tendsto (fun k => gapFraction k c) atTop (nhds (f c)) := by + sorry + +/-- +Hooley's stronger result [Ho65] for Erdős Problem 235: the limiting distribution of +normalized gaps between consecutive integers coprime to the $k$-th primorial is +exponential, i.e., $f(c) = 1 - e^{-c}$. This implies `erdos_235` since +$c \mapsto 1 - e^{-c}$ is continuous. +-/ +@[category research solved, AMS 11] +theorem erdos_235_hooley : + ∀ c : ℝ, 0 ≤ c → + Tendsto (fun k => gapFraction k c) atTop (nhds (1 - Real.exp (-c))) := by + sorry + +end Erdos235 diff --git a/FormalConjectures/ErdosProblems/237.lean b/FormalConjectures/ErdosProblems/237.lean new file mode 100644 index 0000000000..79994986dc --- /dev/null +++ b/FormalConjectures/ErdosProblems/237.lean @@ -0,0 +1,89 @@ +/- +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 237 + +*Reference:* [erdosproblems.com/237](https://www.erdosproblems.com/237) + +Let $A \subseteq \mathbb{N}$ be a set such that $|A \cap \{1, \ldots, N\}| \gg \log N$ for all large $N$. +Let $f(n)$ count the number of solutions to $n = p + a$ for $p$ prime and $a \in A$. +Is it true that $\limsup f(n) = \infty$? + +The answer is yes, as proved by Chen and Ding [ChDi22]. In fact, the +assumption $|A \cap \{1, \ldots, N\}| \gg \log N$ can be replaced with just the assumption +that $A$ is infinite. Erdős [Er50] had proved the result when $A = \{2^k : k \geq 0\}$. + +[Er50] Erdős, P., _On integers of the form $2^k + p$ and some related problems_. Summa Brasil. +Math. **2** (1950), 113–123. + +[Er55c] Erdős, P., _Some problems on number theory_ (1955). + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[ChDi22] Chen, Y.-G. and Ding, Y., _On a conjecture of Erdős_. arXiv:2201.10727 (2022). +-/ + +open Set Real + +namespace Erdos237 + +/-- The number of representations of $n$ as $p + a$ where $p$ is prime and $a \in A$. -/ +noncomputable def countRepresentations (A : Set ℕ) (n : ℕ) : ℕ := + Set.ncard {p : ℕ | Nat.Prime p ∧ p ≤ n ∧ (n - p) ∈ A} + +/-- The counting function $|A \cap \{1, \ldots, N\}|$. -/ +noncomputable def countingFunction (A : Set ℕ) (N : ℕ) : ℕ := + Set.ncard (A ∩ Set.Icc 1 N) + +/-- +Erdős Problem 237 [Er50, Er55c, Er61, Er73] (proved by Chen–Ding [ChDi22]): + +Let $A \subseteq \mathbb{N}$ with $|A \cap \{1, \ldots, N\}| \geq c \cdot \log N$ for some $c > 0$ and all +sufficiently large $N$. Let $f(n) = \#\{p \text{ prime} : n - p \in A\}$ count the +representations of $n$ as prime + element of $A$. Then $\limsup f(n) = \infty$, +i.e., for every $M$ there exist arbitrarily large $n$ with $f(n) \geq M$. + +The conclusion is an unrolled form of $\limsup_{n \to \infty} f(n) = \infty$, +avoiding `Filter` machinery. +-/ +@[category research solved, AMS 11] +theorem erdos_237 : answer(True) ↔ + (∀ A : Set ℕ, + (∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (countingFunction A N : ℝ) ≥ c * Real.log (N : ℝ)) → + ∀ M : ℕ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ countRepresentations A n ≥ M) := by + sorry + +/-- +Stronger form of Erdős Problem 237, proved by Chen–Ding [ChDi22]: + +The growth hypothesis $|A \cap \{1, \ldots, N\}| \gg \log N$ can be weakened to +just requiring that $A$ is infinite. Then $\limsup f(n) = \infty$ still holds. +-/ +@[category research solved, AMS 11] +theorem erdos_237_strong : + (∀ A : Set ℕ, A.Infinite → + ∀ M : ℕ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ countRepresentations A n ≥ M) := by + sorry + +end Erdos237 diff --git a/FormalConjectures/ErdosProblems/24.lean b/FormalConjectures/ErdosProblems/24.lean new file mode 100644 index 0000000000..68af358331 --- /dev/null +++ b/FormalConjectures/ErdosProblems/24.lean @@ -0,0 +1,74 @@ +/- +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 24 + +*Reference:* [erdosproblems.com/24](https://www.erdosproblems.com/24) + +Every triangle-free graph on $5n$ vertices contains at most $n^5$ copies of $C_5$. +Proved independently by Grzesik [Gr12] and by Hatami, Hladký, Král, Norine, and +Razborov [HHKNR13]. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[Er92b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) **47** (1992), 231-240. + +[Er97b] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). + +[Er97f] Erdős, P., _Some unsolved problems_. Combinatorics, geometry and probability +(Cambridge, 1993) (1997), 1-10. + +[Gr12] Grzesik, A., _On the maximum number of five-cycles in a triangle-free graph_. +Journal of Combinatorial Theory, Series B (2012), 1061-1066. + +[HHKNR13] Hatami, H., Hladký, J., Král, D., Norine, S., and Razborov, A., +_On the number of pentagons in triangle-free graphs_. +Journal of Combinatorial Theory, Series A (2013), 722-732. +-/ + +open SimpleGraph Finset + +namespace Erdos24 + +/-- +Every triangle-free graph on $5n$ vertices contains at most $n^5$ copies of $C_5$. + +We count labeled $5$-cycles: injective functions $f : \text{Fin}\,5 \to \text{Fin}(5n)$ such +that $f(i)$ is adjacent to $f(i+1 \bmod 5)$ for all $i$. Each unordered $C_5$ yields exactly +$10$ labeled $5$-cycles ($5$ rotations $\times$ $2$ reflections), so the labeled count bound +is $10 \cdot n^5$. + +Proved independently by Grzesik [Gr12] and by Hatami, Hladký, Král, Norine, and +Razborov [HHKNR13]. +-/ +@[category research solved, AMS 5] +theorem erdos_24 : + ∀ (n : ℕ) (G : SimpleGraph (Fin (5 * n))) (h : DecidableRel G.Adj), + haveI := h + G.CliqueFree 3 → + (Finset.univ.filter (fun (f : Fin 5 → Fin (5 * n)) => + Function.Injective f ∧ + ∀ i : Fin 5, G.Adj (f i) (f (i + 1)))).card + ≤ 10 * n ^ 5 := by + sorry + +end Erdos24 diff --git a/FormalConjectures/ErdosProblems/240.lean b/FormalConjectures/ErdosProblems/240.lean new file mode 100644 index 0000000000..e0baa40025 --- /dev/null +++ b/FormalConjectures/ErdosProblems/240.lean @@ -0,0 +1,90 @@ +/- +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 240 + +*Reference:* [erdosproblems.com/240](https://www.erdosproblems.com/240) + +Is there an infinite set of primes $P$ such that if $\{a_1 < a_2 < \cdots\}$ is the set of +positive integers divisible only by primes in $P$, then $\lim(a_{i+1} - a_i) = \infty$? + +Originally asked to Erdős by Wintner. The answer is yes for finite sets of primes, +which follows from a theorem of Pólya [Po18]. + +Tijdeman [Ti73] resolved this question, proving that for any $\varepsilon > 0$, there exists +an infinite set of primes $P$ such that $a_{i+1} - a_i \gg a_i^{1-\varepsilon}$. + +See also: Problem 368. + +[Er61,p.226] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. **8** (1965), +221–232. + +[Po18] Pólya, G., _Zur arithmetischen Untersuchung der Polynome_. Math. Z. (1918), 143–148. + +[Ti73] Tijdeman, R., _On integers with many small prime factors_. Compositio Math. (1973), +319–330. +-/ + +namespace Erdos240 + +/-- The set of positive integers all of whose prime factors lie in $P$. -/ +def smoothNumbers (P : Set ℕ) : Set ℕ := + {n : ℕ | 0 < n ∧ ∀ q : ℕ, Nat.Prime q → q ∣ n → q ∈ P} + +/-- +Erdős Problem 240 [Er61,p.226][Er65b]: +There exists an infinite set of primes $P$ such that if $\{a_1 < a_2 < \cdots\}$ is the +set of positive integers divisible only by primes in $P$ (the $P$-smooth numbers), +then the consecutive gaps $a_{i+1} - a_i$ tend to infinity. + +Equivalently: for every bound $B$, only finitely many $P$-smooth numbers $n$ have +another $P$-smooth number within distance $B$ above them. + +Proved by Tijdeman [Ti73]. +-/ +@[category research solved, AMS 11] +theorem erdos_240 : + answer(True) ↔ + ∃ P : Set ℕ, Set.Infinite P ∧ (∀ p ∈ P, Nat.Prime p) ∧ + ∀ B : ℕ, Set.Finite {n : ℕ | n ∈ smoothNumbers P ∧ + ∃ m ∈ smoothNumbers P, n < m ∧ m ≤ n + B} := by + sorry + +/-- +Tijdeman's quantitative strengthening of Erdős Problem 240 [Ti73]: +For any $\varepsilon > 0$, there exists an infinite set of primes $P$ such that the +consecutive gaps of $P$-smooth numbers satisfy $a_{i+1} - a_i \gg a_i^{1-\varepsilon}$. + +That is, there exists a constant $c > 0$ such that for all sufficiently large +$P$-smooth numbers $n$, the next $P$-smooth number after $n$ is at least +$n + c \cdot n^{1-\varepsilon}$. +-/ +@[category research solved, AMS 11] +theorem erdos_240_tijdeman_quantitative : + ∀ ε : ℝ, ε > 0 → + ∃ P : Set ℕ, Set.Infinite P ∧ (∀ p ∈ P, Nat.Prime p) ∧ + ∃ c : ℝ, c > 0 ∧ ∀ᶠ n in Filter.atTop, + n ∈ smoothNumbers P → + ∀ m ∈ smoothNumbers P, n < m → c * (n : ℝ) ^ (1 - ε) ≤ (m - n : ℝ) := by + sorry + +end Erdos240 diff --git a/FormalConjectures/ErdosProblems/241.lean b/FormalConjectures/ErdosProblems/241.lean index 79d4913b16..728c376134 100644 --- a/FormalConjectures/ErdosProblems/241.lean +++ b/FormalConjectures/ErdosProblems/241.lean @@ -26,6 +26,7 @@ import FormalConjectures.Util.ProblemImports Helv. (1962/63), 141-147. - [Gr01] Green, Ben, The number of squares and {$B_h[g]$} sets. Acta Arith. (2001), 365-390. - [Gu04] Guy, Richard K., Unsolved problems in number theory. (2004), xviii+437. +- OEIS sequence [A387704](https://oeis.org/A387704). -/ open Filter Finset @@ -40,7 +41,7 @@ $a,b,c\in A$ are all distinct (aside from the trivial coincidences). Formalization note: this is generalized to allow for different $r$. -/ noncomputable def f (N r : ℕ) : ℕ := - letI candidates := (Icc 1 N).powerset.filter (fun A ↦ + let candidates := (Icc 1 N).powerset.filter (fun A ↦ ∀ m₁ m₂ : Multiset ℕ, m₁.card = r → m₂.card = r → (∀ x ∈ m₁, x ∈ A) → (∀ x ∈ m₂, x ∈ A) → @@ -96,6 +97,9 @@ theorem erdos_241.variants.generalization (r : ℕ) (hr : r ≥ 2) : BoseChowla /-- This is known only for $r=2$ (see [erdosproblems.com/30]). + +Note: at $r=2$, `f N 2` coincides with `Finset.maxSidonSubsetCard (Finset.Icc 1 N)` from the +Sidon set infrastructure in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`. -/ @[category research solved, AMS 5] theorem erdos_241.variants.r_eq_2 : diff --git a/FormalConjectures/ErdosProblems/246.lean b/FormalConjectures/ErdosProblems/246.lean new file mode 100644 index 0000000000..8d519dd26d --- /dev/null +++ b/FormalConjectures/ErdosProblems/246.lean @@ -0,0 +1,65 @@ +/- +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.NumberTheory.AdditivelyComplete + +/-! +# Erdős Problem 246 + +*Reference:* [erdosproblems.com/246](https://www.erdosproblems.com/246) + +Let $a, b \geq 2$ with $\gcd(a, b) = 1$. Then the set of all numbers of the form +$a^k \cdot b^\ell$ (with $k, \ell \geq 0$) is complete: every sufficiently large positive +integer can be written as a sum of distinct elements of this set. + +[Er61] Erdős, P. + +[Bi59] Birch, B. J., _Note on a problem of Erdős_. Proc. Cambridge Philos. Soc. (1959), 370–373. + +[Ca60] Cassels, J. W. S., _On the representation of integers as the sums of distinct summands +taken from a fixed set_. Acta Sci. Math. (Szeged) (1960), 111–124. + +[He00b] Hegyvári, N., _On the completeness of an exponential type sequence_. Acta Math. Hungar. +(2000), 127–135. + +[FaCh17] Fang, J.-H., Chen, Y.-G., _A quantitative form of the Erdős–Birch theorem_. Acta Arith. +(2017), 301–311. + +[Yu24] Yu, W.-X., _On the representation of an exponential type sequence_. Publ. Math. Debrecen +(2024), 253–261. +-/ + +namespace Erdos246 + +/-- The set of all natural numbers of the form $a^k \cdot b^\ell$ for $k, \ell \geq 0$. -/ +def powerProductSet (a b : ℕ) : Set ℕ := + {n : ℕ | ∃ k l : ℕ, n = a ^ k * b ^ l} + +/-- +Erdős Problem 246 [Er61] (proved by Birch [Bi59]): +Let $a, b \geq 2$ with $\gcd(a, b) = 1$. Then every sufficiently large positive integer +is the sum of distinct integers of the form $a^k \cdot b^\ell$ with $k, \ell \geq 0$. + +This also follows from a later more general result of Cassels [Ca60] (see Problem 254). +-/ +@[category research solved, AMS 5 11] +theorem erdos_246 : + ∀ a b : ℕ, 2 ≤ a → 2 ≤ b → Nat.Coprime a b → + IsAddComplete (powerProductSet a b) := by + sorry + +end Erdos246 diff --git a/FormalConjectures/ErdosProblems/254.lean b/FormalConjectures/ErdosProblems/254.lean new file mode 100644 index 0000000000..1aa3c79c4c --- /dev/null +++ b/FormalConjectures/ErdosProblems/254.lean @@ -0,0 +1,75 @@ +/- +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.NumberTheory.AdditivelyComplete + +/-! +# Erdős Problem 254 + +If $A \subseteq \mathbb{N}$ satisfies $|A \cap [1, 2x]| - |A \cap [1, x]| \to \infty$ and +$\sum_{n \in A} \|n\theta\| = \infty$ for every irrational $\theta$, then every sufficiently large +integer is the sum of distinct elements of $A$. + +The original problem states the divergence condition for every irrational $\theta$, but the +formalization quantifies over all $\theta \in (0,1)$. This is equivalent given the growth +hypothesis, since for rational $\theta = p/q$ in lowest terms, the growth condition forces $A$ to +contain unboundedly many elements not divisible by $q$, making the sum diverge automatically. + +*Reference:* [erdosproblems.com/254](https://www.erdosproblems.com/254) + +[Er61] Erdős, P., _Some unsolved problems_, Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961), +6, 221-254. + +[Ca60] Cassels, J. W. S., _On the representation of integers as the sums of distinct summands +taken from a fixed set_. Acta Sci. Math. (Szeged) (1960), 111–124. +-/ + +open Set Filter BigOperators Classical + +namespace Erdos254 + +/-- The distance of a real number $x$ from the nearest integer. -/ +noncomputable def distNearestInt (x : ℝ) : ℝ := + min (Int.fract x) (1 - Int.fract x) + +/-- +Erdős Problem #254 [Er61]: +Let $A \subseteq \mathbb{N}$ be such that +$|A \cap [1, 2x]| - |A \cap [1, x]| \to \infty$ as $x \to \infty$, and +$\sum_{n \in A} \|n\theta\| = \infty$ for every $\theta \in (0,1)$, where $\|x\|$ denotes the +distance of $x$ from the nearest integer. Then $A$ is additively complete, i.e., every sufficiently +large integer is the sum of distinct elements of $A$. + +Cassels [Ca60] proved this under the stronger conditions that +$(|A \cap [1,2x]| - |A \cap [1,x]|) / \log\log x \to \infty$ and +$\sum_{n \in A} \|n\theta\|^2 = \infty$. + +Note: The original problem states the divergence condition for every irrational $\theta$, but the +formalization quantifies over all $\theta \in (0,1)$. These are equivalent given `hgrowth`. +-/ +@[category research open, AMS 11] +theorem erdos_254 + (A : Set ℕ) + (hgrowth : Tendsto + (fun x : ℕ => Set.ncard (A ∩ Set.Icc 1 (2 * x)) - Set.ncard (A ∩ Set.Icc 1 x)) + atTop atTop) + (hsum : ∀ θ : ℝ, 0 < θ → θ < 1 → + ¬ Summable (fun n : ℕ => if n ∈ A then distNearestInt (θ * (n : ℝ)) else 0)) : + IsAddComplete A := by + sorry + +end Erdos254 diff --git a/FormalConjectures/ErdosProblems/255.lean b/FormalConjectures/ErdosProblems/255.lean new file mode 100644 index 0000000000..adc04918dc --- /dev/null +++ b/FormalConjectures/ErdosProblems/255.lean @@ -0,0 +1,92 @@ +/- +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 255 + +For any infinite sequence in [0,1], must there exist a sub-interval whose discrepancy is +unbounded? + +*Reference:* [erdosproblems.com/255](https://www.erdosproblems.com/255) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), 221–254. + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[Sc68] Schmidt, W.M., _Irregularities of distribution_. Quart. J. Math. Oxford Ser. (2) +(1968), 181–191. + +[Sc72] Schmidt, W.M., _Irregularities of distribution. VI_. Compositio Math. +(1972), 63–74. + +[TiWa80] Tijdeman, R., Wagner, G., _A sequence has almost nowhere small discrepancy_. +Monatsh. Math. (1980), 315–329. +-/ + +open Finset Classical + +namespace Erdos255 + +/-- +The discrepancy of a sequence $z : \mathbb{N} \to \mathbb{R}$ at length $N$ with respect to +a sub-interval $[a, b] \subseteq [0, 1]$: +$$D_N([a,b]) = \#\{n < N : z(n) \in [a, b]\} - N \cdot (b - a)$$ +-/ +noncomputable def discrepancy (z : ℕ → ℝ) (a b : ℝ) (N : ℕ) : ℝ := + (((range N).filter (fun n => a ≤ z n ∧ z n ≤ b)).card : ℝ) - (N : ℝ) * (b - a) + +/-- +Erdős Problem #255 (proved by Schmidt [Sc68]): + +Let $z_1, z_2, \ldots \in [0,1]$ be an infinite sequence. Define the discrepancy +$$D_N(I) = \#\{n < N : z_n \in I\} - N \cdot |I|.$$ +Then there must exist some interval $I \subseteq [0,1]$ such that +$$\limsup_{N \to \infty} |D_N(I)| = \infty.$$ + +Equivalently: for any sequence in $[0,1]$, there exists a sub-interval +$[a,b] \subseteq [0,1]$ such that $|D_N([a,b])|$ is unbounded as $N \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_255 : answer(True) ↔ + ∀ z : ℕ → ℝ, + (∀ n, 0 ≤ z n ∧ z n ≤ 1) → + ∃ a b : ℝ, 0 ≤ a ∧ a ≤ b ∧ b ≤ 1 ∧ + ∀ M : ℝ, ∃ N : ℕ, |discrepancy z a b N| ≥ M := by + sorry + +/-- +Schmidt's 1972 strengthening [Sc72] of Erdős Problem #255: + +For any sequence $z_1, z_2, \ldots \in [0,1]$, all but countably many $x \in [0,1]$ satisfy +$$\limsup_{N \to \infty} |D_N([0, x])| = \infty.$$ + +This is much stronger than `erdos_255`: it shows that the "bad" intervals witnessing +unbounded discrepancy can always be taken to be of the form $[0, x]$, and almost all +such intervals work. +-/ +@[category research solved, AMS 11] +theorem erdos_255_schmidt : answer(True) ↔ + ∀ z : ℕ → ℝ, + (∀ n, 0 ≤ z n ∧ z n ≤ 1) → + Set.Countable {x : ℝ | 0 ≤ x ∧ x ≤ 1 ∧ + ¬∀ M : ℝ, ∃ N : ℕ, |discrepancy z 0 x N| ≥ M} := by + sorry + +end Erdos255 diff --git a/FormalConjectures/ErdosProblems/256.lean b/FormalConjectures/ErdosProblems/256.lean new file mode 100644 index 0000000000..de00c02246 --- /dev/null +++ b/FormalConjectures/ErdosProblems/256.lean @@ -0,0 +1,123 @@ +/- +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 256 + +*Reference:* [erdosproblems.com/256](https://www.erdosproblems.com/256) + +Let $n \geq 1$ and $f(n)$ be maximal such that for any integers +$1 \leq a_1 \leq \cdots \leq a_n$, +$$\max_{|z|=1} \left|\prod_i (1 - z^{a_i})\right| \geq f(n).$$ + +Equivalently, $f(n)$ is the infimum over all non-decreasing sequences of positive +integers $(a_1, \ldots, a_n)$ of the supremum of $\left|\prod_i (1 - z^{a_i})\right|$ over the +unit circle. + +Erdős conjectured that there exists $c > 0$ such that $\log f(n) \gg n^c$ [Er61, Er64b]. + +This specific conjecture was answered negatively by Belov and Konyagin [BeKo96], +who proved that $\log f(n) \ll (\log n)^4$. The broader problem of precisely +estimating $f(n)$ remains open. + +Related to the Chowla cosine problem (Erdős Problem #510). + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), 221–254. + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[ErSz59] Erdős, P., Szekeres, G., _On the product $\prod_{k=1}^{n}(1-z^{a_k})$_. +Académie Serbe des Sciences, Institut de Mathématiques (1959), 29–34. + +[At61] Atkinson, F. V., _On a problem of Erdős and Szekeres_. Canadian +Mathematical Bulletin (1961), 7–12. + +[Od82] Odlyzko, A. M., _Minima of cosine sums and maxima of polynomials on the +unit circle_. Journal of the London Mathematical Society (Series 2) (1982), 412–420. + +[BeKo96] Belov, A. S., Konyagin, S. V., _An estimate for the free term of a +nonnegative trigonometric polynomial with integer coefficients_. Matematicheskie +Zametki (Mathematical Notes) (1996), 627–629. + +[BoCh18] Bourgain, J., Chang, M.-C., _On a paper of Erdős and Szekeres_. +Journal d'Analyse Mathématique (2018), 253–271. +-/ + +open Complex BigOperators Finset + +namespace Erdos256 + +/-- The supremum of $\left|\prod_i (1 - z^{a_i})\right|$ as $z$ ranges over the unit circle, +for a fixed sequence of exponents $a$. -/ +noncomputable def unitCircleMaxProd (n : ℕ) (a : Fin n → ℕ) : ℝ := + sSup {y : ℝ | ∃ z : ℂ, ‖z‖ = 1 ∧ + y = ‖∏ i : Fin n, (1 - z ^ (a i))‖} + +/-- $f(n)$ is the infimum over all non-decreasing sequences of positive integers +$(a_1, \ldots, a_n)$ of the supremum of $\left|\prod_i (1 - z^{a_i})\right|$ on the unit +circle. Equivalently, $f(n)$ is the largest real number such that for any positive +integers $1 \leq a_1 \leq \cdots \leq a_n$, the maximum of +$\left|\prod_i (1 - z^{a_i})\right|$ on the unit circle is at least $f(n)$. -/ +noncomputable def erdos256_f (n : ℕ) : ℝ := + sInf {y : ℝ | ∃ (a : Fin n → ℕ), + (∀ i, 0 < a i) ∧ Monotone a ∧ + y = unitCircleMaxProd n a} + +/-- +Erdős Conjecture (Problem 256) [Er61, Er64b]: + +Does there exist a constant $c > 0$ such that $\log f(n) \gg n^c$, i.e., do there exist +constants $c > 0$ and $C > 0$ such that for all sufficiently large $n$, +$$\log f(n) \geq C \cdot n^c?$$ + +This was answered negatively by Belov and Konyagin [BeKo96], who showed +$\log f(n) \ll (\log n)^4$. +-/ +@[category research solved, AMS 11 30] +theorem erdos_256 : answer(False) ↔ + ∃ c : ℝ, 0 < c ∧ + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + Real.log (erdos256_f n) ≥ C * (n : ℝ) ^ c := by + sorry + +/-- $f^*(n)$ is the variant of $f(n)$ where the exponents are required to be strictly +increasing ($a_1 < \cdots < a_n$) rather than non-decreasing. Bourgain and Chang [BoCh18] +proved $\log f^*(n) \ll (n \log n)^{1/2} \log \log n$. -/ +noncomputable def erdos256_fStar (n : ℕ) : ℝ := + sInf {y : ℝ | ∃ (a : Fin n → ℕ), + (∀ i, 0 < a i) ∧ StrictMono a ∧ + y = unitCircleMaxProd n a} + +/-- +Variant of Erdős Problem 256 with strictly increasing exponents: + +Bourgain and Chang [BoCh18] proved that $\log f^*(n) \ll (n \log n)^{1/2} \log \log n$, +where $f^*(n)$ is defined as $f(n)$ but with the exponents required to be strictly +increasing rather than non-decreasing. +-/ +@[category research open, AMS 11 30] +theorem erdos_256_strict : ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + Real.log (erdos256_fStar n) ≤ + C * ((n : ℝ) * Real.log n) ^ (1/2 : ℝ) * Real.log (Real.log n) := by + sorry + +end Erdos256 diff --git a/FormalConjectures/ErdosProblems/260.lean b/FormalConjectures/ErdosProblems/260.lean new file mode 100644 index 0000000000..a0e4086e3d --- /dev/null +++ b/FormalConjectures/ErdosProblems/260.lean @@ -0,0 +1,76 @@ +/- +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.Analysis.HasGaps + +/-! +# Erdős Problem 260 + +Let $a_1 < a_2 < \cdots$ be a strictly increasing sequence of natural numbers with +$a_n / n \to \infty$. Is $\sum a_n / 2^{a_n}$ necessarily irrational? + +Erdős proved irrationality under the stronger condition $a_{n+1} - a_n \to \infty$, and also +under $a_n \gg n\sqrt{\log n \log\log n}$. Erdős and Graham speculated that the weaker condition +$\limsup (a_{n+1} - a_n) = \infty$ alone is insufficient, but no counterexample is known. + +*Reference:* [erdosproblems.com/260](https://www.erdosproblems.com/260) + +[Er74b] Erdős, P., *Problems and results on combinatorial number theory III*. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er81h] Erdős, P., *Some problems and results in number theory*. + +[Er81l] Erdős, P., *Sur l'irrationalité d'une certaine série*. C. R. Acad. Sci. Paris +Sér. I Math. (1981), 765–768. + +[Er88c] Erdős, P., *Problems and results on combinatorial number theory*. + +[Va99] *Some of Paul's favorite problems*. Booklet for the conference "Paul Erdős and +his mathematics," Budapest (1999), §1.33. +-/ + +open Filter + +namespace Erdos260 + +/-- +Erdős Problem 260 [Er74b, ErGr80, Er81h, Er81l, Er88c, Va99]: +Let $a_1 < a_2 < \cdots$ be a strictly increasing sequence of natural numbers such +that $a_n / n \to \infty$ (i.e., having Fabry gaps). Is $\sum_n a_n / 2^{a_n}$ irrational? +-/ +@[category research open, AMS 11] +theorem erdos_260 : answer(sorry) ↔ + ∀ a : ℕ → ℕ, + HasFabryGaps a → + Irrational (∑' n, (a n : ℝ) / (2 : ℝ) ^ (a n)) := by + sorry + +/-- +Erdős proved that if $a_1 < a_2 < \cdots$ is a strictly increasing sequence of natural +numbers with $a_{n+1} - a_n \to \infty$, then $\sum a_n / 2^{a_n}$ is irrational. +This is a stronger hypothesis than the Fabry gap condition $a_n / n \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_260_consecutive_gaps_diverge : + ∀ a : ℕ → ℕ, StrictMono a → + Tendsto (fun n => (a (n + 1) : ℝ) - (a n : ℝ)) atTop atTop → + Irrational (∑' n, (a n : ℝ) / (2 : ℝ) ^ (a n)) := by + sorry + +end Erdos260 diff --git a/FormalConjectures/ErdosProblems/261.lean b/FormalConjectures/ErdosProblems/261.lean new file mode 100644 index 0000000000..39c225783d --- /dev/null +++ b/FormalConjectures/ErdosProblems/261.lean @@ -0,0 +1,84 @@ +/- +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 261 + +*Reference:* [erdosproblems.com/261](https://www.erdosproblems.com/261) + +[Er74b] Erdős, P., *Problems and results on combinatorial number theory III*. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. + +[Er88c] Erdős, P., *Problems and results on combinatorial number theory*. + +[BoLo90] Borwein, D. and Loring, T., *Some questions of Erdős and Graham on numbers +of the form $\sum g_n / 2^{g_n}$*. + +[TUZ20] Tengely, Sz., Ulas, M., and Zygadło, J., *On a Diophantine equation of Erdős +and Graham*. J. Number Theory (2020), 445–459. +-/ + +open scoped BigOperators + +namespace Erdos261 + +/-- A positive integer $n$ has the Erdős-261 property if $n/2^n$ can be written as +a finite sum $\sum_{a \in S} a/2^a$ for some set $S$ of at least 2 distinct positive +integers. -/ +def HasErdos261Property (n : ℕ) : Prop := + ∃ S : Finset ℕ, 2 ≤ S.card ∧ (∀ a ∈ S, 0 < a) ∧ + (n : ℝ) / (2 : ℝ) ^ n = ∑ a ∈ S, (a : ℝ) / (2 : ℝ) ^ a + +/-- +Erdős Problem 261 [Er74b, ErGr80, Er88c]: +Is it true for all positive integers $n$ that $n/2^n$ can be written as a finite +sum of at least 2 distinct terms $a/2^a$? +-/ +@[category research open, AMS 11] +theorem erdos_261 : answer(sorry) ↔ ∀ n : ℕ, 0 < n → HasErdos261Property n := by + sorry + +/-- +Erdős Problem 261, weaker variant [Er74b, ErGr80, Er88c]: +Are there infinitely many $n$ such that there exists some $t \geq 2$ and distinct +integers $a_1, \ldots, a_t \geq 1$ such that $n/2^n = \sum_{k \leq t} a_k/2^{a_k}$? + +This was proved by Cusick; Borwein and Loring [BoLo90] showed that for +$n = 2^{m+1} - m - 2$, the representation holds for every positive integer $m$. +-/ +@[category research solved, AMS 11] +theorem erdos_261.variants.infinitely_many : + Set.Infinite {n : ℕ | HasErdos261Property n} := by + sorry + +/-- +Erdős Problem 261, uncountable representations variant [Er74b, ErGr80, Er88c]: +Is there a rational $x$ such that $x = \sum_{k=1}^{\infty} a_k/2^{a_k}$ has at least +$2^{\aleph_0}$ solutions, where the $a_k$ form a strictly increasing sequence of +positive integers? +-/ +@[category research open, AMS 11] +theorem erdos_261.variants.uncountable_representations : + answer(sorry) ↔ ∃ x : ℝ, (∃ q : ℚ, x = (q : ℝ)) ∧ + ¬ Set.Countable {a : ℕ → ℕ | StrictMono a ∧ (∀ n, 0 < a n) ∧ + HasSum (fun n => (a n : ℝ) / (2 : ℝ) ^ (a n)) x} := by + sorry + +end Erdos261 diff --git a/FormalConjectures/ErdosProblems/262.lean b/FormalConjectures/ErdosProblems/262.lean new file mode 100644 index 0000000000..dec64102d7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/262.lean @@ -0,0 +1,94 @@ +/- +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 262 + +*Reference:* [erdosproblems.com/262](https://www.erdosproblems.com/262) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er88c] Erdős, P., *On the irrationality of certain series: problems and results*. +New advances in transcendence theory (Durham, 1986) (1988), 102–109. + +[Er75c] Erdős, P., *Some problems and results on the irrationality of the sum of +infinite series*. J. Math. Sci. (1975), 1–7. + +[Ha91] Hančl, J., *Expression of real numbers with the help of infinite series*. +Acta Arith. **59**.2 (1991), 97–104. +-/ + +open Filter + +namespace Erdos262 + +/-- A strictly increasing sequence of positive integers is an irrationality sequence +if for every sequence of positive integers $t$, the sum $\sum 1/(t_n \cdot a_n)$ is irrational. + +Note: Problems 263 and 264 use different (inequivalent) definitions of irrationality sequence. +See `Erdos263.IsIrrationalitySequence` and `Erdos264.IsIrrationalitySequence`. -/ +def IsIrrationalitySequence (a : ℕ → ℕ) : Prop := + StrictMono a ∧ (∀ n, 0 < a n) ∧ + ∀ t : ℕ → ℕ, (∀ n, 0 < t n) → + Irrational (∑' n, (1 : ℝ) / ((t n : ℝ) * (a n : ℝ))) + +/-- +Erdős Problem 262 [ErGr80, p.63] [Er88c, p.105]: +Suppose $a_1 < a_2 < \cdots$ is a sequence of positive integers such that for all +sequences of positive integers $t_n$, the sum $\sum 1/(t_n a_n)$ is irrational +(i.e., $a$ is an irrationality sequence). How slowly can $a_n$ grow? + +An example of such a sequence is $a_n = 2^{2^n}$ (Erdős [Er75c]), while +a non-example is $a_n = n!$. + +Hančl [Ha91] proved that any irrationality sequence must satisfy +$$\limsup_{n \to \infty} \frac{\log_2 \log_2 a_n}{n} \geq 1,$$ +i.e., for all $c < 1$, $\log_2(\log_2(a_n)) > cn$ for infinitely many $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_262 + (a : ℕ → ℕ) (ha : IsIrrationalitySequence a) + (c : ℝ) (hc : c < 1) : + Filter.Frequently (fun (n : ℕ) => c * (↑n : ℝ) < Real.logb 2 (Real.logb 2 (↑(a n) : ℝ))) + atTop := by + sorry + +/-- The sequence $a_n = 2^{2^n}$ is an irrationality sequence in the sense of Problem 262 +(Erdős [Er75c]). -/ +@[category research solved, AMS 11] +theorem erdos_262_example_double_exp : + IsIrrationalitySequence (fun n => 2 ^ (2 ^ n)) := by + sorry + +/-- The sequence $a_n = n!$ is **not** an irrationality sequence in the sense of Problem 262. -/ +@[category research solved, AMS 11] +theorem erdos_262_factorial_not_irrationality_seq : + ¬ IsIrrationalitySequence (fun n => n.factorial) := by + sorry + +/-- Any irrationality sequence (in the sense of Problem 262) must satisfy +$a_n^{1/n} \to \infty$. This is a weaker necessary condition than the limsup result +in `erdos_262`. -/ +@[category research solved, AMS 11] +theorem erdos_262_necessary_growth + (a : ℕ → ℕ) (ha : IsIrrationalitySequence a) : + Filter.Tendsto (fun n => (↑(a n) : ℝ) ^ ((1 : ℝ) / (↑n : ℝ))) Filter.atTop Filter.atTop := by + sorry + +end Erdos262 diff --git a/FormalConjectures/ErdosProblems/265.lean b/FormalConjectures/ErdosProblems/265.lean new file mode 100644 index 0000000000..a989f985d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/265.lean @@ -0,0 +1,98 @@ +/- +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 265 + +How fast can a sequence of integers grow if both $\sum 1/a_n$ and $\sum 1/(a_n - 1)$ +are rational? Erdős conjectured that $a_n^{1/2^n} \to 1$ must hold. + +*Reference:* [erdosproblems.com/265](https://www.erdosproblems.com/265) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er88c] Erdős, P., _Problems and results on analytic number theory_ (1988). + +[KoTa24] Kovač, V. and Tao T., On several irrationality problems for Ahmes series. +arXiv:2406.17593 (2024). +-/ + +open Filter + +namespace Erdos265 + +/-- +Erdős Problem #265 [ErGr80, p.64] [Er88c, p.104]: + +Let $1 \le a_1 < a_2 < \cdots$ be a strictly increasing sequence of integers with +$a_n \ge 2$ for all $n$. If both $\sum 1/a_n$ and $\sum 1/(a_n - 1)$ are rational, then +$a_n^{1/2^n} \to 1$ as $n \to \infty$. + +Cantor observed that $a_n = \binom{n}{2}$ is such a sequence. Erdős believed that +$a_n^{1/n} \to \infty$ is possible (proved by Kovač–Tao [KoTa24]) but that +$a_n^{1/2^n} \to 1$ is necessary (still open). A folklore result establishes +that $\sum 1/a_n$ is irrational whenever $a_n^{1/2^n} \to \infty$, so such a sequence +cannot grow faster than doubly exponentially. The remaining question is the +precise exponent possible. +-/ +@[category research open, AMS 11 40] +theorem erdos_265 + (a : ℕ → ℕ) + (ha_mono : StrictMono a) + (ha_ge : ∀ n, 2 ≤ a n) + (h_sum_rat : ∃ q : ℚ, HasSum (fun n => (1 : ℝ) / (a n : ℝ)) (q : ℝ)) + (h_shifted_sum_rat : ∃ q : ℚ, HasSum (fun n => (1 : ℝ) / ((a n : ℝ) - 1)) (q : ℝ)) : + Tendsto (fun n => ((a n : ℝ) ^ ((1 : ℝ) / (2 : ℝ) ^ (n : ℕ)))) atTop (nhds 1) := by + sorry + +/-- +Kovač and Tao [KoTa24] proved that there exists a strictly increasing sequence of integers +with $a_n \ge 2$ such that both $\sum 1/a_n$ and $\sum 1/(a_n - 1)$ are rational and +$a_n^{1/n} \to \infty$. This shows the conjectured bound in `erdos_265` is approximately tight. + +[KoTa24] Kovač, V. and Tao T., On several irrationality problems for Ahmes series. + arXiv:2406.17593 (2024). +-/ +@[category research solved, AMS 11 40] +theorem erdos_265_kovac_tao : + ∃ a : ℕ → ℕ, + StrictMono a ∧ + (∀ n, 2 ≤ a n) ∧ + (∃ q : ℚ, HasSum (fun n => (1 : ℝ) / (a n : ℝ)) (q : ℝ)) ∧ + (∃ q : ℚ, HasSum (fun n => (1 : ℝ) / ((a n : ℝ) - 1)) (q : ℝ)) ∧ + Tendsto (fun n => ((a n : ℝ) ^ ((1 : ℝ) / (n : ℝ)))) atTop atTop := by + sorry + +/-- +Can $\limsup a_n^{1/2^n} > 1$ hold for a strictly increasing sequence with $a_n \ge 2$ +and both $\sum 1/a_n$ and $\sum 1/(a_n - 1)$ rational? This is the key remaining open +question highlighted on erdosproblems.com. A positive answer would refute `erdos_265`. +-/ +@[category research open, AMS 11 40] +theorem erdos_265_limsup : + answer(sorry) ↔ + ∃ a : ℕ → ℕ, + StrictMono a ∧ + (∀ n, 2 ≤ a n) ∧ + (∃ q : ℚ, HasSum (fun n => (1 : ℝ) / (a n : ℝ)) (q : ℝ)) ∧ + (∃ q : ℚ, HasSum (fun n => (1 : ℝ) / ((a n : ℝ) - 1)) (q : ℝ)) ∧ + 1 < atTop.limsup (fun n => ((a n : ℝ) ^ ((1 : ℝ) / (2 : ℝ) ^ (n : ℕ)))) := by + sorry + +end Erdos265 diff --git a/FormalConjectures/ErdosProblems/27.lean b/FormalConjectures/ErdosProblems/27.lean new file mode 100644 index 0000000000..c05edb18be --- /dev/null +++ b/FormalConjectures/ErdosProblems/27.lean @@ -0,0 +1,82 @@ +/- +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 27 + +*Reference:* [erdosproblems.com/27](https://www.erdosproblems.com/27) + +An $\varepsilon$-almost covering system is a set of congruences $a_i \pmod{n_i}$ for distinct +moduli $n_1 < \cdots < n_k$ such that the natural density of integers satisfying none of them +is at most $\varepsilon$. + +Erdős asked whether there exists a constant $C > 1$ such that for every $\varepsilon > 0$ and +$N \geq 1$, there is an $\varepsilon$-almost covering system with $N \leq n_1 < \cdots < n_k \leq CN$. +This was disproved by Filaseta, Ford, Konyagin, Pomerance, and Yu [FFKPY07]. + +[FFKPY07] Filaseta, M., Ford, K., Konyagin, S., Pomerance, C., and Yu, G., _Sieving by +large integers and covering systems of congruences_. J. Amer. Math. Soc. **20** (2007), +no. 2, 495–517. +-/ + +open Finset + +open scoped Classical + +namespace Erdos27 + +/-- A congruence system has distinct moduli if no two pairs share the same modulus. -/ +def HasDistinctModuli (S : Finset (ℤ × ℕ)) : Prop := + S.card = (S.image Prod.snd).card + +/-- The LCM of all moduli in a congruence system. -/ +noncomputable def systemLcm (S : Finset (ℤ × ℕ)) : ℕ := + (S.image Prod.snd).lcm id + +/-- +The density of uncovered integers for a congruence system, measured as the proportion of +integers in $\{0, \ldots, L-1\}$ not covered by any congruence, where $L$ is the LCM of +all moduli. +-/ +noncomputable def uncoveredDensity (S : Finset (ℤ × ℕ)) : ℝ := + let L := systemLcm S + ((Finset.range L).filter (fun x => + ∀ p ∈ S, ¬((↑p.2 : ℤ) ∣ (↑x - p.1)))).card / (L : ℝ) + +/-- +There is no constant $C > 1$ such that for every $\varepsilon > 0$ and $N \geq 1$, there +exists an $\varepsilon$-almost covering system whose moduli all lie in the interval $[N, CN]$. + +Erdős conjectured this was possible; it was disproved by Filaseta, Ford, Konyagin, +Pomerance, and Yu [FFKPY07]. +-/ +@[category research solved, AMS 11] +theorem erdos_27 : + answer(False) ↔ + ∃ C : ℝ, C > 1 ∧ + ∀ ε : ℝ, ε > 0 → + ∀ N : ℕ, N ≥ 1 → + ∃ S : Finset (ℤ × ℕ), + HasDistinctModuli S ∧ + S.Nonempty ∧ + (∀ p ∈ S, p.2 ≥ 2) ∧ + (∀ p ∈ S, N ≤ p.2 ∧ (p.2 : ℝ) ≤ C * N) ∧ + uncoveredDensity S ≤ ε := by + sorry + +end Erdos27 diff --git a/FormalConjectures/ErdosProblems/270.lean b/FormalConjectures/ErdosProblems/270.lean new file mode 100644 index 0000000000..dedeb23194 --- /dev/null +++ b/FormalConjectures/ErdosProblems/270.lean @@ -0,0 +1,96 @@ +/- +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 Mathlib.MeasureTheory.Measure.Lebesgue.Basic + +/-! +# Erdős Problem 270 + +*Reference:* [erdosproblems.com/270](https://www.erdosproblems.com/270) + +Let $f(n) \to \infty$. Is it true that $\sum 1/(n+1)\cdots(n+f(n))$ is irrational? + +OEIS: [A073016](https://oeis.org/A073016) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p.66. + +[Ha75] Hansen, E. R., *A Table of Series and Products*. Prentice-Hall (1975), p.87. + +[CrKo25] Crmarić, T. and Kovač, V., *On the irrationality of certain super-polynomially +decaying series*. arXiv:2504.18712 (2025). +-/ + +open Filter Finset BigOperators MeasureTheory + +namespace Erdos270 + +/-- +Erdős Problem 270 [ErGr80, p.66] (Disproved): + +Let $f(n) \to \infty$ as $n \to \infty$. Is it true that +$$\sum_{n \geq 1} \frac{1}{(n+1)\cdots(n+f(n))}$$ +is irrational? + +Disproved by Crmarić and Kovač [CrKo25]. +-/ +@[category research solved, AMS 11 40] +theorem erdos_270 : answer(False) ↔ + ∀ f : ℕ → ℕ, Tendsto f atTop atTop → + Irrational (∑' n, (1 : ℝ) / ∏ i ∈ Finset.range (f (n + 1)), + ((n : ℝ) + 2 + (i : ℝ))) := by + sorry + +/-- +Stronger result from Crmarić and Kovač [CrKo25]: for any $\alpha > 0$ there exists +$f : \mathbb{N} \to \mathbb{N}$ with $f(n) \to \infty$ such that the sum equals $\alpha$. +-/ +@[category research solved, AMS 11 40] +theorem erdos_270.variants.stronger_disproof : + ∀ α : ℝ, 0 < α → + ∃ f : ℕ → ℕ, + Tendsto f atTop atTop ∧ + HasSum (fun n => (1 : ℝ) / (∏ i ∈ Finset.range (f (n + 1)), + ((n : ℝ) + 2 + (i : ℝ)))) α := by + sorry + +/-- +Nondecreasing variant (OPEN) [ErGr80, p.66]: + +Erdős and Graham suggested that the sum $\sum_{n \geq 1} 1/((n+1)\cdots(n+f(n)))$ +is "almost surely" irrational if $f$ is assumed to be nondecreasing. This remains open. +-/ +@[category research open, AMS 11 40] +theorem erdos_270.variants.nondecreasing : + ∀ f : ℕ → ℕ, Monotone f → Tendsto f atTop atTop → + Irrational (∑' n, (1 : ℝ) / ∏ i ∈ Finset.range (f (n + 1)), + ((n : ℝ) + 2 + (i : ℝ))) := by + sorry + +/-- +Crmarić and Kovač [CrKo25] showed that under the nondecreasing constraint on $f$, +the set of achievable values of the sum $\sum_{n \geq 1} 1/((n+1)\cdots(n+f(n)))$ +has Lebesgue measure zero. +-/ +@[category research solved, AMS 11 40] +theorem erdos_270.variants.nondecreasing_measure_zero : + volume {α : ℝ | ∃ f : ℕ → ℕ, Monotone f ∧ Tendsto f atTop atTop ∧ + HasSum (fun n => (1 : ℝ) / (∏ i ∈ Finset.range (f (n + 1)), + ((n : ℝ) + 2 + (i : ℝ)))) α} = 0 := by + sorry + +end Erdos270 diff --git a/FormalConjectures/ErdosProblems/271.lean b/FormalConjectures/ErdosProblems/271.lean new file mode 100644 index 0000000000..2a4e8f24a1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/271.lean @@ -0,0 +1,100 @@ +/- +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 271 + +Stanley sequences are constructed by starting from $\{0, n\}$ and greedily avoiding 3-term +arithmetic progressions. The Odlyzko–Stanley conjecture asserts a dichotomy on their growth rates: +every such sequence eventually grows either as $\Theta(k^{\log_2 3})$ or as $\Theta(k^2 / \log k)$. + +*Reference:* [erdosproblems.com/271](https://www.erdosproblems.com/271) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[OdSt78] Odlyzko, A. and Stanley, R., *Some curious sequences constructed with the greedy +algorithm*. Bell Laboratories internal memorandum (1978). + +[Mo11] Moy, R., *On the growth of the counting function of Stanley sequences*. Discrete +Mathematics (2011), 560–562. + +[Li90] Lindhurst, S., *An investigation of several interesting sets of numbers generated by the +greedy algorithm*. Senior thesis, Princeton University (1990). +-/ + +open Filter +open scoped Asymptotics + +namespace Erdos271 + +/-- +A sequence $a : \mathbb{N} \to \mathbb{N}$ is a Stanley sequence starting from $\{0, n\}$ if: +1. $a(0) = 0$ and $a(1) = n$ +2. $a$ is strictly increasing +3. The image is 3-AP-free: no three indices $i < j < k$ satisfy $a(i) + a(k) = 2 \cdot a(j)$ +4. It is greedy: for every $m$ between consecutive terms $a(k)$ and $a(k+1)$ (with $k \geq 1$), + adding $m$ to $\{a(0), \ldots, a(k)\}$ would create a 3-term AP +-/ +def IsStanleySeq (n : ℕ) (a : ℕ → ℕ) : Prop := + a 0 = 0 ∧ a 1 = n ∧ + StrictMono a ∧ + (∀ i j k : ℕ, i < j → j < k → a i + a k ≠ 2 * a j) ∧ + (∀ k : ℕ, 1 ≤ k → ∀ m : ℕ, a k < m → m < a (k + 1) → + ∃ i j : ℕ, i < j ∧ j ≤ k ∧ a i + m = 2 * a j) + +/-- +Erdős Problem 271 [ErGr80, p.22]: + +Let $A(n) = \{a_0 < a_1 < \cdots\}$ be the Stanley sequence defined by $a_0 = 0$, $a_1 = n$, +and for $k \geq 1$, $a_{k+1}$ is the least positive integer such that $\{a_0, \ldots, a_{k+1}\}$ +contains no three-term arithmetic progression. + +Can the $a_k$ be explicitly determined? How fast do they grow? + +The Odlyzko–Stanley conjecture [OdSt78] asserts that every such sequence eventually +satisfies either $a_k = \Theta(k^{\log_2 3})$ or $a_k = \Theta(k^2 / \log k)$. The first growth +rate is known for $A(1)$, $A(3^k)$, and $A(2 \cdot 3^k)$. No sequence with the second growth +rate has been proven, though computational evidence [Li90] suggests $A(4)$ (OEIS A005487) may +have this growth. Moy [Mo11] proved the asymptotic upper bound +$a_k \leq (\frac{1}{2} + \varepsilon) k^2$ for sufficiently large $k$; van Doorn and Sothanaphan +noted that Moy's proof yields the explicit bound $a_k \leq (k-1)(k+2)/2 + n$ for all $k \geq 0$. +-/ +@[category research open, AMS 5 11] +theorem erdos_271 (n : ℕ) (hn : 0 < n) + (a : ℕ → ℕ) (ha : IsStanleySeq n a) : + ((fun k : ℕ => (a k : ℝ)) =Θ[atTop] (fun k : ℕ => (k : ℝ) ^ Real.logb 2 3)) + ∨ + ((fun k : ℕ => (a k : ℝ)) =Θ[atTop] + (fun k : ℕ => (k : ℝ) ^ 2 / Real.log (k : ℝ))) := by + sorry + +/-- +Van Doorn–Sothanaphan upper bound for Stanley sequences [Mo11]: + +For any Stanley sequence starting from $\{0, n\}$, the $k$-th term satisfies +$a_k \leq (k-1)(k+2)/2 + n$ for all $k \geq 0$. This explicit bound is derived from +Moy's proof technique. +-/ +@[category research solved, AMS 5 11] +theorem erdos_271_upper_bound (n : ℕ) (hn : 0 < n) + (a : ℕ → ℕ) (ha : IsStanleySeq n a) (k : ℕ) : + (a k : ℤ) ≤ (k - 1) * (k + 2) / 2 + n := by + sorry + +end Erdos271 diff --git a/FormalConjectures/ErdosProblems/272.lean b/FormalConjectures/ErdosProblems/272.lean new file mode 100644 index 0000000000..40abe7e9aa --- /dev/null +++ b/FormalConjectures/ErdosProblems/272.lean @@ -0,0 +1,81 @@ +/- +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 272 + +*Reference:* [erdosproblems.com/272](https://www.erdosproblems.com/272) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p. 20. + +[GSS80] Graham, R., Simonovits, M. and Sós, V., *A note on the intersection properties of subsets +of integers*. Journal of Combinatorial Theory Series A (1980), 106–110. + +[SiSo81] Simonovits, M. and Sós, V., *Intersection properties of subsets of integers*. European +Journal of Combinatorics (1981), 363–372. + +[Sz99] Szabó, T., *Intersection properties of subsets of integers*. European Journal of +Combinatorics (1999), 429–444. +-/ + +open Finset + +namespace Erdos272 + +/-- +A finset of natural numbers is a non-empty finite arithmetic progression if it is +nonempty and equals $\{a, a+d, a+2d, \ldots, a+(n-1) \cdot d\}$ for some $a, d \in \mathbb{N}$ +where $n = |S|$. When $|S| \geq 2$ this forces $d > 0$ (so elements are distinct). +-/ +def IsNonEmptyFiniteAP (S : Finset ℕ) : Prop := + S.Nonempty ∧ ∃ (a d : ℕ), ∀ x, x ∈ S ↔ ∃ i, i < S.card ∧ x = a + i * d + +/-- +Erdős Problem 272 [ErGr80, p. 20]: + +Let $N \geq 1$. What is the largest $t$ such that there are +$A_1, \ldots, A_t \subseteq \{1, \ldots, N\}$ with $A_i \cap A_j$ a non-empty arithmetic +progression for all $i \neq j$? + +Simonovits and Sós [SiSo81] showed that $t \ll N^2$. Szabó [Sz99] proved that the +maximum $t$ equals $N^2/2 + O(N^{5/3} (\log N)^3)$, resolving the asymptotic question. + +Szabó conjectures that the maximum $t$ satisfies $t = N^2/2 + O(N)$, i.e., there +exists a constant $C > 0$ such that the largest such $t$ differs from $N^2/2$ by at +most $C \cdot N$. + +We formalize Szabó's conjecture: there exists $C > 0$ such that for all $N \geq 1$, +(1) every AP-intersecting family of subsets of $\{1,\ldots,N\}$ has size +$\leq N^2/2 + C \cdot N$, and +(2) there exists an AP-intersecting family of size $\geq N^2/2 - C \cdot N$. +-/ +@[category research open, AMS 5] +theorem erdos_272 : + ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, 1 ≤ N → + (∀ (𝓕 : Finset (Finset ℕ)), + (∀ A ∈ 𝓕, A ⊆ Icc 1 N) → + (∀ A ∈ 𝓕, ∀ B ∈ 𝓕, A ≠ B → IsNonEmptyFiniteAP (A ∩ B)) → + (𝓕.card : ℝ) ≤ (N : ℝ) ^ 2 / 2 + C * (N : ℝ)) ∧ + (∃ (𝓕 : Finset (Finset ℕ)), + (∀ A ∈ 𝓕, A ⊆ Icc 1 N) ∧ + (∀ A ∈ 𝓕, ∀ B ∈ 𝓕, A ≠ B → IsNonEmptyFiniteAP (A ∩ B)) ∧ + (𝓕.card : ℝ) ≥ (N : ℝ) ^ 2 / 2 - C * (N : ℝ)) := by + sorry + +end Erdos272 diff --git a/FormalConjectures/ErdosProblems/278.lean b/FormalConjectures/ErdosProblems/278.lean new file mode 100644 index 0000000000..5401c45491 --- /dev/null +++ b/FormalConjectures/ErdosProblems/278.lean @@ -0,0 +1,95 @@ +/- +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 278 + +*Reference:* [erdosproblems.com/278](https://www.erdosproblems.com/278) + +Let $A = \{n_1, \ldots, n_r\}$ be a finite set of positive integers. For any choice of +residues $a_1, \ldots, a_r$, consider the set of integers covered by the union of +congruence classes $m \equiv a_i \pmod{n_i}$. The covering density is the natural density +of this set (which exists since the covered set is periodic with period $\operatorname{lcm}(A)$). + +Open question (Erdős–Graham [ErGr80, p.28]): What is the maximum covering density +achievable by a suitable choice of the $a_i$? + +Settled (Simpson [Si86]): The minimum covering density is achieved when all $a_i$ +are equal, and equals the inclusion-exclusion sum +$$\sum_i \frac{1}{n_i} - \sum_{i + ∃ n ∈ moduli, (n : ℤ) ∣ ((m : ℤ) - offsets n) + (covered.card : ℚ) / (L : ℚ) + +/-- The inclusion-exclusion density for a set of moduli: the alternating sum +$\sum_{\emptyset \neq S \subseteq \text{moduli}} (-1)^{|S|+1} / \operatorname{lcm}(S)$. +This equals the covering density when all offsets are equal. -/ +noncomputable def inclusionExclusionDensity (moduli : Finset ℕ) : ℚ := + ((moduli.powerset.filter fun S => S.Nonempty).sum fun S => + (-1 : ℚ) ^ (S.card + 1) / ((S.lcm id : ℕ) : ℚ)) + +/-- +Erdős Problem 278 (Simpson's theorem [Si86]): + +Is the minimum covering density, over all choices of offsets for a finite set of +positive integer moduli, achieved when all offsets are equal (giving the +inclusion-exclusion density)? + +Answered affirmatively by Simpson [Si86]. +-/ +@[category research solved, AMS 11] +theorem erdos_278 : answer(True) ↔ + ∀ (moduli : Finset ℕ), (∀ n ∈ moduli, 0 < n) → + (∀ offsets : ℕ → ℤ, + inclusionExclusionDensity moduli ≤ + coveringDensity moduli offsets) ∧ + (∀ a : ℤ, + coveringDensity moduli (fun _ => a) = + inclusionExclusionDensity moduli) := by + sorry + +/-- Open question (Erdős–Graham [ErGr80, p.28]): What is the maximum +covering density achievable by a suitable choice of offsets? -/ +@[category research open, AMS 11] +theorem erdos_278.variants.max_density + (moduli : Finset ℕ) (h : ∀ n ∈ moduli, 0 < n) : + IsGreatest {coveringDensity moduli offsets | + offsets : ℕ → ℤ} (answer(sorry)) := by + sorry + +end Erdos278 diff --git a/FormalConjectures/ErdosProblems/279.lean b/FormalConjectures/ErdosProblems/279.lean new file mode 100644 index 0000000000..902c238104 --- /dev/null +++ b/FormalConjectures/ErdosProblems/279.lean @@ -0,0 +1,101 @@ +/- +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 279 + +*Reference:* [erdosproblems.com/279](https://www.erdosproblems.com/279) + +Let $k \geq 3$. Is there a choice of congruence classes $a_p \pmod{p}$ for every prime $p$ +such that all sufficiently large integers can be written as $a_p + t \cdot p$ for some +prime $p$ and integer $t \geq k$? + +Even the case $k = 3$ seems difficult. The conjecture may hold with the primes +replaced by any set $A \subseteq \mathbb{N}$ with $|A \cap [1,N]| \gg N / \log N$ and +$\sum_{n \in A, n \leq N} 1/n - \log \log N \to \infty$. + +For $k = 1$ or $k = 2$, any set $A$ with $\sum_{n \in A} 1/n = \infty$ has this property. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). +-/ + +open scoped Classical +open Filter + +namespace Erdos279 + +/-- +Erdős Problem 279 [ErGr80, p.29]: + +For every $k \geq 3$, there exists a choice of congruence classes $a_p \pmod{p}$ for +every prime $p$ such that all sufficiently large integers $n$ can be represented as +$n = a_p + t \cdot p$ for some prime $p$ and integer $t \geq k$. +-/ +@[category research open, AMS 11] +theorem erdos_279 : answer(sorry) ↔ ∀ (k : ℕ), 3 ≤ k → + ∃ a : ℕ → ℤ, + ∃ N₀ : ℤ, ∀ n : ℤ, N₀ ≤ n → + ∃ p : ℕ, Nat.Prime p ∧ + ∃ t : ℤ, (k : ℤ) ≤ t ∧ n = a p + t * (p : ℤ) := by + sorry + +/-- +Erdős Problem 279 — Generalization to dense sets [ErGr80, p.29]: + +The conjecture may hold with the primes replaced by any set $A \subseteq \mathbb{N}$ +satisfying $|A \cap [1,N]| \gg N / \log N$ and +$\sum_{n \in A, n \leq N} 1/n - \log \log N \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_279_general : answer(sorry) ↔ ∀ (k : ℕ), 3 ≤ k → + ∀ A : Set ℕ, + (∃ c : ℝ, 0 < c ∧ ∀ᶠ N : ℕ in atTop, + c * (N : ℝ) / Real.log (N : ℝ) ≤ + (((Finset.Icc 1 N).filter (· ∈ A)).card : ℝ)) → + (Tendsto (fun (N : ℕ) => + (∑ n ∈ (Finset.Icc 1 N).filter (· ∈ A), (1 : ℝ) / (n : ℝ)) - + Real.log (Real.log (N : ℝ))) + atTop atTop) → + ∃ a : ℕ → ℤ, + ∃ N₀ : ℤ, ∀ n : ℤ, N₀ ≤ n → + ∃ m : ℕ, m ∈ A ∧ + ∃ t : ℤ, (k : ℤ) ≤ t ∧ n = a m + t * (m : ℤ) := by + sorry + +/-- +Erdős Problem 279 — Small $k$ case [ErGr80, p.29]: + +For $k = 1$ or $k = 2$, any set $A \subseteq \mathbb{N}$ with +$\sum_{n \in A} 1/n = \infty$ has the covering property: there exists a choice of +residue classes $a_n \pmod{n}$ for every $n \in A$ such that all sufficiently large +integers can be written as $a_n + t \cdot n$ for some $n \in A$ and $t \geq k$. +-/ +@[category research solved, AMS 11] +theorem erdos_279_small_k (k : ℕ) (hk : k = 1 ∨ k = 2) + (A : Set ℕ) + (hA : Tendsto (fun (N : ℕ) => + ∑ n ∈ (Finset.Icc 1 N).filter (· ∈ A), (1 : ℝ) / (n : ℝ)) + atTop atTop) : + ∃ a : ℕ → ℤ, + ∃ N₀ : ℤ, ∀ n : ℤ, N₀ ≤ n → + ∃ m : ℕ, m ∈ A ∧ + ∃ t : ℤ, (k : ℤ) ≤ t ∧ n = a m + t * (m : ℤ) := by + sorry + +end Erdos279 diff --git a/FormalConjectures/ErdosProblems/280.lean b/FormalConjectures/ErdosProblems/280.lean new file mode 100644 index 0000000000..1f823574bb --- /dev/null +++ b/FormalConjectures/ErdosProblems/280.lean @@ -0,0 +1,66 @@ +/- +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 280 + +*Reference:* [erdosproblems.com/280](https://www.erdosproblems.com/280) + +Let $n_1 < n_2 < \cdots$ be an infinite sequence of integers with associated residue +classes $a_k \pmod{n_k}$, such that for some $\varepsilon > 0$ we have +$n_k > (1+\varepsilon)k \log k$ for all $k \geq 1$. Erdős and Graham conjectured that +$$\#\{m < n_k : m \not\equiv a_i \pmod{n_i} \text{ for } 1 \leq i \leq k\} \neq o(k).$$ + +This was disproved by Stijn Cambie, who observed that taking $n_k = 2^k$ and +$a_k = 2^{k-1} + 1$ for $k \geq 1$ gives a trivial counterexample: the only $m$ +not in any congruence class is $1$, so the count is $1$ for all $k$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). +-/ + +namespace Erdos280 + +open Classical in +/-- The count of integers $m < n(k)$ that avoid all congruence classes $a(i) \bmod n(i)$ +for $1 \leq i \leq k$. -/ +noncomputable def sieveCount (n a : ℕ → ℕ) (k : ℕ) : ℕ := + ((Finset.range (n k)).filter fun m => + ∀ i ∈ Finset.Icc 1 k, ¬(m ≡ a i [MOD n i])).card + +/-- +Erdős Problem 280 (Disproved) [ErGr80, p.29]: + +There exist a strictly increasing sequence $n_1 < n_2 < \cdots$ of positive integers +and associated residue classes $a_k \pmod{n_k}$, with $n_k > (1+\varepsilon)k \log k$ +for some $\varepsilon > 0$ and all $k \geq 1$, such that the sieve count +$$\#\{m < n_k : m \not\equiv a_i \pmod{n_i} \text{ for } 1 \leq i \leq k\}$$ +is $o(k)$ as $k \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_280 : + ∃ (n : ℕ → ℕ) (a : ℕ → ℕ) (ε : ℝ), + 0 < ε ∧ + StrictMono n ∧ + (∀ k, 1 ≤ k → (n k : ℝ) > (1 + ε) * ↑k * Real.log ↑k) ∧ + ∀ c : ℝ, 0 < c → + ∃ K : ℕ, ∀ k, K ≤ k → + (sieveCount n a k : ℝ) < c * ↑k := by + sorry + +end Erdos280 diff --git a/FormalConjectures/ErdosProblems/281.lean b/FormalConjectures/ErdosProblems/281.lean new file mode 100644 index 0000000000..1fa4fba72a --- /dev/null +++ b/FormalConjectures/ErdosProblems/281.lean @@ -0,0 +1,65 @@ +/- +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 + +/-! +# Erdős Problem 281 + +*Reference:* [erdosproblems.com/281](https://www.erdosproblems.com/281) + +Let $n_1 < n_2 < \cdots$ be a strictly increasing sequence of positive integers such that, +for any choice of congruence classes $a_i \pmod{n_i}$, the integers not satisfying any of the +congruences have density $0$. Is it true that for every $\varepsilon > 0$ there exists some $k$ +such that the density of integers avoiding the first $k$ congruences is already less than +$\varepsilon$, regardless of the choice of $a_i$? + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +[DaEr36] Davenport, H. and Erdős, P., _On sequences of positive integers_. +Acta Arithmetica **2** (1936), 147-151. + +[HaRo66] Halberstam, H. and Roth, K. F., _Sequences. Vol. I_. +Oxford University Press (1966). +-/ + +open Classical Set + +namespace Erdos281 + +/-- +Erdős Problem 281 (Proved) [ErGr80, p.29]: + +Let $n_1 < n_2 < \cdots$ be a strictly increasing sequence of positive integers such that, +for any choice of congruence classes $a_i \pmod{n_i}$, the set of integers not satisfying +any of the congruences has density $0$. Then for every $\varepsilon > 0$ there exists some $k$ +such that, for every choice of congruence classes $a_i$, the density of integers not +satisfying any of the congruences $a_i \pmod{n_i}$ for $i < k$ is less than $\varepsilon$. + +The proof combines the Davenport–Erdős theorem [DaEr36] with Rogers' optimal sieve +bound [HaRo66]. +-/ +@[category research solved, AMS 11] +theorem erdos_281 : answer(True) ↔ + ∀ (n : ℕ → ℕ), (∀ i, 0 < n i) → StrictMono n → + (∀ a : ℕ → ℕ, {m : ℕ | ∀ i, ¬(m ≡ a i [MOD n i])}.HasDensity 0) → + ∀ ε : ℝ, 0 < ε → ∃ k : ℕ, ∀ a : ℕ → ℕ, + {m : ℕ | ∀ i, i < k → ¬(m ≡ a i [MOD n i])}.upperDensity < ε := by + sorry + +end Erdos281 diff --git a/FormalConjectures/ErdosProblems/282.lean b/FormalConjectures/ErdosProblems/282.lean new file mode 100644 index 0000000000..6b41baa523 --- /dev/null +++ b/FormalConjectures/ErdosProblems/282.lean @@ -0,0 +1,62 @@ +/- +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 282 + +*Reference:* [erdosproblems.com/282](https://www.erdosproblems.com/282) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +The problem of odd denominators was originally posed by Stein; see [ErGr80, p.30]. +-/ + +namespace Erdos282 + +/-- The greedy step: given a set $A \subseteq \mathbb{N}$ and a positive rational $x$, + returns the minimal $n \in A$ such that $n \geq 1/x$. Returns $0$ if $x \leq 0$. -/ +noncomputable def greedyDenominator (A : Set ℕ) (x : ℚ) : ℕ := + if x ≤ 0 then 0 + else sInf {n : ℕ | n ∈ A ∧ x⁻¹ ≤ (n : ℚ)} + +/-- The greedy remainder sequence: starting from $x$, repeatedly subtract $1/n$ + where $n$ is chosen greedily as the minimal element of $A$ with $n \geq 1/x$. -/ +noncomputable def greedyRemainder (A : Set ℕ) (x : ℚ) : ℕ → ℚ + | 0 => x + | k + 1 => + let r := greedyRemainder A x k + if r ≤ 0 then 0 + else r - 1 / ↑(greedyDenominator A r) + +/-- +Erdős Problem 282 [ErGr80, p.30]: + +The greedy algorithm for Egyptian fractions with odd denominators always +terminates: for every rational $x \in (0,1)$ with odd denominator, the process of +repeatedly choosing the minimal odd $n \geq 1/x$ and replacing $x$ by $x - 1/n$ +terminates after finitely many steps. +-/ +@[category research open, AMS 11] +theorem erdos_282 : + answer(sorry) ↔ + ∀ x : ℚ, 0 < x → x < 1 → x.den % 2 = 1 → + ∃ k : ℕ, greedyRemainder {n : ℕ | n % 2 = 1} x k = 0 := by + sorry + +end Erdos282 diff --git a/FormalConjectures/ErdosProblems/284.lean b/FormalConjectures/ErdosProblems/284.lean new file mode 100644 index 0000000000..d1b99025bd --- /dev/null +++ b/FormalConjectures/ErdosProblems/284.lean @@ -0,0 +1,74 @@ +/- +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 284 + +*Reference:* [erdosproblems.com/284](https://www.erdosproblems.com/284) + +Let $f(k)$ be the maximal value of $n_1$ such that there exist $n_1 < n_2 < \cdots < n_k$ +with $1 = 1/n_1 + \cdots + 1/n_k$. Is it true that $f(k) = (1+o(1)) \, k/(e-1)$? + +The upper bound $f(k) \leq (1+o(1)) \, k/(e-1)$ is trivial since for any $u \geq 1$ we have +$\sum_{u \leq n \leq eu} 1/n = 1 + o(1)$, and hence if $f(k) = u$ then $k \geq (e-1-o(1))u$. + +Essentially solved by Croot [Cr01], who showed that for any $N > 1$ there exists +some $k \geq 1$ and $N < n_1 < \cdots < n_k \leq (e+o(1))N$ with $1 = \sum 1/n_i$. + +[Cr01] Croot, E., _On a coloring conjecture about unit fractions_, Annals of Mathematics (2001). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Filter Finset + +namespace Erdos284 + +/-- $f(k)$ is the maximal value of the minimum element in any set of $k$ distinct positive +integers whose reciprocals sum to $1$. -/ +noncomputable def erdos284_f (k : ℕ) : ℕ := + sSup {m : ℕ | ∃ S : Finset ℕ, S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ + S.sum (fun n => (1 : ℚ) / ↑n) = 1 ∧ m ∈ S ∧ ∀ n ∈ S, m ≤ n} + +/-- +Erdős Problem 284 (Proved) [ErGr80]: + +$f(k) = (1+o(1)) \, k/(e-1)$, where $f(k)$ is the maximal minimum element in any +representation of $1$ as a sum of $k$ distinct unit fractions. + +Equivalently, $f(k) \cdot (e-1) / k \to 1$ as $k \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_284 : + answer(True) ↔ + Tendsto (fun k => (erdos284_f k : ℝ) * (Real.exp 1 - 1) / (k : ℝ)) + atTop (nhds 1) := by + sorry + +/-- +The trivial upper bound $f(k) \leq (1+o(1)) \, k/(e-1)$, which follows from the fact that +$\sum_{u \leq n \leq eu} 1/n = 1 + o(1)$ for any $u \geq 1$. +-/ +@[category research solved, AMS 11] +theorem erdos_284.variants.ub : + Filter.limsup (fun k => (erdos284_f k : ℝ) * (Real.exp 1 - 1) / (k : ℝ)) + atTop ≤ 1 := by + sorry + +end Erdos284 diff --git a/FormalConjectures/ErdosProblems/286.lean b/FormalConjectures/ErdosProblems/286.lean new file mode 100644 index 0000000000..bbe606cf12 --- /dev/null +++ b/FormalConjectures/ErdosProblems/286.lean @@ -0,0 +1,59 @@ +/- +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 286 + +*Reference:* [erdosproblems.com/286](https://www.erdosproblems.com/286) + +For sufficiently large $k$, do there exist $k$ distinct positive integers in an interval of +width $(e - 1 + o(1))k$ whose reciprocals sum to $1$? Solved affirmatively by Croot. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980). + +[Cr01] Croot, III, Ernest S., _On unit fractions with denominators in short intervals_. Acta Arith. (2001), 99-114. +-/ + +open Filter Finset + +namespace Erdos286 + +/-- +[ErGr80, p.33] (Proved by Croot [Cr01]): +Let $k \geq 2$. Is it true that there exists an interval $I$ of width $(e - 1 + o(1))k$ +and integers $n_1 < \cdots < n_k \in I$ such that +$$1 = \frac{1}{n_1} + \cdots + \frac{1}{n_k}?$$ + +The answer is yes. For every $\varepsilon > 0$, for all sufficiently large $k$, there +exist $k$ distinct positive integers in an interval of width at most +$(e - 1 + \varepsilon)k$ whose reciprocals sum to $1$. +-/ +@[category research solved, AMS 11] +theorem erdos_286 : + answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∃ S : Finset ℕ, + S.card = k ∧ + (∀ n ∈ S, 0 < n) ∧ + (∃ a : ℕ, ∀ n ∈ S, a ≤ n ∧ (n : ℝ) ≤ (a : ℝ) + (Real.exp 1 - 1 + ε) * (k : ℝ)) ∧ + S.sum (fun n => (1 : ℚ) / ↑n) = 1 := by + sorry + +end Erdos286 diff --git a/FormalConjectures/ErdosProblems/287.lean b/FormalConjectures/ErdosProblems/287.lean new file mode 100644 index 0000000000..9c3eb79013 --- /dev/null +++ b/FormalConjectures/ErdosProblems/287.lean @@ -0,0 +1,57 @@ +/- +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 287 + +*Reference:* [erdosproblems.com/287](https://www.erdosproblems.com/287) + +Is it true that any Egyptian fraction representation of 1 with distinct denominators greater +than 1 must have a consecutive gap of at least 3? + +[Er32] Erdős, P., _Egyszerű bizonyítás Kürschák egy tételére_ (1932). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Va99] §1.15. +-/ + +namespace Erdos287 + +/-- +Erdős Problem 287 [ErGr80, p.33]: + +Let $k \geq 2$. Is it true that, for any distinct integers $1 < n_1 < \cdots < n_k$ such that +$1 = 1/n_1 + \cdots + 1/n_k$, we must have $\max(n_{i+1} - n_i) \geq 3$? + +The example $1 = 1/2 + 1/3 + 1/6$ shows that $3$ would be best possible here. +The lower bound of $\geq 2$ is equivalent to saying that $1$ is not the sum of +reciprocals of consecutive integers, proved by Erdős [Er32]. +-/ +@[category research open, AMS 11] +theorem erdos_287 : answer(sorry) ↔ + ∀ (S : Finset ℕ), + 2 ≤ S.card → + (∀ n ∈ S, 1 < n) → + S.sum (fun n => (1 : ℚ) / ↑n) = 1 → + ∃ a ∈ S, ∃ b ∈ S, a < b ∧ (∀ c ∈ S, c ≤ a ∨ b ≤ c) /- a, b consecutive in S -/ + ∧ 3 ≤ b - a := by + sorry + +end Erdos287 diff --git a/FormalConjectures/ErdosProblems/29.lean b/FormalConjectures/ErdosProblems/29.lean new file mode 100644 index 0000000000..facd4f6d4c --- /dev/null +++ b/FormalConjectures/ErdosProblems/29.lean @@ -0,0 +1,76 @@ +/- +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 29 + +*Reference:* [erdosproblems.com/29](https://www.erdosproblems.com/29) + +There exists a set $A \subseteq \mathbb{N}$ that is an additive basis of order 2 (i.e., +$A + A = \mathbb{N}$) whose representation function grows sub-polynomially: $r_A(n) = o(n^\varepsilon)$ +for every $\varepsilon > 0$. First proved by Erdős via probabilistic methods; an explicit +construction was given by Jain, Pham, Sawhney, and Zakharov [JPSZ24]. + +Note: The original problem asks for an *explicit* construction of such a set. The formalization +below captures the existence statement only. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980), p. 48. + +[Er89d] Erdős, P., _On some of my problems in number theory_ (1989). + +[Er95] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and geometry_. +Resenhas **1** (1995), 165–186. + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[JPSZ24] Jain, V., Pham, H.T., Sawhney, M., and Zakharov, D., _An explicit economical additive +basis_. arXiv:2405.08650 (2024). +-/ + +open Filter Asymptotics Classical + +namespace Erdos29 + +/-- The representation function $r_A(n) = |\{a \in \{0, \ldots, n\} : a \in A \land n - a \in A\}|$, +i.e., the number of ways to write $n$ as a sum of two elements of $A$. -/ +noncomputable def repCount (A : Set ℕ) (n : ℕ) : ℕ := + ((Finset.range (n + 1)).filter (fun a => a ∈ A ∧ (n - a) ∈ A)).card + +/-- +There exists a set $A \subseteq \mathbb{N}$ such that: +1. $A$ is an additive basis of order 2: every natural number is a sum of two elements of $A$ + (i.e., $A + A = \mathbb{N}$), and +2. The additive representation function $r_A(n) = (1_A * 1_A)(n)$ grows sub-polynomially: + $r_A(n) = o(n^\varepsilon)$ for every $\varepsilon > 0$. + +The existence of such a set was first proved by Erdős using probabilistic methods +(answering a question of Sidon from 1932). An explicit construction was given by +Jain, Pham, Sawhney, and Zakharov (2024). +-/ +@[category research solved, AMS 5 11] +theorem erdos_29 : + answer(True) ↔ + ∃ A : Set ℕ, + (∀ n : ℕ, ∃ a ∈ A, ∃ b ∈ A, a + b = n) ∧ + ∀ ε : ℝ, 0 < ε → + (fun n : ℕ => (repCount A n : ℝ)) =o[atTop] (fun n : ℕ => (n : ℝ) ^ ε) := by + sorry + +end Erdos29 diff --git a/FormalConjectures/ErdosProblems/290.lean b/FormalConjectures/ErdosProblems/290.lean new file mode 100644 index 0000000000..306a4ec585 --- /dev/null +++ b/FormalConjectures/ErdosProblems/290.lean @@ -0,0 +1,65 @@ +/- +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 290 + +*Reference:* [erdosproblems.com/290](https://www.erdosproblems.com/290) + +Let $a \ge 1$. Must there exist some $b > a$ such that +$$\sum_{a \le n \le b} 1/n = r_1/s_1 \quad \text{and} \quad \sum_{a \le n \le b+1} 1/n = r_2/s_2,$$ +with $(r_i, s_i) = 1$ and $s_2 < s_1$? + +For example, $\sum_{3 \le n \le 5} 1/n = 47/60$ and $\sum_{3 \le n \le 6} 1/n = 19/20$, +and $20 < 60$. + +The smallest such $b$ for each $a$ is listed in OEIS sequence A375081. + +This was resolved in the affirmative by van Doorn [vD24], who proved $b = b(a)$ +always exists and $b(a) \ll a$. More precisely, $b(a) < 4.374a$ for all $a > 1$, +and $b(a) > a + (1/2 - o(1)) \log a$ for large $a$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[vD24] van Doorn, F., *On the denominators of harmonic numbers* (2024). +-/ + +open Finset + +namespace Erdos290 + +/-- The partial harmonic sum $\sum_{n=a}^{b} 1/n$ as a rational number. -/ +def harmonicPartialSum (a b : ℕ) : ℚ := + (Finset.Icc a b).sum (fun n => (1 : ℚ) / ↑n) + +/-- +Erdős Problem 290 (Proved) [ErGr80, p.34]: + +For every $a \ge 1$, there exists $b > a$ such that the denominator of +$\sum_{n=a}^{b+1} 1/n$ (in lowest terms) is strictly less than the denominator +of $\sum_{n=a}^{b} 1/n$ (in lowest terms). +-/ +@[category research solved, AMS 11] +theorem erdos_290 : answer(True) ↔ + ∀ a : ℕ, 1 ≤ a → + ∃ b : ℕ, a < b ∧ + (harmonicPartialSum a (b + 1)).den < (harmonicPartialSum a b).den := by + sorry + +end Erdos290 diff --git a/FormalConjectures/ErdosProblems/291.lean b/FormalConjectures/ErdosProblems/291.lean new file mode 100644 index 0000000000..c5bb20d7d8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/291.lean @@ -0,0 +1,91 @@ +/- +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 291 + +*Reference:* [erdosproblems.com/291](https://www.erdosproblems.com/291) + +Let $n \geq 1$ and define $L_n$ to be the least common multiple of $\{1, \ldots, n\}$ and $a_n$ by +$$\sum_{k=1}^{n} \frac{1}{k} = \frac{a_n}{L_n}.$$ +Is it true that $\gcd(a_n, L_n) = 1$ and $\gcd(a_n, L_n) > 1$ both occur for infinitely +many $n$? + +The second question is yes (Steinerberger): any $n$ whose leading digit in +base 3 is 2 has $3 \mid \gcd(a_n, L_n)$. + +The first question remains open. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Sh16] Shiu, P., _The denominators of harmonic numbers_. arXiv:1607.02863 (2016). + +[WuYa22] Wu, B.-L. and Yan, X.-H., _On the denominators of harmonic numbers. IV_. +C. R. Math. Acad. Sci. Paris (2022), 53–57. + +See also OEIS sequence [A110566](https://oeis.org/A110566). +-/ + +open Finset + +namespace Erdos291 + +/-- The numerator $a_n$ defined by $\sum_{k=1}^{n} \frac{1}{k} = \frac{a_n}{L_n}$, i.e., +$a_n = \sum_{k=1}^{n} \frac{L_n}{k}$, where $L_n = \mathrm{lcm}(1, \ldots, n)$. +Since $L_n$ is divisible by every $k \leq n$, each summand is a natural number. -/ +def harmonicLcmNumerator (n : ℕ) : ℕ := + (Finset.Icc 1 n).sum fun k => lcmInterval 0 n / k + +/-- +Erdős Problem 291 [ErGr80, p.34]: + +Both $\gcd(a_n, L_n) = 1$ and $\gcd(a_n, L_n) > 1$ occur for infinitely many $n \geq 1$, +where $L_n = \mathrm{lcm}(1, \ldots, n)$ and +$a_n = L_n \cdot H_n = \sum_{k=1}^{n} \frac{L_n}{k}$. +-/ +@[category research open, AMS 11] +theorem erdos_291 : answer(sorry) ↔ + (∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ 1 ≤ n ∧ + Nat.gcd (harmonicLcmNumerator n) (lcmInterval 0 n) = 1) ∧ + (∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ 1 ≤ n ∧ + Nat.gcd (harmonicLcmNumerator n) (lcmInterval 0 n) > 1) := by + sorry + +/-- +The first part of Erdős Problem 291: $\gcd(a_n, L_n) = 1$ occurs for infinitely many $n$. +This remains open. Shiu [Sh16] predicts approximately $x / \log x$ coprime cases in $[1, x]$. +-/ +@[category research open, AMS 11] +theorem erdos_291.variants.gcd_eq_one : + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ 1 ≤ n ∧ + Nat.gcd (harmonicLcmNumerator n) (lcmInterval 0 n) = 1 := by + sorry + +/-- +The second part of Erdős Problem 291: $\gcd(a_n, L_n) > 1$ occurs for infinitely many $n$. +This is true (Steinerberger): any $n$ whose leading digit in base 3 is 2 has +$3 \mid \gcd(a_n, L_n)$. +-/ +@[category research solved, AMS 11] +theorem erdos_291.variants.gcd_gt_one : + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ 1 ≤ n ∧ + Nat.gcd (harmonicLcmNumerator n) (lcmInterval 0 n) > 1 := by + sorry + +end Erdos291 diff --git a/FormalConjectures/ErdosProblems/292.lean b/FormalConjectures/ErdosProblems/292.lean new file mode 100644 index 0000000000..ff7aac832c --- /dev/null +++ b/FormalConjectures/ErdosProblems/292.lean @@ -0,0 +1,60 @@ +/- +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 + +/-! +# Erdős Problem 292 + +*Reference:* [erdosproblems.com/292](https://www.erdosproblems.com/292) + +Does the set of positive integers that can appear as the largest denominator in an +Egyptian fraction representation of 1 have natural density 1? + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ma00] Martin, G., *Dense Egyptian fractions*. Trans. Amer. Math. Soc. 351 (1999), +3641–3657. +-/ + +open Classical + +namespace Erdos292 + +/-- A positive integer $n$ is Egyptian representable if there exists a finite set +of distinct positive integers with maximum element $n$ whose reciprocals sum to $1$. +That is, there exist $1 \leq m_1 < \cdots < m_k = n$ with $\sum 1/m_i = 1$. -/ +def IsEgyptianRepresentable (n : ℕ) : Prop := + ∃ S : Finset ℕ, n ∈ S ∧ (∀ m ∈ S, 1 ≤ m) ∧ (∀ m ∈ S, m ≤ n) ∧ + (S.sum fun m => (1 : ℚ) / m) = 1 + +/-- +Erdős Problem 292 (Proved) [ErGr80, p.35]: + +Does the set of positive integers $n$ for which there exist $1 \leq m_1 < \cdots < m_k = n$ +with $\sum 1/m_i = 1$ have natural density $1$? + +Proved by Martin [Ma00], who showed the complementary set $B = \mathbb{N} \setminus A$ satisfies +$|B \cap [1,x]| / x \asymp \log \log x / \log x$. +-/ +@[category research solved, AMS 11] +theorem erdos_292 : answer(True) ↔ + {n : ℕ | IsEgyptianRepresentable n}.HasDensity 1 := by + sorry + +end Erdos292 diff --git a/FormalConjectures/ErdosProblems/293.lean b/FormalConjectures/ErdosProblems/293.lean new file mode 100644 index 0000000000..c43c5d6709 --- /dev/null +++ b/FormalConjectures/ErdosProblems/293.lean @@ -0,0 +1,110 @@ +/- +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 293 + +*Reference:* [erdosproblems.com/293](https://www.erdosproblems.com/293) + +Let $k \geq 1$ and let $v(k)$ be the minimal integer which does not appear as some $n_i$ +in a solution to $1 = 1/n_1 + \cdots + 1/n_k$ with $1 \leq n_1 < \cdots < n_k$. +Estimate the growth of $v(k)$. + +Known bounds: +- $v(k) \gg k!$ (Bleicher–Erdős [BlEr75]) +- $v(k) \geq e^{ck^2}$ for some $c > 0$ (van Doorn–Tang [vDTa25b]) +- $v(k) \leq k \cdot c_0^{2^k}$ where $c_0 \approx 1.26408$ is the Vardi constant + +It may be that $v(k)$ grows doubly exponentially in $\sqrt{k}$ or even $k$. + +[BlEr75] Bleicher, M.N. and Erdős, P., *Denominators of Egyptian fractions*, J. Number Theory (1975). + +[vDTa25b] van Doorn, F. and Tang, R. (2025). + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*, Monographies de L'Enseignement Mathématique (1980). +-/ + +open BigOperators Real Filter Finset Classical + +namespace Erdos293 + +/-- A positive integer $n$ appears in a $k$-term Egyptian fraction representation of $1$ +if there exists a $k$-element set $S$ of distinct positive integers with $n \in S$ +such that $\sum_{m \in S} 1/m = 1$. -/ +def AppearsInKTermEgyptian (k n : ℕ) : Prop := + ∃ S : Finset ℕ, S.card = k ∧ n ∈ S ∧ (∀ m ∈ S, 0 < m) ∧ + ∑ m ∈ S, (1 : ℚ) / (m : ℚ) = 1 + +/-- $v(k)$ is the smallest positive integer that does not appear in any representation +of $1$ as a sum of exactly $k$ distinct unit fractions. -/ +noncomputable def v (k : ℕ) : ℕ := + sInf {n : ℕ | 0 < n ∧ ¬AppearsInKTermEgyptian k n} + +/-- Bleicher–Erdős lower bound [BlEr75]: +There exists a constant $c > 0$ such that $v(k) \geq c \cdot k!$ for all $k \geq 1$. -/ +@[category research solved, AMS 11] +theorem erdos_293.variants.bleicher_erdos_lower : + ∃ c : ℝ, 0 < c ∧ ∀ k : ℕ, 1 ≤ k → + c * (Nat.factorial k : ℝ) ≤ (v k : ℝ) := by + sorry + +/-- van Doorn–Tang lower bound [vDTa25b]: +There exists a constant $c > 0$ such that $v(k) \geq e^{ck^2}$ for all +sufficiently large $k$. -/ +@[category research solved, AMS 11] +theorem erdos_293.variants.van_doorn_tang_lower : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + exp (c * (k : ℝ) ^ 2) ≤ (v k : ℝ) := by + sorry + +/-- Upper bound: $v(k) \leq k \cdot c_0^{2^k}$ where $c_0$ is the Vardi constant +($\approx 1.26408$). +There exists $c_0 > 1$ such that $v(k) \leq k \cdot c_0^{2^k}$ for all $k \geq 1$. -/ +@[category research solved, AMS 11] +theorem erdos_293.variants.upper_bound : + ∃ c₀ : ℝ, 1 < c₀ ∧ ∀ k : ℕ, 1 ≤ k → + (v k : ℝ) ≤ (k : ℝ) * c₀ ^ ((2 : ℝ) ^ (k : ℕ)) := by + sorry + +/-- +Erdős Problem 293 [ErGr80, p.35]: + +Conjecture: $v(k)$ grows doubly exponentially in $k$. That is, there exists a +constant $c > 0$ such that $v(k) \geq e^{e^{ck}}$ for all sufficiently large $k$. + +(A weaker form conjectures doubly exponential growth in $\sqrt{k}$.) +-/ +@[category research open, AMS 11] +theorem erdos_293 : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + exp (exp (c * (k : ℝ))) ≤ (v k : ℝ) := by + sorry + +/-- Weaker form of Erdős Problem 293: +$v(k)$ grows doubly exponentially in $\sqrt{k}$. That is, there exists a +constant $c > 0$ such that $v(k) \geq e^{e^{c\sqrt{k}}}$ for all sufficiently large $k$. + +This is implied by the main conjecture `erdos_293` but may be easier to establish. -/ +@[category research open, AMS 11] +theorem erdos_293.variants.weak_conjecture : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + exp (exp (c * Real.sqrt k)) ≤ (v k : ℝ) := by + sorry + +end Erdos293 diff --git a/FormalConjectures/ErdosProblems/294.lean b/FormalConjectures/ErdosProblems/294.lean new file mode 100644 index 0000000000..49b424f9ab --- /dev/null +++ b/FormalConjectures/ErdosProblems/294.lean @@ -0,0 +1,88 @@ +/- +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 294 + +*Reference:* [erdosproblems.com/294](https://www.erdosproblems.com/294) + +Let $N \geq 1$ and let $t(N)$ be the least integer $t$ such that there is no solution to +$$1 = 1/n_1 + \cdots + 1/n_k$$ +with $t = n_1 < \cdots < n_k \leq N$. Estimate $t(N)$. + +Erdős and Graham [ErGr80] showed $t(N) \ll N / \log N$, but had no idea of the true value +of $t(N)$. + +Solved by Liu and Sawhney [LiSa24] (up to $(\log \log N)^{O(1)}$), who proved +$$\frac{N}{(\log N)(\log \log N)^3 (\log \log \log N)^{O(1)}} \ll t(N) \ll \frac{N}{\log N}.$$ + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980). + +[LiSa24] Liu, J. and Sawhney, M., *Unit fractions* (2024). +-/ + +open Classical Real Finset + +namespace Erdos294 + +/-- There exists a representation of $1$ as a sum of distinct unit fractions +$1/n_1 + \cdots + 1/n_k$ with $t = n_1 < \cdots < n_k \leq N$. Formally: there exists a +finite set $S \subseteq \{t, \ldots, N\}$ containing $t$ whose reciprocals sum to $1$. -/ +def HasUnitFractionRepFrom (t N : ℕ) : Prop := + ∃ S : Finset ℕ, t ∈ S ∧ (∀ m ∈ S, t ≤ m) ∧ (∀ m ∈ S, m ≤ N) ∧ + -- Positivity guard: `ℚ`-division by zero yields 0 in Lean, so without this + -- the sum could silently drop terms and give a mathematically wrong result. + (∀ m ∈ S, 1 ≤ m) ∧ (S.sum fun m => (1 : ℚ) / m) = 1 + +/-- $t(N)$: the least positive integer $t$ such that there is no unit fraction +representation of $1$ using distinct integers from $\{t, \ldots, N\}$ starting at $t$. +Returns $N + 1$ as a default if no such $t$ exists (this default is never expected to +be reached for large $N$, since eventually the harmonic tail is too small). -/ +noncomputable def leastNoRep (N : ℕ) : ℕ := + if h : ∃ t : ℕ, 1 ≤ t ∧ ¬HasUnitFractionRepFrom t N then + Nat.find h + else + N + 1 + +/-- +Erdős Problem 294 — Upper bound (Erdős–Graham) [ErGr80]: + +There exists a constant $C > 0$ such that $t(N) \leq C \cdot N / \log N$ for all +sufficiently large $N$. +-/ +@[category research solved, AMS 11] +theorem erdos_294 : + ∃ C : ℝ, 0 < C ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (leastNoRep N : ℝ) ≤ C * (N : ℝ) / Real.log (N : ℝ) := by + sorry + +/-- +Erdős Problem 294 — Lower bound (Liu–Sawhney) [LiSa24]: + +There exist constants $c > 0$ and $K \geq 0$ such that for all sufficiently large $N$, +$$t(N) \geq c \cdot \frac{N}{(\log N) \cdot (\log \log N)^3 \cdot (\log \log \log N)^K}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_294.variants.lower : + ∃ c : ℝ, 0 < c ∧ ∃ K : ℕ, ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + c * (N : ℝ) / (Real.log (N : ℝ) * Real.log (Real.log (N : ℝ)) ^ 3 * + Real.log (Real.log (Real.log (N : ℝ))) ^ K) ≤ (leastNoRep N : ℝ) := by + sorry + +end Erdos294 diff --git a/FormalConjectures/ErdosProblems/296.lean b/FormalConjectures/ErdosProblems/296.lean new file mode 100644 index 0000000000..da1a61a700 --- /dev/null +++ b/FormalConjectures/ErdosProblems/296.lean @@ -0,0 +1,67 @@ +/- +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 296 + +*Reference:* [erdosproblems.com/296](https://www.erdosproblems.com/296) + +Let $N \geq 1$ and let $k(N)$ be maximal such that there exist $k$ pairwise disjoint +$A_1, \ldots, A_k \subseteq \{1, \ldots, N\}$ with $\sum_{n \in A_i} 1/n = 1$ for all $i$. + +Erdős and Graham [ErGr80] asked: Estimate $k(N)$. Is it true that $k(N) = o(\log N)$? + +Hunter and Sawhney observed that Theorem 3 of Bloom [Bl21], coupled with the +trivial greedy approach, implies $k(N) = (1 - o(1)) \log N$. In particular, +$k(N)$ is not $o(\log N)$; it grows like $\log N$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Bl21] Bloom, T., *On a density conjecture about unit fractions*. (2021). +-/ + +open Finset BigOperators + +namespace Erdos296 + +/-- The reciprocal sum $\sum_{n \in A} 1/n$ of a finite set of natural numbers. -/ +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) + +/-- +Erdős Problem 296 [ErGr80] (resolved by Hunter–Sawhney via Bloom [Bl21]): + +$k(N) = (1 - o(1)) \log N$, where $k(N)$ is the maximum number of pairwise +disjoint subsets of $\{1, \ldots, N\}$ whose reciprocal sums each equal $1$. + +We formalize the non-trivial lower bound: for every $\varepsilon > 0$, for all +sufficiently large $N$, one can find at least $(1 - \varepsilon) \ln N$ +pairwise disjoint subsets of $\{1, \ldots, N\}$, each with reciprocal sum exactly $1$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_296 (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ (k : ℕ) (family : Fin k → Finset ℕ), + (k : ℝ) ≥ (1 - ε) * Real.log (N : ℝ) ∧ + (∀ i, family i ⊆ Finset.Icc 1 N) ∧ + (∀ i j, i ≠ j → Disjoint (family i) (family j)) ∧ + (∀ i, reciprocalSum (family i) = 1) := by + sorry + +end Erdos296 diff --git a/FormalConjectures/ErdosProblems/297.lean b/FormalConjectures/ErdosProblems/297.lean new file mode 100644 index 0000000000..74a6dd09bb --- /dev/null +++ b/FormalConjectures/ErdosProblems/297.lean @@ -0,0 +1,98 @@ +/- +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 297 + +*Reference:* [erdosproblems.com/297](https://www.erdosproblems.com/297) + +Let $N \geq 1$. How many $A \subseteq \{1, \ldots, N\}$ are there such that +$\sum_{n \in A} \frac{1}{n} = 1$? + +It was not even known for a long time whether this is $2^{cN}$ for some $c < 1$ or +$2^{(1+o(1))N}$. In fact the former is true, and the correct value of $c$ is now known. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[St24] Steinerberger, S., *On a problem involving unit fractions* (2024). + +[LiSa24] Liu, Y. and Sawhney, M., *On further questions regarding unit fractions* (2024). + +[CFHMPSV24] Conlon, D., Fox, J., He, X., Mubayi, D., Pham, H.T., Suk, A., and Verstraëte, J., +*A question of Erdős and Graham on Egyptian fractions* (2024). + +See also: Problem 362, OEIS A092670. +-/ + +open Filter + +open scoped Topology + +namespace Erdos297 + +/-- Count of subsets $A \subseteq \{1, \ldots, N\}$ such that +$\sum_{n \in A} \frac{1}{n} = 1$. -/ +noncomputable def unitFractionSubsetCount (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter fun (A : Finset ℕ) => + (A.sum fun n => (1 : ℚ) / (n : ℚ)) = 1).card + +/-- +Erdős Problem 297 [ErGr80, p.36] + +There exists a constant $c \in (0, 1)$ such that the number of subsets +$A \subseteq \{1, \ldots, N\}$ with $\sum_{n \in A} \frac{1}{n} = 1$ is $2^{(c+o(1))N}$. + +Equivalently, $\log_2(\mathrm{count}(N)) / N \to c$ as $N \to \infty$. + +Steinerberger [St24] proved the count is at most $2^{0.93N}$. Independently, +Liu and Sawhney [LiSa24] gave both upper and lower bounds, proving that the +count is $2^{(0.91\ldots+o(1))N}$, where $0.91\ldots$ is an explicit number defined as +the solution to a certain integral equation. Again independently, the same +asymptotic was proved by Conlon–Fox–He–Mubayi–Pham–Suk–Verstraëte [CFHMPSV24]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_297 : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ + Tendsto (fun N : ℕ => + Real.log (unitFractionSubsetCount N : ℝ) / (Real.log 2 * (N : ℝ))) + atTop (nhds c) := by + sorry + +/-- Count of subsets $A \subseteq \{1, \ldots, N\}$ such that +$\sum_{n \in A} \frac{1}{n} = q$ for a given rational $q$. -/ +noncomputable def unitFractionSubsetCount_q (q : ℚ) (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter fun (A : Finset ℕ) => + (A.sum fun n => (1 : ℚ) / (n : ℚ)) = q).card + +/-- +Erdős Problem 297 — Generalization to arbitrary positive rationals [CFHMPSV24]: + +Conlon–Fox–He–Mubayi–Pham–Suk–Verstraëte proved that for any fixed $q \in \mathbb{Q}_{>0}$, +the number of subsets $A \subseteq \{1, \ldots, N\}$ with $\sum_{n \in A} 1/n = q$ satisfies +the same asymptotic $2^{(c+o(1))N}$ for the same constant $c \approx 0.91\ldots$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_297_variant (q : ℚ) (hq : 0 < q) : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ + Tendsto (fun N : ℕ => + Real.log (unitFractionSubsetCount_q q N : ℝ) / (Real.log 2 * (N : ℝ))) + atTop (nhds c) := by + sorry + +end Erdos297 diff --git a/FormalConjectures/ErdosProblems/300.lean b/FormalConjectures/ErdosProblems/300.lean new file mode 100644 index 0000000000..d530add553 --- /dev/null +++ b/FormalConjectures/ErdosProblems/300.lean @@ -0,0 +1,73 @@ +/- +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 300 + +*Reference:* [erdosproblems.com/300](https://www.erdosproblems.com/300) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Cr03] Croot, E., *On a coloring conjecture about unit fractions*. Annals of Mathematics (2003). + +[Va99] Vardi, I., §1.14. + +[LiSa24] Liu, J. and Sawhney, M., *On a conjecture of Erdős and Graham about Egyptian +fractions* (2024). +-/ + +open Finset BigOperators + +namespace Erdos300 + +/-- A finset $A$ of positive integers is *Egyptian-1-free* if no nonempty subset +$S \subseteq A$ has $\sum_{n \in S} 1/n = 1$. -/ +def Egyptian1Free (A : Finset ℕ) : Prop := + ∀ S : Finset ℕ, S ⊆ A → S.Nonempty → ∑ n ∈ S, (1 : ℝ) / (n : ℝ) ≠ 1 + +/-- +Erdős Problem 300 [ErGr80] [LiSa24]: + +Let $A(N)$ denote the maximal cardinality of $A \subseteq \{1, \ldots, N\}$ such that +$\sum_{n \in S} 1/n \neq 1$ for all nonempty $S \subseteq A$. Estimate $A(N)$. + +Erdős and Graham believed $A(N) = (1 + o(1))N$. Croot [Cr03] disproved this, showing +the existence of some constant $c < 1$ such that $A(N) < cN$ for all large $N$. The lower +bound $A(N) \geq (1 - 1/e + o(1))N$ is trivial (a greedy argument gives an Egyptian-1-free +set of this size). + +Liu and Sawhney [LiSa24] proved that $A(N) = (1 - 1/e + o(1))N$, resolving the problem. + +We formalize the resolved statement: for every $\varepsilon > 0$, for all sufficiently large $N$, +(1) every Egyptian-1-free $A \subseteq \{1, \ldots, N\}$ has +$|A| \leq (1 - 1/e + \varepsilon)N$, and +(2) there exists an Egyptian-1-free $A \subseteq \{1, \ldots, N\}$ with +$|A| \geq (1 - 1/e - \varepsilon)N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_300 : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → Egyptian1Free A → + (A.card : ℝ) ≤ (1 - Real.exp (-1) + ε) * (N : ℝ)) ∧ + (∃ (A : Finset ℕ), A ⊆ Finset.Icc 1 N ∧ Egyptian1Free A ∧ + (A.card : ℝ) ≥ (1 - Real.exp (-1) - ε) * (N : ℝ)) := by + sorry + +end Erdos300 diff --git a/FormalConjectures/ErdosProblems/301.lean b/FormalConjectures/ErdosProblems/301.lean new file mode 100644 index 0000000000..c86fe88be2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/301.lean @@ -0,0 +1,76 @@ +/- +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 301 + +Let $f(N)$ be the size of the largest subset of $\{1, \ldots, N\}$ such that no element has its +reciprocal equal to a sum of reciprocals of other elements. Erdős and Graham conjectured that +$f(N) = (1/2 + o(1))N$. + +*OEIS:* [A390394](https://oeis.org/A390394) + +*Related problems:* [302](https://www.erdosproblems.com/302), [327](https://www.erdosproblems.com/327) + +*Reference:* [erdosproblems.com/301](https://www.erdosproblems.com/301) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset BigOperators + +namespace Erdos301 + +/-- A finset $A$ of positive integers is *unit-fraction-sum-free* if for no +element $a \in A$ can $1/a$ be expressed as a sum $\sum_{b \in S} 1/b$ for some +nonempty $S \subseteq A$ with $a \notin S$. That is, there are no solutions to +$1/a = 1/b_1 + \cdots + 1/b_k$ with distinct $a, b_1, \ldots, b_k \in A$. -/ +def UnitFractionSumFree (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A → a ∉ S → S.Nonempty → + ∑ b ∈ S, (1 : ℝ) / (b : ℝ) ≠ (1 : ℝ) / (a : ℝ) + +/-- +Erdős Problem 301 [ErGr80]: + +Let $f(N)$ be the size of the largest $A \subseteq \{1, \ldots, N\}$ such that there are no +solutions to $1/a = 1/b_1 + \cdots + 1/b_k$ with distinct $a, b_1, \ldots, b_k \in A$. + +Estimate $f(N)$. In particular, is it true that $f(N) = (1/2 + o(1))N$? + +The example $A = (N/2, N] \cap \mathbb{N}$ shows that $f(N) \geq N/2$. Wouter van Doorn +has shown $f(N) \leq (25/28 + o(1))N$. + +We formalize the conjectured statement: for every $\varepsilon > 0$, for all +sufficiently large $N$, +(1) every unit-fraction-sum-free $A \subseteq \{1, \ldots, N\}$ has +$|A| \leq (1/2 + \varepsilon)N$, and +(2) there exists a unit-fraction-sum-free $A \subseteq \{1, \ldots, N\}$ with +$|A| \geq (1/2 - \varepsilon)N$. +-/ +@[category research open, AMS 5 11] +theorem erdos_301 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → UnitFractionSumFree A → + (A.card : ℝ) ≤ (1 / 2 + ε) * (N : ℝ)) ∧ + (∃ (A : Finset ℕ), A ⊆ Finset.Icc 1 N ∧ UnitFractionSumFree A ∧ + (A.card : ℝ) ≥ (1 / 2 - ε) * (N : ℝ)) := by + sorry + +end Erdos301 diff --git a/FormalConjectures/ErdosProblems/302.lean b/FormalConjectures/ErdosProblems/302.lean new file mode 100644 index 0000000000..8ae30b5dcd --- /dev/null +++ b/FormalConjectures/ErdosProblems/302.lean @@ -0,0 +1,134 @@ +/- +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 302 + +*Reference:* [erdosproblems.com/302](https://www.erdosproblems.com/302) + +Let $f(N)$ be the size of the largest subset of $\{1, \ldots, N\}$ with no solution to +$\frac{1}{a} = \frac{1}{b} + \frac{1}{c}$ among distinct elements. Is $f(N) = (\frac{1}{2} + o(1))N$? + +The example $A$ = all odd integers in $[1,N]$ or $A = [\frac{N}{2}, N]$ shows +$f(N) \geq (\frac{1}{2} + o(1))N$. Stijn Cambie improved this to +$f(N) \geq (\frac{5}{8} + o(1))N$. Wouter van Doorn proved +$f(N) \leq (\frac{9}{10} + o(1))N$. Zachary Hunter and Mehtaab Sawhney also +contributed to this problem. + +OEIS sequence: [A390395](https://oeis.org/A390395). + +Related problems: #301, #303, #327. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset + +namespace Erdos302 + +/-- A finset $A$ of positive integers is *unit-fraction-triple-free* if there are +no distinct $a, b, c \in A$ satisfying $\frac{1}{a} = \frac{1}{b} + \frac{1}{c}$. -/ +def UnitFractionTripleFree (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, + a ≠ b → a ≠ c → b ≠ c → + (1 : ℝ) / (a : ℝ) ≠ (1 : ℝ) / (b : ℝ) + (1 : ℝ) / (c : ℝ) + +/-- +Erdős Problem 302 [ErGr80]: + +Let $f(N)$ be the size of the largest $A \subseteq \{1, \ldots, N\}$ such that there are no +solutions to $\frac{1}{a} = \frac{1}{b} + \frac{1}{c}$ with distinct $a, b, c \in A$. + +Is $f(N) = (\frac{1}{2} + o(1))N$? + +The example $A$ = all odd integers in $[1,N]$ or $A = [\frac{N}{2}, N]$ shows +$f(N) \geq (\frac{1}{2} + o(1))N$. Stijn Cambie improved this to +$f(N) \geq (\frac{5}{8} + o(1))N$. Wouter van Doorn proved +$f(N) \leq (\frac{9}{10} + o(1))N$. + +The upper bound part of the original conjecture $f(N) = (\frac{1}{2} + o(1))N$ +has been disproved by Cambie's lower bound. The true asymptotic of $f(N)$ remains +open, with +$\frac{5}{8} \leq \liminf \frac{f(N)}{N} \leq \limsup \frac{f(N)}{N} \leq \frac{9}{10}$. + +We formalize the original conjecture as stated: for every $\varepsilon > 0$, for all +sufficiently large $N$, +(1) every unit-fraction-triple-free $A \subseteq \{1,\ldots,N\}$ has +$|A| \leq (\frac{1}{2} + \varepsilon)N$, and +(2) there exists a unit-fraction-triple-free $A \subseteq \{1,\ldots,N\}$ with +$|A| \geq (\frac{1}{2} - \varepsilon)N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_302 : answer(False) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → UnitFractionTripleFree A → + (A.card : ℝ) ≤ (1 / 2 + ε) * (N : ℝ)) ∧ + (∃ (A : Finset ℕ), A ⊆ Finset.Icc 1 N ∧ UnitFractionTripleFree A ∧ + (A.card : ℝ) ≥ (1 / 2 - ε) * (N : ℝ)) := by + sorry + +/-- +Erdős Problem 302 — Lower bound (Cambie): + +Stijn Cambie proved $f(N) \geq (\frac{5}{8} + o(1))N$ by taking all odd integers +$\leq N/4$ together with all integers in $[N/2, N]$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_302_lower_bound : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ (A : Finset ℕ), A ⊆ Finset.Icc 1 N ∧ UnitFractionTripleFree A ∧ + (A.card : ℝ) ≥ (5 / 8 - ε) * (N : ℝ) := by + sorry + +/-- +Erdős Problem 302 — Upper bound (van Doorn): + +Wouter van Doorn proved $f(N) \leq (\frac{9}{10} + o(1))N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_302_upper_bound : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → UnitFractionTripleFree A → + (A.card : ℝ) ≤ (9 / 10 + ε) * (N : ℝ) := by + sorry + +/-- +Erdős Problem 302 — Variant allowing $b = c$: + +When $b = c$ is permitted (i.e., $\frac{1}{a} = \frac{2}{b}$), the maximum density +drops to at most $\frac{2}{3}$, since any set with $|A| > (\frac{2}{3} + o(1))N$ +must contain some $n$ and $2n$. This variant asks whether the maximum size of a +subset of $\{1, \ldots, N\}$ with no solution to $\frac{1}{a} = \frac{1}{b} + \frac{1}{c}$ +(allowing $b = c$) is $(\frac{2}{3} + o(1))N$. +-/ +@[category research open, AMS 5 11] +theorem erdos_302_variant_equal_denominators : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → + (∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, + a ≠ b ∨ a ≠ c → + (1 : ℝ) / (a : ℝ) ≠ (1 : ℝ) / (b : ℝ) + (1 : ℝ) / (c : ℝ)) → + (A.card : ℝ) ≤ (2 / 3 + ε) * (N : ℝ) := by + sorry + +end Erdos302 diff --git a/FormalConjectures/ErdosProblems/305.lean b/FormalConjectures/ErdosProblems/305.lean new file mode 100644 index 0000000000..345bc47e46 --- /dev/null +++ b/FormalConjectures/ErdosProblems/305.lean @@ -0,0 +1,90 @@ +/- +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 305 + +*Reference:* [erdosproblems.com/305](https://www.erdosproblems.com/305) + +For integers $1 \leq a < b$, let $D(a,b)$ be the largest denominator in an optimal +Egyptian fraction representation of $a/b$, and let $D(b) = \max_{1 \leq a < b} D(a,b)$. +Is it true that $D(b) \ll b(\log b)^{1+o(1)}$? + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[BlEr76] Bleicher, M. N. and Erdős, P., *Denominators of Egyptian fractions*. J. Number Theory +**8** (1976), 157-168. + +[Yo88] Yokota, H., *On a problem of Bleicher and Erdős*. J. Number Theory **30** (1988), 198-207. + +[LiSa24] Liu, J. and Sawhney, M., *An improvement on Erdős-Graham's conjecture*. (2024). +-/ + +open Finset Real + +open scoped BigOperators + +namespace Erdos305 + +/-- +An *Egyptian fraction representation* of $a/b$ is a nonempty finset $S$ of positive +integers such that $\sum_{n \in S} 1/n = a/b$. Distinctness of denominators is +automatic from the finset structure. +-/ +def IsEgyptianRepr (a b : ℕ) (S : Finset ℕ) : Prop := + S.Nonempty ∧ (∀ n ∈ S, 0 < n) ∧ + ∑ n ∈ S, (1 : ℝ) / (n : ℝ) = (a : ℝ) / (b : ℝ) + +/-- +Erdős Problem 305 [ErGr80, p.38]: + +For integers $1 \leq a < b$, let $D(a,b)$ be the minimal value of the largest +denominator $n_k$ in an Egyptian fraction representation +$a/b = 1/n_1 + \cdots + 1/n_k$ with $1 \leq n_1 < \cdots < n_k$. + +Define $D(b) = \max_{1 \leq a < b} D(a,b)$. + +Is it true that $D(b) \ll b(\log b)^{1+o(1)}$? + +Bleicher and Erdős [BlEr76] showed $D(b) \ll b(\log b)^2$. +Yokota [Yo88] improved this to +$D(b) \ll b(\log b)(\log \log b)^4(\log \log \log b)^2$, +and Liu and Sawhney [LiSa24] further improved it to +$D(b) \ll b(\log b)(\log \log b)^3(\log \log \log b)^{O(1)}$. + +For primes $p$, it is known that $D(p) \gg p \log p$, showing that the conjectured +bound is essentially tight. + +We formalize: for every $\varepsilon > 0$, there exist $C > 0$ and $b_0$ such that +for all $b \geq b_0$ and all $1 \leq a < b$, there exists an Egyptian fraction +representation of $a/b$ whose largest denominator is at most +$C \cdot b \cdot (\log b)^{1+\varepsilon}$. +-/ +@[category research solved, AMS 11] +theorem erdos_305 : + answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∃ b₀ : ℕ, ∀ b : ℕ, b₀ ≤ b → + ∀ a : ℕ, 1 ≤ a → a < b → + ∃ S : Finset ℕ, IsEgyptianRepr a b S ∧ + ∀ n ∈ S, (n : ℝ) ≤ C * (b : ℝ) * (Real.log (b : ℝ)) ^ ((1 : ℝ) + ε) := by + sorry + +end Erdos305 diff --git a/FormalConjectures/ErdosProblems/308.lean b/FormalConjectures/ErdosProblems/308.lean new file mode 100644 index 0000000000..b7d31c630f --- /dev/null +++ b/FormalConjectures/ErdosProblems/308.lean @@ -0,0 +1,63 @@ +/- +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 308 + +*Reference:* [erdosproblems.com/308](https://www.erdosproblems.com/308) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Cr99] Croot, E., *On unit fractions*. Ph.D. thesis, University of Georgia (1999). +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos308 + +/-- +A positive integer $k$ is representable as a sum of distinct unit fractions with +denominators from $\{1, \ldots, N\}$ if there exists a subset $S \subseteq \{1, \ldots, N\}$ +such that $\sum_{n \in S} 1/n = k$. +-/ +def IsRepresentableUnitFractionSum (N : ℕ) (k : ℕ) : Prop := + ∃ S : Finset ℕ, (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (k : ℚ) + +/-- +Erdős Problem 308 [ErGr80]: + +Is it true that for every $N \geq 1$, the set of positive integers representable as sums of +distinct unit fractions with denominators from $\{1, \ldots, N\}$ has the shape +$\{1, \ldots, m\}$ for some $m$? + +This was essentially solved by Croot [Cr99], who showed that if $f(N)$ is the smallest +positive integer not so representable, and $m_N = \lfloor \sum_{n \leq N} 1/n \rfloor$, then +for all sufficiently large $N$ the set of representable positive integers is either +$\{1, \ldots, m_N - 1\}$ or $\{1, \ldots, m_N\}$. +-/ +@[category research solved, AMS 11] +theorem erdos_308 : answer(True) ↔ ∀ N : ℕ, 1 ≤ N → + ∃ m : ℕ, (∀ k : ℕ, 1 ≤ k → k ≤ m → IsRepresentableUnitFractionSum N k) ∧ + (∀ k : ℕ, m < k → ¬ IsRepresentableUnitFractionSum N k) := by + sorry + +end Erdos308 diff --git a/FormalConjectures/ErdosProblems/309.lean b/FormalConjectures/ErdosProblems/309.lean new file mode 100644 index 0000000000..8f087e5c83 --- /dev/null +++ b/FormalConjectures/ErdosProblems/309.lean @@ -0,0 +1,109 @@ +/- +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 309 + +*Reference:* [erdosproblems.com/309](https://www.erdosproblems.com/309) + +Let $F(N)$ count the number of positive integers representable as sums of distinct unit fractions +with denominators from $\{1, \ldots, N\}$. Erdős conjectured that $F(N) = o(\log N)$. This was +disproved by Yokota, who showed $F(N) = \Theta(\log N)$. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +[Yo97] Yokota, H., _On number of integers representable as a sum of unit fractions. II_. +J. Number Theory (1997), 162-169. + +[Cr99] Croot III, E. S., _On some questions of Erdős and Graham about Egyptian fractions_. +Mathematika (1999), 359-372. + +[Yo02] Yokota, H., _On the number of integers representable as sums of unit fractions. III_. +J. Number Theory (2002), 351-372. + +See also OEIS A217693. +-/ + +open Classical Filter + +open scoped BigOperators + +namespace Erdos309 + +/-- +A positive integer $k$ is representable as a sum of distinct unit fractions with +denominators from $\{1, \ldots, N\}$ if there exists a subset $S \subseteq \{1, \ldots, N\}$ such +that $\sum_{n \in S} 1/n = k$. +-/ +def IsRepresentableUnitFractionSum (N : ℕ) (k : ℕ) : Prop := + ∃ S : Finset ℕ, (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (k : ℚ) + +/-- +$F(N)$ counts the number of positive integers that can be represented as sums of distinct +unit fractions with denominators from $\{1, \ldots, N\}$. +-/ +noncomputable def countRepresentableIntegers (N : ℕ) : ℕ := + ((Finset.range (N + 1)).filter (fun k => 0 < k ∧ IsRepresentableUnitFractionSum N k)).card + +/-- +Erdős Problem 309 (disproved) [ErGr80]: + +Let $N \geq 1$. How many integers can be written as the sum of distinct unit fractions +with denominators from $\{1, \ldots, N\}$? Erdős conjectured that there are $o(\log N)$ such +integers. This was disproved. + +The trivial upper bound is $F(N) \leq \log N + O(1)$. Yokota [Yo97] proved that +$F(N) \geq \log N - O(\log \log N)$, establishing that $F(N) = \Theta(\log N)$. + +We formalize the negation of the original conjecture: there exists a positive +constant $c$ such that $F(N) \geq c \cdot \log N$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 11] +theorem erdos_309 : + ∃ c : ℝ, c > 0 ∧ ∀ᶠ (N : ℕ) in atTop, + c * Real.log (N : ℝ) ≤ (countRepresentableIntegers N : ℝ) := by + sorry + +/-- +Trivial upper bound for $F(N)$: the number of representable integers is at most $\log N + O(1)$, +since the full harmonic sum $\sum_{n=1}^{N} 1/n = \log N + \gamma + O(1/N)$ bounds the largest +representable integer. +-/ +@[category research solved, AMS 11] +theorem erdos_309_upper : + ∃ C : ℝ, ∀ᶠ (N : ℕ) in atTop, + (countRepresentableIntegers N : ℝ) ≤ Real.log (N : ℝ) + C := by + sorry + +/-- +Yokota's refined lower bound [Yo02]: $F(N) \geq \log N + \gamma - +(\pi^2/3 + o(1))(\log \log N)^2 / \log N$, where $\gamma$ is the Euler–Mascheroni constant. +This is the current best lower bound and establishes $F(N) = \Theta(\log N)$ together with the +trivial upper bound. +-/ +@[category research solved, AMS 11] +theorem erdos_309_yokota_lower : + ∀ ε > 0, ∀ᶠ (N : ℕ) in atTop, + Real.log (N : ℝ) + Real.eulerMascheroniConstant - + (Real.pi ^ 2 / 3 + ε) * (Real.log (Real.log (N : ℝ))) ^ 2 / Real.log (N : ℝ) + ≤ (countRepresentableIntegers N : ℝ) := by + sorry + +end Erdos309 diff --git a/FormalConjectures/ErdosProblems/31.lean b/FormalConjectures/ErdosProblems/31.lean new file mode 100644 index 0000000000..9e494217b1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/31.lean @@ -0,0 +1,60 @@ +/- +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 + +/-! +# Erdős Problem 31 + +*Reference:* [erdosproblems.com/31](https://www.erdosproblems.com/31) + +Given any infinite set $A \subset \mathbb{N}$, there exists a set $B$ of natural density zero +such that $A + B$ contains all except finitely many natural numbers. Proved by Lorentz [Lo54]. + +[Er56] Erdős, P., _Problems and results in additive number theory_. Colloque sur la Théorie +des Nombres, Bruxelles, 1955 (1956), 127-137. + +[Er59] Erdős, P., 1959. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. 8 (1965), +221–232. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117-138. + +[Lo54] Lorentz, G. G., _On a problem of additive number theory_. Proc. Amer. Math. Soc. 5 +(1954), 838–840. +-/ + +open scoped Classical Pointwise + +namespace Erdos31 + +/-- +**Erdős Problem 31** (Erdős–Straus, proved by Lorentz [Lo54]): + +Given any infinite set $A \subset \mathbb{N}$, there exists a set $B \subseteq \mathbb{N}$ +of natural density $0$ such that $A + B$ contains all except finitely many natural numbers. +-/ +@[category research solved, AMS 11] +theorem erdos_31 (A : Set ℕ) (hA : A.Infinite) : + ∃ B : Set ℕ, B.HasDensity 0 ∧ + Set.Finite {n : ℕ | n ∉ A + B} := by + sorry + +end Erdos31 diff --git a/FormalConjectures/ErdosProblems/310.lean b/FormalConjectures/ErdosProblems/310.lean new file mode 100644 index 0000000000..e493c28647 --- /dev/null +++ b/FormalConjectures/ErdosProblems/310.lean @@ -0,0 +1,63 @@ +/- +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 310 + +*Reference:* [erdosproblems.com/310](https://www.erdosproblems.com/310) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Bl21] Bloom, T., *On a density conjecture about unit fractions* (2021). + +[LiSa24] Liu, J. and Sawhney, M., *On a conjecture of Erdős on unit fractions* (2024). +-/ + +open Finset +open scoped BigOperators + +namespace Erdos310 + +/-- +Let $\alpha > 0$ and $N \geq 1$. For any $A \subseteq \{1, \ldots, N\}$ with +$|A| \geq \alpha N$, there exists some $S \subseteq A$ such that +$\sum_{n \in S} 1/n = a/b$ with $a \leq b = O_\alpha(1)$. + +That is, for every $\alpha > 0$ there exists a constant $C$ (depending only on $\alpha$) such +that for every $N \geq 1$ and every $A \subseteq \{1, \ldots, N\}$ with $|A| \geq \alpha N$, +there exist positive integers $a \leq b \leq C$ and a nonempty subset $S \subseteq A$ with +$\sum_{n \in S} 1/n = a/b$. + +Liu and Sawhney [LiSa24] observed that the main result of Bloom [Bl21] implies +a positive solution to this conjecture. They proved the more precise bound +$b \leq \exp(O(1/\alpha))$, which they showed to be sharp. +-/ +@[category research solved, AMS 5 11] +theorem erdos_310 : + ∀ α : ℝ, α > 0 → + ∃ C : ℕ, 0 < C ∧ + ∀ N : ℕ, 1 ≤ N → + ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 N → + α * (N : ℝ) ≤ (A.card : ℝ) → + ∃ S : Finset ℕ, S ⊆ A ∧ S.Nonempty ∧ + ∃ a b : ℕ, 0 < a ∧ a ≤ b ∧ b ≤ C ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (a : ℚ) / (b : ℚ) := by + sorry + +end Erdos310 diff --git a/FormalConjectures/ErdosProblems/311.lean b/FormalConjectures/ErdosProblems/311.lean new file mode 100644 index 0000000000..120326c944 --- /dev/null +++ b/FormalConjectures/ErdosProblems/311.lean @@ -0,0 +1,65 @@ +/- +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 311 + +*Reference:* [erdosproblems.com/311](https://www.erdosproblems.com/311) + +Let δ(N) denote the minimal non-zero value of |1 − Σ_{n ∈ A} 1/n| over subsets A of {1, …, N}. +The problem conjectures that δ(N) = e^{-(c+o(1))·N} for some constant c ∈ (0, 1). + +The original formulation in [ErGr80] additionally required that A contain no subset S with +∑_{n ∈ S} 1/n = 1 (i.e., A is Egyptian-1-free). Kovac showed that this restriction does not +affect the value of δ(N), so the two formulations are equivalent. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p. 40. +-/ + +open Real + +namespace Erdos311 + +/-- The minimal non-zero value of $\left|1 - \sum_{n \in A} \frac{1}{n}\right|$ as $A$ ranges over +all subsets of $\{1, \ldots, N\}$. -/ +noncomputable def unitFractionDeviation (N : ℕ) : ℝ := + sInf { x : ℝ | x > 0 ∧ ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ + x = |1 - ∑ n ∈ A, (1 : ℝ) / n| } + +/-- +Erdős Problem 311 [ErGr80, p. 40]: + +Let $\delta(N)$ be the minimal non-zero value of $\left|1 - \sum_{n \in A} \frac{1}{n}\right|$ as +$A$ ranges over all subsets of $\{1, \ldots, N\}$. The conjecture asserts that +$\delta(N) = e^{-(c+o(1))N}$ for some constant $c \in (0, 1)$. + +Equivalently, there exists $c \in (0, 1)$ such that for all $\varepsilon > 0$ and all +sufficiently large $N$: +$$e^{-(c + \varepsilon) \cdot N} \le \delta(N) \le e^{-(c - \varepsilon) \cdot N}.$$ +-/ +@[category research open, AMS 11] +theorem erdos_311 : answer(sorry) ↔ + (∃ c : ℝ, 0 < c ∧ c < 1 ∧ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + exp (-(c + ε) * N) ≤ unitFractionDeviation N ∧ + unitFractionDeviation N ≤ exp (-(c - ε) * N)) := by + sorry + +end Erdos311 diff --git a/FormalConjectures/ErdosProblems/314.lean b/FormalConjectures/ErdosProblems/314.lean new file mode 100644 index 0000000000..2fc80cdc61 --- /dev/null +++ b/FormalConjectures/ErdosProblems/314.lean @@ -0,0 +1,94 @@ +/- +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 314 + +*Reference:* [erdosproblems.com/314](https://www.erdosproblems.com/314) + +Let $n \geq 1$ and let $m$ be minimal such that $\sum_{k=n}^{m} \frac{1}{k} \geq 1$. Define +$\varepsilon(n) = \sum_{k=n}^{m} \frac{1}{k} - 1$. Is it true that +$\liminf_{n \to \infty} n^2 \varepsilon(n) = 0$? + +This is true, proved by Lim and Steinerberger [LiSt24]. They further showed +that for any $\delta > 0$, there exist infinitely many $n$ such that +$n^2 \left|\sum_{k=n}^{m} \frac{1}{k} - 1\right| \ll \frac{1}{(\log n)^{5/4 - \delta}}$. + +Erdős and Graham [ErGr80] believe the exponent $2$ is best possible, i.e., +$\liminf \varepsilon(n) n^{2+\delta} = \infty$ for all $\delta > 0$. + +[ErGr80, p. 41] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +[LiSt24] Lim, J. and Steinerberger, S., _On differences of two harmonic numbers_. +arXiv:2405.11354 (2024). +-/ + +open Finset BigOperators Filter Classical + +namespace Erdos314 + +/-- For any $n \geq 1$, there exists $m$ such that $\sum_{k=n}^{m} \frac{1}{k} \geq 1$. +This follows from the divergence of the harmonic series. -/ +@[category undergraduate, AMS 40] +lemma exists_harmonic_partial_sum_ge_one (n : ℕ) (hn : 1 ≤ n) : + ∃ m : ℕ, 1 ≤ ∑ k ∈ Finset.Icc n m, (1 : ℝ) / (k : ℝ) := by sorry + +/-- $m(n)$ is the minimal $m$ such that $\sum_{k=n}^{m} \frac{1}{k} \geq 1$, for $n \geq 1$. +Returns $0$ for $n = 0$. -/ +noncomputable def erdos314M (n : ℕ) : ℕ := + if h : 1 ≤ n then + Nat.find (exists_harmonic_partial_sum_ge_one n h) + else 0 + +/-- $\varepsilon(n) = \sum_{k=n}^{m(n)} \frac{1}{k} - 1$, where $m(n)$ is minimal with +$\sum_{k=n}^{m(n)} \frac{1}{k} \geq 1$. -/ +noncomputable def erdos314Epsilon (n : ℕ) : ℝ := + (∑ k ∈ Finset.Icc n (erdos314M n), (1 : ℝ) / (k : ℝ)) - 1 + +/-- +Erdős Problem 314 [ErGr80] (proved by Lim–Steinerberger [LiSt24]): + +Let $n \geq 1$ and let $m(n)$ be minimal such that $\sum_{k=n}^{m(n)} \frac{1}{k} \geq 1$. +Define $\varepsilon(n) = \sum_{k=n}^{m(n)} \frac{1}{k} - 1$. Then +$\liminf_{n \to \infty} n^2 \varepsilon(n) = 0$. + +Equivalently: for every $\delta > 0$ and every $N_0$, there exists $n \geq N_0$ with +$n \geq 1$ such that $n^2 \varepsilon(n) < \delta$. +-/ +@[category research solved, AMS 11 40] +theorem erdos_314 : answer(True) ↔ + (∀ δ : ℝ, 0 < δ → ∀ N₀ : ℕ, ∃ n : ℕ, N₀ ≤ n ∧ 1 ≤ n ∧ + (n : ℝ) ^ 2 * erdos314Epsilon n < δ) := by + sorry + +/-- +Erdős–Graham optimality conjecture [ErGr80, p. 41]: + +The exponent $2$ in Problem 314 is best possible, i.e., +$\liminf_{n \to \infty} \varepsilon(n) n^{2+\delta} = \infty$ for all $\delta > 0$. + +Equivalently: for every $\delta > 0$ and every $C > 0$, for all sufficiently large $n$ with +$n \geq 1$, we have $n^{2+\delta} \varepsilon(n) \geq C$. +-/ +@[category research open, AMS 11 40] +theorem erdos_314_optimality (δ : ℝ) (hδ : 0 < δ) : + Tendsto (fun n : ℕ => (n : ℝ) ^ (2 + δ) * erdos314Epsilon n) atTop atTop := by + sorry + +end Erdos314 diff --git a/FormalConjectures/ErdosProblems/315.lean b/FormalConjectures/ErdosProblems/315.lean new file mode 100644 index 0000000000..45dfe3c014 --- /dev/null +++ b/FormalConjectures/ErdosProblems/315.lean @@ -0,0 +1,84 @@ +/- +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 315 + +*Reference:* [erdosproblems.com/315](https://www.erdosproblems.com/315) + +Is it true that the Sylvester (greedy) sequence uniquely maximizes the growth rate +among all Egyptian fraction representations of 1? That is, if +$a_0 < a_1 < \ldots$ is any strictly increasing sequence of positive integers with +$\sum 1/a_n = 1$ other than the Sylvester sequence, is $\liminf a_n^{1/2^n} < c_0$, +where $c_0$ is the Vardi constant? + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. +Monographies de L'Enseignement Mathématique (1980). + +[Ka25] Kamio, Y., _Asymptotic analysis of infinite decompositions of a unit fraction into unit +fractions_. arXiv:2503.02317 (2025). + +[LiTa25] Li, Z. and Tang, Q., _On a conjecture of Erdős and Graham about the Sylvester's sequence_. +arXiv:2503.12277 (2025). + +See also OEIS sequences A000058 and A076393. +-/ + +open Filter + +open scoped Topology + +namespace Erdos315 + +/-- The auxiliary sequence $u_0 = 1$, $u_{n+1} = u_n(u_n + 1)$, + giving $1, 2, 6, 42, 1806, \ldots$ -/ +def sylvesterU : ℕ → ℕ + | 0 => 1 + | n + 1 => sylvesterU n * (sylvesterU n + 1) + +/-- The Sylvester sequence $s_n = u_n + 1$, giving $2, 3, 7, 43, 1807, \ldots$ + This is the greedy Egyptian fraction representation of $1$: + $\sum_n 1/s_n = 1$. -/ +def sylvesterSeq (n : ℕ) : ℕ := sylvesterU n + 1 + +/-- +Erdős Problem 315 [ErGr80, p.41]: + +The Sylvester sequence $(2, 3, 7, 43, 1807, \ldots)$ is defined by $s_0 = 2$ and +$s_{n+1} = s_n^2 - s_n + 1$. It satisfies $\sum 1/s_n = 1$ and +$\lim s_n^{1/2^n} = c_0 \approx 1.264085\ldots$ (the Vardi constant). + +The conjecture states: if $a_0 < a_1 < a_2 < \ldots$ is any strictly increasing +sequence of positive integers with $\sum 1/a_n = 1$, other than the Sylvester +sequence, then $\liminf a_n^{1/2^n} < c_0$. In other words, the Sylvester (greedy) +representation uniquely maximizes the growth rate $\liminf$. + +This was proved independently by Kamio [Ka25] and Li–Tang [LiTa25] in 2025. +-/ +@[category research solved, AMS 11 40] +theorem erdos_315 : answer(True) ↔ + ∀ (a : ℕ → ℕ), + StrictMono a → + (∀ n, 0 < a n) → + HasSum (fun n => (1 : ℝ) / (a n : ℝ)) 1 → + a ≠ sylvesterSeq → + Filter.liminf (fun n => (a n : ℝ) ^ ((2 : ℝ) ^ (n : ℕ))⁻¹) atTop < + Filter.liminf (fun n => (sylvesterSeq n : ℝ) ^ ((2 : ℝ) ^ (n : ℕ))⁻¹) atTop := by + sorry + +end Erdos315 diff --git a/FormalConjectures/ErdosProblems/320.lean b/FormalConjectures/ErdosProblems/320.lean new file mode 100644 index 0000000000..f9b61079fb --- /dev/null +++ b/FormalConjectures/ErdosProblems/320.lean @@ -0,0 +1,168 @@ +/- +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 320 + +*Reference:* [erdosproblems.com/320](https://www.erdosproblems.com/320) + +Let $S(N)$ count the number of distinct sums of the form $\sum_{n \in A} 1/n$ +for $A \subseteq \{1, \ldots, N\}$. Estimate $S(N)$. + +See also [Problem 321](https://www.erdosproblems.com/321) and +[OEIS A072207](https://oeis.org/A072207). + +## Known Bounds + +Bleicher and Erdős proved: +* **Lower bound** [BlEr75]: $\log S(N) \geq (N/\log N)(\log 2 \cdot \prod_{i=3}^{k} \log_i N)$ +* **Upper bound** [BlEr76b]: $\log S(N) \leq (N/\log N)(\log_r N \cdot \prod_{i=3}^{r} \log_i N)$ + +where $\log_i$ denotes the $i$-fold iterated logarithm. + +Bettin, Grenié, Molteni, and Sanna [BGMS25] improved the lower bound to: +$$\log S(N) \geq (N/\log N)(2 \log 2 (1 - 3/(2 \log_k N)) \cdot \prod_{i=3}^{k} \log_i N)$$ + +[BlEr75] Bleicher, M. N. and Erdős, P., _The number of distinct subsums of ∑₁ᴺ 1/i_. +Mathematics of Computation (1975), 29-42. + +[BlEr76b] Bleicher, M. N. and Erdős, P., _Denominators of Egyptian fractions. II_. +Illinois J. Math. (1976), 598-613. + +[BGMS25] Bettin, S., Grenié, L., Molteni, G., and Sanna, C., _A lower bound for the number +of Egyptian fractions_. arXiv:2509.10030 (2025). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique (1980). +-/ + +open Filter Real + +open scoped Finset + +namespace Erdos320 + +/-- The set of all unit-fraction subset sums from $\{1, \ldots, N\}$: +$\left\{ \sum_{n \in A} 1/n : A \subseteq \{1, \ldots, N\} \right\}$ as a finite set of +rationals. -/ +noncomputable def unitFractionSums (N : ℕ) : Finset ℚ := + (Finset.Icc 1 N).powerset.image + (fun A => A.sum (fun n => (1 : ℚ) / ↑n)) + +/-- $S(N)$ counts the number of distinct sums $\sum_{n \in A} 1/n$ +for $A \subseteq \{1, \ldots, N\}$. -/ +noncomputable def erdos320_S (N : ℕ) : ℕ := (unitFractionSums N).card + +/-- +**Erdős Problem 320** [ErGr80, p. 43]: + +Estimate $S(N)$, the number of distinct sums of the form $\sum_{n \in A} 1/n$ +for $A \subseteq \{1, \ldots, N\}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_320 (N : ℕ) : + erdos320_S N = answer(sorry) := by + sorry + +/- +Formalisation note: it's possible that the solution to `erdos_320` needs to be +expressed asymptotically. To handle this we include `IsTheta`, `IsBigO` +and `IsLittleO` variants below. Since a solution is not known this necessitates +the use of an `answer(sorry)` placeholder. Trivial or sub-optimal solutions +will therefore exist to the asymptotic formalisations. A true solution to +the asymptotic variants should have a degree of optimality or non-triviality to it. +-/ + +/-- +**Erdős Problem 320** (Theta variant): + +What is $\Theta(S(N))$? +-/ +@[category research open, AMS 5 11] +theorem erdos_320.variants.isTheta : + (fun N ↦ (erdos320_S N : ℝ)) =Θ[atTop] (answer(sorry) : ℕ → ℝ) := by + sorry + +/-- +**Erdős Problem 320** (Big-O variant): + +Find the simplest $g(N)$ such that $S(N) = O(g(N))$. +-/ +@[category research open, AMS 5 11] +theorem erdos_320.variants.isBigO : + (fun N ↦ (erdos320_S N : ℝ)) =O[atTop] (answer(sorry) : ℕ → ℝ) := by + sorry + +/-- +**Erdős Problem 320** (Little-o variant): + +Find the simplest $g(N)$ such that $S(N) = o(g(N))$. +-/ +@[category research open, AMS 5 11] +theorem erdos_320.variants.isLittleO : + (fun N ↦ (erdos320_S N : ℝ)) =o[atTop] (answer(sorry) : ℕ → ℝ) := by + sorry + +/-- +**Erdős Problem 320** (Known lower bound, Bleicher–Erdős 1975): + +$\log S(N) \geq (N / \log N) \cdot \log 2 \cdot \prod_{i=3}^{k} \log_i N$, +valid for any $k \geq 4$ with $\log_k N \geq k$. + +[BlEr75] Bleicher, M. N. and Erdős, P., _The number of distinct subsums of ∑₁ᴺ 1/i_. +Mathematics of Computation (1975), 29-42. +-/ +@[category research solved, AMS 5 11] +theorem erdos_320.variants.lower (N k : ℕ) (hk : 4 ≤ k) (hkN : k ≤ log^[k] N) : + N / log N * (log 2 * ∏ i ∈ Finset.Icc 3 k, (log^[i] N)) ≤ + log (erdos320_S N : ℝ) := by + sorry + +/-- +**Erdős Problem 320** (Known upper bound, Bleicher–Erdős 1976): + +$\log S(N) \leq (N / \log N) \cdot \log_r N \cdot \prod_{i=3}^{r} \log_i N$, +valid for any $r \geq 1$ with $\log_{2r} N \geq 1$. + +[BlEr76b] Bleicher, M. N. and Erdős, P., _Denominators of Egyptian fractions. II_. +Illinois J. Math. (1976), 598-613. +-/ +@[category research solved, AMS 5 11] +theorem erdos_320.variants.upper (N r : ℕ) (hr : 1 ≤ r) (hrN : 1 ≤ log^[2 * r] N) : + log (erdos320_S N : ℝ) ≤ + N / log N * (log^[r] N * ∏ i ∈ Finset.Icc 3 r, (log^[i] N)) := by + sorry + +/-- +**Erdős Problem 320** (Improved lower bound, BGMS 2025): + +$\log S(N) \geq (N / \log N) \cdot 2 \log 2 \cdot (1 - 3/(2 \log_k N)) \cdot +\prod_{i=3}^{k} \log_i N$, +valid for any $k \geq 4$ with $\log_k N \geq k$. + +[BGMS25] Bettin, S., Grenié, L., Molteni, G., and Sanna, C., _A lower bound for the number +of Egyptian fractions_. arXiv:2509.10030 (2025). +-/ +@[category research solved, AMS 5 11] +theorem erdos_320.variants.lower_improved (N k : ℕ) (hk : 4 ≤ k) (hkN : k ≤ log^[k] N) : + N / log N * (2 * log 2 * (1 - 3 / (2 * log^[k] N)) * + ∏ i ∈ Finset.Icc 3 k, (log^[i] N)) ≤ + log (erdos320_S N : ℝ) := by + sorry + +end Erdos320 diff --git a/FormalConjectures/ErdosProblems/322.lean b/FormalConjectures/ErdosProblems/322.lean new file mode 100644 index 0000000000..ac2ac3f497 --- /dev/null +++ b/FormalConjectures/ErdosProblems/322.lean @@ -0,0 +1,82 @@ +/- +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 322 + +*Reference:* [erdosproblems.com/322](https://www.erdosproblems.com/322) + +Let $k \geq 3$ and let $A$ be the set of $k$-th powers. Define $1_A^{(k)}(n)$ as +the number of representations of $n$ as the sum of $k$ many $k$-th powers, +i.e., the number of tuples $(a_1, \ldots, a_k) \in \mathbb{N}^k$ with +$a_1^k + \cdots + a_k^k = n$. + +The conjecture asks: for each $k \geq 3$, does there exist some $c > 0$ and +infinitely many $n$ such that $1_A^{(k)}(n) > n^c$? + +Connected to Waring's problem. The famous Hypothesis K of Hardy and Littlewood +asserted $1_A^{(k)}(n) \leq n^{o(1)}$, which was disproved by Mahler [Ma36] for +$k = 3$, who showed $1_A^{(3)}(n) \gg n^{1/12}$ for infinitely many $n$. Erdős +[Er36] believed Hypothesis K fails for all $k \geq 4$, but this remains unknown. + +## References + +[Er36] Erdős, P., *On the representation of an integer as the sum of k k-th powers*. +Journal of the London Mathematical Society (1936), 133-136. + +[Ma36] Mahler, K., *Note on Hypothesis K of Hardy and Littlewood*. Journal of the +London Mathematical Society (1936), 136-138. + +[Er65b] Erdős, P., *Some recent advances and current problems in number theory*. +Lectures on Modern Mathematics, Vol. III (1965), 196-244. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathématique (1980). + +[Gu04] Guy, R., *Unsolved problems in number theory* (2004). + +OEIS: A025456, A025418 +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos322 + +/-- The number of representations of $n$ as a sum of $k$ many $k$-th powers of +natural numbers: $|\{(a_1, \ldots, a_k) \in \mathbb{N}^k : a_1^k + \cdots + a_k^k = n\}|$. +Each component $a_i$ is bounded by $n$ since $a_i^k \leq n$ for $k \geq 1$. -/ +noncomputable def kthPowerReps (k n : ℕ) : ℕ := + (Finset.univ.filter (fun f : Fin k → Fin (n + 1) => + (∑ i, (f i : ℕ) ^ k) = n)).card + +/-- +**Erdős Problem 322**: For every $k \geq 3$, there exists $c > 0$ such that +the number of representations of $n$ as a sum of $k$ many $k$-th powers +exceeds $n^c$ for infinitely many $n$. +-/ +@[category research open, AMS 11] +theorem erdos_322 : + answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → + ∃ c : ℝ, 0 < c ∧ + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ (kthPowerReps k n : ℝ) > (n : ℝ) ^ c := by + sorry + +end Erdos322 diff --git a/FormalConjectures/ErdosProblems/323.lean b/FormalConjectures/ErdosProblems/323.lean new file mode 100644 index 0000000000..a62ff1a67a --- /dev/null +++ b/FormalConjectures/ErdosProblems/323.lean @@ -0,0 +1,81 @@ +/- +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 323 + +If $f_{k,m}(x)$ counts the natural numbers at most $x$ that can be represented as a sum of $m$ +nonnegative $k$-th powers, Erdős and Graham conjectured lower bounds on $f_{k,m}(x)$: that +$f_{k,k}(x) \gg_\varepsilon x^{1-\varepsilon}$ for every $\varepsilon > 0$, and that +$f_{k,m}(x) \gg x^{m/k}$ when $m < k$. + +*Reference:* [erdosproblems.com/323](https://www.erdosproblems.com/323) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset Classical + +open scoped BigOperators + +namespace Erdos323 + +/-- An integer $n$ is a sum of $m$ nonnegative $k$-th powers if there exist +nonnegative integers $a_1, \ldots, a_m$ with $n = a_1^k + \cdots + a_m^k$. -/ +def IsSumOfKthPowers (k m n : ℕ) : Prop := + ∃ a : Fin m → ℕ, n = ∑ i, (a i) ^ k + +/-- $f_{k,m}(x)$ counts the number of natural numbers $\leq x$ which can be +represented as a sum of $m$ nonnegative $k$-th powers. -/ +noncomputable def fKm (k m x : ℕ) : ℕ := + ((Finset.range (x + 1)).filter (fun n => IsSumOfKthPowers k m n)).card + +/-- +**Erdős Problem 323, Part 1** [ErGr80]: + +For every $k \geq 1$ and $\varepsilon > 0$, $f_{k,k}(x) \gg_\varepsilon x^{1-\varepsilon}$, +i.e., there exists a constant $C > 0$ (depending on $k$ and $\varepsilon$) such that +$f_{k,k}(x) \geq C \cdot x^{1-\varepsilon}$ for all sufficiently large $x$. +-/ +@[category research open, AMS 11] +theorem erdos_323 : + ∀ k : ℕ, 1 ≤ k → + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + C * (x : ℝ) ^ (1 - ε) ≤ (fKm k k x : ℝ) := by + sorry + +/-- +**Erdős Problem 323, Part 2** [ErGr80]: + +For $1 \leq m < k$, $f_{k,m}(x) \gg x^{m/k}$, i.e., there exists a constant $C > 0$ +(depending on $k$ and $m$) such that $f_{k,m}(x) \geq C \cdot x^{m/k}$ for all +sufficiently large $x$. +-/ +@[category research open, AMS 11] +theorem erdos_323.variants.m_lt_k : + ∀ k : ℕ, 2 ≤ k → + ∀ m : ℕ, 1 ≤ m → m < k → + ∃ C : ℝ, 0 < C ∧ + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + C * (x : ℝ) ^ ((m : ℝ) / (k : ℝ)) ≤ (fKm k m x : ℝ) := by + sorry + +end Erdos323 diff --git a/FormalConjectures/ErdosProblems/327.lean b/FormalConjectures/ErdosProblems/327.lean new file mode 100644 index 0000000000..bb48624005 --- /dev/null +++ b/FormalConjectures/ErdosProblems/327.lean @@ -0,0 +1,89 @@ +/- +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 327 + +*Reference:* [erdosproblems.com/327](https://www.erdosproblems.com/327) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +Related problems: #301, #302. +OEIS: [A384927](https://oeis.org/A384927). +-/ + +open Finset + +namespace Erdos327 + +/-- A finite set $A$ of positive integers is *unit-fraction-pair-free* if there are +no distinct $a, b \in A$ satisfying $(a + b) \mid ab$, equivalently, no distinct +$a, b \in A$ such that $\frac{1}{a} + \frac{1}{b}$ is a unit fraction. -/ +def UnitFractionPairFree (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, a ≠ b → ¬((a + b) ∣ (a * b)) + +/-- A finite set $A$ of positive integers satisfies the strong unit-fraction-pair +condition if there are no distinct $a, b \in A$ satisfying $(a + b) \mid 2ab$. -/ +def StrongUnitFractionPairFree (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, a ≠ b → ¬((a + b) ∣ (2 * a * b)) + +/-- +Erdős Problem 327 [ErGr80]: Suppose $A \subseteq \{1, \ldots, N\}$ is such that for all +distinct $a, b \in A$, $(a + b) \nmid ab$ (equivalently, $\frac{1}{a} + \frac{1}{b}$ is never +a unit fraction). The odd numbers in $\{1, \ldots, N\}$ give a set of size $\sim N/2$ with this +property. We conjecture the maximum size is $(\frac{1}{2} + o(1))N$. + +Note: Wouter van Doorn has shown that the density cannot exceed $25/28$. +-/ +@[category research open, AMS 5 11] +theorem erdos_327 : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → UnitFractionPairFree A → + (A.card : ℝ) ≤ (1 / 2 + ε) * (N : ℝ) := by + sorry + +/-- +Lower bound for Erdős Problem 327: the odd numbers in $\{1, \ldots, N\}$ witness that there +exists a `UnitFractionPairFree` subset of size $\geq (\frac{1}{2} - \varepsilon) N$ for any +$\varepsilon > 0$ and sufficiently large $N$. Together with `erdos_327`, this shows the maximum +size is $(\frac{1}{2} + o(1))N$. +-/ +@[category undergraduate, AMS 5 11] +theorem erdos_327.variants.lower_bound : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ (A : Finset ℕ), A ⊆ Finset.Icc 1 N ∧ UnitFractionPairFree A ∧ + (A.card : ℝ) ≥ (1 / 2 - ε) * (N : ℝ) := by + sorry + +/-- +Strong variant of Erdős Problem 327 [ErGr80]: If $a, b \in A$ with $a \neq b$ implies +$(a + b) \nmid 2ab$, must $|A| = o(N)$? This strengthens the divisibility condition in +`erdos_327` by replacing $ab$ with $2ab$. +-/ +@[category research open, AMS 5 11] +theorem erdos_327.variants.strong : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → StrongUnitFractionPairFree A → + (A.card : ℝ) ≤ ε * (N : ℝ) := by + sorry + +end Erdos327 diff --git a/FormalConjectures/ErdosProblems/328.lean b/FormalConjectures/ErdosProblems/328.lean new file mode 100644 index 0000000000..85caf747de --- /dev/null +++ b/FormalConjectures/ErdosProblems/328.lean @@ -0,0 +1,65 @@ +/- +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.Combinatorics.Additive.Convolution + +/-! +# Erdős Problem 328 + +*Reference:* [erdosproblems.com/328](https://www.erdosproblems.com/328) + +Suppose $A \subseteq \mathbb{N}$ has bounded additive representation function +($(1_A \ast 1_A)(n) \leq C$ for all $n$). Can $A$ be partitioned into finitely many subsets, +each with strictly smaller representation function? Nešetřil and Rödl showed the answer is no. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er80e] Erdős, P., *Some applications of Ramsey's theorem to additive number theory*. +European Journal of Combinatorics (1980), 43–46. + +[NeRo85] Nešetřil, J. and Rödl, V., *Two proofs in combinatorial number theory*. +Proceedings of the American Mathematical Society (1985), 185–188. +-/ + +open Classical Finset AdditiveCombinatorics + +namespace Erdos328 + +/-- +Erdős Problem 328 [ErGr80, p.48]: + +Suppose $A \subseteq \mathbb{N}$ and $C > 0$ is such that $(1_A \ast 1_A)(n) \leq C$ for all +$n \in \mathbb{N}$. Can $A$ be partitioned into $t$ many subsets $A_1, \ldots, A_t$ +(where $t = t(C)$ depends only on $C$) such that $(1_{A_i} \ast 1_{A_i})(n) < C$ for all +$1 \leq i \leq t$ and $n \in \mathbb{N}$? + +Asked by Erdős and Newman. Nešetřil and Rödl [NeRo85] showed the answer is no +for all $C$ (even if $t$ is also allowed to depend on $A$). Erdős [Er80e] had +previously shown this for $C = 3, 4$ and infinitely many other values of $C$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_328 : answer(False) ↔ + ¬(∀ C : ℕ, 1 ≤ C → + ∀ A : Set ℕ, (∀ n, sumRep A n ≤ C) → + ∃ t : ℕ, 1 ≤ t ∧ + ∃ f : ℕ → Fin t, + ∀ (i : Fin t) (n : ℕ), + sumRep {a ∈ A | f a = i} n < C) := by + sorry + +end Erdos328 diff --git a/FormalConjectures/ErdosProblems/333.lean b/FormalConjectures/ErdosProblems/333.lean new file mode 100644 index 0000000000..ba7b9e4ee9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/333.lean @@ -0,0 +1,62 @@ +/- +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 + +/-! +# Erdős Problem 333 + +*Reference:* [erdosproblems.com/333](https://www.erdosproblems.com/333) + +See also Problem 806. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathématique (1980). + +[ErNe77] Erdős, P. and Newman, D.J., *Bases for sets of integers*. Journal of Number +Theory **9** (1977), 420–425. +-/ + +open scoped Classical + +namespace Erdos333 + +/-- +Erdős Problem 333 [ErGr80] (DISPROVED): + +Let $A \subseteq \mathbb{N}$ be a set of density zero. Does there exist a set +$B \subseteq \mathbb{N}$ such that $A \subseteq B + B$ and +$|B \cap \{1, \ldots, N\}| = o(N^{1/2})$? + +Here $B + B = \{b_1 + b_2 \mid b_1, b_2 \in B\}$ is the sumset of $B$ with itself, and +$o(N^{1/2})$ means that $|B \cap \{1, \ldots, N\}| / N^{1/2} \to 0$ as $N \to \infty$. + +Erdős and Newman [ErNe77] proved this is true when $A$ is the set of squares. +However, Theorem 2 of [ErNe77] already implies a negative answer to this +problem in general, though this was overlooked by Erdős and Graham. +-/ +@[category research solved, AMS 5 11] +theorem erdos_333 : answer(False) ↔ + ∀ A : Set ℕ, A.upperDensity = 0 → + ∃ B : Set ℕ, + A ⊆ Set.image2 (· + ·) B B ∧ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (((Finset.Icc 1 N).filter (· ∈ B)).card : ℝ) ≤ ε * (N : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos333 diff --git a/FormalConjectures/ErdosProblems/334.lean b/FormalConjectures/ErdosProblems/334.lean new file mode 100644 index 0000000000..ee113a56c2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/334.lean @@ -0,0 +1,64 @@ +/- +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 334 + +*Reference:* [erdosproblems.com/334](https://www.erdosproblems.com/334) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er82d] Erdős, P., _Problems and results in number theory_. In: Recent progress in analytic +number theory, Vol. 1 (Durham, 1979), Academic Press, London-New York (1981), 1-13. + +[Ba89] Balog, A., _On the distribution of integers having no large prime factor_. Astérisque +(1989). + +OEIS: [A062241](https://oeis.org/A062241), [A045535](https://oeis.org/A045535) +-/ + +namespace Erdos334 + +/-- A natural number is $B$-smooth if all its prime factors are at most $B$. -/ +def IsSmooth (B n : ℕ) : Prop := ∀ p ∈ n.primeFactorsList, p ≤ B + +/-- +Erdős Problem 334 [ErGr80, p.70] [Er82d, p.55]: + +Find the best function $f(n)$ such that every $n$ can be written as $n = a + b$ +where both $a$, $b$ are $f(n)$-smooth (not divisible by any prime $p > f(n)$). + +Erdős originally asked if $f(n) \leq n^{1/3}$. Balog [Ba89] proved +$f(n) \ll_\varepsilon n^{4/(9\sqrt{e}) + \varepsilon}$ for all $\varepsilon > 0$. +It is conjectured that $f(n) \leq n^{o(1)}$, or even $f(n) \leq e^{O(\sqrt{\log n})}$. + +We formalize the conjecture that $f(n) = n^{o(1)}$: for every $\varepsilon > 0$, +for sufficiently large $n$, $n$ can be written as a sum of two +$\lfloor n^\varepsilon \rfloor$-smooth numbers. +-/ +@[category research open, AMS 11] +theorem erdos_334 : + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ a b : ℕ, a + b = n ∧ + IsSmooth (⌊(n : ℝ) ^ ε⌋₊) a ∧ + IsSmooth (⌊(n : ℝ) ^ ε⌋₊) b := by + sorry + +end Erdos334 diff --git a/FormalConjectures/ErdosProblems/335.lean b/FormalConjectures/ErdosProblems/335.lean new file mode 100644 index 0000000000..6e48bb78c9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/335.lean @@ -0,0 +1,76 @@ +/- +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 335 + +Characterise those $A, B \subseteq \mathbb{N}$ with positive natural density such that +$d(A + B) = d(A) + d(B)$. The conjecture is that such sets must arise from measurable subsets +of a compact abelian group via a group rotation with the corresponding measure additivity property. + +*Reference:* [erdosproblems.com/335](https://www.erdosproblems.com/335) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Classical Filter MeasureTheory + +namespace Erdos335 + +/-- +Erdős Problem 335 [ErGr80, p.51]: + +Let $d(A)$ denote the natural density of $A \subseteq \mathbb{N}$. Characterise those +$A, B \subseteq \mathbb{N}$ with positive density such that $d(A + B) = d(A) + d(B)$. + +One way this can happen is if there exists $\theta > 0$ such that +$A = \{n > 0 : \mathrm{fract}(n\theta) \in X_A\}$ and +$B = \{n > 0 : \mathrm{fract}(n\theta) \in X_B\}$ where +$X_A, X_B \subseteq \mathbb{R}/\mathbb{Z}$ are measurable with +$\mu(X_A + X_B) = \mu(X_A) + \mu(X_B)$. + +The conjecture asks whether all such $A$ and $B$ are generated in a similar way +(possibly using other compact abelian groups in place of $\mathbb{R}/\mathbb{Z}$). +We formalize one direction of the specific $\mathbb{R}/\mathbb{Z}$ version of the +conjectured characterisation: if $d(A+B) = d(A)+d(B)$ with positive densities, then +$A$ and $B$ arise from measurable subsets of $[0,1)$ via an irrational rotation, with +the corresponding measure additivity property. The reverse direction (that such +constructions yield additive density) is not formalized here. +-/ +@[category research open, AMS 5 11] +theorem erdos_335 : + ∀ (A B : Set ℕ) (dA dB : ℝ), + A.HasDensity dA → + B.HasDensity dB → + 0 < dA → 0 < dB → + (Set.image2 (· + ·) A B).HasDensity (dA + dB) → + ∃ (θ : ℝ) (X_A X_B : Set ℝ), + Irrational θ ∧ + MeasurableSet X_A ∧ MeasurableSet X_B ∧ + X_A ⊆ Set.Ico 0 1 ∧ X_B ⊆ Set.Ico 0 1 ∧ + volume X_A = ENNReal.ofReal dA ∧ + volume X_B = ENNReal.ofReal dB ∧ + -- Sumset in ℝ/ℤ, identified with [0,1) via fractional parts + volume (Set.image2 (fun a b => Int.fract (a + b)) X_A X_B) = + volume X_A + volume X_B ∧ + (∀ n : ℕ, 0 < n → (n ∈ A ↔ Int.fract ((n : ℝ) * θ) ∈ X_A)) ∧ + (∀ n : ℕ, 0 < n → (n ∈ B ↔ Int.fract ((n : ℝ) * θ) ∈ X_B)) := by + sorry + +end Erdos335 diff --git a/FormalConjectures/ErdosProblems/336.lean b/FormalConjectures/ErdosProblems/336.lean new file mode 100644 index 0000000000..f000264a76 --- /dev/null +++ b/FormalConjectures/ErdosProblems/336.lean @@ -0,0 +1,86 @@ +/- +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 336 + +For $r \geq 2$, let $h(r)$ be the maximal finite $k$ such that there exists an additive basis +$A \subseteq \mathbb{N}$ of order $r$ that also has exact order $k$. Find the value of +$\lim_{r\to\infty} h(r)/r^2$. It is known that $1/3 \leq \lim h(r)/r^2 \leq 1/2$. + +*Reference:* [erdosproblems.com/336](https://www.erdosproblems.com/336) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +[ErGr80b] Erdős, P. and Graham, R., _On bases with an exact order_. Acta Arithmetica +(1980), 201–207. + +[Gr88] Grekos, G., _Sur l'ordre d'une base additive_. (1988), Exp. No. 31, 13 pp. + +[Na93] Nash, J.C.M., _Some applications of a theorem of M. Kneser_. Journal of Number +Theory (1993), 1–8. + +[Pl04] Plagne, A., _À propos de la fonction X d'Erdős et Graham_. Annales de l'Institut +Fourier (Grenoble) (2004), 1717–1767. +-/ + +open Filter + +open scoped Topology BigOperators + +namespace Erdos336 + +/-- The set of all sums of exactly $k$ elements from $A$ (with repetition allowed). -/ +def exactSumset (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (f : Fin k → ℕ), (∀ i, f i ∈ A) ∧ n = ∑ i, f i} + +/-- $A \subseteq \mathbb{N}$ is an additive basis of order $r$ if every sufficiently large +natural number is the sum of at most $r$ elements from $A$. -/ +def IsAdditiveBasis (A : Set ℕ) (r : ℕ) : Prop := + ∃ N : ℕ, ∀ n ≥ N, ∃ k ≤ r, n ∈ exactSumset A k + +/-- $A$ has exact order $k$ if every sufficiently large natural number is the sum of +exactly $k$ elements from $A$. -/ +def HasExactOrder (A : Set ℕ) (k : ℕ) : Prop := + ∃ N : ℕ, ∀ n ≥ N, n ∈ exactSumset A k + +/-- $h(r)$ is the maximal $k$ such that some basis of order $r$ has exact order $k$. -/ +noncomputable def hBasis (r : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Set ℕ, IsAdditiveBasis A r ∧ HasExactOrder A k} + +/-- +Erdős Problem 336 [ErGr80, p.51]: + +For $r \geq 2$ let $h(r)$ be the maximal finite $k$ such that there exists a basis +$A \subseteq \mathbb{N}$ of order $r$ (every sufficiently large integer is the sum of at most +$r$ elements from $A$) and exact order $k$ (every sufficiently large integer is the sum of +exactly $k$ elements from $A$). + +Find the value of $\lim_{r\to\infty} h(r)/r^2$. + +Known bounds: $1/3 \leq \lim h(r)/r^2 \leq 1/2$ (lower bound due to Grekos [Gr88], upper +bound due to Nash [Na93]). +-/ +@[category research open, AMS 11] +theorem erdos_336 : + Tendsto (fun r : ℕ => (hBasis r : ℝ) / ((r : ℝ) ^ 2)) + atTop (nhds (answer(sorry))) := by + sorry + +end Erdos336 diff --git a/FormalConjectures/ErdosProblems/337.lean b/FormalConjectures/ErdosProblems/337.lean new file mode 100644 index 0000000000..feeafc5986 --- /dev/null +++ b/FormalConjectures/ErdosProblems/337.lean @@ -0,0 +1,115 @@ +/- +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 + +/-! +# Erdős Problem 337 + +*Reference:* [erdosproblems.com/337](https://www.erdosproblems.com/337) + +Is it true that for an additive basis $A$ of density $o(N)$, the ratio +$|(A+A) \cap \{1,\ldots,N\}| / |A \cap \{1,\ldots,N\}|$ tends to infinity? +The answer is no, as shown by Turjányi. + +Ruzsa and Turjányi [RT85] generalised this negative answer to the $h$-fold sumset $hA$ +for any $h \geq 2$. They also proved the positive result that +$|(A+A+A) \cap \{1,\ldots,3N\}| / |A \cap \{1,\ldots,N\}| \to \infty$ +for any additive basis $A$ of density $o(N)$, and conjectured that the same holds with +$(A+A) \cap \{1,\ldots,2N\}$ in the numerator. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[ErGr80b] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory II*. (1980). + +[Tu84] Turjányi, S., *A note on basis sequences*. Topics in Classical Number Theory, Vol. I, II +(Budapest, 1981), Colloq. Math. Soc. János Bolyai **34** (1984), 1571-1576. + +[RT85] Ruzsa, I.Z. and Turjányi, S., *A note on additive bases of integers*. Publ. Math. +Debrecen **32** (1985), 101-104. +-/ + +open Filter Set + +open scoped Topology BigOperators Pointwise + +namespace Erdos337 + +/-- The set of all sums of exactly $k$ elements from $A$ (with repetition). -/ +def exactSumset (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (f : Fin k → ℕ), (∀ i, f i ∈ A) ∧ n = ∑ i, f i} + +/-- $A \subseteq \mathbb{N}$ is an additive basis of order $r$ if every sufficiently large +natural number is the sum of at most $r$ elements from $A$. + +Note: This uses the "at most $r$ summands" convention, which differs from the library's +`Set.IsAsymptoticAddBasisOfOrder` (which requires exactly $n$ summands). The two coincide +when $0 \in A$. -/ +def IsAdditiveBasis (A : Set ℕ) (r : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n ≥ N₀, ∃ k ≤ r, n ∈ exactSumset A k + +/-- +Erdős Problem 337 [ErGr80] [ErGr80b]: + +Let $A \subseteq \mathbb{N}$ be an additive basis (of any finite order) such that +$|A \cap \{1, \ldots, N\}| = o(N)$. Is it true that +$$\lim_{N \to \infty} \frac{|(A+A) \cap \{1, \ldots, N\}|}{|A \cap \{1, \ldots, N\}|} = \infty?$$ + +The answer is no. A counterexample was provided by Turjányi [Tu84]. +This was generalised (replacing $A+A$ by the $h$-fold sumset $hA$ for any +$h \geq 2$) by Ruzsa and Turjányi [RT85]. +-/ +@[category research solved, AMS 11] +theorem erdos_337 : answer(False) ↔ + ∀ (A : Set ℕ), + (∃ r : ℕ, IsAdditiveBasis A r) → + A.HasDensity 0 → + Tendsto (fun N => (A + A).partialDensity N / A.partialDensity N) atTop atTop := by + sorry + +/-- +Ruzsa–Turjányi generalization [RT85]: The negative answer to Erdős Problem 337 extends +to the $h$-fold sumset $hA$ for any $h \geq 2$. That is, for any $h \geq 2$, there exists +an additive basis $A$ of density $o(N)$ such that +$|hA \cap \{1,\ldots,N\}| / |A \cap \{1,\ldots,N\}|$ does not tend to infinity. +-/ +@[category research solved, AMS 11] +theorem erdos_337_hfold (h : ℕ) (hh : 2 ≤ h) : + ¬ ∀ (A : Set ℕ), + (∃ r : ℕ, IsAdditiveBasis A r) → + A.HasDensity 0 → + Tendsto (fun N => (exactSumset A h).partialDensity N / A.partialDensity N) + atTop atTop := by + sorry + +/-- +Ruzsa–Turjányi positive result [RT85]: For any additive basis $A$ of density $o(N)$, +the ratio $|(A+A+A) \cap \{1,\ldots,3N\}| / |A \cap \{1,\ldots,N\}|$ tends to infinity. +-/ +@[category research solved, AMS 11] +theorem erdos_337_triple_sumset : + ∀ (A : Set ℕ), + (∃ r : ℕ, IsAdditiveBasis A r) → + A.HasDensity 0 → + Tendsto (fun N => + ((Set.interIio (A + A + A) (3 * N)).ncard : ℝ) / + ((Set.interIio A N).ncard : ℝ)) atTop atTop := by + sorry + +end Erdos337 diff --git a/FormalConjectures/ErdosProblems/338.lean b/FormalConjectures/ErdosProblems/338.lean new file mode 100644 index 0000000000..660c541ee4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/338.lean @@ -0,0 +1,110 @@ +/- +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 338 + +*Reference:* [erdosproblems.com/338](https://www.erdosproblems.com/338) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Ke57] Kelly, J. B., *Restricted bases*. American Journal of Mathematics **79** (1957), 258–264. + +[He05] Hennecart, F., *On the restricted order of asymptotic bases of order two*. Ramanujan +Journal (2005), 123–130. + +[HHP07] Hegyvári, N., Hennecart, F., Plagne, A., *Answer to a question by Burr and Erdős on +restricted addition, and related results*. Combinatorics, Probability and Computing (2007), +747–756. +-/ + +open scoped BigOperators + +namespace Erdos338 + +/-- The set of all sums of exactly $k$ elements from $A$ (with repetition allowed). -/ +def exactSumset (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (f : Fin k → ℕ), (∀ i, f i ∈ A) ∧ n = ∑ i, f i} + +/-- $A \subseteq \mathbb{N}$ is an additive basis of order $h$ if every sufficiently large +natural number is the sum of at most $h$ elements from $A$ (with repetition). -/ +def IsAdditiveBasis (A : Set ℕ) (h : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n ≥ N₀, ∃ k ≤ h, n ∈ exactSumset A k + +/-- $n$ is the sum of at most $t$ distinct elements from $A$: +there exists a finite subset $s \subseteq A$ with $|s| \leq t$ and $\sum_{x \in s} x = n$. -/ +def IsDistinctSum (A : Set ℕ) (t : ℕ) (n : ℕ) : Prop := + ∃ (s : Finset ℕ), ↑s ⊆ A ∧ s.card ≤ t ∧ s.sum id = n + +/-- $A$ has restricted order at most $t$ if every sufficiently large natural number +is the sum of at most $t$ distinct elements from $A$. -/ +def HasRestrictedOrderAtMost (A : Set ℕ) (t : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n ≥ N₀, IsDistinctSum A t n + +/-- $A$ has a restricted order (i.e., some finite restricted order exists). -/ +def HasRestrictedOrder (A : Set ℕ) : Prop := + ∃ t : ℕ, HasRestrictedOrderAtMost A t + +/-- +Erdős Problem 338 [ErGr80]: + +The restricted order of a basis $A \subseteq \mathbb{N}$ is the least integer $t$ (if it exists) +such that every sufficiently large integer is the sum of at most $t$ distinct elements from $A$. + +Bateman observed that for $h \geq 3$, the basis $A = \{1\} \cup \{x > 0 : h \mid x\}$ has order +$h$ but no restricted order. Kelly showed that any basis of order $2$ has restricted order at most +$4$. Hennecart constructed a basis of order $2$ with restricted order exactly $4$. + +The problem asks: what are necessary and sufficient conditions for the restricted order to exist, +and can it be bounded in terms of the order of the basis? + +A specific sub-conjecture asks: if $A \setminus F$ is a basis of the same order $h$ for every +finite set $F \subseteq \mathbb{N}$, must $A$ have a restricted order? +-/ +@[category research open, AMS 5 11] +theorem erdos_338 : + ∀ (A : Set ℕ) (h : ℕ), + (∀ (F : Finset ℕ), IsAdditiveBasis (A \ ↑F) h) → + HasRestrictedOrder A := by + sorry + +/-- +Bateman's observation [ErGr80]: + +For $h \geq 3$, the set $A = \{1\} \cup \{x > 0 : h \mid x\}$ is a basis of order $h$ +but has no restricted order. This shows that not every basis has a restricted order. +-/ +@[category research solved, AMS 5 11] +theorem erdos_338_bateman : + ∀ h : ℕ, h ≥ 3 → + let A : Set ℕ := {1} ∪ {x | 0 < x ∧ h ∣ x} + IsAdditiveBasis A h ∧ ¬HasRestrictedOrder A := by + sorry + +/-- +Kelly's theorem [Ke57]: + +Any additive basis of order $2$ has restricted order at most $4$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_338_kelly : + ∀ A : Set ℕ, IsAdditiveBasis A 2 → HasRestrictedOrderAtMost A 4 := by + sorry + +end Erdos338 diff --git a/FormalConjectures/ErdosProblems/339.lean b/FormalConjectures/ErdosProblems/339.lean new file mode 100644 index 0000000000..4283dd67a7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/339.lean @@ -0,0 +1,83 @@ +/- +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 + +/-! +# Erdős Problem 339 + +*Reference:* [erdosproblems.com/339](https://www.erdosproblems.com/339) + +Let $A \subseteq \mathbb{N}$ be a basis of order $r$. Must the set of integers representable as +the sum of exactly $r$ distinct elements from $A$ have positive lower density? + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[HHP03] Hegyvári, N., Hennecart, F. and Plagne, A., *A proof of two Erdős' conjectures on +restricted addition and further results*. J. Reine Angew. Math. (2003). +-/ + +open Set Filter BigOperators Classical + +namespace Erdos339 + +/-- The set of all sums of exactly $k$ elements from $A$ (with repetition allowed). -/ +def exactSumset (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (f : Fin k → ℕ), (∀ i, f i ∈ A) ∧ n = ∑ i, f i} + +/-- $A \subseteq \mathbb{N}$ is an additive basis of order $r$ if every sufficiently large natural +number is the sum of at most $r$ elements from $A$ (with repetition). -/ +def IsAdditiveBasis (A : Set ℕ) (r : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n ≥ N₀, ∃ k ≤ r, n ∈ exactSumset A k + +/-- The set of integers representable as the sum of exactly $r$ distinct elements from $A$. -/ +def distinctExactSumset (A : Set ℕ) (r : ℕ) : Set ℕ := + {n : ℕ | ∃ (s : Finset ℕ), ↑s ⊆ A ∧ s.card = r ∧ s.sum id = n} + +/-- +Erdős Problem 339 [ErGr80, p.52]: + +Let $A \subseteq \mathbb{N}$ be a basis of order $r$. Must the set of integers representable as +the sum of exactly $r$ distinct elements from $A$ have positive lower density? + +The answer is yes, as proved by Hegyvári, Hennecart, and Plagne [HHP03]. +-/ +@[category research solved, AMS 11] +theorem erdos_339 : + answer(True) ↔ ∀ (A : Set ℕ) (r : ℕ), + IsAdditiveBasis A r → + 0 < Set.lowerDensity (distinctExactSumset A r) := by + sorry + +/-- +Erdős Problem 339 — Variant [ErGr80]: + +Erdős and Graham also asked: if the set of integers which are the sum of $r$ elements from $A$ +has positive upper density, must the set of integers representable as the sum of exactly $r$ +distinct elements have positive upper density? + +The answer is yes, as proved by Hegyvári, Hennecart, and Plagne [HHP03]. +-/ +@[category research solved, AMS 11] +theorem erdos_339_variant : + answer(True) ↔ ∀ (A : Set ℕ) (r : ℕ), + 0 < Set.upperDensity (exactSumset A r) → + 0 < Set.upperDensity (distinctExactSumset A r) := by + sorry + +end Erdos339 diff --git a/FormalConjectures/ErdosProblems/34.lean b/FormalConjectures/ErdosProblems/34.lean new file mode 100644 index 0000000000..b9fd0faafa --- /dev/null +++ b/FormalConjectures/ErdosProblems/34.lean @@ -0,0 +1,69 @@ +/- +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 34 + +*Reference:* [erdosproblems.com/34](https://www.erdosproblems.com/34) + +For a permutation $\pi$ of $\{1,\ldots,n\}$, let $S(\pi)$ count the distinct consecutive sums. +Is $S(\pi) = o(n^2)$ for all $\pi$? Disproved by Hegyvári [He86]; Konieczny [Ko15] showed +a random permutation has $\sim \frac{1+e^{-2}}{4} \cdot n^2$ distinct consecutive sums. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +[ErGr80] Erdős, P. and Graham, R.L., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique **28** (1980). + +[He86] Hegyvári, N., _On consecutive sums in sequences_. Acta Math. Hungar. (1986), 193–200. + +[Ko15] Konieczny, J., _On consecutive sums in permutations_. arXiv:1504.07156 (2015). +-/ + +open Finset BigOperators Equiv + +namespace Erdos34 + +/-- +For a permutation $\sigma$ of $\operatorname{Fin}(n)$, the set of distinct consecutive sums. +A consecutive sum is $\sum_{i \in [u,v]} (\sigma(i) + 1)$ for $u \leq v$ in $\operatorname{Fin}(n)$, +corresponding to summing consecutive values of a permutation of $\{1,\ldots,n\}$. +-/ +noncomputable def consecutiveSums (n : ℕ) (σ : Equiv.Perm (Fin n)) : Finset ℕ := + ((Finset.univ (α := Fin n)) ×ˢ (Finset.univ (α := Fin n))).filter (fun p => p.1 ≤ p.2) + |>.image (fun p => ∑ i ∈ Finset.Icc p.1 p.2, ((σ i).val + 1)) + +/-- +For a permutation $\pi$ of $\{1,\ldots,n\}$, let $S(\pi)$ count the number of distinct +consecutive sums (sums of the form $\sum_{u \leq i \leq v} \pi(i)$). +Is it true that $S(\pi) = o(n^2)$ for all $\pi \in S_n$? + +This was disproved by Hegyvári [He86] and shown to be extremely false by +Konieczny [Ko15], who proved that a random permutation has +$\sim \frac{1+e^{-2}}{4} \cdot n^2$ distinct consecutive sums. +-/ +@[category research solved, AMS 5] +theorem erdos_34 : answer(False) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ σ : Equiv.Perm (Fin n), + ((consecutiveSums n σ).card : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +end Erdos34 diff --git a/FormalConjectures/ErdosProblems/342.lean b/FormalConjectures/ErdosProblems/342.lean new file mode 100644 index 0000000000..2e92d045b5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/342.lean @@ -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 +import FormalConjecturesForMathlib.Data.Set.Density + +/-! +# Erdős Problem 342 + +*Reference:* [erdosproblems.com/342](https://www.erdosproblems.com/342) + +Questions about properties of the Ulam sequence (1, 2, 3, 4, 6, 8, 11, 13, ...): whether +infinitely many pairs $a$, $a + 2$ occur, whether the differences are eventually periodic, and +whether the upper density of the sequence is zero. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Gu04] Guy, R. K., *Unsolved problems in number theory*. (2004), xviii+437. + +See also Green's open problems list, Problem 7. +-/ + +open Filter + +namespace Erdos342 + +open scoped Classical + +/-- Count the number of representations of $m$ as $a_i + a_j$ with $i < j < n$. -/ +def ulamRepCount (a : ℕ → ℕ) (n m : ℕ) : ℕ := + Finset.card (Finset.filter + (fun p : Fin n × Fin n => p.1.val < p.2.val ∧ a p.1.val + a p.2.val = m) + Finset.univ) + +/-- The Ulam sequence: $a(0) = 1$, $a(1) = 2$, and for each $n \geq 2$, $a(n)$ is the +least integer greater than $a(n-1)$ that has exactly one representation as +$a_i + a_j$ with $i < j < n$. (OEIS A002858) -/ +def IsUlamSequence (a : ℕ → ℕ) : Prop := + a 0 = 1 ∧ a 1 = 2 ∧ + ∀ n, 2 ≤ n → + a (n - 1) < a n ∧ + ulamRepCount a n (a n) = 1 ∧ + ∀ m, a (n - 1) < m → m < a n → ulamRepCount a n m ≠ 1 + +/-- +Erdős Problem 342, Part 1 [ErGr80, p.53]: + +A problem of Ulam. With $a_1 = 1$ and $a_2 = 2$, let $a_{n+1}$ for $n \geq 2$ be the least +integer $> a_n$ which can be expressed uniquely as $a_i + a_j$ for $i < j \leq n$. +The sequence is $1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, \ldots$ + +Do infinitely many pairs $a$, $a + 2$ occur in the sequence? +-/ +@[category research open, AMS 5 11] +theorem erdos_342 : answer(sorry) ↔ + ∀ a : ℕ → ℕ, IsUlamSequence a → + Set.Infinite {n : ℕ | ∃ m, a m = a n + 2} := by + sorry + +/-- +Erdős Problem 342, Part 2 [ErGr80, p.53]: + +Does the Ulam sequence eventually have periodic differences? +That is, do there exist $N$ and $p > 0$ such that +$a(n + p + 1) - a(n + p) = a(n + 1) - a(n)$ for all $n \geq N$? +-/ +@[category research open, AMS 5 11] +theorem erdos_342.variants.periodic : answer(sorry) ↔ + ∀ a : ℕ → ℕ, IsUlamSequence a → + ∃ N p : ℕ, 0 < p ∧ ∀ n, N ≤ n → + a (n + p + 1) - a (n + p) = a (n + 1) - a n := by + sorry + +/-- +Erdős Problem 342, Part 3 [ErGr80, p.53]: + +Is the (upper) density of the Ulam sequence equal to $0$? +-/ +@[category research open, AMS 5 11] +theorem erdos_342.variants.density : answer(sorry) ↔ + ∀ a : ℕ → ℕ, IsUlamSequence a → + Set.upperDensity (Set.range a) = 0 := by + sorry + +end Erdos342 diff --git a/FormalConjectures/ErdosProblems/343.lean b/FormalConjectures/ErdosProblems/343.lean new file mode 100644 index 0000000000..fec0d59ed2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/343.lean @@ -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 + +/-! +# Erdős Problem 343 + +If a multiset of positive integers has positive lower density, must it be subcomplete? +That is, must its set of finite subset sums contain an infinite arithmetic progression? +Proved by Szemerédi and Vu. + +*Reference:* [erdosproblems.com/343](https://www.erdosproblems.com/343) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[SzVu06] Szemerédi, E. and Vu, V.H., *Long arithmetic progressions in sumsets: thresholds and +bounds*. Journal of the American Mathematical Society (2006), 119-169. + +[Fo66] Folkman, J., *On the representation of integers as sums of distinct terms from a fixed +sequence*. Canadian Journal of Mathematics (1966), 643-655. +-/ + +open scoped BigOperators + +namespace Erdos343 + +/-- The counting function for a multiset represented by multiplicities: +number of elements (with multiplicity) in $\{1, \ldots, N\}$. -/ +def countUpTo (mult : ℕ → ℕ) (N : ℕ) : ℕ := + ∑ k ∈ Finset.range N, mult (k + 1) + +/-- The set of all finite subset sums $P(A)$ of a multiset. +A finite submultiset is $b : \mathbb{N} \to_0 \mathbb{N}$ with $b(n) \leq \mathrm{mult}(n)$ +for all $n$. The sum is $\sum n \cdot b(n)$. -/ +def subsetSums (mult : ℕ → ℕ) : Set ℕ := + {s : ℕ | ∃ (b : ℕ →₀ ℕ), (∀ n, b n ≤ mult n) ∧ s = b.sum (fun n k => n * k)} + +/-- A set of natural numbers contains an infinite arithmetic progression +$\{a + nd : n \in \mathbb{N}\}$ for some $a \geq 0$ and $d > 0$. -/ +def ContainsInfiniteAP (S : Set ℕ) : Prop := + ∃ (a d : ℕ), 0 < d ∧ ∀ n : ℕ, a + n * d ∈ S + +/-- +Erdős Problem 343 [ErGr80, p.54]: + +If $A \subseteq \mathbb{N}$ is a multiset of integers such that +$|A \cap \{1, \ldots, N\}| \gg N$ for all $N$, must $A$ be subcomplete? +That is, must $P(A) = \{\sum_{n \in B} n : B \subseteq A \text{ finite}\}$ +contain an infinite arithmetic progression? + +A problem of Folkman. Proved by Szemerédi and Vu [SzVu06]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_343 : + answer(True) ↔ + ∀ (mult : ℕ → ℕ), + mult 0 = 0 → + (∃ c : ℝ, 0 < c ∧ ∀ N : ℕ, 0 < N → c * (N : ℝ) ≤ (countUpTo mult N : ℝ)) → + ContainsInfiniteAP (subsetSums mult) := by + sorry + +end Erdos343 diff --git a/FormalConjectures/ErdosProblems/344.lean b/FormalConjectures/ErdosProblems/344.lean new file mode 100644 index 0000000000..e81c7c6410 --- /dev/null +++ b/FormalConjectures/ErdosProblems/344.lean @@ -0,0 +1,82 @@ +/- +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.NumberTheory.AdditivelyComplete + +/-! +# Erdős Problem 344 + +*Reference:* [erdosproblems.com/344](https://www.erdosproblems.com/344) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980). + +[SzVu06] Szemerédi, E. and Vu, V.H., *Finite and infinite arithmetic progressions in sumsets*. +Annals of Mathematics (2006). + +[Er61b] Erdős, P., *On the representation of large integers as sums of distinct summands taken +from a fixed set*. Acta Arithmetica (1961/62), 345-354. +-/ + +open Classical + +namespace Erdos344 + +/-- A set of natural numbers contains an infinite arithmetic progression: +there exist $a \geq 0$ and $d > 0$ such that $a + nd \in S$ for all $n \in \mathbb{N}$. -/ +def ContainsInfiniteAP (S : Set ℕ) : Prop := + ∃ (a d : ℕ), 0 < d ∧ ∀ n : ℕ, a + n * d ∈ S + +/-- +Erdős Problem 344 [ErGr80, p.54]: + +If $A \subseteq \mathbb{N}$ is a set of positive integers such that +$|A \cap \{1,\ldots,N\}| \gg N^{1/2}$ (i.e., there exists $c > 0$ and $N_0$ such that +$|A \cap \{1,\ldots,N\}| \geq c\sqrt{N}$ for all $N \geq N_0$), then $A$ is subcomplete: the set +$P(A)$ of all finite subset sums of $A$ contains an infinite arithmetic progression. + +This was proved by Szemerédi and Vu [SzVu06]. Folkman had previously proved this under the +stronger assumption $|A \cap \{1,\ldots,N\}| \geq cN^{1/2+\varepsilon}$ for some +$\varepsilon > 0$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_344 + (A : Set ℕ) + (hA_pos : ∀ a ∈ A, 0 < a) + (c : ℝ) (hc : 0 < c) + (hgrowth : ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + c * Real.sqrt (N : ℝ) ≤ (((Finset.Icc 1 N).filter (· ∈ A)).card : ℝ)) : + ContainsInfiniteAP (subsetSums A) := by + sorry + +/-- +Erdős Problem 344, sharp variant [Er61b]: + +The stronger conjecture that the subset sums of $A$ contain an infinite arithmetic progression +under the condition $|A \cap \{1,\ldots,N\}| \geq (2N)^{1/2}$ for all $N$. This would be best +possible, as shown by Erdős [Er61b]. This variant remains open. +-/ +@[category research open, AMS 5 11] +theorem erdos_344_sharp + (A : Set ℕ) + (hA_pos : ∀ a ∈ A, 0 < a) + (hgrowth : ∀ N : ℕ, Real.sqrt (2 * N : ℝ) ≤ + (((Finset.Icc 1 N).filter (· ∈ A)).card : ℝ)) : + ContainsInfiniteAP (subsetSums A) := by + sorry + +end Erdos344 diff --git a/FormalConjectures/ErdosProblems/345.lean b/FormalConjectures/ErdosProblems/345.lean new file mode 100644 index 0000000000..861c75bc8d --- /dev/null +++ b/FormalConjectures/ErdosProblems/345.lean @@ -0,0 +1,88 @@ +/- +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.NumberTheory.AdditivelyComplete + +/-! +# Erdős Problem 345 + +Asks whether the threshold of completeness $T$ (the least $m$ such that all $n \ge m$ are +representable as a finite subset sum) satisfies $T(n^k) > T(n^{k+1})$ for infinitely many $k$. + +*Reference:* [erdosproblems.com/345](https://www.erdosproblems.com/345) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +See also OEIS sequence [A001661](https://oeis.org/A001661) for the known threshold values. +-/ + +open Finset BigOperators + +namespace Erdos345 + +/-- The threshold of completeness $T(A)$: the least $m$ such that +all $n \ge m$ are in $P(A)$, the set of finite subset sums of $A$. +(Only meaningful for complete sequences. Related to `IsAddComplete` from +`AdditivelyComplete.lean`, which asserts that this threshold set is nonempty.) -/ +noncomputable def thresholdOfCompleteness (A : Set ℕ) : ℕ := + sInf {m : ℕ | ∀ n : ℕ, n ≥ m → n ∈ subsetSums A} + +/-- The set of $k$-th powers of positive integers: $\{1^k, 2^k, 3^k, \ldots\}$. -/ +def kthPowers (k : ℕ) : Set ℕ := + {m | ∃ n : ℕ, n ≥ 1 ∧ m = n ^ k} + +/-- +Erdős Problem 345 [ErGr80, p.55]: + +Let $A \subseteq \mathbb{N}$ be a complete sequence, and define the threshold of completeness +$T(A)$ to be the least integer $m$ such that all $n \ge m$ are in +$P(A) = \{\sum_{n \in B} n : B \subseteq A, B \text{ finite}\}$. + +Is it true that there are infinitely many $k$ such that $T(n^k) > T(n^{k+1})$? + +Known values: $T(n) = 1$, $T(n^2) = 128$, $T(n^3) = 12758$, $T(n^4) = 5134240$, +and $T(n^5) = 67898771$. +-/ +@[category research open, AMS 5 11] +theorem erdos_345 : + answer(sorry) ↔ Set.Infinite {k : ℕ | thresholdOfCompleteness (kthPowers k) > + thresholdOfCompleteness (kthPowers (k + 1))} := by + sorry + +/-- +Variant of Erdős Problem 345 for powers of two exponents. + +Erdős and Graham specifically suggest investigating $k = 2^t$ for large $t$ as promising +candidates, "because of the highly restricted values of $n^{2^t} \pmod{2^{t+1}}$." + +This asks whether there are infinitely many $t$ such that $T(n^{2^t}) > T(n^{2^{t+1}})$. +-/ +@[category research open, AMS 5 11] +theorem erdos_345_power_of_two_variant : + answer(sorry) ↔ Set.Infinite {t : ℕ | thresholdOfCompleteness (kthPowers (2 ^ t)) > + thresholdOfCompleteness (kthPowers (2 ^ (t + 1)))} := by + sorry + +/-- The simplest known threshold value: $T(n) = 1$, meaning every positive integer is a sum of +distinct positive integers (which is trivially true). -/ +@[category test, AMS 5 11] +theorem erdos_345_threshold_linear : + thresholdOfCompleteness (kthPowers 1) = 1 := by + sorry + +end Erdos345 diff --git a/FormalConjectures/ErdosProblems/35.lean b/FormalConjectures/ErdosProblems/35.lean new file mode 100644 index 0000000000..3f4ed10d86 --- /dev/null +++ b/FormalConjectures/ErdosProblems/35.lean @@ -0,0 +1,80 @@ +/- +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 35 + +*Reference:* [erdosproblems.com/35](https://www.erdosproblems.com/35) + +If $B$ is an additive basis of order $k$ and $A$ has Schnirelmann density $\alpha$, then +$d_s(A + B) \geq \alpha + \alpha(1-\alpha)/k$. Erdős [Er36c] proved the result with $2k$ in +the denominator. Plünnecke [Pl70] proved the stronger inequality +$d_s(A + B) \geq \alpha^{1-1/k}$, as observed by Ruzsa. + +See also Problem 38. + +[Er36c] Erdős, P., _On the arithmetical density of the sum of two sequences, one of which +forms a basis for the integers_. Acta Arith. (1936), 201-207. + +[Er56] Erdős, P., _Problems and results in additive number theory_. Colloque sur la Théorie +des Nombres, Bruxelles, 1955 (1956), 127-137. + +[Pl70] Plünnecke, H., _Eine zahlentheoretische Anwendung der Graphentheorie_. J. Reine Angew. +Math. 243 (1970), 171–183. +-/ + +open Classical Finset +open scoped Pointwise + +namespace Erdos35 + +/-- Schnirelmann density of a set $A \subseteq \mathbb{N}$: +$$d_s(A) = \inf_{N \geq 1} \frac{|A \cap \{1, \ldots, N\}|}{N}$$ -/ +noncomputable def schnirelmannDensity (A : Set ℕ) : ℝ := + sInf {x : ℝ | ∃ N : ℕ, N ≥ 1 ∧ x = ((Icc 1 N).filter (· ∈ A)).card / (N : ℝ)} + +/-- +Let $B \subseteq \mathbb{N}$ be an additive basis of order $k$ and let +$\alpha = d_s(A)$ be the Schnirelmann density of $A \subseteq \mathbb{N}$. Then +$$d_s(A + B) \geq \alpha + \frac{\alpha(1 - \alpha)}{k}.$$ + +This was proved by Plünnecke [Pl70], who showed the stronger inequality +$d_s(A + B) \geq \alpha^{1-1/k}$, as observed by Ruzsa. +-/ +@[category research solved, AMS 11] +theorem erdos_35 + (A B : Set ℕ) (k : ℕ) (hk : k ≥ 1) + (hB : B.IsAddBasisOfOrder k) : + let α := schnirelmannDensity A + schnirelmannDensity (A + B) ≥ α + α * (1 - α) / (k : ℝ) := by + sorry + +/-- +Plünnecke's strengthening of Erdős Problem 35: if $B$ is an additive basis of order $k$ +and $\alpha = d_s(A)$, then $d_s(A + B) \geq \alpha^{1-1/k}$. This implies the bound +$\alpha + \alpha(1-\alpha)/k$ from the main problem. +-/ +@[category research solved, AMS 11] +theorem erdos_35_plunnecke + (A B : Set ℕ) (k : ℕ) (hk : k ≥ 1) + (hB : B.IsAddBasisOfOrder k) : + let α := schnirelmannDensity A + schnirelmannDensity (A + B) ≥ α ^ (1 - 1 / (k : ℝ)) := by + sorry + +end Erdos35 diff --git a/FormalConjectures/ErdosProblems/353.lean b/FormalConjectures/ErdosProblems/353.lean new file mode 100644 index 0000000000..4277700760 --- /dev/null +++ b/FormalConjectures/ErdosProblems/353.lean @@ -0,0 +1,232 @@ +/- +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 353 + +*Reference:* [erdosproblems.com/353](https://www.erdosproblems.com/353) + +Erdős asked whether every measurable subset of $\mathbb{R}^2$ with infinite Lebesgue measure +must contain the vertices of an isosceles trapezoid of area $1$, and similarly for isosceles +triangles, right-angled triangles, and cyclic quadrilaterals of area $1$. + +[Er83d] Erdős, P., _Problems and results on combinatorial geometry_. + +[Ko23] Kovač, V., _Coloring and density theorems for configurations of a given volume_. +arXiv:2309.09973 (2023). + +[Ko25] Koizumi, S., _Isosceles trapezoids of unit area with vertices in sets of infinite +planar measure_. arXiv:2501.01914 (2025). + +[KoPr24] Kovač, V. and Predojević, B., _Polygons of unit area with vertices in sets of +infinite planar measure_. arXiv:2412.11725 (2024). +-/ + +open MeasureTheory + +namespace Erdos353 + +/-- Squared Euclidean distance between two points in $\mathbb{R}^2$. -/ +noncomputable def sqDist (p q : ℝ × ℝ) : ℝ := + (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 + +/-- Area of a triangle with vertices $p_1$, $p_2$, $p_3$ via the cross product formula. -/ +noncomputable def triangleArea (p₁ p₂ p₃ : ℝ × ℝ) : ℝ := + |(p₂.1 - p₁.1) * (p₃.2 - p₁.2) - (p₃.1 - p₁.1) * (p₂.2 - p₁.2)| / 2 + +/-- Area of a quadrilateral with consecutive vertices $p_1$, $p_2$, $p_3$, $p_4$ via the +shoelace formula: $\frac{1}{2} |x_1 y_2 - x_2 y_1 + x_2 y_3 - x_3 y_2 ++ x_3 y_4 - x_4 y_3 + x_4 y_1 - x_1 y_4|$. -/ +noncomputable def quadArea (p₁ p₂ p₃ p₄ : ℝ × ℝ) : ℝ := + |(p₁.1 * p₂.2 - p₂.1 * p₁.2) + (p₂.1 * p₃.2 - p₃.1 * p₂.2) + + (p₃.1 * p₄.2 - p₄.1 * p₃.2) + (p₄.1 * p₁.2 - p₁.1 * p₄.2)| / 2 + +/-- Two vectors in $\mathbb{R}^2$ are parallel (cross product is zero). -/ +def Parallel (v w : ℝ × ℝ) : Prop := + v.1 * w.2 = v.2 * w.1 + +/-- Three points form an isosceles triangle: all distinct with at least two sides +of equal length. -/ +def IsIsoscelesTriangle (p₁ p₂ p₃ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₂ ≠ p₃ ∧ p₁ ≠ p₃ ∧ + (sqDist p₁ p₂ = sqDist p₁ p₃ ∨ + sqDist p₁ p₂ = sqDist p₂ p₃ ∨ + sqDist p₁ p₃ = sqDist p₂ p₃) + +/-- Three points form a right-angled triangle: all distinct with one angle equal +to $90°$ (dot product of adjacent edges is zero at some vertex). -/ +def IsRightTriangle (p₁ p₂ p₃ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₂ ≠ p₃ ∧ p₁ ≠ p₃ ∧ + ((p₂.1 - p₁.1) * (p₃.1 - p₁.1) + (p₂.2 - p₁.2) * (p₃.2 - p₁.2) = 0 ∨ + (p₁.1 - p₂.1) * (p₃.1 - p₂.1) + (p₁.2 - p₂.2) * (p₃.2 - p₂.2) = 0 ∨ + (p₁.1 - p₃.1) * (p₂.1 - p₃.1) + (p₁.2 - p₃.2) * (p₂.2 - p₃.2) = 0) + +/-- Four points (in order) form an isosceles trapezoid: exactly one pair of +parallel opposite sides, with the non-parallel sides (legs) of equal length. +The side from $p_1$ to $p_2$ is parallel to the side from $p_4$ to $p_3$, and +$p_1 p_4$, $p_2 p_3$ are the equal legs. -/ +def IsIsoscelesTrapezoid (p₁ p₂ p₃ p₄ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₁ ≠ p₄ ∧ p₂ ≠ p₃ ∧ p₂ ≠ p₄ ∧ p₃ ≠ p₄ ∧ + Parallel (p₂.1 - p₁.1, p₂.2 - p₁.2) (p₃.1 - p₄.1, p₃.2 - p₄.2) ∧ + sqDist p₁ p₄ = sqDist p₂ p₃ ∧ + ¬ Parallel (p₄.1 - p₁.1, p₄.2 - p₁.2) (p₃.1 - p₂.1, p₃.2 - p₂.2) + +/-- Four distinct points lie on a common circle. -/ +def IsCyclicQuadrilateral (p₁ p₂ p₃ p₄ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₁ ≠ p₄ ∧ p₂ ≠ p₃ ∧ p₂ ≠ p₄ ∧ p₃ ≠ p₄ ∧ + ∃ (c : ℝ × ℝ) (r_sq : ℝ), 0 < r_sq ∧ + sqDist c p₁ = r_sq ∧ sqDist c p₂ = r_sq ∧ + sqDist c p₃ = r_sq ∧ sqDist c p₄ = r_sq + +/-- +Erdős Problem 353, Part 1 [Er83d]: + +Let $A \subseteq \mathbb{R}^2$ be a measurable set with infinite Lebesgue measure. Must $A$ +contain the vertices of an isosceles trapezoid of area $1$? + +Proved by Koizumi [Ko25]. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353 : answer(True) ↔ + ∀ (A : Set (ℝ × ℝ)), MeasurableSet A → volume A = ⊤ → + ∃ p₁ p₂ p₃ p₄ : ℝ × ℝ, + p₁ ∈ A ∧ p₂ ∈ A ∧ p₃ ∈ A ∧ p₄ ∈ A ∧ + IsIsoscelesTrapezoid p₁ p₂ p₃ p₄ ∧ + quadArea p₁ p₂ p₃ p₄ = 1 := by + sorry + +/-- +Erdős Problem 353, Part 2 [Er83d]: + +Must a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure contain the vertices of +an isosceles triangle of area $1$? + +Proved by Koizumi [Ko25]. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.isosceles_triangle : answer(True) ↔ + ∀ (A : Set (ℝ × ℝ)), MeasurableSet A → volume A = ⊤ → + ∃ p₁ p₂ p₃ : ℝ × ℝ, + p₁ ∈ A ∧ p₂ ∈ A ∧ p₃ ∈ A ∧ + IsIsoscelesTriangle p₁ p₂ p₃ ∧ + triangleArea p₁ p₂ p₃ = 1 := by + sorry + +/-- +Erdős Problem 353, Part 3 [Er83d]: + +Must a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure contain the vertices of +a right-angled triangle of area $1$? + +Proved by Koizumi [Ko25]. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.right_triangle : answer(True) ↔ + ∀ (A : Set (ℝ × ℝ)), MeasurableSet A → volume A = ⊤ → + ∃ p₁ p₂ p₃ : ℝ × ℝ, + p₁ ∈ A ∧ p₂ ∈ A ∧ p₃ ∈ A ∧ + IsRightTriangle p₁ p₂ p₃ ∧ + triangleArea p₁ p₂ p₃ = 1 := by + sorry + +/-- +Erdős Problem 353, Part 4 [Er83d]: + +Must a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure contain four distinct +points on a common circle forming a quadrilateral of area $1$? + +Proved by Kovač and Predojević [KoPr24]. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.cyclic_quadrilateral : answer(True) ↔ + ∀ (A : Set (ℝ × ℝ)), MeasurableSet A → volume A = ⊤ → + ∃ p₁ p₂ p₃ p₄ : ℝ × ℝ, + p₁ ∈ A ∧ p₂ ∈ A ∧ p₃ ∈ A ∧ p₄ ∈ A ∧ + IsCyclicQuadrilateral p₁ p₂ p₃ p₄ ∧ + quadArea p₁ p₂ p₃ p₄ = 1 := by + sorry + +/-- Four points (in order) form a trapezoid: exactly one pair of parallel opposite sides. +The side from $p_1$ to $p_2$ is parallel to the side from $p_4$ to $p_3$, and the +legs $p_1 p_4$, $p_2 p_3$ are not parallel. -/ +def IsTrapezoid (p₁ p₂ p₃ p₄ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₁ ≠ p₄ ∧ p₂ ≠ p₃ ∧ p₂ ≠ p₄ ∧ p₃ ≠ p₄ ∧ + Parallel (p₂.1 - p₁.1, p₂.2 - p₁.2) (p₃.1 - p₄.1, p₃.2 - p₄.2) ∧ + ¬ Parallel (p₄.1 - p₁.1, p₄.2 - p₁.2) (p₃.1 - p₂.1, p₃.2 - p₂.2) + +/-- Four points form a parallelogram: both pairs of opposite sides are parallel. -/ +def IsParallelogram (p₁ p₂ p₃ p₄ : ℝ × ℝ) : Prop := + p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₁ ≠ p₄ ∧ p₂ ≠ p₃ ∧ p₂ ≠ p₄ ∧ p₃ ≠ p₄ ∧ + Parallel (p₂.1 - p₁.1, p₂.2 - p₁.2) (p₃.1 - p₄.1, p₃.2 - p₄.2) ∧ + Parallel (p₄.1 - p₁.1, p₄.2 - p₁.2) (p₃.1 - p₂.1, p₃.2 - p₂.2) + +/-- +Erdős Problem 353, Variant (general trapezoid) [Er83d]: + +Must a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure contain the vertices of +a (not necessarily isosceles) trapezoid of area $1$? + +Erdős and Mauldin claim the result holds for general trapezoids. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.trapezoid : answer(True) ↔ + ∀ (A : Set (ℝ × ℝ)), MeasurableSet A → volume A = ⊤ → + ∃ p₁ p₂ p₃ p₄ : ℝ × ℝ, + p₁ ∈ A ∧ p₂ ∈ A ∧ p₃ ∈ A ∧ p₄ ∈ A ∧ + IsTrapezoid p₁ p₂ p₃ p₄ ∧ + quadArea p₁ p₂ p₃ p₄ = 1 := by + sorry + +/-- +Erdős Problem 353, Variant (parallelogram counterexample) [Ko23]: + +There exists a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure such that $A$ +does not contain the vertices of any parallelogram of area $1$. + +Kovač [Ko23] constructed such a counterexample, showing the result fails for parallelograms. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.parallelogram_counterexample : answer(True) ↔ + ∃ (A : Set (ℝ × ℝ)), MeasurableSet A ∧ volume A = ⊤ ∧ + ∀ p₁ p₂ p₃ p₄ : ℝ × ℝ, + p₁ ∈ A → p₂ ∈ A → p₃ ∈ A → p₄ ∈ A → + IsParallelogram p₁ p₂ p₃ p₄ → + quadArea p₁ p₂ p₃ p₄ ≠ 1 := by + sorry + +/-- +Erdős Problem 353, Variant (congruent-sided polygon counterexample) [KoPr24]: + +There exists a measurable set $A \subseteq \mathbb{R}^2$ with infinite measure such that +every convex polygon with congruent sides and all vertices in $A$ has area less than $1$. + +Proved by Kovač and Predojević [KoPr24]. +-/ +@[category research solved, AMS 28 52] +theorem erdos_353.variants.congruent_sided_polygon_counterexample : answer(True) ↔ + ∃ (A : Set (ℝ × ℝ)), MeasurableSet A ∧ volume A = ⊤ ∧ + ∀ (n : ℕ) (pts : Fin (n + 3) → ℝ × ℝ) (s : ℝ), + (∀ i, pts i ∈ A) → + (∀ i : Fin (n + 3), sqDist (pts i) (pts ⟨(i.val + 1) % (n + 3), Nat.mod_lt _ (by omega)⟩) = s) → + Convex ℝ (Set.range pts) → + ∑ i : Fin (n + 1), + triangleArea (pts ⟨0, by omega⟩) (pts ⟨i.val + 1, by omega⟩) + (pts ⟨i.val + 2, by omega⟩) < 1 := by + sorry + +end Erdos353 diff --git a/FormalConjectures/ErdosProblems/356.lean b/FormalConjectures/ErdosProblems/356.lean new file mode 100644 index 0000000000..5ff388a761 --- /dev/null +++ b/FormalConjectures/ErdosProblems/356.lean @@ -0,0 +1,84 @@ +/- +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 356 + +Is there some $c > 0$ such that, for all sufficiently large $n$, there exist integers +$a_1 < \cdots < a_k \leq n$ with at least $cn^2$ distinct contiguous subsequence sums? + +*Reference:* [erdosproblems.com/356](https://www.erdosproblems.com/356) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Be23b] Beker, A., _On a problem of Erdős and Graham about consecutive sums in strictly +increasing sequences_. arXiv:2311.10087 (2023). + +[Ko15] Konieczny, J., _On consecutive sums in permutations_. arXiv:1504.07156 (2015). +-/ + +open Finset BigOperators + +namespace Erdos356 + +/-- The set of all contiguous subsequence sums of a finite integer sequence. +For a sequence $a : \operatorname{Fin} k \to \mathbb{Z}$, this is +$\{\sum_{i=u}^{v} a_i : 0 \leq u \leq v < k\}$. -/ +def contiguousSubSums {k : ℕ} (a : Fin k → ℤ) : Finset ℤ := + ((univ ×ˢ univ).filter (fun p : Fin k × Fin k => p.1 ≤ p.2)).image + (fun p => ∑ i ∈ Icc p.1 p.2, a i) + +/-- +Erdős Problem 356 [ErGr80, p.58]: + +Is there some $c > 0$ such that, for all sufficiently large $n$, there exist +integers $1 \leq a_1 < \cdots < a_k \leq n$ such that there are at least $cn^2$ distinct integers +of the form $\sum_{u \leq i \leq v} a_i$ (contiguous subsequence sums)? + +Solved in the affirmative by Beker [Be23b]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_356 : + answer(True) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (k : ℕ) (a : Fin k → ℤ), + StrictMono a ∧ + Set.range a ⊆ Set.Icc 1 ↑n ∧ + (↑(contiguousSubSums a).card : ℝ) ≥ c * (↑n : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 356, permutation variant [Ko15]: + +Does there exist some $c > 0$ such that, for all sufficiently large $n$, there exists a +permutation of $\{1, \ldots, n\}$ with at least $cn^2$ distinct contiguous subsequence sums? + +Proved in the affirmative by Konieczny [Ko15]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_356_permutation_variant : + answer(True) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ σ : Equiv.Perm (Fin n), + (↑(contiguousSubSums (fun i => (↑(σ i) : ℤ) + 1)).card : ℝ) ≥ c * (↑n : ℝ) ^ 2 := by + sorry + +end Erdos356 diff --git a/FormalConjectures/ErdosProblems/360.lean b/FormalConjectures/ErdosProblems/360.lean new file mode 100644 index 0000000000..db8e4153b5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/360.lean @@ -0,0 +1,80 @@ +/- +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 360 + +*Reference:* [erdosproblems.com/360](https://www.erdosproblems.com/360) + +Determine the asymptotic order of growth of $f(n)$, the minimum number of classes needed to +partition $\{1, \ldots, n-1\}$ so that $n$ cannot be represented as a sum of distinct elements +from any single class. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[AlEr96] Alon, N. and Erdős, P., *Sure monochromatic subset sums*. Acta Arithmetica (1996), 269–272. + +[Vu07] Vu, V.H., *Some new results on subset sums*. Journal of Number Theory (2007), 229–233. + +[CFP21] Conlon, D., Fox, J. and Pham, H.T., *Sum-free partitions* (2021). +-/ + +open Finset + +namespace Erdos360 + +/-- +A coloring $c$ of $\{1, \ldots, n-1\}$ into $k$ colors is sum-free for $n$ if $n$ cannot be +expressed as a sum of distinct elements from any single color class. +-/ +def SumFreeColoring (n k : ℕ) (c : ℕ → Fin k) : Prop := + ∀ j : Fin k, ∀ S : Finset ℕ, + S ⊆ Icc 1 (n - 1) → + (∀ x ∈ S, c x = j) → + S.sum id ≠ n + +/-- +The minimum number of color classes needed so that $\{1, \ldots, n-1\}$ can be colored +into classes where $n$ is not a sum of distinct elements from any single class. +-/ +noncomputable def minSumFreeClasses (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ c : ℕ → Fin k, SumFreeColoring n k c} + +/-- +Let $f(n)$ be minimal such that $\{1, \ldots, n-1\}$ can be partitioned into $f(n)$ classes +so that $n$ cannot be expressed as a sum of distinct elements from the same class. +Conlon, Fox, and Pham [CFP21] determined the order of growth up to a multiplicative constant: +$$ +f(n) \asymp \frac{n^{1/3} \cdot (n / \varphi(n))}{(\log n)^{1/3} \cdot (\log \log n)^{2/3}} +$$ + +[ErGr80, p.59], [AlEr96], [Vu07], [CFP21] +-/ +@[category research solved, AMS 5 11] +theorem erdos_360 : + ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + let g := (n : ℝ) ^ ((1 : ℝ) / 3) * ((n : ℝ) / (Nat.totient n : ℝ)) / + (Real.log (n : ℝ) ^ ((1 : ℝ) / 3) * + Real.log (Real.log (n : ℝ)) ^ ((2 : ℝ) / 3)) + C₁ * g ≤ (minSumFreeClasses n : ℝ) ∧ + (minSumFreeClasses n : ℝ) ≤ C₂ * g := by + sorry + +end Erdos360 diff --git a/FormalConjectures/ErdosProblems/362.lean b/FormalConjectures/ErdosProblems/362.lean new file mode 100644 index 0000000000..7c401db6fa --- /dev/null +++ b/FormalConjectures/ErdosProblems/362.lean @@ -0,0 +1,79 @@ +/- +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 362 + +*Reference:* [erdosproblems.com/362](https://www.erdosproblems.com/362) + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. **VIII** +(1965), 181–189. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117–138. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[SaSz65] Sárközy, A. and Szemerédi, E., _Über ein Problem von Erdős und Moser_. Acta +Arithmetica (1965), 205–208. + +[Ha77] Halász, G., _Estimates for the concentration function of combinatorial number theory and +probability_. Periodica Mathematica Hungarica (1977), 197–211. +-/ + +open Finset + +namespace Erdos362 + +/-- +Let $A \subseteq \mathbb{N}$ be a finite set of size $N$. For any fixed $t$, the number of +subsets $S \subseteq A$ with $\sum_{n \in S} n = t$ is $\ll 2^N / N^{3/2}$. + +Proved by Sárközy and Szemerédi [SaSz65], removing a log factor from the earlier +bound of Erdős and Moser [Er65]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_362 : + ∃ C : ℝ, C > 0 ∧ + ∀ (N : ℕ), 0 < N → + ∀ (A : Finset ℕ), A.card = N → + ∀ (t : ℕ), + ((A.powerset.filter (fun S => S.sum id = t)).card : ℝ) ≤ + C * (2 : ℝ) ^ N / ((N : ℝ) ^ ((3 : ℝ) / 2)) := by + sorry + +/-- +Let $A \subseteq \mathbb{N}$ be a finite set of size $N$. For any fixed $t$ and $l$, the number of +subsets $S \subseteq A$ with $\sum_{n \in S} n = t$ and $|S| = l$ is $\ll 2^N / N^2$, +with the implied constant independent of $l$ and $t$. + +Proved by Halász [Ha77] as a consequence of a more general multi-dimensional result. +-/ +@[category research solved, AMS 5 11] +theorem erdos_362.variants.fixed_size : + ∃ C : ℝ, C > 0 ∧ + ∀ (N : ℕ), 0 < N → + ∀ (A : Finset ℕ), A.card = N → + ∀ (t l : ℕ), + ((A.powerset.filter (fun S => S.sum id = t ∧ S.card = l)).card : ℝ) ≤ + C * (2 : ℝ) ^ N / ((N : ℝ) ^ 2) := by + sorry + +end Erdos362 diff --git a/FormalConjectures/ErdosProblems/363.lean b/FormalConjectures/ErdosProblems/363.lean new file mode 100644 index 0000000000..a7dbf96fec --- /dev/null +++ b/FormalConjectures/ErdosProblems/363.lean @@ -0,0 +1,56 @@ +/- +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 363 + +*Reference:* [erdosproblems.com/363](https://www.erdosproblems.com/363) + +Is it true that there are only finitely many collections of disjoint intervals +$I_1, \ldots, I_n$ of consecutive integers with $|I_i| \geq 4$ for all $i$, such that +$\prod_i \prod_{m \in I_i} m$ is a perfect square? + +This was disproved: +- [Ul05] Ulas, M., _On products of disjoint blocks of consecutive integers_. + Enseignement Mathématique (2) (2005), 331–334. +- [BaBe07] Bauer, M., Bennett, M. A., _On a question of Erdős and Graham_. + Enseignement Mathématique (2) (2007), 259–264. +- [BeVL12] Bennett, M. A., Van Luijk, R., _Squares from blocks of consecutive integers: + a problem of Erdős and Graham_. Indagationes Mathematicae (N.S.) (2012), 123–127. +-/ + +namespace Erdos363 + +/-- +Erdős Problem 363 (Disproved by Bauer–Bennett [BaBe07]): + +Are there only finitely many triples $(a, b, c)$ of positive natural numbers with +$a + 4 \leq b$ and $b + 4 \leq c$ (so the three intervals of four consecutive integers +starting at $a$, $b$, $c$ are pairwise disjoint) such that the product of all $12$ elements +is a perfect square? The answer is no. +-/ +@[category research solved, AMS 11] +theorem erdos_363 : answer(False) ↔ + Set.Finite {t : ℕ × ℕ × ℕ | + 0 < t.1 ∧ t.1 + 4 ≤ t.2.1 ∧ t.2.1 + 4 ≤ t.2.2 ∧ + IsSquare ((∏ m ∈ Finset.Icc t.1 (t.1 + 3), m) * + (∏ m ∈ Finset.Icc t.2.1 (t.2.1 + 3), m) * + (∏ m ∈ Finset.Icc t.2.2 (t.2.2 + 3), m))} := by + sorry + +end Erdos363 diff --git a/FormalConjectures/ErdosProblems/365.lean b/FormalConjectures/ErdosProblems/365.lean new file mode 100644 index 0000000000..ba538ab47e --- /dev/null +++ b/FormalConjectures/ErdosProblems/365.lean @@ -0,0 +1,75 @@ +/- +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.Nat.Full + +/-! +# Erdős Problem 365 + +*Reference:* [erdosproblems.com/365](https://www.erdosproblems.com/365) + +[Er76d] Erdős, P., *Problems in number theory and combinatorics*, Proc. 6th Manitoba Conf. on +Numerical Mathematics (1976), p. 31. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*, Monographies de L'Enseignement Mathematique (1980), p. 68. + +[Go70] Golomb, S.W., *Powerful numbers*, Amer. Math. Monthly **77** (1970), 848–855. + +[Wa76] Walker, D.T., *Consecutive integer pairs of powerful numbers and related Diophantine +equations*, Fibonacci Quart. **14** (1976), 111–116. + +[Gu04] Guy, R.K., *Unsolved Problems in Number Theory*, 3rd ed., Springer (2004), Problem B16. + +See also OEIS sequences A060355, A060859, A175155. Related: Erdős Problem 364. +-/ + +open Finset Real + +namespace Erdos365 + +/-- +Erdős Problem 365 [Er76d, p. 31] [ErGr80, p. 68]: + +Do all pairs of consecutive powerful numbers $n$ and $n+1$ come from solutions to +Pell equations? In other words, must either $n$ or $n+1$ be a square? + +Is the number of such $n \leq x$ bounded by $(\log x)^{O(1)}$? + +Erdős originally asked Mahler whether infinitely many consecutive powerful pairs exist. +Mahler immediately observed that the answer is yes from the infinitely many solutions to +the Pell equation $x^2 = 2^3 y^2 + 1$. + +The first question was answered negatively by Golomb [Go70], who observed that +$12167 = 23^3$ and $12168 = 2^3 \cdot 3^2 \cdot 13^2$ are both powerful (neither is a square). +Walker [Wa76] proved that $7^3 x^2 = 3^3 y^2 + 1$ has infinitely many solutions, +giving infinitely many counterexamples. + +The second question remains open. We formalize it: there exists $C > 0$ such that +for all sufficiently large $x$, the number of $n \leq x$ with both $n$ and $n+1$ powerful +is at most $(\log x)^C$. +-/ +@[category research open, AMS 11] +theorem erdos_365 : answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + ∀ S : Finset ℕ, S ⊆ Finset.Icc 1 x → + (∀ n ∈ S, Nat.Powerful n ∧ Nat.Powerful (n + 1)) → + (S.card : ℝ) ≤ (Real.log (x : ℝ)) ^ C := by + sorry + +end Erdos365 diff --git a/FormalConjectures/ErdosProblems/367.lean b/FormalConjectures/ErdosProblems/367.lean new file mode 100644 index 0000000000..422aad58b6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/367.lean @@ -0,0 +1,98 @@ +/- +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 367 + +Is it true that the product of the 2-full parts of $k$ consecutive integers starting at $n$ is +$O(n^{2+\varepsilon})$ for every fixed $k \geq 1$ and $\varepsilon > 0$? + +This problem is equivalent (up to constants) to Problem 935, though the two formalizations capture +different mathematical quantities: Problem 367 computes the product of the 2-full parts of each +individual consecutive integer, while Problem 935 computes the 2-full part of the product. + +*Reference:* [erdosproblems.com/367](https://www.erdosproblems.com/367) + +*See also:* [Problem 935](https://www.erdosproblems.com/935), +[OEIS A057521](https://oeis.org/A057521) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset BigOperators Real + +namespace Erdos367 + +/-- The 2-full part of a natural number $n$: the product of all prime power +factors $p^a$ where $a \geq 2$. Equivalently, $B_2(n) = n/n'$ where $n'$ is the +product of all primes dividing $n$ exactly once. -/ +noncomputable def twoFullPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) + +/-- +Erdős Problem 367 [ErGr80, p.68]: + +Let $B_2(n)$ be the 2-full part of $n$ (the product of prime power factors $p^a$ +with $a \geq 2$). Is it true that for every fixed $k \geq 1$, +$$\prod_{n \leq m < n+k} B_2(m) \ll n^{2+o(1)}?$$ + +Equivalently: for every $k \geq 1$ and $\varepsilon > 0$, the product is +$O_{k,\varepsilon}(n^{2+\varepsilon})$. + +van Doorn notes that the stronger bound $\ll_k n^2$ holds trivially for $k \leq 2$ +but fails for all $k \geq 3$ (in fact the product is $\gg n^2 \log n$ infinitely often +when $k = 3$). +-/ +@[category research open, AMS 11] +theorem erdos_367 : + answer(sorry) ↔ + ∀ k : ℕ, 1 ≤ k → + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + ((∏ i ∈ Finset.range k, twoFullPart (n + i) : ℕ) : ℝ) ≤ C * (n : ℝ) ^ (2 + ε) := by + sorry + +/-- The r-full part of a natural number $n$: the product of all prime power +factors $p^a$ where $a \geq r$. When $r = 2$, this is `twoFullPart`. -/ +noncomputable def rFullPart (r : ℕ) (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => r ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) + +/-- +Erdős Problem 367, r-full variant: + +The website asks whether, for fixed $r, k \geq 2$ and $\varepsilon > 0$, +$$\limsup_{n \to \infty} \frac{\prod_{n \leq m < n+k} B_r(m)}{n^{1+\varepsilon}} = \infty,$$ +i.e., the product of $r$-full parts of $k$ consecutive integers grows faster than +$n^{1+\varepsilon}$ for any $\varepsilon > 0$. +-/ +@[category research open, AMS 11] +theorem erdos_367_rFull : + answer(sorry) ↔ + ∀ r : ℕ, 2 ≤ r → + ∀ k : ℕ, 2 ≤ k → + ∀ ε : ℝ, 0 < ε → + ∀ C : ℝ, ∃ n : ℕ, + C * (n : ℝ) ^ (1 + ε) ≤ + ((∏ i ∈ Finset.range k, rFullPart r (n + i) : ℕ) : ℝ) := by + sorry + +end Erdos367 diff --git a/FormalConjectures/ErdosProblems/368.lean b/FormalConjectures/ErdosProblems/368.lean new file mode 100644 index 0000000000..b0d37862da --- /dev/null +++ b/FormalConjectures/ErdosProblems/368.lean @@ -0,0 +1,72 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 368 + +*Reference:* [erdosproblems.com/368](https://www.erdosproblems.com/368) + +How large is the largest prime factor of $n(n+1)$? + +Let $F(n)$ be the largest prime factor of $n(n+1)$. + +Known results: +- Pólya [Po18] proved $F(n) \to \infty$ as $n \to \infty$ +- Mahler [Ma35] showed $F(n) \gg \log \log n$ +- Schinzel [Sc67b] observed $F(n) \leq n^{O(1/\log \log \log n)}$ for infinitely many $n$ +- Pasten [Pa24b] proved $F(n) \gg (\log \log n)^2 / \log \log \log n$ + +The conjectured truth is that $F(n) \gg (\log n)^2$ for all $n$, and for every +$\varepsilon > 0$, infinitely many $n$ have $F(n) < (\log n)^{2+\varepsilon}$. +-/ + +open Real + +namespace Erdos368 + +/-- $F(n)$ is the largest prime factor of $n(n+1)$. -/ +noncomputable def F368 (n : ℕ) : ℕ := (n * (n + 1)).maxPrimeFac + +/-- +Erdős Problem 368 — Lower bound conjecture [Er65b, Er76d, ErGr80]: + +The largest prime factor $F(n)$ of $n(n+1)$ satisfies $F(n) \gg (\log n)^2$ for all $n$. +That is, there exists $c > 0$ such that $F(n) \geq c \cdot (\log n)^2$ for all sufficiently +large $n$. +-/ +@[category research open, AMS 11] +theorem erdos_368 : + ∃ c : ℝ, 0 < c ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + (F368 n : ℝ) ≥ c * (Real.log n) ^ 2 := by + sorry + +/-- +Erdős Problem 368 — Upper bound conjecture [Er76d]: + +For every $\varepsilon > 0$, there are infinitely many $n$ such that +$F(n) < (\log n)^{2+\varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_368.variants.upper_bound : + ∀ ε : ℝ, 0 < ε → + Set.Infinite {n : ℕ | (F368 n : ℝ) < (Real.log n) ^ ((2 : ℝ) + ε)} := by + sorry + +end Erdos368 diff --git a/FormalConjectures/ErdosProblems/369.lean b/FormalConjectures/ErdosProblems/369.lean new file mode 100644 index 0000000000..e32862ff28 --- /dev/null +++ b/FormalConjectures/ErdosProblems/369.lean @@ -0,0 +1,60 @@ +/- +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 369 + +*Reference:* [erdosproblems.com/369](https://www.erdosproblems.com/369) + +The problem as literally stated is trivially true (take $\{1, \ldots, k\}$ with +$n > k^{1/\varepsilon}$). There are two non-trivial variants. The one formalized here +requires the $k$ consecutive integers to lie in $[n/2, n]$. A positive answer follows from +Balog–Wooley [BaWo98] for infinitely many $n$, but the case of all sufficiently large $n$ +remains open. + +See also [370] and [928]. + +[BaWo98] Balog, A. and Wooley, T., _On strings of consecutive integers with no large prime +factors_. J. Austral. Math. Soc. Ser. A (1998). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +namespace Erdos369 + +/-- A natural number $m$ is $y$-smooth if every prime factor of $m$ is at most $y$. -/ +def IsSmooth (y : ℝ) (m : ℕ) : Prop := + ∀ p ∈ m.primeFactorsList, (p : ℝ) ≤ y + +/-- +Erdős Problem 369 [ErGr80, p.69]: + +For all $\varepsilon > 0$ and $k \geq 2$, for all sufficiently large $n$, there exist $k$ +consecutive integers in $[n/2, n]$ that are all $n^{\varepsilon}$-smooth. +-/ +@[category research open, AMS 11] +theorem erdos_369 : answer(sorry) ↔ + ∀ (ε : ℝ) (_ : 0 < ε) (k : ℕ) (_ : 2 ≤ k), + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + -- i.e., a, a+1, ..., a+k-1 all lie in [n/2, n] + ∃ a : ℕ, n / 2 ≤ a ∧ a + k ≤ n + 1 ∧ + ∀ j : ℕ, j < k → IsSmooth ((n : ℝ) ^ ε) (a + j) := by + sorry + +end Erdos369 diff --git a/FormalConjectures/ErdosProblems/37.lean b/FormalConjectures/ErdosProblems/37.lean new file mode 100644 index 0000000000..b6f3d78d58 --- /dev/null +++ b/FormalConjectures/ErdosProblems/37.lean @@ -0,0 +1,102 @@ +/- +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 37 + +*Reference:* [erdosproblems.com/37](https://www.erdosproblems.com/37) + +A lacunary set cannot be an essential component (a set that strictly increases the +Schnirelmann density of every set it is added to). Proved by Ruzsa [Ru87]. + +See also Problem 1146 (whether $\{2^m \cdot 3^n\}$ is an essential component). + +[Er56] Erdős, P., _Problems and results in additive number theory_. Colloque sur la Théorie +des Nombres, Bruxelles, 1955 (1956), 127–137. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. A Survey of +Combinatorial Theory (1973), 117–138. + +[ErGr80] Erdős, P. and Graham, R.L., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique **28** (1980). + +[Ru87] Ruzsa, I.Z., _Essential components_. Proc. London Math. Soc. (3) **54** (1987), 38–56. +-/ + +open Classical Finset Pointwise + +namespace Erdos37 + +/-- +A set $A \subseteq \mathbb{N}$ is an *essential component* if $d_s(A + B) > d_s(B)$ for every +$B \subseteq \mathbb{N}$ with $0 < d_s(B) < 1$, where $d_s$ is the Schnirelmann density. +-/ +def IsEssentialComponent (A : Set ℕ) : Prop := + ∀ (B : Set ℕ), 0 < schnirelmannDensity B → schnirelmannDensity B < 1 → + schnirelmannDensity (A + B) > schnirelmannDensity B + +/-- +A set $A \subseteq \mathbb{N}$ is *lacunary* if there exists $q > 1$ such that for any two +consecutive elements $a < b$ of $A$ (with no element of $A$ strictly between them), +we have $b \geq q \cdot a$. +-/ +def IsLacunary (A : Set ℕ) : Prop := + ∃ (q : ℝ), q > 1 ∧ ∀ (a b : ℕ), a ∈ A → b ∈ A → a < b → + (∀ c ∈ A, ¬(a < c ∧ c < b)) → (b : ℝ) ≥ q * (a : ℝ) + +/-- +Erdős Problem 37, proved by Ruzsa [Ru87]. +A lacunary set cannot be an essential component. +Ruzsa proved that if $A$ is an essential component then there exists some constant +$c > 0$ such that $|A \cap \{1,\ldots,N\}| \geq (\log N)^{1+c}$ for all large $N$, which rules +out lacunary sets (which satisfy $|A \cap \{1,\ldots,N\}| = O(\log N)$). +-/ +@[category research solved, AMS 11] +theorem erdos_37 : + ∀ (A : Set ℕ), IsLacunary A → ¬IsEssentialComponent A := by + sorry + +/-- +Ruzsa's density lower bound for essential components [Ru87]: +if $A$ is an essential component, then there exists $c > 0$ such that +$|A \cap \{1,\ldots,N\}| \geq (\log N)^{1+c}$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 11] +theorem erdos_37_essential_component_lower_bound : + ∀ (A : Set ℕ), IsEssentialComponent A → + ∃ c : ℝ, c > 0 ∧ ∀ᶠ N in Filter.atTop, + ((Icc 1 N).filter (· ∈ A)).card ≥ (Real.log N) ^ (1 + c) := by + sorry + +/-- +Optimality of the density lower bound [Ru87]: +for any $c > 0$, there exists an essential component $A$ with +$|A \cap \{1,\ldots,N\}| \leq (\log N)^{1+c}$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 11] +theorem erdos_37_essential_component_upper_bound : + ∀ c : ℝ, c > 0 → + ∃ (A : Set ℕ), IsEssentialComponent A ∧ + ∀ᶠ N in Filter.atTop, + ((Icc 1 N).filter (· ∈ A)).card ≤ (Real.log N) ^ (1 + c) := by + sorry + +end Erdos37 diff --git a/FormalConjectures/ErdosProblems/372.lean b/FormalConjectures/ErdosProblems/372.lean new file mode 100644 index 0000000000..018f856ce6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/372.lean @@ -0,0 +1,66 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 372 + +*Reference:* [erdosproblems.com/372](https://www.erdosproblems.com/372) + +Let $P(n)$ denote the largest prime factor of $n$. There are infinitely many $n$ +such that $P(n) > P(n+1) > P(n+2)$. + +Conjectured by Erdős and Pomerance [ErPo78], who proved the analogous result +for $P(n) < P(n+1) < P(n+2)$. Solved by Balog [Ba01], who proved that this is +true for $\gg \sqrt{x}$ many $n \leq x$ (for all large $x$). Balog suggests the natural +conjecture that the density of such $n$ is $1/6$. A generalised form of this +conjecture was presented by De Koninck and Doyon [DeDo11]. + +OEIS: [A071870](https://oeis.org/A071870) + +[ErPo78] Erdős, P. and Pomerance, C., _On the largest prime factors of n and n+1_, +Aequationes Math. **17** (1978), 311-321. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er85c] Erdős, P., _Some problems and results on combinatorial number theory_ (1985). + +[Ba01] Balog, A., _On triplets with descending largest prime factors_, Studia Sci. +Math. Hungar. **38** (2001), 45-50. + +[DeDo11] De Koninck, J.-M. and Doyon, N., _On the distance between smooth numbers_, +Integers **11** (2011), A25. +-/ + +namespace Erdos372 + +/-- +Erdős Problem 372 [ErPo78] [ErGr80] [Er85c]: + +There are infinitely many $n$ such that $P(n) > P(n+1) > P(n+2)$, where +$P(n)$ denotes the largest prime factor of $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_372 : + Set.Infinite {n : ℕ | + n.maxPrimeFac > (n + 1).maxPrimeFac ∧ + (n + 1).maxPrimeFac > (n + 2).maxPrimeFac} := by + sorry + +end Erdos372 diff --git a/FormalConjectures/ErdosProblems/374.lean b/FormalConjectures/ErdosProblems/374.lean new file mode 100644 index 0000000000..198e082bc9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/374.lean @@ -0,0 +1,76 @@ +/- +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 + +/-! +# Erdős Problem 374 + +*Reference:* [erdosproblems.com/374](https://www.erdosproblems.com/374) + +For a natural number $m$, let $F(m)$ be the minimal $k \ge 2$ such that there exist +$a_1 < \cdots < a_k = m$ with $a_1! \cdots a_k!$ a perfect square, and let $D_k = \{m : F(m) = k\}$. +The conjecture asserts that $D_6$ has positive lower density, i.e., $|D_6 \cap \{1,\ldots,n\}| \gg n$. + +[ErGr76] Erdős, P. and Graham, R., _On products of factorials_. Bull. Inst. Math. Acad. Sinica +(1976), 337-355. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[LSS14] Luca, F., Saradha, N., and Shorey, T. N., _Squares and factorials in products of +factorials_. Monatshefte für Mathematik (2014), 385-400. +-/ + +open scoped BigOperators +open Filter Classical + +namespace Erdos374 + +/-- +There exists a set of $k$ distinct natural numbers with maximum element $m$ +whose product of factorials is a perfect square. +Formally: there exist $a_1 < \cdots < a_k = m$ with $a_1! \cdots a_k!$ a square. +-/ +def HasFactorialSquareSeq (m : ℕ) (k : ℕ) : Prop := + ∃ (s : Finset ℕ), s.card = k ∧ k ≥ 2 ∧ m ∈ s ∧ + (∀ x ∈ s, x ≤ m) ∧ + IsSquare (∏ x ∈ s, Nat.factorial x) + +/-- +$m \in D_k$: the minimal factorial-square sequence length for $m$ is exactly $k$. +$F(m) = k$ where $F(m)$ is the minimal $k \ge 2$ such that there exist +$a_1 < \cdots < a_k = m$ with $a_1! \cdots a_k!$ a perfect square. +-/ +def IsInD (k : ℕ) (m : ℕ) : Prop := + HasFactorialSquareSeq m k ∧ ∀ j, j < k → ¬HasFactorialSquareSeq m j + +/-- +Erdős Problem 374 [ErGr76][ErGr80][LSS14]: + +For $m \in \mathbb{N}$, let $F(m)$ be the minimal $k \ge 2$ such that there exist +$a_1 < \cdots < a_k = m$ with $a_1! \cdots a_k!$ a perfect square. +Let $D_k = \{m : F(m) = k\}$. + +Conjecture: $|D_6 \cap \{1, \ldots, n\}| \gg n$, i.e., $D_6$ has positive lower density. +-/ +@[category research open, AMS 11] +theorem erdos_374 : + 0 < Set.lowerDensity {m : ℕ | IsInD 6 m} := by + sorry + +end Erdos374 diff --git a/FormalConjectures/ErdosProblems/378.lean b/FormalConjectures/ErdosProblems/378.lean new file mode 100644 index 0000000000..b448f88215 --- /dev/null +++ b/FormalConjectures/ErdosProblems/378.lean @@ -0,0 +1,76 @@ +/- +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 + +/-! +# Erdős Problem 378 + +*Reference:* [erdosproblems.com/378](https://www.erdosproblems.com/378) + +For every $r \ge 0$, the natural density of the set of integers $n$ for which $\binom{n}{k}$ +is squarefree for at least $r$ values of $1 \le k < n$ exists and is positive. + +As noted by Aggarwal and Cambie, this is resolved by Granville and Ramaré [GrRa96]. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[GrRa96] Granville, A. and Ramaré, O., *Explicit bounds on exponential sums and the scarcity of +squarefree binomial coefficients*. Mathematika 43 (1996), 73-107. +-/ + +open Classical Filter + +namespace Erdos378 + +/-- The number of values $k$ with $1 \le k < n$ such that $\binom{n}{k}$ is squarefree. -/ +noncomputable def squarefreeBinomCount (n : ℕ) : ℕ := + ((Finset.range n).filter (fun k => 0 < k ∧ Squarefree (Nat.choose n k))).card + +/-- The set of $n$ for which $\binom{n}{k}$ is squarefree for at least $r$ values of +$1 \le k < n$. -/ +def squarefreeBinomAtLeast (r : ℕ) : Set ℕ := + {n : ℕ | r ≤ squarefreeBinomCount n} + +/-- +Erdős Problem 378 [ErGr80, p.72]: +For every $r \ge 0$, the natural density of the set of integers $n$ for which $\binom{n}{k}$ +is squarefree for at least $r$ values of $1 \le k < n$ exists and is positive. + +Resolved in the affirmative by the results of Granville and Ramaré [GrRa96], as noted by +Aggarwal and Cambie. Granville and Ramaré show that for each $m$, the density of the set of $n$ +such that $\binom{n}{k}$ is squarefree for exactly $2m + 2$ values of $k$ exists. +-/ +@[category research solved, AMS 11] +theorem erdos_378 (r : ℕ) : + (squarefreeBinomAtLeast r).HasPosDensity := by + sorry + +/-- +For each $m$, the natural density of the set of integers $n$ such that $\binom{n}{k}$ is +squarefree for exactly $2m + 2$ values of $1 \le k < n$ exists. + +This is a stronger structural result shown by Granville and Ramaré [GrRa96], from which +`erdos_378` follows. +-/ +@[category research solved, AMS 11] +theorem erdos_378_exact (m : ℕ) : + ∃ d : ℝ, {n : ℕ | squarefreeBinomCount n = 2 * m + 2}.HasDensity d := by + sorry + +end Erdos378 diff --git a/FormalConjectures/ErdosProblems/380.lean b/FormalConjectures/ErdosProblems/380.lean new file mode 100644 index 0000000000..46544008f9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/380.lean @@ -0,0 +1,111 @@ +/- +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.Nat.MaxPrimeFac +import FormalConjecturesForMathlib.Data.Nat.Full + +/-! +# Erdős Problem 380 + +*Reference:* [erdosproblems.com/380](https://www.erdosproblems.com/380) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +See also: Problem 382. + +OEIS sequences: A070003, A388654, A387054, A389100. +-/ + +open Finset BigOperators Nat + +namespace Erdos380 + +/-- An interval $[u, v]$ is *bad* if the greatest prime factor of $\prod_{u \le m \le v} m$ +occurs with exponent greater than $1$ in the factorization of that product. -/ +def IsBadInterval (u v : ℕ) : Prop := + let P := ∏ m ∈ Finset.Icc u v, m + let p := maxPrimeFac P + u ≤ v ∧ 0 < p ∧ 1 < P.factorization p + +/-- A natural number $n$ is contained in at least one bad interval. -/ +def InBadInterval (n : ℕ) : Prop := + ∃ u v : ℕ, u ≤ n ∧ n ≤ v ∧ IsBadInterval u v + +/-- $B(x)$: the number of $n \le x$ contained in at least one bad interval. -/ +noncomputable def B380 (x : ℕ) : ℕ := + Set.ncard {n : ℕ | 1 ≤ n ∧ n ≤ x ∧ InBadInterval n} + +/-- The count of $n \le x$ such that $P(n)^2 \mid n$, where $P(n)$ is the largest prime +factor. -/ +noncomputable def squareDivCount380 (x : ℕ) : ℕ := + Set.ncard {n : ℕ | 1 ≤ n ∧ n ≤ x ∧ + 0 < maxPrimeFac n ∧ (maxPrimeFac n) ^ 2 ∣ n} + +/-- +Erdős Problem 380 [ErGr80, p. 73]: + +We call an interval $[u,v]$ *bad* if the greatest prime factor of $\prod_{u \le m \le v} m$ +occurs with an exponent greater than $1$. Let $B(x)$ count the number of $n \le x$ which +are contained in at least one bad interval. Is it true that +$$B(x) \sim \#\{n \le x : P(n)^2 \mid n\},$$ +where $P(n)$ is the largest prime factor of $n$? + +The asymptotic equivalence $B(x) \sim f(x)$ is formalized as: for every $\varepsilon > 0$, for +sufficiently large $x$, $(1 - \varepsilon) \cdot f(x) \le B(x) \le (1 + \varepsilon) \cdot f(x)$. +-/ +@[category research open, AMS 11] +theorem erdos_380 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + (1 - ε) * (squareDivCount380 x : ℝ) ≤ (B380 x : ℝ) ∧ + (B380 x : ℝ) ≤ (1 + ε) * (squareDivCount380 x : ℝ) := by + sorry + +/-- An interval $[u, v]$ is *very bad* if the product $\prod_{u \le m \le v} m$ is powerful +(every prime factor appears with exponent $\ge 2$). -/ +def IsVeryBadInterval (u v : ℕ) : Prop := + u ≤ v ∧ Nat.Powerful (∏ m ∈ Finset.Icc u v, m) + +/-- A natural number $n$ is contained in at least one very bad interval. -/ +def InVeryBadInterval (n : ℕ) : Prop := + ∃ u v : ℕ, u ≤ n ∧ n ≤ v ∧ IsVeryBadInterval u v + +/-- The count of $n \le x$ contained in at least one very bad interval. -/ +noncomputable def VB380 (x : ℕ) : ℕ := + Set.ncard {n : ℕ | 1 ≤ n ∧ n ≤ x ∧ InVeryBadInterval n} + +/-- The count of powerful numbers $n \le x$. -/ +noncomputable def powerfulCount380 (x : ℕ) : ℕ := + Set.ncard {n : ℕ | 1 ≤ n ∧ n ≤ x ∧ Nat.Powerful n} + +/-- +Erdős Problem 380, "very bad" interval variant: + +An interval $[u,v]$ is *very bad* if $\prod_{u \le m \le v} m$ is powerful (every prime factor +appears with exponent $\ge 2$). The number of $n \le x$ contained in at least one very bad +interval should be asymptotically equivalent to the count of powerful numbers $\le x$. +-/ +@[category research open, AMS 11] +theorem erdos_380_very_bad : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + (1 - ε) * (powerfulCount380 x : ℝ) ≤ (VB380 x : ℝ) ∧ + (VB380 x : ℝ) ≤ (1 + ε) * (powerfulCount380 x : ℝ) := by + sorry + +end Erdos380 diff --git a/FormalConjectures/ErdosProblems/381.lean b/FormalConjectures/ErdosProblems/381.lean new file mode 100644 index 0000000000..f6ad023b73 --- /dev/null +++ b/FormalConjectures/ErdosProblems/381.lean @@ -0,0 +1,70 @@ +/- +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 381 + +*Reference:* [erdosproblems.com/381](https://www.erdosproblems.com/381) + +Is it true that $Q(x) \gg_k (\log x)^k$ for every $k \geq 1$, where $Q(x)$ +counts the number of highly composite numbers in $[1, x]$? Disproved by +Nicolas [Ni71]. + +[Er44] Erdős, P., _On highly composite numbers_, +J. London Math. Soc. 19 (1944), 130–133. + +[Ni71] Nicolas, J.-L., _Répartition des nombres hautement composés +de Ramanujan_, Canad. J. Math. 23 (1971), 116–130. +-/ + +open Classical Finset Real + +namespace Erdos381 + +/-- A natural number $n$ is highly composite if every smaller positive natural +number has strictly fewer divisors. -/ +def IsHighlyComposite (n : ℕ) : Prop := + 0 < n ∧ ∀ m : ℕ, 0 < m → m < n → (Nat.divisors m).card < (Nat.divisors n).card + +/-- `highlyCompositeCount x` counts the number of highly composite numbers in $[1, x]$. -/ +noncomputable def highlyCompositeCount (x : ℕ) : ℕ := + ((Finset.range x).filter (fun n => IsHighlyComposite (n + 1))).card + +/-- +Erdős Problem 381 (Disproved) [Er44]: + +A number $n$ is highly composite if $\tau(m) < \tau(n)$ for all $m < n$, where $\tau(m)$ +counts the number of divisors of $m$. Let $Q(x)$ count the number of highly +composite numbers in $[1, x]$. + +Erdős asked whether $Q(x) \gg_k (\log x)^k$ for every $k \geq 1$. + +Erdős [Er44] proved $Q(x) \gg (\log x)^{1+c}$ for some constant $c > 0$. + +The answer is no: Nicolas [Ni71] showed that $Q(x)$ does not grow faster +than a fixed power of $\log x$. +-/ +@[category research solved, AMS 11] +theorem erdos_381 : + answer(False) ↔ + ∀ (k : ℕ), 1 ≤ k → ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ x : ℕ, N₀ ≤ x → + c * (Real.log (x : ℝ)) ^ k ≤ (highlyCompositeCount x : ℝ) := by + sorry + +end Erdos381 diff --git a/FormalConjectures/ErdosProblems/382.lean b/FormalConjectures/ErdosProblems/382.lean new file mode 100644 index 0000000000..7e38e50b18 --- /dev/null +++ b/FormalConjectures/ErdosProblems/382.lean @@ -0,0 +1,75 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 382 + +Let $u \le v$ be such that the largest prime dividing $\prod_{u \le m \le v} m$ appears with +exponent at least $2$. The problem asks whether $v - u = v^{o(1)}$ and whether $v - u$ can be +arbitrarily large. + +*Reference:* [erdosproblems.com/382](https://www.erdosproblems.com/382) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset BigOperators Real + +namespace Erdos382 + +/-- An interval $[u, v]$ has its largest prime factor appearing with exponent $\ge 2$ +in the factorization of the product $\prod_{u \le m \le v} m$. -/ +noncomputable def HasSquaredLargestPrime (u v : ℕ) : Prop := + let P := ∏ m ∈ Finset.Icc u v, m + let p := Nat.maxPrimeFac P + u ≤ v ∧ 0 < p ∧ 1 < P.factorization p + +/-- +Erdős Problem 382 (Part 1) [ErGr80]: + +Let $u \le v$ be such that the largest prime dividing $\prod_{u \le m \le v} m$ appears with +exponent at least $2$. Is it true that $v - u = v^{o(1)}$? + +This means: for every $\varepsilon > 0$, for all sufficiently large $v$, if the interval $[u,v]$ +has its largest prime factor appearing with exponent $\ge 2$, then $v - u \le v^{\varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_382 : + answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ u v : ℕ, N₀ ≤ v → + HasSquaredLargestPrime u v → + ((v : ℝ) - (u : ℝ)) ≤ (v : ℝ) ^ ε := by + sorry + +/-- +Erdős Problem 382 (Part 2) [ErGr80]: + +Can $v - u$ be arbitrarily large? That is, for every $k$, do there exist $u \le v$ +with $v - u \ge k$ such that the largest prime dividing $\prod_{u \le m \le v} m$ appears +with exponent at least $2$? +-/ +@[category research open, AMS 11] +theorem erdos_382.variants.arbitrarily_large : + answer(sorry) ↔ + ∀ k : ℕ, ∃ u v : ℕ, k ≤ v - u ∧ HasSquaredLargestPrime u v := by + sorry + +end Erdos382 diff --git a/FormalConjectures/ErdosProblems/384.lean b/FormalConjectures/ErdosProblems/384.lean new file mode 100644 index 0000000000..90c1587038 --- /dev/null +++ b/FormalConjectures/ErdosProblems/384.lean @@ -0,0 +1,60 @@ +/- +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 384 + +*Reference:* [erdosproblems.com/384](https://www.erdosproblems.com/384) + +A conjecture of Erdős and Selfridge, proved by Ecklund [Ec69]. + +Ecklund made the stronger conjecture that whenever $n > k^2$ the binomial coefficient +$\binom{n}{k}$ is divisible by a prime $p < n/k$. + +[Ec69] Ecklund, E. F., _On prime divisors of the binomial coefficient_ (1969). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +namespace Erdos384 + +/-- +Erdős Problem 384 [ErGr80, p.73]: + +If $1 < k < n - 1$, then $\binom{n}{k}$ is divisible by some prime $p$ with +$2p \le n$ (equivalently $p \le n/2$), except when $(n, k) = (7, 3)$ or $(7, 4)$. +-/ +@[category research solved, AMS 11] +theorem erdos_384 : + ∀ n k : ℕ, 1 < k → k + 1 < n → + ¬(n = 7 ∧ (k = 3 ∨ k = 4)) → + ∃ p : ℕ, Nat.Prime p ∧ 2 * p ≤ n ∧ p ∣ Nat.choose n k := by + sorry + +/-- +Ecklund's stronger conjecture: whenever $n > k^2$, the binomial coefficient +$\binom{n}{k}$ is divisible by a prime $p < n/k$. +-/ +@[category research open, AMS 11] +theorem erdos_384_ecklund : + ∀ n k : ℕ, 1 < k → k ^ 2 < n → + ∃ p : ℕ, Nat.Prime p ∧ p * k < n ∧ p ∣ Nat.choose n k := by + sorry + +end Erdos384 diff --git a/FormalConjectures/ErdosProblems/388.lean b/FormalConjectures/ErdosProblems/388.lean new file mode 100644 index 0000000000..aef0423d2b --- /dev/null +++ b/FormalConjectures/ErdosProblems/388.lean @@ -0,0 +1,85 @@ +/- +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 388 + +*Reference:* [erdosproblems.com/388](https://www.erdosproblems.com/388) + +Can one classify all solutions of +$$\prod_{1 \le i \le k_1} (m_1 + i) = \prod_{1 \le j \le k_2} (m_2 + j)$$ +where $k_1, k_2 > 3$ and $m_1 + k_1 \le m_2$? Are there only finitely many solutions? + +More generally, if $k_1 > 2$ then for fixed $a$ and $b$, +$$a \cdot \prod_{1 \le i \le k_1} (m_1 + i) = b \cdot \prod_{1 \le j \le k_2} (m_2 + j)$$ +should have only a finite number of solutions. + +See also problems 363 and 931. + +[Er76d] Erdős, P. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er92e] Erdős, P. +-/ + +open Finset BigOperators + +namespace Erdos388 + +/-- The product of $k$ consecutive natural numbers starting from $m + 1$: +$(m+1)(m+2)\cdots(m+k)$. -/ +def consecutiveProduct (m k : ℕ) : ℕ := + ∏ i ∈ Finset.range k, (m + 1 + i) + +/-- +Erdős Problem 388 [Er76d] [ErGr80] [Er92e]: + +Are there only finitely many 4-tuples $(m_1, k_1, m_2, k_2)$ of natural numbers +with $k_1, k_2 > 3$ and $m_1 + k_1 \le m_2$ such that +$$(m_1+1)(m_1+2)\cdots(m_1+k_1) = (m_2+1)(m_2+2)\cdots(m_2+k_2)?$$ +-/ +@[category research open, AMS 11] +theorem erdos_388 : + answer(sorry) ↔ + Set.Finite {(m₁, k₁, m₂, k₂) : ℕ × ℕ × ℕ × ℕ | + 3 < k₁ ∧ 3 < k₂ ∧ + m₁ + k₁ ≤ m₂ ∧ + consecutiveProduct m₁ k₁ = consecutiveProduct m₂ k₂} := by + sorry + +/-- +Erdős Problem 388 (General conjecture) [Er76d] [ErGr80] [Er92e]: + +For $k_1 > 2$ and fixed positive $a, b$, the equation +$$a \cdot \prod_{1 \le i \le k_1} (m_1 + i) = b \cdot \prod_{1 \le j \le k_2} (m_2 + j)$$ +with $m_1 + k_1 \le m_2$ should have only finitely many solutions. +-/ +@[category research open, AMS 11] +theorem erdos_388.variants.general : + answer(sorry) ↔ + ∀ (a b : ℕ), 0 < a → 0 < b → + ∀ (k₁ : ℕ), 2 < k₁ → + ∀ k₂ : ℕ, + Set.Finite {t : ℕ × ℕ | + t.1 + k₁ ≤ t.2 ∧ + a * consecutiveProduct t.1 k₁ = b * consecutiveProduct t.2 k₂} := by + sorry + +end Erdos388 diff --git a/FormalConjectures/ErdosProblems/391.lean b/FormalConjectures/ErdosProblems/391.lean new file mode 100644 index 0000000000..dbc6802ba3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/391.lean @@ -0,0 +1,89 @@ +/- +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 391 + +Let $t(n)$ be the maximal value such that $n!$ can be written as a product +of $n$ positive integers, each at least $t(n)$. Erdős conjectured that +$t(n)/n \to 1/e$. + +Erdős, Selfridge, and Straus claimed to have proved the corresponding lower bound, +but the proof was lost after Straus's death and could never be reconstructed. +The full conjecture (and more) was resolved by Alexeev, Conway, Rosenfeld, Sutherland, +Tao, Uhr, and Ventullo [ACRSTUV25], who proved that +$t(n)/n = 1/e - c_0/\log n + O(1/(\log n)^{1+c})$ where $c_0 = 0.3044\cdots$ +is an explicit constant. + +## References + +* [ACRSTUV25] Alexeev, B., Conway, E., Rosenfeld, M., Sutherland, A., Tao, T., Uhr, M., + Ventullo, K., _Decomposing a factorial into large factors_. arXiv:2503.20170 (2025). +* [AlGr77] Alladi, K., Grinstead, C., _On the decomposition of n! into prime powers_. + J. Number Theory **9** (1977), 452–458. +* [Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. + Analytic number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. +* [Gu04] Guy, R.K., _Unsolved problems in number theory_. (2004), xviii+437. +* [GuSe98] Guy, R.K., Selfridge, J.L., _Factoring Factorial n_. + Amer. Math. Monthly **105** (1998), 766–767. + +OEIS: [A034258](https://oeis.org/A034258), [A034259](https://oeis.org/A034259) + +*Reference:* [erdosproblems.com/391](https://www.erdosproblems.com/391) +-/ + +open BigOperators Filter + +namespace Erdos391 + +/-- +A valid representation of $n!$ as a product of $n$ positive integers in +non-decreasing order. +-/ +def IsFactorialRepr (n : ℕ) (f : Fin n → ℕ) : Prop := + (∀ i, 0 < f i) ∧ Monotone f ∧ ∏ i, f i = n.factorial + +/-- +$t(n)$ is the maximal value of the smallest factor in any representation of $n!$ +as a product of $n$ positive integers in non-decreasing order. +-/ +noncomputable def erdos391_t (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ f : Fin n → ℕ, IsFactorialRepr n f ∧ ∀ i, k ≤ f i} + +/-- +Let $t(n)$ be maximal such that $n! = a_1 \cdots a_n$ with +$t(n) = a_1 \leq \cdots \leq a_n$. +The limit of $t(n)/n$ as $n \to \infty$ equals $1/e$. +-/ +@[category research solved, AMS 11] +theorem erdos_391 : + Tendsto (fun n : ℕ => (erdos391_t n : ℝ) / (n : ℝ)) + atTop (nhds (1 / Real.exp 1)) := by + sorry + +/-- +There exists a constant $c > 0$ such that $t(n)/n \leq 1/e - c/\log(n)$ for +infinitely many $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_391.variants.rate_of_convergence : + ∃ c : ℝ, c > 0 ∧ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + (erdos391_t n : ℝ) / (n : ℝ) ≤ 1 / Real.exp 1 - c / Real.log (n : ℝ) := by + sorry + +end Erdos391 diff --git a/FormalConjectures/ErdosProblems/393.lean b/FormalConjectures/ErdosProblems/393.lean new file mode 100644 index 0000000000..d227801dae --- /dev/null +++ b/FormalConjectures/ErdosProblems/393.lean @@ -0,0 +1,95 @@ +/- +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 393 + +*Reference:* [erdosproblems.com/393](https://www.erdosproblems.com/393) + +Let $f(n)$ denote the minimal $m \geq 1$ such that $n! = a_1 \cdots a_t$ with +$a_1 < \cdots < a_t = a_1 + m$. What is the behaviour of $f(n)$? + +Erdős and Graham write that they do not even know whether $f(n) = 1$ infinitely +often (i.e. whether a factorial is the product of consecutive integers infinitely +often). + +A result of Luca implies that $f(n) \to \infty$ as $n \to \infty$, conditional +on the ABC conjecture. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in +combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +[BeOs92] Berend, D. and Osgood, C. F., *On the equation P(x)=n! and a question of +Erdős*. Journal of Number Theory (1992), 189–193. + +[Lu02] Luca, F., *The Diophantine equation P(x)=n! and a result of M. Overholt*. +Glasnik Matematički, Series III (2002), 269–273. + +[BPZ23] Bui, H. M., Pratt, K., and Zaharescu, A., *Power savings for counting +solutions to polynomial-factorial equations*. Advances in Mathematics (2023), +Paper No. 109021, 32 pages. + +OEIS: [A388302](https://oeis.org/A388302) +-/ + +open Finset BigOperators Filter + +namespace Erdos393 + +/-- A factorization of $n!$ as a product of distinct positive integers whose +maximum minus minimum equals $m$. Concretely, there is a finite set of +positive integers all contained in $[a, a + m]$ (with both $a$ and $a + m$ +achieved) whose product is $n!$. -/ +def HasFactorizationWithSpread (n m : ℕ) : Prop := + ∃ (s : Finset ℕ), + 2 ≤ s.card ∧ + (∀ x ∈ s, 0 < x) ∧ + s.prod id = n.factorial ∧ + ∃ a ∈ s, a + m ∈ s ∧ ∀ x ∈ s, a ≤ x ∧ x ≤ a + m + +/-- The minimal $m \geq 1$ such that $n!$ can be written as a product of distinct +positive integers spanning a range of exactly $m$. Returns $0$ if no such +factorization exists (e.g. for $n \leq 1$). -/ +noncomputable def erdos393_f (n : ℕ) : ℕ := + sInf {m : ℕ | 1 ≤ m ∧ HasFactorizationWithSpread n m} + +/-- +Erdős Problem 393 [ErGr80, p.76]: + +$f(n) \to \infty$ as $n \to \infty$, where $f(n)$ is the minimum spread of any +factorization of $n!$ into distinct positive integers. Implied by the ABC conjecture +via a result of Luca. +-/ +@[category research open, AMS 11] +theorem erdos_393 : + Tendsto (fun n : ℕ => erdos393_f n) atTop atTop := by + sorry + +/-- +Erdős Problem 393 — Variant [ErGr80]: + +Is $f(n) = 1$ infinitely often? That is, is $n!$ the product of consecutive integers +for infinitely many $n$? Erdős and Graham write that they do not even know whether +this holds. +-/ +@[category research open, AMS 11] +theorem erdos_393.variants.f_eq_one_infinitely_often : + answer(sorry) ↔ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ erdos393_f n = 1 := by + sorry + +end Erdos393 diff --git a/FormalConjectures/ErdosProblems/395.lean b/FormalConjectures/ErdosProblems/395.lean new file mode 100644 index 0000000000..acf04bab15 --- /dev/null +++ b/FormalConjectures/ErdosProblems/395.lean @@ -0,0 +1,72 @@ +/- +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 395 + +For unit complex vectors, the probability that a random signed sum has norm +at most √2 is at least proportional to 1/n. + +See also Erdős Problem 498 (the classical Littlewood–Offord problem). + +*Reference:* [erdosproblems.com/395](https://www.erdosproblems.com/395) + +[CaCa11] Carnielli, W., Carolino, P. K., _Adjusting a conjecture of Erdős_. +Contributions to Discrete Mathematics (2011), 154–159. + +[HJNS24] He, X., Juškevičius, T., Narayanan, B., and Spiro, S., +_The Reverse Littlewood-Offord problem of Erdős_. arXiv:2408.11034 (2024). +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos395 + +/-- The signed sum of complex numbers $z$ with signs $\varepsilon \in \{-1, 1\}^n$ +(encoded as `Bool`). -/ +noncomputable def signedSum {n : ℕ} (z : Fin n → ℂ) (ε : Fin n → Bool) : ℂ := + ∑ i : Fin n, (if ε i then (1 : ℂ) else (-1 : ℂ)) * z i + +/-- +Erdős Problem 395 (Proved by He, Juškevičius, Narayanan, and Spiro [HJNS24]): + +If $z_1, \ldots, z_n \in \mathbb{C}$ with $|z_i| = 1$, then the probability that +$|\varepsilon_1 z_1 + \cdots + \varepsilon_n z_n| \leq \sqrt{2}$, where +$\varepsilon_i \in \{-1, 1\}$ uniformly at random, is $\gg 1/n$. + +Formally: there exists $c > 0$ such that for all $n \geq 1$ and all unit complex vectors +$z$, the number of sign patterns $\varepsilon$ for which +$\|\sum \varepsilon_i z_i\| \leq \sqrt{2}$ is at least $c \cdot 2^n / n$. + +This is a reverse Littlewood-Offord problem. The bound $1/n$ is best possible, +as shown by taking $z_k = 1$ for $1 \leq k \leq n/2$ and $z_k = i$ otherwise. +-/ +@[category research solved, AMS 5 60] +theorem erdos_395 : + ∃ c : ℝ, 0 < c ∧ + ∀ (n : ℕ), 0 < n → + ∀ (z : Fin n → ℂ), + (∀ i, ‖z i‖ = 1) → + c * (2 : ℝ) ^ n / (n : ℝ) ≤ + ((Finset.univ.filter (fun ε : Fin n → Bool => + ‖signedSum z ε‖ ≤ Real.sqrt 2)).card : ℝ) := by + sorry + +end Erdos395 diff --git a/FormalConjectures/ErdosProblems/40.lean b/FormalConjectures/ErdosProblems/40.lean index 4d564b9bf5..9bd4ecbf3b 100644 --- a/FormalConjectures/ErdosProblems/40.lean +++ b/FormalConjectures/ErdosProblems/40.lean @@ -15,7 +15,6 @@ limitations under the License. -/ import FormalConjectures.Util.ProblemImports -import FormalConjectures.ErdosProblems.«28» /-! # Erdős Problem 40 @@ -62,7 +61,9 @@ Erdős-Turán conjecture, see Erdõs Problem 28, Problem 28). -/ @[category undergraduate, AMS 11] -theorem erdos_28_of_erdos_40 (h_erdos_40 : Erdos40ForSet .univ) : type_of% Erdos28.erdos_28 := by +theorem erdos_28_of_erdos_40 (h_erdos_40 : Erdos40ForSet .univ) : + ∀ (A : Set ℕ), (A + A)ᶜ.Finite → + limsup (fun (n : ℕ) => (sumRep A n : ℕ∞)) atTop = (⊤ : ℕ∞) := by simp only [Erdos40ForSet, Erdos40For, sumRep, sumConv, indicatorOne, mem_univ, forall_const] at h_erdos_40 intro A hA diff --git a/FormalConjectures/ErdosProblems/400.lean b/FormalConjectures/ErdosProblems/400.lean new file mode 100644 index 0000000000..0764f4df42 --- /dev/null +++ b/FormalConjectures/ErdosProblems/400.lean @@ -0,0 +1,84 @@ +/- +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 400 + +*Reference:* [erdosproblems.com/400](https://www.erdosproblems.com/400) + +For any $k \geq 2$, let $g_k(n)$ denote the maximum value of $(a_1 + \cdots + a_k) - n$ where +$a_1, \ldots, a_k$ are natural numbers such that $a_1! \cdots a_k! \mid n!$. + +Erdős and Graham note that $g_k(n) \ll_k \log n$ always, but the best possible constant is unknown. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980). + +The two parts below are stated as separate questions on the website and are independent +conjectures (neither implies the other). +-/ + +open Filter + +open scoped BigOperators + +namespace Erdos400 + +/-- $g_k(n)$ is the maximum of $(a_1 + \cdots + a_k) - n$ over all $k$-tuples of natural numbers +$(a_1, \ldots, a_k)$ satisfying $a_1! \cdots a_k! \mid n!$. -/ +noncomputable def g (k n : ℕ) : ℕ := + sSup {s : ℕ | ∃ a : Fin k → ℕ, (∏ i, (a i).factorial) ∣ n.factorial ∧ + s = (∑ i, a i) - n} + +/-- +Erdős Problem 400, Part 1 [ErGr80, p.77]: + +For any $k \geq 2$, there exists a constant $c_k > 0$ such that +$$\sum_{n \leq x} g_k(n) \sim c_k \cdot x \cdot \log x.$$ + +Formalized as: the ratio $\left(\sum_{n=1}^{x} g_k(n)\right) / (x \cdot \log x)$ tends to $c_k$ +as $x \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_400 (k : ℕ) (hk : 2 ≤ k) : + ∃ c : ℝ, 0 < c ∧ + Tendsto (fun x : ℕ => + (∑ n ∈ Finset.Icc 1 x, (g k n : ℝ)) / ((x : ℝ) * Real.log (x : ℝ))) + atTop (nhds c) := by + sorry + +/-- +Erdős Problem 400, Part 2 [ErGr80, p.77]: + +For any $k \geq 2$, there exists a constant $c_k$ such that for almost all $n \leq x$, +$g_k(n) = c_k \cdot \log x + o(\log x)$. + +Formalized as: for every $\varepsilon > 0$, the proportion of $n \leq x$ for which +$|g_k(n) - c_k \cdot \log x| > \varepsilon \cdot \log x$ tends to $0$ as $x \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_400.variants.concentration (k : ℕ) (hk : 2 ≤ k) : + ∃ c : ℝ, ∀ ε : ℝ, 0 < ε → + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n => + |(g k n : ℝ) - c * Real.log (x : ℝ)| > + ε * Real.log (x : ℝ))).card : ℝ) / (x : ℝ)) + atTop (nhds 0) := by + sorry + +end Erdos400 diff --git a/FormalConjectures/ErdosProblems/401.lean b/FormalConjectures/ErdosProblems/401.lean new file mode 100644 index 0000000000..60fa06e728 --- /dev/null +++ b/FormalConjectures/ErdosProblems/401.lean @@ -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 + +/-! +# Erdős Problem 401 + +*Reference:* [erdosproblems.com/401](https://www.erdosproblems.com/401) + +Is there a function $f(r) \to \infty$ such that for infinitely many $n$ there exist $a_1, a_2$ +with $a_1! \cdot a_2! \mid n! \cdot p_1^n \cdots p_r^n$ and +$a_1 + a_2 > n + f(r) \log n$, where $p_1, \ldots, p_r$ are the first $r$ primes? + +Solved in the affirmative by Barreto and Leeham, using essentially the same construction as +their solution to Problem 729. Sothanaphan disproved the "for all large $n$" variant. + +Related problems: #400, #728, #729. Problem 401 is arguably a more precisely stated form of +Problem 729. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Filter + +open scoped BigOperators + +namespace Erdos401 + +/-- +Erdős Problem 401 [ErGr80, p.78]: + +Is there a function $f : \mathbb{N} \to \mathbb{R}$ with $f(r) \to \infty$ as $r \to \infty$, +such that for every $r$, there are infinitely many $n$ for which there exist $a_1, a_2 \in \mathbb{N}$ +with $a_1! \cdot a_2! \mid n! \cdot p_1^n \cdot p_2^n \cdots p_r^n$ and +$a_1 + a_2 > n + f(r) \cdot \log n$? +-/ +@[category research solved, AMS 11] +theorem erdos_401 : + answer(True) ↔ + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ r : ℕ, {n : ℕ | ∃ a₁ a₂ : ℕ, + (a₁.factorial * a₂.factorial) ∣ + (n.factorial * ∏ i ∈ Finset.range r, (Nat.nth Nat.Prime i) ^ n) ∧ + ((a₁ + a₂ : ℕ) : ℝ) > (n : ℝ) + f r * Real.log (n : ℝ)}.Infinite := by + sorry + +/-- +Variant of Erdős Problem 401 with "for all sufficiently large $n$" in place of "for infinitely +many $n$". Disproved by Sothanaphan, who showed that when $n = p_{r+1}^k - 1$ the divisibility +condition constrains $a_1 + a_2 \leq n + O(\log n)$ with a bounded constant. +-/ +@[category research solved, AMS 11] +theorem erdos_401_forall_large : + answer(False) ↔ + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ r : ℕ, ∃ N : ℕ, ∀ n : ℕ, n ≥ N → ∃ a₁ a₂ : ℕ, + (a₁.factorial * a₂.factorial) ∣ + (n.factorial * ∏ i ∈ Finset.range r, (Nat.nth Nat.Prime i) ^ n) ∧ + ((a₁ + a₂ : ℕ) : ℝ) > (n : ℝ) + f r * Real.log (n : ℝ) := by + sorry + +end Erdos401 diff --git a/FormalConjectures/ErdosProblems/403.lean b/FormalConjectures/ErdosProblems/403.lean new file mode 100644 index 0000000000..a0fb814c50 --- /dev/null +++ b/FormalConjectures/ErdosProblems/403.lean @@ -0,0 +1,76 @@ +/- +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 403 + +*Reference:* [erdosproblems.com/403](https://www.erdosproblems.com/403) + +Asked by Burr and Erdős. Frankl and Lin independently showed that the answer +is yes, and the largest solution is $2^7 = 2! + 3! + 5!$. + +See also Problem 404. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in +combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +[Li76] Lin, S., *Computer experiments on sequences which form integral bases* (1976). +-/ + +open Finset BigOperators + +namespace Erdos403 + +/-- +Erdős Problem 403 [ErGr80, p.79]: + +The equation $2^m = a_1! + \cdots + a_k!$ with $a_1 < a_2 < \cdots < a_k$ has only finitely +many solutions. Here a solution is a pair $(m, S)$ where $m$ is a natural number +and $S$ is a nonempty finite set of natural numbers whose factorials sum to $2^m$. +-/ +@[category research solved, AMS 11] +theorem erdos_403 : + Set.Finite {p : ℕ × Finset ℕ | p.2.Nonempty ∧ + ∑ a ∈ p.2, Nat.factorial a = 2 ^ p.1} := by + sorry + +/-- +Erdős Problem 403, explicit upper bound: + +The largest solution to $2^m = a_1! + \cdots + a_k!$ with distinct $a_i$ has $m = 7$ +(i.e., $2^7 = 2! + 3! + 5! = 128$). In particular, every solution satisfies $m \leq 7$. +-/ +@[category research solved, AMS 11] +theorem erdos_403_upper : + ∀ p ∈ {p : ℕ × Finset ℕ | p.2.Nonempty ∧ + ∑ a ∈ p.2, Nat.factorial a = 2 ^ p.1}, p.1 ≤ 7 := by + sorry + +/-- +Erdős Problem 403, base-3 variant: + +Lin showed that the values of $m$ for which $3^m = a_1! + \cdots + a_k!$ has a solution +with distinct $a_i$ are exactly $m = 0, 1, 2, 3, 6$. +-/ +@[category research solved, AMS 11] +theorem erdos_403_base3 : + {m : ℕ | ∃ S : Finset ℕ, S.Nonempty ∧ + ∑ a ∈ S, Nat.factorial a = 3 ^ m} = {0, 1, 2, 3, 6} := by + sorry + +end Erdos403 diff --git a/FormalConjectures/ErdosProblems/404.lean b/FormalConjectures/ErdosProblems/404.lean new file mode 100644 index 0000000000..ebd08002d4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/404.lean @@ -0,0 +1,80 @@ +/- +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 404 + +*Reference:* [erdosproblems.com/404](https://www.erdosproblems.com/404) + +For which integers $a \geq 1$ and primes $p$ is there a finite upper bound on those $k$ +such that there are $a = a_1 < \cdots < a_n$ with $p^k \mid (a_1! + \cdots + a_n!)$? If $f(a,p)$ +is the greatest such $k$, how does this function behave? + +Is there a prime $p$ and an infinite sequence $a_1 < a_2 < \cdots$ such that if $p^{m_k}$ +is the highest power of $p$ dividing $\sum_{i \leq k} a_i!$ then $m_k \to \infty$? + +See also Problem 403. Lin [Li76] has shown that $f(2,2) \leq 254$. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Li76] Lin, S., _Computer experiments on sequences which form integral bases_ (1976). +-/ + +open Filter + +open scoped BigOperators + +namespace Erdos404 + +/-- +Erdős Problem 404, Part 1 [ErGr80, p.79]: + +For all integers $a \geq 1$ and all primes $p$, there is a finite upper bound on the +$p$-adic valuation of sums $a_1! + \cdots + a_n!$ over all finite sets $\{a_1, \ldots, a_n\}$ with +$a$ as the minimum element. + +Formally: for every $a \geq 1$ and every prime $p$, there exists $K$ such that for every +finite set $S$ of natural numbers with $a \in S$ and $a \leq x$ for all $x \in S$, we have +$v_p\!\left(\sum_{i \in S} i!\right) \leq K$. +-/ +@[category research open, AMS 11] +theorem erdos_404 (a : ℕ) (ha : 1 ≤ a) (p : ℕ) (hp : Nat.Prime p) : + ∃ K : ℕ, ∀ S : Finset ℕ, a ∈ S → (∀ x ∈ S, a ≤ x) → + padicValNat p (∑ i ∈ S, i.factorial) ≤ K := by + sorry + +/-- +Erdős Problem 404, Part 2 [ErGr80, p.79]: + +Is there a prime $p$ and strictly increasing sequence $a_1 < a_2 < \cdots$ of natural +numbers such that the $p$-adic valuation of the partial sums $\sum_{i \leq k} a_i!$ tends +to infinity? + +If Part 1 is true (i.e., $f(a,p)$ is always finite), then the answer to Part 2 is negative: +for any sequence starting at $a_1$, the $p$-adic valuation of partial sums is bounded by +$f(a_1, p)$. +-/ +@[category research open, AMS 11] +theorem erdos_404.variants.divergence : answer(sorry) ↔ + ∃ (p : ℕ) (_ : Nat.Prime p) (a : ℕ → ℕ), StrictMono a ∧ + Tendsto (fun k => padicValNat p (∑ i ∈ Finset.range (k + 1), (a i).factorial)) + atTop atTop := by + sorry + +end Erdos404 diff --git a/FormalConjectures/ErdosProblems/405.lean b/FormalConjectures/ErdosProblems/405.lean new file mode 100644 index 0000000000..e4326a34bb --- /dev/null +++ b/FormalConjectures/ErdosProblems/405.lean @@ -0,0 +1,78 @@ +/- +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 405 + +*Reference:* [erdosproblems.com/405](https://www.erdosproblems.com/405) + +Let $p$ be an odd prime. Is it true that the equation +$(p-1)! + a^{p-1} = p^k$ +has only finitely many solutions? + +Erdős and Graham remark that it is probably true that in general +$(p-1)! + a^{p-1}$ is rarely a power at all (although this can happen, +for example $6! + 2^6 = 28^2$). + +Brindza and Erdős [BrEr91] proved that there are finitely many solutions. +Yu and Liu [YuLi96] showed that the only solutions are +$2! + 1^2 = 3$, $2! + 5^2 = 3^3$, and $4! + 1^4 = 5^2$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[BrEr91] Brindza, B. and Erdős, P., *On some Diophantine problems involving powers and +factorials*. J. Austral. Math. Soc. Ser. A 51 (1991), 1-7. + +[YuLi96] Yu, K. and Liu, L., *On some Diophantine equations involving powers and factorials*. +(1996). +-/ + +namespace Erdos405 + +/-- +Erdős Problem 405 [ErGr80, p.80]: + +There are only finitely many triples $(p, a, k)$ of natural numbers with $p$ an +odd prime such that $(p-1)! + a^{p-1} = p^k$. +-/ +@[category research solved, AMS 11] +theorem erdos_405 : answer(True) ↔ + Set.Finite {t : ℕ × ℕ × ℕ | + let p := t.1 + let a := t.2.1 + let k := t.2.2 + Nat.Prime p ∧ p ≠ 2 ∧ (p - 1).factorial + a ^ (p - 1) = p ^ k} := by + sorry + +/-- +Yu and Liu [YuLi96] proved the stronger result that the complete set of solutions +$(p, a, k)$ with $p$ an odd prime and $(p-1)! + a^{p-1} = p^k$ is exactly +$\{(3, 1, 1), (3, 5, 3), (5, 1, 2)\}$. +-/ +@[category research solved, AMS 11] +theorem erdos_405_yu_liu : + {t : ℕ × ℕ × ℕ | + let p := t.1 + let a := t.2.1 + let k := t.2.2 + Nat.Prime p ∧ p ≠ 2 ∧ (p - 1).factorial + a ^ (p - 1) = p ^ k} = + {(3, 1, 1), (3, 5, 3), (5, 1, 2)} := by + sorry + +end Erdos405 diff --git a/FormalConjectures/ErdosProblems/407.lean b/FormalConjectures/ErdosProblems/407.lean new file mode 100644 index 0000000000..6e4cac3c5c --- /dev/null +++ b/FormalConjectures/ErdosProblems/407.lean @@ -0,0 +1,63 @@ +/- +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 407 + +*Reference:* [erdosproblems.com/407](https://www.erdosproblems.com/407) + +Let $w(n)$ count the number of solutions to $n = 2^a + 3^b + 2^c \cdot 3^d$ with +$a, b, c, d \geq 0$ integers. Is it true that $w(n)$ is bounded by some absolute +constant? + +A conjecture originally due to Newman. This was proved by Evertse, Györy, +Stewart, and Tijdeman [EGST88]. Tijdeman and Wang [TiWa88] showed that +$w(n) \leq 4$ for all large $n$. Bajpai and Bennett [BaBe24] showed that +$w(n) \leq 4$ for $n \geq 131082$ and $w(n) \leq 9$ for all $n$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in +combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +[EGST88] Evertse, J.-H., Györy, K., Stewart, C. L., and Tijdeman, R., +*S-unit equations and their applications*. New advances in transcendence theory +(Durham, 1986), Cambridge Univ. Press (1988), 110-174. + +[TiWa88] Tijdeman, R. and Wang, L. X., *Sums of products of powers of given prime +numbers*. Pacific Journal of Mathematics (1988), 177-193. + +[BaBe24] Bajpai, P. and Bennett, M. A., *Effective S-unit equations beyond three +terms: Newman's conjecture*. Acta Arithmetica (2024), 421-458. +-/ + +namespace Erdos407 + +/-- +Erdős Problem 407 [ErGr80, p.80]: + +There exists an absolute constant $C$ such that for every natural number $n$, +the number of 4-tuples $(a, b, c, d)$ of natural numbers satisfying +$n = 2^a + 3^b + 2^c \cdot 3^d$ is at most $C$. +-/ +@[category research solved, AMS 11] +theorem erdos_407 : answer(True) ↔ + ∃ C : ℕ, ∀ (n : ℕ) (S : Finset (ℕ × ℕ × ℕ × ℕ)), + (∀ t ∈ S, n = 2 ^ t.1 + 3 ^ t.2.1 + 2 ^ t.2.2.1 * 3 ^ t.2.2.2) → + S.card ≤ C := by + sorry + +end Erdos407 diff --git a/FormalConjectures/ErdosProblems/408.lean b/FormalConjectures/ErdosProblems/408.lean new file mode 100644 index 0000000000..17afbbaf85 --- /dev/null +++ b/FormalConjectures/ErdosProblems/408.lean @@ -0,0 +1,131 @@ +/- +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 + +/-! +# Erdős Problem 408 + +*Reference:* [erdosproblems.com/408](https://www.erdosproblems.com/408) + +Let $f(n)$ be the number of iterations of Euler's totient function needed to reach $1$. +Is it true that $f(n)/\log(n)$ has a distribution function, and that $f(n)/\log(n)$ +concentrates around a constant $\alpha$ (expected to be $1/\log 2$)? + +Pillai [Pi29] established the bounds $\log_3 n < f(n) < \log_2 n$ for all large $n$. +Shapiro [Sh50] proved that $f(n)$ is essentially multiplicative. + +See also OEIS [A049108](https://oeis.org/A049108). + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[EGPS90] Erdős, P., Granville, A., Pomerance, C., and Spiro, C., *On the normal behavior +of the iterates of some arithmetic functions*. Analytic Number Theory (1990), 165–204. + +[Pi29] Pillai, S. S., *On some functions connected with φ(n)*. Bulletin of the American +Mathematical Society **35** (1929), 832–836. + +[Sh50] Shapiro, H. N., *On the iterates of a certain class of arithmetic functions*. +Communications on Pure and Applied Mathematics **3** (1950), 259–272. + +[Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437. +-/ + +open Filter Set + +namespace Erdos408 + +/-- +The $k$-fold iteration of Euler's totient function. +Applies $\varphi$ to $n$ exactly $k$ times: $\varphi^{[0]}(n) = n$, +$\varphi^{[k]}(n) = \varphi(\varphi^{[k-1]}(n))$. +-/ +def iteratedTotient (k n : ℕ) : ℕ := Nat.totient^[k] n + +/-- The iterated totient function eventually reaches $1$ for any $n \ge 2$, +since $\varphi(m) < m$ for $m \ge 2$ and $\varphi(1) = 1$. -/ +@[category test, AMS 11] +lemma iteratedTotient_reaches_one {n : ℕ} (hn : 1 < n) : + ∃ k, iteratedTotient k n = 1 := by + sorry + +/-- +$f(n) = \min\{k : \varphi^{[k]}(n) = 1\}$, the number of iterations of Euler's totient +function needed to reach $1$. Returns $0$ for $n \le 1$. +This is well-defined for $n \ge 2$ since $\varphi(m) < m$ for $m \ge 2$ and $\varphi(1) = 1$. +-/ +noncomputable def totientIterationLength (n : ℕ) : ℕ := + if h : n ≤ 1 then 0 + else Nat.find (iteratedTotient_reaches_one (not_le.mp h)) + +/-- +Erdős Problem 408 [ErGr80] — Part (a). + +Let $\varphi(n)$ be the Euler totient function and $\varphi_k(n)$ be the $k$-fold iterate +of $\varphi$, so that $\varphi_1(n) = \varphi(n)$ and +$\varphi_k(n) = \varphi(\varphi_{k-1}(n))$. Let $f(n) = \min\{k : \varphi_k(n) = 1\}$. + +$f(n)/\log(n)$ has a distribution function, i.e., for every real $c$, the natural density +of $\{n : f(n)/\log(n) \le c\}$ exists. + +Erdős, Granville, Pomerance, and Spiro [EGPS90] proved this conditional on a form of the +Elliott–Halberstam conjecture. +-/ +@[category research open, AMS 11] +theorem erdos_408 : + ∀ c : ℝ, + ∃ d : ℝ, + {n : ℕ | (totientIterationLength n : ℝ) / Real.log n ≤ c}.HasDensity d := by + sorry + +/-- +Erdős Problem 408 [ErGr80] — Part (b). + +$f(n)/\log(n)$ is almost always equal to some constant $\alpha > 0$, i.e., there exists +$\alpha > 0$ such that for all $\varepsilon > 0$, the natural density of +$\{n : |f(n)/\log(n) - \alpha| \ge \varepsilon\}$ is zero. + +It is expected that $\alpha = 1/\log(2)$. Erdős, Granville, Pomerance, and Spiro [EGPS90] +proved this conditional on a form of the Elliott–Halberstam conjecture. +-/ +@[category research open, AMS 11] +theorem erdos_408.variants.concentration : + ∃ α : ℝ, α > 0 ∧ + ∀ ε : ℝ, ε > 0 → + {n : ℕ | ε ≤ |((totientIterationLength n : ℝ) / Real.log n) - α|}.HasDensity 0 := by + sorry + +/-- +Erdős Problem 408 — Part (c). + +For $k \to \infty$ however slowly with $n$, for almost all $n$ the largest prime factor +of $\varphi_k(n)$ is at most $n^{o(1)}$. In particular, when $k = \lfloor \log \log n \rfloor$, +the largest prime factor of $\varphi_k(n)$ should be subpolynomial in $n$. + +This formalizes the weaker statement: for all $\varepsilon > 0$, the natural density of +$\{n : P(\varphi_k(n)) > n^\varepsilon\}$ is zero, where $k = \lfloor \log \log n \rfloor$ +and $P$ denotes the largest prime factor. +-/ +@[category research open, AMS 11] +theorem erdos_408.variants.largest_prime_factor : + ∀ ε : ℝ, ε > 0 → + {n : ℕ | (n : ℝ) ^ ε < + (Nat.maxPrimeFac (iteratedTotient (⌊Real.log (Real.log n)⌋₊) n) : ℝ)}.HasDensity 0 := by + sorry + +end Erdos408 diff --git a/FormalConjectures/ErdosProblems/411.lean b/FormalConjectures/ErdosProblems/411.lean new file mode 100644 index 0000000000..69ebb7ac10 --- /dev/null +++ b/FormalConjectures/ErdosProblems/411.lean @@ -0,0 +1,105 @@ +/- +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 411 + +*Reference:* [erdosproblems.com/411](https://www.erdosproblems.com/411) + +Let $g(n) = n + \varphi(n)$ and $g_k$ denote the $k$-th iterate of $g$, so +$g_1(n) = g(n) = n + \varphi(n)$ and $g_k(n) = g(g_{k-1}(n))$. + +For which $n$ and $r$ is it true that $g_{k+r}(n) = 2 \cdot g_k(n)$ for all +sufficiently large $k$? + +The known solutions to $g_{k+2}(n) = 2 \cdot g_k(n)$ are $n = 10$ and $n = 94$. +Selfridge and Weintraub found solutions to $g_{k+9}(n) = 9 \cdot g_k(n)$ and +Weintraub found $g_{k+25}(3114) = 729 \cdot g_k(3114)$ for all $k \geq 6$. + +Steinerberger showed that for $r = 2$, the problem reduces to solving +$\varphi(n) + \varphi(n + \varphi(n)) = n$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[St25] Steinerberger, S., *On an iterated arithmetic function problem of Erdős and Graham*. +arXiv:2504.08023 (2025). +-/ + +namespace Erdos411 + +/-- The function $g(n) = n + \varphi(n)$ from Erdős Problem 411. -/ +def g (n : ℕ) : ℕ := n + Nat.totient n + +/-- +Erdős Problem 411 [ErGr80, p.81]: + +For which positive integers $n$ and $r$ does $g_{k+r}(n) = 2 \cdot g_k(n)$ hold for all +sufficiently large $k$? Cambie conjectures the answer is $r = 2$ and +$n = 2^l \cdot p$ for $l \geq 1$ and $p \in \{2, 3, 5, 7, 35, 47\}$. +-/ +@[category research open, AMS 11] +theorem erdos_411 : + {p : ℕ × ℕ | 0 < p.1 ∧ 0 < p.2 ∧ + ∃ K, ∀ k, K ≤ k → g^[k + p.2] p.1 = 2 * g^[k] p.1} = answer(sorry) := by + sorry + +/-- +Erdős Problem 411, generalized multiplier variant: + +For which positive integers $n$, $r$, and $m$ does $g_{k+r}(n) = m \cdot g_k(n)$ hold for all +sufficiently large $k$? This generalizes the main problem by replacing the multiplier $2$ with +an arbitrary positive integer $m$. Known examples include $g_{k+9}(n) = 9 \cdot g_k(n)$ +(Selfridge–Weintraub) and $g_{k+25}(3114) = 729 \cdot g_k(3114)$ for $k \geq 6$ (Weintraub). +-/ +@[category research open, AMS 11] +theorem erdos_411_general_multiplier : + {p : ℕ × ℕ × ℕ | 0 < p.1 ∧ 0 < p.2.1 ∧ 0 < p.2.2 ∧ + ∃ K, ∀ k, K ≤ k → g^[k + p.2.1] p.1 = p.2.2 * g^[k] p.1} = answer(sorry) := by + sorry + +/-- +Erdős Problem 411, known solution: $n = 10$, $r = 2$ satisfies +$g_{k+2}(10) = 2 \cdot g_k(10)$ for all sufficiently large $k$. +-/ +@[category test, AMS 11] +theorem erdos_411_test_10 : + ∃ K, ∀ k, K ≤ k → g^[k + 2] 10 = 2 * g^[k] 10 := by + sorry + +/-- +Erdős Problem 411, known solution: $n = 94$, $r = 2$ satisfies +$g_{k+2}(94) = 2 \cdot g_k(94)$ for all sufficiently large $k$. +-/ +@[category test, AMS 11] +theorem erdos_411_test_94 : + ∃ K, ∀ k, K ≤ k → g^[k + 2] 94 = 2 * g^[k] 94 := by + sorry + +/-- +Cambie's refined conjecture: For primes $p \equiv 7 \pmod{8}$ and integers $t \geq 1$, +the equation $g_k(2p^t) = 4p^t$ has no solutions except $t = 1$ with $p \in \{7, 47\}$. +-/ +@[category research open, AMS 11] +theorem erdos_411_cambie : + {p : ℕ × ℕ | p.1.Prime ∧ p.1 % 8 = 7 ∧ 0 < p.2 ∧ + ∃ k, g^[k] (2 * p.1 ^ p.2) = 4 * p.1 ^ p.2} = + {(7, 1), (47, 1)} := by + sorry + +end Erdos411 diff --git a/FormalConjectures/ErdosProblems/415.lean b/FormalConjectures/ErdosProblems/415.lean new file mode 100644 index 0000000000..5c969371a2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/415.lean @@ -0,0 +1,107 @@ +/- +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 415 + +*Reference:* [erdosproblems.com/415](https://www.erdosproblems.com/415) + +For any $n$ let $F(n)$ be the largest $k$ such that every one of the $k!$ possible +ordering patterns appears in some consecutive sequence $\varphi(m+1), \ldots, \varphi(m+k)$ +with $m + k \le n$. + +Erdős [Er36b] proved that $F(n) \asymp \log \log \log n$, and similarly for $\sigma$, $\tau$, +$\nu$, or any decent additive or multiplicative function. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in +combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Filter Classical + +namespace Erdos415 + +/-- A block $\varphi(m+1), \ldots, \varphi(m+k)$ exhibits ordering pattern +$\sigma \in S_k$ if $\sigma$ sorts the totient values into increasing order: +for all $i < j$ in $\operatorname{Fin} k$, +$\varphi(m + 1 + \sigma(i)) < \varphi(m + 1 + \sigma(j))$. -/ +def ExhibitsPattern (k m : ℕ) (σ : Equiv.Perm (Fin k)) : Prop := + ∀ i j : Fin k, i < j → + Nat.totient (m + 1 + (σ i).val) < Nat.totient (m + 1 + (σ j).val) + +/-- $F(n)$ is the largest $k$ such that every permutation pattern of length $k$ is +realized among consecutive totient values up to $n$. -/ +noncomputable def F (n : ℕ) : ℕ := + sSup {k : ℕ | ∀ σ : Equiv.Perm (Fin k), + ∃ m : ℕ, m + k ≤ n ∧ ExhibitsPattern k m σ} + +/-- The descending permutation of $\operatorname{Fin} k$: $i \mapsto k - 1 - i$ (reversal). -/ +def descendingPerm (k : ℕ) : Equiv.Perm (Fin k) where + toFun := Fin.rev + invFun := Fin.rev + left_inv i := Fin.rev_rev i + right_inv i := Fin.rev_rev i + +/-- Number of starting positions $m$ (with $m + k \le n$) where the block of length $k$ +exhibits pattern $\sigma$. -/ +noncomputable def patternCount (k n : ℕ) (σ : Equiv.Perm (Fin k)) : ℕ := + ((Finset.range n).filter (fun m => m + k ≤ n ∧ ExhibitsPattern k m σ)).card + +/-- +Erdős Problem 415, Part 1 [ErGr80, p. 82]: + +$F(n) / \log(\log(\log(n))) \to c$ as $n \to \infty$ for some positive constant $c$. +-/ +@[category research open, AMS 11] +theorem erdos_415 : + ∃ c : ℝ, 0 < c ∧ + Tendsto (fun n : ℕ => + (F n : ℝ) / Real.log (Real.log (Real.log (n : ℝ)))) + atTop (nhds c) := by + sorry + +/-- +Erdős Problem 415, Part 2 [ErGr80, p. 82]: + +The first ordering pattern to fail is always the strictly decreasing one. +If the descending pattern of length $k$ appears in totient blocks up to $n$, +then so does every pattern of length $k$. +-/ +@[category research open, AMS 11] +theorem erdos_415.variants.descending_pattern : + ∀ n k : ℕ, + (∃ m : ℕ, m + k ≤ n ∧ ExhibitsPattern k m (descendingPerm k)) → + ∀ σ : Equiv.Perm (Fin k), + ∃ m : ℕ, m + k ≤ n ∧ ExhibitsPattern k m σ := by + sorry + +/-- +Erdős Problem 415, Part 3 [ErGr80, p. 82]: + +There exists a most common ordering pattern (conjectured to be the "natural" pattern +mimicking $\varphi(1), \ldots, \varphi(k)$). For any pattern $\sigma$, the count of blocks +exhibiting $\sigma$ is eventually at most the count exhibiting this dominant pattern. +-/ +@[category research open, AMS 11] +theorem erdos_415.variants.natural_pattern (k : ℕ) (hk : 1 ≤ k) : + ∃ τ : Equiv.Perm (Fin k), ∀ σ : Equiv.Perm (Fin k), + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + patternCount k n σ ≤ patternCount k n τ := by + sorry + +end Erdos415 diff --git a/FormalConjectures/ErdosProblems/419.lean b/FormalConjectures/ErdosProblems/419.lean new file mode 100644 index 0000000000..452fb7c9ba --- /dev/null +++ b/FormalConjectures/ErdosProblems/419.lean @@ -0,0 +1,70 @@ +/- +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 419 + +*Reference:* [erdosproblems.com/419](https://www.erdosproblems.com/419) + +If $\tau(n)$ counts the number of divisors of $n$, then what is the set of limit +points of $\tau((n+1)!) / \tau(n!)$? + +Erdős and Graham [ErGr80] noted that any number of the shape $1 + 1/k$ for $k \geq 1$ +is a limit point (and thus so too is $1$), but knew of no others. + +Erdős, Graham, Ivić, and Pomerance [EGIP96] proved that these are the only limit +points: the set of limit points of the ratio is exactly +$\{1 + 1/k : k \geq 1\} \cup \{1\}$. Mehtaab Sawhney independently found a +simplified proof of the same result. + +Thanks to Zachary Chase and Mehtaab Sawhney for contributions to this problem. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique (1980). + +[EGIP96] Erdős, P., Graham, S. W., Ivić, A., and Pomerance, C., _On the number of +divisors of n!_. Analytic Number Theory (Proceedings of a Conference in Honor of +Heini Halberstam) (1996), 337–355. +-/ + +open Filter + +open scoped Topology + +namespace Erdos419 + +/-- The ratio $\tau((n+1)!) / \tau(n!)$ as a real number, where $\tau$ counts divisors. -/ +noncomputable def erdos419_ratio (n : ℕ) : ℝ := + ((Nat.divisors (n + 1).factorial).card : ℝ) / ((Nat.divisors n.factorial).card : ℝ) + +/-- +Erdős Problem 419 [ErGr80, p.83] [EGIP96]: + +The set of limit points of $\tau((n+1)!) / \tau(n!)$ is exactly +$\{1 + 1/k : k \geq 1\} \cup \{1\}$, where $\tau(n) = |\text{divisors of } n|$. + +A value $c$ is a cluster point of this sequence if and only if +$c = 1$ or $c = 1 + 1/k$ for some positive integer $k$. +-/ +@[category research solved, AMS 11] +theorem erdos_419 : + {c : ℝ | MapClusterPt c atTop erdos419_ratio} = + answer({1} ∪ {c | ∃ k : ℕ, 0 < k ∧ c = 1 + 1 / (k : ℝ)}) := by + sorry + +end Erdos419 diff --git a/FormalConjectures/ErdosProblems/420.lean b/FormalConjectures/ErdosProblems/420.lean new file mode 100644 index 0000000000..cb4d4d5655 --- /dev/null +++ b/FormalConjectures/ErdosProblems/420.lean @@ -0,0 +1,110 @@ +/- +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 420 + +*Reference:* [erdosproblems.com/420](https://www.erdosproblems.com/420) + +If $\tau(n)$ counts the number of divisors of $n$, define +$$F(f, n) = \frac{\tau((n + \lfloor f(n) \rfloor)!)}{\tau(n!)}$$ + +Three questions: +1. Is it true that $\lim_{n \to \infty} F((\log n)^C, n) = \infty$ for all sufficiently + large $C$? +2. Is it true that $F(\log n, n)$ is everywhere dense in $(1, \infty)$? +3. More generally, if $f(n) \leq \log n$ is a monotonic function with $f(n) \to \infty$, + then is $F(f, n)$ everywhere dense in $(1, \infty)$? + +Erdős and Graham note it is easy to show $\lim F(n^{1/2}, n) = \infty$. + +[EGIP96] Erdős, P., Graham, R., Ivić, A., and Pomerance, C. proved: +- $\liminf F(c \log n, n) = 1$ for any $c > 0$ +- $\lim F(n^{4/9}, n) = \infty$ +- if $f(n) = o((\log n)^2)$, then $F(f,n) \sim 1$ for almost all $n$. + +Van Doorn observes: +- The existence of infinitely many bounded prime gaps implies + $\limsup_{n \to \infty} F(g(n), n) = \infty$ for any $g(n) \to \infty$. +- Cramér's conjecture implies $\lim F(g(n)(\log n)^2, n) = \infty$ for any $g(n) \to \infty$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[EGIP96] Erdős, P., Graham, R., Ivić, A., and Pomerance, C., _On the number of +divisors of n!_. Analytic Number Theory (Proceedings of a Conference in Honor of +Heini Halberstam) (1996), 337–355. +-/ + +open Filter + +open scoped Topology Real + +namespace Erdos420 + +/-- The ratio $F(f, n) = \tau((n + \lfloor f(n) \rfloor)!) / \tau(n!)$ where $\tau$ counts +divisors. Here $f : \mathbb{N} \to \mathbb{R}$ and $\lfloor f(n) \rfloor_+$ is the natural +number floor of $f(n)$. -/ +noncomputable def F (f : ℕ → ℝ) (n : ℕ) : ℝ := + ((Nat.divisors (n + ⌊f n⌋₊).factorial).card : ℝ) / + ((Nat.divisors n.factorial).card : ℝ) + +/-- +Erdős Problem 420 (Part 1) [ErGr80, p.83]: + +Is it true that $\lim_{n \to \infty} F((\log n)^C, n) = \infty$ for all sufficiently large $C$? +-/ +@[category research open, AMS 11] +theorem erdos_420 : answer(sorry) ↔ + ∃ C₀ : ℝ, ∀ C : ℝ, C ≥ C₀ → + Tendsto (fun n : ℕ => F (fun m => (Real.log (m : ℝ)) ^ C) n) + atTop atTop := by + sorry + +/-- +Erdős Problem 420 (Part 2) [ErGr80, p.83]: + +Is it true that $F(\log n, n)$ is everywhere dense in $(1, \infty)$? +That is, for any $1 < a < b$, there are infinitely many $n$ with +$a < F(\log n, n) < b$. +-/ +@[category research open, AMS 11] +theorem erdos_420.variants.dense_log : answer(sorry) ↔ + ∀ a b : ℝ, 1 < a → a < b → + ∃ᶠ n in atTop, + a < F (fun m => Real.log (m : ℝ)) n ∧ + F (fun m => Real.log (m : ℝ)) n < b := by + sorry + +/-- +Erdős Problem 420 (Part 3) [ErGr80, p.83]: + +More generally, if $f(n) \leq \log n$ is a monotonic function such that $f(n) \to \infty$ +as $n \to \infty$, then is $F(f, n)$ everywhere dense in $(1, \infty)$? +-/ +@[category research open, AMS 11] +theorem erdos_420.variants.dense_monotone : answer(sorry) ↔ + ∀ f : ℕ → ℝ, Monotone f → + (∀ n : ℕ, f n ≤ Real.log (n : ℝ)) → + Tendsto f atTop atTop → + ∀ a b : ℝ, 1 < a → a < b → + ∃ᶠ n in atTop, + a < F f n ∧ F f n < b := by + sorry + +end Erdos420 diff --git a/FormalConjectures/ErdosProblems/423.lean b/FormalConjectures/ErdosProblems/423.lean new file mode 100644 index 0000000000..d57fe0ab38 --- /dev/null +++ b/FormalConjectures/ErdosProblems/423.lean @@ -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. + +[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 +-/ + +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 + +/-- +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 : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, N ≤ n → M + n ≤ a n := by + sorry + +/-- +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 : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ n m : ℕ, n ≤ m → a n - n ≤ a m - m := by + sorry + +end Erdos423 diff --git a/FormalConjectures/ErdosProblems/425.lean b/FormalConjectures/ErdosProblems/425.lean new file mode 100644 index 0000000000..70e4bd10f9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/425.lean @@ -0,0 +1,122 @@ +/- +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 425 + +Let $F(n)$ be the maximum size of a multiplicative Sidon subset of $\{1, \ldots, n\}$ +(where all pairwise products are distinct). The problem asks whether the error term +$F(n) - \pi(n)$ has a precise asymptotic of the form $c \cdot n^{3/4} (\log n)^{-3/2}$ +for some constant $c > 0$, and poses a generalization to $r$-fold products. + +*Reference:* [erdosproblems.com/425](https://www.erdosproblems.com/425) + +[Er68] Erdős, P., _On some applications of graph theory to number theoretic problems_. Publ. +Ramanujan Inst. (1968/69), 131-136. + +[Er69] Erdős, P., _On some applications of graph theory to number theoretic problems_. Publ. +Ramanujan Inst. 1 (1969), 131-136. + +[Er70b] Erdős, P., _Some applications of graph theory to number theory_. Proc. Second Chapel Hill +Conf. on Combinatorial Mathematics and its Applications (1970), 136-145. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117-138. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43-72. + +[Er80] Erdős, P., _A survey of problems in combinatorial number theory_. Ann. Discrete Math. +(1980), 89-115. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Filter + +namespace Erdos425 + +/-- +A finite set $A \subseteq \mathbb{N}$ is a *multiplicative $B_2$ set* (or multiplicative Sidon set) +if whenever $ab = cd$ for $a, b, c, d \in A$ with $a < b$ and $c < d$, then $a = c$ and $b = d$. +Equivalently, the pairwise products $\{ab : a, b \in A, a < b\}$ are all distinct. +-/ +def IsMultB2 (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ d ∈ A, + a < b → c < d → a * b = c * d → a = c ∧ b = d + +/-- +A finite set $A \subseteq \mathbb{N}$ is an *$r$-multiplicative Sidon set* if any two $r$-element +subsets of $A$ with equal products must be the same subset. +-/ +def IsMultBr (r : ℕ) (A : Finset ℕ) : Prop := + ∀ S T : Finset ℕ, S ⊆ A → T ⊆ A → S.card = r → T.card = r → + S.prod id = T.prod id → S = T + +/-- +$F(n)$ is the maximum cardinality of a multiplicative $B_2$ subset of $\{1, \ldots, n\}$. +-/ +noncomputable def multB2MaxSize (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Finset ℕ, IsMultB2 A ∧ (∀ x ∈ A, 1 ≤ x ∧ x ≤ n) ∧ A.card = k} + +/-- +Let $F(n)$ be the maximum size of a multiplicative $B_2$ subset of $\{1, \ldots, n\}$ +(a set where all pairwise products $ab$ with $a < b$ are distinct). + +Erdős [Er68] proved that there exist constants $0 < c_1 \leq c_2$ such that +$$ + \pi(n) + c_1 n^{3/4} (\log n)^{-3/2} \leq F(n) \leq \pi(n) + c_2 n^{3/4} (\log n)^{-3/2}. +$$ + +The conjecture asks whether there exists a constant $c$ such that +$$ + F(n) = \pi(n) + (c + o(1))\, n^{3/4} (\log n)^{-3/2}, +$$ +i.e., whether the ratio $(F(n) - \pi(n)) / (n^{3/4} / (\log n)^{3/2})$ converges. +-/ +@[category research open, AMS 5 11] +theorem erdos_425 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun n : ℕ => + ((multB2MaxSize n : ℝ) - (Nat.primeCounting n : ℝ)) / + ((n : ℝ) ^ ((3 : ℝ) / 4) / (Real.log (n : ℝ)) ^ ((3 : ℝ) / 2))) + atTop + (nhds c) := by + sorry + +/-- +If $A \subseteq \{1, \ldots, n\}$ is such that all products $a_1 \cdots a_r$ are distinct for +$a_1 < \cdots < a_r$ (i.e., $A$ is an $r$-multiplicative Sidon set), then +$$ + |A| \leq \pi(n) + O(n^{(r+1)/(2r)}). +$$ +-/ +@[category research open, AMS 5 11] +theorem erdos_425.variants.part2 : answer(sorry) ↔ + ∀ r : ℕ, 2 ≤ r → + ∃ C : ℝ, C > 0 ∧ + ∀ n : ℕ, ∀ A : Finset ℕ, + (∀ x ∈ A, 1 ≤ x ∧ x ≤ n) → + IsMultBr r A → + (A.card : ℝ) ≤ (Nat.primeCounting n : ℝ) + + C * (n : ℝ) ^ (((r : ℝ) + 1) / (2 * (r : ℝ))) := by + sorry + +end Erdos425 diff --git a/FormalConjectures/ErdosProblems/426.lean b/FormalConjectures/ErdosProblems/426.lean new file mode 100644 index 0000000000..0ebb1914a7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/426.lean @@ -0,0 +1,106 @@ +/- +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 426 + +Let $f(n)$ be the maximum number of unique subgraphs in a graph on $n$ vertices. +Bradač and Christoph proved that $f(n) = o(2^{\binom{n}{2}} / n!)$. + +*Reference:* [erdosproblems.com/426](https://www.erdosproblems.com/426) + +[EnEr72] Entringer, R. C. and Erdős, P., _On the number of unique subgraphs of a graph_. +J. Combin. Theory Ser. B 13 (1972), 112-115. + +[HaSc73] Harary, F. and Schwenk, A. J., _On the number of unique subgraphs_. +J. Combin. Theory Ser. B 15 (1973), 156-160. + +[Br75] Brouwer, A. E., _A note on unique subgraphs_. +J. Combin. Theory Ser. B 18 (1975), 184-185. + +[BrCh24] Bradač, D. and Christoph, M., _Unique subgraphs are rare_. +arXiv:2410.16233 (2024). +-/ + +open SimpleGraph + +namespace Erdos426 + +/-- +Two subgraphs of a graph $G$ are isomorphic if there exists a graph isomorphism +between their coerced graphs (viewed as simple graphs on their respective +vertex subtypes). +-/ +def SubgraphIsomorphic {V : Type*} {G : SimpleGraph V} + (H₁ H₂ : G.Subgraph) : Prop := + Nonempty (H₁.coe ≃g H₂.coe) + +/-- +A subgraph $H$ of $G$ is a "unique subgraph" if it is the only subgraph of $G$ +in its isomorphism class: every subgraph $H'$ of $G$ isomorphic to $H$ must equal $H$. +-/ +def IsUniqueSubgraph {V : Type*} {G : SimpleGraph V} + (H : G.Subgraph) : Prop := + ∀ H' : G.Subgraph, SubgraphIsomorphic H H' → H' = H + +/-- +The number of unique subgraphs of a graph $G$ on $n$ vertices. +-/ +noncomputable def numUniqueSubgraphs {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + Set.ncard {H : G.Subgraph | IsUniqueSubgraph H} + +/-- +$f(n)$ is the maximum number of unique subgraphs over all graphs on $n$ vertices. +-/ +noncomputable def maxUniqueSubgraphs (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ G : SimpleGraph (Fin n), numUniqueSubgraphs G = k} + +/-- +Erdős Problem 426 (Disproved): + +We say $H$ is a unique subgraph of $G$ if there is exactly one way to find $H$ as a +subgraph (not necessarily induced) of $G$. Let $f(n)$ be the maximum number of +distinct unique subgraphs in a graph on $n$ vertices. + +A problem of Erdős and Entringer [EnEr72], who constructed a graph with +$\gg 2^{\binom{n}{2} - O(n^{3/2+o(1)})}$ many unique subgraphs. This was improved by +Harary and Schwenk [HaSc73], and then further by Brouwer [Br75], who constructed a graph +with $\gg 2^{\binom{n}{2} - O(n)} / n!$ many unique subgraphs. + +Note that there are approximately $2^{\binom{n}{2}} / n!$ non-isomorphic graphs on $n$ +vertices, so the bound in the problem statement is trivially best possible. + +Erdős believed Brouwer's construction was essentially best possible, but +Spencer suggested that $\gg 2^{\binom{n}{2}} / n!$ might be achievable. Erdős offered +100 dollars for such a construction and 25 dollars for a disproof. + +Bradač and Christoph [BrCh24] proved the answer is no: +$$f(n) = o(2^{\binom{n}{2}} / n!).$$ +Quantitatively, the $o(1)$ factor can be taken to be $O(\log \log \log n / \log \log n)$. +-/ +@[category research solved, AMS 5] +theorem erdos_426 : + Filter.Tendsto + (fun n : ℕ => + (maxUniqueSubgraphs n : ℝ) / + ((2 : ℝ) ^ (n.choose 2) / (Nat.factorial n : ℝ))) + Filter.atTop + (nhds 0) := by + sorry + +end Erdos426 diff --git a/FormalConjectures/ErdosProblems/429.lean b/FormalConjectures/ErdosProblems/429.lean new file mode 100644 index 0000000000..a4235d4b31 --- /dev/null +++ b/FormalConjectures/ErdosProblems/429.lean @@ -0,0 +1,59 @@ +/- +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 429 + +Erdős asked whether every infinite admissible set of natural numbers has a translate contained +in the primes. Weisenberg showed the answer is no. + +*Reference:* [erdosproblems.com/429](https://www.erdosproblems.com/429) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p. 85. + +[We24] Weisenberg, D., *Sparse Admissible Sets and a Problem of Erdős and Graham*. Integers (2024). +-/ + +namespace Erdos429 + +/-- +Is it true that, if $A \subseteq \mathbb{N}$ is sparse enough and does not cover all residue +classes modulo $p$ for any prime $p$, then there exists some $n$ such that $n + a$ +is prime for all $a \in A$? + +A set $A \subseteq \mathbb{N}$ is called "admissible" if for every prime $p$, there exists a +residue class modulo $p$ not represented in $A$. This is a necessary condition +for the translate $A + n$ to consist entirely of primes. + +Weisenberg [We24] has shown the answer is no: $A$ can be arbitrarily sparse +and missing at least one residue class modulo every prime $p$, and yet $A + n$ +is not contained in the primes for any $n \in \mathbb{Z}$. + +We formalize the conjecture for infinite admissible sets $A \subseteq \mathbb{N}$. +-/ +@[category research solved, AMS 11] +theorem erdos_429 : + answer(False) ↔ + ∀ (A : Set ℕ), + Set.Infinite A → + (∀ p : ℕ, p.Prime → ∃ r : ZMod p, ∀ a ∈ A, (a : ZMod p) ≠ r) → + ∃ n : ℕ, ∀ a ∈ A, (n + a).Prime := by + sorry + +end Erdos429 diff --git a/FormalConjectures/ErdosProblems/43.lean b/FormalConjectures/ErdosProblems/43.lean new file mode 100644 index 0000000000..7fe0653960 --- /dev/null +++ b/FormalConjectures/ErdosProblems/43.lean @@ -0,0 +1,93 @@ +/- +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 43 + +*Reference:* [erdosproblems.com/43](https://www.erdosproblems.com/43) + +If $A, B \subseteq \{1, \ldots, N\}$ are Sidon sets with $(A-A) \cap (B-B) = \{0\}$, is it true +that $\binom{|A|}{2} + \binom{|B|}{2} \leq \binom{f(N)}{2} + O(1)$, where $f(N)$ is the maximum +size of a Sidon set in $\{1, \ldots, N\}$? + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics, Paul Erdős is Eighty **2** (1996), 1–25. + +OEIS: A143824, A227590, A003022 +-/ + +open Finset Filter + +namespace Erdos43 + +/-- Two sets $A$, $B$ have disjoint difference sets (intersecting only at $0$): + $(A - A) \cap (B - B) = \{0\}$. Equivalently, if $a_1 - a_2 = b_1 - b_2$ for + $a_1, a_2 \in A$ and $b_1, b_2 \in B$, then $a_1 = a_2$ and $b_1 = b_2$. -/ +def DisjointDifferences (A B : Finset ℕ) : Prop := + ∀ a₁ ∈ A, ∀ a₂ ∈ A, ∀ b₁ ∈ B, ∀ b₂ ∈ B, + (a₁ : ℤ) - (a₂ : ℤ) = (b₁ : ℤ) - (b₂ : ℤ) → a₁ = a₂ ∧ b₁ = b₂ + +/-- If $A, B \subseteq \{1, \ldots, N\}$ are two Sidon sets such that + $(A - A) \cap (B - B) = \{0\}$, is it true that + $$\binom{|A|}{2} + \binom{|B|}{2} \leq \binom{f(N)}{2} + O(1),$$ + where $f(N)$ is the maximum possible size of a Sidon set in $\{1, \ldots, N\}$? + + Here $S$ represents a maximum-size Sidon set in $\{1, \ldots, N\}$, so $|S| = f(N)$. + The $O(1)$ term is captured by the absolute constant $C$. + + *Reference:* [Er95] +-/ +@[category research open, AMS 5 11] +theorem erdos_43 : answer(sorry) ↔ ∃ C : ℕ, ∀ (N : ℕ) (A B S : Finset ℕ), + IsSidon (A : Set ℕ) → IsSidon (B : Set ℕ) → IsSidon (S : Set ℕ) → + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∀ b ∈ B, 1 ≤ b ∧ b ≤ N) → + (∀ s ∈ S, 1 ≤ s ∧ s ≤ N) → + (∀ T : Finset ℕ, IsSidon (T : Set ℕ) → (∀ t ∈ T, 1 ≤ t ∧ t ≤ N) → T.card ≤ S.card) → + DisjointDifferences A B → + Nat.choose A.card 2 + Nat.choose B.card 2 ≤ Nat.choose S.card 2 + C := by + sorry + +/-- Secondary question from Erdős Problem 43: if $|A| = |B|$, can the bound be improved to + $\binom{|A|}{2} + \binom{|B|}{2} \leq (1 - c + o(1)) \binom{f(N)}{2}$ for some constant + $c > 0$? + + Barreto showed the answer is no: for infinitely many $N$, there exist equal-sized Sidon sets + $A, B$ with disjoint differences achieving $(1 - o(1)) \binom{f(N)}{2}$. + + This is formalized as: for every $c > 0$, for all sufficiently large $N$, there exist + equal-sized Sidon sets $A, B \subseteq \{1, \ldots, N\}$ with disjoint differences such that + $\binom{|A|}{2} + \binom{|B|}{2} > (1 - c) \binom{f(N)}{2}$. + + *Reference:* [Er95] +-/ +@[category research solved, AMS 5 11] +theorem erdos_43_equal_size_negative : + ∀ (c : ℝ) (_ : 0 < c), ∀ᶠ N in Filter.atTop, + ∃ (A B S : Finset ℕ), + IsSidon (A : Set ℕ) ∧ IsSidon (B : Set ℕ) ∧ IsSidon (S : Set ℕ) ∧ + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) ∧ + (∀ b ∈ B, 1 ≤ b ∧ b ≤ N) ∧ + (∀ s ∈ S, 1 ≤ s ∧ s ≤ N) ∧ + (∀ T : Finset ℕ, IsSidon (T : Set ℕ) → (∀ t ∈ T, 1 ≤ t ∧ t ≤ N) → T.card ≤ S.card) ∧ + A.card = B.card ∧ + DisjointDifferences A B ∧ + (1 - c) * Nat.choose S.card 2 < ↑(Nat.choose A.card 2 + Nat.choose B.card 2) := by + sorry + +end Erdos43 diff --git a/FormalConjectures/ErdosProblems/430.lean b/FormalConjectures/ErdosProblems/430.lean new file mode 100644 index 0000000000..4d4d4af216 --- /dev/null +++ b/FormalConjectures/ErdosProblems/430.lean @@ -0,0 +1,73 @@ +/- +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.Nat.Prime.Composite + +/-! +# Erdős Problem 430 + +*Reference:* [erdosproblems.com/430](https://www.erdosproblems.com/430) + +Fix an integer $n$ and define a decreasing sequence by $a_1 = n-1$ and, for $k \geq 2$, +$a_k$ is the greatest integer $m$ in $[2, a_{k-1})$ such that all prime factors of $m$ +are $> n - m$. The sequence terminates when no such $m$ exists. + +Conjecture: for sufficiently large $n$, not all terms of the sequence are prime. + +Erdős and Graham [ErGr80] write 'preliminary calculations made by Selfridge indicate +that this is the case but no proof is in sight'. For example if $n = 8$ we have +$a_1 = 7$ and $a_2 = 5$ and then the sequence terminates. + +Note: This problem is equivalent to Erdős Problem 385 (see `erdos_385`). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset + +namespace Erdos430 + +/-- The next term in the Erdős 430 sequence: the greatest $m$ in $[2, \text{prev})$ such that +all prime factors of $m$ are $> n - m$. The condition "all prime factors $> n - m$" +is equivalent to `Nat.minFac m > n - m`, i.e., $n < m + \operatorname{minFac}(m)$. +Returns $0$ if no such $m$ exists (sequence terminates). -/ +def nextTerm (n prev : ℕ) : ℕ := + let S := (Ico 2 prev).filter (fun m => n < m + m.minFac) + if h : S.Nonempty then S.max' h else 0 + +/-- The Erdős 430 sequence for a given $n$: $a(0) = n - 1$, +$a(k+1) = \operatorname{nextTerm}(n, a(k))$. Terms become $0$ once the sequence terminates. -/ +def seq (n : ℕ) : ℕ → ℕ + | 0 => n - 1 + | k + 1 => nextTerm n (seq n k) + +/-- +Erdős Problem 430 [ErGr80]: + +For sufficiently large $n$, the greedy decreasing sequence in $[2, n)$ starting at +$n - 1$, where each term has all prime factors larger than its complement to $n$, +must contain a composite number. +-/ +@[category research open, AMS 11] +theorem erdos_430 : + answer(sorry) ↔ + (∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ k : ℕ, (seq n k).Composite) := by + sorry + +end Erdos430 diff --git a/FormalConjectures/ErdosProblems/431.lean b/FormalConjectures/ErdosProblems/431.lean new file mode 100644 index 0000000000..d76c4aaea2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/431.lean @@ -0,0 +1,71 @@ +/- +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 431 + +*Reference:* [erdosproblems.com/431](https://www.erdosproblems.com/431) + +Are there two infinite sets $A$ and $B$ of natural numbers such that the sumset +$A + B = \{a + b \mid a \in A, b \in B\}$ agrees with the set of prime numbers up to +finitely many exceptions? + +This is a problem of Ostmann, sometimes known as the 'inverse Goldbach problem'. +The expected answer is no. + +Elsholtz and Harper [ElHa15] showed that if $A$, $B$ are such sets then for all +large $x$ we must have +$x^{1/2}/(\log x \cdot \log \log x) \ll |A \cap [1,x]| \ll x^{1/2} \cdot \log \log x$ +and similarly for $B$. + +Elsholtz [El01] proved there are no sets $A$, $B$, $C$ (all of size at least 2) such that +$A + B + C$ agrees with the primes up to finitely many exceptions. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +p. 225. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980), p. 85. + +[El01] Elsholtz, C., _The inverse Goldbach problem_. Mathematika (2001), 151–158. + +[ElHa15] Elsholtz, C. and Harper, A. J., _Additive decompositions of sets with restricted +prime factors_. Trans. Amer. Math. Soc. (2015), 7403–7427. + +[Gr90] Granville, A., _A note on sums of primes_. Canad. Math. Bull. (1990), 452–454. + +[TaZi23] Tao, T. and Ziegler, T., _Infinite partial sumsets in the primes_. J. Anal. Math. +(2023), 375–389. +-/ + +namespace Erdos431 + +/-- +Erdős Problem 431 [ErGr80]: Are there two infinite sets $A$ and $B$ of natural +numbers such that the sumset $A + B = \{a + b \mid a \in A, b \in B\}$ agrees with +the set of prime numbers up to finitely many exceptions? +-/ +@[category research open, AMS 11] +theorem erdos_431 : answer(sorry) ↔ + ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ + (symmDiff (Set.image2 (· + ·) A B) {n | n.Prime}).Finite := by + sorry + +end Erdos431 diff --git a/FormalConjectures/ErdosProblems/432.lean b/FormalConjectures/ErdosProblems/432.lean new file mode 100644 index 0000000000..292d57e500 --- /dev/null +++ b/FormalConjectures/ErdosProblems/432.lean @@ -0,0 +1,49 @@ +/- +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 + +/-! +# Erdős Problem 432 + +*Reference:* [erdosproblems.com/432](https://www.erdosproblems.com/432) + +Asked by Straus, inspired by a problem of Ostmann (see Problem #431). + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p.85. +-/ + +open Filter + +namespace Erdos432 + +/-- +Erdős Problem 432 [ErGr80, p.85]: + +Let $A, B \subseteq \mathbb{N}$ be two infinite sets. If all elements of the sumset +$A + B = \{a + b \mid a \in A, b \in B\}$ are pairwise coprime, then $A + B$ has +zero upper density. +-/ +@[category research open, AMS 5 11] +theorem erdos_432 + (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite) + (h_coprime : (Set.image2 (· + ·) A B).Pairwise Nat.Coprime) : + (Set.image2 (· + ·) A B).upperDensity = 0 := by + sorry + +end Erdos432 diff --git a/FormalConjectures/ErdosProblems/433.lean b/FormalConjectures/ErdosProblems/433.lean new file mode 100644 index 0000000000..e13590666d --- /dev/null +++ b/FormalConjectures/ErdosProblems/433.lean @@ -0,0 +1,81 @@ +/- +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 433 + +*Reference:* [erdosproblems.com/433](https://www.erdosproblems.com/433) + +If $A \subset \mathbb{N}$ is a finite set with $\gcd(A) = 1$, let $G(A)$ denote the Frobenius +number: the greatest natural number not expressible as a non-negative integer linear combination of +elements of $A$ (with repetitions allowed). Define +$$g(k,n) = \max G(A)$$ +where the maximum is over all $A \subseteq \{1,\ldots,n\}$ with $|A| = k$ and $\gcd(A) = 1$. + +Is it true that $g(k,n) \sim n^2/(k-1)$? + +Erdős and Graham [ErGr72] proved $g(k,n) < 2n^2/k$, and examples show +$g(k,n) \geq n^2/(k-1) - 5n$ for $k \geq 2$. + +This was proved by Dixmier [Di90], who showed that for all $2 \leq k < n$, +$$\lfloor(n-2)/(k-1)\rfloor(n-k+1) - 1 \leq g(k,n) \leq (\lfloor(n-1)/(k-1)\rfloor - 1)n - 1.$$ +Dixmier also determined $g(k,n)$ exactly when $k-1 \mid n$, $k-1 \mid n-1$, or $k-1 \mid n-2$. + +[Di90] Dixmier, J., _Proof of a conjecture by Erdős and Graham concerning the problem of +Frobenius_. J. London Math. Soc. (2) 41 (1990), 227-237. + +[ErGr72] Erdős, P. and Graham, R. L., _On a linear diophantine problem of Frobenius_. +Acta Arithmetica **21** (1972), 399-408. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset BigOperators Filter Asymptotics + +namespace Erdos433 + +/-- A natural number $m$ is representable by a finite set $A$ if it equals +$\sum_{a \in A} f(a) \cdot a$ for some coefficient function $f : \mathbb{N} \to \mathbb{N}$. -/ +def Representable433 (A : Finset ℕ) (m : ℕ) : Prop := + ∃ f : ℕ → ℕ, ∑ a ∈ A, f a * a = m + +/-- The Frobenius number of $A$: the supremum of natural numbers not representable +as a non-negative integer linear combination of elements of $A$. Equals $0$ when +every natural number is representable (e.g., when $1 \in A$). -/ +noncomputable def FrobeniusNumber433 (A : Finset ℕ) : ℕ := + sSup {m : ℕ | ¬ Representable433 A m} + +/-- $g(k,n) = \max G(A)$ over all $A \subseteq \{1,\ldots,n\}$ with $|A| = k$ and +$\gcd(A) = 1$. -/ +noncomputable def g433 (k n : ℕ) : ℕ := + sSup (FrobeniusNumber433 '' {A : Finset ℕ | A ⊆ Icc 1 n ∧ A.card = k ∧ A.gcd id = 1}) + +/-- +Erdős Problem 433 [ErGr80]: + +For any fixed $k \geq 2$, $g(k,n) \sim n^2/(k-1)$ as $n \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_433 : answer(True) ↔ + ∀ k : ℕ, 2 ≤ k → + (fun n : ℕ => (g433 k n : ℝ)) ~[atTop] + (fun n : ℕ => (n : ℝ) ^ 2 / ((k : ℝ) - 1)) := by + sorry + +end Erdos433 diff --git a/FormalConjectures/ErdosProblems/435.lean b/FormalConjectures/ErdosProblems/435.lean new file mode 100644 index 0000000000..1c49a0ab8b --- /dev/null +++ b/FormalConjectures/ErdosProblems/435.lean @@ -0,0 +1,69 @@ +/- +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 435 + +Determine the largest natural number not representable as a non-negative integer +linear combination of the interior binomial coefficients $\binom{n}{i}$ for +$1 \le i \le n-1$, when $n \ge 2$ is not a prime power. + +*Reference:* [erdosproblems.com/435](https://www.erdosproblems.com/435) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[HwSo24] Hwang, W. and Song, K., _The Frobenius problem for numerical semigroups generated by +binomial coefficients_. arXiv:2412.17882 (2024). + +See also OEIS sequence [A389479](https://oeis.org/A389479). +-/ + +open Finset BigOperators + +namespace Erdos435 + +/-- The set of natural numbers representable as a non-negative integer linear +combination of the binomial coefficients $\binom{n}{i}$ for $1 \le i \le n-1$. -/ +def BinomialRepresentable (n : ℕ) : Set ℕ := + {m : ℕ | ∃ c : ℕ → ℕ, m = ∑ i ∈ range (n - 1), c i * n.choose (i + 1)} + +/-- The formula for the answer to Erdős Problem 435: +$$\sum_p \left(\sum_{d=1}^{v_p(n)} \binom{n}{p^d}\right) \cdot (p - 1) - n$$ +where the outer sum ranges over primes $p$ dividing $n$ and $v_p(n)$ is the +$p$-adic valuation of $n$. -/ +noncomputable def erdos435Formula (n : ℕ) : ℕ := + (∑ p ∈ n.factorization.support, + (∑ d ∈ range (n.factorization p), n.choose (p ^ (d + 1))) * (p - 1)) - n + +/-- Erdős Problem 435 [ErGr80, p.86]: + +Let $n \in \mathbb{N}$ with $n \ge 2$ and $n$ not a prime power. The largest natural number +not representable as $\sum_{1 \le i < n} c_i \binom{n}{i}$ with non-negative integers $c_i$ +equals +$$\sum_p \left(\sum_{d=1}^{v_p(n)} \binom{n}{p^d}\right) \cdot (p - 1) - n,$$ +where the outer sum is over primes $p$ dividing $n$. + +First proved by Hwang and Song [HwSo24]. Independently found by Peake and Cambie. -/ +@[category research solved, AMS 5 11] +theorem erdos_435 (n : ℕ) (hn : 2 ≤ n) (hnpp : ¬IsPrimePow n) : + erdos435Formula n ∉ BinomialRepresentable n ∧ + ∀ m : ℕ, m > erdos435Formula n → m ∈ BinomialRepresentable n := by + sorry + +end Erdos435 diff --git a/FormalConjectures/ErdosProblems/436.lean b/FormalConjectures/ErdosProblems/436.lean new file mode 100644 index 0000000000..bebe62d40a --- /dev/null +++ b/FormalConjectures/ErdosProblems/436.lean @@ -0,0 +1,87 @@ +/- +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 436 + +*Reference:* [erdosproblems.com/436](https://www.erdosproblems.com/436) + +For prime $p$ and $k, m \geq 2$, let $r(k,m,p)$ be the minimal $r$ such that +$r, r+1, \ldots, r+m-1$ are all $k$-th power residues modulo $p$. +Let $\Lambda(k,m) = \limsup_{p \to \infty} r(k,m,p)$. + +Hildebrand [Hi91] proved that $\Lambda(k,2)$ is finite for all $k \geq 2$. +Graham [Gr64g] proved that $\Lambda(k,\ell) = \infty$ for all $k \geq 2$ and $\ell \geq 4$. +Lehmer and Lehmer [LeLe62] proved that $\Lambda(k,3) = \infty$ for all even $k$. + +The remaining open question is whether $\Lambda(k,3)$ is finite for all odd $k \geq 5$. + +## References + +- [Hi91] Hildebrand, A., _On consecutive k-th power residues. II_. Michigan Math. J. **38** (1991), 241–253. +- [Gr64g] Graham, R. L., _On quadruples of consecutive k-th power residues_. Proc. Amer. Math. Soc. **15** (1964), 196–197. +- [LeLe62] Lehmer, D. H., Lehmer, E., _On runs of residues_. Proc. Amer. Math. Soc. **13** (1962), 102–106. +-/ + +namespace Erdos436 + +/-- A natural number $a$ is a $k$-th power residue modulo $p$ if there exists +$x$ such that $x^k = a$ in $\mathbb{Z}/p\mathbb{Z}$. -/ +def IsKthPowerResidueMod (k : ℕ) (a : ℕ) (p : ℕ) : Prop := + ∃ x : ZMod p, x ^ k = (a : ZMod p) + +/-- `LambdaFinite k m` asserts that $\Lambda(k,m)$ is finite: there exists a bound $R$ +such that for all sufficiently large primes $p$, there exist $m$ consecutive +$k$-th power residues modulo $p$ starting at some $r$ with $1 \leq r \leq R$. -/ +def LambdaFinite (k m : ℕ) : Prop := + ∃ R : ℕ, ∃ N : ℕ, ∀ p : ℕ, p.Prime → p > N → + ∃ r : ℕ, r ≥ 1 ∧ r ≤ R ∧ ∀ j : ℕ, j < m → IsKthPowerResidueMod k (r + j) p + +/-- Erdős Problem 436: Is $\Lambda(k,3)$ finite for all odd $k \geq 5$? That is, for any +odd $k \geq 5$, if $p$ is sufficiently large then there exist three consecutive $k$-th +power residues modulo $p$ in $[1, O_k(1)]$. -/ +@[category research open, AMS 11] +theorem erdos_436 : answer(sorry) ↔ + ∀ k : ℕ, 5 ≤ k → k % 2 = 1 → LambdaFinite k 3 := by + sorry + +/-- Hildebrand [Hi91] proved that $\Lambda(k,2)$ is finite for all $k \geq 2$. For any +$k \geq 2$, if $p$ is sufficiently large then there exists a pair of consecutive $k$-th +power residues modulo $p$ in $[1, O_k(1)]$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.hildebrand (k : ℕ) (hk : 2 ≤ k) : + LambdaFinite k 2 := by + sorry + +/-- Graham [Gr64g] proved that $\Lambda(k,\ell) = \infty$ for all $k \geq 2$ and $\ell \geq 4$. +That is, for any bound $R$, there are infinitely many primes $p$ for which no run of $\ell$ +consecutive $k$-th power residues begins in $[1, R]$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.graham (k : ℕ) (hk : 2 ≤ k) (m : ℕ) (hm : 4 ≤ m) : + ¬ LambdaFinite k m := by + sorry + +/-- Lehmer and Lehmer [LeLe62] proved that $\Lambda(k,3) = \infty$ for all even $k \geq 2$. +That is, for any bound $R$, there are infinitely many primes $p$ for which no run of three +consecutive $k$-th power residues begins in $[1, R]$. -/ +@[category research solved, AMS 11] +theorem erdos_436.variants.lehmer_lehmer (k : ℕ) (hk : 2 ≤ k) (heven : k % 2 = 0) : + ¬ LambdaFinite k 3 := by + sorry + +end Erdos436 diff --git a/FormalConjectures/ErdosProblems/437.lean b/FormalConjectures/ErdosProblems/437.lean new file mode 100644 index 0000000000..0c688fac82 --- /dev/null +++ b/FormalConjectures/ErdosProblems/437.lean @@ -0,0 +1,75 @@ +/- +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 437 + +*Reference:* [erdosproblems.com/437](https://www.erdosproblems.com/437) + +Let $1 \le a_1 < \cdots < a_k \le x$. How many of the partial products +$a_1, a_1 a_2, \ldots, a_1 \cdots a_k$ can be squares? Is it true that, for any +$\varepsilon > 0$, there can be more than $x^{1-\varepsilon}$ squares? + +Erdős and Graham write it is 'trivial' that there are $o(x)$ many such squares, +although this is not quite trivial, using Siegel's theorem. + +A positive answer follows from work of Bui, Pratt, and Zaharescu [BPZ24], +as noted by Tao. + +See also Problem 841 for a related problem. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[BPZ24] Bui, H. M., Pratt, K., and Zaharescu, A., _A problem of +Erdős-Graham-Granville-Selfridge on integral points on hyperelliptic curves_. +Mathematical Proceedings of the Cambridge Philosophical Society (2024), 309–323. +-/ + +open scoped BigOperators + +namespace Erdos437 + +/-- The partial product of the first $j+1$ elements of a finite sequence +$a \colon \mathrm{Fin}\; k \to \mathbb{N}$, i.e., $a(0) \cdot a(1) \cdots a(j)$. -/ +def partialProd {k : ℕ} (a : Fin k → ℕ) (j : Fin k) : ℕ := + ∏ i ∈ Finset.Iic j, a i + +/-- The count of indices $j \in \{0, \ldots, k-1\}$ for which the partial product +$a(0) \cdots a(j)$ is a perfect square. -/ +def squareCount {k : ℕ} (a : Fin k → ℕ) : ℕ := + (Finset.univ.filter (fun j : Fin k => IsSquare (partialProd a j))).card + +/-- Erdős Problem 437 (solved): +For any $\varepsilon > 0$ and all sufficiently large $x$, there exists a strictly +increasing sequence $1 \le a_1 < \cdots < a_k \le x$ such that more than +$x^{1-\varepsilon}$ of the partial products $a_1, a_1 a_2, \ldots, a_1 \cdots a_k$ +are perfect squares. + +Proved by Bui, Pratt, and Zaharescu [BPZ24], as noted by Tao. -/ +@[category research solved, AMS 11] +theorem erdos_437 : answer(True) ↔ ∀ (ε : ℝ), 0 < ε → + ∃ N : ℕ, ∀ x : ℕ, N ≤ x → + ∃ (k : ℕ) (a : Fin k → ℕ), + StrictMono a ∧ + (∀ i, 1 ≤ a i) ∧ + (∀ i, a i ≤ x) ∧ + (squareCount a : ℝ) > (x : ℝ) ^ ((1 : ℝ) - ε) := by + sorry + +end Erdos437 diff --git a/FormalConjectures/ErdosProblems/438.lean b/FormalConjectures/ErdosProblems/438.lean new file mode 100644 index 0000000000..cb6a1b197f --- /dev/null +++ b/FormalConjectures/ErdosProblems/438.lean @@ -0,0 +1,66 @@ +/- +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 438 + +*Reference:* [erdosproblems.com/438](https://www.erdosproblems.com/438) + +How large can $A \subseteq \{1, \ldots, N\}$ be if $A + A$ contains no square numbers? + +Taking all integers $\equiv 1 \pmod{3}$ shows that $|A| \geq N/3$ is possible. This can +be improved to $(11/32)N$ by taking all integers $\equiv 1,5,9,13,14,17,21,25,26,29,30 +\pmod{32}$, as observed by Massias. + +Lagarias, Odlyzko, and Shearer [LOS83] proved the bound $|A| \leq 0.475N$ and showed the +modular version is sharp. Khalfalah, Lodha, and Szemerédi [KLS02] proved that the maximal +such $A$ satisfies $|A| \leq (11/32 + o(1))N$, showing that $11/32$ is sharp. + +[LOS83] Lagarias, J. C., Odlyzko, A. M., and Shearer, J. B., _On the density of sequences +of integers the sum of no two of which is a square. II. General sequences_. Journal of +Combinatorial Theory, Series A (1983), 123–139. + +[KLS02] Khalfalah, A., Lodha, S., and Szemerédi, E., _On the density of sumsets not +containing a square_. Discrete Mathematics (2002), 243–255. + +See also: Erdős Problems 439, 587. +-/ + +open Finset + +namespace Erdos438 + +/-- No sum of two elements of $A$ is a perfect square. -/ +def SumsetAvoidSquares (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ¬IsSquare (a + b) + +/-- Erdős Problem 438 (solved): +For any $\varepsilon > 0$, for all sufficiently large $N$, if $A \subseteq \{1, \ldots, N\}$ +and no sum $a + b$ with $a, b \in A$ is a perfect square, then +$|A| \leq (11/32 + \varepsilon) \cdot N$. + +Proved by Khalfalah, Lodha, and Szemerédi [KLS02]. -/ +@[category research solved, AMS 5 11] +theorem erdos_438 (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, (∀ x ∈ A, 1 ≤ x ∧ x ≤ N) → + SumsetAvoidSquares A → + (A.card : ℝ) ≤ (11 / 32 + ε) * (N : ℝ) := by + sorry + +end Erdos438 diff --git a/FormalConjectures/ErdosProblems/439.lean b/FormalConjectures/ErdosProblems/439.lean new file mode 100644 index 0000000000..e1bee90fe5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/439.lean @@ -0,0 +1,81 @@ +/- +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 Mathlib.RingTheory.Polynomial.Basic + +/-! +# Erdős Problem 439 + +*Reference:* [erdosproblems.com/439](https://www.erdosproblems.com/439) + +Is it true that, in any finite colouring of the integers, there must be two +integers $x \ne y$ of the same colour such that $x + y$ is a square? What about +a $k$-th power? + +A question of Roth, Erdős, Sárközy, and Sós. Erdős, Sárközy, and Sós proved +this for 2 or 3 colours. + +This was proved by Khalfalah and Szemerédi [KhSz06], who showed the general +result with $x + y = z^2$ replaced by $x + y = f(z)$ for any non-constant +$f(z) \in \mathbb{Z}[z]$ such that $2 \mid f(z)$ for some $z \in \mathbb{Z}$. +Since $k$-th powers include even values (take $z$ even), the $k$-th power case +follows. + +[KhSz06] Khalfalah, A. and Szemerédi, E., _On the number of monochromatic +solutions of $x + y = z^2$_. Combinatorics, Probability and Computing (2006), +15(1-2), 213-227. +-/ + +namespace Erdos439 + +/-- Erdős Problem 439, square case: +In any finite colouring of the natural numbers, there exist distinct $x$ and $y$ +of the same colour such that $x + y$ is a perfect square. + +Proved by Khalfalah and Szemerédi [KhSz06]. -/ +@[category research solved, AMS 5 11] +theorem erdos_439 : answer(True) ↔ + ∀ (c : ℕ) (f : ℕ → Fin c), ∃ x y : ℕ, x ≠ y ∧ f x = f y ∧ IsSquare (x + y) := by + sorry + +/-- Erdős Problem 439, $k$-th power generalization: +In any finite colouring of the natural numbers, there exist distinct $x$ and $y$ +of the same colour such that $x + y$ is a perfect $k$-th power (i.e., $z^k$ for +some $z$). + +Also follows from the result of Khalfalah and Szemerédi [KhSz06]. -/ +@[category research solved, AMS 5 11] +theorem erdos_439.variants.kth_powers : answer(True) ↔ + ∀ (k : ℕ), 2 ≤ k → ∀ (c : ℕ) (f : ℕ → Fin c), + ∃ x y : ℕ, x ≠ y ∧ f x = f y ∧ ∃ z : ℕ, z ^ k = x + y := by + sorry + +/-- Erdős Problem 439, polynomial generalization (Khalfalah-Szemerédi [KhSz06]): +For any non-constant polynomial $f(z) \in \mathbb{Z}[z]$ such that $2 \mid f(z)$ for some +$z \in \mathbb{Z}$, in any finite colouring of the natural numbers there exist distinct $x$ and +$y$ of the same colour such that $x + y = f(z)$ for some integer $z$. + +This is the main result of Khalfalah and Szemerédi [KhSz06], from which both the square +and $k$-th power cases follow. -/ +@[category research solved, AMS 5 11] +theorem erdos_439.variants.polynomial (f : Polynomial ℤ) (hf : f.degree ≥ 1) + (heven : ∃ z : ℤ, 2 ∣ f.eval z) : + ∀ (c : ℕ) (g : ℕ → Fin c), + ∃ x y : ℕ, x ≠ y ∧ g x = g y ∧ ∃ z : ℤ, f.eval z = ↑(x + y) := by + sorry + +end Erdos439 diff --git a/FormalConjectures/ErdosProblems/440.lean b/FormalConjectures/ErdosProblems/440.lean new file mode 100644 index 0000000000..9e8f177336 --- /dev/null +++ b/FormalConjectures/ErdosProblems/440.lean @@ -0,0 +1,78 @@ +/- +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 440 + +*Reference:* [erdosproblems.com/440](https://www.erdosproblems.com/440) + +Let $A = \{a_1 < a_2 < \cdots\} \subseteq \mathbb{N}$ be infinite and let $A(x)$ count the +number of indices $i$ for which $\mathrm{lcm}(a_i, a_{i+1}) \leq x$. Is it true that +$A(x) \ll x^{1/2}$? + +How large can $\liminf A(x)/x^{1/2}$ be? + +Taking $A = \mathbb{N}$ shows that $\liminf A(x)/x^{1/2} = 1$ is possible. Erdős and +Szemerédi [ErSz80] proved that it is always $\leq 1$. + +Tao proved that $A(x) \ll x^{1/2}$. Chase also contributed to the problem. +van Doorn proved that $A(x) \leq (c + o(1))x^{1/2}$ where +$c = \sum_{n \geq 1} 1/(n^{1/2}(n+1)) \approx 1.86$. +This was already proved by Erdős and Szemerédi, who showed this constant +is best possible. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[ErSz80] Erdős, P. and Szemerédi, E., _Remarks on a problem of the American Mathematical +Monthly_. Mat. Lapok (1980), 121-124. +-/ + +open Filter + +namespace Erdos440 + +/-- For a strictly increasing sequence $a : \mathbb{N} \to \mathbb{N}$ and a bound $x$, count the +number of indices $i$ such that $\mathrm{lcm}(a(i), a(i+1)) \leq x$. -/ +def lcmPairCount (a : ℕ → ℕ) (x : ℕ) : ℕ := + ((Finset.range (x + 1)).filter (fun i => Nat.lcm (a i) (a (i + 1)) ≤ x)).card + +/-- Erdős Problem 440, part 1 (PROVED): +Is it true that for any strictly increasing sequence $a : \mathbb{N} \to \mathbb{N}$, the counting +function $A(x) = \#\{i : \mathrm{lcm}(a(i), a(i+1)) \leq x\}$ satisfies $A(x) = O(\sqrt{x})$? + +Yes — proved by Tao; the sharp constant was determined by Erdős–Szemerédi [ErSz80]. -/ +@[category research solved, AMS 11] +theorem erdos_440 : answer(True) ↔ + ∀ (a : ℕ → ℕ), StrictMono a → + ∃ C : ℝ, 0 < C ∧ ∀ᶠ x in atTop, + (lcmPairCount a x : ℝ) ≤ C * Real.sqrt (x : ℝ) := by + sorry + +/-- Erdős Problem 440, liminf bound (PROVED): +How large can $\liminf_{x \to \infty} A(x)/\sqrt{x}$ be, over all strictly increasing sequences +$a : \mathbb{N} \to \mathbb{N}$? The answer is $1$: the liminf is always $\leq 1$ +(Erdős–Szemerédi [ErSz80]) and $A = \mathbb{N}$ achieves equality. -/ +@[category research solved, AMS 11] +theorem erdos_440.variants.liminf : + sSup {L : ℝ | ∃ (a : ℕ → ℕ), StrictMono a ∧ + liminf (fun x => (lcmPairCount a x : ℝ) / Real.sqrt (x : ℝ)) atTop = L} + = answer((1 : ℝ)) := by + sorry + +end Erdos440 diff --git a/FormalConjectures/ErdosProblems/441.lean b/FormalConjectures/ErdosProblems/441.lean new file mode 100644 index 0000000000..d85be88fee --- /dev/null +++ b/FormalConjectures/ErdosProblems/441.lean @@ -0,0 +1,113 @@ +/- +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 441 + +*Reference:* [erdosproblems.com/441](https://www.erdosproblems.com/441) + +Let $N \geq 1$. What is the size of the largest $A \subseteq \{1, \ldots, N\}$ +such that $\text{lcm}(a, b) \leq N$ for all $a, b \in A$? + +Is it attained by choosing all integers in $[1, (N/2)^{1/2}]$ together with +all even integers in $[(N/2)^{1/2}, (2N)^{1/2}]$? + +This construction gives $g(N) \geq (9N/8)^{1/2} + O(1)$. Erdős [Er51b] proved +$g(N) \leq (4N)^{1/2} + O(1)$. Choi [Ch72b] improved the upper bound. Chen [Ch98] +established the asymptotic $g(N) \sim (9N/8)^{1/2}$. Dai and Chen [DaCh06] proved a +refined upper bound with error term. Chen and Dai [ChDa07] proved that, infinitely +often, Erdős' construction is not optimal, disproving the conjecture. + +See also OEIS sequence [A068509](https://oeis.org/A068509). + +[Er51b] Erdős, P., _Problem_. Matematikai Lapok (1951), 233. + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. +**8** (1965), 181–189. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A +Survey of Combinatorial Theory (1973), 117–138. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in +combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er98] Erdős, P., _Some of my favourite problems which recently have been solved_, +Challenges for the 21st century (Singapore, 2000), 2001. + +[Ch72b] Choi, S. L. G., _The largest subset in {1,...,n} whose integers have +pairwise L.C.M. not exceeding n_. Mathematika (1972), 221–230. + +[Ch98] Chen, Y.-G., _Sequences with bounded l.c.m. of each pair of terms_. Acta +Arith. (1998), 71–95. + +[DaCh06] Dai, L.-X. and Chen, Y.-G., _Sequences with bounded l.c.m. of each pair +of terms. II_. Acta Arith. (2006), 315–326. + +[ChDa07] Chen, Y.-G. and Dai, L.-X., _Sequences with bounded l.c.m. of each pair +of terms. III_. Acta Arith. (2007), 125–133. + +[Gu04] Guy, Richard K., _Unsolved problems in number theory_. (2004), xviii+437. +-/ + +namespace Erdos441 + +/-- A finite set $A \subseteq \{1, \ldots, N\}$ has all pairwise lcm bounded by $N$. -/ +def LcmBounded (A : Finset ℕ) (N : ℕ) : Prop := + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) ∧ ∀ a ∈ A, ∀ b ∈ A, Nat.lcm a b ≤ N + +/-- Erdős' construction: all integers in $[1, \sqrt{N/2}]$ together with all +even integers in $(\sqrt{N/2}, \sqrt{2N}]$. -/ +noncomputable def erdosConstruction (N : ℕ) : Finset ℕ := + let lo := Nat.sqrt (N / 2) + let hi := Nat.sqrt (2 * N) + (Finset.Icc 1 lo) ∪ ((Finset.Ioc lo hi).filter (fun m => Even m)) + +/-- Erdős Problem 441, asymptotic upper bound (proved by Chen [Ch98]): +$g(N) \sim (9N/8)^{1/2}$. For any $\varepsilon > 0$ and sufficiently large $N$, any +$A \subseteq \{1, \ldots, N\}$ with all pairwise $\operatorname{lcm} \leq N$ satisfies +$|A| \leq (1+\varepsilon) \sqrt{9N/8}$. -/ +@[category research solved, AMS 5 11] +theorem erdos_441 (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, LcmBounded A N → + (A.card : ℝ) ≤ (1 + ε) * Real.sqrt (9 * N / 8) := by + sorry + +/-- Erdős Problem 441, asymptotic lower bound (proved by construction): +For any $\varepsilon > 0$ and sufficiently large $N$, there exists +$A \subseteq \{1, \ldots, N\}$ with all pairwise $\operatorname{lcm} \leq N$ and +$|A| \geq (1-\varepsilon) \sqrt{9N/8}$. -/ +@[category research solved, AMS 5 11] +theorem erdos_441.variants.lower (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ A : Finset ℕ, LcmBounded A N ∧ + (1 - ε) * Real.sqrt (9 * N / 8) ≤ (A.card : ℝ) := by + sorry + +/-- Erdős Problem 441, original conjecture (disproved by Chen–Dai [ChDa07]): +It is not true that Erdős' construction is optimal for all $N$. For infinitely +many $N$, there exists $A$ with $|A| > |\operatorname{erdosConstruction}(N)|$ and all +pairwise $\operatorname{lcm} \leq N$. -/ +@[category research solved, AMS 5 11] +theorem erdos_441.variants.disproved : + ∀ N₀ : ℕ, ∃ N : ℕ, N₀ ≤ N ∧ + ∃ A : Finset ℕ, LcmBounded A N ∧ + (erdosConstruction N).card < A.card := by + sorry + +end Erdos441 diff --git a/FormalConjectures/ErdosProblems/443.lean b/FormalConjectures/ErdosProblems/443.lean new file mode 100644 index 0000000000..8db1b96ed3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/443.lean @@ -0,0 +1,88 @@ +/- +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 443 + +*Reference:* [erdosproblems.com/443](https://www.erdosproblems.com/443) + +Let $m,n\geq 1$. What is +$$\# \{ k(m-k) : 1\leq k\leq m/2\} \cap \{ l(n-l) : 1\leq l\leq n/2\}?$$ +Can it be arbitrarily large? Is it $\leq (mn)^{o(1)}$ for all sufficiently +large $m,n$? + +This was solved independently by Hegyvári [He25] and Cambie (unpublished), who +show that if $m > n$ then the set in question has size +$\leq m^{O(1/\log\log m)}$, and that for any integer $s$ there exist infinitely +many pairs $(m,n)$ such that the set in question has size $s$. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[He25] Hegyvári, N., _An elementary question of Erdős and Graham_. arXiv:2503.24201 (2025). +-/ + +open Finset Real + +namespace Erdos443 + +/-- The set $\{k(m-k) : 1 \leq k \leq m/2\}$ of products arising from partitioning $m$ +into two positive parts $k$ and $m-k$ with $k \leq m/2$. -/ +def productSet (m : ℕ) : Finset ℕ := + (Finset.Icc 1 (m / 2)).image (fun k => k * (m - k)) + +/-- The number of common values in the product sets for $m$ and $n$. -/ +def commonProducts (m n : ℕ) : ℕ := + ((productSet m) ∩ (productSet n)).card + +/-- Erdős Problem 443, part 1: +The intersection can be arbitrarily large. For any $s$, there exist +arbitrarily large $m$ and some $n \geq 1$ with +$|\operatorname{productSet}(m) \cap \operatorname{productSet}(n)| \geq s$. + +Proved independently by Hegyvári [He25] and Cambie (unpublished). -/ +@[category research solved, AMS 5 11] +theorem erdos_443 (s : ℕ) : + ∀ m₀ : ℕ, ∃ m : ℕ, m₀ ≤ m ∧ ∃ n : ℕ, 1 ≤ n ∧ s ≤ commonProducts m n := by + sorry + +/-- Erdős Problem 443, part 2: +If $m > n$ then the intersection has subpolynomial size: +$|\operatorname{productSet}(m) \cap \operatorname{productSet}(n)| \leq m^{C / \log \log m}$ +for some constant $C > 0$ and all sufficiently large $m$. + +Proved independently by Hegyvári [He25] and Cambie (unpublished). -/ +@[category research solved, AMS 5 11] +theorem erdos_443.variants.upper_bound : + ∃ C : ℝ, 0 < C ∧ ∃ m₀ : ℕ, ∀ m : ℕ, m₀ ≤ m → + ∀ n : ℕ, 1 ≤ n → n < m → + (commonProducts m n : ℝ) ≤ (m : ℝ) ^ (C / Real.log (Real.log (m : ℝ))) := by + sorry + +/-- Erdős Problem 443, variant: +For any integer $s$, there exist infinitely many pairs $(m, n)$ such that +$|\operatorname{productSet}(m) \cap \operatorname{productSet}(n)| = s$ (exact size). + +This is a strengthening of `erdos_443`, which only shows $\geq s$. +Proved independently by Hegyvári [He25] and Cambie (unpublished). -/ +@[category research solved, AMS 5 11] +theorem erdos_443.variants.exact_size (s : ℕ) : + ∀ m₀ : ℕ, ∃ m : ℕ, m₀ ≤ m ∧ ∃ n : ℕ, 1 ≤ n ∧ commonProducts m n = s := by + sorry + +end Erdos443 diff --git a/FormalConjectures/ErdosProblems/444.lean b/FormalConjectures/ErdosProblems/444.lean new file mode 100644 index 0000000000..b710bbe975 --- /dev/null +++ b/FormalConjectures/ErdosProblems/444.lean @@ -0,0 +1,66 @@ +/- +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 444 + +*Reference:* [erdosproblems.com/444](https://www.erdosproblems.com/444) + +Let $A \subseteq \mathbb{N}$ be infinite and let $d_A(n)$ count the divisors of $n$ that belong +to $A$. Then for every $k$ the limsup of $\max_{n < x} d_A(n)$ divided by the $k$-th power of +the partial reciprocal sum $\sum_{a \in A,\, a < x} 1/a$ is infinite. + +[ErSa80] Erdős, P. and Sárkőzy, A., *On the number of divisors of $n!$*, 1980. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique, 1980. +-/ + +open Finset Filter BigOperators Classical + +namespace Erdos444 + +/-- $d_A(n)$: the number of elements of $A$ that divide $n$. -/ +noncomputable def divisorCountIn (A : Set ℕ) (n : ℕ) : ℕ := + (n.divisors.filter (· ∈ A)).card + +/-- The partial sum of reciprocals of elements of $A$ in $[1, x)$: +$$\sum_{\substack{a \in A \\ 1 \leq a < x}} \frac{1}{a}.$$ -/ +noncomputable def reciprocalSum (A : Set ℕ) (x : ℕ) : ℝ := + ∑ a ∈ (Finset.Ico 1 x).filter (· ∈ A), (1 : ℝ) / (a : ℝ) + +/-- Erdős Problem 444 [ErGr80, p.88] (PROVED): + +Let $A \subseteq \mathbb{N}$ be infinite and $d_A(n)$ count the number of $a \in A$ dividing $n$. +For every $k$, +$$\limsup_{x \to \infty} \frac{\max_{n < x} d_A(n)}{\left(\sum_{a \in A \cap [1,x)} +\frac{1}{a}\right)^k} = \infty.$$ + +Equivalently, for every $M > 0$, there are arbitrarily large $x$ and some $n < x$ +with $d_A(n) > M \cdot \left(\sum_{a \in A \cap [1,x)} \frac{1}{a}\right)^k$. + +Proved by Erdős and Sárkőzy [ErSa80]. -/ +@[category research solved, AMS 11] +theorem erdos_444 (A : Set ℕ) (hA : A.Infinite) (k : ℕ) : + ∀ M : ℝ, 0 < M → + ∃ᶠ x in atTop, + ∃ n : ℕ, 1 ≤ n ∧ n < x ∧ + M * (reciprocalSum A x) ^ k < (divisorCountIn A n : ℝ) := by + sorry + +end Erdos444 diff --git a/FormalConjectures/ErdosProblems/445.lean b/FormalConjectures/ErdosProblems/445.lean new file mode 100644 index 0000000000..ec6df25e21 --- /dev/null +++ b/FormalConjectures/ErdosProblems/445.lean @@ -0,0 +1,54 @@ +/- +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 445 + +*Reference:* [erdosproblems.com/445](https://www.erdosproblems.com/445) + +Is it true that, for any $c > 1/2$, if $p$ is a sufficiently large prime then, +for any $n \geq 0$, there exist $a, b \in (n, n + p^c)$ such that +$ab \equiv 1 \pmod{p}$? + +Heilbronn (unpublished) proved this for $c$ sufficiently close to $1$. +Heath-Brown [He00] used Kloosterman sums to prove this for all $c > 3/4$. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980), p. 89. + +[He00] Heath-Brown, D. R., _Arithmetic applications of Kloosterman sums_. Nieuw Arch. Wiskd. +(5) (2000), 380–384. +-/ + +open Real + +namespace Erdos445 + +/-- Erdős Problem 445 (OPEN): +Is it true that, for any $c > 1/2$, if $p$ is a sufficiently large prime then for any $n \geq 0$ +there exist $a, b \in (n, n + p^c)$ with $ab \equiv 1 \pmod{p}$? [He00] -/ +@[category research open, AMS 11] +theorem erdos_445 : answer(sorry) ↔ ∀ (c : ℝ), c > 1 / 2 → + ∃ P₀ : ℕ, ∀ p : ℕ, p.Prime → P₀ ≤ p → + ∀ n : ℕ, ∃ a b : ℕ, + (n : ℝ) < (a : ℝ) ∧ (a : ℝ) < (n : ℝ) + (p : ℝ) ^ c ∧ + (n : ℝ) < (b : ℝ) ∧ (b : ℝ) < (n : ℝ) + (p : ℝ) ^ c ∧ + a * b ≡ 1 [MOD p] := by + sorry + +end Erdos445 diff --git a/FormalConjectures/ErdosProblems/446.lean b/FormalConjectures/ErdosProblems/446.lean new file mode 100644 index 0000000000..d123276bac --- /dev/null +++ b/FormalConjectures/ErdosProblems/446.lean @@ -0,0 +1,132 @@ +/- +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 446 + +*Reference:* [erdosproblems.com/446](https://www.erdosproblems.com/446) + +Let $\delta(n)$ denote the density of positive integers having a divisor in $(n, 2n)$. +Erdős studied the rate at which $\delta(n) \to 0$ and conjectured that +$\delta_1(n) = o(\delta(n))$, where $\delta_1(n)$ is the density of integers with exactly +one such divisor. + +**Related problems:** [#448](https://www.erdosproblems.com/448), +[#692](https://www.erdosproblems.com/692), [#693](https://www.erdosproblems.com/693) + +**OEIS:** [A074738](https://oeis.org/A074738) + +**Bibliography:** + +- [Be34] Besicovitch, A. S., _On the density of certain sequences of integers_. + Math. Annalen (1934), 336-341. +- [Er35] Erdős, P., _Note on sequences of integers no one of which is divisible by any other_. + J. London Math. Soc. (1935), 126-128. +- [Er60] Erdős, P., _An asymptotic inequality in the theory of numbers_. + Vestnik Leningrad. Univ. (1960), 41-49. +- [Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979). +- [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number + theory_. Monographies de L'Enseignement Mathematique (1980). +- [Te84] Tenenbaum, G., _Sur la probabilité qu'un entier possède un diviseur dans un intervalle + donné_. Compositio Math. (1984), 243-263. +- [Fo08] Ford, K., _The distribution of integers with a divisor in a given interval_. + Ann. of Math. (2) (2008), 367-433. +- [Ob1] Oberwolfach problem session (1986). +-/ + +open Filter + +open scoped Topology + +namespace Erdos446 + +/-- +Count of positive integers $m \le N$ having at least one divisor $d$ +in the open interval $(n, 2n)$. +-/ +def countWithDivisor (n N : ℕ) : ℕ := + ((Finset.Icc 1 N).filter (fun m => + ((Finset.Ioo n (2 * n)).filter (fun d => d ∣ m)).Nonempty)).card + +/-- +Count of positive integers $m \le N$ having exactly $r$ divisors $d$ +in the open interval $(n, 2n)$. +-/ +def countWithExactDivisors (r n N : ℕ) : ℕ := + ((Finset.Icc 1 N).filter (fun m => + ((Finset.Ioo n (2 * n)).filter (fun d => d ∣ m)).card = r)).card + +/-- +The constant $\alpha = 1 - \frac{1 + \log(\log 2)}{\log 2} \approx 0.08607$, +appearing in the growth rate of $\delta(n)$. +-/ +noncomputable def erdos446Alpha : ℝ := 1 - (1 + Real.log (Real.log 2)) / Real.log 2 + +/-- +Ford's theorem on the growth rate of $\delta(n)$ [Fo08]: + +Let $\delta(n)$ denote the natural density of integers which are divisible by some +integer in $(n, 2n)$. Ford determined the exact growth rate: +$$\delta(n) \asymp \frac{1}{(\log n)^\alpha \cdot (\log \log n)^{3/2}}$$ +where $\alpha = 1 - \frac{1 + \log \log 2}{\log 2} \approx 0.08607$. + +This is formalized as: there exist constants $C_1, C_2 > 0$ such that for all +sufficiently large $n$, the proportion of integers $\le N$ with a divisor in $(n, 2n)$ +converges (as $N \to \infty$) to a value $\delta(n)$ satisfying +$$C_1 / f(n) \le \delta(n) \le C_2 / f(n)$$ +where $f(n) = (\log n)^\alpha \cdot (\log \log n)^{3/2}$. +-/ +@[category research solved, AMS 11] +theorem erdos_446 : + ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ δ : ℝ, + Filter.Tendsto (fun N : ℕ => (countWithDivisor n N : ℝ) / (N : ℝ)) + atTop (nhds δ) ∧ + C₁ / ((Real.log (n : ℝ)) ^ erdos446Alpha * + (Real.log (Real.log (n : ℝ))) ^ ((3 : ℝ) / 2)) ≤ δ ∧ + δ ≤ C₂ / ((Real.log (n : ℝ)) ^ erdos446Alpha * + (Real.log (Real.log (n : ℝ))) ^ ((3 : ℝ) / 2)) := by + sorry + +/-- +Ford's disproof of $\delta_1(n) = o(\delta(n))$ [Fo08]: + +Erdős conjectured that $\delta_1(n) = o(\delta(n))$, where $\delta_1(n)$ is the density of +integers with exactly one divisor in $(n, 2n)$. Ford disproved this, showing more +generally that for each $r \ge 1$, $\delta_r(n) \gg_r \delta(n)$, where $\delta_r(n)$ is the +density of integers with exactly $r$ divisors in $(n, 2n)$. + +This is formalized as: for each $r \ge 1$, there exists $c > 0$ such that for all +sufficiently large $n$, the natural density $\delta_r(n)$ satisfies +$\delta_r(n) \ge c \cdot \delta(n)$. +-/ +@[category research solved, AMS 11] +theorem erdos_446.variants.disproof : + ∀ r : ℕ, 0 < r → + ∃ c : ℝ, 0 < c ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ δ δ_r : ℝ, + Filter.Tendsto (fun N : ℕ => (countWithDivisor n N : ℝ) / (N : ℝ)) + atTop (nhds δ) ∧ + Filter.Tendsto (fun N : ℕ => (countWithExactDivisors r n N : ℝ) / (N : ℝ)) + atTop (nhds δ_r) ∧ + δ_r ≥ c * δ := by + sorry + +end Erdos446 diff --git a/FormalConjectures/ErdosProblems/447.lean b/FormalConjectures/ErdosProblems/447.lean new file mode 100644 index 0000000000..e24d96011f --- /dev/null +++ b/FormalConjectures/ErdosProblems/447.lean @@ -0,0 +1,58 @@ +/- +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 447 + +*Reference:* [erdosproblems.com/447](https://www.erdosproblems.com/447) + +How large can a union-free collection $\mathcal{F}$ of subsets of $[n]$ be? Erdős [Er65b] +conjectured that $|\mathcal{F}| < (1 + o(1)) \binom{n}{\lfloor n/2 \rfloor}$. + +Solved by Kleitman [Kl71], who proved the conjectured bound. + +See also Problem 487 and Problem 1023 for related problems. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Lectures on Modern Mathematics, +Vol. III (1965), 196-244. + +[Kl71] Kleitman, D., _Collections of subsets containing no two sets and their union_. +Proc. LA Meeting AMS (1971), 153-155. +-/ + +namespace Erdos447 + +/-- A family of finsets is union-free if there are no three distinct members +$A$, $B$, $C$ with $A \cup B = C$. -/ +def UnionFreeFamily {α : Type*} [DecidableEq α] (F : Finset (Finset α)) : Prop := + ∀ A ∈ F, ∀ B ∈ F, ∀ C ∈ F, A ≠ B → A ≠ C → B ≠ C → A ∪ B ≠ C + +/-- Erdős Problem 447 (Kleitman's Theorem [Kl71]): +For every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, if $\mathcal{F}$ +is a union-free family of subsets of $\{1, \ldots, n\}$, then +$$|\mathcal{F}| \leq (1 + \varepsilon) \binom{n}{\lfloor n/2 \rfloor}.$$ -/ +@[category research solved, AMS 5] +theorem erdos_447 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ F : Finset (Finset (Fin n)), + UnionFreeFamily F → + (F.card : ℝ) ≤ (1 + ε) * (Nat.choose n (n / 2) : ℝ) := by + sorry + +end Erdos447 diff --git a/FormalConjectures/ErdosProblems/448.lean b/FormalConjectures/ErdosProblems/448.lean new file mode 100644 index 0000000000..303ed70416 --- /dev/null +++ b/FormalConjectures/ErdosProblems/448.lean @@ -0,0 +1,96 @@ +/- +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 448 + +*Reference:* [erdosproblems.com/448](https://www.erdosproblems.com/448) + +Let $\tau(n)$ count the divisors of $n$ and $\tau^+(n)$ count the number of $k$ +such that $n$ has a divisor in $[2^k, 2^{k+1})$. Is it true that, for all +$\epsilon > 0$, $\tau^+(n) < \epsilon \tau(n)$ for almost all $n$? + +This was disproved by Erdős and Tenenbaum [ErTe81], who showed that for every +$\epsilon > 0$, the upper density of $\{n : \tau^+(n) \geq \epsilon \tau(n)\}$ +is $\asymp \epsilon^{1-o(1)}$ (positive for each fixed $\epsilon$). + +Hall and Tenenbaum [HaTe88] showed the upper density is +$\ll \epsilon \log(2/\epsilon)$ and proved that $\tau^+(n)/\tau(n)$ has a +distribution function. + +Ford [Fo08] answered a follow-up question, proving an asymptotic formula +$\sum_{n \leq x} \tau^+(n) \asymp x (\log x)^{1-\alpha} / (\log \log x)^{3/2}$ +where $\alpha = 1 - (1 + \log \log 2)/\log 2 \approx 0.08607$. + +See also problems #446 and #449. + +[Er79] Erdős, P., _Some unconventional problems in number theory_ (1979). + +[Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980), p. 89. + +[Er81h] Erdős, P., _Some problems and results in number theory_ (1981), p. 173. + +[ErTe81] Erdős, P. and Tenenbaum, G., _Sur la structure de la suite des diviseurs d'un entier_. +Ann. Inst. Fourier (Grenoble) **31** (1981), 17–37. + +[HaTe88] Hall, R. R. and Tenenbaum, G., _Divisors_. Cambridge Tracts in Mathematics (1988). + +[Fo08] Ford, K., _The distribution of integers with a divisor in a given interval_. Ann. of Math. +(2) **168** (2008), 367–433. +-/ + +open Finset Classical + +namespace Erdos448 + +/-- $\tau^+(n)$: the number of $k \in \mathbb{N}$ such that $n$ has a divisor $d$ with +$2^k \leq d < 2^{k+1}$. + +`Finset.range n` suffices because any divisor $d$ of $n$ satisfies $d \leq n$, +so $2^k \leq d \leq n$ implies $k \leq \log_2(n) < n$ for $n \geq 1$. -/ +noncomputable def tauPlus (n : ℕ) : ℕ := + ((Finset.range n).filter (fun k => + (n.divisors.filter (fun d => 2 ^ k ≤ d ∧ d < 2 ^ (k + 1))).Nonempty)).card + +/-- Erdős Problem 448 (disproved by Erdős–Tenenbaum [ErTe81]): +Is it true that, for all $\epsilon > 0$, $\tau^+(n) < \epsilon \tau(n)$ for almost all $n$? +The answer is no. -/ +@[category research solved, AMS 11] +theorem erdos_448 : answer(False) ↔ + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ((Finset.Icc 1 N).filter (fun n => + (tauPlus n : ℝ) ≥ ε * (n.divisors.card : ℝ))).card / (N : ℝ) < δ := by + sorry + +/-- Stronger result by Erdős–Tenenbaum [ErTe81]: for every $\epsilon > 0$, the upper density +of $\{n : \tau^+(n) \geq \epsilon \cdot \tau(n)\}$ is positive. -/ +@[category research solved, AMS 11] +theorem erdos_448.variants.upper_density : + ∀ ε : ℝ, ε > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ N₀ : ℕ, ∃ N : ℕ, N₀ ≤ N ∧ + c ≤ ((Finset.Icc 1 N).filter (fun n => + (tauPlus n : ℝ) ≥ ε * (n.divisors.card : ℝ))).card / (N : ℝ) := by + sorry + +end Erdos448 diff --git a/FormalConjectures/ErdosProblems/449.lean b/FormalConjectures/ErdosProblems/449.lean new file mode 100644 index 0000000000..77ea9824a6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/449.lean @@ -0,0 +1,70 @@ +/- +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 + +/-! +# Erdős Problem 449 + +*Reference:* [erdosproblems.com/449](https://www.erdosproblems.com/449) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980), p. 89. + +[HaTe88] Hall, R.R. and Tenenbaum, G., _Divisors_. Cambridge University Press (1988), +Section 4.6. + +Let $r(n)$ count the number of pairs $(d_1, d_2)$ such that $d_1 \mid n$ and +$d_2 \mid n$ and $d_1 < d_2 < 2d_1$. Is it true that, for every $\epsilon > 0$, +$r(n) < \epsilon \tau(n)$ for almost all $n$, where $\tau(n)$ is the number of +divisors of $n$? + +This is false. For any constant $K > 0$, we have $r(n) > K\tau(n)$ for a +positive density set of $n$. Kevin Ford observed this follows from the negative +solution to [448] via the Cauchy–Schwarz inequality. +-/ + +open Classical + +namespace Erdos449 + +/-- $r(n)$: the number of ordered pairs $(d_1, d_2)$ of divisors of $n$ with +$d_1 < d_2 < 2 \cdot d_1$. -/ +def closeDivisorPairs (n : ℕ) : ℕ := + ((n.divisors ×ˢ n.divisors).filter (fun p => p.1 < p.2 ∧ p.2 < 2 * p.1)).card + +/-- Erdős Problem 449 (DISPROVED by Ford, via the negative solution to [448]): + +Is it true that for every $\epsilon > 0$, $r(n) < \epsilon \cdot \tau(n)$ for +almost all $n$? The answer is no. -/ +@[category research solved, AMS 11] +theorem erdos_449 : answer(False) ↔ + ∀ ε : ℝ, ε > 0 → + Set.HasDensity {n : ℕ | (closeDivisorPairs n : ℝ) ≥ ε * (n.divisors.card : ℝ)} 0 := by + sorry + +/-- Stronger variant of Erdős Problem 449: for any constant $K > 0$, the set +of $n$ with $r(n) > K \cdot \tau(n)$ has positive natural density. This follows +from the negative solution to Problem 448 via the Cauchy–Schwarz inequality. -/ +@[category research solved, AMS 11] +theorem erdos_449.variants.positive_density : + ∀ K : ℝ, K > 0 → + Set.HasPosDensity + {n : ℕ | (closeDivisorPairs n : ℝ) > K * (n.divisors.card : ℝ)} := by + sorry + +end Erdos449 diff --git a/FormalConjectures/ErdosProblems/45.lean b/FormalConjectures/ErdosProblems/45.lean new file mode 100644 index 0000000000..7e73af9aec --- /dev/null +++ b/FormalConjectures/ErdosProblems/45.lean @@ -0,0 +1,73 @@ +/- +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 45 + +*Reference:* [erdosproblems.com/45](https://www.erdosproblems.com/45) + +For every $k$-colouring of the divisors of $n$ (excluding $1$ and $n$), there is a +monochromatic subset whose reciprocals sum to $1$. Proved by Croot [Cr03]. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium **107** (1995). + +[Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. +Analytic number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. + +[Cr03] Croot, E., _On a coloring conjecture about unit fractions_. Ann. of Math. (2) +**157** (2003), 545–556. + +[Gu04] Guy, R., _Unsolved Problems in Number Theory_, 3rd ed. Springer, 2004, Problem B2. +-/ + +open Finset BigOperators + +namespace Erdos45 + +/-- The reciprocal sum $\sum_{n \in A} 1/n$ of a finite set of natural numbers. -/ +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) + +/-- +The set of divisors of $n$ strictly between $1$ and $n$: +$$D(n) = \{ d \in \mathbb{N} \mid d \mid n,\; 1 < d < n \}$$ +-/ +def middleDivisors (n : ℕ) : Finset ℕ := + n.divisors.filter (fun d => 1 < d ∧ d < n) + +/-- +Proved by Croot [Cr03]: for every $k \geq 2$, there exists a positive integer $n$ such that +for any $k$-colouring of the set $D(n) = \{d : d \mid n,\, 1 < d < n\}$ of divisors of $n$ +(excluding $1$ and $n$ itself), there is a monochromatic subset $D' \subseteq D(n)$ whose +reciprocals sum to $1$: +$$\sum_{d \in D'} \frac{1}{d} = 1.$$ + +*Reference:* [Cr03] +-/ +@[category research solved, AMS 5 11] +theorem erdos_45 : + ∀ k : ℕ, k ≥ 2 → + ∃ n : ℕ, ∀ (c : ℕ → Fin k), + ∃ D' : Finset ℕ, D' ⊆ middleDivisors n ∧ + D'.Nonempty ∧ + (∃ j : Fin k, ∀ d ∈ D', c d = j) ∧ + reciprocalSum D' = 1 := by + sorry + +end Erdos45 diff --git a/FormalConjectures/ErdosProblems/450.lean b/FormalConjectures/ErdosProblems/450.lean new file mode 100644 index 0000000000..bf4ca5484d --- /dev/null +++ b/FormalConjectures/ErdosProblems/450.lean @@ -0,0 +1,79 @@ +/- +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 450 + +*Reference:* [erdosproblems.com/450](https://www.erdosproblems.com/450) + +How large must $y = y(\varepsilon, n)$ be such that the number of integers in $(x, x+y)$ with a +divisor in $(n, 2n)$ is at most $\varepsilon \cdot y$? + +The intended quantifier on $x$ is not entirely clear from the original source. We formalize +the "for all $x$" interpretation: there exists a constant $C > 0$ such that for all sufficiently +large $n$ and all $\varepsilon \geq C / f(n)$ (where +$f(n) = (\log n)^{\alpha} \cdot (\log \log n)^{3/2}$ and +$\alpha = 1 - (1 + \log \log 2)/\log 2 \approx 0.08607$ is the Ford constant), there exists $y$ +such that for all $x$, the count of integers in $(x, x+y)$ with a divisor in $(n, 2n)$ is at most +$\varepsilon \cdot y$. + +The hypothesis on $\varepsilon$ is necessary: Cambie observed (using Ford's results [Fo08]) that +the unconditioned "for all $x$" version fails when +$\varepsilon \cdot (\log n)^{\alpha} \cdot (\log \log n)^{3/2} \to \infty$. In particular, for +any fixed $\varepsilon > 0$ and all sufficiently large $n$, no such $y$ exists. The condition +$\varepsilon \geq C / f(n)$ restricts to the regime where $\varepsilon$ is comparable to the +natural density $\delta(n) \asymp 1/f(n)$ of integers with a divisor in $(n, 2n)$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Fo08] Ford, K., *The distribution of integers with a divisor in a given interval*. Ann. of Math. +(2) **168** (2008), 367–433. +-/ + +open Finset Classical + +namespace Erdos450 + +/-- Count of integers in the open interval $(x, x + y)$ having at least one divisor +in the open interval $(n, 2n)$. -/ +noncomputable def countWithDivisorInRange (x y n : ℕ) : ℕ := + ((Finset.Ioo x (x + y)).filter (fun m => + ∃ d ∈ Finset.Ioo n (2 * n), d ∣ m)).card + +/-- The Ford constant $\alpha = 1 - \frac{1 + \log(\log 2)}{\log 2} \approx 0.08607$, +governing the density of integers with a divisor in a given interval. -/ +noncomputable def fordAlpha : ℝ := 1 - (1 + Real.log (Real.log 2)) / Real.log 2 + +/-- +Erdős Problem 450 [ErGr80, p.89]: + +There exists a constant $C > 0$ such that for all sufficiently large $n$ and all +$\varepsilon \geq C / ((\log n)^{\alpha} \cdot (\log \log n)^{3/2})$, there exists $y$ such that +for all $x$, the number of integers in $(x, x + y)$ with a divisor in $(n, 2n)$ is at most +$\varepsilon \cdot y$. +-/ +@[category research open, AMS 11] +theorem erdos_450 : + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → ∀ ε : ℝ, 0 < ε → + ε ≥ C / ((Real.log ↑n) ^ fordAlpha * (Real.log (Real.log ↑n)) ^ ((3 : ℝ) / 2)) → + ∃ y : ℕ, 0 < y ∧ ∀ x : ℕ, + (countWithDivisorInRange x y n : ℝ) ≤ ε * (y : ℝ) := by + sorry + +end Erdos450 diff --git a/FormalConjectures/ErdosProblems/451.lean b/FormalConjectures/ErdosProblems/451.lean new file mode 100644 index 0000000000..12d1090c60 --- /dev/null +++ b/FormalConjectures/ErdosProblems/451.lean @@ -0,0 +1,85 @@ +/- +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 451 + +*Reference:* [erdosproblems.com/451](https://www.erdosproblems.com/451) + +Estimate $n_k$, the smallest integer $> 2k$ such that $\prod_{1 \le i \le k} (n_k - i)$ +has no prime factor in $(k, 2k)$. + +Erdős and Graham proved $n_k > k^{1+c}$ for some constant $c > 0$. +Erdős conjectures that $n_k > k^d$ for all constant $d$, and $n_k < e^{o(k)}$. + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. +Math. Mag. **52** (1979), 67-70. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). + +Sarosh Adenwalla observed that $n_k \leq \prod_{k < p < 2k} p = e^{O(k)}$, giving an +elementary upper bound that establishes existence. + +See also [OEIS A386620](https://oeis.org/A386620). +-/ + +open Finset BigOperators Classical + +namespace Erdos451 + +/-- The product $(n-1)(n-2)\cdots(n-k)$ has no prime factor $p$ with $k < p < 2k$. -/ +def noInteriorPrimeFactor (k n : ℕ) : Prop := + ∀ p : ℕ, Nat.Prime p → k < p → p < 2 * k → + ¬(p ∣ ∏ i ∈ Finset.Icc 1 k, (n - i)) + +/-- $n_k$: the smallest integer $> 2k$ such that the product $(n-1)(n-2)\cdots(n-k)$ +has no prime factor in $(k, 2k)$. Returns $0$ if no such integer exists. -/ +noncomputable def erdos451_nk (k : ℕ) : ℕ := + if h : ∃ n, 2 * k < n ∧ noInteriorPrimeFactor k n + then Nat.find h + else 0 + +/-- +Erdős Problem 451 [Er79d][ErGr80, p.89]: + +$n_k$ grows superpolynomially but subexponentially: +1. For all $d > 0$, $n_k > k^d$ for all sufficiently large $k$. +2. For all $\varepsilon > 0$, $n_k < e^{\varepsilon \cdot k}$ for all sufficiently large $k$. +-/ +@[category research open, AMS 11] +theorem erdos_451 : + (∀ d : ℝ, 0 < d → ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (k : ℝ) ^ d < (erdos451_nk k : ℝ)) ∧ + (∀ ε : ℝ, 0 < ε → ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (erdos451_nk k : ℝ) < Real.exp (ε * (k : ℝ))) := by + sorry + +/-- +Erdős–Graham lower bound [ErGr80]: + +Erdős and Graham proved that $n_k > k^{1+c}$ for some constant $c > 0$. +This is a weaker (proved) version of the superpolynomial lower bound conjectured +in `erdos_451`. +-/ +@[category research solved, AMS 11] +theorem erdos_451.variants.erdos_graham_lower_bound : + ∃ c : ℝ, 0 < c ∧ ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (k : ℝ) ^ (1 + c) < (erdos451_nk k : ℝ) := by sorry + +end Erdos451 diff --git a/FormalConjectures/ErdosProblems/452.lean b/FormalConjectures/ErdosProblems/452.lean new file mode 100644 index 0000000000..8a3a66f3c9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/452.lean @@ -0,0 +1,60 @@ +/- +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 452 + +*Reference:* [erdosproblems.com/452](https://www.erdosproblems.com/452) + +Let $\omega(n)$ count the number of distinct prime factors of $n$. What is the size +of the largest interval $I \subseteq [x, 2x]$ such that $\omega(n) > \log \log n$ for all +$n \in I$? + +Erdős [Er37] proved that the density of integers $n$ with $\omega(n) > \log \log n$ is $1/2$. +The Chinese remainder theorem implies there is such an interval with +$|I| \geq (1+o(1)) \log x / (\log \log x)^2$. +It could be true that there is such an interval of length $(\log x)^k$ for +arbitrarily large $k$. + +[Er37] Erdős, P., *On the normal number of prime factors of p-1 and some related problems +concerning Euler's φ-function*. Quart. J. Math. Oxford Ser. **8** (1937), 313-320. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). +-/ + +namespace Erdos452 + +/-- +Erdős Problem 452 [ErGr80, p.90]: + +For every $k > 0$, for all sufficiently large $x$, there exists an interval +$[a, a + L] \subseteq [x, 2x]$ with $L \geq (\log x)^k$ such that $\omega(n) > \log \log n$ +for all integers $n$ in $[a, a + L]$. +-/ +@[category research open, AMS 11] +theorem erdos_452 : + ∀ k : ℝ, 0 < k → + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + ∃ a L : ℕ, x ≤ a ∧ a + L ≤ 2 * x ∧ + (Real.log (x : ℝ)) ^ k ≤ (L : ℝ) ∧ + ∀ n ∈ Finset.Icc a (a + L), + (n.primeFactors.card : ℝ) > Real.log (Real.log (n : ℝ)) := by + sorry + +end Erdos452 diff --git a/FormalConjectures/ErdosProblems/453.lean b/FormalConjectures/ErdosProblems/453.lean new file mode 100644 index 0000000000..955a1a9208 --- /dev/null +++ b/FormalConjectures/ErdosProblems/453.lean @@ -0,0 +1,64 @@ +/- +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 453 + +*Reference:* [erdosproblems.com/453](https://www.erdosproblems.com/453) + +Is it true that, for all sufficiently large $n$, there exists some $i < n$ such that +$p_n^2 < p_{n+i} \cdot p_{n-i}$, where $p_k$ is the $k$th prime? + +Asked by Erdős and Straus. Selfridge conjectured the answer is no, contrary +to Erdős and Straus. The answer is no, as shown by Pomerance [Po79], who +proved there are infinitely many $n$ such that $p_n^2 > p_{n+i} \cdot p_{n-i}$ +for all $0 < i < n$. + +[Po79] Pomerance, Carl, The prime number graph. Math. Comp. (1979), 399-408. +-/ + +namespace Erdos453 + +/-- The $k$th prime (0-indexed): $p_0 = 2$, $p_1 = 3$, $p_2 = 5$, ... -/ +noncomputable def nthPrime (k : ℕ) : ℕ := Nat.nth Nat.Prime k + +/-- +Erdős Problem 453 (Disproved by Pomerance [Po79]): + +Is it true that, for all sufficiently large $n$, there exists some $i < n$ such that +$p_n^2 < p_{n+i} \cdot p_{n-i}$? The answer is no. +-/ +@[category research solved, AMS 11] +theorem erdos_453 : answer(False) ↔ + (∀ᶠ n in Filter.atTop, ∃ i : ℕ, 0 < i ∧ i < n ∧ + nthPrime n ^ 2 < nthPrime (n + i) * nthPrime (n - i)) := by + sorry + +/-- +Pomerance [Po79] proved that there are infinitely many $n$ such that +$p_n^2 > p_{n+i} \cdot p_{n-i}$ for all $0 < i < n$. +-/ +@[category research solved, AMS 11] +theorem erdos_453.variants.pomerance : + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + ∀ i : ℕ, 0 < i → i < n → + nthPrime (n + i) * nthPrime (n - i) < + nthPrime n ^ 2 := by + sorry + +end Erdos453 diff --git a/FormalConjectures/ErdosProblems/456.lean b/FormalConjectures/ErdosProblems/456.lean new file mode 100644 index 0000000000..7cc3af26cb --- /dev/null +++ b/FormalConjectures/ErdosProblems/456.lean @@ -0,0 +1,124 @@ +/- +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 456 + +*Reference:* [erdosproblems.com/456](https://www.erdosproblems.com/456) + +Let $p_n$ be the smallest prime $\equiv 1 \pmod{n}$ and let $m_n$ be the +smallest positive integer such that $n \mid \phi(m_n)$. + +1. Is it true that $m_n < p_n$ for almost all $n$? +2. Does $p_n / m_n \to \infty$ for almost all $n$? +3. Are there infinitely many primes $p$ such that $p - 1$ is the only $n$ + for which $m_n = p$? + +Linnik's theorem implies that $p_n \leq n^{O(1)}$. It is trivial that +$m_n \leq p_n$ always. If $n = q - 1$ for some prime $q$ then $m_n = p_n$. + +[Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in +combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset Filter Classical + +open scoped Topology + +namespace Erdos456 + +/-- The smallest prime congruent to $1$ modulo $n$. -/ +noncomputable def smallestPrimeCong1 (n : ℕ) : ℕ := + sInf {p : ℕ | Nat.Prime p ∧ p ≡ 1 [MOD n]} + +/-- The smallest positive integer $m$ such that $n \mid \phi(m)$. -/ +noncomputable def smallestTotientDiv (n : ℕ) : ℕ := + sInf {m : ℕ | 0 < m ∧ n ∣ Nat.totient m} + +/-- +Erdős Problem 456, Part 1 [Er79e, p.80]: + +Is it true that $m_n < p_n$ for almost all $n$? + +Formalized as: the density of $\{n : m_n \geq p_n\}$ is $0$, i.e., the +proportion of $n \leq x$ for which $p_n \leq m_n$ tends to $0$ as $x \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_456 : + answer(sorry) ↔ + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n => + smallestPrimeCong1 n ≤ smallestTotientDiv n)).card : ℝ) / (x : ℝ)) + atTop (nhds 0) := by + sorry + +/-- +Erdős Problem 456, Part 2 [Er79e, p.80]: + +Does $p_n / m_n \to \infty$ for almost all $n$? + +Formalized as: for every $C > 0$, the density of $\{n : p_n \leq C \cdot m_n\}$ +is $0$. +-/ +@[category research open, AMS 11] +theorem erdos_456.variants.ratio_diverges : + answer(sorry) ↔ + ∀ C : ℝ, 0 < C → + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n => + (smallestPrimeCong1 n : ℝ) ≤ C * (smallestTotientDiv n : ℝ))).card : ℝ) / (x : ℝ)) + atTop (nhds 0) := by + sorry + +/-- +Erdős Problem 456, Part 3 [ErGr80, p.91]: + +Are there infinitely many primes $p$ such that $p - 1$ is the only $n$ for +which $m_n = p$? +-/ +@[category research open, AMS 11] +theorem erdos_456.variants.unique_preimage : + answer(sorry) ↔ + Set.Infinite {p : ℕ | Nat.Prime p ∧ + smallestTotientDiv (p - 1) = p ∧ + ∀ n : ℕ, smallestTotientDiv n = p → n = p - 1} := by + sorry + +/-- +The trivial bound $m_n \leq p_n$ always holds: the smallest positive integer $m$ +with $n \mid \phi(m)$ is at most the smallest prime $p \equiv 1 \pmod{n}$, since +$\phi(p) = p - 1 \equiv 0 \pmod{n}$. +-/ +@[category research solved, AMS 11] +theorem erdos_456.variants.trivial_bound (n : ℕ) (hn : 1 ≤ n) : + smallestTotientDiv n ≤ smallestPrimeCong1 n := by + sorry + +/-- +When $n = q - 1$ for a prime $q$, we have $m_n = p_n = q$: the smallest +prime $\equiv 1 \pmod{q - 1}$ is $q$ itself, and the smallest $m$ with +$(q - 1) \mid \phi(m)$ is also $q$. +-/ +@[category research solved, AMS 11] +theorem erdos_456.variants.prime_minus_one (q : ℕ) (hq : Nat.Prime q) : + smallestTotientDiv (q - 1) = q ∧ smallestPrimeCong1 (q - 1) = q := by + sorry + +end Erdos456 diff --git a/FormalConjectures/ErdosProblems/459.lean b/FormalConjectures/ErdosProblems/459.lean new file mode 100644 index 0000000000..f5ede5be16 --- /dev/null +++ b/FormalConjectures/ErdosProblems/459.lean @@ -0,0 +1,113 @@ +/- +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 459 + +*Reference:* [erdosproblems.com/459](https://www.erdosproblems.com/459) + +Let $f(u)$ be the largest $v$ such that no $m \in (u,v)$ is composed entirely +of primes dividing $uv$. Equivalently, $f(u)$ is the smallest integer $v > u$ +such that every prime factor of $v$ divides $u$. + +Trivially $u + 2 \leq f(u) \leq u^2$. + +Cambie showed: +- $f(p) = p^2$ for every prime $p$ +- $f(u) = u + 2$ whenever $u = 2^k - 2$ for $k \geq 2$ +- $f(n) = (1 + o(1))n$ for almost all $n$ + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathématique (1980). +-/ + +open Filter + +open scoped Topology + +namespace Erdos459 + +/-- The smallest $v > u$ such that every prime factor of $v$ divides $u$. -/ +noncomputable def f (u : ℕ) : ℕ := + sInf {v : ℕ | u < v ∧ ∀ p : ℕ, Nat.Prime p → p ∣ v → p ∣ u} + +/-- +Erdős Problem 459 (almost all, Cambie): + +$f(n) = (1 + o(1))n$ for almost all $n$, i.e., for every $\varepsilon > 0$, the density +of $\{n : f(n) > (1 + \varepsilon)n\}$ tends to $0$. +-/ +@[category research solved, AMS 11] +theorem erdos_459 (ε : ℝ) (hε : 0 < ε) : + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n => + (f n : ℝ) > (1 + ε) * (n : ℝ))).card : ℝ) / (x : ℝ)) + atTop (nhds 0) := by + sorry + +/-- +Erdős Problem 459 (lower bound) [ErGr80, p.91]: + +For all $u \geq 2$, $f(u) \geq u + 2$. +-/ +@[category undergraduate, AMS 11] +theorem erdos_459.variants.lower_bound (u : ℕ) (hu : 2 ≤ u) : + u + 2 ≤ f u := by + sorry + +/-- +Erdős Problem 459 (upper bound) [ErGr80, p.91]: + +For all $u \geq 2$, $f(u) \leq u^2$. +-/ +@[category undergraduate, AMS 11] +theorem erdos_459.variants.upper_bound (u : ℕ) (hu : 2 ≤ u) : + f u ≤ u ^ 2 := by + sorry + +/-- +Erdős Problem 459 (prime case, Cambie): + +For every prime $p$, $f(p) = p^2$. +-/ +@[category research solved, AMS 11] +theorem erdos_459.variants.prime (p : ℕ) (hp : Nat.Prime p) : + f p = p ^ 2 := by + sorry + +/-- +Erdős Problem 459 (power of two case, Cambie): + +$f(u) = u + 2$ whenever $u = 2^k - 2$ for $k \geq 2$. +-/ +@[category research solved, AMS 11] +theorem erdos_459.variants.power_of_two_minus_two (k : ℕ) (hk : 2 ≤ k) : + f (2 ^ k - 2) = 2 ^ k := by + sorry + +/-- +Erdős Problem 459 (even upper bound, Cambie): + +If $u$ is even, then $f(u) \leq 2^k$, where $2^k$ is the smallest power of $2$ exceeding $u$. +-/ +@[category research solved, AMS 11] +theorem erdos_459.variants.even_upper_bound (u : ℕ) (hu : 2 ≤ u) (heven : Even u) : + f u ≤ 2 ^ (Nat.log 2 u + 1) := by + sorry + +end Erdos459 diff --git a/FormalConjectures/ErdosProblems/46.lean b/FormalConjectures/ErdosProblems/46.lean new file mode 100644 index 0000000000..882e7dd711 --- /dev/null +++ b/FormalConjectures/ErdosProblems/46.lean @@ -0,0 +1,95 @@ +/- +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 46 + +*Reference:* [erdosproblems.com/46](https://www.erdosproblems.com/46) + +For every finite colouring of the integers $\geq 2$, there exists a monochromatic finite +set whose reciprocals sum to $1$. Proved by Croot [Cr03]. + +See also: Problem #298. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980), p. 36. + +[Er92c] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) **47** (1992), 231–240. + +[Er95] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and geometry_. +Resenhas **1** (1995), 165–186. + +[Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. Analytic +number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Cr03] Croot, E. S., _On a coloring conjecture about unit fractions_. Annals of Mathematics +**157** (2003), 545–556. +-/ + +open Finset BigOperators + +namespace Erdos46 + +/-- The reciprocal sum $\sum_{n \in A} 1/n$ of a finite set of natural numbers. -/ +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) + +/-- +For every $k$-colouring (with $k \ge 2$) of the positive integers $\ge 2$, there exists a +monochromatic finite set $\{n_1, \ldots, n_m\}$ with $2 \le n_1 < \cdots < n_m$ whose +reciprocals sum to $1$, i.e. $\sum 1/n_i = 1$. + +Proved by Croot [Cr03]. Originally posed by Erdős and Graham [ErGr80]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_46 : answer(True) ↔ + ∀ k : ℕ, k ≥ 2 → + ∀ (c : ℕ → Fin k), + ∃ S : Finset ℕ, S.Nonempty ∧ + (∀ n ∈ S, n ≥ 2) ∧ + (∃ j : Fin k, ∀ n ∈ S, c n = j) ∧ + reciprocalSum S = 1 := by + sorry + +/-- +Generalization of `erdos_46` to arbitrary positive rationals: for every $k$-colouring +(with $k \ge 2$) of the positive integers $\ge 2$ and every positive rational $q$, there +exists a monochromatic finite subset whose reciprocals sum to $q$. + +This follows from the unit case by considering induced colorings on $\{n/b : b \mid n\}$. +Originally posed by Erdős and Graham [ErGr80]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_46_rational_generalization : + ∀ k : ℕ, k ≥ 2 → + ∀ (q : ℚ), 0 < q → + ∀ (c : ℕ → Fin k), + ∃ S : Finset ℕ, S.Nonempty ∧ + (∀ n ∈ S, n ≥ 2) ∧ + (∃ j : Fin k, ∀ n ∈ S, c n = j) ∧ + reciprocalSum S = q := by + sorry + +end Erdos46 diff --git a/FormalConjectures/ErdosProblems/460.lean b/FormalConjectures/ErdosProblems/460.lean new file mode 100644 index 0000000000..19bd906cec --- /dev/null +++ b/FormalConjectures/ErdosProblems/460.lean @@ -0,0 +1,65 @@ +/- +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 460 + +*Reference:* [erdosproblems.com/460](https://www.erdosproblems.com/460) + +This problem arose in work of Eggleton, Erdős, and Selfridge. + +[Er77c] Erdős, P., *Problems and results on combinatorial number theory III*, +Number Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset Filter Classical + +namespace Erdos460 + +/-- The greedy coprime-complement sequence for a given $n$. +$a_0 = 0$ and $a_{k+1}$ is the least integer greater than $a_k$ such that +$\gcd(n - a_{k+1}, n - a_i) = 1$ for all $i \leq k$. -/ +noncomputable def erdos460Seq (n : ℕ) : ℕ → ℕ + | 0 => 0 + | k + 1 => sInf {m : ℕ | erdos460Seq n k < m ∧ + ∀ i : ℕ, i ≤ k → Nat.Coprime (n - m) (n - erdos460Seq n i)} + +/-- The sum $\sum_{0 < a_i < n} 1/a_i$ for the greedy coprime-complement +sequence. -/ +noncomputable def erdos460Sum (n : ℕ) : ℝ := + ((Finset.range n).filter (fun k => + 0 < erdos460Seq n k ∧ erdos460Seq n k < n)).sum + (fun k => (1 : ℝ) / (erdos460Seq n k : ℝ)) + +/-- +Erdős Problem 460 [Er77c] [ErGr80, p.91]: + +Does $\sum_{0 < a_i < n} 1/a_i \to \infty$ as $n \to \infty$, where +$(a_k)$ is the greedy sequence with $a_0 = 0$ and each $a_{k+1}$ the least +integer greater than $a_k$ making $\gcd(n - a_{k+1}, n - a_i) = 1$ for all +$i \leq k$? +-/ +@[category research open, AMS 11] +theorem erdos_460 : + answer(sorry) ↔ Tendsto erdos460Sum atTop atTop := by + sorry + +end Erdos460 diff --git a/FormalConjectures/ErdosProblems/461.lean b/FormalConjectures/ErdosProblems/461.lean new file mode 100644 index 0000000000..c4e49fc2c9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/461.lean @@ -0,0 +1,71 @@ +/- +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 Mathlib.Analysis.SpecialFunctions.Log.Basic + +/-! +# Erdős Problem 461 + +Erdős and Graham asked whether the number of distinct smooth components among consecutive +integers grows linearly: specifically, whether $f(n,t) \gg t$ uniformly for all $n$ and $t$. + +*Reference:* [erdosproblems.com/461](https://www.erdosproblems.com/461) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset BigOperators + +namespace Erdos461 + +/-- The $t$-smooth component of $n$: the product of $p^{v_p(n)}$ over all + primes $p < t$ dividing $n$. -/ +noncomputable def smoothComponent (t n : ℕ) : ℕ := + (n.factorization.support.filter (· < t)).prod + (fun p => p ^ n.factorization p) + +/-- $f(n, t)$ counts the number of distinct values of the $t$-smooth component + of $m$ for $m \in \{n+1, \ldots, n+t\}$. -/ +noncomputable def f (n t : ℕ) : ℕ := + ((Finset.Icc (n + 1) (n + t)).image (smoothComponent t)).card + +/-- +Erdős Problem 461 [ErGr80, p.92]: + +Is it true that $f(n,t) \gg t$ uniformly for all $n$ and $t$, where $f(n,t)$ +counts the number of distinct $t$-smooth components among $\{n+1, \ldots, n+t\}$? +-/ +@[category research open, AMS 11] +theorem erdos_461 : + answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ n t : ℕ, 0 < t → + (f n t : ℝ) ≥ c * (t : ℝ) := by + sorry + +/-- +Erdős and Graham state that they can prove $f(n,t) \gg t / \log t$, i.e., there exists +an absolute constant $c > 0$ such that $f(n,t) \geq c \cdot t / \log t$ for all $n$ and $t \geq 1$. +This is a weaker but proven lower bound for Problem 461. +-/ +@[category research solved, AMS 11] +theorem erdos_461_lower_bound : + ∃ c : ℝ, c > 0 ∧ ∀ n t : ℕ, 0 < t → + (f n t : ℝ) ≥ c * ((t : ℝ) / Real.log (t : ℝ)) := by + sorry + +end Erdos461 diff --git a/FormalConjectures/ErdosProblems/462.lean b/FormalConjectures/ErdosProblems/462.lean new file mode 100644 index 0000000000..8989e4336d --- /dev/null +++ b/FormalConjectures/ErdosProblems/462.lean @@ -0,0 +1,72 @@ +/- +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.Nat.Prime.Composite + +/-! +# Erdős Problem 462 + +Is it true that there exists a constant $C > 0$ such that the sum of $p(n)/n$ +over composite $n$ in $[x, x + C\sqrt{x}(\log x)^2]$ is $\gg 1$ for all +large $x$? Here $p(n)$ denotes the least prime factor of $n$. + +*Reference:* [erdosproblems.com/462](https://www.erdosproblems.com/462) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p. 92. +-/ + +open Finset Filter Real + +open scoped BigOperators + +namespace Erdos462 + +/-- +Erdős Problem 462 [ErGr80, p.92]: + +Is it true that there exists a constant $C > 0$ such that the sum of $p(n)/n$ +over composite $n$ in $[x, x + C\sqrt{x}(\log x)^2]$ is $\gg 1$ for all +large $x$? Here $p(n)$ denotes the least prime factor of $n$. +-/ +@[category research open, AMS 11] +theorem erdos_462 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ δ : ℝ, δ > 0 ∧ ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + δ ≤ ∑ n ∈ (Finset.Icc x + (x + ⌊C * Real.sqrt (x : ℝ) * (Real.log (x : ℝ)) ^ 2⌋₊)).filter + (fun n => n.Composite), + (Nat.minFac n : ℝ) / (n : ℝ) := by + sorry + +/-- +Erdős Problem 462 (Background asymptotic) [ErGr80, p.92]: + +There exists a constant $c > 0$ such that the sum of $p(n)/n$ over composite +$n \leq x$ is asymptotic to $c \cdot \sqrt{x} / (\log x)^2$, where $p(n)$ +denotes the least prime factor of $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_462.variants.asymptotic : + ∃ c : ℝ, c > 0 ∧ + Tendsto (fun x : ℕ => + (∑ n ∈ (Finset.Icc 2 x).filter (fun n => ¬ Nat.Prime n), + (Nat.minFac n : ℝ) / (n : ℝ)) / + (Real.sqrt (x : ℝ) / (Real.log (x : ℝ)) ^ 2)) + atTop (nhds c) := by + sorry + +end Erdos462 diff --git a/FormalConjectures/ErdosProblems/464.lean b/FormalConjectures/ErdosProblems/464.lean new file mode 100644 index 0000000000..0812c53d8d --- /dev/null +++ b/FormalConjectures/ErdosProblems/464.lean @@ -0,0 +1,100 @@ +/- +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 464 + +For any lacunary sequence of natural numbers (where the ratio of consecutive terms is bounded +away from 1), there exists an irrational number θ such that the sequence of distances from +θ·nₖ to the nearest integer is not dense in [0, 1/2]. + +Proved independently by de Mathan and Pollington. Peres and Schlag proved the quantitative +strengthening that $\inf_{k \geq 1} \|\theta n_k\| \gg \varepsilon / \log(1/\varepsilon)$. + +## References + +* [dM80] de Mathan, B., _Numbers contravening a condition in density modulo 1_. + Acta Math. Acad. Sci. Hungar. (1980), 237–241. +* [Po79b] Pollington, A. D., _On the density of sequence {nₖξ}_. + Illinois J. Math. (1979), 511–515. +* [Ka01] Katznelson, Y., _Chromatic numbers of Cayley graphs on Z and recurrence_. + Combinatorica (2001), 211–219. +* [AkMo04] Akhunzhanov, R. K. and Moshchevitin, N. G., + _On the chromatic number of a distance graph associated with a lacunary sequence_. + Dokl. Akad. Nauk (2004), 295–296. +* [Du06] Dubickas, A., _On the fractional parts of lacunary sequences_. + Math. Scand. (2006), 136–146. +* [PeSc10] Peres, Y. and Schlag, W., + _Two Erdős problems on lacunary sequences: chromatic number and Diophantine approximation_. + Bull. Lond. Math. Soc. (2010), 295–300. + +See also Problem 894. + +*Reference:* [erdosproblems.com/464](https://www.erdosproblems.com/464) +-/ + +namespace Erdos464 + +/-- The distance of a real number from the nearest integer. -/ +noncomputable def distNearestInt (x : ℝ) : ℝ := + min (Int.fract x) (1 - Int.fract x) + +/-- +A sequence $a : \mathbb{N} \to \mathbb{N}$ is lacunary if it is strictly increasing and there +exists $\varepsilon > 0$ such that $a(k+1) \geq (1+\varepsilon) \cdot a(k)$ for all $k$. +-/ +def IsLacunary (a : ℕ → ℕ) : Prop := + StrictMono a ∧ ∃ ε : ℝ, ε > 0 ∧ ∀ k : ℕ, (a (k + 1) : ℝ) ≥ (1 + ε) * (a k : ℝ) + +/-- +Erdős Problem 464 (Proved by de Mathan and Pollington): + +Let $A = \{n_1 < n_2 < \cdots\} \subset \mathbb{N}$ be a lacunary sequence (there exists +$\varepsilon > 0$ with $n_{k+1} \geq (1+\varepsilon)n_k$ for all $k$). Then there exists an +irrational $\theta$ such that $\{\| \theta n_k \| : k \geq 1\}$ is not dense in $[0, 1/2]$, +where $\|x\|$ denotes the distance from $x$ to the nearest integer. + +The "not dense" condition is formalized as: there exist $0 \leq c < d \leq 1/2$ such that +$\|\theta n_k\| \notin (c, d)$ for all $k$, i.e., the image avoids some open subinterval +of $[0, 1/2]$. +-/ +@[category research solved, AMS 11] +theorem erdos_464 : + ∀ (a : ℕ → ℕ), IsLacunary a → + ∃ θ : ℝ, Irrational θ ∧ + ∃ c d : ℝ, 0 ≤ c ∧ c < d ∧ d ≤ 1 / 2 ∧ + ∀ k : ℕ, distNearestInt (θ * ↑(a k)) ∉ Set.Ioo c d := by + sorry + +/-- +Quantitative strengthening of Erdős Problem 464 (Peres–Schlag, 2010): + +For any lacunary sequence with ratio parameter ε, there exists an irrational θ and a constant +C > 0 (independent of ε) such that $\inf_{k \geq 1} \|\theta n_k\| \geq C \cdot \varepsilon +/ \log(1/\varepsilon)$. +-/ +@[category research solved, AMS 11] +theorem erdos_464_quantitative : + ∃ C : ℝ, C > 0 ∧ + ∀ (a : ℕ → ℕ) (ε : ℝ), ε > 0 ∧ ε < 1 ∧ + StrictMono a ∧ (∀ k : ℕ, (a (k + 1) : ℝ) ≥ (1 + ε) * (a k : ℝ)) → + ∃ θ : ℝ, Irrational θ ∧ + ∀ k : ℕ, distNearestInt (θ * ↑(a k)) ≥ C * ε / Real.log (1 / ε) := by + sorry + +end Erdos464 diff --git a/FormalConjectures/ErdosProblems/465.lean b/FormalConjectures/ErdosProblems/465.lean new file mode 100644 index 0000000000..b3ba33738e --- /dev/null +++ b/FormalConjectures/ErdosProblems/465.lean @@ -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 + +/-! +# Erdős Problem 465 + +*Reference:* [erdosproblems.com/465](https://www.erdosproblems.com/465) + +Let $N(X, \delta)$ denote the maximum number of points $P_1, \ldots, P_n$ which can be chosen +in a disk of radius $X$ in $\mathbb{R}^2$ such that $\|P_i - P_j\| \geq \delta$ for all +$1 \leq i < j \leq n$, where $\|x\|$ denotes the distance from $x$ to the nearest integer. + +[Sa76] Sárközy, A., *On difference sets of sequences of integers. I.* Acta Math. Acad. Sci. +Hungar. 31 (1978), no. 1-2, 125-149. + +[Ko01] Konyagin, S. V., *A remark on sets of numbers with large trigonometric sums.* 2001. +-/ + +namespace Erdos465 + +/-- The distance of a real number from the nearest integer. -/ +noncomputable def distNearestInt (x : ℝ) : ℝ := + min (Int.fract x) (1 - Int.fract x) + +/-- +Erdős Problem 465, weak form (Proved by Sárközy [Sa76]): + +For any $0 < \delta < 1/2$, $N(X, \delta) = o(X)$. Formalized as: for any $\varepsilon > 0$, for +sufficiently large $X$, any finite set of points in a closed disk of radius $X$ +in $\mathbb{R}^2$ with all pairwise distances satisfying $\|d\| \geq \delta$ has at most +$\varepsilon \cdot X$ points. +-/ +@[category research solved, AMS 11 52] +theorem erdos_465 (δ : ℝ) (hδ₀ : 0 < δ) (hδ₁ : δ < 1 / 2) + (ε : ℝ) (hε : 0 < ε) : + ∃ X₀ : ℝ, 0 < X₀ ∧ + ∀ (X : ℝ), X₀ ≤ X → + ∀ (A : Finset (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ A, dist p 0 ≤ X) → + (∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ δ) → + (A.card : ℝ) ≤ ε * X := by + sorry + +/-- +Erdős Problem 465, strong form (Proved by Konyagin [Ko01]): + +For any fixed $\delta > 0$, $N(X, \delta) \ll_\delta X^{1/2}$. Formalized as: there exists +$C > 0$ (depending on $\delta$) such that any finite set of points in a closed disk of radius +$X$ in $\mathbb{R}^2$ with all pairwise distances satisfying $\|d\| \geq \delta$ has at most +$C \cdot \sqrt{X}$ points. +-/ +@[category research solved, AMS 11 52] +theorem erdos_465.variants.strong (δ : ℝ) (hδ : 0 < δ) : + ∃ C : ℝ, 0 < C ∧ + ∀ (X : ℝ), 0 < X → + ∀ (A : Finset (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ A, dist p 0 ≤ X) → + (∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ δ) → + (A.card : ℝ) ≤ C * Real.sqrt X := by + sorry + +end Erdos465 diff --git a/FormalConjectures/ErdosProblems/466.lean b/FormalConjectures/ErdosProblems/466.lean new file mode 100644 index 0000000000..0225c18805 --- /dev/null +++ b/FormalConjectures/ErdosProblems/466.lean @@ -0,0 +1,105 @@ +/- +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 466 + +*Reference:* [erdosproblems.com/466](https://www.erdosproblems.com/466) + +Let $N(X, \delta)$ denote the maximum number of points $P_1, \ldots, P_n$ which can be chosen +in a disk of radius $X$ in $\mathbb{R}^2$ such that $\| |P_i - P_j| \| \geq \delta$ for all +$1 \leq i < j \leq n$, where $\|x\|$ denotes the distance from $x$ to the nearest integer. + +This was proved by Graham, who showed $N(X, 1/10) > (\log X)/10$. +Sárközy substantially improved this, proving that for all sufficiently small $\delta > 0$, +$N(X, \delta) > X^{1/2 - \delta^{1/7}}$. + +See also Problem 465, which gives complementary upper bounds on $N(X, \delta)$. + +[Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Er82e] Erdős, P., _Problems and results on finite and infinite graphs_. Recent advances +in graph theory (Proc. Second Czechoslovak Sympos., Prague, 1982). + +[Sa76] Sárközy, A., _On difference sets of sequences of integers. I._ Acta Math. Acad. Sci. +Hungar. 31 (1978), no. 1-2, 125-149. +-/ + +namespace Erdos466 + +/-- The distance of a real number from the nearest integer. -/ +noncomputable def distNearestInt (x : ℝ) : ℝ := + min (Int.fract x) (1 - Int.fract x) + +/-- +Erdős Problem 466 (Proved by Graham): + +There exists $\delta > 0$ such that $N(X, \delta) \to \infty$ as $X \to \infty$. Formalized as: +there exists $\delta > 0$ such that for every $M$, for sufficiently large $X$, +one can find at least $M$ points in a disk of radius $X$ in $\mathbb{R}^2$ whose +pairwise distances all satisfy $\|d\| \geq \delta$. +-/ +@[category research solved, AMS 11 52] +theorem erdos_466 : + ∃ δ : ℝ, 0 < δ ∧ + ∀ M : ℕ, ∃ X₀ : ℝ, 0 < X₀ ∧ + ∀ (X : ℝ), X₀ ≤ X → + ∃ (A : Finset (EuclideanSpace ℝ (Fin 2))), + M ≤ A.card ∧ + (∀ p ∈ A, dist p 0 ≤ X) ∧ + (∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ δ) := by + sorry + +/-- +Graham's quantitative bound for Erdős Problem 466 [ErGr80]: + +$N(X, 1/10) > (\log X) / 10$ for sufficiently large $X$. +This gives the first explicit lower bound with $\delta = 1/10$. +-/ +@[category research solved, AMS 11 52] +theorem erdos_466_graham : + ∀ X : ℝ, 1 < X → + ∃ (A : Finset (EuclideanSpace ℝ (Fin 2))), + (Real.log X / 10 : ℝ) ≤ ↑A.card ∧ + (∀ p ∈ A, dist p 0 ≤ X) ∧ + (∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ 1 / 10) := by + sorry + +/-- +Sárközy's improvement for Erdős Problem 466 [Sa76]: + +For all sufficiently small $\delta > 0$ and all sufficiently large $X$, +$N(X, \delta) > X^{1/2 - \delta^{1/7}}$. +This is a polynomial lower bound, much stronger than Graham's logarithmic bound. +-/ +@[category research solved, AMS 11 52] +theorem erdos_466_sarkozy : + ∃ δ₀ : ℝ, 0 < δ₀ ∧ + ∀ δ : ℝ, 0 < δ → δ < δ₀ → + ∃ X₀ : ℝ, 0 < X₀ ∧ + ∀ X : ℝ, X₀ ≤ X → + ∃ (A : Finset (EuclideanSpace ℝ (Fin 2))), + (X ^ (1 / 2 - δ ^ (1 / 7)) : ℝ) ≤ ↑A.card ∧ + (∀ p ∈ A, dist p 0 ≤ X) ∧ + (∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ δ) := by + sorry + +end Erdos466 diff --git a/FormalConjectures/ErdosProblems/467.lean b/FormalConjectures/ErdosProblems/467.lean new file mode 100644 index 0000000000..7e896dd8d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/467.lean @@ -0,0 +1,59 @@ +/- +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 467 + +For all sufficiently large $x$, there exists a choice of congruence classes $a_p$ for every prime +$p \leq x$, and a partition of the primes $\leq x$ into two non-empty sets, such that every +$n < x$ is covered by some prime from each part. + +*Reference:* [erdosproblems.com/467](https://www.erdosproblems.com/467) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980), p. 93. +-/ + +namespace Erdos467 + +/-- +Erdős Problem #467 [ErGr80, p. 93]: + +For all sufficiently large $x$, there exists a choice of congruence classes +$a_p$ for every prime $p \leq x$, and a decomposition of the set of primes +$\leq x$ into two non-empty sets $A$ and $B$, such that for every $n < x$, +there exist some $p \in A$ and $q \in B$ with $n \equiv a_p \pmod{p}$ and +$n \equiv a_q \pmod{q}$. + +The note on the website indicates the original source [ErGr80] is ambiguous +about the quantifiers; this formalises the most natural interpretation. +-/ +@[category research open, AMS 5 11] +theorem erdos_467 : + ∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + ∃ (a : ℕ → ℕ) (A : Finset ℕ), + let P := (Finset.range (x + 1)).filter Nat.Prime + A ⊆ P ∧ + A.Nonempty ∧ + (P \ A).Nonempty ∧ + ∀ n : ℕ, n < x → + (∃ p ∈ A, n % p = a p % p) ∧ + (∃ q ∈ P \ A, n % q = a q % q) := by + sorry + +end Erdos467 diff --git a/FormalConjectures/ErdosProblems/468.lean b/FormalConjectures/ErdosProblems/468.lean new file mode 100644 index 0000000000..a8d8ddffcd --- /dev/null +++ b/FormalConjectures/ErdosProblems/468.lean @@ -0,0 +1,85 @@ +/- +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 468 + +*Reference:* [erdosproblems.com/468](https://www.erdosproblems.com/468) + +For any $n$ let $D_n$ be the set of partial sums $d_1, d_1+d_2, d_1+d_2+d_3, \ldots$ +where $1 < d_1 < d_2 < \cdots$ are the divisors of $n$. + +The problem asks two questions: +1. What is the size of $D_n \setminus \bigcup_{m < n} D_m$? (Not formalized — too imprecise.) +2. If $f(N)$ is the minimal $n$ such that $N \in D_n$, is it true that $f(N) = o(N)$? + Perhaps just for almost all $N$? + +The formalization captures question 2 in both a strong form ($f(N) = o(N)$ for all $N$) +and a weak form ($f(N) = o(N)$ for almost all $N$, in the natural density sense). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathematique (1980). +-/ + +open Finset Filter + +namespace Erdos468 + +/-- Prefix sums of a list with accumulator. +Returns $[\mathrm{acc}+a_1, \mathrm{acc}+a_1+a_2, \ldots]$. -/ +def prefixSums : List ℕ → ℕ → List ℕ + | [], _ => [] + | a :: as, acc => (acc + a) :: prefixSums as (acc + a) + +/-- $D_n$: the set of partial sums of the divisors of $n$ that are greater than $1$, +taken in increasing order. -/ +def D (n : ℕ) : Finset ℕ := + (prefixSums ((n.divisors.filter (1 < ·)).sort (· ≤ ·)) 0).toFinset + +/-- $f(N)$: the minimal $n$ such that $N \in D_n$. -/ +noncomputable def f (N : ℕ) : ℕ := + sInf {n : ℕ | N ∈ D n} + +/-- +Erdős Problem 468, strong form [ErGr80]: + +If $f(N)$ is the minimal $n$ such that $N \in D_n$, then $f(N) = o(N)$. +-/ +@[category research open, AMS 11] +theorem erdos_468 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (f N : ℝ) < ε * (N : ℝ) := by + sorry + +/-- +Erdős Problem 468, weak form [ErGr80]: + +$f(N) = o(N)$ for almost all $N$. Formalized as: for any $\varepsilon > 0$, the density of +$\{N \le x : f(N) \ge \varepsilon \cdot N\}$ tends to $0$ as $x \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_468.variants.weak : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun N => + (f N : ℝ) ≥ ε * (N : ℝ))).card : ℝ) / (x : ℝ)) + atTop (nhds 0) := by + sorry + +end Erdos468 diff --git a/FormalConjectures/ErdosProblems/47.lean b/FormalConjectures/ErdosProblems/47.lean new file mode 100644 index 0000000000..96f0cb330e --- /dev/null +++ b/FormalConjectures/ErdosProblems/47.lean @@ -0,0 +1,97 @@ +/- +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 47 + +*Reference:* [erdosproblems.com/47](https://www.erdosproblems.com/47) + +If $A \subseteq \{1, \ldots, N\}$ satisfies $\sum_{a \in A} 1/a > \delta \cdot \log N$ for some +$\delta > 0$ and $N$ sufficiently large, then $A$ contains a subset whose reciprocals sum to $1$. + +Bloom [Bl21] proved that the weaker threshold +$\sum \frac{1}{n} \gg \frac{\log \log \log N}{\log \log N} \cdot \log N$ suffices, +which implies the conjecture below. Liu and Sawhney [LiSa24] further improved the threshold +to $(\log N)^{4/5 + o(1)}$. + +Erdős conjectured that a threshold of $(\log \log N)^2$ might suffice; a construction by +Pomerance (discussed in [Bl21]) shows this would be optimal. + +Related problems: 46, 298. + +[Bl21] Bloom, T. F., _On a density conjecture about unit fractions_. arXiv:2112.03726 (2021). + +[LiSa24] Liu, Y. and Sawhney, M., _On further questions regarding unit fractions_. +arXiv:2404.07113 (2024). +-/ + +open scoped BigOperators + +namespace Erdos47 + +/-- +If $\delta > 0$ and $N$ is sufficiently large (depending on $\delta$), and +$A \subseteq \{1, \ldots, N\}$ is such that +$$\sum_{a \in A} \frac{1}{a} > \delta \cdot \log N,$$ +then there exists a nonempty subset $S \subseteq A$ such that +$$\sum_{n \in S} \frac{1}{n} = 1.$$ + +Proved by Bloom [Bl21], who showed the weaker threshold +$\sum \frac{1}{n} \gg \frac{\log \log \log N}{\log \log N} \cdot \log N$ suffices. +-/ +@[category research solved, AMS 5 11] +theorem erdos_47 (δ : ℝ) (hδ : δ > 0) : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∑ a ∈ A, (1 : ℝ) / a) > δ * Real.log N → + ∃ S : Finset ℕ, S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, (1 : ℝ) / n) = 1 := by + sorry + +/-- +Bloom [Bl21] proved that if $A \subseteq \{1, \ldots, N\}$ satisfies +$$\sum_{a \in A} \frac{1}{a} \geq C \cdot \frac{\log \log \log N}{\log \log N} \cdot \log N$$ +for some sufficiently large constant $C$, then $A$ contains a nonempty subset whose reciprocals +sum to $1$. This is strictly stronger than the $\delta \cdot \log N$ threshold in `erdos_47`. +-/ +@[category research solved, AMS 5 11] +theorem erdos_47_bloom : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∑ a ∈ A, (1 : ℝ) / a) ≥ + C * (Real.log (Real.log (Real.log N)) / Real.log (Real.log N)) * Real.log N → + ∃ S : Finset ℕ, S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, (1 : ℝ) / n) = 1 := by + sorry + +/-- +Erdős conjectured that a threshold of $(\log \log N)^2$ should suffice: if +$A \subseteq \{1, \ldots, N\}$ satisfies $\sum_{a \in A} 1/a \geq (\log \log N)^2$, +then $A$ contains a nonempty subset whose reciprocals sum to $1$. +A construction by Pomerance shows this would be optimal. +-/ +@[category research open, AMS 5 11] +theorem erdos_47_loglog_sq : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∑ a ∈ A, (1 : ℝ) / a) ≥ (Real.log (Real.log N)) ^ 2 → + ∃ S : Finset ℕ, S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, (1 : ℝ) / n) = 1 := by + sorry + +end Erdos47 diff --git a/FormalConjectures/ErdosProblems/471.lean b/FormalConjectures/ErdosProblems/471.lean new file mode 100644 index 0000000000..45a907a375 --- /dev/null +++ b/FormalConjectures/ErdosProblems/471.lean @@ -0,0 +1,75 @@ +/- +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 471 + +*Reference:* [erdosproblems.com/471](https://www.erdosproblems.com/471) + +Given a finite set of primes $Q = Q_0$, define a sequence of sets $Q_i$ by letting +$Q_{i+1}$ be $Q_i$ together with all primes formed by adding three distinct elements +of $Q_i$. Is there some initial choice of $Q$ such that the $Q_i$ become arbitrarily large? + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique **28**, +Université de Genève (1980), p. 94. +-/ + +namespace Erdos471 + +/-- Given a set $Q$ of natural numbers, `step Q` is $Q$ together with all + primes that equal the sum of three distinct elements of $Q$. -/ +def step (Q : Set ℕ) : Set ℕ := + Q ∪ {p | Nat.Prime p ∧ ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, + a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ p = a + b + c} + +/-- The sequence $Q_i$ starting from $Q_0$. -/ +def seq (Q₀ : Set ℕ) : ℕ → Set ℕ + | 0 => Q₀ + | i + 1 => step (seq Q₀ i) + +/-- +Erdős Problem 471 (Proved): + +Given a finite set of primes $Q = Q_0$, define a sequence of sets $Q_i$ by letting +$Q_{i+1}$ be $Q_i$ together with all primes formed by adding three distinct elements +of $Q_i$. Is there some initial choice of $Q$ such that the $Q_i$ become arbitrarily large? + +A problem of Ulam. Proved by Mrazović and Kovač, and independently Alon, using +Vinogradov's theorem that every large odd integer is the sum of three distinct primes. +In particular, there exists $N$ such that every prime $> N$ is the sum of three distinct +smaller primes. Taking $Q_0$ to be all primes $\leq N$, all primes eventually appear. +-/ +@[category research solved, AMS 11] +theorem erdos_471 : answer(True) ↔ + ∃ Q₀ : Set ℕ, Q₀.Finite ∧ (∀ p ∈ Q₀, Nat.Prime p) ∧ + ∀ p : ℕ, Nat.Prime p → ∃ i : ℕ, p ∈ seq Q₀ i := by + sorry + +/-- +Variant of Erdős Problem 471: + +Does the initial set $Q_0 = \{3, 5, 7, 11\}$ suffice? That is, does every prime +eventually appear in the sequence $Q_i$ starting from $\{3, 5, 7, 11\}$? +-/ +@[category research open, AMS 11] +theorem erdos_471_variant : + ∀ p : ℕ, Nat.Prime p → ∃ i : ℕ, p ∈ seq {3, 5, 7, 11} i := by + sorry + +end Erdos471 diff --git a/FormalConjectures/ErdosProblems/472.lean b/FormalConjectures/ErdosProblems/472.lean new file mode 100644 index 0000000000..3d69d1f8ad --- /dev/null +++ b/FormalConjectures/ErdosProblems/472.lean @@ -0,0 +1,59 @@ +/- +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 472 + +*Reference:* [erdosproblems.com/472](https://www.erdosproblems.com/472) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +Given some initial finite sequence of primes $q_1 < \cdots < q_m$, extend it so that +$q_{n+1}$ is the smallest prime of the form $q_n + q_i - 1$ for $n \geq m$. Is there an +initial starting sequence so that the resulting sequence is infinite? + +A problem due to Ulam. For example if we begin with $3, 5$ then the sequence +continues $3, 5, 7, 11, 13, 17, \ldots$. It is possible that this sequence is infinite. +-/ + +namespace Erdos472 + +/-- A sequence $q : \mathbb{N} \to \mathbb{N}$ is an Erdős-Ulam sequence (Problem 472) with initial + segment of length $m$ if all terms are prime and for each $n$ with $n + 1 \geq m$, + $q(n + 1)$ is the smallest prime of the form $q(n) + q(i) - 1$ for $i \leq n$. -/ +def IsErdos472Sequence (q : ℕ → ℕ) (m : ℕ) : Prop := + (∀ n, Nat.Prime (q n)) ∧ + StrictMono q ∧ + ∀ n, m ≤ n + 1 → + (∃ i, i ≤ n ∧ q (n + 1) = q n + q i - 1) ∧ + (∀ i, i ≤ n → Nat.Prime (q n + q i - 1) → q (n + 1) ≤ q n + q i - 1) + +/-- +Erdős Problem 472 (Open): +There exists an initial finite sequence of primes such that the Erdős-Ulam +extension process produces an infinite sequence. That is, there exists an +infinite sequence where each term after the initial segment is the smallest +prime of the form $q(n) + q(i) - 1$. +-/ +@[category research open, AMS 11] +theorem erdos_472 : answer(sorry) ↔ + ∃ (q : ℕ → ℕ) (m : ℕ), 0 < m ∧ IsErdos472Sequence q m := by + sorry + +end Erdos472 diff --git a/FormalConjectures/ErdosProblems/473.lean b/FormalConjectures/ErdosProblems/473.lean new file mode 100644 index 0000000000..d1a42695c8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/473.lean @@ -0,0 +1,53 @@ +/- +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 473 + +*Reference:* [erdosproblems.com/473](https://www.erdosproblems.com/473) + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +Is there a permutation $a_1, a_2, \ldots$ of the positive integers such that $a_k + a_{k+1}$ is +always prime? Asked by Segal. The answer is yes, as shown by Odlyzko. + +See also OEIS sequence [A055265](https://oeis.org/A055265). +-/ + +namespace Erdos473 + +/-- +Erdős Problem 473 (Segal): +There exists a permutation $a_1, a_2, \ldots$ of the positive integers such that +$a_k + a_{k+1}$ is prime for all $k$. The answer is yes, as shown by Odlyzko. + +The function $a : \mathbb{N} \to \mathbb{N}$ represents the sequence (0-indexed), and the three +conditions (injective, values positive, surjective onto positives) together +encode that $a$ is a bijection from $\mathbb{N}$ onto the positive integers. +-/ +@[category research solved, AMS 5 11] +theorem erdos_473 : + answer(True) ↔ + ∃ a : ℕ → ℕ, Function.Injective a ∧ + (∀ n, 0 < a n) ∧ + (∀ m, 0 < m → ∃ n, a n = m) ∧ + ∀ k, Nat.Prime (a k + a (k + 1)) := by + sorry + +end Erdos473 diff --git a/FormalConjectures/ErdosProblems/474.lean b/FormalConjectures/ErdosProblems/474.lean new file mode 100644 index 0000000000..37085f8a6b --- /dev/null +++ b/FormalConjectures/ErdosProblems/474.lean @@ -0,0 +1,79 @@ +/- +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 474 + +*Reference:* [erdosproblems.com/474](https://www.erdosproblems.com/474) + +Does the negative square-bracket partition relation 2^ℵ₀ ↛ [ℵ₁]³₃ hold assuming the continuum +equals ℵ₂? + +[Er95d] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and +differences* (1995), p.64. + +[Va99] Väänänen, J., *Problems from the Erdős notebook* (1999), 7.81. + +[Sh88] Shelah, S., *Was Sierpiński right? I*. Israel Journal of Mathematics (1988), 355–380. + +Erdős offered $100 for deciding the answer without CH. +-/ + +open Cardinal + +namespace Erdos474 + +/-- The negative square-bracket partition relation $\kappa \nrightarrow [\mu]_k^2$ for cardinals. + +There exists a $k$-coloring of pairs from a set of cardinality $\kappa$ such that +every subset of cardinality $\geq \mu$ contains pairs of all $k$ colors. + +In standard Erdős-Rado partition calculus notation, this is +$\kappa \nrightarrow [\mu]_k^2$. -/ +def NegSqBracketPartition (κ μ : Cardinal) (k : ℕ) : Prop := + ∃ (α : Type*) (_ : #α = κ) (f : α → α → Fin k), + (∀ x y, f x y = f y x) ∧ + ∀ (S : Set α), #S ≥ μ → + ∀ c : Fin k, ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ f a b = c + +/-- +Erdős Problem 474 (1954) [Er95d, p.64] [Va99, 7.81]: + +Does the negative square-bracket partition relation $2^{\aleph_0} \nrightarrow [\aleph_1]_3^2$ +hold assuming $\mathfrak{c} = \aleph_2$? + +In words: can the pairs from $\mathbb{R}$ be $3$-colored so that every uncountable +subset contains pairs of each color? + +Sierpinski and Kurepa independently proved the $2$-color version +($2^{\aleph_0} \nrightarrow [\aleph_1]_2^2$) holds in ZFC. Erdős proved that under the +continuum hypothesis ($\mathfrak{c} = \aleph_1$), the $3$-color version holds, and offered +100 dollars for deciding what happens without CH. + +Shelah [Sh88] showed it is consistent without CH that the positive relation +$2^{\aleph_0} \to [\aleph_1]_3^2$ holds, but with $\mathfrak{c}$ very large. + +The specific remaining open question (asked in [Va99]): +Assuming $\mathfrak{c} = \aleph_2$, does $2^{\aleph_0} \nrightarrow [\aleph_1]_3^2$ hold? +-/ +@[category research open, AMS 3 5] +theorem erdos_474 : answer(sorry) ↔ + (continuum = aleph 2 → NegSqBracketPartition continuum (aleph 1) 3) := by + sorry + +end Erdos474 diff --git a/FormalConjectures/ErdosProblems/475.lean b/FormalConjectures/ErdosProblems/475.lean new file mode 100644 index 0000000000..b94561c8f1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/475.lean @@ -0,0 +1,91 @@ +/- +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 475 + +Let $p$ be a prime. Is it true that every subset $A \subseteq \mathbb{F}_p \setminus \{0\}$ admits +a sequencing $a_1, \ldots, a_t$ such that all partial sums $\sum_{k=1}^{m} a_k$ are distinct? + +## References + +[ErGr80] Erdős, P. and Graham, R.L., _Old and new problems and results in combinatorial +number theory_. Monographies de L'Enseignement Mathématique (1980). + +[CoPe20] Costa, S. and Pellegrini, M.A., _Some new results about a conjecture by Brian +Alspach_. Archiv der Mathematik (Basel) (2020), 479–488. + +[HOS19] Hicks, J., Ollis, M.A., and Schmitt, J.R., _Distinct partial sums in cyclic groups: +polynomial method and constructive approaches_. Journal of Combinatorial Designs (2019), +369–385. + +[Kr24] Kravitz, N., _Rearranging small sets for distinct partial sums_. arXiv:2407.01835 (2024). + +[BeKr24] Bedert, B. and Kravitz, N., _Graham's rearrangement conjecture beyond the +rectification barrier_. arXiv:2409.07403 (2024). + +[MuPo25] Müyesser, A. and Pokrovskiy, A., _A random Hall–Paige conjecture_. +arXiv:2204.09666 (2025). + +[BBKMM25] Bedert, B., Bucić, M., Kravitz, N., Montgomery, R., and Müyesser, A., +_On Graham's rearrangement conjecture over ℤ₂ⁿ_. arXiv:2508.18254 (2025). + +[PhSa26] Pham, H.T. and Sauermann, L., _On Graham's rearrangement conjecture_. +arXiv:2602.15797 (2026). + +[CoDe26] Costa, S. and Della Fiore, S., _New bounds for (weak) sequenceability in ℤₖ_. +arXiv:2602.19989 (2026). + +*Reference:* [erdosproblems.com/475](https://www.erdosproblems.com/475) +-/ + +open Finset BigOperators + +namespace Erdos475 + +/-- +The partial sum of a sequence $f$ at index $m$: the sum $f(0) + f(1) + \cdots + f(m)$. +-/ +noncomputable def partialSum {n : ℕ} {α : Type*} [AddCommMonoid α] + (f : Fin n → α) (m : Fin n) : α := + (univ.filter (fun i : Fin n => i ≤ m)).sum f + +/-- +Erdős-Graham Conjecture on sequenceable sets in $\mathbb{F}_p$ (Problem 475): +Let $p$ be a prime. Given any finite set $A \subseteq \mathbb{F}_p \setminus \{0\}$, there always +exists a rearrangement $A = \{a_1, \ldots, a_t\}$ such that all partial sums +$\sum_{1 \le k \le m} a_k$ are distinct, for all $1 \le m \le t$. + +Such an ordering is called a "valid ordering" or "sequencing" of $A$. +Graham proved the case $t = p - 1$ [ErGr80]. + +The conjecture has been resolved for all sufficiently large primes via four complementary +results: small sets [Kr24] [CoDe26], medium sets [PhSa26], large sets [BBKMM25] [BeKr24], +and very large sets [MuPo25]. Earlier, the conjecture was verified for $t \leq 12$ [CoPe20] +and for $p - 3 \leq t \leq p - 1$ [HOS19]. +-/ +@[category research open, AMS 5 11] +theorem erdos_475 (p : ℕ) [Fact (Nat.Prime p)] (A : Finset (ZMod p)) + (hA : ∀ a ∈ A, a ≠ 0) : + ∃ f : Fin A.card → ZMod p, + (∀ i, f i ∈ A) ∧ + Function.Injective f ∧ + Function.Injective (partialSum f) := by + sorry + +end Erdos475 diff --git a/FormalConjectures/ErdosProblems/476.lean b/FormalConjectures/ErdosProblems/476.lean new file mode 100644 index 0000000000..8803a088c3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/476.lean @@ -0,0 +1,89 @@ +/- +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 476 + +For a prime $p$ and $A \subseteq \mathbb{F}_p$, the restricted sumset +$A \hat{+} A = \{a + b : a, b \in A, a \neq b\}$ satisfies +$|A \hat{+} A| \geq \min(2|A| - 3, p)$. + +*Reference:* [erdosproblems.com/476](https://www.erdosproblems.com/476) + +[Er65b] Erdős, P., *Some recent advances and current problems in number theory*. +Lectures on Modern Mathematics, Vol. III (1965), 196-244. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[dSHa94] da Silva, J.A.D. and Hamidoune, Y.O., *Cyclic spaces for Grassmann derivatives and +additive theory*, Bull. London Math. Soc. 26 (1994), 140-146. + +[Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437, Problem C15. +-/ + +open Finset + +namespace Erdos476 + +/-- +The restricted sumset $A \hat{+} A = \{a + b : a, b \in A, a \neq b\}$, consisting of all +pairwise sums of distinct elements from $A$. +-/ +def restrictedSumset {p : ℕ} (A : Finset (ZMod p)) : Finset (ZMod p) := + A.biUnion (fun a => (A.erase a).image (fun b => a + b)) + +/-- +Erdős-Heilbronn Conjecture (Problem 476): + +Let $p$ be a prime and let $A \subseteq \mathbb{F}_p$. Define the restricted sumset +$$A \hat{+} A = \{a + b : a, b \in A, a \neq b\}.$$ +Is it true that $|A \hat{+} A| \geq \min(2|A| - 3, p)$? + +A question of Erdős and Heilbronn. Solved in the affirmative by +da Silva and Hamidoune [dSHa94]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_476 : answer(True) ↔ + ∀ (p : ℕ) [Fact (Nat.Prime p)] (A : Finset (ZMod p)), + (restrictedSumset A).card ≥ min (2 * A.card - 3) p := by + sorry + +/-- +The restricted $r$-fold sumset of $A$: the set of all sums of exactly $r$ distinct elements of $A$. +-/ +def restrictedSumset_r {p : ℕ} (A : Finset (ZMod p)) (r : ℕ) : Finset (ZMod p) := + A.powersetCard r |>.image (fun s => s.sum id) + +/-- +Erdős–Heilbronn generalized conjecture (Problem 476, variant): + +Let $p$ be a prime, $A \subseteq \mathbb{F}_p$, and $r \geq 1$. The number of elements of +$\mathbb{F}_p$ that can be written as the sum of $r$ distinct elements of $A$ is at least +$\min(r|A| - r^2 + 1, p)$. + +This generalization is mentioned by Erdős [Er65b] and appears as Problem C15 in Guy's +collection [Gu04]. Setting $r = 2$ recovers the original bound $\min(2|A| - 3, p)$. +-/ +@[category research open, AMS 5 11] +theorem erdos_476_generalized : + ∀ (p : ℕ) [Fact (Nat.Prime p)] (A : Finset (ZMod p)) (r : ℕ), + (restrictedSumset_r A r).card ≥ min (r * A.card - r ^ 2 + 1) p := by + sorry + +end Erdos476 diff --git a/FormalConjectures/ErdosProblems/478.lean b/FormalConjectures/ErdosProblems/478.lean new file mode 100644 index 0000000000..a95e61fd6d --- /dev/null +++ b/FormalConjectures/ErdosProblems/478.lean @@ -0,0 +1,83 @@ +/- +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 478 + +*Reference:* [erdosproblems.com/478](https://www.erdosproblems.com/478) + +Let $p$ be a prime and $A_p = \{ k! \bmod p : 1 \leq k < p \}$. +Is it true that $|A_p| \sim (1 - 1/e) \cdot p$? + +The best known lower bound is $|A_p| \geq (\sqrt{2} - o(1)) p^{1/2}$ +due to Grebennikov, Sagdeev, Semchankau, and Vasilevskii [GSSV24]. +Wilson's theorem gives the upper bound $|A_p| \leq p - 2$. + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial +number theory*. Monographies de L'Enseignement Mathematique (1980). + +[GSSV24] Grebennikov, A., Sagdeev, A., Semchankau, A., and Vasilevskii, A., +*On the sequence n! mod p*. Revista Matemática Iberoamericana (2024), 637–648. + +[HaSu02] Hardy, G. E. and Subbarao, M. V., *A modified problem of Pillai and some +related questions*. Amer. Math. Monthly (2002), 554–559. + +[KlMu17] Klurman, O. and Munsch, M., *Distribution of factorials modulo p*. +J. Théor. Nombres Bordeaux (2017), 169–177. +-/ + +open Filter + +open scoped Topology Real + +namespace Erdos478 + +/-- The set of distinct factorial residues modulo $p$: + $A_p = \{ k! \bmod p : 1 \leq k < p \}$. -/ +def factorialResidues (p : ℕ) : Finset ℕ := + (Finset.Icc 1 (p - 1)).image (fun k => Nat.factorial k % p) + +/-- +Erdős Problem 478 [ErGr80, p.96]: + +Let $p$ be a prime and $A_p = \{ k! \bmod p : 1 \leq k < p \}$. +Is it true that $|A_p| \sim (1 - 1/e) \cdot p$? + +Formally: the ratio $|A_p| / ((1 - e^{-1}) \cdot p)$ tends to $1$ as $p \to \infty$ +through the primes. +-/ +@[category research open, AMS 11] +theorem erdos_478 : answer(sorry) ↔ + Tendsto + (fun p : ℕ => + (factorialResidues p).card / ((1 - Real.exp (-1)) * (p : ℝ))) + (atTop ⊓ Filter.principal {p | Nat.Prime p}) + (nhds 1) := by + sorry + +/-- +Hardy–Subbarao conjecture [HaSu02]: only finitely many primes $p$ satisfy +$|A_p| = p - 2$, and perhaps only $p = 5$. Any such prime must satisfy +$p \equiv 1 \pmod{4}$. +-/ +@[category research open, AMS 11] +theorem erdos_478_variant_hardy_subbarao : answer(sorry) ↔ + Set.Finite {p : ℕ | Nat.Prime p ∧ (factorialResidues p).card = p - 2} := by + sorry + +end Erdos478 diff --git a/FormalConjectures/ErdosProblems/481.lean b/FormalConjectures/ErdosProblems/481.lean new file mode 100644 index 0000000000..58dda6238b --- /dev/null +++ b/FormalConjectures/ErdosProblems/481.lean @@ -0,0 +1,71 @@ +/- +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 481 + +Let $a_1, \ldots, a_r, b_1, \ldots, b_r \in \mathbb{N}$ with $\sum 1/a_i > 1$. Starting from +$A_1 = (1)$ and iterating $T(A) = (a_i x_j + b_i)$, prove that some $A_k$ must contain repeated +elements. + +*Reference:* [erdosproblems.com/481](https://www.erdosproblems.com/481) + +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathematique (1980). + +[Kl82] Klarner, D., _A sufficient condition for certain semigroups to be free_. J. Algebra +(1982), 140–148. + +[KoTa22] Kolpakov, A. and Talambutsa, A., _On free semigroups of affine maps on the real line_. +Proc. Amer. Math. Soc. (2022), 2301–2307. +-/ + +namespace Erdos481 + +/-- The affine map transformation $T$ from Erdős Problem 481. +Given parameters $(a_i, b_i)$ and a sequence $A = (x_1, \ldots, x_n)$, +$T(A)$ is the sequence $(a_i x_j + b_i)_{1 \le j \le n, 1 \le i \le r}$. -/ +def affineTransform (params : List (ℕ × ℕ)) (A : List ℤ) : List ℤ := + A.flatMap (fun x => params.map (fun ⟨a, b⟩ => (a : ℤ) * x + (b : ℤ))) + +/-- Iterate the affine transform starting from $A_1 = (1)$. +`iterateAffine params 0 = [1]` and `iterateAffine params (k+1) = T(iterateAffine params k)`. -/ +def iterateAffine (params : List (ℕ × ℕ)) : ℕ → List ℤ + | 0 => [1] + | n + 1 => affineTransform params (iterateAffine params n) + +/-- +Erdős Problem 481 [ErGr80, p.96]: + +Let $a_1, \ldots, a_r, b_1, \ldots, b_r \in \mathbb{N}$ with $\sum_i 1/a_i > 1$. +For a finite sequence $A = (x_1, \ldots, x_n)$ of (not necessarily distinct) integers, +let $T(A)$ denote the sequence of length $rn$ given by +$(a_i x_j + b_i)_{1 \le j \le n, 1 \le i \le r}$. +If $A_1 = (1)$ and $A_{k+1} = T(A_k)$, then there must be some $A_k$ with +repeated elements. +-/ +@[category research solved, AMS 5 11] +theorem erdos_481 + (params : List (ℕ × ℕ)) + (hne : params ≠ []) + (hpos : ∀ p ∈ params, 0 < p.1) + (hsum : (params.map (fun p => (1 : ℝ) / (p.1 : ℝ))).sum > 1) : + ∃ k : ℕ, ¬ (iterateAffine params k).Nodup := by + sorry + +end Erdos481 diff --git a/FormalConjectures/ErdosProblems/482.lean b/FormalConjectures/ErdosProblems/482.lean new file mode 100644 index 0000000000..bdd68e5f11 --- /dev/null +++ b/FormalConjectures/ErdosProblems/482.lean @@ -0,0 +1,82 @@ +/- +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 482 + +*Reference:* [erdosproblems.com/482](https://www.erdosproblems.com/482) + +Define a sequence by $a_1 = 1$ and $a_{n+1} = \lfloor \sqrt{2} \cdot (a_n + 1/2) \rfloor$ for +$n \geq 1$. Graham and Pollak [GrPo70] showed that the difference $a_{2n+1} - 2 \cdot a_{2n-1}$ +equals the $n$th digit in the binary expansion of $\sqrt{2}$. + +Erdős and Graham [ErGr80, p.96] asked for similar results for $\theta = \sqrt{m}$ and other +algebraic numbers. This was addressed by the generalisations of Stoll [St05, St06]. + +[GrPo70] Graham, R.L. and Pollak, H.O., _Note on a nonlinear recurrence related to $\sqrt{2}$_, +Mathematics Magazine 43 (1970), 143–145. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathématique (1980). + +[St05] Stoll, T., _On families of nonlinear recurrences related to digits_, J. Integer Seq. 8 +(2005). + +[St06] Stoll, T., _A fancy way to obtain the binary digits of certain irrational numbers_, +Amer. Math. Monthly 113 (2006), 323–328. + +See also OEIS sequence [A004539](https://oeis.org/A004539) (binary expansion of √2). +-/ + +namespace Erdos482 + +/-- The Graham–Pollak sequence: $a(1) = 1$, $a(n+1) = \lfloor \sqrt{2} \cdot (a(n) + 1/2) \rfloor$. +This sequence is 1-indexed; $a(0)$ is a dummy value. -/ +noncomputable def grahamPollakSeq : ℕ → ℤ + | 0 => 0 + | 1 => 1 + | n + 2 => ⌊Real.sqrt 2 * ((grahamPollakSeq (n + 1) : ℝ) + 1 / 2)⌋ + +/-- The $n$th binary digit (0-indexed) of a nonnegative real number $x$. +Position 0 is the units (2⁰) bit. Equals $\lfloor x \cdot 2^n \rfloor \bmod 2$. -/ +noncomputable def binaryDigit (x : ℝ) (n : ℕ) : ℤ := + ⌊x * (2 : ℝ) ^ n⌋ % 2 + +/-- +Erdős Problem 482 (Graham–Pollak theorem) [ErGr80, p.96]: + +Define a sequence by $a_1 = 1$ and $a_{n+1} = \lfloor \sqrt{2} \cdot (a_n + 1/2) \rfloor$ for +$n \geq 1$. Then the difference $a_{2n+1} - 2 \cdot a_{2n-1}$ equals the $n$th digit in the +binary expansion of $\sqrt{2}$ ($n \geq 1$, 1-indexed). + +The result for $\sqrt{2}$ was proved by Graham and Pollak [GrPo70]. Erdős and Graham asked for +similar results for $\theta = \sqrt{m}$ and other algebraic numbers; this was addressed by the +generalisations of Stoll [St05, St06]. + +Formalised using 0-indexed binary digits (position 0 = integer part) and shifting the index to +avoid natural-number subtraction: for all $n$, +$a(2n+3) - 2 \cdot a(2n+1) = \mathrm{binaryDigit}(\sqrt{2}, n)$. +-/ +@[category research solved, AMS 11] +theorem erdos_482 : + ∀ n : ℕ, + grahamPollakSeq (2 * n + 3) - 2 * grahamPollakSeq (2 * n + 1) = + binaryDigit (Real.sqrt 2) n := by + sorry + +end Erdos482 diff --git a/FormalConjectures/ErdosProblems/483.lean b/FormalConjectures/ErdosProblems/483.lean new file mode 100644 index 0000000000..615f53e0f8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/483.lean @@ -0,0 +1,79 @@ +/- +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 483 + +*Reference:* [erdosproblems.com/483](https://www.erdosproblems.com/483) + +See also Problem 183. + +OEIS: [A030126](https://oeis.org/A030126) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. 8 (1965), +181–189. + +[ACPPRT21] Ageron, R., Casteras, P., Pellerin, T., Portella, Y., Rimmel, A., Tomasik, J., +_New lower bounds for Schur and weak Schur numbers_. arXiv:2112.03175 (2021). + +[Wh73] Whitehead, E. G., Jr., _The Ramsey number N(3,3,3,3;2)_. Discrete Mathematics (1973), +389–396. + +[He17] Heule, M., _Schur Number Five_. arXiv:1711.08076 (2017). +-/ + +namespace Erdos483 + +/-- A coloring $f : \mathbb{N} \to \text{Fin}\ k$ has a *monochromatic Schur triple* in +$\{1, \ldots, N\}$ if there exist $a, b \geq 1$ with $a + b \leq N$ and +$f(a) = f(b) = f(a + b)$. -/ +def HasMonochromaticSchurTriple (k N : ℕ) (f : ℕ → Fin k) : Prop := + ∃ a b : ℕ, 1 ≤ a ∧ 1 ≤ b ∧ a + b ≤ N ∧ f a = f b ∧ f b = f (a + b) + +/-- +Erdős Problem 483 [Er61, p.233] [Er65, p.188]: + +Let $f(k)$ be the minimal $N$ such that if $\{1, \ldots, N\}$ is $k$-coloured then there is a +monochromatic solution to $a + b = c$. The values $f(k)$ are known as Schur numbers. + +Estimate $f(k)$. In particular, is it true that $f(k) < c^k$ for some constant $c > 0$? + +The best-known bounds for large $k$ are +$$ + 380^{k/5} - O(1) \leq f(k) \leq \lfloor (e - 1/24)\, k! \rfloor - 1. +$$ +The known values are $f(1) = 2$, $f(2) = 5$, $f(3) = 14$, $f(4) = 45$, $f(5) = 161$ +(OEIS A030126). + +We formalize the conjecture: there exists $c > 0$ such that for all $k \geq 1$, +every $k$-coloring of $\{1, \ldots, N\}$ with $N \geq c^k$ has a monochromatic Schur triple. +Equivalently, the Schur number $f(k)$ grows at most exponentially in $k$. +-/ +@[category research open, AMS 5] +theorem erdos_483 : answer(sorry) ↔ + ∃ c : ℝ, 0 < c ∧ + ∀ k : ℕ, 1 ≤ k → + ∀ N : ℕ, c ^ k ≤ (N : ℝ) → + ∀ f : ℕ → Fin k, + HasMonochromaticSchurTriple k N f := by + sorry + +end Erdos483 diff --git a/FormalConjectures/ErdosProblems/484.lean b/FormalConjectures/ErdosProblems/484.lean new file mode 100644 index 0000000000..c37c918930 --- /dev/null +++ b/FormalConjectures/ErdosProblems/484.lean @@ -0,0 +1,62 @@ +/- +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 484 + +There exists an absolute constant $c > 0$ such that, whenever $\{1, \ldots, N\}$ is +$k$-coloured (and $N$ is large enough depending on $k$), there are at least $cN$ +integers representable as a monochromatic sum $a + b$ with $a \neq b$. + +*Reference:* [erdosproblems.com/484](https://www.erdosproblems.com/484) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató +Int. Közl. **6** (1961), 221–254. + +[ESS89] Erdős, P., Sárközy, A., and Sós, V. T., *On sum sets of Sidon sets*, +Journal of Number Theory (1989). +-/ + +open Finset + +namespace Erdos484 + +/-- +Erdős Problem 484 (a conjecture of Roth, proved by Erdős–Sárközy–Sós [ESS89]): + +There exists an absolute constant $c > 0$ such that, whenever $\{1, \ldots, N\}$ is +$k$-coloured (and $N$ is large enough depending on $k$), there are at least $cN$ +integers in $\{1, \ldots, N\}$ representable as a monochromatic sum, i.e., as $a + b$ +where $a, b \in \{1, \ldots, N\}$ lie in the same colour class and $a \neq b$. + +Erdős, Sárközy, and Sós proved this and showed that in fact at least +$N/2 - O(N^{1 - 1/2^{k+1}})$ even numbers are of this form. +-/ +@[category research solved, AMS 5 11] +theorem erdos_484 : + ∃ c : ℝ, 0 < c ∧ + ∀ k : ℕ, 0 < k → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ χ : ℕ → Fin k, + ∃ S ⊆ Finset.Icc 1 N, + (S.card : ℝ) ≥ c * (N : ℝ) ∧ + ∀ n ∈ S, ∃ a ∈ Finset.Icc 1 N, ∃ b ∈ Finset.Icc 1 N, + a ≠ b ∧ χ a = χ b ∧ a + b = n := by + sorry + +end Erdos484 diff --git a/FormalConjectures/ErdosProblems/485.lean b/FormalConjectures/ErdosProblems/485.lean new file mode 100644 index 0000000000..6048aabb3a --- /dev/null +++ b/FormalConjectures/ErdosProblems/485.lean @@ -0,0 +1,86 @@ +/- +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 485 + +*Reference:* [erdosproblems.com/485](https://www.erdosproblems.com/485) + +Let $f(k)$ be the minimum number of nonzero terms in $P(x)^2$, where $P \in \mathbb{Q}[x]$ +ranges over all polynomials with exactly $k$ nonzero terms. Is it true that +$f(k) \to \infty$ as $k \to \infty$? + +[Re47] Rényi, A., _On the minimal number of terms of the square of a polynomial_, +Hungarica Acta Math. (1947), 30–34. + +[Er49b] Erdős, P., _On the number of terms of the square of a polynomial_, +Nieuw Arch. Wiskunde (2) (1949), 63–65. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_, (1974), 155–180. + +[Sc87] Schinzel, A., _On the number of terms of a power of a polynomial_, Acta Arith. 49 +(1987), 55–70. + +[ScZa09] Schinzel, A. and Zannier, U., _On the number of terms of a power of a polynomial_, +Atti Accad. Naz. Lincei Rend. Lincei Mat. Appl. 20 (2009), 95–98. +-/ + +open Polynomial + +namespace Erdos485 + +/-- +Erdős Problem #485 (Erdős–Rényi conjecture, proved by Schinzel [Sc87]): + +Let $f(k)$ be the minimum number of nonzero terms in $P(x)^2$, where $P \in \mathbb{Q}[x]$ +ranges over all polynomials with exactly $k$ nonzero terms. Is it true that +$f(k) \to \infty$ as $k \to \infty$? + +This is Problem 4.4 in [Ha74], where it is attributed to Erdős. First investigated +by Rényi and Rédei [Re47]. Erdős [Er49b] proved the upper bound $f(k) < k^{1-c}$ +for some $c > 0$. + +Schinzel [Sc87] proved $f(k) > \log(\log k) / \log 2$. Schinzel and Zannier [ScZa09] +improved this to $f(k) \gg \log k$. +-/ +@[category research solved, AMS 12] +theorem erdos_485 : answer(True) ↔ + ∀ M : ℕ, ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ P : ℚ[X], P.support.card = k → + M ≤ (P ^ 2).support.card := by + sorry + +/-- +Generalization of Erdős Problem #485 to arbitrary powers: + +For any fixed $n \geq 1$, the minimum number of nonzero terms of $P(x)^n$, +over all polynomials $P \in \mathbb{Q}[x]$ with exactly $k$ nonzero terms, +tends to infinity as $k \to \infty$. + +Schinzel [Sc87] established lower bounds for this general case over fields +of characteristic zero or sufficiently large positive characteristic. +-/ +@[category research solved, AMS 12] +theorem erdos_485_general_power : + ∀ (n : ℕ), 1 ≤ n → + ∀ M : ℕ, ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ P : ℚ[X], P.support.card = k → + M ≤ (P ^ n).support.card := by + sorry + +end Erdos485 diff --git a/FormalConjectures/ErdosProblems/487.lean b/FormalConjectures/ErdosProblems/487.lean new file mode 100644 index 0000000000..69ca1dbede --- /dev/null +++ b/FormalConjectures/ErdosProblems/487.lean @@ -0,0 +1,57 @@ +/- +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 487 + +*Reference:* [erdosproblems.com/487](https://www.erdosproblems.com/487) + +If $A \subseteq \mathbb{N}$ has positive upper density, must there exist distinct +$a, b, c \in A$ such that $\text{lcm}(a, b) = c$? + +[Er61] Erdős, P., _Graph theory and probability. II_. Canad. J. Math. 13 (1961), p. 236. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. 8 (1965), +p. 228. + +[Kl71] Kleitman, D., _Collections of subsets containing no two sets and their union_. +Proc. LA Meeting AMS (1971), 153-155. + +[DaEr36] Davenport, H. and Erdős, P., _On sequences of positive integers_. +Acta Arithmetica **2** (1936), 147-151. +-/ + +namespace Erdos487 + +/-- +Erdős Problem 487 [Er61, p. 236] [Er65b, p. 228]: + +Let $A \subseteq \mathbb{N}$ have positive upper density. Must there exist distinct +$a, b, c \in A$ such that $[a, b] = c$ (where $[a, b]$ denotes the least common multiple of +$a$ and $b$)? + +This is true, a consequence of the positive solution to Erdős Problem 447 +by Kleitman [Kl71]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_487 : answer(True) ↔ + ∀ (A : Set ℕ), A.upperDensity > 0 → + ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ Nat.lcm a b = c := by + sorry + +end Erdos487 diff --git a/FormalConjectures/ErdosProblems/49.lean b/FormalConjectures/ErdosProblems/49.lean new file mode 100644 index 0000000000..cabd237b86 --- /dev/null +++ b/FormalConjectures/ErdosProblems/49.lean @@ -0,0 +1,109 @@ +/- +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 Mathlib.NumberTheory.ArithmeticFunction.Misc + +/-! +# Erdős Problem 49 + +*Reference:* [erdosproblems.com/49](https://www.erdosproblems.com/49) + +The maximum size of a subset of $\{1, \ldots, N\}$ on which Euler's totient function is +strictly increasing is $(1 + o(1))\pi(N)$. Proved by Tao [Ta23b]. +See also [Er95], [Er95c]. + +OEIS: [A365339](https://oeis.org/A365339), [A365474](https://oeis.org/A365474). + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium **107** (1995). + +[Er95c] Erdős, P., _Some problems in number theory_. Octogon Math. Mag. (1995), 3–5. + +[Ta23b] Tao, T., _Monotone non-decreasing sequences of the Euler totient function_. +arXiv:2309.02325 (2023). +-/ + +namespace Erdos49 + +open scoped ArithmeticFunction.sigma + +/-- +Let $A = \{a_1 < \cdots < a_t\} \subseteq \{1, \ldots, N\}$ be such that +$\varphi(a_1) < \cdots < \varphi(a_t)$, i.e., the Euler totient function is +strictly increasing on $A$ (in the ordering inherited from $\mathbb{N}$). +The primes are such an example. + +The conjecture (proved by Tao [Ta23b]) is that $|A| \leq (1 + o(1))\pi(N)$, i.e., +for every $\varepsilon > 0$, for all sufficiently large $N$, any such $A$ +satisfies $|A| \leq (1 + \varepsilon) \cdot \pi(N)$. +-/ +@[category research solved, AMS 11] +theorem erdos_49 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ x ∈ A, 1 ≤ x ∧ x ≤ N) → + (∀ a ∈ A, ∀ b ∈ A, a < b → Nat.totient a < Nat.totient b) → + (A.card : ℝ) ≤ (1 + ε) * (Nat.primeCounting N : ℝ) := by + sorry + +/-- +Weaker form of Erdős Problem 49: the maximum size of a subset $A \subseteq \{1, \ldots, N\}$ +on which Euler's totient function is strictly increasing satisfies $|A| = o(N)$. +This is implied by the main result `erdos_49`. +-/ +@[category research solved, AMS 11] +theorem erdos_49_weaker : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ x ∈ A, 1 ≤ x ∧ x ≤ N) → + (∀ a ∈ A, ∀ b ∈ A, a < b → Nat.totient a < Nat.totient b) → + (A.card : ℝ) ≤ ε * (N : ℝ) := by + sorry + +/-- +Variant of Erdős Problem 49 for the sum-of-divisors function $\sigma(n)$: +what is the maximum size of a subset $A \subseteq \{1, \ldots, N\}$ on which +$\sigma$ is strictly increasing? Is it $(1 + o(1))\pi(N)$? +-/ +@[category research open, AMS 11] +theorem erdos_49_sigma : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ x ∈ A, 1 ≤ x ∧ x ≤ N) → + (∀ a ∈ A, ∀ b ∈ A, a < b → σ 1 a < σ 1 b) → + (A.card : ℝ) ≤ (1 + ε) * (Nat.primeCounting N : ℝ) := by + sorry + +/-- +Variant of Erdős Problem 49 with non-strict monotonicity [Er95c]: +what is the maximum size of a subset $A = \{a_1 < \cdots < a_t\} \subseteq \{1, \ldots, N\}$ +such that $\varphi(a_1) \leq \cdots \leq \varphi(a_t)$? Is it $(1 + o(1))\pi(N)$? +-/ +@[category research open, AMS 11] +theorem erdos_49_nonstrict : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, + (∀ x ∈ A, 1 ≤ x ∧ x ≤ N) → + (∀ a ∈ A, ∀ b ∈ A, a < b → Nat.totient a ≤ Nat.totient b) → + (A.card : ℝ) ≤ (1 + ε) * (Nat.primeCounting N : ℝ) := by + sorry + +end Erdos49 diff --git a/FormalConjectures/ErdosProblems/490.lean b/FormalConjectures/ErdosProblems/490.lean new file mode 100644 index 0000000000..957011760a --- /dev/null +++ b/FormalConjectures/ErdosProblems/490.lean @@ -0,0 +1,96 @@ +/- +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 490 + +If $A, B \subseteq \{1, \ldots, N\}$ are such that all products $ab$ ($a \in A$, $b \in B$) +are distinct, is it true that $|A| \cdot |B| \ll N^2 / \log N$? + +*Reference:* [erdosproblems.com/490](https://www.erdosproblems.com/490) + +See also Problems 425 and 896. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Er69] Erdős, P., _On some applications of graph theory to number theoretic problems_. Publ. +Ramanujan Inst. 1 (1969), 131-136. + +[Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117-138. + +[Sz76] Szemerédi, E., _On a problem of P. Erdős_. J. Number Theory (1976), 264-270. +-/ + +namespace Erdos490 + +/-- +The products $ab$ with $a \in A$ and $b \in B$ are all distinct: the multiplication +map $A \times B \to \mathbb{N}$ is injective. +-/ +def HasDistinctProducts (A B : Finset ℕ) : Prop := + ∀ a₁ ∈ A, ∀ b₁ ∈ B, ∀ a₂ ∈ A, ∀ b₂ ∈ B, + a₁ * b₁ = a₂ * b₂ → a₁ = a₂ ∧ b₁ = b₂ + +/-- +If $A, B \subseteq \{1, \ldots, N\}$ are such that all products $ab$ ($a \in A$, $b \in B$) +are distinct, then $|A| \cdot |B| \ll N^2 / \log N$. + +Formally: there exists a constant $C > 0$ such that for all $N \geq 2$ and all +$A, B \subseteq \{1, \ldots, N\}$ with distinct products, +$$ + |A| \cdot |B| \le C \cdot \frac{N^2}{\log N}. +$$ + +Proved by Szemerédi [Sz76]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_490 : + ∃ C : ℝ, C > 0 ∧ + ∀ (N : ℕ), 2 ≤ N → + ∀ (A B : Finset ℕ), + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) → + (∀ b ∈ B, 1 ≤ b ∧ b ≤ N) → + HasDistinctProducts A B → + (A.card : ℝ) * (B.card : ℝ) ≤ C * ((N : ℝ) ^ 2 / Real.log (N : ℝ)) := by + sorry + +/-- +Does the limit $\lim_{N \to \infty} \max_{A,B \subseteq [N]} |A| |B| \log N / N^2$ exist, +where the maximum is over $A, B$ with distinct products? If it exists, it must be $\geq 1$. + +This variant captures the question of whether the constant in Szemerédi's bound is sharp +and whether the limit exists at all. Posed by Erdős [Er72]. +-/ +@[category research open, AMS 5 11] +theorem erdos_490_limit : + ∃ L : ℝ, L ≥ 1 ∧ + Filter.Tendsto + (fun N : ℕ => + sSup {(A.card : ℝ) * (B.card : ℝ) * Real.log (N : ℝ) / ((N : ℝ) ^ 2) | + (A : Finset ℕ) (B : Finset ℕ) + (_ : ∀ a ∈ A, 1 ≤ a ∧ a ≤ N) + (_ : ∀ b ∈ B, 1 ≤ b ∧ b ≤ N) + (_ : HasDistinctProducts A B)}) + Filter.atTop (nhds L) := by + sorry + +end Erdos490 diff --git a/FormalConjectures/ErdosProblems/491.lean b/FormalConjectures/ErdosProblems/491.lean new file mode 100644 index 0000000000..bdcd9e9c47 --- /dev/null +++ b/FormalConjectures/ErdosProblems/491.lean @@ -0,0 +1,90 @@ +/- +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 491 + +*Reference:* [erdosproblems.com/491](https://www.erdosproblems.com/491) + +If $f$ is an additive arithmetic function (i.e. $f(ab) = f(a) + f(b)$ whenever $\gcd(a,b) = 1$) +and there is a constant $c$ such that $|f(n+1) - f(n)| < c$ for all $n$, must there exist a +constant $c'$ such that $f(n) = c' \log n + O(1)$? + +See also Problems 897 and 1122. + +[Er46] Erdős, P., _On the distribution function of additive functions_. Ann. of Math. (2) 47 +(1946), 1-20. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. **6** +(1961), 221–254. + +[Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +[Er82e] Erdős, P., _Some new problems and results in number theory_ (1982). + +[Wi70] Wirsing, E., _A characterization of $\log n$ as an additive arithmetic function_. +Symposia Math. (1970), 45–47. +-/ + +namespace Erdos491 + +/-- +An additive arithmetic function: $f(ab) = f(a) + f(b)$ whenever $\gcd(a,b) = 1$. +-/ +def IsAdditiveArithmeticFunction (f : ℕ → ℝ) : Prop := + ∀ a b : ℕ, Nat.Coprime a b → f (a * b) = f a + f b + +/-- +Erdős Problem 491 (proved by Wirsing [Wi70]): + +Let $f : \mathbb{N} \to \mathbb{R}$ be an additive function (i.e. $f(ab) = f(a) + f(b)$ whenever +$\gcd(a,b) = 1$). If there is a constant $c$ such that $|f(n+1) - f(n)| < c$ for +all $n$, then there exist constants $c'$ and $M$ such that $|f(n) - c' \log n| \leq M$ +for all $n \geq 1$. +-/ +@[category research solved, AMS 11] +theorem erdos_491 : answer(True) ↔ + ∀ f : ℕ → ℝ, IsAdditiveArithmeticFunction f → + (∃ c : ℝ, ∀ n : ℕ, |f (n + 1) - f n| < c) → + ∃ c' : ℝ, ∃ M : ℝ, ∀ n : ℕ, 1 ≤ n → + |f n - c' * Real.log (n : ℝ)| ≤ M := by + sorry + +/-- +Erdős (1946) [Er46]: If $f$ is an additive function and $f(n+1) - f(n) = o(1)$ +(i.e., the differences tend to zero), then $f(n) = c \log n$ for some constant $c$ +(exact equality, not just up to $O(1)$). This is a stronger hypothesis giving a +stronger conclusion than the main problem. +-/ +@[category research solved, AMS 11] +theorem erdos_491_small_o : ∀ f : ℕ → ℝ, IsAdditiveArithmeticFunction f → + (∀ ε : ℝ, 0 < ε → ∃ N : ℕ, ∀ n : ℕ, N ≤ n → |f (n + 1) - f n| < ε) → + ∃ c : ℝ, ∀ n : ℕ, 1 ≤ n → f n = c * Real.log (n : ℝ) := by + sorry + +/-- +Erdős (1946) [Er46]: If $f$ is an additive function and $f$ is monotone non-decreasing +(i.e., $f(n+1) \geq f(n)$ for all $n$), then $f(n) = c \log n$ for some constant $c$. +-/ +@[category research solved, AMS 11] +theorem erdos_491_monotone : ∀ f : ℕ → ℝ, IsAdditiveArithmeticFunction f → + (∀ n : ℕ, f n ≤ f (n + 1)) → + ∃ c : ℝ, ∀ n : ℕ, 1 ≤ n → f n = c * Real.log (n : ℝ) := by + sorry + +end Erdos491 diff --git a/FormalConjectures/ErdosProblems/492.lean b/FormalConjectures/ErdosProblems/492.lean new file mode 100644 index 0000000000..230baff7d4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/492.lean @@ -0,0 +1,116 @@ +/- +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 492 + +*Reference:* [erdosproblems.com/492](https://www.erdosproblems.com/492) + +Let $A = \{a_1 < a_2 < \cdots\} \subseteq \mathbb{N}$ be infinite with $a_{i+1}/a_i \to 1$. +The problem asked whether, for almost all $\alpha > 0$, the sequence of fractional positions +$f(\alpha n)$ is uniformly distributed in $[0,1)$. Disproved by Schmidt. + +[LV53] Le Veque, W.J., _On uniform distribution modulo a subdivision_, + Pacific J. Math. (1953), 757-771. +[DaLe63] Davenport, H., LeVeque, W.J., _Uniform distribution relative to a fixed sequence_, + Michigan Math. J. (1963), 315-319. +[DaEr63] Davenport, H., Erdős, P., _A theorem on uniform distribution_, + Magyar Tud. Akad. Mat. Kutató Int. Közl. (1963), 3-11. +[Sc69] Schmidt, W.M., _Irregularities of distribution. IV_, Invent. Math. 7 (1969), 55-82. +-/ + +open Filter MeasureTheory Finset + +namespace Erdos492 + +attribute [local instance] Classical.propDecidable + +/-- +A sequence $x : \mathbb{N} \to \mathbb{R}$ is equidistributed in $[0,1)$ if for every subinterval +$[c, d) \subseteq [0,1)$, the proportion of indices $n < N$ with $x(n) \in [c, d)$ +converges to $d - c$ as $N \to \infty$. +-/ +def IsEquidistributed (x : ℕ → ℝ) : Prop := + ∀ c d : ℝ, 0 ≤ c → c < d → d ≤ 1 → + Tendsto (fun N : ℕ => + (((Finset.range N).filter (fun n => c ≤ x n ∧ x n < d)).card : ℝ) / (N : ℝ)) + atTop (nhds (d - c)) + +/-- +Given a strictly increasing sequence $a : \mathbb{N} \to \mathbb{N}$, for $x$ in some interval +$[a(i), a(i+1))$, returns the fractional position +$(x - a(i)) / (a(i+1) - a(i)) \in [0,1)$. +Returns $0$ if $x$ is not in any such interval. +-/ +noncomputable def fractionalPosition (a : ℕ → ℕ) (x : ℝ) : ℝ := + if h : ∃ i : ℕ, (a i : ℝ) ≤ x ∧ x < (a (i + 1) : ℝ) then + let i := Nat.find h + (x - (a i : ℝ)) / ((a (i + 1) : ℝ) - (a i : ℝ)) + else 0 + +/-- +Erdős Problem 492 (disproved by Schmidt [Sc69]): + +Let $A = \{a_1 < a_2 < \cdots\} \subseteq \mathbb{N}$ be infinite with $a_{i+1}/a_i \to 1$. +For $x \geq a_1$, define $f(x) = (x - a_i)/(a_{i+1} - a_i) \in [0,1)$ +where $a_i \leq x < a_{i+1}$. For example if $A = \mathbb{N}$ then $f(x) = \{x\}$ is +the usual fractional part operator. + +The conjecture asked whether for almost all $\alpha > 0$, the sequence +$f(\alpha n)$ is uniformly distributed in $[0,1)$. Schmidt showed this is false: +there exists such a sequence for which equidistribution fails on a +set of positive measure. +-/ +@[category research solved, AMS 11 28] +theorem erdos_492 : answer(False) ↔ + ∀ (a : ℕ → ℕ), StrictMono a → (∀ i, 0 < a i) → + Tendsto (fun i => (a (i + 1) : ℝ) / (a i : ℝ)) atTop (nhds 1) → + ∀ᵐ α ∂(volume : Measure ℝ).restrict (Set.Ioi 0), + IsEquidistributed (fun n => fractionalPosition a (α * (n : ℝ))) := by + sorry + +/-- +Davenport–LeVeque (1963) [DaLe63]: If $a_{n+1} - a_n$ is monotone and $a_{n+1}/a_n \to 1$, +then for almost all $\alpha > 0$, the sequence $f(\alpha n)$ is equidistributed in $[0,1)$. +This is a positive partial result for Erdős Problem 492 under a monotone-differences hypothesis. +-/ +@[category research solved, AMS 11 28] +theorem erdos_492_monotone_differences : + ∀ (a : ℕ → ℕ), StrictMono a → (∀ i, 0 < a i) → + Tendsto (fun i => (a (i + 1) : ℝ) / (a i : ℝ)) atTop (nhds 1) → + Monotone (fun i => a (i + 1) - a i) → + ∀ᵐ α ∂(volume : Measure ℝ).restrict (Set.Ioi 0), + IsEquidistributed (fun n => fractionalPosition a (α * (n : ℝ))) := by + sorry + +/-- +Davenport–Erdős (1963) [DaEr63]: If $a_n \gg n^{1/2+\varepsilon}$ for some $\varepsilon > 0$ +(i.e., $a_n$ grows at least as fast as $n^{1/2+\varepsilon}$), then for almost all $\alpha > 0$, +the sequence $f(\alpha n)$ is equidistributed in $[0,1)$. +This is a positive partial result for Erdős Problem 492 under a growth-rate hypothesis. +-/ +@[category research solved, AMS 11 28] +theorem erdos_492_growth_rate : + ∀ (a : ℕ → ℕ), StrictMono a → (∀ i, 0 < a i) → + Tendsto (fun i => (a (i + 1) : ℝ) / (a i : ℝ)) atTop (nhds 1) → + (∃ ε : ℝ, 0 < ε ∧ ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, C * (n : ℝ) ^ (1/2 + ε) ≤ (a n : ℝ)) → + ∀ᵐ α ∂(volume : Measure ℝ).restrict (Set.Ioi 0), + IsEquidistributed (fun n => fractionalPosition a (α * (n : ℝ))) := by + sorry + +end Erdos492 diff --git a/FormalConjectures/ErdosProblems/493.lean b/FormalConjectures/ErdosProblems/493.lean new file mode 100644 index 0000000000..05e726ffdc --- /dev/null +++ b/FormalConjectures/ErdosProblems/493.lean @@ -0,0 +1,50 @@ +/- +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 493 + +Does there exist a $k$ such that every sufficiently large integer can be written +in the form $\prod_i a_i - \sum_i a_i$ for some integers $a_i \geq 2$? + +*Reference:* [erdosproblems.com/493](https://www.erdosproblems.com/493) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +p. 238. +-/ + +open Finset BigOperators + +namespace Erdos493 + +/-- +Erdős Problem 493 (attributed to Schinzel): +Does there exist a $k$ such that every sufficiently large integer can be written +in the form $\prod_i a_i - \sum_i a_i$ for some integers $a_i \geq 2$? + +The answer is yes with $k = 2$: for any integer $n$ we have +$n = 2 \cdot (n+2) - (2 + (n+2))$ (observed by Eli Seamans). +-/ +@[category research solved, AMS 11] +theorem erdos_493 : answer(True) ↔ + ∃ k : ℕ, ∃ N : ℤ, ∀ n : ℤ, n ≥ N → + ∃ a : Fin k → ℤ, (∀ i, a i ≥ 2) ∧ + (∏ i : Fin k, a i) - (∑ i : Fin k, a i) = n := by + sorry + +end Erdos493 diff --git a/FormalConjectures/ErdosProblems/496.lean b/FormalConjectures/ErdosProblems/496.lean new file mode 100644 index 0000000000..626006e113 --- /dev/null +++ b/FormalConjectures/ErdosProblems/496.lean @@ -0,0 +1,54 @@ +/- +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 496 + +Erdős asked whether for every irrational α and every ε > 0 there exist positive integers x, y, z +with |x² + y² − z²α| < ε. An analogous result for quadratic forms in five variables was proved +by Davenport and Heilbronn (1946). The full result was proved by Margulis (1989) as a consequence +of the Oppenheim conjecture. + +## References + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. **6** +(1961), 221–254. + +[DaHe46] Davenport, H., Heilbronn, H., _On indefinite quadratic forms in five variables_. +J. London Math. Soc. (1946), 185–193. + +[Ma89] Margulis, G. A., _Discrete subgroups and ergodic theory_. Number theory, trace formulas +and discrete groups (Oslo, 1987) (1989), 377–398. + +*Reference:* [erdosproblems.com/496](https://www.erdosproblems.com/496) +-/ + +namespace Erdos496 + +/-- +Erdős Problem #496 (Oppenheim conjecture, proved by Margulis): +Let $\alpha \in \mathbb{R}$ be irrational and $\varepsilon > 0$. Then there exist positive integers +$x$, $y$, $z$ such that $|x^2 + y^2 - z^2 \alpha| < \varepsilon$. +-/ +@[category research solved, AMS 11] +theorem erdos_496 (α : ℝ) (hα : Irrational α) (ε : ℝ) (hε : ε > 0) : + ∃ x y z : ℕ, 0 < x ∧ 0 < y ∧ 0 < z ∧ + |(x : ℝ) ^ 2 + (y : ℝ) ^ 2 - (z : ℝ) ^ 2 * α| < ε := by + sorry + +end Erdos496 diff --git a/FormalConjectures/ErdosProblems/497.lean b/FormalConjectures/ErdosProblems/497.lean new file mode 100644 index 0000000000..fa7ee73977 --- /dev/null +++ b/FormalConjectures/ErdosProblems/497.lean @@ -0,0 +1,66 @@ +/- +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 497 + +How many antichains are there in the power set of an n-element set? + +*Reference:* [erdosproblems.com/497](https://www.erdosproblems.com/497) + +OEIS: [A000372](https://oeis.org/A000372) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[Kl69] Kleitman, D., _On Dedekind's Problem: The Number of Monotone Boolean Functions_. +Proc. Amer. Math. Soc. 21 (1969), 677–682. +-/ + +open Finset Filter + +namespace Erdos497 + +open Classical in +/-- +The number of antichains in the power set of $\operatorname{Fin} n$ (the Dedekind number $D(n)$). +An antichain is a family $F$ of subsets of $[n]$ such that for all $A, B \in F$, +$A \neq B$ implies $A \not\subset B$. +-/ +noncomputable def dedekindNumber (n : ℕ) : ℕ := + Fintype.card {F : Finset (Finset (Fin n)) // IsAntichain (· ⊆ ·) (F : Set (Finset (Fin n)))} + +/-- +Erdős Problem 497 (Dedekind's Problem, resolved by Kleitman [Kl69]): +How many antichains in $[n]$ are there? That is, how many families of subsets +of $[n]$ are there such that no member is a subset of another? + +Sperner's theorem states that any single antichain has size at most +$\binom{n}{\lfloor n/2 \rfloor}$. Kleitman proved that the total number of antichains in the +power set of $[n]$ is $2^{(1+o(1)) \binom{n}{\lfloor n/2 \rfloor}}$. + +Equivalently, $\log_2(D(n)) / \binom{n}{\lfloor n/2 \rfloor} \to 1$ as $n \to \infty$. +-/ +@[category research solved, AMS 5 6] +theorem erdos_497 : + Tendsto + (fun n : ℕ => Real.log (dedekindNumber n : ℝ) / (Real.log 2 * (n.choose (n / 2) : ℝ))) + atTop (nhds 1) := by + sorry + +end Erdos497 diff --git a/FormalConjectures/ErdosProblems/498.lean b/FormalConjectures/ErdosProblems/498.lean new file mode 100644 index 0000000000..c61f988934 --- /dev/null +++ b/FormalConjectures/ErdosProblems/498.lean @@ -0,0 +1,71 @@ +/- +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 498 + +*Reference:* [erdosproblems.com/498](https://www.erdosproblems.com/498) + +Given complex numbers $z_1, \ldots, z_n$ with $|z_i| \geq 1$, the number of sign patterns +$\varepsilon \in \{-1,1\}^n$ for which the signed sum $\sum \varepsilon_i z_i$ lands in any unit +disc is at most $\binom{n}{\lfloor n/2 \rfloor}$. + +See also: Problem 395 (reverse Littlewood–Offord problem). + +[Er45] Erdős, P., _On a lemma of Littlewood and Offord_. Bull. Amer. Math. Soc. **51** (1945), +898–902. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. **6** (1961), +221–254. + +[Kl65] Kleitman, D., _On a lemma of Littlewood and Offord on the distributions of linear +combinations of vectors_. Advances in Math. **1** (1965), 155–157. + +[Kl70] Kleitman, D., _On a lemma of Littlewood and Offord on the distribution of certain sums_. +Math. Z. **90** (1970), 251–259. +-/ + +open Finset +open scoped BigOperators + +namespace Erdos498 + +/-- The signed sum of complex numbers $z$ with signs $\varepsilon \in \{-1, 1\}^n$ (encoded as +`Bool`). -/ +noncomputable def signedSum {n : ℕ} (z : Fin n → ℂ) (ε : Fin n → Bool) : ℂ := + ∑ i : Fin n, (if ε i then (1 : ℂ) else (-1 : ℂ)) * z i + +/-- +Erdős Problem 498 (Littlewood–Offord problem, proved by Kleitman [Kl65]): + +Let $z_1, \ldots, z_n \in \mathbb{C}$ with $|z_i| \geq 1$ for all $i$. For any disc of radius $1$ +centered at $w \in \mathbb{C}$, the number of sign patterns $\varepsilon \in \{-1, 1\}^n$ such that +$\varepsilon_1 z_1 + \cdots + \varepsilon_n z_n$ lies in the disc (i.e., +$\|\sum \varepsilon_i z_i - w\| \leq 1$) is at most $\binom{n}{\lfloor n/2 \rfloor}$. + +Erdős [Er45] proved the real case. Kleitman [Kl65] proved the full complex case and later +generalised the result to arbitrary Hilbert spaces [Kl70]. +-/ +@[category research solved, AMS 5] +theorem erdos_498 (n : ℕ) (z : Fin n → ℂ) (w : ℂ) + (hz : ∀ i, 1 ≤ ‖z i‖) : + (Finset.univ.filter (fun ε : Fin n → Bool => + ‖signedSum z ε - w‖ ≤ 1)).card ≤ n.choose (n / 2) := by + sorry + +end Erdos498 diff --git a/FormalConjectures/ErdosProblems/5.lean b/FormalConjectures/ErdosProblems/5.lean new file mode 100644 index 0000000000..2ca0c51c77 --- /dev/null +++ b/FormalConjectures/ErdosProblems/5.lean @@ -0,0 +1,91 @@ +/- +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 5 + +*Reference:* [erdosproblems.com/5](https://www.erdosproblems.com/5) + +This problem concerns the set of limit points of the normalized prime gap sequence +$(p_{n+1} - p_n) / \log n$, where $p_n$ denotes the $n$-th prime. The conjecture, +posed in several papers of Erdős [Er55c, Er57, Er61, Er65b, Er85c, Er90, Er97c], +asserts that this set of limit points equals $[0, \infty]$. + +Related: Erdős Problem 234 (density of normalized prime gaps). +OEIS: [A001223](https://oeis.org/A001223) (prime gaps). + +[Er55c] Erdős, P., _Some problems on number theory_ (1955). + +[Er57] Erdős, P., _Some unsolved problems_ (1957). + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. **6** +(1961), 221–254. + +[Er65b] Erdős, P., _Some recent advances and current problems in number theory_. Lectures on +Modern Mathematics **III** (1965), 196–244. + +[Er85c] Erdős, P., _On some of my problems in number theory I would most like to see solved_. +Number theory (Ootacamund, 1984) (1985), 74–84. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er97c] Erdős, P., _Some of my favorite problems and results_. The mathematics of Paul Erdős, +I (1997). +-/ + +open Filter Nat Real + +namespace Erdos5 + +/-- +The normalized prime gap at index $n$ (0-indexed): +$$\frac{p_{n+1} - p_n}{\log(n+1)}$$ +where $p_n = \texttt{nth Nat.Prime}\; n$ is the $n$-th prime (so $p_0 = 2$, $p_1 = 3$, ...). +We use $n+1$ in the denominator so that $\log$ is evaluated at a positive argument. +-/ +noncomputable def normalizedPrimeGap (n : ℕ) : ℝ := + (primeGap n : ℝ) / Real.log ((n : ℝ) + 1) + +/-- +Let $p_n$ denote the $n$-th prime. Let $S$ be the set of limit points of the sequence +$(p_{n+1} - p_n) / \log n$. +The conjecture [Er55c, Er57, Er61, Er65b, Er85c, Er90, Er97c] asserts $S = [0, \infty]$, +i.e., every value $C \in [0, \infty]$ is attained as a limit along some subsequence. + +Formally (for finite $C$): for every $C \geq 0$ there exists a strictly increasing +sequence of indices $n_1 < n_2 < \cdots$ such that +$$(p_{n_i+1} - p_{n_i}) / \log n_i \to C \quad \text{as } i \to \infty.$$ + +Known results toward this conjecture: +- $\infty \in S$ (Westzynthius 1931): prime gaps are unbounded relative to $\log n$. +- $0 \in S$ (Goldston–Pintz–Yıldırım 2009): normalized gaps can be arbitrarily small. +- $S$ has positive Lebesgue measure (Erdős 1955; Ricci 1956). +- $S$ contains arbitrarily large finite numbers (Hildebrand–Maier 1988). +- $[0, c] \subseteq S$ for some $c > 0$ (Pintz 2016). +- At least $12.5\%$ of $[0, \infty)$ belongs to $S$ (Banks–Freiberg–Maynard 2016). +- At least $1/3$ of $[0, \infty)$ belongs to $S$, and $S$ has bounded gaps (Merikoski 2020). +-/ +@[category research open, AMS 11] +theorem erdos_5 : + ∀ C : ℝ, 0 ≤ C → + ∃ f : ℕ → ℕ, StrictMono f ∧ + Tendsto (fun i => normalizedPrimeGap (f i)) atTop (nhds C) := by + sorry + +end Erdos5 diff --git a/FormalConjectures/ErdosProblems/50.lean b/FormalConjectures/ErdosProblems/50.lean new file mode 100644 index 0000000000..355e139416 --- /dev/null +++ b/FormalConjectures/ErdosProblems/50.lean @@ -0,0 +1,55 @@ +/- +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 50 + +*Reference:* [erdosproblems.com/50](https://www.erdosproblems.com/50) + +The distribution function $f(c) = d(\{n : \varphi(n) < cn\})$ is purely singular: there is +no $x$ at which $f'(x)$ exists and is positive. Proved by Erdős. +See also [Er95]. + +[Er95] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and geometry_. +Resenhas **1** (1995), 165–186. +-/ + +open Nat Finset Filter Set Classical + +namespace Erdos50 + +/-- Count of natural numbers $n$ in $\{1, \ldots, N\}$ with $\varphi(n) < c \cdot n$. -/ +noncomputable def totientDensityCount (c : ℝ) (N : ℕ) : ℕ := + ((Finset.range (N + 1)).filter (fun n => 0 < n ∧ (Nat.totient n : ℝ) < c * ↑n)).card + +/-- +Schoenberg proved that for every $c \in [0,1]$ the natural density of +$\{n \in \mathbb{N} : \varphi(n) < cn\}$ exists. Let this density be denoted by $f(c)$. +Is it true that there are no $x$ such that $f'(x)$ exists and is positive? + +Erdős proved the distribution function $f$ is purely singular. +-/ +@[category research solved, AMS 11 26] +theorem erdos_50 : answer(True) ↔ + ∀ f : ℝ → ℝ, + (∀ c ∈ Icc (0 : ℝ) 1, + Tendsto (fun N : ℕ => (totientDensityCount c N : ℝ) / ↑N) atTop (nhds (f c))) → + ∀ x ∈ Icc (0 : ℝ) 1, ∀ d : ℝ, HasDerivAt f d x → d ≤ 0 := by + sorry + +end Erdos50 diff --git a/FormalConjectures/ErdosProblems/500.lean b/FormalConjectures/ErdosProblems/500.lean new file mode 100644 index 0000000000..673f833cf5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/500.lean @@ -0,0 +1,92 @@ +/- +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 500 + +*Reference:* [erdosproblems.com/500](https://www.erdosproblems.com/500) + +What is $\mathrm{ex}_3(n, K_4^3)$? That is, the largest number of $3$-edges which can be placed +on $n$ vertices so that there exists no $K_4^3$, a set of $4$ vertices which is covered +by all $4$ possible $3$-edges. + +A problem of Turán. Turán observed that dividing the vertices into three equal +parts $X_1, X_2, X_3$, and taking the edges to be those triples that either have +exactly one vertex in each part or two vertices in $X_i$ and one vertex in $X_{i+1}$ +(where $X_4 = X_1$) shows that +$$ + \mathrm{ex}_3(n, K_4^3) \geq (5/9 + o(1)) \binom{n}{3}. +$$ +This is probably the truth. The current best upper bound is +$$ + \mathrm{ex}_3(n, K_4^3) \leq 0.5611666 \binom{n}{3}, +$$ +due to Razborov [Ra10]. + +See also: Problem 712 (general case for r-uniform, k-clique). + +OEIS: [A140462](https://oeis.org/A140462) + +[Er61] Erdős, P., _Problems in combinatorics_ (1961). + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[Er74c] Erdős, P., _Problems and results on combinatorial number theory III_ (1974). + +[Er81] Erdős, P., _Combinatorial problems and results_ (1981). + +[Ra10] Razborov, A., _On 3-hypergraphs with forbidden 4-vertex configurations_. +SIAM J. Discrete Math. (2010), 946–963. +-/ + +open Finset Filter + +namespace Erdos500 + +/-- A $3$-uniform hypergraph on `Fin n` is $K_4^3$-free if every edge has exactly $3$ +vertices and no $4$ vertices span all $4$ possible $3$-element subsets. -/ +def IsK43Free {n : ℕ} (H : Finset (Finset (Fin n))) : Prop := + (∀ e ∈ H, e.card = 3) ∧ + ∀ S : Finset (Fin n), S.card = 4 → ¬(S.powersetCard 3 ⊆ H) + +/-- The $3$-uniform Turán number $\mathrm{ex}_3(n, K_4^3)$: the maximum number of $3$-element +subsets of an $n$-element set such that no $4$ vertices span all $4$ triples. -/ +noncomputable def ex3K43 (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : Finset (Finset (Fin n)), IsK43Free H ∧ H.card = m} + +/-- +Erdős Problem 500 — Turán's Hypergraph Conjecture [Er61][Er71][Er74c][Er81]: + +The $3$-uniform Turán density for $K_4^3$ is exactly $5/9$. Equivalently, +$$ + \mathrm{ex}_3(n, K_4^3) / \binom{n}{3} \to 5/9 \text{ as } n \to \infty. +$$ +Turán conjectured that the lower bound construction (partition into $3$ equal parts, +take triples with one vertex in each part or two in $X_i$ and one in $X_{i+1}$) is +optimal. This remains open. The best known upper bound is $\leq 0.5611666 \binom{n}{3}$ +due to Razborov [Ra10]. +-/ +@[category research open, AMS 5] +theorem erdos_500 : + Tendsto + (fun n : ℕ => (ex3K43 n : ℝ) / (Nat.choose n 3 : ℝ)) + atTop (nhds answer(sorry)) := by + sorry + +end Erdos500 diff --git a/FormalConjectures/ErdosProblems/501.lean b/FormalConjectures/ErdosProblems/501.lean new file mode 100644 index 0000000000..b32501f8c7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/501.lean @@ -0,0 +1,113 @@ +/- +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 501 + +*Reference:* [erdosproblems.com/501](https://www.erdosproblems.com/501) + +For every $x \in \mathbb{R}$, let $A_x \subset \mathbb{R}$ be a bounded set with outer measure +$< 1$. Must there exist an infinite independent set, that is, some infinite $X \subseteq \mathbb{R}$ +such that $x \notin A_y$ for all $x \neq y \in X$? + +If the sets $A_x$ are closed and have measure $< 1$, then must there exist an +independent set of size $3$? + +Erdős and Hajnal [ErHa60] proved the existence of arbitrarily large finite independent +sets (under the assumptions in the first problem). Gladysz [Gl62] proved the existence +of an independent set of size 2 under the closed hypothesis. Hechler [He72] showed the +answer to the first question is no, assuming the continuum hypothesis. Newelski, +Pawlikowski, and Seredyński [NPS87] proved that if all the $A_x$ are closed with +measure $< 1$ then there is an infinite independent set. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +6 (1961), 221–254. + +[ErHa60] Erdős, P. and Hajnal, A., _Some remarks on set theory. VIII_. +Michigan Math. J. 7 (1960), 187–191. + +[Gl62] Gladysz, S., _Bemerkungen über die Unabhängigkeit der Punkte in Bezug auf +mengenwertige Funktionen_. Acta Math. Acad. Sci. Hungar. 13 (1962), 199–201. + +[He72] Hechler, S. H., _On two problems in combinatorial set theory_. Bull. Acad. +Polon. Sci. Sér. Sci. Math. Astronom. Phys. 20 (1972), 429–431. + +[NPS87] Newelski, L., Pawlikowski, J., and Seredyński, W., _Infinite free set for +small measure set mappings_. Proc. Amer. Math. Soc. 100 (1987), 335–339. +-/ + +open MeasureTheory Set + +-- In Mathlib, `volume s` computes the outer measure for any set `s`, +-- whether or not `s` is measurable. + +namespace Erdos501 + +/-- A set $X$ is independent with respect to a family of sets $A$ if for all +distinct $x, y \in X$, we have $x \notin A(y)$. -/ +def IndependentFamily (A : ℝ → Set ℝ) (X : Set ℝ) : Prop := + ∀ x ∈ X, ∀ y ∈ X, x ≠ y → x ∉ A y + +/-- +Erdős Problem 501 [Er61][ErHa60]: If each $A_x$ is bounded with outer measure $< 1$, must +there exist an infinite independent set? + +Erdős and Hajnal [ErHa60] proved the existence of arbitrarily large finite independent +sets. Hechler [He72] showed the answer is no assuming the continuum hypothesis. The full +ZFC status remains open. +-/ +@[category research open, AMS 3 28] +theorem erdos_501 : + answer(sorry) ↔ + ∀ A : ℝ → Set ℝ, + (∀ x : ℝ, Bornology.IsBounded (A x) ∧ volume (A x) < 1) → + ∃ X : Set ℝ, X.Infinite ∧ IndependentFamily A X := by + sorry + +/-- +Erdős Problem 501, closed variant [Er61][ErHa60]: If each $A_x$ is closed with +measure $< 1$, must there exist an independent set of size $3$? + +Newelski, Pawlikowski, and Seredyński [NPS87] proved that under these hypotheses there +is in fact an infinite independent set (see `erdos_501.variants.closed_measure_infinite`). +-/ +@[category research solved, AMS 3 28] +theorem erdos_501.variants.closed_measure : + answer(True) ↔ + ∀ A : ℝ → Set ℝ, + (∀ x : ℝ, IsClosed (A x) ∧ volume (A x) < 1) → + ∃ x y z : ℝ, x ≠ y ∧ y ≠ z ∧ x ≠ z ∧ + IndependentFamily A {x, y, z} := by + sorry + +/-- +Erdős Problem 501, closed variant — infinite independent set [NPS87]: If each $A_x$ is +closed with measure $< 1$, then there exists an infinite independent set. + +This is the full strength of the result of Newelski, Pawlikowski, and Seredyński [NPS87], +which is strictly stronger than the size-3 statement in `erdos_501.variants.closed_measure`. +-/ +@[category research solved, AMS 3 28] +theorem erdos_501.variants.closed_measure_infinite : + answer(True) ↔ + ∀ A : ℝ → Set ℝ, + (∀ x : ℝ, IsClosed (A x) ∧ volume (A x) < 1) → + ∃ X : Set ℝ, X.Infinite ∧ IndependentFamily A X := by + sorry + +end Erdos501 diff --git a/FormalConjectures/ErdosProblems/502.lean b/FormalConjectures/ErdosProblems/502.lean new file mode 100644 index 0000000000..45406cfed2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/502.lean @@ -0,0 +1,81 @@ +/- +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 502 + +*Reference:* [erdosproblems.com/502](https://www.erdosproblems.com/502) + +Erdős asked (after Coxeter): what is the maximum size of a subset of $\mathbb{R}^n$ +with only two distinct pairwise distances? Bannai, Bannai, and Stanton proved an +upper bound of $\binom{n+2}{2}$. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. **6** +(1961), 221–254. (p. 244) + +[BBS83] Bannai, E., Bannai, E., and Stanton, D., _An upper bound for the cardinality of an +$s$-distance subset in real Euclidean space. II_. Combinatorica (1983), 147–152. + +[PePo21] Petrov, F. and Pohoata, C., _A remark on sets with few distances in $\mathbb{R}^d$_. +Proc. Amer. Math. Soc. (2021), 569–571. + +See also Problem 1089 for the general $s$-distance version of this question. + +OEIS: [A027627](https://oeis.org/A027627) +-/ + +namespace Erdos502 + +/-- +A finite set of points in $\mathbb{R}^n$ is a two-distance set if there are exactly +two distinct positive real numbers that occur as distances between pairs +of distinct points. (Positivity is automatic since `dist x y > 0` for `x ≠ y` +in Euclidean space.) +-/ +noncomputable def IsTwoDistanceSet {n : ℕ} (A : Finset (EuclideanSpace ℝ (Fin n))) : Prop := + Set.ncard {d : ℝ | ∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ d = dist x y} = 2 + +/-- +Erdős Problem 502 — Bannai–Bannai–Stanton Upper Bound [Er61] [BBS83]: + +Any two-distance set $A \subseteq \mathbb{R}^n$ has at most $\binom{n+2}{2}$ elements. +A simpler proof was given by Petrov and Pohoata [PePo21]. The best known lower bound +is $\binom{n+1}{2}$ via a construction of Alweiss. +-/ +@[category research solved, AMS 5 52] +theorem erdos_502 + (n : ℕ) (A : Finset (EuclideanSpace ℝ (Fin n))) + (hA : IsTwoDistanceSet A) : + A.card ≤ Nat.choose (n + 2) 2 := by + sorry + +/-- +Erdős Problem 502 — Lower Bound (Alweiss construction): + +There exists a two-distance set in $\mathbb{R}^n$ of size $\binom{n+1}{2}$. +This is the best known lower bound, complementing the Bannai–Bannai–Stanton +upper bound of $\binom{n+2}{2}$. See also Problem 503. +-/ +@[category research solved, AMS 5 52] +theorem erdos_502_lower + (n : ℕ) : + ∃ A : Finset (EuclideanSpace ℝ (Fin n)), + IsTwoDistanceSet A ∧ A.card = Nat.choose (n + 1) 2 := by + sorry + +end Erdos502 diff --git a/FormalConjectures/ErdosProblems/504.lean b/FormalConjectures/ErdosProblems/504.lean new file mode 100644 index 0000000000..92839e3b4a --- /dev/null +++ b/FormalConjectures/ErdosProblems/504.lean @@ -0,0 +1,78 @@ +/- +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 504 + +Determine the maximum guaranteed angle α_N for N-point planar sets: the supremum of all +angles α such that every set of N points in the plane contains three distinct points forming +an angle of at least α. + +*References:* +- [erdosproblems.com/504](https://www.erdosproblems.com/504) +- [Sz41] Szekeres, Gy., _On an extremum problem in the plane_. American Journal of + Mathematics **63** (1941), 208–210. +- [ErSz60] Erdős, P., Szekeres, G., _On some extremum problems in elementary geometry_. + Annales Universitatis Scientiarum Budapestinensis de Rolando Eötvös Nominatae, Sectio + Mathematica **3** (1960/61), 53–62. +- [Se92] Sendov, Bl., _On a conjecture of P. Erdős and G. Szekeres_. Comptes Rendus de + l'Académie Bulgare des Sciences **45** (1992), 17–20. +- [Se93] Sendov, Bl., _Angles in a plane configuration of points_. Comptes Rendus de + l'Académie Bulgare des Sciences **46** (1993), 27–30. +-/ + +open scoped EuclideanGeometry + +namespace Erdos504 + +/-- +$\alpha_N$: the maximum guaranteed angle for $N$-point planar sets. +The supremum of all $\alpha \in [0, \pi]$ such that every set of $N$ points in $\mathbb{R}^2$ +contains three distinct points $x$, $y$, $z$ with angle at $y$ at least $\alpha$. +-/ +noncomputable def maxGuaranteedAngle (N : ℕ) : ℝ := + sSup {α : ℝ | 0 ≤ α ∧ α ≤ Real.pi ∧ + ∀ (A : Finset (EuclideanSpace ℝ (Fin 2))), + A.card = N → + ∃ x ∈ A, ∃ y ∈ A, ∃ z ∈ A, + x ≠ y ∧ y ≠ z ∧ x ≠ z ∧ + ∠ x y z ≥ α} + +/-- +Erdős Problem 504 (Blumenthal's problem, solved by Sendov): + +Let $\alpha_N$ be the supremum of all $0 \leq \alpha \leq \pi$ such that in every set +$A \subset \mathbb{R}^2$ of size $N$ there exist three distinct points $x, y, z \in A$ +such that the angle at $y$ (between rays $yx$ and $yz$) is at least $\alpha$. +Determine $\alpha_N$. + +Sendov [Se93] proved that for $n \geq 3$ and $2^{n-1} < N \leq 2^n$: +$$\alpha_N = \pi(1 - 1/n) \quad \text{when } N > 2^{n-1} + 2^{n-3}$$ +$$\alpha_N = \pi(1 - 1/(2n-1)) \quad \text{when } N \leq 2^{n-1} + 2^{n-3}$$ +-/ +@[category research solved, AMS 52] +theorem erdos_504 : + ∀ (N : ℕ), 4 < N → + ∀ (n : ℕ), 3 ≤ n → 2 ^ (n - 1) < N → N ≤ 2 ^ n → + maxGuaranteedAngle N = + answer(if 2 ^ (n - 1) + 2 ^ (n - 3) < N + then Real.pi * (1 - 1 / (n : ℝ)) + else Real.pi * (1 - 1 / (2 * (n : ℝ) - 1))) := by + sorry + +end Erdos504 diff --git a/FormalConjectures/ErdosProblems/505.lean b/FormalConjectures/ErdosProblems/505.lean new file mode 100644 index 0000000000..424d3eabeb --- /dev/null +++ b/FormalConjectures/ErdosProblems/505.lean @@ -0,0 +1,68 @@ +/- +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 505 + +*Reference:* [erdosproblems.com/505](https://www.erdosproblems.com/505) + +Borsuk's conjecture. Originally conjectured by Borsuk in 1933. Disproved by Kahn and Kalai +[KaKa93] for $n > 2014$. The current smallest known counterexample dimension is $n = 64$, due to +Brouwer and Jenrich [BrJe14]. Eggleston [Eg55] proved the conjecture for $n = 3$. Schramm [Sc88] +proved the upper bound $\alpha(n) \leq ((3/2)^{1/2} + o(1))^n$ on the minimum number of pieces +needed. Erdős [Er81b, p.28] suspected the conjecture was false for sufficiently high dimensions. + +[Er46b] Erdős, P., _On sets of distances of $n$ points_. Amer. Math. Monthly (1946), 248-250. + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[Eg55] Eggleston, H. G., _Covering a three-dimensional set with sets of smaller diameter_. +J. London Math. Soc. (1955), 11-24. + +[KaKa93] Kahn, J., Kalai, G., _A counterexample to Borsuk's conjecture_. Bull. Amer. Math. Soc. +(N.S.) (1993), 60-62. + +[BrJe14] Brouwer, A. E., Jenrich, T., _A 64-dimensional counterexample to Borsuk's conjecture_. +Electron. J. Combin. (2014), Paper 4.29, 3. + +[Sc88] Schramm, O., _Illuminating sets of constant width_. Mathematika (1988), 180-189. +-/ + +open Metric Set + +namespace Erdos505 + +/-- +Borsuk's conjecture: +Is every set of diameter $1$ in $\mathbb{R}^n$ the union of at most $n+1$ sets of diameter +$< 1$? + +This is trivially true for $n=1$ and easy for $n=2$. Eggleston proved it for $n=3$. In 1981, +Erdős wrote that he suspected it was false for sufficiently high dimensions. Indeed, Kahn and +Kalai disproved it for $n > 2014$. The current smallest known counterexample dimension is +$n = 64$, due to Brouwer and Jenrich. +-/ +@[category research solved, AMS 52] +theorem erdos_505 : answer(False) ↔ + ∀ n : ℕ, ∀ S : Set (EuclideanSpace ℝ (Fin n)), + Metric.diam S = 1 → + ∃ F : Fin (n + 1) → Set (EuclideanSpace ℝ (Fin n)), + S = ⋃ i, F i ∧ ∀ i, Metric.diam (F i) < 1 := by + sorry + +end Erdos505 diff --git a/FormalConjectures/ErdosProblems/506.lean b/FormalConjectures/ErdosProblems/506.lean new file mode 100644 index 0000000000..51cc676793 --- /dev/null +++ b/FormalConjectures/ErdosProblems/506.lean @@ -0,0 +1,81 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 506 + +*Reference:* [erdosproblems.com/506](https://www.erdosproblems.com/506) + +What is the minimum number of circles determined by $n$ points in $\mathbb{R}^2$, +not all on a circle and not all on a line? + +Related problems: [#104](https://www.erdosproblems.com/104), +[#831](https://www.erdosproblems.com/831). + +[Er61] Erdős, P., _Some unsolved problems_, 1961, p. 245. + +[El67] Elliott, P. D. T. A., _On the number of circles determined by $n$ points_, +Acta Mathematica Academiae Scientiarum Hungaricae (1967), 181–188. + +[PuSm] Purdy, G. and Smith, J. W., _Lines, circles, and the number of determined circles_. + +[BaBa94] Bálintová, A. and Bálint, V., _On the number of circles determined by $n$ points +in the Euclidean plane_, Acta Mathematica Hungarica (1994), 283–289. +-/ + +open Finset EuclideanGeometry + +namespace Erdos506 + +/-- All points in $S$ lie on a common circle with positive radius. -/ +noncomputable def AllOnCircle (S : Finset ℝ²) : Prop := + ∃ c : ℝ², ∃ r : ℝ, 0 < r ∧ ∀ p ∈ S, dist p c = r + +/-- The number of distinct circles determined by $S$. A circle is identified by its +center and positive radius. It is "determined" by $S$ if at least $3$ points of $S$ +lie on it. -/ +noncomputable def numDeterminedCircles (S : Finset ℝ²) : ℕ := + Set.ncard {p : ℝ² × ℝ | + 0 < p.2 ∧ 3 ≤ Set.ncard {q ∈ (↑S : Set ℝ²) | dist q p.1 = p.2}} + +/-- The minimum number of circles determined by any configuration of $n$ points in +$\mathbb{R}^2$ that are neither all on a circle nor all collinear. Returns $0$ when +no such configuration exists. -/ +noncomputable def minDeterminedCircles (n : ℕ) : ℕ := + sInf (numDeterminedCircles '' {S : Finset ℝ² | + S.card = n ∧ ¬AllOnCircle S ∧ ¬Collinear ℝ (↑S : Set ℝ²)}) + +/-- +Erdős Problem 506 [Er61, p. 245]: + +What is the minimum number of circles determined by $n$ points in $\mathbb{R}^2$, not all on a +circle (and not all on a line)? + +Elliott [El67] proved that for $n > 393$ points not all on a circle or a line, the +points determine at least $\binom{n-1}{2}$ distinct circles. Purdy and Smith [PuSm] +corrected this to the sharper bound $\binom{n-1}{2} + 1 - \lfloor(n-1)/2\rfloor$, which is best +possible (witnessed by $n-1$ points on a circle and one point off it). +-/ +@[category research solved, AMS 52] +theorem erdos_506 : ∀ n : ℕ, 393 < n → + minDeterminedCircles n = + answer(Nat.choose (n - 1) 2 + 1 - (n - 1) / 2) := by + sorry + +end Erdos506 diff --git a/FormalConjectures/ErdosProblems/511.lean b/FormalConjectures/ErdosProblems/511.lean new file mode 100644 index 0000000000..502e0eb323 --- /dev/null +++ b/FormalConjectures/ErdosProblems/511.lean @@ -0,0 +1,91 @@ +/- +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 511 + +*Reference:* [erdosproblems.com/511](https://www.erdosproblems.com/511) + +Let $f(z) \in \mathbb{C}[z]$ be a monic polynomial of degree $n$. Is it true that, +for every $c > 1$, the set $\{z \in \mathbb{C} : |f(z)| < 1\}$ has at most $O_c(1)$ +many connected components of diameter $> c$ (where the implied constant is +independent of $n$)? + +Disproved by Pommerenke [Po61], who showed that for any $0 < d < 4$ and $k \geq 1$, +there exist monic polynomials $f \in \mathbb{C}[x]$ such that +$\{z : |f(z)| \leq 1\}$ has at least $k$ connected components of diameter $\geq d$. +Huang [Hu25] independently obtained the same result. + +Pólya [Po28] proved that no connected component of $\{z : |f(z)| \leq 1\}$ can have +diameter exceeding $4$, so the conjecture is vacuously true for $c \geq 4$. + +[EHP58] Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, +J. Analyse Math. 6 (1958), 125–148. + +[Er61] Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. +6 (1961), 221–254. + +[Ha74] Hayman, W. K., *Research problems in function theory: new problems*, (1974), +155–180. + +[Po28] Pólya, G., *Beitrag zur Verallgemeinerung des Verzerrungssatzes auf mehrfach +zusammenhängende Gebiete*, S.-B. Preuss. Akad. Wiss. (1928), 228–232, 280–282. + +[Po61] Pommerenke, Ch., *On metric properties of complex polynomials*, Michigan Math. J. +8 (1961), 97–115. + +[Hu25] Huang, L., *Many lemniscates with large diameter*, arXiv:2509.11597, 2025. +-/ + +open Polynomial Set + +namespace Erdos511 + +/-- Erdős Problem 511: Is it true that for every $c > 1$, there exists a bound $M$ +(independent of the degree) such that for any monic polynomial $f \in \mathbb{C}[z]$, +the sublevel set $\{z \in \mathbb{C} : \|f(z)\| < 1\}$ has at most $M$ connected +components of diameter $> c$? + +Disproved by Pommerenke. -/ +@[category research solved, AMS 30] +theorem erdos_511 : answer(False) ↔ + ∀ c : ℝ, c > 1 → + ∃ M : ℕ, ∀ (f : Polynomial ℂ), + f.Monic → + ∀ (k : ℕ) (C : Fin k → Set ℂ), + (∀ i, (C i).Nonempty) → + (∀ i, C i ⊆ {z : ℂ | ‖Polynomial.eval z f‖ < 1}) → + (∀ i, IsPreconnected (C i)) → + (∀ i, Metric.diam (C i) > c) → + (∀ i j, i ≠ j → Disjoint (C i) (C j)) → + k ≤ M := by + sorry + +/-- Pólya's theorem [Po28]: Every connected component of the sublevel set +$\{z \in \mathbb{C} : \|f(z)\| \leq 1\}$ for a monic polynomial $f$ has diameter at most $4$. +This provides the complementary upper bound that explains why Problem 511 concerns $c > 1$: +for $c \geq 4$, the conjecture is vacuously true. -/ +@[category research solved, AMS 30] +theorem erdos_511_polya_upper : + ∀ (f : Polynomial ℂ), f.Monic → + ∀ (S : Set ℂ), S ⊆ {z : ℂ | ‖Polynomial.eval z f‖ ≤ 1} → + IsPreconnected S → + Metric.diam S ≤ 4 := by + sorry + +end Erdos511 diff --git a/FormalConjectures/ErdosProblems/512.lean b/FormalConjectures/ErdosProblems/512.lean new file mode 100644 index 0000000000..d97b84e361 --- /dev/null +++ b/FormalConjectures/ErdosProblems/512.lean @@ -0,0 +1,56 @@ +/- +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 512 + +*Reference:* [erdosproblems.com/512](https://www.erdosproblems.com/512) + +This is Littlewood's conjecture, proved independently by Konyagin [Ko81] +and McGehee, Pigno, and Smith [MPS81]. + +[Ko81] Konyagin, S.V., _On a problem of Littlewood_, Izv. Akad. Nauk SSSR Ser. Mat. +45 (1981), 243–265. + +[MPS81] McGehee, O.C., Pigno, L., and Smith, B., _Hardy's inequality and the $L^1$ +norm of exponential sums_, Ann. of Math. 113 (1981), 613–618. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +6 (1961), 221–254. +-/ + +open Finset BigOperators MeasureTheory + +namespace Erdos512 + +/-- The exponential sum $\sum_{n \in A} e(n\theta)$ where $e(x) = e^{2\pi ix}$. -/ +noncomputable def expSum512 (A : Finset ℤ) (θ : ℝ) : ℂ := + ∑ n ∈ A, Complex.exp (2 * ↑Real.pi * ↑n * ↑θ * Complex.I) + +/-- Erdős Problem 512 (Littlewood's conjecture [Ko81] [MPS81]): There exists an absolute +constant $C > 0$ such that for every finite set $A \subset \mathbb{Z}$ with $|A| \geq 2$, +$$\int_0^1 \left| \sum_{n \in A} e(n\theta) \right| d\theta \geq C \cdot \log |A|.$$ -/ +@[category research solved, AMS 42] +theorem erdos_512 : + ∃ C : ℝ, 0 < C ∧ + ∀ A : Finset ℤ, 2 ≤ A.card → + C * Real.log (A.card : ℝ) ≤ + ∫ θ in (0 : ℝ)..1, ‖expSum512 A θ‖ := by + sorry + +end Erdos512 diff --git a/FormalConjectures/ErdosProblems/514.lean b/FormalConjectures/ErdosProblems/514.lean new file mode 100644 index 0000000000..73dfa98a98 --- /dev/null +++ b/FormalConjectures/ErdosProblems/514.lean @@ -0,0 +1,88 @@ +/- +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 Mathlib.Analysis.BoundedVariation + +/-! +# Erdős Problem 514 + +Does every entire transcendental function admit a continuous path going to infinity along which +the function grows faster than any polynomial? A related question asks whether the growth rate +along such a path can be estimated in terms of the maximum modulus. + +*Reference:* [erdosproblems.com/514](https://www.erdosproblems.com/514) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +p. 249. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. +-/ + +open Complex Filter Topology Set + +namespace Erdos514 + +/-- The maximum modulus of $f$ on the circle of radius $r$: +$M(r) = \sup \{ \|f(z)\| \mid \|z\| = r \}$. -/ +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} + +/-- Erdős Problem 514 (proved by Boas, unpublished): +For every entire transcendental function $f$, there exists a continuous path $\gamma$ +going to infinity such that $|f(\gamma(t))/\gamma(t)^n| \to \infty$ for every $n$. -/ +@[category research solved, AMS 30] +theorem erdos_514 : + ∀ f : ℂ → ℂ, Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∃ γ : ℝ → ℂ, Continuous γ ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + ∀ n : ℕ, Tendsto (fun t => ‖f (γ t)‖ / ‖γ t‖ ^ n) atTop atTop := by + sorry + +/-- Erdős Problem 514, growth rate variant (open): +For every entire transcendental function $f$ and every $\varepsilon \in (0, 1)$, does there exist a +continuous path $\gamma$ going to infinity along which $|f(z)| \geq M(|z|)^\varepsilon$? -/ +@[category research open, AMS 30] +theorem erdos_514.variants.max_modulus_growth : + answer(sorry) ↔ + ∀ f : ℂ → ℂ, Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∀ ε : ℝ, 0 < ε → ε < 1 → + ∃ γ : ℝ → ℂ, Continuous γ ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + ∀ᶠ t in atTop, (maxModulus f ‖γ t‖) ^ ε ≤ ‖f (γ t)‖ := by + sorry + +/-- Erdős Problem 514, path length variant (open): +Can the length of a path $\gamma$ to infinity (along which an entire transcendental function +grows faster than any polynomial) be estimated in terms of the maximum modulus +$M(r) = \sup_{|z|=r} |f(z)|$? More precisely, does there exist a function $g$ such that +the arc length of $\gamma$ restricted to the disk of radius $R$ is at most $g(M(R))$? -/ +@[category research open, AMS 30] +theorem erdos_514.variants.path_length : + answer(sorry) ↔ + ∀ f : ℂ → ℂ, Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∃ γ : ℝ → ℂ, Continuous γ ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + (∀ n : ℕ, Tendsto (fun t => ‖f (γ t)‖ / ‖γ t‖ ^ n) atTop atTop) ∧ + ∃ g : ℝ → ℝ, ∀ R : ℝ, 0 < R → + eVariationOn γ {t | ‖γ t‖ ≤ R} ≤ ENNReal.ofReal (g (maxModulus f R)) := by + sorry + +end Erdos514 diff --git a/FormalConjectures/ErdosProblems/515.lean b/FormalConjectures/ErdosProblems/515.lean new file mode 100644 index 0000000000..999b26998d --- /dev/null +++ b/FormalConjectures/ErdosProblems/515.lean @@ -0,0 +1,85 @@ +/- +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 515 + +*Reference:* [erdosproblems.com/515](https://www.erdosproblems.com/515) + +Let $f(z)$ be an entire function, not a polynomial. Does there exist a locally +rectifiable path $C$ tending to infinity such that, for every $\lambda > 0$, the integral +$\int_C |f(z)|^{-\lambda} \, |dz|$ is finite? + +Huber [Hu57] proved the weaker result that for *each* $\lambda > 0$ there exists a +path $C_\lambda$ with finite integral, but the path may depend on $\lambda$. The full +result — a *single* path that works for all $\lambda > 0$ simultaneously — was proved +in the affirmative. The case when $f$ has finite order was proved by Zhang [Zh77]. +The general case was proved by Lewis, Rossi, and Weitsman [LRW84], who in fact +proved this with $|f|$ replaced by $e^u$ where $u$ is any subharmonic function. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +p. 249. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. + +[Hu57] Huber, A., _On subharmonic functions and differential geometry in the large_. Comment. +Math. Helv. 32 (1957), 13–72. + +[Zh77] Zhang, G., _Asymptotic values of entire and meromorphic functions_. Kexue Tongbao +(1977), 480, 486. + +[LRW84] Lewis, J., Rossi, J. and Weitsman, A., _On the growth of subharmonic +functions along paths_. Ark. Mat. 22 (1984), 109–119. +-/ + +open MeasureTheory Filter Set + +namespace Erdos515 + +/-- +Erdős Problem 515: For any entire function $f$ that is not a polynomial, there +exists a locally rectifiable path $\gamma$ tending to infinity such that for every +$\lambda > 0$, the line integral $\int_\gamma |f(z)|^{-\lambda} \, |dz|$ is finite. + +The path $\gamma : \mathbb{R} \to \mathbb{C}$ is parametrized on $[0, \infty)$, is continuous +with locally bounded variation (i.e., locally rectifiable), and satisfies +$\|\gamma(t)\| \to \infty$ as $t \to \infty$. The integral +$\int_\gamma |f(z)|^{-\lambda} \, |dz|$ is expressed as +$\int_0^\infty \|f(\gamma(t))\|^{-\lambda} \cdot \|\gamma'(t)\| \, dt$. + +The case when $f$ has finite order was proved by Zhang [Zh77]. The general case +was proved by Lewis, Rossi, and Weitsman [LRW84]. +-/ +@[category research solved, AMS 30] +theorem erdos_515 : answer(True) ↔ + ∀ (f : ℂ → ℂ), + Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∃ (γ : ℝ → ℂ), + Continuous γ ∧ + LocallyBoundedVariationOn γ (Ici 0) ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + ∀ l : ℝ, 0 < l → + IntegrableOn + (fun t => ‖f (γ t)‖ ^ (-l) * ‖deriv γ t‖) + (Ici 0) + volume := by + sorry + +end Erdos515 diff --git a/FormalConjectures/ErdosProblems/518.lean b/FormalConjectures/ErdosProblems/518.lean new file mode 100644 index 0000000000..37e3ec51a5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/518.lean @@ -0,0 +1,68 @@ +/- +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 518 + +*Reference:* [erdosproblems.com/518](https://www.erdosproblems.com/518) + +A problem of Erdős and Gyárfás [ErGy95]. Gerencsér and Gyárfás [GeGy67] +proved that, if the paths do not need to be of the same colour, then two +paths suffice. Erdős and Gyárfás proved that $2\sqrt{n}$ paths suffice and +observed that $\sqrt{n}$ would be best possible. + +Solved in the affirmative by Pokrovskiy, Versteegen, and Williams [PVW24]. + +[ErGy95] Erdős, P., Gyárfás, A., _Vertex covering with monochromatic paths_. +Math. Pannon. (1995), 7-10. + +[GeGy67] Gerencsér, L., Gyárfás, A., _On Ramsey-type problems_. +Ann. Univ. Sci. Budapest. Eötvös Sect. Math. (1967), 167-170. + +[PVW24] Pokrovskiy, A., Versteegen, L., Williams, E., _A proof of a conjecture +of Erdős and Gyárfás on monochromatic path covers_. arXiv:2409.03623 (2024). +-/ + +namespace Erdos518 + +/-- A path is monochromatic of color $b$ under edge coloring $c$ if every + consecutive pair of vertices in the path receives color $b$. A path + of length $\leq 1$ is trivially monochromatic. -/ +def IsMonochromaticPath {α : Type*} (c : α → α → Bool) (b : Bool) (p : List α) : Prop := + p.IsChain (fun u v => c u v = b) + +/-- +Erdős Problem 518 [ErGy95]: + +Is it true that, in any two-colouring of the edges of $K_n$, there exist +at most $\lceil\sqrt{n}\rceil$ vertex-disjoint monochromatic paths, all of +the same colour, which together cover all vertices? + +Solved in the affirmative by Pokrovskiy, Versteegen, and Williams [PVW24]. +-/ +@[category research solved, AMS 5] +theorem erdos_518 : answer(True) ↔ + ∀ (n : ℕ) (c : Fin n → Fin n → Bool), + (∀ i j : Fin n, c i j = c j i) → + ∃ (b : Bool) (paths : List (List (Fin n))), + paths.length ≤ ⌈Real.sqrt (↑n)⌉₊ ∧ + paths.Pairwise List.Disjoint ∧ + (∀ p ∈ paths, p.Nodup ∧ IsMonochromaticPath c b p) ∧ + (∀ v : Fin n, ∃ p ∈ paths, v ∈ p) := by sorry + +end Erdos518 diff --git a/FormalConjectures/ErdosProblems/519.lean b/FormalConjectures/ErdosProblems/519.lean new file mode 100644 index 0000000000..ea73c60c72 --- /dev/null +++ b/FormalConjectures/ErdosProblems/519.lean @@ -0,0 +1,64 @@ +/- +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 519 + +*Reference:* [erdosproblems.com/519](https://www.erdosproblems.com/519) + +A problem of Turán [Er61, p.251] [Er65b, p.213], who proved that the maximum is +$\gg 1/n$. This was solved by Atkinson [At61b], who showed that $c = 1/6$ suffices. +This has been improved by Biró, first to $c = 1/2$ [Bi94], and later to an absolute +constant $c > 1/2$ [Bi00]. + +See also Problem 973 for a related problem on power sums of complex numbers. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Lectures on Modern +Mathematics, Vol. III (1965), 196-244. + +[At61b] Atkinson, F.V., _On sums of powers of complex numbers_. Acta Math. Acad. +Sci. Hungar. 12 (1961), 185-188. + +[Bi94] Biró, A., _On a problem of Turán concerning sums of powers of complex +numbers_. Acta Math. Hungar. 65 (1994), 209-216. + +[Bi00] Biró, A., _An upper estimate in Turán's pure power sum problem_. Indag. +Math. (N.S.) 11 (2000), 499-508. +-/ + +namespace Erdos519 + +/-- +Erdős Problem 519 (Turán's power sum problem) [At61b]: + +There exists an absolute constant $c > 0$ such that for any $n \geq 1$ and any complex +numbers $z_1, \ldots, z_n$ with $z_1 = 1$, +$$\max_{1 \leq k \leq n} \left| \sum_i z_i^k \right| > c.$$ +-/ +@[category research solved, AMS 30] +theorem erdos_519 : answer(True) ↔ + ∃ c : ℝ, 0 < c ∧ + ∀ (n : ℕ) (hn : 0 < n) (z : Fin n → ℂ), + z ⟨0, hn⟩ = 1 → + ∃ k : Fin n, c < ‖∑ i : Fin n, z i ^ (k.val + 1)‖ := by + sorry + +end Erdos519 diff --git a/FormalConjectures/ErdosProblems/52.lean b/FormalConjectures/ErdosProblems/52.lean new file mode 100644 index 0000000000..ade0b87910 --- /dev/null +++ b/FormalConjectures/ErdosProblems/52.lean @@ -0,0 +1,59 @@ +/- +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 52 + +*Reference:* [erdosproblems.com/52](https://www.erdosproblems.com/52) + +The Erdős–Szemerédi sum-product conjecture [ErSz83]: for every $\varepsilon > 0$ there exists +$c > 0$ such that $\max(|A+A|, |A \cdot A|) \geq c \cdot |A|^{2-\varepsilon}$ for every finite +set $A$ of integers. The best known bound is due to Bloom [Bl25]. + +[ErSz83] Erdős, P. and Szemerédi, E., _On sums and products of integers_. +Studies in pure mathematics, Birkhäuser, Basel (1983), 213–218. + +[Bl25] Bloom, T. F., _Control and its applications in additive combinatorics_. +arXiv:2501.09470 (2025). +-/ + +open Finset Real + +open scoped Pointwise + +namespace Erdos52 + +/-- +**Erdős Problem #52** (The Sum-Product Conjecture): + +For every $\epsilon > 0$, there exists $c > 0$ such that for every finite set +$A$ of integers with $|A| \geq 2$, +$$\max(|A + A|, |A \cdot A|) \geq c \cdot |A|^{2 - \epsilon}.$$ + +A problem of Erdős and Szemerédi [ErSz83]. The current best lower bound is +$\max(|A+A|, |AA|) \gg |A|^{1270/951 - o(1)}$ due to Bloom [Bl25]. +-/ +@[category research open, AMS 5 11] +theorem erdos_52 : + ∀ ε : ℝ, ε > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + max ((A + A).card : ℝ) ((A * A).card : ℝ) ≥ c * (A.card : ℝ) ^ (2 - ε) := by + sorry + +end Erdos52 diff --git a/FormalConjectures/ErdosProblems/521.lean b/FormalConjectures/ErdosProblems/521.lean new file mode 100644 index 0000000000..90f5384c9e --- /dev/null +++ b/FormalConjectures/ErdosProblems/521.lean @@ -0,0 +1,154 @@ +/- +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 521 + +Let $(\varepsilon_k)_{k \geq 0}$ be independently uniformly chosen from $\{-1, 1\}$, +and let $R_n$ count the number of real roots of $f_n(z) = \sum_{k=0}^{n} \varepsilon_k z^k$. +Is it true that, almost surely, $\lim_{n \to \infty} R_n / \log n = 2/\pi$? + +Erdős and Offord [EO56] showed that the expected number of real roots is +$(2/\pi + o(1)) \log n$. This conjecture, posed by Erdős [Er61, p.252], asks whether +the convergence holds almost surely. Do [Do24] proved the partial result that for +roots restricted to $[-1, 1]$, the limit $R_n[-1,1] / \log n \to 1/\pi$ holds +almost surely. + +Note: Erdős's original formulation [Er61, p.252] is ambiguous about whether +the coefficients are from $\{-1, 1\}$ or $\{0, 1\}$. For $\{0, 1\}$ coefficients, +the expected constant is $1/\pi$ rather than $2/\pi$. This formalization uses +$\{-1, 1\}$ (Rademacher), which is the standard modern interpretation. + +## References + +[EO56] Erdős, P., Offord, A. C., _On the number of real roots of a random algebraic +equation_. Proc. London Math. Soc. (3) **6** (1956), 139–160. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. +**6** (1961), 221–254. + +[Do24] Do, Y., _A strong law of large numbers for real roots of random polynomials_. +arXiv:2403.06353 (2024). + +*Reference:* [erdosproblems.com/521](https://www.erdosproblems.com/521) +-/ + +open MeasureTheory ProbabilityTheory Polynomial Filter Finset + +open scoped BigOperators + +namespace Erdos521 + +/-- The polynomial with prescribed $\pm 1$ coefficients: +$f_n(z) = \sum_{k=0}^{n} \varepsilon(k) \cdot z^k$. -/ +noncomputable def signPoly (ε : ℕ → ℝ) (n : ℕ) : Polynomial ℝ := + ∑ k ∈ range (n + 1), C (ε k) * X ^ k + +/-- The number of distinct real roots of a real polynomial. -/ +noncomputable def numRealRoots (p : Polynomial ℝ) : ℕ := + Set.ncard {x : ℝ | p.IsRoot x} + +/-- A random variable is Rademacher distributed: it takes values in $\{-1, 1\}$ +with equal probability (each with probability $1/2$ on a probability space). -/ +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} + +/-- +Erdős Problem 521 [Er61, p.252]: +Let $(\varepsilon_k)_{k \geq 0}$ be independently uniformly chosen at random from $\{-1, 1\}$. +If $R_n$ counts the number of real roots of $f_n(z) = \sum_{k=0}^{n} \varepsilon_k z^k$, +then, almost surely, $\lim_{n \to \infty} R_n / \log n = 2/\pi$. + +Erdős and Offord [EO56] showed that the expected number of real roots is +$(2/\pi + o(1)) \log n$. This conjecture asks whether the convergence holds +almost surely. +-/ +@[category research open, AMS 12 60] +theorem erdos_521 : answer(sorry) ↔ + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → + iIndepFun ε μ → + ∀ᵐ ω ∂μ, Tendsto + (fun n => (numRealRoots (signPoly (fun k => ε k ω) n) : ℝ) / Real.log (n : ℝ)) + atTop (nhds (2 / Real.pi)) := by + sorry + +/-- The number of distinct real roots of a real polynomial in a given interval $[a, b]$. -/ +noncomputable def numRealRootsIn (p : Polynomial ℝ) (a b : ℝ) : ℕ := + Set.ncard {x : ℝ | p.IsRoot x ∧ a ≤ x ∧ x ≤ b} + +/-- +Do's partial result [Do24]: For random $\pm 1$ polynomials, the number of real roots +in $[-1, 1]$ satisfies $R_n[-1,1] / \log n \to 1/\pi$ almost surely. +This is a partial result towards Erdős Problem 521, resolving the conjecture +for roots restricted to $[-1, 1]$. +-/ +@[category research solved, AMS 12 60] +theorem erdos_521.variants.do_restricted_roots : + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → + iIndepFun ε μ → + ∀ᵐ ω ∂μ, Tendsto + (fun n => (numRealRootsIn (signPoly (fun k => ε k ω) n) (-1) 1 : ℝ) / Real.log (n : ℝ)) + atTop (nhds (1 / Real.pi)) := by + sorry + +/-- +Erdős–Offord expectation result [EO56]: The expected number of real roots of a +random degree $n$ polynomial with $\pm 1$ coefficients satisfies +$\mathbb{E}[R_n] / \log n \to 2/\pi$. +This is the convergence in expectation that motivates the almost sure conjecture +(Erdős Problem 521). +-/ +@[category research solved, AMS 12 60] +theorem erdos_521.variants.erdos_offord_expectation : + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → + iIndepFun ε μ → + Tendsto + (fun n => (∫ ω, (numRealRoots (signPoly (fun k => ε k ω) n) : ℝ) ∂μ) / Real.log (n : ℝ)) + atTop (nhds (2 / Real.pi)) := by + sorry + +/-- A random variable is Bernoulli(1/2) distributed: it takes values in $\{0, 1\}$ +with equal probability. -/ +def IsBernoulliHalf {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 0 ∨ X ω = 1) ∧ + μ {ω | X ω = 0} = μ {ω | X ω = 1} + +/-- +$\{0, 1\}$ coefficient variant: Erdős's original formulation [Er61, p.252] may have +intended coefficients from $\{0, 1\}$ instead of $\{-1, 1\}$. For $\{0, 1\}$ coefficients, +the expected constant is $1/\pi$ rather than $2/\pi$. +-/ +@[category research open, AMS 12 60] +theorem erdos_521.variants.zero_one_coefficients : answer(sorry) ↔ + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsBernoulliHalf μ (ε k)) → + iIndepFun ε μ → + ∀ᵐ ω ∂μ, Tendsto + (fun n => (numRealRoots (signPoly (fun k => ε k ω) n) : ℝ) / Real.log (n : ℝ)) + atTop (nhds (1 / Real.pi)) := by + sorry + +end Erdos521 diff --git a/FormalConjectures/ErdosProblems/523.lean b/FormalConjectures/ErdosProblems/523.lean new file mode 100644 index 0000000000..5e3b7891dd --- /dev/null +++ b/FormalConjectures/ErdosProblems/523.lean @@ -0,0 +1,122 @@ +/- +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 523 + +Erdős asked whether the supremum of a random Rademacher polynomial on the unit +circle is asymptotically $C\sqrt{n \log n}$ for some constant $C > 0$. + +Salem and Zygmund [SaZy54] proved that $\sqrt{n \log n}$ is the right order of +magnitude. Halász [Ha73] settled the problem, proving this is true with $C = 1$. + +## References + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. +Közl. **6** (1961), 221–254, p.253. + +[SaZy54] Salem, R., Zygmund, A., _Some properties of trigonometric series whose +terms have random signs_. Acta Mathematica (1954), 245–301. + +[Ha73] Halász, G., _On a result of Salem and Zygmund concerning random +polynomials_. Studia Scientiarum Mathematicarum Hungarica (1973), 369–377. + +## Acknowledgements + +Thanks to Adrian Beker. + +*Reference:* [erdosproblems.com/523](https://www.erdosproblems.com/523) +-/ + +open MeasureTheory ProbabilityTheory Filter Finset + +open scoped BigOperators + +namespace Erdos523 + +/-- A random variable is Rademacher distributed: it takes values in $\{-1, 1\}$ +with equal probability. -/ +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} + +/-- The supremum of $|\sum_{k=0}^n \varepsilon_k z^k|$ over the unit circle $|z| = 1$. -/ +noncomputable def supNormCircle (ε : ℕ → ℝ) (n : ℕ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = 1 ∧ + x = ‖(∑ k ∈ Finset.range (n + 1), (ε k : ℂ) * z ^ k)‖} + +/-- +Erdős Problem #523: +Let $f(z) = \sum_{k=0}^n \varepsilon_k z^k$ be a random polynomial, where +$\varepsilon_k \in \{-1, 1\}$ independently uniformly at random. + +Does there exist some constant $C > 0$ such that, almost surely, +$$\max_{|z|=1} \left|\sum_{k \le n} \varepsilon_k z^k\right| = (C + o(1))\sqrt{n \log n}?$$ + +Salem and Zygmund proved that $\sqrt{n \log n}$ is the right order of magnitude. +This was settled by Halász, who proved this is true with $C = 1$. +-/ +@[category research solved, AMS 42 60] +theorem erdos_523 : answer(True) ↔ + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → iIndepFun ε μ → + ∃ C : ℝ, 0 < C ∧ + ∀ᵐ ω ∂μ, Tendsto + (fun n => supNormCircle (fun k => ε k ω) n / + Real.sqrt ((n : ℝ) * Real.log (n : ℝ))) + atTop (nhds C) := by + sorry + +/-- +Halász's precise result: the constant $C$ in Erdős Problem 523 is exactly $1$. +That is, almost surely, +$$\max_{|z|=1} \left|\sum_{k \le n} \varepsilon_k z^k\right| / \sqrt{n \log n} \to 1.$$ +-/ +@[category research solved, AMS 42 60] +theorem erdos_523_halasz : + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → iIndepFun ε μ → + ∀ᵐ ω ∂μ, Tendsto + (fun n => supNormCircle (fun k => ε k ω) n / + Real.sqrt ((n : ℝ) * Real.log (n : ℝ))) + atTop (nhds 1) := by + sorry + +/-- +Salem–Zygmund order-of-magnitude bound: the supremum of a random Rademacher +polynomial on the unit circle is $\Theta(\sqrt{n \log n})$ almost surely. +That is, there exist constants $0 < c \le C$ such that, almost surely, for all +sufficiently large $n$, +$$c \sqrt{n \log n} \le \max_{|z|=1} |f(z)| \le C \sqrt{n \log n}.$$ +-/ +@[category research solved, AMS 42 60] +theorem erdos_523_salem_zygmund : + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → iIndepFun ε μ → + ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ + ∀ᵐ ω ∂μ, ∀ᶠ (n : ℕ) in atTop, + c * Real.sqrt ((n : ℝ) * Real.log (n : ℝ)) ≤ + supNormCircle (fun k => ε k ω) n ∧ + supNormCircle (fun k => ε k ω) n ≤ + C * Real.sqrt ((n : ℝ) * Real.log (n : ℝ)) := by + sorry + +end Erdos523 diff --git a/FormalConjectures/ErdosProblems/524.lean b/FormalConjectures/ErdosProblems/524.lean new file mode 100644 index 0000000000..934feece15 --- /dev/null +++ b/FormalConjectures/ErdosProblems/524.lean @@ -0,0 +1,105 @@ +/- +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 524 + +A problem of Salem and Zygmund [SaZy54]. For any $t \in (0,1)$ let +$t = \sum_{k=1}^{\infty} \varepsilon_k(t) 2^{-k}$ be the binary expansion (where +$\varepsilon_k(t) \in \{0,1\}$). What is the correct order of magnitude (for almost all +$t \in (0,1)$) of +$$M_n(t) = \max_{x \in [-1,1]} \left|\sum_{k \le n} (-1)^{\varepsilon_k(t)} x^k\right|?$$ + +The binary digits $\varepsilon_k(t)$ are i.i.d. Bernoulli$(1/2)$ under Lebesgue measure, so +$(-1)^{\varepsilon_k(t)}$ are i.i.d. Rademacher random variables. + +**Known partial results:** +- Erdős showed: for a.a. $t$ and every $\delta > 0$, + $\limsup_{n \to \infty} M_n(t)/n^{1/2 - \delta} = \infty$. +- Chung showed: for a.a. $t$, there exist infinitely many $n$ such that + $M_n(t) \ll (n / \log \log n)^{1/2}$. + +## References + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. +Közl. **6** (1961), 221–254, p.253. + +[SaZy54] Salem, R., Zygmund, A., _Some properties of trigonometric series whose +terms have random signs_. Acta Mathematica (1954), 245–301. + +*Reference:* [erdosproblems.com/524](https://www.erdosproblems.com/524) +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators Set Asymptotics + +namespace Erdos524 + +/-- A random variable is Rademacher distributed: it takes values in $\{-1, 1\}$ +with equal probability. -/ +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} + +/-- The supremum of $\left|\sum_{k=1}^n \varepsilon_k x^k\right|$ over $x \in [-1, 1]$. -/ +noncomputable def supNormInterval (ε : ℕ → ℝ) (n : ℕ) : ℝ := + sSup {y : ℝ | ∃ x : ℝ, x ∈ Icc (-1 : ℝ) 1 ∧ + y = |∑ k ∈ Finset.range n, ε (k + 1) * x ^ (k + 1)|} + +/-- What is the correct order of magnitude of $M_n(t)$ for almost all $t$? +The answer $f : \mathbb{N} \to \mathbb{R}$ should satisfy +$M_n(\omega) =\Theta(f(n))$ as $n \to \infty$ for a.a. $\omega$. -/ +@[category research open, AMS 42 60] +theorem erdos_524 + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ} + (hRad : ∀ k, IsRademacher μ (ε k)) + (hIndep : iIndepFun ε μ) : + ∀ᵐ ω ∂μ, + (fun n => supNormInterval (fun k => ε k ω) n) =Θ[atTop] + (answer(sorry) : ℕ → ℝ) := by + sorry + +/-- Erdős showed that for almost all $\omega$ and every $\delta > 0$, +$\limsup_{n \to \infty} M_n(\omega) / n^{1/2 - \delta} = \infty$. -/ +@[category research solved, AMS 42 60] +theorem erdos_524.variants.lower_bound + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ} + (hRad : ∀ k, IsRademacher μ (ε k)) + (hIndep : iIndepFun ε μ) : + ∀ᵐ ω ∂μ, ∀ δ > (0 : ℝ), ∀ C > (0 : ℝ), + ∃ᶠ n in atTop, + C ≤ supNormInterval (fun k => ε k ω) n / + (↑n : ℝ) ^ ((1 : ℝ)/2 - δ) := by + sorry + +/-- Chung showed that for almost all $\omega$, there exist infinitely many $n$ such that +$M_n(\omega) \ll (n / \log \log n)^{1/2}$. -/ +@[category research solved, AMS 42 60] +theorem erdos_524.variants.upper_bound + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ} + (hRad : ∀ k, IsRademacher μ (ε k)) + (hIndep : iIndepFun ε μ) : + ∃ C > (0 : ℝ), ∀ᵐ ω ∂μ, + ∃ᶠ n in atTop, + supNormInterval (fun k => ε k ω) n ≤ + C * ((↑n : ℝ) / Real.log (Real.log (↑n : ℝ))) ^ ((1 : ℝ)/2) := by + sorry + +end Erdos524 diff --git a/FormalConjectures/ErdosProblems/525.lean b/FormalConjectures/ErdosProblems/525.lean new file mode 100644 index 0000000000..150508768b --- /dev/null +++ b/FormalConjectures/ErdosProblems/525.lean @@ -0,0 +1,88 @@ +/- +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 525 + +Is it true that almost all $\pm 1$-coefficient polynomials of degree $n$ attain modulus less +than $1$ somewhere on the unit circle? + +*Reference:* [erdosproblems.com/525](https://www.erdosproblems.com/525) + +[Er61] Erdős, P., _Some unsolved problems_, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221-254. + +[Li66] Littlewood, J. E., _On polynomials ∑ⁿ±zᵐ, ∑ⁿeᵃᵐⁱzᵐ, z=eᶿⁱ_, J. London Math. Soc. +(1966), 367-376. + +[Ka87] Kashin, B. S., _The properties of random trigonometric polynomials with ±1 coefficients_, +Vestnik Moskov. Univ. Ser. I Mat. Mekh. (1987), 40-46, 105. + +[Ko94] Konyagin, S. V., _On the minimum modulus of random trigonometric polynomials with +coefficients ±1_, Mat. Zametki (1994), 80-101, 158. + +[KoSc99] Konyagin, S. V., Schlag, W., _Lower bounds for the absolute value of random polynomials +on a neighborhood of the unit circle_, Trans. Amer. Math. Soc. (1999), 4963-4980. + +[CoNg21] Cook, N. A., Nguyen, H. H., _Universality of the minimum modulus for random +trigonometric polynomials_, Discrete Analysis (2021), Paper No. 20, 46. +-/ + +open Finset BigOperators Filter Classical + +namespace Erdos525 + +/-- Evaluate a $\pm 1$-coefficient polynomial of degree $n$ at $z \in \mathbb{C}$. +The sign vector $\varepsilon : \operatorname{Fin}(n+1) \to \operatorname{Bool}$ determines +coefficients ($\mathrm{true} \to +1$, $\mathrm{false} \to -1$): +$f(z) = \sum_{k=0}^{n} \varepsilon_k \cdot z^k$. -/ +noncomputable def littlewoodEval (n : ℕ) (ε : Fin (n + 1) → Bool) (z : ℂ) : ℂ := + ∑ k : Fin (n + 1), (if ε k then (1 : ℂ) else (-1 : ℂ)) * z ^ (k : ℕ) + +/-- A $\pm 1$-coefficient polynomial of degree $n$ has modulus less than $1$ +somewhere on the unit circle. -/ +def hasSmallValueOnCircle (n : ℕ) (ε : Fin (n + 1) → Bool) : Prop := + ∃ z : ℂ, ‖z‖ = 1 ∧ ‖littlewoodEval n ε z‖ < 1 + +/-- The number of $\pm 1$-coefficient polynomials of degree $n$ that do NOT attain +modulus less than $1$ anywhere on the unit circle. -/ +noncomputable def countNoSmallValue (n : ℕ) : ℕ := + (Finset.univ.filter (fun ε : Fin (n + 1) → Bool => + ¬hasSmallValueOnCircle n ε)).card + +/-- +Erdős Problem 525 [Er61, p.253]: + +Is it true that all except at most $o(2^n)$ many degree $n$ polynomials with +$\pm 1$-valued coefficients $f(z)$ have $|f(z)| < 1$ for some $|z| = 1$? + +Equivalently, the number of sign vectors $\varepsilon \in \{\pm 1\}^{n+1}$ for which +the polynomial $f(z) = \sum \varepsilon_k z^k$ satisfies $\min_{|z|=1} |f(z)| \geq 1$ +is $o(2^n)$ as $n \to \infty$. + +Proved by Kashin (1987). Konyagin (1994) showed +$\min_{|z|=1} |f(z)| \leq n^{-1/2+o(1)}$ for almost all such polynomials. +Cook and Nguyen (2021) identified the limiting distribution. +-/ +@[category research solved, AMS 42] +theorem erdos_525 : + answer(True) ↔ + Tendsto (fun n => (countNoSmallValue n : ℝ) / (2 : ℝ) ^ n) atTop (nhds 0) := by + sorry + +end Erdos525 diff --git a/FormalConjectures/ErdosProblems/526.lean b/FormalConjectures/ErdosProblems/526.lean new file mode 100644 index 0000000000..68f9e24669 --- /dev/null +++ b/FormalConjectures/ErdosProblems/526.lean @@ -0,0 +1,79 @@ +/- +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 526 + +Dvoretzky's covering problem: given a sequence of arc lengths $a_n \to 0$ with $\sum a_n = \infty$, +arcs of these lengths placed independently and uniformly at random on the unit circle cover the +entire circle with probability one if and only if $\sum \exp(a_1+\cdots+a_n)/n^2 = \infty$. + +*Reference:* [erdosproblems.com/526](https://www.erdosproblems.com/526) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +p. 253. + +[Dv56] Dvoretzky, A., _On covering a circle by randomly placed arcs_. Proc. Nat. Acad. Sci. U.S.A. +(1956), 199–203. + +[Sh72] Shepp, L. A., _Covering the circle with random arcs_. Israel J. Math. 11 (1972), 328–345. +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators Set + +namespace Erdos526 + +/-- Point $y$ is covered by an arc of length $\ell$ starting at $x$ on the unit circle +$\mathbb{R}/\mathbb{Z}$. The clockwise arc-distance from $x$ to $y$ is the fractional +part of $(y - x)$. -/ +noncomputable def CircArcCovers (x y ℓ : ℝ) : Prop := + Int.fract (y - x) < ℓ + +/-- The full unit circle $[0,1)$ is covered by arcs starting at $\omega(n)$ of lengths $a(n)$. -/ +noncomputable def CircleFullyCovered (ω a : ℕ → ℝ) : Prop := + ∀ y : ℝ, 0 ≤ y → y < 1 → ∃ n : ℕ, CircArcCovers (ω n) y (a n) + +/-- +Dvoretzky's covering problem [Er61, p. 253] (solved by Shepp [Sh72]). + +Let $a_n \geq 0$ with $a_n \to 0$ and $\sum a_n = \infty$. If we independently and uniformly +place random arcs of length $a_n$ on the unit circle, Shepp showed the circle is covered with +probability $1$ if and only if +$$ + \sum_n \frac{\exp(a_1 + \cdots + a_n)}{n^2} = \infty. +$$ + +The probability space $(\Omega, \mu)$ carries independent $\mathrm{Uniform}[0,1)$ random +variables $X(n)$ giving the starting point of the $n$-th arc. +-/ +@[category research solved, AMS 60] +theorem erdos_526 + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + (a : ℕ → ℝ) + (ha_nonneg : ∀ n, 0 ≤ a n) + (ha_tendsto : Tendsto a atTop (nhds 0)) + (ha_diverges : ¬Summable a) + {X : ℕ → Ω → ℝ} + (hX_meas : ∀ n, Measurable (X n)) + (hX_unif : ∀ n, Measure.map (X n) μ = volume.restrict (Ico (0 : ℝ) 1)) + (hX_indep : iIndepFun X μ) : + (∀ᵐ ω ∂μ, CircleFullyCovered (fun n => X n ω) a) ↔ + ¬Summable (fun n => Real.exp (∑ i ∈ range (n + 1), a i) / ((n : ℝ) + 1) ^ 2) := by + sorry + +end Erdos526 diff --git a/FormalConjectures/ErdosProblems/527.lean b/FormalConjectures/ErdosProblems/527.lean new file mode 100644 index 0000000000..36516ebda9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/527.lean @@ -0,0 +1,78 @@ +/- +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 527 + +*Reference:* [erdosproblems.com/527](https://www.erdosproblems.com/527) + +Let $a_n \in \mathbb{R}$ with $\sum |a_n|^2 = \infty$ and $|a_n| = o(1/\sqrt{n})$. +Is it true that, for almost all choices of signs $\varepsilon_n = \pm 1$, there exists +some $z$ with $|z| = 1$ such that $\sum \varepsilon_n a_n z^n$ converges? +Solved affirmatively by Michelen and Sawhney. + +[DE59] Dvoretzky, A. and Erdős, P., *Divergence of random power series*, Michigan Math. J. +(1959), 343–347. + +[Er61] Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961), +p.254. + +[MiSa25] Michelen, M. and Sawhney, M., *Convergent points for random power series on the +unit circle*, arXiv:2509.02729 (2025). +-/ + +open MeasureTheory ProbabilityTheory Filter Finset BigOperators + +namespace Erdos527 + +/-- A random variable is Rademacher distributed: it takes values in $\{-1, 1\}$ +with equal probability. -/ +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} + +/-- The partial sum of the random power series $\sum_{k=0}^{n-1} \varepsilon_k a_k z^k$. -/ +noncomputable def randomPowerPartialSum (ε : ℕ → ℝ) (a : ℕ → ℝ) (z : ℂ) (n : ℕ) : ℂ := + ∑ k ∈ Finset.range n, ((ε k * a k : ℝ) : ℂ) * z ^ k + +/-- +Erdős Problem 527 [Er61, p.254]: + +Let $a_n \in \mathbb{R}$ be such that $\sum |a_n|^2 = \infty$ and $|a_n| = o(1/\sqrt{n})$. +Is it true that, for almost all $\varepsilon_n = \pm 1$, there exists some $z$ with $|z| = 1$ +(depending on the choice of signs) such that $\sum \varepsilon_n a_n z^n$ converges? + +It is unclear whether Erdős intended to also assume monotonicity $|a_{n+1}| \leq |a_n|$; +the formalization omits this assumption, matching the stronger result of Michelen and +Sawhney [MiSa25], who proved the statement without monotonicity and showed that the set +of such $z$ has Hausdorff dimension 1. Dvoretzky and Erdős [DE59] showed that if +$|a_n| > c/\sqrt{n}$ for some $c > 0$, then the series diverges almost surely at every +$|z| = 1$, so the $o(1/\sqrt{n})$ condition is essentially sharp. +-/ +@[category research solved, AMS 40 60] +theorem erdos_527 : answer(True) ↔ + ∀ {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + {ε : ℕ → Ω → ℝ}, + (∀ k, IsRademacher μ (ε k)) → iIndepFun ε μ → + ∀ (a : ℕ → ℝ), ¬Summable (fun n => a n ^ 2) → + Tendsto (fun n => |a n| * Real.sqrt (↑n : ℝ)) atTop (nhds 0) → + ∀ᵐ ω ∂μ, ∃ z : ℂ, ‖z‖ = 1 ∧ + ∃ S : ℂ, Tendsto (randomPowerPartialSum (fun k => ε k ω) a z) atTop (nhds S) := by + sorry + +end Erdos527 diff --git a/FormalConjectures/ErdosProblems/528.lean b/FormalConjectures/ErdosProblems/528.lean new file mode 100644 index 0000000000..e162f0e861 --- /dev/null +++ b/FormalConjectures/ErdosProblems/528.lean @@ -0,0 +1,110 @@ +/- +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 528 + +*Reference:* [erdosproblems.com/528](https://www.erdosproblems.com/528) + +*Related problems:* [Problem 529](https://www.erdosproblems.com/529) + +Let $f(n,k)$ count the number of self-avoiding walks of $n$ steps beginning at the origin +in the integer lattice $\mathbb{Z}^k$. The connective constant $C_k$ is defined as +$C_k = \lim_{n \to \infty} f(n,k)^{1/n}$. The problem asks to determine $C_k$ exactly. + +OEIS: [A387897](https://oeis.org/A387897), [A156816](https://oeis.org/A156816) + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[HM54] Hammersley, J. M. and Morton, K. W., _Poor man's Monte Carlo_. J. Roy. Statist. +Soc. Ser. B (1954), 23–38; discussion 61–75. + +[Ke63] Kesten, H., _On the number of self-avoiding walks_. J. Math. Phys. (1963), 960–969. + +[CG93] Conway, A. R. and Guttmann, A. J., _Lower bound on the connective constant for +square lattice self-avoiding walks_. J. Phys. A (1993), 3719–3724. + +[Al93] Alm, S. E., _Upper bounds for the connective constant of self-avoiding walks_. +Combin. Probab. Comput. (1993), 115–136. + +[CLS07] Clisby, N., Liang, R., and Slade, G., _Self-avoiding walk enumeration via the lace +expansion_. J. Phys. A (2007), 10973–11017. + +[JSG16] Jacobsen, J. L., Scullard, C. R., and Guttmann, A. J., _On the growth constant for +square-lattice self-avoiding walks_. J. Phys. A (2016), 494004, 18. +-/ + +open Classical Finset BigOperators Filter + +namespace Erdos528 + +/-- Two points in $\mathbb{Z}^k$ are adjacent in the integer lattice if their $\ell^1$ distance +is $1$ (i.e., they differ by $\pm 1$ in exactly one coordinate). -/ +def LatticeAdj {k : ℕ} (x y : Fin k → ℤ) : Prop := + (∑ i : Fin k, |x i - y i|) = 1 + +/-- The number of self-avoiding walks of $n$ steps in $\mathbb{Z}^k$ starting at the origin. +A self-avoiding walk is a path in the integer lattice $\mathbb{Z}^k$ that starts at the +origin, takes $n$ steps along lattice edges, and never revisits a vertex. -/ +noncomputable def selfAvoidingWalkCount (n k : ℕ) : ℕ := + Set.ncard {w : Fin (n + 1) → (Fin k → ℤ) | + w 0 = 0 ∧ + (∀ i : Fin n, LatticeAdj (w ⟨i.val, by omega⟩) (w ⟨i.val + 1, by omega⟩)) ∧ + Function.Injective w} + +/-- The connective constant $C_k$ for self-avoiding walks on $\mathbb{Z}^k$, defined as +$C_k = \lim_{n \to \infty} f(n,k)^{1/n}$ where $f(n,k)$ is the number of self-avoiding +walks of $n$ steps. Returns the limit value if it exists, or $0$ otherwise. -/ +noncomputable def connectiveConstant (k : ℕ) : ℝ := + -- The limit, if it exists, is unique (ℝ is Hausdorff), so `h.choose` is well-defined. + if h : ∃ C : ℝ, Filter.Tendsto + (fun n : ℕ => ((selfAvoidingWalkCount n k : ℝ)) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds C) + then h.choose + else 0 + +/-- +Erdős Problem 528 asks to determine the connective constant $C_k$ exactly, where $C_k$ is +the limit of $f(n,k)^{1/n}$ as $n \to \infty$ and $f(n,k)$ counts the number of +self-avoiding walks of $n$ steps in $\mathbb{Z}^k$. + +Hammersley and Morton [HM54] showed this limit exists. Kesten [Ke63] proved +$C_k = 2k - 1 - 1/(2k) + O(1/k^2)$. +-/ +@[category research open, AMS 5 82] +theorem erdos_528 : + ∀ k : ℕ, 0 < k → + connectiveConstant k = answer(sorry) := by + sorry + +/-- Variant: The connective constant $C_k$ exists and satisfies the known bounds +$k \le C_k \le 2k - 1$. The upper bound $C_k \le 2k - 1$ is due to [HM54] (at each step +there are at most $2k - 1$ non-backtracking choices); the lower bound $C_k \ge k$ follows +from [Ke63]. -/ +@[category research solved, AMS 5 82] +theorem erdos_528.variants.existence_with_bounds : + ∀ k : ℕ, 0 < k → + ∃ C : ℝ, + (k : ℝ) ≤ C ∧ C ≤ 2 * (k : ℝ) - 1 ∧ + Filter.Tendsto + (fun n : ℕ => ((selfAvoidingWalkCount n k : ℝ)) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds C) := by + sorry + +end Erdos528 diff --git a/FormalConjectures/ErdosProblems/529.lean b/FormalConjectures/ErdosProblems/529.lean new file mode 100644 index 0000000000..40c7e67ff6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/529.lean @@ -0,0 +1,110 @@ +/- +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 529 + +Let $d_k(n)$ denote the expected Euclidean distance from the origin of the endpoint of a +uniformly random $n$-step self-avoiding walk on $\mathbb{Z}^k$. The problem asks whether +$d_2(n)/\sqrt{n} \to \infty$ (Part 1) and whether $d_k(n) \ll \sqrt{n}$ for $k \geq 3$ (Part 2). + +*Reference:* [erdosproblems.com/529](https://www.erdosproblems.com/529) + +[Er61] Erdős, P., _Some unsolved problems_, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254, p. 254. + +[Sl87] Slade, G., _The diffusion of self-avoiding random walk in high dimensions_, +Comm. Math. Phys. **108** (1987), 661–683. + +[HaSl91] Hara, T., Slade, G., _Critical behaviour of self-avoiding walk in five or more +dimensions_, Bull. Amer. Math. Soc. (N.S.) **25** (1991), 417–423. + +[HaSl92] Hara, T., Slade, G., _Self-avoiding walk in five or more dimensions. I. The critical +behaviour_, Comm. Math. Phys. **147** (1992), 101–136. + +[MaSl93] Madras, N., Slade, G., _The Self-Avoiding Walk_, Birkhäuser (1993), xiv+425 pp. + +[DuHa13] Duminil-Copin, H., Hammond, A., _Self-avoiding walk is sub-ballistic_, +Comm. Math. Phys. **324** (2013), 401–423. +-/ + +open BigOperators Filter Classical + +namespace Erdos529 + +/-- Two points in $\mathbb{Z}^k$ are adjacent in the integer lattice if their $\ell^1$ distance +is $1$ (i.e., they differ by $\pm 1$ in exactly one coordinate). -/ +def LatticeAdj {k : ℕ} (x y : Fin k → ℤ) : Prop := + (∑ i : Fin k, |x i - y i|) = 1 + +/-- The set of self-avoiding walks of $n$ steps in $\mathbb{Z}^k$ starting at the origin. -/ +def selfAvoidingWalks (n k : ℕ) : Set (Fin (n + 1) → (Fin k → ℤ)) := + {w | w 0 = 0 ∧ + (∀ i : Fin n, LatticeAdj (w ⟨i.val, by omega⟩) (w ⟨i.val + 1, by omega⟩)) ∧ + Function.Injective w} + +/-- The Euclidean distance of a point in $\mathbb{Z}^k$ from the origin. -/ +noncomputable def euclidDistFromOrigin {k : ℕ} (x : Fin k → ℤ) : ℝ := + Real.sqrt (∑ i : Fin k, ((x i : ℝ)) ^ 2) + +/-- The expected Euclidean distance from the origin of the endpoint of a uniformly +random self-avoiding walk of $n$ steps in $\mathbb{Z}^k$. +$$d_k(n) = \frac{1}{|\mathrm{SAW}(n,k)|} \cdot \sum_{w \in \mathrm{SAW}(n,k)} \|w(n)\|_2$$ -/ +noncomputable def expectedSAWDist (n k : ℕ) : ℝ := + if h : (selfAvoidingWalks n k).Finite then + (h.toFinset.sum (fun w => euclidDistFromOrigin (w ⟨n, by omega⟩))) / + (h.toFinset.card : ℝ) + else 0 + +/-- +Erdős Problem 529, Part 1: + +Let $d_k(n)$ be the expected distance from the origin after taking $n$ steps of a +uniformly random self-avoiding walk in $\mathbb{Z}^k$. Is it true that +$$\lim_{n \to \infty} \frac{d_2(n)}{n^{1/2}} = \infty?$$ + +That is, in two dimensions, does the expected endpoint distance grow strictly +faster than $\sqrt{n}$? + +Duminil-Copin and Hammond [DuHa13] proved $d_2(n) = o(n)$. It is conjectured +that $d_2(n) \sim D \cdot n^{3/4}$. +-/ +@[category research open, AMS 5 60] +theorem erdos_529 : answer(sorry) ↔ + Tendsto (fun n : ℕ => expectedSAWDist n 2 / (n : ℝ) ^ ((1 : ℝ) / 2)) + atTop atTop := by + sorry + +/-- +Erdős Problem 529, Part 2: + +Is it true that $d_k(n) \ll n^{1/2}$ for $k \geq 3$? + +Hara and Slade proved $d_k(n) \sim D \cdot n^{1/2}$ for all $k \geq 5$. It is now believed +that this is false for $k = 3$ and $k = 4$: the conjectured behavior is +$d_3(n) \sim n^{\nu}$ where $\nu \approx 0.59$ and +$d_4(n) \sim D \cdot (\log n)^{1/8} \cdot n^{1/2}$. +-/ +@[category research open, AMS 5 60] +theorem erdos_529.variants.part2 : answer(sorry) ↔ + ∀ k : ℕ, k ≥ 3 → + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n in atTop, + expectedSAWDist n k ≤ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos529 diff --git a/FormalConjectures/ErdosProblems/53.lean b/FormalConjectures/ErdosProblems/53.lean new file mode 100644 index 0000000000..6cc7b817df --- /dev/null +++ b/FormalConjectures/ErdosProblems/53.lean @@ -0,0 +1,67 @@ +/- +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 53 + +*Reference:* [erdosproblems.com/53](https://www.erdosproblems.com/53) + +For every $k$, if $|A|$ is sufficiently large, then there are at least $|A|^k$ distinct integers +that are either a sum or product of distinct elements of $A$. Solved by Chang [Ch03]. + +[ErSz83] Erdős, P. and Szemerédi, E., _On sums and products of integers_. Studies in Pure +Mathematics, Birkhäuser, Basel (1983), 213–218. + +[Ch03] Chang, M.-C., _The Erdős-Szemerédi problem on sum set and product set_. Annals of +Mathematics **157** (2003), 939–957. +-/ + +open Finset BigOperators + +namespace Erdos53 + +/-- +The set of all subset sums of a finite set of integers: +$\{ \sum_{i \in S} i \mid S \subseteq A \}$. +-/ +def subsetSums (A : Finset ℤ) : Finset ℤ := + A.powerset.image (fun S => ∑ i ∈ S, i) + +/-- +The set of all subset products of a finite set of integers: +$\{ \prod_{i \in S} i \mid S \subseteq A \}$. +-/ +def subsetProducts (A : Finset ℤ) : Finset ℤ := + A.powerset.image (fun S => ∏ i ∈ S, i) + +/-- +**Erdős Problem 53** [ErSz83]: + +Is it true that, for every $k$, if $|A|$ is sufficiently large depending on $k$, then there are +at least $|A|^k$ many integers which are either the sum or product of distinct elements of $A$? + +Solved in this form by Chang [Ch03]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_53 : answer(True) ↔ + ∀ k : ℕ, ∃ N : ℕ, ∀ A : Finset ℤ, + A.card ≥ N → + (subsetSums A ∪ subsetProducts A).card ≥ A.card ^ k := by + sorry + +end Erdos53 diff --git a/FormalConjectures/ErdosProblems/530.lean b/FormalConjectures/ErdosProblems/530.lean new file mode 100644 index 0000000000..133ee67800 --- /dev/null +++ b/FormalConjectures/ErdosProblems/530.lean @@ -0,0 +1,80 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 530 + +*Reference:* [erdosproblems.com/530](https://www.erdosproblems.com/530) + +Let $\ell(N)$ be maximal such that in any finite set $A \subset \mathbb{R}$ of size $N$ there +exists a Sidon subset $S$ of size $\ell(N)$ (i.e. the only solutions to $a + b = c + d$ in $S$ +are the trivial ones). Is it true that $\ell(N) \sim N^{1/2}$? + +Originally asked by Riddell [Ri69]. Erdős noted the bounds +$N^{1/3} \ll \ell(N) \leq (1+o(1))N^{1/2}$ (the upper bound following from the case +$A = \{1, \ldots, N\}$). The lower bound was improved to $N^{1/2} \ll \ell(N)$ by Komlós, +Sulyok, and Szemerédi [KSS75]. The correct constant is unknown, but it is likely that the +upper bound is true, so that $\ell(N) \sim N^{1/2}$. + +Alon and Erdős [AlEr85] posed the stronger conjecture that any set of size $N$ can be +decomposed into at most $(1+o(1))N^{1/2}$ Sidon sets. + +See also Problem 1088 (higher-dimensional generalization), Guy's collection [Gu04] +(Problem C9), and OEIS sequence A143824. + +[Er73] Erdős, P., p.120. [Er75f] Erdős, P., p.104. [Er80e] Erdős, P. + +[Ri69] Riddell, J., *On sets of numbers containing no l terms in arithmetic progression*, +Nieuw Arch. Wisk. (3) (1969), 204–209. + +[KSS75] Komlós, J., Sulyok, M. and Szemerédi, E., *Linear problems in combinatorial number +theory*, Acta Math. Acad. Sci. Hungar. (1975), 113–121. + +[AlEr85] Alon, N. and Erdős, P., *An application of graph theory to additive number theory*, +European J. Combin. 6 (1985), 201–203. + +[Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437. +-/ + +open Finset Filter + +namespace Erdos530 + +/-- $\ell(N)$: the largest $k$ such that every $N$-element subset of $\mathbb{R}$ contains +a Sidon subset of size at least $k$. Equivalently, the minimum of `Finset.maxSidonSubsetCard A` +over all $N$-element sets $A \subset \mathbb{R}$. -/ +noncomputable def sidonSubsetNumber (N : ℕ) : ℕ := + sInf {m : ℕ | ∃ A : Finset ℝ, A.card = N ∧ A.maxSidonSubsetCard = m} + +/-- +Is it true that $\ell(N) \sim N^{1/2}$, i.e. the ratio $\ell(N) / \sqrt{N}$ tends to $1$ +as $N \to \infty$? [Er73] [Er75f] [Er80e] + +Known bounds: $N^{1/2} \ll \ell(N) \leq (1+o(1))N^{1/2}$. The lower bound +$N^{1/2} \ll \ell(N)$ is due to Komlós, Sulyok, and Szemerédi [KSS75]. The upper bound +follows from the case $A = \{1, \ldots, N\}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_530 : + answer(sorry) ↔ + Tendsto (fun N : ℕ => (sidonSubsetNumber N : ℝ) / Real.sqrt (N : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos530 diff --git a/FormalConjectures/ErdosProblems/531.lean b/FormalConjectures/ErdosProblems/531.lean new file mode 100644 index 0000000000..4f6cf3761a --- /dev/null +++ b/FormalConjectures/ErdosProblems/531.lean @@ -0,0 +1,93 @@ +/- +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 531 + +*Reference:* [erdosproblems.com/531](https://www.erdosproblems.com/531) + +Let $F(k)$ be the minimal $N$ such that if we two-colour $\{1,\ldots,N\}$ there +is a set $A$ of size $k$ such that all subset sums $\sum_{a\in S}a$ +(for $\emptyset\neq S\subseteq A$) are monochromatic. Estimate $F(k)$. + +Originally posed by Erdős [Er73]. + +The existence of $F(k)$ was established by Sanders and Folkman, and also follows +from Rado's theorem. This is commonly known as Folkman's theorem. + +Known lower bounds: +- Erdős–Spencer [ErSp89]: $F(k) \geq 2^{ck^2/\log k}$ for some $c > 0$. +- Balogh–Eberhard–Narayanan–Treglown–Wagner [BENTW17]: $F(k) \geq 2^{2^{k-1}/k}$. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[ErSp89] Erdős, P. and Spencer, J., _Monochromatic sumsets_. Journal of Combinatorial +Theory, Series A **50** (1989), 162–163. + +[BENTW17] Balogh, J., Eberhard, S., Narayanan, B., Treglown, A. and Wagner, A. Z., +_An improved lower bound for Folkman's theorem_. Bulletin of the London Mathematical +Society **49** (2017), 745–747. +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos531 + +/-- A 2-coloring $\chi : \mathbb{N} \to \mathrm{Bool}$ admits a **monochromatic subset-sum +$k$-set** within $\{1, \ldots, N\}$ if there is a $k$-element set +$A \subseteq \{1, \ldots, N\}$ whose non-empty subset sums all lie in +$\{1, \ldots, N\}$ and receive the same color. -/ +def HasMonoSubsetSumSet (χ : ℕ → Bool) (k N : ℕ) : Prop := + ∃ A : Finset ℕ, + A.card = k ∧ + (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) ∧ + (∀ S ∈ A.powerset, S.Nonempty → ∑ i ∈ S, i ≤ N) ∧ + ∃ c : Bool, ∀ S ∈ A.powerset, S.Nonempty → χ (∑ i ∈ S, i) = c + +/-- The **Folkman number** $F(k)$: the minimum $N$ such that every 2-coloring +of $\{1, \ldots, N\}$ admits a $k$-element subset whose non-empty subset sums +are monochromatic. -/ +noncomputable def folkmanNumber (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ χ : ℕ → Bool, HasMonoSubsetSumSet χ k N} + +/-- Folkman's theorem: for every $k$, the Folkman number $F(k)$ is finite. +That is, there exists $N$ such that every 2-coloring of $\{1, \ldots, N\}$ has a +monochromatic subset-sum $k$-set. -/ +@[category research solved, AMS 5] +theorem folkman_theorem (k : ℕ) : + ∃ N : ℕ, ∀ χ : ℕ → Bool, HasMonoSubsetSumSet χ k N := by + sorry + +/-- +**Erdős Problem 531** (lower bound, [BENTW17]): + +$F(k) \geq 2^{2^{k-1}/k}$ for all sufficiently large $k$. + +This is the best known lower bound on the Folkman number, due to +Balogh, Eberhard, Narayanan, Treglown, and Wagner. +-/ +@[category research solved, AMS 5] +theorem erdos_531 : + ∃ k₀ : ℕ, ∀ k : ℕ, k₀ ≤ k → + (folkmanNumber k : ℝ) ≥ (2 : ℝ) ^ ((2 : ℝ) ^ ((k : ℝ) - 1) / (k : ℝ)) := by + sorry + +end Erdos531 diff --git a/FormalConjectures/ErdosProblems/532.lean b/FormalConjectures/ErdosProblems/532.lean new file mode 100644 index 0000000000..78df348248 --- /dev/null +++ b/FormalConjectures/ErdosProblems/532.lean @@ -0,0 +1,76 @@ +/- +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 532 + +*Reference:* [erdosproblems.com/532](https://www.erdosproblems.com/532) + +If $\mathbb{N}$ is 2-coloured then is there some infinite set $A\subseteq \mathbb{N}$ +such that all finite subset sums $\sum_{n\in S}n$ (as $S$ ranges over all non-empty +finite subsets of $A$) are monochromatic? + +In other words, must some colour class be an IP set. Asked by Graham and Rothschild. + +Proved by Hindman [Hi74] for any number of colours. This is now known as +**Hindman's theorem** (or the Finite Sums theorem). + +See also [531] for the finite version (Folkman numbers) and [948]. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[Er75b] Erdős, P., _Problems and results in combinatorial number theory_. Journées +Arithmétiques de Bordeaux (Conf., Univ. Bordeaux, Bordeaux, 1974) (1975), 295–310. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +[Hi74] Hindman, N., _Finite sums from sequences within cells of a partition of N_, +Journal of Combinatorial Theory, Series A **17** (1974), 1–11. +-/ + +open Finset BigOperators + +namespace Erdos532 + +/-- **Hindman's theorem** (Erdős Problem 532, [Hi74]): +For any 2-colouring $\chi$ of the natural numbers, there exists an infinite set +$A$ of positive naturals such that all non-empty finite subset sums of elements +of $A$ are monochromatic. -/ +@[category research solved, AMS 5] +theorem erdos_532 : answer(True) ↔ + ∀ χ : ℕ → Bool, ∃ (A : Set ℕ), A.Infinite ∧ (∀ a ∈ A, 0 < a) ∧ + ∃ c : Bool, ∀ S : Finset ℕ, S.Nonempty → (↑S : Set ℕ) ⊆ A → + χ (∑ i ∈ S, i) = c := by + sorry + +/-- **Hindman's theorem (general version)** (Erdős Problem 532, [Hi74]): +For any finite colouring $\chi : \mathbb{N} \to \mathrm{Fin}\, r$ with $r \geq 1$, +there exists an infinite set $A$ of positive naturals such that all non-empty finite +subset sums of elements of $A$ are monochromatic. +This is the full strength of Hindman's theorem, generalising `erdos_532` from 2 colours +to any finite number of colours. -/ +@[category research solved, AMS 5] +theorem erdos_532_general (r : ℕ) (hr : 0 < r) (χ : ℕ → Fin r) : + ∃ (A : Set ℕ), A.Infinite ∧ (∀ a ∈ A, 0 < a) ∧ + ∃ c : Fin r, ∀ S : Finset ℕ, S.Nonempty → (↑S : Set ℕ) ⊆ A → + χ (∑ i ∈ S, i) = c := by + sorry + +end Erdos532 diff --git a/FormalConjectures/ErdosProblems/533.lean b/FormalConjectures/ErdosProblems/533.lean new file mode 100644 index 0000000000..0ae4751f8b --- /dev/null +++ b/FormalConjectures/ErdosProblems/533.lean @@ -0,0 +1,67 @@ +/- +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 533 + +*Reference:* [erdosproblems.com/533](https://www.erdosproblems.com/533) + +Let $\delta > 0$. If $n$ is sufficiently large and $G$ is a graph on $n$ vertices with no $K_5$ +and at least $\delta n^2$ edges, must $G$ contain a set of $\gg_\delta n$ vertices containing no +triangle? Equivalently, is $\delta_3(5) = 0$? Disproved by Balogh and Lenz [BaLe13]. +The exact value $\delta_3(5) = 1/12$ was established by Liu, Reiher, Sharifzadeh, and +Staden [LRSS21]. The construction of Erdős and Rogers [ErRo62] is also related. + +[BaLe13] Balogh, J. and Lenz, J., _On the Ramsey-Turán numbers of graphs and hypergraphs_. +Israel J. Math. (2013), 45–68. + +[LRSS21] Liu, H., Reiher, C., Sharifzadeh, M., and Staden, K., _Geometric construction for +Ramsey-Turán theory_. arXiv:2103.10423 (2021). + +[ErRo62] Erdős, P. and Rogers, C.A., _The construction of certain graphs_. Canadian J. Math. +(1962), 702–707. +-/ + +open SimpleGraph + +namespace Erdos533 + +/-- +Let $\delta > 0$. If $n$ is sufficiently large and $G$ is a graph on $n$ vertices with no $K_5$ +and at least $\delta n^2$ edges, then $G$ contains a set of $\gg_\delta n$ vertices containing no +triangle. + +Equivalently, the conjecture asks whether $\delta_3(5) = 0$, where $\delta_3(5)$ is the +Ramsey-Turán density. This was disproved by Balogh and Lenz [BaLe13], who +showed $\delta_3(5) > 0$. The correct value is $\delta_3(5) = 1/12$ [LRSS21]. +-/ +@[category research solved, AMS 5] +theorem erdos_533 : answer(False) ↔ + ∀ δ : ℝ, 0 < δ → + ∃ c : ℝ, 0 < c ∧ + ∃ N : ℕ, + ∀ n : ℕ, N ≤ n → + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 5 → + δ * (n : ℝ) ^ 2 ≤ (G.edgeSet.ncard : ℝ) → + ∃ S : Finset (Fin n), + c * (n : ℝ) ≤ (S.card : ℝ) ∧ + (G.induce (S : Set (Fin n))).CliqueFree 3 := by + sorry + +end Erdos533 diff --git a/FormalConjectures/ErdosProblems/534.lean b/FormalConjectures/ErdosProblems/534.lean new file mode 100644 index 0000000000..388d7ace19 --- /dev/null +++ b/FormalConjectures/ErdosProblems/534.lean @@ -0,0 +1,80 @@ +/- +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 534 + +*Reference:* [erdosproblems.com/534](https://www.erdosproblems.com/534) + +What is the largest possible subset $A \subseteq \{1, \ldots, N\}$ containing $N$ such that +$\gcd(a, b) > 1$ for all distinct $a, b \in A$? + +A problem of Erdős and Graham [Er73]. They originally conjectured that the +maximum is either $N/p$ (where $p$ is the smallest prime factor of $N$) or the number +of even integers $2t \leq N$ with $\gcd(2t, N) > 1$. Ahlswede and Khachatrian found +a counterexample to this conjecture in 1992. + +Erdős then gave a refined conjecture: if $N = q_1^{k_1} \cdots q_r^{k_r}$ where +$q_1 < \cdots < q_r$ are distinct primes, then the maximum is achieved by taking, +for some $1 \leq j \leq r$, all integers in $[1, N]$ divisible by at least one element +of $\{2q_1, \ldots, 2q_j, q_1 \cdots q_j\}$. + +This was proved by Ahlswede and Khachatrian [AhKh96]. + +See also: Problem 56. OEIS: A387543, A387698. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, +Colo., 1971) (1973), 117-138. + +[AhKh96] Ahlswede, R., Khachatrian, L.H., *Sets of integers with pairwise common divisor +and a factor from a specified set of primes*. Acta Arithmetica (1996), 259-276. +-/ + +open Finset BigOperators Classical + +namespace Erdos534 + +/-- The Erdős–Ahlswede–Khachatrian candidate family: for a set $S$ of primes, + all $m \in \{1, \ldots, N\}$ divisible by $2p$ for some $p \in S$ or by + $\prod_{p \in S} p$. -/ +noncomputable def candidate (N : ℕ) (S : Finset ℕ) : Finset ℕ := + (Icc 1 N).filter fun m => + (∃ p ∈ S, (2 * p) ∣ m) ∨ (∏ p ∈ S, p) ∣ m + +/-- +Erdős Problem 534 [Er73], proved by Ahlswede–Khachatrian [AhKh96]: + +If $q_1 < \cdots < q_r$ are the distinct prime factors of $N \geq 2$, then the maximum size +of a subset $A \subseteq \{1, \ldots, N\}$ containing $N$ with $\gcd(a, b) > 1$ for all distinct +$a, b \in A$ is achieved by the candidate family for some initial segment +$\{q_1, \ldots, q_j\}$ of the prime factors. +-/ +@[category research solved, AMS 5 11] +theorem erdos_534 (N : ℕ) (hN : 2 ≤ N) : + ∃ S : Finset ℕ, S ⊆ N.primeFactors ∧ S.Nonempty ∧ + (∀ p ∈ N.primeFactors, ∀ q ∈ S, p ≤ q → p ∈ S) ∧ + N ∈ candidate N S ∧ + (∀ a ∈ candidate N S, ∀ b ∈ candidate N S, + a ≠ b → 1 < Nat.gcd a b) ∧ + (∀ A : Finset ℕ, A ⊆ Icc 1 N → N ∈ A → + (∀ a ∈ A, ∀ b ∈ A, a ≠ b → 1 < Nat.gcd a b) → + A.card ≤ (candidate N S).card) := by + sorry + +end Erdos534 diff --git a/FormalConjectures/ErdosProblems/535.lean b/FormalConjectures/ErdosProblems/535.lean new file mode 100644 index 0000000000..d1700a48e3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/535.lean @@ -0,0 +1,135 @@ +/- +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 535 + +*Reference:* [erdosproblems.com/535](https://www.erdosproblems.com/535) + +Let $r \geq 3$, and let $f_r(N)$ denote the size of the largest subset of +$\{1, \ldots, N\}$ such that no subset of size $r$ has the same pairwise +greatest common divisor between all elements. Estimate $f_r(N)$. + +Erdős [Er64] proved that $f_r(N) \leq N^{3/4+o(1)}$, and Abbott and Hanson +[AbHa70] improved this exponent to $1/2$. Erdős [Er64] proved the lower bound +$f_3(N) > N^{c/\log\log N}$ for some constant $c > 0$, and conjectured this +should also be an upper bound. + +This problem is intimately connected with the sunflower problem [20]. +See also Problem 536, the dual problem about triples with equal pairwise LCM. + +[Er64] Erdős, P., *On a problem in elementary number theory and a +combinatorial problem*. Math. Comp. (1964), 644--646. + +[Er69] Erdős, P., *On some applications of graph theory to number theoretic +problems*. Publ. Ramanujan Inst. 1 (1969), 131--136. + +[Er70] Erdős, P. (1970) + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. +A survey of combinatorial theory (Proc. Internat. Sympos., Colorado State +Univ., Fort Collins, Colo., 1971) (1973), 117--138. + +[AbHa70] Abbott, H.L. and Hanson, D., *An extremal problem in number theory*. +Bull. London Math. Soc. (1970), 324--326. +-/ + +open Finset Real + +namespace Erdos535 + +/-- A set $A$ of natural numbers is $r$-GCD-uniform-free if no $r$-element +subset has all pairwise GCDs equal. That is, there is no $r$-element subset +$S \subseteq A$ and value $d$ such that $\gcd(a, b) = d$ for all distinct +$a, b \in S$. -/ +def IsGCDUniformFree (A : Finset ℕ) (r : ℕ) : Prop := + ∀ S : Finset ℕ, S ⊆ A → S.card = r → + ¬∃ d : ℕ, ∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.gcd a b = d + +/-- +**Erdős Problem 535** (Upper bound conjecture): + +There exists a constant $c > 0$ and $N_0$ such that for all $N \geq N_0$, every +$3$-GCD-uniform-free subset of $\{1, \ldots, N\}$ has size at most +$N^{c / \log\log N}$. + +Erdős [Er64] conjectured this specifically for $r = 3$, matching the proved +lower bound. + +See [Er64]. +-/ +@[category research open, AMS 5 11] +theorem erdos_535 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, A ⊆ Icc 1 N → IsGCDUniformFree A 3 → + (A.card : ℝ) ≤ (N : ℝ) ^ (c / Real.log (Real.log (N : ℝ))) := by + sorry + +/-- +**Erdős Problem 535** (Lower bound, proved by Erdős [Er64] for $r = 3$): + +There exists a constant $c > 0$ and $N_0$ such that for all $N \geq N_0$, +there exists a $3$-GCD-uniform-free subset of $\{1, \ldots, N\}$ of size at +least $N^{c / \log\log N}$. + +See [Er64]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_535.variants.lower_bound : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ A : Finset ℕ, A ⊆ Icc 1 N ∧ IsGCDUniformFree A 3 ∧ + (N : ℝ) ^ (c / Real.log (Real.log (N : ℝ))) ≤ (A.card : ℝ) := by + sorry + +/-- +**Erdős Problem 535** (Erdős's original upper bound [Er64]): + +There exists $N_0$ such that for all $r \geq 3$ and $N \geq N_0$, every +$r$-GCD-uniform-free subset of $\{1, \ldots, N\}$ has size at most +$N^{3/4 + o(1)}$. More precisely, for every $\varepsilon > 0$ there exists +$N_0$ such that $f_r(N) \leq N^{3/4 + \varepsilon}$ for all $N \geq N_0$. + +See [Er64]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_535.variants.erdos_upper_bound (r : ℕ) (hr : 3 ≤ r) (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, A ⊆ Icc 1 N → IsGCDUniformFree A r → + (A.card : ℝ) ≤ (N : ℝ) ^ (3 / 4 + ε) := by + sorry + +/-- +**Erdős Problem 535** (Abbott-Hanson upper bound [AbHa70]): + +For all $r \geq 3$, for every $\varepsilon > 0$ there exists $N_0$ such that +for all $N \geq N_0$, every $r$-GCD-uniform-free subset of $\{1, \ldots, N\}$ +has size at most $N^{1/2 + \varepsilon}$. This improves Erdős's original +$3/4$ exponent. + +See [AbHa70]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_535.variants.abbott_hanson_upper_bound (r : ℕ) (hr : 3 ≤ r) (ε : ℝ) (hε : 0 < ε) : + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset ℕ, A ⊆ Icc 1 N → IsGCDUniformFree A r → + (A.card : ℝ) ≤ (N : ℝ) ^ (1 / 2 + ε) := by + sorry + +end Erdos535 diff --git a/FormalConjectures/ErdosProblems/537.lean b/FormalConjectures/ErdosProblems/537.lean new file mode 100644 index 0000000000..4281b495a3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/537.lean @@ -0,0 +1,59 @@ +/- +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 537 + +*Reference:* [erdosproblems.com/537](https://www.erdosproblems.com/537) + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117-138. +-/ + +namespace Erdos537 + +open Finset Nat Filter + +/-- +**Erdős Problem 537** (Disproved by Ruzsa): + +Let $\varepsilon > 0$ and $N$ be sufficiently large. If $A \subseteq \{1, \ldots, N\}$ has +$|A| \geq \varepsilon N$, must there exist $a_1, a_2, a_3 \in A$ and distinct primes +$p_1, p_2, p_3$ such that $a_1 p_1 = a_2 p_2 = a_3 p_3$? + +A positive answer would imply Problem 536. + +Disproved by a construction of Ruzsa: consider the set of all squarefree numbers of the shape +$p_1 \cdots p_r$ where $p_{i+1} > 2p_i$ for $1 \leq i < r$. This set has positive density. If +$A$ is its intersection with $(N/2, N)$ then $|A| \gg N$ for all large $N$, yet no three +elements $a_1, a_2, a_3 \in A$ and distinct primes $p_1, p_2, p_3$ satisfy +$a_1 p_1 = a_2 p_2 = a_3 p_3$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_537 : answer(False) ↔ + ∀ᵉ (ε > (0 : ℝ)), ∀ᶠ N in atTop, + ∀ (A : Finset ℕ), A ⊆ Icc 1 N → (ε * (N : ℝ)) ≤ (A.card : ℝ) → + ∃ᵉ (a₁ ∈ A) (a₂ ∈ A) (a₃ ∈ A), + ∃ p₁ p₂ p₃ : ℕ, + Nat.Prime p₁ ∧ Nat.Prime p₂ ∧ Nat.Prime p₃ ∧ + p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₂ ≠ p₃ ∧ + a₁ * p₁ = a₂ * p₂ ∧ a₁ * p₁ = a₃ * p₃ := by + sorry + +end Erdos537 diff --git a/FormalConjectures/ErdosProblems/538.lean b/FormalConjectures/ErdosProblems/538.lean new file mode 100644 index 0000000000..ababe4c1d9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/538.lean @@ -0,0 +1,90 @@ +/- +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 538 + +*Reference:* [erdosproblems.com/538](https://www.erdosproblems.com/538) + +Let $r \geq 2$ and suppose that $A \subseteq \{1, \ldots, N\}$ is such that, for +any $m$, there are at most $r$ solutions to $m = pa$ where $p$ is prime and +$a \in A$. Give the best possible upper bound for $\sum_{n \in A} 1/n$. + +Erdős observed that +$$\sum_{n \in A} \frac{1}{n} \sum_{p \leq N} \frac{1}{p} + \leq r \sum_{m \leq N^2} \frac{1}{m} \ll r \log N,$$ +and hence +$$\sum_{n \in A} \frac{1}{n} \ll r \frac{\log N}{\log \log N}.$$ + +The problem asks whether this bound is the best possible. + +See also [536] and [537]. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. +-/ + +open Finset Real + +namespace Erdos538 + +/-- The number of representations of $m$ as $p \cdot a$ where $p$ is prime and +$a \in A$. Since $p$ is determined by $a$ (as $p = m / a$), this counts +elements $a \in A$ with $a \mid m$ and $m / a$ prime. -/ +def numPrimeProductReps (A : Finset ℕ) (m : ℕ) : ℕ := + (A.filter (fun a => a ∣ m ∧ Nat.Prime (m / a))).card + +/-- +**Erdős Problem 538** (Sharpness conjecture): + +The upper bound is best possible: there exists $c > 0$ such that for all +$r \geq 2$ and sufficiently large $N$, there exists $A \subseteq \{1, \ldots, N\}$ satisfying +the representation constraint with +$$\sum_{n \in A} \frac{1}{n} \geq c \cdot r \cdot \frac{\log N}{\log \log N}.$$ +-/ +@[category research open, AMS 11] +theorem erdos_538 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ r : ℕ, 2 ≤ r → + ∃ A : Finset ℕ, A ⊆ Icc 1 N ∧ + (∀ m : ℕ, numPrimeProductReps A m ≤ r) ∧ + c * (r : ℝ) * (Real.log (N : ℝ) / Real.log (Real.log (N : ℝ))) ≤ + A.sum (fun n => (1 : ℝ) / (n : ℝ)) := by + sorry + +/-- +**Erdős Problem 538** (Erdős's upper bound): + +There exists a constant $C > 0$ such that for all $r \geq 2$ and sufficiently +large $N$, if $A \subseteq \{1, \ldots, N\}$ has at most $r$ representations $m = p \cdot a$ +(with $p$ prime and $a \in A$) for every $m$, then +$$\sum_{n \in A} \frac{1}{n} \leq C \cdot r \cdot \frac{\log N}{\log \log N}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_538.variants.upper_bound : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ r : ℕ, 2 ≤ r → + ∀ A : Finset ℕ, A ⊆ Icc 1 N → + (∀ m : ℕ, numPrimeProductReps A m ≤ r) → + A.sum (fun n => (1 : ℝ) / (n : ℝ)) ≤ + C * (r : ℝ) * (Real.log (N : ℝ) / Real.log (Real.log (N : ℝ))) := by + sorry + +end Erdos538 diff --git a/FormalConjectures/ErdosProblems/539.lean b/FormalConjectures/ErdosProblems/539.lean new file mode 100644 index 0000000000..75a64209f8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/539.lean @@ -0,0 +1,74 @@ +/- +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 539 + +*Reference:* [erdosproblems.com/539](https://www.erdosproblems.com/539) + +Let $h(n)$ be such that, for any set $A \subseteq \mathbb{N}$ of size $n$, the set +$$\left\{ \frac{a}{\gcd(a,b)} : a, b \in A \right\}$$ +has size at least $h(n)$. Erdős and Szemerédi proved that $n^{1/2} \ll h(n) \ll n^{1-c}$ for some +constant $c > 0$. The upper bound has been improved to $h(n) \ll n^{2/3}$ by Freiman and Lev. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., +1971) (1973), 117–138. + +[GrRo99] Granville, A., Roesler, F., *The set of differences of a given set*. American +Mathematical Monthly (1999), 338–344. +-/ + +open Finset + +namespace Erdos539 + +/-- The set of gcd-quotients $\{a / \gcd(a, b) : a, b \in A\}$ for a finite set $A$ of +natural numbers. -/ +def gcdQuotientSet (A : Finset ℕ) : Finset ℕ := + (A ×ˢ A).image (fun p => p.1 / Nat.gcd p.1 p.2) + +/-- +**Erdős Problem 539** (Lower bound, Erdős-Szemerédi): + +There exists a constant $C > 0$ such that for any finite set $A$ of positive integers +of size $n$, the set $\{a / \gcd(a, b) : a, b \in A\}$ has size at least $C \cdot n^{1/2}$. +-/ +@[category research solved, AMS 11] +theorem erdos_539 : + ∃ C : ℝ, 0 < C ∧ + ∀ A : Finset ℕ, (∀ a ∈ A, 0 < a) → + C * ((A.card : ℝ) ^ ((1 : ℝ) / 2)) ≤ ((gcdQuotientSet A).card : ℝ) := by + sorry + +/-- +**Erdős Problem 539** (Upper bound, Freiman-Lev): + +There exists a constant $C > 0$ such that for all sufficiently large $n$, there exists +a finite set $A$ of positive integers of size $n$ whose gcd-quotient set has size at most +$C \cdot n^{2/3}$. +-/ +@[category research solved, AMS 11] +theorem erdos_539.variants.upper_bound : + ∃ C : ℝ, 0 < C ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + ∃ A : Finset ℕ, (∀ a ∈ A, 0 < a) ∧ A.card = n ∧ + ((gcdQuotientSet A).card : ℝ) ≤ C * ((n : ℝ) ^ ((2 : ℝ) / 3)) := by + sorry + +end Erdos539 diff --git a/FormalConjectures/ErdosProblems/54.lean b/FormalConjectures/ErdosProblems/54.lean new file mode 100644 index 0000000000..e325356e4b --- /dev/null +++ b/FormalConjectures/ErdosProblems/54.lean @@ -0,0 +1,89 @@ +/- +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 54 + +*Reference:* [erdosproblems.com/54](https://www.erdosproblems.com/54) + +There exists a Ramsey 2-complete set $A$ (every large integer is a monochromatic subset sum +under any 2-colouring) with $|A \cap \{1,\ldots,N\}| \leq c (\log N)^2$. +Resolved by Conlon, Fox, and Pham [CFP21]. + +See also Problems 55 and 843. + +[BuEr85] Burr, S. A. and Erdős, P., _A Ramsey-type property in additive number theory_. +Glasgow Math. J. (1985), 5–10. +[Er95] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and +geometry_. Resenhas (1995), 165–186. +[CFP21] Conlon, D., Fox, J., and Pham, H.T., _Subset sums, completeness and colorings_. +arXiv:2104.14766 (2021). +-/ + +open scoped Classical +open Finset Real + +namespace Erdos54 + +/-- +A set $A$ of natural numbers is Ramsey $r$-complete if for every $r$-coloring of $\mathbb{N}$, +all sufficiently large natural numbers can be represented as a sum of distinct +elements of $A$ that all receive the same color. +-/ +def IsRamseyComplete (A : Set ℕ) (r : ℕ) : Prop := + ∀ (χ : ℕ → Fin r), + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∃ (S : Finset ℕ), (↑S : Set ℕ) ⊆ A ∧ + (∃ c : Fin r, ∀ x ∈ S, χ x = c) ∧ + S.sum id = n + +/-- +Erdős Problem 54 (resolved by Conlon, Fox, and Pham [CFP21]): +There exists a Ramsey 2-complete set $A$ of positive integers and a constant $c > 0$ +such that $|A \cap \{1, \ldots, N\}| \leq c \cdot (\log N)^2$ for all sufficiently large $N$. + +This improves the upper bound $(2 \log_2 N)^3$ of Burr and Erdős [BuEr85], matching the +lower bound order of $(\log N)^2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_54 : + ∃ (A : Set ℕ), + IsRamseyComplete A 2 ∧ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + c * (Real.log (N : ℝ)) ^ 2 := by + sorry + +/-- +Lower bound (Burr–Erdős [BuEr85]): there exists $c > 0$ such that any set $A$ with +$|A \cap \{1, \ldots, N\}| \leq c \cdot (\log N)^2$ for all large $N$ cannot be +Ramsey 2-complete. Together with `erdos_54`, this shows the optimal growth rate +is $\Theta((\log N)^2)$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_54.variants.lower_bound : + ∃ c : ℝ, c > 0 ∧ + ∀ (A : Set ℕ), + (∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + c * (Real.log (N : ℝ)) ^ 2) → + ¬ IsRamseyComplete A 2 := by + sorry + +end Erdos54 diff --git a/FormalConjectures/ErdosProblems/540.lean b/FormalConjectures/ErdosProblems/540.lean new file mode 100644 index 0000000000..cf4cb2ad98 --- /dev/null +++ b/FormalConjectures/ErdosProblems/540.lean @@ -0,0 +1,82 @@ +/- +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 540 + +Is it true that if $A \subseteq \mathbb{Z}/N\mathbb{Z}$ has size $\gg N^{1/2}$ then there exists +some non-empty $S \subseteq A$ such that $\sum_{n \in S} n \equiv 0 \pmod{N}$? + +*Reference:* [erdosproblems.com/540](https://www.erdosproblems.com/540) + +[ErHe64] Erdős, P., Heilbronn, H., _On the addition of residue classes mod p_, +Acta Arith. **9** (1964), 149–159. + +[Ol68] Olson, J. E., _An addition theorem modulo p_, J. Combinatorial Theory **5** (1968), 45–52. + +[Sz70] Szemerédi, E., _On a conjecture of Erdős and Heilbronn_, Acta Arith. **17** (1970), 227–229. + +[HaZe96] Hamidoune, Y. O., Zémor, G., _On zero-free subset sums_, +Acta Arith. **78** (1996), 143–152. + +[Ba12] Balandraud, É., _An addition theorem and maximal zero-sum free sets in ℤ/pℤ_, +Israel J. Math. **188** (2012), 405–429. +-/ + +open Finset BigOperators + +namespace Erdos540 + +/-- +Erdős Problem 540: + +Is it true that if $A \subseteq \mathbb{Z}/N\mathbb{Z}$ has size $\gg N^{1/2}$ then there exists +some non-empty $S \subseteq A$ such that $\sum_{n \in S} n \equiv 0 \pmod{N}$? + +The answer is yes. This was originally posed by Erdős and Heilbronn [ErHe64]. +It was proved for $N$ prime by Olson [Ol68], and for all $N$ by +Szemerédi [Sz70] (in fact for arbitrary finite abelian groups). + +Erdős speculated that the correct threshold is $(2N)^{1/2}$; this was proved for $N$ prime +by Balandraud [Ba12]. Hamidoune and Zémor [HaZe96] established a bound of +$(1+o(1))\sqrt{2N}$ for arbitrary abelian groups of order $N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_540 : answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ (N : ℕ), 0 < N → + ∀ (A : Finset (ZMod N)), + (A.card : ℝ) ≥ C * Real.sqrt (N : ℝ) → + ∃ S : Finset (ZMod N), S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, n) = 0 := by + sorry + +/-- +Erdős Problem 540 — sharp constant for prime modulus (Balandraud [Ba12]): + +For $p$ prime, if $A \subseteq \mathbb{Z}/p\mathbb{Z}$ has size at least $\sqrt{2p}$, +then there exists a non-empty $S \subseteq A$ such that $\sum_{n \in S} n = 0$. + +This gives the sharp threshold conjectured by Erdős and Selfridge. +-/ +@[category research solved, AMS 5 11] +theorem erdos_540_prime_sharp (p : ℕ) (hp : p.Prime) (A : Finset (ZMod p)) + (hA : (A.card : ℝ) ≥ Real.sqrt (2 * p)) : + ∃ S : Finset (ZMod p), S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, n) = 0 := by + sorry + +end Erdos540 diff --git a/FormalConjectures/ErdosProblems/542.lean b/FormalConjectures/ErdosProblems/542.lean new file mode 100644 index 0000000000..ce07245c7f --- /dev/null +++ b/FormalConjectures/ErdosProblems/542.lean @@ -0,0 +1,68 @@ +/- +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 542 + +Let $A \subseteq \{1, \ldots, n\}$ be such that $\operatorname{lcm}(a, b) > n$ for all distinct +$a, b \in A$. + +1. Is it true that $\sum_{a \in A} 1/a \leq 31/30$? +2. Must there be $\gg n$ many integers $m \leq n$ that do not divide any element of $A$? + +Schinzel and Szekeres answered (1) affirmatively and (2) negatively. +Chen later proved that for $n > 172509$, the sum is less than +$1/3 + 1/4 + 1/5 + 1/7 + 1/11$. + +See also [Problem 784](https://www.erdosproblems.com/784). + +## References + +* [ScSz59] Schinzel, A., Szekeres, G., _Sur un problème de M. Paul Erdős_. + Acta Sci. Math. (Szeged) (1959), 221–229. +* [Ch96] Chen, Y.-G., _On a problem of P. Erdős_. + Acta Sci. Math. (Szeged) (1996), 101–114. +* [Er73] Erdős, P., _Problems and results on combinatorial number theory_. + A survey of combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., + Fort Collins, Colo., 1971) (1973), 117–138. +* [Er98] Erdős, P., _Some of my new and almost new problems and results in + combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +*Reference:* [erdosproblems.com/542](https://www.erdosproblems.com/542) +-/ + +open Finset BigOperators + +namespace Erdos542 + +/-- +Erdős Problem 542 (proved by Schinzel and Szekeres (1959) [ScSz59]): +If $A \subseteq \{1, \ldots, n\}$ is such that $\operatorname{lcm}(a, b) > n$ for all distinct +$a, b \in A$, then $\sum_{a \in A} 1/a \leq 31/30$. + +The bound $31/30 = 1/2 + 1/3 + 1/5$ is best possible, as $A = \{2, 3, 5\}$ demonstrates. +-/ +@[category research solved, AMS 5 11] +theorem erdos_542 : + ∀ (n : ℕ) (A : Finset ℕ), + (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) → + (∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.lcm a b > n) → + (∑ a ∈ A, (1 : ℝ) / (a : ℝ)) ≤ 31 / 30 := by + sorry + +end Erdos542 diff --git a/FormalConjectures/ErdosProblems/543.lean b/FormalConjectures/ErdosProblems/543.lean new file mode 100644 index 0000000000..ac3009a201 --- /dev/null +++ b/FormalConjectures/ErdosProblems/543.lean @@ -0,0 +1,95 @@ +/- +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 543 + +*Reference:* [erdosproblems.com/543](https://www.erdosproblems.com/543) + +Define $f(N)$ as the minimal $k$ such that a random $k$-element subset of an abelian group +of order $N$ is subset-sum complete with probability $\geq 1/2$. Erdős and Rényi proved +$f(N) \leq \log_2 N + O(\log \log N)$. This problem asks whether the bound can be improved +to $f(N) \leq \log_2 N + o(\log \log N)$. Disproved by ChatGPT and Tang. + +Related: [Erdős Problem 1179](https://www.erdosproblems.com/1179). + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., 1971) +(1973), 117-138. + +[ErRe65] Erdős, P. and Rényi, A., *Probabilistic methods in group theory*. J. Analyse Math. +(1965), 127-138. + +[ErHa78b] Erdős, P. and Hall, R.R., *Some new results in probabilistic group theory*. Comment. +Math. Helv. (1978), 448-457. +-/ + +open Finset Filter Classical + +open scoped BigOperators + +namespace Erdos543 + +/-- A subset $A$ of an additive commutative group is subset-sum complete if every +element of the group can be expressed as a sum over some subset of $A$. -/ +def SubsetSumComplete {G : Type*} [AddCommGroup G] + (A : Finset G) : Prop := + ∀ g : G, ∃ S : Finset G, S ⊆ A ∧ ∑ x ∈ S, x = g + +/-- The number of $k$-element subsets of $\mathbb{Z}/n\mathbb{Z}$ that are subset-sum complete. +Returns $0$ when $n = 0$ (since $\mathbb{Z}/0\mathbb{Z} = \mathbb{Z}$ is not finite). -/ +noncomputable def sscCountMod (n k : ℕ) : ℕ := + if h : n = 0 then 0 + else by + haveI : NeZero n := ⟨h⟩ + exact ((Finset.univ : Finset (ZMod n)).powersetCard k).filter + (fun A => SubsetSumComplete A) |>.card + +/-- The total number of $k$-element subsets of $\mathbb{Z}/n\mathbb{Z}$. +Returns $0$ when $n = 0$. -/ +noncomputable def totalSubsetsMod (n k : ℕ) : ℕ := + if h : n = 0 then 0 + else by + haveI : NeZero n := ⟨h⟩ + exact ((Finset.univ : Finset (ZMod n)).powersetCard k).card + +/-- +Erdős Problem 543 (disproved): + +Define $f(N)$ as the minimal $k$ such that for every abelian group $G$ of size $N$, +a uniformly random subset $A \subseteq G$ of size $k$ is subset-sum complete with +probability $\geq 1/2$. Erdős and Rényi [ErRe65] proved $f(N) \leq \log_2 N + O(\log \log N)$. + +The conjecture asked whether $f(N) \leq \log_2 N + o(\log \log N)$. Erdős believed +this improvement is impossible [Er73, p.127], [ErHa78b]. + +This was confirmed (conjecture disproved) by ChatGPT and Tang. The +formalization states: no function $g = o(\log \log N)$ can improve the bound, +even for cyclic groups $\mathbb{Z}/N\mathbb{Z}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_543 : + answer(False) ↔ + (∃ g : ℕ → ℝ, + Tendsto (fun N => g N / Real.log (Real.log (N : ℝ))) atTop (nhds 0) ∧ + ∀ᶠ (N : ℕ) in atTop, + let k := Nat.ceil (Real.log (↑N : ℝ) / Real.log 2 + g N) + 2 * sscCountMod N k ≥ totalSubsetsMod N k) := by + sorry + +end Erdos543 diff --git a/FormalConjectures/ErdosProblems/544.lean b/FormalConjectures/ErdosProblems/544.lean new file mode 100644 index 0000000000..ccf2dafbfd --- /dev/null +++ b/FormalConjectures/ErdosProblems/544.lean @@ -0,0 +1,72 @@ +/- +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 544 + +*Reference:* [erdosproblems.com/544](https://www.erdosproblems.com/544) + +Show that $R(3,k+1) - R(3,k) \to \infty$ as $k \to \infty$. +Similarly, prove or disprove that $R(3,k+1) - R(3,k) = o(k)$. + +A problem of Erdős and Sós. See also [165] and [1014]. + +Related OEIS sequence: [A000791](https://oeis.org/A000791). + +[Er81c] Erdős, P., _Some problems in combinatorics, graph theory and probability_ (1981). + +[Er93] Erdős, P., _Some of my favourite problems in various branches of combinatorics_ (1993), p. 339. +-/ + +open SimpleGraph Filter + +namespace Erdos544 + +/-- The Ramsey number $R(3,k)$: the minimum $N$ such that every simple graph +on $N$ vertices contains either a triangle ($3$-clique) or an independent +set of size $k$ (a $k$-clique in the complement). -/ +noncomputable def ramseyR3 (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree k} + +/-- +Erdős Problem 544 (Part 1) [Er81c][Er93, p. 339]: + +Show that $R(3,k+1) - R(3,k) \to \infty$ as $k \to \infty$. + +That is, the consecutive differences of the Ramsey numbers $R(3,k)$ +tend to infinity. +-/ +@[category research open, AMS 5] +theorem erdos_544 : + Tendsto (fun k : ℕ => (ramseyR3 (k + 1) : ℤ) - (ramseyR3 k : ℤ)) + atTop atTop := by + sorry + +/-- +Erdős Problem 544 (Part 2) [Er81c][Er93, p. 339]: + +Prove or disprove that $R(3,k+1) - R(3,k) = o(k)$, i.e., +$(R(3,k+1) - R(3,k)) / k \to 0$ as $k \to \infty$. +-/ +@[category research open, AMS 5] +theorem erdos_544.variants.little_o : answer(sorry) ↔ + Tendsto (fun k : ℕ => ((ramseyR3 (k + 1) : ℝ) - (ramseyR3 k : ℝ)) / (k : ℝ)) + atTop (nhds 0) := by + sorry + +end Erdos544 diff --git a/FormalConjectures/ErdosProblems/545.lean b/FormalConjectures/ErdosProblems/545.lean new file mode 100644 index 0000000000..ccadbc3538 --- /dev/null +++ b/FormalConjectures/ErdosProblems/545.lean @@ -0,0 +1,94 @@ +/- +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 545 + +*Reference:* [erdosproblems.com/545](https://www.erdosproblems.com/545) + +Let $G$ be a graph with $m$ edges and no isolated vertices. Is the Ramsey number $R(G)$ +maximised when $G$ is 'as complete as possible'? That is, if $m = \binom{n}{2} + t$ edges +with $0 \leq t < n$ then is $R(G) \leq R(H)$, where $H$ is the graph formed by connecting a +new vertex to $t$ of the vertices of $K_n$? + +A question of Erdős and Graham [ErGr75, p.526] [Er84b, p.11]. + +The weaker question of whether $R(G) \leq 2^{O(\sqrt{m})}$ is Problem 546, proved by +Sudakov [Su11]. Known counterexamples to the literal statement exist for small $m$ +($2 \leq m \leq 5$ and $7 \leq m \leq 9$). + +[ErGr75] Erdős, P. and Graham, R., _On partition theorems for finite graphs_. +Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on his 60th birthday), +Vol. I; Colloq. Math. Soc. János Bolyai, Vol. 10, North-Holland, Amsterdam, 1975, pp. 515–527. + +[Er84b] Erdős, P., _On some problems in graph theory, combinatorial analysis and +combinatorial number theory_. Graph theory and combinatorics (Cambridge, 1983), +Academic Press, London (1984), 1-17. + +[Su11] Sudakov, B., _A conjecture of Erdős on graph Ramsey numbers_. Advances in +Mathematics 227 (2011), 601-609. +-/ + +open SimpleGraph + +namespace Erdos545 + +/-- A graph $H$ contains a copy of graph $G$ (as a subgraph) if there is an injective +function from $V(G)$ to $V(H)$ that preserves adjacency. -/ +def ContainsSubgraphCopy {V W : Type*} (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : V → W, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) + +/-- The diagonal Ramsey number $R(G)$ for a graph $G$ on $\operatorname{Fin}(k)$: the minimum +$N$ such that every graph $H$ on $N$ vertices contains a copy of $G$ or its complement +contains a copy of $G$. -/ +noncomputable def ramseyNumber {k : ℕ} (G : SimpleGraph (Fin k)) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + ContainsSubgraphCopy G H ∨ ContainsSubgraphCopy G Hᶜ} + +/-- The "as complete as possible" graph with $\binom{n}{2} + t$ edges on $n + 1$ vertices. +The first $n$ vertices form $K_n$, and the last vertex is adjacent to the +first $t$ of $K_n$'s vertices. -/ +def asCompleteAsPossible (n t : ℕ) : SimpleGraph (Fin (n + 1)) where + Adj u v := + u ≠ v ∧ ((u.val < n ∧ v.val < n) ∨ + (u.val = n ∧ v.val < t) ∨ + (v.val = n ∧ u.val < t)) + symm u v := by + rintro ⟨hne, h | h | h⟩ + · exact ⟨hne.symm, Or.inl ⟨h.2, h.1⟩⟩ + · exact ⟨hne.symm, Or.inr (Or.inr h)⟩ + · exact ⟨hne.symm, Or.inr (Or.inl h)⟩ + loopless u h := h.1 rfl + +/-- +Erdős Problem 545 [ErGr75, Er84b]: + +Let $G$ be a graph with $m$ edges and no isolated vertices. Is the Ramsey number +$R(G)$ maximised when $G$ is 'as complete as possible'? That is, if +$m = \binom{n}{2} + t$ edges with $0 \leq t < n$ then is $R(G) \leq R(H)$, where $H$ +is the graph formed by connecting a new vertex to $t$ of the vertices of $K_n$? +-/ +@[category research open, AMS 5] +theorem erdos_545 : answer(sorry) ↔ ∀ (n t k : ℕ), t < n → + ∀ (G : SimpleGraph (Fin k)), + G.edgeSet.ncard = n.choose 2 + t → + (∀ v : Fin k, ∃ w : Fin k, G.Adj v w) → + ramseyNumber G ≤ ramseyNumber (asCompleteAsPossible n t) := by + sorry + +end Erdos545 diff --git a/FormalConjectures/ErdosProblems/546.lean b/FormalConjectures/ErdosProblems/546.lean new file mode 100644 index 0000000000..df8cb30a10 --- /dev/null +++ b/FormalConjectures/ErdosProblems/546.lean @@ -0,0 +1,75 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 546 + +*Reference:* [erdosproblems.com/546](https://www.erdosproblems.com/546) + +Let $G$ be a graph with no isolated vertices and $m$ edges. Is it true that +$R(G) \leq 2^{O(m^{1/2})}$? + +This is true, and was proved by Sudakov [Su11]. Alon, Krivelevich, and Sudakov +[AKS03] gave a short proof of this when $G$ is bipartite. The analogous question +for $\geq 3$ colours is still open. A more precise question is Problem 545. + +[Er84b] Erdős, P., _On some problems in graph theory, combinatorial analysis and +combinatorial number theory_. Graph theory and combinatorics (Cambridge, 1983), +Academic Press, London (1984), 1-17. + +[AKS03] Alon, N., Krivelevich, M., and Sudakov, B., _Turán numbers of bipartite +graphs and related Ramsey-type questions_. Combinatorics, Probability and +Computing **12** (2003), 477-494. + +[Su11] Sudakov, B., _A conjecture of Erdős on graph Ramsey numbers_. Advances in +Mathematics **227** (2011), 601-609. +-/ + +open SimpleGraph + +namespace Erdos546 + +/-- The diagonal Ramsey number $R(G)$ for a graph $G$: the minimum +$N$ such that every graph $H$ on $N$ vertices contains a copy of $G$ or its complement +contains a copy of $G$. -/ +noncomputable def ramseyNumber {U : Type*} (G : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G.IsContained H ∨ G.IsContained Hᶜ} + +/-- +Erdős Problem 546 [Er84b, p.10]: + +Let $G$ be a graph with no isolated vertices and $m$ edges. Is it true that +$R(G) \leq 2^{O(m^{1/2})}$? + +Formally: there exists a constant $C > 0$ such that for every graph $G$ on $k$ +vertices with no isolated vertices, $R(G) \leq 2^{C \cdot \sqrt{m}}$ where $m$ is the +number of edges. + +This was proved by Sudakov [Su11]. +-/ +@[category research solved, AMS 5] +theorem erdos_546 : answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ (k : ℕ) (G : SimpleGraph (Fin k)), + (∀ v : Fin k, ∃ w : Fin k, G.Adj v w) → + (ramseyNumber G : ℝ) ≤ (2 : ℝ) ^ (C * Real.sqrt (G.edgeSet.ncard : ℝ)) := by + sorry + +end Erdos546 diff --git a/FormalConjectures/ErdosProblems/547.lean b/FormalConjectures/ErdosProblems/547.lean new file mode 100644 index 0000000000..9b64d94df6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/547.lean @@ -0,0 +1,59 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 547 + +*Reference:* [erdosproblems.com/547](https://www.erdosproblems.com/547) + +If $T$ is a tree on $n$ vertices then $R(T) \leq 2n - 2$. + +This was conjectured by Burr [Bu74]. It follows from the Erdős–Sós +conjecture [548], and has been proved for all large $n$ by Zhao [Zh11]. + +[Bu74] Burr, S. A., _Generalized Ramsey theory for graphs — a survey_. +(1974), 52-75. + +[Zh11] Zhao, Y., _Proof of the (n/2-n/2-n/2) conjecture for large n_. +Electronic Journal of Combinatorics (2011), Paper 27, 61 pages. +-/ + +open SimpleGraph + +namespace Erdos547 + +/-- The diagonal Ramsey number $R(G)$ for a graph $G$: the minimum $N$ +such that every graph $H$ on $N$ vertices contains a copy of $G$ or its complement contains +a copy of $G$. -/ +noncomputable def ramseyNumber {U : Type*} (G : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G.IsContained H ∨ G.IsContained Hᶜ} + +/-- +Erdős Problem 547 [Bu74]: + +If $T$ is a tree on $n$ vertices then $R(T) \leq 2n - 2$. +-/ +@[category research open, AMS 5] +theorem erdos_547 (n : ℕ) (hn : n ≥ 2) + (T : SimpleGraph (Fin n)) (hT : T.IsTree) : + ramseyNumber T ≤ 2 * n - 2 := by + sorry + +end Erdos547 diff --git a/FormalConjectures/ErdosProblems/548.lean b/FormalConjectures/ErdosProblems/548.lean new file mode 100644 index 0000000000..faee4a49ed --- /dev/null +++ b/FormalConjectures/ErdosProblems/548.lean @@ -0,0 +1,67 @@ +/- +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 548 + +*Reference:* [erdosproblems.com/548](https://www.erdosproblems.com/548) + +This is the Erdős–Sós conjecture. + +[Er64c] Erdős, P., *Extremal problems in graph theory*, 1964. + +[Er74c] Erdős, P., *Problems and results on graph theory and combinatorics*, 1974. + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial + number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, + Graph Theory, and Computing (1978), 29–40. + +[Er93] Erdős, P., *Some of my favorite solved and unsolved problems in graph theory*. + Quaestiones Mathematicae **16** (1993), 333–350. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §3.55. +-/ + +open SimpleGraph + +namespace Erdos548 + +/-- A graph $H$ contains a copy of graph $G$ (as a subgraph) if there is an injective +function from $V(G)$ to $V(H)$ that preserves adjacency. -/ +def ContainsSubgraphCopy {V W : Type*} (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : V → W, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) + +/-- +Erdős Problem 548 [Er64c][Er74c, p.78][Er78, p.30][Er93, p.345][Va99, 3.55]: + +Let $n \geq k + 1$. Every graph on $n$ vertices with at least +$\frac{k-1}{2} \cdot n + 1$ edges contains every tree on $k + 1$ vertices. + +The edge condition is expressed as $2 \cdot |E(G)| \geq (k-1) \cdot n + 2$ to avoid +division in the naturals. +-/ +@[category research open, AMS 5] +theorem erdos_548 (k n : ℕ) (hn : n ≥ k + 1) + (G : SimpleGraph (Fin n)) + (hE : 2 * G.edgeSet.ncard ≥ (k - 1) * n + 2) + (T : SimpleGraph (Fin (k + 1))) (hT : T.IsTree) : + ContainsSubgraphCopy T G := by + sorry + +end Erdos548 diff --git a/FormalConjectures/ErdosProblems/549.lean b/FormalConjectures/ErdosProblems/549.lean new file mode 100644 index 0000000000..94e3dfaed7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/549.lean @@ -0,0 +1,86 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 549 + +*Reference:* [erdosproblems.com/549](https://www.erdosproblems.com/549) + +If $T$ is a tree which is a bipartite graph with $k$ vertices in one class and $2k$ +vertices in the other class then $R(T) = 4k - 1$. + +This is a special case of a conjecture of Burr [Bu74] (see [547]). + +This conjecture is false: Norin, Sun, and Zhao [NSZ16] proved that if $T$ is the +union of two stars on $k$ and $2k$ vertices with an edge joining their centres, +then $R(T) \geq (4.2 - o(1))k$. + +[Bu74] Burr, S.A., *Generalized Ramsey theory for graphs — a survey*, 1974, 52-75. + +[BuEr76] Burr, S.A. and Erdős, P., *Extremal Ramsey theory for graphs*. Utilitas +Mathematica (1976), 247-258. + +[EFRS82] Erdős, P., Faudree, R.J., Rousseau, C.C., and Schelp, R.H., *Ramsey numbers +for brooms*. Proceedings of the Thirteenth Southeastern Conference on Combinatorics, +Graph Theory and Computing (1982), 283-293. + +[NSZ16] Norin, S., Sun, Y.R., and Zhao, Y., *Asymptotics of Ramsey numbers of double +stars*. arXiv:1605.03612 (2016). + +[DuSt24] Dubó, F.F. and Stein, M., *On the Ramsey number of the double star*. +arXiv:2401.01274 (2024). + +[MPY25] Montgomery, R., Pavez-Signé, M., and Yan, J., *Ramsey numbers of trees*. +arXiv:2509.07934 (2025). +-/ + +open SimpleGraph Finset + +namespace Erdos549 + +/-- The diagonal Ramsey number $R(G)$ for a graph $G$: the minimum +$N$ such that every graph $H$ on $N$ vertices contains a copy of $G$ or its complement +contains a copy of $G$. -/ +noncomputable def ramseyNumber {U : Type*} (G : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G.IsContained H ∨ G.IsContained Hᶜ} + +/-- +Erdős Problem 549 [EFRS82]: + +If $T$ is a tree which is a bipartite graph with $k$ vertices in one class and $2k$ +vertices in the other class then $R(T) = 4k - 1$. + +The bipartition condition is expressed via a proper 2-coloring where one color +class has $k$ vertices and the other has $2k$ vertices. + +This conjecture has been disproved by Norin, Sun, and Zhao [NSZ16]. +-/ +@[category research solved, AMS 5] +theorem erdos_549 : answer(False) ↔ + ∀ (k : ℕ), k ≥ 1 → + ∀ (T : SimpleGraph (Fin (3 * k))), + T.IsTree → + (∃ c : T.Coloring (Fin 2), + (Finset.univ.filter (fun v => c v = 0)).card = k ∧ + (Finset.univ.filter (fun v => c v = 1)).card = 2 * k) → + ramseyNumber T = 4 * k - 1 := by + sorry + +end Erdos549 diff --git a/FormalConjectures/ErdosProblems/55.lean b/FormalConjectures/ErdosProblems/55.lean new file mode 100644 index 0000000000..ea097c6d3c --- /dev/null +++ b/FormalConjectures/ErdosProblems/55.lean @@ -0,0 +1,86 @@ +/- +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 55 + +*Reference:* [erdosproblems.com/55](https://www.erdosproblems.com/55) + +A problem of Burr and Erdős [BuEr85]. For every $r \geq 2$, there exists an $r$-Ramsey +complete set $A$ with $|A \cap \{1,\ldots,N\}| \leq C \cdot r \cdot (\log N)^2$, and this +bound is best possible. Solved by Conlon, Fox, and Pham [CFP21]. + +See also Problems 54 and 843. + +[BuEr85] Burr, S. A. and Erdős, P., _A Ramsey-type property in additive number theory_. +Glasgow Math. J. (1985), 5–10. +[CFP21] Conlon, D., Fox, J., and Pham, H.T., _Subset sums, completeness and colorings_ (2021). +-/ + +open scoped Classical +open Finset Real + +namespace Erdos55 + +/-- +A set $A$ of natural numbers is Ramsey $r$-complete if for every $r$-coloring of $\mathbb{N}$, +all sufficiently large natural numbers can be represented as a sum of distinct +elements of $A$ that all receive the same color. +-/ +def IsRamseyComplete (A : Set ℕ) (r : ℕ) : Prop := + ∀ (χ : ℕ → Fin r), + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∃ (S : Finset ℕ), (↑S : Set ℕ) ⊆ A ∧ + (∃ c : Fin r, ∀ x ∈ S, χ x = c) ∧ + S.sum id = n + +/-- +Erdős Problem 55 (solved by Conlon, Fox, and Pham [CFP21]): +For every $r \geq 2$, there exists an $r$-Ramsey complete set $A$ such that +$|A \cap \{1, \ldots, N\}| \leq C \cdot r \cdot (\log N)^2$ for all sufficiently large $N$. +This is a generalization of Problem 54 to arbitrary $r \geq 2$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_55 : + ∃ C : ℝ, C > 0 ∧ + ∀ r : ℕ, 2 ≤ r → + ∃ (A : Set ℕ), + IsRamseyComplete A r ∧ + ∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + C * (r : ℝ) * (Real.log (N : ℝ)) ^ 2 := by + sorry + +/-- +There exists $c > 0$ such that for every $r \geq 2$, any set $A$ with +$|A \cap \{1, \ldots, N\}| \leq c \cdot r \cdot (\log N)^2$ for all large $N$ +cannot be $r$-Ramsey complete, showing that the growth rate $\Theta(r (\log N)^2)$ +is optimal [CFP21]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_55.variants.lower_bound : + ∃ c : ℝ, c > 0 ∧ + ∀ r : ℕ, 2 ≤ r → + ∀ (A : Set ℕ), + (∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + c * (r : ℝ) * (Real.log (N : ℝ)) ^ 2) → + ¬ IsRamseyComplete A r := by + sorry + +end Erdos55 diff --git a/FormalConjectures/ErdosProblems/550.lean b/FormalConjectures/ErdosProblems/550.lean new file mode 100644 index 0000000000..1325177441 --- /dev/null +++ b/FormalConjectures/ErdosProblems/550.lean @@ -0,0 +1,91 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 550 + +*Reference:* [erdosproblems.com/550](https://www.erdosproblems.com/550) + +Let $m_1 \le \cdots \le m_k$ and $n$ be sufficiently large. If $T$ is a tree on $n$ vertices +and $G$ is the complete multipartite graph with vertex class sizes $m_1, \ldots, m_k$, then +$$R(T, G) \le (\chi(G) - 1)(R(T, K_{m_1,m_2}) - 1) + m_1.$$ + +For a complete $k$-partite graph with $k \ge 2$ non-empty parts, $\chi(G) = k$, so the +bound becomes $(k - 1)(R(T, K_{m_1,m_2}) - 1) + m_1$. + +Chvátal [Ch77] proved that $R(T, K_m) = (m - 1)(n - 1) + 1$. + +[EFRS85] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., +*Multipartite graph—sparse graph Ramsey numbers*, Combinatorica **5** (1985), 311–318. + +[Ch77] Chvátal, V., *Tree-complete graph Ramsey numbers*, +J. Graph Theory **1** (1977), 93. +-/ + +open SimpleGraph + +namespace Erdos550 + +/-- The off-diagonal Ramsey number $R(G_1, G_2)$: the minimum $N$ such that every +graph $H$ on $N$ vertices contains a copy of $G_1$ or its complement contains a +copy of $G_2$. -/ +noncomputable def offDiagRamseyNumber {V₁ V₂ : Type*} + (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G₁.IsContained H ∨ G₂.IsContained Hᶜ} + +/-- The complete multipartite graph with vertex class sizes given by `sizes`. +Vertices are pairs $(i, j)$ where $i$ indexes the part and $j$ is within the part. +Two vertices are adjacent iff they belong to different parts. -/ +def completeMultipartiteGraph {k : ℕ} (sizes : Fin k → ℕ) : + SimpleGraph (Σ i : Fin k, Fin (sizes i)) where + Adj v w := v.1 ≠ w.1 + symm _ _ h := Ne.symm h + loopless _ := fun h => h rfl + +/-- Part sizes for the complete bipartite graph $K_{m_1,m_2}$. -/ +def bipSizes (m₁ m₂ : ℕ) : Fin 2 → ℕ + | ⟨0, _⟩ => m₁ + | ⟨_ + 1, _⟩ => m₂ + +/-- +Erdős Problem 550 [EFRS85]: + +Let $m_1 \le \cdots \le m_k$ and $n$ be sufficiently large. If $T$ is a tree on $n$ vertices and +$G$ is the complete multipartite graph with vertex class sizes $m_1, \ldots, m_k$, then +$$R(T, G) \le (\chi(G) - 1)(R(T, K_{m_1,m_2}) - 1) + m_1.$$ + +For a complete $k$-partite graph with non-empty parts, $\chi(G) = k$, so the bound +becomes $(k - 1) \cdot (R(T, K_{m_1,m_2}) - 1) + m_1$, where $K_{m_1,m_2}$ is the +complete bipartite graph with part sizes $m_1$ (= `sizes 0`) and $m_2$ (= `sizes 1`). +-/ +@[category research open, AMS 5] +theorem erdos_550 (k : ℕ) (hk : k ≥ 2) (sizes : Fin k → ℕ) + (hsizes_pos : ∀ i, 0 < sizes i) + (hsizes_mono : Monotone sizes) : + let m₁ := sizes ⟨0, by omega⟩ + let m₂ := sizes ⟨1, by omega⟩ + ∃ N₀ : ℕ, ∀ (n : ℕ), n ≥ N₀ → + ∀ (T : SimpleGraph (Fin n)), T.IsTree → + offDiagRamseyNumber T (completeMultipartiteGraph sizes) ≤ + (k - 1) * (offDiagRamseyNumber T + (completeMultipartiteGraph (bipSizes m₁ m₂)) - 1) + m₁ := by + sorry + +end Erdos550 diff --git a/FormalConjectures/ErdosProblems/551.lean b/FormalConjectures/ErdosProblems/551.lean new file mode 100644 index 0000000000..b5c61b85a9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/551.lean @@ -0,0 +1,76 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 551 + +*Reference:* [erdosproblems.com/551](https://www.erdosproblems.com/551) + +Prove that $R(C_k, K_n) = (k-1)(n-1) + 1$ for $k \geq n \geq 3$ (except when $n = k = 3$). + +Here $R(C_k, K_n)$ is the off-diagonal Ramsey number, $C_k$ is the cycle graph on +$k$ vertices, and $K_n$ is the complete graph on $n$ vertices. + +Asked by Erdős, Faudree, Rousseau, and Schelp [EFRS78]. This identity was +proved for $k > n^2 - 2$ by Bondy and Erdős [BoEr73], extended to $k \geq 4n + 2$ by +Nikiforov [Ni05], and established for $k \geq C \frac{\log n}{\log \log n}$ (for some +constant $C$), thus resolving the conjecture for sufficiently large $n$, by Keevash, +Long, and Skokan [KLS21]. + +[EFRS78] Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., +*On cycle-complete graph Ramsey numbers*, J. Graph Theory 2 (1978), 53–64. + +[BoEr73] Bondy, J. A. and Erdős, P., *Ramsey numbers for cycles in graphs*, +J. Combin. Theory Ser. B (1973), 46–54. + +[Ni05] Nikiforov, V., *The cycle-complete graph Ramsey numbers*, +Combin. Probab. Comput. (2005), 349–370. + +[KLS21] Keevash, P., Long, E., and Skokan, J., +*Cycle-complete Ramsey numbers*, Int. Math. Res. Not. IMRN (2021), 277–302. +-/ + +open SimpleGraph + +namespace Erdos551 + +/-- The off-diagonal Ramsey number $R(G_1, G_2)$: the minimum $N$ such that every +graph $H$ on $N$ vertices contains a copy of $G_1$ or its complement contains a +copy of $G_2$. -/ +noncomputable def offDiagRamseyNumber {V₁ V₂ : Type*} + (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G₁ ⊑ H ∨ G₂ ⊑ Hᶜ} + +/-- +Erdős Problem 551 [EFRS78]: + +Prove that $R(C_k, K_n) = (k - 1)(n - 1) + 1$ for $k \geq n \geq 3$, except when $n = k = 3$. + +Here $C_k$ is the cycle graph on $k$ vertices and $K_n$ is the complete graph on $n$ +vertices (expressed as $\top : \text{SimpleGraph}(\text{Fin}\; n)$). +-/ +@[category research open, AMS 5] +theorem erdos_551 (k n : ℕ) (hk : k ≥ n) (hn : n ≥ 3) (hne : ¬(k = 3 ∧ n = 3)) : + offDiagRamseyNumber (cycleGraph k) (⊤ : SimpleGraph (Fin n)) = + (k - 1) * (n - 1) + 1 := by + sorry + +end Erdos551 diff --git a/FormalConjectures/ErdosProblems/552.lean b/FormalConjectures/ErdosProblems/552.lean new file mode 100644 index 0000000000..95cf25161b --- /dev/null +++ b/FormalConjectures/ErdosProblems/552.lean @@ -0,0 +1,92 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 552 + +*Reference:* [erdosproblems.com/552](https://www.erdosproblems.com/552) + +Determine the Ramsey number $R(C_4, S_n)$, where $S_n = K_{1,n}$ is the star on +$n + 1$ vertices. + +[BEFRS89] Burr, S. A., Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., +*Some complete bipartite graph-tree Ramsey numbers*, +Graph theory in memory of G. A. Dirac (Sandbjerg, 1985), 79–89, 1989. + +[Pa75] Parsons, T. D., *Ramsey graphs and block designs. I*, +Trans. Amer. Math. Soc. (1975), 33–44. + +[WSZR15] Wu, Y., Sun, Y., Zhang, R., and Radziszowski, S. P., +*Ramsey numbers of C₄ versus wheels and stars*, +Graphs Combin. (2015), 2437–2446. + +[ZCC17] Zhang, X., Chen, Y., and Cheng, T. C. E., +*Some values of Ramsey numbers for C₄ versus stars*, +Finite Fields Appl. (2017), 73–85. + +[ZCC17b] Zhang, X., Chen, Y., and Cheng, T. C. E., +*Polarity graphs and Ramsey numbers for C₄ versus stars*, +Discrete Math. (2017), 655–660. +-/ + +open SimpleGraph + +namespace Erdos552 + +/-- The off-diagonal Ramsey number $R(G_1, G_2)$: the minimum $N$ such that every +graph $H$ on $N$ vertices contains a copy of $G_1$ or its complement contains a +copy of $G_2$. -/ +noncomputable def offDiagRamseyNumber {V₁ V₂ : Type*} + (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), + G₁.IsContained H ∨ G₂.IsContained Hᶜ} + +/-- The star graph $S_n = K_{1,n}$ on $n + 1$ vertices: vertex $0$ is the center, +adjacent to all other vertices. -/ +def starGraph (n : ℕ) : SimpleGraph (Fin (n + 1)) where + Adj i j := (i.val = 0 ∧ j.val ≠ 0) ∨ (j.val = 0 ∧ i.val ≠ 0) + symm _ _ h := h.elim Or.inr Or.inl + loopless v h := by + rcases h with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> exact h2 h1 + +/-- +Erdős Problem 552 [BEFRS89]: + +Is it true that, for any $c > 0$, there are infinitely many $n$ such that +$R(C_4, S_n) \leq n + \sqrt{n} - c$? + +Here $C_4$ is the cycle on $4$ vertices and $S_n = K_{1,n}$ is the star on $n + 1$ +vertices. "Infinitely many" is formalised as: for every $N$ there exists $n \geq N$ +satisfying the bound. + +The known bounds are: +$$n + \sqrt{n} - 6n^{11/40} \leq R(C_4, S_n) \leq n + \lceil\sqrt{n}\rceil + 1.$$ +The lower bound is due to [BEFRS89] and the upper bound is due to Parsons [Pa75]. +Erdős offered \$100 for a proof or disproof. +-/ +@[category research open, AMS 5] +theorem erdos_552 : answer(sorry) ↔ + ∀ c : ℝ, c > 0 → + ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ + (offDiagRamseyNumber (cycleGraph 4) (starGraph n) : ℝ) ≤ + ↑n + Real.sqrt ↑n - c := by + sorry + +end Erdos552 diff --git a/FormalConjectures/ErdosProblems/553.lean b/FormalConjectures/ErdosProblems/553.lean new file mode 100644 index 0000000000..67ed556118 --- /dev/null +++ b/FormalConjectures/ErdosProblems/553.lean @@ -0,0 +1,83 @@ +/- +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 553 + +*Reference:* [erdosproblems.com/553](https://www.erdosproblems.com/553) + +Let $R(3,3,n)$ denote the smallest integer $m$ such that if we $3$-colour the edges +of $K_m$ then there is either a monochromatic triangle in one of the first two +colours or a monochromatic $K_n$ in the third colour. Define $R(3,n)$ similarly +but with two colours. + +A problem of Erdős and Sós [ErSo80]. This was solved by Alon and Rödl [AlRo05], who +showed $R(3,3,n) \asymp n^3 (\log n)^{O(1)}$, recalling that Shearer [Sh83] showed +$R(3,n) \ll n^2 / \log n$. + +Related problems: [925](https://www.erdosproblems.com/925). + +[ErSo80] Erdős, P. and Sós, V. T. (1980). + +[AlRo05] Alon, N. and Rödl, V., _Sharp bounds for some multicolor Ramsey numbers_, +Combinatorica 25 (2005), 125-141. + +[Sh83] Shearer, J. B., _A note on the independence number of triangle-free +graphs_. Discrete Math. **46** (1983), 83-87. +-/ + +open SimpleGraph + +namespace Erdos553 + +/-- The Ramsey number $R(3,n)$: the minimum $N$ such that every $2$-colouring of +the edges of $K_N$ yields either a monochromatic triangle in colour $1$ or +a monochromatic $K_n$ in colour $2$. Equivalently, every simple graph on $N$ +vertices contains a $3$-clique or its complement contains an $n$-clique. -/ +noncomputable def ramseyR3 (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree n} + +/-- The Ramsey number $R(3,3,n)$: the minimum $N$ such that every $3$-colouring of +the edges of $K_N$ yields either a monochromatic triangle in one of the +first two colours or a monochromatic $K_n$ in the third colour. + +A $3$-colouring is modelled by two edge-disjoint graphs $G_1$, $G_2$ (the first +two colour classes); the third colour class is the complement $(G_1 \sqcup G_2)^c$. -/ +noncomputable def ramseyR33 (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G₁ G₂ : SimpleGraph (Fin N)), + Disjoint G₁ G₂ → + ¬G₁.CliqueFree 3 ∨ ¬G₂.CliqueFree 3 ∨ ¬(G₁ ⊔ G₂)ᶜ.CliqueFree n} + +/-- +Erdős Problem 553 [ErSo80]: + +$$R(3,3,n) / R(3,n) \to \infty$$ + +as $n \to \infty$. + +Formulated as: for every positive real $C$, there exists $N_0$ such that for all +$n \ge N_0$ we have $R(3,3,n) \ge C \cdot R(3,n)$. +-/ +@[category research solved, AMS 5] +theorem erdos_553 : + ∀ C : ℝ, C > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C * (ramseyR3 n : ℝ) ≤ (ramseyR33 n : ℝ) := by + sorry + +end Erdos553 diff --git a/FormalConjectures/ErdosProblems/554.lean b/FormalConjectures/ErdosProblems/554.lean new file mode 100644 index 0000000000..839ea89bff --- /dev/null +++ b/FormalConjectures/ErdosProblems/554.lean @@ -0,0 +1,97 @@ +/- +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 554 + +*Reference:* [erdosproblems.com/554](https://www.erdosproblems.com/554) + +A problem of Erdős and Graham [Er81c]. Schur [Sc16] established $C^k \ll R_k(K_3) \ll k!$. +Bondy and Erdős [BoEr73] and Erdős and Graham [ErGr75] proved +$n 2^k + 1 \leq R_k(C_{2n+1}) \leq 2n(k+2)!$. Day and Johnson [DaJo17] improved the lower +bound for fixed $n$. Jenssen and Skokan [JeSk21] showed the Bondy–Erdős lower bound is sharp +for fixed $k$ and large $n$. Axenovich, Cames van Batenburg, Janzer, Michel, and Rundström +[ACJMR25] improved the upper bound to $R_k(C_{2n+1}) \leq (4n-2)^k k^{k/n} + 1$. +The problem is open even for $n = 2$. + +[Er81c] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathématique, 1981. + +[Sc16] Schur, I., _Über die Kongruenz x^m+y^m=z^m (mod p)_. +Jahresbericht der Deutschen Mathematiker-Vereinigung (1916), 114–117. + +[BoEr73] Bondy, J. A. and Erdős, P., _Ramsey numbers for cycles in graphs_. +J. Combin. Theory Ser. B (1973), 46–54. + +[ErGr75] Erdős, P. and Graham, R., _On partition theorems for finite graphs_. +Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on his 60th birthday), +Vol. I; Colloq. Math. Soc. János Bolyai, Vol. 10, North-Holland, Amsterdam, 1975, pp. 515–527. + +[DaJo17] Day, A. N. and Johnson, J. R., _Multicolour Ramsey numbers of odd cycles_. +J. Combin. Theory Ser. B (2017), 56–63. + +[JeSk21] Jenssen, M. and Skokan, J., _Exact Ramsey numbers of odd cycles via nonlinear +optimisation_. Adv. Math. (2021), Paper No. 107444. + +[ACJMR25] Axenovich, M., Cames van Batenburg, W., Janzer, O., Michel, L., and Rundström, M., +_An improved upper bound for the multicolour Ramsey number of odd cycles_. arXiv:2510.17981, +2025. +-/ + +open SimpleGraph + +namespace Erdos554 + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- The $k$-colour Ramsey number $R_k(G)$: the minimum $N$ such that for every +$k$-colouring of the edges of $K_N$, there is a monochromatic copy of $G$. + +A $k$-colouring is a symmetric function $c : \operatorname{Fin} N \to \operatorname{Fin} N \to +\operatorname{Fin} k$. A monochromatic copy of $G$ in colour $a$ is an injective map +$f : V \to \operatorname{Fin} N$ such that every edge of $G$ maps to an edge of colour $a$. -/ +noncomputable def multicolorRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (f : V → Fin N), Function.Injective f ∧ + ∀ u v, G.Adj u v → c (f u) (f v) = a} + +/-- +Erdős Problem 554 [Er81c]: + +For any $n \geq 2$, +$$\lim_{k \to \infty} R_k(C_{2n+1}) / R_k(K_3) = 0.$$ + +Formulated as: for every $\varepsilon > 0$, there exists $K_0$ such that for all $k \geq K_0$, +$R_k(C_{2n+1}) \leq \varepsilon \cdot R_k(K_3)$. +-/ +@[category research open, AMS 5] +theorem erdos_554 (n : ℕ) (hn : n ≥ 2) : + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (multicolorRamseyNumber (cycleGraph (2 * n + 1) (by omega)) k : ℝ) ≤ + ε * (multicolorRamseyNumber (⊤ : SimpleGraph (Fin 3)) k : ℝ) := by + sorry + +end Erdos554 diff --git a/FormalConjectures/ErdosProblems/555.lean b/FormalConjectures/ErdosProblems/555.lean new file mode 100644 index 0000000000..d20f19da67 --- /dev/null +++ b/FormalConjectures/ErdosProblems/555.lean @@ -0,0 +1,108 @@ +/- +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 555 + +*Reference:* [erdosproblems.com/555](https://www.erdosproblems.com/555) + +Let $R_k(G)$ denote the minimal $m$ such that if the edges of $K_m$ are $k$-coloured +then there is a monochromatic copy of $G$. Determine the value of $R_k(C_{2n})$. + +A problem of Erdős and Graham. Erdős [Er81c] gives the bounds +$$k^{1 + 1/(2n)} \ll R_k(C_{2n}) \ll k^{1 + 1/(n-1)}.$$ + +Chung and Graham [ChGr75] showed that +$R_k(C_4) > k^2 - k + 1$ when $k-1$ is a prime power, and +$R_k(C_4) \leq k^2 + k + 1$ for all $k$. + +[Er81c] Erdős, P., _Some new problems and results in graph theory and other branches of +combinatorial mathematics_. Combinatorics and graph theory (1981), 9–17. + +[ChGr75] Chung, F. R. K., Graham, R. L., _On multicolor Ramsey numbers for complete bipartite +graphs_. J. Combin. Theory Ser. B (1975), 164–169. +-/ + +open SimpleGraph + +namespace Erdos555 + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- The $k$-colour Ramsey number $R_k(G)$: the minimum $N$ such that for every +$k$-colouring of the edges of $K_N$, there is a monochromatic copy of $G$. + +A $k$-colouring is a symmetric function $c : \operatorname{Fin} N \to \operatorname{Fin} N \to \operatorname{Fin} k$. +A monochromatic copy of $G$ in colour $a$ is an injective map $f : V \to \operatorname{Fin} N$ +such that every edge of $G$ maps to an edge of colour $a$. -/ +noncomputable def multicolorRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (f : V → Fin N), Function.Injective f ∧ + ∀ u v, G.Adj u v → c (f u) (f v) = a} + +/-- +Erdős Problem 555, lower bound [Er81c]: + +For every $n \geq 2$, there exist $C > 0$ and $K_0$ such that for all $k \geq K_0$, +$$R_k(C_{2n}) \geq C \cdot k^{1 + 1/(2n)}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_555 (n : ℕ) (hn : n ≥ 2) : + ∃ C : ℝ, C > 0 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (multicolorRamseyNumber (cycleGraph (2 * n) (by omega)) k : ℝ) ≥ + C * (k : ℝ) ^ ((1 : ℝ) + 1 / (2 * (n : ℝ))) := by + sorry + +/-- +Erdős Problem 555, upper bound [Er81c]: + +For every $n \geq 2$, there exist $C > 0$ and $K_0$ such that for all $k \geq K_0$, +$$R_k(C_{2n}) \leq C \cdot k^{1 + 1/(n - 1)}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_555.variants.upper_bound (n : ℕ) (hn : n ≥ 2) : + ∃ C : ℝ, C > 0 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (multicolorRamseyNumber (cycleGraph (2 * n) (by omega)) k : ℝ) ≤ + C * (k : ℝ) ^ ((1 : ℝ) + 1 / ((n : ℝ) - 1)) := by + sorry + +/-- +Chung–Graham upper bound [ChGr75]: $R_k(C_4) \leq k^2 + k + 1$ for all $k \geq 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_555.variants.chung_graham_upper (k : ℕ) (hk : k ≥ 2) : + multicolorRamseyNumber (cycleGraph 4 (by omega)) k ≤ k ^ 2 + k + 1 := by + sorry + +/-- +Chung–Graham lower bound [ChGr75]: $R_k(C_4) > k^2 - k + 1$ when $k - 1$ is a prime power. +-/ +@[category research solved, AMS 5] +theorem erdos_555.variants.chung_graham_lower (k : ℕ) (hk : k ≥ 2) + (hp : IsPrimePow (k - 1 : ℕ)) : + multicolorRamseyNumber (cycleGraph 4 (by omega)) k > k ^ 2 - k + 1 := by + sorry + +end Erdos555 diff --git a/FormalConjectures/ErdosProblems/556.lean b/FormalConjectures/ErdosProblems/556.lean new file mode 100644 index 0000000000..ce49296150 --- /dev/null +++ b/FormalConjectures/ErdosProblems/556.lean @@ -0,0 +1,79 @@ +/- +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 556 + +*Reference:* [erdosproblems.com/556](https://www.erdosproblems.com/556) + +A problem of Bondy and Erdős. This inequality is best possible for odd $n$. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica **1** (1981), 25–42. + +[Er81c] Erdős, P., _Some new problems and results in graph theory and other branches of + combinatorial mathematics_. Combinatorics and graph theory (1981), 9–17. + +[Lu99] Łuczak, T., _R(Cₙ,Cₙ,Cₙ)≤(4+o(1))n_. Journal of Combinatorial Theory Series B + (1999), 174–187. + +[KSS05] Kohayakawa, Y., Simonovits, M., Skokan, J., _The 3-colored Ramsey number of odd + cycles_. Proceedings of GRACO2005 (2005), 397–402. + +[BeSk09] Benevides, F.S., Skokan, J., _The 3-colored Ramsey number of even cycles_. Journal + of Combinatorial Theory Series B (2009), 690–708. + +See also OEIS [A389335](https://oeis.org/A389335). +-/ + +open SimpleGraph + +namespace Erdos556 + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- The $k$-colour Ramsey number $R_k(G)$: the minimum $N$ such that for every +$k$-colouring of the edges of $K_N$, there is a monochromatic copy of $G$. + +A $k$-colouring is a symmetric function $c : \operatorname{Fin} N \to \operatorname{Fin} N \to \operatorname{Fin} k$. +A monochromatic copy of $G$ in colour $a$ is an injective map $f : V \to \operatorname{Fin} N$ +such that every edge of $G$ maps to an edge of colour $a$. -/ +noncomputable def multicolorRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (f : V → Fin N), Function.Injective f ∧ + ∀ u v, G.Adj u v → c (f u) (f v) = a} + +/-- +Erdős Problem 556 [Er81][Er81c]: + +For all $n \geq 3$, the 3-colour Ramsey number of the cycle $C_n$ satisfies +$$R_3(C_n) \leq 4n - 3.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_556 (n : ℕ) (hn : n ≥ 3) : + multicolorRamseyNumber (cycleGraph n hn) 3 ≤ 4 * n - 3 := by + sorry + +end Erdos556 diff --git a/FormalConjectures/ErdosProblems/557.lean b/FormalConjectures/ErdosProblems/557.lean new file mode 100644 index 0000000000..cd7f915424 --- /dev/null +++ b/FormalConjectures/ErdosProblems/557.lean @@ -0,0 +1,65 @@ +/- +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 557 + +*Reference:* [erdosproblems.com/557](https://www.erdosproblems.com/557) + +A problem of Erdős and Graham on multicolour Ramsey numbers for trees. + +This conjecture is implied by Problem 548 (the Erdős–Sós conjecture). The bound would be +best possible, since $R_k(S_n) \geq kn - O(k)$ for the star $S_n = K_{1,n-1}$. + +[ErGr75] Erdős, P. and Graham, R., _On partition theorems for finite graphs_. +Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on his 60th birthday), +Vol. I; Colloq. Math. Soc. János Bolyai, Vol. 10, North-Holland, Amsterdam, 1975, pp. 515–527. +-/ + +open SimpleGraph + +namespace Erdos557 + +/-- The $k$-colour Ramsey number $R_k(G)$: the minimum $N$ such that for every +$k$-colouring of the edges of $K_N$, there is a monochromatic copy of $G$. + +A $k$-colouring is a symmetric function $c : \operatorname{Fin} N \to \operatorname{Fin} N \to \operatorname{Fin} k$. +A monochromatic copy of $G$ in colour $a$ is an injective map $f : V \to \operatorname{Fin} N$ +such that every edge of $G$ maps to an edge of colour $a$. -/ +noncomputable def multicolorRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (f : V → Fin N), Function.Injective f ∧ + ∀ u v, G.Adj u v → c (f u) (f v) = a} + +/-- +Erdős Problem 557 [ErGr75, p. 516]: + +Is it true that there exists an absolute constant $C$ such that for all $k \ge 1$, all $n \ge 1$, +and all trees $T$ on $n$ vertices, $R_k(T) \le kn + C$? +-/ +@[category research open, AMS 5] +theorem erdos_557 : answer(sorry) ↔ + ∃ C : ℕ, ∀ (n : ℕ) (hn : n ≥ 1) (T : SimpleGraph (Fin n)), + T.IsTree → + ∀ k : ℕ, k ≥ 1 → + multicolorRamseyNumber T k ≤ k * n + C := by + sorry + +end Erdos557 diff --git a/FormalConjectures/ErdosProblems/558.lean b/FormalConjectures/ErdosProblems/558.lean new file mode 100644 index 0000000000..76e99bb246 --- /dev/null +++ b/FormalConjectures/ErdosProblems/558.lean @@ -0,0 +1,140 @@ +/- +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 558 + +*Reference:* [erdosproblems.com/558](https://www.erdosproblems.com/558) + +Let $R_k(G)$ denote the minimal $m$ such that if the edges of $K_m$ are $k$-coloured +then there is a monochromatic copy of $G$. Determine $R_k(K_{s,t})$ +where $K_{s,t}$ is the complete bipartite graph with $s$ vertices in one part +and $t$ in the other. + +[ChGr75] Chung, F.R.K. and Graham, R.L., *On multicolor Ramsey numbers for complete +bipartite graphs*, J. Combin. Theory Ser. B 18 (1975), 164–169. + +[ARS99] Alon, N., Rónyai, L. and Szabó, T., *Norm-graphs: variations and applications*, +J. Combin. Theory Ser. B 76 (1999), 280–290. +-/ + +namespace Erdos558 + +/-- The $k$-colour Ramsey number $R_k(G)$: the minimum $N$ such that for every +$k$-colouring of the edges of $K_N$, there is a monochromatic copy of $G$. + +A $k$-colouring is a symmetric function $c : \operatorname{Fin} N \to \operatorname{Fin} N \to \operatorname{Fin} k$. +A monochromatic copy of $G$ in colour $a$ is an injective map $f : V \to \operatorname{Fin} N$ +such that every edge of $G$ maps to an edge of colour $a$. -/ +noncomputable def multicolorRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (c : Fin N → Fin N → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (f : V → Fin N), Function.Injective f ∧ + ∀ u v, G.Adj u v → c (f u) (f v) = a} + +/-- +Erdős Problem 558: Determine $R_k(K_{s,t})$, the $k$-colour Ramsey number of the +complete bipartite graph $K_{s,t}$. The general problem remains open. +-/ +@[category research open, AMS 5] +theorem erdos_558 : + ∀ s t : ℕ, s ≥ 1 → t ≥ 1 → ∀ k : ℕ, + multicolorRamseyNumber (completeBipartiteGraph (Fin s) (Fin t)) k = answer((sorry : ℕ → ℕ → ℕ → ℕ) s t k) := by + sorry + +/-- +Erdős Problem 558, Chung–Graham result [ChGr75]: + +$R_k(K_{2,2}) = (1+o(1))k^2$, i.e., for every $\varepsilon > 0$, there exists $K_0$ +such that for all $k \geq K_0$, +$$ +(1 - \varepsilon)k^2 \leq R_k(K_{2,2}) \leq (1 + \varepsilon)k^2. +$$ +-/ +@[category research solved, AMS 5] +theorem erdos_558.variants.K22 : + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (1 - ε) * (k : ℝ) ^ 2 ≤ + (multicolorRamseyNumber (completeBipartiteGraph (Fin 2) (Fin 2)) k : ℝ) ∧ + (multicolorRamseyNumber (completeBipartiteGraph (Fin 2) (Fin 2)) k : ℝ) ≤ + (1 + ε) * (k : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 558, Alon–Rónyai–Szabó result [ARS99]: + +$R_k(K_{3,3}) = (1+o(1))k^3$, i.e., for every $\varepsilon > 0$, there exists $K_0$ +such that for all $k \geq K_0$, +$$ +(1 - \varepsilon)k^3 \leq R_k(K_{3,3}) \leq (1 + \varepsilon)k^3. +$$ +-/ +@[category research solved, AMS 5] +theorem erdos_558.variants.K33 : + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (1 - ε) * (k : ℝ) ^ 3 ≤ + (multicolorRamseyNumber (completeBipartiteGraph (Fin 3) (Fin 3)) k : ℝ) ∧ + (multicolorRamseyNumber (completeBipartiteGraph (Fin 3) (Fin 3)) k : ℝ) ≤ + (1 + ε) * (k : ℝ) ^ 3 := by + sorry + +/-- +Erdős Problem 558, Alon–Rónyai–Szabó result [ARS99]: + +If $s \geq (t-1)! + 1$ then $R_k(K_{s,t}) \asymp k^t$, i.e., there exist constants +$C_1, C_2 > 0$ such that for all sufficiently large $k$, +$$ +C_1 \cdot k^t \leq R_k(K_{s,t}) \leq C_2 \cdot k^t. +$$ +-/ +@[category research solved, AMS 5] +theorem erdos_558.variants.ars (s t : ℕ) (hs : s ≥ 1) (ht : t ≥ 1) + (hst : s ≥ Nat.factorial (t - 1) + 1) : + ∃ C₁ : ℝ, C₁ > 0 ∧ ∃ C₂ : ℝ, C₂ > 0 ∧ + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + C₁ * (k : ℝ) ^ t ≤ + (multicolorRamseyNumber (completeBipartiteGraph (Fin s) (Fin t)) k : ℝ) ∧ + (multicolorRamseyNumber (completeBipartiteGraph (Fin s) (Fin t)) k : ℝ) ≤ + C₂ * (k : ℝ) ^ t := by + sorry + +/-- +Erdős Problem 558, Chung–Graham explicit bounds [ChGr75]: + +For all $s \geq 1$, $t \geq 2$, and $k \geq 1$, +$$ +(2\pi\sqrt{st})^{1/(s+t)} \cdot \frac{s+t}{e^2} \cdot k^{(st-1)/(s+t)} +\leq R_k(K_{s,t}) +\leq (t-1)(k + k^{1/s})^s. +$$ +-/ +@[category research solved, AMS 5] +theorem erdos_558.variants.chung_graham (s t : ℕ) (hs : s ≥ 1) (ht : t ≥ 2) : + ∀ k : ℕ, k ≥ 1 → + (2 * Real.pi * Real.sqrt ((s : ℝ) * t)) ^ ((1 : ℝ) / ((s : ℝ) + t)) * + (((s : ℝ) + t) / (Real.exp 1) ^ 2) * + (k : ℝ) ^ (((s : ℝ) * t - 1) / ((s : ℝ) + t)) ≤ + (multicolorRamseyNumber (completeBipartiteGraph (Fin s) (Fin t)) k : ℝ) ∧ + (multicolorRamseyNumber (completeBipartiteGraph (Fin s) (Fin t)) k : ℝ) ≤ + ((t : ℝ) - 1) * ((k : ℝ) + (k : ℝ) ^ ((1 : ℝ) / (s : ℝ))) ^ (s : ℕ) := by + sorry + +end Erdos558 diff --git a/FormalConjectures/ErdosProblems/559.lean b/FormalConjectures/ErdosProblems/559.lean new file mode 100644 index 0000000000..d403f6df8e --- /dev/null +++ b/FormalConjectures/ErdosProblems/559.lean @@ -0,0 +1,63 @@ +/- +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 559 + +*Reference:* [erdosproblems.com/559](https://www.erdosproblems.com/559) + +Let $\hat{R}(G)$ denote the size Ramsey number, the minimal number of edges $m$ such +that there is a graph $H$ with $m$ edges that is Ramsey for $G$ (every 2-coloring +of the edges of $H$ contains a monochromatic copy of $G$). + +The conjecture: if $G$ has $n$ vertices and maximum degree $d$ then $\hat{R}(G) \ll_d n$ +(i.e., $\hat{R}(G) \leq C_d \cdot n$ for some constant $C_d$ depending only on $d$). + +This question was originally posed by Beck [Be83b]. It was disproved by Rödl and +Szemerédi [RoSz00] for $d = 3$, who constructed graphs on $n$ vertices with maximum +degree 3 such that $\hat{R}(G) \gg n (\log n)^c$ for some absolute constant $c > 0$. +Tikhomirov [Ti22b] improved this lower bound to $n \cdot \exp(c\sqrt{\log n})$. + +[Be83b] Beck, J., _On size Ramsey number of paths, trees, and circuits. I_. J. Graph Theory (1983), 115-129. +[RoSz00] Rödl, V. and Szemerédi, E., _On size Ramsey numbers of graphs with bounded degree_. Combinatorica 20 (2000), 257-262. +[Ti22b] Tikhomirov, K., _On bounded degree graphs with large size-Ramsey numbers_. arXiv:2210.05818 (2022). +-/ + +open SimpleGraph + +namespace Erdos559 + +/-- +Erdős Problem 559 (DISPROVED) [RoSz00]: + +The original conjecture states: for every $d \geq 1$, there exists a constant $C$ +(depending only on $d$) such that for all $n \geq 1$ and all graphs $G$ on $n$ vertices +with maximum degree at most $d$, the size Ramsey number satisfies $\hat{R}(G) \leq C \cdot n$. + +This was disproved by Rödl and Szemerédi [RoSz00] for $d = 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_559 : + answer(False) ↔ (∀ d : ℕ, d ≥ 1 → + ∃ C : ℕ, ∀ n : ℕ, n ≥ 1 → + ∀ G : SimpleGraph (Fin n), + (∀ v, Nat.card (G.neighborSet v) ≤ d) → + sizeRamsey G G ≤ C * n) := by + sorry + +end Erdos559 diff --git a/FormalConjectures/ErdosProblems/560.lean b/FormalConjectures/ErdosProblems/560.lean new file mode 100644 index 0000000000..230db25145 --- /dev/null +++ b/FormalConjectures/ErdosProblems/560.lean @@ -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 +import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.SizeRamsey + +/-! +# Erdős Problem 560 + +*Reference:* [erdosproblems.com/560](https://www.erdosproblems.com/560) + +Let $\hat{R}(G)$ denote the size Ramsey number, the minimal number of edges $m$ such +that there is a graph $H$ with $m$ edges such that in any 2-colouring of the +edges of $H$ there is a monochromatic copy of $G$. + +Determine $\hat{R}(K_{n,n})$, where $K_{n,n}$ is the complete bipartite graph with $n$ +vertices in each component. + +Known bounds: +$$\frac{1}{60} n^2 \cdot 2^n < \hat{R}(K_{n,n}) < \frac{3}{2} n^3 \cdot 2^n$$ + +The lower bound (for $n \geq 6$) was proved by Erdős and Rousseau [ErRo93]. +The upper bound was proved by Erdős, Faudree, Rousseau, and Schelp [EFRS78b] +and Nešetřil and Rödl [NeRo78]. + +Conlon, Fox, and Wigderson [CFW23] conjecture that $\hat{R}(K_{n,n}) \asymp n^3 \cdot 2^n$. + +[ErRo93] Erdős, P. and Rousseau, C.C., *The size Ramsey number of a complete bipartite +graph*, Discrete Mathematics, 1993. + +[EFRS78b] Erdős, P., Faudree, R.J., Rousseau, C.C., and Schelp, R.H., *The size Ramsey +number*, Periodica Mathematica Hungarica, 1978. + +[NeRo78] Nešetřil, J. and Rödl, V., *The Ramsey property for graphs with forbidden complete +subgraphs*, Journal of Combinatorial Theory, Series B, 1978. + +[CFW23] Conlon, D., Fox, J., and Wigderson, Y., *Ramsey numbers of books and +quasirandomness*, Combinatorica, 2023. +-/ + +open SimpleGraph + +namespace Erdos560 + +/-- +Erdős Problem 560, lower bound [ErRo93]: + +For all $n \geq 6$, $\hat{R}(K_{n,n}) > \frac{1}{60} n^2 \cdot 2^n$. +-/ +@[category research solved, AMS 5] +theorem erdos_560.variants.lower_bound : + ∀ n : ℕ, n ≥ 6 → + (sizeRamsey (completeBipartiteGraph (Fin n) (Fin n)) (completeBipartiteGraph (Fin n) (Fin n)) : ℝ) > + (1 / 60 : ℝ) * (n : ℝ) ^ 2 * 2 ^ n := by + sorry + +/-- +Erdős Problem 560, upper bound [EFRS78b, NeRo78]: + +For all $n \geq 1$, $\hat{R}(K_{n,n}) < \frac{3}{2} n^3 \cdot 2^n$. +-/ +@[category research solved, AMS 5] +theorem erdos_560.variants.upper_bound : + ∀ n : ℕ, n ≥ 1 → + (sizeRamsey (completeBipartiteGraph (Fin n) (Fin n)) (completeBipartiteGraph (Fin n) (Fin n)) : ℝ) < + (3 / 2 : ℝ) * (n : ℝ) ^ 3 * 2 ^ n := by + sorry + +/-- +Erdős Problem 560, conjecture [CFW23]: + +$\hat{R}(K_{n,n}) \asymp n^3 \cdot 2^n$, i.e., there exist constants $C_1, C_2 > 0$ and $N_0$ +such that for all $n \geq N_0$, +$$C_1 \cdot n^3 \cdot 2^n \leq \hat{R}(K_{n,n}) \leq C_2 \cdot n^3 \cdot 2^n.$$ +-/ +@[category research open, AMS 5] +theorem erdos_560 : + ∃ C₁ : ℝ, C₁ > 0 ∧ ∃ C₂ : ℝ, C₂ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C₁ * (n : ℝ) ^ 3 * 2 ^ n ≤ + (sizeRamsey (completeBipartiteGraph (Fin n) (Fin n)) (completeBipartiteGraph (Fin n) (Fin n)) : ℝ) ∧ + (sizeRamsey (completeBipartiteGraph (Fin n) (Fin n)) (completeBipartiteGraph (Fin n) (Fin n)) : ℝ) ≤ + C₂ * (n : ℝ) ^ 3 * 2 ^ n := by + sorry + +end Erdos560 diff --git a/FormalConjectures/ErdosProblems/561.lean b/FormalConjectures/ErdosProblems/561.lean new file mode 100644 index 0000000000..edd550b461 --- /dev/null +++ b/FormalConjectures/ErdosProblems/561.lean @@ -0,0 +1,107 @@ +/- +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.Combinatorics.SimpleGraph.SizeRamsey + +/-! +# Erdős Problem 561 + +*Reference:* [erdosproblems.com/561](https://www.erdosproblems.com/561) + +Determine the two-color size Ramsey number for disjoint unions of stars. If +$F_1$ and $F_2$ are disjoint unions of stars with non-increasing degree sequences, +prove that $\hat{R}(F_1, F_2) = \sum \ell_k$ where each $\ell_k$ is the maximum of +$n_i + m_j - 1$ over pairs with $i + j = k$. + +[BEFRS78] proved the special case where all $n_i$ are identical and all $m_j$ are +identical. The general conjecture remains open. + +[BEFRS78] Burr, S. A., Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., +_Ramsey-minimal graphs for multiple copies_, Nederl. Akad. Wetensch. Indag. Math. (1978), +187-195. + +[GySc02] Győri, E., Schelp, R. H., _Two-edge colorings of graphs with bounded degree in +both colors_, Discrete Math. (2002), 105-110. + +[DJKR25] Davoodi, A., Javadi, R., Kamranian, A., Raeisi, G., _On a conjecture of Erdős +on size Ramsey number of star forests_, Ars Math. Contemp. (2025), Paper No. 9, 10 pages. +-/ + +open Finset SimpleGraph + +namespace Erdos561 + +/-- Disjoint union of star graphs $K_{1,\deg(0)} \cup \cdots \cup K_{1,\deg(s-1)}$. +Vertex $\langle i, j \rangle$ belongs to the $i$-th star; $j = 0$ is the center. -/ +def disjointUnionStars (s : ℕ) (deg : Fin s → ℕ) : + SimpleGraph (Σ i : Fin s, Fin (deg i + 1)) where + Adj x y := x.1 = y.1 ∧ ((x.2.val = 0 ∧ y.2.val ≠ 0) ∨ (x.2.val ≠ 0 ∧ y.2.val = 0)) + symm {_x} {_y} := fun ⟨heq, h⟩ => + ⟨heq.symm, h.elim (fun ⟨a, b⟩ => Or.inr ⟨b, a⟩) (fun ⟨a, b⟩ => Or.inl ⟨b, a⟩)⟩ + loopless _x := fun ⟨_, h⟩ => + h.elim (fun ⟨a, b⟩ => b a) (fun ⟨a, b⟩ => a b) + +/-- $\ell_k = \max\{n_i + m_j - 1 : i + j = k\}$ for $0$-indexed $i < s$, $j < t$. +Returns $0$ when no valid $(i, j)$ pair exists with $i + j = k$. -/ +def lFun (s t : ℕ) (n : Fin s → ℕ) (m : Fin t → ℕ) (k : ℕ) : ℕ := + (Finset.filter (fun p : Fin s × Fin t => p.1.val + p.2.val = k) Finset.univ).sup + (fun p => n p.1 + m p.2 - 1) + +/-- +Erdős Problem 561 [BEFRS78]: + +Let $\hat{R}(F_1, F_2)$ denote the two-color size Ramsey number. Let $F_1$ and $F_2$ be +disjoint unions of stars: +$$F_1 = K_{1,n_0} \cup \cdots \cup K_{1,n_{s-1}} \quad \text{with} \quad n_0 \geq \cdots \geq n_{s-1} \geq 1$$ +$$F_2 = K_{1,m_0} \cup \cdots \cup K_{1,m_{t-1}} \quad \text{with} \quad m_0 \geq \cdots \geq m_{t-1} \geq 1$$ + +Then $\hat{R}(F_1, F_2) = \sum_{k=0}^{s+t-2} \ell_k$ where +$\ell_k = \max\{n_i + m_j - 1 : i + j = k\}$. +-/ +@[category research open, AMS 5] +theorem erdos_561 + (s t : ℕ) (hs : s ≥ 1) (ht : t ≥ 1) + (n : Fin s → ℕ) (m : Fin t → ℕ) + (hn_pos : ∀ i, n i ≥ 1) + (hm_pos : ∀ j, m j ≥ 1) + (hn_mono : ∀ i₁ i₂ : Fin s, i₁ ≤ i₂ → n i₂ ≤ n i₁) + (hm_mono : ∀ j₁ j₂ : Fin t, j₁ ≤ j₂ → m j₂ ≤ m j₁) : + sizeRamsey + (disjointUnionStars s n) + (disjointUnionStars t m) = + Finset.sum (Finset.range (s + t - 1)) (lFun s t n m) := by + sorry + +/-- +Erdős Problem 561, special case [BEFRS78]: + +When all stars in $F_1$ have the same degree $n$ and all stars in $F_2$ have the same +degree $m$, the size Ramsey number $\hat{R}(F_1, F_2)$ equals the predicted formula. +This was proved by Burr, Erdős, Faudree, Rousseau, and Schelp. +-/ +@[category research solved, AMS 5] +theorem erdos_561_identical_stars + (s t : ℕ) (hs : s ≥ 1) (ht : t ≥ 1) + (n_val m_val : ℕ) (hn_pos : n_val ≥ 1) (hm_pos : m_val ≥ 1) : + sizeRamsey + (disjointUnionStars s (fun _ => n_val)) + (disjointUnionStars t (fun _ => m_val)) = + Finset.sum (Finset.range (s + t - 1)) + (lFun s t (fun _ => n_val) (fun _ => m_val)) := by + sorry + +end Erdos561 diff --git a/FormalConjectures/ErdosProblems/563.lean b/FormalConjectures/ErdosProblems/563.lean new file mode 100644 index 0000000000..dfe1a1161a --- /dev/null +++ b/FormalConjectures/ErdosProblems/563.lean @@ -0,0 +1,70 @@ +/- +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 563 + +For every 0 ≤ α < 1/2, let F(n, α) be the smallest m such that some 2-colouring of Kₙ forces +every m-subset of vertices to contain more than α · C(m, 2) edges of each colour. The conjecture +asserts that F(n, α) ~ c_α · log n for some constant c_α > 0. + +*Reference:* [erdosproblems.com/563](https://www.erdosproblems.com/563) + +[Er90b] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and +differences_. Mathematics of Ramsey theory, Algorithms Combin. 5 (1990), 12-28. +-/ + +open Finset Filter + +open scoped Topology + +namespace Erdos563 + +/-- The number of edges of a given colour within a subset $X$, where the colouring +is given by a symmetric function $c : \operatorname{Fin}(n) \to \operatorname{Fin}(n) +\to \operatorname{Bool}$. An edge $\{i, j\}$ (with $i < j$) has colour $c(i,j)$. -/ +def edgesOfColorInSubset {n : ℕ} (c : Fin n → Fin n → Bool) + (X : Finset (Fin n)) (color : Bool) : ℕ := + ((X ×ˢ X).filter (fun p => p.1 < p.2 ∧ c p.1 p.2 = color)).card + +/-- $F(n, \alpha)$: the smallest $m$ such that there exists a 2-colouring of the edges +of $K_n$ such that every subset of vertices of size $\geq m$ contains more than +$\alpha \cdot \binom{|X|}{2}$ edges of each colour. -/ +noncomputable def fErdos563 (n : ℕ) (α : ℝ) : ℕ := + sInf {m : ℕ | ∃ (c : Fin n → Fin n → Bool), + (∀ i j, c i j = c j i) ∧ + ∀ X : Finset (Fin n), (X.card : ℝ) ≥ (m : ℝ) → + ∀ color : Bool, + (edgesOfColorInSubset c X color : ℝ) > + α * ((X.card : ℝ) * ((X.card : ℝ) - 1) / 2)} + +/-- +Erdős Problem 563 [Er90b]: + +For every $0 \leq \alpha < 1/2$, there exists a constant $c_\alpha > 0$ such that +$$F(n, \alpha) \sim c_\alpha \cdot \log n,$$ +i.e., $F(n, \alpha) / \log(n) \to c_\alpha$ as $n \to \infty$. +-/ +@[category research open, AMS 5] +theorem erdos_563 (α : ℝ) (hα0 : 0 ≤ α) (hα1 : α < 1 / 2) : + ∃ c : ℝ, c > 0 ∧ + Tendsto (fun n : ℕ => (fErdos563 n α : ℝ) / Real.log (n : ℝ)) + atTop (nhds c) := by + sorry + +end Erdos563 diff --git a/FormalConjectures/ErdosProblems/565.lean b/FormalConjectures/ErdosProblems/565.lean new file mode 100644 index 0000000000..04ae553b5d --- /dev/null +++ b/FormalConjectures/ErdosProblems/565.lean @@ -0,0 +1,91 @@ +/- +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 565 + +*Reference:* [erdosproblems.com/565](https://www.erdosproblems.com/565) + +Let $R^*(G)$ be the induced Ramsey number: the minimal $m$ such that there is a +graph $H$ on $m$ vertices such that any 2-colouring of the edges of $H$ contains +an induced monochromatic copy of $G$. + +The existence of $R^*(G)$ for all finite graphs was established independently by +Deuber [De75], Erdős, Hajnal, and Pósa [EHP75], and Rödl [Ro73]. + +A problem of Erdős and Rödl. Kohayakawa, Prömel, and Rödl [KPR98] proved +$R^*(G) < 2^{O(n(\log n)^2)}$. Fox and Sudakov [FoSu08] gave an alternative +proof. Conlon, Fox, and Sudakov [CFS12] improved this to $R^*(G) < 2^{O(n \log n)}$. +Proved by Aragão, Campos, Dahia, Filipe, and Marciano [ACDFM25]. + +[De75] Deuber, W., _Generalizations of Ramsey's theorem_. Infinite and finite sets +(Colloq., Keszthely, 1973) (1975), 323-332. + +[EHP75] Erdős, P., Hajnal, A., and Pósa, L., _Strong embeddings of graphs into +colored graphs_. Infinite and finite sets (Colloq., Keszthely, 1973) (1975), 585-595. + +[Ro73] Rödl, V., _The dimension of a graph and generalized Ramsey theorems_. Thesis +(1973). + +[KPR98] Kohayakawa, Y., Prömel, H. J., and Rödl, V., _Induced Ramsey numbers_. +Combinatorica **18** (1998), 373-404. + +[FoSu08] Fox, J. and Sudakov, B., _Induced Ramsey-type theorems_. Advances in +Mathematics **219** (2008), 1771-1800. + +[CFS12] Conlon, D., Fox, J., and Sudakov, B., _On two problems in graph Ramsey +theory_. Combinatorica **32** (2012), 513-535. + +[ACDFM25] Aragão, L., Campos, M., Dahia, G., Filipe, J., and Marciano, J., _An +exponential upper bound for induced Ramsey numbers_. arXiv:2509.22629 (2025). +-/ + +open SimpleGraph + +namespace Erdos565 + +/-- The induced Ramsey number $R^*(G)$: the minimum $m$ such that there exists a +graph $H$ on $m$ vertices where every 2-colouring of the edges of $H$ contains +an induced monochromatic copy of $G$. + +An induced monochromatic copy of $G$ means: there is an injection +$f : V \hookrightarrow [m]$ and a colour $b \in \{0, 1\}$ such that for all +distinct $u, v \in V$, $G$ has edge $\{u, v\}$ if and only if $H$ has edge +$\{f(u), f(v)\}$ with colour $b$. -/ +noncomputable def inducedRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) : ℕ := + sInf {m : ℕ | ∃ (H : SimpleGraph (Fin m)), + ∀ (c : Fin m → Fin m → Bool), + (∀ i j, c i j = c j i) → + ∃ (b : Bool) (f : V → Fin m), Function.Injective f ∧ + ∀ u v, u ≠ v → (G.Adj u v ↔ (H.Adj (f u) (f v) ∧ c (f u) (f v) = b))} + +/-- +Erdős Problem 565: There exists a constant $C$ such that for any graph $G$ on +$n$ vertices, the induced Ramsey number $R^*(G) \leq 2^{Cn}$. + +A problem of Erdős and Rödl. Proved by Aragão, Campos, Dahia, Filipe, +and Marciano [ACDFM25]. +-/ +@[category research solved, AMS 5] +theorem erdos_565 : + ∃ C : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + inducedRamseyNumber G ≤ 2 ^ (C * n) := by + sorry + +end Erdos565 diff --git a/FormalConjectures/ErdosProblems/568.lean b/FormalConjectures/ErdosProblems/568.lean new file mode 100644 index 0000000000..46bd5c2601 --- /dev/null +++ b/FormalConjectures/ErdosProblems/568.lean @@ -0,0 +1,70 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Acyclic + +/-! +# Erdős Problem 568 + +*Reference:* [erdosproblems.com/568](https://www.erdosproblems.com/568) + +A problem of Erdős, Faudree, Rousseau, and Schelp. + +[EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., _Ramsey size linear graphs_. +Combin. Probab. Comput. (1993), 389-399. +-/ + +namespace Erdos568 + +open SimpleGraph + +/-- The Ramsey number $R(G, H)$: the minimum $N$ such that for any graph $F$ +on $\operatorname{Fin} N$, either $G$ embeds in $F$ or $H$ embeds in the +complement of $F$. -/ +noncomputable def ramseyNum {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : ℕ := + sInf {N : ℕ | ∀ (F : SimpleGraph (Fin N)), + G ⊑ F ∨ H ⊑ Fᶜ} + +/-- +Erdős Problem 568: + +Let $G$ be a graph such that: +1. $R(G, T) = O(n)$ for every tree $T$ on $n$ vertices, and +2. $R(G, K_n) = O(n^2)$. + +Is it true that for any graph $H$ with $m$ edges and no isolated vertices, +$R(G, H) = O(m)$? + +In other words, is $G$ Ramsey size linear? + +[EFRS93] +-/ +@[category research open, AMS 5] +theorem erdos_568 : answer(sorry) ↔ + ∀ (V : Type*) [Fintype V] (G : SimpleGraph V), + (∃ C₁ : ℕ, ∀ (n : ℕ) (T : SimpleGraph (Fin n)), + T.IsTree → ramseyNum G T ≤ C₁ * n) → + (∃ C₂ : ℕ, ∀ (n : ℕ), + ramseyNum G (⊤ : SimpleGraph (Fin n)) ≤ C₂ * n ^ 2) → + ∃ C : ℕ, ∀ (k : ℕ) (H : SimpleGraph (Fin k)), + (∀ v : Fin k, ∃ w, H.Adj v w) → + ramseyNum G H ≤ C * H.edgeSet.ncard := by + sorry + +end Erdos568 diff --git a/FormalConjectures/ErdosProblems/569.lean b/FormalConjectures/ErdosProblems/569.lean new file mode 100644 index 0000000000..a907b94589 --- /dev/null +++ b/FormalConjectures/ErdosProblems/569.lean @@ -0,0 +1,60 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 569 + +Is it true that for every $k \geq 1$, there exists a constant $c_k$ such that for any graph $H$ +with $m$ edges and no isolated vertices, $R(C_{2k+1}, H) \leq c_k \cdot m$? + +*Reference:* [erdosproblems.com/569](https://www.erdosproblems.com/569) + +[EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., _Multipartite graph—sparse +graph Ramsey numbers_ (1993). +-/ + +open SimpleGraph + +namespace Erdos569 + +/-- The Ramsey number $R(G, H)$: the minimum $N$ such that for any graph $F$ +on $\operatorname{Fin} N$, either $G$ embeds in $F$ or $H$ embeds in the complement +of $F$. -/ +noncomputable def ramseyNum {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : ℕ := + sInf {N : ℕ | ∀ (F : SimpleGraph (Fin N)), + G.IsContained F ∨ H.IsContained Fᶜ} + +/-- +Erdős Problem 569 [EFRS93]: + +For every $k \geq 1$, there exists a constant $c_k$ such that for any graph $H$ +with $m$ edges and no isolated vertices, $R(C_{2k+1}, H) \leq c_k \cdot m$. + +Here $C_{2k+1}$ is the odd cycle on $2k+1$ vertices. +-/ +@[category research open, AMS 5] +theorem erdos_569 (k : ℕ) (hk : k ≥ 1) : + ∃ c : ℕ, ∀ (n : ℕ) (H : SimpleGraph (Fin n)), + (∀ v : Fin n, ∃ w, H.Adj v w) → + ramseyNum (SimpleGraph.cycleGraph (2 * k + 1)) H ≤ c * H.edgeSet.ncard := by + sorry + +end Erdos569 diff --git a/FormalConjectures/ErdosProblems/57.lean b/FormalConjectures/ErdosProblems/57.lean new file mode 100644 index 0000000000..36a073ec26 --- /dev/null +++ b/FormalConjectures/ErdosProblems/57.lean @@ -0,0 +1,79 @@ +/- +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 57 + +*Reference:* [erdosproblems.com/57](https://www.erdosproblems.com/57) + +If $G$ is a graph with infinite chromatic number and $a_1 < a_2 < \cdots$ are the lengths +of its odd cycles, then $\sum 1/a_i = \infty$. Conjectured by Erdős and Hajnal [ErHa66], +proved by Liu and Montgomery [LiMo20]. + +Erdős later asked ([Er81]) whether the odd cycle lengths must have positive upper density +among the odd numbers, a strictly stronger property. See also Problem 65 for a related +result on sums of reciprocals of all cycle lengths. + +[ErHa66] Erdős, P. and Hajnal, A., _On chromatic number of graphs and set-systems_. +Acta Math. Acad. Sci. Hungar. **17** (1966), 61–99. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica **1** (1981), 25–42. + +[LiMo20] Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_. +J. Amer. Math. Soc. **36** (2023), 1191–1234. +-/ + +open SimpleGraph Finset + +namespace Erdos57 + +/-- The set of lengths of odd cycles in a graph $G$. -/ +def oddCycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n : ℕ | Odd n ∧ ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + +/-- +Erdős Problem 57 (Conjectured by Erdős-Hajnal [ErHa66], proved by Liu-Montgomery [LiMo20]): +If $G$ is a graph with infinite chromatic number and $a_1 < a_2 < \cdots$ are the lengths of +the odd cycles of $G$, then $\sum 1/a_i = \infty$. + +We formalize "$\sum 1/a_i = \infty$" as: for any real bound $B$, there exists a finite set $T$ +of odd cycle lengths of $G$ whose reciprocals sum to at least $B$. +-/ +@[category research solved, AMS 5] +theorem erdos_57 {V : Type*} (G : SimpleGraph V) + (hχ : G.chromaticNumber = ⊤) : + ∀ (B : ℝ), ∃ (T : Finset ℕ), + (∀ n ∈ T, n ∈ oddCycleLengths G) ∧ + B ≤ ∑ n ∈ T, (1 / (n : ℝ)) := by + sorry + +/-- +Variant of Erdős Problem 57 (Erdős [Er81]): +If $G$ has infinite chromatic number, must the set of odd cycle lengths have positive +upper density among the odd numbers? This is strictly stronger than the reciprocal +divergence in `erdos_57`, since positive upper density implies divergence of reciprocals +but not conversely. +-/ +@[category research open, AMS 5] +theorem erdos_57_positive_upper_density {V : Type*} (G : SimpleGraph V) + (hχ : G.chromaticNumber = ⊤) : + 0 < (oddCycleLengths G).upperDensity {n : ℕ | Odd n} := by + sorry + +end Erdos57 diff --git a/FormalConjectures/ErdosProblems/570.lean b/FormalConjectures/ErdosProblems/570.lean new file mode 100644 index 0000000000..c421910760 --- /dev/null +++ b/FormalConjectures/ErdosProblems/570.lean @@ -0,0 +1,91 @@ +/- +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 570 + +*Reference:* [erdosproblems.com/570](https://www.erdosproblems.com/570) + +For any integer $k \geq 3$, is it true that for all sufficiently large $m$, every graph $H$ with +$m$ edges and no isolated vertices satisfies $R(C_k, H) \leq 2m + \lfloor(k-1)/2\rfloor$, where +$R$ denotes the two-colour Ramsey number and $C_k$ the cycle on $k$ vertices? + +This was proved in stages: for even $k$ by Erdős, Faudree, Rousseau, and Schelp [EFRS93]; +for $k = 3$ independently by Goddard–Kleitman [GoKl94] and Sidorenko [Si91]; for $k = 5$ by +Jayawardene [Ja99]; and for all odd $k \geq 7$ by Cambie, Freschi, Morawski, Petrova, and +Pokrovskiy [CFMPP26]. + +See also Erdős Problem 569, which asks for the weaker linear bound $R(C_{2k+1}, H) \leq c_k m$. + +[EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., _Ramsey size linear graphs_. +Combin. Probab. Comput. (1993), 389-399. + +[GoKl94] Goddard, W. and Kleitman, D., _An upper bound for the Ramsey numbers $r(K_3, G)$_. +Discrete Math. (1994), 177-182. + +[Si91] Sidorenko, A., _An upper bound on the Ramsey number $r(K_3, G)$ depending only on the +size of the graph $G$_. J. Graph Theory (1991), 15-17. + +[Ja99] Jayawardene, C., _Ramsey numbers related to small cycles_. Ph.D. dissertation, +University of Memphis (1999). + +[CFMPP26] Cambie, S., Freschi, A., Morawski, P., Petrova, K., and Pokrovskiy, A., +_Ramsey number of a cycle versus a graph of a given size_. arXiv:2601.10238 (2026). +-/ + +open SimpleGraph + +namespace Erdos570 + +/-- A graph $G$ embeds into a graph $H$: there is an injective map from +vertices of $G$ to vertices of $H$ preserving adjacency. -/ +def Embeds {V W : Type*} (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : V → W, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) + +/-- The Ramsey number $R(G, H)$: the minimum $N$ such that for any graph $F$ +on $\operatorname{Fin} N$, either $G$ embeds in $F$ or $H$ embeds in the complement of $F$. -/ +noncomputable def ramseyNum {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : ℕ := + sInf {N : ℕ | ∀ (F : SimpleGraph (Fin N)), + Embeds G F ∨ Embeds H Fᶜ} + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 570 [EFRS93]: + +Let $k \geq 3$. Is it true that, for sufficiently large $m$, for any graph $H$ with $m$ edges and +no isolated vertices, $R(C_k, H) \leq 2m + \lfloor(k - 1) / 2\rfloor$? + +Here $C_k$ is the cycle on $k$ vertices and $R(G, H)$ is the two-colour +Ramsey number. +-/ +@[category research solved, AMS 5] +theorem erdos_570 : answer(True) ↔ ∀ (k : ℕ) (hk : k ≥ 3), + ∃ M₀ : ℕ, ∀ (n : ℕ) (H : SimpleGraph (Fin n)), + (∀ v : Fin n, ∃ w, H.Adj v w) → + H.edgeSet.ncard ≥ M₀ → + ramseyNum (cycleGraph k hk) H ≤ 2 * H.edgeSet.ncard + (k - 1) / 2 := by + sorry + +end Erdos570 diff --git a/FormalConjectures/ErdosProblems/571.lean b/FormalConjectures/ErdosProblems/571.lean new file mode 100644 index 0000000000..e6fb543161 --- /dev/null +++ b/FormalConjectures/ErdosProblems/571.lean @@ -0,0 +1,74 @@ +/- +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 571 + +Is it true that for every rational α ∈ [1, 2), there exists a bipartite graph G such that +the Turán extremal number satisfies ex(n; G) ≍ n^α? + +*Reference:* [erdosproblems.com/571](https://www.erdosproblems.com/571) + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial + number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, + Graph Theory, and Computing (1978), 29–40. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica **1** (1981), 25–42. + +[ErSi84] Erdős, P. and Simonovits, M., _Cube-supersaturated graphs and related problems_, + Progress in graph theory (Waterloo, Ont., 1982), Academic Press, Toronto, ON, 1984, 203–218. + +[BuCo18] Bukh, B. and Conlon, D., _Rational exponents in extremal graph theory_, + Journal of the European Mathematical Society (JEMS) (2018), 1747–1757. +-/ + +open SimpleGraph + +namespace Erdos571 + +/-- A graph $G$ contains $H$ as a subgraph via an injective graph homomorphism. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán extremal number $\mathrm{ex}(n; H)$: the maximum number of edges in a +simple graph on $n$ vertices that does not contain $H$ as a subgraph. -/ +noncomputable def extremalNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m} + +/-- +Erdős Problem 571 (Erdős–Simonovits): + +For every rational $\alpha \in [1, 2)$, there exists a finite bipartite graph $G$ such that +the Turán extremal number satisfies $\mathrm{ex}(n; G) \asymp n^\alpha$, meaning there exist positive +constants $c_1, c_2 > 0$ and a threshold $N_0$ such that for all $n \geq N_0$, +$$c_1 \cdot n^\alpha \leq \mathrm{ex}(n; G) \leq c_2 \cdot n^\alpha.$$ +-/ +@[category research open, AMS 5] +theorem erdos_571 : + ∀ α : ℚ, 1 ≤ α → α < 2 → + ∃ (U : Type) (_ : Fintype U) (G : SimpleGraph U), + G.Colorable 2 ∧ + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c₁ * (n : ℝ) ^ (α : ℝ) ≤ (extremalNumber G n : ℝ) ∧ + (extremalNumber G n : ℝ) ≤ c₂ * (n : ℝ) ^ (α : ℝ) := by + sorry + +end Erdos571 diff --git a/FormalConjectures/ErdosProblems/572.lean b/FormalConjectures/ErdosProblems/572.lean new file mode 100644 index 0000000000..59c615717a --- /dev/null +++ b/FormalConjectures/ErdosProblems/572.lean @@ -0,0 +1,145 @@ +/- +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 572 + +*Reference:* [erdosproblems.com/572](https://www.erdosproblems.com/572) + +Show that for $k \geq 3$, +$$\mathrm{ex}(n; C_{2k}) \gg n^{1 + 1/k}.$$ + +Here $\mathrm{ex}(n; C_{2k})$ is the Turán extremal number: the maximum number of edges in +an $n$-vertex graph that does not contain the even cycle $C_{2k}$ as a subgraph. + +The notation $\gg$ means there exists a positive constant $c > 0$ such that +$\mathrm{ex}(n; C_{2k}) \geq c \cdot n^{1+1/k}$ for all sufficiently large $n$. + +A problem of Erdős [Er64c]. The upper bound $\mathrm{ex}(n; C_{2k}) \ll k \cdot n^{1+1/k}$ +was proved by Erdős [Er64c] and Bondy–Simonovits [BoSi74]. The matching lower +bound is known for $k = 2$ (Erdős–Klein [Er38]), $k = 3, 5$ (Benson [Be66]), +and $k = 4$ (Wenger). The general case remains open. + +[Er64c] Erdős, P., _On extremal problems of graphs and generalized graphs_. +Israel J. Math. 2 (1964), 183–190. + +[BoSi74] Bondy, J.A. and Simonovits, M., _Cycles of even length in graphs_. +J. Combin. Theory Ser. B 16 (1974), 97–105. + +[Er38] Erdős, P., _On sequences of integers no one of which divides the product +of two others and on some related problems_. Mitt. Forsch.-Inst. Math. Mech. +Univ. Tomsk 2 (1938), 74–82. + +[Be66] Benson, C.T., _Minimal regular graphs of girths eight and twelve_. +Canad. J. Math. 18 (1966), 1091–1094. + +[LUW95] Lazebnik, F., Ustimenko, V.A., Woldar, A.J., _A new series of dense graphs +of high girth_. Bull. Amer. Math. Soc. (N.S.) 32 (1995), 73–79. + +[LUW99] Lazebnik, F., Ustimenko, V.A., Woldar, A.J., _Polarities and 2k-cycle-free +graphs_. Discrete Math. 197/198 (1999), 503–513. +-/ + +open SimpleGraph + +namespace Erdos572 + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- A graph $G$ contains $H$ as a subgraph via an injective graph homomorphism. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán extremal number $\mathrm{ex}(n; H)$: the maximum number of edges in a +simple graph on $n$ vertices that does not contain $H$ as a subgraph. -/ +noncomputable def extremalNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m} + +/-- +Erdős Problem 572 [Er64c]: + +For every $k \geq 3$, there exists a constant $c > 0$ such that for all sufficiently +large $n$, +$$\mathrm{ex}(n; C_{2k}) \geq c \cdot n^{1 + 1/k}.$$ +-/ +@[category research open, AMS 5] +theorem erdos_572 (k : ℕ) (hk : k ≥ 3) : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) ^ (1 + 1 / (k : ℝ)) ≤ (extremalNumber (cycleGraph (2 * k) (by omega)) n : ℝ) := by + sorry + +/-- +Erdős Problem 572, solved case $k = 2$ (Erdős–Klein [Er38]): + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +$\mathrm{ex}(n; C_4) \geq c \cdot n^{3/2}$. +-/ +@[category research solved, AMS 5] +theorem erdos_572_k2 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) ^ (1 + 1 / (2 : ℝ)) ≤ (extremalNumber (cycleGraph 4 (by omega)) n : ℝ) := by + sorry + +/-- +Erdős Problem 572, solved case $k = 3$ (Benson [Be66]): + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +$\mathrm{ex}(n; C_6) \geq c \cdot n^{4/3}$. +-/ +@[category research solved, AMS 5] +theorem erdos_572_k3 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) ^ (1 + 1 / (3 : ℝ)) ≤ (extremalNumber (cycleGraph 6 (by omega)) n : ℝ) := by + sorry + +/-- +Erdős Problem 572, solved case $k = 4$ (Wenger): + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +$\mathrm{ex}(n; C_8) \geq c \cdot n^{5/4}$. +-/ +@[category research solved, AMS 5] +theorem erdos_572_k4 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) ^ (1 + 1 / (4 : ℝ)) ≤ (extremalNumber (cycleGraph 8 (by omega)) n : ℝ) := by + sorry + +/-- +Erdős Problem 572, solved case $k = 5$ (Benson [Be66]): + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +$\mathrm{ex}(n; C_{10}) \geq c \cdot n^{6/5}$. +-/ +@[category research solved, AMS 5] +theorem erdos_572_k5 : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) ^ (1 + 1 / (5 : ℝ)) ≤ (extremalNumber (cycleGraph 10 (by omega)) n : ℝ) := by + sorry + +end Erdos572 diff --git a/FormalConjectures/ErdosProblems/573.lean b/FormalConjectures/ErdosProblems/573.lean new file mode 100644 index 0000000000..a5a55b9fed --- /dev/null +++ b/FormalConjectures/ErdosProblems/573.lean @@ -0,0 +1,85 @@ +/- +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 573 + +*Reference:* [erdosproblems.com/573](https://www.erdosproblems.com/573) + +Is it true that $\operatorname{ex}(n; \{C_3, C_4\}) \sim (n/2)^{3/2}$? + +This is the $k = 2$ case of [Erdős Problem 574](https://www.erdosproblems.com/574). +See also [Erdős Problem 765](https://www.erdosproblems.com/765) concerning +$\operatorname{ex}(n; C_4)$ specifically. + +OEIS: [A006856](https://oeis.org/A006856) + +[Er71] Erdős, P., *Topics in combinatorial analysis*, 1971, p.103. +[Er75] Erdős, P., *Problems and results on combinatorial number theory*, 1975. +[ErSi82] Erdős, P. and Simonovits, M., *Compactness results in extremal graph theory*. +Combinatorica **2** (1982), 275-288. +[Er93] Erdős, P., 1993, p.336. +[KST54] Kővári, T., Sós, V. T., and Turán, P., *On a problem of K. Zarankiewicz*. +Colloq. Math. **3** (1954), 50-57. +-/ + +open Filter SimpleGraph + +open scoped Topology Real + +namespace Erdos573 + +/-- A simple graph is $C_4$-free if it contains no 4-cycle. +The conditions $a \neq c$ and $b \neq d$ ensure the four vertices are distinct +(the remaining distinctness conditions follow from irreflexivity of `Adj`). -/ +def C4Free {V : Type*} (G : SimpleGraph V) : Prop := + ∀ a b c d : V, a ≠ c → b ≠ d → + G.Adj a b → G.Adj b c → G.Adj c d → ¬G.Adj d a + +/-- The extremal number $\operatorname{ex}(n; \{C_3, C_4\})$: the maximum number of edges in a +simple graph on $n$ vertices containing neither a triangle ($C_3$, i.e. a $3$-clique) +nor a 4-cycle ($C_4$). -/ +noncomputable def exC3C4 (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ G : SimpleGraph (Fin n), + G.CliqueFree 3 ∧ C4Free G ∧ G.edgeSet.ncard = k} + +/-- +Is it true that $\operatorname{ex}(n; \{C_3, C_4\}) \sim (n/2)^{3/2}$? + +The extremal number $\operatorname{ex}(n; \{C_3, C_4\})$ is the maximum number of edges in a graph +on $n$ vertices that contains no triangle ($C_3$) and no 4-cycle ($C_4$). + +The conjecture asserts that this quantity is asymptotically $(n/2)^{3/2}$, +i.e. the ratio $\operatorname{ex}(n; \{C_3, C_4\}) / (n/2)^{3/2}$ tends to $1$ as $n \to \infty$. + +Erdős and Simonovits proved that $\operatorname{ex}(n; \{C_4, C_5\}) = (n/2)^{3/2} + O(n)$. +Kővári, Sós, and Turán proved that the extremal number for forbidding $C_4$ +together with any odd cycle is $\sim (n/2)^{3/2}$. This problem asks whether +the same holds when only $C_3$ (triangles) are forbidden alongside $C_4$. + +References: [Er71,p.103], [Er75], [ErSi82], [Er93,p.336], [KST54] +-/ +@[category research open, AMS 5] +theorem erdos_573 : + answer(sorry) ↔ + Tendsto + (fun n : ℕ => (exC3C4 n : ℝ) / ((n : ℝ) / 2) ^ ((3 : ℝ) / 2)) + atTop (nhds 1) := by + sorry + +end Erdos573 diff --git a/FormalConjectures/ErdosProblems/574.lean b/FormalConjectures/ErdosProblems/574.lean new file mode 100644 index 0000000000..142e65d477 --- /dev/null +++ b/FormalConjectures/ErdosProblems/574.lean @@ -0,0 +1,72 @@ +/- +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 574 + +*Reference:* [erdosproblems.com/574](https://www.erdosproblems.com/574) + +A problem of Erdős and Simonovits. + +[ErSi82] Erdős, P. and Simonovits, M. +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos574 + +/-- A simple graph $G$ contains a cycle of length $m$ ($m \geq 3$) if there exist $m$ +distinct vertices $v_0, \ldots, v_{m-1}$ such that $v_i$ is adjacent to +$v_{(i+1) \bmod m}$ for all $i$. -/ +def ContainsCycleOfLength {V : Type*} (G : SimpleGraph V) (m : ℕ) (_ : m ≥ 3) : Prop := + ∃ (f : Fin m → V), Function.Injective f ∧ + ∀ i : Fin m, G.Adj (f i) (f ⟨(i.val + 1) % m, Nat.mod_lt _ (by omega)⟩) + +/-- The extremal number $\operatorname{ex}(n; \{C_{2k-1}, C_{2k}\})$: the maximum number of edges +in a simple graph on $n$ vertices containing no cycle of length $2k-1$ or $2k$. -/ +noncomputable def exConsecutiveCycles (k : ℕ) (hk : k ≥ 2) (n : ℕ) : ℕ := + sSup {e : ℕ | ∃ G : SimpleGraph (Fin n), + ¬ContainsCycleOfLength G (2 * k - 1) (by omega) ∧ + ¬ContainsCycleOfLength G (2 * k) (by omega) ∧ + G.edgeSet.ncard = e} + +/-- +Erdős Problem 574: +Is it true that, for $k \geq 2$, +$$\operatorname{ex}(n; \{C_{2k-1}, C_{2k}\}) = (1 + o(1)) \cdot (n/2)^{1 + 1/k}?$$ + +The extremal number $\operatorname{ex}(n; \{C_{2k-1}, C_{2k}\})$ is the maximum number of edges in +a graph on $n$ vertices that contains no cycle of length $2k-1$ and no cycle of length $2k$. + +The conjecture asserts that for each fixed $k \geq 2$, this extremal number is +asymptotically $(n/2)^{1+1/k}$, i.e. the ratio tends to $1$ as $n \to \infty$. + +The case $k = 2$ (forbidding $C_3$ and $C_4$) is Erdős Problem 573. + +See [ErSi82] for the original statement. +-/ +@[category research open, AMS 5] +theorem erdos_574 : answer(sorry) ↔ + ∀ (k : ℕ) (hk : k ≥ 2), Tendsto + (fun n : ℕ => (exConsecutiveCycles k hk n : ℝ) / ((n : ℝ) / 2) ^ (1 + 1 / (k : ℝ))) + atTop (nhds 1) := by + sorry + +end Erdos574 diff --git a/FormalConjectures/ErdosProblems/575.lean b/FormalConjectures/ErdosProblems/575.lean new file mode 100644 index 0000000000..0cad7f45f3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/575.lean @@ -0,0 +1,80 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Bipartite + +/-! +# Erdős Problem 575 + +Erdős and Simonovits asked whether, for every finite family of graphs containing a bipartite +member, some bipartite member has Turán number within a constant factor of the family Turán number. + +*Reference:* [erdosproblems.com/575](https://www.erdosproblems.com/575) + +[ErSi82] Erdős, P. and Simonovits, M., _Compactness results in extremal graph theory_, +Combinatorica **2** (1982), 275-288. +-/ + +open SimpleGraph + +namespace Erdos575 + +/-- An injective graph homomorphism from $H$ to $G$: $G$ contains a copy of $H$ as a +subgraph. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán number $\operatorname{ex}(n; H)$: the maximum number of edges in a simple graph on +$n$ vertices that contains no copy of $H$ as a subgraph. -/ +noncomputable def turanNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ ¬ContainsSubgraph F H ∧ F.edgeFinset.card = m} + +/-- The Turán number for a family $\operatorname{ex}(n; \mathcal{F})$: the maximum number of edges +in a simple graph on $n$ vertices that contains no copy of any member of the family $\mathcal{F}$ +as a subgraph. -/ +noncomputable def turanNumberFamily + {ι : Type*} [Fintype ι] + {k : ι → ℕ} (H : (i : ι) → SimpleGraph (Fin (k i))) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ (∀ i : ι, ¬ContainsSubgraph F (H i)) ∧ F.edgeFinset.card = m} + +/-- +Erdős Conjecture (Problem 575) [ErSi82]: + +If $\mathcal{F}$ is a finite set of finite graphs containing at least one bipartite graph, then +there exists a bipartite $G \in \mathcal{F}$ such that +$\operatorname{ex}(n; G) \leq C \cdot \operatorname{ex}(n; \mathcal{F})$ for some constant $C$ +depending on $\mathcal{F}$ and all $n \geq 1$. + +See also Problem 180. +-/ +@[category research open, AMS 5] +theorem erdos_575 : answer(sorry) ↔ + ∀ (ι : Type) [Fintype ι] [Nonempty ι] + (k : ι → ℕ) (H : (i : ι) → SimpleGraph (Fin (k i))), + (∃ i : ι, IsBipartite (H i)) → + ∃ i : ι, + IsBipartite (H i) ∧ + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (turanNumber (H i) n : ℝ) ≤ C * (turanNumberFamily H n : ℝ) := by + sorry + +end Erdos575 diff --git a/FormalConjectures/ErdosProblems/576.lean b/FormalConjectures/ErdosProblems/576.lean new file mode 100644 index 0000000000..713bfd7f7f --- /dev/null +++ b/FormalConjectures/ErdosProblems/576.lean @@ -0,0 +1,87 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 576 + +Erdős conjectured that the Turán number of the 3-dimensional hypercube graph $Q_3$ +satisfies $\mathrm{ex}(n; Q_3) \asymp n^{8/5}$. + +*Reference:* [erdosproblems.com/576](https://www.erdosproblems.com/576) + +References: +- [Er64c] Erdős, P. (1964). +- [Er74c] Erdős, P., _Extremal problems on graphs and hypergraphs_. (1974), 75-84. +- [Er75] Erdős, P., _Some recent progress on extremal problems in graph theory_. (1975). +- [Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. Combinatorica (1981), 25-42. +- [Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. Quaestiones Mathematicae (1993), 333-350. +- [ErSi70] Erdős, P., Simonovits, M., _Some extremal problems in graph theory_. Combinatorial Theory and Its Applications, I-III (1970), 377-390. +- [JaSu22] Janzer, O., Sudakov, B., _On the Turán number of the hypercube_. arXiv:2211.02015 (2024). +- [SuTo22] Sudakov, B., Tomon, I., _The extremal number of tight cycles_. International Mathematics Research Notices (IMRN) (2022), 9663-9684. +-/ + +open SimpleGraph Finset + +namespace Erdos576 + +/-- The $k$-dimensional hypercube graph $Q_k$: vertices are functions +$\operatorname{Fin} k \to \operatorname{Bool}$, and two vertices are adjacent iff they differ +in exactly one coordinate. -/ +def hypercubeGraph (k : ℕ) : SimpleGraph (Fin k → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm u v := by + rintro ⟨hne, hcard⟩ + refine ⟨hne.symm, ?_⟩ + have heq : (Finset.univ.filter fun i => v i ≠ u i) = + (Finset.univ.filter fun i => u i ≠ v i) := + Finset.filter_congr (fun i _ => ne_comm) + rw [heq] + exact hcard + loopless := fun v ⟨hne, _⟩ => hne rfl + +/-- The Turán number $\mathrm{ex}(n; H)$: the maximum number of edges in a simple graph +on $n$ vertices that contains no copy of $H$ as a subgraph. -/ +noncomputable def turanNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ ¬(H ⊑ F) ∧ F.edgeFinset.card = m} + +/-- +Erdős Conjecture (Problem 576) [Er64c], [ErSi70], [Er74c], [Er81], [Er93]: + +Let $Q_3$ be the 3-dimensional hypercube graph. Erdős and Simonovits proved that +$$ + (1/2 + o(1)) \cdot n^{3/2} \leq \mathrm{ex}(n; Q_3) \ll n^{8/5}. +$$ + +Erdős conjectured that $\mathrm{ex}(n; Q_3) \asymp n^{8/5}$, i.e., there exist constants +$c, C > 0$ such that for all sufficiently large $n$, +$$ + c \cdot n^{8/5} \leq \mathrm{ex}(n; Q_3) \leq C \cdot n^{8/5}. +$$ +-/ +@[category research open, AMS 5] +theorem erdos_576 : + ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + c * (n : ℝ) ^ ((8 : ℝ) / 5) ≤ (turanNumber (hypercubeGraph 3) n : ℝ) ∧ + (turanNumber (hypercubeGraph 3) n : ℝ) ≤ C * (n : ℝ) ^ ((8 : ℝ) / 5) := by + sorry + +end Erdos576 diff --git a/FormalConjectures/ErdosProblems/577.lean b/FormalConjectures/ErdosProblems/577.lean new file mode 100644 index 0000000000..c7b4532d0d --- /dev/null +++ b/FormalConjectures/ErdosProblems/577.lean @@ -0,0 +1,67 @@ +/- +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 577 + +*Reference:* [erdosproblems.com/577](https://www.erdosproblems.com/577) + +A conjecture of Erdős and Faudree [Er90c]. Proved by Wang [Wa10]. + +[Er90c] Erdős, P., Some of my favourite problems in various branches of combinatorics, +Matematiche (Catania) 45 (1990), 59-73. + +[Wa10] Wang, H., Proof of the Erdős-Faudree conjecture on quadrilaterals, Graphs and +Combinatorics 26 (2010), 833-877. +-/ + +open SimpleGraph + +namespace Erdos577 + +/-- Four vertices form a $4$-cycle in $G$: they are pairwise distinct and +adjacent in cyclic order $a \sim b \sim c \sim d \sim a$. -/ +def IsFourCycle {V : Type*} (G : SimpleGraph V) (a b c d : V) : Prop := + a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ + G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a + +/-- The set of vertices in a $4$-tuple. -/ +def fourCycleVertices {V : Type*} (t : V × V × V × V) : Set V := + let (a, b, c, d) := t; {a, b, c, d} + +/-- +Erdős Problem 577 [Er90c]: + +If $G$ is a graph with $4k$ vertices and minimum degree at least $2k$ then $G$ +contains $k$ vertex-disjoint $4$-cycles. + +A conjecture of Erdős and Faudree. Proved by Wang [Wa10]. +-/ +@[category research solved, AMS 5] +theorem erdos_577 : + ∀ (k : ℕ) + (G : SimpleGraph (Fin (4 * k))) (dG : DecidableRel G.Adj), + haveI := dG; + (∀ v : Fin (4 * k), 2 * k ≤ G.degree v) → + ∃ cycles : Fin k → Fin (4 * k) × Fin (4 * k) × Fin (4 * k) × Fin (4 * k), + (∀ i, let (a, b, c, d) := cycles i; IsFourCycle G a b c d) ∧ + (∀ i j, i ≠ j → + Disjoint (fourCycleVertices (cycles i)) (fourCycleVertices (cycles j))) := by + sorry + +end Erdos577 diff --git a/FormalConjectures/ErdosProblems/578.lean b/FormalConjectures/ErdosProblems/578.lean new file mode 100644 index 0000000000..aad758769c --- /dev/null +++ b/FormalConjectures/ErdosProblems/578.lean @@ -0,0 +1,87 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 578 + +*Reference:* [erdosproblems.com/578](https://www.erdosproblems.com/578) + +A conjecture of Erdős and Bollobás [Er90c]. Solved by Riordan [Ri00], who in fact +proved this with any edge-probability $> 1/4$. + +[Er90c] Erdős, P., *Problems and results in graph theory and combinatorics*. 1990. + +[Ri00] Riordan, O., *Spanning subgraphs of random graphs*. Combinatorics, Probability +and Computing, 2000. +-/ + +open scoped Classical +open SimpleGraph + +namespace Erdos578 + +/-- The $d$-dimensional hypercube graph $Q_d$. Vertices are functions `Fin d → Bool` + (binary strings of length $d$). Two vertices are adjacent iff they differ in + exactly one coordinate. -/ +def hypercubeGraph (d : ℕ) : SimpleGraph (Fin d → Bool) where + Adj u v := (Finset.univ.filter fun i => u i ≠ v i).card = 1 + symm := by + intro u v h + have heq : (Finset.univ.filter fun i : Fin d => v i ≠ u i) = + (Finset.univ.filter fun i : Fin d => u i ≠ v i) := by + ext i; simp [ne_comm] + rw [heq]; exact h + loopless := fun v h => by + simp [Finset.filter_false_of_mem] at h + +/-- The simple graph on `Fin n` determined by a Boolean matrix. Only values at + `(min u v, max u v)` matter; this ensures symmetry. Under $G(n, 1/2)$, each + Boolean matrix is equally likely, and the fraction of matrices whose graph + has a property equals the probability that $G(n, 1/2)$ has that property. -/ +def toGraph578 {n : ℕ} (ec : Fin n → Fin n → Bool) : SimpleGraph (Fin n) where + Adj u v := u ≠ v ∧ ec (min u v) (max u v) = true + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, by rwa [min_comm, max_comm]⟩ + loopless := fun v ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 578 [Er90c]: + +In the Erdős–Rényi random graph $G(2^d, 1/2)$ — the uniform distribution over all +labelled simple graphs on $2^d$ vertices — the probability that $G$ contains a copy +of $Q_d$ (the $d$-dimensional hypercube) tends to $1$ as $d \to \infty$. + +A copy of $Q_d$ in $G$ means an injective map $f$ from the vertices of $Q_d$ to the +vertices of $G$ such that adjacent vertices in $Q_d$ map to adjacent vertices in $G$. + +Equivalently: for every $\varepsilon > 0$ there exists $d_0$ such that for all +$d \geq d_0$ the fraction of Boolean matrices on `Fin (2 ^ d)` whose graph contains +$Q_d$ is $\geq 1 - \varepsilon$. + +Solved by Riordan [Ri00]. +-/ +@[category research solved, AMS 5 60] +theorem erdos_578 : + ∀ ε : ℝ, ε > 0 → + ∃ d₀ : ℕ, ∀ d : ℕ, d ≥ d₀ → + ((Finset.univ.filter (fun ec : Fin (2 ^ d) → Fin (2 ^ d) → Bool => + (hypercubeGraph d).IsContained (toGraph578 ec))).card : ℝ) ≥ + (1 - ε) * (Fintype.card (Fin (2 ^ d) → Fin (2 ^ d) → Bool) : ℝ) := by + sorry + +end Erdos578 diff --git a/FormalConjectures/ErdosProblems/579.lean b/FormalConjectures/ErdosProblems/579.lean new file mode 100644 index 0000000000..fa47bb47f0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/579.lean @@ -0,0 +1,72 @@ +/- +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 579 + +Erdős, Hajnal, Sós, and Szemerédi [EHSS83] conjectured that for any δ > 0, if n is sufficiently +large and G is a K_{2,2,2}-free graph on n vertices with at least δn² edges, then G contains an +independent set of size linear in n. + +Erdős, Hajnal, Sós, and Szemerédi proved the conjecture for δ > 1/8. + +Related to Problem 533. + +*Reference:* [erdosproblems.com/579](https://www.erdosproblems.com/579) + +**References:** + +[EHSS83] Erdős, P., Hajnal, A., Sós, V. T., and Szemerédi, E., +_More results on Ramsey-Turán type problems_. Combinatorica **3** (1983), 69–81. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er91] Erdős, P., _Problems and results in combinatorial number theory_. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), 97–132, p.340. +-/ + +open SimpleGraph + +namespace Erdos579 + +/-- +Let $\delta > 0$. If $n$ is sufficiently large and $G$ is a graph on $n$ vertices with no +$K_{2,2,2}$ (the complete tripartite graph with three parts of size $2$, also known as the +octahedron) and at least $\delta n^2$ edges then $G$ contains an independent set of size +$\gg_\delta n$. + +A problem of Erdős, Hajnal, Sós, and Szemerédi [EHSS83], who proved this for $\delta > 1/8$. +-/ +@[category research open, AMS 5] +theorem erdos_579 : + ∀ δ : ℝ, 0 < δ → + ∃ c : ℝ, 0 < c ∧ + ∃ N : ℕ, + ∀ n : ℕ, N ≤ n → + ∀ G : SimpleGraph (Fin n), + ¬(completeEquipartiteGraph 3 2).IsContained G → + δ * (n : ℝ) ^ 2 ≤ (G.edgeSet.ncard : ℝ) → + ∃ S : Finset (Fin n), + c * (n : ℝ) ≤ (S.card : ℝ) ∧ + (G.induce (S : Set (Fin n))).CliqueFree 2 := by + sorry + +end Erdos579 diff --git a/FormalConjectures/ErdosProblems/58.lean b/FormalConjectures/ErdosProblems/58.lean new file mode 100644 index 0000000000..7d91b03e11 --- /dev/null +++ b/FormalConjectures/ErdosProblems/58.lean @@ -0,0 +1,63 @@ +/- +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 58 + +*Reference:* [erdosproblems.com/58](https://www.erdosproblems.com/58) + +Conjectured by Bollobás and Erdős [Er90]. Bollobás and Shelah confirmed it for $k = 1$. +Proved by Gyárfás [Gy92], who showed the stronger result that if $G$ is 2-connected, +then $G$ is either $K_{2k+2}$ or contains a vertex of degree at most $2k$. +Gao, Huo, and Ma [GaHuMa21] proved the stronger result that if $\chi(G) \geq 2k+3$ +then $G$ contains cycles of $k+1$ consecutive odd lengths. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Gy92] Gyárfás, A., _Graphs with $k$ odd cycle lengths_. Discrete Mathematics **103** (1992), +41–48. + +[GaHuMa21] Gao, J., Huo, Q., Ma, J., _A strengthening on odd cycles in graphs of given +chromatic number_. SIAM Journal on Discrete Mathematics **35** (2021), 2317–2327. +-/ + +open SimpleGraph + +namespace Erdos58 + +/-- The set of lengths of odd cycles in a graph $G$. -/ +def oddCycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n : ℕ | Odd n ∧ ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + +/-- +**Erdős Problem 58** (Bollobás–Erdős conjecture, proved by Gyárfás [Gy92]): + +If $G$ is a finite graph containing odd cycles of at most $k$ different lengths, +then $\chi(G) \leq 2k + 2$, with equality if and only if $G$ contains $K_{2k+2}$ as a +clique subgraph. +-/ +@[category research solved, AMS 5] +theorem erdos_58 {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ) + (hk : (oddCycleLengths G).ncard ≤ k) : + G.chromaticNumber ≤ (2 * k + 2 : ℕ) ∧ + (G.chromaticNumber = (2 * k + 2 : ℕ) ↔ ∃ s : Finset V, G.IsNClique (2 * k + 2) s) := by + sorry + +end Erdos58 diff --git a/FormalConjectures/ErdosProblems/580.lean b/FormalConjectures/ErdosProblems/580.lean new file mode 100644 index 0000000000..880f5ad152 --- /dev/null +++ b/FormalConjectures/ErdosProblems/580.lean @@ -0,0 +1,76 @@ +/- +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 580 + +If at least half the vertices of an $n$-vertex graph have degree at least $n/2$, must the graph +contain every tree on at most $n/2$ vertices as a subgraph? + +This problem has status **DECIDABLE** — resolved up to a finite check, since Zhao [Zh11] proved the +conjecture for all sufficiently large $n$. + +*Reference:* [erdosproblems.com/580](https://www.erdosproblems.com/580) + +[EFLS95] Erdős, P., Füredi, Z., Loebl, M., and Sós, V.T. + +[AKS95] Ajtai, M., Komlós, J., and Szemerédi, E., _On a conjecture of Loebl_. +Graph theory, combinatorics, and algorithms, Vol. 1, 2 (Kalamazoo, MI, 1992), 1995, 1135–1146. + +[Zh11] Zhao, Y., _Proof of the (n/2–n/2–n/2) conjecture for large n_. +Electronic Journal of Combinatorics **18** (2011), Paper 27, 61 pp. +-/ + +open SimpleGraph Finset + +namespace Erdos580 + +/-- +Erdős-Füredi-Loebl-Sós Conjecture (Problem 580): +Let $G$ be a graph on $n$ vertices such that at least $n/2$ vertices have degree at +least $n/2$. Must $G$ contain every tree on at most $n/2$ vertices? + +Conjectured by Erdős, Füredi, Loebl, and Sós [EFLS95]. +Ajtai, Komlós, and Szemerédi [AKS95] proved an asymptotic version. +Zhao [Zh11] proved the conjecture for all sufficiently large $n$. +-/ +@[category research open, AMS 5] +theorem erdos_580 : answer(sorry) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + n / 2 ≤ (Finset.univ.filter (fun v => n / 2 ≤ G.degree v)).card → + ∀ (k : ℕ) (T : SimpleGraph (Fin k)) [DecidableRel T.Adj], + k ≤ n / 2 → T.IsTree → Nonempty (T ↪g G) := by + sorry + +/-- +Komlós–Sós Conjecture (generalization of Problem 580): +If at least $n/2$ vertices of an $n$-vertex graph $G$ have degree at least $k$, then $G$ contains +every tree with at most $k+1$ vertices (equivalently, at most $k$ edges). + +Problem 580 is the special case $k = \lfloor n/2 \rfloor$ of this conjecture. +-/ +@[category research open, AMS 5] +theorem erdos_580_komlos_sos : answer(sorry) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + ∀ (k : ℕ), + n / 2 ≤ (Finset.univ.filter (fun v => k ≤ G.degree v)).card → + ∀ (m : ℕ) (T : SimpleGraph (Fin m)) [DecidableRel T.Adj], + m ≤ k + 1 → T.IsTree → Nonempty (T ↪g G) := by + sorry + +end Erdos580 diff --git a/FormalConjectures/ErdosProblems/581.lean b/FormalConjectures/ErdosProblems/581.lean new file mode 100644 index 0000000000..8dea7b8bbf --- /dev/null +++ b/FormalConjectures/ErdosProblems/581.lean @@ -0,0 +1,78 @@ +/- +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 581 + +Determine the maximum number of edges in a bipartite subgraph that every +triangle-free graph with $m$ edges must contain. + +*Reference:* [erdosproblems.com/581](https://www.erdosproblems.com/581) + +[CEG79] Chung, F. R. K., Erdős, P., and Graham, R. L., 1979. + +[Al96] Alon, N., *Bipartite subgraphs*. Combinatorica 16 (1996), 301–311. +-/ + +open SimpleGraph + +namespace Erdos581 + +/-- +The maximum number of edges in a bipartite spanning subgraph of a graph $G$ on +a finite vertex type. A spanning subgraph $H \leq G$ is bipartite iff it admits a +proper 2-coloring (i.e., is bipartite). We use `Set.ncard` to count edges, avoiding the need for +decidability instances. +-/ +noncomputable def maxBipartiteEdges {V : Type*} [Fintype V] + (G : SimpleGraph V) : ℕ := + sSup {k : ℕ | ∃ H : SimpleGraph V, H ≤ G ∧ + H.IsBipartite ∧ + H.edgeSet.ncard = k} + +/-- +$f(m)$ is the largest $k$ such that every triangle-free graph on $m$ edges must +contain a bipartite subgraph with at least $k$ edges. Equivalently, $f(m)$ is +the infimum of `maxBipartiteEdges G` over all finite triangle-free graphs $G$ +with exactly $m$ edges. We quantify over graphs on `Fin n` for all $n$, which +suffices since every finite graph is isomorphic to one on `Fin n`. +-/ +noncomputable def f (m : ℕ) : ℕ := + sInf {k : ℕ | ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.CliqueFree 3 ∧ + G.edgeSet.ncard = m ∧ + maxBipartiteEdges G = k} + +/-- +Erdős Problem 581 [CEG79]: + +Let $f(m)$ be the maximal $k$ such that a triangle-free graph on $m$ edges must +contain a bipartite graph with $k$ edges. Determine $f(m)$. + +Resolved by Alon [Al96], who showed that there exist constants $c_1, c_2 > 0$ +such that $m/2 + c_1 \cdot m^{4/5} \leq f(m) \leq m/2 + c_2 \cdot m^{4/5}$. +-/ +@[category research solved, AMS 5] +theorem erdos_581 : + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∀ m : ℕ, 0 < m → + (m : ℝ) / 2 + c₁ * (m : ℝ) ^ ((4 : ℝ) / 5) ≤ (f m : ℝ) ∧ + (f m : ℝ) ≤ (m : ℝ) / 2 + c₂ * (m : ℝ) ^ ((4 : ℝ) / 5) := by + sorry + +end Erdos581 diff --git a/FormalConjectures/ErdosProblems/582.lean b/FormalConjectures/ErdosProblems/582.lean new file mode 100644 index 0000000000..ea96bc5010 --- /dev/null +++ b/FormalConjectures/ErdosProblems/582.lean @@ -0,0 +1,66 @@ +/- +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 582 + +*Reference:* [erdosproblems.com/582](https://www.erdosproblems.com/582) + +Does there exist a graph $G$ which contains no $K_4$, and yet any $2$-colouring +of the edges produces a monochromatic $K_3$? + +The question was originally posed by Erdős and Hajnal [ErHa67]. Existence was +proved by Folkman [Fo70]. The smallest such graph defines the Folkman number +$f(3,3;4)$, with current best bounds $21 \leq f(3,3;4) \leq 786$ due to +Bikov–Nenov [BiNe20] and Lange–Radziszowski–Xu [LRX14], respectively. + +See also Problem 924 for the generalization to arbitrary numbers of colors and +clique sizes. + +[ErHa67] Erdős, P., Hajnal, A., *Research Problem 2.5*. J. Comb. Theory (1967). + +[Fo70] Folkman, J., *Graphs with monochromatic complete subgraphs in every edge coloring*. +SIAM J. Appl. Math. 18 (1970), 19-24. + +[BiNe20] Bikov, A., Nenov, N., *On the independence number of (3,3)-Ramsey graphs and the +Folkman number $F_e(3,3;4)$*. Australas. J. Combin. (2020), 35-50. + +[LRX14] Lange, A. R., Radziszowski, S. P., Xu, X., *Use of MAX-CUT for Ramsey arrowing of +triangles*. J. Combin. Math. Combin. Comput. (2014), 61-71. +-/ + +namespace Erdos582 + +/-- +There exists a $K_4$-free graph $G$ such that for any $2$-colouring of the edges, +there is a monochromatic $K_3$. Existence was proved by Folkman [Fo70]. + +We formalize this as: there exists $n$ and a simple graph $G$ on $\operatorname{Fin} n$ that +is $K_4$-free, such that for any subgraph $H \leq G$ (representing one color class +in a $2$-coloring of the edges), either $H$ or the complementary subgraph $G \setminus H$ +contains a triangle. +-/ +@[category research solved, AMS 5] +theorem erdos_582 : answer(True) ↔ + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.CliqueFree 4 ∧ + ∀ (H : SimpleGraph (Fin n)), H ≤ G → + ¬H.CliqueFree 3 ∨ ¬(G \ H).CliqueFree 3 := by + sorry + +end Erdos582 diff --git a/FormalConjectures/ErdosProblems/583.lean b/FormalConjectures/ErdosProblems/583.lean new file mode 100644 index 0000000000..b3d46a8580 --- /dev/null +++ b/FormalConjectures/ErdosProblems/583.lean @@ -0,0 +1,56 @@ +/- +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 583 + +*Reference:* [erdosproblems.com/583](https://www.erdosproblems.com/583) + +Every connected graph on $n$ vertices can be partitioned into at most $\lceil n/2 \rceil$ +edge-disjoint paths. + +[ErGa59] Erdős, P. and Gallai, T., *On the minimal number of vertices representing the +edges of a graph*, 1959. + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. +-/ + +open SimpleGraph + +namespace Erdos583 + +/-- +Erdős Problem 583 [ErGa59][Er71]: + +Every connected graph on $n$ vertices can be partitioned into at most $\lceil n/2 \rceil$ +edge-disjoint paths. +-/ +@[category research open, AMS 5] +theorem erdos_583 (n : ℕ) (G : SimpleGraph (Fin n)) + (dG : DecidableRel G.Adj) (hconn : G.Connected) : + haveI := dG + ∃ (k : ℕ) (paths : Fin k → Σ (v w : Fin n), G.Walk v w), + k ≤ (n + 1) / 2 ∧ + (∀ i, (paths i).2.2.IsPath) ∧ + (∀ i j : Fin k, i ≠ j → + Disjoint (paths i).2.2.edges.toFinset (paths j).2.2.edges.toFinset) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ (paths i).2.2.edges.toFinset) := by + sorry + +end Erdos583 diff --git a/FormalConjectures/ErdosProblems/584.lean b/FormalConjectures/ErdosProblems/584.lean new file mode 100644 index 0000000000..22b65be8e0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/584.lean @@ -0,0 +1,102 @@ +/- +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.Combinatorics.SimpleGraph.GraphConjectures.Domination + +/-! +# Erdős Problem 584 + +*Reference:* [erdosproblems.com/584](https://www.erdosproblems.com/584) + +A problem of Erdős, Duke, and Rödl. + +[DuEr82] Duke, R.A. and Erdős, P., _Subgraphs in which each pair of edges lies in a short +common cycle_. Proceedings of the thirteenth Southeastern conference on combinatorics, graph +theory and computing (1982), 253-260. + +[DER84] Duke, R.A., Erdős, P., and Rödl, V., _More results on subgraphs with many short +cycles_. Proceedings of the fifteenth Southeastern conference on combinatorics, graph theory +and computing (1984), 295-300. + +[FoSu08b] Fox, J. and Sudakov, B., _On a problem of Duke-Erdős-Rödl on cycle-connected +subgraphs_. Journal of Combinatorial Theory, Series B (2008), 1056-1062. +-/ + +open SimpleGraph + +namespace Erdos584 + +/-- Two edges of a graph lie on a common cycle of length at most $k$. -/ +def EdgesOnCommonCycle {V : Type*} (G : SimpleGraph V) + (e₁ e₂ : Sym2 V) (k : ℕ) : Prop := + ∃ (u : V) (c : G.Walk u u), c.IsCycle ∧ c.length ≤ k ∧ + e₁ ∈ c.edges ∧ e₂ ∈ c.edges + +/-- Two edges of a graph lie on a common cycle of exactly length $k$. -/ +def EdgesOnCommonCycleExact {V : Type*} (G : SimpleGraph V) + (e₁ e₂ : Sym2 V) (k : ℕ) : Prop := + ∃ (u : V) (c : G.Walk u u), c.IsCycle ∧ c.length = k ∧ + e₁ ∈ c.edges ∧ e₂ ∈ c.edges + +/-- +Erdős Problem 584, Part 1: +For every graph $G$ on $n$ vertices with $\delta n^2$ edges, there exists a subgraph $H_1$ +with $\gg \delta^3 n^2$ edges such that every two edges of $H_1$ lie on a common cycle of +length at most $6$ in $G$, and any two edges sharing a vertex lie on a common +cycle of length exactly $4$. + +A problem of Erdős, Duke, and Rödl [DuEr82, DER84]. +-/ +@[category research open, AMS 5] +theorem erdos_584 : + ∃ c : ℝ, 0 < c ∧ + ∀ (n : ℕ), 0 < n → + ∀ (δ : ℝ), 0 < δ → δ ≤ 1 → + ∀ (G : SimpleGraph (Fin n)), + (G.edgeFinset.card : ℝ) ≥ δ * (n : ℝ) ^ 2 → + ∃ H : SimpleGraph (Fin n), + H ≤ G ∧ + (H.edgeFinset.card : ℝ) ≥ c * δ ^ 3 * (n : ℝ) ^ 2 ∧ + (∀ e₁ ∈ H.edgeFinset, ∀ e₂ ∈ H.edgeFinset, + EdgesOnCommonCycle G e₁ e₂ 6) ∧ + (∀ e₁ ∈ H.edgeFinset, ∀ e₂ ∈ H.edgeFinset, + edgesAdjacent e₁ e₂ → EdgesOnCommonCycleExact G e₁ e₂ 4) := by + sorry + +/-- +Erdős Problem 584, Part 2: +For every graph $G$ on $n$ vertices with $\delta n^2$ edges, there exists a subgraph $H_2$ +with $\gg \delta^2 n^2$ edges such that every two edges of $H_2$ lie on a common cycle of +length at most $8$ in $G$. + +A problem of Erdős, Duke, and Rödl [DuEr82, DER84]. +-/ +@[category research open, AMS 5] +theorem erdos_584.variants.part2 : + ∃ c : ℝ, 0 < c ∧ + ∀ (n : ℕ), 0 < n → + ∀ (δ : ℝ), 0 < δ → δ ≤ 1 → + ∀ (G : SimpleGraph (Fin n)), + (G.edgeFinset.card : ℝ) ≥ δ * (n : ℝ) ^ 2 → + ∃ H : SimpleGraph (Fin n), + H ≤ G ∧ + (H.edgeFinset.card : ℝ) ≥ c * δ ^ 2 * (n : ℝ) ^ 2 ∧ + (∀ e₁ ∈ H.edgeFinset, ∀ e₂ ∈ H.edgeFinset, + EdgesOnCommonCycle G e₁ e₂ 8) := by + sorry + +end Erdos584 diff --git a/FormalConjectures/ErdosProblems/585.lean b/FormalConjectures/ErdosProblems/585.lean new file mode 100644 index 0000000000..14e7e7cec1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/585.lean @@ -0,0 +1,123 @@ +/- +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 585 + +*Reference:* [erdosproblems.com/585](https://www.erdosproblems.com/585) + +What is the maximum number of edges that a graph on $n$ vertices can have if it +does not contain two edge-disjoint cycles with the same vertex set? + +A problem of Erdős [Er76b]. + +Pyber, Rödl, and Szemerédi [PRS95] constructed such a graph with +$\gg n \log \log n$ edges (lower bound). + +Chakraborti, Janzer, Methuku, and Montgomery [CJMM24] showed that such a +graph can have at most $n \cdot (\log n)^{O(1)}$ many edges (upper bound). + +[Er76b] Erdős, P., _Problems in combinatorial and graph theory_ (1976). + +[PRS95] Pyber, L., Rödl, V., Szemerédi, E., _Dense graphs without +3-regular subgraphs_. Journal of Combinatorial Theory, Series B (1995), 41-54. + +[CJMM24] Chakraborti, D., Janzer, O., Methuku, A., Montgomery, R., +_Edge-disjoint cycles with the same vertex set_. arXiv:2404.07190 (2024). +-/ + +open SimpleGraph Classical + +namespace Erdos585 + +/-- A graph has no two edge-disjoint cycles with the same vertex set. -/ +def NoTwoEdgeDisjointCyclesSameVertexSet {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ¬∃ (u v : Fin n) (c₁ : G.Walk u u) (c₂ : G.Walk v v), + c₁.IsCycle ∧ c₂.IsCycle ∧ + c₁.support.toFinset = c₂.support.toFinset ∧ + Disjoint c₁.edges.toFinset c₂.edges.toFinset + +/-- The maximum number of edges in a graph on $n$ vertices with no two +edge-disjoint cycles sharing the same vertex set. -/ +noncomputable def maxEdgesNoEdgeDisjointCycles (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + NoTwoEdgeDisjointCyclesSameVertexSet G ∧ G.edgeFinset.card = m} + +/-- +Erdős Problem 585: + +What is the maximum number of edges that a graph on $n$ vertices can have if it +does not contain two edge-disjoint cycles with the same vertex set? +-/ +@[category research open, AMS 5] +theorem erdos_585 : + ∀ n, maxEdgesNoEdgeDisjointCycles n = answer(sorry) := by + sorry + +/-- +Erdős Problem 585, Lower Bound [PRS95]: + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +the maximum number of edges in an $n$-vertex graph with no two edge-disjoint +cycles on the same vertex set is at least $c \cdot n \cdot \log(\log(n))$. +-/ +@[category research solved, AMS 5] +theorem erdos_585.variants.lower_bound : + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + c * (n : ℝ) * Real.log (Real.log (n : ℝ)) ≤ + (maxEdgesNoEdgeDisjointCycles n : ℝ) := by + sorry + +/-- +Erdős Problem 585, Upper Bound [CJMM24]: + +There exists a constant $C > 0$ such that for all sufficiently large $n$, +the maximum number of edges in an $n$-vertex graph with no two edge-disjoint +cycles on the same vertex set is at most $n \cdot (\log n)^C$. +-/ +@[category research solved, AMS 5] +theorem erdos_585.variants.upper_bound : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (maxEdgesNoEdgeDisjointCycles n : ℝ) ≤ + (n : ℝ) * (Real.log (n : ℝ)) ^ C := by + sorry + +/-- +Erdős Problem 585, k-wise generalization [CJMM24]: + +There exist constants $C > 0$ (universal) such that for any $k \geq 2$, there exists a constant +$c_k > 0$ such that every graph on $n$ vertices with at least $c_k \cdot n \cdot (\log n)^C$ edges +contains $k$ pairwise edge-disjoint cycles sharing the same vertex set. +-/ +@[category research solved, AMS 5] +theorem erdos_585.variants.k_wise_generalization : + ∃ C : ℝ, 0 < C ∧ + ∀ k : ℕ, 2 ≤ k → + ∃ c_k : ℝ, 0 < c_k ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + c_k * (n : ℝ) * (Real.log (n : ℝ)) ^ C ≤ (G.edgeFinset.card : ℝ) → + ∃ (u : Fin n) (cycles : Fin k → G.Walk u u), + (∀ i, (cycles i).IsCycle) ∧ + (∀ i j, i ≠ j → Disjoint (cycles i).edges.toFinset (cycles j).edges.toFinset) ∧ + (∀ i j, (cycles i).support.toFinset = (cycles j).support.toFinset) := by + sorry + +end Erdos585 diff --git a/FormalConjectures/ErdosProblems/586.lean b/FormalConjectures/ErdosProblems/586.lean new file mode 100644 index 0000000000..b9077c887e --- /dev/null +++ b/FormalConjectures/ErdosProblems/586.lean @@ -0,0 +1,66 @@ +/- +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 586 + +*Reference:* [erdosproblems.com/586](https://www.erdosproblems.com/586) + +Asked by Schinzel, motivated by a question of Erdős and Selfridge. +The answer is no, as proved by Balister, Bollobás, Morris, Sahasrabudhe, +and Tiba [BBMST22]. Selfridge showed that a positive answer to this problem +would imply a positive answer to Problem 7 (odd covering systems). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathématique (1980). + +[Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. +Analytic number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. + +[Er97] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_ (1997). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). + +[BBMST22] Balister, P., Bollobás, B., Morris, R., Sahasrabudhe, J., and Tiba, M., +_On the Erdős covering problem: the density of the uncovered set_, Inventiones +mathematicae (2022). +-/ + +namespace Erdos586 + +/-- A covering system: a finite collection of residue classes $a_i \bmod n_i$ (with $n_i \geq 2$) + that covers every integer. -/ +def IsCoveringSystem (k : ℕ) (a : Fin k → ℤ) (n : Fin k → ℕ) : Prop := + (∀ i : Fin k, 2 ≤ n i) ∧ + (∀ z : ℤ, ∃ i : Fin k, (n i : ℤ) ∣ (z - a i)) + +/-- **Erdős Problem 586** (Schinzel): Is there a covering system such that no two of the + moduli divide each other? The answer is no, as proved by Balister, Bollobás, Morris, + Sahasrabudhe, and Tiba [BBMST22]. -/ +@[category research solved, AMS 11] +theorem erdos_586 : answer(False) ↔ + (∃ (k : ℕ) (a : Fin k → ℤ) (n : Fin k → ℕ), + IsCoveringSystem k a n ∧ + ∀ i j : Fin k, i ≠ j → ¬(n i ∣ n j)) := by + sorry + +end Erdos586 diff --git a/FormalConjectures/ErdosProblems/588.lean b/FormalConjectures/ErdosProblems/588.lean new file mode 100644 index 0000000000..aea35fce90 --- /dev/null +++ b/FormalConjectures/ErdosProblems/588.lean @@ -0,0 +1,94 @@ +/- +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 588 + +Is it true that the maximum number of k-rich lines determined by n points in the plane with no +k+1 collinear is o(n²) for all k ≥ 4? This generalises Problem #101 (the case k = 4). + +Kárteszi [Ka63] proved f_k(n) ≫_k n log n for k ≥ 4. Grünbaum [Gr76] improved this to +f_k(n) ≫_k n^{1+1/(k-2)}. Solymosi and Stojaković [SoSt13] constructed point sets with +no (k+1) collinear and ≥ n^{2 - O_k(1/√(log n))} k-rich lines, showing the answer is close +to quadratic if false. + +Erdős offered $100 for a resolution of this problem. + +*Reference:* [erdosproblems.com/588](https://www.erdosproblems.com/588) + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. + +[BGS74] Burr, S. A., Grünbaum, B., and Sloane, N. J. A., _The orchard problem_. +Geometriae Dedicata (1974), 397–424. + +[FuPa84] Füredi, Z. and Palásti, I., _Arrangements of lines with a large number of +triangles_. Proc. Amer. Math. Soc. (1984), 561–566. + +[Ka63] Kárteszi, F., _Sylvester egy tételéről és Erdős egy sejtéséről_. +Matematikai Lapok (1963), 3–10. + +[Gr76] Grünbaum, B., _New views on some old questions of combinatorial geometry_. +Colloquio Internazionale sulle Teorie Combinatorie (Roma, 1973), Tomo I (1976), 451–468. + +[SoSt13] Solymosi, J. and Stojaković, M., _Many collinear k-tuples with no k+1 collinear +points_. Discrete Comput. Geom. (2013), 811–820. +-/ + +namespace Erdos588 + +/-- +A finite point set in $\mathbb{R}^2$ has no $(k+1)$ collinear points if every $(k+1)$-element +subset is not collinear (i.e., no line contains $k+1$ or more of the points). +-/ +def NoKPlusOneCollinear (k : ℕ) (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = k + 1 → ¬Collinear ℝ (S : Set (EuclideanSpace ℝ (Fin 2))) + +/-- +The number of $k$-rich lines: the number of distinct affine lines in $\mathbb{R}^2$ that +contain at least $k$ points from $P$. +-/ +noncomputable def kRichLineCount (k : ℕ) (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + k ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} + +/-- +Let $f_k(n)$ be the maximum number of lines containing at least $k$ points, +over all configurations of $n$ points in $\mathbb{R}^2$ with no $k+1$ collinear. +Is it true that $f_k(n) = o(n^2)$ for all $k \geq 4$? + +This is a generalisation of Problem \#101 (the case $k = 4$). The restriction +to $k \geq 4$ is necessary since Sylvester showed $f_3(n) = n^2/6 + O(n)$. + +Formally: for every $k \geq 4$ and every $\varepsilon > 0$, there exists $N$ such that for +all $n \geq N$ and every set $P$ of $n$ points in $\mathbb{R}^2$ with no $k+1$ collinear, the +count of $k$-rich lines is at most $\varepsilon \cdot n^2$. +-/ +@[category research open, AMS 5 52] +theorem erdos_588 : answer(sorry) ↔ + ∀ k : ℕ, k ≥ 4 → + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + NoKPlusOneCollinear k P → + (kRichLineCount k P : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +end Erdos588 diff --git a/FormalConjectures/ErdosProblems/589.lean b/FormalConjectures/ErdosProblems/589.lean new file mode 100644 index 0000000000..729ec1fce2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/589.lean @@ -0,0 +1,98 @@ +/- +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 589 + +*Reference:* [erdosproblems.com/589](https://www.erdosproblems.com/589) + +Let $g(n)$ be maximal such that in any set of $n$ points in $\mathbb{R}^2$ with no four +points on a line there exists a subset of $g(n)$ points with no three points +on a line. Estimate $g(n)$. + +The trivial greedy algorithm gives $g(n) \gg n^{1/2}$. Füredi [Fu91b] proved +$g(n) \gg n^{1/2} \log n$. Furstenberg and Katznelson [FuKa91] proved +$g(n) = o(n)$ as a consequence of the density Hales-Jewett theorem. +Balogh and Solymosi [BaSo18] improved the upper bound to +$g(n) \ll n^{5/6+o(1)}$. + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. +[Fu91b] Füredi, Z., _Maximal independent subsets in Steiner systems and in planar sets_. +SIAM J. Discrete Math. (1991), 196–199. +[FuKa91] Furstenberg, H. and Katznelson, Y., _A density version of the Hales-Jewett theorem_. +J. Anal. Math. 57 (1991), 64–119. +[BaSo18] Balogh, J. and Solymosi, J., _On the number of points in general position in the plane_. +Discrete Analysis (2018), Paper No. 16, 20. +-/ + +namespace Erdos589 + +/-- A finite set of points in $\mathbb{R}^2$ has at most $k$ points on any affine line. +Equivalently, no $k + 1$ points of $S$ are collinear (lie on a common +line $\{p \mid a \cdot p_0 + b \cdot p_1 = c\}$ for some $(a, b) \neq (0, 0)$). -/ +def AtMostKOnAnyLine (k : ℕ) (S : Finset (Fin 2 → ℝ)) : Prop := + ∀ T : Finset (Fin 2 → ℝ), T ⊆ S → T.card = k + 1 → + ¬∃ (a b c : ℝ), (a ≠ 0 ∨ b ≠ 0) ∧ + ∀ p : Fin 2 → ℝ, p ∈ T → a * p 0 + b * p 1 = c + +/-- `erdos589_g n` is the largest $m$ such that every set of $n$ points in $\mathbb{R}^2$ +with no four on a line contains a subset of at least $m$ points with no +three on a line. -/ +noncomputable def erdos589_g (n : ℕ) : ℕ := + sSup {m : ℕ | ∀ S : Finset (Fin 2 → ℝ), + S.card = n → AtMostKOnAnyLine 3 S → + ∃ T : Finset (Fin 2 → ℝ), T ⊆ S ∧ m ≤ T.card ∧ AtMostKOnAnyLine 2 T} + +/-- +Erdős Problem 589 (lower bound, Füredi [Fu91b]): + +There exists a constant $C > 0$ such that for all sufficiently large $n$, +$\operatorname{erdos589\_g}(n) \geq C \sqrt{n} \log n$. +-/ +@[category research solved, AMS 05 52] +theorem erdos_589 : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos589_g n : ℝ) ≥ C * Real.sqrt (↑n) * Real.log (↑n) := by + sorry + +/-- +Erdős Problem 589 (upper bound, Balogh–Solymosi [BaSo18]): + +For all $\varepsilon > 0$, there exists $C > 0$ such that for all sufficiently large $n$, +$\operatorname{erdos589\_g}(n) \leq C \cdot n^{5/6 + \varepsilon}$. +-/ +@[category research solved, AMS 05 52] +theorem erdos_589.variants.upper_bound (ε : ℝ) (hε : ε > 0) : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos589_g n : ℝ) ≤ C * (↑n : ℝ) ^ ((5 : ℝ) / 6 + ε) := by + sorry + +/-- +Erdős Problem 589 (sublinear upper bound, Furstenberg–Katznelson [FuKa91]): + +$g(n) = o(n)$: for any $\varepsilon > 0$, for all sufficiently large $n$, +$\operatorname{erdos589\_g}(n) \leq \varepsilon \cdot n$. +This follows from the density Hales-Jewett theorem. +-/ +@[category research solved, AMS 05 52] +theorem erdos_589.variants.sublinear (ε : ℝ) (hε : ε > 0) : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos589_g n : ℝ) ≤ ε * (↑n : ℝ) := by + sorry + +end Erdos589 diff --git a/FormalConjectures/ErdosProblems/59.lean b/FormalConjectures/ErdosProblems/59.lean new file mode 100644 index 0000000000..b1647d1049 --- /dev/null +++ b/FormalConjectures/ErdosProblems/59.lean @@ -0,0 +1,109 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic + +/-! +# Erdős Problem 59 + +*Reference:* [erdosproblems.com/59](https://www.erdosproblems.com/59) + +Is it true that for every graph $G$, the number of labeled $G$-free graphs on $n$ vertices +is at most $2^{(1+o(1)) \cdot \operatorname{ex}(n; G)}$? Disproved: the answer is no for +$G = C_6$ (Morris and Saxton [MoSa16]). Erdős, Frankl, and Rödl [EFR86] proved the +answer is yes when $G$ is not bipartite. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er93, p.335] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae (1993), 333–350. + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Va99, 3.56] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999). + +[EFR86] Erdős, P., Frankl, P., Rödl, V., _The asymptotic number of graphs not containing +a fixed subgraph and a problem for hypergraphs having no exponent_. Graphs and +Combinatorics (1986), 113–121. + +[MoSa16] Morris, R., Saxton, D., _The number of $C_{2\ell}$-free graphs_. Adv. Math. (2016), +534–580. +-/ + +open SimpleGraph + +namespace Erdos59 + +/-- The number of labeled simple graphs on $n$ vertices that do not contain $H$ as a subgraph. -/ +noncomputable def countHFreeGraphs {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + Nat.card {F : SimpleGraph (Fin n) // H.Free F} + +/-- +Erdős Problem 59 [Er90, Er93, p.335, Er97c, Va99, 3.56]: + +Is it true that, for every graph $G$, the number of labeled graphs on $n$ vertices that +contain no copy of $G$ is at most $2^{(1+o(1)) \cdot \operatorname{ex}(n; G)}$? + +That is, for every $\varepsilon > 0$, for all sufficiently large $n$: +$$\#\{\text{$G$-free graphs on $[n]$}\} \leq 2^{(1+\varepsilon) \cdot \operatorname{ex}(n; G)}$$ + +This was DISPROVED: the answer is no for $G = C_6$ (the 6-cycle). +Erdős, Frankl, and Rödl [EFR86] proved the answer is yes when $G$ is not bipartite. +Morris and Saxton [MoSa16] showed there are at least $2^{(1+c) \cdot \operatorname{ex}(n; C_6)}$ +such graphs for infinitely many $n$, for some constant $c > 0$. +-/ +@[category research solved, AMS 5] +theorem erdos_59 : answer(False) ↔ + ∀ (U : Type*) (H : SimpleGraph U) [Fintype U] [DecidableRel H.Adj], + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (countHFreeGraphs H n : ℝ) ≤ (2 : ℝ) ^ ((1 + ε) * (extremalNumber n H : ℝ)) := by + sorry + +/-- +Morris–Saxton weaker conjecture: for every graph $G$, the number of labeled $G$-free graphs +on $n$ vertices is at most $2^{O(\operatorname{ex}(n; G))}$. That is, there exists a constant +$C$ (depending on $G$) such that the count is at most $2^{C \cdot \operatorname{ex}(n; G)}$ +for all sufficiently large $n$. This weaker bound is conjectured to hold even though the +original conjecture (with $1 + o(1)$ in the exponent) was disproved for $C_6$. +-/ +@[category research open, AMS 5] +theorem erdos_59_weakened : answer(sorry) ↔ + ∀ (U : Type*) (H : SimpleGraph U) [Fintype U] [DecidableRel H.Adj], + ∃ (C : ℝ) (_ : 0 < C) (N : ℕ), ∀ n : ℕ, N ≤ n → + (countHFreeGraphs H n : ℝ) ≤ (2 : ℝ) ^ (C * (extremalNumber n H : ℝ)) := by + sorry + +/-- +The $C_4$ case of Erdős Problem 59 [Va99, 3.56]: does the original bound +$2^{(1+o(1)) \cdot \operatorname{ex}(n; C_4)}$ hold for the number of labeled $C_4$-free +graphs on $n$ vertices? This remains open even though the general conjecture was +disproved for $C_6$. +-/ +@[category research open, AMS 5] +theorem erdos_59_C4 : answer(sorry) ↔ + ∀ (H : SimpleGraph (Fin 4)) [DecidableRel H.Adj], + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (countHFreeGraphs H n : ℝ) ≤ (2 : ℝ) ^ ((1 + ε) * (extremalNumber n H : ℝ)) := by + sorry + +end Erdos59 diff --git a/FormalConjectures/ErdosProblems/593.lean b/FormalConjectures/ErdosProblems/593.lean new file mode 100644 index 0000000000..95c090f186 --- /dev/null +++ b/FormalConjectures/ErdosProblems/593.lean @@ -0,0 +1,93 @@ +/- +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 593 + +*Reference:* [erdosproblems.com/593](https://www.erdosproblems.com/593) + +Characterize those finite $3$-uniform hypergraphs which appear in every +$3$-uniform hypergraph of chromatic number $> \aleph_0$. + +Similar problems were investigated by Erdős, Galvin, and Hajnal [EGH75]. +Erdős claims that for graphs the problem is completely solved: a graph of +chromatic number $\geq \aleph_1$ must contain all finite bipartite graphs but need not +contain any fixed odd cycle. + +We define a finite $3$-uniform hypergraph $F$ to be *obligatory* if it appears +in every $3$-uniform hypergraph of uncountable chromatic number. By analogy +with the graph case, we conjecture that the obligatory finite $3$-uniform +hypergraphs are exactly the $2$-colorable ones. + +[EGH75] Erdős, P., Galvin, F., and Hajnal, A., _On set-systems having large chromatic +number and not containing prescribed subsystems_ (1975), 425–513. + +[Er95d] Erdős, P., _Problems and results in discrete mathematics_, Discrete Math., 1995. +-/ + +namespace Erdos593 + +/-- A $3$-uniform hypergraph on vertex type $V$: a collection of $3$-element + subsets of $V$. -/ +structure Hypergraph3 (V : Type*) where + edges : Set (Finset V) + uniform : ∀ e ∈ edges, e.card = 3 + +/-- A proper coloring of a $3$-uniform hypergraph: no edge is monochromatic + (every edge contains two vertices receiving different colors). -/ +def Hypergraph3.IsProperColoring {V : Type*} (H : Hypergraph3 V) + {C : Type*} (c : V → C) : Prop := + ∀ e ∈ H.edges, ∃ x ∈ e, ∃ y ∈ e, c x ≠ c y + +/-- A $3$-uniform hypergraph has uncountable chromatic number: it admits no + proper coloring with countably many colors. -/ +def Hypergraph3.HasUncountableChromaticNumber {V : Type*} + (H : Hypergraph3 V) : Prop := + ∀ (C : Type*) [Countable C], ¬∃ c : V → C, H.IsProperColoring c + +/-- A finite $3$-uniform hypergraph $F$ on $W$ embeds (non-induced) into $H$ on $V$: + there is an injective map from $W$ to $V$ sending every edge of $F$ to an edge of $H$. + Non-edges of $F$ are unconstrained in $H$. -/ +def Hypergraph3.ContainsCopy {V W : Type*} + (H : Hypergraph3 V) (F : Hypergraph3 W) : Prop := + ∃ f : W ↪ V, ∀ e ∈ F.edges, e.map f ∈ H.edges + +/-- A $3$-uniform hypergraph is $2$-colorable: it admits a proper coloring with + two colors such that no edge is monochromatic. -/ +def Hypergraph3.Is2Colorable {V : Type*} (H : Hypergraph3 V) : Prop := + ∃ c : V → Bool, H.IsProperColoring c + +/-- +Erdős Problem 593 [Er95d]: + +A finite $3$-uniform hypergraph appears in every $3$-uniform hypergraph of +uncountable chromatic number if and only if it is $2$-colorable. + +This is conjectured by analogy with the known graph result: a graph of +chromatic number $\geq \aleph_1$ must contain all finite bipartite graphs but need not +contain any fixed odd cycle [EGH75]. +-/ +@[category research open, AMS 5] +theorem erdos_593 (W : Type*) [Fintype W] + (F : Hypergraph3 W) : + (∀ (V : Type*) (H : Hypergraph3 V), + H.HasUncountableChromaticNumber → H.ContainsCopy F) ↔ + F.Is2Colorable := by + sorry + +end Erdos593 diff --git a/FormalConjectures/ErdosProblems/594.lean b/FormalConjectures/ErdosProblems/594.lean new file mode 100644 index 0000000000..07467d8b71 --- /dev/null +++ b/FormalConjectures/ErdosProblems/594.lean @@ -0,0 +1,64 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Circulant +import Mathlib.Combinatorics.SimpleGraph.Copy +import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 594 + +*Reference:* [erdosproblems.com/594](https://www.erdosproblems.com/594) + +A problem of Erdős and Hajnal: does every graph with chromatic number +$\geq \aleph_1$ contain all sufficiently large odd cycles? Proved by +Erdős, Hajnal, and Shelah [EHS74]. + +[ErHa66] Erdős, P. and Hajnal, A., *On chromatic number of graphs and +set-systems*, Acta Math. Acad. Sci. Hung. **17** (1966), 61–99. + +[Er69b] Erdős, P., *Problems and results in combinatorial analysis and +graph theory*, Proof Techniques in Graph Theory (1969), 27–35. + +[EHS74] Erdős, P., Hajnal, A., and Shelah, S., *On some general properties +of chromatic numbers*, Topics in Topology, Colloq. Math. Soc. Janos Bolyai +**8** (1974), 243–255. +-/ + +open SimpleGraph Cardinal + +namespace Erdos594 + +/-- +Erdős Problem 594 [ErHa66] [Er69b]: + +Every graph with uncountable chromatic number (i.e., chromatic number +$\geq \aleph_1$) contains all sufficiently large odd cycles. That is, there exists +$N_0$ such that for all odd $n \geq N_0$, the graph contains $C_n$ +as a subgraph. + +Proved by Erdős, Hajnal, and Shelah [EHS74]. +-/ +@[category research solved, AMS 5] +theorem erdos_594 : answer(True) ↔ + ∀ {V : Type*} (G : SimpleGraph V), + Cardinal.aleph 1 ≤ G.chromaticCardinal → + ∃ N₀ : ℕ, ∀ (n : ℕ), Odd n → n ≥ N₀ → + (cycleGraph n).IsContained G := by + sorry + +end Erdos594 diff --git a/FormalConjectures/ErdosProblems/595.lean b/FormalConjectures/ErdosProblems/595.lean new file mode 100644 index 0000000000..64a78fa315 --- /dev/null +++ b/FormalConjectures/ErdosProblems/595.lean @@ -0,0 +1,56 @@ +/- +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 595 + +*Reference:* [erdosproblems.com/595](https://www.erdosproblems.com/595) + +A problem of Erdős and Hajnal. Folkman [Fo70] and Nešetřil and Rödl [NeRo75] +have proved that for every $n \geq 1$ there is a graph $G$ which contains no +$K_4$ and is not the union of $n$ triangle-free graphs. + +[Er87] Erdős, P., _Some problems and results in combinatorial number theory_, +Graph theory and its applications: East and West (1987). + +[Fo70] Folkman, J., _Graphs with monochromatic complete subgraphs in every edge +coloring_, SIAM J. Appl. Math. 18 (1970), 19-24. + +[NeRo75] Nešetřil, J. and Rödl, V., _Type theory of partition properties of +graphs_ (1975), 405-412. +-/ + +namespace Erdos595 + +/-- +Erdős Problem 595 [Er87]: + +Is there an infinite graph $G$ which contains no $K_4$ and is not the union +of countably many triangle-free graphs? +-/ +@[category research open, AMS 5] +theorem erdos_595 : answer(sorry) ↔ + ∃ (V : Type) (_ : Infinite V) (G : SimpleGraph V), + G.CliqueFree 4 ∧ + ¬∃ (H : ℕ → SimpleGraph V), + (∀ i, H i ≤ G) ∧ + (∀ i, (H i).CliqueFree 3) ∧ + (∀ u v, G.Adj u v → ∃ i, (H i).Adj u v) := by + sorry + +end Erdos595 diff --git a/FormalConjectures/ErdosProblems/596.lean b/FormalConjectures/ErdosProblems/596.lean new file mode 100644 index 0000000000..ae9904a3c6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/596.lean @@ -0,0 +1,78 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 596 + +*Reference:* [erdosproblems.com/596](https://www.erdosproblems.com/596) + +For which graphs $G_1$, $G_2$ is it true that for every $n \geq 1$ there is a $G_1$-free +graph $H$ such that every $n$-coloring of the edges of $H$ contains a monochromatic copy +of $G_2$, and yet for every $G_1$-free graph $H$ there is an $\aleph_0$-coloring of the +edges of $H$ without a monochromatic $G_2$? + +Erdős and Hajnal originally conjectured that no such $G_1$, $G_2$ exist, but $G_1 = C_4$ +and $G_2 = C_6$ is an example (Nešetřil–Rödl for the finite Ramsey property, Erdős–Hajnal +for the countable case). Whether $G_1 = K_4$, $G_2 = K_3$ works is problem 595. + +[Er87] Erdős, P., _Some problems and results on combinatorial number theory_, +Graph theory and its applications: East and West (1987). +-/ + +open SimpleGraph + +namespace Erdos596 + +/-- A graph $H$ contains a monochromatic copy of $G$ under edge coloring $c$: there exists +a copy (injective homomorphism) of $G$ into $H$ such that all edges in the image receive the +same color. -/ +def HasMonochromaticCopy {W : Type*} {V : Type*} + (H : SimpleGraph V) (G : SimpleGraph W) {α : Type*} (c : V → V → α) : Prop := + ∃ (φ : G.Copy H) (color : α), ∀ u v, G.Adj u v → c (φ u) (φ v) = color + +/-- +Erdős Problem 596 [Er87]: + +There exist finite graphs $G_1$ and $G_2$ such that: +(a) For every $n \geq 1$, there exists a $G_1$-free graph $H$ such that every $n$-coloring + of $H$'s edges contains a monochromatic copy of $G_2$. +(b) For every $G_1$-free graph $H$, there exists a countable coloring of $H$'s edges + with no monochromatic copy of $G_2$. + +The known example is $G_1 = C_4$, $G_2 = C_6$ (Nešetřil–Rödl for the finite Ramsey +property, Erdős–Hajnal for the countable case). The full characterization of +all such pairs remains open. +-/ +@[category research solved, AMS 5] +theorem erdos_596 : + ∃ (W₁ : Type) (G₁ : SimpleGraph W₁) (W₂ : Type) (G₂ : SimpleGraph W₂), + -- (a) Finite Ramsey property: for every n ≥ 1, there exists a G₁-free graph + -- whose edges cannot be n-colored without a monochromatic G₂ + (∀ n : ℕ, 1 ≤ n → + ∃ (V : Type) (H : SimpleGraph V), + G₁.Free H ∧ + ∀ c : V → V → Fin n, HasMonochromaticCopy H G₂ c) ∧ + -- (b) Countable failure: every G₁-free graph can be countably colored + -- without a monochromatic G₂ + (∀ (V : Type) (H : SimpleGraph V), + G₁.Free H → + ∃ c : V → V → ℕ, ¬HasMonochromaticCopy H G₂ c) := by + sorry + +end Erdos596 diff --git a/FormalConjectures/ErdosProblems/597.lean b/FormalConjectures/ErdosProblems/597.lean new file mode 100644 index 0000000000..807396da98 --- /dev/null +++ b/FormalConjectures/ErdosProblems/597.lean @@ -0,0 +1,86 @@ +/- +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 597 + +Erdős asked whether the ordinal partition relation ω₁² → (ω₁·ω, G)² holds for +every graph G on at most ℵ₁ vertices that is K₄-free and contains no K_{ℵ₀,ℵ₀}. + +*Reference:* [erdosproblems.com/597](https://www.erdosproblems.com/597) + +[Er87] Erdős, P., _Some problems on finite and infinite graphs_, Logic and combinatorics, +Contemp. Math. **65** (1987), 223–228. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999, §7.84. +-/ + +open Cardinal SimpleGraph + +namespace Erdos597 + +/-- The type of ordinals strictly less than $\alpha$. -/ +abbrev OrdinalSet (α : Ordinal) := {a : Ordinal // a < α} + +/-- A graph $G$ contains a complete bipartite subgraph $K_{\kappa,\kappa}$ if there exist +disjoint vertex sets $A$ and $B$, each of cardinality at least $\kappa$, +such that every vertex in $A$ is adjacent to every vertex in $B$. -/ +def ContainsBiclique {V : Type*} (G : SimpleGraph V) (κ : Cardinal) : Prop := + ∃ (A B : Set V), Disjoint A B ∧ #A ≥ κ ∧ #B ≥ κ ∧ + ∀ a ∈ A, ∀ b ∈ B, G.Adj a b + +/-- The ordinal-graph partition relation $\alpha \to (\beta, G)^2$: +every $2$-coloring of ordered pairs from `OrdinalSet α` yields either: +- an order-embedded copy of $\beta$ whose pairs are all colored $0$, or +- a copy of $G$ in the color-$1$ graph (an injective map preserving edges). + +Here a "copy of $\beta$" is given by an order embedding +$e : \operatorname{OrdinalSet}(\beta) \hookrightarrow \operatorname{OrdinalSet}(\alpha)$, +and monochromaticity means $f(e(i), e(j)) = 0$ for all $i < j$. A "copy of $G$" +is an injective map $g : V \to \operatorname{OrdinalSet}(\alpha)$ such that every edge of $G$ +maps to a pair colored $1$. + +Note: the coloring `f` is not required to be symmetric — only the "upper triangle" +(pairs with `i < j`) is consulted. -/ +def OrdGraphPartition (α β : Ordinal) {V : Type*} (G : SimpleGraph V) : Prop := + ∀ (f : OrdinalSet α → OrdinalSet α → Fin 2), + (∃ e : OrdinalSet β ↪o OrdinalSet α, + ∀ i j : OrdinalSet β, i < j → f (e i) (e j) = 0) ∨ + (∃ g : V → OrdinalSet α, Function.Injective g ∧ + ∀ u v : V, G.Adj u v → g u < g v → f (g u) (g v) = 1) + +/-- +Erdős Problem 597 [Er87] [Va99, 7.84]: + +If $G$ is a graph on at most $\aleph_1$ vertices containing no $K_4$ and no +$K_{\aleph_0,\aleph_0}$, is it true that +$$\omega_1^2 \to (\omega_1 \cdot \omega, G)^2?$$ + +Erdős and Hajnal proved that $\omega_1^2 \to (\omega_1 \cdot \omega, 3)^2$. Erdős originally +asked this with just the assumption that $G$ is $K_4$-free, but Baumgartner proved that +$\omega_1^2 \not\to (\omega_1 \cdot \omega, K_{\aleph_0,\aleph_0})^2$. +-/ +@[category research open, AMS 3 5] +theorem erdos_597 : answer(sorry) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + #V ≤ aleph 1 → G.CliqueFree 4 → ¬ContainsBiclique G (aleph 0) → + OrdGraphPartition ((aleph 1).ord ^ 2) ((aleph 1).ord * (aleph 0).ord) G := by + sorry + +end Erdos597 diff --git a/FormalConjectures/ErdosProblems/599.lean b/FormalConjectures/ErdosProblems/599.lean new file mode 100644 index 0000000000..613752fc20 --- /dev/null +++ b/FormalConjectures/ErdosProblems/599.lean @@ -0,0 +1,70 @@ +/- +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 599 + +*Reference:* [erdosproblems.com/599](https://www.erdosproblems.com/599) + +Sometimes known as the Erdős-Menger conjecture. Let $G$ be a (possibly infinite) +graph and $A$, $B$ be disjoint independent sets of vertices. Must there exist a +family $P$ of disjoint paths between $A$ and $B$ and a set $S$ which contains +exactly one vertex from each path in $P$, and such that every path between $A$ +and $B$ contains at least one vertex from $S$? + +When $G$ is finite this is equivalent to Menger's theorem. Erdős was interested +in the case when $G$ is infinite. This was proved by Aharoni and Berger [AhBe09]. + +[Er81] Erdős, P. (1981). + +[Er87] Erdős, P. (1987). + +[AhBe09] Aharoni, R. and Berger, E., _Menger's theorem for infinite graphs_. +Inventiones Mathematicae 176 (2009), 1-62. +-/ + +open SimpleGraph + +namespace Erdos599 + +/-- +Erdős Problem 599 (Erdős-Menger Conjecture) [Er81][Er87]: + +For any graph $G$ and disjoint independent sets $A$, $B$, there exists a family of +pairwise vertex-disjoint $A$-$B$ paths and a set $S$ containing exactly one vertex +from each path, such that $S$ separates $A$ from $B$ (every $A$-$B$ walk meets $S$). +-/ +@[category research solved, AMS 5] +theorem erdos_599 : answer(True) ↔ + ∀ (V : Type*) (G : SimpleGraph V) (A B : Set V), + Disjoint A B → + G.IsIndepSet A → + G.IsIndepSet B → + ∃ (ι : Type) (src : ι → V) (dst : ι → V) + (p : (i : ι) → G.Walk (src i) (dst i)) + (S : Set V), + (∀ i, src i ∈ A) ∧ + (∀ i, dst i ∈ B) ∧ + (∀ i, (p i).IsPath) ∧ + (∀ i j, i ≠ j → List.Disjoint (p i).support (p j).support) ∧ + (∀ i, ∃! v, v ∈ S ∧ v ∈ (p i).support) ∧ + (∀ (x : V) (y : V), x ∈ A → y ∈ B → + ∀ (w : G.Walk x y), ∃ s ∈ S, s ∈ w.support) := by + sorry + +end Erdos599 diff --git a/FormalConjectures/ErdosProblems/60.lean b/FormalConjectures/ErdosProblems/60.lean new file mode 100644 index 0000000000..20ed7e2279 --- /dev/null +++ b/FormalConjectures/ErdosProblems/60.lean @@ -0,0 +1,101 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy +import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic +import Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 60 + +*Reference:* [erdosproblems.com/60](https://www.erdosproblems.com/60) + +Does every graph on $n$ vertices with more than $\mathrm{ex}(n; C_4)$ edges contain +$\gg n^{1/2}$ many copies of $C_4$? + +Conjectured by Erdős and Simonovits [Er90][Er93], who could not even prove that +at least 2 copies of $C_4$ are guaranteed. The behaviour of $\mathrm{ex}(n; C_4)$ +is the subject of problem [765]. + +He, Ma, and Yang [HeMaYa21] proved the conjecture for the special case +$n = q^2 + q + 1$ where $q$ is an even integer. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős +(1990), 467–478. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is +eighty, Vol. 2 (Keszthely, 1993), 97–132. + +[HeMaYa21] He, J., Ma, J., Yang, T., _Some extremal results on 4-cycles_. +J. Combin. Theory Ser. B (2021). +-/ + +open SimpleGraph + +namespace Erdos60 + +/-- +Erdős Problem 60 [Er90][Er93]: + +Does every graph on $n$ vertices with more than $\mathrm{ex}(n; C_4)$ edges contain +$\gg n^{1/2}$ copies of $C_4$? + +Formally: there exist $c > 0$ and $N_0$ such that for all $n \geq N_0$, every graph $G$ on +$n$ vertices with more than $\mathrm{ex}(n; C_4)$ edges has at least $c \cdot n^{1/2}$ labelled +copies of $C_4$. +-/ +@[category research open, AMS 5] +theorem erdos_60 : answer(sorry) ↔ + ∃ (c : ℝ) (_ : c > 0) (N₀ : ℕ), + ∀ n : ℕ, N₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber n (cycleGraph 4) → + (G.labelledCopyCount (cycleGraph 4) : ℝ) ≥ c * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +He–Ma–Yang partial result [HeMaYa21]: the conjecture holds for $n = q^2 + q + 1$ where $q$ +is an even integer. That is, there exists $c > 0$ such that for all even $q$, every graph on +$n = q^2 + q + 1$ vertices with more than $\mathrm{ex}(n; C_4)$ edges has at least +$c \cdot n^{1/2}$ labelled copies of $C_4$. +-/ +@[category research solved, AMS 5] +theorem erdos_60_even_prime_power : answer(sorry) ↔ + ∃ (c : ℝ) (_ : c > 0), + ∀ q : ℕ, 2 ∣ q → + let n := q ^ 2 + q + 1 + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber n (cycleGraph 4) → + (G.labelledCopyCount (cycleGraph 4) : ℝ) ≥ c * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Weak form of Erdős Problem 60: every graph on $n$ vertices with more than $\mathrm{ex}(n; C_4)$ +edges contains at least 2 (unlabelled) copies of $C_4$. Equivalently, at least 16 labelled +copies (each unlabelled $C_4$ yields 8 labelled copies: 4 rotations × 2 reflections, and we +need at least 2 unlabelled copies). Erdős and Simonovits noted they could not even prove this +weaker statement. +-/ +@[category research open, AMS 5] +theorem erdos_60_at_least_two : answer(sorry) ↔ + ∃ (N₀ : ℕ), ∀ n : ℕ, N₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber n (cycleGraph 4) → + G.labelledCopyCount (cycleGraph 4) ≥ 16 := by + sorry + +end Erdos60 diff --git a/FormalConjectures/ErdosProblems/600.lean b/FormalConjectures/ErdosProblems/600.lean new file mode 100644 index 0000000000..652caa1a92 --- /dev/null +++ b/FormalConjectures/ErdosProblems/600.lean @@ -0,0 +1,91 @@ +/- +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 600 + +*Reference:* [erdosproblems.com/600](https://www.erdosproblems.com/600) + +Let $e(n, r)$ be minimal such that every graph on $n$ vertices with at least $e(n, r)$ +edges, each edge contained in at least one triangle, must have an edge contained +in at least $r$ triangles. Let $r \geq 2$. Is it true that +$$e(n, r+1) - e(n, r) \to \infty$$ +as $n \to \infty$? Is it true that +$$e(n, r+1) / e(n, r) \to 1$$ +as $n \to \infty$? + +Ruzsa and Szemerédi [RuSz78] proved that $e(n, r) = o(n^2)$ for any fixed $r$. + +See also problem [80](https://www.erdosproblems.com/80). + +[RuSz78] Ruzsa, I.Z. and Szemerédi, E., _Triple systems with no six points carrying +three triangles_. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), +Vol. II, Colloq. Math. Soc. János Bolyai 18, North-Holland, 1978, pp. 939–945. + +[Er87] Erdős, P., 1987. +-/ + +open Filter SimpleGraph Classical + +open scoped Topology + +namespace Erdos600 + +/-- The number of triangles containing the edge $\{u, v\}$ in graph $G$: +the count of vertices $w$ with $w \neq u$, $w \neq v$, adjacent to both $u$ and $v$. -/ +noncomputable def trianglesThrough {n : ℕ} (G : SimpleGraph (Fin n)) + (u v : Fin n) : ℕ := + (Finset.univ.filter fun w => w ≠ u ∧ w ≠ v ∧ G.Adj u w ∧ G.Adj v w).card + +/-- A graph is triangle-covered if every edge is contained in at least one triangle. -/ +def IsTriangleCovered {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ u v : Fin n, G.Adj u v → 0 < trianglesThrough G u v + +/-- $e(n, r)$: the minimal number of edges such that every triangle-covered graph +on $n$ vertices with at least that many edges has an edge in at least $r$ triangles. -/ +noncomputable def erdosE (n r : ℕ) : ℕ := + sInf {m : ℕ | ∀ G : SimpleGraph (Fin n), + IsTriangleCovered G → G.edgeFinset.card ≥ m → + ∃ u v : Fin n, G.Adj u v ∧ trianglesThrough G u v ≥ r} + +/-- +Erdős Problem 600, Part 1 [Er87]: + +Is it true that for any $r \geq 2$, $e(n, r+1) - e(n, r) \to \infty$ as $n \to \infty$? +That is, for any bound $M$, for all sufficiently large $n$, +$e(n, r+1) \geq e(n, r) + M$. +-/ +@[category research open, AMS 5] +theorem erdos_600 : answer(sorry) ↔ ∀ (r : ℕ), r ≥ 2 → + ∀ M : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + erdosE n (r + 1) ≥ erdosE n r + M := by + sorry + +/-- +Erdős Problem 600, Part 2 [Er87]: + +Is it true that for any $r \geq 2$, $e(n, r+1) / e(n, r) \to 1$ as $n \to \infty$? +-/ +@[category research open, AMS 5] +theorem erdos_600.variants.ratio : answer(sorry) ↔ ∀ (r : ℕ), r ≥ 2 → + Tendsto + (fun n : ℕ => (erdosE n (r + 1) : ℝ) / (erdosE n r : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos600 diff --git a/FormalConjectures/ErdosProblems/601.lean b/FormalConjectures/ErdosProblems/601.lean new file mode 100644 index 0000000000..0808e75b39 --- /dev/null +++ b/FormalConjectures/ErdosProblems/601.lean @@ -0,0 +1,92 @@ +/- +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 601 + +*Reference:* [erdosproblems.com/601](https://www.erdosproblems.com/601) + +For which limit ordinals $\alpha$ is it true that if $G$ is a graph with vertex set $\alpha$ +then $G$ must have either an infinite path or an independent set on a set of +vertices with order type $\alpha$? + +A problem of Erdős, Hajnal, and Milner, who proved this is true for +$\alpha < \omega_1^{\omega+2}$. Erdős offered 250 dollars for showing what happens when +$\alpha = \omega_1^{\omega+2}$ and 500 dollars for settling the general case. +Larson proved this is true for all $\alpha < 2^{\aleph_0}$ assuming Martin's axiom. + +[EHM70] Erdős, P., Hajnal, A., and Milner, E.C., _A theorem in the partition calculus_, +Acta Math. Acad. Sci. Hungar. 21 (1970), 335–357. + +[Er81] Erdős, P., _Solved and unsolved problems in combinatorics and combinatorial +number theory_, Congr. Numer. 32 (1981), 49–62. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. + +[Er87] Erdős, P., _Some problems on finite and infinite graphs_, Logic and combinatorics, +Contemp. Math. 65 (1987), 223–228. + +[La90] Larson, J.A., _Martin's axiom and ordinal graphs: large independent sets or infinite +paths_, Ann. Pure Appl. Logic (1990), 31–39. +-/ + +open SimpleGraph Ordinal + +namespace Erdos601 + +/-- The type of ordinals strictly less than $\alpha$. -/ +abbrev OrdinalSet (α : Ordinal) := {a : Ordinal // a < α} + +/-- A graph has an infinite path: an injective sequence of vertices +such that consecutive vertices are adjacent. -/ +def HasInfinitePath {V : Type*} (G : SimpleGraph V) : Prop := + ∃ f : ℕ → V, Function.Injective f ∧ ∀ n : ℕ, G.Adj (f n) (f (n + 1)) + +/-- A graph on `OrdinalSet α` has an independent set of order type $\alpha$: +there is an order embedding from `OrdinalSet α` into itself whose +image is an independent set. -/ +def HasIndepSetOfOrderType {α : Ordinal} + (G : SimpleGraph (OrdinalSet α)) : Prop := + ∃ e : OrdinalSet α ↪o OrdinalSet α, + ∀ i j : OrdinalSet α, i ≠ j → ¬G.Adj (e i) (e j) + +/-- The Erdős-Hajnal-Milner property for an ordinal $\alpha$: +every graph on vertex set $\alpha$ has either an infinite path or +an independent set of order type $\alpha$. -/ +def EHMProperty (α : Ordinal) : Prop := + ∀ G : SimpleGraph (OrdinalSet α), + HasInfinitePath G ∨ HasIndepSetOfOrderType G + +/-- +Erdős Problem 601 [EHM70] [Er81] [Er82e] [Er87]: + +Every limit ordinal has the Erdős-Hajnal-Milner property: if $G$ is a graph +with vertex set $\alpha$ (a limit ordinal), then $G$ must have either an infinite path +or an independent set of vertices with order type $\alpha$. + +Known results: +- True for $\alpha < \omega_1^{\omega+2}$ (Erdős-Hajnal-Milner, 1970) +- True for all $\alpha < 2^{\aleph_0}$ assuming Martin's axiom (Larson, 1990) +-/ +@[category research open, AMS 3 5] +theorem erdos_601 (α : Ordinal) (hα : Order.IsSuccLimit α) : + EHMProperty α := by + sorry + +end Erdos601 diff --git a/FormalConjectures/ErdosProblems/602.lean b/FormalConjectures/ErdosProblems/602.lean new file mode 100644 index 0000000000..aae22b23a6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/602.lean @@ -0,0 +1,55 @@ +/- +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 602 + +*Reference:* [erdosproblems.com/602](https://www.erdosproblems.com/602) + +A problem of Komjáth. The existence of such a $2$-colouring is sometimes known as +Property B. + +[Er87] Erdős, P., _Some problems and results on combinatorial number theory_ (1987). +-/ + +open Cardinal Set + +namespace Erdos602 + +/-- Property B for a family of sets: there exists a $2$-colouring of the union +such that every set in the family contains elements of both colours. -/ +def HasPropertyB {α : Type*} {ι : Type*} (A : ι → Set α) : Prop := + ∃ c : α → Bool, ∀ i : ι, (∃ x ∈ A i, c x = true) ∧ (∃ x ∈ A i, c x = false) + +/-- +Erdős Problem 602 [Er87]: + +Let $(A_i)$ be a family of sets with $|A_i| = \aleph_0$ for all $i$, such that +for any $i \neq j$, $|A_i \cap A_j|$ is finite and $\neq 1$. Then the family +has Property B: there is a $2$-colouring of $\bigcup A_i$ such that no $A_i$ is +monochromatic. +-/ +@[category research open, AMS 3 5] +theorem erdos_602 {α : Type*} {ι : Type*} (A : ι → Set α) + (hcount : ∀ i, #(↥(A i)) = ℵ₀) + (hfin : ∀ i j, i ≠ j → (A i ∩ A j).Finite) + (hne1 : ∀ i j, i ≠ j → (A i ∩ A j).ncard ≠ 1) : + HasPropertyB A := by + sorry + +end Erdos602 diff --git a/FormalConjectures/ErdosProblems/603.lean b/FormalConjectures/ErdosProblems/603.lean new file mode 100644 index 0000000000..4f48b968c4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/603.lean @@ -0,0 +1,55 @@ +/- +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 603 + +*Reference:* [erdosproblems.com/603](https://www.erdosproblems.com/603) + +A problem of Komjáth [Er87]. Let $(A_i)$ be a family of countably infinite sets such that +$|A_i \cap A_j| \neq 2$ for all $i \neq j$. Find the smallest cardinal $C$ such that +$\bigcup A_i$ can always be coloured with at most $C$ colours so that no $A_i$ is +monochromatic. If instead we have $|A_i \cap A_j| \neq 1$ then Komjáth showed that this is +possible with at most $\aleph_0$ colours. + +[Er87] Erdős, P., _Some problems on finite and infinite graphs_, Logic and combinatorics, +Contemp. Math. **65** (1987), 223–228. +-/ + +open Cardinal Set + +namespace Erdos603 + +/-- +Erdős Problem 603 [Er87]: + +Let $(A_i)$ be a family of countably infinite sets such that $|A_i \cap A_j| \neq 2$ +for all $i \neq j$. Then there is a colouring with at most $\aleph_0$ colours so that +no $A_i$ is monochromatic. + +This is conjectured by analogy with the Komjáth result for the $|A_i \cap A_j| \neq 1$ +case, where $\aleph_0$ colours suffice. +-/ +@[category research open, AMS 3 5] +theorem erdos_603 {α : Type*} {ι : Type*} (A : ι → Set α) + (hcount : ∀ i, #(↥(A i)) = ℵ₀) + (hne2 : ∀ i j, i ≠ j → (A i ∩ A j).ncard ≠ 2) : + ∃ c : α → ℕ, ∀ i : ι, ∃ x ∈ A i, ∃ y ∈ A i, c x ≠ c y := by + sorry + +end Erdos603 diff --git a/FormalConjectures/ErdosProblems/604.lean b/FormalConjectures/ErdosProblems/604.lean new file mode 100644 index 0000000000..399dc2654a --- /dev/null +++ b/FormalConjectures/ErdosProblems/604.lean @@ -0,0 +1,123 @@ +/- +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 604 + +*Reference:* [erdosproblems.com/604](https://www.erdosproblems.com/604) + +Given $n$ distinct points $A \subset \mathbb{R}^2$, must there be a point $x \in A$ such that +$$\#\{ d(x,y) : y \in A\} \gg n/\sqrt{\log n}?$$ + +This is the pinned distance problem, a stronger form of Problem \#89 (the distinct +distances problem). The example of an integer grid shows that $n/\sqrt{\log n}$ would +be best possible. + +The best known bound is $\gg n^{c - o(1)}$ where $c = (48 - 14e)/(55 - 16e) = 0.8641\ldots$, +due to Katz and Tardos [KaTa04]. + +[Er57] Erdős, P., _Some unsolved problems_, 1957. + +[Er61] Erdős, P., _Some unsolved problems_. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), +221–254. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 99. + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Er85] Erdős, P., _Problems and results in combinatorial geometry_. Discrete geometry and +convexity (New York, 1982), Ann. New York Acad. Sci. 440 (1985), 1–11. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167–177, p. 169. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium 107 (1995). + +[Er97b] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) + +[KaTa04] Katz, N.H. and Tardos, G., _A new entropy inequality for the Erdős distance problem_. +Towards a theory of geometric graphs (2004), 119–126. +-/ + +namespace Erdos604 + +/-- +The set of distinct distances from a point $x$ to all points in a finite set $A$ in +$\mathbb{R}^2$. +-/ +noncomputable def pinnedDistances (x : EuclideanSpace ℝ (Fin 2)) + (A : Finset (EuclideanSpace ℝ (Fin 2))) : Finset ℝ := + A.image (fun y => dist x y) + +/-- +Erdős Problem 604 [Er57][Er61]: + +Given $n$ distinct points $A \subset \mathbb{R}^2$, there must exist a point $x \in A$ such that +the number of distinct distances from $x$ to other points in $A$ is +$\gg n/\sqrt{\log n}$. + +Formally: there exists a constant $C > 0$ and a threshold $N_0$ such that for all $n \geq N_0$ +and every set $A$ of $n$ points in $\mathbb{R}^2$, some point $x \in A$ has at least +$C \cdot n / \sqrt{\log n}$ distinct pinned distances. + +The integer grid shows this would be best possible. +-/ +@[category research open, AMS 52] +theorem erdos_604 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + A.card = n → + ∃ x ∈ A, ((pinnedDistances x A).card : ℝ) ≥ + C * (n : ℝ) / Real.sqrt (Real.log (n : ℝ)) := by + sorry + +/-- +Katz and Tardos [KaTa04] proved that for any $n$ distinct points in $\mathbb{R}^2$, some point +has $\gg n^{c - o(1)}$ pinned distances, where $c = (48 - 14e)/(55 - 16e) \approx 0.8641$. + +This is a partial result towards `erdos_604`, which conjectures the stronger bound +$\gg n / \sqrt{\log n}$. + +[KaTa04] Katz, N.H. and Tardos, G., _A new entropy inequality for the Erdős distance problem_. +Towards a theory of geometric graphs (2004), 119–126. +-/ +@[category research solved, AMS 52] +theorem erdos_604.variants.katz_tardos : + let c : ℝ := (48 - 14 * Real.exp 1) / (55 - 16 * Real.exp 1) + ∀ ε > 0, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + A.card = n → + ∃ x ∈ A, ((pinnedDistances x A).card : ℝ) ≥ + (n : ℝ) ^ (c - ε) := by + sorry + +end Erdos604 diff --git a/FormalConjectures/ErdosProblems/605.lean b/FormalConjectures/ErdosProblems/605.lean new file mode 100644 index 0000000000..9388bd39c5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/605.lean @@ -0,0 +1,69 @@ +/- +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 605 + +*Reference:* [erdosproblems.com/605](https://www.erdosproblems.com/605) + +Is there some function $f(n)\to \infty$ as $n\to\infty$ such that there exist $n$ distinct +points on the surface of a two-dimensional sphere with at least $f(n)n$ many pairs of +points whose distances are the same? + +This was solved by Erdős, Hickerson, and Pach [EHP89], who showed $u_{\sqrt{2}}(n) \asymp +n^{4/3}$ and $u_D(n) \gg n \log^* n$ for all $D > 1$. The lower bound was improved by +Swanepoel and Valtr [SwVa04] to $u_D(n) \gg n\sqrt{\log n}$. The best upper bound for +general $D$ is $u_D(n) \ll n^{4/3}$. + +[EHP89] Erdős, P., Hickerson, D., and Pach, J., _A problem of Leo Moser about repeated +distances on the sphere_. Amer. Math. Monthly 96 (1989), 569–575. + +[SwVa04] Swanepoel, K. J. and Valtr, P., _The unit distance problem on spheres_. +In Towards a Theory of Geometric Graphs (2004), 145–160. + +[Er85] Erdős, P., _Problems and results in combinatorial geometry_. Discrete geometry and +convexity (New York, 1982), Ann. New York Acad. Sci. 440 (1985), 1–11. +-/ + +open Filter + +namespace Erdos605 + +/-- The number of ordered pairs of distinct points from $A$ at Euclidean distance $d$. -/ +noncomputable def pairsAtDistance + (A : Finset (EuclideanSpace ℝ (Fin 3))) (d : ℝ) : ℕ := + (A.offDiag.filter (fun p => dist p.1 p.2 = d)).card + +/-- +Erdős Problem 605 [Er85]: + +There exists a function $f(n) \to \infty$ such that for all $n \geq 2$, one can place $n$ distinct +points on the surface of a sphere in $\mathbb{R}^3$ with at least $f(n) \cdot n$ ordered pairs of +points at some common distance. (Equivalently, at least $f(n) \cdot n / 2$ unordered pairs.) +-/ +@[category research solved, AMS 5 52] +theorem erdos_605 : answer(True) ↔ + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ n : ℕ, n ≥ 2 → + ∃ (R : ℝ) (A : Finset (EuclideanSpace ℝ (Fin 3))), + R > 0 ∧ A.card = n ∧ + (∀ x ∈ A, ‖x‖ = R) ∧ + ∃ d : ℝ, (pairsAtDistance A d : ℝ) ≥ f n * n := by + sorry + +end Erdos605 diff --git a/FormalConjectures/ErdosProblems/606.lean b/FormalConjectures/ErdosProblems/606.lean new file mode 100644 index 0000000000..aa853946cd --- /dev/null +++ b/FormalConjectures/ErdosProblems/606.lean @@ -0,0 +1,93 @@ +/- +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.Geometry.«2d» + +open scoped EuclideanGeometry + +/-! +# Erdős Problem 606 + +*Reference:* [erdosproblems.com/606](https://www.erdosproblems.com/606) + +Given any $n$ distinct points in $\mathbb{R}^2$, let $f(n)$ count the number of distinct +lines determined by these points. What are the possible values of $f(n)$? + +A question of Grünbaum. The Sylvester-Gallai theorem implies that if the points are not +all collinear (i.e., they determine more than one line), then they determine at least $n$ +lines. Erdős showed that, for some constant $c > 0$, all integers in +$[cn^{3/2}, \binom{n}{2}]$ are possible except $\binom{n}{2} - 1$ and $\binom{n}{2} - 3$. + +Solved (for all sufficiently large $n$) completely by Erdős and Salamon [ErSa88]. + +[Er85] Erdős, P., _Problems and results in combinatorial geometry_. Discrete geometry and +convexity (New York, 1982), Ann. New York Acad. Sci. 440 (1985), 1–11. + +[ErSa88] Erdős, P. and Salamon, P., _The solution to a problem of Grünbaum_. +Canad. Math. Bull. **31** (1988), 129–138. +-/ + +namespace Erdos606 + +/-- The number of distinct lines determined by a finite point set $A$ in $\mathbb{R}^2$. +A line is the affine span of a pair of distinct points from $A$. -/ +noncomputable def numLinesDetermined + (A : Finset (ℝ²)) : ℕ := + Set.ncard {l : AffineSubspace ℝ (ℝ²) | + ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ l = affineSpan ℝ ({a, b} : Set (ℝ²))} + +/-- The set of achievable line counts for configurations of exactly $n$ points +in $\mathbb{R}^2$. -/ +noncomputable def achievableLineCounts (n : ℕ) : Set ℕ := + {k | ∃ A : Finset (ℝ²), + A.card = n ∧ numLinesDetermined A = k} + +/-- +Erdős Problem 606 [ErSa88]: + +For sufficiently large $n$, every integer in $[c \cdot n^{3/2}, \binom{n}{2}]$ is achievable +as a line count for some configuration of $n$ points in $\mathbb{R}^2$, except for +$\binom{n}{2} - 1$ and $\binom{n}{2} - 3$. +-/ +@[category research solved, AMS 52] +theorem erdos_606 : + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (∀ k : ℕ, (k : ℝ) ≥ c * (n : ℝ) ^ (3 / 2 : ℝ) → + k ≤ n.choose 2 → + k ≠ n.choose 2 - 1 → + k ≠ n.choose 2 - 3 → + k ∈ achievableLineCounts n) ∧ + n.choose 2 - 1 ∉ achievableLineCounts n ∧ + n.choose 2 - 3 ∉ achievableLineCounts n := by + sorry + +/-- +Sylvester-Gallai consequence [Er85]: + +For any set of $n \geq 2$ points in $\mathbb{R}^2$ that are not all collinear (i.e., they +determine more than $1$ line), the number of distinct lines determined is at least $n$. +-/ +@[category research solved, AMS 52] +theorem erdos_606.variants.sylvester_gallai : + ∀ A : Finset (ℝ²), + A.card ≥ 2 → + numLinesDetermined A > 1 → + numLinesDetermined A ≥ A.card := by + sorry + +end Erdos606 diff --git a/FormalConjectures/ErdosProblems/607.lean b/FormalConjectures/ErdosProblems/607.lean new file mode 100644 index 0000000000..1d6ccb5436 --- /dev/null +++ b/FormalConjectures/ErdosProblems/607.lean @@ -0,0 +1,93 @@ +/- +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 607 + +*Reference:* [erdosproblems.com/607](https://www.erdosproblems.com/607) + +Erdős asked for an upper bound on the number of distinct line spectra achievable by +$n$-point configurations in $\mathbb{R}^2$. Szemerédi and Trotter proved it is at most +$\exp(C\sqrt{n})$ for some constant $C > 0$. Erdős noted that this bound is best possible, +i.e., the exponential order $\exp(\Theta(\sqrt{n}))$ is tight. + +[Er85] Erdős, P., *Problems and results in combinatorial geometry*. + +[SzTr83] Szemerédi, E. and Trotter, W. T., Jr., *Extremal problems in discrete geometry*. +Combinatorica (1983), 381-392. +-/ + +namespace Erdos607 + +open scoped Classical + +/-- Three points in $\mathbb{R}^2$ are collinear: the cross product of the displacement + vectors $(q - p)$ and $(r - p)$ vanishes. -/ +noncomputable def Collinear607 (p q r : ℝ × ℝ) : Prop := + (q.1 - p.1) * (r.2 - p.2) = (r.1 - p.1) * (q.2 - p.2) + +/-- Given a finite point set $P$ and two points $p, q$, the number of points in $P$ + lying on the line through $p$ and $q$. -/ +noncomputable def lineIncidence607 (P : Finset (ℝ × ℝ)) (p q : ℝ × ℝ) : ℕ := + (P.filter (fun r => Collinear607 p q r)).card + +/-- The line spectrum of a finite point set $P \subset \mathbb{R}^2$: the set of all distinct + values $|\ell \cap P|$ as $\ell$ ranges over lines determined by $P$ (lines through at + least two points of $P$). -/ +noncomputable def lineSpectrum607 (P : Finset (ℝ × ℝ)) : Finset ℕ := + P.biUnion fun p => + (P.filter fun q => p ≠ q).image fun q => lineIncidence607 P p q + +/-- The set of achievable line spectra for $n$-point configurations in $\mathbb{R}^2$. -/ +noncomputable def achievableSpectra607 (n : ℕ) : Set (Finset ℕ) := + {S | ∃ P : Finset (ℝ × ℝ), P.card = n ∧ lineSpectrum607 P = S} + +/-- +**Erdős Problem 607** [Er85]: + +There exists a constant $C > 0$ such that for all sufficiently large $n$, the number +$F(n)$ of distinct line spectra achievable by $n$-point configurations in $\mathbb{R}^2$ +satisfies $F(n) \leq \exp(C \cdot \sqrt{n})$. + +Proved by Szemerédi and Trotter [SzTr83]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_607 : + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + (achievableSpectra607 n).Finite ∧ + ((achievableSpectra607 n).ncard : ℝ) ≤ Real.exp (C * Real.sqrt (n : ℝ)) := by + sorry + +/-- +**Erdős Problem 607 (lower bound)** [Er85]: + +There exists a constant $c > 0$ such that for infinitely many $n$, the number +$F(n)$ of distinct line spectra achievable by $n$-point configurations in $\mathbb{R}^2$ +satisfies $F(n) \geq \exp(c \cdot \sqrt{n})$. + +Erdős noted that this lower bound is "easy to see," confirming that the +$\exp(\Theta(\sqrt{n}))$ growth rate is tight. +-/ +@[category research solved, AMS 5 52] +theorem erdos_607_lower : + ∃ c : ℝ, 0 < c ∧ ∀ n₀ : ℕ, ∃ n : ℕ, n₀ ≤ n ∧ + (achievableSpectra607 n).Finite ∧ + Real.exp (c * Real.sqrt (n : ℝ)) ≤ ((achievableSpectra607 n).ncard : ℝ) := by + sorry + +end Erdos607 diff --git a/FormalConjectures/ErdosProblems/608.lean b/FormalConjectures/ErdosProblems/608.lean new file mode 100644 index 0000000000..ecf5e8b576 --- /dev/null +++ b/FormalConjectures/ErdosProblems/608.lean @@ -0,0 +1,76 @@ +/- +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 608 + +*Reference:* [erdosproblems.com/608](https://www.erdosproblems.com/608) + +Let $G$ be a graph with $n$ vertices and more than $n^2/4$ edges. Are there at least +$(2/9)n^2$ edges of $G$ which are contained in a $C_5$? + +This was disproved. Füredi and Maleki (unpublished, described in [GHV19]) constructed +graphs with more than $n^2/4$ edges where at most $c \cdot n^2 + O(n)$ edges are in a +$C_5$, with $c = (2 + \sqrt{2})/16 \approx 0.2134$. Grzesik, Hu, and Volec [GHV19] +proved this bound is tight: any graph with more than $n^2/4$ edges contains at least +$(c - o(1)) \cdot n^2$ edges in a $C_5$. + +[EFR92] Erdős, P., Faudree, R. J., Rousseau, C. C., _Extremal problems involving +vertices and edges on odd cycles_. Discrete Mathematics (1992), 23–31. + +[Er97d] Erdős, P., _Some recent problems and results in graph theory_. Discrete +Mathematics (1997), 81–85. + +[GHV19] Grzesik, A., Hu, P., Volec, J., _Minimum number of edges that occur in odd +cycles_. Journal of Combinatorial Theory, Series B (2019), 65–103. +-/ + +open scoped Classical +open SimpleGraph + +namespace Erdos608 + +/-- The number of edges of $G$ contained in some $5$-cycle. An edge $\{u, v\}$ is +in a $C_5$ if there exist vertices $w_1, w_2, w_3$ (all five pairwise distinct) +such that $u$-$w_1$-$w_2$-$w_3$-$v$-$u$ is a $5$-cycle in $G$. Edges are counted as +unordered edges $\{u, v\}$ (with $u < v$ as a canonical ordering) to avoid +double-counting. -/ +noncomputable def numEdgesInC5 {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + (Finset.univ.filter fun p : Fin n × Fin n => + p.1 < p.2 ∧ G.Adj p.1 p.2 ∧ + ∃ w₁ w₂ w₃ : Fin n, + ({p.1, p.2, w₁, w₂, w₃} : Finset (Fin n)).card = 5 ∧ + G.Adj p.1 w₁ ∧ G.Adj w₁ w₂ ∧ G.Adj w₂ w₃ ∧ G.Adj w₃ p.2).card + +/-- +**Erdős Problem 608** (Disproved) [EFR92, Er97d]: + +If $G$ is a graph on $n$ vertices with more than $n^2/4$ edges, then at least +$(2/9) \cdot n^2$ edges of $G$ are contained in a $C_5$. + +This is false. The correct threshold is $c = (2+\sqrt{2})/16 \approx 0.2134$, proved +optimal by Grzesik, Hu, and Volec [GHV19]. +-/ +@[category research solved, AMS 5] +theorem erdos_608 : answer(False) ↔ + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + (G.edgeFinset.card : ℝ) > (n : ℝ) ^ 2 / 4 → + (numEdgesInC5 G : ℝ) ≥ 2 / 9 * (n : ℝ) ^ 2 := by + sorry + +end Erdos608 diff --git a/FormalConjectures/ErdosProblems/609.lean b/FormalConjectures/ErdosProblems/609.lean new file mode 100644 index 0000000000..6877dd5ded --- /dev/null +++ b/FormalConjectures/ErdosProblems/609.lean @@ -0,0 +1,123 @@ +/- +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 609 + +*Reference:* [erdosproblems.com/609](https://www.erdosproblems.com/609) + +Let $f(n)$ be the minimal $m$ such that if the edges of $K_{2^n+1}$ are coloured +with $n$ colours then there must be a monochromatic odd cycle of length at most $m$. +Estimate $f(n)$. + +A problem of Erdős and Graham [ErGr75]. The edges of $K_{2^n}$ can be +$n$-coloured to avoid monochromatic odd cycles entirely (partition vertices by +binary coordinates). Day and Johnson [DaJo17] proved $f(n) \to \infty$ and +$f(n) \geq 2^{c\sqrt{\log n}}$ for some $c > 0$. Janzer and Yip [JaYi25] proved +$f(n) \leq O(n^{3/2} \cdot 2^{n/2})$. + +[ErGr75] Erdős, P. and Graham, R. + +[Ch97] Chung, F. R. K., _Open problems of Paul Erdős in graph theory_. J. Graph Theory (1997), 3–36. + +[DaJo17] Day, A. N. and Johnson, J. R., _Multicolour Ramsey numbers of odd cycles_. +J. Combin. Theory Ser. B (2017), 56–63. + +[GiHu24] Girão, A. and Hunter, Z., _Monochromatic odd cycles in edge-coloured complete +graphs_. arXiv:2412.07708 (2024). + +[JaYi25] Janzer, O. and Yip, C. H., _Short monochromatic odd cycles_. +arXiv:2506.14910 (2025). +-/ + +namespace Erdos609 + +/-- There exists a monochromatic cycle of length $k$ in an edge coloring of $K_N$. +A cycle is an injective sequence of $k \geq 3$ vertices $v_0, \ldots, v_{k-1}$ where all +consecutive edges $v_0 v_1, v_1 v_2, \ldots, v_{k-1} v_0$ have the same color. -/ +def HasMonoCycle609 {N c : ℕ} (χ : Fin N → Fin N → Fin c) (k : ℕ) : Prop := + k ≥ 3 ∧ + ∃ (v : Fin k → Fin N), + Function.Injective v ∧ + ∃ col : Fin c, ∀ i : Fin k, + χ (v i) (v ⟨(i.val + 1) % k, Nat.mod_lt _ (by have := i.isLt; omega)⟩) = col + +/-- +**Erdős Problem 609** [ErGr75]: + +For every $n \geq 1$, every symmetric $n$-coloring of the edges of $K_{2^n+1}$ +contains a monochromatic odd cycle. (This establishes that $f(n)$ is finite.) +-/ +@[category research solved, AMS 5] +theorem erdos_609 : + ∀ n : ℕ, n ≥ 1 → + ∀ χ : Fin (2^n + 1) → Fin (2^n + 1) → Fin n, + (∀ u v, χ u v = χ v u) → + ∃ k, Odd k ∧ HasMonoCycle609 χ k := by + sorry + +/-- +**Erdős Problem 609** (Day–Johnson lower bound) [DaJo17]: + +There exists $c > 0$ such that for all sufficiently large $n$, there exists a +symmetric $n$-coloring of $K_{2^n+1}$ with no monochromatic odd cycle of length +less than $2^{c \cdot \sqrt{\log n}}$. +-/ +@[category research solved, AMS 5] +theorem erdos_609.variants.lower_bound : + ∃ c : ℝ, c > 0 ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ χ : Fin (2^n + 1) → Fin (2^n + 1) → Fin n, + (∀ u v, χ u v = χ v u) ∧ + ∀ k, Odd k → HasMonoCycle609 χ k → + (k : ℝ) ≥ (2 : ℝ) ^ (c * Real.sqrt (Real.log (n : ℝ))) := by + sorry + +/-- +**Erdős Problem 609** (Janzer–Yip upper bound) [JaYi25]: + +There exists $C > 0$ such that for all sufficiently large $n$, every symmetric +$n$-coloring of $K_{2^n+1}$ contains a monochromatic odd cycle of length at most +$C \cdot n^{3/2} \cdot 2^{n/2}$. +-/ +@[category research solved, AMS 5] +theorem erdos_609.variants.upper_bound : + ∃ C : ℝ, C > 0 ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ χ : Fin (2^n + 1) → Fin (2^n + 1) → Fin n, + (∀ u v, χ u v = χ v u) → + ∃ k, Odd k ∧ HasMonoCycle609 χ k ∧ + (k : ℝ) ≤ C * (n : ℝ) ^ ((3 : ℝ) / 2) * (2 : ℝ) ^ ((n : ℝ) / 2) := by + sorry + +/-- +**Erdős Problem 609** (Girão–Hunter upper bound) [GiHu24]: + +There exists $n_0$ such that for all $n \geq n_0$, every symmetric $n$-coloring +of $K_{2^n+1}$ contains a monochromatic odd cycle of length at most $2^n / n^{1-o(1)}$. +More precisely, for every $\varepsilon > 0$ and all sufficiently large $n$, there is a +monochromatic odd cycle of length at most $2^n / n^{1-\varepsilon}$. +-/ +@[category research solved, AMS 5] +theorem erdos_609.variants.upper_bound_GiHu : + ∀ ε : ℝ, ε > 0 → ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ χ : Fin (2^n + 1) → Fin (2^n + 1) → Fin n, + (∀ u v, χ u v = χ v u) → + ∃ k, Odd k ∧ HasMonoCycle609 χ k ∧ + (k : ℝ) ≤ (2 : ℝ) ^ (n : ℝ) / (n : ℝ) ^ (1 - ε) := by + sorry + +end Erdos609 diff --git a/FormalConjectures/ErdosProblems/610.lean b/FormalConjectures/ErdosProblems/610.lean new file mode 100644 index 0000000000..715cba5d80 --- /dev/null +++ b/FormalConjectures/ErdosProblems/610.lean @@ -0,0 +1,115 @@ +/- +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 610 + +*Reference:* [erdosproblems.com/610](https://www.erdosproblems.com/610) + +For a graph $G$, let $\tau(G)$ denote the minimal number of vertices that include at +least one from each maximal clique of $G$ (the clique transversal number). + +Estimate $\tau(G)$. In particular, is it true that if $G$ has $n$ vertices then +$\tau(G) \leq n - \omega(n)\sqrt{n}$ for some $\omega(n) \to \infty$, or even +$\tau(G) \leq n - c\sqrt{n \log n}$ for some absolute constant $c > 0$? + +A problem of Erdős, Gallai, and Tuza [EGT92], who proved that +$\tau(G) \leq n - \sqrt{2n} + O(1)$. + +A positive answer to the strong form would follow from Problem 151 (Erdős–Gallai conjecture +on $\tau(G) \leq n - H(n)$), since Ajtai, Komlós, and Szemerédi [AKS80] proved +$H(n) \gg \sqrt{n \log n}$. See also the related Problem 611. + +[EGT92] Erdős, P., Gallai, T., and Tuza, Zs., *Covering the cliques of a graph with +vertices*, Discrete Mathematics **108** (1992), 279-289. + +[Er94] Erdős, P., *Some old and new problems in various branches of combinatorics*, +Discrete Mathematics, 1994. + +[Er99] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Le Matematiche, 1999. + +[AKS80] Ajtai, M., Komlós, J., and Szemerédi, E., *A note on Ramsey numbers*, +Journal of Combinatorial Theory, Series A (1980), 354-360. +-/ + +open SimpleGraph Filter + +namespace Erdos610 + +/-- $S$ is a maximal clique of $G$ (as a `Finset`): it is a clique and no vertex +outside $S$ can be added while preserving the clique property. -/ +def IsMaximalCliqueFS {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + G.IsClique (S : Set (Fin n)) ∧ + ∀ v : Fin n, v ∉ S → ¬G.IsClique (↑(insert v S) : Set (Fin n)) + +/-- $T$ is a clique transversal of $G$ if $T$ meets every maximal clique of $G$ +that has at least $2$ vertices. (Singleton maximal cliques — i.e., isolated vertices — +are excluded by convention, as otherwise $\tau(G) = n$ trivially.) -/ +def IsCliqueTransversal {n : ℕ} (G : SimpleGraph (Fin n)) (T : Finset (Fin n)) : Prop := + ∀ S : Finset (Fin n), IsMaximalCliqueFS G S → 2 ≤ S.card → (T ∩ S).Nonempty + +/-- The clique transversal number $\tau(G)$: the minimum cardinality of a clique +transversal of $G$. -/ +noncomputable def cliqueTransversalNum {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf { k : ℕ | ∃ T : Finset (Fin n), IsCliqueTransversal G T ∧ T.card = k } + +/-- +**Erdős Problem 610** (Weak form) [EGT92]: + +There exists a function $\omega : \mathbb{N} \to \mathbb{R}$ with $\omega(n) \to \infty$ +such that for every graph $G$ on $n$ vertices, +$\tau(G) \leq n - \omega(n) \cdot \sqrt{n}$. +-/ +@[category research open, AMS 5] +theorem erdos_610 : answer(sorry) ↔ + ∃ ω : ℕ → ℝ, Tendsto ω atTop atTop ∧ + ∀ n : ℕ, n ≥ 1 → + ∀ G : SimpleGraph (Fin n), + (cliqueTransversalNum G : ℝ) ≤ (n : ℝ) - ω n * Real.sqrt (n : ℝ) := by + sorry + +/-- +**Erdős Problem 610** (Strong form) [EGT92] [Er94] [Er99]: + +There exists $c > 0$ such that for every graph $G$ on $n$ vertices, +$\tau(G) \leq n - c \cdot \sqrt{n \cdot \log n}$. +-/ +@[category research open, AMS 5] +theorem erdos_610.variants.strong : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ n : ℕ, n ≥ 2 → + ∀ G : SimpleGraph (Fin n), + (cliqueTransversalNum G : ℝ) ≤ + (n : ℝ) - c * Real.sqrt ((n : ℝ) * Real.log (n : ℝ)) := by + sorry + +/-- +**Erdős Problem 610** (Known bound, Erdős–Gallai–Tuza) [EGT92]: + +There exists $C > 0$ such that for every graph $G$ on $n$ vertices, +$\tau(G) \leq n - \sqrt{2n} + C$. +-/ +@[category research solved, AMS 5] +theorem erdos_610.variants.known_bound : + ∃ C : ℝ, ∀ n : ℕ, n ≥ 1 → + ∀ G : SimpleGraph (Fin n), + (cliqueTransversalNum G : ℝ) ≤ (n : ℝ) - Real.sqrt (2 * (n : ℝ)) + C := by + sorry + +end Erdos610 diff --git a/FormalConjectures/ErdosProblems/611.lean b/FormalConjectures/ErdosProblems/611.lean new file mode 100644 index 0000000000..85ab408634 --- /dev/null +++ b/FormalConjectures/ErdosProblems/611.lean @@ -0,0 +1,123 @@ +/- +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 611 + +*Reference:* [erdosproblems.com/611](https://www.erdosproblems.com/611) + +Let $\tau(G)$ denote the minimum number of vertices needed to intersect every maximal +clique of a graph $G$. Erdős, Gallai, and Tuza conjectured that if every maximal clique +of $G$ on $n$ vertices has at least $cn$ vertices (for a fixed constant $c > 0$), then +$\tau(G) = o(n)$. + +[EGT92] Erdős, P., Gallai, T., and Tuza, Zs., _Covering the cliques of a graph with vertices_. +Discrete Mathematics (1992), 279-289. + +[Er94] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Discrete Mathematics (1994). + +[Er99] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) (1999). +-/ + +open SimpleGraph + +namespace Erdos611 + +/-- $S$ is a maximal clique of $G$ (as a `Finset`): it is a clique and no vertex + outside $S$ can be added while preserving the clique property. -/ +def IsMaximalCliqueFS {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + G.IsClique (S : Set (Fin n)) ∧ + ∀ v : Fin n, v ∉ S → ¬G.IsClique (↑(insert v S) : Set (Fin n)) + +/-- $T$ is a clique transversal of $G$ if $T$ meets every maximal clique of $G$ + that has at least $2$ vertices. -/ +def IsCliqueTransversal {n : ℕ} (G : SimpleGraph (Fin n)) (T : Finset (Fin n)) : Prop := + ∀ S : Finset (Fin n), IsMaximalCliqueFS G S → 2 ≤ S.card → (T ∩ S).Nonempty + +/-- The clique transversal number $\tau(G)$: the minimum cardinality of a clique + transversal of $G$. -/ +noncomputable def cliqueTransversalNum {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf { k : ℕ | ∃ T : Finset (Fin n), IsCliqueTransversal G T ∧ T.card = k } + +/-- Every maximal clique of $G$ with at least $2$ vertices has at least $m$ vertices. -/ +def AllMaxCliquesAtLeast {n : ℕ} (G : SimpleGraph (Fin n)) (m : ℕ) : Prop := + ∀ S : Finset (Fin n), IsMaximalCliqueFS G S → 2 ≤ S.card → m ≤ S.card + +/-- +**Erdős Problem 611** (Main conjecture) [EGT92][Er94][Er99]: + +If all maximal cliques in $G$ have at least $cn$ vertices then $\tau(G) = o_c(n)$. + +Formulated as: for every $c > 0$ and $\varepsilon > 0$, there exists $N_0$ such that for all +$n \ge N_0$, every graph $G$ on $n$ vertices in which every maximal clique has at +least $\lceil c \cdot n \rceil$ vertices satisfies $\tau(G) \le \varepsilon \cdot n$. +-/ +@[category research open, AMS 5] +theorem erdos_611 (c : ℝ) (hc : 0 < c) (hc1 : c ≤ 1) : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + AllMaxCliquesAtLeast G (⌈c * (n : ℝ)⌉₊) → + (cliqueTransversalNum G : ℝ) ≤ ε * (n : ℝ) := by + sorry + +/-- +**Erdős Problem 611** (Known bound, Erdős-Gallai-Tuza) [EGT92]: + +If every maximal clique of $G$ on $n$ vertices has at least $k$ vertices then +$\tau(G) \le n - \sqrt{kn}$. +-/ +@[category research solved, AMS 5] +theorem erdos_611.variants.known_bound (n : ℕ) (hn : n ≥ 1) + (G : SimpleGraph (Fin n)) (k : ℕ) (hk : k ≥ 1) + (hclique : AllMaxCliquesAtLeast G k) : + (cliqueTransversalNum G : ℝ) ≤ (n : ℝ) - Real.sqrt ((k : ℝ) * (n : ℝ)) := by + sorry + +/-- +**Erdős Problem 611** (Bollobás-Erdős): + +If every maximal clique of $G$ on $n$ vertices has at least $n + 3 - 2\sqrt{n}$ vertices +then $\tau(G) \le 1$. (This threshold is best possible.) +-/ +@[category research solved, AMS 5] +theorem erdos_611.variants.bollobas_erdos (n : ℕ) (hn : n ≥ 4) + (G : SimpleGraph (Fin n)) : + AllMaxCliquesAtLeast G (⌈(n : ℝ) + 3 - 2 * Real.sqrt (n : ℝ)⌉₊) → + cliqueTransversalNum G ≤ 1 := by + sorry + +/-- +**Erdős Problem 611** (k_c(n) estimation) [EGT92]: + +For $c > 0$, let $k_c(n)$ be the minimal value such that if every maximal clique of $G$ on +$n$ vertices has at least $k_c(n)$ vertices, then $\tau(G) < (1 - c) n$. Erdős, Gallai, and +Tuza proved that $k_c(n) \ge n^{c' / \log \log n}$ for some $c' > 0$ depending on $c$. +-/ +@[category research solved, AMS 5] +theorem erdos_611.variants.kc_lower_bound (c : ℝ) (hc : 0 < c) (hc1 : c < 1) : + ∃ c' : ℝ, c' > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + AllMaxCliquesAtLeast G ⌈(n : ℝ) ^ (c' / Real.log (Real.log (n : ℝ)))⌉₊ → + (cliqueTransversalNum G : ℝ) < (1 - c) * (n : ℝ) := by + sorry + +end Erdos611 diff --git a/FormalConjectures/ErdosProblems/612.lean b/FormalConjectures/ErdosProblems/612.lean new file mode 100644 index 0000000000..c5aa5f571b --- /dev/null +++ b/FormalConjectures/ErdosProblems/612.lean @@ -0,0 +1,155 @@ +/- +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 612 + +*Reference:* [erdosproblems.com/612](https://www.erdosproblems.com/612) + +Let $G$ be a connected graph with $n$ vertices, minimum degree $d$, and diameter $D$. + +The original conjecture of Erdős, Pach, Pollack, and Tuza [EPPT89] stated: +- If $G$ contains no $K_{2r}$ and $(r-1)(3r+2) \mid d$ then + $D \leq \frac{2(r-1)(3r+2)}{2r^2-1} \cdot \frac{n}{d} + O(1)$ +- If $G$ contains no $K_{2r+1}$ and $(3r-1) \mid d$ then + $D \leq \frac{3r-1}{r} \cdot \frac{n}{d} + O(1)$ + +The first case was disproven for $r \geq 2$ by Czabarka, Singgih, and Székely [CSS21]. + +The amended conjecture (due to [CSS21]) states that if $G$ contains no $K_{k+1}$ then +$D \leq (3 - 2/k) \cdot n/d + O(1)$. + +This is known: +- For $k = 2$ ($K_3$-free), proved in [EPPT89] +- For $3$-colourable graphs (weaker than $K_4$-free), by Czabarka, Dankelmann, + Székely [CDS09] +- For $4$-colourable graphs (weaker than $K_5$-free), by Czabarka, Smith, + Székely [CSS23] + +Cambie and Jooken [CaJo25] have given constructions for $K_4$-free graphs with minimum +degree $16$ achieving diameter at least $(31/216)n + O(1)$, providing another +counterexample to the original conjecture. + +It is also known that any connected graph on $n$ vertices with minimum degree $d$ has +$D \leq 3n/(d+1) + O(1)$. + +[EPPT89] Erdős, P., Pach, J., Pollack, R., and Tuza, Zs., _Radius, diameter, and +minimum degree_. J. Combin. Theory Ser. B 47 (1989), 73–79. + +[CSS21] Czabarka, É., Singgih, O., and Székely, L.A., _Counterexamples to a conjecture +of Erdős, Pach, Pollack, and Tuza_. J. Combin. Theory Ser. B (2021), 38–45. + +[CDS09] Czabarka, É., Dankelmann, P., and Székely, L.A., _Diameter of 4-colourable +graphs_. European J. Combin. (2009), 1082–1089. + +[CSS23] Czabarka, É., Smith, S.J., and Székely, L.A., _Maximum diameter of 3- and +4-colorable graphs_. J. Graph Theory (2023), 262–270. + +[CaJo25] Cambie, S. and Jooken, J., _Sharp results for the Erdős, Pach, Pollack and +Tuza problem_. arXiv:2502.08626 (2025). +-/ + +open SimpleGraph + +namespace Erdos612 + +/-- +**Erdős Problem 612** (Amended conjecture, [CSS21]): + +If $G$ is a connected $K_{k+1}$-free graph on $n$ vertices with minimum degree $d \geq 1$, +then +$$\operatorname{diam}(G) \leq \left(3 - \frac{2}{k}\right) \cdot \frac{n}{d} + C$$ +for some constant $C$ depending only on $k$. +-/ +@[category research open, AMS 5] +theorem erdos_612 (k : ℕ) (hk : k ≥ 2) : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.CliqueFree (k + 1) → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ (3 - 2 / (k : ℝ)) * ((n : ℝ) / (G.minDegree : ℝ)) + C := by + sorry + +/-- +**Erdős Problem 612** (Known case $k = 2$, [EPPT89]): + +If $G$ is a connected triangle-free graph on $n$ vertices with minimum degree $d \geq 1$, +then +$$\operatorname{diam}(G) \leq 2 \cdot \frac{n}{d} + C$$ +for some absolute constant $C$. +-/ +@[category research solved, AMS 5] +theorem erdos_612.variants.triangle_free : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.CliqueFree 3 → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ 2 * ((n : ℝ) / (G.minDegree : ℝ)) + C := by + sorry + +/-- +Known general bound ([EPPT89]): + +Any connected graph on $n$ vertices with minimum degree $d \geq 1$ has +$$\operatorname{diam}(G) \leq \frac{3n}{d+1} + O(1).$$ +-/ +@[category research solved, AMS 5] +theorem erdos_612.variants.general_bound : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ 3 * ((n : ℝ) / ((G.minDegree : ℝ) + 1)) + C := by + sorry + +/-- +**Erdős Problem 612** (Known case: 3-colourable graphs, [CDS09]): + +If $G$ is a connected $3$-colourable graph on $n$ vertices with minimum degree $d \geq 1$, +then +$$\operatorname{diam}(G) \leq \frac{7}{3} \cdot \frac{n}{d} + C$$ +for some absolute constant $C$. This is weaker than the $K_4$-free case ($k = 3$) of the +amended conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_612.variants.three_colorable : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.Colorable 3 → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ (7 / 3 : ℝ) * ((n : ℝ) / (G.minDegree : ℝ)) + C := by + sorry + +/-- +**Erdős Problem 612** (Known case: 4-colourable graphs, [CSS23]): + +If $G$ is a connected $4$-colourable graph on $n$ vertices with minimum degree $d \geq 1$, +then +$$\operatorname{diam}(G) \leq \frac{5}{2} \cdot \frac{n}{d} + C$$ +for some absolute constant $C$. This is weaker than the $K_5$-free case ($k = 4$) of the +amended conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_612.variants.four_colorable : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.Colorable 4 → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ (5 / 2 : ℝ) * ((n : ℝ) / (G.minDegree : ℝ)) + C := by + sorry + +end Erdos612 diff --git a/FormalConjectures/ErdosProblems/613.lean b/FormalConjectures/ErdosProblems/613.lean new file mode 100644 index 0000000000..2a38b84a59 --- /dev/null +++ b/FormalConjectures/ErdosProblems/613.lean @@ -0,0 +1,90 @@ +/- +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 613 + +Must every graph on $\binom{2n+1}{2} - \binom{n}{2} - 1$ edges (for $n \geq 3$) be expressible +as the union of a bipartite graph and a graph with maximum degree less than $n$? This is a +question about the size Ramsey number of stars $K_{1,n}$ versus the family of odd cycles. +Faudree proved the conjecture holds when the graph has exactly $2n+1$ vertices (unpublished, +referenced in [Er93]). Disproved in general by Pikhurko [Pi01]. + +*Reference:* [erdosproblems.com/613](https://www.erdosproblems.com/613) + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae **16** (1993), 333–350. + +[Pi01] Pikhurko, O., _Size Ramsey numbers of stars versus 3-chromatic graphs_, +Combinatorica 21 (2001), 403–412. +-/ + +open scoped Classical +open SimpleGraph + +namespace Erdos613 + +/-- +**Erdős Problem 613** (Original conjecture, DISPROVED): + +For $n \geq 3$, every graph $G$ with $\binom{2n+1}{2} - \binom{n}{2} - 1$ edges can be written as +the union of a bipartite graph and a graph with maximum degree less than $n$. + +This is false, as disproved by Pikhurko [Pi01]. +-/ +@[category research solved, AMS 5] +theorem erdos_613 : answer(False) ↔ ∀ (n : ℕ), n ≥ 3 → + ∀ (m : ℕ) (G : SimpleGraph (Fin m)), + G.edgeFinset.card = Nat.choose (2 * n + 1) 2 - Nat.choose n 2 - 1 → + ∃ (G₁ G₂ : SimpleGraph (Fin m)), + G₁ ⊔ G₂ = G ∧ G₁.Colorable 2 ∧ G₂.maxDegree < n := by + sorry + +/-- +**Erdős Problem 613** (Disproof, Pikhurko [Pi01]): + +There exists $n \geq 3$ and a graph $G$ with $\binom{2n+1}{2} - \binom{n}{2} - 1$ edges that +cannot be written as the union of a bipartite graph and a graph with maximum degree less than $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_613.variants.disproof : + ∃ (n : ℕ), n ≥ 3 ∧ + ∃ (m : ℕ) (G : SimpleGraph (Fin m)), + G.edgeFinset.card = Nat.choose (2 * n + 1) 2 - Nat.choose n 2 - 1 ∧ + ¬∃ (G₁ G₂ : SimpleGraph (Fin m)), + G₁ ⊔ G₂ = G ∧ G₁.Colorable 2 ∧ G₂.maxDegree < n := by + sorry + +/-- +**Erdős Problem 613** (Faudree's positive result): + +For $n \geq 3$, every graph on $2n+1$ vertices with $\binom{2n+1}{2} - \binom{n}{2} - 1$ edges +can be written as the union of a bipartite graph and a graph with maximum degree less than $n$. +That is, the conjecture holds when restricted to graphs with exactly $2n+1$ vertices. +This result is unpublished but referenced in [Er93]. +-/ +@[category research solved, AMS 5] +theorem erdos_613.variants.faudree : ∀ (n : ℕ), n ≥ 3 → + ∀ (G : SimpleGraph (Fin (2 * n + 1))), + -- edge count = C(2n+1, 2) - C(n, 2) - 1 = 3n(n+1)/2 - 1 + G.edgeFinset.card = Nat.choose (2 * n + 1) 2 - Nat.choose n 2 - 1 → + ∃ (G₁ G₂ : SimpleGraph (Fin (2 * n + 1))), + G₁ ⊔ G₂ = G ∧ G₁.Colorable 2 ∧ G₂.maxDegree < n := by + sorry + +end Erdos613 diff --git a/FormalConjectures/ErdosProblems/614.lean b/FormalConjectures/ErdosProblems/614.lean new file mode 100644 index 0000000000..fae4f3ac86 --- /dev/null +++ b/FormalConjectures/ErdosProblems/614.lean @@ -0,0 +1,63 @@ +/- +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 614 + +*Reference:* [erdosproblems.com/614](https://www.erdosproblems.com/614) + +Let $f(n,k)$ be minimal such that there is a graph with $n$ vertices and $f(n,k)$ edges +where every set of $k+2$ vertices induces a subgraph with maximum degree at least $k$. +Determine $f(n,k)$. + +A problem of Erdős, Faudree, Rousseau, and Schelp. + +[FRS97] Faudree, R., Rousseau, C., and Schelp, R., *Problems in graph theory from +Memphis*. The Mathematics of Paul Erdős, II (1997). +-/ + +open Classical SimpleGraph Finset + +namespace Erdos614 + +/-- A graph $G$ on `Fin n` has the **$(n,k)$-induced degree property** if every subset of +exactly $k + 2$ vertices contains a vertex adjacent to at least $k$ other vertices +in the subset (i.e., the induced subgraph on that subset has maximum degree $\geq k$). -/ +def HasInducedDegreeProp {n : ℕ} (G : SimpleGraph (Fin n)) (k : ℕ) : Prop := + ∀ S : Finset (Fin n), S.card = k + 2 → + ∃ v ∈ S, k ≤ (S.filter (G.Adj v)).card + +/-- `erdos614_f n k` is the minimum number of edges in a graph on $n$ vertices such that +every subset of $k + 2$ vertices induces a subgraph with maximum degree at least $k$. +This is the function $f(n, k)$ from Erdős Problem 614. -/ +noncomputable def erdos614_f (n k : ℕ) : ℕ := + sInf {m : ℕ | ∃ G : SimpleGraph (Fin n), + G.edgeFinset.card = m ∧ HasInducedDegreeProp G k} + +/-- +**Erdős Problem 614** [FRS97]: + +Determine $f(n,k)$, the minimum number of edges in a graph on $n$ vertices such that every +subset of $k+2$ vertices induces a subgraph with maximum degree at least $k$. +-/ +@[category research open, AMS 5] +theorem erdos_614 : ∀ n k : ℕ, n ≥ k + 2 → + erdos614_f n k = answer(sorry) := by + sorry + +end Erdos614 diff --git a/FormalConjectures/ErdosProblems/615.lean b/FormalConjectures/ErdosProblems/615.lean new file mode 100644 index 0000000000..119efbfd30 --- /dev/null +++ b/FormalConjectures/ErdosProblems/615.lean @@ -0,0 +1,150 @@ +/- +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 615 + +*Reference:* [erdosproblems.com/615](https://www.erdosproblems.com/615) + +Does there exist some constant $c > 0$ such that if $G$ is a graph with $n$ vertices +and $\geq (1/8 - c)n^2$ edges then $G$ must contain either a $K_4$ or an independent set +on at least $n / \log n$ vertices? + +Equivalently, if $\mathrm{rt}(n; k, \ell)$ denotes the Ramsey-Turán number (maximum number of +edges in a $K_k$-free graph on $n$ vertices with independence number $< \ell$), the +question asks whether $\mathrm{rt}(n; 4, \lceil n / \log n \rceil) < (1/8 - c)n^2$ for some +$c > 0$. + +A problem of Erdős, Hajnal, Simonovits, Sós, and Szemerédi [Er91][EHSSS93]. + +Erdős, Hajnal, Sós, and Szemerédi [EHSS83] proved that for any fixed $\varepsilon > 0$, +$$\mathrm{rt}(n; 4, \varepsilon n) < (1/8 + o(1))n^2.$$ + +Sudakov [Su03] proved that $\mathrm{rt}(n; 4, n \cdot e^{-f(n)}) = o(n^2)$ whenever +$f(n)/\sqrt{\log n} \to \infty$. + +Disproved by Fox, Loh, and Zhao [FLZ15], who showed that +$\mathrm{rt}(n; 4, n \cdot e^{-f(n)}) \geq (1/8 - o(1))n^2$ +whenever $f(n) = o(\sqrt{\log n / \log \log n})$. + +See also Problem 22. + +**References:** + +[Er91] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. +Matematiche (Catania) 47 (1992), no. 2, 231-240 (1993). + +[EHSSS93] Erdős, P., Hajnal, A., Simonovits, M., Sós, V. T., and Szemerédi, E., +_Turán-Ramsey theorems and simple asymptotically extremal structures_. Combinatorica (1993), 31-56. + +[EHSS83] Erdős, P., Hajnal, A., Sós, V. T., and Szemerédi, E., +_More results on Ramsey-Turán type problems_. Combinatorica (1983), 69-81. + +[Su03] Sudakov, B., _A few remarks on Ramsey-Turán-type problems_. +J. Combin. Theory Ser. B (2003), 99-106. + +[FLZ15] Fox, J., Loh, P.-S., and Zhao, Y., _The critical window for the classical +Ramsey-Turán problem_. Combinatorica (2015), 435-476. +-/ + +open SimpleGraph Classical + +namespace Erdos615 + +/-- The Ramsey-Turán number $\mathrm{rt}(n; k, \ell)$: the maximum number of edges in a graph + on $n$ vertices that contains no $k$-clique and has no independent set of size + $\geq \ell$. Returns $0$ if no such graph exists. -/ +noncomputable def ramseyTuranNumber (n k ℓ : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + G.edgeFinset.card = m ∧ G.CliqueFree k ∧ + ∀ S : Finset (Fin n), G.IsIndepSet ↑S → S.card < ℓ} + +/-- +**Erdős Problem 615** (DISPROVED) [EHSSS93]: + +Does there exist $c > 0$ such that for all sufficiently large $n$, every graph $G$ +on $n$ vertices with at least $(1/8 - c)n^2$ edges contains either a $K_4$ or an +independent set of size at least $n / \log n$? + +Disproved by Fox, Loh, and Zhao [FLZ15]. +-/ +@[category research solved, AMS 5] +theorem erdos_615 : answer(False) ↔ + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (G.edgeFinset.card : ℝ) ≥ (1 / 8 - c) * (n : ℝ) ^ 2 → + (¬G.CliqueFree 4) ∨ + ∃ S : Finset (Fin n), (S.card : ℝ) ≥ (n : ℝ) / Real.log (n : ℝ) ∧ + G.IsIndepSet ↑S := by + sorry + +/-- +**Erdős-Hajnal-Sós-Szemerédi** [EHSS83]: + +For any fixed $\varepsilon > 0$, every $K_4$-free graph on $n$ vertices with independence +number $< \varepsilon n$ has fewer than $(1/8 + o(1))n^2$ edges. +-/ +@[category research solved, AMS 5] +theorem erdos_615.variants.EHSS (ε : ℝ) (hε : ε > 0) : + ∀ δ : ℝ, δ > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 4 → + (∀ S : Finset (Fin n), G.IsIndepSet ↑S → (S.card : ℝ) < ε * (n : ℝ)) → + (G.edgeFinset.card : ℝ) ≤ (1 / 8 + δ) * (n : ℝ) ^ 2 := by + sorry + +/-- +**Sudakov** [Su03]: + +$\mathrm{rt}(n; 4, n \cdot e^{-f(n)}) = o(n^2)$ whenever $f(n)/\sqrt{\log n} \to \infty$. +That is, for any function $f$ with $f(n)/\sqrt{\log n} \to \infty$, the number of edges +in any $K_4$-free graph on $n$ vertices with independence number $< n \cdot e^{-f(n)}$ +is $o(n^2)$. +-/ +@[category research solved, AMS 5] +theorem erdos_615.variants.Sudakov (f : ℕ → ℝ) + (hf : Filter.Tendsto (fun n : ℕ => f n / Real.sqrt (Real.log n)) + Filter.atTop Filter.atTop) : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 4 → + (∀ S : Finset (Fin n), G.IsIndepSet ↑S → + (S.card : ℝ) < (n : ℝ) * Real.exp (-f n)) → + (G.edgeFinset.card : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +/-- +**Fox-Loh-Zhao** [FLZ15]: + +$\mathrm{rt}(n; 4, n \cdot e^{-f(n)}) \geq (1/8 - o(1))n^2$ whenever +$f(n) = o(\sqrt{\log n / \log \log n})$. This is the key result disproving the conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_615.variants.FLZ (f : ℕ → ℝ) + (hf : Filter.Tendsto + (fun n : ℕ => f n / Real.sqrt (Real.log n / Real.log (Real.log n))) + Filter.atTop (nhds 0)) : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ G : SimpleGraph (Fin n), + G.CliqueFree 4 ∧ + (∀ S : Finset (Fin n), G.IsIndepSet ↑S → + (S.card : ℝ) < (n : ℝ) * Real.exp (-f n)) ∧ + (G.edgeFinset.card : ℝ) ≥ (1 / 8 - ε) * (n : ℝ) ^ 2 := by + sorry + +end Erdos615 diff --git a/FormalConjectures/ErdosProblems/616.lean b/FormalConjectures/ErdosProblems/616.lean new file mode 100644 index 0000000000..9d7258bce2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/616.lean @@ -0,0 +1,93 @@ +/- +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 616 + +*Reference:* [erdosproblems.com/616](https://www.erdosproblems.com/616) + +Let $r \geq 3$. For an $r$-uniform hypergraph $G$ let $\tau(G)$ denote the covering number +(or transversal number), the minimum size of a set of vertices which includes +at least one from each edge in $G$. + +Determine the best possible $t$ such that, if $G$ is an $r$-uniform hypergraph +where every subgraph $G'$ on at most $3r - 3$ vertices has $\tau(G') \leq 1$, we have +$\tau(G) \leq t$. + +[EHT91] Erdős, P., Hajnal, A., and Tuza, Zs., _Local constraints ensuring small representing +sets_. J. Combin. Theory Ser. A 58 (1991), 78-84. + +[Er99] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) (1999). +-/ + +open Finset + +namespace Erdos616 + +/-- An $r$-uniform hypergraph on vertex set `Fin n`. -/ +structure UniformHypergraph (n r : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = r + +/-- A set $S$ of vertices is a transversal of hypergraph $G$ if it meets every edge. -/ +def IsTransversal {n r : ℕ} (G : UniformHypergraph n r) (S : Finset (Fin n)) : Prop := + ∀ e ∈ G.edges, ∃ v ∈ S, v ∈ e + +/-- The covering number $\tau(G)$: the minimum size of a transversal. -/ +noncomputable def coveringNumber {n r : ℕ} (G : UniformHypergraph n r) : ℕ := + sInf {k : ℕ | ∃ S : Finset (Fin n), S.card = k ∧ IsTransversal G S} + +/-- The subhypergraph of $G$ induced on vertex set $W$: edges of $G$ contained in $W$. -/ +def inducedSub {n r : ℕ} (G : UniformHypergraph n r) (W : Finset (Fin n)) : + UniformHypergraph n r where + edges := G.edges.filter (· ⊆ W) + uniform := fun e he => G.uniform e (Finset.mem_filter.mp he).1 + +/-- The local covering property: every induced subhypergraph on at most +$3r - 3$ vertices has covering number at most $1$. -/ +def HasLocalCoveringProperty {n r : ℕ} (G : UniformHypergraph n r) : Prop := + ∀ W : Finset (Fin n), W.card ≤ 3 * r - 3 → coveringNumber (inducedSub G W) ≤ 1 + +/-- +Erdős Problem 616 — Upper bound [EHT91]: +If $G$ is an $r$-uniform hypergraph ($r \geq 3$) where every subhypergraph on at most +$3r - 3$ vertices has covering number $\leq 1$, then $\tau(G) \leq \frac{1}{5}r$. +-/ +@[category research solved, AMS 5] +theorem erdos_616 : + ∀ r : ℕ, 3 ≤ r → + ∀ n : ℕ, ∀ G : UniformHypergraph n r, + HasLocalCoveringProperty G → + (coveringNumber G : ℝ) ≤ (1 : ℝ) / 5 * (r : ℝ) := by + sorry + +/-- +Erdős Problem 616 — Lower bound [EHT91]: +For every $r \geq 3$, there exists an $r$-uniform hypergraph $G$ satisfying the local +covering property with $\tau(G) \geq \frac{3}{16}r + \frac{7}{8}$. +-/ +@[category research solved, AMS 5] +theorem erdos_616.variants.lower_bound : + ∀ r : ℕ, 3 ≤ r → + ∃ n : ℕ, ∃ G : UniformHypergraph n r, + HasLocalCoveringProperty G ∧ + (coveringNumber G : ℝ) ≥ (3 : ℝ) / 16 * (r : ℝ) + 7 / 8 := by + sorry + +end Erdos616 diff --git a/FormalConjectures/ErdosProblems/618.lean b/FormalConjectures/ErdosProblems/618.lean new file mode 100644 index 0000000000..7ef3e35017 --- /dev/null +++ b/FormalConjectures/ErdosProblems/618.lean @@ -0,0 +1,76 @@ +/- +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 618 + +*Reference:* [erdosproblems.com/618](https://www.erdosproblems.com/618) + +A problem of Erdős, Gyárfás, and Ruszinkó [EGR98]. Simonovits showed that there exist +graphs $G$ with maximum degree $\gg n^{1/2}$ and $h_2(G) \gg n^2$. Proved in the +affirmative by Alon [Al99]. This problem is essentially equivalent to Problem 134. + +See also: Problem 619. + +[EGR98] Erdős, P., Gyárfás, A. and Ruszinkó, M., *How to decrease the diameter of +triangle-free graphs*, Combinatorica **18** (1998), 493–501. + +[Er99] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Le Matematiche, 1999. + +[Al99] Alon, N., *Remark on a problem of Erdős*. +-/ + +open SimpleGraph + +namespace Erdos618 + +/-- `triangleFreeDiam2Completion G` is the minimum number of edges that must be added +to a triangle-free graph `G` on `Fin n` so that the resulting supergraph has +diameter at most $2$ and remains triangle-free. -/ +noncomputable def triangleFreeDiam2Completion {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf {k : ℕ | ∃ H : SimpleGraph (Fin n), G ≤ H ∧ + H.CliqueFree 3 ∧ + H.Connected ∧ + H.diam ≤ 2 ∧ + (H.edgeFinset \ G.edgeFinset).card = k} + +/-- +**Erdős Problem 618** [EGR98]: + +For a triangle-free graph $G$, let $h_2(G)$ be the smallest number of edges that need +to be added to $G$ so that it has diameter $2$ and is still triangle-free. If $G$ has +maximum degree $o(n^{1/2})$ then $h_2(G) = o(n^2)$. + +Formulated as: for every $\varepsilon > 0$, there exist $\delta > 0$ and $N_0$ such that +for all $n \geq N_0$, for every triangle-free graph $G$ on $n$ vertices with every vertex +having degree at most $\delta \cdot n^{1/2}$, we have $h_2(G) \leq \varepsilon \cdot n^2$. + +Proved by Alon. +-/ +@[category research solved, AMS 5] +theorem erdos_618 : + ∀ ε : ℝ, ε > 0 → + ∃ δ : ℝ, δ > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + (∀ v : Fin n, (G.degree v : ℝ) ≤ δ * (n : ℝ) ^ ((1 / 2 : ℝ))) → + (triangleFreeDiam2Completion G : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +end Erdos618 diff --git a/FormalConjectures/ErdosProblems/619.lean b/FormalConjectures/ErdosProblems/619.lean new file mode 100644 index 0000000000..a7010b0a21 --- /dev/null +++ b/FormalConjectures/ErdosProblems/619.lean @@ -0,0 +1,75 @@ +/- +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 619 + +*Reference:* [erdosproblems.com/619](https://www.erdosproblems.com/619) + +For a triangle-free graph $G$ let $h_r(G)$ be the smallest number of edges that +need to be added to $G$ so that it has diameter $r$ (while preserving the property +of being triangle-free). + +[EGR98] Erdős, P., Gyárfás, A. and Ruszinkó, M., *How to decrease the diameter of +triangle-free graphs*, Combinatorica **18** (1998), 493–501. + +[Er99] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Le Matematiche, 1999. + +[AGR00] Alon, N., Gyárfás, A. and Ruszinkó, M., *Decreasing the diameter of bounded +degree graphs*, J. Graph Theory **35** (2000), 161–172. + +See also Erdős Problems [#134](https://www.erdosproblems.com/134) and +[#618](https://www.erdosproblems.com/618). +-/ + +open SimpleGraph + +namespace Erdos619 + +/-- `triangleFreeDiamCompletion r G` is the minimum number of edges that must be added +to a triangle-free graph `G` on `Fin n` so that the resulting supergraph has +diameter at most $r$ and remains triangle-free. Returns $0$ if no such completion +exists (the set is empty and `sInf` defaults to $0$). -/ +noncomputable def triangleFreeDiamCompletion {n : ℕ} (r : ℕ) (G : SimpleGraph (Fin n)) : ℕ := + sInf {k : ℕ | ∃ H : SimpleGraph (Fin n), G ≤ H ∧ + H.CliqueFree 3 ∧ + H.Connected ∧ + H.diam ≤ r ∧ + (H.edgeFinset \ G.edgeFinset).card = k} + +/-- +**Erdős Problem 619** [EGR98]: + +Is it true that there exists a constant $c > 0$ such that for every connected +triangle-free graph $G$ on $n$ vertices, $h_4(G) < (1 - c) \cdot n$? + +A problem of Erdős, Gyárfás, and Ruszinkó [EGR98] who proved that $h_3(G) \leq n$ +and $h_5(G) \leq (n-1)/2$ and there exist connected graphs $G$ on $n$ vertices with +$h_3(G) \geq n - c$ for some constant $c > 0$. +-/ +@[category research open, AMS 5] +theorem erdos_619 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + G.Connected → + (triangleFreeDiamCompletion 4 G : ℝ) < (1 - c) * (n : ℝ) := by + sorry + +end Erdos619 diff --git a/FormalConjectures/ErdosProblems/62.lean b/FormalConjectures/ErdosProblems/62.lean new file mode 100644 index 0000000000..6d1b2b2fc9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/62.lean @@ -0,0 +1,111 @@ +/- +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 62 + +*Reference:* [erdosproblems.com/62](https://www.erdosproblems.com/62) + +If $G_1$ and $G_2$ are graphs with chromatic number $\aleph_1$, must they share a common +subgraph with infinite chromatic number? + +[EHS74] Erdős, P., Hajnal, A., and Shelah, S., _On some general properties of chromatic numbers_, +Topics in Topology, Colloq. Math. Soc. Janos Bolyai **8** (1974), 243–255. + +[Er87] Erdős, P., _Some problems on finite and infinite graphs_, Logic and combinatorics, +Contemp. Math. **65** (1987), 223–228. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er95d] Erdős, P., _Problems and results in discrete mathematics_, Discrete Math., 1995. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999. +-/ + +open SimpleGraph Cardinal + +namespace Erdos62 + +/-- $G$ contains $H$ as a subgraph via an injective adjacency-preserving map. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- +Erdős Problem 62 (strong version) [Er87]: + +If $G_1$, $G_2$ are two graphs with chromatic number $\aleph_1$, must there exist a graph $H$ +with infinite chromatic number ($\chi \geq \aleph_0$) which is a subgraph of both $G_1$ and $G_2$? + +This is the stronger form of the conjecture. Erdős also asked [Er87] about +finding such a common subgraph in any finite collection of graphs with +chromatic number $\aleph_1$. +-/ +@[category research open, AMS 5] +theorem erdos_62 : answer(sorry) ↔ + ∀ (V₁ : Type*) (V₂ : Type*) (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂), + G₁.chromaticCardinal = aleph 1 → + G₂.chromaticCardinal = aleph 1 → + ∃ (U : Type*) (H : SimpleGraph U), + H.chromaticNumber = ⊤ ∧ + ContainsSubgraph G₁ H ∧ + ContainsSubgraph G₂ H := by + sorry + +/-- +Erdős Problem 62 (weak version) [Er87]: + +If $G_1$, $G_2$ are two graphs with chromatic number $\aleph_1$, must there exist a graph $H$ +with chromatic number at least $4$ which is a subgraph of both $G_1$ and $G_2$? + +Every graph with chromatic number $\aleph_1$ contains all sufficiently large odd +cycles (chromatic number $3$), proved by Erdős, Hajnal, and Shelah [EHS74]. +Erdős wrote [Er87] that 'probably' every graph with chromatic number $\aleph_1$ +contains as subgraphs all graphs with chromatic number $4$ with sufficiently +large girth. +-/ +@[category research open, AMS 5] +theorem erdos_62.variants.weak : answer(sorry) ↔ + ∀ (V₁ : Type*) (V₂ : Type*) (G₁ : SimpleGraph V₁) (G₂ : SimpleGraph V₂), + G₁.chromaticCardinal = aleph 1 → + G₂.chromaticCardinal = aleph 1 → + ∃ (U : Type*) (H : SimpleGraph U), + ¬ H.Colorable 3 ∧ + ContainsSubgraph G₁ H ∧ + ContainsSubgraph G₂ H := by + sorry + +/-- +Erdős Problem 62 (finite collection variant) [Er87]: + +If $G_1, \ldots, G_n$ are finitely many graphs each with chromatic number $\aleph_1$, must +there exist a graph $H$ with infinite chromatic number which is a subgraph of every $G_i$? + +This is a strictly stronger form of the conjecture, mentioned by Erdős in [Er87]. +-/ +@[category research open, AMS 5] +theorem erdos_62.variants.finite_collection : answer(sorry) ↔ + ∀ (n : ℕ) (V : Fin n → Type*) (G : ∀ i, SimpleGraph (V i)), + (∀ i, (G i).chromaticCardinal = aleph 1) → + ∃ (U : Type*) (H : SimpleGraph U), + H.chromaticNumber = ⊤ ∧ + ∀ i, ContainsSubgraph (G i) H := by + sorry + +end Erdos62 diff --git a/FormalConjectures/ErdosProblems/620.lean b/FormalConjectures/ErdosProblems/620.lean new file mode 100644 index 0000000000..af0ee2ec4d --- /dev/null +++ b/FormalConjectures/ErdosProblems/620.lean @@ -0,0 +1,106 @@ +/- +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 620 + +*Reference:* [erdosproblems.com/620](https://www.erdosproblems.com/620) + +The Erdős-Rogers problem: If $G$ is a graph on $n$ vertices without a $K_4$, how large a +triangle-free induced subgraph must $G$ contain? + +Let $f(n)$ be the largest $m$ such that every $K_4$-free graph on $n$ vertices contains a +triangle-free induced subgraph with at least $m$ vertices. It is known that +$f(n) = n^{1/2+o(1)}$. + +The best bounds currently known are: +$$n^{1/2} \cdot (\log n)^{1/2} / \log(\log n) \ll f(n) \ll n^{1/2} \cdot \log n$$ + +The lower bound follows from results of Shearer [Sh95], and the upper bound was proved by +Mubayi and Verstraëte [MuVe24]. + +The precise asymptotic behaviour of $f(n)$ remains open. The formalized statements below +capture the known result $f(n) = n^{1/2+o(1)}$; the original Erdős-Rogers problem of +determining the precise asymptotics remains open. + +[ErRo62] Erdős, P. and Rogers, C.A., _The construction of certain graphs_. +Canadian Journal of Mathematics **14** (1962), 702-707. + +[BoHi91] Bollobás, B. and Hind, H.R., _Graphs without large triangle free subgraphs_. +Discrete Mathematics (1991), 119-131. + +[Kr94] Krivelevich, M., _$K^s$-free graphs without large $K^r$-free subgraphs_. +Combinatorics, Probability and Computing (1994), 349-354. + +[Sh95] Shearer, J.B., _On the independence number of sparse graphs_. +Random Structures and Algorithms (1995), 269-271. + +[Er99] Erdős, P. + +[Wo13] Wolfovitz, G., _$K_4$-free graphs without large induced triangle-free subgraphs_. +Combinatorica (2013), 623-631. + +[MuVe24] Mubayi, D. and Verstraëte, J., _On the order of Erdős-Rogers functions_. +arXiv:2401.02548 (2024). +-/ + +open SimpleGraph Finset + +namespace Erdos620 + +/-- +Erdős Problem 620 (lower bound direction of the Erdős-Rogers problem): +For all $\varepsilon > 0$, for sufficiently large $n$, every $K_4$-free graph on $n$ vertices +contains a triangle-free induced subgraph of size at least $n^{1/2 - \varepsilon}$. + +Together with `erdos_620.variants.upper`, this captures the known result +$f(n) = n^{1/2+o(1)}$. The original Erdős-Rogers problem of determining the precise +asymptotics of $f(n)$ remains open. + +[ErRo62], [Sh95] +-/ +@[category research solved, AMS 5] +theorem erdos_620 : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ (G : SimpleGraph (Fin n)), G.CliqueFree 4 → + ∃ (S : Finset (Fin n)), + (G.induce (↑S : Set (Fin n))).CliqueFree 3 ∧ + (S.card : ℝ) ≥ (n : ℝ) ^ ((1 : ℝ) / 2 - ε) := by + sorry + +/-- +Erdős Problem 620 (upper bound direction of the Erdős-Rogers problem): +For all $\varepsilon > 0$, for sufficiently large $n$, there exists a $K_4$-free graph on $n$ +vertices such that every triangle-free induced subgraph has at most $n^{1/2 + \varepsilon}$ +vertices. + +[MuVe24] +-/ +@[category research solved, AMS 5] +theorem erdos_620.variants.upper : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (G : SimpleGraph (Fin n)), + G.CliqueFree 4 ∧ + ∀ (S : Finset (Fin n)), + (G.induce (↑S : Set (Fin n))).CliqueFree 3 → + (S.card : ℝ) ≤ (n : ℝ) ^ ((1 : ℝ) / 2 + ε) := by + sorry + +end Erdos620 diff --git a/FormalConjectures/ErdosProblems/621.lean b/FormalConjectures/ErdosProblems/621.lean new file mode 100644 index 0000000000..567ed78136 --- /dev/null +++ b/FormalConjectures/ErdosProblems/621.lean @@ -0,0 +1,108 @@ +/- +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 621 + +*Reference:* [erdosproblems.com/621](https://www.erdosproblems.com/621) + +A problem of Erdős, Gallai, and Tuza on triangle-independent and triangle-transversal +edge sets in graphs. Proved by Norin and Sun. + +[EGT96] Erdős, P., Gallai, T., and Tuza, Z., _Covering and independence in triangle +structures_, Discrete Mathematics 150 (1996), 89-101. + +[NoSu16] Norin, S. and Sun, Y., _Triangle-independent sets vs. triangle-transversals_, +European Journal of Combinatorics 56 (2016), 95-104. +-/ + +open SimpleGraph + +namespace Erdos621 + +/-- Create an unordered pair from two vertices, representing an edge. -/ +abbrev mkEdge {V : Type*} (a b : V) : Sym2 V := Sym2.mk (a, b) + +/-- +A set of edges $S$ is triangle-independent in $G$ if $S \subseteq E(G)$ and every +triangle in $G$ contains at most one edge from $S$. +-/ +def IsTriangleIndependent {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (S : Finset (Sym2 (Fin n))) : Prop := + S ⊆ G.edgeFinset ∧ + ∀ a b c : Fin n, G.Adj a b → G.Adj b c → G.Adj a c → + ¬(mkEdge a b ∈ S ∧ mkEdge b c ∈ S) ∧ + ¬(mkEdge a b ∈ S ∧ mkEdge a c ∈ S) ∧ + ¬(mkEdge b c ∈ S ∧ mkEdge a c ∈ S) + +/-- +A set of edges $T$ is a triangle transversal in $G$ if $T \subseteq E(G)$ and every +triangle in $G$ contains at least one edge from $T$. +-/ +def IsTriangleTransversal {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (T : Finset (Sym2 (Fin n))) : Prop := + T ⊆ G.edgeFinset ∧ + ∀ a b c : Fin n, G.Adj a b → G.Adj b c → G.Adj a c → + mkEdge a b ∈ T ∨ mkEdge b c ∈ T ∨ mkEdge a c ∈ T + +/-- +**Erdős Problem 621** (Erdős-Gallai-Tuza conjecture) [EGT96]: + +Let $G$ be a graph on $n$ vertices. Define $\alpha_1(G)$ as the maximum number of edges +forming a set that contains at most one edge from every triangle, and $\tau_1(G)$ as +the minimum number of edges forming a set that contains at least one edge from +every triangle. + +Conjecture: $\alpha_1(G) + \tau_1(G) \leq n^2/4$. + +This was proved by Norin and Sun [NoSu16]. +-/ +@[category research solved, AMS 5] +theorem erdos_621 (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (S : Finset (Sym2 (Fin n))) + (hS : IsTriangleIndependent G S) + (hS_max : ∀ S' : Finset (Sym2 (Fin n)), IsTriangleIndependent G S' → S'.card ≤ S.card) + (T : Finset (Sym2 (Fin n))) + (hT : IsTriangleTransversal G T) + (hT_min : ∀ T' : Finset (Sym2 (Fin n)), IsTriangleTransversal G T' → T.card ≤ T'.card) : + 4 * (S.card + T.card) ≤ n ^ 2 := by + sorry + +/-- +**Erdős Problem 621 — Stronger Norin–Sun result** [NoSu16]: + +Norin and Sun proved a stronger version of the Erdős–Gallai–Tuza conjecture: +$\alpha_1(G) + \tau_B(G) \leq n^2/4$, where $\tau_B(G)$ is the minimum number of edges +whose removal makes $G$ bipartite. This is strictly stronger than the original conjecture +since $\tau_1(G) \leq \tau_B(G)$ (every set of edges whose removal makes $G$ bipartite +is in particular a triangle transversal). +-/ +@[category research solved, AMS 5] +theorem erdos_621_stronger (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (S : Finset (Sym2 (Fin n))) + (hS : IsTriangleIndependent G S) + (hS_max : ∀ S' : Finset (Sym2 (Fin n)), IsTriangleIndependent G S' → S'.card ≤ S.card) + (T : Finset (Sym2 (Fin n))) + (hT_sub : ↑T ⊆ G.edgeSet) + (hT_bip : (G.deleteEdges ↑T).IsBipartite) + (hT_min : ∀ T' : Finset (Sym2 (Fin n)), + ↑T' ⊆ G.edgeSet → (G.deleteEdges ↑T').IsBipartite → T.card ≤ T'.card) : + 4 * (S.card + T.card) ≤ n ^ 2 := by + sorry + +end Erdos621 diff --git a/FormalConjectures/ErdosProblems/622.lean b/FormalConjectures/ErdosProblems/622.lean new file mode 100644 index 0000000000..f1a599cad2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/622.lean @@ -0,0 +1,79 @@ +/- +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 622 + +*Reference:* [erdosproblems.com/622](https://www.erdosproblems.com/622) + +Let $G$ be a regular graph with $2n$ vertices and degree $n+1$. Must $G$ have $\gg 2^{2n}$ +subsets that are spanned by a cycle? + +A problem of Erdős and Faudree [Er99]. Erdős writes 'it is easy to see' that +there are at least $(1/2 + o(1))2^{2n}$ sets that are NOT on a cycle. + +If the regularity condition is replaced by minimum degree $n+1$ then the answer is +no (consider $K_{n,n}$ with a spanning star in each part). Similarly this is false +with degree $n$, as $K_{n,n}$ shows. + +This has been resolved by Draganić, Keevash, and Müyesser [DKM25], who prove the +asymptotically tight result that there are at least $(1/2 + o(1))2^{2n}$ subsets +which are spanned by a cycle. + +[Er99] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Le Matematiche, 1999. + +[DKM25] Draganić, N., Keevash, P., Müyesser, A., *Cyclic subsets in regular Dirac graphs*, +arXiv:2503.01826 (2025). +-/ + +open scoped Classical +open SimpleGraph Finset + +namespace Erdos622 + +/-- A subset $S$ of vertices is *spanned by a cycle* in $G$ if there exists + a cycle in $G$ whose vertex set is exactly $S$. -/ +def IsSpannedByCycle {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + ∃ v ∈ S, ∃ p : G.Walk v v, p.IsCycle ∧ p.support.toFinset = S + +/-- The number of subsets of vertices spanned by a cycle in a graph on $2n$ vertices. -/ +noncomputable def numCycleSpannedSubsets (n : ℕ) + (G : SimpleGraph (Fin (2 * n))) : ℕ := + ((Finset.univ : Finset (Fin (2 * n))).powerset.filter (IsSpannedByCycle G)).card + +/-- +**Erdős Problem 622** [Er99]: + +Let $G$ be a $(n+1)$-regular graph on $2n$ vertices. Then for any $\varepsilon > 0$ and +sufficiently large $n$, $G$ has at least $(1/2 - \varepsilon) \cdot 2^{2n}$ subsets that are +spanned by a cycle. + +Proved by Draganić, Keevash, and Müyesser [DKM25]. +-/ +@[category research solved, AMS 5] +theorem erdos_622 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ G : SimpleGraph (Fin (2 * n)), + G.IsRegularOfDegree (n + 1) → + (numCycleSpannedSubsets n G : ℝ) ≥ (1 / 2 - ε) * (2 : ℝ) ^ (2 * n) := by + sorry + +end Erdos622 diff --git a/FormalConjectures/ErdosProblems/625.lean b/FormalConjectures/ErdosProblems/625.lean new file mode 100644 index 0000000000..b537a8ecad --- /dev/null +++ b/FormalConjectures/ErdosProblems/625.lean @@ -0,0 +1,69 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 625 + +*Reference:* [erdosproblems.com/625](https://www.erdosproblems.com/625) + +The cochromatic number of $G$, denoted by $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either a +complete graph or an empty graph. Let $\chi(G)$ denote the chromatic number. + +If $G$ is a random graph with $n$ vertices and each edge included independently with +probability $1/2$, is it true that almost surely +$$\chi(G) - \zeta(G) \to \infty$$ +as $n \to \infty$? + +[ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*, 1993. +-/ + +open SimpleGraph Finset + +namespace Erdos625 + +/-- The simple graph on `Fin n` determined by a Boolean edge matrix. Under $G(n, 1/2)$, +each Boolean matrix is equally likely, so the fraction of matrices whose graph +has a property equals the $G(n, 1/2)$-probability of that property. -/ +def toGraph625 {n : ℕ} (ec : Fin n → Fin n → Bool) : SimpleGraph (Fin n) where + Adj u v := u ≠ v ∧ ec (min u v) (max u v) = true + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, by rwa [min_comm, max_comm]⟩ + loopless := fun v ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 625 [ErGi93]: + +In the Erdős–Rényi random graph $G(n, 1/2)$ — the uniform distribution over all +labelled simple graphs on $n$ vertices — is it true that the difference +$\chi(G) - \zeta(G)$ tends to infinity almost surely as $n \to \infty$? + +Equivalently: for every $M \in \mathbb{N}$ and $\varepsilon > 0$, there exists $n_0$ such +that for all $n \geq n_0$, the fraction of graphs on `Fin n` with +$\chi(G) - \zeta(G) \geq M$ is at least $1 - \varepsilon$. +-/ +@[category research open, AMS 5 60] +theorem erdos_625 : answer(sorry) ↔ + ∀ M : ℕ, ∀ ε : ℝ, ε > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ((Finset.univ.filter (fun ec : Fin n → Fin n → Bool => + χ(toGraph625 ec).toNat - (cochromaticNumber (toGraph625 ec)).toNat ≥ M)).card : ℝ) ≥ + (1 - ε) * (Fintype.card (Fin n → Fin n → Bool) : ℝ) := by + sorry + +end Erdos625 diff --git a/FormalConjectures/ErdosProblems/626.lean b/FormalConjectures/ErdosProblems/626.lean new file mode 100644 index 0000000000..63276c28f9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/626.lean @@ -0,0 +1,130 @@ +/- +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 626 + +*Reference:* [erdosproblems.com/626](https://www.erdosproblems.com/626) + +Let $k \geq 4$ and $g_k(n)$ denote the largest $m$ such that there is a graph on $n$ vertices +with chromatic number $k$ and girth $> m$. Does +$$ + \lim_{n \to \infty} g_k(n) / \log n +$$ +exist? + +Conversely, if $h^{(m)}(n)$ is the maximal chromatic number of a graph on $n$ vertices +with girth $> m$ then does +$$ + \lim_{n \to \infty} \log h^{(m)}(n) / \log n +$$ +exist, and what is its value? + +[Er59b] Erdős, P., _Graph theory and probability_, Canad. J. Math. **11** (1959), 34–38. + +[Er62b] Erdős, P., _On circuits and subgraphs of chromatic graphs_, Mathematika **9** (1962), +170–175. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_, 1969. + +[Ko88] Kostochka, A.V., _The minimum Hadwiger number for graphs with a given mean degree of +vertices_, Metody Diskret. Analiz. **38** (1988), 37–58. +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos626 + +/-- $g_k(n)$ is the largest $m$ such that there exists a graph on $n$ vertices + with chromatic number $k$ and girth $> m$. Returns $0$ if no such graph exists. -/ +noncomputable def g (k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), G.chromaticNumber = k ∧ m < G.girth} + +/-- $h^{(m)}(n)$ is the maximal chromatic number of a graph on $n$ vertices + with girth $> m$. -/ +noncomputable def h (m n : ℕ) : ℕ := + sSup {k : ℕ | ∃ G : SimpleGraph (Fin n), G.chromaticNumber = k ∧ m < G.girth} + +/-- +**Erdős Problem 626, Part 1** [Er59b][Er62b][Er69b]: + +For $k \geq 4$, does the limit $\lim_{n \to \infty} g_k(n) / \log n$ exist? + +It is known that +$$ + \frac{1}{4 \log k} \log n \leq g_k(n) \leq \frac{2}{\log(k-2)} \log n + 1, +$$ +the lower bound due to Kostochka [Ko88] and the upper bound to Erdős [Er59b]. +-/ +@[category research open, AMS 5] +theorem erdos_626 : answer(sorry) ↔ + ∀ k : ℕ, k ≥ 4 → ∃ L : ℝ, + Tendsto (fun n : ℕ => (g k n : ℝ) / Real.log (n : ℝ)) atTop (nhds L) := by + sorry + +/-- +**Erdős Problem 626, Part 2** [Er59b][Er62b][Er69b]: + +For $m \geq 1$, does the limit $\lim_{n \to \infty} \log h^{(m)}(n) / \log n$ exist, +and what is its value? + +Erdős [Er59b] proved that +$$ + \lim_{n \to \infty} \frac{\log h^{(m)}(n)}{\log n} \gg \frac{1}{m} +$$ +and, for odd $m$, +$$ + \lim_{n \to \infty} \frac{\log h^{(m)}(n)}{\log n} \leq \frac{2}{m+1}, +$$ +and conjectured this is sharp. +-/ +@[category research open, AMS 5] +theorem erdos_626.variants.maximal_chromatic : answer(sorry) ↔ + ∀ m : ℕ, m ≥ 1 → ∃ L : ℝ, + Tendsto (fun n : ℕ => Real.log (h m n : ℝ) / Real.log (n : ℝ)) atTop (nhds L) := by + sorry + +/-- +**Erdős Problem 626, Odd sharpness variant** [Er59b]: + +For odd $m$, Erdős proved $\lim_{n \to \infty} \log h^{(m)}(n) / \log n \leq \frac{2}{m+1}$ +and conjectured this bound is sharp, i.e., the limit equals $\frac{2}{m+1}$. +-/ +@[category research open, AMS 5] +theorem erdos_626.variants.odd_sharpness : + ∀ m : ℕ, Odd m → ∃ L : ℝ, + Tendsto (fun n : ℕ => Real.log (h m n : ℝ) / Real.log (n : ℝ)) atTop (nhds L) ∧ + L = 2 / (m + 1 : ℝ) := by + sorry + +/-- +**Erdős Problem 626, Even $m$ variant** [Er59b]: + +For even $m$, Erdős suspected the limit $\lim_{n \to \infty} \log h^{(m)}(n) / \log n$ +lies in the interval $\left[\frac{2}{m+2}, \frac{2}{m}\right]$. +-/ +@[category research open, AMS 5] +theorem erdos_626.variants.even_bounds : + ∀ m : ℕ, Even m → 0 < m → ∃ L : ℝ, + Tendsto (fun n : ℕ => Real.log (h m n : ℝ) / Real.log (n : ℝ)) atTop (nhds L) ∧ + 2 / (m + 2 : ℝ) ≤ L ∧ L ≤ 2 / (m : ℝ) := by + sorry + +end Erdos626 diff --git a/FormalConjectures/ErdosProblems/627.lean b/FormalConjectures/ErdosProblems/627.lean new file mode 100644 index 0000000000..e09871b33e --- /dev/null +++ b/FormalConjectures/ErdosProblems/627.lean @@ -0,0 +1,74 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Clique +import Mathlib.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 627 + +*Reference:* [erdosproblems.com/627](https://www.erdosproblems.com/627) + +Let $\omega(G)$ denote the clique number of $G$ and $\chi(G)$ the chromatic number. If $f(n)$ is the +maximum value of $\chi(G)/\omega(G)$, as $G$ ranges over all graphs on $n$ vertices, then does +$$\lim_{n \to \infty} \frac{f(n)}{n / (\log_2 n)^2}$$ +exist? + +Erdős [Er67c] proved that $f(n) \asymp n / (\log_2 n)^2$ and that the limit, if it exists, +must be in $[1/4, 4]$. + +[Er61d] Erdős, P., _Graph theory and probability. II_. Canadian Journal of Mathematics (1961), +346–352. + +[Er67c] Erdős, P., _Some remarks on chromatic graphs_. Colloquium Mathematicum (1967), 253–256. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_, 1969. + +[Zy52] Zykov, A. A., _On some properties of linear complexes_. American Mathematical Society +Translation (1952), 33. + +[AFM25] Araujo, I., Filipe, R., Miyazaki, R., _A note on the maximum ratio between chromatic +number and clique number_. arXiv:2502.16062 (2025). +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos627 + +/-- $f_{627}(n)$ is the maximum of $\chi(G)/\omega(G)$ over all simple graphs $G$ +on $n$ vertices. -/ +noncomputable def f627 (n : ℕ) : ℝ := + sSup {r : ℝ | ∃ G : SimpleGraph (Fin n), + G.cliqueNum > 0 ∧ + r = (G.chromaticNumber.toNat : ℝ) / (G.cliqueNum : ℝ)} + +/-- +**Erdős Problem 627** [Er61d][Er67c][Er69b]: + +Does the limit $\lim_{n \to \infty} f(n) / (n / (\log_2 n)^2)$ exist, where $f(n)$ is the maximum +of $\chi(G)/\omega(G)$ over all graphs $G$ on $n$ vertices? +-/ +@[category research open, AMS 5] +theorem erdos_627 : answer(sorry) ↔ + ∃ L : ℝ, Tendsto + (fun n : ℕ => f627 n / ((n : ℝ) / (Real.logb 2 (n : ℝ)) ^ 2)) + atTop (nhds L) := by + sorry + +end Erdos627 diff --git a/FormalConjectures/ErdosProblems/628.lean b/FormalConjectures/ErdosProblems/628.lean new file mode 100644 index 0000000000..3279759a1b --- /dev/null +++ b/FormalConjectures/ErdosProblems/628.lean @@ -0,0 +1,60 @@ +/- +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 628 + +*Reference:* [erdosproblems.com/628](https://www.erdosproblems.com/628) + +Also known as the Erdős–Lovász Tihany conjecture. + +[Er68b] Erdős, P., _On chromatic number of graphs and set-systems_ (1968). + +[BrJu69] Brown, W. G. and Jung, H. A., _On odd circuits in chromatic graphs_. +Acta Math. Acad. Sci. Hungar. (1969), 129-134. + +[BKPS09] Balogh, J., Kostochka, A. V., Prince, N., and Stiebitz, M., +_The Erdős–Lovász Tihany conjecture for quasi-line graphs_. +Discrete Math. (2009), 3985-3991. + +[So22] Song, Z.-X., _A survey on the Erdős–Lovász Tihany conjecture_. +Adv. Math. (China) (2022), 259–274. +-/ + +open SimpleGraph + +namespace Erdos628 + +/-- +Erdős Problem 628 (Erdős–Lovász Tihany Conjecture) [Er68b]: + +Let $G$ be a graph with chromatic number $k$ containing no complete graph $K_k$. +If $a, b \geq 2$ and $a + b = k + 1$, then there exist two vertex-disjoint induced +subgraphs of $G$ with chromatic numbers $\geq a$ and $\geq b$ respectively. +-/ +@[category research open, AMS 5] +theorem erdos_628 {V : Type*} (G : SimpleGraph V) + (k : ℕ) (hk : G.chromaticNumber = k) + (hclique : G.CliqueFree k) + (a b : ℕ) (ha : a ≥ 2) (hb : b ≥ 2) (hab : a + b = k + 1) : + ∃ (S T : Set V), Disjoint S T ∧ + (G.induce S).chromaticNumber ≥ a ∧ + (G.induce T).chromaticNumber ≥ b := by + sorry + +end Erdos628 diff --git a/FormalConjectures/ErdosProblems/629.lean b/FormalConjectures/ErdosProblems/629.lean new file mode 100644 index 0000000000..8b3bef503e --- /dev/null +++ b/FormalConjectures/ErdosProblems/629.lean @@ -0,0 +1,103 @@ +/- +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 629 + +*Reference:* [erdosproblems.com/629](https://www.erdosproblems.com/629) + +Determine the minimal number of vertices $n(k)$ of a bipartite graph $G$ such that +the list chromatic number $\chi_L(G) > k$. + +A problem of Erdős, Rubin, and Taylor [ERT80], who proved that +$2^{k-1} < n(k) < k^2 \cdot 2^{k+2}$ +and $n(2) = 6$. Hanson, MacGillivray, and Toft [HMT96] proved $n(3) = 14$. + +[ERT80] Erdős, P., Rubin, A. L., and Taylor, H., _Choosability in graphs_, +Proc. West Coast Conf. on Combinatorics, Graph Theory and Computing, +Congressus Numerantium XXVI (1980), 125-157. + +[HMT96] Hanson, D., MacGillivray, G., and Toft, B., _Choosability of bipartite graphs_, +Ars Combinatoria 44 (1996), 183-192. + +[RaSr00] Radhakrishnan, J. and Srinivasan, A., _Improved bounds and algorithms for +hypergraph 2-coloring_, Random Structures & Algorithms (2000), 4-32. +-/ + +open SimpleGraph + +namespace Erdos629 + +/-- A proper list coloring of $G$ with respect to a list assignment $L : V \to \text{Finset}\ \mathbb{N}$ +is a function $f : V \to \mathbb{N}$ such that $f(v) \in L(v)$ for all $v$, and $f(u) \neq f(v)$ +whenever $u$ and $v$ are adjacent. -/ +def IsProperListColoring {V : Type*} (G : SimpleGraph V) (L : V → Finset ℕ) + (f : V → ℕ) : Prop := + (∀ v, f v ∈ L v) ∧ (∀ u v, G.Adj u v → f u ≠ f v) + +/-- A graph $G$ is $k$-choosable ($k$-list-colorable) if for every list assignment $L$ +where each vertex receives a list of at least $k$ colors, there exists a +proper list coloring. -/ +def IsChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, k ≤ (L v).card) → + ∃ f : V → ℕ, IsProperListColoring G L f + +/-- The list chromatic number (choice number) of a graph $G$: the minimum $k$ +such that $G$ is $k$-choosable. -/ +noncomputable def listChromaticNumber {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | IsChoosable G k} + +/-- $n(k)$: the minimum number of vertices of a bipartite graph with list +chromatic number greater than $k$. -/ +noncomputable def erdos629_n (k : ℕ) : ℕ := + sInf {n : ℕ | ∃ G : SimpleGraph (Fin n), + G.IsBipartite ∧ listChromaticNumber G > k} + +/-- +Erdős Problem 629, lower bound [ERT80]: +$2^{k-1} < n(k)$ for all $k \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_629 (k : ℕ) (hk : k ≥ 1) : + erdos629_n k > 2 ^ (k - 1) := by + sorry + +/-- +Erdős Problem 629, upper bound [ERT80]: +$n(k) < k^2 \cdot 2^{k+2}$ for all $k \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.upper_bound (k : ℕ) (hk : k ≥ 1) : + erdos629_n k < k ^ 2 * 2 ^ (k + 2) := by + sorry + +/-- +Erdős Problem 629 [ERT80]: $n(2) = 6$. +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.n2 : erdos629_n 2 = 6 := by + sorry + +/-- +Erdős Problem 629 [HMT96]: $n(3) = 14$. +-/ +@[category research solved, AMS 5] +theorem erdos_629.variants.n3 : erdos629_n 3 = 14 := by + sorry + +end Erdos629 diff --git a/FormalConjectures/ErdosProblems/63.lean b/FormalConjectures/ErdosProblems/63.lean new file mode 100644 index 0000000000..4e13652c71 --- /dev/null +++ b/FormalConjectures/ErdosProblems/63.lean @@ -0,0 +1,70 @@ +/- +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 63 + +*Reference:* [erdosproblems.com/63](https://www.erdosproblems.com/63) + +Does every graph with infinite chromatic number contain a cycle of length $2^n$ for +infinitely many $n$? Proved by Liu and Montgomery [LiMo20]. See also Problem #64. + +[Er93, p.342] [Er94b] [Er95] [Er95d] [Er96] [Er97b] Various papers by Erdős where this +problem appears. + +[ErHa66] Erdős, P. and Hajnal, A., _On chromatic number of graphs and set-systems_. +Acta Math. Acad. Sci. Hungar. **17** (1966), 61–99. + +[LiMo20] Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_. +J. Amer. Math. Soc. **36** (2023), 1191–1234. +-/ + +open SimpleGraph + +namespace Erdos63 + +/-- +Erdős Problem 63 (Conjectured by Mihók and Erdős [Er93,Er94b,Er95,Er95d,Er96,Er97b]): +Does every graph with infinite chromatic number contain a cycle of length $2^n$ for +infinitely many $n$? Proved by Liu and Montgomery [LiMo20]. + +Formalized as: for every graph $G$ with infinite chromatic number, for every bound $N$, +there exists $n \geq N$ such that $G$ contains a cycle of length $2^n$. +-/ +@[category research solved, AMS 5] +theorem erdos_63 : answer(True) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + G.chromaticNumber = ⊤ → + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = 2 ^ n := by + sorry + +/-- +Variant of Erdős Problem 63: Can $2^n$ be replaced by $n^2$ (or any sufficiently rapidly +growing sequence)? The website notes that the exponent $2^n$ might be replaceable by other +rapidly growing sequences such as perfect squares. +-/ +@[category research open, AMS 5] +theorem erdos_63_variant_squares : answer(sorry) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + G.chromaticNumber = ⊤ → + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n ^ 2 := by + sorry + +end Erdos63 diff --git a/FormalConjectures/ErdosProblems/630.lean b/FormalConjectures/ErdosProblems/630.lean new file mode 100644 index 0000000000..615d1fae39 --- /dev/null +++ b/FormalConjectures/ErdosProblems/630.lean @@ -0,0 +1,71 @@ +/- +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 630 + +*Reference:* [erdosproblems.com/630](https://www.erdosproblems.com/630) + +Erdős, Rubin, and Taylor asked whether every planar bipartite graph is 3-choosable +(i.e., 3-list-colorable). This was proved by Alon and Tarsi. + +[ERT80] Erdős, P., Rubin, A. L., and Taylor, H., _Choosability in graphs_. +Proc. West Coast Conf. on Combinatorics, Graph Theory and Computing, +Congressus Numerantium XXVI (1980), 125-157. + +[AlTa92] Alon, N. and Tarsi, M., _Colorings and orientations of graphs_. Combinatorica 12 +(1992), 125-134. +-/ + +open SimpleGraph + +namespace Erdos630 + +/-- A proper list coloring of $G$ with respect to a list assignment $L : V \to \text{Finset}\ \mathbb{N}$ +is a function $f : V \to \mathbb{N}$ such that $f(v) \in L(v)$ for all $v$, and $f(u) \neq f(v)$ +whenever $u$ and $v$ are adjacent. -/ +def IsProperListColoring {V : Type*} (G : SimpleGraph V) (L : V → Finset ℕ) + (f : V → ℕ) : Prop := + (∀ v, f v ∈ L v) ∧ (∀ u v, G.Adj u v → f u ≠ f v) + +/-- A graph $G$ is $k$-choosable ($k$-list-colorable) if for every list assignment $L$ +where each vertex receives a list of at least $k$ colors, there exists a +proper list coloring. -/ +def IsChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, k ≤ (L v).card) → + ∃ f : V → ℕ, IsProperListColoring G L f + +/-- A graph is planar if it can be embedded in the plane without edge crossings. +Mathlib does not yet have a formalization of graph planarity; we axiomatize it +here as an opaque predicate. -/ +opaque IsPlanar {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop + +/-- +Erdős Problem 630 [ERT80]: + +Every planar bipartite graph $G$ is $3$-choosable, i.e., $\chi_L(G) \leq 3$. + +Proved by Alon and Tarsi [AlTa92]. +-/ +@[category research solved, AMS 5] +theorem erdos_630 {V : Type*} [Fintype V] (G : SimpleGraph V) + (hplanar : IsPlanar G) (hbip : G.Colorable 2) : + IsChoosable G 3 := by + sorry + +end Erdos630 diff --git a/FormalConjectures/ErdosProblems/631.lean b/FormalConjectures/ErdosProblems/631.lean new file mode 100644 index 0000000000..74ac6693d7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/631.lean @@ -0,0 +1,92 @@ +/- +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 631 + +*Reference:* [erdosproblems.com/631](https://www.erdosproblems.com/631) + +The list chromatic number $\chi_L(G)$ is defined to be the minimal $k$ such that for any +assignment of a list of $k$ colours to each vertex of $G$ (perhaps different lists for +different vertices) a colouring of each vertex by a colour on its list can be chosen +such that adjacent vertices receive distinct colours. + +A problem of Erdős, Rubin, and Taylor [ERT80]. Thomassen [Th94] proved that +$\chi_L(G) \leq 5$ if $G$ is planar, and Voigt [Vo93] constructed a planar graph +with $\chi_L(G) = 5$. + +[ERT80] Erdős, P., Rubin, A. L., and Taylor, H., _Choosability in graphs_. +Proceedings of the West Coast Conference on Combinatorics, Graph Theory and +Computing, Humboldt State Univ., Arcata, Calif. (1980), 125–157. + +[Th94] Thomassen, C., _Every planar graph is 5-choosable_. +Journal of Combinatorial Theory, Series B 62 (1994), 180–181. + +[Vo93] Voigt, M., _List colourings of planar graphs_. +Discrete Mathematics 120 (1993), 215–219. + +[Gu96] Gutner, S., _The complexity of planar graph choosability_. +Discrete Mathematics (1996), 119–130. +-/ + +open SimpleGraph + +namespace Erdos631 + +/-- A proper list coloring of $G$ with respect to a list assignment $L : V \to \text{Finset}\ \mathbb{N}$ +is a function $f : V \to \mathbb{N}$ such that $f(v) \in L(v)$ for all $v$, and $f(u) \neq f(v)$ +whenever $u$ and $v$ are adjacent. -/ +def IsProperListColoring {V : Type*} (G : SimpleGraph V) (L : V → Finset ℕ) + (f : V → ℕ) : Prop := + (∀ v, f v ∈ L v) ∧ (∀ u v, G.Adj u v → f u ≠ f v) + +/-- A graph $G$ is $k$-choosable ($k$-list-colorable) if for every list assignment $L$ +where each vertex receives a list of at least $k$ colors, there exists a +proper list coloring. -/ +def IsChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, k ≤ (L v).card) → + ∃ f : V → ℕ, IsProperListColoring G L f + +/-- A graph is planar if it can be embedded in the plane without edge crossings. +Mathlib does not yet have a formalization of graph planarity; we define it +here as an opaque predicate. -/ +opaque IsPlanar {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop + +/-- +Erdős Problem 631, Part 1 (Thomassen's theorem [Th94]): + +Every planar graph $G$ is 5-choosable, i.e., $\chi_L(G) \leq 5$. +-/ +@[category research solved, AMS 5] +theorem erdos_631 : answer(True) ↔ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V), IsPlanar G → IsChoosable G 5 := by + sorry + +/-- +Erdős Problem 631, Part 2 (Voigt's construction [Vo93]): + +There exists a planar graph that is not 4-choosable, showing that 5 is best possible. +-/ +@[category research solved, AMS 5] +theorem erdos_631.variants.tight : answer(True) ↔ + ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), + IsPlanar G ∧ ¬IsChoosable G 4 := by + sorry + +end Erdos631 diff --git a/FormalConjectures/ErdosProblems/632.lean b/FormalConjectures/ErdosProblems/632.lean new file mode 100644 index 0000000000..d6e6a3f7a2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/632.lean @@ -0,0 +1,68 @@ +/- +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 632 + +Erdős, Rubin, and Taylor asked whether $(a,b)$-choosability of a graph implies +$(am,bm)$-choosability for every positive integer $m$. Dvořák, Hu, and Sereni disproved this +by constructing a 4-choosable graph that is not $(8,2)$-choosable. + +*Reference:* [erdosproblems.com/632](https://www.erdosproblems.com/632) + +[ERT80] Erdős, P., Rubin, A.L., and Taylor, H., *Choosability in graphs*, Proceedings of the +West Coast Conference on Combinatorics, Graph Theory and Computing, Congressus Numerantium 26 +(1980), 125-157. + +[DHS19] Dvořák, Z., Hu, X., and Sereni, J.-S., *A 4-choosable graph that is not +(8:2)-choosable*, Advances in Combinatorics (2019). +-/ + +open SimpleGraph + +namespace Erdos632 + +/-- A graph $G$ is $(a,b)$-choosable if for every assignment $L$ of a list of at least $a$ +colors to each vertex, there exists a choice of a subset $S(v) \subseteq L(v)$ of size $b$ +for each vertex $v$, such that the chosen subsets of adjacent vertices are disjoint. -/ +def IsABChoosable {V : Type*} (G : SimpleGraph V) (a b : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, a ≤ (L v).card) → + ∃ S : V → Finset ℕ, (∀ v, S v ⊆ L v) ∧ (∀ v, (S v).card = b) ∧ + (∀ u v, G.Adj u v → Disjoint (S u) (S v)) + +/-- +Erdős Problem 632 [ERT80] (disproved by Dvořák, Hu, and Sereni [DHS19]): +If $G$ is $(a,b)$-choosable then $G$ is $(am, bm)$-choosable for every positive integer $m$. +-/ +@[category research solved, AMS 5] +theorem erdos_632 : answer(False) ↔ ∀ (V : Type*) (G : SimpleGraph V) (a b m : ℕ), + 1 ≤ m → IsABChoosable G a b → IsABChoosable G (a * m) (b * m) := by + sorry + +/-- +Dvořák, Hu, and Sereni [DHS19] constructed a specific counterexample: a graph that is +4-choosable (i.e., (4,1)-choosable) but not (8,2)-choosable, disproving the conjecture +of Erdős, Rubin, and Taylor [ERT80] for the case $m = 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_632_counterexample : answer(True) ↔ + ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), + IsABChoosable G 4 1 ∧ ¬IsABChoosable G 8 2 := by + sorry + +end Erdos632 diff --git a/FormalConjectures/ErdosProblems/633.lean b/FormalConjectures/ErdosProblems/633.lean new file mode 100644 index 0000000000..91b9b9f382 --- /dev/null +++ b/FormalConjectures/ErdosProblems/633.lean @@ -0,0 +1,169 @@ +/- +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 633 + +*Reference:* [erdosproblems.com/633](https://www.erdosproblems.com/633) + +Classify those triangles which can only be cut into a square number of congruent +triangles. **$25 reward.** + +Any triangle can be cut into $n^2$ congruent triangles for any $n \geq 1$ [So09]. +Soifer [So09c] reported Erdős's question and proved that there exists at least one +triangle (e.g. one with sides $\sqrt{2}$, $\sqrt{3}$, $\sqrt{4}$) which can only be cut +into a square number of congruent triangles. In fact, Soifer [So09b] proved that any +triangle for which the angles and sides are both integrally independent has this property. +The full classification remains open. + +See also Problem 634 for related results on which numbers $n$ admit a congruent dissection +of an equilateral triangle. + +[So09] Soifer, A., *How Does One Cut a Triangle? I*, The Mathematical Coloring Book, +Springer, 2009, pp. 15–23. +[So09b] Soifer, A., *How Does One Cut a Triangle? II*, The Mathematical Coloring Book, +Springer, 2009, pp. 37–39. +[So09c] Soifer, A., *Is There Anything Beyond the Solution?*, The Mathematical Coloring +Book, Springer, 2009, pp. 47–50. +-/ + +namespace Erdos633 + +/-- Squared Euclidean distance between two points in $\mathbb{R}^2$. -/ +noncomputable def sqDist (p q : ℝ × ℝ) : ℝ := + (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 + +/-- Multiset of squared side lengths of a triangle. +Two triangles are congruent (by SSS) iff these multisets agree. -/ +noncomputable def sideLengthsSq (A B C : ℝ × ℝ) : Multiset ℝ := + ↑[sqDist A B, sqDist B C, sqDist A C] + +/-- A triangle is non-degenerate (vertices not collinear). -/ +def NonDegenerate (A B C : ℝ × ℝ) : Prop := + (B.1 - A.1) * (C.2 - A.2) - (C.1 - A.1) * (B.2 - A.2) ≠ 0 + +/-- The closed triangular region: convex hull of vertices $A$, $B$, $C$. +A point $p$ lies in the triangle iff $p = \alpha A + \beta B + \gamma C$ for some +$\alpha, \beta, \gamma \geq 0$ with $\alpha + \beta + \gamma = 1$. -/ +def triangleRegion (A B C : ℝ × ℝ) : Set (ℝ × ℝ) := + {p | ∃ (α β γ : ℝ), 0 ≤ α ∧ 0 ≤ β ∧ 0 ≤ γ ∧ α + β + γ = 1 ∧ + p.1 = α * A.1 + β * B.1 + γ * C.1 ∧ + p.2 = α * A.2 + β * B.2 + γ * C.2} + +/-- The open interior of a triangular region: strictly positive +barycentric coordinates. -/ +def triangleInterior (A B C : ℝ × ℝ) : Set (ℝ × ℝ) := + {p | ∃ (α β γ : ℝ), 0 < α ∧ 0 < β ∧ 0 < γ ∧ α + β + γ = 1 ∧ + p.1 = α * A.1 + β * B.1 + γ * C.1 ∧ + p.2 = α * A.2 + β * B.2 + γ * C.2} + +/-- Triangle $(A, B, C)$ can be dissected into exactly $n$ pairwise-congruent +non-degenerate triangles that tile it: each is contained in the original, +their interiors are pairwise disjoint, and their union covers the original. -/ +def CanDissectInto (A B C : ℝ × ℝ) (n : ℕ) : Prop := + ∃ (V : Fin n → (ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ)), + -- All sub-triangles are non-degenerate + (∀ i, NonDegenerate (V i).1 (V i).2.1 (V i).2.2) ∧ + -- All sub-triangles are mutually congruent (same squared side lengths) + (∀ i j, sideLengthsSq (V i).1 (V i).2.1 (V i).2.2 = + sideLengthsSq (V j).1 (V j).2.1 (V j).2.2) ∧ + -- Each sub-triangle is contained in the original + (∀ i, triangleRegion (V i).1 (V i).2.1 (V i).2.2 ⊆ + triangleRegion A B C) ∧ + -- Pairwise disjoint interiors + (∀ i j, i ≠ j → + triangleInterior (V i).1 (V i).2.1 (V i).2.2 ∩ + triangleInterior (V j).1 (V j).2.1 (V j).2.2 = ∅) ∧ + -- Union covers the original triangle + (∀ p, p ∈ triangleRegion A B C → + ∃ i, p ∈ triangleRegion (V i).1 (V i).2.1 (V i).2.2) + +/-- Euclidean distance (side length) between two points. -/ +noncomputable def sideLength (p q : ℝ × ℝ) : ℝ := + Real.sqrt (sqDist p q) + +/-- The sides of a triangle are integrally independent: no nontrivial integer +linear combination of the three side lengths equals zero. -/ +def IntIndepSides (A B C : ℝ × ℝ) : Prop := + ∀ (a₁ a₂ a₃ : ℤ), + ↑a₁ * sideLength B C + ↑a₂ * sideLength A C + + ↑a₃ * sideLength A B = 0 → + a₁ = 0 ∧ a₂ = 0 ∧ a₃ = 0 + +/-- The angle at vertex $P$ in triangle $PQR$, via the dot-product formula: +$\arccos\bigl(\frac{\vec{PQ} \cdot \vec{PR}}{|PQ| \cdot |PR|}\bigr)$. +Returns a value in $[0, \pi]$. -/ +noncomputable def angle (P Q R : ℝ × ℝ) : ℝ := + Real.arccos (((Q.1 - P.1) * (R.1 - P.1) + (Q.2 - P.2) * (R.2 - P.2)) / + (sideLength P Q * sideLength P R)) + +/-- The angles of a triangle are integrally independent: the only integer +linear combination of the angles that equals an integer multiple of $\pi$ +is the trivial one (all coefficients equal). This accounts for the +constraint $\alpha + \beta + \gamma = \pi$. -/ +def IntIndepAngles (A B C : ℝ × ℝ) : Prop := + ∀ (a₁ a₂ a₃ k : ℤ), + ↑a₁ * angle A B C + ↑a₂ * angle B A C + + ↑a₃ * angle C A B = ↑k * Real.pi → + a₁ = a₂ ∧ a₂ = a₃ + +/-- +Every non-degenerate triangle can be dissected into $n^2$ congruent triangles +for any positive integer $n$. +-/ +@[category research solved, AMS 51] +theorem erdos_633.variants.square_dissection + (A B C : ℝ × ℝ) (hnd : NonDegenerate A B C) + (n : ℕ) (hn : 1 ≤ n) : + CanDissectInto A B C (n ^ 2) := by + sorry + +/-- +There exists a non-degenerate triangle which can be dissected into $n$ +congruent triangles only when $n$ is a perfect square. [So09c] +-/ +@[category research solved, AMS 51] +theorem erdos_633.variants.existence : + ∃ A B C : ℝ × ℝ, NonDegenerate A B C ∧ + ∀ n : ℕ, 1 ≤ n → CanDissectInto A B C n → ∃ m : ℕ, n = m ^ 2 := by + sorry + +/-- +If a non-degenerate triangle has integrally independent sides and angles, +then it can only be dissected into a perfect square number of congruent +triangles. [So09b] +-/ +@[category research solved, AMS 51] +theorem erdos_633.variants.soifer + (A B C : ℝ × ℝ) (hnd : NonDegenerate A B C) + (hsides : IntIndepSides A B C) (hangles : IntIndepAngles A B C) : + ∀ n : ℕ, 1 ≤ n → CanDissectInto A B C n → ∃ m : ℕ, n = m ^ 2 := by + sorry + +/-- +Classify those non-degenerate triangles that can only be cut into a perfect +square number of congruent triangles. The full classification remains open. +-/ +@[category research open, AMS 51] +theorem erdos_633 : + {T : (ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ) | + NonDegenerate T.1 T.2.1 T.2.2 ∧ + ∀ n, 1 ≤ n → CanDissectInto T.1 T.2.1 T.2.2 n → ∃ m, n = m ^ 2} = + answer(sorry) := by sorry + +end Erdos633 diff --git a/FormalConjectures/ErdosProblems/634.lean b/FormalConjectures/ErdosProblems/634.lean new file mode 100644 index 0000000000..af077af2de --- /dev/null +++ b/FormalConjectures/ErdosProblems/634.lean @@ -0,0 +1,202 @@ +/- +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 634 + +*Reference:* [erdosproblems.com/634](https://www.erdosproblems.com/634) + +Find all $n$ such that there is at least one triangle which can be cut into $n$ +congruent triangles. + +[So09c] Soifer, A., *Is There Anything Beyond the Solution?*, The Mathematical Coloring +Book, Springer, 2009, pp. 47–50. +[SWW91] Snover, S., Waiveris, C., Williams, J., *Rep-tiling for triangles*, +Discrete Mathematics (1991), 193–200. +[Zh25] Zhang, Y., *Tiling Triangles With 2π/3 Angles*, arXiv:2512.22696, 2025. +-/ + +open scoped EuclideanGeometry + +namespace Erdos634 + +/-- Multiset of side lengths of a triangle with vertices `T : Fin 3 → ℝ²`. + Two triangles are congruent (by SSS) iff these multisets agree. -/ +noncomputable def sideLengths (T : Fin 3 → ℝ²) : Multiset ℝ := + ↑[dist (T 0) (T 1), dist (T 1) (T 2), dist (T 0) (T 2)] + +/-- Triangle `T` can be dissected into exactly `n` pairwise-congruent + non-degenerate triangles that tile it: each piece has affinely independent + vertices, all pieces are congruent, each is contained in the original, + their interiors are pairwise disjoint, and their union covers the original. -/ +def CanDissectInto (T : Fin 3 → ℝ²) (n : ℕ) : Prop := + ∃ (V : Fin n → Fin 3 → ℝ²), + (∀ i, AffineIndependent ℝ (V i)) ∧ + (∀ i j, sideLengths (V i) = sideLengths (V j)) ∧ + (∀ i, convexHull ℝ (Set.range (V i)) ⊆ convexHull ℝ (Set.range T)) ∧ + (∀ i j, i ≠ j → + interior (convexHull ℝ (Set.range (V i))) ∩ + interior (convexHull ℝ (Set.range (V j))) = ∅) ∧ + (∀ p, p ∈ convexHull ℝ (Set.range T) → + ∃ i, p ∈ convexHull ℝ (Set.range (V i))) + +/-- There exists a triangle that can be dissected into `n` congruent triangles. -/ +def HasCongruentDissection (n : ℕ) : Prop := + ∃ T : Fin 3 → ℝ², AffineIndependent ℝ T ∧ CanDissectInto T n + +/-- Two triangles are similar if their side length multisets are proportional. -/ +noncomputable def AreSimilar (T₁ T₂ : Fin 3 → ℝ²) : Prop := + ∃ c : ℝ, 0 < c ∧ sideLengths T₁ = (sideLengths T₂).map (c * ·) + +/-- Triangle `T` can be dissected into `n` pairwise-similar non-degenerate triangles. -/ +def CanDissectIntoSimilar (T : Fin 3 → ℝ²) (n : ℕ) : Prop := + ∃ (V : Fin n → Fin 3 → ℝ²), + (∀ i, AffineIndependent ℝ (V i)) ∧ + (∀ i j, AreSimilar (V i) (V j)) ∧ + (∀ i, convexHull ℝ (Set.range (V i)) ⊆ convexHull ℝ (Set.range T)) ∧ + (∀ i j, i ≠ j → + interior (convexHull ℝ (Set.range (V i))) ∩ + interior (convexHull ℝ (Set.range (V j))) = ∅) ∧ + (∀ p, p ∈ convexHull ℝ (Set.range T) → + ∃ i, p ∈ convexHull ℝ (Set.range (V i))) + +/-- Triangle `T` can be dissected into `n` non-degenerate triangles each similar to `T`. -/ +def CanDissectIntoSelfSimilar (T : Fin 3 → ℝ²) (n : ℕ) : Prop := + ∃ (V : Fin n → Fin 3 → ℝ²), + (∀ i, AffineIndependent ℝ (V i)) ∧ + (∀ i, AreSimilar (V i) T) ∧ + (∀ i, convexHull ℝ (Set.range (V i)) ⊆ convexHull ℝ (Set.range T)) ∧ + (∀ i j, i ≠ j → + interior (convexHull ℝ (Set.range (V i))) ∩ + interior (convexHull ℝ (Set.range (V j))) = ∅) ∧ + (∀ p, p ∈ convexHull ℝ (Set.range T) → + ∃ i, p ∈ convexHull ℝ (Set.range (V i))) + +/-- There exists a triangle that can be dissected into `n` triangles similar to itself. -/ +def HasSelfSimilarDissection (n : ℕ) : Prop := + ∃ T : Fin 3 → ℝ², AffineIndependent ℝ T ∧ CanDissectIntoSelfSimilar T n + +/-- +Erdős Problem 634: It is conjectured that no prime $p \equiv 3 \pmod{4}$ +has the property that some triangle can be cut into $p$ congruent triangles. +-/ +@[category research open, AMS 52] +theorem erdos_634 : + ∀ p : ℕ, Nat.Prime p → p % 4 = 3 → ¬ HasCongruentDissection p := by + sorry + +/-- +Every perfect square $n^2$ (with $n \ge 1$) has a congruent dissection: +any triangle can be cut into $n^2$ congruent copies. (Folklore) +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.squares (n : ℕ) (hn : 1 ≤ n) : + HasCongruentDissection (n ^ 2) := by + sorry + +/-- +For any positive integer $n$, the number $2n^2$ has a congruent dissection. [So09c] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.two_squares (n : ℕ) (hn : 1 ≤ n) : + HasCongruentDissection (2 * n ^ 2) := by + sorry + +/-- +For any positive integer $n$, the number $3n^2$ has a congruent dissection. [So09c] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.three_squares (n : ℕ) (hn : 1 ≤ n) : + HasCongruentDissection (3 * n ^ 2) := by + sorry + +/-- +For any positive integer $n$, the number $6n^2$ has a congruent dissection. [So09c] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.six_squares (n : ℕ) (hn : 1 ≤ n) : + HasCongruentDissection (6 * n ^ 2) := by + sorry + +/-- +For any positive integers $n$ and $m$, the number $n^2 + m^2$ has a congruent +dissection. [So09c] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.sum_of_squares (n m : ℕ) (hn : 1 ≤ n) (hm : 1 ≤ m) : + HasCongruentDissection (n ^ 2 + m ^ 2) := by + sorry + +/-- +There is no triangle that can be cut into exactly $7$ congruent triangles. (Beeson) +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.not_seven : ¬ HasCongruentDissection 7 := by + sorry + +/-- +There is no triangle that can be cut into exactly $11$ congruent triangles. (Beeson) +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.not_eleven : ¬ HasCongruentDissection 11 := by + sorry + +/-- +Zhang [Zh25] proved that for integers $a \ge b \ge 1$, if +$n \ge 3\lceil(a^2 + b^2 + ab - a - b)/(ab)\rceil$, then $n^2 ab$ has a +congruent dissection. +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.zhang (a b n : ℕ) (ha : 1 ≤ a) (hb : 1 ≤ b) (hab : b ≤ a) + (hn : 3 * ⌈((a : ℚ) ^ 2 + b ^ 2 + a * b - a - b) / (a * b)⌉₊ ≤ n) : + HasCongruentDissection (n ^ 2 * a * b) := by + sorry + +/-- +Every triangle can be cut into $N$ similar (not necessarily congruent) triangles +for all $N \ne 2, 3, 5$. [So09c] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.similar (T : Fin 3 → ℝ²) (hT : AffineIndependent ℝ T) + (n : ℕ) (hn₁ : 1 ≤ n) (hn₂ : n ≠ 2) (hn₃ : n ≠ 3) (hn₅ : n ≠ 5) : + CanDissectIntoSimilar T n := by + sorry + +/-- +If the smaller triangles must be similar to the original triangle, the possible +values of $n$ are exactly those of the form $k^2$, $k^2 + m^2$, or $3k^2$ +for positive integers $k, m$. [SWW91] +-/ +@[category research solved, AMS 52] +theorem erdos_634.variants.self_similar_characterization (n : ℕ) : + HasSelfSimilarDissection n ↔ + (∃ k : ℕ, 1 ≤ k ∧ n = k ^ 2) ∨ + (∃ k m : ℕ, 1 ≤ k ∧ 1 ≤ m ∧ n = k ^ 2 + m ^ 2) ∨ + (∃ k : ℕ, 1 ≤ k ∧ n = 3 * k ^ 2) := by + sorry + +/-- +The case $n = 19$ is the smallest open case: it is unknown whether any triangle +can be cut into exactly $19$ congruent triangles. Since $19 \equiv 3 \pmod{4}$ +is prime, the main conjecture predicts this is impossible. +-/ +@[category research open, AMS 52] +theorem erdos_634.variants.not_nineteen : ¬ HasCongruentDissection 19 := by + sorry + +end Erdos634 diff --git a/FormalConjectures/ErdosProblems/635.lean b/FormalConjectures/ErdosProblems/635.lean new file mode 100644 index 0000000000..e93dfd57ea --- /dev/null +++ b/FormalConjectures/ErdosProblems/635.lean @@ -0,0 +1,96 @@ +/- +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 635 + +*Reference:* [erdosproblems.com/635](https://www.erdosproblems.com/635) + +Let $t \geq 1$ and $A \subseteq \{1, \ldots, N\}$ be such that whenever $a, b \in A$ with +$b - a \geq t$ we have $(b - a) \nmid b$. How large can $|A|$ be? Is it true that +$|A| \leq (1/2 + o(1)) \cdot N$? + +Asked by Erdős in a letter to Ruzsa around 1980. + +[Gu83] Guy, R. K., _Unsolved Problems in Number Theory_ (1983). + +[Ru99] Ruzsa, I., related correspondence and results (1999). + +[El79] Elliott, P. D. T. A., _Probabilistic Number Theory. I_ (1979). + +When $t = 1$, the maximum is $\lfloor (N+1)/2 \rfloor$, achieved by taking $A$ to be all odd +numbers in $\{1, \ldots, N\}$. When $t = 2$, Erdős observed $|A| \geq N/2 + c \log N$ for +some $c > 0$, by taking $A$ to be the odd numbers together with $2^k$ for odd $k$. + +The upper bound $|A| \leq (1/2 + o(1)) \cdot N$ has been resolved affirmatively +by ChatGPT-5.2 (prompted by Leeham). Tao observed that a positive answer also follows +from an inequality due to Elliott [El79]. +-/ + +namespace Erdos635 + +/-- The divisibility-avoidance property with threshold $t$: +for all $a, b \in A$ with $b - a \geq t$, we require $(b - a) \nmid b$. -/ +def DivAvoidance (A : Finset ℕ) (t : ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, b - a ≥ t → ¬(b - a ∣ b) + +/-- The maximum cardinality of a subset of $\{1, \ldots, N\}$ satisfying the +divisibility-avoidance property with threshold $t$. -/ +noncomputable def maxDivAvoidance (N t : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ DivAvoidance A t ∧ A.card = k} + +/-- +When $t = 1$, the maximum size of a divisibility-avoidance set in $\{1, \ldots, N\}$ +is exactly $\lfloor (N+1)/2 \rfloor$, achieved by taking all odd numbers. [Gu83][Ru99] +-/ +@[category research solved, AMS 5 11] +theorem erdos_635.variants.t_eq_one (N : ℕ) (hN : N ≥ 1) : + maxDivAvoidance N 1 = (N + 1) / 2 := by + sorry + +/-- +When $t = 2$, there exists $c > 0$ such that there is a set $A \subseteq \{1, \ldots, N\}$ +satisfying the divisibility-avoidance condition with $|A| \geq N/2 + c \cdot \log N$. +(Take $A$ to be the odd numbers together with $2^k$ for odd $k$.) [Gu83][Ru99] +-/ +@[category research solved, AMS 5 11] +theorem erdos_635.variants.t_eq_two_lower : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (maxDivAvoidance N 2 : ℝ) ≥ (N : ℝ) / 2 + c * Real.log (N : ℝ) := by + sorry + +/-- +For every $t \geq 1$ and $\varepsilon > 0$, there exists $N_0$ such that for all $N \geq N_0$, +every $A \subseteq \{1, \ldots, N\}$ satisfying the divisibility-avoidance property with +threshold $t$ has $|A| \leq (1/2 + \varepsilon) \cdot N$. [Gu83][Ru99][El79] + +Resolved affirmatively by ChatGPT-5.2 (prompted by Leeham); Tao observed that a positive +answer also follows from an inequality due to Elliott [El79]. + +Equivalently, $\mathrm{maxDivAvoidance}(N, t) / N \to 1/2$ as $N \to \infty$ for any fixed $t$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_635 : answer(True) ↔ + ∀ t : ℕ, t ≥ 1 → ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 N → + DivAvoidance A t → + (A.card : ℝ) ≤ (1 / 2 + ε) * (N : ℝ) := by + sorry + +end Erdos635 diff --git a/FormalConjectures/ErdosProblems/636.lean b/FormalConjectures/ErdosProblems/636.lean new file mode 100644 index 0000000000..fb11c9a367 --- /dev/null +++ b/FormalConjectures/ErdosProblems/636.lean @@ -0,0 +1,80 @@ +/- +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 636 + +*Reference:* [erdosproblems.com/636](https://www.erdosproblems.com/636) + +Suppose $G$ is a graph on $n$ vertices which contains no complete graph or independent +set on $\gg \log n$ many vertices. Must $G$ contain $\gg n^{5/2}$ induced subgraphs which +pairwise differ in either the number of vertices or the number of edges? + +A problem of Erdős, Faudree, and Sós [Er93, p.346], who proved there exist +$\gg n^{3/2}$ many such subgraphs, and note that $n^{5/2}$ would be best possible. +Erdős credits Alon and Bollobás in [Er93]. + +This was proved by Kwan and Sudakov [KwSu21]. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph +theory_. Quaestiones Mathematicae (1993), 333-350. + +[Er97d] Erdős, P., _Some of my new and almost new problems and results in +combinatorics and graph theory_ (1997). + +[KwSu21] Kwan, M. and Sudakov, B., _Proof of a conjecture on induced subgraphs +of Ramsey graphs_ (2021). +-/ + +open SimpleGraph + +namespace Erdos636 + +/-- The set of distinct (vertex count, edge count) signatures realized by induced +subgraphs of a graph $G$ on $\operatorname{Fin}(n)$. For each subset $S$ of vertices, +we record $(|S|, |E(G[S])|)$ where $G[S]$ is the induced subgraph on $S$. -/ +noncomputable def inducedSubgraphSignatures {n : ℕ} (G : SimpleGraph (Fin n)) : + Finset (ℕ × ℕ) := + Finset.univ.image fun S : Finset (Fin n) => + (S.card, (G.induce (↑S : Set (Fin n))).edgeSet.ncard) + +/-- +**Erdős Problem 636** [Er93, p.346]; [Er97d]: + +For every $C > 0$, there exist $c > 0$ and $N_0$ such that for all $n \geq N_0$, if $G$ is a +graph on $n$ vertices with clique number at most $C \cdot \log_2(n)$ and independence number +at most $C \cdot \log_2(n)$, then $G$ has at least $c \cdot n^{5/2}$ distinct induced subgraph +signatures (pairs (vertex count, edge count) among all induced subgraphs of $G$). + +Proved by Kwan and Sudakov [KwSu21]. +-/ +@[category research solved, AMS 5] +theorem erdos_636 : + answer(True) ↔ + ∀ C : ℝ, C > 0 → + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + (∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + ((inducedSubgraphSignatures G).card : ℝ) ≥ c * (↑n : ℝ) ^ ((5 : ℝ) / 2) := by + sorry + +end Erdos636 diff --git a/FormalConjectures/ErdosProblems/637.lean b/FormalConjectures/ErdosProblems/637.lean new file mode 100644 index 0000000000..2736a07d06 --- /dev/null +++ b/FormalConjectures/ErdosProblems/637.lean @@ -0,0 +1,109 @@ +/- +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 637 + +*Reference:* [erdosproblems.com/637](https://www.erdosproblems.com/637) + +If $G$ is a graph on $n$ vertices which contains no complete graph or independent +set on $\gg \log n$ vertices then $G$ contains an induced subgraph on $\gg n$ vertices +which contains $\gg n^{1/2}$ distinct degrees. + +A problem of Erdős, Faudree, and Sós [Er97d]. + +This was proved by Bukh and Sudakov [BuSu07]. + +Jenssen, Keevash, Long, and Yepremyan [JKLY20] proved that there must exist +an induced subgraph which contains $\gg n^{2/3}$ distinct degrees (with no +restriction on the number of vertices). + +[Er97d] Erdős, P., _Some of my favourite problems in various branches of +combinatorics_, 1997. + +[BuSu07] Bukh, B. and Sudakov, B., _Induced subgraphs of Ramsey graphs with +many distinct degrees_, 2007. + +[JKLY20] Jenssen, M., Keevash, P., Long, E. and Yepremyan, L., _Distinct +degrees in induced subgraphs_, 2020. +-/ + +open SimpleGraph Classical + +namespace Erdos637 + +/-- The number of neighbors of vertex $v$ within $S$. When $v \in S$, this equals the degree + of $v$ in the induced subgraph $G[S]$. -/ +noncomputable def inducedDegree {n : ℕ} (G : SimpleGraph (Fin n)) + (S : Finset (Fin n)) (v : Fin n) : ℕ := + (S.filter fun w => G.Adj v w).card + +/-- The number of distinct degrees realized by vertices of $S$ in the induced + subgraph $G[S]$. -/ +noncomputable def inducedDistinctDegrees {n : ℕ} (G : SimpleGraph (Fin n)) + (S : Finset (Fin n)) : ℕ := + (S.image fun v => inducedDegree G S v).card + +/-- +**Erdős Problem 637** (PROVED) [Er97d]: + +For every $C > 0$, there exist $c_1 > 0$, $c_2 > 0$, and $N_0$ such that for all +$n \geq N_0$, if $G$ is a graph on $n$ vertices with clique number at most +$C \cdot \log_2(n)$ and independence number at most $C \cdot \log_2(n)$, then there +exists a subset $S$ of vertices with $|S| \geq c_1 \cdot n$ such that the induced +subgraph $G[S]$ has at least $c_2 \cdot n^{1/2}$ distinct degrees. + +Proved by Bukh and Sudakov [BuSu07]. +-/ +@[category research solved, AMS 5] +theorem erdos_637 : + ∀ C : ℝ, C > 0 → + ∃ c₁ : ℝ, c₁ > 0 ∧ + ∃ c₂ : ℝ, c₂ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + (∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + ∃ S : Finset (Fin n), (S.card : ℝ) ≥ c₁ * (↑n : ℝ) ∧ + (inducedDistinctDegrees G S : ℝ) ≥ c₂ * (↑n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +**Erdős Problem 637 — JKLY20 variant** (PROVED) [JKLY20]: + +A strengthening of Problem 637 due to Jenssen, Keevash, Long, and Yepremyan: under the +same Ramsey-type hypothesis, there exists an induced subgraph (with no restriction on +the number of vertices) having $\gg n^{2/3}$ distinct degrees. +-/ +@[category research solved, AMS 5] +theorem erdos_637_jkly20 : + ∀ C : ℝ, C > 0 → + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + (∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + ∃ S : Finset (Fin n), + (inducedDistinctDegrees G S : ℝ) ≥ c * (↑n : ℝ) ^ ((2 : ℝ) / 3) := by + sorry + +end Erdos637 diff --git a/FormalConjectures/ErdosProblems/638.lean b/FormalConjectures/ErdosProblems/638.lean new file mode 100644 index 0000000000..15a83cefb8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/638.lean @@ -0,0 +1,75 @@ +/- +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 638 + +Is it true that for every infinite cardinal $\kappa$ there is a graph $G$ such that every +finite induced subgraph of $G$ belongs to a given family $S$ with the Ramsey property, and +every $\kappa$-colouring of the edges of $G$ contains a monochromatic triangle? + +Erdős noted: "if the answer is affirmative many extensions and generalisations will be +possible." + +See also Problem 639, which comes from the same paper and concerns monochromatic triangles +in 2-colourings of $K_n$. + +*Reference:* [erdosproblems.com/638](https://www.erdosproblems.com/638) + +[Er97d] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, +Matematiche (Catania), 1997. +-/ + +open SimpleGraph Cardinal + +namespace Erdos638 + +/-- A symmetric colouring of a simple graph has a **monochromatic triangle** + if three pairwise-adjacent vertices have all three edges the same colour. -/ +def HasMonoTriangle {V : Type*} (G : SimpleGraph V) {α : Type*} + (c : V → V → α) : Prop := + ∃ a b d : V, G.Adj a b ∧ G.Adj b d ∧ G.Adj a d ∧ + c a b = c b d ∧ c a b = c a d + +/-- +**Erdős Problem 638** + +Let $S$ be a family of finite graphs (indexed by vertex count) with the Ramsey +property: for every $n \geq 1$, some member of $S$ forces a monochromatic triangle +under any $n$-colouring of its edges. + +Is it true that for every infinite cardinal $\kappa$, there exists a graph $G$ such that +every finite induced subgraph of $G$ belongs (up to isomorphism) to $S$, and +every $\kappa$-colouring of the edges of $G$ contains a monochromatic triangle? +-/ +@[category research open, AMS 5] +theorem erdos_638 : answer(sorry) ↔ + ∀ (S : (m : ℕ) → Set (SimpleGraph (Fin m))) + (_ : ∀ n : ℕ, n ≥ 1 → + ∃ m : ℕ, ∃ G ∈ S m, + ∀ (c : Fin m → Fin m → Fin n), (∀ u v, c u v = c v u) → + HasMonoTriangle G c) + (κ : Cardinal) (_ : ℵ₀ ≤ κ), + ∃ (V : Type) (G : SimpleGraph V), + (∀ (m : ℕ) (f : Fin m ↪ V), + ∃ H ∈ S m, Nonempty (G.comap f ≃g H)) ∧ + ∀ (α : Type) (_ : #α = κ) (c : V → V → α), + (∀ u v, c u v = c v u) → HasMonoTriangle G c := by + sorry + +end Erdos638 diff --git a/FormalConjectures/ErdosProblems/639.lean b/FormalConjectures/ErdosProblems/639.lean new file mode 100644 index 0000000000..91b96fa419 --- /dev/null +++ b/FormalConjectures/ErdosProblems/639.lean @@ -0,0 +1,76 @@ +/- +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 639 + +Erdős conjectured that in any 2-coloring of the edges of $K_n$, at most $\lfloor n^2/4 \rfloor$ +edges do not lie in a monochromatic triangle. This was solved by Erdős, Rousseau, and Schelp +for large $n$ (unpublished). Alon observed that the conjecture also follows from a result of +Pyber [Py86], who showed that at most $\lfloor n^2/4 \rfloor + 2$ monochromatic cliques cover +all edges of a 2-coloured $K_n$ for sufficiently large $n$. Keevash and Sudakov [KeSu04] +completely solved the problem, establishing the exact threshold for all $n$: the answer is +$\binom{n}{2}$ for $n \leq 5$, $10$ for $n = 6$, and $\lfloor n^2/4 \rfloor$ for $n \geq 7$. + +*Reference:* [erdosproblems.com/639](https://www.erdosproblems.com/639) + +[Er97d] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, +Matematiche (Catania), 1997. + +[Py86] Pyber, L., _Clique covering of graphs_, Combinatorica **6** (1986), 393–398. + +[KeSu04] Keevash, P. and Sudakov, B., _On the number of edges not covered by monochromatic +copies of a fixed graph_, J. Combin. Theory Ser. B **90** (2004), 41–53. +-/ + +namespace Erdos639 + +/-- A 2-coloring of the edges of the complete graph on $\operatorname{Fin} n$. +Represented as a symmetric function assigning a color ($\operatorname{Bool}$) to each pair +of distinct vertices. -/ +structure EdgeTwoColoring (n : ℕ) where + color : Fin n → Fin n → Bool + symm : ∀ u v : Fin n, color u v = color v u + +/-- An edge $\{u, v\}$ lies in a monochromatic triangle under coloring $c$ if there +exists a vertex $w$ distinct from both $u$ and $v$ such that all three edges +$\{u,v\}$, $\{u,w\}$, $\{v,w\}$ have the same color. -/ +def EdgeTwoColoring.inMonoTriangle {n : ℕ} (c : EdgeTwoColoring n) + (u v : Fin n) : Prop := + ∃ w : Fin n, w ≠ u ∧ w ≠ v ∧ + c.color u v = c.color u w ∧ c.color u v = c.color v w + +/-- The number of edges of $K_n$ (counted as unordered pairs with $u < v$) that +do not lie in any monochromatic triangle under coloring $c$. -/ +noncomputable def edgesNotInMonoTriangleCount {n : ℕ} (c : EdgeTwoColoring n) : ℕ := + Set.ncard {p : Fin n × Fin n | p.1 < p.2 ∧ ¬c.inMonoTriangle p.1 p.2} + +/-- +Erdős Problem 639 [Er97d]: +If the edges of $K_n$ are 2-coloured then there are at most $\lfloor n^2/4 \rfloor$ edges +which do not occur in a monochromatic triangle. + +Solved by Keevash and Sudakov [KeSu04], who proved the threshold is exactly +$\lfloor n^2/4 \rfloor$ for all $n \geq 7$. +-/ +@[category research solved, AMS 5] +theorem erdos_639 (n : ℕ) (hn : 7 ≤ n) (c : EdgeTwoColoring n) : + edgesNotInMonoTriangleCount c ≤ n ^ 2 / 4 := by + sorry + +end Erdos639 diff --git a/FormalConjectures/ErdosProblems/640.lean b/FormalConjectures/ErdosProblems/640.lean new file mode 100644 index 0000000000..81b2da9e61 --- /dev/null +++ b/FormalConjectures/ErdosProblems/640.lean @@ -0,0 +1,56 @@ +/- +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 640 + +*Reference:* [erdosproblems.com/640](https://www.erdosproblems.com/640) + +A problem of Erdős and Hajnal. + +[Er97d] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 52 (1997), 53-97. +-/ + +open SimpleGraph + +namespace Erdos640 + +/-- +Erdős Problem 640 (Erdős-Hajnal) [Er97d, p.84]: + +For every $k \geq 3$, does there exist $f(k)$ such that every graph with chromatic number +at least $f(k)$ contains an odd cycle whose vertices span an induced subgraph +with chromatic number at least $k$? + +This is trivial when $k = 3$, since any non-bipartite graph contains an odd cycle, +and all odd cycles have chromatic number $3$. +-/ +@[category research open, AMS 5] +theorem erdos_640 : + answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → + ∃ f : ℕ, + ∀ (V : Type*) (G : SimpleGraph V), + (f : ℕ∞) ≤ G.chromaticNumber → + ∃ (v : V) (p : G.Walk v v), + p.IsCycle ∧ Odd p.length ∧ + (k : ℕ∞) ≤ (G.induce {w : V | w ∈ p.support}).chromaticNumber := by + sorry + +end Erdos640 diff --git a/FormalConjectures/ErdosProblems/641.lean b/FormalConjectures/ErdosProblems/641.lean new file mode 100644 index 0000000000..c218af1ec4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/641.lean @@ -0,0 +1,79 @@ +/- +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 641 + +*Reference:* [erdosproblems.com/641](https://www.erdosproblems.com/641) + +A problem of Erdős and Hajnal on chromatic number and edge-disjoint cycles. + +[Er92b] Erdős, P., problems in combinatorics. + +[Er97d] Erdős, P., some of my favourite problems, p.84. + +[JSS24] Janzer, O., Steiner, R., and Sudakov, B., disproof of the conjecture. +-/ + +open SimpleGraph + +namespace Erdos641 + +/-- +**Erdős Problem 641** (Original conjecture, DISPROVED) [Er92b][Er97d, p.84]: + +Is there some function $f$ such that for all $k \geq 1$, if a finite graph $G$ has +chromatic number $\geq f(k)$ then $G$ has $k$ edge-disjoint cycles on the same set +of vertices? + +This was resolved in the negative by Janzer, Steiner, and Sudakov [JSS24] — +in fact, this fails even at $k = 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_641 : answer(False) ↔ + ∃ f : ℕ → ℕ, ∀ k : ℕ, 1 ≤ k → + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (f k : ℕ∞) ≤ G.chromaticNumber → + ∃ (cycles : Fin k → Σ (v : Fin n), G.Walk v v), + (∀ i, (cycles i).2.IsCycle) ∧ + (∀ i j, (cycles i).2.support.toFinset = (cycles j).2.support.toFinset) ∧ + (∀ i j, i ≠ j → + Disjoint (cycles i).2.edges.toFinset (cycles j).2.edges.toFinset) := by + sorry + +/-- +**Erdős Problem 641** (Disproof, Janzer–Steiner–Sudakov [JSS24]): + +There exists $k \geq 1$ such that for any proposed bound $f$, one can find a +finite graph with chromatic number at least $f$ but without $k$ edge-disjoint +cycles on any common vertex set. In fact $k = 2$ already fails. +-/ +@[category research solved, AMS 5] +theorem erdos_641.variants.disproof : + ∃ k : ℕ, 1 ≤ k ∧ + ∀ f : ℕ, + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + (f : ℕ∞) ≤ G.chromaticNumber ∧ + ¬∃ (cycles : Fin k → Σ (v : Fin n), G.Walk v v), + (∀ i, (cycles i).2.IsCycle) ∧ + (∀ i j, (cycles i).2.support.toFinset = (cycles j).2.support.toFinset) ∧ + (∀ i j, i ≠ j → + Disjoint (cycles i).2.edges.toFinset (cycles j).2.edges.toFinset) := by + sorry + +end Erdos641 diff --git a/FormalConjectures/ErdosProblems/642.lean b/FormalConjectures/ErdosProblems/642.lean new file mode 100644 index 0000000000..791216a8dd --- /dev/null +++ b/FormalConjectures/ErdosProblems/642.lean @@ -0,0 +1,73 @@ +/- +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 642 + +*Reference:* [erdosproblems.com/642](https://www.erdosproblems.com/642) + +Let $f(n)$ be the maximal number of edges in a graph on $n$ vertices such that +all cycles have more vertices than chords. Is it true that $f(n) \ll n$? + +A chord is an edge between two vertices of the cycle which are not consecutive +in the cycle. A problem of Hamburger and Szegedy. + +Chen, Erdős, and Staton [CES96] proved $f(n) \ll n^{3/2}$. Draganić, Methuku, +Munhá Correia, and Sudakov [DMMS24] improved this to $f(n) \ll n(\log n)^8$. + +[CES96] Chen, G., Erdős, P., and Staton, W., _Proof of a conjecture of +Bollobás on nested cycles_. J. Combin. Theory Ser. B (1996), 38–43. + +[DMMS24] Draganić, N., Methuku, A., Munhá Correia, D., and Sudakov, B., +_Cycles with many chords_. Random Structures & Algorithms (2024), 3–16. + +[Er97d] Erdős, P., _Some old and new problems in various branches of +combinatorics_. Discrete Math. (1997). +-/ + +open SimpleGraph + +namespace Erdos642 + +variable {V : Type*} [Fintype V] [DecidableEq V] + {G : SimpleGraph V} [DecidableRel G.Adj] + +/-- The number of chords of a walk in a graph. A chord is an edge of $G$ +connecting two vertices that appear in the walk's support but is not +itself an edge traversed by the walk. -/ +noncomputable def numChords {u v : V} (p : G.Walk u v) : ℕ := + (G.edgeFinset.filter (fun e => + (∀ w, w ∈ e → w ∈ p.support.toFinset) ∧ e ∉ p.edges.toFinset)).card + +/-- +Erdős Problem 642 [CES96][Er97d]: + +There exists a constant $C$ such that for all $n$, every graph $G$ on $n$ +vertices in which every cycle has strictly more vertices than chords has at +most $C \cdot n$ edges. +-/ +@[category research open, AMS 5] +theorem erdos_642 : + answer(sorry) ↔ + ∃ C : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (∀ (v : Fin n) (p : G.Walk v v), p.IsCycle → + p.support.toFinset.card > numChords p) → + G.edgeFinset.card ≤ C * n := by + sorry + +end Erdos642 diff --git a/FormalConjectures/ErdosProblems/643.lean b/FormalConjectures/ErdosProblems/643.lean new file mode 100644 index 0000000000..983557a2e0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/643.lean @@ -0,0 +1,103 @@ +/- +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 643 + +*Reference:* [erdosproblems.com/643](https://www.erdosproblems.com/643) + +Let $f(n;t)$ be minimal such that if a $t$-uniform hypergraph on $n$ vertices +contains at least $f(n;t)$ edges then there must be four edges $A,B,C,D$ such +that $A \cup B = C \cup D$ and $A \cap B = C \cap D = \emptyset$. + +Estimate $f(n;t)$ — in particular, is it true that for $t \geq 3$, +$f(n;t) = (1+o(1))\binom{n}{t-1}$? + +For $t=2$ this asks for the maximum number of edges in a graph with no $C_4$, +giving $f(n;2) = (1/2+o(1))n^{3/2}$. + +Füredi [Fu84] proved $f(n;3) \ll n^2$ and $f(n;3) > \binom{n}{2}$ for +infinitely many $n$. Pikhurko and Verstraëte [PiVe09] proved +$f(n;3) \leq \frac{13}{9}\binom{n}{2}$ for all $n$. + +More generally, Füredi proved +$\binom{n-1}{t-1} + \lfloor(n-1)/t\rfloor \leq f(n;t) < \frac{7}{2}\binom{n}{t-1}$, +and conjectured the lower bound is sharp for $t \geq 4$. + +Pikhurko and Verstraëte proved +$1 \leq \limsup_{n\to\infty} f(n;t)/\binom{n}{t-1} \leq \min(7/4, 1+2/\sqrt{t})$ +for all $t \geq 3$. + +[Er77b] Erdős, P., _Problems and results in combinatorial analysis_. +Proceedings of the Eighth Southeastern Conference on Combinatorics, Graph Theory +and Computing (1977), 3–12. + +[Er97d] Erdős, P., _Some recent problems and results in graph theory_. +Discrete Math. (1997), 81–85. + +[Fu84] Füredi, Z., _Hypergraphs in which all disjoint pairs have distinct unions_. +Combinatorica (1984), 161–168. + +[PiVe09] Pikhurko, O. and Verstraëte, J., _The maximum size of hypergraphs without +generalized 4-cycles_. J. Combin. Theory Ser. A (2009), 637–649. +-/ + +namespace Erdos643 + +/-- A $t$-uniform hypergraph on `Fin n`: a family of $t$-element subsets. -/ +def IsUniformHypergraph (n t : ℕ) (H : Finset (Finset (Fin n))) : Prop := + ∀ e ∈ H, e.card = t + +/-- A hypergraph contains the "complementary pairs" configuration: + edges $A, B, C, D$ with $A \cup B = C \cup D$, both pairs disjoint, + and $\{A, B\} \neq \{C, D\}$ as unordered pairs. -/ +def HasComplementaryPairs {n : ℕ} (H : Finset (Finset (Fin n))) : Prop := + ∃ A B C D : Finset (Fin n), + A ∈ H ∧ B ∈ H ∧ C ∈ H ∧ D ∈ H ∧ + A ∪ B = C ∪ D ∧ + Disjoint A B ∧ Disjoint C D ∧ + ({A, B} : Finset (Finset (Fin n))) ≠ {C, D} + +/-- +**Erdős Problem 643** [Er77b][Er97d]: + +For every $t \geq 3$ and every $\varepsilon > 0$, there exists $N$ such that +for all $n \geq N$, every $t$-uniform hypergraph on $n$ vertices with more than +$(1+\varepsilon)\binom{n}{t-1}$ edges contains the complementary pairs +configuration, and there exists one with at least +$(1-\varepsilon)\binom{n}{t-1}$ edges avoiding it. + +Equivalently, $f(n;t) = (1+o(1))\binom{n}{t-1}$ for all $t \geq 3$. +-/ +@[category research open, AMS 5] +theorem erdos_643 : + answer(sorry) ↔ + ∀ t : ℕ, 3 ≤ t → + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (∀ H : Finset (Finset (Fin n)), + IsUniformHypergraph n t H → + (H.card : ℝ) > (1 + ε) * (Nat.choose n (t - 1) : ℝ) → + HasComplementaryPairs H) ∧ + (∃ H : Finset (Finset (Fin n)), + IsUniformHypergraph n t H ∧ + (H.card : ℝ) ≥ (1 - ε) * (Nat.choose n (t - 1) : ℝ) ∧ + ¬HasComplementaryPairs H) := by + sorry + +end Erdos643 diff --git a/FormalConjectures/ErdosProblems/644.lean b/FormalConjectures/ErdosProblems/644.lean new file mode 100644 index 0000000000..8fda878d02 --- /dev/null +++ b/FormalConjectures/ErdosProblems/644.lean @@ -0,0 +1,104 @@ +/- +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 644 + +*Reference:* [erdosproblems.com/644](https://www.erdosproblems.com/644) + +Let $f(k,r)$ be minimal such that if $A_1, A_2, \ldots$ is a family of sets, +all of size $k$, such that for every collection of $r$ of the $A_i$s there +is some pair $\{x,y\}$ which intersects all of the $A_j$, then there is some +set of size $f(k,r)$ which intersects all of the sets $A_i$. + +Known results (Erdős, Fon-Der-Flaass, Kostochka, and Tuza [EFKT92]): +$f(k,3) = 2k$, $f(k,4) = \lfloor 3k/2 \rfloor$, +$f(k,5) = \lfloor 5k/4 \rfloor$, and $f(k,6) = k$. + +[EFKT92] Erdős, P., Fon-Der-Flaass, D., Kostochka, A. V., and Tuza, Zs., +_Small transversals in uniform hypergraphs_. Siberian Advances in Mathematics +(1992), 82–88. + +[Er97d] Erdős, P., _Some of my favourite problems in various branches of +combinatorics_, Matematiche (Catania), 1997. +-/ + +namespace Erdos644 + +/-- A family of sets is $k$-uniform: every set has exactly $k$ elements. -/ +def IsKUniformFamily {ι : Type*} (F : ι → Finset ℕ) (k : ℕ) : Prop := + ∀ i, (F i).card = k + +/-- The $r$-wise pair-hitting property: for every $r$ members of the family, + there exist two distinct elements that together hit all of them. -/ +def HasRWisePairHitting {ι : Type*} (F : ι → Finset ℕ) (r : ℕ) : Prop := + ∀ (S : Fin r → ι), ∃ x y : ℕ, x ≠ y ∧ ∀ j, x ∈ F (S j) ∨ y ∈ F (S j) + +/-- A set $T$ is a transversal (hitting set) of the family $F$: it intersects every member. -/ +def IsTransversal {ι : Type*} (F : ι → Finset ℕ) (T : Finset ℕ) : Prop := + ∀ i : ι, ∃ x ∈ T, x ∈ F i + +/-- +**Erdős Problem 644, Part 1** [EFKT92][Er97d]: + +Is it true that $f(k,7) = (1+o(1))\frac{3}{4}k$? + +For every $\varepsilon > 0$ and all sufficiently large $k$, every family of +$k$-element sets in which every 7 members can be hit by a pair has a +transversal of size at most $(3/4 + \varepsilon)k$, and there exists such a +family requiring a transversal of size at least $(3/4 - \varepsilon)k$. +-/ +@[category research open, AMS 5] +theorem erdos_644 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (∀ (ι : Type) (F : ι → Finset ℕ), + IsKUniformFamily F k → HasRWisePairHitting F 7 → + ∃ T : Finset ℕ, (T.card : ℝ) ≤ (3 / 4 + ε) * (k : ℝ) ∧ + IsTransversal F T) ∧ + (∃ (ι : Type) (F : ι → Finset ℕ), + IsKUniformFamily F k ∧ HasRWisePairHitting F 7 ∧ + ∀ T : Finset ℕ, IsTransversal F T → + (T.card : ℝ) ≥ (3 / 4 - ε) * (k : ℝ)) := by + sorry + +/-- +**Erdős Problem 644, Part 2** [EFKT92][Er97d]: + +For every $r \geq 3$, there exists a constant $c_r > 0$ such that +$f(k,r) = (1+o(1))c_r k$. +-/ +@[category research open, AMS 5] +theorem erdos_644.variants.general_constant : + answer(sorry) ↔ + ∀ r : ℕ, 3 ≤ r → + ∃ c : ℝ, c > 0 ∧ + ∀ ε : ℝ, ε > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (∀ (ι : Type) (F : ι → Finset ℕ), + IsKUniformFamily F k → HasRWisePairHitting F r → + ∃ T : Finset ℕ, (T.card : ℝ) ≤ (c + ε) * (k : ℝ) ∧ + IsTransversal F T) ∧ + (∃ (ι : Type) (F : ι → Finset ℕ), + IsKUniformFamily F k ∧ HasRWisePairHitting F r ∧ + ∀ T : Finset ℕ, IsTransversal F T → + (T.card : ℝ) ≥ (c - ε) * (k : ℝ)) := by + sorry + +end Erdos644 diff --git a/FormalConjectures/ErdosProblems/646.lean b/FormalConjectures/ErdosProblems/646.lean new file mode 100644 index 0000000000..67bdb1575d --- /dev/null +++ b/FormalConjectures/ErdosProblems/646.lean @@ -0,0 +1,69 @@ +/- +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 646 + +*Reference:* [erdosproblems.com/646](https://www.erdosproblems.com/646) + +Let $p_1, \ldots, p_k$ be distinct primes. Are there infinitely many $n$ such that +$n!$ is divisible by an even power of each of the $p_i$? + +The answer is yes, proved by Berend [Be97], who further proved that the +sequence of such $n$ has bounded gaps (where the bound depends on the initial +set of primes). + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_, +Monographies de L'Enseignement Mathématique (1980), p. 77. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[Be97] Berend, D., _On the parity of exponents in the factorization of $n!$_. +J. Number Theory **64** (1997), 13–19. +-/ + +namespace Erdos646 + +/-- +Erdős Problem 646 (proved by Berend [Be97]): + +For any finite set of primes, there are infinitely many $n$ such that +$n!$ is divisible by an even power of each prime in the set. Equivalently, +for each prime $p$ in the set, the $p$-adic valuation of $n!$ is even. +-/ +@[category research solved, AMS 11] +theorem erdos_646 : answer(True) ↔ + ∀ (primes : Finset ℕ), (∀ p ∈ primes, Nat.Prime p) → + Set.Infinite {n : ℕ | ∀ p ∈ primes, Even (padicValNat p n.factorial)} := by + sorry + +/-- +Berend's stronger result [Be97]: for any finite set of primes, the sequence of $n$ +such that $n!$ has even $p$-adic valuation for every prime in the set has bounded gaps. +That is, there exists a bound $B$ (depending on the set of primes) such that in every +interval of length $B$ there is such an $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_646_bounded_gaps : + ∀ (primes : Finset ℕ), (∀ p ∈ primes, Nat.Prime p) → + ∃ B : ℕ, ∀ n : ℕ, ∃ m ∈ Set.Icc n (n + B), + ∀ p ∈ primes, Even (padicValNat p m.factorial) := by + sorry + +end Erdos646 diff --git a/FormalConjectures/ErdosProblems/648.lean b/FormalConjectures/ErdosProblems/648.lean new file mode 100644 index 0000000000..59b96b36c1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/648.lean @@ -0,0 +1,69 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 648 + +*Reference:* [erdosproblems.com/648](https://www.erdosproblems.com/648) + +Let $g(n)$ denote the largest $t$ such that there exist integers +$2 \leq a_1 < a_2 < \cdots < a_t < n$ such that +$P(a_1) > P(a_2) > \cdots > P(a_t)$, +where $P(m)$ is the greatest prime factor of $m$. Estimate $g(n)$. + +Stijn Cambie proved that $g(n) \asymp \left(\frac{n}{\log n}\right)^{1/2}$. +Cambie further asks whether there exists a constant $c$ such that +$g(n) \sim c \left(\frac{n}{\log n}\right)^{1/2}$, and shows that such $c$ +must satisfy $2 \leq c \leq 2\sqrt{2}$. + +[Er95c] Erdős, P., _Some problems in number theory_. Octogon Math. Mag. (1995), 3-5. + +[Ca25b] Cambie, S., _Longest decreasing sequences of largest prime factors_. + +See also OEIS sequence A391750. +-/ + +open Real + +namespace Erdos648 + +/-- $g(n)$ is the largest $t$ such that there exist integers $2 \leq a_1 < a_2 < \cdots < a_t < n$ +with $P(a_1) > P(a_2) > \cdots > P(a_t)$, where $P(m)$ is the greatest prime factor. -/ +noncomputable def g (n : ℕ) : ℕ := + sSup {t : ℕ | ∃ a : Fin t → ℕ, + (∀ i, 2 ≤ a i ∧ a i < n) ∧ + StrictMono a ∧ + StrictAnti (fun i => Nat.maxPrimeFac (a i))} + +/-- +Erdős Problem 648 (proved by Cambie [Ca25b]): + +$g(n) \asymp \left(\frac{n}{\log n}\right)^{1/2}$, i.e., there exist positive +constants $c_1, c_2$ such that for all sufficiently large $n$, +$$c_1 \sqrt{\frac{n}{\log n}} \leq g(n) \leq c_2 \sqrt{\frac{n}{\log n}}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_648 : + ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + c₁ * Real.sqrt ((n : ℝ) / Real.log (n : ℝ)) ≤ (g n : ℝ) ∧ + (g n : ℝ) ≤ c₂ * Real.sqrt ((n : ℝ) / Real.log (n : ℝ)) := by + sorry + +end Erdos648 diff --git a/FormalConjectures/ErdosProblems/649.lean b/FormalConjectures/ErdosProblems/649.lean new file mode 100644 index 0000000000..1154d2cfd2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/649.lean @@ -0,0 +1,53 @@ +/- +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 649 + +*Reference:* [erdosproblems.com/649](https://www.erdosproblems.com/649) + +Is it true that for any two primes $p, q$ there exists an integer $n$ such that +$P(n) = p$ and $P(n+1) = q$, where $P(m)$ denotes the greatest prime factor of $m$? + +[Er95c] Erdős, P., *Some of my favourite problems which recently have been solved*. + +[Ma35] Mahler, K., *Über den größten Primteiler spezieller Polynome zweiten Grades*. +Archiv för mathematik og naturvidenskab (1935). + +[Ro64b] Rotkiewicz, A., *Sur les nombres naturels n et k tels que les nombres n et nk sont +à la fois pseudopremiers*. Atti Accademia Nazionale dei Lincei, Rendiconti, Classe di Scienze +Fisiche, Matematiche e Naturali, Series 8 (1964), 816–818. +-/ + +namespace Erdos649 + +/-- +Erdős Problem 649 (disproved): + +Is it true that for any two primes $p, q$ there exists an integer $n$ such that +$P(n) = p$ and $P(n+1) = q$, where $P(m)$ denotes the greatest prime factor of $m$? + +The answer is **no**. There are no solutions to $2^k \equiv -1 \pmod{7}$, +so this fails with $p = 2$ and $q = 7$. [Er95c] +-/ +@[category research solved, AMS 11] +theorem erdos_649 : answer(False) ↔ ∀ p q : ℕ, Nat.Prime p → Nat.Prime q → + ∃ n : ℕ, 0 < n ∧ Nat.maxPrimeFac n = p ∧ Nat.maxPrimeFac (n + 1) = q := by + sorry + +end Erdos649 diff --git a/FormalConjectures/ErdosProblems/65.lean b/FormalConjectures/ErdosProblems/65.lean new file mode 100644 index 0000000000..c173166cdf --- /dev/null +++ b/FormalConjectures/ErdosProblems/65.lean @@ -0,0 +1,80 @@ +/- +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 65 + +*Reference:* [erdosproblems.com/65](https://www.erdosproblems.com/65) + +*Related:* Erdős Problem 57. + +Is the sum of reciprocals of distinct cycle lengths in a graph on $n$ vertices with $kn$ +edges minimised by the complete bipartite graph? Gyárfás, Komlós, and Szemerédi [GKS84] +proved $\sum 1/a_i \gg \log k$; Liu and Montgomery [LiMo20] proved the sharp bound. + +Montgomery, Milojević, Pokrovskiy, and Sudakov [MMPS] showed that for sufficiently large +$k$, the sum $\sum 1/a_i$ is in fact *maximised* (not minimised) when $G$ is a complete +bipartite graph, suggesting the original minimisation conjecture is false. + +[GKS84] Gyárfás, A., Komlós, J., and Szemerédi, E., _On the distribution of cycle lengths in +graphs_. J. Graph Theory **8** (1984), 441–462. + +[LiMo20] Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_. +J. Amer. Math. Soc. **36** (2023), 1191–1234. + +[MMPS] Montgomery, R., Milojević, A., Pokrovskiy, A., and Sudakov, B., _forthcoming_. +-/ + +open SimpleGraph Finset + +namespace Erdos65 + +/-- The set of cycle lengths occurring in a simple graph. -/ +def cycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + +/-- +Erdős Problem #65 (Erdős–Hajnal) [GKS84] [LiMo20]: +Let $G$ be a graph with $n$ vertices and $kn$ edges, and let $a_1 < a_2 < \cdots$ be the +distinct lengths of cycles in $G$. Is it true that $\sum 1/a_i \gg \log k$? Is the sum +$\sum 1/a_i$ minimised when $G$ is a complete bipartite graph? + +The first question was proved by Gyárfás, Komlós, and Szemerédi [GKS84]. +Liu and Montgomery [LiMo20] proved the asymptotically sharp lower bound +$\geq (1/2 - o(1)) \log k$. + +Montgomery, Milojević, Pokrovskiy, and Sudakov [MMPS] showed that for sufficiently large +$k$, the sum is actually maximised by the complete bipartite graph, suggesting the original +minimisation conjecture is false. + +The remaining open question is formalized below: for any graph $G$ on $n$ vertices whose edge +count equals $a \cdot b$ for some partition $a + b = n$, the sum of reciprocals of distinct cycle +lengths of $G$ is at least the corresponding sum for the complete bipartite graph $K_{a,b}$. +-/ +@[category research open, AMS 5] +theorem erdos_65 : answer(sorry) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (a b : ℕ), a + b = n → + ∀ [DecidableRel G.Adj], a * b = G.edgeFinset.card → + ∀ (T_G : Finset ℕ), + (↑T_G : Set ℕ) = cycleLengths G → + ∀ (T_K : Finset ℕ), + (↑T_K : Set ℕ) = cycleLengths (completeBipartiteGraph (Fin a) (Fin b)) → + ∑ m ∈ T_K, (1 / (m : ℝ)) ≤ ∑ m ∈ T_G, (1 / (m : ℝ)) := by + sorry + +end Erdos65 diff --git a/FormalConjectures/ErdosProblems/650.lean b/FormalConjectures/ErdosProblems/650.lean new file mode 100644 index 0000000000..f02db08743 --- /dev/null +++ b/FormalConjectures/ErdosProblems/650.lean @@ -0,0 +1,86 @@ +/- +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 650 + +*Reference:* [erdosproblems.com/650](https://www.erdosproblems.com/650) + +Let $f(m)$ denote the largest number guaranteed such that for every $N \geq 1$, +every $m$-element subset $A \subseteq \{1, \ldots, N\}$, and every $t \geq 1$, +the interval $[t, t+2N)$ contains at least $f(m)$ integers that can be matched +to distinct elements of $A$ by divisibility. Erdős and Sarányi proved +$f(m) \gg m^{1/2}$; is it true that $f(m) \ll m^{1/2}$? The answer is yes: +Erdős and Selfridge established $f(m) \ll m^{1/2}$. + +[Er95c] Erdős, P., _Some problems in number theory_. Octogon Math. Mag. (1995), 3–5. + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial + number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, + Graph Theory, and Computing (1978), 29–40. + +[Er86c] Erdős, P., _Some problems on number theory_ (1986), 53–67. + +[ErSa59] Erdős, P. and Sarányi, J., _Über ein Extremalproblem_. Matematikai Lapok (1959). +-/ + +namespace Erdos650 + +/-- The divisibility matching number: given a finite set $A$ of positive integers, +a starting point $t \geq 1$, and a parameter $N$, this is the maximum $r$ such that +there exist $r$ distinct integers $b_1, \ldots, b_r$ in $[t, t + 2N)$ and $r$ distinct +elements $a_1, \ldots, a_r \in A$ with $a_i \mid b_i$. -/ +noncomputable def divMatchCount (A : Finset ℕ) (t N : ℕ) : ℕ := + sSup {r : ℕ | ∃ (b a : Fin r → ℕ), + Function.Injective b ∧ Function.Injective a ∧ + (∀ i, a i ∈ A) ∧ + (∀ i, t ≤ b i ∧ b i < t + 2 * N) ∧ + (∀ i, a i ∣ b i)} + +/-- $f(m)$: the largest value guaranteed in all configurations. For every $N \geq 1$ +and every $m$-element subset $A$ of $\{1, \ldots, N\}$, every interval $[t, t+2N)$ with +$t \geq 1$ contains at least $f(m)$ matchable integers. -/ +noncomputable def erdos650F (m : ℕ) : ℕ := + sInf {c : ℕ | ∃ (N : ℕ) (A : Finset ℕ) (t : ℕ), + A.card = m ∧ (∀ a ∈ A, 1 ≤ a ∧ a ≤ N) ∧ t ≥ 1 ∧ + divMatchCount A t N = c} + +/-- +Erdős Problem 650 [Er95c]: + +Is it true that $f(m) \ll m^{1/2}$? Erdős and Sarányi [ErSa59] proved $f(m) \gg m^{1/2}$, +so this would establish $f(m) \asymp m^{1/2}$. The answer is yes, proved by Erdős and +Selfridge [Er78] [Er86c]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_650 : answer(True) ↔ + (fun m => (erdos650F m : ℝ)) ≪ (fun m => Real.sqrt (m : ℝ)) := by + sorry + +/-- +Erdős Problem 650, stronger variant: + +$f(st) \leq s + t$ for all integers $s, t \geq 1$, which implies +$f(m) \leq 2\lceil\sqrt{m}\rceil$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_650_strong : + ∀ s t : ℕ, 1 ≤ s → 1 ≤ t → erdos650F (s * t) ≤ s + t := by + sorry + +end Erdos650 diff --git a/FormalConjectures/ErdosProblems/651.lean b/FormalConjectures/ErdosProblems/651.lean new file mode 100644 index 0000000000..67c1381883 --- /dev/null +++ b/FormalConjectures/ErdosProblems/651.lean @@ -0,0 +1,100 @@ +/- +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 651 + +*Reference:* [erdosproblems.com/651](https://www.erdosproblems.com/651) + +Let $f_k(n)$ denote the smallest integer such that any $f_k(n)$ points in general +position in $\mathbb{R}^k$ contain $n$ points forming the vertices of a convex polytope. +Erdős conjectured that $f_k(n)$ grows at least exponentially in $n$ for each fixed +$k \geq 2$. This was disproved for $k \geq 3$ by Pohoata and Zakharov, who showed +$f_3(n) \leq 2^{o(n)}$. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[PoZa22] Pohoata, C. and Zakharov, D., _Convex polytopes from fewer points_, +arXiv:2208.04878 (2022). +-/ + +namespace Erdos651 + +/-- A finite point set in $\mathbb{R}^k$ is in general position if any $k+1$ distinct +points are affinely independent (no $k+1$ points lie on a common hyperplane). -/ +def InGeneralPosition (k : ℕ) (P : Finset (EuclideanSpace ℝ (Fin k))) : Prop := + ∀ f : Fin (k + 1) → EuclideanSpace ℝ (Fin k), + (∀ i, f i ∈ P) → Function.Injective f → + AffineIndependent ℝ f + +/-- A finite point set in $\mathbb{R}^k$ is in convex position if no point lies in the +convex hull of the remaining points (the points are the vertices of a convex polytope). -/ +def InConvexPosition (k : ℕ) (S : Finset (EuclideanSpace ℝ (Fin k))) : Prop := + ∀ p ∈ S, p ∉ convexHull ℝ (↑(S.erase p) : Set (EuclideanSpace ℝ (Fin k))) + +/-- $f_k(n)$: the smallest integer $m$ such that any $m$ points in general position +in $\mathbb{R}^k$ contain $n$ points in convex position (forming the vertices of a +convex polytope). -/ +noncomputable def fk (k n : ℕ) : ℕ := + sInf {m : ℕ | ∀ P : Finset (EuclideanSpace ℝ (Fin k)), + P.card = m → + InGeneralPosition k P → + ∃ Q : Finset (EuclideanSpace ℝ (Fin k)), + Q ⊆ P ∧ Q.card = n ∧ InConvexPosition k Q} + +/-- +Erdős Problem 651 [Er97e]: + +Let $f_k(n)$ denote the smallest integer such that any $f_k(n)$ points in general +position in $\mathbb{R}^k$ contain $n$ points forming the vertices of a convex polytope. +The conjecture asks whether $f_k(n)$ grows at least exponentially in $n$ for +each fixed $k \geq 2$, i.e., whether there exists $c_k > 0$ such that +$$f_k(n) > (1 + c_k)^n.$$ + +DISPROVED for $k \geq 3$: Pohoata and Zakharov [PoZa22] proved $f_3(n) \leq 2^{o(n)}$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_651 : answer(False) ↔ + ∀ (k : ℕ), k ≥ 2 → ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (fk k n : ℝ) > (1 + c) ^ n := by + sorry + +/-- +Monotonicity of $f_k(n)$: the convex position number is strictly decreasing in dimension, +i.e., $f_2(n) > f_3(n) > f_4(n) > \cdots$ for all sufficiently large $n$. +Points in general position in $\mathbb{R}^k$ can be projected to $\mathbb{R}^{k-1}$ +while preserving general position, so fewer points suffice in higher dimensions. +-/ +@[category research solved, AMS 5 52] +theorem erdos_651_monotone : + ∀ (k : ℕ), k ≥ 2 → ∀ n : ℕ, fk k n ≥ fk (k + 1) n := by + sorry + +/-- +Pohoata–Zakharov upper bound [PoZa22]: $f_3(n) \leq 2^{o(n)}$, i.e., for every $c > 0$, +$f_3(n) \leq 2^{c \cdot n}$ for all sufficiently large $n$. This disproves the +exponential lower bound conjecture for $k = 3$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_651_pohoata_zakharov : + ∀ c : ℝ, c > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (fk 3 n : ℝ) ≤ 2 ^ (c * n) := by + sorry + +end Erdos651 diff --git a/FormalConjectures/ErdosProblems/652.lean b/FormalConjectures/ErdosProblems/652.lean new file mode 100644 index 0000000000..5b235f84bc --- /dev/null +++ b/FormalConjectures/ErdosProblems/652.lean @@ -0,0 +1,74 @@ +/- +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 652 + +*Reference:* [erdosproblems.com/652](https://www.erdosproblems.com/652) + +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ and let +$R(x_i) = \#\{ |x_j - x_i| : j \neq i \}$, where the points are ordered such that +$R(x_1) \leq \cdots \leq R(x_n)$. + +Let $\alpha_k$ be minimal such that, for all large enough $n$, there exists a set of +$n$ points with $R(x_k) < \alpha_k n^{1/2}$. + +Is it true that $\alpha_k \to \infty$ as $k \to \infty$? + +This was proved in the affirmative. Mathialagan [Ma21] showed that given sets $P$ +($k$ points) and $Q$ ($n$ points) with $2 \leq k \leq n^{1/3}$, some point of $P$ +determines $\gg (kn)^{1/2}$ distances to $Q$, implying +$R(x_k) \gg (kn)^{1/2}$ for $2 \leq k \leq n^{1/3}$. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[Ma21] Mathialagan, S., _On bipartite distinct distances in the plane_. +Electronic Journal of Combinatorics (2021), Paper No. 4.33, 1–25. +-/ + +namespace Erdos652 + +/-- +The number of distinct distances from a point $p$ to other points in a finite set +$S \subset \mathbb{R}^2$. That is, $R(p) = \#\{\operatorname{dist}(p, q) : q \in S, q \neq p\}$. +-/ +noncomputable def numDistinctDistances (p : EuclideanSpace ℝ (Fin 2)) + (S : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + ((S.filter (· ≠ p)).image (dist p)).card + +/-- +Erdős Problem 652: The conjecture that $\alpha_k \to \infty$ is equivalent to: for every +constant $C > 0$, for all sufficiently large $k$, there are infinitely many $n$ such that +every set of $n$ points in $\mathbb{R}^2$ has fewer than $k$ points with fewer than +$C\sqrt{n}$ distinct distances to the rest of the set. + +This was proved in the affirmative by Mathialagan [Ma21]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_652 : + answer(True) ↔ + ∀ C : ℝ, C > 0 → + ∃ K : ℕ, ∀ k : ℕ, k ≥ K → + ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), S.card = n → + (S.filter (fun p => + (numDistinctDistances p S : ℝ) < C * Real.sqrt (↑n))).card < k := by + sorry + +end Erdos652 diff --git a/FormalConjectures/ErdosProblems/653.lean b/FormalConjectures/ErdosProblems/653.lean new file mode 100644 index 0000000000..7537c34a2a --- /dev/null +++ b/FormalConjectures/ErdosProblems/653.lean @@ -0,0 +1,66 @@ +/- +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 653 + +For $n$ points in $\mathbb{R}^2$, let $R(x_i)$ count the number of distinct distances from +$x_i$ to all other points. Let $g(n)$ be the maximum number of distinct values the $R(x_i)$ +can take. Is it true that $g(n) \geq (1 - o(1))n$? + +*Reference:* [erdosproblems.com/653](https://www.erdosproblems.com/653) + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. +-/ + +open Finset Classical + +namespace Erdos653 + +/-- +For a configuration of $n$ points in the Euclidean plane, $R(x_i)$ counts the number +of distinct distances from $x_i$ to all other points. +-/ +noncomputable def distinctDistances (n : ℕ) (x : Fin n → EuclideanSpace ℝ (Fin 2)) + (i : Fin n) : ℕ := + ((Finset.univ.filter (· ≠ i)).image (fun j => dist (x i) (x j))).card + +/-- +For a configuration of $n$ points in the Euclidean plane, the number of distinct +values that $R(x_i)$ takes over all $i$. +-/ +noncomputable def numDistinctR (n : ℕ) (x : Fin n → EuclideanSpace ℝ (Fin 2)) : ℕ := + (Finset.univ.image (fun i => distinctDistances n x i)).card + +/-- +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ and +$R(x_i) = \#\{|x_j - x_i| : j \neq i\}$. Order the points so that +$R(x_1) \leq \cdots \leq R(x_n)$. Let $g(n)$ be the maximum number of distinct +values the $R(x_i)$ can take. Is it true that $g(n) \geq (1 - o(1))n$? [Er97e] +-/ +@[category research open, AMS 52] +theorem erdos_653 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ x : Fin n → EuclideanSpace ℝ (Fin 2), + (numDistinctR n x : ℝ) ≥ (1 - ε) * n := by + sorry + +end Erdos653 diff --git a/FormalConjectures/ErdosProblems/654.lean b/FormalConjectures/ErdosProblems/654.lean new file mode 100644 index 0000000000..3c9ec7291b --- /dev/null +++ b/FormalConjectures/ErdosProblems/654.lean @@ -0,0 +1,79 @@ +/- +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 654 + +*Reference:* [erdosproblems.com/654](https://www.erdosproblems.com/654) + +Let $f(n)$ be such that, given any $x_1, \ldots, x_n \in \mathbb{R}^2$ with no four points on a +circle, there exists some $x_i$ with at least $f(n)$ many distinct distances to other $x_j$. +Is it true that $f(n) > (1/3 + c)n$ for some $c > 0$, for all large $n$? + +The trivial bound is $f(n) \geq (n-1)/3$. The stronger conjecture $f(n) > (1-o(1))n$ +was disproved by Aletheia [Fe26]. + +A problem of Erdős and Pach [Er87b][ErPa90][Er97e]. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167-177. + +[ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, +Combinatorica (1990), 261-269. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527-537. + +[Fe26] Feng, T. et al., _Semi-Autonomous Mathematics Discovery with Gemini: A Case Study on +the Erdős Problems_. arXiv:2601.22401 (2026). +-/ + +open Finset Classical EuclideanGeometry + +open scoped EuclideanGeometry + +namespace Erdos654 + +/-- A configuration of $n$ points in $\mathbb{R}^2$ has no four concyclic points + if no four distinct points lie on a common circle. -/ +def NoFourConcyclic (n : ℕ) (pts : Fin n → ℝ²) : Prop := + ∀ (i₁ i₂ i₃ i₄ : Fin n), + i₁ ≠ i₂ → i₁ ≠ i₃ → i₁ ≠ i₄ → i₂ ≠ i₃ → i₂ ≠ i₄ → i₃ ≠ i₄ → + ¬Concyclic ({pts i₁, pts i₂, pts i₃, pts i₄} : Set ℝ²) + +/-- The number of distinct distances from point $i$ to all other points in the + configuration. -/ +noncomputable def numDistinctDistances (n : ℕ) (pts : Fin n → ℝ²) (i : Fin n) : ℕ := + ((univ.filter (· ≠ i)).image (fun j => dist (pts i) (pts j))).card + +/-- +Erdős Problem 654 [Er87b][ErPa90][Er97e]: + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +given any $n$ points in $\mathbb{R}^2$ with no four on a circle, there exists some +point with at least $(1/3 + c) \cdot n$ distinct distances to the other points. +-/ +@[category research open, AMS 5 52] +theorem erdos_654 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ pts : Fin n → ℝ², Function.Injective pts → + NoFourConcyclic n pts → + ∃ i : Fin n, (numDistinctDistances n pts i : ℝ) > (1 / 3 + c) * ↑n := by + sorry + +end Erdos654 diff --git a/FormalConjectures/ErdosProblems/655.lean b/FormalConjectures/ErdosProblems/655.lean new file mode 100644 index 0000000000..80e12d3f96 --- /dev/null +++ b/FormalConjectures/ErdosProblems/655.lean @@ -0,0 +1,123 @@ +/- +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 655 + +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ be such that no circle centered at one of the $x_i$ +passes through three others. Are there at least $(1 + c) n / 2$ distinct distances for some +constant $c > 0$ and all $n$ sufficiently large? + +This conjecture is **false** as literally stated: Zach Hunter observed that $n$ equally spaced +points on a circle satisfy the hypothesis yet determine only $\lfloor n/2 \rfloor$ distinct +distances, which does not exceed $(1 + c) n / 2$ for any fixed $c > 0$. + +The intended problem likely assumed general position (no three collinear and no four concyclic). +Under such stronger hypotheses, the question remains open. + +A problem of Erdős and Pach [Er97e]. + +*Reference:* [erdosproblems.com/655](https://www.erdosproblems.com/655) + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. +-/ + +namespace Erdos655 + +/-- +A finite set of points in $\mathbb{R}^2$ satisfies the "no three equidistant from a center" +condition if for each point $p$ in the set, no three other distinct points in the +set are equidistant from $p$ (i.e., no circle centered at $p$ passes through three +or more other points). +-/ +def NoThreeEquidistantFromCenter (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ p ∈ P, ∀ q₁ ∈ P, ∀ q₂ ∈ P, ∀ q₃ ∈ P, + p ≠ q₁ → p ≠ q₂ → p ≠ q₃ → + q₁ ≠ q₂ → q₁ ≠ q₃ → q₂ ≠ q₃ → + ¬(dist p q₁ = dist p q₂ ∧ dist p q₂ = dist p q₃) + +/-- +The number of distinct pairwise distances determined by a finite point set in $\mathbb{R}^2$. +-/ +noncomputable def distinctDistanceCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {d : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ d = dist p q} + +/-- +Erdős Problem 655 (Erdős–Pach) [Er97e]: +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ be such that no circle whose centre is one of the $x_i$ +contains three other points. Then the number of distinct distances determined +by the points is at least $(1 + c) \cdot n / 2$ for some constant $c > 0$ and all $n$ +sufficiently large. + +This is **false**: Zach Hunter showed that $n$ equally spaced points on a circle +provide a counterexample. +-/ +@[category research solved, AMS 52] +theorem erdos_655 : answer(False) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + NoThreeEquidistantFromCenter P → + (distinctDistanceCount P : ℝ) ≥ (1 + c) * (n : ℝ) / 2 := by + sorry + +/-- +A finite point set in $\mathbb{R}^2$ has no three collinear if no line contains three or +more of the points. +-/ +def NoThreeCollinear (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = 3 → ¬Collinear ℝ (S : Set (EuclideanSpace ℝ (Fin 2))) + +/-- +Four points in $\mathbb{R}^2$ are concyclic if they all lie on a common circle (with +positive radius). +-/ +def FourPointsConcyclic (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ c : EuclideanSpace ℝ (Fin 2), ∃ r : ℝ, r > 0 ∧ ∀ p ∈ S, dist p c = r + +/-- +A finite point set in $\mathbb{R}^2$ has no four concyclic if every four-element subset +does not lie on a common circle. +-/ +def NoFourConcyclic (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = 4 → ¬FourPointsConcyclic S + +/-- +Erdős Problem 655, general-position variant [Er97e]: +Under the stronger hypothesis that the points are in general position (no three +collinear and no four concyclic), is there a constant $c > 0$ such that +the number of distinct distances is at least $(1 + c) \cdot n / 2$ for all $n$ +sufficiently large? This is believed to be the intended formulation of the +problem. +-/ +@[category research open, AMS 52] +theorem erdos_655_general_position : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + NoThreeCollinear P → + NoFourConcyclic P → + (distinctDistanceCount P : ℝ) ≥ (1 + c) * (n : ℝ) / 2 := by + sorry + +end Erdos655 diff --git a/FormalConjectures/ErdosProblems/656.lean b/FormalConjectures/ErdosProblems/656.lean new file mode 100644 index 0000000000..73841afda1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/656.lean @@ -0,0 +1,57 @@ +/- +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 656 + +*Reference:* [erdosproblems.com/656](https://www.erdosproblems.com/656) + +Let $A \subseteq \mathbb{N}$ have positive upper density. Must there exist an infinite set +$B \subseteq \mathbb{N}$ and an integer $t$ such that $B + B + t \subseteq A$? +This is a density version of Hindman's theorem, and a strengthening of Problem 109. +Solved affirmatively by Kra, Moreira, Richter, and Robertson [KMRR24]. + +[Er75b] Erdős, P., *Problems and results in combinatorial number theory*, +Journées Arithmétiques de Bordeaux (1974), 1975, pp. 295–310. + +[KMRR24] Kra, B., Moreira, J., Richter, F.K., and Robertson, D., +*A proof of Erdős's B+B+t conjecture*, Communications of the American Mathematical Society +(2024), pp. 480–494. +-/ + +open Filter + +namespace Erdos656 + +/-- +**Erdős Problem 656** [Er75b]: + +Let $A \subseteq \mathbb{N}$ have positive upper density. Then there exist an infinite set +$B \subseteq \mathbb{N}$ and an integer $t$ such that $b_1 + b_2 + t \in A$ for all +$b_1, b_2 \in B$ (where the arithmetic is in $\mathbb{Z}$). + +Proved by Kra, Moreira, Richter, and Robertson [KMRR24]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_656 : answer(True) ↔ + ∀ (A : Set ℕ), A.upperDensity > 0 → + ∃ (B : Set ℕ) (t : ℤ), Set.Infinite B ∧ + ∀ b₁ ∈ B, ∀ b₂ ∈ B, ∃ a ∈ A, (a : ℤ) = ↑b₁ + ↑b₂ + t := by + sorry + +end Erdos656 diff --git a/FormalConjectures/ErdosProblems/657.lean b/FormalConjectures/ErdosProblems/657.lean new file mode 100644 index 0000000000..96f977ddb5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/657.lean @@ -0,0 +1,70 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 657 + +*Reference:* [erdosproblems.com/657](https://www.erdosproblems.com/657) + +Is it true that if $A \subseteq \mathbb{R}^2$ is a set of $n$ points with no isosceles triangles +(every $3$-point subset determines $3$ distinct distances), then $A$ must determine at least +$f(n) \cdot n$ distinct distances for some $f(n) \to \infty$? + +- [Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of + Combinatorial Theory (1973), 117–138. +- [Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975. +- [ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, + Combinatorica (1990). +- [Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, + Proc. Int. Conf. on Discrete Math. (1997), 527–533. +- [Du08] Dumitrescu, A., _On distinct distances and λ-free point sets_. Discrete Mathematics + (2008), 6533–6538. +-/ + +open EuclideanGeometry + +namespace Erdos657 + +/-- A finite point set $A \subseteq \mathbb{R}^2$ has no isosceles triangles if every $3$-element +subset determines $3$ distinct pairwise distances. -/ +def NoIsoscelesTriangles (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ A → S.card = 3 → distinctDistances S = 3 + +/-- +**Erdős Problem 657** [Er73, Er75f, ErPa90, Er97e]: + +Is it true that if $A \subseteq \mathbb{R}^2$ is a set of $n$ points such that every $3$-point +subset determines $3$ distinct distances (no isosceles triangles), then the number of distinct +distances determined by $A$ is at least $f(n) \cdot n$ for some $f(n) \to \infty$? + +Equivalently: for every constant $C > 0$, there exists $N_0$ such that every set of $n \geq N_0$ +points in $\mathbb{R}^2$ with no isosceles triangles determines at least $C \cdot n$ distinct +distances. +-/ +@[category research open, AMS 5 52] +theorem erdos_657 : answer(sorry) ↔ + ∀ C : ℝ, 0 < C → + ∃ N₀ : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + NoIsoscelesTriangles A → + N₀ ≤ A.card → + C * (A.card : ℝ) ≤ (distinctDistances A : ℝ) := by + sorry + +end Erdos657 diff --git a/FormalConjectures/ErdosProblems/658.lean b/FormalConjectures/ErdosProblems/658.lean new file mode 100644 index 0000000000..d6df0d280a --- /dev/null +++ b/FormalConjectures/ErdosProblems/658.lean @@ -0,0 +1,97 @@ +/- +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 658 + +Is it true that if $A \subseteq \{1, \ldots, N\}^2$ has $|A| \geq \delta N^2$ then $A$ must +contain the vertices of a square? This is a problem of Graham if the square is restricted to be +axis-aligned; it is unclear whether in [Er97e] Erdős had this restriction in mind. + +The axis-aligned case was proved via the density Hales–Jewett theorem by Furstenberg and +Katznelson [FuKa91], with a quantitative proof given by Solymosi [So04]. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_. +Proc. Int. Conf. on Discrete Math. (1997), 527-537. +[FuKa91] Furstenberg, H. and Katznelson, Y., _A density version of the Hales-Jewett theorem_. +J. Anal. Math. 57 (1991), 64–119. +[So04] Solymosi, J., _A Note on a Question of Erdős and Graham_. +Combin. Probab. Comput. 13 (2004), 263–267. + +*Reference:* [erdosproblems.com/658](https://www.erdosproblems.com/658) +-/ + +open Finset + +namespace Erdos658 + +/-- +A subset $A$ of $\mathbb{N} \times \mathbb{N}$ contains the vertices of an axis-aligned square +if there exist $a, b, d$ with $d \geq 1$ such that all four corners +$(a, b)$, $(a + d, b)$, $(a, b + d)$, $(a + d, b + d)$ lie in $A$. +-/ +def ContainsAxisAlignedSquare (A : Finset (ℕ × ℕ)) : Prop := + ∃ a b d : ℕ, d ≥ 1 ∧ + (a, b) ∈ A ∧ (a + d, b) ∈ A ∧ (a, b + d) ∈ A ∧ (a + d, b + d) ∈ A + +/-- +For any $\delta > 0$, for all sufficiently large $N$, if $A \subseteq \{1, \ldots, N\}^2$ has +$|A| \geq \delta N^2$ then $A$ must contain the vertices of an axis-aligned square. + +This is a problem originally attributed to Graham [Er97e]. The qualitative statement +follows from the density Hales-Jewett theorem proved by Furstenberg and Katznelson [FuKa91]. +A quantitative proof was given by Solymosi [So04]. +-/ +@[category research solved, AMS 5] +theorem erdos_658 : answer(True) ↔ + (∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset (ℕ × ℕ), + A ⊆ Finset.Icc 1 N ×ˢ Finset.Icc 1 N → + (A.card : ℝ) ≥ δ * (N : ℝ) ^ 2 → + ContainsAxisAlignedSquare A) := by + sorry + +/-- +A subset $A$ of $\mathbb{Z} \times \mathbb{Z}$ contains the vertices of a (possibly tilted) +square if there exist integers $a, b, d, e$ with $(d, e) \neq (0, 0)$ such that all four +vertices $(a, b)$, $(a+d, b+e)$, $(a+d-e, b+d+e)$, $(a-e, b+d)$ lie in $A$. +-/ +def ContainsSquare (A : Finset (ℤ × ℤ)) : Prop := + ∃ a b d e : ℤ, (d ≠ 0 ∨ e ≠ 0) ∧ + (a, b) ∈ A ∧ (a + d, b + e) ∈ A ∧ (a + d - e, b + d + e) ∈ A ∧ (a - e, b + d) ∈ A + +/-- +General (tilted) square variant of Erdős Problem 658 [Er97e]: for any $\delta > 0$, +for all sufficiently large $N$, if $A \subseteq \{1, \ldots, N\}^2$ has $|A| \geq \delta N^2$ +then $A$ must contain the vertices of a square (not necessarily axis-aligned). + +It is unclear whether Erdős had the axis-aligned restriction in mind in [Er97e]. This variant +captures the more general interpretation where the square may be tilted. +-/ +@[category research open, AMS 5] +theorem erdos_658_general : answer(sorry) ↔ + (∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A : Finset (ℤ × ℤ), + (∀ p ∈ A, (1 : ℤ) ≤ p.1 ∧ p.1 ≤ N ∧ (1 : ℤ) ≤ p.2 ∧ p.2 ≤ N) → + (A.card : ℝ) ≥ δ * (N : ℝ) ^ 2 → + ContainsSquare A) := by + sorry + +end Erdos658 diff --git a/FormalConjectures/ErdosProblems/660.lean b/FormalConjectures/ErdosProblems/660.lean new file mode 100644 index 0000000000..c46654b16c --- /dev/null +++ b/FormalConjectures/ErdosProblems/660.lean @@ -0,0 +1,69 @@ +/- +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 660 + +*Reference:* [erdosproblems.com/660](https://www.erdosproblems.com/660) + +Let $x_1, \ldots, x_n \in \mathbb{R}^3$ be the vertices of a convex polyhedron. Are there at +least $(1 - o(1))n/2$ many distinct distances between the $x_i$? + +For the similar problem in $\mathbb{R}^2$ there are always at least $n/2$ distances, +as proved by Altman [Al63] (see [93]). + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975. + +[Al63] Altman, E., _On a problem of P. Erdős_, Amer. Math. Monthly 70 (1963), 148–157. +-/ + +namespace Erdos660 + +/-- Points in $\mathbb{R}^3$ are in convex position if every point is a vertex of the + convex hull, i.e., no point lies in the convex hull of the remaining points. -/ +def InConvexPosition3d (P : Finset (EuclideanSpace ℝ (Fin 3))) : Prop := + ∀ p ∈ P, p ∉ convexHull ℝ (↑(P.erase p) : Set (EuclideanSpace ℝ (Fin 3))) + +/-- The number of distinct pairwise distances determined by a finite point set in + $\mathbb{R}^3$. -/ +noncomputable def distinctDistanceCount3d (P : Finset (EuclideanSpace ℝ (Fin 3))) : ℕ := + Set.ncard {d : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ d = dist p q} + +/-- +**Erdős Problem 660** [Er97e, p.531]: + +Let $x_1, \ldots, x_n \in \mathbb{R}^3$ be the vertices of a convex polyhedron. Then the number +of distinct distances determined by these points is at least $(1 - o(1)) \cdot n/2$, +i.e., for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$, the number of +distinct distances is at least $(1 - \varepsilon) \cdot n/2$. +-/ +@[category research open, AMS 52] +theorem erdos_660 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 3)), + P.card = n → + InConvexPosition3d P → + (distinctDistanceCount3d P : ℝ) ≥ (1 - ε) * (n : ℝ) / 2 := by + sorry + +end Erdos660 diff --git a/FormalConjectures/ErdosProblems/661.lean b/FormalConjectures/ErdosProblems/661.lean new file mode 100644 index 0000000000..0ca9f69184 --- /dev/null +++ b/FormalConjectures/ErdosProblems/661.lean @@ -0,0 +1,72 @@ +/- +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 661 + +Erdős and Pach asked whether there exist, for all large $n$, point sets +$x_1, \ldots, x_n, y_1, \ldots, y_n \in \mathbb{R}^2$ such that the number of distinct +bipartite distances $d(x_i, y_j)$ is $o(n / \sqrt{\log n})$. + +*Reference:* [erdosproblems.com/661](https://www.erdosproblems.com/661) + +[ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, +Combinatorica (1990). + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44–48. + +[Er97e] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proc. Int. Conf. on Discrete Math. (1997), 527–533. + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) +-/ + +open Real + +namespace Erdos661 + +/-- The number of distinct bipartite distances between two finite point sets +in $\mathbb{R}^2$, i.e., the number of distinct values $\operatorname{dist}(x, y)$ +for $x \in X$, $y \in Y$. -/ +noncomputable def bipartiteDistinctDistances + (X Y : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + ((X ×ˢ Y).image (fun p => dist p.1 p.2)).card + +/-- +**Erdős Problem 661** [ErPa90, Er92e, Er97e, Er97f]: + +Are there, for all large $n$, some points $x_1, \ldots, x_n, y_1, \ldots, y_n \in \mathbb{R}^2$ +such that the number of distinct distances $d(x_i, y_j)$ is $o(n / \sqrt{\log n})$? + +Formulated as: for every $\varepsilon > 0$, there exists $N$ such that for all $n \geq N$, +there exist $X, Y \subset \mathbb{R}^2$ with $|X| = n$, $|Y| = n$, and the number of distinct +bipartite distances is at most $\varepsilon \cdot n / \sqrt{\log n}$. +-/ +@[category research open, AMS 5 52] +theorem erdos_661 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ X Y : Finset (EuclideanSpace ℝ (Fin 2)), + X.card = n ∧ Y.card = n ∧ + (bipartiteDistinctDistances X Y : ℝ) ≤ + ε * (n : ℝ) / Real.sqrt (Real.log (n : ℝ)) := by + sorry + +end Erdos661 diff --git a/FormalConjectures/ErdosProblems/662.lean b/FormalConjectures/ErdosProblems/662.lean new file mode 100644 index 0000000000..10ef44f656 --- /dev/null +++ b/FormalConjectures/ErdosProblems/662.lean @@ -0,0 +1,78 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 662 + +*Reference:* [erdosproblems.com/662](https://www.erdosproblems.com/662) + +Consider the triangular lattice with minimal distance between two points $1$. +Denote by $f(t)$ the number of lattice points within distance $t$ of any fixed +lattice point. For example $f(1) = 6$, $f(\sqrt{3}) = 12$. + +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ be such that $d(x_i, x_j) \geq 1$ for +all $i \neq j$. Is it true that, provided $n$ is sufficiently large depending on +$t$, the number of ordered pairs $(i, j)$ with $i \neq j$ and $d(x_i, x_j) \leq t$ +is at most $n \cdot f(t)$? + +Note: The original problem statement in [Er97e] contains apparent typos and is +acknowledged as ambiguous. This formalization captures what appears to be the +most natural interpretation: among unit-separated point sets, the triangular +lattice maximizes the number of close pairs. + +A problem of Erdős, Lovász, and Vesztergombi. +-/ + +open Classical +open scoped EuclideanGeometry + +namespace Erdos662 + +/-- $f(t)$ is the number of integer pairs $(a, b) \neq (0, 0)$ with +$a^2 + ab + b^2 \leq t^2$, which equals the number of neighbors within distance +$t$ of any point in the triangular lattice (with unit minimal distance). The +squared distance from the origin to lattice point $(a, b)$ in the triangular +lattice is $a^2 + ab + b^2$. -/ +noncomputable def triangularLatticeNeighborCount (t : ℝ) : ℕ := + Set.ncard {p : ℤ × ℤ | p ≠ (0, 0) ∧ + ((p.1 : ℝ) ^ 2 + (p.1 : ℝ) * (p.2 : ℝ) + (p.2 : ℝ) ^ 2) ≤ t ^ 2} + +/-- The number of ordered pairs of distinct points in $P$ with distance at most $t$. -/ +noncomputable def closePairCount + (P : Finset (ℝ²)) (t : ℝ) : ℕ := + ((P ×ˢ P).filter (fun pq => pq.1 ≠ pq.2 ∧ dist pq.1 pq.2 ≤ t)).card + +/-- +**Erdős Problem 662** [Er97e, p.532]: + +Among $n$ points in $\mathbb{R}^2$ with minimum pairwise distance $\geq 1$, is +the number of ordered pairs at distance $\leq t$ at most $n \cdot f(t)$, where +$f(t)$ is the number of neighbors within distance $t$ in the triangular lattice? +-/ +@[category research open, AMS 52] +theorem erdos_662 : answer(sorry) ↔ + ∀ t : ℝ, t > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (ℝ²), + P.card = n → + (∀ p ∈ P, ∀ q ∈ P, p ≠ q → dist p q ≥ 1) → + closePairCount P t ≤ n * triangularLatticeNeighborCount t := by + sorry + +end Erdos662 diff --git a/FormalConjectures/ErdosProblems/663.lean b/FormalConjectures/ErdosProblems/663.lean new file mode 100644 index 0000000000..670770c0b2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/663.lean @@ -0,0 +1,87 @@ +/- +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 663 + +*Reference:* [erdosproblems.com/663](https://www.erdosproblems.com/663) + +Let $k \geq 2$ and $q(n, k)$ denote the least prime which does not divide +$\prod_{1 \leq i \leq k} (n + i)$. Is it true that, if $k$ is fixed and $n$ is +sufficiently large, we have $q(n, k) < (1 + o(1)) \log n$? + +A problem of Erdős and Pomerance [BEGL96][Er97e]. + +The bound $q(n, k) < (1 + o(1)) k \log n$ is easy. It may be true that this +improved bound holds even up to $k = o(\log n)$. + +See also problem 457. + +[BEGL96] Balog, A., Erdős, P., Graham, R. L., and Leep, D. + +[Er97e] Erdős, P. +-/ + +open scoped BigOperators + +namespace Erdos663 + +/-- $q(n, k)$ is the least prime which does not divide $\prod_{i=1}^{k} (n + i)$. +Returns $0$ if no such prime exists (which cannot happen since a finite +product has only finitely many prime factors). -/ +noncomputable def leastNondividingPrime (n k : ℕ) : ℕ := + sInf {p : ℕ | Nat.Prime p ∧ ¬(p ∣ ∏ i ∈ Finset.range k, (n + i + 1))} + +/-- +Erdős Problem 663 [BEGL96][Er97e]: + +Is it true that for any fixed $k \geq 2$, $q(n, k) < (1 + o(1)) \log n$ as $n \to \infty$, +where $q(n, k)$ is the least prime not dividing $\prod_{i=1}^{k} (n + i)$? + +Formulated as: for every $\varepsilon > 0$ and every $k \geq 2$, there exists $N_0$ such that +for all $n \geq N_0$, $q(n, k) < (1 + \varepsilon) \cdot \log n$. +-/ +@[category research open, AMS 11] +theorem erdos_663 : answer(sorry) ↔ + ∀ (k : ℕ), k ≥ 2 → + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (leastNondividingPrime n k : ℝ) < (1 + ε) * Real.log (n : ℝ) := by + sorry + +/-- +Variant of Erdős Problem 663: + +It may be true that the bound $q(n, k) < (1 + o(1)) \log n$ holds even when $k$ grows with $n$, +as long as $k = o(\log n)$. This strengthens the main conjecture by allowing $k$ to depend on $n$ +rather than being fixed. + +Formulated as: for every function $f : \mathbb{N} \to \mathbb{N}$ with $f(n) / \log n \to 0$, +and every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$q(n, f(n)) < (1 + \varepsilon) \cdot \log n$. +-/ +@[category research open, AMS 11] +theorem erdos_663_growing_k : answer(sorry) ↔ + ∀ f : ℕ → ℕ, + Filter.Tendsto (fun n => (f n : ℝ) / Real.log (n : ℝ)) Filter.atTop (nhds 0) → + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (leastNondividingPrime n (f n) : ℝ) < (1 + ε) * Real.log (n : ℝ) := by + sorry + +end Erdos663 diff --git a/FormalConjectures/ErdosProblems/664.lean b/FormalConjectures/ErdosProblems/664.lean new file mode 100644 index 0000000000..31b0f6c0d4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/664.lean @@ -0,0 +1,68 @@ +/- +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 664 + +*Reference:* [erdosproblems.com/664](https://www.erdosproblems.com/664) + +Let $c < 1$ be some constant and $A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ be such that +$|A_i| > c\sqrt{n}$ for all $i$ and $|A_i \cap A_j| \leq 1$ for all $i \neq j$. + +Must there exist some set $B$ such that $B \cap A_i \neq \emptyset$ and +$|B \cap A_i| \ll_c 1$ for all $i$? + +This was disproved by Alon, who showed that for $c = 2/5$ and appropriate families derived +from random subsets of lines of a projective plane, any transversal $B$ must intersect +some $A_j$ in $\Omega(\log n)$ points. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_ (1997). + +See also: Erdős Problem 1159 for the weaker projective plane variant. +-/ + +open Finset + +namespace Erdos664 + +/-- +Erdős Problem 664 (Disproved) [Er81][Er97f]: + +Let $c < 1$ be some constant and $A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ with +$|A_i| > c\sqrt{n}$ for all $i$ and $|A_i \cap A_j| \leq 1$ for $i \neq j$. Must there +exist a transversal $B$ (meeting every $A_i$) such that $|B \cap A_i| \leq K$ for all $i$, +where $K$ depends only on $c$? + +Disproved by Alon using random subsets of lines of a projective plane, with $c = 2/5$. +-/ +@[category research solved, AMS 5] +theorem erdos_664 : answer(False) ↔ + ∀ c : ℝ, 0 < c → c < 1 → + ∃ K : ℕ, ∀ n m : ℕ, ∀ A : Fin m → Finset (Fin n), + (∀ i, (↑(A i).card : ℝ) > c * Real.sqrt ↑n) → + (∀ i j, i ≠ j → ((A i) ∩ (A j)).card ≤ 1) → + ∃ B : Finset (Fin n), + (∀ i, ((A i) ∩ B).Nonempty) ∧ + (∀ i, ((A i) ∩ B).card ≤ K) := by + sorry + +end Erdos664 diff --git a/FormalConjectures/ErdosProblems/665.lean b/FormalConjectures/ErdosProblems/665.lean new file mode 100644 index 0000000000..443c6fef5f --- /dev/null +++ b/FormalConjectures/ErdosProblems/665.lean @@ -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 665 + +*Reference:* [erdosproblems.com/665](https://www.erdosproblems.com/665) + +A pairwise balanced design for $\{1, \ldots, n\}$ is a collection of sets +$A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ such that $2 \leq |A_i| < n$ and every pair +of distinct elements $x, y \in \{1, \ldots, n\}$ is contained in exactly one $A_i$. + +See also Problem 723 for the conjecture that the order of every projective plane is a +prime power. + +[ErLa82] Erdős, P. and Larson, J. A., _On pairwise balanced block designs with the sizes +of blocks as uniform as possible_. Annals of Discrete Mathematics (1982), 129–134. + +[ShSi85] Shrikhande, S. S. and Singhi, N. M., _On a problem of Erdős and Larson_. +Combinatorica (1985), 351–358. + +[Er97f, p.3] Erdős, P., _Some unsolved problems_. Combinatorics, geometry and probability +(Cambridge, 1993) (1997), 1–10. +-/ + +open Finset + +namespace Erdos665 + +/-- A pairwise balanced design on `Fin n`: a family of blocks where each block has +at least $2$ and fewer than $n$ elements, and every pair of distinct elements is +contained in exactly one block. -/ +def IsPairwiseBalancedDesign (n : ℕ) (blocks : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ blocks, 2 ≤ B.card ∧ B.card < n) ∧ + (∀ x y : Fin n, x ≠ y → ∃! B, B ∈ blocks ∧ x ∈ B ∧ y ∈ B) + +/-- +Erdős Problem 665 [ErLa82][Er97f]: + +Is there a constant $C > 0$ such that for all sufficiently large $n$, there exists +a pairwise balanced design on $\{1, \ldots, n\}$ where every block has size +$> \sqrt{n} - C$? + +Shrikhande and Singhi [ShSi85] proved that the answer is no conditional on the +conjecture that the order of every projective plane is a prime power. +-/ +@[category research open, AMS 5] +theorem erdos_665 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ blocks : Finset (Finset (Fin n)), + IsPairwiseBalancedDesign n blocks ∧ + ∀ B ∈ blocks, (↑B.card : ℝ) > Real.sqrt ↑n - C := by + sorry + +/-- +Erdős Problem 665, general variant [ErLa82][Er97f]: + +Find the slowest-growing function $h(n)$ such that for all sufficiently large $n$, +there exists a pairwise balanced design on $\{1, \ldots, n\}$ where every block has size +$> \sqrt{n} - h(n)$. + +Erdős and Larson [ErLa82] proved that $h(n) \ll n^{1/2 - c}$ for some $c > 0$. +Under the conjecture that the order of every projective plane is a prime power +(Problem 723), Shrikhande and Singhi [ShSi85] showed $h(n) \asymp H(n)$, +where $H(n)$ is the largest prime gap below $n$. +-/ +@[category research open, AMS 5] +theorem erdos_665_general : + ∃ h : ℕ → ℝ, + (∀ ε > 0, ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → h n ≤ ε * (↑n : ℝ) ^ ((1 : ℝ) / 2)) ∧ + (∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ blocks : Finset (Finset (Fin n)), + IsPairwiseBalancedDesign n blocks ∧ + ∀ B ∈ blocks, (↑B.card : ℝ) > Real.sqrt ↑n - h n) ∧ + (∀ h' : ℕ → ℝ, + (∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ blocks : Finset (Finset (Fin n)), + IsPairwiseBalancedDesign n blocks ∧ + ∀ B ∈ blocks, (↑B.card : ℝ) > Real.sqrt ↑n - h' n) → + ∃ C > 0, ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → h n ≤ C * h' n) := by + sorry + +end Erdos665 diff --git a/FormalConjectures/ErdosProblems/666.lean b/FormalConjectures/ErdosProblems/666.lean new file mode 100644 index 0000000000..d383daeee5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/666.lean @@ -0,0 +1,88 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 666 + +*Reference:* [erdosproblems.com/666](https://www.erdosproblems.com/666) + +Let $Q_n$ be the $n$-dimensional hypercube graph (so that $Q_n$ has $2^n$ vertices +and $n \cdot 2^{n-1}$ edges). Is it true that, for every $\epsilon > 0$, if $n$ is +sufficiently large, every subgraph of $Q_n$ with $\geq \epsilon \cdot n \cdot 2^{n-1}$ +many edges contains a $C_6$? + +The answer is no: Chung [Ch92] and Brouwer, Dejter, and Thomassen [BDT93] constructed +an edge-partition of $Q_n$ into four subgraphs, each containing no $C_6$. + +[Er91] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. +Matematiche (Catania) 47 (1992), no. 2, 231-240 (1993). + +[Er92b] Erdős, P., *Some of my old and new problems in elementary number theory and +geometry*. Proceedings of the Fifth Canadian Number Theory Association Conference (1992). + +[Er97f] Erdős, P., *Some recent problems and results in graph theory*. Discrete Math. +164 (1997), no. 1-3, 81-85. + +[Ch92] Chung, F., *Subgraphs of a hypercube containing no small even cycles*. J. Graph +Theory 16 (1992), no. 3, 273-286. + +[BDT93] Brouwer, A. E., Dejter, I. J., and Thomassen, C., *Highly symmetric subgraphs +of hypercubes*. J. Algebraic Combin. 2 (1993), no. 1, 25-29. +-/ + +open SimpleGraph Finset + +namespace Erdos666 + +/-- The $n$-dimensional hypercube graph $Q_n$. Vertices are functions +$\operatorname{Fin} n \to \operatorname{Bool}$, and two vertices are adjacent iff they +differ in exactly one coordinate. -/ +def hypercubeGraph (n : ℕ) : SimpleGraph (Fin n → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm u v := by + rintro ⟨hne, hcard⟩ + refine ⟨hne.symm, ?_⟩ + have heq : (Finset.univ.filter fun i => v i ≠ u i) = + (Finset.univ.filter fun i => u i ≠ v i) := + Finset.filter_congr (fun i _ => ne_comm) + rw [heq] + exact hcard + loopless v := fun ⟨hne, _⟩ => hne rfl + +/-- +Erdős Problem 666 (disproved) [Er91][Er92b][Er97f]: + +Is it true that, for every $\epsilon > 0$, if $n$ is sufficiently large, every subgraph of $Q_n$ +with $\geq \epsilon \cdot n \cdot 2^{n-1}$ edges contains a $C_6$? + +The answer is no. Chung [Ch92] and Brouwer, Dejter, and Thomassen [BDT93] constructed +an edge-partition of $Q_n$ into four subgraphs, each containing no $C_6$. +-/ +@[category research solved, AMS 5] +theorem erdos_666 : answer(False) ↔ + (∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ H : SimpleGraph (Fin n → Bool), + (∀ u v, H.Adj u v → (hypercubeGraph n).Adj u v) → + (↑(H.edgeFinset.card) : ℝ) ≥ ε * ↑n * (2 : ℝ) ^ (n - 1 : ℕ) → + ∃ f : Fin 6 → (Fin n → Bool), Function.Injective f ∧ + ∀ i j, (SimpleGraph.cycleGraph 6).Adj i j → H.Adj (f i) (f j)) := by + sorry + +end Erdos666 diff --git a/FormalConjectures/ErdosProblems/667.lean b/FormalConjectures/ErdosProblems/667.lean new file mode 100644 index 0000000000..241c7b81d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/667.lean @@ -0,0 +1,75 @@ +/- +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 667 + +*Reference:* [erdosproblems.com/667](https://www.erdosproblems.com/667) + +Let $p, q \geq 1$ be fixed integers. Define $H(n) = H(n; p, q)$ to be the largest $m$ +such that any graph on $n$ vertices where every set of $p$ vertices spans at least +$q$ edges must contain a complete graph on $m$ vertices. + +Is $c(p, q) = \liminf_{n \to \infty} \frac{\log H(n; p, q)}{\log n}$ a strictly increasing +function of $q$ for $1 \leq q \leq \binom{p-1}{2} + 1$? + +A problem of Erdős, Faudree, Rousseau, and Schelp [Er97f]. + +[Er97f] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R. +-/ + +open SimpleGraph Finset Filter Classical + +namespace Erdos667 + +/-- The number of edges of $G$ within a subset $S$ of vertices: +the count of pairs $(u, v)$ with $u < v$, both in $S$, that are adjacent in $G$. -/ +noncomputable def edgesInSubset {n : ℕ} (G : SimpleGraph (Fin n)) + (S : Finset (Fin n)) : ℕ := + ((S ×ˢ S).filter fun e => e.1 < e.2 ∧ G.Adj e.1 e.2).card + +/-- A graph on $n$ vertices has the $(p, q)$-density property if every $p$-element +subset spans at least $q$ edges. -/ +def HasDensityProperty {n : ℕ} (G : SimpleGraph (Fin n)) (p q : ℕ) : Prop := + ∀ S : Finset (Fin n), S.card = p → edgesInSubset G S ≥ q + +/-- $H(n; p, q)$: the largest $m$ such that every graph on $n$ vertices with the +$(p, q)$-density property must contain a clique of size $m$. -/ +noncomputable def erdosH (n p q : ℕ) : ℕ := + sSup {m : ℕ | ∀ G : SimpleGraph (Fin n), + HasDensityProperty G p q → ∃ S : Finset (Fin n), G.IsNClique m S} + +/-- $c(p, q) = \liminf_{n \to \infty} \frac{\log H(n; p, q)}{\log n}$. -/ +noncomputable def erdosC (p q : ℕ) : ℝ := + Filter.liminf (fun n : ℕ => Real.log (erdosH n p q : ℝ) / Real.log (n : ℝ)) + Filter.atTop + +/-- +Erdős Problem 667 [Er97f]: + +Is $c(p, q)$ strictly increasing in $q$ for $1 \leq q \leq \binom{p-1}{2} + 1$? + +That is, for all $q$ with $1 \leq q < \binom{p-1}{2} + 1$, we have $c(p, q) < c(p, q+1)$. +-/ +@[category research open, AMS 5] +theorem erdos_667 : answer(sorry) ↔ + ∀ (p : ℕ), p ≥ 1 → ∀ (q : ℕ), 1 ≤ q → q < (p - 1).choose 2 + 1 → + erdosC p q < erdosC p (q + 1) := by + sorry + +end Erdos667 diff --git a/FormalConjectures/ErdosProblems/668.lean b/FormalConjectures/ErdosProblems/668.lean new file mode 100644 index 0000000000..e28d1404a1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/668.lean @@ -0,0 +1,107 @@ +/- +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.Geometry.Metric +import FormalConjecturesForMathlib.Geometry.«2d» + +/-! +# Erdős Problem 668 + +*Reference:* [erdosproblems.com/668](https://www.erdosproblems.com/668) + +Is it true that the number of incongruent sets of $n$ points in $\mathbb{R}^2$ which +maximise the number of unit distances tends to infinity as $n \to \infty$? +Is it always $> 1$ for $n > 3$? + +In fact this is $= 1$ also for $n = 4$, the unique example given by two +equilateral triangles joined by an edge. + +The actual maximal number of unit distances is the subject of problem #90. + +[Er97f] Erdős, P., _Some of my favourite problems which recently have been solved_. +Proceedings of the International Conference on Set-theoretic Topology and its Applications +(Matsuyama, 1994) (1997), 59-79. + +[EHSVZ25] Engel, P., Hammond-Lee, O., Su, Y., Varga, D., Zsámboki, P., _Diverse beam search +to find densest-known planar unit distance graphs_. arXiv:2406.15317 (2025). + +[AMP25] Alexeev, B., Mixon, D., Parshall, H., _The Erdős unit distance problem for small +point sets_. arXiv:2412.11914 (2025). +-/ + +open scoped EuclideanGeometry + +namespace Erdos668 + +/-- The maximum number of unit distance pairs among all $n$-point + sets in $\mathbb{R}^2$. -/ +noncomputable def maxUnitDistances (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ P : Finset ℝ², + P.card = n ∧ unitDistNum P = k} + +/-- Two finite point sets in $\mathbb{R}^2$ are congruent if there is a distance-preserving + map of $\mathbb{R}^2$ sending one onto the other. -/ +def AreCongruent + (P Q : Finset ℝ²) : Prop := + ∃ f : ℝ² → ℝ², + (∀ x y, dist (f x) (f y) = dist x y) ∧ + f '' (↑P : Set ℝ²) = ↑Q + +/-- +**Erdős Problem 668** [Er97f]: + +Is it true that the number of incongruent $n$-point sets in $\mathbb{R}^2$ maximising the number of +unit distances tends to infinity as $n \to \infty$? + +Formulated as: for every $M$, there exists $N$ such that for all $n \ge N$, there +exist $M$ pairwise non-congruent $n$-point sets each achieving the maximum +unit distance count. +-/ +@[category research open, AMS 5 52] +theorem erdos_668 : + answer(sorry) ↔ + ∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (Ps : Fin M → Finset ℝ²), + (∀ i, (Ps i).card = n ∧ + unitDistNum (Ps i) = maxUnitDistances n) ∧ + (∀ i j, i ≠ j → ¬AreCongruent (Ps i) (Ps j)) := by + sorry + +/-- +**Erdős Problem 668, Part 2** [Er97f]: + +For every $n > 3$, do there exist at least two incongruent $n$-point sets in $\mathbb{R}^2$ +achieving the maximum number of unit distances? + +Note: the additional commentary on the problem states that the count of +incongruent maximisers is in fact $= 1$ for $n = 4$, so this part of the +conjecture may be false as stated. Computational evidence [EHSVZ25] [AMP25] +suggests uniqueness (up to graph isomorphism, which implies uniqueness up to +congruence) for $5 \le n \le 21$. +-/ +@[category research open, AMS 5 52] +theorem erdos_668.variants.part2 : + answer(sorry) ↔ + ∀ (n : ℕ), n > 3 → + ∃ (P Q : Finset ℝ²), + P.card = n ∧ Q.card = n ∧ + unitDistNum P = maxUnitDistances n ∧ + unitDistNum Q = maxUnitDistances n ∧ + ¬AreCongruent P Q := by + sorry + +end Erdos668 diff --git a/FormalConjectures/ErdosProblems/669.lean b/FormalConjectures/ErdosProblems/669.lean new file mode 100644 index 0000000000..7a391069d5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/669.lean @@ -0,0 +1,119 @@ +/- +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 669 + +*Reference:* [erdosproblems.com/669](https://www.erdosproblems.com/669) + +Let $F_k(n)$ be minimal such that for any $n$ points in $\mathbb{R}^2$ there +exist at most $F_k(n)$ many distinct lines passing through at least $k$ of the +points, and $f_k(n)$ similarly but with lines passing through exactly $k$ points. + +Estimate $f_k(n)$ and $F_k(n)$ — in particular, determine $\lim F_k(n)/n^2$ +and $\lim f_k(n)/n^2$. + +Trivially $f_k(n) \leq F_k(n)$ and $f_2(n) = F_2(n) = \binom{n}{2}$. +The problem with $k = 3$ is the classical 'Orchard problem' of Sylvester. +Burr, Grünbaum, and Sloane [BGS74] proved that $f_3(n) = n^2/6 - O(n)$ and +$F_3(n) = n^2/6 - O(n)$. + +There is a trivial upper bound $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$, +hence $\lim F_k(n)/n^2 \leq 1/(k(k-1))$. + +A problem of Erdős [Er97f]. See also problem \#101. + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in +combinatorial geometry_. (1997). + +[BGS74] Burr, S. A., Grünbaum, B., and Sloane, N. J. A., _The orchard problem_. +Geometriae Dedicata (1974), 397–424. + +OEIS sequences: [A003035](https://oeis.org/A003035), +[A006065](https://oeis.org/A006065), [A008997](https://oeis.org/A008997). +-/ + +open Classical + +namespace Erdos669 + +/-- The number of affine lines in $\mathbb{R}^2$ passing through at least $k$ points +from a finite point set $P$. -/ +noncomputable def atLeastKPointLineCount + (P : Finset (EuclideanSpace ℝ (Fin 2))) (k : ℕ) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + k ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} + +/-- The number of affine lines in $\mathbb{R}^2$ passing through exactly $k$ points +from a finite point set $P$. -/ +noncomputable def exactlyKPointLineCount + (P : Finset (EuclideanSpace ℝ (Fin 2))) (k : ℕ) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L} = k} + +/-- $F_k(n)$: the maximum over all $n$-point sets $P \subseteq \mathbb{R}^2$ of the number of +lines passing through at least $k$ points of $P$. -/ +noncomputable def bigF (k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n ∧ atLeastKPointLineCount P k = m} + +/-- $f_k(n)$: the maximum over all $n$-point sets $P \subseteq \mathbb{R}^2$ of the number of +lines passing through exactly $k$ points of $P$. -/ +noncomputable def littleF (k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n ∧ exactlyKPointLineCount P k = m} + +/-- +**Erdős Problem 669, Part 1** [Er97f]: + +The limit $\lim_{n \to \infty} F_k(n)/n^2$ exists for all $k \geq 2$. +-/ +@[category research open, AMS 5 52] +theorem erdos_669 (k : ℕ) (hk : k ≥ 2) : + ∃ L : ℝ, ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + |((bigF k n : ℝ) / (n : ℝ) ^ 2) - L| ≤ ε := by + sorry + +/-- +**Erdős Problem 669, Part 2** [Er97f]: + +The limit $\lim_{n \to \infty} f_k(n)/n^2$ exists for all $k \geq 2$. +-/ +@[category research open, AMS 5 52] +theorem erdos_669.variants.littleF_limit_exists (k : ℕ) (hk : k ≥ 2) : + ∃ L : ℝ, ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + |((littleF k n : ℝ) / (n : ℝ) ^ 2) - L| ≤ ε := by + sorry + +/-- +**Erdős Problem 669, trivial upper bound**: + +$F_k(n) \leq n(n-1)/(k(k-1))$ for all $n$ and $k \geq 2$. +This follows from $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$ since each line +through at least $k$ points accounts for at least $\binom{k}{2}$ pairs. +-/ +@[category undergraduate, AMS 5 52] +theorem erdos_669.variants.trivial_bound (k : ℕ) (hk : k ≥ 2) (n : ℕ) : + (bigF k n : ℝ) ≤ (n : ℝ) * ((n : ℝ) - 1) / ((k : ℝ) * ((k : ℝ) - 1)) := by + sorry + +end Erdos669 diff --git a/FormalConjectures/ErdosProblems/670.lean b/FormalConjectures/ErdosProblems/670.lean new file mode 100644 index 0000000000..11e27aaf4e --- /dev/null +++ b/FormalConjectures/ErdosProblems/670.lean @@ -0,0 +1,67 @@ +/- +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 670 + +*Reference:* [erdosproblems.com/670](https://www.erdosproblems.com/670) + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) +-/ + +open Metric + +namespace Erdos670 + +/-- +All pairwise distances in a finite point set are separated by at least $1$: +for any two distinct unordered pairs $\{a, b\}$ and $\{c, d\}$ of points from $A$ +(where $a \neq b$ and $c \neq d$), $|d(a, b) - d(c, d)| \geq 1$. +-/ +def AllPairwiseDistsSeparatedByOne {X : Type*} [PseudoMetricSpace X] + (A : Finset X) : Prop := + ∀ a b c d : X, a ∈ A → b ∈ A → c ∈ A → d ∈ A → + a ≠ b → c ≠ d → + (a ≠ c ∨ b ≠ d) → (a ≠ d ∨ b ≠ c) → + |dist a b - dist c d| ≥ 1 + +/-- +Let $A \subseteq \mathbb{R}^d$ be a set of $n$ points such that all pairwise distances differ by +at least $1$. Is the diameter of $A$ at least $(1 + o(1))n^2$? + +The lower bound of $\binom{n}{2}$ for the diameter is trivial. Erdős [Er97f] proved +the claim when $d = 1$. + +Formalized as: for every $\varepsilon > 0$, there exists $N$ such that for all $n \geq N$, for +every dimension $d$ and every set $A$ of $n$ points in $\mathbb{R}^d$ with all pairwise +distances differing by at least $1$, the diameter of $A$ is at least $(1 - \varepsilon) \cdot n^2$. +-/ +@[category research open, AMS 52] +theorem erdos_670 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ d : ℕ, + ∀ A : Finset (EuclideanSpace ℝ (Fin d)), + A.card = n → + AllPairwiseDistsSeparatedByOne A → + (1 - ε) * (n : ℝ) ^ 2 ≤ + Metric.diam (A : Set (EuclideanSpace ℝ (Fin d))) := by + sorry + +end Erdos670 diff --git a/FormalConjectures/ErdosProblems/671.lean b/FormalConjectures/ErdosProblems/671.lean new file mode 100644 index 0000000000..f75dd411af --- /dev/null +++ b/FormalConjectures/ErdosProblems/671.lean @@ -0,0 +1,111 @@ +/- +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 671 + +*Reference:* [erdosproblems.com/671](https://www.erdosproblems.com/671) + +Given nodes $a_i^n \in [-1,1]$ for $1 \leq i \leq n$, define $p_i^n$ as the +Lagrange basis polynomial of degree $n-1$ (satisfying $p_i^n(a_i^n) = 1$ and +$p_i^n(a_j^n) = 0$ for $j \neq i$) and the Lagrange interpolation operator +$$\mathcal{L}^n f(x) = \sum_i f(a_i^n) p_i^n(x).$$ + +Part 1: Is there a triangular array of nodes in $[-1,1]$ such that for every +continuous $f: [-1,1] \to \mathbb{R}$ there exists $x \in [-1,1]$ where the +Lebesgue function $\sum_i |p_i^n(x)|$ has infinite limsup yet +$\mathcal{L}^n f(x) \to f(x)$? + +Part 2: Is there such an array where the Lebesgue function has infinite limsup +for every $x \in [-1,1]$ and yet for every continuous $f$ there exists $x$ with +$\mathcal{L}^n f(x) \to f(x)$? + +Bernstein [Be31] proved that for any choice of interpolation points, there exists a point +where the Lebesgue function diverges. Erdős and Vértesi [ErVe80] proved that for any choice +of nodes there exists a continuous $f$ such that the Lagrange interpolation diverges at +almost all points. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) +[Va99] Vértesi, P., _Classical (unweighted) and weighted interpolation_ (1999). +[Be31] Bernstein, S., _Sur la limitation des valeurs d'un polynome de degré n sur tout un +segment par ses valeurs en (n+1) points du segment_. Izv. Akad. Nauk. SSSR (1931), +1025–1050. +[ErVe80] Erdős, P., Vértesi, P., _On the almost everywhere divergence of Lagrange +interpolatory polynomials for arbitrary system of nodes_. Acta Math. Acad. Sci. Hungar. +(1980), 71–89. +-/ + +open scoped BigOperators + +open Filter Set Finset + +namespace Erdos671 + +/-- The value of the $i$-th Lagrange basis polynomial for nodes $a$ at point $x$. +This is $\prod_{j \neq i} (x - a_j) / (a_i - a_j)$. -/ +noncomputable def lagrangeBasisEval {n : ℕ} (a : Fin n → ℝ) (i : Fin n) (x : ℝ) : ℝ := + ∏ j ∈ univ.erase i, (x - a j) / (a i - a j) + +/-- The Lebesgue function: $\Lambda_n(x) = \sum_i |p_i^n(x)|$. -/ +noncomputable def lebesgueFunction {n : ℕ} (a : Fin n → ℝ) (x : ℝ) : ℝ := + ∑ i : Fin n, |lagrangeBasisEval a i x| + +/-- The Lagrange interpolation of $f$ at nodes $a$, evaluated at $x$: +$L^n f(x) = \sum_i f(a_i) \cdot p_i(x)$. -/ +noncomputable def lagrangeInterpolation {n : ℕ} (a : Fin n → ℝ) (f : ℝ → ℝ) (x : ℝ) : ℝ := + ∑ i : Fin n, f (a i) * lagrangeBasisEval a i x + +/-- +Erdős Problem 671 (Part 1): Is there a triangular array of distinct nodes +in $[-1,1]$ such that for every continuous $f : [-1,1] \to \mathbb{R}$, there exists +$x \in [-1,1]$ where the Lebesgue function has infinite limsup yet the Lagrange +interpolation converges to $f(x)$? +-/ +@[category research open, AMS 41] +theorem erdos_671 : answer(sorry) ↔ + ∃ (nodes : (n : ℕ) → Fin n → ℝ), + (∀ n (i : Fin n), nodes n i ∈ Icc (-1 : ℝ) 1) ∧ + (∀ n, Function.Injective (nodes n)) ∧ + ∀ f : ℝ → ℝ, ContinuousOn f (Icc (-1) 1) → + ∃ x ∈ Icc (-1 : ℝ) 1, + (∀ M : ℝ, ∃ᶠ n in atTop, lebesgueFunction (nodes n) x ≥ M) ∧ + Tendsto (fun n => lagrangeInterpolation (nodes n) f x) atTop (nhds (f x)) := by + sorry + +/-- +Erdős Problem 671 (Part 2): Is there a triangular array of distinct nodes +in $[-1,1]$ such that the Lebesgue function has infinite limsup at every +$x \in [-1,1]$, and yet for every continuous $f : [-1,1] \to \mathbb{R}$ there +exists $x \in [-1,1]$ where the Lagrange interpolation converges to $f(x)$? +-/ +@[category research open, AMS 41] +theorem erdos_671.variants.part2 : answer(sorry) ↔ + ∃ (nodes : (n : ℕ) → Fin n → ℝ), + (∀ n (i : Fin n), nodes n i ∈ Icc (-1 : ℝ) 1) ∧ + (∀ n, Function.Injective (nodes n)) ∧ + (∀ x ∈ Icc (-1 : ℝ) 1, ∀ M : ℝ, + ∃ᶠ n in atTop, lebesgueFunction (nodes n) x ≥ M) ∧ + (∀ f : ℝ → ℝ, ContinuousOn f (Icc (-1) 1) → + ∃ x ∈ Icc (-1 : ℝ) 1, + Tendsto (fun n => lagrangeInterpolation (nodes n) f x) atTop (nhds (f x))) := by + sorry + +end Erdos671 diff --git a/FormalConjectures/ErdosProblems/673.lean b/FormalConjectures/ErdosProblems/673.lean new file mode 100644 index 0000000000..771f78b979 --- /dev/null +++ b/FormalConjectures/ErdosProblems/673.lean @@ -0,0 +1,84 @@ +/- +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 + +/-! +# Erdős Problem 673 + +*Reference:* [erdosproblems.com/673](https://www.erdosproblems.com/673) + +Let $1 = d_1 < \cdots < d_{\tau(n)} = n$ be the divisors of $n$ and +$$G(n) = \sum_{1 \leq i < \tau(n)} d_i / d_{i+1}.$$ + +Is it true that $G(n) \to \infty$ for almost all $n$? Can one prove an asymptotic +formula for $\sum_{n \leq X} G(n)$? + +Erdős writes it is 'easy' to prove $(1/X) \sum_{n \leq X} G(n) \to \infty$. + +Terence Tao observed that for any divisor $m \mid n$, +$\tau(n/m) / m \leq G(n) \leq \tau(n)$, +and hence for example $\tau(n)/4 \leq G(n) \leq \tau(n)$ for even $n$. It follows easily +that $G(n)$ grows on average and tends to infinity for almost all $n$. + +Erdős and Tenenbaum proved that $G(n)/\tau(n)$ has a continuous distribution +function. + +[Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979). + +[Er82e] Erdős, P., _Some new problems and results in number theory_ (1982). +-/ + +open Filter + +namespace Erdos673 + +/-- The sorted list of divisors of $n$ in increasing order. -/ +def sortedDivisors (n : ℕ) : List ℕ := + (Nat.divisors n).sort (· ≤ ·) + +/-- $G(n) = \sum_{1 \leq i < \tau(n)} d_i / d_{i+1}$, where $d_1 < \cdots < d_{\tau(n)}$ are the +divisors of $n$ in increasing order. This is the sum of ratios of consecutive +divisors. -/ +noncomputable def erdosG (n : ℕ) : ℝ := + let divs := sortedDivisors n + ((divs.zip divs.tail).map (fun p => (p.1 : ℝ) / (p.2 : ℝ))).sum + +/-- +Erdős Problem 673, Part 1 [Er79e, Er82e]: + +$G(n) \to \infty$ for almost all $n$, i.e., for every $M$, the set of $n$ with $G(n) \leq M$ +has natural density zero. +-/ +@[category research solved, AMS 11] +theorem erdos_673 : + answer(True) ↔ ∀ M : ℝ, Set.HasDensity {n : ℕ | erdosG n ≤ M} 0 := by + sorry + +/-- +Erdős Problem 673, Part 2 [Er79e, Er82e]: + +$(1/X) \cdot \sum_{n \leq X} G(n) \to \infty$ as $X \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_673.variants.average : + Tendsto + (fun X : ℕ => (Finset.sum (Finset.range X) erdosG) / (X : ℝ)) + atTop atTop := by + sorry + +end Erdos673 diff --git a/FormalConjectures/ErdosProblems/674.lean b/FormalConjectures/ErdosProblems/674.lean new file mode 100644 index 0000000000..0ffc93e1da --- /dev/null +++ b/FormalConjectures/ErdosProblems/674.lean @@ -0,0 +1,87 @@ +/- +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 674 + +*Reference:* [erdosproblems.com/674](https://www.erdosproblems.com/674) + +Are there any integer solutions to $x^x \cdot y^y = z^z$ with $x, y, z > 1$? + +Ko [Ko40] proved there are none if $\gcd(x, y) = 1$, but there are in fact +infinitely many solutions in general — for example, +$x = 2^{12} \cdot 3^6$, $y = 2^8 \cdot 3^8$, $z = 2^{11} \cdot 3^7$. + +In [Er79] Erdős asked if the infinite families found by Ko are the only +solutions. + +[Ko40] Ko, C., _Note on the Diophantine equation $x^x y^y = z^z$_. +J. Chinese Math. Soc. (1940), 205–207. + +[Er79] Erdős, P., _Some unconventional problems in number theory_. +Math. Mag. (1979), 67–70. + +[Sc58] Schinzel, A., _Sur un problème de P. Erdős_. Colloq. Math. (1958), 198–204. + +[Mi59] Mills, W. H., _An unsolved Diophantine equation_. +Rep. Inst. in the theory of numbers, University of Colorado (1959), 258–268. + +[De75b] Dem'janenko, V. A., _On a conjecture of A. Schinzel_. +Izv. Vyssh. Ucheb. Zaved. Matematika (1975), 39–45. + +[Uc84] Uchiyama, S., _On the Diophantine equation $x^x y^y = z^z$_. +Trudy Mat. Inst. Steklov. (1984), 237–243. +-/ + +namespace Erdos674 + +/-- +Are there any natural numbers $x, y, z > 1$ such that $x^x \cdot y^y = z^z$? Yes — infinitely +many solutions exist, including the family found by Ko [Ko40]. +-/ +@[category research solved, AMS 11] +theorem erdos_674 : answer(True) ↔ + ∃ x y z : ℕ, x > 1 ∧ y > 1 ∧ z > 1 ∧ x ^ x * y ^ y = z ^ z := by + sorry + +/-- Are the infinite families found by Ko [Ko40] the only integer solutions +to $x^x \cdot y^y = z^z$ with $x, y, z > 1$? [Er79] -/ +@[category research open, AMS 11] +theorem erdos_674.variants.unique_families : answer(sorry) ↔ + ∀ x y z : ℕ, x > 1 → y > 1 → z > 1 → x ^ x * y ^ y = z ^ z → + sorry := by + sorry + +/-- Ko [Ko40] proved that there are no solutions to $x^x \cdot y^y = z^z$ with $x, y, z > 1$ +when $\gcd(x, y) = 1$. -/ +@[category research solved, AMS 11] +theorem erdos_674.variants.coprime_no_solution : + ¬∃ x y z : ℕ, x > 1 ∧ y > 1 ∧ z > 1 ∧ Nat.Coprime x y ∧ x ^ x * y ^ y = z ^ z := by + sorry + +/-- The triple $(2^{12} \cdot 3^6,\; 2^8 \cdot 3^8,\; 2^{11} \cdot 3^7)$ is a solution +to $x^x \cdot y^y = z^z$. -/ +@[category research solved, AMS 11] +theorem erdos_674.variants.witness : + let x := 2 ^ 12 * 3 ^ 6 + let y := 2 ^ 8 * 3 ^ 8 + let z := 2 ^ 11 * 3 ^ 7 + x > 1 ∧ y > 1 ∧ z > 1 ∧ x ^ x * y ^ y = z ^ z := by + sorry + +end Erdos674 diff --git a/FormalConjectures/ErdosProblems/675.lean b/FormalConjectures/ErdosProblems/675.lean new file mode 100644 index 0000000000..d110ec49ca --- /dev/null +++ b/FormalConjectures/ErdosProblems/675.lean @@ -0,0 +1,117 @@ +/- +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 675 + +*Reference:* [erdosproblems.com/675](https://www.erdosproblems.com/675) + +We say that $A \subset \mathbb{N}$ has the translation property if, for every $n$, there exists +some integer $t_n \geq 1$ such that, for all $1 \leq a \leq n$, +$a \in A$ if and only if $a + t_n \in A$. + +Three questions: +1. Does the set of sums of two squares have the translation property? +2. If we partition all primes into $P \sqcup Q$, such that each set contains $\gg x/\log x$ + many primes $\leq x$ for all large $x$, then can the set of integers only divisible + by primes from $P$ have the translation property? +3. If $A$ is the set of squarefree numbers then how fast does the minimal such $t_n$ + grow? Is it true that $t_n > \exp(n^c)$ for some constant $c > 0$? + +Elementary sieve theory implies the set of squarefree numbers has the +translation property. + +[Er79] Erdős, P., _Some unconventional problems in number theory_ (1979). +-/ + +open Real Classical + +namespace Erdos675 + +/-- A set $A \subseteq \mathbb{N}$ has the translation property if for every $n$, there exists + $t \geq 1$ such that for all $1 \leq a \leq n$, $a \in A \leftrightarrow a + t \in A$. -/ +def HasTranslationProperty (A : Set ℕ) : Prop := + ∀ n : ℕ, ∃ t : ℕ, t ≥ 1 ∧ ∀ a : ℕ, 1 ≤ a → a ≤ n → (a ∈ A ↔ a + t ∈ A) + +/-- A natural number is a sum of two squares. -/ +def IsSumOfTwoSquares (n : ℕ) : Prop := + ∃ a b : ℕ, n = a ^ 2 + b ^ 2 + +/-- The set of natural numbers that are sums of two squares. -/ +def sumOfTwoSquaresSet : Set ℕ := {n | IsSumOfTwoSquares n} + +/-- The set of squarefree natural numbers. -/ +def squarefreeSet : Set ℕ := {n | Squarefree n} + +/-- The minimal translation witness for a set $A$ at level $n$: + the smallest $t \geq 1$ such that for all $1 \leq a \leq n$, + $a \in A \leftrightarrow a + t \in A$. -/ +noncomputable def minimalTranslation (A : Set ℕ) (n : ℕ) : ℕ := + sInf {t : ℕ | t ≥ 1 ∧ ∀ a : ℕ, 1 ≤ a → a ≤ n → (a ∈ A ↔ a + t ∈ A)} + +/-- Given a set of primes $P$, the set of natural numbers $\geq 1$ all of whose + prime factors lie in $P$. -/ +def smoothNumbers (P : Set ℕ) : Set ℕ := + {n | n ≥ 1 ∧ ∀ p : ℕ, Nat.Prime p → p ∣ n → p ∈ P} + +/-- +Erdős Problem 675 [Er79]: + +Does the set of sums of two squares have the translation property? +-/ +@[category research open, AMS 11] +theorem erdos_675 : + answer(sorry) ↔ HasTranslationProperty sumOfTwoSquaresSet := by + sorry + +/-- +Erdős Problem 675, Part 2 [Er79]: + +If we partition all primes into $P \sqcup Q$, such that each set contains $\gg x/\log x$ +many primes $\leq x$ for all large $x$, then can the set of integers only divisible +by primes from $P$ have the translation property? +-/ +@[category research open, AMS 11] +theorem erdos_675.variants.smoothNumbers : + answer(sorry) ↔ + ∃ (P : Set ℕ), + (∃ c₁ : ℝ, c₁ > 0 ∧ ∃ N₁ : ℕ, ∀ x : ℕ, x ≥ N₁ → + c₁ * (x : ℝ) / Real.log (x : ℝ) ≤ + (((Finset.range (x + 1)).filter (fun q => Nat.Prime q ∧ q ∈ P)).card : ℝ)) ∧ + (∃ c₂ : ℝ, c₂ > 0 ∧ ∃ N₂ : ℕ, ∀ x : ℕ, x ≥ N₂ → + c₂ * (x : ℝ) / Real.log (x : ℝ) ≤ + (((Finset.range (x + 1)).filter (fun q => Nat.Prime q ∧ q ∉ P)).card : ℝ)) ∧ + HasTranslationProperty (smoothNumbers P) := by + sorry + +/-- +Erdős Problem 675, Part 3 [Er79]: + +If $A$ is the set of squarefree numbers, then the minimal translation $t_n$ +grows faster than $\exp(n^c)$ for some constant $c > 0$. That is, there exists +$c > 0$ and $N_0$ such that for all $n \geq N_0$, $t_n > \exp(n^c)$. +-/ +@[category research open, AMS 11] +theorem erdos_675.variants.squarefreeGrowth : + answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (minimalTranslation squarefreeSet n : ℝ) > Real.exp ((n : ℝ) ^ c) := by + sorry + +end Erdos675 diff --git a/FormalConjectures/ErdosProblems/676.lean b/FormalConjectures/ErdosProblems/676.lean new file mode 100644 index 0000000000..862c6f697f --- /dev/null +++ b/FormalConjectures/ErdosProblems/676.lean @@ -0,0 +1,78 @@ +/- +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 676 + +*Reference:* [erdosproblems.com/676](https://www.erdosproblems.com/676) + +Is every sufficiently large integer of the form $ap^2 + b$ for some prime $p$ +and integer $a \geq 1$ and $0 \leq b < p$? + +The sieve of Eratosthenes implies that almost all integers are of this form, +and the Brun–Selberg sieve implies the number of exceptions in $[1,x]$ is +$\ll x/(\log x)^c$ for some constant $c > 0$. Erdős believed it is "rather unlikely" +that all large integers are of this form. + +[Er79] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67–70. + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. Acta Math. Acad. Sci. +Hungar. 33 (1979), 71–80. +-/ + +namespace Erdos676 + +/-- +Erdős Problem 676 [Er79][Er79d]: + +Is every sufficiently large integer of the form $ap^2 + b$ for some prime $p$ +and integer $a \geq 1$ and $0 \leq b < p$? + +Formalized as: there exists $N_0$ such that for all $n \geq N_0$, there exist a prime $p$, +a positive integer $a$, and a non-negative integer $b < p$ with $n = a \cdot p^2 + b$. +-/ +@[category research open, AMS 11] +theorem erdos_676 : + answer(sorry) ↔ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ p a b : ℕ, Nat.Prime p ∧ a ≥ 1 ∧ b < p ∧ n = a * p ^ 2 + b := by + sorry + +/-- +Variant of Erdős Problem 676 (Selfridge–Wagstaff): If the primality requirement on $p$ is +dropped, a preliminary computer search by Selfridge and Wagstaff suggested that there are +infinitely many integers not of the form $am^2 + b$ with $m \geq 2$, $a \geq 1$, +$0 \leq b < m$. -/ +@[category research open, AMS 11] +theorem erdos_676_non_prime : + ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ + ∀ m a b : ℕ, m ≥ 2 → a ≥ 1 → b < m → n ≠ a * m ^ 2 + b := by + sorry + +/-- +Variant of Erdős Problem 676 [Er79d]: Erdős conjectured that $\limsup c_n = \infty$, +where $c_n$ is the minimal coefficient such that $n = ap^2 + b$ with $0 \leq b < c_n p$ +for some prime $p$ with $p^2 \leq n$. Equivalently, for every $C$, there are infinitely +many $n$ such that $n \bmod p^2 \geq C \cdot p$ for every prime $p$ with $p^2 \leq n$. -/ +@[category research open, AMS 11] +theorem erdos_676_limsup_minimal_coefficient : + ∀ C : ℕ, ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ + ∀ p : ℕ, Nat.Prime p → p ^ 2 ≤ n → n % (p ^ 2) ≥ C * p := by + sorry + +end Erdos676 diff --git a/FormalConjectures/ErdosProblems/679.lean b/FormalConjectures/ErdosProblems/679.lean new file mode 100644 index 0000000000..fbaa092cae --- /dev/null +++ b/FormalConjectures/ErdosProblems/679.lean @@ -0,0 +1,98 @@ +/- +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 679 + +Erdős asked whether, for every ε > 0, there are infinitely many n such that +ω(n − k) < (1 + ε) log k / log log k for all sufficiently large k < n. A stronger +form with O(1) error was disproved. + +A similar question can be asked for Ω (prime factors with multiplicity), replacing +log k / log log k with log₂ k. + +*Reference:* [erdosproblems.com/679](https://www.erdosproblems.com/679) + +*Related problems:* [#248](https://www.erdosproblems.com/248), +[#413](https://www.erdosproblems.com/413) + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67-70. +-/ + +open scoped ArithmeticFunction.omega ArithmeticFunction.Omega + +namespace Erdos679 + +/-- +Erdős Problem 679, Part 1 [Er79d]: + +For every $\varepsilon > 0$, are there infinitely many $n$ such that for all sufficiently +large $k$ (with $1 \leq k < n$), we have +$\omega(n - k) < (1 + \varepsilon) \cdot \log k / \log \log k$? + +Here "sufficiently large" means there exists a threshold $k_0$ depending on $\varepsilon$ +(but not on $n$) such that the bound holds for all $k \geq k_0$ with $k < n$. +-/ +@[category research open, AMS 11] +theorem erdos_679 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ k₀ : ℕ, + Set.Infinite {n : ℕ | + ∀ k : ℕ, k₀ ≤ k → k < n → + (ω (n - k) : ℝ) < + (1 + ε) * Real.log (k : ℝ) / Real.log (Real.log (k : ℝ))} := by + sorry + +/-- +Erdős Problem 679, Part 2 (disproved by DottedCalculator) [Er79d]: + +The stronger version asking whether $\omega(n - k) < \log k / \log \log k + O(1)$ +holds for infinitely many $n$ is false. In fact, there exists a constant $c > 0$ +such that for all sufficiently large $n$, there exists $k \geq 3$ with $k < n$ and +$$\omega(n - k) \geq \log k / \log \log k + c \cdot \log k / (\log \log k)^2.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_679.variants.disproof : + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ k : ℕ, k ≥ 3 ∧ k < n ∧ + (ω (n - k) : ℝ) ≥ + Real.log (k : ℝ) / Real.log (Real.log (k : ℝ)) + + c * Real.log (k : ℝ) / (Real.log (Real.log (k : ℝ))) ^ 2 := by + sorry + +/-- +Erdős Problem 679, Ω variant [Er79d]: + +A similar question to Part 1 can be asked for $\Omega$ (prime factors counted with +multiplicity): for every $\varepsilon > 0$, are there infinitely many $n$ such that +$\Omega(n - k) < (1 + \varepsilon) \log_2 k$ for all sufficiently large $k < n$? +-/ +@[category research open, AMS 11] +theorem erdos_679.variants.bigOmega : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ k₀ : ℕ, + Set.Infinite {n : ℕ | + ∀ k : ℕ, k₀ ≤ k → k < n → + (Ω (n - k) : ℝ) < + (1 + ε) * Real.log (k : ℝ) / Real.log 2} := by + sorry + +end Erdos679 diff --git a/FormalConjectures/ErdosProblems/682.lean b/FormalConjectures/ErdosProblems/682.lean new file mode 100644 index 0000000000..9f83b16053 --- /dev/null +++ b/FormalConjectures/ErdosProblems/682.lean @@ -0,0 +1,59 @@ +/- +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 682 + +*Reference:* [erdosproblems.com/682](https://www.erdosproblems.com/682) + +For almost all $n$, there exists an integer $m$ strictly between consecutive primes +$p_n$ and $p_{n+1}$ whose least prime factor is at least as large as the prime gap +$p_{n+1} - p_n$. + +Erdős originally conjectured this for all sufficiently large $n$, but a conditional +counterexample via Dickson's conjecture shows this fails: if infinitely many pairs +$(2183 + 30030d, 2201 + 30030d)$ are both prime, they form consecutive primes with no +suitable $m$, since $30030 = 2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13$ divides every +integer in the interval. + +See also Erdős Problems 680 and 681. OEIS: [A386978](https://oeis.org/A386978). + +[GaTa25] Gafni, A., Tao, T., _Rough numbers between consecutive primes_. arXiv:2508.06463 +(2025). +-/ + +open Nat Classical Set + +namespace Erdos682 + +/-- +Erdős Problem 682: For almost all $n$, there exists an integer $m$ strictly +between consecutive primes $p_n$ and $p_{n+1}$ whose least prime factor is at +least as large as the prime gap $p_{n+1} - p_n$. + +"Almost all" is formalized as: the exceptional set has natural density zero. + +Proved by Gafni and Tao [GaTa25]. +-/ +@[category research solved, AMS 11] +theorem erdos_682 : + {n : ℕ | ¬ ∃ m : ℕ, nth Nat.Prime n < m ∧ m < nth Nat.Prime (n + 1) ∧ + primeGap n ≤ minFac m}.HasDensity 0 := by + sorry + +end Erdos682 diff --git a/FormalConjectures/ErdosProblems/683.lean b/FormalConjectures/ErdosProblems/683.lean new file mode 100644 index 0000000000..45876dc446 --- /dev/null +++ b/FormalConjectures/ErdosProblems/683.lean @@ -0,0 +1,60 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 683 + +*Reference:* [erdosproblems.com/683](https://www.erdosproblems.com/683) + +A problem of Erdős [Er76d][Er79d]. The Sylvester-Schur theorem [Er34] states that +$P\left(\binom{n}{k}\right) > k$ if $k \leq n/2$. Erdős [Er55d] proved that there exists +some $c > 0$ such that $P\left(\binom{n}{k}\right) \gg k \log k$ whenever $k \leq n/2$. + +This problem is essentially equivalent to Problem 961. + +OEIS: [A006530](https://oeis.org/A006530), [A074399](https://oeis.org/A074399), +[A121359](https://oeis.org/A121359). + +[Er34] Erdős, P., _A theorem of Sylvester and Schur_. J. London Math. Soc. (1934), 282–288. + +[Er55d] Erdős, P., _On consecutive integers_. Nieuw Arch. Wisk. (3) **3** (1955), 124–128. + +[Er76d] Erdős, P., _Problems in number theory and combinatorics_. Congr. Numer. **18** (1976). + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. Mathematics Magazine +**52** (1979), 67–70. +-/ + +open Real + +namespace Erdos683 + +/-- +Erdős Problem 683 [Er76d][Er79d]: Is it true that there exists a constant $c > 0$ such that +for every $1 \leq k < n$, the largest prime factor of $\binom{n}{k}$ satisfies +$$P\left(\binom{n}{k}\right) \geq \min(n - k + 1,\; k^{1+c})?$$ +-/ +@[category research open, AMS 11] +theorem erdos_683 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ n k : ℕ, 1 ≤ k → k < n → + (Nat.maxPrimeFac (Nat.choose n k) : ℝ) ≥ + min (↑(n - k + 1)) ((k : ℝ) ^ (1 + c)) := by + sorry + +end Erdos683 diff --git a/FormalConjectures/ErdosProblems/684.lean b/FormalConjectures/ErdosProblems/684.lean new file mode 100644 index 0000000000..7088dd2fce --- /dev/null +++ b/FormalConjectures/ErdosProblems/684.lean @@ -0,0 +1,97 @@ +/- +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 684 + +*Reference:* [erdosproblems.com/684](https://www.erdosproblems.com/684) + +For $0 \le k \le n$ write $\binom{n}{k} = uv$ where the only primes dividing $u$ are in $[2,k]$ +and the only primes dividing $v$ are in $(k,n]$. Let $f(n)$ be the smallest $k$ such +that $u > n^2$. Give bounds for $f(n)$. + +Mahler's theorem implies $f(n) \to \infty$ as $n \to \infty$, but is ineffective and gives +no explicit bounds. Tang and ChatGPT proved $f(n) \le n^{30/43 + o(1)}$, and the same proof +yields $f(n) \le n^{2/3 + o(1)}$ under the Riemann Hypothesis. +A heuristic due to Sothanaphan and ChatGPT suggests $f(n) \sim 2 \log n$ for most $n$. + +Possibly related OEIS sequence: [A392019](https://oeis.org/A392019). + +[Er79d] Erdős, P., _Problems and results on number theoretic properties of consecutive integers +and related questions_. Proceedings of the Fifth Manitoba Conference on Numerical Mathematics +(1975), Congress. Numer. XVI (1976), 25-44. +-/ + +open Nat Finset BigOperators Classical + +namespace Erdos684 + +/-- The $k$-smooth part of a natural number $m$: the product of $p^{v_p(m)}$ over +all primes $p \le k$. This is the largest divisor of $m$ whose prime factors +are all at most $k$. -/ +noncomputable def smoothPart (m k : ℕ) : ℕ := + ∏ p ∈ (Finset.Icc 2 k).filter Nat.Prime, p ^ (m.factorization p) + +/-- $f(n)$ for Erdős Problem 684: the smallest $k$ such that the $k$-smooth part +of $\binom{n}{k}$ exceeds $n^2$. Returns $0$ if no such $k$ exists. -/ +noncomputable def erdos684F (n : ℕ) : ℕ := + if h : ∃ k : ℕ, smoothPart (n.choose k) k > n ^ 2 + then Nat.find h + else 0 + +/-- +Erdős Problem 684 [Er79d]: $f(n) \to \infty$ as $n \to \infty$. + +For every bound $K$, for all sufficiently large $n$, the smallest $k$ such that the +$k$-smooth part of $\binom{n}{k}$ exceeds $n^2$ is greater than $K$. + +This follows from Mahler's theorem. The problem asks for effective bounds +on the growth of $f(n)$, which remains open. +-/ +@[category research open, AMS 11] +theorem erdos_684 : + ∀ K : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → erdos684F n > K := by + sorry + +/-- +Erdős Problem 684, upper bound (Tang and ChatGPT): + +$f(n) \le n^{30/43 + o(1)}$. For every $\varepsilon > 0$, for all sufficiently large $n$, +$f(n) \le n^{30/43 + \varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_684.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos684F n : ℝ) ≤ (n : ℝ) ^ ((30 : ℝ) / 43 + ε) := by + sorry + +/-- +Erdős Problem 684, conditional upper bound under the Riemann Hypothesis +(Tang and ChatGPT): + +$f(n) \le n^{2/3 + o(1)}$ assuming RH. For every $\varepsilon > 0$, for all sufficiently +large $n$, $f(n) \le n^{2/3 + \varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_684.variants.upper_bound_conditional_RH : + RiemannHypothesis → + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos684F n : ℝ) ≤ (n : ℝ) ^ ((2 : ℝ) / 3 + ε) := by + sorry + +end Erdos684 diff --git a/FormalConjectures/ErdosProblems/685.lean b/FormalConjectures/ErdosProblems/685.lean new file mode 100644 index 0000000000..f5cef5e5aa --- /dev/null +++ b/FormalConjectures/ErdosProblems/685.lean @@ -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 + +/-! +# Erdős Problem 685 + +*Reference:* [erdosproblems.com/685](https://www.erdosproblems.com/685) + +Let $\varepsilon > 0$ and $n$ be large depending on $\varepsilon$. Is it true that for all +$n^\varepsilon < k \leq n^{1-\varepsilon}$, the number of distinct prime divisors of +$\binom{n}{k}$ is $(1 + o(1)) \cdot k \cdot \sum_{k < p < n} \frac{1}{p}$? +Or perhaps even when $k \geq (\log n)^c$? + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. Mathematics Magazine +52 (1979), 67-70. +-/ + +open Finset Nat BigOperators +open scoped ArithmeticFunction.omega + +namespace Erdos685 + +/-- The sum of reciprocals of primes $p$ with $k < p < n$: $\sum_{k < p < n} \frac{1}{p}$. -/ +noncomputable def primeReciprocalSum (k n : ℕ) : ℝ := + ∑ p ∈ (Finset.range n).filter (fun p => k < p ∧ Nat.Prime p), (1 : ℝ) / p + +/-- +Erdős Problem 685 [Er79d]: For all $\varepsilon \in (0, 1)$ and $\delta > 0$, there exists $N_0$ +such that for all $n \geq N_0$ and all $k$ with $n^\varepsilon < k \leq n^{1 - \varepsilon}$, +the number of distinct prime divisors of $\binom{n}{k}$ satisfies: +$$ + |\omega(\binom{n}{k}) - k \cdot \sum_{k < p < n} \frac{1}{p}| + \leq \delta \cdot k \cdot \sum_{k < p < n} \frac{1}{p} +$$ +-/ +@[category research open, AMS 11] +theorem erdos_685 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ε < 1 → + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ k : ℕ, (n : ℝ) ^ ε < (k : ℝ) → (k : ℝ) ≤ (n : ℝ) ^ (1 - ε) → + |(↑(ω (n.choose k)) : ℝ) - ↑k * primeReciprocalSum k n| ≤ + δ * ↑k * primeReciprocalSum k n := by + sorry + +/-- +Variant of Erdős Problem 685 [Er79d]: A stronger form asking whether the same asymptotic +$\omega(\binom{n}{k}) = (1 + o(1)) \cdot k \cdot \sum_{k < p < n} \frac{1}{p}$ +holds under the weaker lower bound $k \geq (\log n)^c$ for some constant $c > 0$. +This would allow much smaller values of $k$ than the main formulation. +-/ +@[category research open, AMS 11] +theorem erdos_685_variant : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ k : ℕ, (Real.log (n : ℝ)) ^ c ≤ (k : ℝ) → (k : ℝ) ≤ (n : ℝ) → + |(↑(ω (n.choose k)) : ℝ) - ↑k * primeReciprocalSum k n| ≤ + δ * ↑k * primeReciprocalSum k n := by + sorry + +end Erdos685 diff --git a/FormalConjectures/ErdosProblems/687.lean b/FormalConjectures/ErdosProblems/687.lean new file mode 100644 index 0000000000..df523db1d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/687.lean @@ -0,0 +1,88 @@ +/- +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 687 + +Let $Y(x)$ be the maximal $y$ such that one can choose one residue class $a_p \pmod{p}$ +for every prime $p \le x$ so that every integer in $\{1, \ldots, y\}$ is covered by at +least one of these classes. Is it true that $Y(x) = o(x^2)$? Or even +$Y(x) \ll x^{1+o(1)}$? + +Iwaniec [Iw78] proved the upper bound $Y(x) \ll x^2$. Ford, Green, Konyagin, +Maynard, and Tao [FGKMT18] proved the lower bound +$Y(x) \gg x \cdot (\log x)(\log \log \log x)/(\log \log x)$. +Maier and Pomerance conjectured $Y(x) \ll x(\log x)^{2+o(1)}$. + +[Er80] Erdős, P., *A survey of problems in combinatorial number theory*. +Annals of Discrete Mathematics (1980), 89–115. + +[Iw78] Iwaniec, H., *On the problem of Jacobsthal*. +Demonstratio Mathematica (1978), 225–231. + +[FGKMT18] Ford, K., Green, B., Konyagin, S., Maynard, J., Tao, T., +*Long gaps between primes*. Journal of the American Mathematical Society (2018), 65–105. + +[Ra38] Rankin, R. A., *The Difference between Consecutive Prime Numbers*. +Journal of the London Mathematical Society (1938), 242–247. + +OEIS: A048670, A058989. + +See also problems #4, #688, #689, #970. + +*Reference:* [erdosproblems.com/687](https://www.erdosproblems.com/687) +-/ + +namespace Erdos687 + +/-- +A choice of residue classes for primes $p \le x$ covers $[1, y]$ if every +integer $n \in \{1, \ldots, y\}$ is congruent to $a(p) \pmod{p}$ for some prime $p \le x$. +This captures a covering system related to the Jacobsthal function. +-/ +def PrimeCovering (x y : ℕ) (a : ℕ → ℕ) : Prop := + ∀ n : ℕ, 1 ≤ n → n ≤ y → ∃ p : ℕ, p.Prime ∧ p ≤ x ∧ n % p = a p % p + +/-- +Erdős Problem 687 (weak form): $Y(x) = o(x^2)$. +Let $Y(x)$ be the maximal $y$ such that there exists a choice of congruence +classes $a_p$ for all primes $p \le x$ such that every integer in $[1, y]$ is +congruent to at least one of the $a_p \pmod{p}$. Then $Y(x) = o(x^2)$. +-/ +@[category research open, AMS 11] +theorem erdos_687 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ X : ℕ, ∀ x : ℕ, x ≥ X → + ∀ (a : ℕ → ℕ) (y : ℕ), PrimeCovering x y a → + (y : ℝ) < ε * (x : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 687 (strong form): $Y(x) \ll x^{1+o(1)}$. +For every $\varepsilon > 0$, for all sufficiently large $x$, any covering of $[1, y]$ +by residue classes of primes $\le x$ satisfies $y \le x^{1+\varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_687.variants.strong : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ X : ℕ, ∀ x : ℕ, x ≥ X → + ∀ (a : ℕ → ℕ) (y : ℕ), PrimeCovering x y a → + (y : ℝ) ≤ (x : ℝ) ^ ((1 : ℝ) + ε) := by + sorry + +end Erdos687 diff --git a/FormalConjectures/ErdosProblems/688.lean b/FormalConjectures/ErdosProblems/688.lean new file mode 100644 index 0000000000..418302b5f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/688.lean @@ -0,0 +1,68 @@ +/- +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 688 + +*Reference:* [erdosproblems.com/688](https://www.erdosproblems.com/688) + +[Er79d] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67-70. + +Define $\varepsilon_n$ to be maximal such that there exists some choice of congruence +class $a_p$ for all primes $n^{\varepsilon_n} < p \leq n$ such that every integer in $[1, n]$ +satisfies at least one of the congruences $\equiv a_p \pmod{p}$. + +Estimate $\varepsilon_n$ — in particular is it true that $\varepsilon_n = o(1)$? + +Erdős could prove $\varepsilon_n \gg (\log \log \log n) / (\log \log n)$. + +See also problems [#687](https://www.erdosproblems.com/687) and +[#689](https://www.erdosproblems.com/689). +-/ + +namespace Erdos688 + +/-- A choice of residue classes for primes $p$ in $(n^\varepsilon, n]$ covers $[1, n]$ if +every integer $m \in \{1, \ldots, n\}$ satisfies $m \equiv a(p) \pmod{p}$ for some +prime $p$ with $n^\varepsilon < p \leq n$. -/ +def PrimeCoveringInRange (n : ℕ) (ε : ℝ) (a : ℕ → ℕ) : Prop := + ∀ m : ℕ, 1 ≤ m → m ≤ n → + ∃ p : ℕ, p.Prime ∧ (n : ℝ) ^ ε < (p : ℝ) ∧ p ≤ n ∧ m % p = a p % p + +/-- Erdős Problem 688 (conjecture): $\varepsilon_n = o(1)$. +For any fixed $\delta > 0$, for sufficiently large $n$, the primes in $(n^\delta, n]$ +cannot cover $[1, n]$ with any choice of congruence classes. -/ +@[category research open, AMS 11] +theorem erdos_688 : answer(sorry) ↔ + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ¬∃ a : ℕ → ℕ, PrimeCoveringInRange n δ a := by + sorry + +/-- Known lower bound: $\varepsilon_n \gg (\log \log \log n) / (\log \log n)$. +For some constant $C > 0$, for all sufficiently large $n$, there exists a +covering using primes in $(n^{C \cdot \log\log\log(n)/\log\log(n)}, n]$. -/ +@[category research solved, AMS 11] +theorem erdos_688.variants.lower_bound : + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ a : ℕ → ℕ, PrimeCoveringInRange n + (C * Real.log (Real.log (Real.log (n : ℝ))) / Real.log (Real.log (n : ℝ))) a := by + sorry + +end Erdos688 diff --git a/FormalConjectures/ErdosProblems/690.lean b/FormalConjectures/ErdosProblems/690.lean new file mode 100644 index 0000000000..afc50e4571 --- /dev/null +++ b/FormalConjectures/ErdosProblems/690.lean @@ -0,0 +1,79 @@ +/- +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 690 + +Let $d_k(p)$ be the density of those integers whose $k$-th smallest prime factor is $p$. +For each fixed $k \geq 1$, is $d_k(p)$ unimodal in $p$? + +*Reference:* [erdosproblems.com/690](https://www.erdosproblems.com/690) + +[Er79e] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67-70. + +[Ca25] Cambie, S., _Resolution of Erdős' problems about unimodularity_. arXiv:2501.10333 (2025). +-/ + +open Filter Finset + +open scoped Topology + +namespace Erdos690 + +/-- The sorted list of distinct prime factors of $n$ in increasing order. -/ +noncomputable def sortedPrimeFactors (n : ℕ) : List ℕ := + (Nat.primeFactors n).sort (· ≤ ·) + +/-- The $k$-th smallest prime factor of $n$ (1-indexed). +Returns $0$ if $n$ has fewer than $k$ distinct prime factors. -/ +noncomputable def kthSmallestPrimeFactor (n : ℕ) (k : ℕ) : ℕ := + (sortedPrimeFactors n).getD (k - 1) 0 + +/-- Count of positive integers in $\{1, \ldots, N\}$ whose $k$-th smallest prime +factor is $p$. -/ +noncomputable def countKthPrimeFactor (k p N : ℕ) : ℕ := + ((Finset.range N).filter (fun n => kthSmallestPrimeFactor (n + 1) k = p)).card + +/-- A function on primes is unimodal if there exists a prime $m$ such that +$f$ is non-decreasing on primes $\leq m$ and non-increasing on primes $\geq m$. -/ +def IsUnimodalOnPrimes (f : ℕ → ℝ) : Prop := + ∃ m : ℕ, Nat.Prime m ∧ + (∀ p q : ℕ, Nat.Prime p → Nat.Prime q → p ≤ q → q ≤ m → f p ≤ f q) ∧ + (∀ p q : ℕ, Nat.Prime p → Nat.Prime q → m ≤ p → p ≤ q → f q ≤ f p) + +/-- +Erdős Problem 690: Let $d_k(p)$ be the density of those integers whose $k$-th smallest +prime factor is $p$. For each fixed $k \geq 1$, is $d_k(p)$ unimodal in $p$? + +Erdős believed the answer is negative. Cambie [Ca25] confirmed $d_k(p)$ is unimodal for +$1 \leq k \leq 3$ but not for $4 \leq k \leq 20$. + +[Er79e] [Ca25] +-/ +@[category research solved, AMS 11] +theorem erdos_690 : answer(False) ↔ + ∀ k : ℕ, k ≥ 1 → + ∃ d_k : ℕ → ℝ, + (∀ p : ℕ, Nat.Prime p → + Filter.Tendsto (fun N : ℕ => + (countKthPrimeFactor k p (N + 1) : ℝ) / ((N + 1 : ℕ) : ℝ)) + atTop (nhds (d_k p))) ∧ + IsUnimodalOnPrimes d_k := by + sorry + +end Erdos690 diff --git a/FormalConjectures/ErdosProblems/691.lean b/FormalConjectures/ErdosProblems/691.lean new file mode 100644 index 0000000000..6e43f4b47f --- /dev/null +++ b/FormalConjectures/ErdosProblems/691.lean @@ -0,0 +1,50 @@ +/- +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 691 + +*Reference:* [erdosproblems.com/691](https://www.erdosproblems.com/691) + +Given $A \subseteq \mathbb{N}$, let $M_A = \{n \geq 1 : a \mid n \text{ for some } a \in A\}$ +be the set of multiples of $A$. A sequence $A$ for which $M_A$ has density $1$ is called +a *Behrend sequence*. + +For pairwise coprime sets of integers (all $\geq 2$), a necessary and sufficient condition +for $A$ to be a Behrend sequence is $\sum_{a \in A} 1/a = \infty$. + +The general characterization remains open. + +[Er79e] Erdős, P., _Some old and new problems on combinatorial number theory_ (1979), p.77. +-/ + +namespace Erdos691 + +/-- +Erdős Problem 691 (pairwise coprime case) [Er79e]: +If $A$ is a set of pairwise coprime integers (all $\geq 2$), then $A$ is a Behrend +sequence if and only if the sum of reciprocals $\sum_{a \in A} 1/a$ diverges. +-/ +@[category research solved, AMS 11] +theorem erdos_691 (A : Set ℕ) (hA : ∀ a ∈ A, a ≥ 2) + (hCoprime : A.Pairwise Nat.Coprime) : + ({n : ℕ | ∃ a ∈ A, a ∣ n}).HasDensity 1 ↔ + ¬Summable (fun a : ↥A ↦ (1 : ℝ) / (a : ℕ)) := by + sorry + +end Erdos691 diff --git a/FormalConjectures/ErdosProblems/692.lean b/FormalConjectures/ErdosProblems/692.lean new file mode 100644 index 0000000000..a48c5eecc5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/692.lean @@ -0,0 +1,84 @@ +/- +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 692 + +*Reference:* [erdosproblems.com/692](https://www.erdosproblems.com/692) + +[Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979). + +[Ob1] Oberwolfach problem session (1986). + +[Fo08] Ford, K., _The distribution of integers with a divisor in a given interval_. + Ann. of Math. (2) (2008), 367-433. + +[Ca25] Cambie, S., _Resolution of Erdős' problems about unimodularity_. arXiv:2501.10333 (2025). + +See also: Problem 446. +-/ + +open Finset Filter + +namespace Erdos692 + +/-- The number of divisors of $k$ that lie strictly between $n$ and $m$. -/ +def countDivisorsInOpenInterval (k n m : ℕ) : ℕ := + ((Nat.divisors k).filter (fun d => n < d ∧ d < m)).card + +/-- The proportion of positive integers up to $N$ having exactly one divisor +in the open interval $(n, m)$. This approximates $\delta_1(n, m)$. -/ +noncomputable def delta1Approx (n m N : ℕ) : ℝ := + (((Finset.range (N + 1)).filter + (fun k => 0 < k ∧ countDivisorsInOpenInterval k n m = 1)).card : ℝ) / (N : ℝ) + +/-- The natural density $\delta_1(n, m)$ exists and equals $d$: +the limit of $|\{k \leq N : k \text{ has exactly one divisor in } (n, m)\}| / N$ equals $d$. -/ +def HasDelta1Density (n m : ℕ) (d : ℝ) : Prop := + Filter.Tendsto (fun N => delta1Approx n m N) Filter.atTop (nhds d) + +/-- +Erdős Problem 692 [Er79e, Ob1] — DISPROVED + +Let $\delta_1(n, m)$ be the natural density of the set of positive integers with exactly +one divisor in the open interval $(n, m)$. Erdős asked (1986, Oberwolfach) whether, +for fixed $n$, $\delta_1(n, m)$ is unimodal as a function of $m$ for $m > n + 1$. + +Cambie [Ca25] disproved this by showing it fails even for $n = 3$: +$$\delta_1(3, 6) = 0.35, \quad \delta_1(3, 7) \approx 0.33, \quad \delta_1(3, 8) \approx 0.3619,$$ +exhibiting a "valley" at $m = 7$ that contradicts unimodality. +Furthermore, for fixed $n$, the sequence $\delta_1(n, m)$ has superpolynomially many +local maxima in $m$. + +The RHS formalizes unimodality via quasiconcavity (no strict local minima): +for every $n$ and $m_1 < m_2 < m_3$ (all $> n + 1$), +the density at $m_2$ is not a strict local minimum (i.e., $d_1 \le d_2$ or $d_3 \le d_2$). +The answer is `False` because Cambie exhibited a counterexample. +-/ +@[category research solved, AMS 11] +theorem erdos_692 : answer(False) ↔ + ∀ n : ℕ, ∀ m₁ m₂ m₃ : ℕ, + n + 1 < m₁ → m₁ < m₂ → m₂ < m₃ → + ∀ d₁ d₂ d₃ : ℝ, + HasDelta1Density n m₁ d₁ → + HasDelta1Density n m₂ d₂ → + HasDelta1Density n m₃ d₃ → + d₁ ≤ d₂ ∨ d₃ ≤ d₂ := by + sorry + +end Erdos692 diff --git a/FormalConjectures/ErdosProblems/693.lean b/FormalConjectures/ErdosProblems/693.lean new file mode 100644 index 0000000000..ef8d929a0e --- /dev/null +++ b/FormalConjectures/ErdosProblems/693.lean @@ -0,0 +1,63 @@ +/- +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 693 + +Let $k \geq 2$ and $n$ be sufficiently large. Consider the set of integers in $[n, n^k]$ which +have a divisor in the open interval $(n, 2n)$. Is the maximum gap between consecutive elements of +this set at most $(\log n)^{O(1)}$? + +See also Problem 446 for a related problem about integers with divisors in $(n, 2n)$. + +OEIS: [A391118](https://oeis.org/A391118) (possibly related sequence). + +*Reference:* [erdosproblems.com/693](https://www.erdosproblems.com/693) + +[Er79e] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. **52** (1979), +67-70. +-/ + +open Real + +namespace Erdos693 + +/-- An integer $m$ has a divisor in the open interval $(n, 2n)$. -/ +def HasDivisorIn (m n : ℕ) : Prop := + ∃ d, d ∣ m ∧ n < d ∧ d < 2 * n + +/-- +Erdős Problem 693 [Er79e]: + +Let $k \geq 2$ and $n$ be sufficiently large depending on $k$. Let +$A = \{a_1 < a_2 < \cdots\}$ be the set of integers in $[n, n^k]$ which have a divisor +in $(n, 2n)$. Is the maximum gap $\max_i (a_{i+1} - a_i) \leq (\log n)^{O(1)}$? +-/ +@[category research open, AMS 11] +theorem erdos_693 : + answer(sorry) ↔ + ∀ k : ℕ, k ≥ 2 → + ∃ C : ℕ, + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ a b : ℕ, n ≤ a → a < b → b ≤ n ^ k → + HasDivisorIn a n → HasDivisorIn b n → + (∀ m : ℕ, a < m → m < b → ¬HasDivisorIn m n) → + (b : ℝ) - (a : ℝ) ≤ (Real.log (n : ℝ)) ^ C := by + sorry + +end Erdos693 diff --git a/FormalConjectures/ErdosProblems/696.lean b/FormalConjectures/ErdosProblems/696.lean new file mode 100644 index 0000000000..3a13b1bf37 --- /dev/null +++ b/FormalConjectures/ErdosProblems/696.lean @@ -0,0 +1,74 @@ +/- +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 696 + +*Reference:* [erdosproblems.com/696](https://www.erdosproblems.com/696) + +Erdős asked whether $H(n)/h(n) \to \infty$ for almost all $n$, where $h(n)$ is the length of +the longest mod-chain of prime divisors of $n$ and $H(n)$ is the length of the longest mod-chain +of divisors of $n$. + +See also Erdős Problem 695. + +[Er79e] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67-70. +-/ + +open Classical Filter Finset + +namespace Erdos696 + +/-- A list of natural numbers forms a mod-chain: it is strictly increasing +and consecutive elements satisfy $d_{i+1} \equiv 1 \pmod{d_i}$. -/ +def IsModChain (l : List ℕ) : Prop := + List.IsChain (fun a b => a < b ∧ a ∣ (b - 1)) l + +/-- $h(n)$: the largest $\ell$ such that there is a mod-chain of primes of length $\ell$ +all dividing $n$. -/ +noncomputable def hPrime (n : ℕ) : ℕ := + sSup {k | ∃ l : List ℕ, l.length = k ∧ IsModChain l ∧ ∀ p ∈ l, Nat.Prime p ∧ p ∣ n} + +/-- $H(n)$: the largest $u$ such that there is a mod-chain of divisors of length $u$ +all dividing $n$. -/ +noncomputable def hDivisor (n : ℕ) : ℕ := + sSup {k | ∃ l : List ℕ, l.length = k ∧ IsModChain l ∧ ∀ d ∈ l, d ∣ n} + +/-- Count of integers $m \in \{1, \ldots, N\}$ satisfying predicate $P$. -/ +noncomputable def countSat (P : ℕ → Prop) (N : ℕ) : ℕ := + ((Finset.range N).filter (fun n => P (n + 1))).card + +/-- +Erdős Problem 696 [Er79e, p. 81]: + +Is it true that $H(n)/h(n) \to \infty$ for almost all $n$? + +Formulated as: for every $M > 0$, the natural density of +$\{n : H(n) \geq M \cdot h(n)\}$ is $1$. +-/ +@[category research open, AMS 11] +theorem erdos_696 : answer(sorry) ↔ + ∀ M : ℝ, M > 0 → + Tendsto + (fun N : ℕ => + (countSat (fun n => (hDivisor n : ℝ) ≥ M * (hPrime n : ℝ)) (N + 1) : ℝ) / + ((N + 1 : ℕ) : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos696 diff --git a/FormalConjectures/ErdosProblems/698.lean b/FormalConjectures/ErdosProblems/698.lean new file mode 100644 index 0000000000..7c97472a36 --- /dev/null +++ b/FormalConjectures/ErdosProblems/698.lean @@ -0,0 +1,61 @@ +/- +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 698 + +*Reference:* [erdosproblems.com/698](https://www.erdosproblems.com/698) + +A problem of Erdős and Szekeres [ErSz78], who observed that +$$\gcd\left(\binom{n}{i}, \binom{n}{j}\right) \geq \frac{\binom{n}{i}}{\binom{j}{i}} \geq 2^i$$ +(in particular the greatest common divisor is always $> 1$). This inequality is +sharp for $i = 1$, $j = p$, and $n = 2p$. + +Resolved by Bergman [Be11], who proved that for any $2 \leq i < j \leq n/2$, +$$\gcd\left(\binom{n}{i}, \binom{n}{j}\right) \gg n^{1/2} \cdot 2^i / i^{3/2},$$ +where the implied constant is absolute. +-/ + +open Filter + +namespace Erdos698 + +/-- +Erdős Problem 698 [ErSz78] — proved by Bergman [Be11]: +There exists $h : \mathbb{N} \to \mathbb{N}$ with $h(n) \to \infty$ such that for all +$2 \leq i < j \leq n/2$, +$$\gcd\left(\binom{n}{i}, \binom{n}{j}\right) \geq h(n).$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_698 : answer(True) ↔ + ∃ h : ℕ → ℕ, Tendsto h atTop atTop ∧ + ∀ n i j : ℕ, 2 ≤ i → i < j → j ≤ n / 2 → + h n ≤ Nat.gcd (Nat.choose n i) (Nat.choose n j) := by + sorry + +/-- Bergman's quantitative bound [Be11]: for $2 \leq i < j \leq n/2$, +$$\gcd\left(\binom{n}{i}, \binom{n}{j}\right) \gg n^{1/2} \cdot 2^i / i^{3/2},$$ +where the implied constant is absolute. -/ +@[category research solved, AMS 5 11] +theorem erdos_698_bergman_bound : + ∃ C : ℝ, C > 0 ∧ ∀ n i j : ℕ, 2 ≤ i → i < j → j ≤ n / 2 → + C * (n : ℝ) ^ ((1 : ℝ) / 2) * (2 : ℝ) ^ (i : ℕ) / (i : ℝ) ^ ((3 : ℝ) / 2) ≤ + ↑(Nat.gcd (Nat.choose n i) (Nat.choose n j)) := by + sorry + +end Erdos698 diff --git a/FormalConjectures/ErdosProblems/7.lean b/FormalConjectures/ErdosProblems/7.lean new file mode 100644 index 0000000000..2759b950e3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/7.lean @@ -0,0 +1,71 @@ +/- +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 7 + +*Reference:* [erdosproblems.com/7](https://www.erdosproblems.com/7) + +Erdős asked whether there exists a distinct covering system all of whose moduli are odd. + +[HoNi19] Hough, R. D. and Nielsen, P. P., _Covering systems with restricted divisibility_. +Duke Math. J. **168** (2019), 3261–3295. + +[BBMST22] Balister, P., Bollobás, B., Morris, R., Sahasrabudhe, J., and Tiba, M., +_On the Erdős covering problem: the density of the uncovered set_. Inventiones +mathematicae (2022), 377–414. +-/ + +namespace Erdos7 + +/-- +A finite system of congruences $\{(a_i, m_i)\}$ is a **covering system** if every +modulus is positive and every integer satisfies at least one congruence $n \equiv a_i \pmod{m_i}$. +-/ +def IsCoveringSystem (S : Finset (ℤ × ℕ)) : Prop := + S.Nonempty ∧ + (∀ p ∈ S, 0 < p.2) ∧ + (∀ n : ℤ, ∃ p ∈ S, (p.2 : ℤ) ∣ (n - p.1)) + +/-- +A covering system has **distinct moduli** if no two congruences share the same modulus. +-/ +def HasDistinctModuli (S : Finset (ℤ × ℕ)) : Prop := + ∀ p ∈ S, ∀ q ∈ S, p.2 = q.2 → p = q + +/-- +Is there a distinct covering system all of whose moduli are odd? + +A **distinct covering system** is a finite collection of congruences +$\{n \equiv a_i \pmod{m_i}\}$ where all moduli $m_i$ are pairwise distinct, +covering every integer. The question asks whether such a system can exist with all +moduli odd. + +Known results: +- [HoNi19] proved that in any distinct covering system, at least one modulus must be + divisible by 2 or 3. A simpler proof was given by [BBMST22], who also showed that the + lcm of any odd covering system's moduli must be divisible by 9 or 15. +- [BBMST22] proved no odd distinct covering system exists if the moduli are additionally + required to be squarefree. The general odd case remains open. +-/ +@[category research open, AMS 11] +theorem erdos_7 : answer(sorry) ↔ + ∃ S : Finset (ℤ × ℕ), IsCoveringSystem S ∧ HasDistinctModuli S ∧ ∀ p ∈ S, Odd p.2 := by + sorry + +end Erdos7 diff --git a/FormalConjectures/ErdosProblems/70.lean b/FormalConjectures/ErdosProblems/70.lean new file mode 100644 index 0000000000..e448f40f0c --- /dev/null +++ b/FormalConjectures/ErdosProblems/70.lean @@ -0,0 +1,71 @@ +/- +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 70 + +*Reference:* [erdosproblems.com/70](https://www.erdosproblems.com/70) + +Is it true that $\mathfrak{c} \to (\beta, n)^3_2$ for every countable ordinal $\beta$ and +every finite $n \geq 2$, where $\mathfrak{c}$ is the cardinality of the continuum? + +Erdős and Rado proved that $\mathfrak{c} \to (\omega + n, 4)^3_2$ for any $2 \leq n < \omega$. + +[Er87] Erdős, P., _On some of my favourite unsolved problems_ (1987). + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999), §7.83. +-/ + +open Ordinal Cardinal + +namespace Erdos70 + +/-- The ordinal partition relation $\alpha \to (\beta, \gamma)^3_2$: +for every 2-coloring of increasing triples from ordinals below $\alpha$, +there is either a homogeneous set of order type $\beta$ for color 0, +or a homogeneous set of order type $\gamma$ for color 1. + +A homogeneous set of order type $\delta$ is given by a strictly increasing +function $g$ mapping ordinals below $\delta$ to ordinals below $\alpha$, such that +all increasing triples in the image of $g$ receive the same color. -/ +def OrdinalPartition3_2 (α β γ : Ordinal) : Prop := + ∀ f : Ordinal → Ordinal → Ordinal → Fin 2, + (∃ g : Ordinal → Ordinal, + (∀ i j, i < β → j < β → i < j → g i < g j) ∧ + (∀ i, i < β → g i < α) ∧ + ∀ i j k, i < j → j < k → k < β → f (g i) (g j) (g k) = 0) ∨ + (∃ g : Ordinal → Ordinal, + (∀ i j, i < γ → j < γ → i < j → g i < g j) ∧ + (∀ i, i < γ → g i < α) ∧ + ∀ i j k, i < j → j < k → k < γ → f (g i) (g j) (g k) = 1) + +/-- +**Erdős Problem #70** [Er87]: + +Let $\mathfrak{c}$ be the cardinality of the continuum (viewed as an initial ordinal), +$\beta$ be any countable ordinal, and $2 \le n < \omega$. Is it true that +$\mathfrak{c} \to (\beta, n)^3_2$? +-/ +@[category research open, AMS 3 5] +theorem erdos_70 : answer(sorry) ↔ + ∀ (β : Ordinal), β.card ≤ ℵ₀ → ∀ (n : ℕ), 2 ≤ n → + OrdinalPartition3_2 (Cardinal.continuum.ord) β (↑n) := by + sorry + +end Erdos70 diff --git a/FormalConjectures/ErdosProblems/700.lean b/FormalConjectures/ErdosProblems/700.lean new file mode 100644 index 0000000000..9a7b80ed02 --- /dev/null +++ b/FormalConjectures/ErdosProblems/700.lean @@ -0,0 +1,96 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 700 + +*Reference:* [erdosproblems.com/700](https://www.erdosproblems.com/700) + +A problem of Erdős and Szekeres on the function +$f(n) = \min_{1 < k \le n/2} \gcd(n, \binom{n}{k})$ for composite $n$. + +It is easy to see that $f(n) \le n/P(n)$ for composite $n$, and that $f(n) \ge p(n)$ +(the smallest prime factor). Hence $f(n) \ge n^{1/2}$ when $n = p^2$, and +$f(n) \le (1+o(1))\, n / \log n$ in general. It is known that $f(n) = n/P(n)$ when $n$ +is a product of two primes, or $n = 30$. + +See also OEIS sequence [A091963](https://oeis.org/A091963). + +[ErSz78] Erdős, P., Szekeres, G., _Some number theoretic problems on binomial +coefficients_. Australian Mathematical Society Gazette **5** (1978), 97–99. +-/ + +namespace Erdos700 + +/-- $f(n) = \min_{1 < k \le n/2} \gcd(n, \binom{n}{k})$ for $n \ge 4$; +defined as $0$ for $n < 4$. -/ +def f (n : ℕ) : ℕ := + if h : 4 ≤ n then + ((Finset.Icc 2 (n / 2)).image (fun k => Nat.gcd n (Nat.choose n k))).min' (by + exact ⟨Nat.gcd n (Nat.choose n 2), Finset.mem_image.mpr + ⟨2, Finset.mem_Icc.mpr ⟨le_refl _, by omega⟩, rfl⟩⟩) + else 0 + +/-- +Erdős Problem 700, Part (a) [ErSz78]: +For any composite $n \ge 4$, $f(n) \le n / P(n)$ where $P(n)$ is the largest prime factor. +The characterization of those $n$ where equality holds is the open question. +-/ +@[category research solved, AMS 11] +theorem erdos_700.variants.upper_bound (n : ℕ) (hn : 4 ≤ n) (hcomp : ¬ Nat.Prime n) : + f n ≤ n / Nat.maxPrimeFac n := by + sorry + +/-- +Erdős Problem 700, Part (a') [ErSz78]: +For any composite $n \ge 4$, $f(n) \ge p(n)$ where $p(n)$ is the smallest prime factor of $n$. +-/ +@[category research solved, AMS 11] +theorem erdos_700.variants.lower_bound (n : ℕ) (hn : 4 ≤ n) (hcomp : ¬ Nat.Prime n) : + Nat.minFac n ≤ f n := by + sorry + +/-- +Erdős Problem 700, Part (b) [ErSz78]: +Are there infinitely many composite $n$ such that $f(n) > \sqrt{n}$? +Here $f(n) > \sqrt{n}$ is stated as $f(n)^2 > n$ to remain in $\mathbb{N}$. +-/ +@[category research open, AMS 11] +theorem erdos_700.variants.infinitely_many_large : + answer(sorry) ↔ + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ ¬ Nat.Prime n ∧ 2 ≤ n ∧ (f n) ^ 2 > n := by + sorry + +/-- +Erdős Problem 700, Part (c) [ErSz78]: +Is it true that, for every composite $n$, $f(n) \ll_A n / (\log n)^A$ for every $A > 0$? + +Formalized as: for every positive integer $A$, there exist $C > 0$ and $N_0$ such that +for all composite $n \ge N_0$, $f(n) \le C \cdot n / (\log n)^A$. +-/ +@[category research open, AMS 11] +theorem erdos_700 : + answer(sorry) ↔ + ∀ A : ℕ, 0 < A → + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → ¬ Nat.Prime n → 2 ≤ n → + (f n : ℝ) ≤ C * (n : ℝ) / (Real.log (n : ℝ)) ^ A := by + sorry + +end Erdos700 diff --git a/FormalConjectures/ErdosProblems/701.lean b/FormalConjectures/ErdosProblems/701.lean new file mode 100644 index 0000000000..bbe3a1d9e5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/701.lean @@ -0,0 +1,76 @@ +/- +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 701 + +Chvátal's Conjecture: if a family of finite sets is downward closed (closed under taking subsets), +then the maximum size of an intersecting subfamily is at most the maximum degree (the largest +number of sets containing any single element). + +## References + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica 1 (1981), 25–42. + +[Ch74] Chvátal, V., _Intersecting families of edges in hypergraphs having the hereditary + property_ (1974), 61–66. + +[St74] Sterboul, F., _Sur une conjecture de V. Chvátal_ (1974), 152–164. + +[FrKu23] Frankl, P., Kupavskii, A., _Perfect matchings in down-sets_, Discrete Math. (2023), + Paper No. 113323. + +[Bo11] Borg, P., _On Chvátal's conjecture and a conjecture on families of signed sets_, + European J. Combin. (2011), 140–145. + +*Reference:* [erdosproblems.com/701](https://www.erdosproblems.com/701) +-/ + +open Finset + +namespace Erdos701 + +/-- A family of finite sets $\mathcal{F}$ is downward closed (an abstract simplicial complex) +if whenever $A \in \mathcal{F}$ and $B \subseteq A$, then $B \in \mathcal{F}$. -/ +def IsDownwardClosed {α : Type*} [DecidableEq α] (F : Finset (Finset α)) : Prop := + ∀ A ∈ F, ∀ B : Finset α, B ⊆ A → B ∈ F + +/-- A family of finite sets $\mathcal{F}'$ is intersecting if every two members have +nonempty intersection. -/ +def IsIntersectingFamily {α : Type*} [DecidableEq α] (F' : Finset (Finset α)) : Prop := + ∀ A ∈ F', ∀ B ∈ F', (A ∩ B).Nonempty + +/-- +Chvátal's Conjecture: Let $\mathcal{F}$ be a family of finite sets closed under taking subsets +(i.e. if $B \subseteq A \in \mathcal{F}$ then $B \in \mathcal{F}$). There exists some element $x$ +such that whenever $\mathcal{F}' \subseteq \mathcal{F}$ is an intersecting subfamily we have +$|\mathcal{F}'| \leq |\{A \in \mathcal{F} : x \in A\}|$. + +Equivalently, the maximum intersecting subfamily of a downward-closed family has size at most the +maximum degree. +-/ +@[category research open, AMS 5] +theorem erdos_701 {α : Type*} [DecidableEq α] [Nonempty α] + (F : Finset (Finset α)) + (hF : IsDownwardClosed F) : + ∃ x : α, ∀ F' : Finset (Finset α), F' ⊆ F → IsIntersectingFamily F' → + F'.card ≤ (F.filter (fun A => x ∈ A)).card := by + sorry + +end Erdos701 diff --git a/FormalConjectures/ErdosProblems/702.lean b/FormalConjectures/ErdosProblems/702.lean new file mode 100644 index 0000000000..9d69723653 --- /dev/null +++ b/FormalConjectures/ErdosProblems/702.lean @@ -0,0 +1,56 @@ +/- +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 702 + +*Reference:* [erdosproblems.com/702](https://www.erdosproblems.com/702) + +If a family of k-element subsets of {1,...,n} has more than C(n-2,k-2) members (where k ≥ 4), +then some two members of the family intersect in exactly one element. + +See also: Problem 703. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 108. +[Er76b] Erdős, P., _Problems in combinatorial and graph theory_ (1976), p. 186. +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, 1981. +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, 1982. +[Fr77] Frankl, P., *On families of finite sets no two of which intersect in a singleton*, +Bull. Austral. Math. Soc. 17 (1977), 125–134. +-/ + +open Finset + +namespace Erdos702 + +/-- +**Erdős–Sós Conjecture.** Let $k \geq 4$. If $\mathcal{F}$ is a family of $k$-element subsets of +$\{1, \ldots, n\}$ with $|\mathcal{F}| > \binom{n-2}{k-2}$, then there exist distinct +$A, B \in \mathcal{F}$ such that $|A \cap B| = 1$. + +Proved by Katona (unpublished) for $k = 4$, and by Frankl [Fr77] for all $k \geq 4$. +-/ +@[category research solved, AMS 5] +theorem erdos_702 (n k : ℕ) (hk : 4 ≤ k) (h2k : 2 * k - 1 ≤ n) + (F : Finset (Finset (Fin n))) + (hF_unif : ∀ A ∈ F, A.card = k) + (hF_large : F.card > Nat.choose (n - 2) (k - 2)) : + ∃ A ∈ F, ∃ B ∈ F, A ≠ B ∧ (A ∩ B).card = 1 := by + sorry + +end Erdos702 diff --git a/FormalConjectures/ErdosProblems/703.lean b/FormalConjectures/ErdosProblems/703.lean new file mode 100644 index 0000000000..207f784665 --- /dev/null +++ b/FormalConjectures/ErdosProblems/703.lean @@ -0,0 +1,80 @@ +/- +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 703 + +*Reference:* [erdosproblems.com/703](https://www.erdosproblems.com/703) + +Let $T(n, r)$ be the maximum size of a family of subsets of $\{1, \ldots, n\}$ such that no two +distinct members intersect in exactly $r$ elements. The conjecture, proved by Frankl and Rödl, +asserts that for every $\varepsilon > 0$ there exists $\delta > 0$ such that +$T(n, r) < (2 - \delta)^n$ whenever $\varepsilon n < r < (1/2 - \varepsilon) n$. + +This problem carried a **$250 prize**. + +See also: Problem 702. + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 108. +[Er76b] Erdős, P., _Problems in combinatorial and graph theory_ (1976). +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, 1981. +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, 1982. +[Fr77b] Frankl, P., _An intersection problem for finite sets_, Acta Math. Acad. Sci. Hungar. +(1977), 371–373. +[FrFu84b] Frankl, P. and Füredi, Z., _On hypergraphs without two edges intersecting in a given +number of vertices_, J. Combin. Theory Ser. A (1984), 230–236. +[FrRo87] Frankl, P. and Rödl, V., _Forbidden intersections_, Trans. Amer. Math. Soc. 300 (1987), +259–286. +[FrWi81] Frankl, P. and Wilson, R. M., _Intersection theorems with geometric consequences_, +Combinatorica 1 (1981), 357–368. +-/ + +open Finset + +namespace Erdos703 + +/-- $T(n, r)$ is the maximum cardinality of a family $\mathcal{F}$ of subsets of +$\{1, \ldots, n\}$ (represented as `Fin n`) such that $|A \cap B| \neq r$ for all distinct +$A, B \in \mathcal{F}$. -/ +noncomputable def T (n r : ℕ) : ℕ := + sSup {k : ℕ | ∃ F : Finset (Finset (Fin n)), + F.card = k ∧ + ∀ A ∈ F, ∀ B ∈ F, A ≠ B → (A ∩ B).card ≠ r} + +/-- +Erdős Problem 703 (Frankl–Rödl theorem): + +Let $r \geq 1$ and define $T(n,r)$ to be the maximum size of a family $\mathcal{F}$ of subsets +of $\{1, \ldots, n\}$ such that $|A \cap B| \neq r$ for all distinct $A, B \in \mathcal{F}$. + +For every $\varepsilon > 0$ there exists $\delta > 0$ such that for all $n$ and $r$ with +$\varepsilon n < r < (1/2 - \varepsilon) n$, we have $T(n,r) < (2 - \delta)^n$. + +Proved by Frankl and Rödl [FrRo87]. +-/ +@[category research solved, AMS 5] +theorem erdos_703 : + ∀ ε : ℝ, ε > 0 → + ∃ δ : ℝ, δ > 0 ∧ + ∀ n : ℕ, ∀ r : ℕ, + ε * (n : ℝ) < (r : ℝ) → + (r : ℝ) < (1 / 2 - ε) * (n : ℝ) → + (T n r : ℝ) < (2 - δ) ^ n := by + sorry + +end Erdos703 diff --git a/FormalConjectures/ErdosProblems/704.lean b/FormalConjectures/ErdosProblems/704.lean new file mode 100644 index 0000000000..847d37f943 --- /dev/null +++ b/FormalConjectures/ErdosProblems/704.lean @@ -0,0 +1,109 @@ +/- +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 704 + +*Reference:* [erdosproblems.com/704](https://www.erdosproblems.com/704) + +Let $G_n$ be the unit distance graph in $\mathbb{R}^n$, with two vertices joined by an edge +if and only if the Euclidean distance between them is $1$. + +Estimate the chromatic number $\chi(G_n)$. Does it grow exponentially in $n$? Does +$\lim_{n \to \infty} \chi(G_n)^{1/n}$ exist? + +A generalisation of the Hadwiger–Nelson problem (which addresses $n = 2$). + +**Known results:** +- Frankl–Wilson [FrWi81]: $\chi(G_n) \geq (1+o(1)) \cdot 1.2^n$ +- Larman–Rogers [LaRo72]: $\chi(G_n) \leq (3+o(1))^n$ + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[FrWi81] Frankl, P. and Wilson, R. M., _Intersection theorems with geometric consequences_. +Combinatorica 1 (1981), 357–368. + +[LaRo72] Larman, D. G. and Rogers, C. A., _The realization of distances within sets in +Euclidean space_. Mathematika 19 (1972), 1–24. + +[Pr20] Prosanov, R., _A new proof of the Larman–Rogers upper bound for the chromatic number +of the Euclidean space_. Discrete Appl. Math. (2020), 115–120. +-/ + +open Filter + +open scoped Topology + +namespace Erdos704 + +/-- The unit distance graph in $\mathbb{R}^n$: two points are adjacent iff their +Euclidean distance is exactly $1$. -/ +noncomputable def unitDistanceGraph (n : ℕ) : SimpleGraph (EuclideanSpace ℝ (Fin n)) where + Adj x y := x ≠ y ∧ dist x y = 1 + symm := fun _ _ ⟨hne, hd⟩ => ⟨hne.symm, by rw [dist_comm]; exact hd⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- The chromatic number of the unit distance graph in $\mathbb{R}^n$: the minimum number +of colors needed to properly color all points so that no two points at +distance $1$ share the same color. Returns $0$ if no finite coloring exists. -/ +noncomputable def chromaticNumber_unitDist (n : ℕ) : ℕ := + sInf {k : ℕ | (unitDistanceGraph n).Colorable k} + +/-- +Erdős Problem 704, main open question: + +Does the limit $\lim_{n \to \infty} \chi(G_n)^{1/n}$ exist? +-/ +@[category research open, AMS 5 52] +theorem erdos_704 : answer(sorry) ↔ + ∃ L : ℝ, Tendsto + (fun n : ℕ => (chromaticNumber_unitDist n : ℝ) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds L) := by + sorry + +/-- +Erdős Problem 704, Frankl–Wilson lower bound [FrWi81]: + +The chromatic number of the unit distance graph in $\mathbb{R}^n$ grows at least +exponentially: $\chi(G_n) \geq (1+o(1)) \cdot 1.2^n$. + +Formalized as: there exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$\chi(G_n) \geq C \cdot (6/5)^n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.lower_bound : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (chromaticNumber_unitDist n : ℝ) ≥ C * ((6 : ℝ) / 5) ^ n := by + sorry + +/-- +Erdős Problem 704, Larman–Rogers upper bound [LaRo72]: + +$\chi(G_n) \leq (3+o(1))^n$. + +Formalized as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$\chi(G_n) \leq (3 + \varepsilon)^n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_704.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (chromaticNumber_unitDist n : ℝ) ≤ (3 + ε) ^ n := by + sorry + +end Erdos704 diff --git a/FormalConjectures/ErdosProblems/706.lean b/FormalConjectures/ErdosProblems/706.lean new file mode 100644 index 0000000000..10dbb4c652 --- /dev/null +++ b/FormalConjectures/ErdosProblems/706.lean @@ -0,0 +1,62 @@ +/- +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 706 + +*Reference:* [erdosproblems.com/706](https://www.erdosproblems.com/706) + +Let $L(r)$ be such that if $G$ is a graph formed by taking a finite set of points $P$ in +$\mathbb{R}^2$ and some set $A \subset (0,\infty)$ of size $r$, where the vertex set is $P$ and +there is an edge between two points if and only if their distance is a member of $A$, then +$\chi(G) \leq L(r)$. + +The case $r = 1$ is the Hadwiger–Nelson problem, for which $5 \leq L(1) \leq 7$. + +See also [508], [704], [705]. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica **1** (1981), 25–42. +-/ + +namespace Erdos706 + +/-- The multi-distance graph in $\mathbb{R}^2$: given a set $A$ of positive reals, two points +are adjacent iff their Euclidean distance belongs to $A$. -/ +noncomputable def multiDistanceGraph (A : Set ℝ) : SimpleGraph (EuclideanSpace ℝ (Fin 2)) where + Adj x y := x ≠ y ∧ dist x y ∈ A + symm := fun _ _ ⟨hne, hd⟩ => ⟨hne.symm, by rw [dist_comm]; exact hd⟩ + loopless := fun _ h => h.1 rfl + +/-- +Is it true that $L(r) \leq r^{O(1)}$? That is, does there exist a polynomial bound +on the chromatic number of multi-distance graphs in $\mathbb{R}^2$ as a function of the +number of allowed distances? + +Formalized as: there exist constants $C, K \in \mathbb{N}$ such that for all $r \geq 1$ and all +sets $A$ of $r$ positive real distances, the multi-distance graph on $\mathbb{R}^2$ with +distance set $A$ is $(C \cdot r^K)$-colorable. +-/ +@[category research open, AMS 5 51] +theorem erdos_706 : answer(sorry) ↔ + ∃ C K : ℕ, ∀ (r : ℕ), 1 ≤ r → ∀ (A : Finset ℝ), A.card = r → + (∀ a ∈ A, (0 : ℝ) < a) → + (multiDistanceGraph (↑A : Set ℝ)).Colorable (C * r ^ K) := by + sorry + +end Erdos706 diff --git a/FormalConjectures/ErdosProblems/708.lean b/FormalConjectures/ErdosProblems/708.lean new file mode 100644 index 0000000000..209c93ea60 --- /dev/null +++ b/FormalConjectures/ErdosProblems/708.lean @@ -0,0 +1,136 @@ +/- +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 708 + +*Reference:* [erdosproblems.com/708](https://www.erdosproblems.com/708) + +Let $g(n)$ be minimal such that for any $A \subseteq [2,\infty) \cap \mathbb{N}$ with +$|A| = n$ and any set $I$ of $\max(A)$ consecutive integers there exists some +$B \subseteq I$ with $|B| = g(n)$ such that $\prod_{a \in A} a \mid \prod_{b \in B} b$. + +Is it true that $g(n) \leq (2+o(1))n$? Or perhaps even $g(n) \leq 2n$? + +A problem of Erdős and Surányi [ErSu59], who proved that $g(n) \geq (2-o(1))n$, +and that $g(3) = 4$. Gallai first considered such problems and observed $g(2) = 2$. + +[ErSu59] Erdős, P. and Surányi, J., _Bemerkungen zu einer Aufgabe eines mathematischen +Wettbewerbs_. Mat. Lapok (1959), 39-48. + +[Er92c] Erdős, P., _Some of my forgotten problems in number theory_. Hardy-Ramanujan J. +(1992), 34-50. +-/ + +open Nat Finset + +open scoped BigOperators + +namespace Erdos708 + +/-- +Erdős Problem 708 (weak form) [ErSu59]: $g(n) \leq (2+o(1))n$. + +For every $\varepsilon > 0$, there exists $N_0$ such that for all nonempty +$A \subseteq \{2, 3, \ldots\}$ with $|A| \geq N_0$ and every interval of $\max(A)$ +consecutive natural numbers starting at $k$, there exists a subset $B$ of that interval +with $|B| \leq (2+\varepsilon)|A|$ whose product is divisible by the product of $A$. +-/ +@[category research open, AMS 5 11] +theorem erdos_708 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ (A : Finset ℕ) (hA : A.Nonempty), + N₀ ≤ A.card → (∀ a ∈ A, 2 ≤ a) → + ∀ (k : ℕ), + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + (B.card : ℝ) ≤ (2 + ε) * A.card ∧ + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) := by + sorry + +/-- +Erdős Problem 708 (strong form) [ErSu59]: $g(n) \leq 2n$. + +For every nonempty finite set $A \subseteq \{2, 3, \ldots\}$ and every interval of +$\max(A)$ consecutive natural numbers starting at $k$, there exists a subset $B$ of that +interval with $|B| \leq 2|A|$ whose product is divisible by the product of $A$. +-/ +@[category research open, AMS 5 11] +theorem erdos_708.variants.strong : answer(sorry) ↔ + ∀ (A : Finset ℕ) (hA : A.Nonempty), (∀ a ∈ A, 2 ≤ a) → + ∀ (k : ℕ), + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + B.card ≤ 2 * A.card ∧ + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) := by + sorry + +/-- +Erdős Problem 708 (lower bound, solved) [ErSu59]: $g(n) \geq (2-o(1))n$. + +Erdős and Surányi proved that for every $\varepsilon > 0$ and all sufficiently large $n$, +there exists a set $A \subseteq \{2, 3, \ldots\}$ with $|A| = n$ and an interval of $\max(A)$ +consecutive natural numbers such that any subset $B$ of that interval whose product is +divisible by the product of $A$ must have $|B| \geq (2 - \varepsilon) n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_708.variants.lower_bound : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ (A : Finset ℕ) (hA : A.Nonempty), + A.card = n ∧ (∀ a ∈ A, 2 ≤ a) ∧ + ∃ k : ℕ, ∀ B : Finset ℕ, + B ⊆ Finset.Icc k (k + A.max' hA - 1) → + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) → + ((2 - ε) * n : ℝ) ≤ (B.card : ℝ) := by + sorry + +/-- +Erdős Problem 708 (exact value, solved): $g(2) = 2$. + +Gallai observed that $g(2) = 2$: for any two-element set $A \subseteq \{2, 3, \ldots\}$ +and any interval of $\max(A)$ consecutive naturals, there exists a subset $B$ of size at +most 2 whose product is divisible by $\prod A$, and this bound is tight. +-/ +@[category research solved, AMS 5 11] +theorem erdos_708.variants.g_two : + (∀ (A : Finset ℕ) (hA : A.Nonempty), A.card = 2 → (∀ a ∈ A, 2 ≤ a) → ∀ k : ℕ, + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + B.card ≤ 2 ∧ (∏ a ∈ A, a) ∣ (∏ b ∈ B, b)) ∧ + (∃ (A : Finset ℕ) (hA : A.Nonempty), A.card = 2 ∧ (∀ a ∈ A, 2 ≤ a) ∧ + ∃ k : ℕ, ∀ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) → + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) → 2 ≤ B.card) := by + sorry + +/-- +Erdős Problem 708 (exact value, solved) [ErSu59]: $g(3) = 4$. + +Erdős and Surányi proved that $g(3) = 4$: for any three-element set +$A \subseteq \{2, 3, \ldots\}$ and any interval of $\max(A)$ consecutive naturals, there +exists a subset $B$ of size at most 4 whose product is divisible by $\prod A$, and this +bound is tight. +-/ +@[category research solved, AMS 5 11] +theorem erdos_708.variants.g_three : + (∀ (A : Finset ℕ) (hA : A.Nonempty), A.card = 3 → (∀ a ∈ A, 2 ≤ a) → ∀ k : ℕ, + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + B.card ≤ 4 ∧ (∏ a ∈ A, a) ∣ (∏ b ∈ B, b)) ∧ + (∃ (A : Finset ℕ) (hA : A.Nonempty), A.card = 3 ∧ (∀ a ∈ A, 2 ≤ a) ∧ + ∃ k : ℕ, ∀ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) → + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) → 4 ≤ B.card) := by + sorry + +end Erdos708 diff --git a/FormalConjectures/ErdosProblems/709.lean b/FormalConjectures/ErdosProblems/709.lean new file mode 100644 index 0000000000..a0456f9317 --- /dev/null +++ b/FormalConjectures/ErdosProblems/709.lean @@ -0,0 +1,86 @@ +/- +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 709 + +*Reference:* [erdosproblems.com/709](https://www.erdosproblems.com/709) + +Let $f(n)$ be minimal such that, for any $A = \{a_1, \ldots, a_n\} \subseteq [2, \infty) \cap \mathbb{N}$ +of size $n$, in any interval $I$ of $f(n) \cdot \max(A)$ consecutive integers there exist distinct +$x_1, \ldots, x_n \in I$ such that $a_i \mid x_i$. + +Obtain good bounds for $f(n)$, or even an asymptotic formula. + +A problem of Erdős and Surányi [ErSu59], who proved +$(\log n)^c \ll f(n) \ll n^{1/2}$ +for some constant $c > 0$. + +See also [708]. + +[ErSu59] Erdős, P. and Surányi, J., _Bemerkungen zu einer Aufgabe eines mathematischen +Wettbewerbs_, Mat. Lapok (1959), 39–48. + +[Er92c] Erdős, P., _Some of my forgotten problems in number theory_, Hardy-Ramanujan J. +(1992), 34–50. +-/ + +open Nat Finset + +namespace Erdos709 + +/-- $f(n)$ for Erdős Problem 709: the minimal $f$ such that for any $A \subseteq \{2, 3, \ldots\}$ +with $|A| = n$ and any interval of $f \cdot \max(A)$ consecutive integers starting at $k$, +there exist distinct $x_1, \ldots, x_n$ in the interval with $a_i \mid x_i$. + +Formally, the infimum of all $f$ such that for every such $A$ there exists an +injective assignment $g : A \to \text{interval}$ with $a \mid g(a)$ for all $a \in A$. -/ +noncomputable def f (n : ℕ) : ℕ := + sInf {m : ℕ | ∀ (A : Finset ℕ) (hA : A.Nonempty), + A.card = n → (∀ a ∈ A, 2 ≤ a) → + ∀ k : ℕ, + ∃ g : ℕ → ℕ, + (∀ a ∈ A, g a ∈ Finset.Icc k (k + m * A.max' hA - 1)) ∧ + (∀ a ∈ A, a ∣ g a) ∧ + Set.InjOn g ↑A} + +/-- +Erdős Problem 709, known lower bound [ErSu59]: + +There exist constants $c > 0$ and $C > 0$ such that for all sufficiently large $n$, +$f(n) \geq C \cdot (\log n)^c$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_709 : + ∃ c : ℝ, c > 0 ∧ ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (f n : ℝ) ≥ C * (Real.log n) ^ c := by + sorry + +/-- +Erdős Problem 709, known upper bound [ErSu59]: + +There exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$f(n) \leq C \cdot n^{1/2}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_709.variants.upper : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (f n : ℝ) ≤ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos709 diff --git a/FormalConjectures/ErdosProblems/71.lean b/FormalConjectures/ErdosProblems/71.lean new file mode 100644 index 0000000000..752f48e9f3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/71.lean @@ -0,0 +1,61 @@ +/- +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 71 + +*Reference:* [erdosproblems.com/71](https://www.erdosproblems.com/71) + +For every infinite arithmetic progression containing even numbers, there exists $c > 0$ +such that every graph with average degree at least $c$ contains a cycle whose length +belongs to the progression. Credited to Erdős and Burr [Er82e]. Proved by Bollobás [Bo77]. + +See also Problem 72. + +[Bo77] Bollobás, B., _Cycles modulo k_. Bull. London Math. Soc. **9** (1977), 97–98. +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_. +L'Enseignement Math. **27** (1982), 163–176. +[Er95] Erdős, P., _Some recent problems and results in graph theory_. +Discrete Math. **164** (1997), 81–85. +[Er97b] Erdős, P., _Some of my favourite problems which recently have been solved_. +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). +-/ + +open SimpleGraph + +namespace Erdos71 + +/-- +Erdős Problem #71 (credited to Erdős and Burr [Er82e], proved by Bollobás [Bo77]): +For every infinite arithmetic progression $P = \{a, a+d, a+2d, \ldots\}$ (with $d \geq 1$) +that contains even numbers, there exists a constant $c = c(P) > 0$ such that every +finite graph with average degree at least $c$ contains a cycle whose length belongs to $P$. + +The average degree of a graph $G$ on $n > 0$ vertices is $2|E(G)|/n$. +-/ +@[category research solved, AMS 5] +theorem erdos_71 (a d : ℕ) (hd : 1 ≤ d) (heven : ∃ k : ℕ, Even (a + k * d)) : + ∃ c : ℝ, c > 0 ∧ + ∀ (V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], + 0 < Fintype.card V → + c ≤ (2 * (G.edgeFinset.card : ℝ)) / (Fintype.card V : ℝ) → + ∃ m : ℕ, (∃ k : ℕ, m = a + k * d) ∧ + ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = m := by + sorry + +end Erdos71 diff --git a/FormalConjectures/ErdosProblems/710.lean b/FormalConjectures/ErdosProblems/710.lean new file mode 100644 index 0000000000..5448bba0f8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/710.lean @@ -0,0 +1,106 @@ +/- +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 710 + +*Reference:* [erdosproblems.com/710](https://www.erdosproblems.com/710) + +Let $f(n)$ be minimal such that in $(n, n+f(n))$ there exist distinct integers +$a_1, \ldots, a_n$ such that $k \mid a_k$ for all $1 \le k \le n$. The problem asks +to obtain an asymptotic formula for $f(n)$. + +A problem of Erdős and Pomerance [ErPo80], who proved +$$ +(2/\sqrt{e} + o(1)) \cdot n \cdot (\log n / \log \log n)^{1/2} \le f(n) +\le (1.7398\ldots + o(1)) \cdot n \cdot (\log n)^{1/2}. +$$ + +Erdős [Er92c] offered a prize of 2000 rupees for an asymptotic formula. + +See also [711]. See also OEIS [A390246](https://oeis.org/A390246). + +[ErPo80] Erdős, P. and Pomerance, C., _Matching the natural numbers up to n with distinct multiples +in another interval_. Nederl. Akad. Wetensch. Proc. Ser. A 83 (= Indag. Math. 42) (1980), 147-161. + +[Er92c] Erdős, P., _Some of my forgotten problems in number theory_. Hardy-Ramanujan J. 15 (1992), +34-50. +-/ + +open Nat + +namespace Erdos710 + +/-- $f(n)$ for Erdős Problem 710: the minimal $f$ such that in the open interval +$(n, n+f)$ there exist $n$ distinct integers $a_1, \ldots, a_n$ with $k \mid a_k$ for all +$1 \le k \le n$. -/ +noncomputable def erdos710F (n : ℕ) : ℕ := + sInf {f : ℕ | ∃ g : Fin n → ℕ, + Function.Injective g ∧ + (∀ i : Fin n, n < g i) ∧ + (∀ i : Fin n, g i < n + f) ∧ + (∀ i : Fin n, (i.val + 1) ∣ g i)} + +/-- +Erdős Problem 710: Obtain an asymptotic formula for $f(n)$, defined as the minimal $f$ such +that in $(n, n+f)$ there exist distinct integers $a_1, \ldots, a_n$ with $k \mid a_k$ for all +$1 \le k \le n$. The answer is an unknown function $g$ such that $f(n) / g(n) \to 1$. +-/ +@[category research open, AMS 11] +theorem erdos_710 : + Filter.Tendsto (fun n : ℕ => (erdos710F n : ℝ) / (answer(sorry) : ℕ → ℝ) n) + Filter.atTop (nhds 1) := by + sorry + +/-- +Erdős Problem 710, known lower bound [ErPo80]: + +For every $\varepsilon > 0$, there exists $N_0$ such that for all $n \ge N_0$, +$$ +f(n) \ge (2/\sqrt{e} - \varepsilon) \cdot n \cdot (\log n / \log \log n)^{1/2}. +$$ +-/ +@[category research solved, AMS 11] +theorem erdos_710.variants.lower : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos710F n : ℝ) ≥ + (2 / (Real.exp 1) ^ ((1 : ℝ) / 2) - ε) * (n : ℝ) * + (Real.log (n : ℝ) / Real.log (Real.log (n : ℝ))) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 710, known upper bound [ErPo80]: + +For every $\varepsilon > 0$, there exists $N_0$ such that for all $n \ge N_0$, +$$ +f(n) \le (1.7399 + \varepsilon) \cdot n \cdot (\log n)^{1/2}. +$$ + +The constant $1.7398\ldots$ comes from the original paper; we use $1.7399$ as +a rational upper bound on that constant. +-/ +@[category research solved, AMS 11] +theorem erdos_710.variants.upper : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos710F n : ℝ) ≤ + (1.7399 + ε) * (n : ℝ) * (Real.log (n : ℝ)) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos710 diff --git a/FormalConjectures/ErdosProblems/711.lean b/FormalConjectures/ErdosProblems/711.lean new file mode 100644 index 0000000000..6fe0bc545e --- /dev/null +++ b/FormalConjectures/ErdosProblems/711.lean @@ -0,0 +1,90 @@ +/- +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 711 + +*Reference:* [erdosproblems.com/711](https://www.erdosproblems.com/711) + +A problem of Erdős and Pomerance on the function $f(n,m)$, the minimal $f$ such that +in the open interval $(m, m+f)$ there exist distinct integers $a_1, \ldots, a_n$ with +$k \mid a_k$ for all $1 \leq k \leq n$. + +Erdős [Er92c] offered 1000 rupees for solutions to either part. See also [710]. + +[ErPo80] Erdős, P. and Pomerance, C., _Matching the natural numbers up to n with distinct multiples +in another interval_. Nederl. Akad. Wetensch. Proc. Ser. A 83 (= Indag. Math. 42) (1980), 147-161. + +[Er92c] Erdős, P., _Some of my forgotten problems in number theory_. Hardy-Ramanujan J. 15 (1992), +34-50. + +[vD26] van Doorn, W., _On the length of an interval that contains distinct multiples of the first +n positive integers_. Integers (2026), #A7. +-/ + +open Nat + +namespace Erdos711 + +/-- $f(n,m)$ for Erdős Problem 711: the minimal $f$ such that in the open interval +$(m, m+f)$ there exist $n$ distinct integers $a_1, \ldots, a_n$ with $k \mid a_k$ for all +$1 \leq k \leq n$. When $m = n$ this coincides with the function in Problem 710. -/ +noncomputable def f (n m : ℕ) : ℕ := + sInf {f : ℕ | ∃ g : Fin n → ℕ, + Function.Injective g ∧ + (∀ i : Fin n, m < g i) ∧ + (∀ i : Fin n, g i < m + f) ∧ + (∀ i : Fin n, (i.val + 1) ∣ g i)} + +/-- +Erdős Problem 711, Part 1 [ErPo80]: + +Prove that $\max_m f(n,m) \leq n^{1+o(1)}$. + +Formulated as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$ +and all $m$, +$$f(n,m) \leq n^{1+\varepsilon}.$$ + +Erdős and Pomerance proved the weaker bound $\max_m f(n,m) \ll n^{3/2}$. +-/ +@[category research open, AMS 11] +theorem erdos_711 : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ m : ℕ, + (f n m : ℝ) ≤ (n : ℝ) ^ (1 + ε) := by + sorry + +/-- +Erdős Problem 711, Part 2 [ErPo80]: + +Prove that $\max_m (f(n,m) - f(n,n)) \to \infty$. + +Formulated as: for every $C$, there exists $N_0$ such that for all $n \geq N_0$, +there exists $m$ with $f(n,m) \geq f(n,n) + C$. + +van Doorn [vD26] proved that for all large $n$ there exists $m$ with +$f(n,m) - f(n,n) \gg (\log n / \log \log n) \cdot n$. +-/ +@[category research solved, AMS 11] +theorem erdos_711.variants.divergence : + ∀ C : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ m : ℕ, f n m ≥ f n n + C := by + sorry + +end Erdos711 diff --git a/FormalConjectures/ErdosProblems/712.lean b/FormalConjectures/ErdosProblems/712.lean new file mode 100644 index 0000000000..b6c90a2097 --- /dev/null +++ b/FormalConjectures/ErdosProblems/712.lean @@ -0,0 +1,75 @@ +/- +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 712 + +*Reference:* [erdosproblems.com/712](https://www.erdosproblems.com/712) + +Determine, for any $k > r > 2$, the value of +$$\lim_{n \to \infty} \mathrm{ex}_r(n, K_k^r) / \binom{n}{r},$$ +where $\mathrm{ex}_r(n, K_k^r)$ is the largest number of $r$-edges which can be placed on $n$ +vertices so that there exists no set of $k$ vertices which is covered by all +$\binom{k}{r}$ possible $r$-edges. + +Turán proved that, when $r = 2$, this limit is $\frac{1}{2}(1 - \frac{1}{k-1})$. + +Erdős offered \$500 for the determination of this value for any fixed $k > r > 2$, +and \$1000 for 'clearing up the whole set of problems'. + +See also [500] for the case $r = 3$ and $k = 4$. + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[Er74c] Erdős, P., _Problems and results on combinatorial number theory III_ (1974). + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica (1981), 25–42. +-/ + +open Finset Filter + +namespace Erdos712 + +/-- An $r$-uniform hypergraph on `Fin n` is $K_k^r$-free if every edge has exactly $r$ +vertices and no $k$ vertices span all $\binom{k}{r}$ possible $r$-element subsets. -/ +def IsKkrFree {n : ℕ} (r k : ℕ) (H : Finset (Finset (Fin n))) : Prop := + (∀ e ∈ H, e.card = r) ∧ + ∀ S : Finset (Fin n), S.card = k → ¬(S.powersetCard r ⊆ H) + +/-- The $r$-uniform Turán number $\mathrm{ex}_r(n, K_k^r)$: the maximum number of $r$-element +subsets of an $n$-element set such that no $k$ vertices span all $\binom{k}{r}$ +$r$-subsets. -/ +noncomputable def exrKkr (r k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : Finset (Finset (Fin n)), IsKkrFree r k H ∧ H.card = m} + +/-- +Erdős Conjecture (Problem 712) — Hypergraph Turán Densities: + +For any $k > r > 2$, determine the value of the Turán density +$$\lim_{n \to \infty} \mathrm{ex}_r(n, K_k^r) / \binom{n}{r}.$$ +-/ +@[category research open, AMS 5] +theorem erdos_712 : ∀ k r : ℕ, 2 < r → r < k → + ∃ L : ℝ, Tendsto + (fun n : ℕ => (exrKkr r k n : ℝ) / (Nat.choose n r : ℝ)) + atTop (nhds L) ∧ L = answer(sorry) := by + sorry + +end Erdos712 diff --git a/FormalConjectures/ErdosProblems/713.lean b/FormalConjectures/ErdosProblems/713.lean new file mode 100644 index 0000000000..dc5c943ef9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/713.lean @@ -0,0 +1,100 @@ +/- +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 713 + +*Reference:* [erdosproblems.com/713](https://www.erdosproblems.com/713) + +A problem of Erdős and Simonovits, worth \$500. Is it true that for every finite bipartite graph +$G$, there exist $\alpha \in [1, 2)$ and $c > 0$ such that $\operatorname{ex}(n; G) \sim cn^\alpha$? +Must $\alpha$ be rational? + +Erdős [Er67] initially conjectured that $\alpha$ must have the form $1 + 1/k$ or $2 - 1/k$ for +some integer $k \geq 2$, but this was disproved by Erdős and Simonovits [ErSi70]. +The analogous statement fails for hypergraphs: Frankl and Füredi [FrFu87] constructed a +5-uniform counterexample, and Füredi and Gerbner [FuGe21] extended these counterexamples to all +$k \geq 5$. + +See also Problem \#571. + +[Er67] Erdős, P., _Some recent results on extremal problems in graph theory. Results_, +Theory of Graphs (Internat. Sympos., Rome, 1966) (1967), 117–123. + +[ErSi70] Erdős, P. and Simonovits, M., _Some extremal problems in graph theory_, +Combinatorial theory and its applications, I–III (Proc. Colloq., Balatonfüred, 1969) (1970), +377–390. + +[FrFu87] Frankl, P. and Füredi, Z., _Exact solution of some Turán-type problems_, +J. Combin. Theory Ser. A (1987), 226–262. + +[FuGe21] Füredi, Z. and Gerbner, D., _Hypergraphs without exponents_, +J. Combin. Theory Ser. A (2021), Paper No. 105517, 9 pp. +-/ + +open SimpleGraph Filter + +open scoped Topology + +namespace Erdos713 + +/-- A graph $G$ contains $H$ as a subgraph via an injective graph homomorphism. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán extremal number $\operatorname{ex}(n; H)$: the maximum number of edges in a +simple graph on $n$ vertices that does not contain $H$ as a subgraph. -/ +noncomputable def extremalNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m} + +/-- +Erdős Problem 713, Part 1 (Erdős–Simonovits): + +Is it true that for every finite bipartite graph $G$, there exist $\alpha \in [1, 2)$ and $c > 0$ +such that $\operatorname{ex}(n; G) \sim cn^\alpha$, i.e., +$\operatorname{ex}(n; G) / (cn^\alpha) \to 1$ as $n \to \infty$? +-/ +@[category research open, AMS 5] +theorem erdos_713 : answer(sorry) ↔ + ∀ (U : Type) [Fintype U] (G : SimpleGraph U), + G.Colorable 2 → + ∃ α : ℝ, 1 ≤ α ∧ α < 2 ∧ + ∃ c : ℝ, 0 < c ∧ + Tendsto (fun n : ℕ => (extremalNumber G n : ℝ) / (c * (n : ℝ) ^ α)) + atTop (nhds 1) := by + sorry + +/-- +Erdős Problem 713, Part 2 (Rationality of the exponent): + +If $\operatorname{ex}(n; G) \sim cn^\alpha$ for a finite bipartite graph $G$, must $\alpha$ be +rational? +-/ +@[category research open, AMS 5] +theorem erdos_713.variants.rationality : answer(sorry) ↔ + ∀ (U : Type) [Fintype U] (G : SimpleGraph U), + G.Colorable 2 → + ∀ α : ℝ, 1 ≤ α → α < 2 → + ∀ c : ℝ, 0 < c → + Tendsto (fun n : ℕ => (extremalNumber G n : ℝ) / (c * (n : ℝ) ^ α)) + atTop (nhds 1) → + ∃ q : ℚ, (q : ℝ) = α := by + sorry + +end Erdos713 diff --git a/FormalConjectures/ErdosProblems/714.lean b/FormalConjectures/ErdosProblems/714.lean new file mode 100644 index 0000000000..372244f420 --- /dev/null +++ b/FormalConjectures/ErdosProblems/714.lean @@ -0,0 +1,79 @@ +/- +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 714 + +Is it true that $\operatorname{ex}(n; K_{r,r}) \gg n^{2-1/r}$ for all $r \geq 2$? + +*Reference:* [erdosproblems.com/714](https://www.erdosproblems.com/714) + +See also Erdős Problems [#147](https://www.erdosproblems.com/147), +[#768](https://www.erdosproblems.com/768) (the $K_{2,2} = C_4$ case), and +[#1158](https://www.erdosproblems.com/1158) (hypergraph generalization). + +[KST54] Kővári, T., Sós, V. T., and Turán, P., *On a problem of K. Zarankiewicz*. +Colloq. Math. **3** (1954), 50-57. +[Br66] Brown, W. G., *On graphs that do not contain a Thomsen graph*. +Canad. Math. Bull. (1966), 281-285. +[ERS66] Erdős, P., Rényi, A., and Sós, V. T., *On a problem of graph theory*. +Studia Sci. Math. Hungar. (1966), 215-235. +-/ + +open SimpleGraph + +namespace Erdos714 + +/-- A graph $G$ contains $H$ as a subgraph via an injective graph homomorphism. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán extremal number $\operatorname{ex}(n; H)$: the maximum number of edges in a +simple graph on $n$ vertices that does not contain $H$ as a subgraph. -/ +noncomputable def extremalNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m} + +/-- +Erdős Problem 714: + +For every $r \geq 2$, the extremal number $\operatorname{ex}(n; K_{r,r})$ satisfies a lower bound +of order $n^{2-1/r}$. That is, there exist $C > 0$ and $N_0$ such that for all +$n \geq N_0$: +$$\operatorname{ex}(n; K_{r,r}) \geq C \cdot n^{2-1/r}.$$ + +Here $K_{r,r}$ is represented by `completeBipartiteGraph (Fin r) (Fin r)` from +Mathlib, the complete bipartite graph on `Fin r ⊕ Fin r`. + +Kövári, Sós, and Turán proved the matching upper bound +$\operatorname{ex}(n; K_{r,r}) \ll n^{2-1/r}$ for all $r \geq 2$. The conjecture asks whether +the lower bound of the same order also holds. + +The conjectured lower bound is known for $r = 2$ and $r = 3$; the $r = 3$ case was +proved independently by Brown [Br66] and by Erdős, Rényi, and Sós [ERS66]. +-/ +@[category research open, AMS 5] +theorem erdos_714 : answer(sorry) ↔ + ∀ r : ℕ, 2 ≤ r → + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * (n : ℝ) ^ ((2 : ℝ) - 1 / (r : ℝ)) ≤ + (extremalNumber (completeBipartiteGraph (Fin r) (Fin r)) n : ℝ) := by + sorry + +end Erdos714 diff --git a/FormalConjectures/ErdosProblems/715.lean b/FormalConjectures/ErdosProblems/715.lean new file mode 100644 index 0000000000..80d9e75a1a --- /dev/null +++ b/FormalConjectures/ErdosProblems/715.lean @@ -0,0 +1,90 @@ +/- +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 715 + +*Reference:* [erdosproblems.com/715](https://www.erdosproblems.com/715) + +Does every regular graph of degree $4$ contain a regular subgraph of degree $3$? +Is there any $r$ such that every regular graph of degree $r$ must contain a regular +subgraph of degree $3$? + +A problem of Berge (or Berge and Sauer). Alon, Friedland, and Kalai [AFK84] +proved that every $4$-regular graph plus an edge contains a $3$-regular subgraph, +and hence in particular every $r$-regular graph with $r \geq 5$ contains a $3$-regular +subgraph. + +The answer is yes, proved by Tashkinov [Ta82]. + +[Er75] Erdős, P. (1975). + +[Er81] Erdős, P. (1981). + +[Ta82] Tashkinov, V. A., _Regular subgraphs of regular graphs_. Soviet Mathematics +Doklady (1982), 37-38. + +[AFK84] Alon, N., Friedland, S., and Kalai, G., _Regular subgraphs of almost +regular graphs_. Journal of Combinatorial Theory Series B (1984), 92-93. +-/ + +open Classical SimpleGraph + +namespace Erdos715 + +/-- +**Erdős Problem 715** [Er75][Er81]: + +Every $4$-regular simple graph contains a $3$-regular subgraph. + +A subgraph $H$ of $G$ is $3$-regular if every vertex of $H$ has exactly $3$ neighbours +in $H$. We express this using Mathlib's `SimpleGraph.Subgraph`: there exists a +subgraph $H$ of $G$ such that `H.coe` (the coercion to a `SimpleGraph` on `H.verts`) +is $3$-regular, and $H$ has at least one vertex. + +Proved by Tashkinov [Ta82]. +-/ +@[category research solved, AMS 5] +theorem erdos_715 : answer(True) ↔ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj], + G.IsRegularOfDegree 4 → + ∃ H : G.Subgraph, + H.verts.Nonempty ∧ + ∀ v : H.verts, H.degree v = 3 := by + sorry + +/-- +**Erdős Problem 715, Variant** [AFK84]: + +Every $r$-regular simple graph with $r \geq 5$ contains a $3$-regular subgraph. + +Proved by Alon, Friedland, and Kalai [AFK84]. +-/ +@[category research solved, AMS 5] +theorem erdos_715.variants.r_geq_5 : answer(True) ↔ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (r : ℕ), r ≥ 5 → + G.IsRegularOfDegree r → + ∃ H : G.Subgraph, + H.verts.Nonempty ∧ + ∀ v : H.verts, H.degree v = 3 := by + sorry + +end Erdos715 diff --git a/FormalConjectures/ErdosProblems/716.lean b/FormalConjectures/ErdosProblems/716.lean new file mode 100644 index 0000000000..e0c18346b6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/716.lean @@ -0,0 +1,66 @@ +/- +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 716 + +*Reference:* [erdosproblems.com/716](https://www.erdosproblems.com/716) + +Let $\mathcal{F}$ be the family of all 3-uniform hypergraphs on 6 vertices with 3 edges. +Is it true that $\mathrm{ex}_3(n, \mathcal{F}) = o(n^2)$? A conjecture of Brown, Erdős, +and Sós [BES73], answered affirmatively by Ruzsa and Szemerédi [RuSz78]. This is known as +the Ruzsa–Szemerédi problem. + +See also Problem 1178 for the generalisation to $k$ vertices and $k-3$ edges, and +Problem 1157 for the completely general Brown–Erdős–Sós conjecture. + +[BES73] Brown, W.G., Erdős, P., and Sós, V.T., *Some extremal problems on r-graphs*. +(1973), 53-63. + +[RuSz78] Ruzsa, I.Z. and Szemerédi, E., *Triple systems with no six points carrying three +triangles*. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), Vol. II +(1978), 939-945. +-/ + +namespace Erdos716 + +/-- A 3-uniform hypergraph on `Fin n`: a family of 3-element subsets. -/ +structure Hypergraph3 (n : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = 3 + +/-- A 3-uniform hypergraph is $\mathcal{F}$-free (where $\mathcal{F}$ is the family of all +3-uniform hypergraphs on 6 vertices with 3 edges) if every 6-element subset of +vertices contains at most 2 edges. -/ +def Hypergraph3.isFamilyFree {n : ℕ} (H : Hypergraph3 n) : Prop := + ∀ S : Finset (Fin n), S.card = 6 → + (H.edges.filter (· ⊆ S)).card ≤ 2 + +/-- **Erdős Problem 716** (Brown-Erdős-Sós conjecture [BES73], proved by Ruzsa-Szemerédi +[RuSz78]): $\mathrm{ex}_3(n, \mathcal{F}) = o(n^2)$, i.e., for any $\varepsilon > 0$, +every sufficiently large $\mathcal{F}$-free 3-uniform hypergraph on $n$ vertices has at most +$\varepsilon \cdot n^2$ edges. -/ +@[category research solved, AMS 5] +theorem erdos_716 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ H : Hypergraph3 n, H.isFamilyFree → + (H.edges.card : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +end Erdos716 diff --git a/FormalConjectures/ErdosProblems/717.lean b/FormalConjectures/ErdosProblems/717.lean new file mode 100644 index 0000000000..5b047d2989 --- /dev/null +++ b/FormalConjectures/ErdosProblems/717.lean @@ -0,0 +1,93 @@ +/- +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 717 + +*Reference:* [erdosproblems.com/717](https://www.erdosproblems.com/717) + +Let $G$ be a graph on $n$ vertices with chromatic number $\chi(G)$ and let $\sigma(G)$ be +the maximal $k$ such that $G$ contains a subdivision of $K_k$. Is it true that +$$\chi(G) \ll \frac{n^{1/2}}{\log n} \cdot \sigma(G)?$$ + +Hajós originally conjectured that $\chi(G) \leq \sigma(G)$, which was proved by Dirac [Di52] +when $\chi(G) = 4$. Catlin [Ca74] disproved Hajós' conjecture for all $\chi(G) \geq 7$, and +Erdős and Fajtlowicz [ErFa81] disproved it in a strong form, showing that for almost +all graphs on $n$ vertices, $\chi(G) \gg \frac{n^{1/2}}{\log n} \cdot \sigma(G)$. + +The answer is yes, proved by Fox, Lee, and Sudakov [FLS13]. + +[Di52] Dirac, G. A., _A property of 4-chromatic graphs and some remarks on critical graphs_. +J. London Math. Soc. **27** (1952), 85–92. + +[Ca74] Catlin, P. A., _Subgraphs of graphs, I_. Discrete Mathematics **10** (1974), 225–233. + +[ErFa81] Erdős, P. and Fajtlowicz, S., _On the conjecture of Hajós_. Combinatorica **1** +(1981), 141–143. + +[FLS13] Fox, J., Lee, C., and Sudakov, B., _Chromatic number, clique subdivisions, and the +conjectures of Hajós and Erdős–Fajtlowicz_. Combinatorica **33** (2013), 181–197. +-/ + +open SimpleGraph + +namespace Erdos717 + +/-- A graph $G$ contains a subdivision of $K_k$ (a topological $K_k$ minor) if there + exist $k$ distinct branch vertices and internally vertex-disjoint paths in $G$ + between every pair of branch vertices. -/ +def ContainsSubdivision {V : Type*} [DecidableEq V] + (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (f : Fin k ↪ V) + (paths : ∀ (i j : Fin k), i < j → G.Walk (f i) (f j)), + -- Each walk is a path (no repeated vertices) + (∀ i j (h : i < j), (paths i j h).IsPath) ∧ + -- Internal vertices of different paths are disjoint + (∀ i₁ j₁ (h₁ : i₁ < j₁) i₂ j₂ (h₂ : i₂ < j₂), + (i₁, j₁) ≠ (i₂, j₂) → + ∀ v, v ∈ (paths i₁ j₁ h₁).support.tail.dropLast → + v ∉ (paths i₂ j₂ h₂).support.tail.dropLast) ∧ + -- Internal vertices are disjoint from branch vertices + (∀ i j (h : i < j) v, + v ∈ (paths i j h).support.tail.dropLast → + ∀ m : Fin k, v ≠ f m) + +/-- $\sigma(G)$ is the maximum $k$ such that $G$ contains a subdivision of $K_k$. + For a graph on a finite vertex type, this is always finite. -/ +noncomputable def subdivisionNumber {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) : ℕ := + sSup {k : ℕ | ContainsSubdivision G k} + +/-- +**Erdős Problem 717** (PROVED, Fox–Lee–Sudakov [FLS13]): + +For every graph $G$ on $n$ vertices, +$$\chi(G) \leq C \cdot \frac{\sqrt{n}}{\log n} \cdot \sigma(G)$$ +for some absolute constant $C > 0$. +-/ +@[category research solved, AMS 5] +theorem erdos_717 : answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ (n : ℕ), 2 ≤ n → + ∀ (G : SimpleGraph (Fin n)), + (G.chromaticNumber.toNat : ℝ) ≤ + C * Real.sqrt (n : ℝ) / Real.log (n : ℝ) * + (subdivisionNumber G : ℝ) := by + sorry + +end Erdos717 diff --git a/FormalConjectures/ErdosProblems/718.lean b/FormalConjectures/ErdosProblems/718.lean new file mode 100644 index 0000000000..45d89362c6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/718.lean @@ -0,0 +1,74 @@ +/- +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 718 + +*Reference:* [erdosproblems.com/718](https://www.erdosproblems.com/718) + +A conjecture of Erdős, Hajnal, and Mader [Er81]. Dirac proved that every graph on $n$ +vertices with at least $2n - 2$ edges contains a subdivision of $K_4$, and conjectured that +$3n - 5$ edges forces a subdivision of $K_5$. + +Mader proved that $\geq 2^{\binom{r}{2}} \cdot n$ edges suffices. + +[Er81] Erdős, P., _Problems and results in graph theory and combinatorics_. Proceedings of +the Southeastern Conference on Combinatorics, Graph Theory, and Computing (1981), p. 35. + +[KoSz96] Komlós, J. and Szemerédi, E., _Topological cliques in graphs II_. Combinatorics, +Probability and Computing (1996), 5, 79–90. + +[BoTh96] Bollobás, B. and Thomason, A., _Proof of a conjecture of Mader, Erdős and Hajnal +on topological complete subgraphs_. European J. Combin. (1998), 19, 883–887. +-/ + +open SimpleGraph + +namespace Erdos718 + +/-- A graph $G$ contains a subdivision of $K_k$ if there exist $k$ distinct branch vertices +and internally vertex-disjoint paths between every pair of branch vertices. -/ +def ContainsSubdivision {V : Type*} [DecidableEq V] + (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (f : Fin k ↪ V) + (paths : ∀ (i j : Fin k), i < j → G.Walk (f i) (f j)), + (∀ i j (h : i < j), (paths i j h).IsPath) ∧ + (∀ i₁ j₁ (h₁ : i₁ < j₁) i₂ j₂ (h₂ : i₂ < j₂), + (i₁, j₁) ≠ (i₂, j₂) → + ∀ v, v ∈ (paths i₁ j₁ h₁).support.tail.dropLast → + v ∉ (paths i₂ j₂ h₂).support.tail.dropLast) ∧ + (∀ i j (h : i < j) v, + v ∈ (paths i j h).support.tail.dropLast → + ∀ m : Fin k, v ≠ f m) + +/-- +**Erdős Problem 718** (Komlós–Szemerédi [KoSz96], Bollobás–Thomason [BoTh96]): + +There exists an absolute constant $C > 0$ such that any graph on $n$ vertices +with at least $C \cdot r^2 \cdot n$ edges contains a subdivision of $K_r$. +-/ +@[category research solved, AMS 5] +theorem erdos_718 : + ∃ C : ℝ, C > 0 ∧ + ∀ (n r : ℕ), r ≤ n → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ C * (r : ℝ) ^ 2 * (n : ℝ) → + ContainsSubdivision G r := by + sorry + +end Erdos718 diff --git a/FormalConjectures/ErdosProblems/719.lean b/FormalConjectures/ErdosProblems/719.lean new file mode 100644 index 0000000000..5ad1d4d917 --- /dev/null +++ b/FormalConjectures/ErdosProblems/719.lean @@ -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 + +/-! +# Erdős Problem 719 + +*Reference:* [erdosproblems.com/719](https://www.erdosproblems.com/719) + +A conjecture of Erdős and Sauer. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. +-/ + +open Finset + +namespace Erdos719 + +/-- An $r$-uniform hypergraph on `Fin n`: a family of $r$-element subsets. -/ +def IsRUniformHypergraph (n r : ℕ) (H : Finset (Finset (Fin n))) : Prop := + ∀ e ∈ H, e.card = r + +/-- An $r$-uniform hypergraph is $K_{r+1}^r$-free: no $(r+1)$-element vertex set has +all its $r$-element subsets as edges. -/ +def IsHypergraphCliqueFree (r : ℕ) {n : ℕ} (H : Finset (Finset (Fin n))) : Prop := + ¬∃ S : Finset (Fin n), S.card = r + 1 ∧ Finset.powersetCard r S ⊆ H + +/-- The Turán number $\mathrm{ex}_r(n; K_{r+1}^r)$: the maximum number of edges in an +$r$-uniform $K_{r+1}^r$-free hypergraph on $n$ vertices. -/ +noncomputable def turanHypergraphNumber (n r : ℕ) : ℕ := + sSup {k : ℕ | ∃ H : Finset (Finset (Fin n)), + IsRUniformHypergraph n r H ∧ H.card = k ∧ IsHypergraphCliqueFree r H} + +/-- The edges of a decomposition piece: if $S$ has $r$ elements (a $K_r^r$ copy), +it contributes the single edge $\{S\}$; if $S$ has $r+1$ elements (a $K_{r+1}^r$ copy), +it contributes all $r$-element subsets of $S$. -/ +def pieceEdges (r : ℕ) {n : ℕ} (S : Finset (Fin n)) : Finset (Finset (Fin n)) := + if S.card = r then {S} + else if S.card = r + 1 then Finset.powersetCard r S + else ∅ + +/-- +Erdős Problem 719 (Erdős–Sauer conjecture) [Er81]: + +Is every $r$-uniform hypergraph $G$ on $n$ vertices the union of at most +$\mathrm{ex}_r(n; K_{r+1}^r)$ edge-disjoint copies of $K_r^r$ (single edges) and $K_{r+1}^r$ +(complete $(r+1)$-cliques)? +-/ +@[category research open, AMS 5] +theorem erdos_719 : answer(sorry) ↔ ∀ (n r : ℕ) (H : Finset (Finset (Fin n))), + 2 ≤ r → + IsRUniformHypergraph n r H → + ∃ (pieces : Finset (Finset (Fin n))), + (∀ S ∈ pieces, S.card = r ∨ S.card = r + 1) ∧ + (∀ e ∈ H, ∃ S ∈ pieces, e ∈ pieceEdges r S) ∧ + (∀ S ∈ pieces, ∀ e ∈ pieceEdges r S, e ∈ H) ∧ + (∀ S₁ ∈ pieces, ∀ S₂ ∈ pieces, S₁ ≠ S₂ → + Disjoint (pieceEdges r S₁) (pieceEdges r S₂)) ∧ + pieces.card ≤ turanHypergraphNumber n r := by + sorry + +end Erdos719 diff --git a/FormalConjectures/ErdosProblems/72.lean b/FormalConjectures/ErdosProblems/72.lean new file mode 100644 index 0000000000..6d8cc9137a --- /dev/null +++ b/FormalConjectures/ErdosProblems/72.lean @@ -0,0 +1,92 @@ +/- +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 + +/-! +# Erdős Problem 72 + +*Reference:* [erdosproblems.com/72](https://www.erdosproblems.com/72) + +There exists a density-zero set $A$ and a constant $c > 0$ such that every graph with +average degree at least $c$ contains a cycle whose length is in $A$. Proved by +Verstraëte [Ve05]; Liu and Montgomery [LiMo20] showed powers of $2$ work. +Erdős was "almost certain" that powers of $2$ would not work, and offered \$100 for a solution. + +See also Problem 71. + +[Bo77] Bollobás, B., _Cycles modulo k_. Bull. London Math. Soc. **9** (1977), 97–98. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Math. Pannon. (1994), 261–269. + +[Er95] Erdős, P., _Some recent problems and results in graph theory_. +Discrete Math. **164** (1997), 81–85. + +[Er97b] Erdős, P., _Some of my favourite problems which recently have been solved_, +Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Ve05] Verstraëte, J., _A note on vertex-disjoint cycles_. Combinatorics, Probability and +Computing **14** (2005), 127–143. + +[LiMo20] Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_. +J. Amer. Math. Soc. **36** (2023), 1191–1234. +-/ + +open SimpleGraph + +namespace Erdos72 + +/-- +Is there a set $A \subset \mathbb{N}$ of density $0$ and a constant $c > 0$ such that every graph on +sufficiently many vertices with average degree $\geq c$ contains a cycle whose length is in $A$? + +Solved affirmatively by Verstraëte [Ve05] (non-constructive proof). +Liu and Montgomery [LiMo20] proved this holds even when $A$ is the set of powers of $2$. +-/ +@[category research solved, AMS 5] +theorem erdos_72 : answer(True) ↔ + ∃ (A : Set ℕ), A.HasDensity 0 ∧ + ∃ (c : ℝ), c > 0 ∧ + ∃ (N₀ : ℕ), ∀ (n : ℕ), n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) (hd : DecidableRel G.Adj), + haveI := hd + 2 * (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) → + ∃ (k : ℕ), k ∈ A ∧ ∃ (v : Fin n), ∃ (p : G.Walk v v), p.IsCycle ∧ p.length = k := by + sorry + +/-- +Liu–Montgomery powers-of-2 variant [LiMo20]: There exists $c > 0$ such that every graph on +sufficiently many vertices with average degree $\geq c$ contains a cycle whose length is a +power of $2$. This is a strictly stronger result than `erdos_72`, giving an explicit +density-zero set. +-/ +@[category research solved, AMS 5] +theorem erdos_72_powers_of_two : + ∃ (c : ℝ), c > 0 ∧ + ∃ (N₀ : ℕ), ∀ (n : ℕ), n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) (hd : DecidableRel G.Adj), + haveI := hd + 2 * (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) → + ∃ (k : ℕ), (∃ m : ℕ, k = 2 ^ m) ∧ + ∃ (v : Fin n), ∃ (p : G.Walk v v), p.IsCycle ∧ p.length = k := by + sorry + +end Erdos72 diff --git a/FormalConjectures/ErdosProblems/720.lean b/FormalConjectures/ErdosProblems/720.lean new file mode 100644 index 0000000000..f0a5e07cea --- /dev/null +++ b/FormalConjectures/ErdosProblems/720.lean @@ -0,0 +1,109 @@ +/- +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.Combinatorics.SimpleGraph.SizeRamsey + +/-! +# Erdős Problem 720 + +*Reference:* [erdosproblems.com/720](https://www.erdosproblems.com/720) + +Let $\hat{R}(G)$ denote the size Ramsey number, the minimal number of edges $m$ such +that there is a graph $H$ with $m$ edges such that in any 2-colouring of the +edges of $H$ there is a monochromatic copy of $G$. + +The original questions asked: +1. Is it true that $\hat{R}(P_n)/n \to \infty$? +2. Is it true that $\hat{R}(P_n)/n^2 \to 0$? +3. Is it true that $\hat{R}(C_n) = o(n^2)$? + +Answered by Beck [Be83b], who proved the much stronger result that +$\hat{R}(P_n) \ll n$ and $\hat{R}(C_n) \ll n$ (i.e., the size Ramsey numbers are linear). + +This resolves all three questions: +- Question 1 is answered in the negative ($\hat{R}(P_n)/n$ is bounded). +- Questions 2 and 3 are answered in the affirmative (in a much stronger form). + +This problem carried a **$100 prize**. See also: Problem #559. + +[Er76c] Erdős, P., _Problems in combinatorics and graph theory_ (1976), p. 5. + +[EFRS78b] Erdős, P., Faudree, R.J., Rousseau, C.C., and Schelp, R.H., _The size Ramsey +number_, Periodica Mathematica Hungarica **9** (1978), 145–161. + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial +number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, +Graph Theory, and Computing (1978), 29–40, p. 33. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica **1** (1981), 25–42. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +1982. + +[Be83b] Beck, J., _On size Ramsey number of paths, trees, and circuits I_, +J. Graph Theory **7** (1983), 115–129. +-/ + +open SimpleGraph + +namespace Erdos720 + +/-- The path graph $P_n$ of length $n$: $n+1$ vertices $\{0, \ldots, n\}$ where vertex $i$ + is adjacent to vertex $i+1$. -/ +def pathGraph (n : ℕ) : SimpleGraph (Fin (n + 1)) where + Adj i j := (i.val + 1 = j.val) ∨ (j.val + 1 = i.val) + symm := fun _ _ h => h.elim Or.inr Or.inl + loopless := fun x h => by rcases h with h | h <;> omega + +/-- The cycle graph $C_n$ on $n$ vertices ($n \geq 3$). Vertex $i$ is adjacent to + vertex $(i+1) \bmod n$ and vertex $(i-1) \bmod n$. -/ +def cycleGraph (n : ℕ) (_ : n ≥ 3) : SimpleGraph (Fin n) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % n ∨ i.val = (j.val + 1) % n) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 720, Part 1 (Beck's theorem for paths) [Be83b]: + +The size Ramsey number of the path $P_n$ is at most linear in $n$. +That is, there exists a constant $C$ such that $\hat{R}(P_n) \leq C \cdot (n + 1)$ for all $n$. + +This disproves the conjecture that $\hat{R}(P_n)/n \to \infty$ and proves +$\hat{R}(P_n)/n^2 \to 0$. +-/ +@[category research solved, AMS 5] +theorem erdos_720 : + ∃ C : ℕ, ∀ n : ℕ, + sizeRamsey (pathGraph n) (pathGraph n) ≤ C * (n + 1) := by + sorry + +/-- +Erdős Problem 720, Part 2 (Beck's theorem for cycles) [Be83b]: + +The size Ramsey number of the cycle $C_n$ is at most linear in $n$. +That is, there exists a constant $C$ such that $\hat{R}(C_n) \leq C \cdot n$ for all $n \geq 3$. + +This proves (in a much stronger form) the conjecture that $\hat{R}(C_n) = o(n^2)$. +-/ +@[category research solved, AMS 5] +theorem erdos_720.variants.cycles : + ∃ C : ℕ, ∀ n : ℕ, (hn : n ≥ 3) → + sizeRamsey (cycleGraph n hn) (cycleGraph n hn) ≤ C * n := by + sorry + +end Erdos720 diff --git a/FormalConjectures/ErdosProblems/721.lean b/FormalConjectures/ErdosProblems/721.lean new file mode 100644 index 0000000000..220d27c1ed --- /dev/null +++ b/FormalConjectures/ErdosProblems/721.lean @@ -0,0 +1,113 @@ +/- +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 721 + +*Reference:* [erdosproblems.com/721](https://www.erdosproblems.com/721) + +Erdős asked for reasonable bounds on the van der Waerden number $W(3,k)$, in particular +whether $W(3,k) < \exp(k^c)$ for some $c < 1$, and for non-trivial lower bounds. + +OEIS: [A171081](https://oeis.org/A171081) + +[Er80] Erdős, P., _A survey of problems in combinatorial number theory_. +Ann. Discrete Math. (1980), 89–115. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. + +[Sc21] Schoen, T., _A subexponential upper bound for van der Waerden numbers W(3, k)_. +Electron. J. Combin. (2021), Paper No. 2.34, 10. + +[BlSi23] Bloom, T. F., Sisask, O., _An improvement to the Kelley-Meka bounds on three-term +arithmetic progressions_. arXiv:2309.02353 (2023). + +[KeMe23] Kelley, Z., Meka, R., _Strong Bounds for 3-Progressions_. arXiv:2302.05537 (2023). + +[Gr22] Green, B., _New lower bounds for van der Waerden numbers_. Forum Math. Pi (2022), +Paper No. e18, 51. + +[Hu22] Hunter, Z., _Improved lower bounds for van der Waerden numbers_. Combinatorica (2022), +1231–1252. +-/ + +open Real + +namespace Erdos721 + +/-- +An arithmetic progression of length $j$ with first term $a$ and common +difference $d$ lies in $\{0, \ldots, n-1\}$ if $d \geq 1$ and all terms +$a + id$ for $i < j$ are less than $n$. +-/ +def APInRange (n a d j : ℕ) : Prop := + d ≥ 1 ∧ ∀ i < j, a + i * d < n + +/-- +A 2-coloring $f : \mathbb{N} \to \text{Bool}$ of $\{0, \ldots, n-1\}$ has a monochromatic +$j$-term arithmetic progression in color $c$. +-/ +def HasMonoAP (f : ℕ → Bool) (n j : ℕ) (c : Bool) : Prop := + ∃ a d, APInRange n a d j ∧ ∀ i < j, f (a + i * d) = c + +/-- +`VDWProperty j k n` asserts: every 2-coloring of $\{0, \ldots, n-1\}$ contains +either a monochromatic $j$-AP in one color or a monochromatic $k$-AP in +the other. +-/ +def VDWProperty (j k n : ℕ) : Prop := + ∀ f : ℕ → Bool, HasMonoAP f n j true ∨ HasMonoAP f n k false + +/-- +The van der Waerden number $W(j, k)$ is the smallest $n$ such that +`VDWProperty j k n` holds. Defined as the infimum of all such $n$. +Van der Waerden's theorem guarantees this set is nonempty for $j, k \geq 1$. +-/ +noncomputable def vanDerWaerden (j k : ℕ) : ℕ := + sInf {n : ℕ | VDWProperty j k n} + +/-- +There exists a constant $c$ with $0 < c < 1$ such that for all sufficiently +large $k$, $W(3, k) < \exp(k^c)$. + +This was first proved by Schoen [Sc21]. The best known upper bound is +$W(3, k) \leq \exp(O((\log k)^9))$ due to Bloom-Sisask [BlSi23], improving +on Kelley-Meka [KeMe23]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_721 : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ + ∃ N₀ : ℕ, ∀ k : ℕ, k ≥ N₀ → + (vanDerWaerden 3 k : ℝ) < Real.exp ((k : ℝ) ^ c) := by + sorry + +/-- +$W(3, k)$ grows superpolynomially: for every degree $d$, +$W(3, k) > k^d$ for all sufficiently large $k$. + +Green [Gr22] proved $W(3,k) \geq \exp(c(\log k)^{4/3}/(\log \log k)^{1/3})$, +improved by Hunter [Hu22] to $W(3,k) \geq \exp(c(\log k)^2/\log \log k)$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_721.variants.lower_bound : + ∀ d : ℕ, ∃ N₀ : ℕ, ∀ k : ℕ, k ≥ N₀ → + (vanDerWaerden 3 k : ℝ) > (k : ℝ) ^ (d : ℝ) := by + sorry + +end Erdos721 diff --git a/FormalConjectures/ErdosProblems/722.lean b/FormalConjectures/ErdosProblems/722.lean new file mode 100644 index 0000000000..0fea1e32f1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/722.lean @@ -0,0 +1,82 @@ +/- +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 722 + +*Reference:* [erdosproblems.com/722](https://www.erdosproblems.com/722) + +Let $k > r$ and $n$ be sufficiently large in terms of $k$ and $r$. Does there always +exist a Steiner system $S(r, k, n)$, provided the trivial necessary divisibility +conditions $\binom{k-i}{r-i} \mid \binom{n-i}{r-i}$ are satisfied for every $0 \le i < r$? + +That is, can one find a family of $\binom{n}{k}/\binom{k}{r}$ many $k$-element subsets of +$\{1, \ldots, n\}$ such that every $r$-element subset is contained in exactly one set +in the family? + +This was proved for $(r,k)$ by: +- Kirkman for $(2,3)$; +- Hanani [Ha61] for $(3,4)$, $(2,4)$, and $(2,5)$; +- Wilson [Wi72] for $(2,k)$ for any $k$; +- Keevash [Ke14] for all $(r,k)$. + +[Ha61] Hanani, H., *The existence and construction of balanced incomplete block designs*, +Ann. Math. Statist. 32 (1961), 361-386. + +[Wi72] Wilson, R. M., *An existence theory for pairwise balanced designs I-III*, +J. Combin. Theory Ser. A (1972-1975). + +[Ke14] Keevash, P., *The existence of designs*, arXiv:1401.3665 (2014). + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica 1 (1981), 25–42. +-/ + +open Finset Nat + +namespace Erdos722 + +/-- A Steiner system $S(r, k, n)$: a collection $F$ of $k$-element subsets of `Fin n` +such that every $r$-element subset of `Fin n` is contained in exactly one +member of $F$. -/ +def IsSteinerSystem (r k n : ℕ) (F : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ F, B.card = k) ∧ + (∀ A : Finset (Fin n), A.card = r → + ∃! B, B ∈ F ∧ A ⊆ B) + +/-- The necessary divisibility conditions for a Steiner system $S(r, k, n)$: +for every $0 \le i < r$, $\binom{k-i}{r-i} \mid \binom{n-i}{r-i}$. -/ +def SteinerDivisibilityConditions (r k n : ℕ) : Prop := + ∀ i < r, (Nat.choose (k - i) (r - i)) ∣ (Nat.choose (n - i) (r - i)) + +/-- +Erdős Problem 722 (Keevash's theorem [Ke14]): + +For every $k > r \ge 1$, there exists $N_0$ such that for all $n \ge N_0$, if the +necessary divisibility conditions are satisfied, then a Steiner system +$S(r, k, n)$ exists. +-/ +@[category research solved, AMS 5] +theorem erdos_722 : answer(True) ↔ + ∀ (r k : ℕ), r ≥ 1 → k > r → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + SteinerDivisibilityConditions r k n → + ∃ F : Finset (Finset (Fin n)), IsSteinerSystem r k n F := by + sorry + +end Erdos722 diff --git a/FormalConjectures/ErdosProblems/724.lean b/FormalConjectures/ErdosProblems/724.lean new file mode 100644 index 0000000000..7bf9c3495f --- /dev/null +++ b/FormalConjectures/ErdosProblems/724.lean @@ -0,0 +1,89 @@ +/- +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 724 + +*Reference:* [erdosproblems.com/724](https://www.erdosproblems.com/724) + +Let $f(n)$ be the maximum number of mutually orthogonal Latin squares of order $n$. +Is it true that $f(n) \gg n^{1/2}$? + +A Latin square of order $n$ is an $n \times n$ array filled with $n$ symbols such that +each symbol occurs exactly once in each row and each column. + +Two Latin squares $L_1$, $L_2$ of order $n$ are orthogonal if the map +$(i, j) \mapsto (L_1(i,j), L_2(i,j))$ is injective (equivalently bijective) on +$\{1, \ldots, n\}^2$, i.e., every ordered pair of symbols occurs exactly once +when the squares are superimposed. + +[Er81] Erdős, P., 1981. + +[CES60] Chowla, S., Erdős, P., and Straus, E.G., _On the maximal number of pairwise +orthogonal Latin squares of a given order_. Canadian J. Math. (1960), 204-208. + +[Wi74] Wilson, R.M., _Concerning the number of mutually orthogonal Latin squares_. Discrete +Math. (1974), 181-198. + +[Be83c] Beth, T., _Eine Bemerkung zur Abschätzung der Anzahl orthogonaler lateinischer +Quadrate mittels Siebverfahren_. Abh. Math. Sem. Univ. Hamburg (1983), 284-288. + +[BPS60] Bose, R.C., Shrikhande, S.S., and Parker, E.T., _Further results on the construction +of mutually orthogonal Latin squares and the falsity of Euler's conjecture_. Canadian J. Math. +(1960), 189-203. +-/ + +namespace Erdos724 + +/-- A Latin square of order $n$: a function `Fin n → Fin n → Fin n` such that +each row and each column is a bijection. -/ +def IsLatinSquare {n : ℕ} (L : Fin n → Fin n → Fin n) : Prop := + (∀ i : Fin n, Function.Bijective (L i)) ∧ + (∀ j : Fin n, Function.Bijective (fun i => L i j)) + +/-- Two Latin squares of order $n$ are orthogonal if the map +$(i, j) \mapsto (L_1(i,j), L_2(i,j))$ is injective on `Fin n × Fin n`. -/ +def AreOrthogonalLatinSquares {n : ℕ} (L₁ L₂ : Fin n → Fin n → Fin n) : Prop := + Function.Injective (fun p : Fin n × Fin n => (L₁ p.1 p.2, L₂ p.1 p.2)) + +/-- A family of $k$ Latin squares of order $n$ is mutually orthogonal if each +is a Latin square and every distinct pair is orthogonal. -/ +def IsMOLS {n k : ℕ} (L : Fin k → Fin n → Fin n → Fin n) : Prop := + (∀ i : Fin k, IsLatinSquare (L i)) ∧ + (∀ i j : Fin k, i ≠ j → AreOrthogonalLatinSquares (L i) (L j)) + +/-- The maximum number of mutually orthogonal Latin squares of order $n$. -/ +noncomputable def maxMOLS (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ L : Fin k → Fin n → Fin n → Fin n, IsMOLS L} + +/-- +Erdős Problem 724 [Er81]: + +Let $f(n)$ be the maximum number of mutually orthogonal Latin squares of order $n$. +Is it true that $f(n) \gg n^{1/2}$? + +Chowla, Erdős, and Straus [CES60] proved $f(n) \gg n^{1/91}$. +Wilson [Wi74] improved this to $f(n) \gg n^{1/17}$. +Beth [Be83c] improved this to $f(n) \gg n^{1/14.8}$. +-/ +@[category research open, AMS 5] +theorem erdos_724 : answer(sorry) ↔ ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxMOLS n : ℝ) ≥ C * Real.sqrt (n : ℝ) := by + sorry + +end Erdos724 diff --git a/FormalConjectures/ErdosProblems/725.lean b/FormalConjectures/ErdosProblems/725.lean new file mode 100644 index 0000000000..7f84b8c9b7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/725.lean @@ -0,0 +1,78 @@ +/- +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 725 + +*Reference:* [erdosproblems.com/725](https://www.erdosproblems.com/725) + +Erdős and Kaplansky [ErKa46] proved the count $L(k,n)$ of $k \times n$ Latin rectangles satisfies +$$ +L(k,n) \sim e^{-\binom{k}{2}} \cdot (n!)^k +$$ +when $k = o((\log n)^{3/2-\varepsilon})$. Yamamoto [Ya51] extended this to +$k \leq n^{1/3-o(1)}$. + +[ErKa46] Erdős, P., Kaplansky, I., _The asymptotic number of Latin rectangles_. +American Journal of Mathematics **68** (1946), 230-236. + +[Ya51] Yamamoto, K., _On the asymptotic number of Latin rectangles_. +Japanese Journal of Mathematics **21** (1951), 113-119. + +[Er81] Erdős, P. (1981). + +See also OEIS sequence [A001009](https://oeis.org/A001009). +-/ + +open Filter + +namespace Erdos725 + +/-- A $k \times n$ Latin rectangle: a function $f : \text{Fin}\, k \to \text{Fin}\, n \to \text{Fin}\, n$ +where each row is a bijection (permutation of $\text{Fin}\, n$) and each column has distinct +entries. -/ +def IsLatinRectangle {k n : ℕ} (f : Fin k → Fin n → Fin n) : Prop := + (∀ i : Fin k, Function.Bijective (f i)) ∧ + (∀ j : Fin n, Function.Injective (fun i : Fin k => f i j)) + +/-- The number of $k \times n$ Latin rectangles. -/ +noncomputable def latinRectangleCount (k n : ℕ) : ℕ := + Set.ncard {f : Fin k → Fin n → Fin n | IsLatinRectangle f} + +/-- +Erdős Problem 725 [Er81]: + +For any sequence $k(n)$ with $k(n) = o(\sqrt{n})$ and $k(n) \geq 2$ eventually, +the number $L(k(n), n)$ of $k(n) \times n$ Latin rectangles satisfies +$$ +\frac{L(k(n), n)}{e^{-\binom{k(n)}{2}} \cdot (n!)^{k(n)}} \to 1 \quad \text{as } n \to \infty. +$$ +-/ +@[category research open, AMS 5] +theorem erdos_725 : + ∀ (k : ℕ → ℕ), + (∀ᶠ n in atTop, 2 ≤ k n) → + (∀ n, k n ≤ n) → + Tendsto (fun n => (k n : ℝ) / Real.sqrt ↑n) atTop (nhds 0) → + Tendsto + (fun n => (latinRectangleCount (k n) n : ℝ) / + (Real.exp (-(↑(Nat.choose (k n) 2) : ℝ)) * ((Nat.factorial n : ℝ) ^ (k n)))) + atTop (nhds 1) := by + sorry + +end Erdos725 diff --git a/FormalConjectures/ErdosProblems/726.lean b/FormalConjectures/ErdosProblems/726.lean new file mode 100644 index 0000000000..dd7189b4f1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/726.lean @@ -0,0 +1,58 @@ +/- +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 726 + +*Reference:* [erdosproblems.com/726](https://www.erdosproblems.com/726) + +A conjecture of Erdős, Graham, Ruzsa, and Straus. + +[EGRS75] Erdős, P., Graham, R. L., Ruzsa, I. Z., and Straus, E. G., +_On the prime factors of $\binom{2n}{n}$_. Mathematics of Computation **29** (1975), 83–92. +-/ + +open Filter Nat + +open scoped Topology Real + +namespace Erdos726 + +/-- The weighted sum of $1/p$ over primes $p \le n$ for which $n \bmod p$ lies in $(p/2, p)$, +i.e., $2 \cdot (n \bmod p) > p$. This captures the condition $n \equiv r \pmod{p}$ for some +integer $r$ with $p/2 < r < p$. -/ +noncomputable def erdos726Sum (n : ℕ) : ℝ := + ((Finset.range (n + 1)).filter Nat.Prime).sum + (fun p => if 2 * (n % p) > p then (1 : ℝ) / (p : ℝ) else 0) + +/-- +Erdős Problem 726 [EGRS75]: + +As $n \to \infty$, +$$\sum_{\substack{p \le n \\ p \text{ prime}}} \mathbf{1}_{n \in (p/2, p) \pmod{p}} \cdot +\frac{1}{p} \sim \frac{\log \log n}{2}.$$ + +Stated as: the ratio of the sum to $(\log \log n)/2$ tends to $1$. +-/ +@[category research open, AMS 11] +theorem erdos_726 : + Tendsto (fun n : ℕ => erdos726Sum n / (Real.log (Real.log (n : ℝ)) / 2)) + atTop (nhds 1) := by + sorry + +end Erdos726 diff --git a/FormalConjectures/ErdosProblems/729.lean b/FormalConjectures/ErdosProblems/729.lean new file mode 100644 index 0000000000..73b9828716 --- /dev/null +++ b/FormalConjectures/ErdosProblems/729.lean @@ -0,0 +1,50 @@ +/- +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 Mathlib.NumberTheory.SmoothNumbers + +/-! +# Erdős Problem 729 + +*Reference:* [erdosproblems.com/729](https://www.erdosproblems.com/729) + +Erdős proved that if $a! b! \mid n!$ then $a + b \le n + O(\log n)$. This problem asks +whether the same bound holds when divisibility is only required "up to small +primes," i.e., the denominator of $n!/(a! b!)$ is supported only on bounded primes. + +The answer is yes (the bound still holds). Proved by Barreto and Leeham. + +[Er68c] Erdős, P., _Aufgabe 557_. Elemente Math. (1968), 111–113. +-/ + +namespace Erdos729 + +/-- +Erdős Problem 729 [Er68c]: + +For any $C > 0$ and any prime bound $P$, the set of triples $(a, b, n)$ such that +$a + b > n + C \cdot \log n$ and the denominator of $n!/(a! b!)$ is $P$-smooth, is finite. +-/ +@[category research solved, AMS 11] +theorem erdos_729 : answer(True) ↔ + ∀ (C : ℝ), C > 0 → ∀ (P : ℕ), Set.Finite {t : ℕ × ℕ × ℕ | + (t.1 : ℝ) + (t.2.1 : ℝ) > (t.2.2 : ℝ) + C * Real.log (t.2.2 : ℝ) ∧ + ((t.2.2.factorial : ℚ) / ((t.1.factorial : ℚ) * (t.2.1.factorial : ℚ))).den ∈ + Nat.smoothNumbers (P + 1)} := by + sorry + +end Erdos729 diff --git a/FormalConjectures/ErdosProblems/73.lean b/FormalConjectures/ErdosProblems/73.lean new file mode 100644 index 0000000000..d07960be48 --- /dev/null +++ b/FormalConjectures/ErdosProblems/73.lean @@ -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 + +/-! +# Erdős Problem 73 + +*Reference:* [erdosproblems.com/73](https://www.erdosproblems.com/73) + +If every induced subgraph of $G$ on $n$ vertices has an independent set of size +$\geq (n - k)/2$, then removing $O_k(1)$ vertices makes $G$ bipartite. +Proved by Reed [Re99]. + +See also: Erdős Problem 922 (related independent-set condition yielding bounded chromatic +number). + +[EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., _On almost bipartite large chromatic graphs_. +Annals of Discrete Mathematics **12** (1982), 117–123. + +[Re99] Reed, B., _Mangoes and blueberries_. Combinatorica **19** (1999), 267–296. +-/ + +namespace Erdos73 + +/-- +Let $k \geq 0$. If $G$ is a finite graph such that every induced subgraph $H$ on $n$ +vertices contains an independent set of size $\geq (n - k) / 2$, then there exists +a set $S$ of $O_k(1)$ vertices whose removal makes $G$ bipartite. + +Equivalently: for every $k$, there exists a constant $C$ (depending only on $k$) +such that for any finite graph $G$ on $n$ vertices, if every vertex subset $S$ +contains an independent set of size at least $(|S| - k) / 2$, then $G$ can be +made bipartite by removing at most $C$ vertices. + +Proved by Reed [Re99]. +-/ +@[category research solved, AMS 5] +theorem erdos_73 : answer(True) ↔ + ∀ k : ℕ, ∃ C : ℕ, + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + -- The condition `2 * I.card ≥ S.card - k` encodes |I| ≥ (|S| - k) / 2. + (∀ S : Finset (Fin n), ∃ I : Finset (Fin n), I ⊆ S ∧ G.IsIndepSet ↑I ∧ + 2 * I.card ≥ S.card - k) → + ∃ T : Finset (Fin n), T.card ≤ C ∧ + ∃ f : Fin n → Bool, ∀ ⦃u v⦄, u ∉ T → v ∉ T → G.Adj u v → f u ≠ f v := by + sorry + +/-- +The $k = 0$ case of Erdős Problem 73: if every vertex subset $S$ of $G$ contains +an independent set of size $\geq |S| / 2$, then $G$ is bipartite (no vertex removal needed). + +This is trivial: a non-bipartite graph contains an odd cycle, which violates the +independent-set hypothesis. Noted by Reed [Re99]. +-/ +@[category research solved, AMS 5] +theorem erdos_73.variants.k_eq_zero : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ S : Finset (Fin n), ∃ I : Finset (Fin n), I ⊆ S ∧ G.IsIndepSet ↑I ∧ + 2 * I.card ≥ S.card) → + ∃ f : Fin n → Bool, ∀ ⦃u v⦄, G.Adj u v → f u ≠ f v := by + sorry + +end Erdos73 diff --git a/FormalConjectures/ErdosProblems/731.lean b/FormalConjectures/ErdosProblems/731.lean new file mode 100644 index 0000000000..a492582566 --- /dev/null +++ b/FormalConjectures/ErdosProblems/731.lean @@ -0,0 +1,68 @@ +/- +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 731 + +For almost all $n$, the least integer $m \geq 2$ not dividing $\binom{2n}{n}$ satisfies +$m = \exp((\log n)^{1/2 + o(1)})$. The open problem asks to find a precise closed-form +function $f(n)$ such that $m \sim f(n)$ for almost all $n$. + +*Reference:* [erdosproblems.com/731](https://www.erdosproblems.com/731) + +[EGRS75] Erdős, P., Graham, R. L., Ruzsa, I. Z., and Straus, E. G., +_On the prime factors of $\binom{2n}{n}$_. Mathematics of Computation **29** (1975), 83–92. + +- [A006197](https://oeis.org/A006197) +-/ + +open Finset Filter Real + +open scoped Topology + +namespace Erdos731 + +/-- The least integer $m \geq 2$ that does not divide $\binom{2n}{n}$. -/ +noncomputable def leastNonDivisorCentralBinom (n : ℕ) : ℕ := + sInf {m : ℕ | 2 ≤ m ∧ ¬(m ∣ n.centralBinom)} + +/-- +Erdős Problem 731 [EGRS75]: + +For almost all $n$, the least $m \geq 2$ not dividing $\binom{2n}{n}$ satisfies +$$m = \exp((\log n)^{1/2 + o(1)}),$$ +i.e., for every $\varepsilon > 0$, the natural density of integers $n$ where the +least non-divisor of $\binom{2n}{n}$ falls outside the interval +$$[\exp((\log n)^{1/2 - \varepsilon}),\, \exp((\log n)^{1/2 + \varepsilon})]$$ +is zero. + +The open problem asks to find a precise closed-form function $f(n)$ such +that $m \sim f(n)$ for almost all $n$. This theorem formalizes the known +asymptotic from [EGRS75]; the full open problem (identifying $f$) remains open. +-/ +@[category research open, AMS 5 11] +theorem erdos_731 (ε : ℝ) (hε : 0 < ε) : + Tendsto (fun x : ℕ => + (((Finset.Icc 1 x).filter (fun n : ℕ => + let m : ℝ := (leastNonDivisorCentralBinom n : ℝ) + ¬(exp ((log (↑n : ℝ)) ^ ((1 : ℝ) / 2 - ε)) ≤ m ∧ + m ≤ exp ((log (↑n : ℝ)) ^ ((1 : ℝ) / 2 + ε))))).card : ℝ) / (↑x : ℝ)) + atTop (nhds 0) := by + sorry + +end Erdos731 diff --git a/FormalConjectures/ErdosProblems/732.lean b/FormalConjectures/ErdosProblems/732.lean new file mode 100644 index 0000000000..11ecd6e748 --- /dev/null +++ b/FormalConjectures/ErdosProblems/732.lean @@ -0,0 +1,72 @@ +/- +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 732 + +*Reference:* [erdosproblems.com/732](https://www.erdosproblems.com/732) + +Call a sequence $1 < X_1 \leq \cdots \leq X_m \leq n$ block-compatible if there is a pairwise +balanced block design $A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ such that $|A_i| = X_i$ for +$1 \leq i \leq m$. (A pairwise block design means every pair in $\{1, \ldots, n\}$ is contained in +exactly one $A_i$.) + +Is there some constant $c > 0$ such that for all large $n$ there are +$\geq \exp(c \cdot \sqrt{n} \cdot \log n)$ many block-compatible sequences for $\{1, \ldots, n\}$? + +Proved by Alon, who showed there are at least $2^{(1/2 + o(1)) \cdot \sqrt{n} \cdot \log n}$ +block-compatible sequences. Erdős proved the upper bound $\exp(O(\sqrt{n} \cdot \log n))$. + +[Er81] Erdős, P., _Problems and results in graph theory and combinatorics_, +Proceedings of the Southeastern Conference on Combinatorics, Graph Theory, +and Computing (1981), p. 35. +-/ + +namespace Erdos732 + +/-- A pairwise balanced design (PBD) on `Fin n`: a finset of blocks where each block +has at least 2 elements and every pair of distinct elements belongs to exactly +one block. -/ +def IsPBD (n : ℕ) (blocks : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ blocks, 2 ≤ B.card) ∧ + (∀ i j : Fin n, i ≠ j → ∃! B, B ∈ blocks ∧ i ∈ B ∧ j ∈ B) + +/-- The multiset of block sizes of a family of sets. -/ +def blockSizeMultiset (n : ℕ) (blocks : Finset (Finset (Fin n))) : Multiset ℕ := + blocks.val.map Finset.card + +/-- A multiset of natural numbers is block-compatible for $n$ if there exists a PBD +on `Fin n` with those block sizes. -/ +def IsBlockCompatible (n : ℕ) (M : Multiset ℕ) : Prop := + ∃ blocks : Finset (Finset (Fin n)), IsPBD n blocks ∧ blockSizeMultiset n blocks = M + +/-- +Erdős Problem 732 [Er81]: + +There exists a constant $c > 0$ such that for all sufficiently large $n$, the number +of block-compatible sequences (multisets of block sizes from PBDs on $\{1, \ldots, n\}$) +is at least $\exp(c \cdot \sqrt{n} \cdot \log n)$. +-/ +@[category research solved, AMS 5] +theorem erdos_732 : answer(True) ↔ ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ S : Finset (Multiset ℕ), + (∀ M ∈ S, IsBlockCompatible n M) ∧ + (S.card : ℝ) ≥ Real.exp (c * Real.sqrt (n : ℝ) * Real.log (n : ℝ)) := by + sorry + +end Erdos732 diff --git a/FormalConjectures/ErdosProblems/733.lean b/FormalConjectures/ErdosProblems/733.lean new file mode 100644 index 0000000000..6a70cdf0d1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/733.lean @@ -0,0 +1,81 @@ +/- +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 733 + +*Reference:* [erdosproblems.com/733](https://www.erdosproblems.com/733) + +Call a sequence $1 < X_1 \leq \cdots \leq X_m \leq n$ line-compatible if there is a set of $n$ +points in $\mathbb{R}^2$ such that there are $m$ lines $\ell_1, \ldots, \ell_m$ containing at least +two points, and the number of points on $\ell_i$ is exactly $X_i$. + +This is essentially the same as problem 607, but with multiplicities. See also problem 732. + +Proved by Szemerédi and Trotter [SzTr83]. + +[Er81] Erdős, P., 1981. + +[SzTr83] Szemerédi, E. and Trotter, W. T., _Extremal problems in discrete geometry_. +Combinatorica 3 (1983), 381–392. +-/ + +open Classical + +namespace Erdos733 + +/-- A line determined by a point set $P$: the set of all points in $P$ collinear +with a given pair of distinct points. -/ +def IsLine (P : Finset (ℝ × ℝ)) (L : Finset (ℝ × ℝ)) : Prop := + L ⊆ P ∧ 2 ≤ L.card ∧ + ∃ p q : ℝ × ℝ, p ∈ P ∧ q ∈ P ∧ p ≠ q ∧ + L = P.filter (fun r => Collinear ℝ ({p, q, r} : Set (ℝ × ℝ))) + +/-- A multiset of natural numbers is line-compatible for $n$ if there exists a +point set $P$ of size $n$ in $\mathbb{R}^2$ whose collection of determined lines yields +that multiset of sizes. -/ +def IsLineCompatible (n : ℕ) (M : Multiset ℕ) : Prop := + ∃ P : Finset (ℝ × ℝ), P.card = n ∧ + ∃ lines : Finset (Finset (ℝ × ℝ)), + (∀ L ∈ lines, IsLine P L) ∧ + (∀ L, IsLine P L → L ∈ lines) ∧ + lines.val.map Finset.card = M + +/-- The set of achievable line-compatible multisets for $n$-point configurations +in $\mathbb{R}^2$. -/ +def achievableLineMultisets (n : ℕ) : Set (Multiset ℕ) := + {M | IsLineCompatible n M} + +/-- +**Erdős Problem 733** [Er81]: + +There exists a constant $C > 0$ such that for all sufficiently large $n$, the number +of line-compatible sequences (multisets of line sizes from $n$-point configurations +in $\mathbb{R}^2$) is at most $\exp(C \cdot \sqrt{n})$. + +Proved by Szemerédi and Trotter [SzTr83]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_733 : + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + (achievableLineMultisets n).Finite ∧ + ((achievableLineMultisets n).ncard : ℝ) ≤ + Real.exp (C * Real.sqrt (n : ℝ)) := by + sorry + +end Erdos733 diff --git a/FormalConjectures/ErdosProblems/734.lean b/FormalConjectures/ErdosProblems/734.lean new file mode 100644 index 0000000000..9f752a6657 --- /dev/null +++ b/FormalConjectures/ErdosProblems/734.lean @@ -0,0 +1,73 @@ +/- +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 734 + +*Reference:* [erdosproblems.com/734](https://www.erdosproblems.com/734) + +Find, for all large $n$, a non-trivial pairwise balanced block design +$A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ such that, for all $t$, +there are $O(n^{1/2})$ many $i$ such that $|A_i| = t$. + +A pairwise balanced block design (PBBD) on $\{1, \ldots, n\}$ is a +collection of subsets such that every pair of distinct elements is +contained in exactly one block. + +Erdős and de Bruijn proved that any PBBD has $m \geq n$ blocks, which +implies there must be some block size $t$ appearing at least +$\Omega(\sqrt{n})$ times. This conjecture asks whether $O(\sqrt{n})$ is +achievable for every block size simultaneously. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica (1981), 25-42. + +[dBEr48] de Bruijn, N.G. and Erdős, P., _On a combinatorial problem_, +Nederl. Akad. Wetensch., Proc. (1948), 1277–1279. +-/ + +open Finset + +namespace Erdos734 + +/-- A pairwise balanced block design (PBBD) on `Fin n`: a collection of +subsets such that every pair of distinct elements is contained in +exactly one block. -/ +def IsPairwiseBalancedDesign (n : ℕ) (blocks : Finset (Finset (Fin n))) : Prop := + ∀ (a b : Fin n), a ≠ b → + ∃! B ∈ blocks, a ∈ B ∧ b ∈ B + +/-- +Erdős Problem 734 [Er81, p.35]: + +For all sufficiently large $n$, there exists a non-trivial pairwise balanced +block design on $\{1, \ldots, n\}$ where for every $t$, at most $O(\sqrt{n})$ +blocks have size $t$. Non-trivial means at least one block has size $\geq 3$. +-/ +@[category research open, AMS 5] +theorem erdos_734 : + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ blocks : Finset (Finset (Fin n)), + IsPairwiseBalancedDesign n blocks ∧ + (∃ B ∈ blocks, 2 < B.card) ∧ + ∀ t : ℕ, ((blocks.filter (fun B => B.card = t)).card : ℝ) ≤ + C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos734 diff --git a/FormalConjectures/ErdosProblems/735.lean b/FormalConjectures/ErdosProblems/735.lean new file mode 100644 index 0000000000..48aaaa4a06 --- /dev/null +++ b/FormalConjectures/ErdosProblems/735.lean @@ -0,0 +1,114 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 735 + +*Reference:* [erdosproblems.com/735](https://www.erdosproblems.com/735) + +Given any $n$ points in $\mathbb{R}^2$, when can one assign positive weights to the points +such that the sum of the weights along every line containing at least two points +is the same? + +A problem of Murty, who conjectured this is only possible in one of four cases: +1. All points on a line +2. No three points on a line (general position) +3. $n - 1$ points on a line (with one point off) +4. The 7-point incenter configuration: a triangle, the feet of the three angle + bisectors, and the incenter (or a projective equivalence) + +Proved by Ackerman, Buchin, Knauer, Pinchasi, and Rote [ABKPR08]. + +*Acknowledgement:* Noga Alon. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica 1 (1981), 25–42. + +[ABKPR08] Ackerman, E., Buchin, K., Knauer, C., Pinchasi, R., and Rote, G., +_There are not too many magic configurations_, Discrete & Computational Geometry 39 (2008), 3--16. +-/ + +open Finset BigOperators Classical EuclideanGeometry + +open scoped EuclideanGeometry + +namespace Erdos735 + +/-- A finite set of points in $\mathbb{R}^2$ admits a balanced weighting if there exist positive +real weights such that the total weight on every line through $\geq 2$ points is the same. -/ +noncomputable def AdmitsBalancedWeighting (S : Finset ℝ²) : Prop := + ∃ (w : ℝ² → ℝ), + (∀ p ∈ S, w p > 0) ∧ + ∀ p₁ ∈ S, ∀ q₁ ∈ S, ∀ p₂ ∈ S, ∀ q₂ ∈ S, + p₁ ≠ q₁ → p₂ ≠ q₂ → + ∑ x ∈ S.filter (fun x => Collinear ℝ ({p₁, q₁, x} : Set ℝ²)), w x = + ∑ x ∈ S.filter (fun x => Collinear ℝ ({p₂, q₂, x} : Set ℝ²)), w x + +/-- All points of $S$ are collinear (lie on a single line). -/ +def AllCollinear (S : Finset ℝ²) : Prop := + Collinear ℝ (↑S : Set ℝ²) + +/-- All but one point of $S$ are collinear, and the full set is not collinear. -/ +def AllButOneCollinear (S : Finset ℝ²) : Prop := + ∃ p ∈ S, Collinear ℝ (↑(S.erase p) : Set ℝ²) ∧ ¬Collinear ℝ (↑S : Set ℝ²) + +/-- The 7-point incenter configuration of a non-degenerate triangle $ABC$: the three vertices, +the incenter, and the three feet of the angle bisectors. Two 7-point sets have the same +incidence structure if there is a bijection between them that preserves collinearity of triples. + +`HasIncenterIncidenceStructure S` holds when $S$ has the same collinearity incidence pattern +as some incenter configuration — equivalently, $S$ is a projective image of an incenter +configuration where all 7 points remain finite. -/ +noncomputable def HasIncenterIncidenceStructure (S : Finset ℝ²) : Prop := + ∃ (A B C : ℝ²), + ¬Collinear ℝ ({A, B, C} : Set ℝ²) ∧ ( + let a := dist B C + let b := dist C A + let c := dist A B + let bisA := (b / (b + c)) • B + (c / (b + c)) • C + let bisB := (a / (a + c)) • A + (c / (a + c)) • C + let bisC := (a / (a + b)) • A + (b / (a + b)) • B + let inc := (a / (a + b + c)) • A + (b / (a + b + c)) • B + (c / (a + b + c)) • C + let T : Finset ℝ² := {A, B, C, bisA, bisB, bisC, inc} + ∃ f : ℝ² → ℝ², + Function.Bijective f ∧ + (S.image f = T ∨ S = T) ∧ + ∀ p ∈ S, ∀ q ∈ S, ∀ r ∈ S, + Collinear ℝ ({p, q, r} : Set ℝ²) ↔ + Collinear ℝ ({f p, f q, f r} : Set ℝ²)) + +/-- +Erdős Problem 735 (Murty's conjecture, proved by Ackerman–Buchin–Knauer–Pinchasi–Rote [ABKPR08]): + +A finite set $S$ of at least 2 points in $\mathbb{R}^2$ admits a balanced weighting if and only if +$S$ is one of: +1. All points collinear, +2. No three points collinear (general position), +3. All but one point collinear, or +4. A 7-point configuration with the same incidence structure as the incenter configuration + (i.e., the incenter configuration or a projective equivalence). +-/ +@[category research solved, AMS 5 52] +theorem erdos_735 (S : Finset ℝ²) (hS : 2 ≤ S.card) : + AdmitsBalancedWeighting S ↔ + AllCollinear S ∨ NonTrilinear (↑S : Set ℝ²) ∨ AllButOneCollinear S ∨ + HasIncenterIncidenceStructure S := by + sorry + +end Erdos735 diff --git a/FormalConjectures/ErdosProblems/736.lean b/FormalConjectures/ErdosProblems/736.lean new file mode 100644 index 0000000000..7bab19455d --- /dev/null +++ b/FormalConjectures/ErdosProblems/736.lean @@ -0,0 +1,68 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 736 + +*Reference:* [erdosproblems.com/736](https://www.erdosproblems.com/736) + +A conjecture of Walter Taylor. Let $G$ be a graph with chromatic number $\aleph_1$. +Is there, for every cardinal number $m$, some graph $G_m$ of chromatic number $m$ +such that every finite subgraph of $G_m$ is a subgraph of $G$? + +Komjáth and Shelah [KoSh05] proved that it is consistent that the answer is no, +so the conjecture is not provable in ZFC. + +[KoSh05] Komjáth, P. and Shelah, S., _Finite subgraphs of uncountably chromatic +graphs_. J. Graph Theory 49 (2005), 28-38. +-/ + +open SimpleGraph Cardinal + +universe u + +namespace Erdos736 + +/-- $G$ contains a copy of $H$: there is an injective map preserving adjacency. -/ +def ContainsCopy {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : W → V, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v) + +/-- +Erdős Problem 736 [Er81] [Er93, p. 343]: + +If $G$ is a graph with chromatic number $\aleph_1$, then for every cardinal $m$, +there exists a graph $G_m$ with chromatic number $m$ such that every finite +subgraph of $G_m$ is also a subgraph of $G$. + +A conjecture of Walter Taylor. Komjáth and Shelah [KoSh05] proved that +this is consistently false (not provable in ZFC). +-/ +@[category research open, AMS 3 5] +theorem erdos_736 : answer(sorry) ↔ + ∀ (V : Type u) (G : SimpleGraph V), + G.chromaticCardinal = aleph 1 → + ∀ (m : Cardinal.{u}), + ∃ (W : Type u) (Gm : SimpleGraph W), + Gm.chromaticCardinal = m ∧ + ∀ (U : Type u) [Fintype U] (H : SimpleGraph U), + ContainsCopy Gm H → ContainsCopy G H := by + sorry + +end Erdos736 diff --git a/FormalConjectures/ErdosProblems/737.lean b/FormalConjectures/ErdosProblems/737.lean new file mode 100644 index 0000000000..bc17d177fc --- /dev/null +++ b/FormalConjectures/ErdosProblems/737.lean @@ -0,0 +1,90 @@ +/- +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 737 + +*Reference:* [erdosproblems.com/737](https://www.erdosproblems.com/737) + +Let $G$ be a graph with chromatic number $\aleph_1$. Must there exist an +edge $e$ such that, for all large $n$, $G$ contains a cycle of length $n$ +containing $e$? + +A problem of Erdős, Hajnal, and Shelah [EHS74], who proved that $G$ must +contain all sufficiently large cycles (see [594]). + +This is true, and was proved by Thomassen [Th83]. + +## References + +[EHS74] Erdős, P., Hajnal, A., and Shelah, S., *On some general properties of chromatic numbers*. +Topics in topology (Proc. Colloq., Keszthely, 1972), Colloq. Math. Soc. Janos Bolyai (1974), +243-255. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, +Combinatorica **1** (1981), 25–42. + +[Th83] Thomassen, C., _Cycles in graphs of uncountable chromatic number_, +Combinatorica **3** (1983), 133–134. +-/ + +open SimpleGraph + +namespace Erdos737 + +/-- A graph has uncountable chromatic number: it cannot be properly colored + with countably many colors. -/ +def HasUncountableChromaticNumber {V : Type*} (G : SimpleGraph V) : Prop := + ∀ (α : Type*) [Countable α], IsEmpty (G.Coloring α) + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex + $i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- $G$ contains a copy of the cycle graph $C_m$ passing through edge $\{u, v\}$: + there is an injective embedding of $C_m$ into $G$ that maps some edge of + the cycle to the edge $\{u, v\}$. -/ +def ContainsCycleThroughEdge {V : Type*} + (G : SimpleGraph V) (u v : V) (m : ℕ) (hm : m ≥ 3) : Prop := + ∃ f : Fin m → V, Function.Injective f ∧ + (∀ a b : Fin m, (cycleGraph m hm).Adj a b → G.Adj (f a) (f b)) ∧ + ∃ a b : Fin m, (cycleGraph m hm).Adj a b ∧ + ((f a = u ∧ f b = v) ∨ (f a = v ∧ f b = u)) + +/-- +Erdős Problem 737 [EHS74] [Er81]: + +If $G$ is a graph with chromatic number $\geq \aleph_1$ (uncountable), then there +exists an edge $\{u, v\}$ of $G$ such that for all sufficiently large $n$, +$G$ contains a cycle of length $n$ passing through $\{u, v\}$. + +Proved by Thomassen [Th83]. +-/ +@[category research solved, AMS 5] +theorem erdos_737 : answer(True) ↔ + ∀ {V : Type*} (G : SimpleGraph V), + HasUncountableChromaticNumber G → + ∃ u v : V, G.Adj u v ∧ + ∃ N₀ : ℕ, ∀ (n : ℕ) (hn : n ≥ 3), n ≥ N₀ → + ContainsCycleThroughEdge G u v n hn := by + sorry + +end Erdos737 diff --git a/FormalConjectures/ErdosProblems/738.lean b/FormalConjectures/ErdosProblems/738.lean new file mode 100644 index 0000000000..3559aaeb44 --- /dev/null +++ b/FormalConjectures/ErdosProblems/738.lean @@ -0,0 +1,47 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 738 + +*Reference:* [erdosproblems.com/738](https://www.erdosproblems.com/738) + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica 1 (1981), 25-42. +-/ + +open SimpleGraph + +namespace Erdos738 + +/-- +Erdős Problem 738 (Gyárfás conjecture) [Er81]: + +If $G$ is a graph with infinite chromatic number and $G$ is triangle-free +(contains no $K_3$), must $G$ contain every finite tree as an induced subgraph? +-/ +@[category research open, AMS 5] +theorem erdos_738 : answer(sorry) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + χ(G) = ⊤ → G.CliqueFree 3 → + ∀ (m : ℕ) (T : SimpleGraph (Fin m)), T.IsTree → + Nonempty (T ↪g G) := by + sorry + +end Erdos738 diff --git a/FormalConjectures/ErdosProblems/739.lean b/FormalConjectures/ErdosProblems/739.lean new file mode 100644 index 0000000000..28fcd2924c --- /dev/null +++ b/FormalConjectures/ErdosProblems/739.lean @@ -0,0 +1,75 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 739 + +*Reference:* [erdosproblems.com/739](https://www.erdosproblems.com/739) + +If a graph has infinite chromatic number $\mathfrak{m}$, must every infinite cardinal +$\mathfrak{n} < \mathfrak{m}$ be realized as the chromatic number of some subgraph? + +A question of Galvin [Ga73], who proved the case $\mathfrak{m} = \aleph_0$ +(i.e., every graph with chromatic number $\aleph_0$ has subgraphs of every finite +chromatic number; note that under the formalization's restriction to infinite +$\mathfrak{n}$, the case $\mathfrak{m} = \aleph_0$ is vacuously true). +Komjáth [Ko88b] proved it is consistent that the answer is no +(with $\mathfrak{m} = \aleph_2$ and $\mathfrak{n} = \aleph_1$, +under $2^{\aleph_0} = 2^{\aleph_1} = 2^{\aleph_2} = \aleph_3$). +Shelah [Sh90] proved that assuming $V = L$, the answer is yes +with $\mathfrak{m} = \aleph_2$ and $\mathfrak{n} = \aleph_1$. +Whether the answer is affirmative under GCH remains open. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica **1** (1981), 25–42. + +[Ga73] Galvin, F., _Chromatic numbers of subgraphs_. Period. Math. Hungar. (1973), 117–119. + +[Ko88b] Komjáth, P., _Consistency results on infinite graphs_. Israel J. Math. (1988), 285–294. + +[Sh90] Shelah, S., _Incompactness for chromatic numbers of graphs_. (1990), 361–371. +-/ + +open SimpleGraph Cardinal + +universe u + +namespace Erdos739 + +/-- +Erdős Problem 739 [Er81]: + +If $G$ is a graph with infinite chromatic number $\mathfrak{m}$, then for every infinite +cardinal $\mathfrak{n} < \mathfrak{m}$, there is a subgraph of $G$ with chromatic +number $\mathfrak{n}$. + +A question of Galvin [Ga73]. This is not provable +in ZFC: Komjáth [Ko88b] showed it is consistent that the answer is no. +-/ +@[category research open, AMS 3 5] +theorem erdos_739 : answer(sorry) ↔ + ∀ {V : Type u} (G : SimpleGraph V) + (𝔪 : Cardinal.{u}), ℵ₀ ≤ 𝔪 → G.chromaticCardinal = 𝔪 → + ∀ (𝔫 : Cardinal.{u}), ℵ₀ ≤ 𝔫 → 𝔫 < 𝔪 → + ∃ (W : Type u) (H : SimpleGraph W), + H.chromaticCardinal = 𝔫 ∧ + ∃ f : W → V, Function.Injective f ∧ ∀ a b, H.Adj a b → G.Adj (f a) (f b) := by + sorry + +end Erdos739 diff --git a/FormalConjectures/ErdosProblems/740.lean b/FormalConjectures/ErdosProblems/740.lean new file mode 100644 index 0000000000..e629c7d935 --- /dev/null +++ b/FormalConjectures/ErdosProblems/740.lean @@ -0,0 +1,66 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 740 + +*Reference:* [erdosproblems.com/740](https://www.erdosproblems.com/740) + +A question of Erdős and Hajnal [Er69b][Er71, p.100][Er81][Er95d]. + +Let $\mathfrak{m}$ be an infinite cardinal and $G$ be a graph with chromatic number +$\mathfrak{m}$. Let $r \geq 1$. Must $G$ contain a subgraph of chromatic number +$\mathfrak{m}$ which does not contain any odd cycle of length $\leq r$? + +Rödl proved this is true if $\mathfrak{m} = \aleph_0$ and $r = 3$ (see [108] for +the finitary version). + +More generally, Erdős and Hajnal asked whether for every cardinal $\mathfrak{m}$ and +integer $r$, there exists $f_r(\mathfrak{m})$ such that every graph with chromatic +number $\geq f_r(\mathfrak{m})$ contains a subgraph with chromatic number +$\mathfrak{m}$ with no odd cycle of length $\leq r$. +-/ + +open SimpleGraph Cardinal + +universe u + +namespace Erdos740 + +/-- +Erdős Problem 740 [Er69b][Er71, p.100][Er81][Er95d]: + +If $G$ is a graph with infinite chromatic number $\mathfrak{m}$, then for every +$r \geq 1$, $G$ contains a subgraph with chromatic number $\mathfrak{m}$ that has +no odd cycle of length $\leq r$. + +A question of Erdős and Hajnal. Rödl proved the case +$\mathfrak{m} = \aleph_0$, $r = 3$. +-/ +@[category research open, AMS 5] +theorem erdos_740 : answer(sorry) ↔ + ∀ {V : Type u} (G : SimpleGraph V) (𝔪 : Cardinal.{u}), + ℵ₀ ≤ 𝔪 → chromaticCardinal G = 𝔪 → ∀ (r : ℕ), 1 ≤ r → + ∃ (W : Type u) (H : SimpleGraph W), + chromaticCardinal H = 𝔪 ∧ + (∃ f : W → V, Function.Injective f ∧ ∀ a b, H.Adj a b → G.Adj (f a) (f b)) ∧ + (∀ (w : W) (p : H.Walk w w), p.IsCycle → Odd p.length → r < p.length) := by + sorry + +end Erdos740 diff --git a/FormalConjectures/ErdosProblems/742.lean b/FormalConjectures/ErdosProblems/742.lean new file mode 100644 index 0000000000..989d9c077b --- /dev/null +++ b/FormalConjectures/ErdosProblems/742.lean @@ -0,0 +1,52 @@ +/- +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 742 + +*Reference:* [erdosproblems.com/742](https://www.erdosproblems.com/742) + +A conjecture of Murty and Plesnik (see [CaHa79]), also attributed to Ore. +The complete bipartite graph shows that this would be best possible. +This was proved for sufficiently large $n$ by Füredi [Fu92]; the conjecture +as originally posed is for all $n$. +-/ + +open Classical SimpleGraph + +namespace Erdos742 + +/-- +**Erdős Problem 742** [Er81]: + +Let $G$ be a graph on $n$ vertices with diameter $2$, such that deleting any edge +increases the diameter (either by disconnecting the graph or increasing it +beyond $2$). Then $G$ has at most $n^2/4$ edges. +-/ +@[category research solved, AMS 5] +theorem erdos_742 : answer(True) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + G.Connected → + G.diam = 2 → + (∀ v w : Fin n, G.Adj v w → + ¬(G.deleteEdges {Sym2.mk (v, w)}).Connected ∨ + 2 < (G.deleteEdges {Sym2.mk (v, w)}).diam) → + G.edgeFinset.card ≤ n ^ 2 / 4 := by + sorry + +end Erdos742 diff --git a/FormalConjectures/ErdosProblems/743.lean b/FormalConjectures/ErdosProblems/743.lean new file mode 100644 index 0000000000..40e55cb02c --- /dev/null +++ b/FormalConjectures/ErdosProblems/743.lean @@ -0,0 +1,75 @@ +/- +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 743 + +*Reference:* [erdosproblems.com/743](https://www.erdosproblems.com/743) + +Let $T_2, \ldots, T_n$ be a collection of trees such that $T_k$ has $k$ vertices. +Can we always write $K_n$ as the edge disjoint union of the $T_k$? + +A conjecture of Gyárfás, known as the tree packing conjecture. + +Gyárfás and Lehel proved that this holds if all but at most 2 of the trees are +stars, or if all the trees are stars or paths. Fishburn proved this for $n \leq 9$. +Bollobás proved that the smallest $\lfloor n/\sqrt{2} \rfloor$ many trees can always be packed +greedily into $K_n$. + +Joos, Kim, Kühn, and Osthus proved this conjecture holds when the trees +have bounded maximum degree. Allen, Böttcher, Clemens, Hladký, Piguet, and Taraz +proved it holds when all trees have maximum degree at most $c \cdot n / \log n$ for +some constant $c > 0$. Janzer and Montgomery proved that there exists +some $c > 0$ such that the largest $cn$ trees can be packed into $K_n$. + +[Er81] Erdős, P. +[ABCHPT21] Allen, P., Böttcher, J., Clemens, D., Hladký, J., Piguet, D., Taraz, A., + _The tree packing conjecture for trees of almost linear maximum degree_. arXiv:2106.11720 (2021). +-/ + +open SimpleGraph + +namespace Erdos743 + +/-- +**Erdős Problem 743** [Er81]: + +Let $T_2, \ldots, T_n$ be any collection of trees such that $T_k$ has $k$ vertices. +Then the complete graph $K_n$ can be decomposed into edge-disjoint copies +of these trees. Also known as the tree packing conjecture (Gyárfás). +-/ +@[category research open, AMS 5] +theorem erdos_743 : answer(sorry) ↔ + ∀ (n : ℕ), 2 ≤ n → + ∀ (T : (k : Fin (n - 1)) → SimpleGraph (Fin (k.val + 2))), + (∀ k, (T k).IsTree) → + ∃ (f : (k : Fin (n - 1)) → Fin (k.val + 2) → Fin n), + -- Each embedding is injective + (∀ k, Function.Injective (f k)) ∧ + -- The edge images are pairwise disjoint across different trees + (∀ k₁ k₂, k₁ ≠ k₂ → + ∀ a₁ b₁, (T k₁).Adj a₁ b₁ → + ∀ a₂ b₂, (T k₂).Adj a₂ b₂ → + Sym2.mk (f k₁ a₁, f k₁ b₁) ≠ Sym2.mk (f k₂ a₂, f k₂ b₂)) ∧ + -- Every edge of Kₙ is covered + (∀ v w : Fin n, v ≠ w → + ∃ k a b, (T k).Adj a b ∧ + Sym2.mk (v, w) = Sym2.mk (f k a, f k b)) := by + sorry + +end Erdos743 diff --git a/FormalConjectures/ErdosProblems/744.lean b/FormalConjectures/ErdosProblems/744.lean new file mode 100644 index 0000000000..41c6366f27 --- /dev/null +++ b/FormalConjectures/ErdosProblems/744.lean @@ -0,0 +1,81 @@ +/- +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 744 + +*Reference:* [erdosproblems.com/744](https://www.erdosproblems.com/744) + +For a $k$-critical graph $G$ on $n$ vertices, let $f_k(n)$ denote the minimum number of edges +that must be deleted from $G$ to make it bipartite. Erdős asked whether $f_k(n) \to \infty$ as +$n \to \infty$ for $k \ge 4$. Rödl and Tuza disproved this by showing that $f_k(n) = \binom{k-1}{2}$ +for all sufficiently large $n$. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica 1 (1981), 25–42. + +[EHS82] Erdős, P. and Hajnal, A. and Szemerédi, E., + _On almost bipartite large chromatic graphs_, Theory and practice of combinatorics (1982), 117–123. + +[Ga68] Gallai, T., _On covering of graphs_, Theory of Graphs, Proc. Coll. Tihany, Hungary (1968), + 231–236. + +[RoTu85] Rödl, V. and Tuza, Zs., _On color critical graphs_, J. Combin. Theory Ser. B (1985), + 204–213. +-/ + +open SimpleGraph Filter + +namespace Erdos744 + +/-- A graph $G$ is $k$-critical if it has chromatic number exactly $k$ (i.e., is +$k$-colorable but not $(k-1)$-colorable) and every proper subgraph (strictly +fewer edges) is $(k-1)$-colorable. -/ +def IsKCritical {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + G.Colorable k ∧ ¬G.Colorable (k - 1) ∧ + ∀ H : SimpleGraph V, H < G → H.Colorable (k - 1) + +/-- The minimum number of edges to delete from $G$ to make it bipartite +($2$-colorable). Defined as the infimum over cardinalities of edge sets +whose removal yields a $2$-colorable graph. -/ +noncomputable def minEdgesToBipartite {V : Type*} [DecidableEq V] + (G : SimpleGraph V) : ℕ := + sInf {m : ℕ | ∃ S : Finset (Sym2 V), S.card = m ∧ + (G.deleteEdges (↑S : Set (Sym2 V))).Colorable 2} + +/-- $f_k(n)$: the minimum, over all $k$-critical graphs $G$ on $n$ vertices, of the +minimum number of edges to delete from $G$ to make it bipartite. -/ +noncomputable def fk (k n : ℕ) : ℕ := + sInf {m : ℕ | ∃ G : SimpleGraph (Fin n), + IsKCritical G k ∧ minEdgesToBipartite G = m} + +/-- +Erdős Problem 744 (Disproved) [Er81, EHS82]: + +The original conjecture asked: is it true that $f_k(n) \to \infty$ as $n \to \infty$ for $k \ge 4$? +In particular, is it true that $f_4(n) \gg \log n$? + +Rödl and Tuza [RoTu85] disproved this by showing that $f_k(n) = \binom{k-1}{2}$ +for all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_744 : answer(False) ↔ + ∀ k : ℕ, k ≥ 4 → Tendsto (fk k) atTop atTop := by + sorry + +end Erdos744 diff --git a/FormalConjectures/ErdosProblems/745.lean b/FormalConjectures/ErdosProblems/745.lean new file mode 100644 index 0000000000..dd8fd69b6f --- /dev/null +++ b/FormalConjectures/ErdosProblems/745.lean @@ -0,0 +1,112 @@ +/- +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 745 + +*Reference:* [erdosproblems.com/745](https://www.erdosproblems.com/745) + +Describe the size of the second largest component of the random graph on $n$ +vertices, where each edge is included independently with probability $1/n$. + +Erdős believed that almost surely the second largest component has size +$\ll \log n$. This is true, as proved by Komlós, Sulyok, and Szemerédi. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to +see solved_. Combinatorica 1 (1981), 25-42. + +[KSS80] Komlós, J., Sulyok, M., and Szemerédi, E., _Linear problems in +combinatorial number theory_. Acta Math. Acad. Sci. Hungar. 36 (1980), 341-365. +-/ + +open SimpleGraph Finset + +attribute [local instance] Classical.propDecidable + +namespace Erdos745 + +/-- An edge configuration on `Fin n`: a Boolean assignment to each +unordered pair $\{i, j\}$ with $i < j$. -/ +abbrev EdgeConfig745 (n : ℕ) := {p : Fin n × Fin n // p.1 < p.2} → Bool + +/-- The simple graph on `Fin n` determined by an edge configuration. -/ +def toGraph745 {n : ℕ} (ec : EdgeConfig745 n) : SimpleGraph (Fin n) where + Adj u v := ∃ h : min u v < max u v, ec ⟨(min u v, max u v), h⟩ = true + symm := by + intro u v ⟨h, he⟩ + refine ⟨by rwa [min_comm, max_comm] at h, ?_⟩ + have : (⟨(min u v, max u v), h⟩ : {p : Fin n × Fin n // p.1 < p.2}) = + ⟨(min v u, max v u), by rwa [min_comm, max_comm] at h⟩ := by + ext <;> simp [min_comm, max_comm] + rwa [← this] + loopless := fun v ⟨h, _⟩ => by simp at h + +/-- The number of edges in an edge configuration on `Fin n`. -/ +def edgeCount745 {n : ℕ} (ec : EdgeConfig745 n) : ℕ := + (Finset.univ.filter (fun p : {p : Fin n × Fin n // p.1 < p.2} => ec p = true)).card + +/-- The probability weight of a specific edge configuration under the +Erdős–Rényi model $G(n, 1/n)$: each edge is included independently +with probability $1/n$. -/ +noncomputable def gnpWeight745 (n : ℕ) (ec : EdgeConfig745 n) : ℝ := + (1 / (n : ℝ)) ^ edgeCount745 ec * + (1 - 1 / (n : ℝ)) ^ (n.choose 2 - edgeCount745 ec) + +/-- The $G(n, 1/n)$-probability of a graph property $P$: the sum of weights +over all edge configurations whose graph satisfies $P$. -/ +noncomputable def gnpProb745 (n : ℕ) (P : SimpleGraph (Fin n) → Prop) : ℝ := + (Finset.univ.filter (fun ec : EdgeConfig745 n => + P (toGraph745 ec))).sum (gnpWeight745 n) + +/-- The size of the connected component containing vertex $v$ in graph $G$. -/ +noncomputable def componentSize745 {n : ℕ} (G : SimpleGraph (Fin n)) + (v : Fin n) : ℕ := + (Finset.univ.filter (fun w : Fin n => G.Reachable v w)).card + +/-- The size of the second largest connected component of $G$ on `Fin n`. +Defined as the smallest $k$ such that at most one connected component +has more than $k$ vertices; equivalently, any two vertices whose +components both exceed size $k$ must be in the same component. -/ +noncomputable def secondLargestComponent745 {n : ℕ} + (G : SimpleGraph (Fin n)) : ℕ := + sInf {k : ℕ | ∀ u v : Fin n, + componentSize745 G u > k → componentSize745 G v > k → G.Reachable u v} + +/-- +Erdős Problem 745 [Er81]: + +In the Erdős–Rényi random graph $G(n, 1/n)$, the second largest connected +component almost surely has size $O(\log n)$. + +Formally: there exists a constant $C > 0$ such that for every $\varepsilon > 0$ +there exists $n_0$ such that for all $n \geq n_0$, the $G(n, 1/n)$-probability +that the second largest component has size at most $C \cdot \log n$ is at least +$1 - \varepsilon$. + +Proved by Komlós, Sulyok, and Szemerédi [KSS80]. +-/ +@[category research solved, AMS 5 60] +theorem erdos_745 : + ∃ C : ℝ, C > 0 ∧ + ∀ ε : ℝ, ε > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + gnpProb745 n (fun G => + (secondLargestComponent745 G : ℝ) ≤ C * Real.log (n : ℝ)) ≥ 1 - ε := by + sorry + +end Erdos745 diff --git a/FormalConjectures/ErdosProblems/746.lean b/FormalConjectures/ErdosProblems/746.lean new file mode 100644 index 0000000000..22acd59336 --- /dev/null +++ b/FormalConjectures/ErdosProblems/746.lean @@ -0,0 +1,93 @@ +/- +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 746 + +*Reference:* [erdosproblems.com/746](https://www.erdosproblems.com/746) + +A conjecture of Erdős and Rényi [ErRe66]. Pósa [Po76] showed this with $Cn \log n$ edges +for some large $C$, Korshunov [Ko77] improved the threshold, and Komlós and Szemerédi [KoSz83] +proved the sharp result that with $(1/2)n \log n + (1/2)n \log \log n + cn$ edges the probability +of being Hamiltonian tends to $e^{-e^{-2c}}$. + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica **1** (1981), 25–42. +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_. +L'Enseignement Math. **27** (1982), 163–176. +[ErRe66] Erdős, P. and Rényi, A., _On the existence of a factor of degree one of a connected +random graph_. Acta Math. Acad. Sci. Hungar. (1966), 359–368. +[Po76] Pósa, L., _Hamiltonian circuits in random graphs_. Discrete Math. (1976), 359–364. +[Ko77] Korshunov, A. D., _Solution of a problem of P. Erdős and A. Rényi on Hamiltonian cycles +in nonoriented graphs_. Diskret. Analiz (1977), 17–56, 90. +[KoSz83] Komlós, J. and Szemerédi, E., _Limit distribution for the existence of Hamiltonian +cycles in a random graph_. Discrete Math. (1983), 55–63. +-/ + +open SimpleGraph Finset + +namespace Erdos746 + +/-- The simple graph on $\operatorname{Fin} n$ determined by a Boolean edge configuration. -/ +def toGraph {n : ℕ} (ec : Fin n → Fin n → Bool) : SimpleGraph (Fin n) where + Adj u v := u ≠ v ∧ ec (min u v) (max u v) = true + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, by rwa [min_comm, max_comm]⟩ + loopless := fun v ⟨h, _⟩ => h rfl + +/-- The number of edges in a Boolean edge configuration on $\operatorname{Fin} n$ +(counting only pairs $i < j$ to avoid double-counting). -/ +def edgeCount {n : ℕ} (ec : Fin n → Fin n → Bool) : ℕ := + (Finset.univ.filter (fun p : Fin n × Fin n => p.1 < p.2 ∧ ec p.1 p.2 = true)).card + +/-- The set of all edge configurations on $\operatorname{Fin} n$ with exactly $m$ edges. -/ +def graphsWithEdges (n m : ℕ) : Finset (Fin n → Fin n → Bool) := + Finset.univ.filter (fun ec => edgeCount ec = m) + +open Classical in +/-- The fraction of graphs on $\operatorname{Fin} n$ with exactly $m$ edges that satisfy +property $P$ (the $G(n,m)$ probability of $P$). Returns $0$ if there are +no graphs with exactly $m$ edges. -/ +noncomputable def gnmFraction (n m : ℕ) (P : SimpleGraph (Fin n) → Prop) : ℝ := + ((graphsWithEdges n m).filter (fun ec => P (toGraph ec))).card / + ((graphsWithEdges n m).card : ℝ) + +/-- +Erdős Problem 746 [Er71, p.98], [Er81, p.16], [Er82e, p.69]: + +For every $\varepsilon > 0$, almost surely a random graph on $n$ vertices with at least +$(1/2 + \varepsilon) \cdot n \cdot \log n$ edges is Hamiltonian. + +Formally: for every $\varepsilon > 0$ and $\delta > 0$, there exists $n_0$ such that for all +$n \geq n_0$ and all $m$ with $(1/2 + \varepsilon) \cdot n \cdot \log n \leq m \leq \binom{n}{2}$, +the $G(n,m)$-probability that the graph is Hamiltonian is at least $1 - \delta$. + +Proved by Komlós and Szemerédi [KoSz83]. +-/ +@[category research solved, AMS 5 60] +theorem erdos_746 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ m : ℕ, (m : ℝ) ≥ (1/2 + ε) * (n : ℝ) * Real.log (n : ℝ) → + m ≤ n.choose 2 → + gnmFraction n m (fun G => G.IsHamiltonian) ≥ 1 - δ := by + sorry + +end Erdos746 diff --git a/FormalConjectures/ErdosProblems/747.lean b/FormalConjectures/ErdosProblems/747.lean new file mode 100644 index 0000000000..31d31ed2e0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/747.lean @@ -0,0 +1,85 @@ +/- +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 747 + +*Reference:* [erdosproblems.com/747](https://www.erdosproblems.com/747) + +Shamir's problem (1979): How large should $\ell(n)$ be such that, almost surely, a random +$3$-uniform hypergraph on $3n$ vertices with $\ell(n)$ edges must contain $n$ vertex-disjoint +edges? + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_, + Combinatorica **1** (1981), 25–42. + +[JKV08] Johansson, A., Kahn, J., and Vu, V., _Factors in random graphs_, Random Structures +& Algorithms 33 (2008), 1-28. + +[Ka23] Kahn, J., _Asymptotics for Shamir's problem_, Annals of Mathematics 198 (2023), 1-69. +-/ + +open scoped Classical +open Finset + +namespace Erdos747 + +/-- The set of all $3$-element subsets of $\operatorname{Fin} N$ (potential hyperedges). -/ +def threeEdges (N : ℕ) : Finset (Finset (Fin N)) := + Finset.univ.powersetCard 3 + +/-- The set of all $3$-uniform hypergraphs on $\operatorname{Fin} N$ with exactly $m$ edges. -/ +def hypergraphsWithEdges (N m : ℕ) : Finset (Finset (Finset (Fin N))) := + (threeEdges N).powersetCard m + +/-- A $3$-uniform hypergraph $H$ contains a matching of size $k$: there exist + $k$ pairwise vertex-disjoint edges in $H$. -/ +def HasMatching {N : ℕ} (H : Finset (Finset (Fin N))) (k : ℕ) : Prop := + ∃ M : Finset (Finset (Fin N)), M ⊆ H ∧ M.card = k ∧ + ∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ ≠ e₂ → Disjoint e₁ e₂ + +/-- The fraction of $3$-uniform hypergraphs on $\operatorname{Fin} N$ with $m$ edges that + contain a matching of size $k$. Returns $0$ if no such hypergraphs exist. -/ +noncomputable def hypergraphMatchingFraction (N m k : ℕ) : ℝ := + ((hypergraphsWithEdges N m).filter (fun H => HasMatching H k)).card / + ((hypergraphsWithEdges N m).card : ℝ) + +/-- +Erdős Problem 747 (Shamir's problem): + +For every $\varepsilon > 0$, almost surely a random $3$-uniform hypergraph on $3n$ vertices +with at least $(1 + \varepsilon) \cdot n \cdot \log n$ edges contains $n$ vertex-disjoint edges. + +Formally: for every $\varepsilon > 0$ and $\delta > 0$, there exists $n_0$ such that for all +$n \geq n_0$ and all $m$ with $(1 + \varepsilon) \cdot n \cdot \log n \leq m \leq \binom{3n}{3}$, +the fraction of $3$-uniform hypergraphs on $3n$ vertices with $m$ edges containing a perfect +matching is at least $1 - \delta$. + +Proved by Johansson, Kahn, and Vu [JKV08]; sharp threshold by Kahn [Ka23]. +-/ +@[category research solved, AMS 5] +theorem erdos_747 : + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ m : ℕ, (m : ℝ) ≥ (1 + ε) * (n : ℝ) * Real.log (n : ℝ) → + m ≤ (3 * n).choose 3 → + hypergraphMatchingFraction (3 * n) m n ≥ 1 - δ := by + sorry + +end Erdos747 diff --git a/FormalConjectures/ErdosProblems/748.lean b/FormalConjectures/ErdosProblems/748.lean new file mode 100644 index 0000000000..ccc34458ae --- /dev/null +++ b/FormalConjectures/ErdosProblems/748.lean @@ -0,0 +1,83 @@ +/- +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 748 + +*Reference:* [erdosproblems.com/748](https://www.erdosproblems.com/748) + +The Cameron-Erdős Conjecture. Let $f(n)$ count the number of sum-free subsets +$A \subseteq \{1, \ldots, n\}$, i.e., $A$ contains no three elements $a$, $b$, $c$ with +$a = b + c$. Is it true that $f(n) = 2^{(1+o(1)) n/2}$? + +The lower bound $f(n) \geq 2^{n/2}$ is trivial (consider all subsets of +$\{\lceil n/2 \rceil, \ldots, n\}$). + +This was proved independently by Green [Gr04] and Sapozhenko [Sa03], who showed +$f(n) \sim c_n \cdot 2^{n/2}$ where $c_n$ depends on the parity of $n$. + +See also Problem 877 (maximal sum-free subsets) and OEIS sequence A007865. + +[CaEr90] Cameron, P.J. and Erdős, P. + +[Er94b] Erdős, P. + +[Er98] Erdős, P. + +[Gr04] Green, B., _The Cameron-Erdős conjecture_, Bull. London Math. Soc. 36 (2004), 769-778. + +[Sa03] Sapozhenko, A.A., _The Cameron-Erdős conjecture_, Discrete Math. 235 (2003), 131-138. +-/ + +open Finset + +namespace Erdos748 + +/-- A finite set of natural numbers is *sum-free* if it contains no three + elements $a$, $b$, $c$ (not necessarily distinct) with $b + c = a$. Equivalently, + for all $b, c \in A$, we have $b + c \notin A$. -/ +def IsSumFree (A : Finset ℕ) : Prop := + ∀ b ∈ A, ∀ c ∈ A, b + c ∉ A + +instance : DecidablePred IsSumFree := + fun A => decidable_of_iff (∀ b ∈ A, ∀ c ∈ A, b + c ∉ A) Iff.rfl + +/-- The number of sum-free subsets of $\{1, \ldots, n\}$. -/ +noncomputable def sumFreeSubsetCount (n : ℕ) : ℕ := + ((Finset.Icc 1 n).powerset.filter (fun A => IsSumFree A)).card + +/-- +Erdős Problem 748 (Cameron-Erdős Conjecture) [CaEr90][Er94b][Er98]: + +Let $f(n)$ count the number of sum-free subsets of $\{1, \ldots, n\}$. Then +$$f(n) = 2^{(1+o(1)) n/2}.$$ + +Equivalently: for every $\varepsilon > 0$, for all sufficiently large $n$, +$$2^{(1 - \varepsilon) \cdot n/2} \leq f(n) \leq 2^{(1 + \varepsilon) \cdot n/2}.$$ + +Proved independently by Green [Gr04] and Sapozhenko [Sa03]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_748 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (2 : ℝ) ^ ((1 - ε) * (n : ℝ) / 2) ≤ (sumFreeSubsetCount n : ℝ) ∧ + (sumFreeSubsetCount n : ℝ) ≤ (2 : ℝ) ^ ((1 + ε) * (n : ℝ) / 2) := by + sorry + +end Erdos748 diff --git a/FormalConjectures/ErdosProblems/75.lean b/FormalConjectures/ErdosProblems/75.lean new file mode 100644 index 0000000000..fa0c42e3ca --- /dev/null +++ b/FormalConjectures/ErdosProblems/75.lean @@ -0,0 +1,86 @@ +/- +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 75 + +*Reference:* [erdosproblems.com/75](https://www.erdosproblems.com/75) + +Does there exist a graph on $\aleph_1$ vertices with chromatic number $\aleph_1$ such that +every set of $n$ vertices contains an independent set of size $> n^{1-\varepsilon}$ for all +$\varepsilon > 0$ and large $n$? + +[EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., _On almost bipartite large chromatic graphs_. +Annals of Discrete Mathematics **12** (1982), 117–123. + +[Er95] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and geometry_. +Resenhas (1995), 165–186. + +[Er95d] Erdős, P., _On some problems in combinatorial set theory_. +Publ. Inst. Math. (Beograd) (N.S.) (1995), 61–65. + +Erdős offered $1000 for a complete solution. See also Problems 74 and 750. +-/ + +open SimpleGraph Cardinal + +namespace Erdos75 + +/-- +Erdős Problem 75, Part 1 [EHS82, p. 120][Er95, p. 11][Er95d, p. 63]: + +There exists a graph $G$ on $\aleph_1$ vertices with chromatic number $\aleph_1$ such that for +all $\varepsilon > 0$, if $n$ is sufficiently large and $S$ is any set of $n$ vertices, then +$S$ contains an independent set of size $> n^{1-\varepsilon}$. +-/ +@[category research open, AMS 5] +theorem erdos_75 : + answer(sorry) ↔ + ∃ (V : Type) (_ : DecidableEq V) (G : SimpleGraph V), + #V = aleph 1 ∧ + G.chromaticCardinal = ℵ_ 1 ∧ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ S : Finset V, S.card = n → + ∃ T : Finset V, T ⊆ S ∧ + (↑T : Set V).Pairwise (fun u v => ¬G.Adj u v) ∧ + (T.card : ℝ) > (n : ℝ) ^ ((1 : ℝ) - ε) := by + sorry + +/-- +Erdős Problem 75, Part 2 (linear variant) [EHS82, p. 120][Er95, p. 11][Er95d, p. 63]: + +There exists a graph $G$ on $\aleph_1$ vertices with chromatic number $\aleph_1$ such that +there exists $c > 0$ where every set of $n \geq 1$ vertices contains an independent +set of size at least $c \cdot n$. +-/ +@[category research open, AMS 5] +theorem erdos_75.variants.linear : + answer(sorry) ↔ + ∃ (V : Type) (_ : DecidableEq V) (G : SimpleGraph V), + #V = aleph 1 ∧ + G.chromaticCardinal = ℵ_ 1 ∧ + ∃ c : ℝ, c > 0 ∧ + ∀ n : ℕ, n ≥ 1 → + ∀ S : Finset V, S.card = n → + ∃ T : Finset V, T ⊆ S ∧ + (↑T : Set V).Pairwise (fun u v => ¬G.Adj u v) ∧ + (T.card : ℝ) ≥ c * (n : ℝ) := by + sorry + +end Erdos75 diff --git a/FormalConjectures/ErdosProblems/750.lean b/FormalConjectures/ErdosProblems/750.lean new file mode 100644 index 0000000000..93c7fbba1d --- /dev/null +++ b/FormalConjectures/ErdosProblems/750.lean @@ -0,0 +1,108 @@ +/- +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 750 + +*Reference:* [erdosproblems.com/750](https://www.erdosproblems.com/750) + +Does there exist, for every function $f$ with $f(m) \to \infty$, a graph with infinite chromatic +number such that every finite set of $m$ vertices contains an independent set of size at least +$m/2 - f(m)$? + +See also [Problem #75](https://www.erdosproblems.com/75). + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph +Theory (1969), 27-35. + +[ErHa67b] Erdős, P. and Hajnal, A., _On chromatic graphs_. Mat. Lapok (1967), 1-4. + +[EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., _On almost bipartite large chromatic +graphs_. Theory and practice of combinatorics (1982), 117-123. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_ (1994). + +[Er95d] Erdős, P., _Problems and results in discrete mathematics_ (1995). +-/ + +open SimpleGraph + +namespace Erdos750 + +/-- +Erdős Problem 750 [Er94b][Er95d]: + +Does there exist, for every function $f : \mathbb{N} \to \mathbb{N}$ with $f(m) \to \infty$ +as $m \to \infty$, a graph $G$ with infinite chromatic number such that every finite set of +$m$ vertices in $G$ contains an independent set of size at least $m/2 - f(m)$? + +In [Er69b] Erdős conjectures this for $f(m) = \varepsilon m$ for any fixed $\varepsilon > 0$. +This follows from a result of Erdős, Hajnal, and Szemerédi [EHS82]. + +In [ErHa67b] Erdős and Hajnal prove this for $f(m) \geq cm$ for all $c > 1/4$. +-/ +@[category research open, AMS 5] +theorem erdos_750 : answer(sorry) ↔ + ∀ f : ℕ → ℕ, (∀ C : ℕ, ∃ M₀ : ℕ, ∀ m : ℕ, m ≥ M₀ → f m ≥ C) → + ∃ (V : Type) (G : SimpleGraph V), + (∀ k : ℕ, ¬G.Colorable k) ∧ + ∀ (S : Finset V), ∃ I : Finset V, + I ⊆ S ∧ G.IsIndepSet ↑I ∧ + (S.card : ℝ) / 2 - (f S.card : ℝ) ≤ (I.card : ℝ) := by + sorry + +/-- +Erdős Problem 750 — εm variant [EHS82]: + +For every $\varepsilon > 0$, there exists a graph $G$ with infinite chromatic number such that +every finite set of $m$ vertices in $G$ contains an independent set of size at least +$(1/2 - \varepsilon) m$. + +This was conjectured by Erdős [Er69b] and follows from a result of Erdős, Hajnal, and +Szemerédi [EHS82]. +-/ +@[category research solved, AMS 5] +theorem erdos_750_eps : + ∀ ε : ℝ, ε > 0 → + ∃ (V : Type) (G : SimpleGraph V), + (∀ k : ℕ, ¬G.Colorable k) ∧ + ∀ (S : Finset V), ∃ I : Finset V, + I ⊆ S ∧ G.IsIndepSet ↑I ∧ + (1 / 2 - ε) * (S.card : ℝ) ≤ (I.card : ℝ) := by + sorry + +/-- +Erdős Problem 750 — c > 1/4 variant [ErHa67b]: + +For every $c > 1/4$, there exists a graph $G$ with infinite chromatic number such that +every finite set of $m$ vertices in $G$ contains an independent set of size at least +$(1/2 - c) m$. + +Proved by Erdős and Hajnal [ErHa67b]. +-/ +@[category research solved, AMS 5] +theorem erdos_750_quarter : + ∀ c : ℝ, c > 1 / 4 → + ∃ (V : Type) (G : SimpleGraph V), + (∀ k : ℕ, ¬G.Colorable k) ∧ + ∀ (S : Finset V), ∃ I : Finset V, + I ⊆ S ∧ G.IsIndepSet ↑I ∧ + (1 / 2 - c) * (S.card : ℝ) ≤ (I.card : ℝ) := by + sorry + +end Erdos750 diff --git a/FormalConjectures/ErdosProblems/751.lean b/FormalConjectures/ErdosProblems/751.lean new file mode 100644 index 0000000000..3e6cf47973 --- /dev/null +++ b/FormalConjectures/ErdosProblems/751.lean @@ -0,0 +1,85 @@ +/- +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 751 + +*Reference:* [erdosproblems.com/751](https://www.erdosproblems.com/751) + +Let $G$ be a graph with chromatic number $\chi(G) = 4$. If $m_1 < m_2 < \cdots$ are the +lengths of the cycles in $G$, can $\min(m_{i+1} - m_i)$ be arbitrarily large? Can this +happen if the girth of $G$ is large? + +The answer is no: Bondy and Vince [BoVi98] proved that every graph with minimum degree +at least $3$ has two cycles whose lengths differ by at most $2$, and hence the same is +true for every graph with chromatic number $4$ (regardless of girth). + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_ (1994). + +[BoVi98] Bondy, J. A. and Vince, A., _Cycles in a graph whose lengths differ by one or +two_. Journal of Graph Theory **27** (1998), 11–15. +-/ + +open SimpleGraph + +namespace Erdos751 + +/-- The set of cycle lengths occurring in a simple graph. -/ +def cycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + +/-- **Erdős Problem 751**: If $G$ is a graph with $\chi(G) = 4$ and $m_1 < m_2 < \cdots$ +are the cycle lengths of $G$, the minimum gap $\min(m_{i+1} - m_i)$ cannot be made +arbitrarily large. Bondy and Vince [BoVi98] proved that every graph with minimum degree +at least $3$ has two cycles whose lengths differ by at most $2$, which implies the +negative answer since $\chi(G) = 4$ forces a subgraph with minimum degree $\geq 3$. + +[BoVi98] -/ +@[category research solved, AMS 5] +theorem erdos_751 : answer(False) ↔ + (∀ C : ℕ, ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), + G.chromaticNumber = 4 ∧ + ∀ m₁ ∈ cycleLengths G, ∀ m₂ ∈ cycleLengths G, + m₁ < m₂ → C ≤ m₂ - m₁) := by + sorry + +/-- **Bondy–Vince Theorem** [BoVi98]: Every graph with minimum degree at least $3$ +contains two cycles whose lengths differ by at most $2$. This is the stronger result +that resolves Erdős Problem 751. -/ +@[category research solved, AMS 5] +theorem erdos_751.variants.bondy_vince {V : Type*} [Fintype V] [DecidableEq V] + [Nonempty V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (hmin : 3 ≤ G.minDegree) : + ∃ m₁ ∈ cycleLengths G, ∃ m₂ ∈ cycleLengths G, + m₁ < m₂ ∧ m₂ - m₁ ≤ 2 := by + sorry + +/-- **Erdős Problem 751 (girth variant)**: Even if we additionally require the girth of +$G$ to be large, the minimum gap between consecutive cycle lengths in a graph with +$\chi(G) = 4$ cannot be made arbitrarily large. This follows from the Bondy–Vince theorem, +which makes no assumption on girth. -/ +@[category research solved, AMS 5] +theorem erdos_751.variants.large_girth : answer(False) ↔ + (∀ C : ℕ, ∀ g : ℕ, ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), + G.chromaticNumber = 4 ∧ g < G.girth ∧ + ∀ m₁ ∈ cycleLengths G, ∀ m₂ ∈ cycleLengths G, + m₁ < m₂ → C ≤ m₂ - m₁) := by + sorry + +end Erdos751 diff --git a/FormalConjectures/ErdosProblems/752.lean b/FormalConjectures/ErdosProblems/752.lean new file mode 100644 index 0000000000..f15882b0b9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/752.lean @@ -0,0 +1,75 @@ +/- +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 752 + +*Reference:* [erdosproblems.com/752](https://www.erdosproblems.com/752) + +A question of Erdős, Faudree, and Schelp. Let $G$ be a graph with minimum degree $k$ and +girth $> 2s$. Must there be $\gg k^s$ many distinct cycle lengths in $G$? + +Erdős, Faudree, and Schelp proved it when $s = 2$. + +Sudakov and Verstraëte proved the full conjecture, and moreover showed that under the weaker +assumption of average degree $k$ and girth $> 2s$, there are $\gg k^s$ many consecutive even +integers that are cycle lengths in $G$. + +Additional thanks to Raphael Steiner. + +[Er92b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) (1992), 231–240. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), 97–132. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Discrete Math. 165/166 (1997), 227–231. + +[SuVe08] Sudakov, B. and Verstraëte, J., _Cycle lengths in sparse graphs_. Combinatorica 28 +(2008), 357–372. +-/ + +open SimpleGraph + +namespace Erdos752 + +/-- The set of cycle lengths occurring in a simple graph. -/ +def cycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + +/-- +**Erdős–Faudree–Schelp Conjecture (proved by Sudakov–Verstraëte) +(Erdős Problem 752)** [Er92b][Er93][Er94b][SuVe08]: + +There exists an absolute constant $c > 0$ such that for every finite graph $G$ +with minimum degree at least $k$ and girth greater than $2s$, the number of +distinct cycle lengths in $G$ is at least $c \cdot k^s$. +-/ +@[category research solved, AMS 5] +theorem erdos_752 : answer(True) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (k s : ℕ), + k ≤ G.minDegree → + 2 * s < G.girth → + c * (k : ℝ) ^ s ≤ ((cycleLengths G).ncard : ℝ) := by + sorry + +end Erdos752 diff --git a/FormalConjectures/ErdosProblems/753.lean b/FormalConjectures/ErdosProblems/753.lean new file mode 100644 index 0000000000..87f997b145 --- /dev/null +++ b/FormalConjectures/ErdosProblems/753.lean @@ -0,0 +1,86 @@ +/- +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 753 + +*Reference:* [erdosproblems.com/753](https://www.erdosproblems.com/753) + +Does there exist some constant $c > 0$ such that +$\chi_L(G) + \chi_L(G^c) > n^{1/2+c}$ for every graph $G$ on $n$ vertices? +Disproved by Alon [Al92], who showed that for every $n$, there exists a graph $G$ on +$n$ vertices with $\chi_L(G) + \chi_L(G^c) \leq C \sqrt{n \log n}$ for some absolute +constant $C > 0$. + +[ERT80] Erdős, P., Rubin, A. L., and Taylor, H., _Choosability in graphs_. Proceedings of the +West Coast Conference on Combinatorics, Graph Theory and Computing (1980), 125-157. + +[Al92] Alon, N., _Choice numbers of graphs: a probabilistic approach_. Combinatorics, Probability +and Computing 1 (1992), 107-114. +-/ + +open SimpleGraph + +namespace Erdos753 + +/-- A graph $G$ is $k$-choosable ($k$-list-colorable) if for every assignment of lists +of size at least $k$ to the vertices, there exists a proper coloring where each +vertex receives a color from its list. -/ +def IsChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ (L : V → Finset ℕ), (∀ v, k ≤ (L v).card) → + ∃ f : V → ℕ, (∀ v, f v ∈ L v) ∧ (∀ u v, G.Adj u v → f u ≠ f v) + +/-- The list chromatic number (choice number) of a graph: the minimum $k$ such +that $G$ is $k$-choosable. -/ +noncomputable def listChromaticNumber {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | IsChoosable G k} + +/-- +**Erdős Problem 753** [ERT80]: + +Does there exist some constant $c > 0$ such that +$\chi_L(G) + \chi_L(G^c) > n^{1/2+c}$ for every graph $G$ on $n$ vertices? +Disproved by Alon [Al92]. +-/ +@[category research solved, AMS 5] +theorem erdos_753 : + answer(False) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ n : ℕ, n ≥ 2 → + ∀ (G : SimpleGraph (Fin n)), + (listChromaticNumber G + listChromaticNumber Gᶜ : ℝ) > + (n : ℝ) ^ (1 / 2 + c) := by + sorry + +/-- +**Alon's upper bound** [Al92]: + +There exists an absolute constant $C > 0$ such that for every $n \geq 2$, there exists +a graph $G$ on $n$ vertices with +$\chi_L(G) + \chi_L(G^c) \leq C \cdot \sqrt{n \cdot \log n}$. +-/ +@[category research solved, AMS 5] +theorem erdos_753.variants.alon_upper_bound : + ∃ C : ℝ, C > 0 ∧ + ∀ n : ℕ, n ≥ 2 → + ∃ (G : SimpleGraph (Fin n)), + (listChromaticNumber G + listChromaticNumber Gᶜ : ℝ) ≤ + C * Real.sqrt (n * Real.log n) := by + sorry + +end Erdos753 diff --git a/FormalConjectures/ErdosProblems/754.lean b/FormalConjectures/ErdosProblems/754.lean new file mode 100644 index 0000000000..c6ee272bc4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/754.lean @@ -0,0 +1,66 @@ +/- +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 754 + +*Reference:* [erdosproblems.com/754](https://www.erdosproblems.com/754) + +Let $f(n)$ be maximal such that there exists a set $A$ of $n$ points in $\mathbb{R}^4$ +in which every $x \in A$ has at least $f(n)$ points in $A$ equidistant from $x$. + +Is it true that $f(n) \leq n/2 + O(1)$? + +Avis, Erdős, and Pach [AEP88] proved that $n/2 + 2 \leq f(n) \leq (1 + o(1))n/2$. +This was proved by Swanepoel [Sw13]. + +[Er94b] Erdős, P., _Some old and new problems on combinatorial geometry_. + +[AEP88] Avis, D., Erdős, P., and Pach, J., _Repeated distances in space_. +Graphs Combin. (1988), 207–217. + +[Sw13] Swanepoel, K.J., _Favorite distances in high dimensions_. (2013), 499–519. +-/ + +open Classical + +namespace Erdos754 + +/-- +**Erdős Problem 754** [Er94b]: + +Let $f(n)$ be the largest $k$ such that there exists a set $A$ of $n$ points in $\mathbb{R}^4$ +where every $x \in A$ has at least $k$ other points in $A$ all at the same distance +from $x$. Is it true that $f(n) \leq n/2 + O(1)$? + +Formulated as: there exists a constant $C$ such that for every finite set +$A \subseteq \mathbb{R}^4$ of $n$ points, if every point $x \in A$ has at least $k$ other +points at a common distance from $x$, then $k \leq n/2 + C$. +-/ +@[category research solved, AMS 52] +theorem erdos_754 : + answer(True) ↔ + ∃ C : ℝ, ∀ n : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin 4)), + A.card = n → + ∀ k : ℕ, + (∀ x ∈ A, ∃ d : ℝ, + k ≤ (A.filter (fun y => x ≠ y ∧ dist x y = d)).card) → + (k : ℝ) ≤ n / 2 + C := by + sorry + +end Erdos754 diff --git a/FormalConjectures/ErdosProblems/755.lean b/FormalConjectures/ErdosProblems/755.lean new file mode 100644 index 0000000000..583b2c59df --- /dev/null +++ b/FormalConjectures/ErdosProblems/755.lean @@ -0,0 +1,101 @@ +/- +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 755 + +*Reference:* [erdosproblems.com/755](https://www.erdosproblems.com/755) + +The number of equilateral triangles of size $1$ formed by any set of $n$ points +in $\mathbb{R}^6$ is at most $(1/27 + o(1))n^3$. + +A problem of Erdős and Purdy [ErPu75]. Erdős believed the bound should hold +even for equilateral triangles of any size. This was proved in a strong form +by Clemen, Dumitrescu, and Liu [CDL25b], who showed $T_d(n) = (1/27 + o(1))n^3$ +for all even $d \geq 6$. + +See also Problem #1086. + +[ErPu75] Erdős, P. and Purdy, G., _Some extremal problems in geometry. III_. +(1975), 291-308. + +[Er94b] Erdős, P., _Some problems in number theory, combinatorics and +combinatorial geometry_. Mathematica Pannonica (1994), 261-269. + +[CDL25b] Clemen, F., Dumitrescu, A., and Liu, Y., _The number of regular +simplices in higher dimensions_. arXiv:2507.19841 (2025). +-/ + +open Classical + +namespace Erdos755 + +/-- The number of unit equilateral triangles determined by a finite point set +in $d$-dimensional Euclidean space: the number of $3$-element subsets where +all pairwise distances are $1$. -/ +noncomputable def unitEquilateralTriangleCount {d : ℕ} + (A : Finset (EuclideanSpace ℝ (Fin d))) : ℕ := + Set.ncard {T : Finset (EuclideanSpace ℝ (Fin d)) | + T ⊆ A ∧ T.card = 3 ∧ ∀ x ∈ T, ∀ y ∈ T, x ≠ y → dist x y = 1} + +/-- +Erdős Problem 755 [ErPu75][Er94b]: + +The number of unit equilateral triangles determined by $n$ points in $\mathbb{R}^6$ is +at most $(1/27 + o(1))n^3$. + +Formulated as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$ +and every set of $n$ points in $\mathbb{R}^6$, the number of unit equilateral triangles +is at most $(1/27 + \varepsilon) \cdot n^3$. +-/ +@[category research solved, AMS 52] +theorem erdos_755 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset (EuclideanSpace ℝ (Fin 6)), + A.card = n → + (unitEquilateralTriangleCount A : ℝ) ≤ (1 / 27 + ε) * (n : ℝ) ^ 3 := by + sorry + +/-- The number of equilateral triangles of any size determined by a finite point set +in $d$-dimensional Euclidean space: the number of $3$-element subsets where +all pairwise distances are equal (and positive). -/ +noncomputable def equilateralTriangleCount {d : ℕ} + (A : Finset (EuclideanSpace ℝ (Fin d))) : ℕ := + Set.ncard {T : Finset (EuclideanSpace ℝ (Fin d)) | + T ⊆ A ∧ T.card = 3 ∧ ∃ r > 0, ∀ x ∈ T, ∀ y ∈ T, x ≠ y → dist x y = r} + +/-- +Erdős Problem 755, any-size variant [ErPu75][Er94b][CDL25b]: + +The number of equilateral triangles of *any* size determined by $n$ points in $\mathbb{R}^6$ +is at most $(1/27 + o(1))n^3$. + +This is the stronger version of `erdos_755`, where the equilateral triangles are not +restricted to unit side length. Proved by Clemen, Dumitrescu, and Liu [CDL25b]. +-/ +@[category research solved, AMS 52] +theorem erdos_755_any_size : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset (EuclideanSpace ℝ (Fin 6)), + A.card = n → + (equilateralTriangleCount A : ℝ) ≤ (1 / 27 + ε) * (n : ℝ) ^ 3 := by + sorry + +end Erdos755 diff --git a/FormalConjectures/ErdosProblems/756.lean b/FormalConjectures/ErdosProblems/756.lean new file mode 100644 index 0000000000..abbbe460bb --- /dev/null +++ b/FormalConjectures/ErdosProblems/756.lean @@ -0,0 +1,84 @@ +/- +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 756 + +*Reference:* [erdosproblems.com/756](https://www.erdosproblems.com/756) + +Let $A \subset \mathbb{R}^2$ be a set of $n$ points. Can there be $\gg n$ many +distinct distances each of which occurs for more than $n$ many pairs from $A$? + +[ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, +Combinatorica (1990). + +[Bh24] Bhowmick, K., _A problem of Erdős about rich distances_. arXiv:2407.01174 (2024). + +[CDL25] Clemen, F., Dumitrescu, A., and Liu, D., _On multiplicities of interpoint +distances_. arXiv:2505.04283 (2025). + +See also problems #132 and #957. +-/ + +open Classical + +namespace Erdos756 + +/-- For a finite point set $A \subseteq \mathbb{R}^2$ and a real value $d$, +the number of ordered pairs $(x, y)$ with $x \neq y$ in $A$ at +Euclidean distance $d$. -/ +noncomputable def pairCount (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card + +/-- The set of distances that occur with multiplicity greater than $|A|$ +(counting ordered pairs). -/ +noncomputable def highMultiplicityDistances (A : Finset (EuclideanSpace ℝ (Fin 2))) : Set ℝ := + {d : ℝ | A.card < pairCount A d} + +/-- +Erdős Problem 756 [ErPa90] (proved by Bhowmick [Bh24]): +There exists a constant $c > 0$ such that for all sufficiently large $n$, +there is a set $A$ of $n$ points in $\mathbb{R}^2$ with the number of +distinct distances occurring more than $n$ times (as ordered pairs) being +at least $c \cdot n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_756 : answer(True) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ A : Finset (EuclideanSpace ℝ (Fin 2)), A.card = n ∧ + c * (n : ℝ) ≤ Set.ncard (highMultiplicityDistances A) := by + sorry + +/-- +Stronger variant of Erdős Problem 756 (Erdős–Pach [ErPa90]): for sufficiently +large $n$, there exists a set $A$ of $n$ points in $\mathbb{R}^2$ such that every +realized distance except the largest occurs with multiplicity greater than $|A|$ +(as ordered pairs). Hopf and Pannwitz (1934) showed the largest distance occurs +at most $n$ times, so it must be excluded. +-/ +@[category research open, AMS 5 52] +theorem erdos_756_all_except_largest : + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ A : Finset (EuclideanSpace ℝ (Fin 2)), A.card = n ∧ + ∀ d : ℝ, 0 < pairCount A d → + (∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ dist x y > d) → + A.card < pairCount A d := by + sorry + +end Erdos756 diff --git a/FormalConjectures/ErdosProblems/758.lean b/FormalConjectures/ErdosProblems/758.lean new file mode 100644 index 0000000000..0187b6cdef --- /dev/null +++ b/FormalConjectures/ErdosProblems/758.lean @@ -0,0 +1,56 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 758 + +*Reference:* [erdosproblems.com/758](https://www.erdosproblems.com/758) + +The cochromatic number of $G$, denoted $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either +a complete graph or an empty graph (independent set). Let $z(n)$ be the maximum +value of $\zeta(G)$ over all graphs $G$ with $n$ vertices. + +[ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory* (1993). + +[Gi86] Gimbel, J., *The chromatic and cochromatic number of a graph* (1986). +-/ + +open SimpleGraph + +namespace Erdos758 + +/-- $z(n)$: the maximum cochromatic number over all simple graphs on $n$ +vertices. -/ +noncomputable def maxCochromaticNumber (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ G : SimpleGraph (Fin n), G.cochromaticNumber = (k : ℕ∞)} + +/-- +Erdős Problem 758 [ErGi93]: + +Is it true that $z(12) = 4$, where $z(n)$ is the maximum cochromatic number +over all graphs on $n$ vertices? + +Resolved: $z(12) = 4$ (confirmed computationally by Bhavik Mehta). +-/ +@[category research solved, AMS 5] +theorem erdos_758 : answer(True) ↔ maxCochromaticNumber 12 = 4 := by + sorry + +end Erdos758 diff --git a/FormalConjectures/ErdosProblems/759.lean b/FormalConjectures/ErdosProblems/759.lean new file mode 100644 index 0000000000..2ea3677285 --- /dev/null +++ b/FormalConjectures/ErdosProblems/759.lean @@ -0,0 +1,85 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 759 + +*Reference:* [erdosproblems.com/759](https://www.erdosproblems.com/759) + +The cochromatic number of $G$, denoted by $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either +a complete graph or an empty graph. + +Let $z(S_n)$ be the maximum value of $\zeta(G)$ over all graphs $G$ which can be embedded +on $S_n$, the orientable surface of genus $n$. Determine the growth rate of $z(S_n)$. + +A problem of Erdős and Gimbel [ErGi93]. Gimbel [Gi86] proved that +$$\sqrt{n} / \log n \ll z(S_n) \ll \sqrt{n}.$$ + +Solved by Gimbel and Thomassen [GiTh97], who proved +$$z(S_n) \asymp \sqrt{n} / \log n.$$ + +[ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*, 1993. + +[Gi86] Gimbel, J., *Some remarks on the cochromatic number of a graph*, 1986. + +[GiTh97] Gimbel, J. and Thomassen, C., *Coloring graphs with fixed genus and girth*, 1997. +-/ + +open SimpleGraph Real + +namespace Erdos759 + +/-- Embeddability of a finite simple graph on the orientable surface of genus $n$. +This is axiomatized since surface topology is not available in Mathlib. -/ +opaque IsEmbeddableOnSurface {m : ℕ} (_ : SimpleGraph (Fin m)) (_ : ℕ) : Prop + +/-- $z(S_n)$: the maximum cochromatic number over all finite graphs embeddable +on the orientable surface of genus $n$. -/ +noncomputable def maxCochromaticOnSurface (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ (m : ℕ) (G : SimpleGraph (Fin m)), + IsEmbeddableOnSurface G n ∧ (cochromaticNumber G).toNat = k} + +/-- +Erdős Problem 759, upper bound (Gimbel–Thomassen [GiTh97]): + +There exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$$z(S_n) \leq C \cdot \sqrt{n} / \log n.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_759 : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxCochromaticOnSurface n : ℝ) ≤ + C * Real.sqrt (n : ℝ) / Real.log (n : ℝ) := by + sorry + +/-- +Erdős Problem 759, lower bound (Gimbel [Gi86]): + +There exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$$z(S_n) \geq C \cdot \sqrt{n} / \log n.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_759.variants.lower_bound : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxCochromaticOnSurface n : ℝ) ≥ + C * Real.sqrt (n : ℝ) / Real.log (n : ℝ) := by + sorry + +end Erdos759 diff --git a/FormalConjectures/ErdosProblems/76.lean b/FormalConjectures/ErdosProblems/76.lean new file mode 100644 index 0000000000..168f2cbf10 --- /dev/null +++ b/FormalConjectures/ErdosProblems/76.lean @@ -0,0 +1,114 @@ +/- +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 76 + +*Reference:* [erdosproblems.com/76](https://www.erdosproblems.com/76) + +In any 2-colouring of the edges of $K_n$ there must exist at least +$(1 + o(1)) \, n^2/12$ many edge-disjoint monochromatic triangles. + +Conjectured by Erdős, Faudree, and Ordman [Er95][Er97d]. Proved by Gruslys and +Letzter [GrLe20]. + +The bound is tight: partition $V(K_n)$ into two equal halves, colour edges +between parts red and edges within parts blue — any edge-disjoint monochromatic +triangle must either use 3 blue edges (within a part) or 3 red edges (between +parts), and a careful count shows $\approx n^2/12$ is achievable but not more. + +See also OEIS sequence A060407. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium **107** (1995). + +[Er97d] Erdős, P., _Some of my favourite problems in number theory, combinatorics, +and geometry_. Resenhas **1** (1995), 165–186. + +[Va99, 3.54] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999. + +[GrLe20] Gruslys, V. and Letzter, S., _Minimising the number of triangles in a +two-colouring of the edges of $K_n$_, J. Combin. Theory Ser. B (2020). +-/ + +namespace Erdos76 + +/-- A 2-edge-colouring of $K_n$ assigns a `Bool` to each unordered pair of vertices. +(Values at diagonal elements $s(v, v)$ are irrelevant.) -/ +def EdgeTwoColoring (n : ℕ) := Sym2 (Fin n) → Bool + +/-- The set of (non-diagonal) edges of a triangle $T \subseteq V(K_n)$: +all unordered pairs $\{x, y\}$ with $x \neq y$ and $x, y \in T$. -/ +def triangleEdges {n : ℕ} (T : Finset (Fin n)) : Finset (Sym2 (Fin n)) := + ((T ×ˢ T).image (fun p : Fin n × Fin n => s(p.1, p.2))).filter (fun e => ¬e.IsDiag) + +/-- A 3-vertex set $T \subseteq V(K_n)$ is a monochromatic triangle under colouring `col` if +all three edges of $T$ receive the same colour. -/ +def IsMonochromaticTriangle {n : ℕ} (col : EdgeTwoColoring n) (T : Finset (Fin n)) : Prop := + T.card = 3 ∧ ∃ c : Bool, ∀ e ∈ triangleEdges T, col e = c + +/-- A family $\mathcal{T}$ of triangles is edge-disjoint if any two distinct triangles in +$\mathcal{T}$ share no edge. -/ +def IsEdgeDisjointFamily {n : ℕ} (𝒯 : Finset (Finset (Fin n))) : Prop := + ∀ T₁ ∈ 𝒯, ∀ T₂ ∈ 𝒯, T₁ ≠ T₂ → Disjoint (triangleEdges T₁) (triangleEdges T₂) + +/-- +**Erdős Problem 76** (Erdős–Faudree–Ordman conjecture, proved by Gruslys–Letzter [GrLe20]): + +In any 2-colouring of the edges of $K_n$, there exist at least $(1 + o(1)) \, n^2/12$ +edge-disjoint monochromatic triangles. + +Formally: for every $\varepsilon > 0$ there exists $N$ such that for all $n \geq N$ and any +2-colouring `col` of the edges of $K_n$, there is an edge-disjoint family of +monochromatic triangles of size at least $(1 - \varepsilon) \cdot n^2 / 12$. +-/ +@[category research solved, AMS 5] +theorem erdos_76 : answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ col : EdgeTwoColoring n, + ∃ 𝒯 : Finset (Finset (Fin n)), + (∀ T ∈ 𝒯, IsMonochromaticTriangle col T) ∧ + IsEdgeDisjointFamily 𝒯 ∧ + (1 - ε) * (n : ℝ) ^ 2 / 12 ≤ (𝒯.card : ℝ) := by + sorry + +/-- +**Erdős Problem 76, single-color variant** [Er97d]: + +In any 2-colouring of the edges of $K_n$, there exist at least $c \cdot n^2$ +edge-disjoint monochromatic triangles *all of the same colour* (choosing the +better colour), for some absolute constant $c > 1/24$. + +This is strictly stronger than the main problem: it asks for many edge-disjoint +triangles in a single colour class rather than across both colours. +-/ +@[category research open, AMS 5] +theorem erdos_76_single_color : answer(True) ↔ + ∃ c : ℝ, 1 / 24 < c ∧ + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ col : EdgeTwoColoring n, + ∃ (color : Bool) (𝒯 : Finset (Finset (Fin n))), + (∀ T ∈ 𝒯, IsMonochromaticTriangle col T ∧ + ∀ e ∈ triangleEdges T, col e = color) ∧ + IsEdgeDisjointFamily 𝒯 ∧ + c * (n : ℝ) ^ 2 ≤ (𝒯.card : ℝ) := by + sorry + +end Erdos76 diff --git a/FormalConjectures/ErdosProblems/760.lean b/FormalConjectures/ErdosProblems/760.lean new file mode 100644 index 0000000000..017ec8870c --- /dev/null +++ b/FormalConjectures/ErdosProblems/760.lean @@ -0,0 +1,64 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 760 + +*Reference:* [erdosproblems.com/760](https://www.erdosproblems.com/760) + +The cochromatic number of $G$, denoted by $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either +a complete graph or an empty graph. + +If $G$ is a graph with chromatic number $\chi(G) = m$ then must $G$ contain a subgraph $H$ +with $\zeta(H) \gg m / \log m$? + +A problem of Erdős and Gimbel [ErGi93], who proved that there must exist a +subgraph $H$ with $\zeta(H) \gg (m / \log m)^{1/2}$. The proposed bound would be best +possible, as shown by taking $G$ to be a complete graph. + +The answer is yes, proved by Alon, Krivelevich, and Sudakov [AKS97]. + +[ErGi93] Erdős, P. and Gimbel, J. + +[AKS97] Alon, N., Krivelevich, M., and Sudakov, B. +-/ + +open SimpleGraph Real + +namespace Erdos760 + +/-- +**Erdős Problem 760** (Proved, Alon–Krivelevich–Sudakov [AKS97]): + +There exists a constant $C > 0$ such that for every graph $G$ with sufficiently +large chromatic number $m = \chi(G)$, there exists an induced subgraph $H$ of $G$ with +cochromatic number $\zeta(H) \geq C \cdot m / \log m$. +-/ +@[category research solved, AMS 5] +theorem erdos_760 : + answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + G.chromaticNumber.toNat ≥ N₀ → + ∃ (S : Finset (Fin n)), + (SimpleGraph.cochromaticNumber (G.induce (↑S : Set (Fin n))) |>.toNat : ℝ) ≥ + C * (G.chromaticNumber.toNat : ℝ) / Real.log (G.chromaticNumber.toNat : ℝ) := by + sorry + +end Erdos760 diff --git a/FormalConjectures/ErdosProblems/761.lean b/FormalConjectures/ErdosProblems/761.lean new file mode 100644 index 0000000000..48a374a292 --- /dev/null +++ b/FormalConjectures/ErdosProblems/761.lean @@ -0,0 +1,93 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 761 + +*Reference:* [erdosproblems.com/761](https://www.erdosproblems.com/761) + +The cochromatic number of $G$, denoted by $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either +a complete graph or empty graph. The dichromatic number of $G$, denoted by $\delta(G)$, +is the minimum number $k$ of colours required such that, in any orientation of +the edges of $G$, there is a $k$-colouring of the vertices of $G$ such that there +are no monochromatic oriented cycles. + +The first question is due to Erdős and Neumann-Lara. The second question is +due to Erdős and Gimbel. A positive answer to the second question implies a +positive answer to the first via the bound mentioned in Problem 760. + +[ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory* (1993). +-/ + +open SimpleGraph + +namespace Erdos761 + +/-- An orientation of a simple graph assigns a direction to each edge: +each edge $\{u,v\}$ is oriented as $u \to v$ or $v \to u$ (but not both). -/ +def IsOrientation {V : Type*} (G : SimpleGraph V) (D : V → V → Prop) : Prop := + (∀ u v, D u v → G.Adj u v) ∧ + (∀ u v, G.Adj u v → D u v ∨ D v u) ∧ + (∀ u v, D u v → ¬D v u) + +/-- A colouring $c : V \to \operatorname{Fin}(k)$ is acyclic with respect to an orientation $D$ +if there is no monochromatic directed cycle: no vertex can reach itself +via directed edges within its own colour class. -/ +def IsAcyclicColouring {V : Type*} (D : V → V → Prop) (k : ℕ) + (c : V → Fin k) : Prop := + ∀ i : Fin k, ∀ v : V, c v = i → + ¬Relation.TransGen (fun u w => c u = i ∧ c w = i ∧ D u w) v v + +/-- The dichromatic number of $G$: the minimum $k$ such that for every orientation +of $G$, there exists an acyclic $k$-colouring. -/ +noncomputable def dichromaticNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | ∀ D : V → V → Prop, IsOrientation G D → + ∃ c : V → Fin k, IsAcyclicColouring D k c} + +/-- +**Erdős Problem 761, Question 1** (Erdős–Neumann-Lara): + +Must a graph with large chromatic number have large dichromatic number? +For every $n$ there exists $m$ such that $\chi(G) \geq m$ implies $\delta(G) \geq n$. +-/ +@[category research open, AMS 5] +theorem erdos_761 : answer(sorry) ↔ + (∀ n : ℕ, ∃ m : ℕ, ∀ (s : ℕ) (G : SimpleGraph (Fin s)), + G.chromaticNumber.toNat ≥ m → + dichromaticNumber G ≥ n) := by + sorry + +/-- +**Erdős Problem 761, Question 2** (Erdős–Gimbel): + +Must a graph with large cochromatic number contain a subgraph with large +dichromatic number? For every $n$ there exists $m$ such that $\zeta(G) \geq m$ implies +$G$ contains an induced subgraph with $\delta \geq n$. +-/ +@[category research open, AMS 5] +theorem erdos_761.variants.cochromatic : answer(sorry) ↔ + (∀ n : ℕ, ∃ m : ℕ, ∀ (s : ℕ) (G : SimpleGraph (Fin s)), + G.cochromaticNumber.toNat ≥ m → + ∃ (S : Finset (Fin s)), + dichromaticNumber (G.induce (↑S : Set (Fin s))) ≥ n) := by + sorry + +end Erdos761 diff --git a/FormalConjectures/ErdosProblems/762.lean b/FormalConjectures/ErdosProblems/762.lean new file mode 100644 index 0000000000..265a79d797 --- /dev/null +++ b/FormalConjectures/ErdosProblems/762.lean @@ -0,0 +1,66 @@ +/- +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.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 762 + +*Reference:* [erdosproblems.com/762](https://www.erdosproblems.com/762) + +The cochromatic number of $G$, denoted by $\zeta(G)$, is the minimum number of colours +needed to colour the vertices of $G$ such that each colour class induces either a +complete graph or empty graph. + +A conjecture of Erdős, Gimbel, and Straight [EGS90], who proved that for every +$n > 2$ there exists some $f(n)$ such that if $G$ contains no clique on $n$ vertices +then $\chi(G) \leq \zeta(G) + f(n)$. + +This has been disproved by Steiner [St24b], who constructed a graph $G$ with +$\omega(G) = 4$, $\zeta(G) = 4$, and $\chi(G) = 7$. + +[EGS90] Erdős, P., Gimbel, J., and Straight, H.J., _Chromatic number versus cochromatic +number in graphs with bounded clique number_, European J. Combin. 11 (1990), 235–240. + +[ErGi93] Erdős, P. and Gimbel, J., _Some problems and results in cochromatic theory_ (1993). + +[St24b] Steiner, R., _A counterexample to the Erdős–Gimbel–Straight conjecture_, 2024. +-/ + +open SimpleGraph + +namespace Erdos762 + +/-- +**Erdős Problem 762** (disproved, Steiner [St24b]): + +Is it true that if $G$ has no $K_5$ and $\zeta(G) \geq 4$ then +$\chi(G) \leq \zeta(G) + 2$? + +Steiner constructed a counterexample: a graph $G$ with $\omega(G) = 4$, +$\zeta(G) = 4$, and $\chi(G) = 7 > \zeta(G) + 2 = 6$. +-/ +@[category research solved, AMS 5] +theorem erdos_762 : + answer(False) ↔ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + G.CliqueFree 5 → + G.cochromaticNumber ≥ 4 → + G.chromaticNumber ≤ G.cochromaticNumber + 2 := by + sorry + +end Erdos762 diff --git a/FormalConjectures/ErdosProblems/763.lean b/FormalConjectures/ErdosProblems/763.lean new file mode 100644 index 0000000000..8b7d87e6e9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/763.lean @@ -0,0 +1,60 @@ +/- +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.Combinatorics.Additive.Convolution + +/-! +# Erdős Problem 763 + +*Reference:* [erdosproblems.com/763](https://www.erdosproblems.com/763) + +Let $A \subseteq \mathbb{N}$. Can there exist some constant $c > 0$ such that +$$\sum_{n \leq N} 1_A \ast 1_A(n) = cN + O(1)?$$ +Here $1_A \ast 1_A(n)$ denotes the number of representations of $n$ as $a + b$ +with $a, b \in A$. + +A conjecture of Erdős and Turán [Er65b][Er70c]. + +Disproved: Erdős and Fuchs [ErFu56] proved the answer is no in a strong +form: even $\sum_{n \leq N} 1_A \ast 1_A(n) = cN + o(N^{1/4} / (\log N)^{1/2})$ +is impossible. The error term was later improved to $o(N^{1/4})$ by +Jurkat (unpublished) and Montgomery–Vaughan [MoVa90]. +-/ + +open Finset BigOperators Classical AdditiveCombinatorics + +namespace Erdos763 + +/-- The partial sum $\sum_{n=0}^{N} 1_A \ast 1_A(n)$. -/ +noncomputable def repSum (A : Set ℕ) (N : ℕ) : ℕ := + (Finset.range (N + 1)).sum (fun n => sumRep A n) + +/-- +Erdős Problem 763 (Erdős–Fuchs theorem) [ErFu56]: + +For any $A \subseteq \mathbb{N}$ and any $c > 0$, the partial sums +$\sum_{n \leq N} 1_A \ast 1_A(n)$ cannot satisfy +$\sum_{n \leq N} 1_A \ast 1_A(n) = cN + O(1)$. That is, the error +term $|\sum_{n \leq N} 1_A \ast 1_A(n) - cN|$ is unbounded. +-/ +@[category research solved, AMS 11] +theorem erdos_763 : answer(False) ↔ + ∃ (A : Set ℕ) (c : ℝ), c > 0 ∧ + ∃ C : ℝ, ∀ N : ℕ, |↑(repSum A N) - c * ↑N| ≤ C := by + sorry + +end Erdos763 diff --git a/FormalConjectures/ErdosProblems/764.lean b/FormalConjectures/ErdosProblems/764.lean new file mode 100644 index 0000000000..fcdaea5336 --- /dev/null +++ b/FormalConjectures/ErdosProblems/764.lean @@ -0,0 +1,50 @@ +/- +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.Combinatorics.Additive.Convolution + +/-! +# Erdős Problem 764 + +*Reference:* [erdosproblems.com/764](https://www.erdosproblems.com/764) + +A conjecture of Erdős [Er65b][Er70c] on whether the partial sums of the 3-fold additive +convolution $1_A \ast 1_A \ast 1_A$ can have bounded error term around a linear function. +Related to problem 763, which concerns the 2-fold convolution. + +Disproved by Vaughan [Va72], who proved the answer is no in a strong form, showing that even +$\sum_{n \leq N} 1_A \ast 1_A \ast 1_A(n) = cN + o(N^{1/4} / (\log N)^{1/2})$ is impossible. +-/ + +open Finset BigOperators Classical AdditiveCombinatorics Set + +namespace Erdos764 + +/-- +Erdős Problem 764 (Vaughan's theorem) [Va72]: + +There do not exist $A \subseteq \mathbb{N}$ and $c > 0$ such that +$\sum_{n \leq N} 1_A \ast 1_A \ast 1_A(n) = cN + O(1)$. +-/ +@[category research solved, AMS 11] +theorem erdos_764 : answer(False) ↔ + ∃ (A : Set ℕ) (c : ℝ), c > 0 ∧ + ∃ C : ℝ, ∀ N : ℕ, + |↑((Finset.range (N + 1)).sum ((𝟙_A ∗ 𝟙_A) ∗ 𝟙_A)) - c * ↑N| ≤ C := by + sorry + +end Erdos764 diff --git a/FormalConjectures/ErdosProblems/765.lean b/FormalConjectures/ErdosProblems/765.lean new file mode 100644 index 0000000000..0baff408d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/765.lean @@ -0,0 +1,104 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Extremal.Basic +import Mathlib.Combinatorics.SimpleGraph.Circulant + +/-! +# Erdős Problem 765 + +*Reference:* [erdosproblems.com/765](https://www.erdosproblems.com/765) + +Give an asymptotic formula for $\mathrm{ex}(n; C_4)$. + +Erdős and Klein proved $\mathrm{ex}(n; C_4) \asymp n^{3/2}$. Reiman proved +$\frac{1}{2\sqrt{2}} \leq \lim \frac{\mathrm{ex}(n; C_4)}{n^{3/2}} \leq \frac{1}{2}$. +Erdős–Rényi and independently Brown showed that for $n = q^2 + q + 1$ with $q$ a +prime power, $\mathrm{ex}(n; C_4) \geq \frac{q(q+1)^2}{2}$, which together with Reiman's +upper bound gives $\mathrm{ex}(n; C_4) \sim \frac{1}{2} n^{3/2}$. + +Füredi [Fu83] proved exact values for $q > 13$: +$\mathrm{ex}(n; C_4) = \frac{1}{2} q(q+1)^2$ when $n = q^2 + q + 1$ and $q$ is a prime power. + +[Er93] Erdős, P., *On some of my favourite theorems*. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), 97–132. + +[Fu83] Füredi, Z., *Graphs without quadrilaterals*. J. Combin. Theory Ser. B (1983), 187–190. + +[MaYa23] Ma, J. and Yang, T., *On the extremal number of subdivisions*. Combinatorica 43 +(2023), 1019–1027. +-/ + +open SimpleGraph + +namespace Erdos765 + +/-- +Erdős Problem 765 (SOLVED): + +The asymptotic formula for $\mathrm{ex}(n; C_4)$ is +$\mathrm{ex}(n; C_4) \sim \frac{1}{2} n^{3/2}$. + +Formally: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$$\left|\frac{\mathrm{ex}(n; C_4)}{n^{3/2}} - \frac{1}{2}\right| < \varepsilon.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_765 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + |(↑(extremalNumber n (cycleGraph 4)) / (n : ℝ) ^ ((3 : ℝ) / 2) - 1 / 2)| < ε := by + sorry + +/-- +Erdős's refined conjecture from [Er93] (still open): + +$\mathrm{ex}(n; C_4) = \frac{n^{3/2}}{2} + O(n)$. + +Formally: there exists a constant $C > 0$ such that for all $n \geq 1$, +$$\left|\mathrm{ex}(n; C_4) - \frac{n^{3/2}}{2}\right| \leq C \cdot n.$$ + +His even stronger conjecture $\mathrm{ex}(n; C_4) = \frac{n^{3/2}}{2} + \frac{n}{4} + +O(n^{1/2})$ was disproved by Ma–Yang [MaYa23]. +-/ +@[category research open, AMS 5] +theorem erdos_765.variants.refined : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + |(↑(extremalNumber n (cycleGraph 4)) - (n : ℝ) ^ ((3 : ℝ) / 2) / 2)| ≤ + C * (n : ℝ) := by + sorry + +/-- +Erdős's stronger conjecture (DISPROVED by Ma–Yang [MaYa23]): + +$\mathrm{ex}(n; C_4) = \frac{n^{3/2}}{2} + \frac{n}{4} + O(n^{1/2})$. + +Formally: there exists a constant $C > 0$ such that for all $n \geq 1$, +$$\left|\mathrm{ex}(n; C_4) - \frac{n^{3/2}}{2} - \frac{n}{4}\right| \leq C \cdot n^{1/2}.$$ + +This is a refinement of the O(n) variant; it pins down the second-order term as $n/4$. +Ma and Yang showed this is false. +-/ +@[category research solved, AMS 5] +theorem erdos_765.variants.strong_conjecture : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + |(↑(extremalNumber n (cycleGraph 4)) - (n : ℝ) ^ ((3 : ℝ) / 2) / 2 - + (n : ℝ) / 4)| ≤ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos765 diff --git a/FormalConjectures/ErdosProblems/766.lean b/FormalConjectures/ErdosProblems/766.lean new file mode 100644 index 0000000000..6d65b5988e --- /dev/null +++ b/FormalConjectures/ErdosProblems/766.lean @@ -0,0 +1,73 @@ +/- +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 766 + +*Reference:* [erdosproblems.com/766](https://www.erdosproblems.com/766) + +[Er64c] Erdős, P., _On extremal problems of graphs and generalized graphs_. +Israel J. Math. **2** (1964), 183–190. + +Let $f(n;k,l) = \min \operatorname{ex}(n;G)$, where $G$ ranges over all graphs with $k$ vertices +and $l$ edges. + +Give good estimates for $f(n;k,l)$ in the range $k < l \leq k^2/4$. For fixed $k$ and +large $n$, is $f(n;k,l)$ a strictly monotone function of $l$? + +Dirac and Erdős proved independently that when $l = \lfloor k^2/4 \rfloor + 1$, +$f(n;k,l) \leq \lfloor n^2/4 \rfloor + 1$. +-/ + +open SimpleGraph + +namespace Erdos766 + +/-- The minimum extremal number $f(n;k,l)$: the minimum of $\operatorname{ex}(n;G)$ over all +graphs $G$ on $k$ vertices with exactly $l$ edges. -/ +noncomputable def minExtremalNumber (n k l : ℕ) : ℕ := + sInf {m : ℕ | ∃ G : SimpleGraph (Fin k), + G.edgeSet.ncard = l ∧ SimpleGraph.extremalNumber n G = m} + +/-- +Erdős Problem 766, monotonicity conjecture: + +For fixed $k$ and large $n$, $f(n;k,l)$ is a strictly monotone function of $l$ +in the range $k < l \leq k^2/4$. + +Formally: for all $k \geq 2$ and $l < l'$ in the range $(k, k^2/4]$, there exists $N_0$ +such that for all $n \geq N_0$, $f(n;k,l) < f(n;k,l')$. +-/ +@[category research open, AMS 5] +theorem erdos_766 : answer(sorry) ↔ + ∀ (k l l' : ℕ), k ≥ 2 → k < l → l < l' → 4 * l' ≤ k ^ 2 → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + minExtremalNumber n k l < minExtremalNumber n k l' := by + sorry + +/-- +Dirac--Erdős theorem (known result): + +When $l = \lfloor k^2/4 \rfloor + 1$, $f(n;k,l) \leq \lfloor n^2/4 \rfloor + 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_766.variants.dirac_erdos (k n : ℕ) (hk : k ≥ 2) : + minExtremalNumber n k (k ^ 2 / 4 + 1) ≤ n ^ 2 / 4 + 1 := by + sorry + +end Erdos766 diff --git a/FormalConjectures/ErdosProblems/767.lean b/FormalConjectures/ErdosProblems/767.lean new file mode 100644 index 0000000000..9a5ebcf415 --- /dev/null +++ b/FormalConjectures/ErdosProblems/767.lean @@ -0,0 +1,100 @@ +/- +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 767 + +*Reference:* [erdosproblems.com/767](https://www.erdosproblems.com/767) + +Let $g_k(n)$ be the maximal number of edges possible on a graph with $n$ vertices +which does not contain a cycle with $k$ chords incident to a vertex on the cycle. + +Erdős conjectured that $g_k(n) = (k+1)n - (k+1)^2$ for sufficiently large $n$, noting +that the lower bound $g_k(n) \geq (k+1)n - (k+1)^2$ is "easy to see." +Czipszer proved that $g_k(n)$ exists for all $k$, and in fact $g_k(n) \leq (k+1)n$. +Pósa proved that $g_1(n) = 2n - 4$ for $n \geq 4$. +Erdős verified the conjecture for $k = 2$ and $k = 3$ when $n \geq 2k + 2$. +The conjectured equality was proved for $n \geq 3k + 3$ by Jiang [Ji04]. + +In [Er69b], Erdős mentions that Lewin disproved the conjecture for general $k$ (oral +communication), though it is unclear whether this applied only to small $n$ or was incorrect, +given Jiang's later proof. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph + Theory (1969), 27-35. +[Ji04] Jiang, T., _On the Turán number of cycles with $k$ chords_, 2004. +-/ + +open SimpleGraph + +namespace Erdos767 + +/-- A graph $G$ contains a cycle with at least $k$ chords incident to a single vertex. +That is, there exists a simple cycle (given by an injective map $f : \operatorname{Fin} m \to V$ +tracing consecutive adjacent vertices) and a vertex $f(i_0)$ on the cycle that +is adjacent to at least $k$ other cycle vertices which are not its two +cycle-neighbors. -/ +def HasCycleWithKChords {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (m : ℕ) (hm : m ≥ 3) (f : Fin m → V), + Function.Injective f ∧ + (∀ i : Fin m, G.Adj (f i) (f ⟨(i.val + 1) % m, Nat.mod_lt _ (by omega)⟩)) ∧ + ∃ i₀ : Fin m, + k ≤ Set.ncard {j : Fin m | + j ≠ i₀ ∧ + j.val ≠ (i₀.val + 1) % m ∧ + j.val ≠ (i₀.val + m - 1) % m ∧ + G.Adj (f i₀) (f j)} + +/-- $g_k(n)$: the maximum number of edges in a simple graph on $n$ vertices that +does not contain a cycle with $k$ chords incident to a vertex. -/ +noncomputable def maxEdgesAvoidingCycleChords (k n : ℕ) : ℕ := + sSup {e : ℕ | ∃ G : SimpleGraph (Fin n), + ¬HasCycleWithKChords G k ∧ G.edgeSet.ncard = e} + +/-- +**Erdős Problem 767** (proved by Jiang [Ji04]): + +For all $k \geq 1$, $g_k(n) = (k+1)n - (k+1)^2$ for all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_767 : answer(True) ↔ + ∀ (k : ℕ), k ≥ 1 → ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + maxEdgesAvoidingCycleChords k n = (k + 1) * n - (k + 1) ^ 2 := by + sorry + +/-- +**Czipszer's upper bound:** + +For all $k$, $g_k(n) \leq (k+1)n$. +-/ +@[category research solved, AMS 5] +theorem erdos_767_czipszer_upper_bound : + ∀ (k n : ℕ), maxEdgesAvoidingCycleChords k n ≤ (k + 1) * n := by + sorry + +/-- +**Pósa's exact result:** + +$g_1(n) = 2n - 4$ for $n \geq 4$. +-/ +@[category research solved, AMS 5] +theorem erdos_767_posa : + ∀ (n : ℕ), n ≥ 4 → maxEdgesAvoidingCycleChords 1 n = 2 * n - 4 := by + sorry + +end Erdos767 diff --git a/FormalConjectures/ErdosProblems/768.lean b/FormalConjectures/ErdosProblems/768.lean new file mode 100644 index 0000000000..432b6cec2c --- /dev/null +++ b/FormalConjectures/ErdosProblems/768.lean @@ -0,0 +1,63 @@ +/- +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 768 + +*Reference:* [erdosproblems.com/768](https://www.erdosproblems.com/768) + +Let $A$ be the set of integers $n$ such that for every prime $p$ dividing $n$, there +exists a divisor $d > 1$ of $n$ with $d \equiv 1 \pmod{p}$. Is it true that there +exists $c > 0$ such that $|A \cap [1,N]| / N = \exp(-(c+o(1))\sqrt{\log N} \cdot \log \log N)$? + +[Er74b] Erdős, P., *Problems and results on combinatorial number theory*. +-/ + +open Filter Classical + +namespace Erdos768 + +/-- An integer $n$ is in the set $A$ if for every prime $p$ dividing $n$, there exists +some divisor $d > 1$ of $n$ with $d \equiv 1 \pmod{p}$. -/ +def InSetA (n : ℕ) : Prop := + ∀ p : ℕ, Nat.Prime p → p ∣ n → ∃ d : ℕ, d > 1 ∧ d ∣ n ∧ d % p = 1 + +/-- Count of integers in $\{1, \ldots, N\}$ belonging to the set $A$. -/ +noncomputable def countA (N : ℕ) : ℕ := + ((Finset.range N).filter (fun n => InSetA (n + 1))).card + +/-- +Erdős Problem 768 [Er74b]: + +Is it true that there exists $c > 0$ such that +$$|A \cap [1,N]| / N = \exp(-(c + o(1)) \sqrt{\log N} \cdot \log \log N)?$$ + +Formalized as: there exists $c > 0$ such that +$-\log(|A \cap [1,N]| / N) / (\sqrt{\log N} \cdot \log(\log N)) \to c$ as $N \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_768 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun N : ℕ => + -Real.log ((countA N : ℝ) / (N : ℝ)) / + (Real.sqrt (Real.log (N : ℝ)) * Real.log (Real.log (N : ℝ)))) + atTop (nhds c) := by + sorry + +end Erdos768 diff --git a/FormalConjectures/ErdosProblems/769.lean b/FormalConjectures/ErdosProblems/769.lean new file mode 100644 index 0000000000..b3a630dcfd --- /dev/null +++ b/FormalConjectures/ErdosProblems/769.lean @@ -0,0 +1,75 @@ +/- +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 769 + +*Reference:* [erdosproblems.com/769](https://www.erdosproblems.com/769) + +Let $c(n)$ be minimal such that if $k \geq c(n)$ then the $n$-dimensional unit cube +can be decomposed into $k$ homothetic $n$-dimensional cubes. Is it true that +$c(n) \gg n^n$? + +A problem first investigated by Hadwiger, who proved $c(n) \geq 2^n + 2^{n-1}$. + +[Er74b] Erdős, P., *Remarks on some problems in number theory*. Math. Balkanica (1974), 197-202. + +[CoMa18] Connor, P. and Marmorino, P., *Decomposing cubes into smaller cubes*. J. Geom. +(2018), Paper No. 19, 11. + +[Hu98] Hudelson, M., *Dissecting d-cubes into smaller d-cubes*. J. Combin. Theory Ser. A +(1998), 190-200. +-/ + +namespace Erdos769 + +open Set + +/-- The $n$-dimensional unit cube $[0,1]^n$ can be decomposed into exactly $k$ +homothetic cubes (axis-aligned cubes with positive side lengths) such that +the cubes cover the unit cube and have pairwise disjoint interiors. -/ +def CanDecomposeUnitCube (n k : ℕ) : Prop := + ∃ (corners : Fin k → Fin n → ℝ) (sides : Fin k → ℝ), + (∀ j, sides j > 0) ∧ + (∀ j, pi univ (fun i => Icc (corners j i) (corners j i + sides j)) ⊆ + pi univ (fun _ => Icc 0 1)) ∧ + (∀ x ∈ pi univ (fun _ => Icc (0 : ℝ) 1), ∃ j, + x ∈ pi univ (fun i => Icc (corners j i) (corners j i + sides j))) ∧ + (∀ i j, i ≠ j → ∀ x, + ¬(x ∈ pi univ (fun l => Ioo (corners i l) (corners i l + sides i)) ∧ + x ∈ pi univ (fun l => Ioo (corners j l) (corners j l + sides j)))) + +/-- +Erdős Problem 769 [Er74b]: + +Let $c(n)$ be minimal such that if $k \geq c(n)$ then the $n$-dimensional unit cube +can be decomposed into $k$ homothetic $n$-dimensional cubes. Is it true that +$c(n) \gg n^n$? + +Formalized as: there exists $C > 0$ and $N_0$ such that for all $n \geq N_0$, +if every $k \geq m$ permits a decomposition of the unit $n$-cube into $k$ homothetic +cubes, then $m \geq C \cdot n^n$ (i.e., the threshold $c(n) \geq C \cdot n^n$). +-/ +@[category research open, AMS 52] +theorem erdos_769 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ m : ℕ, (∀ k : ℕ, k ≥ m → CanDecomposeUnitCube n k) → + (m : ℝ) ≥ C * (n : ℝ) ^ n := by + sorry + +end Erdos769 diff --git a/FormalConjectures/ErdosProblems/77.lean b/FormalConjectures/ErdosProblems/77.lean new file mode 100644 index 0000000000..0f5462ba19 --- /dev/null +++ b/FormalConjectures/ErdosProblems/77.lean @@ -0,0 +1,140 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 77 + +*Reference:* [erdosproblems.com/77](https://www.erdosproblems.com/77) + +If $R(k)$ is the diagonal Ramsey number, the minimal $n$ such that every 2-colouring +of the edges of $K_n$ contains a monochromatic copy of $K_k$, then find the value of +$$\lim_{k \to \infty} R(k)^{1/k}.$$ + +Erdős proved $\sqrt{2} \leq \liminf R(k)^{1/k} \leq \limsup R(k)^{1/k} \leq 4$. +The upper bound has been improved to $3.7992\ldots$ by Gupta, Ndiaye, Norin, and +Wei [GNNW24], building on the breakthrough of Campos, Griffiths, Morris, +and Sahasrabudhe [CGMS23] who first improved the upper bound below 4. +A simplified proof of the sub-4 bound was given by Balister, Bollobás, Campos, +Griffiths, Hurley, Morris, Sahasrabudhe, and Tiba [BBCGHMST24]. + +Erdős conjectured the limit is "perhaps 2 but we have no real evidence for this" [Er93]. + +Erdős offered \$100 for proving the limit exists, and \$1,000 (later raised to \$10,000 +in [Er88]) for proving it does not exist. + +See also OEIS sequence A059442 and related problems #627, #1029. + +[Er61] Erdős, P., _Graph theory and probability, II_. Canad. J. Math. **13** (1961), 346–352. + +[Er69b] Erdős, P., _Some applications of Ramsey's theorem to additive number theory_. +European J. Combin. (1969). + +[Er71] Erdős, P., _On some extremal problems on r-graphs_. Discrete Math. **1** (1971), 1–6. + +[Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. +Combinatorica **1** (1981), 25–42. + +[Er88] Erdős, P., _Problems and results on chromatic numbers in finite and infinite graphs_. +Graph Theory with Applications to Algorithms and Computer Science (1988). + +[Er90b] Erdős, P., _Some of my old and new problems in elementary number theory and +combinatorics_. Congressus Numerantium (1990). + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is Eighty, +Vol. 2 (1993). + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Congressus Numerantium **107** (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Er97d] Erdős, P., _Some of my favourite problems in number theory, combinatorics, +and geometry_. + +[Va99] Vaughan, R. C., _On the number of monochromatic complete subgraphs_. + +[CGMS23] Campos, M., Griffiths, S., Morris, R., and Sahasrabudhe, J., +_An exponential improvement for diagonal Ramsey_. (2023). + +[GNNW24] Gupta, A., Ndiaye, M., Norin, S., and Wei, F., +_An improved upper bound for diagonal Ramsey numbers_. (2024). + +[BBCGHMST24] Balister, P., Bollobás, B., Campos, M., Griffiths, S., Hurley, E., +Morris, R., Sahasrabudhe, J., and Tiba, M., _A simple proof of the upper bound for +diagonal Ramsey numbers_. (2024). +-/ + +open Filter SimpleGraph + +open scoped Topology + +namespace Erdos77 + +/-- The (diagonal) graph Ramsey number $R(H)$: the minimum $N$ such that every simple +graph $G$ on $N$ vertices either contains a copy of $H$ as a subgraph or its +complement contains a copy of $H$. -/ +noncomputable def graphRamseyNumber {U : Type*} (H : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + H.IsContained G ∨ H.IsContained Gᶜ} + +/-- The classical diagonal Ramsey number $R(k) := R(K_k, K_k)$. -/ +noncomputable def diagRamsey (k : ℕ) : ℕ := + graphRamseyNumber (⊤ : SimpleGraph (Fin k)) + +/-- +Erdős Problem 77: + +Find the value of $\lim_{k \to \infty} R(k)^{1/k}$, where $R(k)$ is the diagonal +Ramsey number. +-/ +@[category research open, AMS 5] +theorem erdos_77 : + Tendsto (fun k : ℕ => + (diagRamsey k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds (answer(sorry) : ℝ)) := by + sorry + +/-- +Erdős Problem 77 — Existence variant: + +The limit $\lim_{k \to \infty} R(k)^{1/k}$ exists. Erdős offered \$100 for a proof. +-/ +@[category research open, AMS 5] +theorem erdos_77.variants.limit_exists : + ∃ L : ℝ, Tendsto (fun k : ℕ => + (diagRamsey k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by + sorry + +/-- +Erdős Problem 77 — Non-existence variant: + +The limit $\lim_{k \to \infty} R(k)^{1/k}$ does not exist, i.e., +$\liminf R(k)^{1/k} < \limsup R(k)^{1/k}$. +Erdős offered \$1,000 (later raised to \$10,000) for a proof. +-/ +@[category research open, AMS 5] +theorem erdos_77.variants.limit_does_not_exist : + ¬ ∃ L : ℝ, Tendsto (fun k : ℕ => + (diagRamsey k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by + sorry + +end Erdos77 diff --git a/FormalConjectures/ErdosProblems/771.lean b/FormalConjectures/ErdosProblems/771.lean new file mode 100644 index 0000000000..96743c09dc --- /dev/null +++ b/FormalConjectures/ErdosProblems/771.lean @@ -0,0 +1,71 @@ +/- +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 771 + +*Reference:* [erdosproblems.com/771](https://www.erdosproblems.com/771) + +Let $f(n)$ be maximal such that, for every $m \geq 1$, there exists some +$S \subseteq \{1, \ldots, n\}$ with $|S| = f(n)$ such that $m \neq \sum_{a \in A} a$ +for all $A \subseteq S$. + +Is it true that $f(n) = (\tfrac{1}{2} + o(1)) \cdot n / \log n$? + +The lower bound $f(n) \geq (\tfrac{1}{2} + o(1)) \cdot n / \log n$ was proved by Erdős +and Graham [Er89], who took $S = \{kp : 1 \leq k < n/p\}$ where $p$ is the least prime not +dividing $m$. The matching upper bound was proved by Alon and Freiman [AlFr88]. + +[Er89] Erdős, P., _Some problems and results on combinatorial number theory_. Annals of the +New York Academy of Sciences **576** (1989), 132-145. + +[AlFr88] Alon, N. and Freiman, G., _On sums of subsets of a set of integers_. Combinatorica +8 (1988), 297-306. +-/ + +open Finset Real + +namespace Erdos771 + +/-- $m$ is a subset sum of $S$: there exists $A \subseteq S$ with $\sum_{a \in A} a = m$. -/ +def IsSubsetSum (S : Finset ℕ) (m : ℕ) : Prop := + ∃ A : Finset ℕ, A ⊆ S ∧ A.sum id = m + +/-- $f(n)$ is the maximum $k$ such that for every positive integer $m$, there exists +a $k$-element subset $S \subseteq \{1, \ldots, n\}$ for which $m$ is not a subset sum +of $S$. -/ +noncomputable def f (n : ℕ) : ℕ := + sSup {k : ℕ | ∀ m : ℕ, m ≥ 1 → + ∃ S : Finset ℕ, S ⊆ Finset.Icc 1 n ∧ S.card = k ∧ ¬IsSubsetSum S m} + +/-- +Erdős Problem 771 (Erdős–Graham + Alon–Freiman [AlFr88]): +$f(n) = (\tfrac{1}{2} + o(1)) \cdot n / \log n$. + +Formally: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$$(\tfrac{1}{2} - \varepsilon) \cdot n / \log n \leq f(n) \leq (\tfrac{1}{2} + \varepsilon) \cdot n / \log n.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_771 : answer(True) ↔ + (∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (1 / 2 - ε) * (↑n / Real.log ↑n) ≤ ↑(f n) ∧ + ↑(f n) ≤ (1 / 2 + ε) * (↑n / Real.log ↑n)) := by + sorry + +end Erdos771 diff --git a/FormalConjectures/ErdosProblems/772.lean b/FormalConjectures/ErdosProblems/772.lean new file mode 100644 index 0000000000..d9467667d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/772.lean @@ -0,0 +1,107 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 772 + +*Reference:* [erdosproblems.com/772](https://www.erdosproblems.com/772) + +Let $k \geq 1$ and $H_k(n)$ be the maximal $r$ such that if $A \subset \mathbb{N}$ has +$|A| = n$ and $\|1_A \ast 1_A\|_\infty \leq k$ (the additive representation function is +bounded by $k$) then $A$ contains a Sidon set of size at least $r$. + +Is it true that $H_k(n)/n^{1/2} \to \infty$? Or even $H_k(n) > n^{1/2+c}$ for some +constant $c > 0$? + +**Proved**: The answer is yes, and in fact $H_k(n) \gg_k n^{2/3}$, proved by +Alon and Erdős. Erdős also proved the matching upper bound $H_k(n) \ll n^{2/3}$. +Originally posed by Erdős [Er80e, Er84d]. + +[Er80e] Erdős, P., *Some applications of Ramsey's theorem to additive number theory*. +European Journal of Combinatorics (1980), 43–46. + +[Er84d] Erdős, P., *Extremal problems in number theory, combinatorics and geometry*. +Proceedings of the International Congress of Mathematicians, Vol. 1, 2 (Warsaw, 1983) (1984), +51–70. + +[AlEr85] Alon, N. and Erdős, P., *An application of graph theory to additive number theory*, +European J. Combin. 6 (1985), 201–203. +-/ + +namespace Erdos772 + +/-- The additive representation count: the number of ordered pairs $(a, b) \in A \times A$ +with $a + b = m$. The condition $\|1_A \ast 1_A\|_\infty \leq k$ is equivalent to +$\operatorname{addRepCount}(A, m) \leq k$ for all $m$. -/ +def addRepCount (A : Finset ℕ) (m : ℕ) : ℕ := + (A.filter (fun a => a ≤ m ∧ (m - a) ∈ A)).card + +/-- +Erdős Problem 772 (Proved, Alon–Erdős [AlEr85]): + +Is it true that $H_k(n)/n^{1/2} \to \infty$? The answer is yes: for every $k \geq 1$ and +every $C > 0$, eventually every $n$-element set with additive representation bounded by $k$ +contains a Sidon subset of size at least $C \cdot n^{1/2}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_772 : answer(True) ↔ + ∀ k : ℕ, k ≥ 1 → + ∀ C : ℝ, C > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset ℕ, A.card = n → + (∀ m : ℕ, addRepCount A m ≤ k) → + ∃ S : Finset ℕ, S ⊆ A ∧ IsSidon (S : Set ℕ) ∧ + (S.card : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 772 — stronger variant (Proved, Alon–Erdős [AlEr85]): + +In fact $H_k(n) \gg_k n^{2/3}$: for each $k \geq 1$ there exist $C > 0$ and $N_0$ such that +for all $n \geq N_0$, every $n$-element set with additive representation bounded by $k$ +contains a Sidon subset of size at least $C \cdot n^{2/3}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_772.variants.alon_erdos_bound : + ∀ k : ℕ, k ≥ 1 → + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset ℕ, A.card = n → + (∀ m : ℕ, addRepCount A m ≤ k) → + ∃ S : Finset ℕ, S ⊆ A ∧ IsSidon (S : Set ℕ) ∧ + (S.card : ℝ) ≥ C * (n : ℝ) ^ ((2 : ℝ) / 3) := by + sorry + +/-- +Erdős Problem 772 — upper bound variant (Erdős [Er84d]): + +Erdős proved the matching upper bound $H_k(n) \ll n^{2/3}$: there exists an absolute constant +$C > 0$ such that for every $k \geq 1$, eventually there exist $n$-element sets with additive +representation bounded by $k$ whose largest Sidon subset has size at most $C \cdot n^{2/3}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_772.variants.upper_bound : + ∃ C : ℝ, C > 0 ∧ ∀ k : ℕ, k ≥ 1 → + ∀ᶠ n in Filter.atTop, + ∃ A : Finset ℕ, A.card = n ∧ + (∀ m : ℕ, addRepCount A m ≤ k) ∧ + ∀ S : Finset ℕ, S ⊆ A → IsSidon (S : Set ℕ) → + (S.card : ℝ) ≤ C * (n : ℝ) ^ ((2 : ℝ) / 3) := by + sorry + +end Erdos772 diff --git a/FormalConjectures/ErdosProblems/773.lean b/FormalConjectures/ErdosProblems/773.lean new file mode 100644 index 0000000000..4507b76ec0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/773.lean @@ -0,0 +1,59 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 773 + +*Reference:* [erdosproblems.com/773](https://www.erdosproblems.com/773) + +A question of Alon and Erdős [AlEr85], who proved $|A| \geq N^{2/3-o(1)}$ is possible +(via a random subset), and observed that $|A| \ll N / (\log N)^{1/4}$, since (as shown +by Landau) the density of the sums of two squares decays like $(\log N)^{-1/2}$. +The lower bound was improved to $|A| \gg N^{2/3}$ by Lefmann and Thiele [LeTh95]. + +[AlEr85] Alon, N. and Erdős, P., *An application of graph theory to additive number theory*. European Journal of Combinatorics (1985), 201–203. + +[LeTh95] Lefmann, H. and Thiele, T., *Point sets with distinct distances*. Combinatorica (1995), 379–408. +-/ + +namespace Erdos773 + +/-- The set of perfect squares $\{1^2, 2^2, \ldots, N^2\}$. -/ +def squaresUpTo (N : ℕ) : Finset ℕ := + (Finset.range N).image (fun i => (i + 1) ^ 2) + +/-- +Is the size of the largest Sidon subset of $\{1^2, 2^2, \ldots, N^2\}$ equal to +$N^{1-o(1)}$? That is, for every $\varepsilon > 0$, for all sufficiently large $N$, +there exists a Sidon subset of $\{1^2, 2^2, \ldots, N^2\}$ of size at least +$N^{1-\varepsilon}$. + +Known bounds: +- Lower: $|A| \gg N^{2/3}$ (Lefmann–Thiele [LeTh95]) +- Upper: $|A| \ll N / (\log N)^{1/4}$ (Alon–Erdős [AlEr85]) +-/ +@[category research open, AMS 5 11] +theorem erdos_773 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∃ A : Finset ℕ, A ⊆ squaresUpTo N ∧ IsSidon (↑A : Set ℕ) ∧ + (A.card : ℝ) ≥ (N : ℝ) ^ (1 - ε) := by + sorry + +end Erdos773 diff --git a/FormalConjectures/ErdosProblems/774.lean b/FormalConjectures/ErdosProblems/774.lean new file mode 100644 index 0000000000..97e170e414 --- /dev/null +++ b/FormalConjectures/ErdosProblems/774.lean @@ -0,0 +1,75 @@ +/- +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 774 + +Is every proportionately dissociated set of natural numbers the union of finitely many +dissociated sets? + +Pisier [Pi83] showed that proportionately dissociated sets are equivalent to Sidon sets in the +harmonic analysis sense. The analogous question for Sidon sets (in the additive combinatorics +sense) was answered negatively by Nešetřil, Rödl, and Sales [NRS24]. + +See also **Problem 328** (the Sidon set analogue). + +*Reference:* [erdosproblems.com/774](https://www.erdosproblems.com/774) + +[AlEr85] Alon, N. and Erdős, P., _An application of graph theory to additive number theory_. +European J. Combin. **6** (1985), 201–203. + +[Er92b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) **47** (1992), 231–240. + +[Pi83] Pisier, G., _Arithmetic characterizations of Sidon sets_. +Bull. Amer. Math. Soc. (N.S.) **8** (1983), 87–89. + +[NRS24] Nešetřil, J., Rödl, V., and Sales, M., _On Pisier type theorems_. +Combinatorica **44** (2024), 1211–1232. +-/ + +open Finset + +namespace Erdos774 + +/-- A set $A \subseteq \mathbb{N}$ is *dissociated* if all finite subset sums are distinct: +for any two distinct finite subsets $X \neq Y$ of $A$, $\sum X \neq \sum Y$. -/ +def Dissociated (A : Set ℕ) : Prop := + ∀ X Y : Finset ℕ, ↑X ⊆ A → ↑Y ⊆ A → X ≠ Y → X.sum id ≠ Y.sum id + +/-- A set $A \subseteq \mathbb{N}$ is *proportionately dissociated* if there exists $c > 0$ such +that every finite subset $B \subseteq A$ contains a dissociated subset of size +$\geq c \cdot |B|$. -/ +def ProportionatelyDissociated (A : Set ℕ) : Prop := + ∃ c : ℝ, c > 0 ∧ ∀ B : Finset ℕ, ↑B ⊆ A → + ∃ D : Finset ℕ, D ⊆ B ∧ Dissociated ↑D ∧ (D.card : ℝ) ≥ c * B.card + +/-- +**Erdős Problem 774** (Alon–Erdős conjecture [AlEr85]): +Is every proportionately dissociated set the union of finitely many +dissociated sets? +-/ +@[category research open, AMS 5 11] +theorem erdos_774 : answer(sorry) ↔ + ∀ A : Set ℕ, A.Infinite → + ProportionatelyDissociated A → + ∃ n : ℕ, ∃ D : Fin n → Set ℕ, + (∀ i, Dissociated (D i)) ∧ A ⊆ ⋃ i, D i := by + sorry + +end Erdos774 diff --git a/FormalConjectures/ErdosProblems/775.lean b/FormalConjectures/ErdosProblems/775.lean new file mode 100644 index 0000000000..dec60cd754 --- /dev/null +++ b/FormalConjectures/ErdosProblems/775.lean @@ -0,0 +1,89 @@ +/- +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 775 + +*Reference:* [erdosproblems.com/775](https://www.erdosproblems.com/775) + +Is there a 3-uniform hypergraph on $n$ vertices which contains at least +$n - O(1)$ different sizes of cliques (maximal complete subgraphs)? + +DISPROVED: The answer is no, as proved by Gao [Ga25]. More generally, for any +$k \geq 3$, every $k$-uniform hypergraph on $n$ vertices contains at most +$n - f_k(n)$ different sizes of cliques, where $f_k(n) \to \infty$ as $n \to \infty$. + +See also [927]. + +[Gu83] Guy, R.K., _Unsolved Problems in Number Theory_, 1983. +[Sp71] Spencer, J., _On cliques in graphs_. Israel J. Math. (1971), 419–421. +[MoMo65] Moon, J.W., Moser, L., _On cliques in graphs_. Israel J. Math. (1965), 23–28. +[Ga25] Gao, J., _On cliques in hypergraphs_. arXiv:2510.14804 (2025). +-/ + +namespace Erdos775 + +/-- A subset $S$ of vertices is complete in a $k$-uniform hypergraph $H$ if every +$k$-element subset of $S$ belongs to $H$. -/ +def IsCompleteInHypergraph {n : ℕ} (H : Finset (Finset (Fin n))) (k : ℕ) + (S : Finset (Fin n)) : Prop := + ∀ T : Finset (Fin n), T ⊆ S → T.card = k → T ∈ H + +/-- A clique in a $k$-uniform hypergraph is a maximal complete subhypergraph: +$S$ is complete and no strict superset of $S$ is complete. -/ +def IsHypergraphClique {n : ℕ} (H : Finset (Finset (Fin n))) (k : ℕ) + (S : Finset (Fin n)) : Prop := + IsCompleteInHypergraph H k S ∧ + ∀ T : Finset (Fin n), S ⊂ T → ¬IsCompleteInHypergraph H k T + +/-- The set of distinct clique sizes in a $k$-uniform hypergraph. -/ +def cliqueSizeSet {n : ℕ} (H : Finset (Finset (Fin n))) (k : ℕ) : Set ℕ := + {m : ℕ | ∃ S : Finset (Fin n), IsHypergraphClique H k S ∧ S.card = m} + +/-- +Erdős Problem 775 (DISPROVED by Gao [Ga25]): + +There is no 3-uniform hypergraph on $n$ vertices which contains at least $n - O(1)$ +different sizes of cliques. That is, there is no constant $C$ such that for all $n$, +there exists a 3-uniform hypergraph on $n$ vertices with at least $n - C$ distinct +clique sizes. + +More generally, for any $k \geq 3$, the number of distinct clique sizes in any +$k$-uniform hypergraph on $n$ vertices is at most $n - f_k(n)$ where $f_k(n) \to \infty$. +-/ +@[category research solved, AMS 5] +theorem erdos_775 : answer(False) ↔ + (∃ C : ℕ, ∀ n : ℕ, ∃ H : Finset (Finset (Fin n)), + (∀ e ∈ H, e.card = 3) ∧ + (cliqueSizeSet H 3).ncard ≥ n - C) := by + sorry + +/-- +General version of Erdős Problem 775 (Gao [Ga25]): +For any $k \geq 3$, the number of distinct clique sizes in any $k$-uniform +hypergraph on $n$ vertices is at most $n - f_k(n)$ where $f_k(n) \to \infty$. +-/ +@[category research solved, AMS 5] +theorem erdos_775_general_k : + ∀ k : ℕ, k ≥ 3 → ∃ f : ℕ → ℕ, Filter.Tendsto f Filter.atTop Filter.atTop ∧ + ∀ n : ℕ, ∀ H : Finset (Finset (Fin n)), + (∀ e ∈ H, e.card = k) → + (cliqueSizeSet H k).ncard + f n ≤ n := by + sorry + +end Erdos775 diff --git a/FormalConjectures/ErdosProblems/776.lean b/FormalConjectures/ErdosProblems/776.lean new file mode 100644 index 0000000000..2885d8b2a7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/776.lean @@ -0,0 +1,98 @@ +/- +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 776 + +*Reference:* [Gu83] Guy, R.K., _Unsolved Problems in Number Theory_, 1983; +[erdosproblems.com/776](https://www.erdosproblems.com/776) + +A problem of Erdős and Trotter. Let $r \geq 2$ and $A_1, \ldots, A_m \subseteq \{1, \ldots, n\}$ +be an antichain such that every set size that appears does so at least $r$ times. How large must +$n$ be (as a function of $r$) to ensure such a family achieves $n - 3$ distinct set sizes? + +For $r = 1$ and $n > 3$ the maximum possible number of distinct sizes is $n - 2$. For $r > 1$ and +$n$ sufficiently large, $n - 3$ is achievable but $n - 2$ is never achievable. +-/ + +namespace Erdos776 + +/-- Every size that appears in the family appears at least $r$ times. -/ +def HasMinMultiplicity (F : Finset (Finset ℕ)) (r : ℕ) : Prop := + ∀ t : ℕ, (∃ A ∈ F, A.card = t) → + r ≤ (F.filter (fun A => A.card = t)).card + +/-- The number of distinct sizes of sets in the family. -/ +def numDistinctSizes (F : Finset (Finset ℕ)) : ℕ := + (F.image Finset.card).card + +/-- All sets in the family are subsets of $\{0, \ldots, n-1\}$. -/ +def AllSubsetsOfRange (F : Finset (Finset ℕ)) (n : ℕ) : Prop := + ∀ A ∈ F, ∀ x ∈ A, x < n + +/-- +Erdős Problem 776: +For every $r \geq 2$, there exists $N_0$ such that for all $n \geq N_0$ there is an antichain +$F$ of subsets of $\{0, \ldots, n-1\}$ in which every size class has at least $r$ members +and the family achieves exactly $n - 3$ distinct sizes of sets. + +The problem asks for the growth rate of $N_0$ as a function of $r$. +-/ +@[category research open, AMS 5] +theorem erdos_776 : + ∀ r : ℕ, r ≥ 2 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ F : Finset (Finset ℕ), + AllSubsetsOfRange F n ∧ + IsAntichain (· ⊆ ·) (F : Set (Finset ℕ)) ∧ + HasMinMultiplicity F r ∧ + numDistinctSizes F = n - 3 := by + sorry + +/-- +For $r = 1$ and $n > 3$, an antichain of subsets of $\{0, \ldots, n-1\}$ can achieve +at most $n - 2$ distinct sizes, and this is tight. +-/ +@[category research solved, AMS 5] +theorem erdos_776.variants.r_eq_1 : + ∀ n : ℕ, n > 3 → + (∃ F : Finset (Finset ℕ), + AllSubsetsOfRange F n ∧ + IsAntichain (· ⊆ ·) (F : Set (Finset ℕ)) ∧ + numDistinctSizes F = n - 2) ∧ + (∀ F : Finset (Finset ℕ), + AllSubsetsOfRange F n → + IsAntichain (· ⊆ ·) (F : Set (Finset ℕ)) → + numDistinctSizes F ≤ n - 2) := by + sorry + +/-- +For $r \geq 2$, no antichain with minimum multiplicity $r$ can achieve $n - 2$ +distinct sizes (for any $n$). +-/ +@[category research solved, AMS 5] +theorem erdos_776.variants.upper_bound : + ∀ r : ℕ, r ≥ 2 → ∀ n : ℕ, + ∀ F : Finset (Finset ℕ), + AllSubsetsOfRange F n → + IsAntichain (· ⊆ ·) (F : Set (Finset ℕ)) → + HasMinMultiplicity F r → + numDistinctSizes F ≠ n - 2 := by + sorry + +end Erdos776 diff --git a/FormalConjectures/ErdosProblems/777.lean b/FormalConjectures/ErdosProblems/777.lean new file mode 100644 index 0000000000..7c40e19846 --- /dev/null +++ b/FormalConjectures/ErdosProblems/777.lean @@ -0,0 +1,95 @@ +/- +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 777 + +*Reference:* [erdosproblems.com/777](https://www.erdosproblems.com/777) + +Three questions of Daykin and Erdős on comparability graphs of families of subsets. + +The first question was answered affirmatively by Alon, Das, Glebov, and Sudakov. +The second question was answered negatively by Alon and Frankl. +The third question was answered affirmatively by Alon and Frankl. + +[Gu83] Guy, R.K., _Unsolved Problems in Number Theory_, 1983. +[ADGS15] Alon, N., Das, S., Glebov, R., Sudakov, B., _Comparable pairs in families of sets_. + J. Combin. Theory Ser. B **114** (2015), 164–185. +[AlFr85] Alon, N., Frankl, P., _The maximum number of disjoint pairs in a family of subsets_. + Graphs Combin. **1** (1985), 13–21. +-/ + +namespace Erdos777 + +/-- +The number of edges of the comparability graph of a family $F$ of subsets of +$\mathrm{Fin}(n)$: counts pairs $(A, B)$ in $F \times F$ with $A \subsetneq B$. +Since the filter is asymmetric ($A \subsetneq B$ does not imply $B \subsetneq A$), +each unordered comparable pair is counted exactly once. +-/ +def comparableEdges (n : ℕ) (F : Finset (Finset (Fin n))) : ℕ := + ((F ×ˢ F).filter (fun p => p.1 ≠ p.2 ∧ p.1 ⊆ p.2)).card + +/-- +**Erdős Problem 777, Question 1** (solved, affirmative — Alon–Das–Glebov–Sudakov): + +For all $\varepsilon > 0$, if $n$ is sufficiently large and $F$ is a family of at most +$\lfloor (2 - \varepsilon) \cdot 2^{n/2} \rfloor$ subsets of $\{0, \ldots, n-1\}$, then the +comparability graph of $F$ has fewer than $2^n$ edges. +-/ +@[category research solved, AMS 5] +theorem erdos_777 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → ε < 2 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ F : Finset (Finset (Fin n)), + (F.card : ℝ) ≤ (2 - ε) * (2 : ℝ) ^ ((n : ℝ) / 2) → + comparableEdges n F < 2 ^ n := by + sorry + +/-- +**Erdős Problem 777, Question 2** (solved, negative — Alon–Frankl): + +Is it true that if the comparability graph of $F$ has at least $c \cdot |F|^2$ edges, +then $|F| \ll_c 2^{n/2}$? The answer is no. +-/ +@[category research solved, AMS 5] +theorem erdos_777.variants.q2 : answer(False) ↔ + ∀ c : ℝ, c > 0 → + ∃ C : ℝ, C > 0 ∧ + ∀ (n : ℕ) (F : Finset (Finset (Fin n))), + (comparableEdges n F : ℝ) ≥ c * (F.card : ℝ) ^ 2 → + (F.card : ℝ) ≤ C * (2 : ℝ) ^ ((n : ℝ) / 2) := by + sorry + +/-- +**Erdős Problem 777, Question 3** (solved, affirmative — Alon–Frankl): + +For all $\varepsilon > 0$, there exists $\delta > 0$ such that for all $n$ and every family $F$ of +subsets of $\{0, \ldots, n-1\}$, if the number of comparable pairs exceeds $|F|^{2 - \delta}$, +then $|F| < (2 + \varepsilon)^{n/2}$. +-/ +@[category research solved, AMS 5] +theorem erdos_777.variants.q3 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ δ : ℝ, δ > 0 ∧ + ∀ (n : ℕ) (F : Finset (Finset (Fin n))), + (comparableEdges n F : ℝ) > (F.card : ℝ) ^ ((2 : ℝ) - δ) → + (F.card : ℝ) < ((2 : ℝ) + ε) ^ ((n : ℝ) / 2) := by + sorry + +end Erdos777 diff --git a/FormalConjectures/ErdosProblems/778.lean b/FormalConjectures/ErdosProblems/778.lean new file mode 100644 index 0000000000..a5342095ec --- /dev/null +++ b/FormalConjectures/ErdosProblems/778.lean @@ -0,0 +1,112 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 778 + +*Reference:* [erdosproblems.com/778](https://www.erdosproblems.com/778) + +Alice and Bob play a game on the edges of $K_n$, alternating colouring edges +by red (Alice) and blue (Bob). Alice goes first, and wins if at the end +the largest red clique is larger than any of the blue cliques. + +Malekshahian and Spiro [MaSp24] proved that for the first game, the set of $n$ +for which Bob wins has density at least $3/4$. + +[Gu83] Guy, R.K., _Unsolved Problems in Number Theory_, 1983. + +[MaSp24] Malekshahian, A. and Spiro, S., _On a clique-building game of Erdős_. arXiv:2410.18304 (2024). +-/ + +open SimpleGraph + +namespace Erdos778 + +/-- A game state in the edge-coloring game on $K_n$: + tracks which edges are colored red (Alice) and blue (Bob). -/ +structure GameState (n : ℕ) where + red : Finset (Sym2 (Fin n)) + blue : Finset (Sym2 (Fin n)) +deriving Inhabited + +/-- A strategy for a player in the edge-coloring game: + given the current game state, choose the next edge to color. -/ +def Strategy (n : ℕ) := GameState n → Sym2 (Fin n) + +/-- Play the standard edge-coloring game on $K_n$ (alternating, one edge each, Alice first) + to completion. Returns the final game state with all edges colored. -/ +opaque playStandardGame (n : ℕ) (alice bob : Strategy n) : GameState n + +/-- Play the modified (1-vs-2) game on $K_n$ (Alice colors one edge, then Bob colors two, + repeating) to completion. Returns the final game state with all edges colored. -/ +opaque playModifiedGame (n : ℕ) (alice bob : Strategy n) : GameState n + +/-- +Erdős Problem 778, Part 1 [Gu83]: + +Does Bob have a winning strategy in the standard edge-coloring game on $K_n$ +(alternating, Alice first) for all $n \geq 3$? That is, can he ensure his largest +blue clique is at least as large as Alice's largest red clique? +-/ +@[category research open, AMS 5 91] +theorem erdos_778 : answer(sorry) ↔ + ∀ n : ℕ, 3 ≤ n → + ∃ bob : Strategy n, + ∀ alice : Strategy n, + let final := playStandardGame n alice bob + cliqueNum (fromEdgeSet (final.blue : Set (Sym2 (Fin n)))) ≥ + cliqueNum (fromEdgeSet (final.red : Set (Sym2 (Fin n)))) := by + sorry + +/-- +Erdős Problem 778, Part 2 [Gu83]: + +In the modified game on $K_n$ where Alice colors one edge (red) and Bob colors two edges +(blue) per round, does Bob have a winning strategy for all $n > 3$? That is, can he ensure his +largest blue clique is strictly larger than Alice's largest red clique? +-/ +@[category research open, AMS 5 91] +theorem erdos_778.variants.modified_game : answer(sorry) ↔ + ∀ n : ℕ, 3 < n → + ∃ bob : Strategy n, + ∀ alice : Strategy n, + let final := playModifiedGame n alice bob + cliqueNum (fromEdgeSet (final.blue : Set (Sym2 (Fin n)))) > + cliqueNum (fromEdgeSet (final.red : Set (Sym2 (Fin n)))) := by + sorry + +/-- +Erdős Problem 778, Variant 3 (max-degree game) [Gu83]: + +In the standard edge-coloring game on $K_n$ (alternating, Alice first), Alice wins if the +maximum degree of the red subgraph exceeds the maximum degree of the blue subgraph. Does Bob +have a winning strategy for all sufficiently large $n$? Malekshahian and Spiro [MaSp24] proved +that the set of $n$ for which Bob wins has density at least $2/3$. +-/ +@[category research open, AMS 5 91] +theorem erdos_778.variants.max_degree_game : answer(sorry) ↔ + ∀ n : ℕ, 3 ≤ n → + ∃ bob : Strategy n, + ∀ alice : Strategy n, + let final := playStandardGame n alice bob + (fromEdgeSet (final.blue : Set (Sym2 (Fin n)))).maxDegree ≥ + (fromEdgeSet (final.red : Set (Sym2 (Fin n)))).maxDegree := by + sorry + +end Erdos778 diff --git a/FormalConjectures/ErdosProblems/78.lean b/FormalConjectures/ErdosProblems/78.lean new file mode 100644 index 0000000000..486029abdc --- /dev/null +++ b/FormalConjectures/ErdosProblems/78.lean @@ -0,0 +1,121 @@ +/- +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 78 + +*Reference:* [erdosproblems.com/78](https://www.erdosproblems.com/78) + +Give a constructive proof that $R(k) > C^k$ for some constant $C > 1$, where $R(k)$ is the +diagonal Ramsey number. Erdős's probabilistic proof that $R(k) \gg k \cdot 2^{k/2}$ is +non-constructive. Prize: \$100. + +Partial progress: Cohen [Co15] constructed a graph on $n$ vertices with no clique or independent +set of size $\geq 2^{(\log \log n)^C}$. Li [Li23b] improved this to $(\log n)^C$. + +See also OEIS sequence A059442 and related problems #77, #1029. + +[Er69b] Erdős, P., _Some applications of Ramsey's theorem to additive number theory_. +European J. Combin. (1969). + +[Er71] Erdős, P., _On some extremal problems on r-graphs_. Discrete Math. **1** (1971), 1–6. + +[Er88] Erdős, P., _Problems and results on chromatic numbers in finite and infinite graphs_. +Graph Theory with Applications to Algorithms and Computer Science (1988). + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is Eighty, +Vol. 2 (1993), p. 337. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Congressus Numerantium **107** (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Va99] Vaughan, R. C., _On the number of monochromatic complete subgraphs_. (1999), 3.49. + +[Co15] Cohen, D., _Two-source dispersers for polylogarithmic entropy and improved Ramsey +graphs_. (2015). + +[Li23b] Li, Z., _Explicit Ramsey graphs and two-source extractors_. (2023). +-/ + +open SimpleGraph + +namespace Erdos78 + +/-- +Erdős Problem 78 (Open, \$100 prize): + +Let $R(k)$ be the Ramsey number for $K_k$, the minimal $n$ such that every +2-colouring of the edges of $K_n$ contains a monochromatic copy of $K_k$. +Give a constructive proof that $R(k) > C^k$ for some constant $C > 1$. + +Erdős gave a simple probabilistic (non-constructive) proof that +$R(k) \gg k \cdot 2^{k/2}$. This problem asks for an explicit/constructive +lower bound that is still exponential in $k$. + +Equivalently, this asks for an explicit construction of a graph on $n$ +vertices which does not contain any clique or independent set of size +$\geq c \cdot \log(n)$ for some constant $c > 0$. + +We formalize the core mathematical content: there exists $C > 1$ such that +for all $k \geq 2$, there exists a graph on at least $C^k$ vertices with no +clique or independent set of size $k$ (an independent set of size $k$ in $G$ +is equivalent to a clique of size $k$ in the complement $G^c$, by +`SimpleGraph.isClique_compl`). The "constructive" requirement pertains +to the nature of the proof, not the formal statement itself. +-/ +@[category research open, AMS 5] +theorem erdos_78 : + ∃ C : ℝ, C > 1 ∧ ∀ k : ℕ, k ≥ 2 → + ∃ n : ℕ, (C ^ k : ℝ) ≤ ↑n ∧ + ∃ G : SimpleGraph (Fin n), + G.CliqueFree k ∧ Gᶜ.CliqueFree k := by + sorry + +/-- +Erdős Problem 78 — $o(\sqrt{n})$ variant [Er69b]: + +Erdős also asked for an explicit construction of a graph on $n$ vertices +with no clique or independent set of size $o(\sqrt{n})$. This is weaker +than the full exponential lower bound. The website notes this is now known. +-/ +@[category research solved, AMS 5] +theorem erdos_78_variant_sqrt : + ∃ (f : ℕ → ℕ), (∀ n, f n < n) ∧ + Filter.Tendsto (fun n => (f n : ℝ) / n ^ (1/2 : ℝ)) Filter.atTop (nhds 0) ∧ + ∀ n, ∃ G : SimpleGraph (Fin n), G.CliqueFree (f n) ∧ Gᶜ.CliqueFree (f n) := by + sorry + +/-- +Erdős Problem 78 — logarithmic formulation: + +Equivalently, there exists a constant $c > 0$ such that for all $n \geq 2$, +there is a graph on $n$ vertices with no clique or independent set of size +$\geq c \cdot \log(n)$. This is logically equivalent to `erdos_78` but +phrased in the "construct a graph on $n$ vertices" framing. +-/ +@[category research open, AMS 5] +theorem erdos_78_log : + ∃ c : ℝ, c > 0 ∧ ∀ n : ℕ, n ≥ 2 → + ∃ G : SimpleGraph (Fin n), + G.CliqueFree ⌈c * Real.log n⌉₊ ∧ Gᶜ.CliqueFree ⌈c * Real.log n⌉₊ := by + sorry + +end Erdos78 diff --git a/FormalConjectures/ErdosProblems/780.lean b/FormalConjectures/ErdosProblems/780.lean new file mode 100644 index 0000000000..83a17813ec --- /dev/null +++ b/FormalConjectures/ErdosProblems/780.lean @@ -0,0 +1,83 @@ +/- +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 780 + +*Reference:* [erdosproblems.com/780](https://www.erdosproblems.com/780) + +Suppose $n \geq kr + (t-1)(k-1)$ and the edges of the complete $r$-uniform hypergraph +on $n$ vertices are $t$-coloured. Prove that some colour class must contain $k$ pairwise +disjoint edges. + +In other words, this problem asks to determine the chromatic number of the Kneser +hypergraph. The bound is best possible. + +When $k = 2$ this was conjectured by Kneser and proved by Lovász [Lo78]. +The general case was proved by Alon, Frankl, and Lovász [AFL86]. + +[Er76] Erdős, P., _Problems and results in graph theory and combinatorics_ (1976). + +[Lo78] Lovász, L., _Kneser's conjecture, chromatic number, and homotopy_. J. Combin. +Theory Ser. A **25** (1978), 319--324. + +[AFL86] Alon, N., Frankl, P., and Lovász, L., _The chromatic number of Kneser +hypergraphs_. Trans. Amer. Math. Soc. **298** (1986), 359--370. +-/ + +namespace Erdos780 + +/-- +**Erdős Problem 780** (PROVED — Alon, Frankl, Lovász [AFL86]): + +If $n \geq kr + (t-1)(k-1)$ and the edges of the complete $r$-uniform hypergraph +on $n$ vertices are $t$-coloured, then some colour class contains $k$ pairwise +disjoint edges. + +Here an "edge" of the complete $r$-uniform hypergraph on $\text{Fin}\; n$ is an +$r$-element subset of $\text{Fin}\; n$, and "$t$-coloured" means we have a colouring +function from these edges to $\text{Fin}\; t$. +-/ +@[category research solved, AMS 5] +theorem erdos_780 + (k r t : ℕ) (hk : k ≥ 1) (hr : r ≥ 1) (ht : t ≥ 1) + (n : ℕ) (hn : n ≥ k * r + (t - 1) * (k - 1)) + (c : {s : Finset (Fin n) // s.card = r} → Fin t) : + ∃ (i : Fin t) (edges : Fin k → {s : Finset (Fin n) // s.card = r}), + (∀ j, c (edges j) = i) ∧ + (∀ j₁ j₂, j₁ ≠ j₂ → Disjoint (edges j₁).val (edges j₂).val) := by + sorry + +/-- +**Erdős Problem 780 — Sharpness:** + +The bound in `erdos_780` is tight: when `n = k * r + (t - 1) * (k - 1) - 1`, +there exists a $t$-colouring of the complete $r$-uniform hypergraph on $n$ vertices +such that no colour class contains $k$ pairwise disjoint edges. +-/ +@[category research solved, AMS 5] +theorem erdos_780_tight + (k r t : ℕ) (hk : k ≥ 2) (hr : r ≥ 1) (ht : t ≥ 2) + (n : ℕ) (hn : n = k * r + (t - 1) * (k - 1) - 1) : + ∃ (c : {s : Finset (Fin n) // s.card = r} → Fin t), + ∀ (i : Fin t) (edges : Fin k → {s : Finset (Fin n) // s.card = r}), + (∀ j, c (edges j) = i) → + ¬(∀ j₁ j₂, j₁ ≠ j₂ → Disjoint (edges j₁).val (edges j₂).val) := by + sorry + +end Erdos780 diff --git a/FormalConjectures/ErdosProblems/781.lean b/FormalConjectures/ErdosProblems/781.lean new file mode 100644 index 0000000000..d793e19180 --- /dev/null +++ b/FormalConjectures/ErdosProblems/781.lean @@ -0,0 +1,93 @@ +/- +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 781 + +*Reference:* [erdosproblems.com/781](https://www.erdosproblems.com/781) + +Let $f(k)$ be the minimal $n$ such that any 2-colouring of $\{1,\ldots,n\}$ contains +a monochromatic $k$-term descending wave: a sequence $x_1 < \cdots < x_k$ such that, +for $1 < j < k$, $x_j \geq (x_{j+1} + x_{j-1}) / 2$. + +A problem of Brown, Erdős, and Freedman [BEF90], who proved +$k^2 - k + 1 \leq f(k) \leq (k^3 - 4k + 9) / 3$. +They conjectured $f(k) = k^2 - k + 1$ for all $k$. +Disproved by Alon and Spencer [AlSp89] who proved $f(k) \gg k^3$. + +[BEF90] Brown, T. C., Erdős, P., and Freedman, A. R., _Quasi-progressions and descending +waves_. J. Combin. Theory Ser. A **53** (1990), 81-95. + +[AlSp89] Alon, N. and Spencer, J., _Ascending waves_. J. Combin. Theory Ser. A **52** +(1989), 275-287. +-/ + +namespace Erdos781 + +/-- A $k$-term descending wave in $\{0, \ldots, n-1\}$: a strictly increasing sequence +$x : \mathrm{Fin}\; k \to \mathrm{Fin}\; n$ such that for every interior index $j$ +($0 < j$ and $j+1 < k$), $2 x(j) \geq x(j+1) + x(j-1)$. + +Equivalently, the gaps $x(j+1) - x(j)$ are non-increasing. -/ +def IsDescendingWave (k n : ℕ) (x : Fin k → Fin n) : Prop := + StrictMono x ∧ + ∀ (j : Fin k) (_ : 0 < j.val) (hj : j.val + 1 < k), + 2 * (x j).val ≥ (x ⟨j.val + 1, hj⟩).val + (x ⟨j.val - 1, by omega⟩).val + +/-- A 2-colouring of $\{0, \ldots, n-1\}$ contains a monochromatic $k$-term +descending wave. -/ +def HasMonochromaticDescendingWave (k n : ℕ) (c : Fin n → Bool) : Prop := + ∃ x : Fin k → Fin n, IsDescendingWave k n x ∧ + ∃ a : Bool, ∀ i : Fin k, c (x i) = a + +/-- $f(k)$: the minimal $n$ such that every 2-colouring of $\{0, \ldots, n-1\}$ contains +a monochromatic $k$-term descending wave. -/ +noncomputable def descendingWaveNumber (k : ℕ) : ℕ := + sInf {n : ℕ | ∀ c : Fin n → Bool, HasMonochromaticDescendingWave k n c} + +/-- +Alon–Spencer [AlSp89]: $f(k) \gg k^3$. + +There exists $C > 0$ such that for all sufficiently large $k$, +$f(k) \geq C \cdot k^3$. This disproves the conjecture that $f(k) = k^2 - k + 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_781 : + ∃ C : ℝ, C > 0 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (descendingWaveNumber k : ℝ) ≥ C * (k : ℝ) ^ 3 := by + sorry + +/-- +Erdős Problem 781, lower bound [BEF90]: +For all $k \geq 1$, $f(k) \geq k^2 - k + 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_781.variants.bef_lower_bound (k : ℕ) (hk : k ≥ 1) : + descendingWaveNumber k ≥ k ^ 2 - k + 1 := by + sorry + +/-- +Erdős Problem 781, upper bound [BEF90]: +For all $k \geq 2$, $f(k) \leq (k^3 - 4k + 9) / 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_781.variants.bef_upper_bound (k : ℕ) (hk : k ≥ 2) : + descendingWaveNumber k ≤ (k ^ 3 - 4 * k + 9) / 3 := by + sorry + +end Erdos781 diff --git a/FormalConjectures/ErdosProblems/782.lean b/FormalConjectures/ErdosProblems/782.lean new file mode 100644 index 0000000000..ace3e73a99 --- /dev/null +++ b/FormalConjectures/ErdosProblems/782.lean @@ -0,0 +1,80 @@ +/- +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 782 + +*Reference:* [erdosproblems.com/782](https://www.erdosproblems.com/782) + +A question of Brown, Erdős, and Freedman [BEF90]. It is a classical fact that +the squares do not contain arithmetic progressions of length 4. An affirmative +answer to the first question implies an affirmative answer to the second. + +Solymosi [So07] conjectured that the answer to Part 2 is no. Cilleruelo and +Granville [CiGr07] showed that the answer to Part 2 is no conditional on the +Bombieri–Lang conjecture. + +[BEF90] Brown, T. C., Erdős, P., and Freedman, A. R., _Quasi-progressions and +descending waves_. J. Combin. Theory Ser. A 53 (1990), no. 1, 81-95. +[So07] Solymosi, J., _Elementary additive combinatorics_. Additive Combinatorics, +CRM Proc. Lecture Notes **43** (2007), 29-38. +[CiGr07] Cilleruelo, J. and Granville, A., _Lattice points on circles, squares in +arithmetic progressions and sumsets of squares_. Additive Combinatorics, CRM Proc. +Lecture Notes **43** (2007), 241-262. +-/ + +open Finset + +open scoped BigOperators + +namespace Erdos782 + +/-- +Erdős Problem 782, Part 1 (Quasi-progressions in the squares) [BEF90]: + +There exists a constant $C$ such that for any $k \geq 2$, one can find $k$ perfect +squares $x_1 < x_2 < \cdots < x_k$ forming a quasi-progression with gap $d$, meaning +$x_i + d \leq x_{i+1} \leq x_i + d + C$ for all consecutive pairs. +-/ +@[category research open, AMS 5 11] +theorem erdos_782 : answer(sorry) ↔ + ∃ C : ℕ, ∀ k : ℕ, k ≥ 2 → + ∃ (x : Fin k → ℕ) (d : ℕ), d > 0 ∧ + (∀ i, IsSquare (x i)) ∧ + (∀ i j : Fin k, i < j → x i < x j) ∧ + (∀ (i : ℕ) (hi : i + 1 < k), + x ⟨i, by omega⟩ + d ≤ x ⟨i + 1, hi⟩ ∧ + x ⟨i + 1, hi⟩ ≤ x ⟨i, by omega⟩ + d + C) := by + sorry + +/-- +Erdős Problem 782, Part 2 (Combinatorial cubes in the squares) [BEF90]: + +For any $m$, the set of perfect squares contains a combinatorial cube of +dimension $m$: there exist $a$ and positive $b_1, \ldots, b_m$ such that +$a + \sum_{i \in S} b_i$ is a perfect square for every subset +$S \subseteq \{1, \ldots, m\}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_782.variants.cubes : answer(sorry) ↔ + ∀ m : ℕ, ∃ (a : ℕ) (b : Fin m → ℕ), + (∀ i, b i > 0) ∧ + (∀ S : Finset (Fin m), IsSquare (a + ∑ i ∈ S, b i)) := by + sorry + +end Erdos782 diff --git a/FormalConjectures/ErdosProblems/783.lean b/FormalConjectures/ErdosProblems/783.lean new file mode 100644 index 0000000000..063a531685 --- /dev/null +++ b/FormalConjectures/ErdosProblems/783.lean @@ -0,0 +1,84 @@ +/- +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 783 + +*Reference:* [erdosproblems.com/783](https://www.erdosproblems.com/783) + +Fix some constant $C > 0$ and let $N$ be large. Let $A \subseteq \{2, \ldots, N\}$ be such that +$(a, b) = 1$ for all $a \neq b \in A$ and $\sum_{n \in A} 1/n \leq C$. + +What choice of such an $A$ minimises the number of integers $m \leq N$ not divisible +by any $a \in A$? + +Erdős suggests the optimal set is consecutive largest primes up to $N$. +Tao conjectures the minimum is $(\rho(e^C) + o(1))N$ where $\rho$ is the Dickman function. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[ErRu80] Erdős, P., Ruzsa, I. Z., _On the small sieve. I. Sifting by primes_. J. Number Theory +(1980), 385–394. + +[Hi87b] Hildebrand, A., _Quantitative mean value theorems for nonnegative multiplicative +functions. II_. Acta Arith. (1987), 209–260. +-/ + +open Finset BigOperators + +namespace Erdos783 + +/-- The Dickman rho function, the unique continuous function $\rho : \mathbb{R} \to \mathbb{R}$ +satisfying $\rho(u) = 1$ for $0 \leq u \leq 1$ and $u \cdot \rho'(u) = -\rho(u-1)$ for +$u > 1$. -/ +noncomputable opaque dickmanRho : ℝ → ℝ + +/-- Count of integers in $\{1, \ldots, N\}$ not divisible by any element of $A$. -/ +def unsievedCount (N : ℕ) (A : Finset ℕ) : ℕ := + (Finset.Icc 1 N).filter + (fun m => ∀ a ∈ A, ¬(a ∣ m)) |>.card + +/-- +Erdős Problem 783 (Tao's formulation): + +For any $C > 0$, the minimum number of integers in $\{1, \ldots, N\}$ not divisible by +any element of a pairwise coprime set $A \subseteq \{2, \ldots, N\}$ with +$\sum_{a \in A} 1/a \leq C$ is asymptotically $\rho(e^C) \cdot N$, where $\rho$ is the +Dickman function. + +That is, for every $\varepsilon > 0$ and large enough $N$: +(1) There exists a valid $A$ with unsieved count $\leq (\rho(e^C) + \varepsilon) \cdot N$. +(2) Every valid $A$ has unsieved count $\geq (\rho(e^C) - \varepsilon) \cdot N$. +-/ +@[category research open, AMS 11] +theorem erdos_783 (C : ℝ) (hC : C > 0) : + ∀ ε > 0, ∃ N₀ : ℕ, ∀ N ≥ N₀, + (∃ (A : Finset ℕ), + (∀ a ∈ A, 2 ≤ a ∧ a ≤ N) ∧ + (∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.Coprime a b) ∧ + (∑ a ∈ A, (1 : ℝ) / (a : ℝ) ≤ C) ∧ + (unsievedCount N A : ℝ) ≤ (dickmanRho (Real.exp C) + ε) * ↑N) ∧ + (∀ (A : Finset ℕ), + (∀ a ∈ A, 2 ≤ a ∧ a ≤ N) → + (∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.Coprime a b) → + (∑ a ∈ A, (1 : ℝ) / (a : ℝ) ≤ C) → + (dickmanRho (Real.exp C) - ε) * ↑N ≤ (unsievedCount N A : ℝ)) := by + sorry + +end Erdos783 diff --git a/FormalConjectures/ErdosProblems/784.lean b/FormalConjectures/ErdosProblems/784.lean new file mode 100644 index 0000000000..98a8a01828 --- /dev/null +++ b/FormalConjectures/ErdosProblems/784.lean @@ -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 784 + +For every $C > 0$, does every subset $A \subseteq \{2, \ldots, x\}$ with +$\sum_{a \in A} 1/a \le C$ leave at least $K \cdot x / (\log x)^c$ integers in $[1, x]$ +undivided by any element of $A$? Resolved: true for $0 < C \le 1$ [Ru82] [Sa98], +false for $C > 1$ [Ru82] [We25]. + +*Reference:* [erdosproblems.com/784](https://www.erdosproblems.com/784) + +See also Problem 542. + +[Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[ScSz59] Schinzel, A., Szekeres, G., _Sur un problème de M. Paul Erdős_. +Acta Sci. Math. (Szeged) (1959), 221–229. + +[Ru82] Ruzsa, I., _On the small sieve. II. Sifting by composite numbers_, +J. Number Theory (1982), 260–268. + +[Sa98] Saias, E., _Applications des entiers à diviseurs denses_, Acta Arith. (1998), 225–240. + +[We25] Weingartner, A., _The Schinzel–Szekeres function_, Res. Number Theory (2025), +Paper No. 63, 32 pp. +-/ + +open Finset BigOperators Real + +namespace Erdos784 + +/-- +Erdős Problem 784: + +For every $C > 0$, does there exist $c > 0$ and a constant $K > 0$ such that for all +sufficiently large $x$, every $A \subseteq \{2, \ldots, x\}$ with +$\sum_{a \in A} 1/a \le C$ satisfies +$$\#\{m \le x : a \nmid m \text{ for all } a \in A\} \ge K \cdot x / (\log x)^c ?$$ + +Resolved: true for $0 < C \le 1$ [Ru82] [Sa98], false for $C > 1$ [Ru82] [We25]. +-/ +@[category research solved, AMS 11] +theorem erdos_784 : + answer(False) ↔ + ∀ C : ℝ, C > 0 → + ∃ c : ℝ, c > 0 ∧ + ∃ K : ℝ, K > 0 ∧ + ∃ x₀ : ℕ, ∀ x : ℕ, x ≥ x₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 2 ≤ a ∧ a ≤ x) → + (∑ a ∈ A, (1 : ℝ) / (a : ℝ)) ≤ C → + (((Finset.Icc 1 x).filter (fun m => ∀ a ∈ A, ¬(a ∣ m))).card : ℝ) ≥ + K * (x : ℝ) / (Real.log (x : ℝ)) ^ c := by + sorry + +/-- +Erdős Problem 784 (positive case): + +For $0 < C \le 1$, there exist $c > 0$ and $K > 0$ such that for all sufficiently large $x$, +every $A \subseteq \{2, \ldots, x\}$ with $\sum_{a \in A} 1/a \le C$ satisfies +$$\#\{m \le x : a \nmid m \text{ for all } a \in A\} \ge K \cdot x / (\log x)^c.$$ + +Proved by Ruzsa [Ru82] (lower bound) and Saias [Sa98] (upper bound), giving +$H_1(x) \asymp x / \log x$. +-/ +@[category research solved, AMS 11] +theorem erdos_784_small_C : + ∀ C : ℝ, 0 < C → C ≤ 1 → + ∃ c : ℝ, c > 0 ∧ + ∃ K : ℝ, K > 0 ∧ + ∃ x₀ : ℕ, ∀ x : ℕ, x ≥ x₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 2 ≤ a ∧ a ≤ x) → + (∑ a ∈ A, (1 : ℝ) / (a : ℝ)) ≤ C → + (((Finset.Icc 1 x).filter (fun m => ∀ a ∈ A, ¬(a ∣ m))).card : ℝ) ≥ + K * (x : ℝ) / (Real.log (x : ℝ)) ^ c := by + sorry + +end Erdos784 diff --git a/FormalConjectures/ErdosProblems/785.lean b/FormalConjectures/ErdosProblems/785.lean new file mode 100644 index 0000000000..a3104e6c58 --- /dev/null +++ b/FormalConjectures/ErdosProblems/785.lean @@ -0,0 +1,98 @@ +/- +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 785 + +*Reference:* [erdosproblems.com/785](https://www.erdosproblems.com/785) + +Let $A, B \subseteq \mathbb{N}$ be infinite sets such that $A + B$ contains all large integers. +Let $A(x) = |A \cap [1, x]|$ and similarly for $B(x)$. Is it true that if +$A(x)B(x) \sim x$ then $A(x)B(x) - x \to \infty$ as $x \to \infty$? + +Such sets $A$ and $B$ (with all large integers in $A + B$ and $A(x)B(x) \sim x$) are +called exact additive complements. Danzer [Da64] proved that exact additive complements exist. + +The answer is yes, proved by Sárközy and Szemerédi [SaSz94]. +Ruzsa [Ru17] has constructed, for any function $w(x) \to \infty$, such a pair +of sets with $A(x)B(x) - x < w(x)$ for infinitely many $x$. + +Chen and Fang [ChFa15] strengthened the result, showing that +$A(x)B(x) - x \ll A(x)^c$ cannot hold for any constant $c > 0$. +Narkiewicz [Na59] proved that $A(2x)/A(x) \to 1$ and $B(2x)/B(x) \to 2$ +for exact additive complements. + +[SaSz94] Sárközy, A., Szemerédi, E., _On a problem in additive number theory_. +Acta Mathematica Hungarica **65** (1994), 237–245. + +[Ru17] Ruzsa, I. Z., _Exact additive complements_. +Quarterly Journal of Mathematics **68** (2017), 227–235. + +[Da64] Danzer, L., _Über eine Frage von G. Hanani aus der additiven Zahlentheorie_. +Journal für die Reine und Angewandte Mathematik **214** (1964), 392–394. + +[ChFa15] Chen, Y.-G., Fang, J.-H., _On a conjecture of Sárközy and Szemerédi_. +Acta Arithmetica **169** (2015), 47–58. + +[Na59] Narkiewicz, W. (1959). +-/ + +open scoped Classical +open Filter + +namespace Erdos785 + +/-- Counting function: $|A \cap \{1, \ldots, x\}|$ -/ +noncomputable def countingFn (A : Set ℕ) (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter (· ∈ A)).card + +/-- +**Erdős Problem 785** (Sárközy and Szemerédi [SaSz94]): + +Let $A, B \subseteq \mathbb{N}$ be infinite sets such that $A + B$ contains all sufficiently +large integers (i.e., $A$ and $B$ are additive complements). If $A(x)B(x) \sim x$ +(exact additive complements), then $A(x)B(x) - x \to \infty$ as $x \to \infty$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_785 : answer(True) ↔ + ∀ (A B : Set ℕ), Set.Infinite A → Set.Infinite B → + (∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ∃ a ∈ A, ∃ b ∈ B, a + b = n) → + Tendsto (fun x : ℕ => (countingFn A x * countingFn B x : ℝ) / (x : ℝ)) + atTop (nhds 1) → + Tendsto (fun x : ℕ => (countingFn A x * countingFn B x : ℝ) - (x : ℝ)) + atTop atTop := by + sorry + +/-- +**Ruzsa's construction [Ru17]:** + +For any function $w(x) \to \infty$, there exist exact additive complements $A, B$ such that +$A(x)B(x) - x < w(x)$ for infinitely many $x$. This shows that the divergence in `erdos_785` +can be arbitrarily slow. +-/ +@[category research solved, AMS 5 11] +theorem erdos_785_ruzsa_sharpness : + ∀ w : ℕ → ℝ, Tendsto w atTop atTop → + ∃ (A B : Set ℕ), Set.Infinite A ∧ Set.Infinite B ∧ + (∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ∃ a ∈ A, ∃ b ∈ B, a + b = n) ∧ + Tendsto (fun x : ℕ => (countingFn A x * countingFn B x : ℝ) / (x : ℝ)) + atTop (nhds 1) ∧ + ∃ᶠ x in atTop, (countingFn A x * countingFn B x : ℝ) - (x : ℝ) < w x := by + sorry + +end Erdos785 diff --git a/FormalConjectures/ErdosProblems/787.lean b/FormalConjectures/ErdosProblems/787.lean new file mode 100644 index 0000000000..0b1ad42399 --- /dev/null +++ b/FormalConjectures/ErdosProblems/787.lean @@ -0,0 +1,94 @@ +/- +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 787 + +*Reference:* [erdosproblems.com/787](https://www.erdosproblems.com/787) + +Let $g(n)$ be maximal such that given any set $A \subset \mathbb{R}$ with $|A| = n$ there exists +some $B \subseteq A$ of size $|B| \geq g(n)$ such that $b_1 + b_2 \notin A$ for all +$b_1 \neq b_2 \in B$. + +Estimate $g(n)$. + +The current best bounds are +$$(\log n)^{1+c} \ll g(n) \ll \exp(\sqrt{\log n})$$ +for some constant $c > 0$, the lower bound due to Sanders [Sa21] and the upper bound due to +Ruzsa [Ru05]. Beker [Be25] proved the lower bound with $c = 1/68$. + +[Er65, p.187] Erdős, P., _Extremal problems in number theory_. In: Proc. Sympos. Pure Math., +Vol. VIII, pp. 181–189, Amer. Math. Soc., Providence, R.I., 1965. + +[Er73, p.130] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[Va99, 1.22] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999. + +[Ch71] Choi, S. L. G., _On a combinatorial problem in number theory_. Proc. London Math. Soc. +(3), 23:629–642, 1971. + +[Sa21] Sanders, T., _The Erdős–Moser Sum-free Set Problem_. Canadian Journal of Mathematics +**73**.1 (2021), 63–107. + +[Ru05] Ruzsa, I. Z., _Sum-avoiding subsets_. Ramanujan J. **9** (2005), no. 1-2, 77–82. + +[Be25] Beker, A., _The Erdős-Moser sum-free set problem via improved bounds for +k-configurations_. arXiv:2501.10203 (2025). +-/ + +open Finset Real + +namespace Erdos787 + +/-- A subset $B$ of a finite set $A \subseteq \mathbb{R}$ is *sum-avoiding in $A$* if +$B \subseteq A$ and for all distinct $b_1, b_2 \in B$, their sum $b_1 + b_2 \notin A$. -/ +def IsSumAvoidingIn (A B : Finset ℝ) : Prop := + B ⊆ A ∧ ∀ b₁ ∈ B, ∀ b₂ ∈ B, b₁ ≠ b₂ → b₁ + b₂ ∉ A + +/-- $g(n)$: the largest $m$ such that every $n$-element subset of $\mathbb{R}$ contains a +sum-avoiding subset of size at least $m$. -/ +noncomputable def g (n : ℕ) : ℕ := + sSup {m : ℕ | ∀ A : Finset ℝ, A.card = n → + ∃ B : Finset ℝ, IsSumAvoidingIn A B ∧ B.card ≥ m} + +/-- +**Erdős Problem 787** — Lower bound (Sanders [Sa21], Beker [Be25]): + +There exists a constant $c > 0$ such that $g(n) \gg (\log n)^{1+c}$ for all +sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_787 : + ∃ c : ℝ, c > 0 ∧ ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (g n : ℝ) ≥ C * (Real.log (n : ℝ)) ^ (1 + c) := by + sorry + +/-- +**Erdős Problem 787** — Upper bound (Ruzsa [Ru05]): + +$g(n) < \exp(C \sqrt{\log n})$ for some constant $C > 0$ and all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_787.variants.upper_bound : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (g n : ℝ) ≤ Real.exp (C * Real.sqrt (Real.log (n : ℝ))) := by + sorry + +end Erdos787 diff --git a/FormalConjectures/ErdosProblems/788.lean b/FormalConjectures/ErdosProblems/788.lean new file mode 100644 index 0000000000..2b013efadc --- /dev/null +++ b/FormalConjectures/ErdosProblems/788.lean @@ -0,0 +1,89 @@ +/- +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 788 + +*Reference:* [erdosproblems.com/788](https://www.erdosproblems.com/788) + +Let $f(n)$ be maximal such that if $B \subset (2n, 4n) \cap \mathbb{N}$ there exists some +$C \subset (n, 2n) \cap \mathbb{N}$ such that $c_1 + c_2 \notin B$ for all +$c_1 \neq c_2 \in C$ and $|C| + |B| \geq f(n)$. + +Estimate $f(n)$. In particular is it true that $f(n) \leq n^{1/2+o(1)}$? + +A conjecture of Choi [Ch71], who proved $f(n) \ll n^{3/4}$. Adenwalla provided a construction +proving $f(n) \gg n^{1/2}$. The bound $f(n) \ll (n \log n)^{2/3}$ was proved by Baltz, Schoen, +and Srivastav [BSS00]. Hunter sketched an argument yielding $f(n) \ll n^{2/3+o(1)}$. The work +of Alon and Pham [AlPh25] on random Cayley graphs implies $f(n) \leq n^{3/5+o(1)}$. + +[Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of +combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, +Colo., 1971) (1973), 117-138. + +[Ch71] Choi, S. L. G., *On a combinatorial problem in number theory*. Proc. London Math. +Soc. (3), 23:629–642, 1971. + +[BSS00] Baltz, A., Schoen, T., and Srivastav, A., *Probabilistic construction of small strongly +sum-free sets via large Sidon sets*. Colloq. Math., 86(2):171–176, 2000. + +[AlPh25] Alon, N. and Pham, H.T., *Random Cayley graphs*. arXiv:2509.02561 (2025). +-/ + +open Finset Real + +namespace Erdos788 + +/-- $f(n)$: the largest $m$ such that for every $B \subseteq (2n, 4n) \cap \mathbb{N}$, there +exists $C \subseteq (n, 2n) \cap \mathbb{N}$ with $c_1 + c_2 \notin B$ for all distinct +$c_1, c_2 \in C$ and $|C| + |B| \geq m$. -/ +noncomputable def erdos788F (n : ℕ) : ℕ := + sSup {m : ℕ | ∀ B : Finset ℕ, B ⊆ Finset.Ioo (2 * n) (4 * n) → + ∃ C : Finset ℕ, C ⊆ Finset.Ioo n (2 * n) ∧ + (∀ c₁ ∈ C, ∀ c₂ ∈ C, c₁ ≠ c₂ → c₁ + c₂ ∉ B) ∧ + C.card + B.card ≥ m} + +/-- **Erdős Problem 788** — Is it true that $f(n) \leq n^{1/2+o(1)}$? That is, for every +$\varepsilon > 0$ there exists $N_0$ such that $f(n) \leq n^{1/2+\varepsilon}$ for all +$n \geq N_0$. + +A conjecture of Choi, who proved $f(n) \ll n^{3/4}$. -/ +@[category research open, AMS 5] +theorem erdos_788 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos788F n : ℝ) ≤ (n : ℝ) ^ (1 / 2 + ε) := by + sorry + +/-- Lower bound (Adenwalla): $f(n) \gg n^{1/2}$, i.e., there exists $C > 0$ such that +$f(n) \geq C \cdot n^{1/2}$ for all sufficiently large $n$. -/ +@[category research solved, AMS 5] +theorem erdos_788.variants.lower : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos788F n : ℝ) ≥ C * (n : ℝ) ^ (1 / 2) := by + sorry + +/-- Upper bound (Alon–Pham [AlPh25]): $f(n) \leq n^{3/5+o(1)}$, i.e., for every +$\varepsilon > 0$ there exists $N_0$ such that $f(n) \leq n^{3/5+\varepsilon}$ for all +$n \geq N_0$. -/ +@[category research solved, AMS 5] +theorem erdos_788.variants.upper : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos788F n : ℝ) ≤ (n : ℝ) ^ (3 / 5 + ε) := by + sorry + +end Erdos788 diff --git a/FormalConjectures/ErdosProblems/789.lean b/FormalConjectures/ErdosProblems/789.lean new file mode 100644 index 0000000000..76fedd36ec --- /dev/null +++ b/FormalConjectures/ErdosProblems/789.lean @@ -0,0 +1,89 @@ +/- +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 789 + +*Reference:* [erdosproblems.com/789](https://www.erdosproblems.com/789) + +Let $h(n)$ be maximal such that if $A \subseteq \mathbb{Z}$ with $|A| = n$ then there is +$B \subseteq A$ with $|B| \geq h(n)$ such that if $a_1 + \cdots + a_r = b_1 + \cdots + b_s$ +with $a_i, b_i \in B$ then $r = s$. + +Estimate $h(n)$. This problem is open; the best known bounds are stated below. + +Erdős [Er62c] proved $h(n) \ll n^{5/6}$. Straus [St66] proved $h(n) \ll n^{1/2}$. +Erdős noted $h(n) \gg n^{1/3}$. Erdős [Er62c] and Choi [Ch74b] improved the +lower bound to $h(n) \gg (n \log n)^{1/3}$. + +See also: Problems #186, #874. + +## References + +[Er62c] Erdős, P., _Some remarks on number theory. III_. Mat. Lapok **13** (1962), 28–38. + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. **VIII** +(1965), 181–189. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973). + +[St66] Straus, E. G., _On a problem in combinatorial number theory_. J. Math. Sci. **1** +(1966), 77–80. + +[Ch74b] Choi, S. L. G., _On an extremal problem in number theory_. J. Number Theory **6** +(1974), 105–111. +-/ + +namespace Erdos789 + +/-- A subset $B$ of $\mathbb{Z}$ has the "sum-length property" if whenever +$a_1 + \cdots + a_r = b_1 + \cdots + b_s$ with all $a_i, b_j \in B$, then $r = s$. -/ +def SumLengthProperty (B : Finset ℤ) : Prop := + ∀ (as bs : List ℤ), (∀ a ∈ as, a ∈ B) → (∀ b ∈ bs, b ∈ B) → + as.sum = bs.sum → as.length = bs.length + +/-- $h(n)$ is the maximal $h$ such that every $n$-element subset $A$ of $\mathbb{Z}$ contains a +subset $B$ of size $\geq h$ with the sum-length property. -/ +noncomputable def erdos789_h (n : ℕ) : ℕ := + sSup { h : ℕ | ∀ (A : Finset ℤ), A.card = n → + ∃ B : Finset ℤ, B ⊆ A ∧ h ≤ B.card ∧ SumLengthProperty B } + +/-- +Erdős Problem 789, upper bound (Straus [St66]): +$h(n) \ll n^{1/2}$, i.e., there exists $C > 0$ such that $h(n) \leq C \cdot n^{1/2}$ +for all $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_789 : + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, + (erdos789_h n : ℝ) ≤ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 789, lower bound (Erdős [Er62c] and Choi [Ch74b]): +$h(n) \gg (n \log n)^{1/3}$, i.e., there exist $C > 0$ and $N_0$ such that for all +$n \geq N_0$, $h(n) \geq C \cdot (n \cdot \log n)^{1/3}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_789.variants.lower_bound : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos789_h n : ℝ) ≥ C * ((n : ℝ) * Real.log (n : ℝ)) ^ ((1 : ℝ) / 3) := by + sorry + +end Erdos789 diff --git a/FormalConjectures/ErdosProblems/79.lean b/FormalConjectures/ErdosProblems/79.lean new file mode 100644 index 0000000000..e30171f4ae --- /dev/null +++ b/FormalConjectures/ErdosProblems/79.lean @@ -0,0 +1,61 @@ +/- +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 79 + +*Reference:* [erdosproblems.com/79](https://www.erdosproblems.com/79) + +We say $G$ is *Ramsey size linear* if $\hat{r}(G,H) \ll m$ for all graphs $H$ with $m$ edges +and no isolated vertices, where $\hat{r}$ denotes the size Ramsey number. + +Are there infinitely many graphs $G$ which are not Ramsey size linear but such +that all of their proper subgraphs are? + +[EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., _Ramsey size linear graphs_. +Combin. Probab. Comput. (1993), 389-399. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics, Paul Erdős is Eighty, Vol. 2 (1996), 1–25. + +[Wi24] Wigderson, Y., _Infinitely many minimally Ramsey size-linear graphs_. +arXiv:2409.05931 (2024). +-/ + +open SimpleGraph + +namespace Erdos79 + +/-- **Erdős Problem 79**: Are there infinitely many graphs which are not Ramsey + size linear but all of whose proper subgraphs are? A graph $H$ is a proper subgraph + of $G$ if $H$ embeds into $G$ (as a subgraph) but $G$ does not embed into $H$. + + Asked by Erdős, Faudree, Rousseau, and Schelp [EFRS93][Er95]. + Proved by Wigderson [Wi24]. $K_4$ is the only explicitly known example. -/ +@[category research solved, AMS 5] +theorem erdos_79 : answer(True) ↔ + ∀ N : ℕ, ∃ (p : ℕ) (G : SimpleGraph (Fin p)), + p ≥ N ∧ + ¬ IsRamseySizeLinear G ∧ + ∀ (q : ℕ) (H : SimpleGraph (Fin q)), + H.IsContained G → + ¬ G.IsContained H → + IsRamseySizeLinear H := by + sorry + +end Erdos79 diff --git a/FormalConjectures/ErdosProblems/790.lean b/FormalConjectures/ErdosProblems/790.lean new file mode 100644 index 0000000000..cdb1ae4f55 --- /dev/null +++ b/FormalConjectures/ErdosProblems/790.lean @@ -0,0 +1,118 @@ +/- +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 790 + +*Reference:* [erdosproblems.com/790](https://www.erdosproblems.com/790) + +Let $l(n)$ be maximal such that if $A \subset \mathbb{Z}$ with $|A| = n$ then there exists a +sum-free $B \subseteq A$ with $|B| \geq l(n)$ — that is, $B$ is such that there are no +solutions to $a_1 = a_2 + \cdots + a_r$ with $a_i \in B$ all distinct. + +Choi, Komlós, and Szemerédi [CKS75] proved +$$ +(n \log n / \log \log n)^{1/2} \ll l(n) \ll n / \log n. +$$ +They further conjecture that $l(n) \geq n^{1 - o(1)}$. + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. **VIII** (1965), +181–189. + +[Er73] Erdős, P., _Problems and results on combinatorial number theory_. In: A Survey of +Combinatorial Theory (1973), 117–138. + +[CKS75] Choi, S. L. G., Komlós, J., and Szemerédi, E., _On sum-free subsequences_, +Trans. Amer. Math. Soc. 212 (1975), 307–313. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference "Paul Erdős +and his mathematics", Budapest, July 1999 (1999), §1.22. + +See also: Problem 876. +-/ + +namespace Erdos790 + +/-- A finset $B \subseteq \mathbb{Z}$ is "sum-free" in the sense of Erdős Problem 790 if no +element of $B$ equals the sum of two or more other distinct elements of $B$. -/ +def IsSumFree (B : Finset ℤ) : Prop := + ∀ b ∈ B, ∀ S : Finset ℤ, S ⊆ B.erase b → S.card ≥ 2 → b ≠ S.sum id + +/-- $l(n)$: the largest $l$ such that every $n$-element subset $A$ of $\mathbb{Z}$ contains a +sum-free subset $B$ with $|B| \geq l$. -/ +noncomputable def maxSumFreeSize (n : ℕ) : ℕ := + sSup {l : ℕ | ∀ (A : Finset ℤ), A.card = n → + ∃ B : Finset ℤ, B ⊆ A ∧ l ≤ B.card ∧ IsSumFree B} + +/-- +**Erdős Problem 790** — Is it true that $l(n) n^{-1/2} \to \infty$? That is, for every $C > 0$ +there exists $N_0$ such that $l(n) \geq C \cdot n^{1/2}$ for all $n \geq N_0$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_790 : answer(True) ↔ + ∀ C : ℝ, C > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +**Erdős Problem 790** — Is it true that $l(n) < n^{1-c}$ for some $c > 0$? That is, there +exist $c > 0$ and $N_0$ such that $l(n) \leq n^{1-c}$ for all $n \geq N_0$. +-/ +@[category research open, AMS 5 11] +theorem erdos_790.variants.upper_bound_conjecture : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≤ (n : ℝ) ^ (1 - c) := by + sorry + +/-- +**Erdős Problem 790** — CKS lower bound [CKS75]: +$$ +l(n) \gg \left(\frac{n \log n}{\log \log n}\right)^{1/2}. +$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_790.variants.cks_lower : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≥ + C * ((n : ℝ) * Real.log (n : ℝ) / Real.log (Real.log (n : ℝ))) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +**Erdős Problem 790** — CKS upper bound [CKS75]: +$$ +l(n) \ll \frac{n}{\log n}. +$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_790.variants.cks_upper : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≤ C * ((n : ℝ) / Real.log (n : ℝ)) := by + sorry + +/-- +**Erdős Problem 790** — CKS conjecture [CKS75]: $l(n) \geq n^{1 - o(1)}$, i.e., for every +$\varepsilon > 0$, there exists $N_0$ such that $l(n) \geq n^{1 - \varepsilon}$ for all +$n \geq N_0$. +-/ +@[category research open, AMS 5 11] +theorem erdos_790.variants.cks_conjecture : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≥ (n : ℝ) ^ (1 - ε) := by + sorry + +end Erdos790 diff --git a/FormalConjectures/ErdosProblems/791.lean b/FormalConjectures/ErdosProblems/791.lean new file mode 100644 index 0000000000..837b57a5a5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/791.lean @@ -0,0 +1,104 @@ +/- +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 791 + +*Reference:* [erdosproblems.com/791](https://www.erdosproblems.com/791) + +Let $g(n)$ be the minimal size of a set $A \subseteq \{0, \ldots, n\}$ such that +$\{0, \ldots, n\} \subseteq A + A$ (i.e., $A$ is a finite additive 2-basis for +$\{0, \ldots, n\}$). Estimate $g(n)$. In particular, is it true that +$g(n) \sim 2\sqrt{n}$? + +A problem of Erdős [Er73], building on work of Rohrbach [Ro37]. + +Rohrbach [Ro37] proved $(2 + c) \cdot n \le g(n)^2 \le 4 \cdot n$ for some small $c > 0$. + +The current best-known bounds are: +$$ +(2.181\ldots + o(1)) \cdot n \le g(n)^2 \le (3.458\ldots + o(1)) \cdot n. +$$ + +The lower bound is due to Yu [Yu15], the upper bound to Kohonen [Ko17]. +The disproof of $g(n) \sim 2\sqrt{n}$ was accomplished by Mrose [Mr79], who showed +$g(n)^2 \le \tfrac{7}{2} \cdot n$. +-/ + +open scoped Pointwise + +namespace Erdos791 + +/-- `additiveBasesMinSize n` is the minimum cardinality of a set $A \subseteq \{0, \ldots, n\}$ +such that every element of $\{0, \ldots, n\}$ can be written as a sum of two elements +of $A$ (a finite additive 2-basis). This is the function $g(n)$ in Erdős Problem 791. -/ +noncomputable def additiveBasesMinSize (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ A : Finset ℕ, A.card = k ∧ + A ⊆ Finset.range (n + 1) ∧ Finset.range (n + 1) ⊆ A + A} + +/-- +Erdős Problem 791 — Best known lower bound (Yu [Yu15]): + +For all $\varepsilon > 0$, for sufficiently large $n$, +$$ +g(n)^2 \ge \left(\frac{2181}{1000} - \varepsilon\right) \cdot n. +$$ + +The constant $2181/1000$ approximates $2.181\ldots$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_791.variants.lower_bound : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ((2181 : ℝ) / 1000 - ε) * (n : ℝ) ≤ ((additiveBasesMinSize n : ℝ)) ^ 2 := by + sorry + +/-- +Erdős Problem 791 — Best known upper bound (Kohonen [Ko17]): + +For all $\varepsilon > 0$, for sufficiently large $n$, +$$ +g(n)^2 \le \left(\frac{3459}{1000} + \varepsilon\right) \cdot n. +$$ + +The constant $3459/1000$ provides a rational upper approximation to $3.4584\ldots$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_791.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ((additiveBasesMinSize n : ℝ)) ^ 2 ≤ ((3459 : ℝ) / 1000 + ε) * (n : ℝ) := by + sorry + +/-- +Erdős Problem 791 — Main open question [Er73]: + +Determine the value of $\lim_{n \to \infty} g(n)^2 / n$, if it exists. +Currently known to lie in the interval $[2.181\ldots, 3.458\ldots]$. + +Formalized as: there exists $c > 0$ such that $g(n)^2 = (c + o(1)) \cdot n$. +-/ +@[category research open, AMS 5 11] +theorem erdos_791 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + |((additiveBasesMinSize n : ℝ)) ^ 2 - c * (n : ℝ)| ≤ ε * (n : ℝ) := by + sorry + +end Erdos791 diff --git a/FormalConjectures/ErdosProblems/792.lean b/FormalConjectures/ErdosProblems/792.lean new file mode 100644 index 0000000000..e69b63c3b1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/792.lean @@ -0,0 +1,111 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 792 + +*Reference:* [erdosproblems.com/792](https://www.erdosproblems.com/792) + +Let $f(n)$ be maximal such that in any $A \subset \mathbb{Z}$ with $|A| = n$ there exists some +sum-free subset $B \subseteq A$ with $|B| \geq f(n)$, so that there are no solutions to +$a + b = c$ with $a, b, c \in B$. Estimate $f(n)$. + +Erdős [Er65] gave a simple proof that $f(n) \geq n/3$. Alon and Kleitman [AlKl90] improved this +to $f(n) \geq (n+1)/3$, and Bourgain [Bo97] further improved it to $f(n) \geq (n+2)/3$. The best +lower bound known is $f(n) \geq n/3 + c \log \log n$ for some $c > 0$, due to Bedert [Be25b]. +The best upper bound known is $f(n) \leq n/3 + o(n)$, due to Eberhard, Green, and +Manners [EGM14]. + +This is listed as Problem 1 on Ben Green's open problems list. + +[Er65] Erdős, P., *Extremal problems in number theory*. Proc. Sympos. Pure Math., +Vol. VIII (1965), 181-189. + +[AlKl90] Alon, N., Kleitman, D. J., *Sum-free subsets*. (1990), 13-26. + +[Bo97] Bourgain, J., *Estimates related to sumfree subsets of sets of integers*. Israel J. +Math. (1997), 71-92. + +[Be25b] Bedert, B., *Large sum-free subsets of sets of integers via L¹-estimates for +trigonometric sums*. arXiv:2502.08624 (2025). + +[EGM14] Eberhard, S., Green, B., Manners, F., *Sets of integers with no large +sum-free subset*. Ann. of Math. (2) 180 (2014), 621-652. +-/ + +open scoped Pointwise + +namespace Erdos792 + +/-- $f(n)$ is the largest $k$ such that every $n$-element subset of $\mathbb{Z}$ contains +a sum-free subset of size at least $k$. -/ +noncomputable def maxSumFreeSize (n : ℕ) : ℕ := + sSup {k : ℕ | ∀ (A : Finset ℤ), A.card = n → + ∃ B : Finset ℤ, B ⊆ A ∧ IsSumFree (B : Set ℤ) ∧ k ≤ B.card} + +/-- +Erdős Problem 792, Erdős's lower bound [Er65]: +$f(n) \geq n/3$ for all $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_792 (n : ℕ) : + (maxSumFreeSize n : ℝ) ≥ n / 3 := by + sorry + +/-- +Erdős Problem 792, Alon–Kleitman lower bound [AlKl90]: +$f(n) \geq (n+1)/3$ for all $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_792.variants.lower_alon_kleitman (n : ℕ) : + (maxSumFreeSize n : ℝ) ≥ (n + 1) / 3 := by + sorry + +/-- +Erdős Problem 792, Bourgain lower bound [Bo97]: +$f(n) \geq (n+2)/3$ for all $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_792.variants.lower_bourgain (n : ℕ) : + (maxSumFreeSize n : ℝ) ≥ (n + 2) / 3 := by + sorry + +/-- +Erdős Problem 792, best known lower bound (Bedert [Be25b]): +There exists $c > 0$ such that $f(n) \geq n/3 + c \cdot \log(\log(n))$ for all +sufficiently large $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_792.variants.lower_bedert : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≥ n / 3 + c * Real.log (Real.log n) := by + sorry + +/-- +Erdős Problem 792, best known upper bound (Eberhard–Green–Manners [EGM14]): +$f(n) \leq n/3 + o(n)$, i.e., for every $\varepsilon > 0$, +$f(n) \leq (1/3 + \varepsilon) \cdot n$ for all sufficiently large $n$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_792.variants.upper_egm : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxSumFreeSize n : ℝ) ≤ (1 / 3 + ε) * n := by + sorry + +end Erdos792 diff --git a/FormalConjectures/ErdosProblems/793.lean b/FormalConjectures/ErdosProblems/793.lean new file mode 100644 index 0000000000..271c5a1a6e --- /dev/null +++ b/FormalConjectures/ErdosProblems/793.lean @@ -0,0 +1,116 @@ +/- +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 793 + +*Reference:* [erdosproblems.com/793](https://www.erdosproblems.com/793) + +Let $F(n)$ be the maximum possible size of a subset $A \subseteq \{1, \ldots, n\}$ such that +$a \nmid bc$ whenever $a, b, c \in A$ with $a \neq b$ and $a \neq c$. Is there a constant $C$ +such that +$$ + F(n) = \pi(n) + (C + o(1)) \cdot n^{2/3} \cdot (\log n)^{-2}? +$$ + +Erdős [Er38] proved there exist constants $0 < c_1 \leq c_2$ such that +$$ + \pi(n) + c_1 \cdot n^{2/3} \cdot (\log n)^{-2} \leq F(n) + \leq \pi(n) + c_2 \cdot n^{2/3} \cdot (\log n)^{-2}. +$$ + +See also problem #425. +-/ + +open Filter + +open scoped Topology Real + +namespace Erdos793 + +/-- +A finite set $A \subseteq \mathbb{N}$ is *primitive-like* if no element divides +the product of two other elements: for all $a, b, c \in A$ with $a \neq b$ and $a \neq c$, +$a \nmid bc$. +-/ +def IsPrimitiveLike (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, + a ≠ b → a ≠ c → ¬(a ∣ b * c) + +/-- +$F(n)$ is the maximum cardinality of a primitive-like subset of $\{1, \ldots, n\}$. +-/ +noncomputable def primitiveLikeMaxSize (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Finset ℕ, IsPrimitiveLike A ∧ (∀ x ∈ A, 1 ≤ x ∧ x ≤ n) ∧ A.card = k} + +/-- +Erdős Problem 793 [Er69][Er70b]: + +Is there a constant $C > 0$ such that +$$ + \frac{F(n) - \pi(n)}{n^{2/3} / (\log n)^2} \to C? +$$ +-/ +@[category research open, AMS 5 11] +theorem erdos_793 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun n : ℕ => + ((primitiveLikeMaxSize n : ℝ) - (Nat.primeCounting n : ℝ)) / + ((n : ℝ) ^ ((2 : ℝ) / 3) / (Real.log (n : ℝ)) ^ (2 : ℝ))) + atTop + (nhds c) := by + sorry + +/-- +A finite set $A \subseteq \mathbb{N}$ is *r-primitive-like* if no element divides the product +of $r$ distinct other elements: for all $a \in A$ and all multisets $B$ of size $r$ drawn from +$A \setminus \{a\}$, $a \nmid \prod B$. When $r = 2$, this reduces to `IsPrimitiveLike`. +-/ +def IsRPrimitiveLike (r : ℕ) (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ B : Finset ℕ, B ⊆ A.erase a → B.card = r → + ¬(a ∣ B.prod id) + +/-- +$F_r(n)$ is the maximum cardinality of an r-primitive-like subset of $\{1, \ldots, n\}$. +-/ +noncomputable def rPrimitiveLikeMaxSize (r : ℕ) (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Finset ℕ, IsRPrimitiveLike r A ∧ + (∀ x ∈ A, 1 ≤ x ∧ x ≤ n) ∧ A.card = k} + +/-- +Generalization of Erdős Problem 793: for sets where no $a \in A$ divides the product +of $r$ distinct other elements of $A$, is there a constant $C_r > 0$ such that +$$ + \frac{F_r(n) - \pi(n)}{n^{2/(r+1)} / (\log n)^2} \to C_r? +$$ +The case $r = 2$ recovers the original problem with exponent $2/3$. +-/ +@[category research open, AMS 5 11] +theorem erdos_793.variant : answer(sorry) ↔ + ∀ᵉ (r : ℕ) (_ : 2 ≤ r), + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun n : ℕ => + ((rPrimitiveLikeMaxSize r n : ℝ) - (Nat.primeCounting n : ℝ)) / + ((n : ℝ) ^ ((2 : ℝ) / (r + 1 : ℝ)) / (Real.log (n : ℝ)) ^ (2 : ℝ))) + atTop + (nhds c) := by + sorry + +end Erdos793 diff --git a/FormalConjectures/ErdosProblems/794.lean b/FormalConjectures/ErdosProblems/794.lean new file mode 100644 index 0000000000..e3febf397d --- /dev/null +++ b/FormalConjectures/ErdosProblems/794.lean @@ -0,0 +1,62 @@ +/- +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 794 + +Is it true that every 3-uniform hypergraph on $3n$ vertices with at least $n^3 + 1$ edges must +contain either a subgraph on 4 vertices with 3 edges or a subgraph on 5 vertices with 7 edges? +Disproved by Harris. + +*Reference:* [erdosproblems.com/794](https://www.erdosproblems.com/794) + +[Er69, p.81] Erdős, P., _Some applications of graph theory to number theory_. The Many Facets of +Graph Theory (Proc. Conf., Western Mich. Univ., Kalamazoo, Mich., 1968), Springer (1969), 77-82. +[FrFu84] Frankl, P. and Füredi, Z., _An exact result for 3-graphs_. Discrete Mathematics (1984), +323-328. +-/ + +namespace Erdos794 + +/-- A 3-uniform hypergraph $H$ contains a $(k, m)$-subhypergraph if there exist $k$ + vertices spanning at least $m$ edges of $H$. -/ +def ContainsSubhypergraph {N : ℕ} (H : Finset (Finset (Fin N))) (k m : ℕ) : Prop := + ∃ S : Finset (Fin N), S.card = k ∧ (H.filter (· ⊆ S)).card ≥ m + +/-- +Erdős Problem 794 (DISPROVED by Harris): + +Is it true that every 3-uniform hypergraph on $3n$ vertices with at least $n^3 + 1$ +edges must contain either a subgraph on 4 vertices with 3 edges or a subgraph on +5 vertices with 7 edges? + +Balogh observed that every 3-uniform hypergraph on 5 vertices with 7 +edges contains a sub-hypergraph on 4 vertices with 3 edges, so the second +condition is redundant. Harris provided a counterexample to the remaining +statement: the 3-uniform hypergraph on $\{1, \ldots, 9\}$ with 28 edges, formed by taking +27 edges by choosing one element each from $\{1,2,3\}$, $\{4,5,6\}$, $\{7,8,9\}$, and then +adding the edge $\{1,2,3\}$. +-/ +@[category research solved, AMS 5] +theorem erdos_794 : answer(False) ↔ ∀ n : ℕ, ∀ H : Finset (Finset (Fin (3 * n))), + (∀ e ∈ H, e.card = 3) → + H.card ≥ n ^ 3 + 1 → + ContainsSubhypergraph H 4 3 ∨ ContainsSubhypergraph H 5 7 := by + sorry + +end Erdos794 diff --git a/FormalConjectures/ErdosProblems/795.lean b/FormalConjectures/ErdosProblems/795.lean new file mode 100644 index 0000000000..a909cccbba --- /dev/null +++ b/FormalConjectures/ErdosProblems/795.lean @@ -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 Mathlib.NumberTheory.ArithmeticFunction.Misc + +/-! +# Erdős Problem 795 + +*Reference:* [erdosproblems.com/795](https://www.erdosproblems.com/795) + +*Related:* [Erdős Problem 786](https://www.erdosproblems.com/786) + +Let $g(n)$ be the maximal size of $A \subseteq \{1, \ldots, n\}$ such that the subset products +$\prod_{a \in S} a$ are distinct for all $S \subseteq A$. Erdős [Er66] proved that +$g(n) \leq \pi(n) + O(\sqrt{n} / \log n)$. This upper bound is essentially best possible, +since one could take $A$ to be all primes and squares of primes. + +Raghavan [Ra25] resolved this, proving +$g(n) \leq \pi(n) + \pi(\lfloor\sqrt{n}\rfloor) + O(n^{5/12 + o(1)})$ and also +$g(n) \geq \pi(n) + \pi(\lfloor\sqrt{n}\rfloor) + \pi(n^{1/3})/3 - O(1)$. + +[Er66] Erdős, P., _Remarks on number theory. V. Extremal problems in number theory. II_. +Mat. Lapok (1966), 135–155. + +[Ra25] Raghavan, S., _Sharp bounds for sets with distinct subset products_. +arXiv:2501.02695 (2025). +-/ + +open Finset BigOperators + +namespace Erdos795 + +/-- A finset of natural numbers has distinct subset products if for all subsets +$S, T \subseteq A$, $\prod_{a \in S} a = \prod_{a \in T} a$ implies $S = T$. -/ +def HasDistinctSubsetProducts (A : Finset ℕ) : Prop := + ∀ S T, S ⊆ A → T ⊆ A → (∏ i ∈ S, i) = (∏ i ∈ T, i) → S = T + +/-- $g(n)$: the maximal cardinality of $A \subseteq \{1, \ldots, n\}$ with distinct subset +products. -/ +noncomputable def maxDistinctProductSetSize (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Finset ℕ, (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) ∧ + HasDistinctSubsetProducts A ∧ A.card = k} + +/-- +Erdős Problem 795: $g(n) \leq \pi(n) + \pi(\lfloor\sqrt{n}\rfloor) + o(\sqrt{n} / \log n)$. + +Formulated as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$g(n) \leq \pi(n) + \pi(\lfloor\sqrt{n}\rfloor) + \varepsilon \cdot \sqrt{n} / \log n$. + +This was solved by Raghavan [Ra25], who proved +$g(n) \leq \pi(n) + \pi(\lfloor\sqrt{n}\rfloor) + O(n^{5/12 + o(1)})$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_795 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maxDistinctProductSetSize n : ℝ) ≤ + (Nat.primeCounting n : ℝ) + (Nat.primeCounting (Nat.sqrt n) : ℝ) + + ε * (Nat.sqrt n : ℝ) / Real.log (n : ℝ) := by + sorry + +end Erdos795 diff --git a/FormalConjectures/ErdosProblems/796.lean b/FormalConjectures/ErdosProblems/796.lean new file mode 100644 index 0000000000..ce7e329e89 --- /dev/null +++ b/FormalConjectures/ErdosProblems/796.lean @@ -0,0 +1,95 @@ +/- +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 796 + +Let $g_k(n)$ denote the largest size of a subset $A \subseteq \{1, \ldots, n\}$ such that every +integer has fewer than $k$ representations as a product $a_1 \cdot a_2$ with $a_1 < a_2$ and +$a_1, a_2 \in A$. Is it true that +$g_3(n) = \frac{n \log \log n}{\log n} + (c + o(1)) \frac{n}{\log n}$ for some constant $c$? + +The special case $k = 2$ is the subject of Erdős Problem 425 (see `Erdos425`). + +*Reference:* [erdosproblems.com/796](https://www.erdosproblems.com/796) + +[Er69] Erdős, P., _On some applications of graph theory to number theoretic problems_. Publ. +Ramanujan Inst. 1 (1969), 131-136. +-/ + +open Finset + +namespace Erdos796 + +/-- The number of representations of $m$ as $a_1 \cdot a_2$ with $a_1 < a_2$ and +$a_1, a_2 \in A$. For each $a_1 \in A$, we check whether $m / a_1 \in A$, +$a_1 < m / a_1$, and $a_1$ divides $m$ (verified by $a_1 \cdot (m / a_1) = m$). -/ +def productRepCount (A : Finset ℕ) (m : ℕ) : ℕ := + (A.filter (fun a₁ => m / a₁ ∈ A ∧ a₁ < m / a₁ ∧ a₁ * (m / a₁) = m)).card + +/-- $g_k(n)$: the largest cardinality of $A \subseteq \{1, \ldots, n\}$ such that every $m$ has +fewer than $k$ representations as $a_1 \cdot a_2$ with $a_1 < a_2$, $a_1, a_2 \in A$. -/ +noncomputable def multiplicativeBkMax (k n : ℕ) : ℕ := + sSup {s : ℕ | ∃ A : Finset ℕ, (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) ∧ + (∀ m, productRepCount A m < k) ∧ A.card = s} + +/-- +Erdős Problem 796 [Er69, p.80]: + +There exists a constant $c$ such that +$$g_3(n) = \frac{n \log \log n}{\log n} + (c + o(1)) \cdot \frac{n}{\log n}.$$ + +Formulated as: there exists $c$ such that for every $\varepsilon > 0$, there exists $N_0$ +such that for all $n \ge N_0$, +$$\left| g_3(n) - \frac{n \log \log n}{\log n} - \frac{cn}{\log n} \right| + \le \frac{\varepsilon \, n}{\log n}.$$ +-/ +@[category research open, AMS 5 11] +theorem erdos_796 : + answer(sorry) ↔ + ∃ c : ℝ, ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + |(multiplicativeBkMax 3 n : ℝ) - + (n : ℝ) * Real.log (Real.log (n : ℝ)) / Real.log (n : ℝ) - + c * (n : ℝ) / Real.log (n : ℝ)| ≤ + ε * (n : ℝ) / Real.log (n : ℝ) := by + sorry + +/-- +Erdős's general leading-term asymptotic [Er69]: for $2^{r-1} < k \le 2^r$ with $r \ge 1$, +$$g_k(n) \sim \frac{(\log \log n)^{r-1}}{(r-1)! \cdot \log n} \cdot n.$$ + +Formulated as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \ge N_0$, +$$\left| g_k(n) - \frac{n \, (\log \log n)^{r-1}}{(r-1)! \cdot \log n} \right| + \le \varepsilon \cdot \frac{n \, (\log \log n)^{r-1}}{(r-1)! \cdot \log n}.$$ + +See also `erdos_796` for the refined second-order conjecture in the $k = 3$ case. +-/ +@[category research solved, AMS 5 11] +theorem erdos_796_general (k r : ℕ) (hr : 1 ≤ r) (hk_lower : 2 ^ (r - 1) < k) + (hk_upper : k ≤ 2 ^ r) : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + |(multiplicativeBkMax k n : ℝ) - + (n : ℝ) * (Real.log (Real.log (n : ℝ))) ^ (r - 1) / + (↑(Nat.factorial (r - 1)) * Real.log (n : ℝ))| ≤ + ε * (n : ℝ) * (Real.log (Real.log (n : ℝ))) ^ (r - 1) / + (↑(Nat.factorial (r - 1)) * Real.log (n : ℝ)) := by + sorry + +end Erdos796 diff --git a/FormalConjectures/ErdosProblems/797.lean b/FormalConjectures/ErdosProblems/797.lean new file mode 100644 index 0000000000..5736494a58 --- /dev/null +++ b/FormalConjectures/ErdosProblems/797.lean @@ -0,0 +1,67 @@ +/- +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 797 + +*Reference:* [erdosproblems.com/797](https://www.erdosproblems.com/797) + +Let `f(d)` be the maximal acyclic chromatic number of any graph with maximum degree `d`. +Estimate `f(d)`. In particular, is it true that `f(d) = o(d²)`? + +[AlBe76] Albertson, M. O. and Berman, D. M., *Every planar graph has an acyclic +7-coloring*, 1976. + +[AMR91] Alon, N., McDiarmid, C., and Reed, B., *Acyclic coloring of graphs*, 1991. +-/ + +open SimpleGraph Real Classical + +namespace Erdos797 + +/-- A proper coloring of $G$ is acyclic if for every pair of distinct colors, + the subgraph induced by vertices of those two colors is acyclic (a forest). -/ +def IsAcyclicColoring {V : Type*} (G : SimpleGraph V) {α : Type*} + (c : G.Coloring α) : Prop := + ∀ a b : α, a ≠ b → + (G.induce {v : V | c v = a ∨ c v = b}).IsAcyclic + +/-- +Let $f(d)$ be the maximal acyclic chromatic number of any graph with maximum +degree $d$. Alon, McDiarmid, and Reed [AMR91] showed +$$d^{4/3} / (\log d)^{1/3} \ll f(d) \ll d^{4/3}.$$ +-/ +@[category research solved, AMS 5] +theorem erdos_797 : + -- Upper bound: f(d) ≪ d^{4/3} + (∃ C : ℝ, 0 < C ∧ + ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ v, G.degree v ≤ d) → + ∃ (k : ℕ) (c : G.Coloring (Fin k)), + IsAcyclicColoring G c ∧ (k : ℝ) ≤ C * (d : ℝ) ^ ((4 : ℝ) / 3)) ∧ + -- Lower bound: f(d) ≫ d^{4/3} / (log d)^{1/3} + (∃ C : ℝ, 0 < C ∧ + ∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d → + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ v, G.degree v ≤ d) ∧ + ∀ (k : ℕ), (∃ c : G.Coloring (Fin k), IsAcyclicColoring G c) → + C * (d : ℝ) ^ ((4 : ℝ) / 3) / (Real.log (d : ℝ)) ^ ((1 : ℝ) / 3) ≤ (k : ℝ)) := by + sorry + +end Erdos797 diff --git a/FormalConjectures/ErdosProblems/798.lean b/FormalConjectures/ErdosProblems/798.lean new file mode 100644 index 0000000000..30f10fdd74 --- /dev/null +++ b/FormalConjectures/ErdosProblems/798.lean @@ -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 798 + +*Reference:* [erdosproblems.com/798](https://www.erdosproblems.com/798) + +Let $t(n)$ be the minimum number of points in $\{1, \ldots, n\}^2$ such that the $\binom{t}{2}$ +lines determined by these points cover all points in $\{1, \ldots, n\}^2$. + +Estimate $t(n)$. In particular, is it true that $t(n) = o(n)$? + +A problem of Erdős and Purdy, who proved $t(n) \gg n^{2/3}$. +Resolved by Alon [Al91] who proved $t(n) \ll n^{2/3} \log n$, confirming $t(n) = o(n)$. + +[Al91] Alon, N., _Economical coverings of sets of lattice points_. Geom. Funct. Anal. (1991), 224–230. +-/ + +namespace Erdos798 + +/-- Three points in $\mathbb{Z} \times \mathbb{Z}$ are collinear if the cross product of the +displacement vectors from the first point is zero. -/ +def IntGridCollinear (p q r : ℤ × ℤ) : Prop := + (q.1 - p.1) * (r.2 - p.2) = (r.1 - p.1) * (q.2 - p.2) + +/-- A finite set $S$ of points in $\{1, \ldots, n\}^2$ covers the grid if every point +in $\{1, \ldots, n\}^2$ lies on a line determined by two distinct points of $S$. -/ +def CoversIntGrid (n : ℕ) (S : Finset (ℤ × ℤ)) : Prop := + (∀ p ∈ S, 1 ≤ p.1 ∧ p.1 ≤ ↑n ∧ 1 ≤ p.2 ∧ p.2 ≤ ↑n) ∧ + ∀ (p : ℤ × ℤ), 1 ≤ p.1 → p.1 ≤ ↑n → 1 ≤ p.2 → p.2 ≤ ↑n → + ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ IntGridCollinear a b p + +/-- $t(n)$: the minimum number of points in $\{1, \ldots, n\}^2$ whose pairwise lines +cover all $n^2$ grid points. -/ +noncomputable def gridCoveringNumber (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ S : Finset (ℤ × ℤ), S.card = k ∧ CoversIntGrid n S} + +/-- +Erdős Problem 798 (proved by Alon [Al91]): + +$t(n) = o(n)$, i.e., the minimum number of points in $\{1, \ldots, n\}^2$ whose lines +cover all grid points is sublinear in $n$. + +Equivalently: for every $\varepsilon > 0$, there exists $N_0$ such that for all $n \geq N_0$, +$t(n) \leq \varepsilon \cdot n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_798 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (gridCoveringNumber n : ℝ) ≤ ε * (n : ℝ) := by + sorry + +/-- +Erdős–Purdy lower bound for Problem 798: + +$t(n) \gg n^{2/3}$, i.e., there exists a constant $C > 0$ such that +$t(n) \geq C \cdot n^{2/3}$ for all sufficiently large $n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_798_lower : + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (gridCoveringNumber n : ℝ) ≥ C * (n : ℝ) ^ ((2 : ℝ) / 3) := by + sorry + +/-- +Alon's upper bound for Problem 798 [Al91]: + +$t(n) \ll n^{2/3} \log n$, i.e., there exists a constant $C > 0$ such that +$t(n) \leq C \cdot n^{2/3} \cdot \log n$ for all sufficiently large $n$. + +This is the result that implies $t(n) = o(n)$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_798_upper : + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (gridCoveringNumber n : ℝ) ≤ C * (n : ℝ) ^ ((2 : ℝ) / 3) * Real.log n := by + sorry + +end Erdos798 diff --git a/FormalConjectures/ErdosProblems/799.lean b/FormalConjectures/ErdosProblems/799.lean new file mode 100644 index 0000000000..dd8ef0acd5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/799.lean @@ -0,0 +1,126 @@ +/- +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 799 + +*Reference:* [erdosproblems.com/799](https://www.erdosproblems.com/799) + +Is it true that the list chromatic number $\chi_L(G) = o(n)$ for almost all graphs on $n$ vertices? + +[ERT80] Erdős, P., Rubin, A. L. and Taylor, H., *Choosability in graphs*, Proc. West Coast +Conf. on Combinatorics, Graph Theory and Computing, Congressus Numerantium 26 (1980), 125–157. + +[Al92] Alon, N., *Choice numbers of graphs: a probabilistic approach*, Combin. Probab. +Comput. 1 (1992), 107–114. + +[AKS99] Alon, N., Krivelevich, M. and Sudakov, B., *List coloring of random and +pseudo-random graphs*, Combinatorica 19 (1999), 453–472. +-/ + +namespace Erdos799 + +/-- A proper list coloring of $G$ with respect to a list assignment $L : V \to \text{Finset}\ \mathbb{N}$ +is a function $f : V \to \mathbb{N}$ such that $f(v) \in L(v)$ for all $v$, and $f(u) \neq f(v)$ +whenever $u$ and $v$ are adjacent. -/ +def IsProperListColoring {V : Type*} (G : SimpleGraph V) (L : V → Finset ℕ) + (f : V → ℕ) : Prop := + (∀ v, f v ∈ L v) ∧ (∀ u v, G.Adj u v → f u ≠ f v) + +/-- A graph $G$ is $k$-choosable ($k$-list-colorable) if for every list assignment $L$ +where each vertex receives a list of at least $k$ colors, there exists a +proper list coloring. -/ +def IsChoosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, k ≤ (L v).card) → + ∃ f : V → ℕ, IsProperListColoring G L f + +/-- The simple graph on $\text{Fin}\ n$ determined by a Boolean edge predicate. +Only the upper-triangle entries $ec(\min(u, v), \max(u, v))$ for $u \neq v$ are read. -/ +def toGraph {n : ℕ} (ec : Fin n → Fin n → Bool) : SimpleGraph (Fin n) where + Adj u v := u ≠ v ∧ ec (min u v) (max u v) = true + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, by rwa [min_comm, max_comm]⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- The fraction of all labeled graphs on $n$ vertices satisfying property $P$. +Each graph is encoded by a Boolean edge predicate; the graph is read +from the upper triangle, so every graph has equal weight. -/ +noncomputable def graphFraction (n : ℕ) (P : SimpleGraph (Fin n) → Prop) : ℝ := + haveI : DecidablePred (fun ec => P (toGraph ec)) := fun _ => Classical.dec _ + ((Finset.univ : Finset (Fin n → Fin n → Bool)).filter + (fun ec => P (toGraph ec))).card / + ((Finset.univ : Finset (Fin n → Fin n → Bool)).card : ℝ) + +/-- +Erdős Problem 799 [ERT80]: + +Is it true that $\chi_L(G) = o(n)$ for almost all graphs on $n$ vertices? + +Formally: for every $\varepsilon > 0$ and $\delta > 0$, there exists $n_0$ such that for all +$n \geq n_0$ and all $k \geq \varepsilon n$, the fraction of labeled graphs on $n$ vertices +that are $k$-choosable is at least $1 - \delta$. + +The answer is yes. Alon [Al92] proved that the random graph on $n$ vertices with edge +probability $1/2$ has $\chi_L(G) \ll (\log \log n / \log n) \cdot n$ almost surely. Alon, +Krivelevich, and Sudakov [AKS99] improved this to $\chi_L(G) \asymp n / \log n$ almost surely. +-/ +@[category research solved, AMS 5] +theorem erdos_799 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ k : ℕ, (k : ℝ) ≥ ε * (n : ℝ) → + graphFraction n (fun G => IsChoosable G k) ≥ 1 - δ := by + sorry + +/-- +Alon's bound [Al92]: The list chromatic number of almost all graphs on $n$ vertices +is $O\!\left(\frac{n \log \log n}{\log n}\right)$. That is, there exists a constant $C > 0$ +such that for all $\delta > 0$, for all sufficiently large $n$, the fraction of labeled graphs +on $n$ vertices that are $\lceil C \cdot n \cdot \log \log n / \log n \rceil$-choosable +is at least $1 - \delta$. +-/ +@[category research solved, AMS 5] +theorem erdos_799_alon_upper : + ∃ C : ℝ, C > 0 ∧ + ∀ δ : ℝ, δ > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + graphFraction n (fun G => IsChoosable G + ⌈C * (n : ℝ) * Real.log (Real.log (n : ℝ)) / Real.log (n : ℝ)⌉₊) ≥ 1 - δ := by + sorry + +/-- +Alon–Krivelevich–Sudakov tight bound [AKS99]: The list chromatic number of almost all +graphs on $n$ vertices is $\Theta(n / \log n)$. There exist constants $c, C > 0$ such that +for all $\delta > 0$ and all sufficiently large $n$: +- the fraction of labeled graphs that are $\lceil C n / \log n \rceil$-choosable is $\ge 1 - \delta$ + (upper bound on $\chi_L$), and +- the fraction that are $\lfloor c n / \log n \rfloor$-choosable is $\le \delta$ + (lower bound on $\chi_L$). +-/ +@[category research solved, AMS 5] +theorem erdos_799_aks_tight : + ∃ c C : ℝ, c > 0 ∧ C > 0 ∧ + ∀ δ : ℝ, δ > 0 → + ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + graphFraction n (fun G => IsChoosable G + ⌈C * (n : ℝ) / Real.log (n : ℝ)⌉₊) ≥ 1 - δ ∧ + graphFraction n (fun G => IsChoosable G + ⌊c * (n : ℝ) / Real.log (n : ℝ)⌋₊) ≤ δ := by + sorry + +end Erdos799 diff --git a/FormalConjectures/ErdosProblems/8.lean b/FormalConjectures/ErdosProblems/8.lean new file mode 100644 index 0000000000..a9536daf96 --- /dev/null +++ b/FormalConjectures/ErdosProblems/8.lean @@ -0,0 +1,96 @@ +/- +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 8 + +*Reference:* [erdosproblems.com/8](https://www.erdosproblems.com/8) + +The original Erdős–Graham conjecture [ErGr80, p.25] asked: for any finite colouring of the +positive integers, must there exist a covering system (with distinct moduli ≥ 2) all of whose +moduli are monochromatic? + +The answer is **no**, as a consequence of Hough's theorem [Ho15] that every covering system +must contain a modulus below an absolute bound (at most $10^{16}$, later improved to $616000$ +by Balister, Bollobás, Morris, Sahasrabudhe, and Tiba [BBMST22]). One can therefore assign a +distinct colour to each integer up to this bound and a single fresh colour to all larger integers; +any covering system must then contain a small modulus with a unique colour, making +monochromaticity impossible. + +Erdős also asked a density-type version: whether $\sum_{a \in A,\, a > N} 1/a \gg \log N$ +suffices for $A$ to contain the moduli of a covering system. Hough's theorem also answers this +negatively. + +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number +theory_. Monographies de L'Enseignement Mathematique (1980). + +[Er96b] Erdős, P., _Some problems I presented or planned to present in my short talk_. +Analytic number theory, Vol. 1 (Allerton Park, IL, 1995) (1996), 333–335. + +[Er97] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_ (1997). + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). + +[Ho15] Hough, R. D., _The interval of covering congruences_. Ann. of Math. (2) **181** (2015), +no. 1, 361–382. + +[BBMST22] Balister, P., Bollobás, B., Morris, R., Sahasrabudhe, J., and Tiba, M., +_The Erdős covering problem: the density of the uncovered set_. Ann. of Math. (2) **198** (2023), +no. 1, 1–92. +-/ + +namespace Erdos8 + +/-- +A finite system of congruences $\{(a_i, m_i)\}$ is a **covering system** if every +modulus is at least 2 and every integer satisfies at least one congruence +$n \equiv a_i \pmod{m_i}$. +-/ +def IsCoveringSystem (S : Finset (ℤ × ℕ)) : Prop := + S.Nonempty ∧ + (∀ p ∈ S, 2 ≤ p.2) ∧ + (∀ n : ℤ, ∃ p ∈ S, (p.2 : ℤ) ∣ (n - p.1)) + +/-- A congruence system has distinct moduli if no two pairs share the same modulus. -/ +def HasDistinctModuli (S : Finset (ℤ × ℕ)) : Prop := + S.card = (S.image Prod.snd).card + +/-- +All moduli in a covering system are **monochromatic** under a colouring $\chi : \mathbb{N} \to \text{Fin}\, k$ +if there exists a colour $c$ such that every modulus in $S$ receives colour $c$. +-/ +def HasMonochromaticModuli {k : ℕ} (χ : ℕ → Fin k) (S : Finset (ℤ × ℕ)) : Prop := + ∃ c : Fin k, ∀ p ∈ S, χ p.2 = c + +/-- +The Erdős–Graham conjecture [ErGr80, p.25] asked: for any finite colouring of the positive +integers, must there exist a covering system with distinct moduli all of whose moduli are +monochromatic? + +The answer is **no**, as a consequence of Hough's theorem [Ho15] that every covering system +(with distinct moduli ≥ 2) must contain a modulus below an absolute bound. +-/ +@[category research solved, AMS 11] +theorem erdos_8 : answer(False) ↔ + (∀ k : ℕ, 0 < k → ∀ χ : ℕ → Fin k, + ∃ S : Finset (ℤ × ℕ), IsCoveringSystem S ∧ HasDistinctModuli S ∧ + HasMonochromaticModuli χ S) := by + sorry + +end Erdos8 diff --git a/FormalConjectures/ErdosProblems/80.lean b/FormalConjectures/ErdosProblems/80.lean new file mode 100644 index 0000000000..1f0741b3b9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/80.lean @@ -0,0 +1,82 @@ +/- +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 80 + +*Reference:* [erdosproblems.com/80](https://www.erdosproblems.com/80) + +Let $c > 0$ and let $f_c(n)$ be the maximal $m$ such that every graph $G$ with +$n$ vertices and at least $cn^2$ edges, where each edge is contained in at least +one triangle, must contain a book of size $m$, that is, an edge shared by at least +$m$ different triangles. + +Estimate $f_c(n)$. In particular, is it true that $f_c(n) \gg \log n$? + +A problem of Erdős and Rothschild. Alon and Trotter showed that, provided $c < 1/4$, +$f_c(n) \ll_c n^{1/2}$. Szemerédi observed that his regularity lemma implies +$f_c(n) \to \infty$. Fox and Loh [FoLo12] proved that +$f_c(n) \le n^{O(1/\log\log n)}$ for all $c < 1/4$, disproving the stronger +conjecture $f_c(n) > n^\varepsilon$. Edwards (unpublished) and Khadziivanov and +Nikiforov [KhNi79] showed that for $c > 1/4$, $f_c(n) \geq n/6$. + +The weaker conjecture $f_c(n) \gg \log n$ remains open. + +See also Problem 600. + +[FoLo12] Fox, J., Loh, P.-S., _On a problem of Erdős and Rothschild on edges in +triangles_. Combinatorica (2012), 619–628. + +[KhNi79] Hadžiivanov, N. G., Nikiforov, S. V., _Solution of a problem of P. Erdős +about the maximum number of triangles with a common edge in a graph_. C. R. Acad. +Bulgare Sci. (1979), 1315–1318. +-/ + +open SimpleGraph + +namespace Erdos80 + +/-- The number of common neighbors of $u$ and $v$ in $G$. When $\{u, v\}$ is an edge, + this equals the number of triangles containing that edge (i.e., the book size at + that edge). -/ +def bookSize {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] (u v : V) : ℕ := + ((G.neighborFinset u) ∩ (G.neighborFinset v)).card + +/-- Every edge of $G$ is contained in at least one triangle. -/ +def EveryEdgeInTriangle {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] : Prop := + ∀ u v : V, G.Adj u v → 0 < bookSize G u v + +/-- **Erdős Problem 80**: For every $c > 0$, there exists $C > 0$ such that for all + sufficiently large $n$, every graph on $n$ vertices with at least $cn^2$ edges, + where every edge lies in a triangle, contains an edge that is in at least + $C \log n$ triangles. -/ +@[category research open, AMS 5] +theorem erdos_80 : answer(sorry) ↔ + ∀ c : ℝ, c > 0 → + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ (n : ℕ), n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) ^ 2 → + EveryEdgeInTriangle G → + ∃ u v : Fin n, G.Adj u v ∧ + (bookSize G u v : ℝ) ≥ C * Real.log (n : ℝ) := by + sorry + +end Erdos80 diff --git a/FormalConjectures/ErdosProblems/800.lean b/FormalConjectures/ErdosProblems/800.lean new file mode 100644 index 0000000000..448fdf54db --- /dev/null +++ b/FormalConjectures/ErdosProblems/800.lean @@ -0,0 +1,67 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 800 + +*Reference:* [erdosproblems.com/800](https://www.erdosproblems.com/800) + +If $G$ is a graph on $n$ vertices which has no two adjacent vertices of degree $\geq 3$ then +$R(G) \ll n$, where the implied constant is absolute. + +A problem of Burr and Erdős [BuEr75]. Solved in the affirmative by Alon [Al94]. +This is a special case of problem #163. + +[BuEr75] Burr, S. A. and Erdős, P., _On the magnitude of generalized Ramsey numbers for graphs_, +1975. + +[Al94] Alon, N., _Subdivided graphs have linear Ramsey numbers_, 1994. +-/ + +open SimpleGraph + +namespace Erdos800 + +/-- The graph Ramsey number $R(G)$: the minimum $N$ such that for every graph $H$ on +$\text{Fin}(N)$, either $G$ embeds into $H$ or $G$ embeds into $H^c$ as a subgraph. -/ +noncomputable def graphRamseyNumber {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), G ⊑ H ∨ G ⊑ Hᶜ} + +/-- +Erdős Problem 800 (Burr–Erdős [BuEr75]): + +If $G$ is a graph on $n$ vertices which has no two adjacent vertices of degree $\geq 3$, +then $R(G) \ll n$, where the implied constant is absolute. + +Formally: there exists an absolute constant $C > 0$ such that for all $n$ and every +graph $G$ on $n$ vertices where no edge has both endpoints of degree $\geq 3$, +the graph Ramsey number $R(G) \leq C \cdot n$. + +Proved by Alon [Al94]. +-/ +@[category research solved, AMS 5] +theorem erdos_800 : + ∃ C : ℝ, C > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (h : DecidableRel G.Adj), + haveI := h + (∀ u v, G.Adj u v → G.degree u < 3 ∨ G.degree v < 3) → + (graphRamseyNumber G : ℝ) ≤ C * (n : ℝ) := by + sorry + +end Erdos800 diff --git a/FormalConjectures/ErdosProblems/801.lean b/FormalConjectures/ErdosProblems/801.lean new file mode 100644 index 0000000000..c38556b14f --- /dev/null +++ b/FormalConjectures/ErdosProblems/801.lean @@ -0,0 +1,72 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 801 + +*Reference:* [erdosproblems.com/801](https://www.erdosproblems.com/801) + +If a graph on $n$ vertices has no independent set of size $> \sqrt{n}$, then there +exists a set of $\leq \sqrt{n}$ vertices containing $\gg \sqrt{n} \log n$ edges. + +[Er79g] Erdős, P., original problem statement (1979). + +[Al96b] Alon, N., _Independence numbers of locally sparse graphs and a Ramsey type problem_. +Random Structures & Algorithms **9** (1996), 271–278. +-/ + +open SimpleGraph Real Classical + +namespace Erdos801 + +/-- The number of edges in the subgraph of $G$ induced by a subset $S$ of vertices, +counted as the number of adjacent pairs $\{u, v\}$ with $u, v \in S$ and $u < v$. -/ +noncomputable def inducedEdgeCount {n : ℕ} + (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : ℕ := + (Finset.univ.filter (fun p : Fin n × Fin n => + p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2 ∧ G.Adj p.1 p.2)).card + +/-- +Erdős Problem 801 [Er79g]: + +If $G$ is a graph on $n$ vertices with no independent set of size $> \sqrt{n}$, +then there exists a set of $\leq \sqrt{n}$ vertices containing +$\gg \sqrt{n} \log n$ edges. + +Formally: there exists a constant $C > 0$ such that for all sufficiently large $n$, +for every graph $G$ on $n$ vertices, if $G$ has no independent set of size +$> \lfloor\sqrt{n}\rfloor$, then there exists a subset $S$ with +$|S| \leq \lfloor\sqrt{n}\rfloor$ and the number of edges in $G[S]$ is at least +$C \cdot \sqrt{n} \cdot \log n$. + +Proved by Alon [Al96b]. +-/ +@[category research solved, AMS 5] +theorem erdos_801 : + ∃ C : ℝ, 0 < C ∧ + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + α(G) ≤ Nat.sqrt n → + ∃ S : Finset (Fin n), + S.card ≤ Nat.sqrt n ∧ + C * (n : ℝ) ^ ((1 : ℝ) / 2) * Real.log (n : ℝ) ≤ + (inducedEdgeCount G S : ℝ) := by + sorry + +end Erdos801 diff --git a/FormalConjectures/ErdosProblems/802.lean b/FormalConjectures/ErdosProblems/802.lean new file mode 100644 index 0000000000..428a0b4c84 --- /dev/null +++ b/FormalConjectures/ErdosProblems/802.lean @@ -0,0 +1,68 @@ +/- +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 802 + +*Reference:* [erdosproblems.com/802](https://www.erdosproblems.com/802) + +A conjecture of Ajtai, Erdős, Komlós, and Szemerédi [AEKS81], who proved a +lower bound of $\gg_r (\log \log(t+1) / t) \cdot n$. Shearer [Sh95] improved this to +$\gg_r (\log t / (\log \log(t+1) \cdot t)) \cdot n$. Ajtai, Komlós, and Szemerédi [AKS80] +proved the conjectured bound when $r = 3$. Alon [Al96b] proved the conjectured +bound under the stronger assumption that the induced graph on every vertex +neighbourhood has chromatic number $\leq r - 2$. + +[AEKS81] Ajtai, M., Erdős, P., Komlós, J. and Szemerédi, E., _On Turán's theorem for +sparse graphs_. Combinatorica (1981), 313-317. + +[AKS80] Ajtai, M., Komlós, J. and Szemerédi, E., _A note on Ramsey numbers_. J. Combin. +Theory Ser. A (1980), 354-360. + +[Sh95] Shearer, J. B., _On the independence number of sparse graphs_. Random Structures +Algorithms (1995), 269-271. + +[Al96b] Alon, N., _Independence numbers of locally sparse graphs and a Ramsey type +problem_. Random Structures Algorithms (1996), 271-278. +-/ + +open SimpleGraph Finset + +namespace Erdos802 + +/-- +Erdős Problem 802 [AEKS81]: + +For every $r \geq 3$, there exists a constant $c > 0$ (depending on $r$) such that +every $K_r$-free graph $G$ on $n$ vertices with average degree $t \geq 2$ contains an +independent set of size at least $c \cdot (\log t / t) \cdot n$. +-/ +@[category research open, AMS 5] +theorem erdos_802 : answer(sorry) ↔ + ∀ (r : ℕ), r ≥ 3 → + ∃ c : ℝ, c > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.CliqueFree r → + let t : ℝ := (G.averageDegree : ℝ) + t ≥ 2 → + ∃ S : Finset (Fin n), + G.IsIndepSet ↑S ∧ + (S.card : ℝ) ≥ c * (Real.log t / t) * (n : ℝ) := by + sorry + +end Erdos802 diff --git a/FormalConjectures/ErdosProblems/803.lean b/FormalConjectures/ErdosProblems/803.lean new file mode 100644 index 0000000000..125ea7d440 --- /dev/null +++ b/FormalConjectures/ErdosProblems/803.lean @@ -0,0 +1,79 @@ +/- +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.Combinatorics.SimpleGraph.Balanced + +/-! +# Erdős Problem 803 + +*Reference:* [erdosproblems.com/803](https://www.erdosproblems.com/803) + +*Related:* [Erdős Problem 1077](https://www.erdosproblems.com/1077) + +We call a graph $H$ *$D$-balanced* (or *$D$-almost-regular*) if the maximum +degree of $H$ is at most $D$ times the minimum degree of $H$. + +A problem of Erdős and Simonovits [ErSi70]. Disproved by Alon [Al08], who +showed that for every $D > 1$ and large $n$ there is a graph $G$ with $n$ +vertices and $\geq n \log n$ edges such that every $D$-balanced subgraph on $m$ +vertices has $\ll m \sqrt{\log m} + \log D$ edges. + +Janzer and Sudakov [JaSu23] proved a partial positive result: any graph on $n$ +vertices with $\geq n \log n$ edges contains an $O(1)$-balanced subgraph on +$m \geq k$ vertices with $\gg_k \sqrt{\log m} / (\log \log m)^{3/2} \cdot m$ +edges. + +[ErSi70] Erdős, P. and Simonovits, M., _Some extremal problems in graph +theory_. Combinatorial theory and its applications, I–III (Proc. Colloq., +Balatonfüred, 1969) (1970), 377–390. + +[Al08] Alon, N., _Problems and results in extremal combinatorics. II_. +Discrete Mathematics (2008), 4460–4472. + +[JaSu23] Janzer, O. and Sudakov, B., _Resolution of the Erdős–Sauer problem +on regular subgraphs_. Forum Mathematics Pi (2023), Paper No. e19, 13 pages. +-/ + +open SimpleGraph Classical + +namespace Erdos803 + +/-- +Erdős Problem 803 [ErSi70] (Disproved by Alon [Al08]): + +Is it true that there exist absolute constants $D \geq 1$ and $C > 0$ such that +for every $m \geq 1$, there exists $N_0$ such that for all $n \geq N_0$, every +graph on $n$ vertices with at least $n \cdot \log(n)$ edges contains a +$D$-balanced subgraph on $m$ vertices with at least $C \cdot m \cdot \log(m)$ +edges? +-/ +@[category research solved, AMS 5] +theorem erdos_803 : + answer(False) ↔ + ∃ D : ℕ, D ≥ 1 ∧ ∃ C : ℝ, C > 0 ∧ + ∀ m : ℕ, m ≥ 1 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)), + (G.edgeFinset.card : ℝ) ≥ (n : ℝ) * Real.log (n : ℝ) → + ∃ (H : SimpleGraph (Fin m)) (f : Fin m → Fin n), + Function.Injective f ∧ + (∀ u v, H.Adj u v → G.Adj (f u) (f v)) ∧ + H.IsBalanced (D : ℝ) ∧ + (H.edgeFinset.card : ℝ) ≥ C * (m : ℝ) * Real.log (m : ℝ) := by + sorry + +end Erdos803 diff --git a/FormalConjectures/ErdosProblems/804.lean b/FormalConjectures/ErdosProblems/804.lean new file mode 100644 index 0000000000..b2ff5ebfec --- /dev/null +++ b/FormalConjectures/ErdosProblems/804.lean @@ -0,0 +1,115 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 804 + +*Reference:* [erdosproblems.com/804](https://www.erdosproblems.com/804) + +Let $f(m,n)$ be maximal such that any graph on $n$ vertices in which every induced +subgraph on $m$ vertices has an independent set of size at least $\log n$ must +contain an independent set of size at least $f(m,n)$. + +Estimate $f(n)$. In particular, is it true that $f((\log n)^2, n) \geq n^{1/2 - o(1)}$? +Is it true that $f((\log n)^3, n) \gg (\log n)^3$? + +A question of Erdős and Hajnal [Er91]. DISPROVED by Alon and Sudakov [AlSu07], +who proved that +$$(\log n)^2 / \log(\log n) \ll f((\log n)^2, n) \ll (\log n)^2$$ +and +$$f((\log n)^3, n) \asymp (\log n)^2 / \log(\log n).$$ + +See also problem 805. + +[Er91] Erdős, P., _Problems and results in combinatorial number theory_. + +[AlSu07] Alon, N. and Sudakov, B., _On graphs with subgraphs having large independence +numbers_. J. Graph Theory (2007), 149-157. +-/ + +open Classical SimpleGraph Finset + +namespace Erdos804 + +/-- $f(m, n)$ is the largest $k$ such that every graph on $n$ vertices + in which every induced subgraph on $m$ vertices has an independent set of + size $\geq \lceil \log n \rceil$ must have independence number $\geq k$. + + Equivalently, the infimum of independence numbers over all qualifying + graphs. -/ +noncomputable def erdos804_f (m n : ℕ) : ℕ := + -- Infimum over independence numbers of graphs satisfying the local + -- independence condition on every m-vertex induced subgraph. + sInf { k : ℕ | ∃ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), S.card = m → + ∃ T : Finset (Fin n), T ⊆ S ∧ T.card ≥ Nat.ceil (Real.log (n : ℝ)) ∧ + G.IsIndepSet (T : Set (Fin n))) ∧ + α(G) = k } + +/-- +Alon-Sudakov [AlSu07] upper bound: $f((\log n)^2, n) \leq C \cdot (\log n)^2$ +for some constant $C > 0$ and all sufficiently large $n$. + +This disproves the conjecture of Erdős and Hajnal that +$f((\log n)^2, n) \geq n^{1/2 - o(1)}$. +-/ +@[category research solved, AMS 5] +theorem erdos_804 : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos804_f (Nat.floor ((Real.log (n : ℝ)) ^ 2)) n : ℝ) ≤ + C * (Real.log (n : ℝ)) ^ 2 := by + sorry + +/-- +Alon-Sudakov [AlSu07] lower bound: $f((\log n)^2, n) \geq c \cdot (\log n)^2 / \log(\log n)$ +for some constant $c > 0$ and all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_804.variants.part1_lower : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos804_f (Nat.floor ((Real.log (n : ℝ)) ^ 2)) n : ℝ) ≥ + C * (Real.log (n : ℝ)) ^ 2 / Real.log (Real.log (n : ℝ)) := by + sorry + +/-- +Alon-Sudakov [AlSu07] upper bound: $f((\log n)^3, n) \leq C \cdot (\log n)^2 / \log(\log n)$ +for some constant $C > 0$ and all sufficiently large $n$. + +This disproves the conjecture of Erdős and Hajnal that +$f((\log n)^3, n) \gg (\log n)^3$. +-/ +@[category research solved, AMS 5] +theorem erdos_804.variants.part2_upper : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos804_f (Nat.floor ((Real.log (n : ℝ)) ^ 3)) n : ℝ) ≤ + C * (Real.log (n : ℝ)) ^ 2 / Real.log (Real.log (n : ℝ)) := by + sorry + +/-- +Alon-Sudakov [AlSu07] lower bound: $f((\log n)^3, n) \geq c \cdot (\log n)^2 / \log(\log n)$ +for some constant $c > 0$ and all sufficiently large $n$. +-/ +@[category research solved, AMS 5] +theorem erdos_804.variants.part2_lower : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos804_f (Nat.floor ((Real.log (n : ℝ)) ^ 3)) n : ℝ) ≥ + C * (Real.log (n : ℝ)) ^ 2 / Real.log (Real.log (n : ℝ)) := by + sorry + +end Erdos804 diff --git a/FormalConjectures/ErdosProblems/805.lean b/FormalConjectures/ErdosProblems/805.lean new file mode 100644 index 0000000000..d9b5185236 --- /dev/null +++ b/FormalConjectures/ErdosProblems/805.lean @@ -0,0 +1,101 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 805 + +*Reference:* [erdosproblems.com/805](https://www.erdosproblems.com/805) + +For which functions $g(n)$ with $n > g(n) \geq (\log n)^2$ is there a graph on $n$ vertices +in which every induced subgraph on $g(n)$ vertices contains a clique of size $\geq \log n$ +and an independent set of size $\geq \log n$? + +In particular, is there such a graph for $g(n) = (\log n)^3$? + +See also [Problem #804](https://www.erdosproblems.com/804). + +Additional thanks to Zach Hunter. + +[Er91] Erdős, P., _Problems and results in combinatorial number theory_. + +[AlSu07] Alon, N. and Sudakov, B., _On graphs with subgraphs having large independence +numbers_. J. Graph Theory (2007), 149-157. + +[ABS21] Alon, N., Bucić, M. and Sudakov, B., _Large cliques and independent sets all over +the place_. Proc. Amer. Math. Soc. (2021), 3145-3157. +-/ + +open SimpleGraph Finset + +namespace Erdos805 + +/-- The Erdős–Hajnal property for Problem 805: a graph $G$ on $\operatorname{Fin}(n)$ has + the property that every induced subgraph on $m$ vertices contains both a clique and an + independent set of size at least $k$. + + Note: This is distinct from the more famous "Erdős–Hajnal conjecture" about hereditary + graph properties and polynomial Ramsey numbers. -/ +def ErdosHajnalProperty {n : ℕ} (G : SimpleGraph (Fin n)) (m k : ℕ) : Prop := + ∀ S : Finset (Fin n), S.card = m → + (∃ T : Finset (Fin n), T ⊆ S ∧ T.card ≥ k ∧ G.IsClique ↑T) ∧ + (∃ T : Finset (Fin n), T ⊆ S ∧ T.card ≥ k ∧ G.IsIndepSet ↑T) + +/-- +Erdős–Hajnal conjecture [Er91]: is there a graph on $n$ vertices such that every +induced subgraph on $\lfloor (\log n)^3 \rfloor$ vertices contains both a clique and an +independent set of size $\geq \lceil \log n \rceil$? + +Erdős and Hajnal conjectured that the answer is no. +-/ +@[category research open, AMS 5] +theorem erdos_805 : answer(sorry) ↔ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ G : SimpleGraph (Fin n), ErdosHajnalProperty G + (Nat.floor ((Real.log (n : ℝ)) ^ 3)) + (Nat.ceil (Real.log (n : ℝ))) := by + sorry + +/-- +Alon–Sudakov [AlSu07]: there is no such graph with +$g(n) = c \cdot (\log n)^3 / \log(\log n)$ for some constant $c > 0$. +This is a partial result toward the Erdős–Hajnal conjecture. +-/ +@[category research solved, AMS 5] +theorem erdos_805.variants.alon_sudakov : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ¬∃ G : SimpleGraph (Fin n), ErdosHajnalProperty G + (Nat.floor (c * (Real.log (n : ℝ)) ^ 3 / Real.log (Real.log (n : ℝ)))) + (Nat.ceil (Real.log (n : ℝ))) := by + sorry + +/-- +Alon–Bucić–Sudakov [ABS21]: for every $\varepsilon > 0$, for sufficiently large $n$, +there exists a graph on $n$ vertices satisfying the property with +$g(n) = \lfloor 2^{2^{(\log \log n)^{1/2+\varepsilon}}} \rfloor$. +-/ +@[category research solved, AMS 5] +theorem erdos_805.variants.alon_bucic_sudakov : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ G : SimpleGraph (Fin n), ErdosHajnalProperty G + (Nat.floor ((2 : ℝ) ^ ((2 : ℝ) ^ ((Real.log (Real.log (n : ℝ))) ^ ((1 : ℝ) / 2 + ε))))) + (Nat.ceil (Real.log (n : ℝ))) := by + sorry + +end Erdos805 diff --git a/FormalConjectures/ErdosProblems/806.lean b/FormalConjectures/ErdosProblems/806.lean new file mode 100644 index 0000000000..c6df2a78d1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/806.lean @@ -0,0 +1,57 @@ +/- +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 806 + +Must every set $A \subseteq \{1, \ldots, n\}$ with $|A| \leq \sqrt{n}$ be contained in +$B + B$ for some $B \subset \mathbb{Z}$ with $|B| = o(\sqrt{n})$? + +*Reference:* [erdosproblems.com/806](https://www.erdosproblems.com/806) + +[ErNe77] Erdős, P. and Newman, D.J., *Bases for sets of integers*, J. Number Theory (1977), 420-425. + +[ABS09] Alon, N., Bukh, B., and Sudakov, B., *Discrete Kakeya-type problems and small bases for +the integers*, Israel J. Math. (2009), 285-301. + +See also: Erdős Problem 333 (the infinite/density-zero version of this finite problem). +-/ + +namespace Erdos806 + +/-- +Erdős Problem 806 [ErNe77]: + +For any $\varepsilon > 0$, for all sufficiently large $n$, for any $A \subseteq \{1, \ldots, n\}$ +with $|A| \leq \sqrt{n}$, there exists a finite set $B \subset \mathbb{Z}$ with +$|B| \leq \varepsilon \cdot \sqrt{n}$ such that every element of $A$ (viewed in $\mathbb{Z}$) +belongs to $B + B$. + +This captures the $o(\sqrt{n})$ conjecture. It was resolved by Alon, Bukh, and +Sudakov [ABS09] with the sharper bound $|B| \leq C \cdot (\log \log n / \log n) \cdot \sqrt{n}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_806 : answer(True) ↔ + ∀ (ε : ℝ), 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ A : Finset ℕ, (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) → (A.card : ℝ) ≤ Real.sqrt n → + ∃ B : Finset ℤ, (B.card : ℝ) ≤ ε * Real.sqrt n ∧ + ∀ a ∈ A, (a : ℤ) ∈ Finset.image₂ (· + ·) B B := by + sorry + +end Erdos806 diff --git a/FormalConjectures/ErdosProblems/807.lean b/FormalConjectures/ErdosProblems/807.lean new file mode 100644 index 0000000000..d5978c9c66 --- /dev/null +++ b/FormalConjectures/ErdosProblems/807.lean @@ -0,0 +1,94 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 807 + +*Reference:* [erdosproblems.com/807](https://www.erdosproblems.com/807) + +Is it true that for a random graph $G$ on $n$ vertices with edge probability $1/2$, +$\tau(G) = n - \alpha(G)$ almost surely? Here $\tau(G)$ is the bipartition number (the +smallest number of pairwise edge-disjoint complete bipartite graphs whose union is $G$) +and $\alpha(G)$ is the independence number. Disproved by Alon [Al15]. + +[KRW88] Kratzke, T., Reznick, B., West, D., _Eigensharp graphs: decomposition into complete +bipartite subgraphs_, Trans. Amer. Math. Soc. (1988). + +[Al15] Alon, N., _Bipartite decomposition of random graphs_, J. Graph Theory, 2015. + +[ABH17] Alon, N., Bohman, T. and Huang, H., _More on bipartite decomposition of random +graphs_, J. Graph Theory, 2017. +-/ + +open SimpleGraph Filter Classical + +open scoped Topology + +namespace Erdos807 + +/-- +A biclique cover of a simple graph $G$ of size $k$ consists of $k$ complete bipartite +subgraphs (specified by pairs of disjoint vertex sets) that are pairwise +edge-disjoint and together cover all edges of $G$. +-/ +def IsBicliqueCover {V : Type*} (G : SimpleGraph V) (k : ℕ) + (A B : Fin k → Set V) : Prop := + (∀ i, Disjoint (A i) (B i)) ∧ + (∀ i, ∀ a ∈ A i, ∀ b ∈ B i, G.Adj a b) ∧ + (∀ i j : Fin k, i ≠ j → + ∀ v w : V, ¬((v ∈ A i ∧ w ∈ B i ∨ w ∈ A i ∧ v ∈ B i) ∧ + (v ∈ A j ∧ w ∈ B j ∨ w ∈ A j ∧ v ∈ B j))) ∧ + (∀ v w : V, G.Adj v w → + ∃ i : Fin k, (v ∈ A i ∧ w ∈ B i) ∨ (w ∈ A i ∧ v ∈ B i)) + +/-- +The bipartition number $\tau(G)$ is the minimum number of pairwise edge-disjoint +complete bipartite subgraphs needed to cover all edges of $G$. +-/ +noncomputable def bipartitionNumber {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | ∃ (A B : Fin k → Set V), IsBicliqueCover G k A B} + +/-- +Erdős Problem 807 (disproved by Alon [Al15]): + +Is it true that for a random graph $G$ on $n$ vertices with edge probability $1/2$, +$\tau(G) = n - \alpha(G)$ almost surely? + +The bipartition number $\tau(G)$ is the smallest number of pairwise edge-disjoint +complete bipartite graphs whose union is $G$. The independence number $\alpha(G)$ is +the size of the largest independent set in $G$. + +In the $G(n, 1/2)$ model every labeled graph on $n$ vertices is equally likely, so +"almost surely" means the proportion of graphs satisfying the property tends +to $1$ as $n \to \infty$. + +Alon [Al15] showed this is false: almost surely $\tau(G) \leq n - \alpha(G) - 1$. +Alon, Bohman, and Huang [ABH17] proved there exists $c > 0$ such that +almost surely $\tau(G) \leq n - (1 + c)\alpha(G)$. +-/ +@[category research solved, AMS 5 60] +theorem erdos_807 : answer(False) ↔ + Tendsto (fun n : ℕ => + (Nat.card {G : SimpleGraph (Fin n) // + bipartitionNumber G = n - G.indepNum} : ℝ) / + (Nat.card (SimpleGraph (Fin n)) : ℝ)) + atTop (nhds 1) := by + sorry + +end Erdos807 diff --git a/FormalConjectures/ErdosProblems/808.lean b/FormalConjectures/ErdosProblems/808.lean new file mode 100644 index 0000000000..61a14f593d --- /dev/null +++ b/FormalConjectures/ErdosProblems/808.lean @@ -0,0 +1,82 @@ +/- +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 808 + +*Reference:* [erdosproblems.com/808](https://www.erdosproblems.com/808) + +Erdős conjectured that for any set $A \subset \mathbb{N}$ with $|A| = n$ and any graph $G$ on $A$ +with at least $n^{1+c}$ edges, the graph-restricted sumset or product set must satisfy +$\max(|A +_G A|, |A \cdot_G A|) \geq n^{1+c-\varepsilon}$. This strengthens Problem #52 +(the Erdős–Szemerédi sum-product conjecture). Disproved by Alon, Ruzsa, and Solymosi [ARS20]. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +[ErSz83] Erdős, P. and Szemerédi, E., _On sums and products of integers_. Studies in Pure +Mathematics, Birkhäuser, Basel (1983), 213–218. + +[Er91] Erdős, P., _Problems and results in combinatorial number theory_. + +[Er97] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_ (1997). + +[ARS20] Alon, N., Ruzsa, I., and Solymosi, J., _Sums, products, and ratios along the edges of a +graph_. Publ. Mat. (2020), 143–155. +-/ + +open SimpleGraph Finset + +namespace Erdos808 + +/-- The graph-restricted sumset $\{f(i) + f(j) : (i, j) \in E(G)\}$. -/ +def graphSumset {n : ℕ} (f : Fin n → ℕ) (G : SimpleGraph (Fin n)) + [DecidableRel G.Adj] : Finset ℕ := + (Finset.univ.filter (fun p : Fin n × Fin n => G.Adj p.1 p.2)).image + (fun p => f p.1 + f p.2) + +/-- The graph-restricted product set $\{f(i) \cdot f(j) : (i, j) \in E(G)\}$. -/ +def graphProdset {n : ℕ} (f : Fin n → ℕ) (G : SimpleGraph (Fin n)) + [DecidableRel G.Adj] : Finset ℕ := + (Finset.univ.filter (fun p : Fin n × Fin n => G.Adj p.1 p.2)).image + (fun p => f p.1 * f p.2) + +/-- +Erdős Problem 808 (disproved) [Er77c], [ErSz83], [Er91], [Er97]: + +For all $c, \varepsilon > 0$, for sufficiently large $n$, if $A \subset \mathbb{N}$ has +$|A| = n$ and $G$ is any graph on $A$ with at least $n^{1+c}$ edges then +$$ +\max(|A +_G A|, |A \cdot_G A|) \geq n^{1+c-\varepsilon}. +$$ + +Disproved by Alon, Ruzsa, and Solymosi [ARS20]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_808 : ¬ + (∀ (c ε : ℝ), 0 < c → 0 < ε → + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ (f : Fin n → ℕ), Function.Injective f → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (n : ℝ) ^ (1 + c) ≤ (G.edgeFinset.card : ℝ) → + (n : ℝ) ^ (1 + c - ε) ≤ + max ((graphSumset f G).card : ℝ) ((graphProdset f G).card : ℝ)) := by + sorry + +end Erdos808 diff --git a/FormalConjectures/ErdosProblems/809.lean b/FormalConjectures/ErdosProblems/809.lean new file mode 100644 index 0000000000..40d39ae385 --- /dev/null +++ b/FormalConjectures/ErdosProblems/809.lean @@ -0,0 +1,70 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Circulant +import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring + +/-! +# Erdős Problem 809 + +*Reference:* [erdosproblems.com/809](https://www.erdosproblems.com/809) + +Let $k \geq 3$ and define $F_k(n)$ to be the minimal $r$ such that for any graph $G$ +on $n$ vertices with $\lfloor n^2/4 \rfloor + 1$ edges, the edges can be $r$-coloured +so that every subgraph isomorphic to $C_{2k+1}$ is rainbow (no colour repeating on the edges). + +Is it true that $F_k(n) \sim n^2/8$? + +A problem of Burr, Erdős, Graham, and Sós [Er91], who proved that $F_k(n) \gg n^2$. + +See also [Erdős Problem 810](https://www.erdosproblems.com/810). + +[Er91] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) **47** (1992), no. 2, 231-240 (1993). +-/ + +open SimpleGraph + +namespace Erdos809 + +/-- For all graphs on $n$ vertices with $\lfloor n^2/4 \rfloor + 1$ edges, there exists an +$r$-edge-coloring such that every subgraph isomorphic to the cycle $C_{2k+1}$ is rainbow. -/ +noncomputable def AllAdmitRainbowOddCycleColoring (k n r : ℕ) : Prop := + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard = n ^ 2 / 4 + 1 → + ∃ c : Sym2 (Fin n) → Fin r, + ∀ (f : cycleGraph (2 * k + 1) →g G), + Function.Injective f → + IsRainbow f c + +/-- +**Erdős Problem 809**: $F_k(n) \sim n^2/8$ for all $k \geq 3$. + +For every $\varepsilon > 0$, for sufficiently large $n$, $F_k(n)$ lies between +$(1-\varepsilon)n^2/8$ and $(1+\varepsilon)n^2/8$. +-/ +@[category research open, AMS 5] +theorem erdos_809 : answer(sorry) ↔ + ∀ (k : ℕ), k ≥ 3 → ∀ (ε : ℝ), 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + (∃ r : ℕ, (↑r : ℝ) ≤ (1 + ε) * ↑n ^ 2 / 8 ∧ + AllAdmitRainbowOddCycleColoring k n r) ∧ + (∀ r : ℕ, (↑r : ℝ) < (1 - ε) * ↑n ^ 2 / 8 → + ¬AllAdmitRainbowOddCycleColoring k n r) := by + sorry + +end Erdos809 diff --git a/FormalConjectures/ErdosProblems/81.lean b/FormalConjectures/ErdosProblems/81.lean new file mode 100644 index 0000000000..e62f8b4af2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/81.lean @@ -0,0 +1,119 @@ +/- +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 81 + +*Reference:* [erdosproblems.com/81](https://www.erdosproblems.com/81) + +Can the edges of a chordal graph on $n$ vertices be partitioned into at most +$n^2/6 + O(n)$ cliques? + +[EOZ93] Erdős, P., Ordman, E.T., and Zalcstein, Y., *Clique partitions of chordal graphs*, +Combinatorics, Probability and Computing **2** (1993), 409-415. + +[CEO94] Chen, G., Erdős, P., and Ordman, E.T., *Clique partitions of split graphs*, +Combinatorics, graph theory, algorithms and applications (Beijing, 1993) (1994), 21-30. + +See also: [Erdős Problem 1017](https://www.erdosproblems.com/1017) (general clique partition +numbers). +-/ + +open SimpleGraph + +namespace Erdos81 + +/-- +An induced cycle of length $k$ in a simple graph $G$: an injective map +$f : \text{Fin}\ k \to V$ such that $f(i)$ and $f(j)$ are adjacent if and only if +$i$ and $j$ are consecutive modulo $k$. This captures the notion that $f$ traces out a +cycle with no chords. +-/ +def HasInducedCycle {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ f : Fin k → V, Function.Injective f ∧ + ∀ i j : Fin k, i ≠ j → + (G.Adj (f i) (f j) ↔ (i.val + 1) % k = j.val ∨ (j.val + 1) % k = i.val) + +/-- +A graph is chordal if it contains no induced cycle of length $\geq 4$. +Equivalently, every cycle of length $\geq 4$ has a chord. +-/ +def IsChordal {V : Type*} (G : SimpleGraph V) : Prop := + ∀ k : ℕ, 4 ≤ k → ¬HasInducedCycle G k + +/-- +Erdős Problem 81 (Erdős, Ordman, Zalcstein [EOZ93]): + +Let $G$ be a chordal graph on $n$ vertices — that is, $G$ has no induced cycles of +length greater than 3. Can the edges of $G$ be partitioned into $n^2/6 + O(n)$ +many cliques? + +The example of all edges between a complete graph on $n/3$ vertices and an empty +graph on $2n/3$ vertices shows that $n^2/6 + O(n)$ is sometimes necessary. + +Formalized as: there exists a constant $C > 0$ such that for all $n$ and all +chordal graphs $G$ on $n$ vertices, there exists a collection $P$ of cliques +(vertex sets, each pairwise adjacent in $G$) that partition the edges of $G$, +with $|P| \leq n^2/6 + Cn$. +-/ +@[category research open, AMS 5] +theorem erdos_81 : answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + IsChordal G → + ∃ P : Finset (Finset (Fin n)), + -- Each set in P is a clique in G + (∀ S ∈ P, G.IsClique (↑S : Set (Fin n))) ∧ + -- Every edge of G is covered by some clique in P + (∀ u v : Fin n, G.Adj u v → ∃ S ∈ P, u ∈ S ∧ v ∈ S) ∧ + -- No edge belongs to two distinct cliques (partition, not just cover): + -- if u, v are both in S₁ and S₂ with S₁ ≠ S₂, then {u,v} is not an edge. + (∀ S₁ ∈ P, ∀ S₂ ∈ P, S₁ ≠ S₂ → + ∀ u v : Fin n, u ∈ S₁ → v ∈ S₁ → u ∈ S₂ → v ∈ S₂ → ¬G.Adj u v) ∧ + -- The number of cliques is at most n²/6 + C·n + (P.card : ℝ) ≤ (n : ℝ) ^ 2 / 6 + C * (n : ℝ) := by + sorry + +/-- +A graph is a split graph if its vertices can be partitioned into a clique and an +independent set. +-/ +def IsSplitGraph {V : Type*} (G : SimpleGraph V) : Prop := + ∃ (S T : Set V), S ∪ T = Set.univ ∧ Disjoint S T ∧ + G.IsClique S ∧ ∀ u ∈ T, ∀ v ∈ T, u ≠ v → ¬G.Adj u v + +/-- +Split graph variant of Erdős Problem 81 (Chen, Erdős, Ordman [CEO94]): + +For split graphs (vertices partition into a clique and an independent set), the edges +can be partitioned into at most $3n^2/16 + O(n)$ cliques. +-/ +@[category research solved, AMS 5] +theorem erdos_81_split : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + IsSplitGraph G → + ∃ P : Finset (Finset (Fin n)), + (∀ S ∈ P, G.IsClique (↑S : Set (Fin n))) ∧ + (∀ u v : Fin n, G.Adj u v → ∃ S ∈ P, u ∈ S ∧ v ∈ S) ∧ + (∀ S₁ ∈ P, ∀ S₂ ∈ P, S₁ ≠ S₂ → + ∀ u v : Fin n, u ∈ S₁ → v ∈ S₁ → u ∈ S₂ → v ∈ S₂ → ¬G.Adj u v) ∧ + (P.card : ℝ) ≤ 3 * (n : ℝ) ^ 2 / 16 + C * (n : ℝ) := by + sorry + +end Erdos81 diff --git a/FormalConjectures/ErdosProblems/810.lean b/FormalConjectures/ErdosProblems/810.lean new file mode 100644 index 0000000000..006c859c16 --- /dev/null +++ b/FormalConjectures/ErdosProblems/810.lean @@ -0,0 +1,62 @@ +/- +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 810 + +*Reference:* [erdosproblems.com/810](https://www.erdosproblems.com/810) + +A problem of Burr, Erdős, Graham, and Sós. Asks whether there exists ε > 0 such that, for all +sufficiently large n, some n-vertex graph with at least εn² edges admits an n-coloring of its edges +where every C₄ is rainbow. + +See also Problem 809. + +[Er91] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) **47** (1992), no. 2, 231-240 (1993). +-/ + +namespace Erdos810 + +/-- A graph on $n$ vertices admits a rainbow $C_4$ coloring with $n$ colors if there + exists an edge coloring using $n$ colors such that every 4-cycle in the + graph has all 4 edges receiving distinct colors. -/ +def AdmitsRainbowC4Coloring (n : ℕ) (G : SimpleGraph (Fin n)) : Prop := + ∃ col : Sym2 (Fin n) → Fin n, + ∀ (a b c d : Fin n), + [a, b, c, d].Nodup → + G.Adj a b → G.Adj b c → G.Adj c d → G.Adj d a → + [col (Sym2.mk (a, b)), col (Sym2.mk (b, c)), + col (Sym2.mk (c, d)), col (Sym2.mk (d, a))].Nodup + +/-- +**Erdős Problem 810**: Does there exist some $\varepsilon > 0$ such that, for all +sufficiently large $n$, there exists a graph $G$ on $n$ vertices with at least +$\varepsilon n^2$ many edges such that the edges can be coloured with $n$ colours so that +every $C_4$ receives 4 distinct colours? +-/ +@[category research open, AMS 5] +theorem erdos_810 : answer(sorry) ↔ + ∃ ε : ℝ, 0 < ε ∧ + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ G : SimpleGraph (Fin n), + (G.edgeSet.ncard : ℝ) ≥ ε * (n : ℝ) ^ 2 ∧ + AdmitsRainbowC4Coloring n G := by + sorry + +end Erdos810 diff --git a/FormalConjectures/ErdosProblems/811.lean b/FormalConjectures/ErdosProblems/811.lean new file mode 100644 index 0000000000..299d6bde94 --- /dev/null +++ b/FormalConjectures/ErdosProblems/811.lean @@ -0,0 +1,84 @@ +/- +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 811 + +*Reference:* [erdosproblems.com/811](https://www.erdosproblems.com/811) + +Suppose $n \equiv 1 \pmod{m}$. We say that an edge-colouring of $K_n$ using $m$ colours +is balanced if every vertex sees exactly $\lfloor n/m \rfloor$ edges of each colour. + +For which graphs $G$ is it true that, if $m = e(G)$, for all large $n \equiv 1 \pmod{m}$, +every balanced edge-colouring of $K_n$ with $m$ colours contains a rainbow copy +of $G$? (That is, a subgraph isomorphic to $G$ where each edge receives a +different colour.) + +A problem of Erdős, Pyber, and Tuza. + +[Er91] Erdős, P., _Problems and results in combinatorial analysis and combinatorial number theory_. +Graph theory, combinatorics, and applications, Vol. 1 (Kalamazoo, MI, 1988), 1991, 397–406. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae **16** (1993), 333–350, p. 346. + +[ErTu93] Erdős, P. and Tuza, Zs., _Rainbow subgraphs in edge-colorings of complete graphs_ (1993), +81–88. + +[Er96] Erdős, P., _Some of my favourite problems on cycles and colourings_. +Tatra Mt. Math. Publ. (1996), 7–9. + +[ClWa23] Clemen, F. C. and Wagner, A. Z., _Balanced edge-colorings avoiding rainbow cliques of +size four_. Electron. J. Combin. (2023), Paper No. 3.17. + +[AxCl24] Axenovich, M. and Clemen, F. C., _Rainbow subgraphs in edge-colored complete graphs: +answering two questions by Erdős and Tuza_. J. Graph Theory (2024), 57–66. +-/ + +open SimpleGraph Finset + +namespace Erdos811 + +/-- An edge-colouring of the complete graph on $\operatorname{Fin} n$ with $m$ colours is + **balanced** if every vertex sees exactly $\lfloor n / m \rfloor$ edges of each colour. + (When $n \equiv 1 \pmod{m}$, the degree $n - 1$ divides evenly as + $m \cdot \lfloor n / m \rfloor$.) -/ +def IsBalancedColoring (n m : ℕ) (c : Sym2 (Fin n) → Fin m) : Prop := + ∀ (v : Fin n) (i : Fin m), + (Finset.univ.filter (fun w : Fin n => w ≠ v ∧ + c (Sym2.mk (v, w)) = i)).card = n / m + +/-- +**Erdős Problem 811** (specific challenge from [Er91] and [Er96]): + +For all sufficiently large $n \equiv 1 \pmod{6}$, every balanced edge-colouring +of $K_n$ with $6$ colours contains a rainbow copy of $C_6$. + +The companion question about $K_4$ (which also has $6$ edges) was answered +negatively by Clemen and Wagner [ClWa23]. +-/ +@[category research open, AMS 5] +theorem erdos_811 : + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → n % 6 = 1 → + ∀ c : Sym2 (Fin n) → Fin 6, + IsBalancedColoring n 6 c → + ∃ f : (cycleGraph 6) →g (⊤ : SimpleGraph (Fin n)), + Function.Injective f ∧ IsRainbow f c := by + sorry + +end Erdos811 diff --git a/FormalConjectures/ErdosProblems/812.lean b/FormalConjectures/ErdosProblems/812.lean new file mode 100644 index 0000000000..b0105b3045 --- /dev/null +++ b/FormalConjectures/ErdosProblems/812.lean @@ -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 + +/-! +# Erdős Problem 812 + +*Reference:* [erdosproblems.com/812](https://www.erdosproblems.com/812) + +Is it true that $R(n+1)/R(n) \geq 1 + c$ for some constant $c > 0$, for all large $n$? +Is it true that $R(n+1) - R(n) \gg n^2$? + +Here $R(n)$ denotes the diagonal Ramsey number $R(n,n)$: the minimum $N$ such that +every simple graph on $N$ vertices contains either a clique of size $n$ or an +independent set of size $n$. + +[BEFS89] Burr, S.A., Erdős, P., Faudree, R.J., and Schelp, R.H., +_On the difference between consecutive Ramsey numbers_. Utilitas Math. (1989), 115–118. +Proved that $R(n+1) - R(n) \geq 4n - 8$ for all $n \geq 2$. + +Results from Problem 165 imply $R(n+2) - R(n) \gg n^{2-o(1)}$. + +[Er91] Erdős, P., _Problems and results on graphs and hypergraphs_, 1991. +-/ + +open SimpleGraph + +namespace Erdos812 + +/-- The diagonal Ramsey number $R(n) = R(n,n)$: the minimum $N$ such that every +simple graph on $N$ vertices contains either an $n$-clique or an independent +set of size $n$ (an $n$-clique in the complement). -/ +noncomputable def diagonalRamsey (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree n ∨ ¬Gᶜ.CliqueFree n} + +/-- +**Erdős Problem 812, Part 1** [Er91]: + +Is it true that there exists a constant $c > 0$ such that $R(n+1)/R(n) \geq 1 + c$ for all +sufficiently large $n$? That is, do the diagonal Ramsey numbers grow at least +geometrically? +-/ +@[category research open, AMS 5] +theorem erdos_812 : answer(sorry) ↔ + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (diagonalRamsey (n + 1) : ℝ) / (diagonalRamsey n : ℝ) ≥ 1 + c := by + sorry + +/-- +**Erdős Problem 812, Part 2** [Er91]: + +Is it true that $R(n+1) - R(n) \gg n^2$, i.e., there exists a constant $c > 0$ such that +$R(n+1) - R(n) \geq c \cdot n^2$ for all sufficiently large $n$? +-/ +@[category research open, AMS 5] +theorem erdos_812.variants.quadratic_gap : answer(sorry) ↔ + ∃ c : ℝ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (diagonalRamsey (n + 1) : ℝ) - (diagonalRamsey n : ℝ) ≥ c * (n : ℝ) ^ 2 := by + sorry + +end Erdos812 diff --git a/FormalConjectures/ErdosProblems/813.lean b/FormalConjectures/ErdosProblems/813.lean new file mode 100644 index 0000000000..4d82e48065 --- /dev/null +++ b/FormalConjectures/ErdosProblems/813.lean @@ -0,0 +1,103 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 813 + +*Reference:* [erdosproblems.com/813](https://www.erdosproblems.com/813) + +A problem of Erdős and Hajnal [Er90b], who proved $n^{1/3} \ll h(n) \ll n^{1/2}$. +Bucić and Sudakov [BuSu23] proved $h(n) \gg n^{5/12 - o(1)}$. + +[Er90b] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and +differences_. Mathematics of Ramsey theory, Algorithms Combin., 5 (1990), 12-28. + +[BuSu23] Bucić, M. and Sudakov, B., _Large independent sets from local considerations_. +arXiv:2007.03667 (2023). +-/ + +open SimpleGraph Classical + +namespace Erdos813 + +/-- A graph on $n$ vertices has the property that every subset of $7$ vertices + contains a triangle (three mutually adjacent vertices). -/ +def EverySevenSetHasTriangle {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∀ S : Finset (Fin n), S.card = 7 → + ∃ a b c, a ∈ S ∧ b ∈ S ∧ c ∈ S ∧ + a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ + G.Adj a b ∧ G.Adj a c ∧ G.Adj b c + +/-- $h(n)$ is the minimum clique number over all graphs on $n$ vertices in which + every set of $7$ vertices contains a triangle. -/ +noncomputable def erdos813H (n : ℕ) : ℕ := + sInf (SimpleGraph.cliqueNum '' {G : SimpleGraph (Fin n) | EverySevenSetHasTriangle G}) + +/-- +Erdős Problem 813 [Er90b]: + +There exist constants $c_1, c_2 > 0$ such that for all sufficiently large $n$, +$$ + C_1 \cdot n^{1/3 + c_1} \leq h(n) \leq C_2 \cdot n^{1/2 - c_2}. +$$ +-/ +@[category research open, AMS 05] +theorem erdos_813 : + ∃ c₁ : ℝ, c₁ > 0 ∧ + ∃ c₂ : ℝ, c₂ > 0 ∧ + ∃ C₁ : ℝ, C₁ > 0 ∧ + ∃ C₂ : ℝ, C₂ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C₁ * (n : ℝ) ^ ((1 : ℝ) / 3 + c₁) ≤ (erdos813H n : ℝ) ∧ + (erdos813H n : ℝ) ≤ C₂ * (n : ℝ) ^ ((1 : ℝ) / 2 - c₂) := by + sorry + +/-- +Erdős–Hajnal basic bounds [Er90b]: + +The known result $n^{1/3} \ll h(n) \ll n^{1/2}$, i.e., there exist constants +$C_1, C_2 > 0$ and a threshold $N_0$ such that for all $n \geq N_0$, +$C_1 \cdot n^{1/3} \leq h(n) \leq C_2 \cdot n^{1/2}$. +-/ +@[category research solved, AMS 05] +theorem erdos_813_basic_bounds : + ∃ C₁ : ℝ, C₁ > 0 ∧ + ∃ C₂ : ℝ, C₂ > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C₁ * (n : ℝ) ^ ((1 : ℝ) / 3) ≤ (erdos813H n : ℝ) ∧ + (erdos813H n : ℝ) ≤ C₂ * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Bucić–Sudakov lower bound [BuSu23]: + +The improved lower bound $h(n) \gg n^{5/12 - o(1)}$, formalized as: for every $\varepsilon > 0$, +there exist $C > 0$ and $N_0$ such that $h(n) \geq C \cdot n^{5/12 - \varepsilon}$ for all +$n \geq N_0$. This partially resolves the lower bound side of the main conjecture since +$5/12 > 1/3$. +-/ +@[category research solved, AMS 05] +theorem erdos_813_bucic_sudakov : + ∀ ε : ℝ, ε > 0 → + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + C * (n : ℝ) ^ ((5 : ℝ) / 12 - ε) ≤ (erdos813H n : ℝ) := by + sorry + +end Erdos813 diff --git a/FormalConjectures/ErdosProblems/814.lean b/FormalConjectures/ErdosProblems/814.lean new file mode 100644 index 0000000000..feea97c462 --- /dev/null +++ b/FormalConjectures/ErdosProblems/814.lean @@ -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 + +/-! +# Erdős Problem 814 + +*Reference:* [erdosproblems.com/814](https://www.erdosproblems.com/814) + +Let $k \geq 2$ and $G$ be a graph with $n \geq k-1$ vertices and +$(k-1)(n-k+2) + \binom{k-2}{2} + 1$ edges. Does there exist some $c_k > 0$ such that $G$ +must contain an induced subgraph on at most $(1-c_k)n$ vertices with minimum degree at least $k$? + +The case $k=3$ was a problem of Erdős and Hajnal [Er91]. The question for general $k$ was a +conjecture of Erdős, Faudree, Rousseau, and Schelp [EFRS90], who proved that such a subgraph +exists with at most $n - c_k\sqrt{n}$ vertices. Mousset, Noever, and Skorić [MNS17] improved +this to $n - c_k \cdot n / \log n$. The full conjecture was proved by Sauermann [Sa19] with +$c_k \gg 1/k^3$. + +[EFRS90] Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., +_Subgraphs of minimal degree k_. Discrete Mathematics (1990), 53–58. + +[Er91] Erdős, P., _Problems and results in combinatorial analysis and combinatorial number +theory_. Graph theory, combinatorics, and applications, Vol. 1 (Kalamazoo, MI, 1988), 1991, +397–406. + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is eighty, +Vol. 2 (Keszthely, 1993), 97–132, p.344. + +[MNS17] Mousset, F., Noever, A., and Skorić, N., _Smaller subgraphs of minimum degree k_. +Electronic Journal of Combinatorics (2017), Paper No. 4.9, 8 pp. + +[Sa19] Sauermann, L., _A proof of a conjecture of Erdős, Faudree, Rousseau and Schelp on +subgraphs of minimum degree k_. Journal of Combinatorial Theory, Series B (2019), 36–75. +-/ + +open SimpleGraph Finset + +namespace Erdos814 + +/-- +Erdős Problem 814 [EFRS90][Er91]: + +For every $k \geq 2$, there exists $c > 0$ such that for all sufficiently large $n$, +every graph $G$ on $n$ vertices with at least $(k-1)(n-k+2) + \binom{k-2}{2} + 1$ edges +contains a nonempty vertex subset $S$ with $|S| \leq (1-c) \cdot n$ such that every vertex +in $S$ has at least $k$ neighbors within $S$. +-/ +@[category research solved, AMS 5] +theorem erdos_814 : + answer(True) ↔ + ∀ k : ℕ, k ≥ 2 → + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.edgeFinset.card ≥ (k - 1) * (n - k + 2) + (k - 2).choose 2 + 1 → + ∃ S : Finset (Fin n), + (S.card : ℝ) ≤ (1 - c) * (n : ℝ) ∧ + S.Nonempty ∧ + ∀ v ∈ S, k ≤ (S.filter (fun w => G.Adj v w)).card := by + sorry + +end Erdos814 diff --git a/FormalConjectures/ErdosProblems/815.lean b/FormalConjectures/ErdosProblems/815.lean new file mode 100644 index 0000000000..d2b4116f2b --- /dev/null +++ b/FormalConjectures/ErdosProblems/815.lean @@ -0,0 +1,78 @@ +/- +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 815 + +*Reference:* [erdosproblems.com/815](https://www.erdosproblems.com/815) + +Let $k \geq 3$ and $n$ be sufficiently large. Is it true that if $G$ is a graph +with $n$ vertices and $2n - 2$ edges such that every proper induced subgraph has +minimum degree $\leq 2$ then $G$ must contain a copy of $C_k$? + +Such graphs are called *degree 3 critical*. This conjecture was **disproved** by +Narins, Pokrovskiy, and Szabó [NPS17], who proved that there exist arbitrarily +large such graphs with no cycle of length $23$. + +It remains open whether the answer is affirmative when restricted to even $k$. + +[EFGS88] Erdős, P., Faudree, R., Gyárfás, A. and Schelp, R. H., _Cycles in graphs without +proper subgraphs of minimum degree 3_. Ars Combinatoria (1988), 195–201. + +[NPS17] Narins, L., Pokrovskiy, A. and Szabó, T., _Graphs without proper subgraphs of +minimum degree 3 and short cycles_. Combinatorica (2017), 495–519. +-/ + +open Filter SimpleGraph + +namespace Erdos815 + +/-- A graph on `Fin n` is *degree 3 critical* if it has $2n - 2$ edges and every + proper induced subgraph has a vertex of degree at most $2$. -/ +noncomputable def IsDegree3Critical {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + G.edgeSet.ncard = 2 * n - 2 ∧ + ∀ S : Finset (Fin n), S.Nonempty → S ⊂ Finset.univ → + ∃ v ∈ S, ((↑S : Set (Fin n)) ∩ G.neighborSet v).ncard ≤ 2 + +/-- +**Erdős Problem 815** (disproved by Narins–Pokrovskiy–Szabó [NPS17]): + +Is it true that for every $k \geq 3$, every sufficiently large degree 3 +critical graph contains a cycle of length $k$? The answer is **no**. +-/ +@[category research solved, AMS 5] +theorem erdos_815 : answer(False) ↔ + ∀ k : ℕ, k ≥ 3 → ∀ᶠ n in atTop, + ∀ (G : SimpleGraph (Fin n)), IsDegree3Critical G → + ∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = k := by + sorry + +/-- +**Erdős Problem 815 (even-k variant):** + +It remains open whether for every $k \geq 2$, every sufficiently large degree 3 +critical graph contains a cycle of length $2k$ (i.e., every even length $\geq 4$). +-/ +@[category research open, AMS 5] +theorem erdos_815.variants.even_cycle : + ∀ k : ℕ, k ≥ 2 → ∀ᶠ n in atTop, + ∀ (G : SimpleGraph (Fin n)), IsDegree3Critical G → + ∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = 2 * k := by + sorry + +end Erdos815 diff --git a/FormalConjectures/ErdosProblems/816.lean b/FormalConjectures/ErdosProblems/816.lean new file mode 100644 index 0000000000..043054a03d --- /dev/null +++ b/FormalConjectures/ErdosProblems/816.lean @@ -0,0 +1,62 @@ +/- +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 816 + +*Reference:* [erdosproblems.com/816](https://www.erdosproblems.com/816) + +Let $G$ be a graph with $2n+1$ vertices and $n^2+n+1$ edges. Must $G$ contain two +vertices of the same degree which are joined by a path of length $3$? + +A problem of Erdős and Hajnal. The example of $K_{n,n+1}$ shows that this fails +if we only have $n^2+n$ edges. + +This was proved by Chen and Ma [ChMa25], who showed the stronger statement that, +provided $n \geq 600$, all graphs with $2n+1$ vertices and at least $n^2+n$ edges +contain two vertices of the same degree joined by a path of length $3$, except +$K_{n,n+1}$. + +[Er91] Erdős, P., _Problems and results in combinatorial analysis and combinatorial +number theory_. Graph theory, combinatorics, and applications, Vol. 1 (Kalamazoo, +MI, 1988), 1991, 397–406. + +[ChMa25] Chen, K., Ma, J., _A problem of Erdős and Hajnal on paths with +equal-degree endpoints_. arXiv:2503.19569, 2025. +-/ + +open SimpleGraph + +namespace Erdos816 + +/-- +**Erdős Problem 816** (proved by Chen–Ma [ChMa25]): + +For every $n$, every graph on $2n+1$ vertices with $n^2+n+1$ edges contains +two vertices of the same degree joined by a path of length $3$. +-/ +@[category research solved, AMS 5] +theorem erdos_816 : answer(True) ↔ + ∀ n : ℕ, ∀ (G : SimpleGraph (Fin (2 * n + 1))) [DecidableRel G.Adj], + G.edgeSet.ncard = n ^ 2 + n + 1 → + ∃ v w : Fin (2 * n + 1), v ≠ w ∧ + G.degree v = G.degree w ∧ + ∃ p : G.Walk v w, p.IsPath ∧ p.length = 3 := by + sorry + +end Erdos816 diff --git a/FormalConjectures/ErdosProblems/818.lean b/FormalConjectures/ErdosProblems/818.lean new file mode 100644 index 0000000000..a4478231ce --- /dev/null +++ b/FormalConjectures/ErdosProblems/818.lean @@ -0,0 +1,78 @@ +/- +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 818 + +*Reference:* [erdosproblems.com/818](https://www.erdosproblems.com/818) + +Let $A$ be a finite set of integers such that $|A+A| \ll |A|$. Is it true that +$$|AA| \gg \frac{|A|^2}{(\log |A|)^C}$$ +for some constant $C > 0$? + +A problem of Erdős [Er91]. This was proved by Solymosi [So09d], in the strong form +$|AA| \gg |A|^2 / \log |A|$. + +[Er91] Erdős, P., _Some of my favourite problems in number theory, combinatorics, and geometry_. Resenhas do Instituto de Matemática e Estatística da Universidade de São Paulo (1991). + +[So09d] Solymosi, J., _Bounding multiplicative energy by the sumset_. Advances in Mathematics (2009), 402-408. + +See also [erdosproblems.com/52](https://www.erdosproblems.com/52) (Erdős–Szemerédi sum-product conjecture). +-/ + +open Finset Real + +open scoped Pointwise + +namespace Erdos818 + +/-- +**Erdős Problem 818** (proved by Solymosi [So09d]): + +There exists a constant $C > 0$ such that for every $K > 0$, there exists $c > 0$ +such that for every finite set $A$ of integers with $|A + A| \leq K \cdot |A|$, +we have $|A \cdot A| \geq c \cdot |A|^2 / (\log |A|)^C$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_818 : + answer(True) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ K : ℝ, K > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + ((A + A).card : ℝ) ≤ K * A.card → + ((A * A).card : ℝ) ≥ c * (A.card : ℝ) ^ 2 / (Real.log (A.card : ℝ)) ^ C := by + sorry + +/-- +**Solymosi's theorem** (strong form of Erdős Problem 818): + +Solymosi [So09d] proved that for every $K > 0$, there exists $c > 0$ such that for every +finite set $A$ of integers with $|A + A| \leq K \cdot |A|$, we have +$|A \cdot A| \geq c \cdot |A|^2 / \log |A|$. This is the case $C = 1$ of the main problem. +-/ +@[category research solved, AMS 5 11] +theorem erdos_818.variants.solymosi : + ∀ K : ℝ, K > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + ((A + A).card : ℝ) ≤ K * A.card → + ((A * A).card : ℝ) ≥ c * (A.card : ℝ) ^ 2 / Real.log (A.card : ℝ) := by + sorry + +end Erdos818 diff --git a/FormalConjectures/ErdosProblems/819.lean b/FormalConjectures/ErdosProblems/819.lean new file mode 100644 index 0000000000..19f4a5c754 --- /dev/null +++ b/FormalConjectures/ErdosProblems/819.lean @@ -0,0 +1,75 @@ +/- +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 819 + +*Reference:* [erdosproblems.com/819](https://www.erdosproblems.com/819) + +Let $f(N)$ be maximal such that there exists $A\subseteq \{1,\ldots,N\}$ with +$|A|=\lfloor N^{1/2}\rfloor$ such that $|(A+A)\cap [1,N]|=f(N)$. Estimate $f(N)$. + +Erdős and Freud [ErFr91] proved +$(3/8-o(1))N \leq f(N) \leq (1/2+o(1))N$, +and note that it is closely connected to the size of the largest quasi-Sidon set +(see [840]). + +[Er91] Erdős, P., _Problems and results in combinatorial number theory_. + +[ErFr91] Erdős, P. and Freud, R., _On sums of a Sidon-sequence_. J. Number Theory (1991), 196–205. +-/ + +open Finset + +open scoped Pointwise + +namespace Erdos819 + +/-- The maximum of $|(A + A) \cap \{1, \ldots, N\}|$ over all $A \subseteq \{1, \ldots, N\}$ with +$|A| = \lfloor\sqrt{N}\rfloor$. -/ +noncomputable def f (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter (fun A => A.card = Nat.sqrt N)).sup + (fun A => ((A + A) ∩ Finset.Icc 1 N).card) + +/-- +**Erdős Problem 819** — Lower bound (Erdős–Freud [ErFr91]): + +For every $\varepsilon > 0$, for sufficiently large $N$, +$f(N) \geq (3/8 - \varepsilon) N$. +-/ +@[category research solved, AMS 5] +theorem erdos_819 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (↑(f N) : ℝ) ≥ (3 / 8 - ε) * (↑N : ℝ) := by + sorry + +/-- +**Erdős Problem 819** — Upper bound (Erdős–Freud [ErFr91]): + +For every $\varepsilon > 0$, for sufficiently large $N$, +$f(N) \leq (1/2 + \varepsilon) N$. +-/ +@[category research solved, AMS 5] +theorem erdos_819.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (↑(f N) : ℝ) ≤ (1 / 2 + ε) * (↑N : ℝ) := by + sorry + +end Erdos819 diff --git a/FormalConjectures/ErdosProblems/820.lean b/FormalConjectures/ErdosProblems/820.lean new file mode 100644 index 0000000000..6f64bccee2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/820.lean @@ -0,0 +1,96 @@ +/- +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 820 + +*Reference:* [erdosproblems.com/820](https://www.erdosproblems.com/820) + +Let $H(n)$ be the smallest integer $l \geq 2$ such that there exists $k$ with +$2 \leq k < l$ and $\gcd(k^n - 1, l^n - 1) = 1$. + +The sequence $H(n)$ for $1 \leq n \leq 10$ is $3, 3, 3, 6, 3, 18, 3, 6, 3, 12$. + +Erdős proved $H(n) > \exp(n^{c/(\log\log n)^2})$ for infinitely many $n$. +Wouter van Doorn sketched a proof of the stronger bound +$H(n) > \exp(n^{c/\log\log n})$ for infinitely many $n$. + +See also: [Problem 770](https://www.erdosproblems.com/770), +[OEIS A263647](https://oeis.org/A263647) (values of $n$ where $\gcd(2^n - 1, 3^n - 1) = 1$). + +[Er74b] Erdős, P., *Remarks on some problems in number theory*. Math. Balkanica (1974), 197-202. +-/ + +namespace Erdos820 + +/-- $H(n)$ is the smallest integer $l \geq 2$ such that there exists $k$ with +$2 \leq k < l$ and $\gcd(k^n - 1, l^n - 1) = 1$. -/ +noncomputable def H (n : ℕ) : ℕ := + sInf {l : ℕ | 2 ≤ l ∧ ∃ k : ℕ, 2 ≤ k ∧ k < l ∧ Nat.Coprime (k ^ n - 1) (l ^ n - 1)} + +/-- +**Erdős Problem 820** — Part 1: + +Is it true that $\gcd(2^n - 1, 3^n - 1) = 1$ for infinitely many $n$? +Equivalently, $H(n) = 3$ for infinitely many $n$. +-/ +@[category research open, AMS 11] +theorem erdos_820 : answer(sorry) ↔ + ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ Nat.Coprime (2 ^ n - 1) (3 ^ n - 1) := by + sorry + +/-- +**Erdős Problem 820** — Part 2 (asymptotic growth of $H(n)$): + +Does there exist a single constant $c > 0$ such that for all $\varepsilon > 0$: +- $H(n) > \exp(n^{(c - \varepsilon)/\log\log n})$ for infinitely many $n$, and +- $H(n) < \exp(n^{(c + \varepsilon)/\log\log n})$ for all sufficiently large $n$? +-/ +@[category research open, AMS 11] +theorem erdos_820.variants.asymptotic_growth : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + (∀ ε : ℝ, ε > 0 → + ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ + (H n : ℝ) > + Real.exp ((↑n : ℝ) ^ ((c - ε) / Real.log (Real.log (↑n : ℝ))))) ∧ + (∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (H n : ℝ) < + Real.exp ((↑n : ℝ) ^ ((c + ε) / Real.log (Real.log (↑n : ℝ))))) := by + sorry + +/-- +**Erdős Problem 820** — Part 3 (dual variant): + +Let $K(n)$ be the smallest integer $k \geq 2$ such that $\gcd(k^n - 1, 2^n - 1) = 1$. +Do similar bounds hold for $K(n)$ as conjectured for $H(n)$? +-/ +@[category research open, AMS 11] +theorem erdos_820.variants.dual : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + (∀ ε : ℝ, ε > 0 → + ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ + (↑(sInf {k : ℕ | 2 ≤ k ∧ Nat.Coprime (k ^ n - 1) (2 ^ n - 1)}) : ℝ) > + Real.exp ((↑n : ℝ) ^ ((c - ε) / Real.log (Real.log (↑n : ℝ))))) ∧ + (∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (↑(sInf {k : ℕ | 2 ≤ k ∧ Nat.Coprime (k ^ n - 1) (2 ^ n - 1)}) : ℝ) < + Real.exp ((↑n : ℝ) ^ ((c + ε) / Real.log (Real.log (↑n : ℝ))))) := by + sorry + +end Erdos820 diff --git a/FormalConjectures/ErdosProblems/821.lean b/FormalConjectures/ErdosProblems/821.lean new file mode 100644 index 0000000000..bcf39e6a90 --- /dev/null +++ b/FormalConjectures/ErdosProblems/821.lean @@ -0,0 +1,71 @@ +/- +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 821 + +*Reference:* [erdosproblems.com/821](https://www.erdosproblems.com/821) + +Let $g(n)$ count the number of $m$ such that $\varphi(m) = n$. Is it true that, +for every $\varepsilon > 0$, there exist infinitely many $n$ such that +$g(n) > n^{1 - \varepsilon}$? + +Pillai proved that $\limsup g(n) = \infty$ and Erdős [Er35b] proved that there +exists some constant $c > 0$ such that $g(n) > n^c$ for infinitely many $n$. +Baker and Harman [BaHa98] made improvements on the exponent, and the best known +bound is $g(n) > n^{0.71568\ldots}$ for infinitely many $n$, obtained by +Lichtman [Li22]. Luca and Pollack [LuPo11] investigated the average size of +$g(n)$. + +Related to Problem #416. See also OEIS sequence +[A014197](https://oeis.org/A014197). + +[Er35b] Erdős, P., _On the normal number of prime factors of p−1 and some +related problems concerning Euler's φ-function_. Quarterly Journal of +Mathematics (1935), 205–213. + +[BaHa98] Baker, R. C., Harman, G., _Shifted primes without large prime +factors_. Acta Arithmetica (1998), 331–361. + +[Li22] Lichtman, J. D., _Primes in arithmetic progressions to large moduli and +shifted primes without large prime factors_. arXiv:2211.09641 (2022). + +[LuPo11] Luca, F., Pollack, P., _An arithmetic function arising from +Carmichael's conjecture_. Journal de Théorie des Nombres de Bordeaux (2011), +697–714. +-/ + +namespace Erdos821 + +/-- The number of positive integers $m$ such that $\varphi(m) = n$. -/ +noncomputable def totientPreimageCount (n : ℕ) : ℕ := + Nat.card {m : ℕ // 0 < m ∧ Nat.totient m = n} + +/-- +Erdős Problem 821 [Er74b]: + +Is it true that for every $\varepsilon > 0$, there exist infinitely many $n$ such that +$g(n) > n^{1-\varepsilon}$, where $g(n)$ counts the number of $m$ with $\varphi(m) = n$? +-/ +@[category research open, AMS 11] +theorem erdos_821 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + Set.Infinite {n : ℕ | (totientPreimageCount n : ℝ) > (n : ℝ) ^ (1 - ε)} := by + sorry + +end Erdos821 diff --git a/FormalConjectures/ErdosProblems/823.lean b/FormalConjectures/ErdosProblems/823.lean new file mode 100644 index 0000000000..c3b48b6f17 --- /dev/null +++ b/FormalConjectures/ErdosProblems/823.lean @@ -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 + +/-! +# Erdős Problem 823 + +*Reference:* [erdosproblems.com/823](https://www.erdosproblems.com/823) + +Given α ≥ 1, is there a sequence of positive integers n_k, m_k such that n_k / m_k → α and +σ(n_k) = σ(m_k) for all k, where σ is the sum of divisors function? The answer is yes, proved by +Pollack. + +Erdős [Er74b] observed that it is easy to prove the analogous result for φ(n) (Euler's totient +function). + +[Er59c] Erdős, P., _Remarks on number theory II. Some problems on the σ function_. +Acta Arith. 5 (1959), 171-177. + +[Er74b] Erdős, P., _On abundant-like numbers_. Canad. Math. Bull. 17 (1974), 599-602. + +[Po15b] Pollack, P., _Remarks on fibers of the sum-of-divisors function_. (2015), 305-320. +-/ + +open Finset Filter + +open scoped ArithmeticFunction.sigma BigOperators Topology + +namespace Erdos823 + +/-- +Erdős Problem 823 [Er59c] [Er74b]: + +Let $\alpha \geq 1$. Is there a sequence of positive integers $n_k, m_k$ such that +$n_k / m_k \to \alpha$ and $\sigma(n_k) = \sigma(m_k)$ for all $k \geq 1$, where $\sigma$ is the +sum of divisors function? + +The answer is yes, proved by Pollack [Po15b]. +-/ +@[category research solved, AMS 11] +theorem erdos_823 : answer(True) ↔ + ∀ (α : ℝ), α ≥ 1 → + ∃ (n m : ℕ → ℕ), (∀ k, 0 < n k) ∧ (∀ k, 0 < m k) ∧ + (∀ k, σ 1 (n k) = σ 1 (m k)) ∧ + Tendsto (fun k => (n k : ℝ) / (m k : ℝ)) atTop (nhds α) := by + sorry + +/-- +Variant of Erdős Problem 823 for Euler's totient function φ(n): + +Erdős [Er74b] observed that it is easy to prove the analogous result for φ(n). That is, +for every α ≥ 1, there exist sequences of positive integers n_k, m_k such that +n_k / m_k → α and φ(n_k) = φ(m_k) for all k. +-/ +@[category research solved, AMS 11] +theorem erdos_823_totient : + ∀ (α : ℝ), α ≥ 1 → + ∃ (n m : ℕ → ℕ), (∀ k, 0 < n k) ∧ (∀ k, 0 < m k) ∧ + (∀ k, Nat.totient (n k) = Nat.totient (m k)) ∧ + Tendsto (fun k => (n k : ℝ) / (m k : ℝ)) atTop (nhds α) := by + sorry + +end Erdos823 diff --git a/FormalConjectures/ErdosProblems/824.lean b/FormalConjectures/ErdosProblems/824.lean new file mode 100644 index 0000000000..f968df6c7d --- /dev/null +++ b/FormalConjectures/ErdosProblems/824.lean @@ -0,0 +1,91 @@ +/- +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 824 + +*Reference:* [erdosproblems.com/824](https://www.erdosproblems.com/824) + +Let $h(x)$ count the number of integers $1 \le a < b < x$ such that $(a,b) = 1$ and +$\sigma(a) = \sigma(b)$, where $\sigma$ is the sum of divisors function. + +Is it true that $h(x) > x^{2-o(1)}$? + +Erdős [Er74b] proved that $\limsup h(x)/x = \infty$, and claimed a similar proof for +this problem. A complete proof that $h(x)/x \to \infty$ was provided by Pollack and +Pomerance [PoPo16]. + +[Er59c] Erdős, P., _Remarks on number theory II. Some problems on the σ function_. +Acta Arith. 5 (1959), 171-177. (p.172) + +[Er74b] Erdős, P., _Remarks on some problems in number theory_. +Math. Balkanica (1974), 197-202. (p.202) + +[PoPo16] Pollack, P. and Pomerance, C., _Some problems of Erdős on the sum-of-divisors +function_. Trans. Amer. Math. Soc. Ser. B 3 (2016), 1-26. +-/ + +open Finset BigOperators Nat +open scoped ArithmeticFunction.sigma + +namespace Erdos824 + +/-- $h(x)$ counts the number of pairs of coprime integers $1 \le a < b < x$ +with equal sum-of-divisors values. -/ +def erdos824_h (x : ℕ) : ℕ := + ((Finset.range x ×ˢ Finset.range x).filter + (fun p => 0 < p.1 ∧ p.1 < p.2 ∧ Nat.Coprime p.1 p.2 ∧ + σ 1 p.1 = σ 1 p.2)).card + +/-- +Erdős Problem 824 [Er59c, Er74b]: + +Is it true that $h(x) > x^{2-o(1)}$? Equivalently, for every $\varepsilon > 0$, +for all sufficiently large $x$, $h(x) > x^{2-\varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_824 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + (erdos824_h x : ℝ) > (x : ℝ) ^ ((2 : ℝ) - ε) := by + sorry + +/-- Weisenberg's variant of $h(x)$: count pairs $1 \le a < b < x$ with $\sigma(a) = \sigma(b)$ +such that no proper divisors $u \mid a$ and $v \mid b$ satisfy $\sigma(u) = \sigma(v)$, +$(u, a/u) = 1$, and $(v, b/v) = 1$. This is a weaker restriction than coprimality, +described as the weakest condition that still eliminates trivial duplicates. -/ +def erdos824_h_weisenberg (x : ℕ) : ℕ := + ((Finset.range x ×ˢ Finset.range x).filter + (fun p => 0 < p.1 ∧ p.1 < p.2 ∧ σ 1 p.1 = σ 1 p.2 ∧ + ¬∃ u ∈ p.1.properDivisors, ∃ v ∈ p.2.properDivisors, + σ 1 u = σ 1 v ∧ Nat.Coprime u (p.1 / u) ∧ Nat.Coprime v (p.2 / v))).card + +/-- +Weisenberg's variant of Erdős Problem 824: + +Is it true that $h_W(x) > x^{2-o(1)}$, where $h_W$ uses the weaker Weisenberg condition +instead of coprimality? +-/ +@[category research open, AMS 11] +theorem erdos_824_weisenberg : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + (erdos824_h_weisenberg x : ℝ) > (x : ℝ) ^ ((2 : ℝ) - ε) := by + sorry + +end Erdos824 diff --git a/FormalConjectures/ErdosProblems/827.lean b/FormalConjectures/ErdosProblems/827.lean new file mode 100644 index 0000000000..a258b5da16 --- /dev/null +++ b/FormalConjectures/ErdosProblems/827.lean @@ -0,0 +1,108 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 827 + +*Reference:* [erdosproblems.com/827](https://www.erdosproblems.com/827) + +Let $n_k$ be minimal such that if $n_k$ points in $\mathbb{R}^2$ are in general +position then there exists a subset of $k$ points such that all $\binom{k}{3}$ +triples determine circles of different radii. + +Erdős [Er75h] asked whether $n_k$ exists. In [Er78c] he gave a simple argument +proving existence, but the argument was incorrect as noted by Martínez and +Roldán-Pensado [MaRo15]. A corrected argument gives $n_k \ll k^9$. + +## References + +- [Er75h] Erdős, P., _Some problems on elementary geometry_. Australian Mathematical Society + Gazette (1975), 2–3. +- [Er78c] Erdős, P., _Some more problems on elementary geometry_. Australian Mathematical Society + Gazette (1978), 52–54. +- [Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. + Eureka (1992), 44–48. +- [MaRo15] Martínez, L., Roldán-Pensado, E., _Points defining triangles with distinct + circumradii_. Acta Mathematica Hungarica (2015), 136–141. +-/ + +open Finset EuclideanGeometry + +namespace Erdos827 + +/-- The circumradius of three points in $\mathbb{R}^2$, defined via Heron's formula. + For a non-degenerate triangle with side lengths $a$, $b$, $c$ and semiperimeter + $s = (a+b+c)/2$, the circumradius is $R = \frac{abc}{4\sqrt{s(s-a)(s-b)(s-c)}}$. + Returns $0$ for degenerate (collinear) configurations. -/ +noncomputable def circumradius (p₁ p₂ p₃ : EuclideanSpace ℝ (Fin 2)) : ℝ := + let a := dist p₁ p₂ + let b := dist p₂ p₃ + let c := dist p₁ p₃ + let s := (a + b + c) / 2 + let area_sq := s * (s - a) * (s - b) * (s - c) + if area_sq > 0 then + (a * b * c) / (4 * Real.sqrt area_sq) + else 0 + +/-- All $\binom{k}{3}$ triples of distinct points in $S$ determine circles of pairwise + distinct radii. -/ +def AllDistinctCircumradii (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, + ∀ d ∈ S, ∀ e ∈ S, ∀ f ∈ S, + a ≠ b → a ≠ c → b ≠ c → + d ≠ e → d ≠ f → e ≠ f → + ({a, b, c} : Finset _) ≠ ({d, e, f} : Finset _) → + circumradius a b c ≠ circumradius d e f + +/-- +**Erdős Problem 827** [Er75h, Er78c, Er92e, MaRo15]: + +For every $k \geq 3$, there exists $n$ such that any set of $n$ points in +$\mathbb{R}^2$ in general position contains a $k$-element subset whose +$\binom{k}{3}$ triples all determine circumscribed circles of pairwise +different radii. + +Martínez and Roldán-Pensado [MaRo15] proved this with $n \leq C \cdot k^9$. +-/ +@[category research solved, AMS 5 51] +theorem erdos_827 (k : ℕ) (hk : k ≥ 3) : + ∃ n : ℕ, ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card ≥ n → + NonTrilinear (P : Set (EuclideanSpace ℝ (Fin 2))) → + ∃ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P ∧ S.card = k ∧ AllDistinctCircumradii S := by + sorry + +/-- +**Erdős Problem 827 (Upper bound)** [MaRo15]: + +Martínez and Roldán-Pensado proved that $n_k \ll k^9$, i.e., there exists +a constant $C$ such that any set of $C \cdot k^9$ points in general position +contains a $k$-subset with all-distinct circumradii. +-/ +@[category research solved, AMS 5 51] +theorem erdos_827_upper (k : ℕ) (hk : k ≥ 3) : + ∃ C : ℕ, ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card ≥ C * k ^ 9 → + NonTrilinear (P : Set (EuclideanSpace ℝ (Fin 2))) → + ∃ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P ∧ S.card = k ∧ AllDistinctCircumradii S := by + sorry + +end Erdos827 diff --git a/FormalConjectures/ErdosProblems/829.lean b/FormalConjectures/ErdosProblems/829.lean new file mode 100644 index 0000000000..58f1aed3ad --- /dev/null +++ b/FormalConjectures/ErdosProblems/829.lean @@ -0,0 +1,58 @@ +/- +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.Combinatorics.Additive.Convolution + +/-! +# Erdős Problem 829 + +*Reference:* [erdosproblems.com/829](https://www.erdosproblems.com/829) + +Let $A \subset \mathbb{N}$ be the set of cubes. Is it true that +$1_A * 1_A(n) \ll (\log n)^{O(1)}$? + +Here $1_A * 1_A(n)$ counts the number of representations of $n$ as a sum of two +positive cubes, i.e., the number of pairs $(a, b)$ with $a^3 + b^3 = n$. + +Mordell proved that $\limsup 1_A * 1_A(n) = \infty$. Mahler [Ma35b] proved +$1_A * 1_A(n) \gg (\log n)^{1/4}$ for infinitely many $n$. Stewart [St08] improved +this to $1_A * 1_A(n) \gg (\log n)^{11/13}$. +-/ + +open Real Finset AdditiveCombinatorics + +namespace Erdos829 + +/-- The set of positive cubes: $A = \{m \in \mathbb{N} \mid \exists k \geq 1,\, k^3 = m\}$. -/ +def positiveCubes : Set ℕ := {m : ℕ | ∃ k ≥ 1, k ^ 3 = m} + +/-- +**Erdős Problem 829** [Er83]: + +Is it true that the number of representations of $n$ as a sum of two positive cubes is bounded +by a polynomial in $\log n$? That is, do there exist constants $C > 0$ and $k > 0$ +such that for all sufficiently large $n$, +$$1_A * 1_A(n) \leq C \cdot (\log n)^k,$$ +where $A$ is the set of positive cubes? +-/ +@[category research open, AMS 11] +theorem erdos_829 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ k : ℝ, k > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (sumRep positiveCubes n : ℝ) ≤ C * (Real.log n) ^ k := by + sorry + +end Erdos829 diff --git a/FormalConjectures/ErdosProblems/83.lean b/FormalConjectures/ErdosProblems/83.lean new file mode 100644 index 0000000000..6961c99d63 --- /dev/null +++ b/FormalConjectures/ErdosProblems/83.lean @@ -0,0 +1,75 @@ +/- +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 83 + +*Reference:* [erdosproblems.com/83](https://www.erdosproblems.com/83) + +If $\mathcal{F}$ is a family of $2n$-element subsets of $[4n]$ with pairwise intersections +of size $\geq 2$, then $|\mathcal{F}| \leq \frac{1}{2}(\binom{4n}{2n} - \binom{2n}{n}^2)$. +Conjectured by Erdős, Ko, and Rado [ErKoRa61], proved by Ahlswede and Khachatrian [AhKh97]. +This problem carried a \$500 reward. + +The extremal family consists of all subsets of $[4n]$ of size $2n$ containing at least $n+1$ +elements from $[2n]$. + +OEIS: [A071799](https://oeis.org/A071799), [A387635](https://oeis.org/A387635). + +[ErKoRa61] Erdős, P., Ko, C., and Rado, R., _Intersection theorems for systems of +finite sets_. Quart. J. Math. Oxford Ser. (2) 12 (1961), 313-320. + +[AhKh97] Ahlswede, R. and Khachatrian, L.H., _The complete intersection theorem for +systems of finite sets_. European J. Combin. 18 (1997), 125-136. + +[Er71] Erdős, P., _Topics in combinatorial analysis_ (1971). + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44-48. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium 107 (1995). +-/ + +open Finset + +namespace Erdos83 + +/-- +Suppose that we have a family $\mathcal{F}$ of subsets of $[4n]$ such that $|A| = 2n$ for all +$A \in \mathcal{F}$ and for every $A, B \in \mathcal{F}$ we have $|A \cap B| \geq 2$. Then +$$ + |\mathcal{F}| \leq \frac{1}{2}\left(\binom{4n}{2n} - \binom{2n}{n}^2\right). +$$ + +This was conjectured by Erdős, Ko, and Rado [ErKoRa61], and proved by Ahlswede and +Khachatrian [AhKh97]. +-/ +@[category research solved, AMS 5] +theorem erdos_83 : + ∀ n : ℕ, 0 < n → + ∀ F : Finset (Finset (Fin (4 * n))), + (∀ A ∈ F, A.card = 2 * n) → + (∀ A ∈ F, ∀ B ∈ F, (A ∩ B).card ≥ 2) → + F.card ≤ (Nat.choose (4 * n) (2 * n) - Nat.choose (2 * n) n ^ 2) / 2 := by + sorry + +end Erdos83 diff --git a/FormalConjectures/ErdosProblems/831.lean b/FormalConjectures/ErdosProblems/831.lean new file mode 100644 index 0000000000..a8ebb9fad5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/831.lean @@ -0,0 +1,88 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 831 + +Estimate the function $h(n)$, where $h(n)$ is the minimum number of distinct circumradii +determined by $n$ points in $\mathbb{R}^2$ in general position (no three collinear, no four +concyclic). + +## References + +- [Er75h] Erdős, P., _Some problems on elementary geometry_. Australian Mathematical Society + Gazette (1975), 2–3. +- [Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. + Eureka (1992), 44–48. + +See also Erdős Problems [104], [506], [827], and +[erdosproblems.com/831](https://www.erdosproblems.com/831). +-/ + +open EuclideanGeometry + +namespace Erdos831 + +/-- +Four points in $\mathbb{R}^2$ are concyclic if they all lie on a common circle, i.e., +there exists a center and positive radius such that all four points are +equidistant from the center. +-/ +def FourPointsConcyclic (S : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ c : EuclideanSpace ℝ (Fin 2), ∃ r : ℝ, r > 0 ∧ ∀ p ∈ S, dist p c = r + +/-- +A finite point set in $\mathbb{R}^2$ has no four concyclic if every four-element subset +does not lie on a common circle. +-/ +def NoFourConcyclic (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = 4 → ¬FourPointsConcyclic S + +/-- +The number of distinct circumradii of circles passing through three points of $P$. +A radius $r$ is counted if there exist three distinct points $a, b, c \in P$ and a +center $o$ such that all three points lie on the circle of radius $r$ centered at $o$. +-/ +noncomputable def distinctCircumradiiCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {r : ℝ | r > 0 ∧ ∃ a ∈ P, ∃ b ∈ P, ∃ c ∈ P, + a ≠ b ∧ b ≠ c ∧ a ≠ c ∧ + ∃ o : EuclideanSpace ℝ (Fin 2), dist a o = r ∧ dist b o = r ∧ dist c o = r} + +/-- +Let $h(n)$ be the minimum number of distinct circumradii over all $n$-point configurations +in $\mathbb{R}^2$ in general position (no three on a line, no four on a circle). Estimate $h(n)$. + +Formalized as: $h(n) \to \infty$, i.e., for every $C$ there exists $N$ such that for all +$n \geq N$ and every set $P$ of $n$ points in $\mathbb{R}^2$ in general position (no three collinear, +no four concyclic), the number of distinct circumradii of circles through three +points is at least $C$. +-/ +@[category research open, AMS 5 52] +theorem erdos_831 : + ∀ C : ℕ, + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset (EuclideanSpace ℝ (Fin 2)), + P.card = n → + NonTrilinear (P : Set (EuclideanSpace ℝ (Fin 2))) → + NoFourConcyclic P → + distinctCircumradiiCount P ≥ C := by + sorry + +end Erdos831 diff --git a/FormalConjectures/ErdosProblems/832.lean b/FormalConjectures/ErdosProblems/832.lean new file mode 100644 index 0000000000..f0710d6608 --- /dev/null +++ b/FormalConjectures/ErdosProblems/832.lean @@ -0,0 +1,97 @@ +/- +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 832 + +*Reference:* [erdosproblems.com/832](https://www.erdosproblems.com/832) + +Let $r \geq 3$ and $k$ be sufficiently large in terms of $r$. Is it true that every +$r$-uniform hypergraph with chromatic number $k$ has at least $\binom{(r-1)(k-1)+1}{r}$ +edges, with equality only for the complete graph on $(r-1)(k-1)+1$ vertices? + +When $r = 2$ it is a classical fact that chromatic number $k$ implies at least +$\binom{k}{2}$ edges. Erdős asked for $k$ to be large since he knew the conjecture to +be false for $r = k = 3$ (Steiner triples with 7 vertices and 7 edges). + +This was disproved by Alon [Al85] for all $r \geq 4$. The case $r = 3$ remains open. + +[Er74d] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and +differences_. Mathematics of Ramsey Theory (1974). + +[Al85] Alon, N., _Hypergraphs with high chromatic number_. Graphs and Combinatorics (1985). +-/ + +namespace Erdos832 + +/-- An $r$-uniform hypergraph on a finite vertex set $V$: a collection of +$r$-element subsets of $V$. -/ +structure UniformHypergraph (V : Type*) [DecidableEq V] (r : ℕ) where + edges : Finset (Finset V) + uniform : ∀ e ∈ edges, e.card = r + +/-- A proper $k$-coloring of a hypergraph: a vertex coloring such that no edge +is monochromatic (for every edge, not all vertices receive the same color). + +Note: the formulation `∀ c, ∃ v ∈ e, f v ≠ c` is equivalent to "not all vertices of `e` +share the same color" for nonempty edges: if all vertices had color `c₀`, the universal +would fail at `c = c₀`. -/ +def UniformHypergraph.IsProperColoring {V : Type*} [DecidableEq V] {r : ℕ} + (H : UniformHypergraph V r) (k : ℕ) (f : V → Fin k) : Prop := + ∀ e ∈ H.edges, ∀ c : Fin k, ∃ v ∈ e, f v ≠ c + +/-- The chromatic number of a uniform hypergraph: the minimum number of colors +needed for a proper coloring (no monochromatic edge). -/ +noncomputable def UniformHypergraph.chromaticNumber {V : Type*} [DecidableEq V] + [Fintype V] {r : ℕ} (H : UniformHypergraph V r) : ℕ := + sInf {k : ℕ | k ≥ 1 ∧ ∃ f : V → Fin k, H.IsProperColoring k f} + +/-- +**Erdős Problem 832** [Er74d]: + +For $r \geq 3$ and $k$ sufficiently large (in terms of $r$), is it true that every +$r$-uniform hypergraph with chromatic number $k$ has at least +$\binom{(r-1)(k-1)+1}{r}$ edges? + +This was disproved by Alon [Al85] for all $r \geq 4$. +-/ +@[category research solved, AMS 5] +theorem erdos_832 : answer(False) ↔ + ∀ r : ℕ, r ≥ 3 → ∃ k₀ : ℕ, ∀ k : ℕ, k ≥ k₀ → + ∀ (V : Type) [DecidableEq V] [Fintype V] (H : UniformHypergraph V r), + H.chromaticNumber = k → + H.edges.card ≥ Nat.choose ((r - 1) * (k - 1) + 1) r := by + sorry + +/-- +**Erdős Problem 832, $r = 3$ case** [Er74d]: + +For $k$ sufficiently large, does every $3$-uniform hypergraph with chromatic number $k$ +have at least $\binom{2(k-1)+1}{3}$ edges? + +The case $r = 3$ remains open. +-/ +@[category research open, AMS 5] +theorem erdos_832.variants.r_eq_3 : answer(sorry) ↔ + ∃ k₀ : ℕ, ∀ k : ℕ, k ≥ k₀ → + ∀ (V : Type) [DecidableEq V] [Fintype V] (H : UniformHypergraph V 3), + H.chromaticNumber = k → + H.edges.card ≥ Nat.choose (2 * (k - 1) + 1) 3 := by + sorry + +end Erdos832 diff --git a/FormalConjectures/ErdosProblems/833.lean b/FormalConjectures/ErdosProblems/833.lean new file mode 100644 index 0000000000..b0cc2324ab --- /dev/null +++ b/FormalConjectures/ErdosProblems/833.lean @@ -0,0 +1,107 @@ +/- +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 833 + +Does there exist an absolute constant $c > 0$ such that, for all $r \geq 2$, +every $r$-uniform hypergraph with chromatic number $3$ has a vertex contained +in at least $(1+c)^r$ edges? + +*Reference:* [erdosproblems.com/833](https://www.erdosproblems.com/833) + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20, p. 105. + +[Er74d] Erdős, P., _Problems and results on graphs and hypergraphs: similarities and +differences_. Mathematics of Ramsey Theory (1974). + +[ErLo75] Erdős, P. and Lovász, L., *Problems and results on 3-chromatic hypergraphs and some +related questions*. Infinite and Finite Sets (Colloq., Keszthely, 1973), Vol. II, Colloq. +Math. Soc. János Bolyai, Vol. 10 (1975), 609–627. +-/ + +open Finset + +namespace Erdos833 + +/-- A hypergraph on vertex type $V$, represented as a finset of edges, +where each edge is a finset of vertices. -/ +structure Hypergraph (V : Type*) [DecidableEq V] where + edges : Finset (Finset V) + +/-- A hypergraph is $r$-uniform if every edge has exactly $r$ vertices. -/ +def Hypergraph.IsUniform {V : Type*} [DecidableEq V] (H : Hypergraph V) (r : ℕ) : Prop := + ∀ e ∈ H.edges, e.card = r + +/-- A proper coloring of a hypergraph: no edge with $\geq 2$ vertices is monochromatic. -/ +def Hypergraph.IsProperColoring {V : Type*} [DecidableEq V] (H : Hypergraph V) + {α : Type*} (f : V → α) : Prop := + ∀ e ∈ H.edges, e.card ≥ 2 → ∃ u ∈ e, ∃ v ∈ e, f u ≠ f v + +/-- A hypergraph has chromatic number exactly $k$ if it can be properly colored +with $k$ colors but not with $k-1$ colors. -/ +def Hypergraph.HasChromaticNumber {V : Type*} [DecidableEq V] (H : Hypergraph V) + (k : ℕ) : Prop := + (∃ f : V → Fin k, H.IsProperColoring f) ∧ + ∀ f : V → Fin (k - 1), ¬H.IsProperColoring f + +/-- The degree of a vertex $v$ in a hypergraph is the number of edges containing $v$. -/ +def Hypergraph.degree {V : Type*} [DecidableEq V] (H : Hypergraph V) (v : V) : ℕ := + (H.edges.filter (fun e => v ∈ e)).card + +/-- +Does there exist an absolute constant $c > 0$ such that, for all $r \geq 2$, +in any $r$-uniform hypergraph with chromatic number $3$ there is a vertex +contained in at least $(1+c)^r$ many edges? + +This was proved by Erdős and Lovász [ErLo75], who showed in particular +that there is a vertex contained in at least $2^{r-1}/(4r)$ many edges. +-/ +@[category research solved, AMS 5] +theorem erdos_833 : + answer(True) ↔ + ∃ c : ℝ, 0 < c ∧ + ∀ (r : ℕ), 2 ≤ r → + ∀ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r → H.HasChromaticNumber 3 → + ∃ v : Fin n, (H.degree v : ℝ) ≥ (1 + c) ^ r := by + sorry + +/-- +Determine the largest integer $f(r)$ such that every $r$-uniform hypergraph +with chromatic number $3$ has a vertex contained in at least $f(r)$ edges. + +This is a refinement of `erdos_833`: while the main problem asks whether $f(r)$ +grows exponentially, this variant asks for the exact value. Known values are +$f(2) = 2$ and $f(3) = 3$. Erdős noted that $f(4)$ was unknown. +-/ +@[category research open, AMS 5] +theorem erdos_833_variant : + ∃ f : ℕ → ℕ, + (∀ (r : ℕ), 2 ≤ r → + (∀ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r → H.HasChromaticNumber 3 → + ∃ v : Fin n, H.degree v ≥ f r) ∧ + (∀ m, (∀ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r → H.HasChromaticNumber 3 → + ∃ v : Fin n, H.degree v ≥ m) → m ≤ f r)) ∧ + f 2 = 2 ∧ f 3 = 3 := by + sorry + +end Erdos833 diff --git a/FormalConjectures/ErdosProblems/834.lean b/FormalConjectures/ErdosProblems/834.lean new file mode 100644 index 0000000000..124cca330b --- /dev/null +++ b/FormalConjectures/ErdosProblems/834.lean @@ -0,0 +1,134 @@ +/- +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 834 + +*Reference:* [erdosproblems.com/834](https://www.erdosproblems.com/834) + +Does there exist a $3$-critical $3$-uniform hypergraph in which every vertex +has degree $\geq 7$? A problem of Erdős and Lovász [Er74d]. + +There are two natural interpretations of "$3$-critical": + +1. **Transversal criticality**: the minimum transversal (hitting set) has + size $3$, and for every edge $e$ the hypergraph $H \setminus \{e\}$ has a transversal + of size $\leq 2$. + +2. **Chromatic criticality**: the chromatic number is $3$, but deleting any + edge or vertex reduces the chromatic number to at most $2$. + +Li [Li25] resolved both formulations: +- In the transversal formulation, every $3$-critical $3$-uniform hypergraph + has a vertex of degree $\leq 6$ (answer: NO). +- In the chromatic formulation, there exists a $3$-critical $3$-uniform + hypergraph on $9$ vertices with minimum degree $7$ (answer: YES). + +[Er74d, p.282] Erdős, P. and Lovász, L., _Problems and results on 3-chromatic hypergraphs +and some related questions_. Infinite and Finite Sets, Colloq. Math. Soc. J. Bolyai **10** +(1975), 609–627. + +[Li25] Li, R., _On an Erdős-Lovász problem: 3-critical 3-graphs of minimum degree 7_. +arXiv:2512.24850 (2025). +-/ + +open Finset + +namespace Erdos834 + +/-- A hypergraph on vertex type $V$, represented as a finset of edges, +where each edge is a finset of vertices. -/ +structure Hypergraph (V : Type*) [DecidableEq V] where + edges : Finset (Finset V) + +/-- A hypergraph is $r$-uniform if every edge has exactly $r$ vertices. -/ +def Hypergraph.IsUniform {V : Type*} [DecidableEq V] (H : Hypergraph V) (r : ℕ) : Prop := + ∀ e ∈ H.edges, e.card = r + +/-- The degree of a vertex $v$ in a hypergraph is the number of edges containing $v$. -/ +def Hypergraph.degree {V : Type*} [DecidableEq V] (H : Hypergraph V) (v : V) : ℕ := + (H.edges.filter (fun e => v ∈ e)).card + +/-- The vertices of a hypergraph (the union of all edges). -/ +def Hypergraph.vertices {V : Type*} [DecidableEq V] (H : Hypergraph V) : Finset V := + H.edges.biUnion id + +/-- The hypergraph obtained by removing an edge. -/ +def Hypergraph.eraseEdge {V : Type*} [DecidableEq V] (H : Hypergraph V) + (e : Finset V) : Hypergraph V := + ⟨H.edges.erase e⟩ + +/-- The hypergraph obtained by removing a vertex (and all edges containing it). -/ +def Hypergraph.eraseVertex {V : Type*} [DecidableEq V] (H : Hypergraph V) + (v : V) : Hypergraph V := + ⟨H.edges.filter (fun e => v ∉ e)⟩ + +/-- A proper coloring of a hypergraph: no edge is monochromatic. -/ +def Hypergraph.IsProperColoring {V : Type*} [DecidableEq V] (H : Hypergraph V) + {α : Type*} (f : V → α) : Prop := + ∀ e ∈ H.edges, e.card ≥ 2 → ∃ u ∈ e, ∃ v ∈ e, f u ≠ f v + +/-- A set $S$ is a transversal (hitting set) of $H$ if it intersects every edge. -/ +def Hypergraph.IsTransversal {V : Type*} [DecidableEq V] (H : Hypergraph V) + (S : Finset V) : Prop := + ∀ e ∈ H.edges, ∃ v ∈ e, v ∈ S + +/-- A hypergraph is $3$-transversal-critical if the minimum transversal has +size $3$ and removing any single edge allows a transversal of size $\leq 2$. -/ +def Hypergraph.Is3TransversalCritical {V : Type*} [DecidableEq V] + (H : Hypergraph V) : Prop := + (∃ S : Finset V, S.card = 3 ∧ H.IsTransversal S) ∧ + (∀ S : Finset V, S.card < 3 → ¬H.IsTransversal S) ∧ + (∀ e ∈ H.edges, ∃ S : Finset V, S.card ≤ 2 ∧ (H.eraseEdge e).IsTransversal S) + +/-- A hypergraph is $3$-chromatic-critical if its chromatic number is $3$ and +removing any edge or vertex makes it $2$-colorable. -/ +def Hypergraph.Is3ChromaticCritical {V : Type*} [DecidableEq V] + (H : Hypergraph V) : Prop := + (∃ f : V → Fin 3, H.IsProperColoring f) ∧ + (∀ f : V → Fin 2, ¬H.IsProperColoring f) ∧ + (∀ e ∈ H.edges, ∃ f : V → Fin 2, (H.eraseEdge e).IsProperColoring f) ∧ + (∀ v : V, v ∈ H.vertices → ∃ f : V → Fin 2, (H.eraseVertex v).IsProperColoring f) + +/-- +Erdős Problem 834, transversal formulation (resolved by Li [Li25]): + +Does there exist a $3$-transversal-critical $3$-uniform hypergraph in which every vertex +has degree $\geq 7$? Li showed the answer is NO: every such hypergraph has a vertex +of degree $\leq 6$. +-/ +@[category research solved, AMS 5] +theorem erdos_834 : answer(False) ↔ + ∃ (n : ℕ) (H : Hypergraph (Fin n)), H.IsUniform 3 ∧ H.Is3TransversalCritical ∧ + ∀ v : Fin n, H.degree v ≥ 7 := by + sorry + +/-- +Erdős Problem 834, chromatic formulation (resolved by Li [Li25]): + +Does there exist a $3$-chromatic-critical $3$-uniform hypergraph in which every vertex +has degree $\geq 7$? Li showed the answer is YES, constructing such a hypergraph +on $9$ vertices. +-/ +@[category research solved, AMS 5] +theorem erdos_834.variants.chromatic : answer(True) ↔ + ∃ (n : ℕ) (H : Hypergraph (Fin n)), H.IsUniform 3 ∧ H.Is3ChromaticCritical ∧ + ∀ v : Fin n, H.degree v ≥ 7 := by + sorry + +end Erdos834 diff --git a/FormalConjectures/ErdosProblems/836.lean b/FormalConjectures/ErdosProblems/836.lean new file mode 100644 index 0000000000..63f402c6a6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/836.lean @@ -0,0 +1,139 @@ +/- +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 836 + +*Reference:* [erdosproblems.com/836](https://www.erdosproblems.com/836) + +Let $r \geq 2$ and $G$ be an $r$-uniform hypergraph with chromatic number 3 +(that is, there is a 3-colouring of the vertices of $G$ such that no edge +is monochromatic). Suppose any two edges of $G$ have a non-empty intersection. + +Must $G$ contain $O(r^2)$ many vertices? +Must there be two edges which meet in $\gg r$ many vertices? + +A problem of Erdős and Shelah [Er74d]. + +Alon showed the first question is false: there exists an intersecting +$r$-uniform 3-chromatic hypergraph with $\sim 4^r / \sqrt{r}$ vertices. + +Erdős and Lovász [ErLo75] proved that there must be two edges meeting +in $\Omega(r / \log r)$ vertices. The second question ($\Omega(r)$) remains open. + +[Er74d] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and +differences*. Mathematics of Ramsey Theory (1974). + +[ErLo75] Erdős, P. and Lovász, L., *Problems and results on 3-chromatic hypergraphs and some +related questions*. Infinite and Finite Sets (Colloq., Keszthely, 1973), Vol. II, Colloq. +Math. Soc. János Bolyai, Vol. 10 (1975), 609–627. +-/ + +open Finset + +namespace Erdos836 + +/-- A hypergraph on vertex type $V$. -/ +structure Hypergraph (V : Type*) [DecidableEq V] where + edges : Finset (Finset V) + +/-- A hypergraph is $r$-uniform if every edge has exactly $r$ vertices. -/ +def Hypergraph.IsUniform {V : Type*} [DecidableEq V] (H : Hypergraph V) (r : ℕ) : Prop := + ∀ e ∈ H.edges, e.card = r + +/-- The vertices of a hypergraph (the union of all edges). -/ +def Hypergraph.vertices {V : Type*} [DecidableEq V] (H : Hypergraph V) : Finset V := + H.edges.biUnion id + +/-- A proper coloring of a hypergraph: no edge is monochromatic. -/ +def Hypergraph.IsProperColoring {V : Type*} [DecidableEq V] (H : Hypergraph V) + {α : Type*} (f : V → α) : Prop := + ∀ e ∈ H.edges, e.card ≥ 2 → ∃ u ∈ e, ∃ v ∈ e, f u ≠ f v + +/-- A hypergraph has chromatic number 3: it is 3-colorable but not 2-colorable. -/ +def Hypergraph.HasChromaticNumber3 {V : Type*} [DecidableEq V] (H : Hypergraph V) : Prop := + (∃ f : V → Fin 3, H.IsProperColoring f) ∧ + (∀ f : V → Fin 2, ¬H.IsProperColoring f) + +/-- A hypergraph is intersecting if any two edges share at least one vertex. -/ +def Hypergraph.IsIntersecting {V : Type*} [DecidableEq V] (H : Hypergraph V) : Prop := + ∀ e₁ ∈ H.edges, ∀ e₂ ∈ H.edges, (e₁ ∩ e₂).Nonempty + +/-- +Erdős Problem 836 [Er74d]: + +For every $r$-uniform intersecting hypergraph with chromatic number 3, +there exist two edges meeting in $\Omega(r)$ vertices. + +Formally: there exists a constant $C > 0$ such that for all $r \geq 2$ and for every +such hypergraph, there exist two distinct edges whose intersection has +size $\geq C \cdot r$. + +Erdős and Lovász [ErLo75] proved the weaker bound $\Omega(r / \log r)$. +-/ +@[category research open, AMS 5] +theorem erdos_836 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ r : ℕ, r ≥ 2 → + ∀ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r → + H.HasChromaticNumber3 → + H.IsIntersecting → + ∃ e₁ ∈ H.edges, ∃ e₂ ∈ H.edges, e₁ ≠ e₂ ∧ + ((e₁ ∩ e₂).card : ℝ) ≥ C * (r : ℝ) := by + sorry + +/-- +**Alon's counterexample to the first question of Erdős Problem 836:** + +The first question of Problem 836 asks whether every $r$-uniform intersecting +hypergraph with chromatic number 3 must have $O(r^2)$ vertices. Alon showed +this is false: for all sufficiently large $r$, there exists such a hypergraph +with more than $r^2$ vertices. +-/ +@[category research solved, AMS 5] +theorem erdos_836_alon_counterexample : + ∃ᶠ r in Filter.atTop, + ∃ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r ∧ + H.HasChromaticNumber3 ∧ + H.IsIntersecting ∧ + n > r ^ 2 := by + sorry + +/-- +**Erdős–Lovász result for Problem 836** [ErLo75]: + +Erdős and Lovász proved that for every $r$-uniform intersecting hypergraph +with chromatic number 3, there exist two edges meeting in +$\Omega(r / \log r)$ vertices. This is a weaker form of the main conjecture +(Problem 836), which asks for $\Omega(r)$. +-/ +@[category research solved, AMS 5] +theorem erdos_836_erdos_lovasz : + ∃ C : ℝ, C > 0 ∧ + ∀ r : ℕ, r ≥ 2 → + ∀ (n : ℕ) (H : Hypergraph (Fin n)), + H.IsUniform r → + H.HasChromaticNumber3 → + H.IsIntersecting → + ∃ e₁ ∈ H.edges, ∃ e₂ ∈ H.edges, e₁ ≠ e₂ ∧ + ((e₁ ∩ e₂).card : ℝ) ≥ C * ((r : ℝ) / Real.log (r : ℝ)) := by + sorry + +end Erdos836 diff --git a/FormalConjectures/ErdosProblems/837.lean b/FormalConjectures/ErdosProblems/837.lean new file mode 100644 index 0000000000..a8d9296ac0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/837.lean @@ -0,0 +1,115 @@ +/- +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 837 + +*Reference:* [erdosproblems.com/837](https://www.erdosproblems.com/837) + +Let $k \geq 2$ and $A_k \subseteq [0,1]$ be the set of $\alpha$ such that there exists some +$\beta(\alpha) > \alpha$ with the property that, if $G_1, G_2, \ldots$ is a sequence of $k$-uniform +hypergraphs with +$$\liminf \frac{e(G_n)}{\binom{|G_n|}{k}} > \alpha$$ +then there exist subgraphs $H_n \subseteq G_n$ such that $|H_n| \to \infty$ and +$$\liminf \frac{e(H_n)}{\binom{|H_n|}{k}} > \beta,$$ +and further that this property does not necessarily hold if $> \alpha$ is +replaced by $\geq \alpha$. + +It is known that $A_2 = \{1 - 1/m : m \geq 1\}$ (Erdős-Stone-Simonovits). + +What is $A_3$? + +[Er74d] Erdős, P. and Simonovits, M., problem on hypergraph density jumps. +-/ + +open Finset + +namespace Erdos837 + +/-- A $k$-uniform hypergraph on $n$ vertices: a collection of $k$-element subsets + of $\operatorname{Fin}(n)$. -/ +structure UniformHypergraph (n k : ℕ) where + edges : Finset (Finset (Fin n)) + uniform : ∀ e ∈ edges, e.card = k + +/-- The edge density of a $k$-uniform hypergraph: $|E| / \binom{n}{k}$. -/ +noncomputable def UniformHypergraph.density {n k : ℕ} + (G : UniformHypergraph n k) : ℝ := + if Nat.choose n k = 0 then 0 + else (G.edges.card : ℝ) / (Nat.choose n k : ℝ) + +/-- $H$ is a sub-hypergraph of $G$ via an injective vertex map $f$, + meaning every edge of $H$ maps to an edge of $G$ under $f$. -/ +def UniformHypergraph.IsSubgraphVia {m n k : ℕ} (H : UniformHypergraph m k) + (G : UniformHypergraph n k) (f : Fin m ↪ Fin n) : Prop := + ∀ e ∈ H.edges, e.map f ∈ G.edges + +/-- The density jump set $A_k$ for $k$-uniform hypergraphs. + $\alpha \in A_k$ iff there exists $\beta > \alpha$ such that: + (a) any sequence of $k$-uniform hypergraphs with $\liminf$ density $> \alpha$ + contains growing subgraphs with $\liminf$ density $> \beta$; + (b) this does NOT hold when the hypothesis is weakened to $\liminf$ density $\geq \alpha$. -/ +def densityJumpSet (k : ℕ) : Set ℝ := + {α : ℝ | 0 ≤ α ∧ α ≤ 1 ∧ + ∃ β : ℝ, β > α ∧ + -- (a) Density jump: liminf density > α implies dense growing subgraphs + (∀ (sizes : ℕ → ℕ) (G : ∀ i, UniformHypergraph (sizes i) k), + -- Hypothesis: |Gᵢ| → ∞ + (∀ M : ℕ, ∃ N : ℕ, ∀ i : ℕ, i ≥ N → sizes i ≥ M) → + -- Hypothesis: liminf density(Gᵢ) > α + (∃ δ : ℝ, δ > 0 ∧ ∃ N₀ : ℕ, ∀ i : ℕ, i ≥ N₀ → + (G i).density ≥ α + δ) → + -- Conclusion: ∃ subgraphs Hᵢ with |Hᵢ| → ∞ and liminf density > β + ∃ (subSizes : ℕ → ℕ) (H : ∀ i, UniformHypergraph (subSizes i) k), + (∀ M : ℕ, ∃ N : ℕ, ∀ i : ℕ, i ≥ N → subSizes i ≥ M) ∧ + (∀ i, ∃ f : Fin (subSizes i) ↪ Fin (sizes i), + (H i).IsSubgraphVia (G i) f) ∧ + (∃ δ' : ℝ, δ' > 0 ∧ ∃ N₁ : ℕ, ∀ i : ℕ, i ≥ N₁ → + (H i).density ≥ β + δ')) ∧ + -- (b) Fails with ≥ α + ¬(∀ (sizes : ℕ → ℕ) (G : ∀ i, UniformHypergraph (sizes i) k), + -- Hypothesis: |Gᵢ| → ∞ + (∀ M : ℕ, ∃ N : ℕ, ∀ i : ℕ, i ≥ N → sizes i ≥ M) → + (∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ i : ℕ, i ≥ N₀ → + (G i).density ≥ α - ε) → + ∃ (subSizes : ℕ → ℕ) (H : ∀ i, UniformHypergraph (subSizes i) k), + (∀ M : ℕ, ∃ N : ℕ, ∀ i : ℕ, i ≥ N → subSizes i ≥ M) ∧ + (∀ i, ∃ f : Fin (subSizes i) ↪ Fin (sizes i), + (H i).IsSubgraphVia (G i) f) ∧ + (∃ δ' : ℝ, δ' > 0 ∧ ∃ N₁ : ℕ, ∀ i : ℕ, i ≥ N₁ → + (H i).density ≥ β + δ'))} + +/-- Known: $A_2 = \{1 - 1/m : m \geq 1\}$ (Erdős-Stone-Simonovits density jump). -/ +@[category research solved, AMS 5] +theorem erdos_837.variants.graphs : + densityJumpSet 2 = {α : ℝ | ∃ m : ℕ, m ≥ 1 ∧ α = 1 - 1 / (m : ℝ)} := by + sorry + +/-- +Erdős Problem 837 [Er74d]: +Determine the density jump set $A_3$ for $3$-uniform hypergraphs. + +It is known that $A_2 = \{1 - 1/m : m \geq 1\}$ by the Erdős-Stone-Simonovits theorem. +The analogous characterization of $A_3$ is open. +-/ +@[category research open, AMS 5] +theorem erdos_837 : + densityJumpSet 3 = answer(sorry) := by + sorry + +end Erdos837 diff --git a/FormalConjectures/ErdosProblems/838.lean b/FormalConjectures/ErdosProblems/838.lean new file mode 100644 index 0000000000..4a846d7e9d --- /dev/null +++ b/FormalConjectures/ErdosProblems/838.lean @@ -0,0 +1,69 @@ +/- +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.Geometry.«2d» + +/-! +# Erdős Problem 838 + +Let $f(n)$ be the minimum number of convex subsets determined by $n$ points in general position +in $\mathbb{R}^2$. Does $\log f(n) / (\log n)^2$ converge to a constant? + +A question of Erdős and Hammer. See also Problem 107 (Happy Ending / Erdős–Szekeres). + +*Reference:* [erdosproblems.com/838](https://www.erdosproblems.com/838) + +[Er78c] Erdős, P., _Some more problems on elementary geometry_. Austral. Math. Soc. Gaz. + **5** (1978), 52–54. +-/ + +open Classical Filter Finset + +open scoped Topology Real EuclideanGeometry + +namespace Erdos838 + +/-- +The number of subsets of $P$ that are in convex position. +-/ +noncomputable def numConvexSubsets (P : Finset ℝ²) : ℕ := + (P.powerset.filter fun S : Finset ℝ² => EuclideanGeometry.ConvexIndep (↑S : Set ℝ²)).card + +/-- +$f(n)$ is the minimum number of convex subsets determined by any $n$ points in $\mathbb{R}^2$ +in general position (no three collinear). +-/ +noncomputable def f (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ P : Finset ℝ², + P.card = n ∧ EuclideanGeometry.NonTrilinear (P : Set ℝ²) ∧ numConvexSubsets P = k} + +/-- +Erdős Problem 838 (Erdős–Hammer): +Let $f(n)$ be the minimum number of convex subsets determined by any $n$ points in $\mathbb{R}^2$, +with no three collinear. Does there exist a constant $c$ such that +$$\lim_{n \to \infty} \frac{\log f(n)}{(\log n)^2} = c?$$ + +Erdős proved that $n^{c_1 \log n} < f(n) < n^{c_2 \log n}$ for some constants +$c_1, c_2 > 0$ [Er78c]. +-/ +@[category research open, AMS 5 52] +theorem erdos_838 : answer(sorry) ↔ + ∃ c : ℝ, Tendsto (fun n : ℕ => Real.log (f n : ℝ) / (Real.log (n : ℝ)) ^ 2) + atTop (nhds c) := by + sorry + +end Erdos838 diff --git a/FormalConjectures/ErdosProblems/839.lean b/FormalConjectures/ErdosProblems/839.lean new file mode 100644 index 0000000000..6470ed9417 --- /dev/null +++ b/FormalConjectures/ErdosProblems/839.lean @@ -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 + +/-! +# 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. +-/ + +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) ↔ + ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + ∀ M : ℝ, ∃ᶠ n in atTop, M < (a n : ℝ) / (n : ℝ) := by + 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$? +-/ +@[category research open, AMS 11] +theorem erdos_839.variants.stronger : answer(sorry) ↔ + ∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + Set.HasLogDensity (Set.range a) 0 := by + sorry + +end Erdos839 diff --git a/FormalConjectures/ErdosProblems/84.lean b/FormalConjectures/ErdosProblems/84.lean new file mode 100644 index 0000000000..c1da616faa --- /dev/null +++ b/FormalConjectures/ErdosProblems/84.lean @@ -0,0 +1,100 @@ +/- +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 84 + +*Reference:* [erdosproblems.com/84](https://www.erdosproblems.com/84) + +The cycle set of a graph $G$ on $n$ vertices is the set $A \subseteq \{3, \ldots, n\}$ of all cycle +lengths present in $G$. Let $f(n)$ count the number of distinct such sets $A$ over all graphs on +$n$ vertices. Erdős and Faudree conjectured that $f(n) = o(2^n)$ and $f(n) / 2^{n/2} \to \infty$. + +Erdős and Faudree showed $2^{n/2} < f(n) \leq 2^{n-2}$. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Discrete Math. 165/166 (1997), 227–231. + +[Er95] Erdős, P., _Some recent problems and results in graph theory_. +Discrete Math. 164 (1997), 81–85. + +[Er96] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) 47 (1992), 231–240. + +[Er97d] Erdős, P., _Some problems and results in combinatorial number theory_. + +[Ve04] Verstraëte, J., _On the number of sets of cycle lengths_. +Combinatorica (2004), 719–730. + +[Ne25] Nenadov, R., _Improved bound on the number of cycle sets_. +arXiv:2501.09904 (2025). +-/ + +open SimpleGraph + +namespace Erdos84 + +/-- The cycle spectrum of a simple graph: the set of all cycle lengths present in $G$. -/ +def cycleSpectrum {V : Type*} (G : SimpleGraph V) : Set ℕ := + {ℓ : ℕ | ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = ℓ} + +/-- The number of distinct cycle spectra realizable by simple graphs on $\operatorname{Fin}(n)$. -/ +noncomputable def cycleSetCount (n : ℕ) : ℕ := + Set.ncard {A : Set ℕ | ∃ G : SimpleGraph (Fin n), cycleSpectrum G = A} + +/-- +Erdős Problem 84, Part 2 (open) [Er94b][Er95][Er96][Er97d]: +$f(n) / 2^{n/2} \to \infty$. +That is, for every $B > 0$, for all sufficiently large $n$, $f(n) \geq B \cdot 2^{n/2}$. + +This is the main open conjecture; Part 1 (the solved upper bound) appears below as a variant. +-/ +@[category research open, AMS 5] +theorem erdos_84 : + ∀ B : ℝ, B > 0 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (cycleSetCount n : ℝ) ≥ B * (2 : ℝ) ^ ((n : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 84, Part 1 (proved by Verstraëte [Ve04]): +$f(n) = o(2^n)$. +That is, for every $\varepsilon > 0$, for all sufficiently large $n$, +$f(n) \leq \varepsilon \cdot 2^n$. + +Verstraëte proved $f(n) \ll 2^{n - n^{1/10}}$, improved by Nenadov to +$f(n) \ll 2^{n - n^{1/2 - o(1)}}$. +-/ +@[category research solved, AMS 5] +theorem erdos_84.variants.subexponential : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (cycleSetCount n : ℝ) ≤ ε * (2 : ℝ) ^ n := by + sorry + +/-- +Erdős Problem 84, variant: does $\lim_{n \to \infty} f(n)^{1/n}$ exist, and if so, what is its +value? This is noted as an open question on the website. +-/ +@[category research open, AMS 5] +theorem erdos_84.variants.limit_exists : + ∃ L : ℝ, Filter.Tendsto (fun n => (cycleSetCount n : ℝ) ^ ((1 : ℝ) / n)) + Filter.atTop (nhds L) := by + sorry + +end Erdos84 diff --git a/FormalConjectures/ErdosProblems/840.lean b/FormalConjectures/ErdosProblems/840.lean new file mode 100644 index 0000000000..3485cb8584 --- /dev/null +++ b/FormalConjectures/ErdosProblems/840.lean @@ -0,0 +1,112 @@ +/- +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 840 + +*Reference:* [erdosproblems.com/840](https://www.erdosproblems.com/840) + +Let $f(N)$ be the size of the largest quasi-Sidon subset $A \subset \{1, \ldots, N\}$, +where we say that $A$ is quasi-Sidon if $|A + A| = (1 + o(1))\binom{|A|}{2}$. +How does $f(N)$ grow? + +Erdős and Freud [ErFr91] proved +$(2/\sqrt{3} + o(1))N^{1/2} \leq f(N) \leq (2 + o(1))N^{1/2}$. + +The upper bound was improved by Pikhurko [Pi06] to +$f(N) \leq ((1/4 + 1/(\pi+2)^2)^{-1/2} + o(1))N^{1/2} \approx 1.863\, N^{1/2}$. + +[Er81h] Erdős, P., _Some problems and results on additive and multiplicative number theory_. +Analytic number theory (Philadelphia, Pa., 1980), 1981, pp. 171–182. + +[ErFr91] Erdős, P. and Freud, R., _On sums of a Sidon-sequence_. J. Number Theory (1991), +196–205. + +[Er92c] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, +Matematiche (Catania) **47** (1992), no. 2, 231–240. + +[Pi06] Pikhurko, O., _Dense edge-magic graphs and thin additive bases_. Discrete Mathematics +(2006), 2097–2107. +-/ + +open Finset Classical + +open scoped Pointwise + +namespace Erdos840 + +/-- A finite set of natural numbers is $\delta$-quasi-Sidon if +$|A + A| \geq (1 - \delta) \cdot \binom{|A|}{2}$. +A sequence of sets is quasi-Sidon iff for every $\delta > 0$ it is eventually +$\delta$-quasi-Sidon. -/ +def IsQuasiSidon (δ : ℝ) (A : Finset ℕ) : Prop := + ((A + A).card : ℝ) ≥ (1 - δ) * (Nat.choose A.card 2 : ℝ) + +/-- The maximum size of a $\delta$-quasi-Sidon subset of $\{1, \ldots, N\}$. -/ +noncomputable def maxQuasiSidonCard (δ : ℝ) (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter (fun A => IsQuasiSidon δ A)).sup Finset.card + +/-- +**Erdős Problem 840** — How does $f(N)$ grow? + +The problem asks for the asymptotic constant $c$ such that +$f_\delta(N) \sim c \cdot \sqrt{N}$ as $N \to \infty$, where $f(N)$ is the size of +the largest quasi-Sidon subset of $\{1, \ldots, N\}$. +It is known that $2/\sqrt{3} \leq c \leq (1/4 + 1/(\pi+2)^2)^{-1/2} \approx 1.863$. +-/ +@[category research open, AMS 5 11] +theorem erdos_840 : + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + |(maxQuasiSidonCard δ N : ℝ) - answer(sorry) * Real.sqrt (N : ℝ)| ≤ + ε * Real.sqrt (N : ℝ) := by + sorry + +/-- +**Erdős Problem 840** — Lower bound (Erdős–Freud [ErFr91]): + +For every $\varepsilon > 0$ and $\delta > 0$, for sufficiently large $N$, +$f_\delta(N) \geq (2/\sqrt{3} - \varepsilon) \cdot \sqrt{N}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_840.variants.lower_bound : + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (maxQuasiSidonCard δ N : ℝ) ≥ (2 / Real.sqrt 3 - ε) * Real.sqrt (N : ℝ) := by + sorry + +/-- +**Erdős Problem 840** — Upper bound (Pikhurko [Pi06]): + +For every $\varepsilon > 0$ and $\delta > 0$, for sufficiently large $N$, +$f_\delta(N) \leq ((1/4 + 1/(\pi+2)^2)^{-1/2} + \varepsilon) \cdot \sqrt{N}$. + +The constant $(1/4 + 1/(\pi+2)^2)^{-1/2} \approx 1.863$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_840.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (maxQuasiSidonCard δ N : ℝ) ≤ + (Real.sqrt ((1 / 4 + 1 / (Real.pi + 2) ^ 2)⁻¹) + ε) * Real.sqrt (N : ℝ) := by + sorry + +end Erdos840 diff --git a/FormalConjectures/ErdosProblems/841.lean b/FormalConjectures/ErdosProblems/841.lean new file mode 100644 index 0000000000..f7e271a5ff --- /dev/null +++ b/FormalConjectures/ErdosProblems/841.lean @@ -0,0 +1,106 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 841 + +*Reference:* [erdosproblems.com/841](https://www.erdosproblems.com/841) + +Let $t_n$ be minimal such that $\{n+1, \ldots, n+t_n\}$ contains a subset whose +product with $n$ is a square number (and let $t_n = 0$ if $n$ is itself square). +Estimate $t_n$. + +A problem of Erdős, Graham, and Selfridge. + +See also OEIS [A092487](https://oeis.org/A092487) and Problem 437. + +[ErGrSe92] Erdős, P., Graham, R. L., and Selfridge, J. L., 1992. + +[BPZ24] Bui, H. M., Pratt, K., and Zaharescu, A., _A problem of +Erdős-Graham-Granville-Selfridge on integral points on hyperelliptic curves_. +Math. Proc. Cambridge Philos. Soc. (2024), 309–323. + +[Gu04] Guy, R. K., _Unsolved problems in number theory_. (2004), Problem B30. +-/ + +open Finset + +namespace Erdos841 + +/-- The set $\{n+1, \ldots, n+t\}$ contains a nonempty subset whose product with $n$ +is a perfect square. -/ +def HasSquareProductSubset (n t : ℕ) : Prop := + ∃ S : Finset ℕ, S.Nonempty ∧ S ⊆ Finset.Icc (n + 1) (n + t) ∧ + IsSquare (n * S.prod id) + +/-- $t_n$: the minimal $t$ such that $\{n+1, \ldots, n+t\}$ contains a nonempty subset whose +product with $n$ is a perfect square. Defined as $0$ when $n$ is a perfect square. -/ +noncomputable def erdos841T (n : ℕ) : ℕ := + if IsSquare n then 0 + else sInf {t : ℕ | HasSquareProductSubset n t} + +/-- +**Erdős Problem 841** — Trivial lower bound: + +For all non-square $n \geq 2$, $t_n \geq P(n)$ where $P(n)$ is the largest prime factor of $n$. +-/ +@[category undergraduate, AMS 11] +theorem erdos_841 (n : ℕ) (hn : n ≥ 2) (hns : ¬IsSquare n) : + erdos841T n ≥ Nat.maxPrimeFac n := by + sorry + +/-- +**Erdős Problem 841** — Selfridge's result [ErGrSe92]: + +If the largest prime factor $P(n) > \sqrt{2n} + 1$, then $t_n = P(n)$. +-/ +@[category research solved, AMS 11] +theorem erdos_841.variants.selfridge (n : ℕ) (hn : n ≥ 2) (hns : ¬IsSquare n) + (hP : (Nat.maxPrimeFac n : ℝ) > Real.sqrt (2 * (n : ℝ)) + 1) : + erdos841T n = Nat.maxPrimeFac n := by + sorry + +/-- +**Erdős Problem 841** — Selfridge's upper bound [ErGrSe92]: + +If $P(n) \leq \sqrt{2n} + 1$, then $t_n \ll \sqrt{n}$. Formally: there exists $C > 0$ such that +for all non-square $n \geq 2$ with $P(n) \leq \sqrt{2n} + 1$, we have $t_n \leq C \cdot \sqrt{n}$. +-/ +@[category research solved, AMS 11] +theorem erdos_841.variants.selfridge_upper : + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, n ≥ 2 → ¬IsSquare n → + (Nat.maxPrimeFac n : ℝ) ≤ Real.sqrt (2 * (n : ℝ)) + 1 → + (erdos841T n : ℝ) ≤ C * Real.sqrt (n : ℝ) := by + sorry + +/-- +**Erdős Problem 841** — Bui–Pratt–Zaharescu lower bound [BPZ24]: + +For all non-square $n \geq N_0$, +$$t_n \geq C \cdot (\log \log n)^{6/5} \cdot (\log \log \log n)^{-1/5}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_841.variants.bpz_lower : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ¬IsSquare n → + (erdos841T n : ℝ) ≥ + C * (Real.log (Real.log (n : ℝ))) ^ ((6 : ℝ) / 5) * + (Real.log (Real.log (Real.log (n : ℝ)))) ^ (-(1 : ℝ) / 5) := by + sorry + +end Erdos841 diff --git a/FormalConjectures/ErdosProblems/842.lean b/FormalConjectures/ErdosProblems/842.lean new file mode 100644 index 0000000000..942ef7f82f --- /dev/null +++ b/FormalConjectures/ErdosProblems/842.lean @@ -0,0 +1,79 @@ +/- +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 842 + +*Reference:* [erdosproblems.com/842](https://www.erdosproblems.com/842) + +Let $G$ be a graph on $3n$ vertices formed by taking $n$ vertex disjoint triangles +and adding a Hamiltonian cycle (with all new edges) between these vertices. +Does $G$ have chromatic number at most $3$? + +The answer is yes, proved by Fleischner and Stiebitz [FlSt92]. + +[Er92b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) 47 (1992), 231-240. + +[FlSt92] Fleischner, H. and Stiebitz, M., _A solution to a colouring problem of P. Erdős_. +Discrete Math. 101 (1992), 39-48. +-/ + +open SimpleGraph + +namespace Erdos842 + +/-- The graph of $n$ vertex-disjoint triangles on $3n$ vertices. Vertices $3i$, $3i+1$, $3i+2$ + form the $i$-th triangle. -/ +def triangleGraph (n : ℕ) : SimpleGraph (Fin (3 * n)) where + Adj u v := u ≠ v ∧ u.val / 3 = v.val / 3 + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.symm⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- A permutation $\sigma$ on `Fin m` is a single $m$-cycle (Hamiltonian cycle): applying $\sigma$ + repeatedly from any vertex can reach every other vertex. -/ +def IsSingleCycle {m : ℕ} (σ : Equiv.Perm (Fin m)) : Prop := + ∀ u v : Fin m, ∃ k : ℕ, (σ ^ k) u = v + +/-- The cycle graph induced by a permutation $\sigma$: vertices $u$ and $v$ are adjacent + iff $\sigma(u) = v$ or $\sigma(v) = u$. -/ +def cycleGraphOfPerm {m : ℕ} (σ : Equiv.Perm (Fin m)) : SimpleGraph (Fin m) where + Adj u v := u ≠ v ∧ (σ u = v ∨ σ v = u) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 842 [Er92b]: + +Let $G$ be a graph on $3n$ vertices formed by taking $n$ vertex-disjoint triangles +and adding a Hamiltonian cycle (with all new edges). Then $G$ has chromatic +number at most $3$. + +Proved by Fleischner and Stiebitz [FlSt92]. +-/ +@[category research solved, AMS 5] +theorem erdos_842 : answer(True) ↔ + ∀ (n : ℕ), n ≥ 1 → + ∀ (σ : Equiv.Perm (Fin (3 * n))), + IsSingleCycle σ → + (∀ u v : Fin (3 * n), + (cycleGraphOfPerm σ).Adj u v → ¬(triangleGraph n).Adj u v) → + (triangleGraph n ⊔ cycleGraphOfPerm σ).chromaticNumber ≤ 3 := by + sorry + +end Erdos842 diff --git a/FormalConjectures/ErdosProblems/843.lean b/FormalConjectures/ErdosProblems/843.lean new file mode 100644 index 0000000000..8aca5af0e3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/843.lean @@ -0,0 +1,54 @@ +/- +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 843 + +*Reference:* [erdosproblems.com/843](https://www.erdosproblems.com/843) + +A problem of Burr and Erdős [BuEr85]. Proved by Conlon, Fox, and Pham [CFP21], +who showed that the set of $k$-th powers contains a sparse Ramsey $r$-complete +subsequence for every $r, k \geq 2$. +-/ + +namespace Erdos843 + +/-- A set $A \subseteq \mathbb{N}$ is Ramsey $r$-complete if for every $r$-colouring of $A$, +every sufficiently large natural number can be written as a sum of +distinct monochromatic elements of $A$. -/ +def IsRamseyComplete (A : Set ℕ) (r : ℕ) : Prop := + ∀ c : ℕ → Fin r, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ (S : Finset ℕ) (a : Fin r), + (↑S : Set ℕ) ⊆ A ∧ + (∀ s ∈ S, c s = a) ∧ + S.sum id = n + +/-- +Erdős Problem 843 [BuEr85][Er92b][Er95]: +The set of perfect squares is Ramsey $2$-complete. That is, for any +$2$-colouring of the squares, every sufficiently large natural number +can be written as a monochromatic sum of distinct squares. + +Proved by Conlon, Fox, and Pham [CFP21]. +-/ +@[category research solved, AMS 5] +theorem erdos_843 : + answer(True) ↔ IsRamseyComplete {n : ℕ | ∃ m : ℕ, m ≥ 1 ∧ n = m ^ 2} 2 := by + sorry + +end Erdos843 diff --git a/FormalConjectures/ErdosProblems/844.lean b/FormalConjectures/ErdosProblems/844.lean new file mode 100644 index 0000000000..c2ffe5503e --- /dev/null +++ b/FormalConjectures/ErdosProblems/844.lean @@ -0,0 +1,65 @@ +/- +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 844 + +*Reference:* [erdosproblems.com/844](https://www.erdosproblems.com/844) + +A problem of Erdős and Sárközy [Er92b, p.239]. Proved affirmatively by Weisenberg, +and independently by Alexeev, Mixon, and Sawin [AMS25]. The proof reduces to +Chvátal's result [Ch74]; see also problems [701] and [848]. + +## References + +[Er92b] Erdős, P. and Sárközy, A. (1992). + +[AMS25] Alexeev, B., Mixon, D., and Sawin, W., _The independence and clique cover numbers + of the squarefree graph_. arXiv:2507.01928 (2025). + +[Ch74] Chvátal, V., _Intersecting families of edges in hypergraphs having the hereditary + property_ (1974), 61–66. +-/ + +namespace Erdos844 + +/-- The candidate extremal set for Erdős Problem 844: all numbers in +$\{1, \ldots, N\}$ that are either even or not squarefree. -/ +noncomputable def extremalSet (N : ℕ) : Finset ℕ := + (Finset.Icc 1 N).filter (fun n => Even n ∨ ¬Squarefree n) + +/-- +**Erdős Problem 844** [Er92b]: + +Let $A \subseteq \{1, \ldots, N\}$ be such that for all $a, b \in A$, the product $ab$ is not +squarefree. Then $|A| \leq |\mathrm{extremalSet}(N)|$. + +Equivalently, the maximum is achieved by the set of all even numbers together +with all odd non-squarefree numbers in $\{1, \ldots, N\}$. + +Proved by Weisenberg, and independently by Alexeev, Mixon, and Sawin [AMS25]. +-/ +@[category research solved, AMS 11] +theorem erdos_844 : + answer(True) ↔ ∀ (N : ℕ) (A : Finset ℕ), + A ⊆ Finset.Icc 1 N → + (∀ a ∈ A, ∀ b ∈ A, ¬Squarefree (a * b)) → + A.card ≤ (extremalSet N).card := by + sorry + +end Erdos844 diff --git a/FormalConjectures/ErdosProblems/852.lean b/FormalConjectures/ErdosProblems/852.lean new file mode 100644 index 0000000000..b40c5d9100 --- /dev/null +++ b/FormalConjectures/ErdosProblems/852.lean @@ -0,0 +1,71 @@ +/- +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 852 + +*Reference:* [erdosproblems.com/852](https://www.erdosproblems.com/852) + +Let $d_n = p_{n+1} - p_n$, where $p_n$ is the $n$-th prime. Let $h(x)$ be maximal +such that for some $n < x$ the numbers $d_n, d_{n+1}, \ldots, d_{n+h(x)-1}$ are +all distinct. Estimate $h(x)$. + +Brun's sieve implies $h(x) \to \infty$ as $x \to \infty$. + +[Er85c] Erdős, P., _Some problems and results on combinatorial number theory_ (1985). +-/ + +namespace Erdos852 + +/-- A run of $k$ consecutive prime gaps starting at position $n$ are all distinct: +$d_n, d_{n+1}, \ldots, d_{n+k-1}$ are pairwise different. -/ +def IsDistinctPrimeGapRun (n k : ℕ) : Prop := + Function.Injective (fun i : Fin k => _root_.primeGap (n + i.val)) + +/-- $h(x)$: the maximal length of a run of distinct consecutive prime gaps +$d_n, d_{n+1}, \ldots, d_{n+h-1}$ for some $n < x$. -/ +noncomputable def h (x : ℕ) : ℕ := + sSup {k : ℕ | ∃ n, n < x ∧ IsDistinctPrimeGapRun n k} + +/-- +**Erdős Problem 852** — Lower bound [Er85c]: + +Is it true that there exists a constant $c > 0$ such that for all sufficiently large $x$, +$h(x) > (\log x)^c$? +-/ +@[category research open, AMS 11] +theorem erdos_852 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ x : ℕ, x ≥ N₀ → + (h x : ℝ) > (Real.log (x : ℝ)) ^ c := by + sorry + +/-- +**Erdős Problem 852** — Upper bound [Er85c]: + +Is it true that $h(x) = o(\log x)$, i.e., for every $\varepsilon > 0$ there exists $N_0$ +such that for all $x \geq N_0$, $h(x) < \varepsilon \cdot \log(x)$? +-/ +@[category research open, AMS 11] +theorem erdos_852.variants.upper_bound : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ x : ℕ, x ≥ N₀ → + (h x : ℝ) < ε * Real.log (x : ℝ) := by + sorry + +end Erdos852 diff --git a/FormalConjectures/ErdosProblems/854.lean b/FormalConjectures/ErdosProblems/854.lean new file mode 100644 index 0000000000..5cbe159e76 --- /dev/null +++ b/FormalConjectures/ErdosProblems/854.lean @@ -0,0 +1,86 @@ +/- +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 854 + +*Reference:* [erdosproblems.com/854](https://www.erdosproblems.com/854) + +Let $n_k$ denote the $k$-th primorial, i.e. the product of the first $k$ primes. +If $1 = a_1 < a_2 < \cdots < a_{\varphi(n_k)} = n_k - 1$ is the sequence of integers +coprime to $n_k$, are there $\gg \max_i (a_{i+1} - a_i)$ many even integers +of the form $a_{j+1} - a_j$? + +Erdős initially conjectured that all even integers up to the maximum gap appear as +consecutive differences, but computational work by Lacampagne and Selfridge for +$n_k = 2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 = 30030$ produced counterexamples, +leading him to retreat to the weaker "$\gg$ many" formulation. + +This was asked by Erdős in Oberwolfach (most likely in 1986) [Er85c, p.80], [Ob1]. + +See also OEIS sequences [A389839](https://oeis.org/A389839) and +[A048670](https://oeis.org/A048670). +-/ + +open Nat Finset + +namespace Erdos854 + +/-- The $k$-th primorial: product of the first $k$ primes. +$\operatorname{primorial}(0) = 1$, $\operatorname{primorial}(1) = 2$, +$\operatorname{primorial}(2) = 6$, $\operatorname{primorial}(3) = 30$. -/ +noncomputable def primorial : ℕ → ℕ + | 0 => 1 + | k + 1 => Nat.nth Nat.Prime k * primorial k + +/-- The sorted list of integers in $\{1, \ldots, n-1\}$ coprime to $n$. +We exclude 0 because the coprime sequence starts at $a_1 = 1$. -/ +noncomputable def coprimeList (n : ℕ) : List ℕ := + ((Finset.range n).filter (fun a => 0 < a ∧ Nat.Coprime a n)).sort (· ≤ ·) + +/-- Consecutive differences of a sorted list of natural numbers. -/ +def consecutiveDiffs : List ℕ → List ℕ + | [] => [] + | [_] => [] + | a :: b :: rest => (b - a) :: consecutiveDiffs (b :: rest) + +/-- The set of distinct gap values in the coprime sequence for $n$. -/ +noncomputable def gapValues (n : ℕ) : Finset ℕ := + (consecutiveDiffs (coprimeList n)).toFinset + +/-- The maximum consecutive gap in the coprime sequence for $n$. +Equivalently, one could use `List.maximum?` on the consecutive differences. -/ +noncomputable def maxGap (n : ℕ) : ℕ := + (consecutiveDiffs (coprimeList n)).foldl max 0 + +/-- +Erdős Problem 854 [Er85c, Ob1]: + +Let $n_k$ be the $k$-th primorial. The number of distinct even integers appearing +as consecutive gaps among integers coprime to $n_k$ in $\{1, \ldots, n_k - 1\}$ +is $\gg \max_i(a_{i+1} - a_i)$. That is, there exist $C > 0$ and $K_0$ such that for all +$k \geq K_0$, the number of distinct gap values is at least $C$ times the maximum gap. +-/ +@[category research open, AMS 11] +theorem erdos_854 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (((gapValues (primorial k)).filter (Even ·)).card : ℝ) ≥ + C * (maxGap (primorial k) : ℝ) := by + sorry + +end Erdos854 diff --git a/FormalConjectures/ErdosProblems/856.lean b/FormalConjectures/ErdosProblems/856.lean new file mode 100644 index 0000000000..2abc9067f0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/856.lean @@ -0,0 +1,114 @@ +/- +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 856 + +*Reference:* [erdosproblems.com/856](https://www.erdosproblems.com/856) + +Let $k \geq 3$ and $f_k(N)$ be the maximum value of $\sum_{n \in A} 1/n$, where $A$ +ranges over all subsets of $\{1, \ldots, N\}$ which contain no subset of size $k$ +with the same pairwise least common multiple. + +Estimate $f_k(N)$. + +See also problem #536 for the analogous question with natural density in place of +logarithmic density. + +[Er70] Erdős, P., _Some extremal problems in combinatorial number theory_. +Mathematical Essays Dedicated to A. J. Macintyre (1970), 123–133. + +[TaZh25b] Tang, R. and Zhang, R., _Harmonic LCM patterns and sunflower-free capacity_. +arXiv:2512.20055 (2025). +-/ + +open Finset Real + +namespace Erdos856 + +/-- A family of sets forms a sunflower if every pair of distinct members +has the same intersection (the "kernel"). -/ +def IsSunflower {n : ℕ} (S : Finset (Finset (Fin n))) : Prop := + ∃ K : Finset (Fin n), (S : Set (Finset (Fin n))).Pairwise (fun A B => A ∩ B = K) + +/-- A finite set of natural numbers has no $k$-element subset where all pairwise +LCMs are equal. That is, there is no $S \subseteq A$ with $|S| = k$ and a value $L$ +such that $\operatorname{lcm}(a, b) = L$ for all distinct $a, b \in S$. -/ +def NoPairwiseLcmClique (A : Finset ℕ) (k : ℕ) : Prop := + ∀ S : Finset ℕ, S ⊆ A → S.card = k → + ¬∃ L : ℕ, ∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.lcm a b = L + +/-- $f_k(N)$: the supremum of $\sum_{n \in A} 1/n$ over subsets $A \subseteq \{1, \ldots, N\}$ +with no $k$-element subset having all pairwise LCMs equal. -/ +noncomputable def fk (k N : ℕ) : ℝ := + sSup {x : ℝ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ + NoPairwiseLcmClique A k ∧ + x = ∑ n ∈ A, (1 : ℝ) / (n : ℝ)} + +/-- +**Erdős Problem 856** — Upper bound [Er70]: + +For every $k \geq 3$, there exists $C > 0$ such that for all sufficiently large $N$, +$$f_k(N) \leq C \cdot \frac{\log N}{\log(\log N)}.$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_856 (k : ℕ) (hk : k ≥ 3) : + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + fk k N ≤ C * Real.log (N : ℝ) / Real.log (Real.log (N : ℝ)) := by + sorry + +/-- +**Erdős Problem 856** — Tang–Zhang lower bound [TaZh25b]: + +For every $k \geq 3$, there exist constants $b$ with $0 < b \leq 1$ and $C > 0$ such that +for all sufficiently large $N$, +$$f_k(N) \geq C \cdot (\log N)^{b}.$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_856.variants.tang_zhang_lower (k : ℕ) (hk : k ≥ 3) : + ∃ b : ℝ, 0 < b ∧ b ≤ 1 ∧ + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + fk k N ≥ C * (Real.log (N : ℝ)) ^ b := by + sorry + +/-- +**Erdős Problem 856** — Tang–Zhang upper bound [TaZh25b]: + +Assuming the sunflower conjecture (problem #857) holds for $k$-sunflowers, +for every $k \geq 3$, there exist constants $c$ with $0 < c < 1$ and $C > 0$ such that +for all sufficiently large $N$, +$$f_k(N) \leq C \cdot (\log N)^{c}.$$ + +The exponents $c_k$ are $< 1$ (improving over the trivial bound) if and only if +the sunflower conjecture [857] holds for $k$-sunflowers. +-/ +@[category research solved, AMS 5 11] +theorem erdos_856.variants.tang_zhang_upper (k : ℕ) (hk : k ≥ 3) + (hsunflower : ∃ c : ℝ, 0 < c ∧ c < 2 ∧ + ∀ n : ℕ, ∀ F : Finset (Finset (Fin n)), + (F.card : ℝ) > c ^ n → + ∃ S ⊆ F, S.card = k ∧ IsSunflower S) : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + fk k N ≤ C * (Real.log (N : ℝ)) ^ c := by + sorry + +end Erdos856 diff --git a/FormalConjectures/ErdosProblems/857.lean b/FormalConjectures/ErdosProblems/857.lean new file mode 100644 index 0000000000..d6685abad6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/857.lean @@ -0,0 +1,83 @@ +/- +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 857 + +*Reference:* [erdosproblems.com/857](https://www.erdosproblems.com/857) + +This is sometimes known as the weak sunflower problem (see problem \#20 +for the strong sunflower problem). See also problems \#536 and \#856. + +[Er70] Erdős, P., _Some extremal problems in combinatorial number theory_. +Mathematical Essays Dedicated to A. J. Macintyre (1970), pp. 123–133. + +[Er71] Erdős, P., _Topics in combinatorial analysis_ (1971), p. 105. + +[NaSa17] Naslund, E. and Sawin, W., _Upper bounds for sunflower-free sets_. +Forum Mathematicum Sigma (2017), Paper No. e15. +-/ + +open Finset + +namespace Erdos857 + +/-- A family of sets forms a sunflower if every pair of distinct members +has the same intersection (the "kernel"). -/ +def IsSunflower {n : ℕ} (S : Finset (Finset (Fin n))) : Prop := + ∃ K : Finset (Fin n), (S : Set (Finset (Fin n))).Pairwise (fun A B => A ∩ B = K) + +/-- +**Erdős Problem 857** — Weak Sunflower Problem: + +For every $k \geq 2$, there exists a constant $c$ depending only on $k$ (with $c < 2$) +such that any family of distinct subsets of $\{1, \ldots, n\}$ of size greater than +$c^n$ must contain a sunflower of size $k$. + +The trivial upper bound on $m(n,k)$ is $2^n$ (the total number of subsets), +so the content of this conjecture is that the base of the exponential +is strictly less than $2$. +-/ +@[category research open, AMS 5] +theorem erdos_857 (k : ℕ) (hk : k ≥ 2) : + ∃ c : ℝ, 0 < c ∧ c < 2 ∧ + ∀ n : ℕ, + ∀ F : Finset (Finset (Fin n)), + (F.card : ℝ) > c ^ n → + ∃ S ⊆ F, S.card = k ∧ IsSunflower S := by + sorry + +/-- +**Erdős Problem 857** — Naslund–Sawin bound [NaSa17]: + +$m(n, 3) \leq (3 / 2^{2/3})^{(1 + o(1)) n}$. + +For every $\varepsilon > 0$, for all sufficiently large $n$, any family of more than +$((3 / 2^{2/3}) + \varepsilon)^n$ distinct subsets of $\{1, \ldots, n\}$ contains a +$3$-sunflower. +-/ +@[category research solved, AMS 5] +theorem erdos_857.variants.naslund_sawin : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ F : Finset (Finset (Fin n)), + (F.card : ℝ) > (3 / (2 : ℝ) ^ ((2 : ℝ) / 3) + ε) ^ n → + ∃ S ⊆ F, S.card = 3 ∧ IsSunflower S := by + sorry + +end Erdos857 diff --git a/FormalConjectures/ErdosProblems/858.lean b/FormalConjectures/ErdosProblems/858.lean new file mode 100644 index 0000000000..d8cfd1838f --- /dev/null +++ b/FormalConjectures/ErdosProblems/858.lean @@ -0,0 +1,101 @@ +/- +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 858 + +*Reference:* [erdosproblems.com/858](https://www.erdosproblems.com/858) + +Let $A \subseteq \{1, \ldots, N\}$ be such that there is no solution to $at = b$ with +$a, b \in A$ and the smallest prime factor of $t$ is $> a$. Estimate the maximum of +$$\frac{1}{\log N} \sum_{n \in A} \frac{1}{n}.$$ + +Alexander [Al66] and Erdős, Sárközi, and Szemerédi [ESS68] proved that this +maximum is $o(1)$ (as $N \to \infty$). This condition on $A$ is a weaker form of the +usual primitive condition. If $A$ is primitive then Behrend [Be35] proved +$$\frac{1}{\log N} \sum_{n \in A} \frac{1}{n} \ll \frac{1}{\sqrt{\log \log N}}.$$ + +An example of such a set $A$ is the set of all integers in $[N^{1/2}, N]$ +divisible by some prime $> N^{1/2}$. + +See also [Erdős Problem 143](https://www.erdosproblems.com/143) concerning primitive sets. + +[Er70] Erdős, P. (1970), p. 128. + +[Al66] Alexander, R., *Density and multiplicative structure of sets of integers*. +Acta Arith. (1966/67), 321-332. + +[ESS68] Erdős, P., Sárközi, A., and Szemerédi, E., *On the solvability of certain +equations in sequences of positive upper logarithmic density*. +J. London Math. Soc. (1968), 71-78. + +[Be35] Behrend, F., *On sequences of numbers not divisible one by another*. +J. London Math. Soc. **10** (1935), 42-45. +-/ + +open scoped BigOperators + +namespace Erdos858 + +/-- A finite set $A$ of positive integers satisfies the *weak primitive* condition +if whenever $at = b$ for $a, b \in A$ with $t > 1$, the smallest prime factor of $t$ +is at most $a$. -/ +def IsWeakPrimitive (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, a < b → a ∣ b → + Nat.minFac (b / a) ≤ a + +/-- The maximum of $\sum_{n \in A} \frac{1}{n}$ over all weak-primitive subsets +$A \subseteq \{1, \ldots, N\}$. -/ +noncomputable def weakPrimitiveMaxSum (N : ℕ) : ℝ := + sSup {x : ℝ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ + IsWeakPrimitive A ∧ + x = ∑ n ∈ A, (1 : ℝ) / (n : ℝ)} + +/-- +**Erdős Problem 858** — Known result [Al66, ESS68]: + +The quantity $\frac{1}{\log N} \cdot \max\left\{\sum_{n \in A} \frac{1}{n}\right\}$ over +weak-primitive subsets $A \subseteq \{1, \ldots, N\}$ tends to $0$ as $N \to \infty$. + +Formulated as: for every $\varepsilon > 0$, there exists $N_0$ such that for all $N \geq N_0$, +$\mathrm{weakPrimitiveMaxSum}(N) \leq \varepsilon \cdot \log N$. +-/ +@[category research solved, AMS 11] +theorem erdos_858 : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + weakPrimitiveMaxSum N ≤ ε * Real.log (N : ℝ) := by + sorry + +/-- +**Erdős Problem 858** — Behrend-type conjecture: + +Does there exist $C > 0$ such that for all sufficiently large $N$, +$$\frac{1}{\log N} \cdot \max\left\{\sum_{n \in A} \frac{1}{n}\right\} + \leq \frac{C}{\sqrt{\log \log N}}?$$ +-/ +@[category research open, AMS 11] +theorem erdos_858.variants.behrend_type : + answer(sorry) ↔ + (∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + weakPrimitiveMaxSum N ≤ C * Real.log (N : ℝ) / + Real.sqrt (Real.log (Real.log (N : ℝ)))) := by + sorry + +end Erdos858 diff --git a/FormalConjectures/ErdosProblems/86.lean b/FormalConjectures/ErdosProblems/86.lean new file mode 100644 index 0000000000..fec87e4002 --- /dev/null +++ b/FormalConjectures/ErdosProblems/86.lean @@ -0,0 +1,116 @@ +/- +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 86 + +*Reference:* [erdosproblems.com/86](https://www.erdosproblems.com/86) + +This problem has a **$100** reward. + +Let $Q_n$ be the $n$-dimensional hypercube graph (so that $Q_n$ has $2^n$ vertices +and $n \cdot 2^{n-1}$ edges). Is it true that every subgraph of $Q_n$ with +$\geq (\frac{1}{2} + o(1)) n \cdot 2^{n-1}$ many edges contains a $C_4$? + +Equivalently, let $f(n)$ be the maximum number of edges in a subgraph of $Q_n$ +without a $C_4$. The conjecture is that $f(n) \leq (\frac{1}{2} + o(1)) n \cdot 2^{n-1}$. + +Erdős [Er91] showed that $f(n) \geq (\frac{1}{2} + c/n) n \cdot 2^{n-1}$ for some +constant $c > 0$. Brass, Harborth, and Nienborg [BHN95] improved the lower bound to +$f(n) \geq (\frac{1}{2} + c/\sqrt{n}) n \cdot 2^{n-1}$. + +Balogh, Hu, Lidicky, and Liu [BHLL14] proved $f(n) \leq 0.6068 \cdot n \cdot 2^{n-1}$. +This was improved to $\leq 0.60318 \cdot n \cdot 2^{n-1}$ by Baber [Ba12b]. + +See also Problem 666 (the $C_6$ analogue) and OEIS A245762. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467–478. + +[Er91] Erdős, P., _Problems and results in combinatorial analysis and combinatorial number +theory_. Graph Theory, Combinatorics, and Applications, Vol. 1 (Kalamazoo, MI, 1988) (1991), +397–406. + +[Er92b] Erdős, P., _Some of my old and new problems in elementary number theory and +geometry_. Proceedings of the Fifth Canadian Number Theory Association Conference (1992). + +[Er93] Erdős, P., _On some of my favourite theorems_. Combinatorics, Paul Erdős is +eighty, Vol. 2 (Keszthely, 1993), 97–132. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Discrete Math. 165/166 (1997), 227–231. + +[Er95] Erdős, P., _Some recent problems and results in graph theory_. +Discrete Math. 164 (1997), 81–85. + +[Er97f] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +164 (1997), no. 1-3, 81–85. + +[BHN95] Brass, P., Harborth, H., Nienborg, H., _On the maximum number of edges in a +C₄-free subgraph of Qₙ_. J. Graph Theory (1995), 17–23. + +[BHLL14] Balogh, J., Hu, P., Lidický, B., Liu, H., _Upper bounds on the size of 4- and +6-cycle-free subgraphs of the hypercube_. European J. Combin. (2014), 75–85. + +[Ba12b] Baber, R., _Turán densities of hypercubes_. arXiv:1201.3587 (2012). +-/ + +open SimpleGraph Finset + +namespace Erdos86 + +/-- The $n$-dimensional hypercube graph $Q_n$. Vertices are functions +$\operatorname{Fin} n \to \operatorname{Bool}$, and two vertices are adjacent iff they differ +in exactly one coordinate. -/ +noncomputable def hypercubeGraph (n : ℕ) : SimpleGraph (Fin n → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm u v := by + rintro ⟨hne, hcard⟩ + refine ⟨hne.symm, ?_⟩ + have heq : (Finset.univ.filter fun i => v i ≠ u i) = + (Finset.univ.filter fun i => u i ≠ v i) := + Finset.filter_congr (fun i _ => ne_comm) + rw [heq] + exact hcard + loopless := fun v ⟨hne, _⟩ => hne rfl + +/-- The cycle graph $C_m$ on $m$ vertices ($m \geq 3$). Vertex $i$ is adjacent to vertex +$i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$. -/ +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) + symm := fun _ _ ⟨hne, h⟩ => ⟨hne.symm, h.elim Or.inr Or.inl⟩ + loopless := fun _ ⟨h, _⟩ => h rfl + +/-- +Erdős Problem 86 [Er90][Er91][Er92b][Er93][Er94b][Er95][Er97f]: + +Is it true that for every $\varepsilon > 0$, if $n$ is sufficiently large, every subgraph of +$Q_n$ with at least $(\frac{1}{2} + \varepsilon) \cdot n \cdot 2^{n-1}$ edges contains a $C_4$? +-/ +@[category research open, AMS 5] +theorem erdos_86 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ H : SimpleGraph (Fin n → Bool), + (∀ u v : Fin n → Bool, H.Adj u v → (hypercubeGraph n).Adj u v) → + (↑(H.edgeFinset.card) : ℝ) ≥ (1 / 2 + ε) * ↑n * (2 : ℝ) ^ (n - 1 : ℕ) → + ∃ f : Fin 4 → (Fin n → Bool), Function.Injective f ∧ + ∀ i j, (cycleGraph 4 (by omega)).Adj i j → H.Adj (f i) (f j) := by + sorry + +end Erdos86 diff --git a/FormalConjectures/ErdosProblems/860.lean b/FormalConjectures/ErdosProblems/860.lean new file mode 100644 index 0000000000..70ff298eb3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/860.lean @@ -0,0 +1,91 @@ +/- +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 860 + +*Reference:* [erdosproblems.com/860](https://www.erdosproblems.com/860) + +Let $h(n)$ be such that, for any $m \geq 1$, in the interval $(m, m + h(n))$ there +exist distinct integers $a_i$ for $1 \leq i \leq \pi(n)$ such that $p_i \mid a_i$, where $p_i$ +denotes the $i$-th prime. + +Estimate $h(n)$. + +A problem of Erdős and Pomerance [ErPo80], who proved that +$h(n) \ll n^{3/2} / (\log n)^{1/2}$. +Erdős and Selfridge proved $h(n) > (3 - o(1))n$, and Ruzsa proved $h(n)/n \to \infty$. +The individual bounds are established, but the problem of determining the true order of +$h(n)$ remains open. + +See also: Problem 375 (Grimm's conjecture), which involves a related injective assignment +of primes to integers with divisibility constraints. + +OEIS: [A048670](https://oeis.org/A048670), [A058989](https://oeis.org/A058989). + +[ErPo80] Erdős, P. and Pomerance, C., *Matching the natural numbers up to n with distinct +multiples in another interval*. Indigationes Math. (1980), 147–151. + +[Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 47 (1992), no. 2, 231–240. + +[Gu04] Guy, Richard K., *Unsolved problems in number theory*. (2004), xviii+437, Problem B32. +-/ + +open Filter + +namespace Erdos860 + +/-- A prime covering of $(m, m + h)$ for primes up to $n$: an injective assignment +of distinct integers in $(m, m + h)$, one for each prime $p \leq n$, such that +$p$ divides the integer assigned to it. -/ +def HasPrimeCovering (n m h : ℕ) : Prop := + ∃ a : {p : ℕ // p.Prime ∧ p ≤ n} → ℕ, + Function.Injective a ∧ + (∀ p, m < a p ∧ a p < m + h) ∧ + (∀ p, p.val ∣ a p) + +/-- `erdosPomeranceH n` is the smallest $h$ such that for every $m \geq 1$, +in the open interval $(m, m + h)$ one can find $\pi(n)$ distinct multiples, +one for each prime $p \leq n$. -/ +noncomputable def erdosPomeranceH (n : ℕ) : ℕ := + sInf {h : ℕ | ∀ m : ℕ, m ≥ 1 → HasPrimeCovering n m h} + +/-- +Erdős Problem 860, upper bound (Erdős–Pomerance [ErPo80]): + +There exists $C > 0$ such that for all sufficiently large $n$, +$$h(n) \leq C \cdot n^{3/2} / (\log n)^{1/2}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_860 : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdosPomeranceH n : ℝ) ≤ + C * (n : ℝ) ^ ((3 : ℝ) / 2) / (Real.log (n : ℝ)) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 860, lower bound (Ruzsa): +$h(n) / n \to \infty$ as $n \to \infty$. +-/ +@[category research solved, AMS 11] +theorem erdos_860.variants.lower_ruzsa : + Tendsto (fun n => (erdosPomeranceH n : ℝ) / (n : ℝ)) atTop atTop := by + sorry + +end Erdos860 diff --git a/FormalConjectures/ErdosProblems/861.lean b/FormalConjectures/ErdosProblems/861.lean new file mode 100644 index 0000000000..7e30aecb31 --- /dev/null +++ b/FormalConjectures/ErdosProblems/861.lean @@ -0,0 +1,94 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 861 + +*Reference:* [erdosproblems.com/861](https://www.erdosproblems.com/861) + +Let $f(N)$ be the size of the largest Sidon subset of $\{1,\ldots,N\}$ and $A(N)$ be +the number of Sidon subsets of $\{1,\ldots,N\}$. Is it true that +$$A(N)/2^{f(N)}\to \infty?$$ +Is it true that $A(N) = 2^{(1+o(1))f(N)}$? + +A problem of Cameron and Erdős [Er92c]. The first question is answered positively and the +second negatively. The current best bounds (for large $N$) are +$$2^{1.16\,f(N)} \leq A(N) \leq 2^{6.442\,f(N)}.$$ +The lower bound is due to Saxton–Thomason [SaTh15]; the upper bound is due to +Kohayakawa–Lee–Rödl–Samotij [KLRS15]. + +See also problem 862. + +[Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 47 (1992), no. 2, 231–240. + +[SaTh15] Saxton, D. and Thomason, A., *Hypergraph containers*, Inventiones Mathematicae +201 (2015), 925–992. + +[KLRS15] Kohayakawa, Y., Lee, S. J., Rödl, V., and Samotij, W., *The number of Sidon sets and +the maximum size of Sidon sets contained in a sparse random set of integers*, Random Structures +& Algorithms 46 (2015), no. 1, 1–25. +-/ + +open scoped Classical + +open Finset Filter + +namespace Erdos861 + +/-- $A(N)$, the number of Sidon subsets of $\{1, \ldots, N\}$. -/ +noncomputable def countSidonSubsets (N : ℕ) : ℕ := + ((Icc 1 N).powerset.filter fun S : Finset ℕ ↦ IsSidon (S : Set ℕ)).card + +/-- +Erdős Problem 861, first question (Cameron–Erdős [Er92c], proved): + +$A(N) / 2^{f(N)} \to \infty$ as $N \to \infty$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_861 : answer(True) ↔ + Tendsto (fun N => (countSidonSubsets N : ℝ) / (2 : ℝ) ^ ((Icc 1 N).maxSidonSubsetCard)) + atTop atTop := by + sorry + +/-- +Erdős Problem 861, lower bound (Saxton–Thomason [SaTh15]): + +For all sufficiently large $N$, +$A(N) \geq 2^{1.16 \cdot f(N)}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_861.variants.lower : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (countSidonSubsets N : ℝ) ≥ (2 : ℝ) ^ ((1.16 : ℝ) * ((Icc 1 N).maxSidonSubsetCard : ℝ)) := by + sorry + +/-- +Erdős Problem 861, upper bound (Kohayakawa–Lee–Rödl–Samotij [KLRS15]): + +For all sufficiently large $N$, +$A(N) \leq 2^{6.442 \cdot f(N)}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_861.variants.upper : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (countSidonSubsets N : ℝ) ≤ (2 : ℝ) ^ ((6.442 : ℝ) * ((Icc 1 N).maxSidonSubsetCard : ℝ)) := by + sorry + +end Erdos861 diff --git a/FormalConjectures/ErdosProblems/862.lean b/FormalConjectures/ErdosProblems/862.lean new file mode 100644 index 0000000000..a4aeed66d8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/862.lean @@ -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.Combinatorics.Basic + +/-! +# Erdős Problem 862 + +*Reference:* [erdosproblems.com/862](https://www.erdosproblems.com/862) + +Let $A_1(N)$ be the number of maximal Sidon subsets of $\{1,\ldots,N\}$. Is it true that +$A_1(N) < 2^{o(N^{1/2})}$? Is it true that $A_1(N) > 2^{N^c}$ for some constant $c > 0$? + +A problem of Cameron and Erdős [Er92c, p.39]. + +**Status**: Both questions are resolved by results of Saxton and Thomason [SaTh15]. +They prove that the number of Sidon sets in $\{1,\ldots,N\}$ is at least +$2^{(1.16+o(1))N^{1/2}}$. Since each Sidon set is contained in a maximal Sidon set, and each +maximal Sidon set contains at most $2^{(1+o(1))N^{1/2}}$ Sidon subsets, it follows that +$A_1(N) \geq 2^{(0.16+o(1))N^{1/2}}$. This shows the first conjecture is false and the second +is true. + +[Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 47 (1992), no. 2, 231–240. + +[SaTh15] Saxton, D. and Thomason, A., *The number of Sidon sets and the maximum size +of Sidon sets contained in a sparse random set of integers*, Random Structures & Algorithms +46 (2015), no. 1, 1–25. +-/ + +open Finset Classical + +namespace Erdos862 + +/-- $A_1(N)$ is the number of maximal Sidon subsets of $\{1,\ldots,N\}$. -/ +noncomputable def countMaximalSidon (N : ℕ) : ℕ := + ((Icc 1 N).powerset.filter + (fun S => Set.IsMaximalSidonSetIn (S : Set ℕ) N)).card + +/-- +Erdős Problem 862, first question (Cameron–Erdős [Er92c], disproved by Saxton–Thomason [SaTh15]): + +$A_1(N) \not< 2^{o(N^{1/2})}$. More precisely, for all sufficiently large $N$, +$A_1(N) \geq 2^{0.16 \cdot N^{1/2}}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_862 : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (countMaximalSidon N : ℝ) ≥ (2 : ℝ) ^ ((0.16 : ℝ) * (N : ℝ) ^ ((1 : ℝ) / 2)) := by + sorry + +/-- +Erdős Problem 862, second question (Cameron–Erdős [Er92c], proved by Saxton–Thomason [SaTh15]): + +$A_1(N) > 2^{N^c}$ for some $c > 0$, for all sufficiently large $N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_862.variants.second_question : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (countMaximalSidon N : ℝ) > (2 : ℝ) ^ ((N : ℝ) ^ c) := by + sorry + +end Erdos862 diff --git a/FormalConjectures/ErdosProblems/863.lean b/FormalConjectures/ErdosProblems/863.lean new file mode 100644 index 0000000000..2fe9a9dd73 --- /dev/null +++ b/FormalConjectures/ErdosProblems/863.lean @@ -0,0 +1,95 @@ +/- +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 863 + +*Reference:* [erdosproblems.com/863](https://www.erdosproblems.com/863) + +A problem of Erdős [Er92c], first formulated in conversation with Berend, and later +independently reformulated with Freud. It is known that $c_1 = c_1' = 1$ (the classical +bound on Sidon sets). + +[Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 47 (1992), no. 2, 231–240. +-/ + +open Classical Finset Filter + +open scoped Topology + +namespace Erdos863 + +/-- The number of representations of $n$ as $a + b$ with $a \leq b$ and $a, b \in S$. -/ +noncomputable def sumRepCount (S : Finset ℕ) (n : ℕ) : ℕ := + S.sum (fun a => (S.filter (fun b => a ≤ b ∧ a + b = n)).card) + +/-- $S$ is a $B_2[r]$ set if every $n$ has at most $r$ representations + as $a + b$ with $a \leq b$, $a, b \in S$. -/ +def IsB2r (r : ℕ) (S : Finset ℕ) : Prop := + ∀ n : ℕ, sumRepCount S n ≤ r + +/-- The maximum cardinality of a $B_2[r]$ subset of $\{1, \ldots, N\}$. -/ +noncomputable def maxB2rSize (r : ℕ) (N : ℕ) : ℕ := + ((Icc 1 N).powerset.filter (fun S => IsB2r r S)).sup Finset.card + +/-- The number of representations of a positive integer $n$ as a difference $a - b = n$ + (equivalently, $a = b + n$) with $a, b \in S$. -/ +noncomputable def diffRepCount (S : Finset ℕ) (n : ℕ) : ℕ := + S.sum (fun b => (S.filter (fun a => a = b + n)).card) + +/-- $S$ is difference-$r$-bounded if every nonzero difference has at most $r$ + representations as $a - b$ with $a, b \in S$. -/ +def IsDiffBounded (r : ℕ) (S : Finset ℕ) : Prop := + ∀ n : ℕ, n > 0 → diffRepCount S n ≤ r + +/-- The maximum cardinality of a difference-$r$-bounded subset of $\{1, \ldots, N\}$. -/ +noncomputable def maxDiffBoundedSize (r : ℕ) (N : ℕ) : ℕ := + ((Icc 1 N).powerset.filter (fun S => IsDiffBounded r S)).sup Finset.card + +/-- +Erdős Problem 863, weak form [Er92c]: + +If the limits $c_r = \lim_{N \to \infty} f_r^+(N) / \sqrt{N}$ (maximum $B_2[r]$ set size) +and $c_r' = \lim_{N \to \infty} f_r^-(N) / \sqrt{N}$ (maximum difference-$r$-bounded set +size) both exist, then $c_r \neq c_r'$ for $r \geq 2$. +-/ +@[category research open, AMS 5 11] +theorem erdos_863 : answer(sorry) ↔ + ∀ (r : ℕ), r ≥ 2 → ∀ (c c' : ℝ), + Tendsto (fun N => (maxB2rSize r N : ℝ) / Real.sqrt (N : ℝ)) atTop (nhds c) → + Tendsto (fun N => (maxDiffBoundedSize r N : ℝ) / Real.sqrt (N : ℝ)) atTop (nhds c') → + c ≠ c' := by + sorry + +/-- +Erdős Problem 863, strong form [Er92c]: + +If the limits $c_r = \lim_{N \to \infty} f_r^+(N) / \sqrt{N}$ (maximum $B_2[r]$ set size) +and $c_r' = \lim_{N \to \infty} f_r^-(N) / \sqrt{N}$ (maximum difference-$r$-bounded set +size) both exist, then $c_r' < c_r$ for $r \geq 2$. +-/ +@[category research open, AMS 5 11] +theorem erdos_863.variants.strong : answer(sorry) ↔ + ∀ (r : ℕ), r ≥ 2 → ∀ (c c' : ℝ), + Tendsto (fun N => (maxB2rSize r N : ℝ) / Real.sqrt (N : ℝ)) atTop (nhds c) → + Tendsto (fun N => (maxDiffBoundedSize r N : ℝ) / Real.sqrt (N : ℝ)) atTop (nhds c') → + c' < c := by + sorry + +end Erdos863 diff --git a/FormalConjectures/ErdosProblems/864.lean b/FormalConjectures/ErdosProblems/864.lean new file mode 100644 index 0000000000..5bf5bfb5ac --- /dev/null +++ b/FormalConjectures/ErdosProblems/864.lean @@ -0,0 +1,115 @@ +/- +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 864 + +*Reference:* [erdosproblems.com/864](https://www.erdosproblems.com/864) + +Let $A\subseteq \{1,\ldots, N\}$ be a set such that there exists at most one $n$ +with more than one solution to $n = a + b$ (with $a \le b \in A$). +Estimate the maximal possible size of $|A|$ — in particular, is it true that +$|A| \le (1+o(1))\frac{2}{\sqrt{3}} N^{1/2}$? + +A problem of Erdős and Freud [ErFr91], who prove the matching lower bound +$|A| \ge (1+o(1))\frac{2}{\sqrt{3}} N^{1/2}$. + +For the analogous question with $n = a - b$, they proved $|A| \sim N^{1/2}$. + +This is a weaker form of Problem 840. See also OEIS sequence A389182. + +[ErFr91] Erdős, P. and Freud, R., *On Sidon-sequences and related problems*, +Mat. Lapok (1991). + +[Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, +Matematiche (Catania) 47 (1992), no. 2, 231–240. +-/ + +open Finset Classical + +namespace Erdos864 + +/-- The number of representations of $n$ as $a + b$ with $a \le b$, $a \in A$, $b \in A$. -/ +def sumRepCount (A : Finset ℕ) (n : ℕ) : ℕ := + (A.filter (fun a => 2 * a ≤ n ∧ (n - a) ∈ A)).card + +/-- A set $A$ is *almost Sidon* if at most one integer $n$ has more than one + representation as $n = a + b$ with $a \le b \in A$. -/ +def IsAlmostSidon (A : Finset ℕ) : Prop := + ∃ S : Finset ℕ, S.card ≤ 1 ∧ + ∀ n : ℕ, n ∉ S → sumRepCount A n ≤ 1 + +/-- The maximum size of an almost Sidon subset of $\{1, \ldots, N\}$. -/ +noncomputable def maxAlmostSidonCard (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter IsAlmostSidon).sup Finset.card + +/-- +**Erdős Problem 864** [ErFr91] — Is it true that for every $\varepsilon > 0$, +for sufficiently large $N$, +$$f(N) \le \left(\frac{2}{\sqrt{3}} + \varepsilon\right) \sqrt{N}?$$ +-/ +@[category research open, AMS 5 11] +theorem erdos_864 : answer(sorry) ↔ + (∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (maxAlmostSidonCard N : ℝ) ≤ (2 / Real.sqrt 3 + ε) * Real.sqrt (N : ℝ)) := by + sorry + +/-- +**Erdős Problem 864** — Lower bound (Erdős–Freud [ErFr91]): + +For every $\varepsilon > 0$, for sufficiently large $N$, +$$f(N) \ge \left(\frac{2}{\sqrt{3}} - \varepsilon\right) \sqrt{N}.$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_864.variants.lower_bound : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (maxAlmostSidonCard N : ℝ) ≥ (2 / Real.sqrt 3 - ε) * Real.sqrt (N : ℝ) := by + sorry + +/-- The number of representations of $n$ as $a - b$ with $a > b$, $a \in A$, $b \in A$. -/ +def diffRepCount (A : Finset ℕ) (n : ℕ) : ℕ := + (A.filter (fun b => (n + b) ∈ A)).card + +/-- A set $A$ is *almost Sidon for differences* if at most one nonzero integer $n$ has more than + one representation as $n = a - b$ with $a, b \in A$. -/ +def IsAlmostSidonDiff (A : Finset ℕ) : Prop := + ∃ S : Finset ℕ, S.card ≤ 1 ∧ + ∀ n : ℕ, n ≠ 0 → n ∉ S → diffRepCount A n ≤ 1 + +/-- The maximum size of an almost-Sidon-for-differences subset of $\{1, \ldots, N\}$. -/ +noncomputable def maxAlmostSidonDiffCard (N : ℕ) : ℕ := + ((Finset.Icc 1 N).powerset.filter IsAlmostSidonDiff).sup Finset.card + +/-- +**Erdős Problem 864** — Difference analogue (Erdős–Freud [ErFr91]): + +For the analogous question with differences $n = a - b$, the maximum size satisfies +$|A| \sim N^{1/2}$, i.e., for every $\varepsilon > 0$ and sufficiently large $N$, +$(1 - \varepsilon) \sqrt{N} \le f_{\mathrm{diff}}(N) \le (1 + \varepsilon) \sqrt{N}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_864.variants.diff_analogue : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (1 - ε) * Real.sqrt (N : ℝ) ≤ (maxAlmostSidonDiffCard N : ℝ) ∧ + (maxAlmostSidonDiffCard N : ℝ) ≤ (1 + ε) * Real.sqrt (N : ℝ) := by + sorry + +end Erdos864 diff --git a/FormalConjectures/ErdosProblems/866.lean b/FormalConjectures/ErdosProblems/866.lean new file mode 100644 index 0000000000..280952649e --- /dev/null +++ b/FormalConjectures/ErdosProblems/866.lean @@ -0,0 +1,90 @@ +/- +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 866 + +*Reference:* [erdosproblems.com/866](https://www.erdosproblems.com/866) + +Let $k \geq 3$ and let $g_k(N)$ be minimal such that if $A \subseteq \{1, \ldots, 2N\}$ has +$|A| \geq N + g_k(N)$ then there exist integers $b_1, \ldots, b_k$ such that all $\binom{k}{2}$ +pairwise sums $b_i + b_j$ are in $A$ (but the $b_i$ themselves need not be in $A$). + +Estimate $g_k(N)$ [Er92c, p.41]. + +Known results: +- $g_3(N) = 2$ and $g_4(N) \leq 2032$ +- $g_5(N) \asymp \log N$ and $g_6(N) \asymp N^{1/2}$ +- $g_k(N) \ll_k N^{1 - 2^{-k}}$ for all $k \geq 3$ +- For every $\varepsilon > 0$, if $k$ is sufficiently large then $g_k(N) > N^{1-\varepsilon}$ + +[CES75] Choi, S. L. G., Erdős, P., and Szemerédi, E., _Some additive and multiplicative +problems in combinatorics_, 1975. + +[Er92c] Erdős, P., _Some of my forgotten problems in number theory_. Hardy-Ramanujan J. 15 +(1992), 34-50. +-/ + +namespace Erdos866 + +/-- A finset $A$ of integers contains all pairwise sums of some $k$ integers: there exist +$b_1, \ldots, b_k \in \mathbb{Z}$ such that $b_i + b_j \in A$ for all $i < j$. -/ +def HasPairwiseSums (A : Finset ℤ) (k : ℕ) : Prop := + ∃ b : Fin k → ℤ, Function.Injective b ∧ + ∀ i j : Fin k, i < j → (b i + b j) ∈ A + +/-- $g_k(N)$ is the minimal $g \in \mathbb{N}$ such that every $A \subseteq \{1, \ldots, 2N\}$ +with $|A| \geq N + g$ contains all pairwise sums of some $k$ integers. -/ +noncomputable def gPairwiseSum (k N : ℕ) : ℕ := + sInf {g : ℕ | ∀ A : Finset ℤ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ 2 * (N : ℤ)) → + A.card ≥ N + g → HasPairwiseSums A k} + +/-- +Erdős Problem 866, upper bound [CES75]: +For every $k \geq 3$, $g_k(N) \ll_k N^{1 - 2^{-k}}$, i.e., there exists a constant $C > 0$ +(depending on $k$) such that $g_k(N) \leq C \cdot N^{1 - 1/2^k}$ for all $N \geq 1$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_866 (k : ℕ) (hk : k ≥ 3) : + ∃ C : ℝ, C > 0 ∧ ∀ N : ℕ, N ≥ 1 → + (gPairwiseSum k N : ℝ) ≤ C * (N : ℝ) ^ ((1 : ℝ) - 1 / (2 : ℝ) ^ k) := by + sorry + +/-- +Erdős Problem 866 [CES75]: $g_3(N) = 2$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_866.variants.g3 : + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → gPairwiseSum 3 N = 2 := by + sorry + +/-- +Erdős Problem 866, lower bound for large $k$ [CES75]: +For every $\varepsilon > 0$, there exists $k_0$ such that for all $k \geq k_0$, +$g_k(N) > N^{1 - \varepsilon}$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_866.variants.lower_bound_large_k : + ∀ ε : ℝ, ε > 0 → + ∃ k₀ : ℕ, ∀ k : ℕ, k ≥ k₀ → + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (gPairwiseSum k N : ℝ) > (N : ℝ) ^ ((1 : ℝ) - ε) := by + sorry + +end Erdos866 diff --git a/FormalConjectures/ErdosProblems/867.lean b/FormalConjectures/ErdosProblems/867.lean new file mode 100644 index 0000000000..e2f8cd2e02 --- /dev/null +++ b/FormalConjectures/ErdosProblems/867.lean @@ -0,0 +1,73 @@ +/- +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 867 + +*Reference:* [erdosproblems.com/867](https://www.erdosproblems.com/867) + +Erdős asked whether a consecutive-sum-free subset of $\{1, \ldots, N\}$ can have at most +$N/2 + C$ elements for some absolute constant $C$. This is a finitary version of +[Problem #839](https://www.erdosproblems.com/839). Freud [Fr93] first disproved it by +constructing sets of density ≥ 19/36. Coppersmith and Phillips [CoPh96] later proved the +tighter bounds $(13/24)N - O(1) \le |A| \le (2/3 - 1/512)N + \log N$. Adenwalla observed +the upper bound $|A| \le (2/3 + o(1))N$. + +[Er92c] Erdős, P., _Some of my favourite problems which recently have been solved_, Proceedings +of the international conference on set-theoretic topology and its applications, Part 2, Matsuyama +(1992), p. 43. + +[Fr93] Freud, R., _Adding numbers — on a problem of P. Erdős_, James Cook Mathematical Notes +(1993), 6199–6202. + +[CoPh96] Coppersmith, D. and Phillips, S., _On a question of Erdős on subsequence sums_, +SIAM J. Discrete Math. (1996), 173–177. +-/ + +open Finset + +namespace Erdos867 + +/-- A finite set $A$ of natural numbers is "consecutive-sum-free" if, when its +elements are listed in increasing order as $a_1 < a_2 < \cdots < a_t$, no sum of +two or more consecutive elements ($a_i + a_{i+1} + \cdots + a_j$ with $i < j$) +lies in $A$. -/ +def ConsecutiveSumFree (A : Finset ℕ) : Prop := + let s := A.sort (· ≤ ·) + ∀ i j : ℕ, i < j → j < s.length → + (∑ k ∈ Icc i j, s.getD k 0) ∉ A + +/-- +Erdős Problem 867 (disproved) [Er92c]: + +Is it true that if $A = \{a_1 < \cdots < a_t\} \subseteq \{1, \ldots, N\}$ has no sum of two or +more consecutive elements in $A$, then $|A| \le N/2 + C$ for some absolute constant $C$? + +Disproved by Coppersmith and Phillips [CoPh96], who proved the maximum $|A|$ satisfies +$$ + \frac{13}{24} N - O(1) \le |A| \le \left(\frac{2}{3} - \frac{1}{512}\right) N + \log N. +$$ +-/ +@[category research solved, AMS 5 11] +theorem erdos_867 : answer(False) ↔ + ∃ C : ℕ, ∀ N : ℕ, ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 N → + ConsecutiveSumFree A → + A.card ≤ N / 2 + C := by + sorry + +end Erdos867 diff --git a/FormalConjectures/ErdosProblems/869.lean b/FormalConjectures/ErdosProblems/869.lean new file mode 100644 index 0000000000..f8f77d63eb --- /dev/null +++ b/FormalConjectures/ErdosProblems/869.lean @@ -0,0 +1,50 @@ +/- +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 869 + +*Reference:* [erdosproblems.com/869](https://www.erdosproblems.com/869) + +A question of Erdős and Nathanson. + +[ErNa88] Erdős, P. and Nathanson, M.B., _Partitions of bases into disjoint unions of bases_, +J. Number Theory (1988), 1–9. + +[Er92c] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, +Matematiche (Catania) 47 (1992), no. 2, 231–240. +-/ + +namespace Erdos869 + +/-- +**Erdős Problem 869** [ErNa88][Er92c]: + +If $A_1$ and $A_2$ are disjoint additive bases of order $2$, must +$A_1 \cup A_2$ contain a minimal additive basis of order $2$? +-/ +@[category research open, AMS 11] +theorem erdos_869 : answer(sorry) ↔ + ∀ (A₁ A₂ : Set ℕ), A₁.IsAsymptoticAddBasisOfOrder 2 → A₂.IsAsymptoticAddBasisOfOrder 2 → + Disjoint A₁ A₂ → + ∃ B : Set ℕ, B ⊆ A₁ ∪ A₂ ∧ + B.IsAsymptoticAddBasisOfOrder 2 ∧ + ∀ b ∈ B, ¬(B \ {b}).IsAsymptoticAddBasisOfOrder 2 := by + sorry + +end Erdos869 diff --git a/FormalConjectures/ErdosProblems/87.lean b/FormalConjectures/ErdosProblems/87.lean new file mode 100644 index 0000000000..25104a7fd9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/87.lean @@ -0,0 +1,84 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Copy + +/-! +# Erdős Problem 87 + +*Reference:* [erdosproblems.com/87](https://www.erdosproblems.com/87) + +[Er95] Erdős, P., _Problems and results in combinatorial analysis and graph theory_, 1995, p. 14. + +[FaMc93] Faudree, R. J. and McKay, B., _A conjecture of Erdős and the Ramsey number r(W)_, +J. Combin. Math. Combin. Comput. **13** (1993), 23–31. + +Is it true that for every $\varepsilon > 0$ and all sufficiently large $k$, we have +$R(G) > (1 - \varepsilon)^k R(k)$ for every graph $G$ with chromatic number $\chi(G) = k$? +A stronger form asks whether $R(G) > c \cdot R(k)$ for some absolute constant $c > 0$. +Erdős originally conjectured $R(G) \geq R(k)$, which fails already for $k = 4$ [FaMc93]. +-/ + +open SimpleGraph + +namespace Erdos87 + +/-- The (diagonal) graph Ramsey number $R(H)$: the minimum $N$ such that every simple +graph $G$ on $N$ vertices either contains a copy of $H$ as a subgraph or its +complement contains a copy of $H$ (equivalently, every 2-colouring of $K_N$ +contains a monochromatic copy of $H$). -/ +noncomputable def graphRamseyNumber {U : Type*} (H : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + H.IsContained G ∨ H.IsContained Gᶜ} + +/-- The classical diagonal Ramsey number $R(k) := R(K_k, K_k)$. -/ +noncomputable def diagRamsey (k : ℕ) : ℕ := + graphRamseyNumber (⊤ : SimpleGraph (Fin k)) + +/-- +**Erdős Problem 87** — Weak form (open). [Er95, p. 14] + +Let $\varepsilon > 0$. Is it true that, if $k$ is sufficiently large, then +$$R(G) > (1 - \varepsilon)^k \cdot R(k)$$ +for every graph $G$ with chromatic number $\chi(G) = k$? +-/ +@[category research open, AMS 5] +theorem erdos_87 : answer(sorry) ↔ + ∀ ε : ℝ, 0 < ε → ε < 1 → + ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ {V : Type*} [Fintype V] (G : SimpleGraph V), + G.chromaticNumber = k → + (diagRamsey k : ℝ) * (1 - ε) ^ k < (graphRamseyNumber G : ℝ) := by + sorry + +/-- +**Erdős Problem 87** — Strong form (open). [Er95, p. 14] + +Is there some $c > 0$ such that, for all large $k$, +$$R(G) > c \cdot R(k)$$ +for every graph $G$ with chromatic number $\chi(G) = k$? +-/ +@[category research open, AMS 5] +theorem erdos_87.variants.strong : answer(sorry) ↔ + ∃ c : ℝ, 0 < c ∧ + ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ {V : Type*} [Fintype V] (G : SimpleGraph V), + G.chromaticNumber = k → + c * (diagRamsey k : ℝ) < (graphRamseyNumber G : ℝ) := by + sorry + +end Erdos87 diff --git a/FormalConjectures/ErdosProblems/870.lean b/FormalConjectures/ErdosProblems/870.lean new file mode 100644 index 0000000000..ace02a5b20 --- /dev/null +++ b/FormalConjectures/ErdosProblems/870.lean @@ -0,0 +1,105 @@ +/- +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 870 + +*Reference:* [erdosproblems.com/870](https://www.erdosproblems.com/870) + +[ErNa88] Erdős, P. and Nathanson, M., _Minimal asymptotic bases with prescribed densities_, +Illinois J. Math. 32 (1988), 562-574. + +[ErNa79] Erdős, P. and Nathanson, M., _Systems of distinct representatives and minimal +bases in additive number theory_ (1979), 89-107. + +[Ha56] Härtter, E., _Ein Beitrag zur Theorie der Minimalbasen_, +J. Reine Angew. Math. 196 (1956), 170-204. + +[Na74] Nathanson, M., _Minimal bases and maximal nonbases in additive number theory_, +J. Number Theory (1974), 324-333. +-/ + +open Real + +namespace Erdos870 + +/-- A set $A \subseteq \mathbb{N}$ is an additive basis of order $k$ if every sufficiently large +natural number can be represented as a sum of at most $k$ elements of $A$ +(with repetition allowed). -/ +def IsAdditiveBasis (A : Set ℕ) (k : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ (l : List ℕ), l.length ≤ k ∧ (∀ x ∈ l, x ∈ A) ∧ l.sum = n + +/-- A set $A$ is a minimal additive basis of order $k$ if it is a basis of order $k$, +but removing any single element makes it no longer a basis of order $k$. -/ +def IsMinimalAdditiveBasis (A : Set ℕ) (k : ℕ) : Prop := + IsAdditiveBasis A k ∧ ∀ a ∈ A, ¬ IsAdditiveBasis (A \ {a}) k + +/-- The number of representations of $n$ as a sum of at most $k$ elements from $A$. +A representation is a weakly increasing (non-decreasing) list of elements of $A$ +with length at most $k$ summing to $n$. Using weakly increasing lists gives a +canonical representative for each multiset. -/ +noncomputable def repCount (A : Set ℕ) (k n : ℕ) : ℕ := + Set.ncard {l : List ℕ | l.length ≤ k ∧ l.Pairwise (· ≤ ·) ∧ + (∀ x ∈ l, x ∈ A) ∧ l.sum = n} + +/-- +Erdős Problem 870 [ErNa88]: + +For every $k \geq 3$, does there exist $c > 0$ (depending only on $k$) such that for every +additive basis $A$ of order $k$, if the representation count $r(n) \geq c \cdot \log(n)$ for +all sufficiently large $n$, then $A$ contains a minimal additive basis of order $k$? + +Erdős and Nathanson [ErNa79] proved this for $k = 2$ when +$1_A * 1_A(n) > (\log(4/3))^{-1} \log n$ for all large $n$. + +Härtter [Ha56] and Nathanson [Na74] proved that there exist additive bases +which do not contain any minimal additive bases. + +See also problem 868. +-/ +@[category research open, AMS 11] +theorem erdos_870 : answer(sorry) ↔ ∀ (k : ℕ), k ≥ 3 → + ∃ c : ℝ, c > 0 ∧ + ∀ (A : Set ℕ), IsAdditiveBasis A k → + (∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → (repCount A k n : ℝ) ≥ c * Real.log n) → + ∃ B : Set ℕ, B ⊆ A ∧ IsMinimalAdditiveBasis B k := by + sorry + +/-- Erdős and Nathanson [ErNa79] proved that for $k = 2$, if the convolution +$1_A * 1_A(n) > (\log \frac{4}{3})^{-1} \log n$ for all sufficiently large $n$, +then $A$ contains a minimal additive basis of order $2$. -/ +@[category research solved, AMS 11] +theorem erdos_870.variants.k_eq_2 : + answer(True) ↔ ∀ (A : Set ℕ), IsAdditiveBasis A 2 → + (∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (Set.ncard {p : ℕ × ℕ | p.1 ∈ A ∧ p.2 ∈ A ∧ p.1 + p.2 = n} : ℝ) > + (Real.log (4 / 3))⁻¹ * Real.log n) → + ∃ B : Set ℕ, B ⊆ A ∧ IsMinimalAdditiveBasis B 2 := by + sorry + +/-- Härtter [Ha56] and Nathanson [Na74] proved that there exist additive bases of any +order $k \geq 2$ which do not contain any minimal additive bases. -/ +@[category research solved, AMS 11] +theorem erdos_870.variants.Hartter_Nathanson (k : ℕ) (hk : 1 < k) : + ∃ (A : Set ℕ), IsAdditiveBasis A k ∧ + ∀ B : Set ℕ, B ⊆ A → IsAdditiveBasis B k → + ∃ b ∈ B, IsAdditiveBasis (B \ {b}) k := by + sorry + +end Erdos870 diff --git a/FormalConjectures/ErdosProblems/871.lean b/FormalConjectures/ErdosProblems/871.lean new file mode 100644 index 0000000000..066f178046 --- /dev/null +++ b/FormalConjectures/ErdosProblems/871.lean @@ -0,0 +1,73 @@ +/- +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.Combinatorics.Additive.Basis + +/-! +# Erdős Problem 871 + +*Reference:* [erdosproblems.com/871](https://www.erdosproblems.com/871) + +If $A$ is an additive basis of order $2$ whose representation function tends to infinity, +can $A$ always be partitioned into two disjoint additive bases of order $2$? + +[ErNa88] Erdős, P. and Nathanson, M.B., *Partitions of bases into disjoint unions of bases*, +J. Number Theory (1988), 1-9. + +[ErNa89] Erdős, P. and Nathanson, M.B., *Additive bases with many representations*, +Acta Arith. (1989), 399-406. +-/ + +open Classical Filter + +open scoped Topology + +namespace Erdos871 + +/-- The representation function $r_A(n) = |\{a \in \{0, \ldots, n\} : a \in A \land n - a \in A\}|$, +i.e., the number of ways to write $n$ as a sum of two elements of $A$. -/ +noncomputable def repCount (A : Set ℕ) (n : ℕ) : ℕ := + ((Finset.range (n + 1)).filter (fun a => a ∈ A ∧ (n - a) ∈ A)).card + +/-- +Erdős Problem 871 (DISPROVED) [ErNa88]: + +Let $A \subseteq \mathbb{N}$ be an additive basis of order $2$, and suppose +$1_A * 1_A(n) \to \infty$ as $n \to \infty$ (i.e., the number of representations +of $n$ as a sum of two elements of $A$ tends to infinity). Can $A$ be partitioned +into two disjoint additive bases of order $2$? + +Erdős and Nathanson proved this is true if $1_A * 1_A(n) > c \log n$ for some +$c > (\log(4/3))^{-1}$. They also proved [ErNa89] that for every $t$ there exists +a basis $A$ of order $2$ with $1_A * 1_A(n) \geq t$ for all large $n$ that cannot +be partitioned into two disjoint additive bases. + +Disproved by Larsen using Claude Opus 4.5, with contributions from +Wouter van Doorn and Terence Tao — only a small modification of +the argument of [ErNa89] is required. +-/ +@[category research solved, AMS 11] +theorem erdos_871 : answer(False) ↔ + ∀ A : Set ℕ, Set.IsAsymptoticAddBasisOfOrder A 2 ∧ + Tendsto (fun n => (repCount A n : ℝ)) atTop atTop → + ∃ A₁ A₂ : Set ℕ, + A₁ ∪ A₂ = A ∧ Disjoint A₁ A₂ ∧ + Set.IsAsymptoticAddBasisOfOrder A₁ 2 ∧ + Set.IsAsymptoticAddBasisOfOrder A₂ 2 := by + sorry + +end Erdos871 diff --git a/FormalConjectures/ErdosProblems/872.lean b/FormalConjectures/ErdosProblems/872.lean new file mode 100644 index 0000000000..82a76e0976 --- /dev/null +++ b/FormalConjectures/ErdosProblems/872.lean @@ -0,0 +1,119 @@ +/- +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 872 + +*Reference:* [erdosproblems.com/872](https://www.erdosproblems.com/872) + +Consider the two-player game in which players alternately choose integers +from $\{2, 3, \ldots, n\}$ to be included in some set $A$ such that no $a \mid b$ for +$a \neq b \in A$ (i.e., $A$ remains a primitive set — an antichain under divisibility). +The game ends when no legal move is possible. + +One player (the Lengthener) wants the game to last as long as possible; +the other (the Shortener) wants it to end quickly. + +At least $\varepsilon n$ moves (for some $\varepsilon > 0$ and $n$ sufficiently large)? +At least $(1 - \varepsilon) n / 2$ moves (for any $\varepsilon > 0$ and $n$ sufficiently large)? + +Erdős does not specify which player goes first, which may affect the answer. +This is a type of saturation game. + +[Er92c] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, +Matematiche (Catania) 47 (1992), 231–240. +-/ + +open Finset Classical + +namespace Erdos872 + +/-- A finset of natural numbers is *primitive* (an antichain under divisibility) +if $a \mid b$ with $a, b \in A$ implies $a = b$. -/ +def IsPrimitive (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, a ∣ b → a = b + +/-- The universe of moves in the game: $\{2, 3, \ldots, n\}$. -/ +def gameUniverse (n : ℕ) : Finset ℕ := + (Finset.range (n + 1)).filter (· ≥ 2) + +/-- Legal moves from a primitive position $A \subseteq \{2, \ldots, n\}$: elements $x$ in the +universe not in $A$ such that inserting $x$ keeps the set primitive. -/ +noncomputable def legalMoves (n : ℕ) (A : Finset ℕ) : Finset ℕ := + (gameUniverse n \ A).filter fun x => + ∀ a ∈ A, ¬(a ∣ x) ∧ ¬(x ∣ a) + +/-- A legal strategy for the primitive-set game on $\{2, \ldots, n\}$: given any +game state with at least one legal move, it picks a legal move. -/ +def LegalStrategy (n : ℕ) := + (A : Finset ℕ) → (legalMoves n A).Nonempty → {x // x ∈ legalMoves n A} + +/-- Play the game with given legal strategies for the Lengthener and Shortener. +`lengthenerTurn = true` means it is the Lengthener's turn. +The `fuel` parameter bounds recursion depth ($n + 1$ suffices). +Returns the total number of moves played. -/ +noncomputable def playGame (n : ℕ) (sL sS : LegalStrategy n) : + ℕ → Finset ℕ → Bool → ℕ + | 0, _, _ => 0 + | fuel + 1, A, lengthenerTurn => + if h : (legalMoves n A).Nonempty then + let strategy := if lengthenerTurn then sL else sS + let x := (strategy A h).val + 1 + playGame n sL sS fuel (insert x A) (!lengthenerTurn) + else 0 + +/-- +Erdős Problem 872 (weak form) [Er92c, p. 47]: + +In the primitive-set saturation game on $\{2, 3, \ldots, n\}$, there exists $\varepsilon > 0$ +such that, regardless of who moves first, the Lengthener can guarantee +at least $\varepsilon n$ moves for all sufficiently large $n$. + +The number of moves (`playGame` returns `ℕ`) is cast to `ℝ` for comparison with $\varepsilon n$. +-/ +@[category research open, AMS 5 91] +theorem erdos_872 : + answer(sorry) ↔ + ∃ ε : ℝ, ε > 0 ∧ + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∀ firstPlayer : Bool, + ∃ sL : LegalStrategy n, ∀ sS : LegalStrategy n, + (playGame n sL sS (n + 1) ∅ firstPlayer : ℝ) ≥ ε * (n : ℝ) := by + sorry + +/-- +Erdős Problem 872 (strong form) [Er92c, p. 47]: + +For every $\varepsilon > 0$ and all sufficiently large $n$, regardless of who moves first, +the Lengthener can guarantee at least $(1 - \varepsilon) \cdot n / 2$ moves in the +primitive-set saturation game on $\{2, 3, \ldots, n\}$. + +The number of moves (`playGame` returns `ℕ`) is cast to `ℝ` for comparison with +$(1 - \varepsilon) n / 2$. +-/ +@[category research open, AMS 5 91] +theorem erdos_872.variants.strong : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∀ firstPlayer : Bool, + ∃ sL : LegalStrategy n, ∀ sS : LegalStrategy n, + (playGame n sL sS (n + 1) ∅ firstPlayer : ℝ) ≥ (1 - ε) * (n : ℝ) / 2 := by + sorry + +end Erdos872 diff --git a/FormalConjectures/ErdosProblems/874.lean b/FormalConjectures/ErdosProblems/874.lean new file mode 100644 index 0000000000..2580b04b84 --- /dev/null +++ b/FormalConjectures/ErdosProblems/874.lean @@ -0,0 +1,83 @@ +/- +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 874 + +*Reference:* [erdosproblems.com/874](https://www.erdosproblems.com/874) + +Let $k(N)$ denote the size of the largest set $A \subseteq \{1,\ldots,N\}$ such that the sets +$$S_r = \{ a_1 + \cdots + a_r : a_1 < \cdots < a_r \in A \}$$ +are disjoint for distinct $r \geq 1$. Estimate $k(N)$ — in particular, is it true +that $k(N) \sim 2N^{1/2}$? + +Straus [St66] calls such sets admissible and showed +$\liminf k(N)/N^{1/2} \geq 2$ and $\limsup k(N)/N^{1/2} \leq 4/\sqrt{3}$. +Erdős–Nicolas–Sárközy [ENS91] improved the upper bound to $(143/27)^{1/2}$. +The conjecture was proved for all large $N$ by Deshouillers and Freiman [DeFr99]. + +See also Problem 875 (the infinite analogue), and related Problems 186 and 789. + +[Er62c] Erdős, P., _Some remarks on number theory. III_. Mat. Lapok **13** (1962), 28–38. + +[Er98] Erdős, P., _Some of my new and almost new problems and results in +combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +[St66] Straus, E. G., _On a problem in combinatorial number theory_. J. Math. Sci. +**1** (1966), 77–80. + +[ENS91] Erdős, P., Nicolas, J.-L., Sárközy, A., _Sommes de sous-ensembles_. +Séminaire de Théorie des Nombres Bordeaux (2) (1991), 55–72. + +[DeFr99] Deshouillers, J.-M., Freiman, G. A., _On an additive problem of Erdős and +Straus. II_. Astérisque (1999), xii, 141–148. +-/ + +open Filter + +namespace Erdos874 + +/-- The set of $r$-fold subset sums of $A$: all possible values of $a_1 + \cdots + a_r$ +where $a_1, \ldots, a_r$ are $r$ distinct elements of $A$. -/ +def rSubsetSums (A : Finset ℕ) (r : ℕ) : Finset ℕ := + (A.powersetCard r).image (fun S => S.sum id) + +/-- A set $A \subseteq \mathbb{N}$ is *admissible* (in the sense of Straus) if the $r$-fold subset +sums $S_r$ are pairwise disjoint for all distinct $r_1 \neq r_2$ with $r_1, r_2 \geq 1$. -/ +def IsAdmissible874 (A : Finset ℕ) : Prop := + ∀ r₁ r₂ : ℕ, 1 ≤ r₁ → 1 ≤ r₂ → r₁ ≠ r₂ → + Disjoint (rSubsetSums A r₁) (rSubsetSums A r₂) + +/-- $k(N)$ is the maximum size of an admissible subset of $\{1,\ldots,N\}$. -/ +noncomputable def kAdmissible (N : ℕ) : ℕ := + sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ IsAdmissible874 A ∧ A.card = k} + +/-- +Erdős Problem 874 (proved by Deshouillers–Freiman [DeFr99]): +$k(N) \sim 2N^{1/2}$, i.e., for every $\varepsilon > 0$ and all sufficiently large $N$, +$(2 - \varepsilon) \cdot N^{1/2} \leq k(N) \leq (2 + \varepsilon) \cdot N^{1/2}$. +-/ +@[category research solved, AMS 5 11] +theorem erdos_874 : + ∀ ε : ℝ, 0 < ε → + ∀ᶠ N : ℕ in atTop, + (2 - ε) * (N : ℝ) ^ ((1 : ℝ) / 2) ≤ (kAdmissible N : ℝ) ∧ + (kAdmissible N : ℝ) ≤ (2 + ε) * (N : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +end Erdos874 diff --git a/FormalConjectures/ErdosProblems/875.lean b/FormalConjectures/ErdosProblems/875.lean new file mode 100644 index 0000000000..d6dce30397 --- /dev/null +++ b/FormalConjectures/ErdosProblems/875.lean @@ -0,0 +1,80 @@ +/- +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 875 + +A problem of Deshouillers and Erdős (an infinite version of problem #874). + +* [Er98] Erdős, P., _Some of my new and almost new problems and results in + combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +*Reference:* [erdosproblems.com/875](https://www.erdosproblems.com/875) +-/ + +open Filter Finset BigOperators + +namespace Erdos875 + +/-- The set of $r$-fold subset sums of a set $A \subseteq \mathbb{N}$: all sums +$a_1 + \cdots + a_r$ where $a_1, \ldots, a_r$ are $r$ distinct elements of $A$. -/ +def rSubsetSumsInf (A : Set ℕ) (r : ℕ) : Set ℕ := + {s | ∃ S : Finset ℕ, (↑S : Set ℕ) ⊆ A ∧ S.card = r ∧ S.sum id = s} + +/-- An infinite set $A \subseteq \mathbb{N}$ is *admissible* if the $r$-fold subset sums $S_r$ are +pairwise disjoint for all distinct $r_1 \neq r_2$ with $r_1, r_2 \geq 1$. -/ +def IsAdmissibleInf (A : Set ℕ) : Prop := + ∀ r₁ r₂ : ℕ, 1 ≤ r₁ → 1 ≤ r₂ → r₁ ≠ r₂ → + Disjoint (rSubsetSumsInf A r₁) (rSubsetSumsInf A r₂) + +/-- +Erdős Problem 875, part (a): + +There exists an infinite admissible set $A = \{a_1 < a_2 < \cdots\}$ such that +$a_{n+1}/a_n \to 1$ as $n \to \infty$. + +Formulated as: for every $\varepsilon > 0$, eventually $a(n+1) \leq (1 + \varepsilon) \cdot a(n)$. +-/ +@[category research open, AMS 5 11] +theorem erdos_875 : + ∃ a : ℕ → ℕ, StrictMono a ∧ + IsAdmissibleInf (Set.range a) ∧ + ∀ ε : ℝ, 0 < ε → + ∀ᶠ n : ℕ in atTop, + (a (n + 1) : ℝ) ≤ (1 + ε) * (a n : ℝ) := by + sorry + +/-- +Erdős Problem 875, part (b): + +Determine for which $c > 0$ there exists an infinite admissible set +$A = \{a_1 < a_2 < \cdots\}$ such that $a_{n+1} - a_n \leq n^c$ for all sufficiently large $n$. + +Formalized as: there exists $c > 0$ and an infinite admissible sequence whose +gaps satisfy $a(n+1) - a(n) \leq n^c$ eventually. +-/ +@[category research open, AMS 5 11] +theorem erdos_875.variants.gap : + ∃ c : ℝ, c > 0 ∧ + ∃ a : ℕ → ℕ, StrictMono a ∧ + IsAdmissibleInf (Set.range a) ∧ + ∀ᶠ n : ℕ in atTop, + (a (n + 1) : ℝ) - (a n : ℝ) ≤ (n : ℝ) ^ c := by + sorry + +end Erdos875 diff --git a/FormalConjectures/ErdosProblems/876.lean b/FormalConjectures/ErdosProblems/876.lean new file mode 100644 index 0000000000..5d4516d8b1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/876.lean @@ -0,0 +1,90 @@ +/- +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 876 + +*Reference:* [erdosproblems.com/876](https://www.erdosproblems.com/876) + +Let $A = \{a_1 < a_2 < \cdots\}$ be an infinite sum-free sequence (no element is the sum of +finitely many distinct smaller elements). Is it possible that $a_{n+1} - a_n < n$ for all +sufficiently large $n$? Graham proved there exists such a sequence with +$a_{n+1} - a_n < n^{1+o(1)}$. + +Erdős proved that sum-free sets have density zero [Er62c], and later asked about the maximum +value of $\sum_{n \in A} 1/n$ [Er75b] [Er77c]. Deshouillers, Erdős, and Melfi constructed a +sum-free set with $a_n \sim n^{3+o(1)}$ [DEM99]. Łuczak and Schoen established bounds on the +density of sum-free sets [LuSc00]. + +Related: Problem 790. + +[Er62c] Erdős, P., *Some remarks on number theory. III*, Mat. Lapok (1962), pp. 28–38. + +[Er75b] Erdős, P., *Problems and results in combinatorial number theory*, +Journées Arithmétiques de Bordeaux (1975), pp. 295–310. + +[Er77c] Erdős, P., *Problems and results on combinatorial number theory. III*, +Number theory day (1977), pp. 43–72. + +[Er98] Erdős, P., *Some of my new and almost new problems and results in combinatorial +number theory*, Number theory (Eger, 1996) (1998), pp. 169–180. + +[DEM99] Deshouillers, J.-M., Erdős, P., Melfi, G., *On a question about sum-free sequences*, +Discrete Math. (1999), pp. 49–54. + +[LuSc00] Łuczak, T., Schoen, T., *On the maximal density of sum-free sets*, +Acta Arith. (2000), pp. 225–229. +-/ + +namespace Erdos876 + +/-- +A set $A \subseteq \mathbb{N}$ is sum-free in the sense of Erdős if no element of $A$ can be +expressed as the sum of finitely many distinct smaller elements of $A$. +-/ +def IsSumFreeErdos (A : Set ℕ) : Prop := + ∀ a ∈ A, ∀ S : Finset ℕ, S.Nonempty → (∀ x ∈ S, x ∈ A) → (∀ x ∈ S, x < a) → S.sum id ≠ a + +/-- +Let $A = \{a_1 < a_2 < \cdots\} \subseteq \mathbb{N}$ be an infinite sum-free set (no element +is the sum of finitely many distinct smaller elements of $A$). Is it possible that +$a_{n+1} - a_n < n$ for all sufficiently large $n$? + +Erdős notes that Graham proved there exists such a sequence with +$a_{n+1} - a_n < n^{1+o(1)}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_876 : answer(sorry) ↔ + ∃ a : ℕ → ℕ, StrictMono a ∧ + IsSumFreeErdos (Set.range a) ∧ + ∃ N, ∀ n ≥ N, a (n + 1) - a n < n + 1 := by + sorry + +/-- +Graham proved that there exists an infinite sum-free set $A = \{a_1 < a_2 < \cdots\}$ such that +$a_{n+1} - a_n < n^{1+\varepsilon}$ for every $\varepsilon > 0$ and all sufficiently large $n$. +This is the best known result toward Problem 876 [Er98]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_876_graham : ∃ a : ℕ → ℕ, StrictMono a ∧ + IsSumFreeErdos (Set.range a) ∧ + ∀ ε : ℝ, 0 < ε → ∃ N, ∀ n ≥ N, + (a (n + 1) - a n : ℝ) < (n : ℝ) ^ (1 + ε) := by + sorry + +end Erdos876 diff --git a/FormalConjectures/ErdosProblems/877.lean b/FormalConjectures/ErdosProblems/877.lean new file mode 100644 index 0000000000..cea7fc66ec --- /dev/null +++ b/FormalConjectures/ErdosProblems/877.lean @@ -0,0 +1,88 @@ +/- +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.Combinatorics.Basic + +/-! +# Erdős Problem 877 + +*Reference:* [erdosproblems.com/877](https://www.erdosproblems.com/877) + +Let $f_m(n)$ count the number of maximal sum-free subsets $A \subseteq \{1, \ldots, n\}$ — that is, +$A$ contains no three elements $a, b, c$ with $a = b + c$, and $A$ is maximal with this +property (no element of $\{1, \ldots, n\} \setminus A$ can be added while preserving sum-freeness). + +Is it true that $f_m(n) = o(2^{n/2})$? + +Cameron and Erdős [CaEr90] proved that $f_m(n) > 2^{n/4}$. Łuczak and Schoen [LuSc01] proved +that there exists $c < 1/2$ with $f_m(n) < 2^{cn}$, resolving the conjecture. +Balogh, Liu, Sharifzadeh, and Treglown [BLST15] proved $f_m(n) = 2^{(1/4+o(1))n}$, +later refined [BLST18] to $f_m(n) = (C_n + o(1)) \cdot 2^{n/4}$. + +[CaEr90] Cameron, P.J. and Erdős, P. + +[Er98] Erdős, P., _Some of my favourite problems which recently have been solved_, +Challenges for the 21st century (Singapore, 2000), 2001. + +[LuSc01] Łuczak, T. and Schoen, T., _On the number of maximal sum-free sets_, +Proc. Amer. Math. Soc. (2001), 2205–2207. + +[BLST15] Balogh, J., Liu, H., Sharifzadeh, M., and Treglown, A., _The number of maximal +sum-free subsets of integers_, Proc. Amer. Math. Soc. (2015), 4713–4721. + +[BLST18] Balogh, J., Liu, H., Sharifzadeh, M., and Treglown, A., _Sharp bound on the number +of maximal sum-free subsets of integers_, J. Eur. Math. Soc. (JEMS) (2018), 1885–1911. +-/ + +open scoped Classical Pointwise +open Finset + +namespace Erdos877 + +/-- A subset $A$ of $\{1, \ldots, n\}$ is a *maximal sum-free subset* if it is sum-free +and no element of $\{1, \ldots, n\} \setminus A$ can be added while preserving +sum-freeness. -/ +def IsMaximalSumFree (A : Finset ℕ) (n : ℕ) : Prop := + A ⊆ Finset.Icc 1 n ∧ + IsSumFree (A : Set ℕ) ∧ + ∀ x ∈ Finset.Icc 1 n, x ∉ A → ¬ IsSumFree (↑(insert x A) : Set ℕ) + +/-- The number of maximal sum-free subsets of $\{1, \ldots, n\}$. -/ +noncomputable def maximalSumFreeCount (n : ℕ) : ℕ := + ((Finset.Icc 1 n).powerset.filter (fun A => IsMaximalSumFree A n)).card + +/-- +Erdős Problem 877 [CaEr90][Er98]: + +Let $f_m(n)$ count the number of maximal sum-free subsets of $\{1, \ldots, n\}$. Then +$$f_m(n) = o(2^{n/2}).$$ + +That is, for every $\varepsilon > 0$, for all sufficiently large $n$, +$$f_m(n) \leq \varepsilon \cdot 2^{n/2}.$$ + +Proved by Łuczak and Schoen [LuSc01], with the sharp asymptotics +$f_m(n) = 2^{(1/4+o(1))n}$ established by Balogh–Liu–Sharifzadeh–Treglown [BLST15]. +-/ +@[category research solved, AMS 5] +theorem erdos_877 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (maximalSumFreeCount n : ℝ) ≤ ε * (2 : ℝ) ^ ((n : ℝ) / 2) := by + sorry + +end Erdos877 diff --git a/FormalConjectures/ErdosProblems/878.lean b/FormalConjectures/ErdosProblems/878.lean new file mode 100644 index 0000000000..59f3a4f147 --- /dev/null +++ b/FormalConjectures/ErdosProblems/878.lean @@ -0,0 +1,152 @@ +/- +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 878 + +*Reference:* [erdosproblems.com/878](https://www.erdosproblems.com/878) + +If $n = \prod p_i^{k_i}$ is the factorisation of $n$ into distinct primes, define +$$f(n) = \sum p_i^{\ell_i}$$ +where $\ell_i$ is the largest integer with $p_i^{\ell_i} \le n$. Furthermore, define +$$F(n) = \max \sum_{i=1}^{t} a_i$$ +where the max is over all pairwise coprime $a_1, \ldots, a_t \le n$ whose prime +factors are all prime factors of $n$ (where $t = \omega(n)$ is the number of +distinct prime factors of $n$). + +Conjectures: +1. For almost all $n$, $f(n) = o(n \log \log n)$. +2. For almost all $n$, $F(n) \gg n \log \log n$. +3. $\max_{n \le x} f(n) \sim \frac{x \log x}{\log \log x}$. +4. For all sufficiently large $x$, $\max_{n \le x} f(n) = \max_{n \le x} F(n)$. +5. $H(x) = \sum_{n < x} \frac{f(n)}{n} \ll x \log \log \log \log x$. + +[Er84e] Erdős proved (3) along a subsequence of $x \to \infty$. +[Er84e] Erdős proved $x \log\log\log\log x \ll H(x) \ll x \log\log\log x$. + +## References + +* [Er84e] Erdős, P., _On two unconventional number theoretic functions and on some + related problems_. (1984), 113–121. +* [Er98] Erdős, P., _Some of my new and almost new problems and results in + combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +## See also + +* OEIS sequence [A339378](https://oeis.org/A339378) (possible). +-/ + +open Finset BigOperators Real + +namespace Erdos878 + +/-- For each prime $p$ dividing $n$, let $\ell = \lfloor \log_p(n) \rfloor$ be the +largest integer with $p^{\ell} \le n$. Then $f(n) = \sum_{p \mid n} p^{\ell}$. -/ +noncomputable def f (n : ℕ) : ℕ := + ∑ p ∈ n.primeFactors, p ^ Nat.log p n + +/-- A valid assignment for $F(n)$: a tuple of $\omega(n)$ natural numbers that are +pairwise coprime, each at most $n$, with all prime factors dividing $n$. -/ +def ValidAssignment (n : ℕ) (a : Fin n.primeFactors.card → ℕ) : Prop := + (∀ i, a i ≤ n) ∧ + (∀ i j, i ≠ j → Nat.Coprime (a i) (a j)) ∧ + (∀ i, ∀ p : ℕ, Nat.Prime p → p ∣ a i → p ∈ n.primeFactors) + +/-- $F(n)$: the maximum of $\sum a_i$ over all valid assignments for $n$. -/ +noncomputable def F (n : ℕ) : ℕ := + sSup {s | ∃ a : Fin n.primeFactors.card → ℕ, + ValidAssignment n a ∧ s = ∑ i, a i} + +/-- $H(x) = \sum_{1 \le n < x} \frac{f(n)}{n}$. -/ +noncomputable def H (x : ℕ) : ℝ := + ∑ n ∈ (Finset.range x).filter (· ≥ 1), (f n : ℝ) / (n : ℝ) + +/-- +**Erdős Problem 878, Conjecture (1):** For almost all $n$, $f(n) = o(n \log \log n)$. + +For every $\varepsilon > 0$ and $\delta > 0$, for all sufficiently large $x$, the proportion of +$n \le x$ with $f(n) > \varepsilon \cdot n \cdot \log(\log n)$ is less than $\delta$. +-/ +@[category research open, AMS 11] +theorem erdos_878 : + ∀ ε : ℝ, ε > 0 → ∀ δ : ℝ, δ > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + (((Finset.Icc 1 x).filter (fun n => + (f n : ℝ) > ε * (n : ℝ) * log (log (n : ℝ)))).card : ℝ) / + (x : ℝ) < δ := by + sorry + +/-- +**Erdős Problem 878, Conjecture (2):** For almost all $n$, $F(n) \gg n \log \log n$. + +There exists $C > 0$ such that for every $\delta > 0$, for all sufficiently large $x$, the +proportion of $n \le x$ with $F(n) < C \cdot n \cdot \log(\log n)$ is less than $\delta$. +-/ +@[category research open, AMS 11] +theorem erdos_878.variants.F_large_almost_all : + ∃ C : ℝ, C > 0 ∧ ∀ δ : ℝ, δ > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + (((Finset.Icc 1 x).filter (fun n => + (F n : ℝ) < C * (n : ℝ) * log (log (n : ℝ)))).card : ℝ) / + (x : ℝ) < δ := by + sorry + +/-- +**Erdős Problem 878, Conjecture (3):** +$\max_{n \le x} f(n) \sim \frac{x \log x}{\log \log x}$. + +For every $\varepsilon > 0$, for all sufficiently large $x$, +$(1 - \varepsilon) \cdot \frac{x \log x}{\log \log x} \le \max_{n \le x} f(n) +\le (1 + \varepsilon) \cdot \frac{x \log x}{\log \log x}$. + +Erdős [Er84e] proved this along a subsequence of $x \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_878.variants.f_max_asymptotic : + ∀ ε : ℝ, ε > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + let M : ℕ := (Finset.Icc 1 x).sup f + (1 - ε) * ((x : ℝ) * log (x : ℝ) / log (log (x : ℝ))) ≤ (M : ℝ) ∧ + (M : ℝ) ≤ (1 + ε) * ((x : ℝ) * log (x : ℝ) / log (log (x : ℝ))) := by + sorry + +/-- +**Erdős Problem 878, Conjecture (4):** For all sufficiently large $x$, +$\max_{n \le x} f(n) = \max_{n \le x} F(n)$. +-/ +@[category research open, AMS 11] +theorem erdos_878.variants.max_f_eq_max_F : + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + (Finset.Icc 1 x).sup f = (Finset.Icc 1 x).sup F := by + sorry + +/-- +**Erdős Problem 878, Conjecture (5):** $H(x) \ll x \log \log \log \log x$. + +There exists $C > 0$ such that for all sufficiently large $x$, +$H(x) \le C \cdot x \cdot \log(\log(\log(\log(x))))$. + +Erdős [Er84e] proved $x \log\log\log\log x \ll H(x) \ll x \log\log\log x$. +-/ +@[category research open, AMS 11] +theorem erdos_878.variants.H_upper : + ∃ C : ℝ, C > 0 ∧ ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + H x ≤ C * (x : ℝ) * log (log (log (log (x : ℝ)))) := by + sorry + +end Erdos878 diff --git a/FormalConjectures/ErdosProblems/879.lean b/FormalConjectures/ErdosProblems/879.lean new file mode 100644 index 0000000000..2ade96d8f4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/879.lean @@ -0,0 +1,88 @@ +/- +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 879 + +Let $G(n)$ denote the maximum sum of a pairwise coprime subset of $\{1, \ldots, n\}$, +and let $H(n) = \sum_{p < n} p + n \cdot \pi(\sqrt{n})$. Erdős and Van Lint asked +whether $G(n) > H(n) - n^{1+\varepsilon}$ for every $\varepsilon > 0$ and all +sufficiently large $n$ (Part 1), and whether for every $k \geq 2$ the optimal +admissible set must contain an element with at least $k$ distinct prime factors (Part 2). + +Erdős and Van Lint proved that $H(n) - n^{3/2-o(1)} < G(n) < H(n)$ and +$(H(n) - G(n))/n \to \infty$. They also verified Part 2 for $k = 2$. + +*Reference:* [erdosproblems.com/879](https://www.erdosproblems.com/879) + +## References + +* [Er84e] Erdős, P., _On two unconventional number theoretic functions and on some + related problems_. (1984), 113–121. +* [Er98] Erdős, P., _Some of my new and almost new problems and results in + combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +## See also + +* [Problem 878](https://www.erdosproblems.com/878) +* OEIS sequence [A186736](https://oeis.org/A186736) +-/ + +namespace Erdos879 + +/-- An admissible subset of $\{1, \ldots, n\}$ that achieves the maximum sum among all +pairwise coprime subsets of $\{1, \ldots, n\}$. -/ +def IsMaxAdmissible (S : Finset ℕ) (n : ℕ) : Prop := + S ⊆ Finset.Icc 1 n ∧ (↑S : Set ℕ).Pairwise Nat.Coprime ∧ + ∀ T : Finset ℕ, T ⊆ Finset.Icc 1 n → (↑T : Set ℕ).Pairwise Nat.Coprime → + T.sum id ≤ S.sum id + +/-- $H(n) = \sum_{p < n,\, p \text{ prime}} p + n \cdot \pi(\sqrt{n})$. -/ +noncomputable def H (n : ℕ) : ℕ := + ((Finset.range n).filter Nat.Prime).sum id + + n * ((Finset.range (Nat.sqrt n + 1)).filter Nat.Prime).card + +/-- +Erdős Problem 879, Part 1 [Er84e, Er98]: +For every $\varepsilon > 0$, for all sufficiently large $n$, +$G(n) > H(n) - n^{1+\varepsilon}$. +-/ +@[category research open, AMS 5 11] +theorem erdos_879 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∀ S : Finset ℕ, IsMaxAdmissible S n → + (↑(S.sum id) : ℝ) > (↑(H n) : ℝ) - (↑n : ℝ) ^ ((1 : ℝ) + ε) := by + sorry + +/-- +Erdős Problem 879, Part 2 [Er84e, Er98]: +For every $k \geq 2$, if $n$ is sufficiently large then any admissible set maximising +$G(n)$ contains at least one integer with at least $k$ distinct prime factors. +-/ +@[category research open, AMS 5 11] +theorem erdos_879.variants.prime_factors : + answer(sorry) ↔ + ∀ k : ℕ, k ≥ 2 → + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∀ S : Finset ℕ, IsMaxAdmissible S n → + ∃ a ∈ S, a.primeFactors.card ≥ k := by + sorry + +end Erdos879 diff --git a/FormalConjectures/ErdosProblems/88.lean b/FormalConjectures/ErdosProblems/88.lean new file mode 100644 index 0000000000..7d81a4454e --- /dev/null +++ b/FormalConjectures/ErdosProblems/88.lean @@ -0,0 +1,75 @@ +/- +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 88 + +*Reference:* [erdosproblems.com/88](https://www.erdosproblems.com/88) + +Erdős–McKay conjecture (proved by Kwan–Sah–Sauermann–Sawhney): if a graph on $n$ vertices +has no clique or independent set of size $\geq \varepsilon \log n$, then it contains an induced +subgraph with exactly $m$ edges for every $m \leq \delta n^2$. + +Conjectured by Erdős and McKay [Er92b][Er95][Er97d]. Proved by +Kwan, Sah, Sauermann, and Sawhney [KSSS22]. + +[Er92b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) (1992), 231-240. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics, Paul Erdős is Eighty, vol. 2 (1995). + +[Er97d] Erdős, P., _Some of my new and almost new problems and results in +combinatorics and graph theory_ (1997). + +[KSSS22] Kwan, M., Sah, A., Sauermann, L., and Sawhney, M., +_Anticoncentration in Ramsey graphs and a proof of the Erdős–McKay conjecture_, +Forum of Mathematics, Pi (2023). +-/ + +open SimpleGraph Finset Real + +namespace Erdos88 + +/-- Count edges in the induced subgraph on vertex set $S$: + the number of pairs $\{u, v\}$ with $u, v \in S$, $u < v$, and $G$ adjacent on $u$ and $v$. -/ +def inducedEdgeCount {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (S : Finset (Fin n)) : ℕ := + ((S ×ˢ S).filter (fun p => p.1 < p.2 ∧ G.Adj p.1 p.2)).card + +/-- +Erdős Problem 88 [KSSS22]: +For any $\varepsilon > 0$ there exists $\delta = \delta(\varepsilon) > 0$ such that if $G$ is a +graph on $n$ vertices with no independent set or clique of size $\geq \varepsilon \log n$ then $G$ +contains an induced subgraph with exactly $m$ edges for all $m \leq \delta n^2$. + +Conjectured by Erdős and McKay. +-/ +@[category research solved, AMS 5] +theorem erdos_88 : + ∀ ε : ℝ, ε > 0 → + ∃ δ : ℝ, δ > 0 ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (h : DecidableRel G.Adj), + haveI := h + G.CliqueFree ⌈ε * Real.log n⌉₊ → + Gᶜ.CliqueFree ⌈ε * Real.log n⌉₊ → + ∀ m : ℕ, (m : ℝ) ≤ δ * (n : ℝ) ^ 2 → + ∃ S : Finset (Fin n), inducedEdgeCount G S = m := by + sorry + +end Erdos88 diff --git a/FormalConjectures/ErdosProblems/880.lean b/FormalConjectures/ErdosProblems/880.lean new file mode 100644 index 0000000000..5e12a71104 --- /dev/null +++ b/FormalConjectures/ErdosProblems/880.lean @@ -0,0 +1,100 @@ +/- +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 880 + +*Reference:* [erdosproblems.com/880](https://www.erdosproblems.com/880) + +Let $A \subset \mathbb{N}$ be an additive basis of order $k$. Let +$B = \{b_1 < b_2 < \cdots\}$ be the set of integers which are the sum of $k$ or fewer +distinct $a \in A$. Is it true that $b_{n+1} - b_n = O(1)$? + +A problem of Burr and Erdős [Er98]. Hegyvári, Hennecart, and Plagne [HHP07] showed the +answer is yes for $k = 2$ (in fact with $b_{n+1} - b_n \leq 2$ for sufficiently large $n$) +but no for $k \geq 3$. + +[Er98] Erdős, P., _Some of my new and almost new problems and results in +combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. + +[HHP07] Hegyvári, N., Hennecart, F., Plagne, A., _Answer to a question by Burr and Erdős on +restricted addition, and related results_. Combinatorics, Probability and Computing (2007), +747–756. +-/ + +open Finset BigOperators + +namespace Erdos880 + +/-- A set $A \subseteq \mathbb{N}$ is an additive basis of order $k$ if every sufficiently large +natural number can be written as a sum of at most $k$ elements from $A$ +(with repetition allowed). -/ +def IsAdditiveBasis880 (A : Set ℕ) (k : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ (l : List ℕ), l.length ≤ k ∧ (∀ x ∈ l, x ∈ A) ∧ l.sum = n + +/-- The set of natural numbers expressible as the sum of at most $k$ distinct +elements of $A$. -/ +def DistinctSumSet880 (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (S : Finset ℕ), (∀ x ∈ S, x ∈ A) ∧ S.card ≤ k ∧ S.sum id = n} + +/-- +Erdős Problem 880: + +Let $A \subset \mathbb{N}$ be an additive basis of order $k$, and let $B$ be the set of +integers expressible as sums of $k$ or fewer distinct elements of $A$. Is it true that +$b_{n+1} - b_n = O(1)$? + +The answer is **no** in general. Hegyvári, Hennecart, and Plagne [HHP07] showed that +the answer is yes for $k = 2$ but no for $k \geq 3$. +-/ +@[category research solved, AMS 11] +theorem erdos_880 : answer(False) ↔ + ∀ (k : ℕ) (A : Set ℕ), IsAdditiveBasis880 A k → + ∃ C N₀ : ℕ, ∀ b ∈ DistinctSumSet880 A k, b ≥ N₀ → + ∃ b' ∈ DistinctSumSet880 A k, b < b' ∧ b' ≤ b + C := by + sorry + +/-- +Erdős Problem 880, positive result for $k = 2$ (Hegyvári–Hennecart–Plagne [HHP07]): + +If $A$ is an additive basis of order $2$, then the distinct sum set $B$ of $A$ (sums of +at most $2$ distinct elements) has gaps bounded by $2$ for all sufficiently large +elements: for large enough $b \in B$, the next element of $B$ is at most $b + 2$. +-/ +@[category research solved, AMS 11] +theorem erdos_880.variants.bounded_gaps_k_eq_2 (A : Set ℕ) (hA : IsAdditiveBasis880 A 2) : + ∃ N₀ : ℕ, ∀ b ∈ DistinctSumSet880 A 2, b ≥ N₀ → + ∃ b' ∈ DistinctSumSet880 A 2, b < b' ∧ b' ≤ b + 2 := by + sorry + +/-- +Erdős Problem 880, counterexample for $k \geq 3$ (Hegyvári–Hennecart–Plagne [HHP07]): + +For every $k \geq 3$, there exists an additive basis $A$ of order $k$ whose distinct sum +set has unbounded gaps. +-/ +@[category research solved, AMS 11] +theorem erdos_880.variants.unbounded_gaps_k_ge_3 : + ∀ k : ℕ, k ≥ 3 → + ∃ A : Set ℕ, IsAdditiveBasis880 A k ∧ + ∀ C : ℕ, ∃ b ∈ DistinctSumSet880 A k, + ∀ b' ∈ DistinctSumSet880 A k, b < b' → b + C < b' := by + sorry + +end Erdos880 diff --git a/FormalConjectures/ErdosProblems/882.lean b/FormalConjectures/ErdosProblems/882.lean new file mode 100644 index 0000000000..f060f06426 --- /dev/null +++ b/FormalConjectures/ErdosProblems/882.lean @@ -0,0 +1,105 @@ +/- +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 882 + +*Reference:* [erdosproblems.com/882](https://www.erdosproblems.com/882) + +What is the size of the largest $A \subseteq \{1, \ldots, n\}$ such that the set of all +non-empty subset sums $\{ \sum_{a \in S} a : \emptyset \neq S \subseteq A \}$ is primitive +(no two distinct elements divide each other)? + +A problem of Erdős and Sárkőzy [Er98]. The greedy algorithm shows +$|A| \geq (1 - o(1)) \log_3 n$. Erdős, Lev, Rauzy, Sándor, and Sárközy [ELRSS99] +proved $|A| > \log_2 n - 1$ is achievable. The upper bound +$|A| \leq \log_2 n + \tfrac{1}{2} \log_2 \log n + O(1)$ follows from the distinct subset +sums property (see also Problem 13). It is conjectured that $|A| \leq \log_2 n + O(1)$. + +The website considers this problem solved because the asymptotic answer $\sim \log_2 n$ is +established. The main theorem `erdos_882` formalizes the stronger conjecture +$|A| \leq \log_2 n + O(1)$, which remains open. + +[Er98] Erdős, P., _Some of my new and almost new problems and results in combinatorial +number theory_. Number theory (Eger, 1996), 169–180, 1998. + +[ELRSS99] Erdős, P., Lev, V., Rauzy, G., Sándor, C., and Sárközy, A., _Greedy algorithm, +arithmetic progressions, subset sums and divisibility_. Discrete Mathematics (1999), +119–135. +-/ + +open Finset BigOperators Real + +namespace Erdos882 + +/-- The set of all non-empty subset sums of a finset $A$ of natural numbers. -/ +def subsetSums (A : Finset ℕ) : Finset ℕ := + (A.powerset.filter (· ≠ ∅)).image (fun S => S.sum id) + +/-- A finset of natural numbers is *primitive* (an antichain under divisibility) if no element +divides another distinct element. -/ +def IsPrimitive (B : Finset ℕ) : Prop := + ∀ a ∈ B, ∀ b ∈ B, a ∣ b → a = b + +/-- The maximum size of $A \subseteq \{1, \ldots, n\}$ whose non-empty subset sums form a +primitive set. -/ +noncomputable def maxPrimitiveSubsetSumSize (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 n ∧ A.card = k ∧ + IsPrimitive (subsetSums A)} + +/-- +Erdős Problem 882, conjectured upper bound [Er98]: + +There exists a constant $C$ such that for all sufficiently large $n$, +the maximum size of $A \subseteq \{1, \ldots, n\}$ whose non-empty subset sums are +primitive satisfies $|A| \leq \log_2 n + C$. +-/ +@[category research open, AMS 5 11] +theorem erdos_882 : + ∃ C : ℝ, ∃ N₀ : ℕ, ∀ n ≥ N₀, + (maxPrimitiveSubsetSumSize n : ℝ) ≤ Real.log n / Real.log 2 + C := by + sorry + +/-- +Erdős Problem 882, lower bound [ELRSS99]: + +For all sufficiently large $n$, there exists $A \subseteq \{1, \ldots, n\}$ with +$|A| > \log_2 n - 1$ such that the non-empty subset sums of $A$ form a primitive set. +-/ +@[category research solved, AMS 5 11] +theorem erdos_882.variants.lower_bound : + ∃ N₀ : ℕ, ∀ n ≥ N₀, + (maxPrimitiveSubsetSumSize n : ℝ) > Real.log n / Real.log 2 - 1 := by + sorry + +/-- +Erdős Problem 882, known upper bound [ELRSS99]: + +For all sufficiently large $n$, the maximum size of $A \subseteq \{1, \ldots, n\}$ whose +non-empty subset sums are primitive satisfies +$|A| \leq \log_2 n + \tfrac{1}{2} \log_2 \log n + C$ for some constant $C$. +This follows from the connection to the distinct subset sums problem (Problem 13). +-/ +@[category research solved, AMS 5 11] +theorem erdos_882.variants.upper_bound : + ∃ C : ℝ, ∃ N₀ : ℕ, ∀ n ≥ N₀, + (maxPrimitiveSubsetSumSize n : ℝ) ≤ + Real.log n / Real.log 2 + Real.log (Real.log n) / (2 * Real.log 2) + C := by + sorry + +end Erdos882 diff --git a/FormalConjectures/ErdosProblems/883.lean b/FormalConjectures/ErdosProblems/883.lean new file mode 100644 index 0000000000..566fc02484 --- /dev/null +++ b/FormalConjectures/ErdosProblems/883.lean @@ -0,0 +1,119 @@ +/- +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 883 + +*Reference:* [erdosproblems.com/883](https://www.erdosproblems.com/883) + +For $A \subseteq \{1, \ldots, n\}$, let $G(A)$ be the coprimality graph (two distinct elements +are adjacent iff they are coprime). Erdős and Sárközy asked whether +$|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$ implies that $G(A)$ +contains all odd cycles of length at most $n/3 + 1$, and also whether $G(A)$ must contain +a complete $(1,\ell,\ell)$ tripartite subgraph for every fixed $\ell$ when $n$ is sufficiently +large (the latter was proved by Sárközy). + +[ErSa97] Erdős, P. and Sárközy, G. N., _On cycles in the coprime graph of integers_. +Electron. J. Combin. (1997). + +[Er98] Erdős, P., various problems papers. + +[Sa99] Sárközy, G. N., _Complete tripartite subgraphs in the coprime graph of integers_. +Discrete Math. (1999), 227–238. +-/ + +open Finset + +namespace Erdos883 + +/-- +The coprimality graph on a subset $A$ of natural numbers: two distinct elements +are connected by an edge if and only if they are coprime ($\gcd = 1$). +-/ +def coprimeGraph (A : Finset ℕ) : SimpleGraph ℕ where + Adj x y := x ∈ A ∧ y ∈ A ∧ x ≠ y ∧ Nat.Coprime x y + symm := by + intro x y ⟨hx, hy, hne, hcop⟩ + exact ⟨hy, hx, hne.symm, hcop.symm⟩ + loopless x := fun ⟨_, _, hne, _⟩ => hne rfl + +/-- +A graph contains a cycle of length $k$: there exist $k$ distinct vertices +$v_0, \ldots, v_{k-1}$ such that $v_i$ is adjacent to $v_{(i+1) \bmod k}$ for all $i$. +Uses $\mathbb{Z}/k\mathbb{Z}$ for natural cyclic indexing. For $k < 3$ this is vacuously +false due to the loopless/irreflexive properties of simple graphs. +-/ +def SimpleGraph.ContainsCycle {α : Type*} (G : SimpleGraph α) (k : ℕ) : Prop := + ∃ f : ZMod k → α, Function.Injective f ∧ ∀ i, G.Adj (f i) (f (i + 1)) + +/-- +The threshold function: $\lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$, +equal to the count of integers in $\{1, \ldots, n\}$ divisible by $2$ or $3$ +(by inclusion-exclusion). +-/ +def erdos883Threshold (n : ℕ) : ℕ := n / 2 + n / 3 - n / 6 + +/-- +For $A \subseteq \{1, \ldots, n\}$, let $G(A)$ be the coprimality graph on $A$. If +$|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$ then $G(A)$ +contains all odd cycles of length at most $n/3 + 1$. + +A problem of Erdős and Sárközy [ErSa97], who proved this for cycles of +length $\leq cn$ for some constant $c > 0$. The threshold is best possible since +the set of integers in $\{1, \ldots, n\}$ divisible by $2$ or $3$ has this cardinality +and its coprimality graph contains no triangles. +-/ +@[category research open, AMS 5 11] +theorem erdos_883 : answer(sorry) ↔ + ∀ n : ℕ, ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) → + A.card > erdos883Threshold n → + ∀ k : ℕ, k ≥ 3 → k % 2 = 1 → k ≤ n / 3 + 1 → + Erdos883.SimpleGraph.ContainsCycle (coprimeGraph A) k := by + sorry + +/-- +A graph $G$ contains a complete $(1,\ell,\ell)$ tripartite subgraph: there exist a vertex $v$ +and two disjoint sets $S_1, S_2$ each of size $\ell$ such that $v$ is adjacent to every vertex +in $S_1 \cup S_2$, and every vertex in $S_1$ is adjacent to every vertex in $S_2$. +-/ +def SimpleGraph.ContainsTripartite {α : Type*} (G : SimpleGraph α) (ℓ : ℕ) : Prop := + ∃ v : α, ∃ S₁ S₂ : Finset α, + S₁.card = ℓ ∧ S₂.card = ℓ ∧ + Disjoint S₁ S₂ ∧ v ∉ S₁ ∧ v ∉ S₂ ∧ + (∀ u ∈ S₁, G.Adj v u) ∧ (∀ u ∈ S₂, G.Adj v u) ∧ + (∀ u₁ ∈ S₁, ∀ u₂ ∈ S₂, G.Adj u₁ u₂) + +/-- +For $A \subseteq \{1, \ldots, n\}$, is it true that for every $\ell \geq 1$, if $n$ is +sufficiently large and $|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$, +then $G(A)$ must contain a complete $(1,\ell,\ell)$ tripartite subgraph? + +Proved by Sárközy [Sa99]. +-/ +@[category research solved, AMS 5 11] +theorem erdos_883.variants.tripartite : answer(True) ↔ + ∀ ℓ : ℕ, ℓ ≥ 1 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ A : Finset ℕ, + (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) → + A.card > erdos883Threshold n → + Erdos883.SimpleGraph.ContainsTripartite (coprimeGraph A) ℓ := by + sorry + +end Erdos883 diff --git a/FormalConjectures/ErdosProblems/884.lean b/FormalConjectures/ErdosProblems/884.lean new file mode 100644 index 0000000000..26861b2b3a --- /dev/null +++ b/FormalConjectures/ErdosProblems/884.lean @@ -0,0 +1,54 @@ +/- +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 884 + +*Reference:* [erdosproblems.com/884](https://www.erdosproblems.com/884) + +[Er98] Erdős, P., _Some of my new and almost new problems and results in +combinatorial number theory_. Number theory (Eger, 1996) (1998), 169–180. +-/ + +open Finset + +namespace Erdos884 + +/-- +Is it true that, for any $n$, if $d_1 < \cdots < d_t$ are the divisors of $n$, then +$$\sum_{1 \leq i < j \leq t} \frac{1}{d_j - d_i} \ll 1 + \sum_{1 \leq i < t} \frac{1}{d_{i+1} - d_i},$$ +where the implied constant is absolute? [Er98] + +The double sum over all pairs of divisors is bounded (up to an absolute constant) +by $1$ plus the sum over consecutive divisor gaps. Two divisors are consecutive +if no other divisor of $n$ lies strictly between them. + +See also problem #144. +-/ +@[category research open, AMS 11] +theorem erdos_884 : + answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, n ≥ 1 → + (∑ p ∈ (n.divisors ×ˢ n.divisors).filter (fun p => p.1 < p.2), + (1 : ℝ) / ((p.2 : ℝ) - (p.1 : ℝ))) ≤ + C * (1 + ∑ p ∈ (n.divisors ×ˢ n.divisors).filter (fun p => + p.1 < p.2 ∧ ∀ e ∈ n.divisors, ¬(p.1 < e ∧ e < p.2)), + (1 : ℝ) / ((p.2 : ℝ) - (p.1 : ℝ))) := by + sorry + +end Erdos884 diff --git a/FormalConjectures/ErdosProblems/892.lean b/FormalConjectures/ErdosProblems/892.lean new file mode 100644 index 0000000000..0bf698b631 --- /dev/null +++ b/FormalConjectures/ErdosProblems/892.lean @@ -0,0 +1,91 @@ +/- +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 892 + +*Reference:* [erdosproblems.com/892](https://www.erdosproblems.com/892) + +Is there a necessary and sufficient condition for a sequence of integers +$b_1 < b_2 < \cdots$ that ensures there exists a primitive sequence +$a_1 < a_2 < \cdots$ (i.e. no element divides another) with $a_n \ll b_n$ +for all $n$? + +Erdős [Er35] proved the necessary condition $\sum \frac{1}{b_n \log b_n} < \infty$, +and Erdős, Sárközy, and Szemerédi [ESS67] proved the necessary condition +$\sum_{b_n < x} \frac{1}{b_n} = o\!\left(\frac{\log x}{\sqrt{\log\log x}}\right)$. + +See also Problem 143 for an analogous question for sequences of real numbers. + +[Er35] Erdős, P., _Note on sequences of integers no one of which is divisible by any +other_. J. London Math. Soc. (1935), 126-128. + +[ESS67] Erdős, P., Sárközy, A., and Szemerédi, E., _On a theorem of Behrend_. +J. Austral. Math. Soc. (1967), 9-16. + +[ESS68] Erdős, P., Sárközy, A., and Szemerédi, E., _On the solvability of certain +equations in sequences of positive upper logarithmic density_. +J. London Math. Soc. (1968), 71-78. + +[Er98] Erdős, P., _Some of my new and almost new problems and results in +combinatorial number theory_. Number theory (Eger, 1996) (1998), 169-180. +-/ + +namespace Erdos892 + +/-- A sequence of natural numbers is *primitive* if no element divides any other. -/ +def IsPrimitiveSeq (a : ℕ → ℕ) : Prop := + ∀ i j, i ≠ j → ¬(a i ∣ a j) + +/-- +Erdős Problem 892 (particular case) [Er98]: + +If $b : \mathbb{N} \to \mathbb{N}$ is a strictly increasing sequence of positive integers such that +$\gcd(b_i, b_j) \neq b_k$ for all pairwise distinct $i, j, k$ (no $b_k$ equals $\gcd(b_i, b_j)$ +for pairwise distinct indices), +then there exists a strictly increasing primitive sequence $a : \mathbb{N} \to \mathbb{N}$ with +$a_n \ll b_n$ (i.e. there exists $C$ such that $a_n \leq C \cdot b_n$ for all $n$). +-/ +@[category research open, AMS 11] +theorem erdos_892 + (b : ℕ → ℕ) + (hb_pos : ∀ n, 0 < b n) + (hb_mono : StrictMono b) + (hb_gcd : ∀ i j k, i ≠ j → i ≠ k → j ≠ k → + Nat.gcd (b i) (b j) ≠ b k) : + ∃ (a : ℕ → ℕ) (C : ℕ), + 0 < C ∧ + StrictMono a ∧ + IsPrimitiveSeq a ∧ + ∀ n, a n ≤ C * b n := by + sorry + +/-- +Erdős Problem 892 (general form) [ESS68] [Er98]: + +Characterize which strictly increasing sequences of positive integers $b_1 < b_2 < \cdots$ have the +property that there exists a primitive sequence $a_1 < a_2 < \cdots$ with $a_n \ll b_n$. +-/ +@[category research open, AMS 11] +theorem erdos_892.variants.general : + {b : ℕ → ℕ | (∀ n, 0 < b n) ∧ StrictMono b ∧ + ∃ (a : ℕ → ℕ) (C : ℕ), 0 < C ∧ StrictMono a ∧ IsPrimitiveSeq a ∧ + ∀ n, a n ≤ C * b n} = answer(sorry) := by + sorry + +end Erdos892 diff --git a/FormalConjectures/ErdosProblems/894.lean b/FormalConjectures/ErdosProblems/894.lean new file mode 100644 index 0000000000..e602284870 --- /dev/null +++ b/FormalConjectures/ErdosProblems/894.lean @@ -0,0 +1,65 @@ +/- +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 894 + +Is it true that for every lacunary sequence $A \subset \mathbb{N}$, there exists a finite colouring +of $\mathbb{N}$ with no monochromatic pair whose difference lies in $A$? + +[Ka01] Katznelson, Y., _Chromatic numbers of Cayley graphs on ℤ and recurrence_. +Combinatorica (2001), 211–219. + +[PeSc10] Peres, Y., Schlag, W., _Two Erdős problems on lacunary sequences: chromatic +number and Diophantine approximation_. Bull. Lond. Math. Soc. (2010), 295–300. + +*Reference:* [erdosproblems.com/894](https://www.erdosproblems.com/894) +-/ + +namespace Erdos894 + +/-- +A sequence $a : \mathbb{N} \to \mathbb{N}$ is lacunary if it is strictly increasing and there +exists some $\varepsilon > 0$ such that $a(k+1) \geq (1 + \varepsilon) \cdot a(k)$ for all $k$. +-/ +def IsLacunary (a : ℕ → ℕ) : Prop := + StrictMono a ∧ ∃ ε : ℝ, ε > 0 ∧ ∀ k : ℕ, (a (k + 1) : ℝ) ≥ (1 + ε) * (a k : ℝ) + +/-- +Let $A = \{n_1 < n_2 < \cdots\} \subset \mathbb{N}$ be a lacunary sequence (there exists some +$\varepsilon > 0$ with $n_{k+1} \geq (1+\varepsilon) \cdot n_k$ for all $k$). + +Is it true that there must exist a finite colouring of $\mathbb{N}$ with no monochromatic +solutions to $a - b \in A$? + +Equivalently, does the Cayley graph on $\mathbb{Z}$ defined by a lacunary set have finite +chromatic number? + +This was proved: the answer is yes. Katznelson [Ka01] observed it follows from the +solution to Problem 464 (on the Littlewood conjecture). The best quantitative +bound, due to Peres and Schlag [PeSc10], gives at most +$\ll \varepsilon^{-1} \log(1/\varepsilon)$ colours. +-/ +@[category research solved, AMS 5] +theorem erdos_894 : answer(True) ↔ + ∀ (a : ℕ → ℕ), IsLacunary a → + ∃ (k : ℕ) (c : ℕ → Fin k), + ∀ x y : ℕ, x > y → (∃ i, a i = x - y) → c x ≠ c y := by + sorry + +end Erdos894 diff --git a/FormalConjectures/ErdosProblems/895.lean b/FormalConjectures/ErdosProblems/895.lean new file mode 100644 index 0000000000..0e5f9b2134 --- /dev/null +++ b/FormalConjectures/ErdosProblems/895.lean @@ -0,0 +1,59 @@ +/- +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 895 + +Is it true that, for all sufficiently large $n$, if $G$ is a triangle-free graph +on $\{1, \ldots, n\}$ then there must exist an independent set $\{a, b, a+b\}$? + +*Reference:* [erdosproblems.com/895](https://www.erdosproblems.com/895) + +[ErHa95] Erdős, P. and Hajnal, A., unpublished (1995). +-/ + +open SimpleGraph + +namespace Erdos895 + +/-- +Erdős Problem 895 [ErHa95]: + +Is it true that, for all sufficiently large $n$, if $G$ is a triangle-free graph +on $\{1, \ldots, n\}$ then there exist distinct $a, b$ with $a + b$ also in the vertex set +such that $\{a, b, a+b\}$ is an independent set in $G$? + +Proved by Barber using a SAT solver: this is true for all $n \geq 18$. + +We model the vertex set as $\operatorname{Fin} n = \{0, \ldots, n-1\}$ and require $a \geq 1$, +$b \geq 1$, and $a + b < n$ so that $a$, $b$, $a+b$ are all valid vertices +representing positive integers with $a + b$ in range. +-/ +@[category research solved, AMS 5] +theorem erdos_895 : answer(True) ↔ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), G.CliqueFree 3 → + ∃ a b : Fin n, + a ≠ b ∧ a.val ≥ 1 ∧ b.val ≥ 1 ∧ + ∃ h : a.val + b.val < n, + ¬G.Adj a b ∧ + ¬G.Adj a ⟨a.val + b.val, h⟩ ∧ + ¬G.Adj b ⟨a.val + b.val, h⟩ := by + sorry + +end Erdos895 diff --git a/FormalConjectures/ErdosProblems/896.lean b/FormalConjectures/ErdosProblems/896.lean new file mode 100644 index 0000000000..ce9393872d --- /dev/null +++ b/FormalConjectures/ErdosProblems/896.lean @@ -0,0 +1,89 @@ +/- +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 896 + +*Reference:* [erdosproblems.com/896](https://www.erdosproblems.com/896) + +*See also:* Problem #490. + +[Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +Estimate the maximum of $F(A,B)$ as $A, B$ range over all subsets of $\{1,\ldots,N\}$, +where $F(A,B)$ counts the number of $m$ such that $m = ab$ has exactly one solution with +$a \in A$ and $b \in B$. + +Van Doorn proved: +$$ +(1 + o(1)) \frac{N^2}{\log N} \leq \max_{A,B} F(A,B) \ll \frac{N^2}{(\log N)^\delta (\log \log N)^{3/2}} +$$ +where $\delta = 1 - \frac{1 + \log \log 2}{\log 2} \approx 0.086$. + +The conjectured answer is that the maximum is $\Theta(N^2 / \log N)$, matching the known +lower bound. +-/ + +open Finset Real + +namespace Erdos896 + +/-- +$F(A,B)$ counts the number of distinct products $m = a \cdot b$ (with $a \in A$, $b \in B$) +that have exactly one representation as such a product. +-/ +def uniqueProductCount (A B : Finset ℕ) : ℕ := + ((A ×ˢ B).image (fun p => p.1 * p.2)).filter (fun m => + ((A ×ˢ B).filter (fun p => p.1 * p.2 = m)).card = 1) |>.card + +/-- Conjectured: the maximum of $F(A,B)$ over all $A, B \subseteq \{1,\ldots,N\}$ is +$O(N^2 / \log N)$, matching the known lower bound. [Er72] -/ +@[category research open, AMS 5 11] +theorem erdos_896 : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A B : Finset ℕ, A ⊆ Finset.Icc 1 N → B ⊆ Finset.Icc 1 N → + (uniqueProductCount A B : ℝ) ≤ C * (N : ℝ) ^ 2 / Real.log (N : ℝ) := by + sorry + +/-- Known lower bound (van Doorn): for any $\varepsilon > 0$ and all sufficiently large $N$, +there exist $A, B \subseteq \{1,\ldots,N\}$ with +$F(A,B) \geq (1-\varepsilon) \cdot N^2 / \log N$. [Er72] -/ +@[category research solved, AMS 5 11] +theorem erdos_896.variants.lower_bound : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∃ A B : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ B ⊆ Finset.Icc 1 N ∧ + (uniqueProductCount A B : ℝ) ≥ (1 - ε) * (N : ℝ) ^ 2 / Real.log (N : ℝ) := by + sorry + +/-- Known upper bound (van Doorn): for all sufficiently large $N$ and all +$A, B \subseteq \{1,\ldots,N\}$, +$F(A,B) \ll N^2 / ((\log N)^\delta (\log \log N)^{3/2})$ +where $\delta = 1 - \frac{1 + \log \log 2}{\log 2} \approx 0.086$. -/ +@[category research solved, AMS 5 11] +theorem erdos_896.variants.upper_bound : + let δ : ℝ := 1 - (1 + Real.log (Real.log 2)) / Real.log 2 + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ A B : Finset ℕ, A ⊆ Finset.Icc 1 N → B ⊆ Finset.Icc 1 N → + (uniqueProductCount A B : ℝ) ≤ + C * (N : ℝ) ^ 2 / ((Real.log (N : ℝ)) ^ δ * (Real.log (Real.log (N : ℝ))) ^ (3/2 : ℝ)) := by + sorry + +end Erdos896 diff --git a/FormalConjectures/ErdosProblems/898.lean b/FormalConjectures/ErdosProblems/898.lean new file mode 100644 index 0000000000..d0889acbe4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/898.lean @@ -0,0 +1,87 @@ +/- +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 898 + +If P is a point in the interior of triangle ABC, and D_a, D_b, D_c are the feet of the +perpendiculars from P to the sides BC, CA, AB respectively, then +PA + PB + PC ≥ 2(PD_a + PD_b + PD_c). + +*Reference:* [erdosproblems.com/898](https://www.erdosproblems.com/898) + +[Er82e] Erdős, P., _Some of my favourite problems which recently have been solved_, +1982, pp. 59–79, p. 61. +-/ + +namespace Erdos898 + +/-- Squared Euclidean distance between two points in $\mathbb{R}^2$. -/ +noncomputable def sqDist898 (p q : ℝ × ℝ) : ℝ := + (p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2 + +/-- Euclidean distance between two points in $\mathbb{R}^2$. -/ +noncomputable def dist898 (p q : ℝ × ℝ) : ℝ := + Real.sqrt (sqDist898 p q) + +/-- A triangle is non-degenerate (vertices not collinear). -/ +def NonDegenerate898 (A B C : ℝ × ℝ) : Prop := + (B.1 - A.1) * (C.2 - A.2) - (C.1 - A.1) * (B.2 - A.2) ≠ 0 + +/-- Point $P$ lies in the open interior of triangle $ABC$ +(strictly positive barycentric coordinates). -/ +def InInterior898 (P A B C : ℝ × ℝ) : Prop := + ∃ (α β γ : ℝ), 0 < α ∧ 0 < β ∧ 0 < γ ∧ α + β + γ = 1 ∧ + P.1 = α * A.1 + β * B.1 + γ * C.1 ∧ + P.2 = α * A.2 + β * B.2 + γ * C.2 + +/-- The foot of the perpendicular from point $P$ to the line through $A$ and $B$. +This is the orthogonal projection of $P$ onto line $AB$: +$$\text{foot} = A + t \cdot (B - A)$$ +where $t = \frac{(P - A) \cdot (B - A)}{|B - A|^2}$. -/ +noncomputable def perpFoot898 (P A B : ℝ × ℝ) : ℝ × ℝ := + let dx := B.1 - A.1 + let dy := B.2 - A.2 + let t := ((P.1 - A.1) * dx + (P.2 - A.2) * dy) / (dx ^ 2 + dy ^ 2) + (A.1 + t * dx, A.2 + t * dy) + +/-- +Erdős Problem 898 (Erdős-Mordell Inequality) [Er82e, p.61]: + +If $A$, $B$, $C$ form a non-degenerate triangle in $\mathbb{R}^2$ and $P$ is a point in its +interior, then +$$ + d(P, A) + d(P, B) + d(P, C) \geq 2 \cdot (d(P, D_a) + d(P, D_b) + d(P, D_c)) +$$ +where $D_a$, $D_b$, $D_c$ are the feet of the perpendiculars from $P$ to sides +$BC$, $CA$, $AB$ respectively. + +Conjectured by Erdős in 1932 and proved by Mordell soon afterwards. +-/ +@[category research solved, AMS 51] +theorem erdos_898 + (A B C P : ℝ × ℝ) + (hnd : NonDegenerate898 A B C) + (hP : InInterior898 P A B C) : + dist898 P A + dist898 P B + dist898 P C ≥ + 2 * (dist898 P (perpFoot898 P B C) + + dist898 P (perpFoot898 P A C) + + dist898 P (perpFoot898 P A B)) := by + sorry + +end Erdos898 diff --git a/FormalConjectures/ErdosProblems/900.lean b/FormalConjectures/ErdosProblems/900.lean new file mode 100644 index 0000000000..db4a1e33b8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/900.lean @@ -0,0 +1,70 @@ +/- +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 900 + +*Reference:* [erdosproblems.com/900](https://www.erdosproblems.com/900) + +There exists a function $f$ with $f(c) \to 0$ as $c \to (1/2)^+$ and $f(c) \to 1$ as +$c \to \infty$, such that for every $c > 1/2$, a random graph $G(n, \lfloor cn \rfloor)$ +with high probability contains a path of length at least $f(c) \cdot n$. + +[Er78] Erdős, P., _Problems and results in combinatorial analysis and combinatorial + number theory_, Proceedings of the Ninth Southeastern Conference on Combinatorics, + Graph Theory, and Computing (1978), 29–40. + +[AKS81] Ajtai, M., Komlós, J. and Szemerédi, E., _The longest path in a random graph_, +Combinatorica 1 (1981), 1–12. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, + L'Enseignement Math. 27 (1982), 163–176. +-/ + +namespace Erdos900 + +open Classical in +/-- The probability that a uniformly random simple graph on $\operatorname{Fin}(n)$ with exactly +$m$ edges satisfies a given property, in the Erdős–Rényi $G(n,m)$ model. +This is the fraction $|\{G \in G(n,m) \mid P(G)\}| / |G(n,m)|$. -/ +noncomputable def erdosRenyiProbability (n m : ℕ) + (P : SimpleGraph (Fin n) → Prop) : ℝ := + let total := Finset.univ.filter (fun G : SimpleGraph (Fin n) => G.edgeFinset.card = m) + ((total.filter (fun G => P G)).card : ℝ) / (total.card : ℝ) + +/-- +Erdős Problem 900 (proved by Ajtai, Komlós, and Szemerédi [AKS81]): + +There exists $f : \mathbb{R} \to \mathbb{R}$ with $f(c) \to 0$ as $c \to (1/2)^+$ and +$f(c) \to 1$ as $c \to \infty$, such that for every $c > 1/2$, a random graph +$G(n, \lfloor cn \rfloor)$ with high probability contains a path of length at least +$f(c) \cdot n$. +-/ +@[category research solved, AMS 5 60] +theorem erdos_900 : + ∃ f : ℝ → ℝ, + (Filter.Tendsto f (nhdsWithin (1/2) (Set.Ioi (1/2))) (nhds 0)) ∧ + (Filter.Tendsto f Filter.atTop (nhds 1)) ∧ + (∀ c : ℝ, c > 1/2 → ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + erdosRenyiProbability n (⌊c * (n : ℝ)⌋₊) + (fun G => ∃ (v w : Fin n) (p : G.Walk v w), p.IsPath ∧ + ⌊f c * (n : ℝ)⌋₊ ≤ p.length) ≥ 1 - ε) := by + sorry + +end Erdos900 diff --git a/FormalConjectures/ErdosProblems/901.lean b/FormalConjectures/ErdosProblems/901.lean new file mode 100644 index 0000000000..1517a021d6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/901.lean @@ -0,0 +1,85 @@ +/- +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 901 + +Let $m(n)$ denote the minimum number of edges in an $n$-uniform hypergraph that does not have +Property B (i.e., is not $2$-colorable). Erdős and Lovász conjectured that $m(n)$ is of order +$n \cdot 2^n$. + +*Reference:* [erdosproblems.com/901](https://www.erdosproblems.com/901) + +[ErLo75] Erdős, P. and Lovász, L., _Problems and results on 3-chromatic hypergraphs and some +related questions_. Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on +his 60th birthday), Vol. II (1975), 609–627. + +[Er64e] Erdős, P., _On a combinatorial problem. II_. Acta Mathematica Academiae Scientiarum +Hungaricae **15** (1964), 445–447. +-/ + +open Finset + +namespace Erdos901 + +/-- +An $n$-uniform hypergraph is a finite collection of edges where each edge +has exactly $n$ vertices. +-/ +def IsNUniform (H : Finset (Finset ℕ)) (n : ℕ) : Prop := + ∀ e ∈ H, e.card = n + +/-- +A hypergraph has Property B (is $2$-colorable) if there exists a $2$-coloring +of the vertex set such that no edge is monochromatic, i.e., every edge +contains vertices of both colors. +-/ +def HasPropertyB (H : Finset (Finset ℕ)) : Prop := + ∃ f : ℕ → Bool, ∀ e ∈ H, (∃ x ∈ e, f x = true) ∧ (∃ x ∈ e, f x = false) + +/-- +Erdős Problem 901 (Erdős–Lovász Conjecture), lower bound: +Let $m(n)$ be minimal such that there is an $n$-uniform hypergraph with $m(n)$ edges +that does not have Property B. Erdős and Lovász conjecture that $m(n)$ is of +order $n \cdot 2^n$. + +Lower bound: there exists $c > 0$ such that for all sufficiently large $n$, +every $n$-uniform hypergraph without Property B has at least $c \cdot n \cdot 2^n$ edges. +-/ +@[category research open, AMS 5] +theorem erdos_901 : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ (H : Finset (Finset ℕ)), + IsNUniform H n → ¬HasPropertyB H → + (H.card : ℝ) ≥ c * ↑n * (2 : ℝ) ^ n := by + sorry + +/-- +Erdős Problem 901 (Erdős–Lovász Conjecture), upper bound: +There exists $c > 0$ such that for all sufficiently large $n$, there exists +an $n$-uniform hypergraph without Property B with at most $c \cdot n \cdot 2^n$ edges. +-/ +@[category research open, AMS 5] +theorem erdos_901.variants.upper_bound : + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ (H : Finset (Finset ℕ)), + IsNUniform H n ∧ ¬HasPropertyB H ∧ + (H.card : ℝ) ≤ c * ↑n * (2 : ℝ) ^ n := by + sorry + +end Erdos901 diff --git a/FormalConjectures/ErdosProblems/902.lean b/FormalConjectures/ErdosProblems/902.lean new file mode 100644 index 0000000000..9e3050eaf0 --- /dev/null +++ b/FormalConjectures/ErdosProblems/902.lean @@ -0,0 +1,112 @@ +/- +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 902 + +*Reference:* [erdosproblems.com/902](https://www.erdosproblems.com/902) + +Let $f(n)$ be minimal such that there is a tournament (a complete directed graph) +on $f(n)$ vertices such that every set of $n$ vertices is dominated by at least one +other vertex. Estimate $f(n)$. + +Schütte asked Erdős this in the early 1960s. It is easy to check that +$f(1) = 3$ and $f(2) = 7$. + +[Er63c] Erdős, P., _On a problem in graph theory_. Mathematical Gazette **47** (1963), 220–223. + +[SzSz65] Szekeres, E. and Szekeres, G., _On a problem of Schütte and Erdős_. Mathematical Gazette **49** (1965), 290–293. + +[Er82e] Erdős, P., _Some of my favourite problems which recently have been solved_ (1982), 59–79. +-/ + +namespace Erdos902 + +/-- A tournament on a type $V$: a relation where for any two distinct vertices, +exactly one beats the other. -/ +structure Tournament (V : Type*) where + beats : V → V → Prop + irrefl : ∀ v, ¬beats v v + complete : ∀ v w, v ≠ w → (beats v w ∨ beats w v) + antisymm : ∀ v w, beats v w → ¬beats w v + +/-- A tournament has the $n$-domination property if every subset of size $n$ +is dominated by some vertex outside the subset (i.e., some vertex $v \notin S$ +beats every member of $S$). -/ +def Tournament.hasDominationProperty {V : Type*} (T : Tournament V) + (n : ℕ) : Prop := + ∀ S : Finset V, S.card = n → ∃ v, v ∉ S ∧ ∀ u ∈ S, T.beats v u + +/-- $f(n)$: the minimum number of vertices in a tournament with the +$n$-domination property. -/ +noncomputable def tournamentDominationNumber (n : ℕ) : ℕ := + sInf {m : ℕ | ∃ (T : Tournament (Fin m)), T.hasDominationProperty n} + +/-- +Erdős Problem 902, exact value: $f(1) = 3$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.f1 : + tournamentDominationNumber 1 = 3 := by + sorry + +/-- +Erdős Problem 902, exact value: $f(2) = 7$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.f2 : + tournamentDominationNumber 2 = 7 := by + sorry + +/-- +Erdős Problem 902, exact value [SzSz65]: $f(3) = 19$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.f3 : + tournamentDominationNumber 3 = 19 := by + sorry + +/-- +Erdős Problem 902, Erdős lower bound [Er63c]: $f(n) \geq 2^{n+1} - 1$ for all $n \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.erdos_lower (n : ℕ) (hn : n ≥ 1) : + tournamentDominationNumber n ≥ 2 ^ (n + 1) - 1 := by + sorry + +/-- +Erdős Problem 902, upper bound [Er63c]: $f(n) \ll n^2 \cdot 2^n$. +There exists $C > 0$ such that $f(n) \leq C \cdot n^2 \cdot 2^n$ for all $n \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.upper : + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, n ≥ 1 → + (tournamentDominationNumber n : ℝ) ≤ C * (n : ℝ) ^ 2 * 2 ^ n := by + sorry + +/-- +Szekeres–Szekeres improved lower bound [SzSz65]: $f(n) \gg n \cdot 2^n$. +There exists $C > 0$ such that $f(n) \geq C \cdot n \cdot 2^n$ for all $n \geq 1$. +-/ +@[category research solved, AMS 5] +theorem erdos_902.variants.szekeres_lower : + ∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, n ≥ 1 → + (tournamentDominationNumber n : ℝ) ≥ C * (n : ℝ) * 2 ^ n := by + sorry + +end Erdos902 diff --git a/FormalConjectures/ErdosProblems/903.lean b/FormalConjectures/ErdosProblems/903.lean new file mode 100644 index 0000000000..17eebfe60b --- /dev/null +++ b/FormalConjectures/ErdosProblems/903.lean @@ -0,0 +1,67 @@ +/- +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 903 + +A conjecture of Erdős and Sós. For a prime power $p$ and $n = p^2 + p + 1$, if a pairwise +balanced design on $n$ points has more than $n$ blocks, then it must have at least $n + p$ +blocks. Proved by Erdős, Fowler, Sós, and Wilson [EFSW85]. + +*Reference:* [erdosproblems.com/903](https://www.erdosproblems.com/903) + +[Er82e] Erdős, P., _Problems and results in combinatorics and graph theory_, 1982. + +[dBEr48] de Bruijn, N.G. and Erdős, P., _On a combinatorial problem_, +Nederl. Akad. Wetensch., Proc. **51** (1948), 1277–1279. + +[EFSW85] Erdős, P., Fowler, J.C., Sós, V.T., and Wilson, R.M., _On 2-designs_, +J. Combin. Theory Ser. A (1985), 131–142. +-/ + +namespace Erdos903 + +/-- A pairwise balanced design on $\operatorname{Fin}(n)$: a family of blocks (subsets), each of +size at least 2, such that every pair of distinct elements is contained in exactly one +block. -/ +def IsPairwiseBalancedDesign {n : ℕ} (blocks : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ blocks, 2 ≤ B.card) ∧ + (∀ x y : Fin n, x ≠ y → + ∃! B : Finset (Fin n), B ∈ blocks ∧ x ∈ B ∧ y ∈ B) + +/-- +Erdős Problem 903, a conjecture of Erdős and Sós [Er82e]: + +Let $n = p^2 + p + 1$ for a prime power $p$ (i.e., $p = q^k$ for some prime $q$ and +$k \geq 1$), and let blocks be a pairwise balanced design on $\{0, \ldots, n-1\}$ (every +pair of distinct elements appears in exactly one block, and every block has at least 2 +elements). If the number of blocks $t > n$, then $t \geq n + p$. + +Proved by Erdős, Fowler, Sós, and Wilson [EFSW85]. +-/ +@[category research solved, AMS 5] +theorem erdos_903 (p q k : ℕ) (hq : Nat.Prime q) (hk : k ≥ 1) + (hp : p = q ^ k) + (n : ℕ) (hn : n = p ^ 2 + p + 1) + (blocks : Finset (Finset (Fin n))) + (hdesign : IsPairwiseBalancedDesign blocks) + (hgt : blocks.card > n) : + blocks.card ≥ n + p := by + sorry + +end Erdos903 diff --git a/FormalConjectures/ErdosProblems/904.lean b/FormalConjectures/ErdosProblems/904.lean new file mode 100644 index 0000000000..0fb01cde99 --- /dev/null +++ b/FormalConjectures/ErdosProblems/904.lean @@ -0,0 +1,52 @@ +/- +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 904 + +If $G$ is a graph with $n$ vertices and more than $n^2/4$ edges, then $G$ contains a +triangle on vertices $x, y, z$ such that $d(x) + d(y) + d(z) \geq 3n/2$. + +*Reference:* [erdosproblems.com/904](https://www.erdosproblems.com/904) + +[Er75] Erdős, P., _Some recent progress on extremal problems in graph theory_, + Congressus Numerantium (1975), 3–14. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, 1982. + +[Ed78] Edwards, C. S., _Complete subgraphs with largest sum of vertex degrees_. (1978), 293–306. +-/ + +open SimpleGraph + +namespace Erdos904 + +/-- +Bollobás-Erdős conjecture (proved by Edwards [Ed78]): +If $G$ is a graph with $n$ vertices and more than $n^2/4$ edges, then $G$ contains a +triangle on vertices $x, y, z$ such that $d(x) + d(y) + d(z) \geq 3n/2$. +-/ +@[category research solved, AMS 5] +theorem erdos_904 : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (n : ℝ) ^ 2 / 4 < (G.edgeFinset.card : ℝ) → + ∃ x y z : Fin n, G.Adj x y ∧ G.Adj y z ∧ G.Adj x z ∧ + (G.degree x + G.degree y + G.degree z : ℝ) ≥ 3 / 2 * (n : ℝ) := by + sorry + +end Erdos904 diff --git a/FormalConjectures/ErdosProblems/905.lean b/FormalConjectures/ErdosProblems/905.lean new file mode 100644 index 0000000000..f3eb591c1d --- /dev/null +++ b/FormalConjectures/ErdosProblems/905.lean @@ -0,0 +1,65 @@ +/- +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 905 + +Every graph on $n$ vertices with more than $n^2/4$ edges contains an edge +which is in at least $n/6$ triangles (Bollobás-Erdős conjecture). + +Proved independently by Edwards (unpublished) and by Hadžiivanov and +Nikiforov [KhNi79]. + +See also Problem 80 (more general) and Problem 1034 (stronger version, disproved). + +*Reference:* [erdosproblems.com/905](https://www.erdosproblems.com/905) + +[Er75] Erdős, P., _Some recent progress on extremal problems in graph theory_, +Congressus Numerantium (1975), 3–14. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, 1982. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph +theory_. Quaestiones Mathematicae (1993), 333-350. + +[KhNi79] Hadžiivanov, N. G., Nikiforov, S. V., _Solution of a problem of P. Erdős +about the maximum number of triangles with a common edge in a graph_. C. R. Acad. +Bulgare Sci. (1979), 1315–1318. +-/ + +open SimpleGraph Finset + +namespace Erdos905 + +/-- +Erdős Problem 905 (Bollobás-Erdős conjecture, proved by Edwards and +Hadžiivanov–Nikiforov [KhNi79]): +Every graph with $n$ vertices and more than $n^2/4$ edges contains an edge +which is in at least $n/6$ triangles. + +A triangle containing edge $\{u, v\}$ corresponds to a common neighbor of $u$ and $v$, +i.e., a vertex $w$ adjacent to both $u$ and $v$. +-/ +@[category research solved, AMS 5] +theorem erdos_905 (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] : + (G.edgeFinset.card : ℝ) > (n : ℝ) ^ 2 / 4 → + ∃ u v : Fin n, G.Adj u v ∧ + ((G.neighborFinset u ∩ G.neighborFinset v).card : ℝ) ≥ (n : ℝ) / 6 := by + sorry + +end Erdos905 diff --git a/FormalConjectures/ErdosProblems/907.lean b/FormalConjectures/ErdosProblems/907.lean new file mode 100644 index 0000000000..27d6061829 --- /dev/null +++ b/FormalConjectures/ErdosProblems/907.lean @@ -0,0 +1,55 @@ +/- +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 907 + +*Reference:* [erdosproblems.com/907](https://www.erdosproblems.com/907) + +If $f : \mathbb{R} \to \mathbb{R}$ is such that for every $h > 0$ the difference function +$x \mapsto f(x+h) - f(x)$ is continuous, must $f$ decompose as $g + \varphi$ where $g$ is +continuous and $\varphi$ is additive? + +See also Problem 908. + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. + +[dB51] de Bruijn, N. G., _Functions whose differences belong to a given class_, +Nieuw Arch. Wiskunde (2) 23 (1951), 194-218. +-/ + +namespace Erdos907 + +/-- +Let $f : \mathbb{R} \to \mathbb{R}$ be such that for every $h > 0$, the function +$x \mapsto f(x + h) - f(x)$ is continuous. Is it true that $f = g + \varphi$ for some +continuous $g$ and additive $\varphi$ (i.e., $\varphi(x + y) = \varphi(x) + \varphi(y)$)? + +Answered in the affirmative by de Bruijn [dB51]. +-/ +@[category research solved, AMS 26 39] +theorem erdos_907 : answer(True) ↔ ∀ (f : ℝ → ℝ), + (∀ h : ℝ, h > 0 → Continuous (fun x => f (x + h) - f x)) → + ∃ g φ : ℝ → ℝ, Continuous g ∧ (∀ x y : ℝ, φ (x + y) = φ x + φ y) ∧ + ∀ x : ℝ, f x = g x + φ x := by + sorry + +end Erdos907 diff --git a/FormalConjectures/ErdosProblems/908.lean b/FormalConjectures/ErdosProblems/908.lean new file mode 100644 index 0000000000..e44bb9b88d --- /dev/null +++ b/FormalConjectures/ErdosProblems/908.lean @@ -0,0 +1,62 @@ +/- +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 908 + +A conjecture of de Bruijn and Erdős asking whether every function with measurable +differences can be decomposed as the sum of a continuous function, an additive function, +and a function that is almost periodic for every period. Answered affirmatively by +Laczkovich. + +*Reference:* [erdosproblems.com/908](https://www.erdosproblems.com/908) + +[Er81b] Erdős, P., _My Scottish Book 'Problems'_. The Scottish Book (1981), 27-35. + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. + +[La80] Laczkovich, M., _Functions with measurable differences_, +Acta Mathematica Academiae Scientiarum Hungaricae **35** (1980), 217–235. +-/ + +open MeasureTheory + +namespace Erdos908 + +/-- +Erdős Problem 908 (proved by Laczkovich [La80]): + +Let $f : \mathbb{R} \to \mathbb{R}$ be such that for every $h > 0$, the function +$x \mapsto f(x + h) - f(x)$ is measurable. Is it true that $f = g + \varphi + r$ where +$g$ is continuous, $\varphi$ is additive (i.e., $\varphi(x + y) = \varphi(x) + \varphi(y)$), +and $r(x + h) - r(x) = 0$ for every $h > 0$ (equivalently, every $h$) and almost all +(depending on $h$) $x$? + +A conjecture of de Bruijn and Erdős. Answered in the affirmative by Laczkovich. +See also [907]. +-/ +@[category research solved, AMS 26 28] +theorem erdos_908 : answer(True) ↔ + ∀ f : ℝ → ℝ, (∀ h : ℝ, h > 0 → Measurable (fun x => f (x + h) - f x)) → + ∃ g φ r : ℝ → ℝ, Continuous g ∧ (∀ x y : ℝ, φ (x + y) = φ x + φ y) ∧ + (∀ h : ℝ, h > 0 → ∀ᵐ x ∂volume, r (x + h) - r x = 0) ∧ + ∀ x : ℝ, f x = g x + φ x + r x := by + sorry + +end Erdos908 diff --git a/FormalConjectures/ErdosProblems/909.lean b/FormalConjectures/ErdosProblems/909.lean new file mode 100644 index 0000000000..03118144c4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/909.lean @@ -0,0 +1,66 @@ +/- +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 909 + +For every $n \geq 2$, is there a topological space of covering dimension $n$ whose square also +has covering dimension $n$? Proved by Anderson and Keisler. + +*Reference:* [erdosproblems.com/909](https://www.erdosproblems.com/909) + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, +L'Enseignement Math. 27 (1982), 163–176. + +[AnKe67] Anderson, R. D. and Keisler, J. E., _An example in dimension theory_. +Proc. Amer. Math. Soc. (1967), 709–713. +-/ + +open TopologicalSpace Set Classical + +namespace Erdos909 + +/-- A topological space has covering dimension at most $n$ if every finite open + cover has a finite open refinement of order at most $n + 1$, meaning every + point belongs to at most $n + 1$ sets of the refinement. -/ +def coveringDimLE (X : Type*) [TopologicalSpace X] (n : ℕ) : Prop := + ∀ (ι : Type) [Fintype ι] (U : ι → Set X), + (∀ i, IsOpen (U i)) → (⋃ i, U i) = univ → + ∃ (κ : Type) (_ : Fintype κ) (V : κ → Set X), + (∀ k, IsOpen (V k)) ∧ + (⋃ k, V k) = univ ∧ + (∀ k, ∃ i, V k ⊆ U i) ∧ + ∀ x : X, (Finset.univ.filter (fun k => x ∈ V k)).card ≤ n + 1 + +/-- A topological space has covering dimension exactly $n$. -/ +def hasCoveringDim (X : Type*) [TopologicalSpace X] (n : ℕ) : Prop := + coveringDimLE X n ∧ ∀ m : ℕ, m < n → ¬coveringDimLE X m + +/-- +Erdős Problem 909 (proved by Anderson and Keisler [AnKe67]): + +For every $n \geq 2$, there exists a topological space $S$ of covering dimension $n$ +such that $S \times S$ also has covering dimension $n$. +-/ +@[category research solved, AMS 54] +theorem erdos_909 : answer(True) ↔ + ∀ n : ℕ, n ≥ 2 → ∃ (S : Type) (_ : TopologicalSpace S), + hasCoveringDim S n ∧ hasCoveringDim (S × S) n := by + sorry + +end Erdos909 diff --git a/FormalConjectures/ErdosProblems/91.lean b/FormalConjectures/ErdosProblems/91.lean new file mode 100644 index 0000000000..1316cb3796 --- /dev/null +++ b/FormalConjectures/ErdosProblems/91.lean @@ -0,0 +1,74 @@ +/- +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 91 + +*Reference:* [erdosproblems.com/91](https://www.erdosproblems.com/91) + +For large $n$, is it true that every $n$-point set in $\mathbb{R}^2$ minimizing the number of +distinct distances admits another minimizer of the same size that is not similar to it? + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167-177. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). + +[Ko24c] Kovács, Z., _A note on Erdős's mysterious remark_. arXiv:2412.05190 (2024). +-/ + +open Finset Classical EuclideanGeometry + +namespace Erdos91 + +/-- +Two finite point sets in $\mathbb{R}^2$ are similar if there exists a map +$f : \mathbb{R}^2 \to \mathbb{R}^2$ that scales all distances by the same positive constant $r$ +and maps one set onto the other. +-/ +def AreSimilar (A B : Finset ℝ²) : Prop := + ∃ (f : ℝ² → ℝ²) (r : ℝ), + r > 0 ∧ + (∀ x y : ℝ², dist (f x) (f y) = r * dist x y) ∧ + (∀ a, a ∈ A → f a ∈ B) ∧ + (∀ b, b ∈ B → ∃ a ∈ A, f a = b) + +/-- +Erdős Problem 91 [Er87b, Er90, Er97e]: For sufficiently large $n$, if +$A \subset \mathbb{R}^2$ has $|A| = n$ and minimises the number of distinct distances, then there +exists another minimiser $A'$ of the same cardinality that is not similar to $A$. In other words, +there are at least two non-similar sets that minimise the number of distinct distances. +-/ +@[category research open, AMS 52] +theorem erdos_91 : answer(sorry) ↔ + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ A : Finset ℝ², + A.card = n → + (∀ B : Finset ℝ², B.card = n → + distinctDistances A ≤ distinctDistances B) → + ∃ A' : Finset ℝ², + A'.card = n ∧ + (∀ B : Finset ℝ², B.card = n → + distinctDistances A' ≤ distinctDistances B) ∧ + ¬ AreSimilar A A' := by + sorry + +end Erdos91 diff --git a/FormalConjectures/ErdosProblems/910.lean b/FormalConjectures/ErdosProblems/910.lean new file mode 100644 index 0000000000..bc0c3ac6bd --- /dev/null +++ b/FormalConjectures/ErdosProblems/910.lean @@ -0,0 +1,71 @@ +/- +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 910 + +*Reference:* [erdosproblems.com/910](https://www.erdosproblems.com/910) + +Does every connected set in $\mathbb{R}^n$ contain a connected subset which is not a point +and not homeomorphic to the original set? If $n \geq 2$, does every connected set in +$\mathbb{R}^n$ contain more than $2^{\aleph_0}$ many connected subsets? + +Asked by Erdős in the 1940s, who thought the answer to both questions is yes. +The answer to both is in fact no, as shown by Rudin [Ru58] (conditional on the +continuum hypothesis). + +[Er82e] Erdős, P., _Problems and results on finite and infinite combinatorial analysis II_, 1982. + +[Ru58] Rudin, M. E., _A connected subset of the plane_, Fund. Math. 46 (1958), 15-24. +-/ + +open Set Cardinal Topology + +namespace Erdos910 + +/-- +Erdős Problem 910, Part 1 (disproved by Rudin [Ru58]): + +Does every connected set in $\mathbb{R}^n$ contain a connected subset which is not a single +point and not homeomorphic to the original set? +-/ +@[category research solved, AMS 54] +theorem erdos_910 : answer(False) ↔ + ∀ (n : ℕ), n ≥ 1 → + ∀ (S : Set (EuclideanSpace ℝ (Fin n))), + IsConnected S → + ∃ (T : Set (EuclideanSpace ℝ (Fin n))), + T ⊆ S ∧ IsConnected T ∧ T.Nontrivial ∧ + IsEmpty (Homeomorph T S) := by + sorry + +/-- +Erdős Problem 910, Part 2 (disproved by Rudin [Ru58]): + +If $n \geq 2$, does every connected set in $\mathbb{R}^n$ have more than $2^{\aleph_0}$ many +connected subsets? +-/ +@[category research solved, AMS 54] +theorem erdos_910.variants.part2 : answer(False) ↔ + ∀ (n : ℕ), n ≥ 2 → + ∀ (S : Set (EuclideanSpace ℝ (Fin n))), + IsConnected S → + Cardinal.continuum < #{T : Set (EuclideanSpace ℝ (Fin n)) // T ⊆ S ∧ IsConnected T} := by + sorry + +end Erdos910 diff --git a/FormalConjectures/ErdosProblems/911.lean b/FormalConjectures/ErdosProblems/911.lean new file mode 100644 index 0000000000..6bfe9a95c5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/911.lean @@ -0,0 +1,57 @@ +/- +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.Combinatorics.SimpleGraph.SizeRamsey + +/-! +# Erdős Problem 911 + +Is there a function $f$ with $f(x)/x \to \infty$ such that, for all sufficiently large $C$, +every graph $G$ with $n$ vertices and at least $Cn$ edges satisfies +$\hat{R}(G) > f(C) \cdot |E(G)|$? + +*Reference:* [erdosproblems.com/911](https://www.erdosproblems.com/911) + +[Er82e] Erdős, P., _Problems and results in graph theory_. (1982), p. 78. +-/ + +open SimpleGraph + +namespace Erdos911 + +/-- +Erdős Problem #911 [Er82e, p.78]: + +Is there a function $f : \mathbb{N} \to \mathbb{N}$ with $f(x)/x \to \infty$ as +$x \to \infty$ such that, for all sufficiently large $C$, if $G$ is any graph with +$n$ vertices and at least $C \cdot n$ edges then +$\hat{R}(G) > f(C) \cdot |E(G)|$? +-/ +@[category research open, AMS 5] +theorem erdos_911 : + answer(sorry) ↔ + ∃ f : ℕ → ℕ, + -- f(x)/x → ∞ as x → ∞ + (∀ M : ℕ, ∃ x₀ : ℕ, ∀ x : ℕ, x ≥ x₀ → f x ≥ M * x) ∧ + -- For all large C, the bound holds + ∃ C₀ : ℕ, ∀ C : ℕ, C ≥ C₀ → + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard ≥ C * n → + sizeRamsey G G > f C * G.edgeSet.ncard := by + sorry + +end Erdos911 diff --git a/FormalConjectures/ErdosProblems/914.lean b/FormalConjectures/ErdosProblems/914.lean new file mode 100644 index 0000000000..74d20b5d39 --- /dev/null +++ b/FormalConjectures/ErdosProblems/914.lean @@ -0,0 +1,63 @@ +/- +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 914 + +*Reference:* [erdosproblems.com/914](https://www.erdosproblems.com/914) + +Let $r \geq 2$ and $m \geq 1$. Every graph with $r \cdot m$ vertices and minimum degree at +least $m \cdot (r-1)$ contains $m$ vertex-disjoint copies of $K_r$. + +When $r = 2$ this follows from Dirac's theorem. Corrádi and Hajnal proved this when $r = 3$. +Hajnal and Szemerédi proved this for all $r \geq 4$. + +This is known as the Hajnal–Szemerédi theorem. + +[Er67b] Erdős, P., _Some recent results on extremal problems in graph theory (Results)_. +Theory of Graphs (Internat. Sympos., Rome, 1966) (1967), 117-123. + +[CoHa63] Corrádi, K. and Hajnal, A., _On the maximal number of independent circuits in a +graph_. Acta Math. Acad. Sci. Hungar. **14** (1963), 423-439. + +[HaSz70] Hajnal, A. and Szemerédi, E., _Proof of a conjecture of P. Erdős_. Combinatorial theory +and its applications, II (Proc. Colloq., Balatonfüred, 1969) (1970), 601-623. +-/ + +open SimpleGraph Finset + +namespace Erdos914 + +/-- +Erdős Problem 914 (proved by Hajnal and Szemerédi [HaSz70]): + +Let $r \geq 2$ and $m \geq 1$. Every graph on $r \cdot m$ vertices with minimum degree at +least $m \cdot (r-1)$ contains $m$ vertex-disjoint copies of $K_r$ (complete graphs +on $r$ vertices). +-/ +@[category research solved, AMS 5] +theorem erdos_914 (r m : ℕ) (hr : r ≥ 2) (hm : m ≥ 1) + (G : SimpleGraph (Fin (r * m))) [DecidableRel G.Adj] + (hdeg : ∀ v : Fin (r * m), G.degree v ≥ m * (r - 1)) : + ∃ S : Fin m → Finset (Fin (r * m)), + (∀ i, (S i).card = r) ∧ + (∀ i, G.IsClique (S i : Set (Fin (r * m)))) ∧ + (∀ i j, i ≠ j → Disjoint (S i) (S j)) := by + sorry + +end Erdos914 diff --git a/FormalConjectures/ErdosProblems/915.lean b/FormalConjectures/ErdosProblems/915.lean new file mode 100644 index 0000000000..18a405dd8c --- /dev/null +++ b/FormalConjectures/ErdosProblems/915.lean @@ -0,0 +1,119 @@ +/- +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.Combinatorics.SimpleGraph.GraphConjectures.Definitions + +/-! +# Erdős Problem 915 + +*Reference:* [erdosproblems.com/915](https://www.erdosproblems.com/915) + +Let $G$ be a graph with $1 + n(m-1)$ vertices and $1 + n\binom{m}{2}$ edges. +Must $G$ contain two vertices which are connected by $m$ disjoint paths? + +A conjecture of Bollobás and Erdős [BoEr62]. It is unclear whether "disjoint" +means edge-disjoint or (internally) vertex-disjoint. The construction of $n$ +copies of $K_m$ sharing a single vertex is valid for either interpretation. + +The vertex-disjoint version was disproved by Leonard [Le73] for $m = 5$ and by +Mader [Ma73] for all $m \geq 6$. The cases $m = 2, 3, 4$ were confirmed by +Bártfai [Ba60] and Bollobás [Bo66]. The edge-disjoint version was confirmed +(and strengthened) by Mader [Ma73], who showed +$\ell_m(n) = \lfloor m(n-1)/2 + 1 \rfloor$ for all $m \geq 2$. + +[Ba60] Bártfai, P., _Solution of a problem posed by P. Erdős_. Mat. Lapok +(1960), 175–176. + +[Bo66] Bollobás, B., _On graphs with at most three independent paths +connecting any two vertices_. Studia Sci. Math. Hungar. (1966), 137–140. + +[BoEr62] Bollobás, B. and Erdős, P., _Extremal problems in graph theory_. +Mat. Lapok (1962), 143–152. + +[Le72] Leonard, J. L., _On graphs with at most four line-disjoint paths +connecting any two vertices_. J. Combinatorial Theory Ser. B (1972), 242–250. + +[Le73] Leonard, J. L., _On a conjecture of Bollobás and Erdős_. Period. Math. +Hungar. (1973), 281–284. + +[Le73b] Leonard, J. L., _Graphs with 6-ways_. Canadian J. Math. (1973), +687–692. + +[Ma73] Mader, W., _Ein Extremalproblem des Zusammenhangs von Graphen_. Math. +Z. (1973), 223–231. + +[SoTh74] Sørensen, B. A. and Thomassen, C., _On k-rails in graphs_. J. +Combinatorial Theory Ser. B (1974), 143–159. +-/ + +open SimpleGraph Finset + +namespace Erdos915 + +/-- Two vertices $u$, $v$ in a simple graph $G$ are connected by $m$ internally +vertex-disjoint paths if there exist $m$ paths from $u$ to $v$ such that +no internal vertex of one path appears as an internal vertex of another. -/ +def HasInternallyDisjointPaths {V : Type*} (G : SimpleGraph V) + (u v : V) (m : ℕ) : Prop := + ∃ (paths : Fin m → G.Walk u v), + (∀ i, (paths i).IsPath) ∧ + (∀ i j, i ≠ j → InternallyDisjoint (paths i) (paths j)) + +/-- Two vertices $u$, $v$ in a simple graph $G$ are connected by $m$ +edge-disjoint paths if there exist $m$ walks from $u$ to $v$ such that +no edge appears in more than one walk. -/ +def HasEdgeDisjointPaths {V : Type*} [DecidableEq V] (G : SimpleGraph V) + (u v : V) (m : ℕ) : Prop := + ∃ (paths : Fin m → G.Walk u v), + (∀ i, (paths i).IsPath) ∧ + (∀ i j, i ≠ j → Disjoint (paths i).edges.toFinset (paths j).edges.toFinset) + +/-- +Erdős Problem 915 (Bollobás–Erdős conjecture [BoEr62]): + +Let $G$ be a graph with $1 + n(m-1)$ vertices and at least $1 + n\binom{m}{2}$ edges. +Must $G$ contain two vertices connected by $m$ internally vertex-disjoint paths? + +This was disproved by Leonard [Le73] for $m = 5$ and by Mader [Ma73] for all +$m \geq 6$. The edge-disjoint analogue was confirmed by Mader. +-/ +@[category research solved, AMS 5] +theorem erdos_915 : answer(False) ↔ + ∀ (n m : ℕ), m ≥ 2 → + ∀ (G : SimpleGraph (Fin (1 + n * (m - 1)))) [DecidableRel G.Adj], + G.edgeFinset.card ≥ 1 + n * m.choose 2 → + ∃ u v : Fin (1 + n * (m - 1)), u ≠ v ∧ + HasInternallyDisjointPaths G u v m := by + sorry + +/-- +Edge-disjoint version of Erdős Problem 915: + +Mader [Ma73] confirmed that for all $m \geq 2$, if a graph $G$ has +$1 + n(m-1)$ vertices and at least $\lfloor m(n-1)/2 + 1 \rfloor$ edges, +then $G$ contains two vertices connected by $m$ edge-disjoint paths. +-/ +@[category research solved, AMS 5] +theorem erdos_915_edge_disjoint : answer(True) ↔ + ∀ (n m : ℕ), m ≥ 2 → + ∀ (G : SimpleGraph (Fin (1 + n * (m - 1)))) [DecidableRel G.Adj], + G.edgeFinset.card ≥ (m * (n - 1)) / 2 + 1 → + ∃ u v : Fin (1 + n * (m - 1)), u ≠ v ∧ + HasEdgeDisjointPaths G u v m := by + sorry + +end Erdos915 diff --git a/FormalConjectures/ErdosProblems/916.lean b/FormalConjectures/ErdosProblems/916.lean new file mode 100644 index 0000000000..878594b2c1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/916.lean @@ -0,0 +1,71 @@ +/- +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 916 + +*Reference:* [erdosproblems.com/916](https://www.erdosproblems.com/916) + +Does every graph with $n$ vertices and $2n-2$ edges contain a cycle and another +vertex adjacent to three vertices on the cycle? + +This would be a stronger form of Dirac's result [Di60] that every such graph +contains a subgraph homeomorphic to $K_4$. + +The answer is yes, as proved by Thomassen [Th74]. + +[Er67b] Erdős, P., _Some recent results on extremal problems in graph theory (Results)_. +Theory of Graphs (Internat. Sympos., Rome, 1966) (1967), 117-123. + +[Di60] Dirac, G. A., _In abstrakten Graphen vorhandene vollständige 4-Graphen und ihre +Unterteilungen_. Math. Nachr. 22 (1960), 61-85. + +[Th74] Thomassen, C., _Some homeomorphism properties of graphs_. Math. Nachr. 64 (1974), +119-133. +-/ + +open SimpleGraph Finset + +namespace Erdos916 + +/-- +Erdős Problem 916 [Er67b]: + +Every simple graph with $n$ vertices and at least $2n-2$ edges contains a cycle $C$ +and a vertex $v$ not on $C$ that is adjacent to at least three vertices of $C$. + +A cycle of length $m$ ($m \geq 3$) is represented as an injective map +`cycle : Fin m → Fin n` where consecutive vertices (including wrap-around) +are adjacent. +-/ +@[category research solved, AMS 5] +theorem erdos_916 : answer(True) ↔ + ∀ (n : ℕ), n ≥ 4 → + ∀ (G : SimpleGraph (Fin n)) (_ : DecidableRel G.Adj), + G.edgeFinset.card ≥ 2 * n - 2 → + -- `k + 3` encodes a cycle of length at least 3 + ∃ (k : ℕ) (cycle : Fin (k + 3) → Fin n), + Function.Injective cycle ∧ + (∀ i : Fin (k + 3), G.Adj (cycle i) + (cycle ⟨(i.val + 1) % (k + 3), Nat.mod_lt _ (by omega)⟩)) ∧ + ∃ v : Fin n, v ∉ Set.range cycle ∧ + ∃ (i j l : Fin (k + 3)), i ≠ j ∧ j ≠ l ∧ i ≠ l ∧ + G.Adj v (cycle i) ∧ G.Adj v (cycle j) ∧ G.Adj v (cycle l) := by + sorry + +end Erdos916 diff --git a/FormalConjectures/ErdosProblems/917.lean b/FormalConjectures/ErdosProblems/917.lean new file mode 100644 index 0000000000..032b973fac --- /dev/null +++ b/FormalConjectures/ErdosProblems/917.lean @@ -0,0 +1,114 @@ +/- +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 917 + +*Reference:* [erdosproblems.com/917](https://www.erdosproblems.com/917) + +Let $k \geq 4$ and $f_k(n)$ be the largest number of edges in a graph on $n$ vertices +which has chromatic number $k$ and is critical (i.e. deleting any edge reduces +the chromatic number). + +Is it true that $f_k(n) \gg_k n^2$? +Is it true that $f_6(n) \sim n^2/4$? +More generally, is it true that, for $k \geq 6$, +$$f_k(n) \sim \tfrac{1}{2}\left(1 - \tfrac{1}{\lfloor k/3 \rfloor}\right) n^2?$$ + +Toft [To70] proved that $f_k(n) \gg_k n^2$ for $k \geq 4$. +Stiebitz [St87] disproved the asymptotic for $k \not\equiv 0 \pmod{3}$. + +[Di52] Dirac, G. A., _A property of 4-chromatic graphs and some remarks on critical graphs_. J. London Math. Soc. (1952), 85–92. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph Theory (1969), 27–35. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. Quaestiones Math. (1993), 333–350. + +[To70] Toft, B., _On the maximal number of edges of critical k-chromatic graphs_. Studia Sci. Math. Hungar. (1970), 461–470. + +[St87] Stiebitz, M., _Subgraphs of colour-critical graphs_. Combinatorica (1987), 303–312. + +[LMY23] Luo, C., Ma, J., Yang, T., _On the maximum number of edges in k-critical graphs_. Combin. Probab. Comput. (2023), 900–911. +-/ + +open SimpleGraph + +namespace Erdos917 + +/-- +A simple graph $G$ is $k$-critical if its chromatic number equals $k$ and for every +edge $e$, the graph obtained by deleting $e$ has chromatic number strictly less +than $k$. +-/ +def IsCritical {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + G.chromaticNumber = (k : ℕ∞) ∧ + ∀ e ∈ G.edgeSet, G.IsCriticalEdge e + +/-- +Erdős Problem 917, Part 1 [Er69b]: +For $k \geq 4$, $f_k(n) \gg_k n^2$. There exists a constant $c > 0$ such that for all +sufficiently large $n$, there exists a $k$-critical graph on $n$ vertices with at +least $c \cdot n^2$ edges. + +Proved by Toft [To70]. +-/ +@[category research solved, AMS 5] +theorem erdos_917 : + answer(True) ↔ ∀ k : ℕ, k ≥ 4 → + ∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ G : SimpleGraph (Fin n), + IsCritical G k ∧ (G.edgeSet.ncard : ℝ) ≥ c * (n : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 917, Part 2 [Er69b][Er93]: +$f_6(n) \sim n^2/4$. For all $\varepsilon > 0$ and sufficiently large $n$, the maximum number of +edges in a $6$-critical graph on $n$ vertices is asymptotically $n^2/4$. + +This problem remains open. +-/ +@[category research open, AMS 5] +theorem erdos_917.variants.f6_asymptotic : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (∃ G : SimpleGraph (Fin n), + IsCritical G 6 ∧ (G.edgeSet.ncard : ℝ) ≥ (1 / 4 - ε) * (n : ℝ) ^ 2) ∧ + (∀ G : SimpleGraph (Fin n), + IsCritical G 6 → (G.edgeSet.ncard : ℝ) ≤ (1 / 4 + ε) * (n : ℝ) ^ 2) := by + sorry + +/-- +Erdős Problem 917, Part 3 [Er69b]: +For $k \geq 6$, +$$f_k(n) \sim \tfrac{1}{2}\left(1 - \tfrac{1}{\lfloor k/3 \rfloor}\right) n^2.$$ + +Note: Disproved by Stiebitz [St87] for $k \not\equiv 0 \pmod{3}$. +-/ +@[category research solved, AMS 5] +theorem erdos_917.variants.general_asymptotic : + answer(False) ↔ ∀ k : ℕ, k ≥ 6 → + let d : ℕ := k / 3 + let α : ℝ := 1 / 2 * (1 - 1 / (d : ℝ)) + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (∃ G : SimpleGraph (Fin n), + IsCritical G k ∧ (G.edgeSet.ncard : ℝ) ≥ (α - ε) * (n : ℝ) ^ 2) ∧ + (∀ G : SimpleGraph (Fin n), + IsCritical G k → (G.edgeSet.ncard : ℝ) ≤ (α + ε) * (n : ℝ) ^ 2) := by + sorry + +end Erdos917 diff --git a/FormalConjectures/ErdosProblems/919.lean b/FormalConjectures/ErdosProblems/919.lean new file mode 100644 index 0000000000..e8a224165c --- /dev/null +++ b/FormalConjectures/ErdosProblems/919.lean @@ -0,0 +1,86 @@ +/- +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 919 + +*Reference:* [erdosproblems.com/919](https://www.erdosproblems.com/919) + +This question was inspired by a theorem of Babai, that if $G$ is a graph on a +well-ordered set with chromatic number $\geq \aleph_0$ there is a subgraph on +vertices with order-type $\omega$ with chromatic number $\aleph_0$. + +Erdős and Hajnal showed this does not generalise to higher cardinals — they +constructed a graph on $\omega_1^2$ with chromatic number $\aleph_1$ such that +every strictly smaller subgraph has chromatic number $\leq \aleph_0$. + +A similar construction produces a graph on $\omega_2^2$ with chromatic number +$\aleph_2$ such that every smaller subgraph has chromatic number $\leq \aleph_1$. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph +Theory (Proc. Second Ann Arbor Graph Theory Conf., Ann Arbor, Mich., 1968) (1969), 27-35. +-/ + +open SimpleGraph Cardinal Ordinal +open scoped Cardinal + +namespace Erdos919 + +/-- +Erdős Problem 919 [Er69b]: + +Is there a graph on a well-ordered set of order type $\omega_2 \cdot \omega_2$ with chromatic +number $\aleph_2$ such that every subgraph induced on a subset of strictly smaller +order type has chromatic number $\leq \aleph_0$? +-/ +@[category research open, AMS 3 5] +theorem erdos_919 : answer(sorry) ↔ + ∃ (V : Type) (_ : LinearOrder V) (_ : IsWellOrder V (· < ·)) + (G : SimpleGraph V), + Ordinal.type ((· < ·) : V → V → Prop) = + Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2) ∧ + G.chromaticCardinal = ℵ_ 2 ∧ + (∀ (S : Set V), + Ordinal.type (Subrel (· < ·) S) < + Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2) → + (G.induce S).chromaticCardinal ≤ ℵ₀) := by + sorry + +/-- +Erdős Problem 919, variant [Er69b]: + +What if instead we ask for $G$ to have chromatic number $\aleph_1$? + +Is there a graph on a well-ordered set of order type $\omega_2 \cdot \omega_2$ with chromatic +number exactly $\aleph_1$ such that every subgraph induced on a subset of strictly +smaller order type has chromatic number $\leq \aleph_0$? +-/ +@[category research open, AMS 3 5] +theorem erdos_919.variants.aleph_1 : answer(sorry) ↔ + ∃ (V : Type) (_ : LinearOrder V) (_ : IsWellOrder V (· < ·)) + (G : SimpleGraph V), + Ordinal.type ((· < ·) : V → V → Prop) = + Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2) ∧ + G.chromaticCardinal = ℵ_ 1 ∧ + (∀ (S : Set V), + Ordinal.type (Subrel (· < ·) S) < + Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2) → + (G.induce S).chromaticCardinal ≤ ℵ₀) := by + sorry + +end Erdos919 diff --git a/FormalConjectures/ErdosProblems/921.lean b/FormalConjectures/ErdosProblems/921.lean new file mode 100644 index 0000000000..06ea2539f1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/921.lean @@ -0,0 +1,92 @@ +/- +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 921 + +*Reference:* [erdosproblems.com/921](https://www.erdosproblems.com/921) + +Let $k \geq 4$ and let $f_k(n)$ be the largest $m$ such that there is a graph on $n$ +vertices with chromatic number $k$ in which every odd cycle has length $> m$. +Is it true that $f_k(n) \asymp n^{1/(k-2)}$? + +A question of Erdős and Gallai [Er69b]. Gallai [Ga63] proved that $f_4(n) \gg n^{1/2}$ +and Erdős (unpublished) proved $f_4(n) \ll n^{1/2}$. + +This was proved for all $k \geq 4$ by Kierstead, Szemerédi, and Trotter [KST84]. + +[Er69b] Erdős, P., *Problems and results in graph theory and combinatorics*, 1969. + +[Ga63] Gallai, T., *Kritische Graphen I*. Magyar Tudományos Akadémia Matematikai +Kutatóintézet Közleményei (1963), 165–192. + +[KST84] Kierstead, H. A., Szemerédi, E., and Trotter, W. T., *On coloring graphs with +locally small chromatic number*. Combinatorica (1984), 183–185. +-/ + +open SimpleGraph + +namespace Erdos921 + +/-- The largest $m$ such that there exists a graph on $n$ vertices with chromatic + number $k$ in which every odd cycle has length $> m$. -/ +noncomputable def erdos921F (k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), + G.chromaticNumber = (k : ℕ∞) ∧ + ∀ (v : Fin n) (p : G.Walk v v), p.IsCycle → Odd p.length → m < p.length} + +/-- +Erdős Problem 921 [Er69b] [KST84]: + +Is it true that $f_k(n) \asymp n^{1/(k-2)}$ for all $k \geq 4$? +This was proved by Kierstead, Szemerédi, and Trotter. +-/ +@[category research solved, AMS 5] +theorem erdos_921 : answer(True) ↔ + ∀ k : ℕ, k ≥ 4 → + (∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos921F k n : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 2))) ∧ + (∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos921F k n : ℝ) ≤ C * (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 2))) := by + sorry + +/-- +Erdős Problem 921, lower bound [Er69b] [KST84]: + +For every $k \geq 4$, there exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$f_k(n) \geq C \cdot n^{1/(k-2)}$. +-/ +@[category research solved, AMS 5] +theorem erdos_921.variants.lower_bound (k : ℕ) (hk : k ≥ 4) : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos921F k n : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 2)) := by + sorry + +/-- +Erdős Problem 921, upper bound [Er69b] [KST84]: + +For every $k \geq 4$, there exist $C > 0$ and $N_0$ such that for all $n \geq N_0$, +$f_k(n) \leq C \cdot n^{1/(k-2)}$. +-/ +@[category research solved, AMS 5] +theorem erdos_921.variants.upper_bound (k : ℕ) (hk : k ≥ 4) : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos921F k n : ℝ) ≤ C * (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 2)) := by + sorry + +end Erdos921 diff --git a/FormalConjectures/ErdosProblems/922.lean b/FormalConjectures/ErdosProblems/922.lean new file mode 100644 index 0000000000..204b433c45 --- /dev/null +++ b/FormalConjectures/ErdosProblems/922.lean @@ -0,0 +1,63 @@ +/- +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 922 + +*Reference:* [erdosproblems.com/922](https://www.erdosproblems.com/922) + +Let $k \geq 0$. Let $G$ be a graph such that every induced subgraph $H$ contains an independent +set of size $\geq (n - k) / 2$, where $n$ is the number of vertices of $H$. Must $G$ have +chromatic number at most $k + 2$? + +A question of Erdős and Hajnal [ErHa67b]. This is true, and was proved by +Folkman [Fo70b]. + +See also [Problem #73](https://www.erdosproblems.com/73). + +[ErHa67b] Erdős, P. and Hajnal, A., _On chromatic graphs_. Mat. Lapok (1967), 1-4. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph +Theory (1969), 27-35. + +[Fo70b] Folkman, J. H., _An upper bound on the chromatic number of a graph_ (1970), 437-457. +-/ + +open SimpleGraph + +namespace Erdos922 + +/-- +Erdős Problem 922 [ErHa67b]: + +If every induced subgraph of $G$ on $n$ vertices has an independent set of +size at least $(n - k) / 2$, then $G$ is $(k + 2)$-colorable. + +The condition `2 * T.card + k ≥ S.card` encodes $|T| \geq (|S| - k) / 2$. +-/ +@[category research solved, AMS 5] +theorem erdos_922 : answer(True) ↔ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) (k : ℕ), + (∀ S : Finset V, ∃ T : Finset V, T ⊆ S ∧ + G.IsIndepSet ↑T ∧ + 2 * T.card + k ≥ S.card) → + G.Colorable (k + 2) := by + sorry + +end Erdos922 diff --git a/FormalConjectures/ErdosProblems/923.lean b/FormalConjectures/ErdosProblems/923.lean new file mode 100644 index 0000000000..d80bce8862 --- /dev/null +++ b/FormalConjectures/ErdosProblems/923.lean @@ -0,0 +1,57 @@ +/- +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 923 + +Is it true that, for every $k$, there is some $f(k)$ such that if $G$ has chromatic number +$\geq f(k)$ then $G$ contains a triangle-free subgraph with chromatic number $\geq k$? + +*Reference:* [erdosproblems.com/923](https://www.erdosproblems.com/923) + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in +Graph Theory (1969), 27–35. + +[Ro77] Rödl, V., *On the chromatic number of subgraphs of a given graph*, Proc. Amer. +Math. Soc. 64 (1977), 370-371. +-/ + +open SimpleGraph + +namespace Erdos923 + +/-- +Is it true that, for every $k$, there is some $f(k)$ such that if $G$ has chromatic number +$\geq f(k)$ then $G$ contains a triangle-free subgraph with chromatic number $\geq k$? + +Proved by Rödl [Ro77]. This is the $r = 4$ special case of problem \#108 [Er69b]. +Triangle-free is formalized here as girth $\geq 4$ (no cycles of length 3). +-/ +@[category research solved, AMS 5] +theorem erdos_923 : + answer(True) ↔ + ∀ k ≥ (2 : ℕ), + ∃ (f : ℕ), + ∀ (V : Type*) (G : SimpleGraph V), + (f : ℕ∞) ≤ G.chromaticNumber → + ∃ H : G.Subgraph, + (k : ℕ∞) ≤ H.coe.chromaticNumber ∧ + (4 : ℕ∞) ≤ H.coe.egirth := by + sorry + +end Erdos923 diff --git a/FormalConjectures/ErdosProblems/924.lean b/FormalConjectures/ErdosProblems/924.lean new file mode 100644 index 0000000000..33cccae0d7 --- /dev/null +++ b/FormalConjectures/ErdosProblems/924.lean @@ -0,0 +1,67 @@ +/- +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 924 + +*Reference:* [erdosproblems.com/924](https://www.erdosproblems.com/924) + +Let $k \geq 2$ and $l \geq 3$. Is there a graph $G$ which contains no $K_{l+1}$ such that +every $k$-colouring of the edges of $G$ contains a monochromatic copy of $K_l$? + +A question of Erdős and Hajnal [Er69b][Er75b]. Folkman [Fo70] proved this +when $k = 2$. The case for general $k$ was proved by Nešetřil and Rödl [NeRo76]. + +See #582 for the special case $k = 2$, $l = 3$ and #966 for an arithmetic analogue. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in +Graph Theory (1969), 27–35. + +[Er75b] Erdős, P., _Problems and results on finite and infinite graphs_. Recent Advances in +Graph Theory (1975), 183–192. + +[Fo70] Folkman, J., _Graphs with monochromatic complete subgraphs in every edge coloring_. +SIAM J. Appl. Math. 18 (1970), 19–24. + +[NeRo76] Nešetřil, J. and Rödl, V., _The Ramsey property for graphs with forbidden complete +subgraphs_. J. Combin. Theory Ser. B 20 (1976), 243–249. +-/ + +namespace Erdos924 + +/-- +Erdős Problem #924 [Er69b][Er75b]: + +For all $k \geq 2$ and $l \geq 3$, there exists a $K_{l+1}$-free graph $G$ such that every +$k$-colouring of the edges of $G$ contains a monochromatic $K_l$. + +Proved by Nešetřil and Rödl [NeRo76]. +-/ +@[category research solved, AMS 5] +theorem erdos_924 : answer(True) ↔ + ∀ (k : ℕ) (l : ℕ), k ≥ 2 → l ≥ 3 → + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.CliqueFree (l + 1) ∧ + ∀ (c : Fin n → Fin n → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a : Fin k) (S : Finset (Fin n)), + G.IsNClique l S ∧ + ∀ ⦃x⦄, x ∈ S → ∀ ⦃y⦄, y ∈ S → x ≠ y → c x y = a := by + sorry + +end Erdos924 diff --git a/FormalConjectures/ErdosProblems/925.lean b/FormalConjectures/ErdosProblems/925.lean new file mode 100644 index 0000000000..748c89a931 --- /dev/null +++ b/FormalConjectures/ErdosProblems/925.lean @@ -0,0 +1,70 @@ +/- +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.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 925 + +*Reference:* [erdosproblems.com/925](https://www.erdosproblems.com/925) + +Is there a constant $\delta > 0$ such that, for all large $n$, if $G$ is a graph on $n$ +vertices which is not Ramsey for $K_3$ (i.e. there exists a 2-colouring of the +edges of $G$ with no monochromatic triangle) then $G$ contains an independent set +of size $\gg n^{1/3+\delta}$? + +It is easy to show that there exists an independent set of size $\gg n^{1/3}$. + +Equivalently, this asks whether $R(3,3,m) \ll m^{3-c}$ for some $c > 0$. + +DISPROVED by Alon and Rödl [AlRo05], who proved that +$$m^3 / (\log m)^{4+o(1)} \ll R(3,3,m) \ll m^3 / (\log m)^2.$$ +Sudakov observed that the $\log \log m$ in the upper bound can be removed. + +See also [Problem 553](https://www.erdosproblems.com/553). + +[Er69b] Erdős, P. + +[AlRo05] Alon, N. and Rödl, V., _Sharp bounds for some multicolor Ramsey numbers_, +Combinatorica 25 (2005), 125-141. +-/ + +open SimpleGraph + +namespace Erdos925 + +/-- A graph $G$ on $n$ vertices is "not Ramsey for $K_3$" if there exists a +2-colouring of its edges with no monochromatic triangle. Equivalently, +there is a subgraph $H \leq G$ such that both $H$ and $G \setminus H$ are triangle-free. -/ +def IsNotRamseyForTriangle {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ∃ H : SimpleGraph (Fin n), H ≤ G ∧ H.CliqueFree 3 ∧ (G \ H).CliqueFree 3 + +/-- +Erdős Problem 925 [Er69b] (DISPROVED by Alon-Rödl [AlRo05]): + +There exists $\delta > 0$ and $C > 0$ such that for all sufficiently large $n$, every +graph $G$ on $n$ vertices which is not Ramsey for $K_3$ contains an independent set +of size at least $C \cdot n^{1/3 + \delta}$. +-/ +@[category research solved, AMS 5] +theorem erdos_925 : answer(False) ↔ + ∃ δ : ℝ, δ > 0 ∧ ∃ C : ℝ, C > 0 ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ G : SimpleGraph (Fin n), IsNotRamseyForTriangle G → + (α(G) : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / 3 + δ) := by + sorry + +end Erdos925 diff --git a/FormalConjectures/ErdosProblems/926.lean b/FormalConjectures/ErdosProblems/926.lean new file mode 100644 index 0000000000..501128c2d2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/926.lean @@ -0,0 +1,112 @@ +/- +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 926 + +*Reference:* [erdosproblems.com/926](https://www.erdosproblems.com/926) + +Is it true that $\mathrm{ex}(n; H_k) \ll_k n^{3/2}$, where $H_k$ is the graph on vertices +$x, y_1, \ldots, y_k, z_1, \ldots, z_{\binom{k}{2}}$ in which $x$ is adjacent to every $y_i$ and +each pair $y_i, y_j$ is adjacent to a unique $z_{ij}$? + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph +Theory (1969), 27-35. + +[Er71] Erdős, P., _Some unsolved problems in graph theory and combinatorial analysis_. +Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109. + +[Er74c] Erdős, P., _Extremal problems on graphs and hypergraphs_. (1974), 75-84. + +[Er93] Erdős, P., _Some of my favorite solved and unsolved problems in graph theory_. +Quaestiones Mathematicae (1993), 333-350. + +[Fu91] Füredi, Z., _On a Turán type problem of Erdős_. Combinatorica (1991), 75-79. + +[AKS03] Alon, N., Krivelevich, M., and Sudakov, B., _Turán numbers of bipartite graphs and +related Ramsey-type questions_. Combinatorics, Probability and Computing 12 (2003), +no. 5-6, 477-494. +-/ + +open SimpleGraph + +namespace Erdos926 + +/-- An injective graph homomorphism from $H$ to $G$; witnesses that $G$ contains a +subgraph isomorphic to $H$. -/ +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) + +/-- The Turán number $\mathrm{ex}(n; H)$: the maximum number of edges in a simple graph on $n$ +vertices that contains no copy of $H$ as a subgraph. -/ +noncomputable def turanNumber {U : Type*} (H : SimpleGraph U) (n : ℕ) : ℕ := + sSup {m : ℕ | ∃ (V : Type) (fv : Fintype V) (F : SimpleGraph V) (dr : DecidableRel F.Adj), + haveI := fv; haveI := dr; + Fintype.card V = n ∧ ¬ContainsSubgraph F H ∧ F.edgeFinset.card = m} + +/-- Vertex type for the graph $H_k$: one center vertex $x$, $k$ spoke vertices +$y_1, \ldots, y_k$, and one pair vertex $z_{ij}$ for each pair $(i, j)$ with $i < j \leq k$. -/ +abbrev HkVertex (k : ℕ) := Unit ⊕ Fin k ⊕ { p : Fin k × Fin k // p.1 < p.2 } + +/-- The graph $H_k$ from Erdős Problem 926. +The center vertex $x$ is adjacent to all spoke vertices $y_i$, +and each pair vertex $z_{ij}$ (for $i < j$) is adjacent to $y_i$ and $y_j$. -/ +def graphHk (k : ℕ) : SimpleGraph (HkVertex k) where + Adj := fun v w => match v, w with + | Sum.inl (), Sum.inr (Sum.inl _) => True + | Sum.inr (Sum.inl _), Sum.inl () => True + | Sum.inr (Sum.inl i), Sum.inr (Sum.inr ⟨(a, b), _⟩) => i = a ∨ i = b + | Sum.inr (Sum.inr ⟨(a, b), _⟩), Sum.inr (Sum.inl i) => i = a ∨ i = b + | _, _ => False + symm := by + intro v w + match v, w with + | Sum.inl (), Sum.inr (Sum.inl _) => intro _; trivial + | Sum.inr (Sum.inl _), Sum.inl () => intro _; trivial + | Sum.inr (Sum.inl i), Sum.inr (Sum.inr ⟨(a, b), h⟩) => intro h'; exact h' + | Sum.inr (Sum.inr ⟨(a, b), h⟩), Sum.inr (Sum.inl i) => intro h'; exact h' + | Sum.inl (), Sum.inl () => intro h; exact h + | Sum.inr (Sum.inl _), Sum.inr (Sum.inl _) => intro h; exact h + | Sum.inr (Sum.inr _), Sum.inr (Sum.inr _) => intro h; exact h + | Sum.inl (), Sum.inr (Sum.inr _) => intro h; exact h + | Sum.inr (Sum.inr _), Sum.inl () => intro h; exact h + loopless := by + intro v + match v with + | Sum.inl () => intro h; exact h + | Sum.inr (Sum.inl _) => intro h; exact h + | Sum.inr (Sum.inr ⟨(a, b), h⟩) => nofun + +/-- +Erdős Problem 926 [Er69b, Er71, Er74c, Er93]: + +Let $k \geq 4$. Is it true that $\mathrm{ex}(n; H_k) \ll_k n^{3/2}$, where $H_k$ is the graph on +vertices $x, y_1, \ldots, y_k, z_1, \ldots, z_{\binom{k}{2}}$, where $x$ is adjacent to all $y_i$ +and each pair $y_i, y_j$ is adjacent to a unique $z_{ij}$? + +The answer is yes, proved by Füredi [Fu91] who showed $\mathrm{ex}(n; H_k) \ll (kn)^{3/2}$, +improved to $\mathrm{ex}(n; H_k) \ll k \cdot n^{3/2}$ by Alon, Krivelevich, and Sudakov [AKS03]. +-/ +@[category research solved, AMS 5] +theorem erdos_926 : answer(True) ↔ + ∀ (k : ℕ), 4 ≤ k → + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → + (turanNumber (graphHk k) n : ℝ) ≤ C * (n : ℝ) ^ ((3 : ℝ) / 2) := by + sorry + +end Erdos926 diff --git a/FormalConjectures/ErdosProblems/927.lean b/FormalConjectures/ErdosProblems/927.lean new file mode 100644 index 0000000000..0ca2ce37cc --- /dev/null +++ b/FormalConjectures/ErdosProblems/927.lean @@ -0,0 +1,106 @@ +/- +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 Mathlib.Combinatorics.SimpleGraph.Clique + +/-! +# Erdős Problem 927 + +*Reference:* [erdosproblems.com/927](https://www.erdosproblems.com/927) + +Let $g(n)$ be the maximum number of different sizes of cliques (maximal complete +subgraphs) that can occur in a graph on $n$ vertices. Is it true that +$$ + g(n) = n - \log_2 n - \log^*(n) + O(1), +$$ +where $\log^*(n)$ is the iterated logarithm (the number of times the logarithm +must be applied before the result is less than $1$)? + +Moon and Moser [MoMo65] first studied $g(n)$ and proved +$n - \log_2 n - 2\log\log n < g(n) \leq n - \lfloor \log_2 n \rfloor$. +Erdős [Er66b] improved the lower bound to $g(n) > n - \log_2 n - \log^*(n) - O(1)$ +and conjectured this was the correct order of magnitude. + +DISPROVED by Spencer [Sp71], who proved that $g(n) > n - \log_2 n - O(1)$, +showing the $\log^*$ correction term is unnecessary. + +See also [775]. + +[Er66b] Erdős, P., _On cliques in graphs_. Israel Journal of Mathematics (1966), 233–234. + +[Er69b] Erdős, P., _Problems and results in chromatic graph theory_. Proof Techniques in Graph +Theory (1969), 27-35. + +[Er71] Erdős, P., _Topics in combinatorial analysis_. Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[MoMo65] Moon, J. W. and Moser, L., _On cliques in graphs_. Israel Journal of Mathematics +(1965), 23–28. + +[Sp71] Spencer, J. H., _The number of distinct clique sizes of a graph_. Israel Journal of +Mathematics (1971), 419–421. +-/ + +open SimpleGraph + +namespace Erdos927 + +/-- The set of distinct sizes of maximal cliques in a simple graph on `n` vertices. -/ +def graphCliqueSizes {n : ℕ} (G : SimpleGraph (Fin n)) : Set ℕ := + {m : ℕ | ∃ S : Finset (Fin n), Maximal (fun T : Finset (Fin n) => G.IsClique ↑T) S ∧ + S.card = m} + +/-- +Erdős Problem 927 (DISPROVED by Spencer [Sp71]): + +Is it true that $g(n) = n - \log_2 n - \log^*(n) + O(1)$? + +The right-hand side formalizes a necessary consequence of the conjecture: since +$\log^*(n) \to \infty$, the conjecture implies that for every constant $C$, +$g(n) \leq n - \lfloor \log_2 n \rfloor - C$ for all sufficiently large $n$. +Spencer showed $g(n) \geq n - \lfloor \log_2 n \rfloor - O(1)$, disproving this. +-/ +@[category research solved, AMS 5] +theorem erdos_927 : answer(False) ↔ + (∀ C : ℕ, ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∀ G : SimpleGraph (Fin n), + (graphCliqueSizes G).ncard + Nat.log 2 n + C ≤ n) := by + sorry + +/-- +Spencer's lower bound [Sp71]: there exists a constant $C$ such that for every $n$, +some graph on $n$ vertices has at least $n - \lfloor \log_2 n \rfloor - C$ distinct +maximal clique sizes. +-/ +@[category research solved, AMS 5] +theorem erdos_927.variants.spencer_lower_bound : + ∃ C : ℕ, ∀ n : ℕ, ∃ G : SimpleGraph (Fin n), + (graphCliqueSizes G).ncard + C ≥ n - Nat.log 2 n := by + sorry + +/-- +Moon–Moser upper bound [MoMo65]: $g(n) \leq n - \lfloor \log_2 n \rfloor$, i.e., +every graph on $n$ vertices has at most $n - \lfloor \log_2 n \rfloor$ distinct +maximal clique sizes. +-/ +@[category research solved, AMS 5] +theorem erdos_927.variants.moon_moser_upper_bound : + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + (graphCliqueSizes G).ncard ≤ n - Nat.log 2 n := by + sorry + +end Erdos927 diff --git a/FormalConjectures/ErdosProblems/928.lean b/FormalConjectures/ErdosProblems/928.lean new file mode 100644 index 0000000000..5488a0cb33 --- /dev/null +++ b/FormalConjectures/ErdosProblems/928.lean @@ -0,0 +1,94 @@ +/- +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.Nat.MaxPrimeFac +import FormalConjecturesForMathlib.Data.Set.Density + +/-! +# Erdős Problem 928 + +*Reference:* [erdosproblems.com/928](https://www.erdosproblems.com/928) + +*Related:* [Erdős Problem 370](https://www.erdosproblems.com/370) + +Let $\alpha, \beta \in (0,1)$ and let $P(n)$ denote the largest prime divisor of $n$. +Does the density of integers $n$ such that $P(n) < n^\alpha$ and $P(n+1) < (n+1)^\beta$ +exist? + +Erdős asked whether the events $P(n) < n^\alpha$ and $P(n+1) < (n+1)^\beta$ are independent, +in the sense that the density of $n$ satisfying both conditions equals +$\rho(1/\alpha) \cdot \rho(1/\beta)$, where $\rho$ is the Dickman function. + +Dickman [Di30] showed the density of smooth $n$, with largest prime factor $< n^\alpha$, +is $\rho(1/\alpha)$. + +Schinzel [Sc67b] showed that for infinitely many $n$, the largest prime factor of $n(n+1)$ +is at most $n^{O(1/\log \log n)}$. + +Teräväinen [Te18] proved the logarithmic density exists and equals +$\rho(1/\alpha) \rho(1/\beta)$. +Wang [Wa21] proved the natural density equals $\rho(1/\alpha) \rho(1/\beta)$ assuming the +Elliott–Halberstam conjecture for friable integers. + +[Er76d] Erdős, P., *Problems in number theory and combinatorics*. + +[ErPo78] Erdős, P. and Pomerance, C., *On the largest prime factors of n and n+1*. +Aequationes Math. **17** (1978), 311–321. + +[Di30] Dickman, K., *On the frequency of numbers containing prime factors of a certain +relative magnitude*. Ark. Mat. Astr. Fys. **22A** (1930), 1–14. + +[Sc67b] Schinzel, A., *On two theorems of Gelfond and some of their applications*. +Acta Arith. **13** (1967/68), 177–236. + +[Te18] Teräväinen, J., *On binary correlations of multiplicative functions*. Forum Math. +Sigma **6** (2018), e10. + +[Wa21] Wang, Z., *Three conjectures on P⁺(n) and P⁺(n+1) hold under the +Elliott–Halberstam conjecture for friable integers*. J. Number Theory **228** (2021), 1–11. +-/ + +open Set Filter + +namespace Erdos928 + +/-- The Dickman function $\rho : \mathbb{R} \to \mathbb{R}$, the unique continuous function +satisfying $\rho(u) = 1$ for $0 \le u \le 1$ and $u \rho'(u) = -\rho(u-1)$ for $u > 1$. -/ +opaque dickmanRho : ℝ → ℝ + +/-- The set of $n \ge 2$ with $P(n) < n^\alpha$ and $P(n+1) < (n+1)^\beta$. -/ +def smoothConsecutiveSet (α β : ℝ) : Set ℕ := + {n : ℕ | n ≥ 2 ∧ + (Nat.maxPrimeFac n : ℝ) < (n : ℝ) ^ α ∧ + (Nat.maxPrimeFac (n + 1) : ℝ) < ((n + 1 : ℕ) : ℝ) ^ β} + +/-- +Erdős Problem 928 [Er76d][ErPo78]: + +For $\alpha, \beta \in (0,1)$, the natural density of integers $n$ with $P(n) < n^\alpha$ and +$P(n+1) < (n+1)^\beta$ exists and equals $\rho(1/\alpha) \cdot \rho(1/\beta)$, where $\rho$ is +the Dickman function. This asserts independence of the smooth-number events for consecutive +integers. +-/ +@[category research open, AMS 11] +theorem erdos_928 : answer(sorry) ↔ + ∀ α β : ℝ, 0 < α → α < 1 → 0 < β → β < 1 → + (smoothConsecutiveSet α β).HasDensity + (dickmanRho (1 / α) * dickmanRho (1 / β)) := by + sorry + +end Erdos928 diff --git a/FormalConjectures/ErdosProblems/929.lean b/FormalConjectures/ErdosProblems/929.lean new file mode 100644 index 0000000000..0a7399595c --- /dev/null +++ b/FormalConjectures/ErdosProblems/929.lean @@ -0,0 +1,67 @@ +/- +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 929 + +For $k \geq 2$, let $S(k)$ be the minimal $x$ such that the set of $n$ with $n+1, \ldots, n+k$ +all $x$-smooth has positive upper density. Erdős conjectured that $S(k) \geq k^{1-o(1)}$. + +*Reference:* [erdosproblems.com/929](https://www.erdosproblems.com/929) + +[Er76d] Erdős, P., *Problems in number theory and combinatorics*. Proceedings of the Sixth +Manitoba Conference on Numerical Mathematics (1976), 35-58. + +[FGKMT18] Ford, K., Green, B., Konyagin, S., Maynard, J., Tao, T., +*Long gaps between primes*. Journal of the American Mathematical Society (2018), 65–105. +-/ + +namespace Erdos929 + +/-- An integer $m$ is $x$-smooth if all its prime factors are at most $x$. -/ +def IsSmooth (x m : ℕ) : Prop := + ∀ p ∈ m.primeFactors, p ≤ x + +/-- The set of $n$ such that $n+1, n+2, \ldots, n+k$ are all $x$-smooth. -/ +def smoothConsecutiveBlockSet (k x : ℕ) : Set ℕ := + {n : ℕ | ∀ i : ℕ, 1 ≤ i → i ≤ k → IsSmooth x (n + i)} + +/-- A set $S \subseteq \mathbb{N}$ has positive upper density: there exists $\delta > 0$ such that +$|S \cap [1, N]| / N \geq \delta$ for infinitely many $N$. -/ +def HasPositiveUpperDensity (S : Set ℕ) : Prop := + ∃ δ : ℝ, δ > 0 ∧ ∀ N₀ : ℕ, ∃ N : ℕ, N ≥ N₀ ∧ + ((S ∩ {i | 1 ≤ i ∧ i ≤ N}).ncard : ℝ) / (N : ℝ) ≥ δ + +/-- +Erdős Problem 929 [Er76d]: + +For $k \geq 2$, let $S(k)$ be the minimal $x$ such that the set of $n$ with +$n+1, \ldots, n+k$ all $x$-smooth has positive upper density. The conjecture is that +$S(k) \geq k^{1-o(1)}$, i.e., for every $\varepsilon > 0$ and all sufficiently large $k$, +if $x < k^{1-\varepsilon}$ then the set of $n$ with $n+1, \ldots, n+k$ all $x$-smooth does not +have positive upper density. +-/ +@[category research open, AMS 11] +theorem erdos_929 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ K : ℕ, ∀ k : ℕ, k ≥ K → + ∀ x : ℕ, (x : ℝ) < (k : ℝ) ^ (1 - ε) → + ¬HasPositiveUpperDensity (smoothConsecutiveBlockSet k x) := by + sorry + +end Erdos929 diff --git a/FormalConjectures/ErdosProblems/93.lean b/FormalConjectures/ErdosProblems/93.lean new file mode 100644 index 0000000000..fb712aba9a --- /dev/null +++ b/FormalConjectures/ErdosProblems/93.lean @@ -0,0 +1,47 @@ +/- +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 93 + +*Reference:* [erdosproblems.com/93](https://www.erdosproblems.com/93) + +If $n$ points in $\mathbb{R}^2$ are in convex position (vertices of a convex polygon), then they +determine at least $\lfloor n/2 \rfloor$ distinct distances. Proved by Altman. + +[Al63] Altman, E., _On a problem of P. Erdős_. Amer. Math. Monthly 70 (1963), 148-157. +-/ + +open scoped Classical +open EuclideanGeometry + +namespace Erdos93 + +/-- +Erdős Problem 93: If $n$ distinct points in $\mathbb{R}^2$ form a convex polygon, then they +determine at least $\lfloor n/2 \rfloor$ distinct distances. Proved by Altman [Al63]. +-/ +@[category research solved, AMS 52] +theorem erdos_93 + (A : Finset (EuclideanSpace ℝ (Fin 2))) + (hconv : ConvexIndep (↑A : Set (EuclideanSpace ℝ (Fin 2)))) + (hn : 2 ≤ A.card) : + A.card / 2 ≤ distinctDistances A := by + sorry + +end Erdos93 diff --git a/FormalConjectures/ErdosProblems/933.lean b/FormalConjectures/ErdosProblems/933.lean new file mode 100644 index 0000000000..2e8ae352ce --- /dev/null +++ b/FormalConjectures/ErdosProblems/933.lean @@ -0,0 +1,66 @@ +/- +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 933 + +Erdős asked whether the limsup of the ratio of the {2,3}-smooth part of n(n+1) +to n·log(n) is infinite. + +Stefan Steinerberger noted a simple proof that 2^k · 3^l > n · log n holds for +infinitely many n, by taking n = 2^{3^r}. + +*Reference:* [erdosproblems.com/933](https://www.erdosproblems.com/933) + +[Er76d] Erdős, P., _Problems and results on number theoretic properties of consecutive +integers and related questions_. Proceedings of the Fifth Manitoba Conference on Numerical +Mathematics (Univ. Manitoba, Winnipeg, Man., 1975) (1976), 25-44. +-/ + +open Real + +namespace Erdos933 + +/-- +The $\{2,3\}$-smooth part of a natural number $n$, i.e., $2^{v_2(n)} \cdot 3^{v_3(n)}$, +where $v_p$ denotes the $p$-adic valuation. +-/ +noncomputable def smoothPart23 (n : ℕ) : ℕ := + 2 ^ padicValNat 2 n * 3 ^ padicValNat 3 n + +/-- +Erdős Problem 933 [Er76d]: + +If $n(n+1) = 2^k \cdot 3^l \cdot m$ where $\gcd(m, 6) = 1$, is it true that +$$\limsup_{n \to \infty} \frac{2^k \cdot 3^l}{n \log n} = \infty?$$ + +Equivalently: for every $C > 0$, there exist arbitrarily large $n$ such that +the $\{2,3\}$-smooth part of $n(n+1)$ exceeds $C \cdot n \cdot \log n$. + +Mahler proved that $2^k \cdot 3^l < n^{1+o(1)}$. +Erdős wrote that 'it is easy to see' that for infinitely many $n$, +$2^k \cdot 3^l > n \cdot \log n$. +-/ +@[category research open, AMS 11] +theorem erdos_933 : answer(sorry) ↔ + ∀ C : ℝ, C > 0 → + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + (smoothPart23 (n * (n + 1)) : ℝ) > C * (n : ℝ) * Real.log (n : ℝ) := by + sorry + +end Erdos933 diff --git a/FormalConjectures/ErdosProblems/934.lean b/FormalConjectures/ErdosProblems/934.lean new file mode 100644 index 0000000000..5ed6015558 --- /dev/null +++ b/FormalConjectures/ErdosProblems/934.lean @@ -0,0 +1,95 @@ +/- +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 934 + +*Reference:* [erdosproblems.com/934](https://www.erdosproblems.com/934) + +Let $h_t(d)$ be minimal such that every graph $G$ with $h_t(d)$ edges and +maximal degree $\leq d$ contains two edges whose shortest path between them +has length $\geq t$. + +Estimate $h_t(d)$. + +A problem of Erdős and Nešetřil [Er88]. Known: +- $h_t(d) \leq 2d^t$ always and $h_1(d) = d + 1$ +- $h_2(d) \leq \frac{5}{4}d^2 + 1$ (Chung–Gyárfás–Tuza–Trotter [CGTT90]) +- $h_t(d) \leq \frac{3}{2}d^t + 1$ for all $t \geq 1$ [CCJK22] + +Cambie–Cames van Batenburg–de Joannis de Verclos–Kang [CCJK22] conjecture +that, for all $t \geq 3$, $h_t(d) \sim d^t$ as $d \to \infty$: +$h_t(d) \leq (1 + o(1))d^t$ for all $d$ and +$h_t(d) \geq (1 - o(1))d^t$ for infinitely many $d$. + +[Er88] Erdős, P. and Nešetřil, J., _Irregularities of partitions_ (1989). + +[BBPP83] Bermond, J.-C., Bond, J., Paoli, M., and Peyrat, C., _Graphs and Interconnection +Networks: Diameter and Vulnerability_. Surveys in Combinatorics (1983), 1–30. + +[CGTT90] Chung, F.R.K., Gyárfás, A., Tuza, Z., and Trotter, W.T., _The maximum number of edges +in $2K_2$-free graphs of bounded degree_. Discrete Mathematics (1990). + +[CCJK22] Cambie, S., Cames van Batenburg, W., de Joannis de Verclos, R., and Kang, R.J., +_Packing graphs of bounded codegree_. SIAM J. Discrete Math. (2022), 939–950. +-/ + +open SimpleGraph Classical + +namespace Erdos934 + +/-- Two edges $e_1$, $e_2$ in a simple graph $G$ are at distance at least $t$: +for every endpoint $u$ of $e_1$ and $v$ of $e_2$ that lie in the same connected +component, $t \leq \operatorname{dist}_G(u, v)$. (Endpoints in different components are +considered infinitely far apart and satisfy any finite distance bound.) -/ +def EdgesAtDist {V : Type*} (G : SimpleGraph V) (e₁ e₂ : Sym2 V) (t : ℕ) : Prop := + ∀ u, u ∈ e₁ → ∀ v, v ∈ e₂ → G.Reachable u v → t ≤ G.dist u v + +/-- Erdős Problem 934, upper bound direction of the asymptotic conjecture [CCJK22]: +For all $t \geq 3$ and $\varepsilon > 0$, for all sufficiently large $d$, every finite graph +with maximum degree $\leq d$ and more than $(1 + \varepsilon) \cdot d^t$ edges contains two +distinct edges at distance $\geq t$. -/ +@[category research open, AMS 5] +theorem erdos_934 : + ∀ t : ℕ, 3 ≤ t → + ∀ ε : ℝ, 0 < ε → + ∃ D₀ : ℕ, ∀ d : ℕ, D₀ ≤ d → + ∀ (V : Type*) [Fintype V] (G : SimpleGraph V), + G.maxDegree ≤ d → + (G.edgeFinset.card : ℝ) > (1 + ε) * (d : ℝ) ^ t → + ∃ e₁ ∈ G.edgeSet, ∃ e₂ ∈ G.edgeSet, + e₁ ≠ e₂ ∧ EdgesAtDist G e₁ e₂ t := by + sorry + +/-- Erdős Problem 934, lower bound direction of the asymptotic conjecture [CCJK22]: +For all $t \geq 3$ and $\varepsilon > 0$, there are infinitely many $d$ for which some graph +with maximum degree $\leq d$ and at least $(1 - \varepsilon) \cdot d^t$ edges has no pair of +distinct edges at distance $\geq t$. -/ +@[category research open, AMS 5] +theorem erdos_934.variants.lower_bound : + ∀ t : ℕ, 3 ≤ t → + ∀ ε : ℝ, 0 < ε → + ∀ D₀ : ℕ, ∃ d : ℕ, D₀ ≤ d ∧ + ∃ (n : ℕ) (G : SimpleGraph (Fin n)), + G.maxDegree ≤ d ∧ + (G.edgeFinset.card : ℝ) ≥ (1 - ε) * (d : ℝ) ^ t ∧ + ¬∃ e₁ ∈ G.edgeSet, ∃ e₂ ∈ G.edgeSet, + e₁ ≠ e₂ ∧ EdgesAtDist G e₁ e₂ t := by + sorry + +end Erdos934 diff --git a/FormalConjectures/ErdosProblems/935.lean b/FormalConjectures/ErdosProblems/935.lean new file mode 100644 index 0000000000..23b1835ac3 --- /dev/null +++ b/FormalConjectures/ErdosProblems/935.lean @@ -0,0 +1,108 @@ +/- +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 935 + +This problem concerns the powerful (2-full) part $Q_2$ of products of consecutive integers +$n(n+1)\cdots(n+\ell)$. It asks whether $Q_2 < n^{2+\varepsilon}$ for all sufficiently large $n$, +and whether $Q_2 / n^{\ell+1} \to 0$ as $n \to \infty$. + +The second part is essentially the same (up to constants) as Problem 367. +The ABC conjecture implies a positive answer to the third question. + +*Reference:* [erdosproblems.com/935](https://www.erdosproblems.com/935) + +*See also:* [Problem 367](https://www.erdosproblems.com/367), +[OEIS A057521](https://oeis.org/A057521), +[OEIS A389244](https://oeis.org/A389244) + +[Er76d] Erdős, P., _Problems and results on number theoretic properties of consecutive +integers and related questions_. Proceedings of the Fifth Manitoba Conference on Numerical +Mathematics (Univ. Manitoba, Winnipeg, Man., 1975) (1976), 25-44. + +[Fe26] Feng, T. et al., _Semi-Autonomous Mathematics Discovery with Gemini: A Case Study on +the Erdős Problems_. arXiv:2601.22401 (2026). +-/ + +open Finset + +open scoped BigOperators Real + +namespace Erdos935 + +/-- The powerful (2-full) part of a natural number $n$: the product of all prime +power factors $p^a$ where $a \geq 2$. -/ +noncomputable def powerfulPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) + +/-- +Erdős Problem 935, Part 1: + +Is it true that for every $\varepsilon > 0$ and $\ell \geq 1$, if $n$ is sufficiently large then +$$Q_2(n(n+1)\cdots(n+\ell)) < n^{2+\varepsilon}?$$ +-/ +@[category research open, AMS 11] +theorem erdos_935 : + answer(sorry) ↔ + ∀ ℓ : ℕ, 1 ≤ ℓ → + ∀ ε : ℝ, 0 < ε → + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + (powerfulPart (∏ i ∈ Finset.range (ℓ + 1), (n + i)) : ℝ) < + (n : ℝ) ^ ((2 : ℝ) + ε) := by + sorry + +/-- +Erdős Problem 935, Part 2 (resolved): + +For every $\ell \geq 2$, $\limsup_{n \to \infty} Q_2(n(n+1)\cdots(n+\ell))/n^2 = \infty$. +This was proved via solutions to the Pell equation $x^2 - 8y^2 = 1$. +Formulated as: for every $M$ and $N$, there exists $n \geq N$ such that +$Q_2(n(n+1)\cdots(n+\ell)) > M \cdot n^2$. +-/ +@[category research solved, AMS 11] +theorem erdos_935.variants.part2 : + ∀ ℓ : ℕ, 2 ≤ ℓ → + ∀ M : ℝ, ∀ N : ℕ, + ∃ n : ℕ, N ≤ n ∧ + (powerfulPart (∏ i ∈ Finset.range (ℓ + 1), (n + i)) : ℝ) > + M * ((n : ℝ) ^ (2 : ℕ)) := by + sorry + +/-- +Erdős Problem 935, Part 3: + +Is it true that for every $\ell \geq 2$, +$\lim_{n \to \infty} Q_2(n(n+1)\cdots(n+\ell))/n^{\ell+1} = 0$? +Formulated as: for every $\varepsilon > 0$, +$Q_2(n(n+1)\cdots(n+\ell)) < \varepsilon \cdot n^{\ell+1}$ for all sufficiently large $n$. + +The ABC conjecture implies a positive answer to this question. +-/ +@[category research open, AMS 11] +theorem erdos_935.variants.part3 : + answer(sorry) ↔ + ∀ ℓ : ℕ, 2 ≤ ℓ → + ∀ ε : ℝ, 0 < ε → + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → + (powerfulPart (∏ i ∈ Finset.range (ℓ + 1), (n + i)) : ℝ) < + ε * ((n : ℝ) ^ ((ℓ : ℝ) + 1)) := by + sorry + +end Erdos935 diff --git a/FormalConjectures/ErdosProblems/937.lean b/FormalConjectures/ErdosProblems/937.lean new file mode 100644 index 0000000000..bce5adbb3d --- /dev/null +++ b/FormalConjectures/ErdosProblems/937.lean @@ -0,0 +1,97 @@ +/- +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.Nat.Full + +/-! +# Erdős Problem 937 + +*Reference:* [erdosproblems.com/937](https://www.erdosproblems.com/937) + +Are there infinitely many four-term arithmetic progressions of coprime powerful +numbers (i.e. if $p \mid n$ then $p^2 \mid n$)? + +This was proved in the affirmative by Bajpai, Bennett, and Chan [BBC24]. + +[Er76d] Erdős, P., _Problems and results on number theoretic properties of consecutive +integers and related questions_. Proceedings of the Fifth Manitoba Conference on +Numerical Mathematics (Univ. Manitoba, Winnipeg, Man., 1975) (1976), 25–44. + +[BBC24] Bajpai, P., Bennett, M.A., and Chan, T.H., _Arithmetic progressions in +squarefull numbers_. Int. J. Number Theory (2024), 19–45. +-/ + +open Nat + +namespace Erdos937 + +/-- +Erdős Problem 937 (proved by Bajpai–Bennett–Chan [BBC24]): + +There are infinitely many four-term arithmetic progressions of pairwise coprime +powerful numbers. Formulated as: for every $N$, there exist $a > 0$, $d > 0$ with +$a \geq N$ such that $a$, $a+d$, $a+2d$, $a+3d$ are all powerful and pairwise coprime. +-/ +@[category research solved, AMS 11] +theorem erdos_937 : + answer(True) ↔ + ∀ N : ℕ, ∃ a d : ℕ, N ≤ a ∧ 0 < a ∧ 0 < d ∧ + a.Powerful ∧ (a + d).Powerful ∧ + (a + 2 * d).Powerful ∧ (a + 3 * d).Powerful ∧ + Nat.Coprime a (a + d) ∧ + Nat.Coprime a (a + 2 * d) ∧ + Nat.Coprime a (a + 3 * d) ∧ + Nat.Coprime (a + d) (a + 2 * d) ∧ + Nat.Coprime (a + d) (a + 3 * d) ∧ + Nat.Coprime (a + 2 * d) (a + 3 * d) := by + sorry + +/-- +Variant (proved by Bajpai–Bennett–Chan [BBC24]): + +There are infinitely many three-term arithmetic progressions of pairwise coprime +3-powerful numbers (i.e. if $p \mid n$ then $p^3 \mid n$). +-/ +@[category research solved, AMS 11] +theorem erdos_937_three_powerful_three_term : + answer(True) ↔ + ∀ N : ℕ, ∃ a d : ℕ, N ≤ a ∧ 0 < a ∧ 0 < d ∧ + Full 3 a ∧ Full 3 (a + d) ∧ Full 3 (a + 2 * d) ∧ + Nat.Coprime a (a + d) ∧ + Nat.Coprime a (a + 2 * d) ∧ + Nat.Coprime (a + d) (a + 2 * d) := by + sorry + +/-- +Variant (Erdős conjecture [Er76d], proved conditionally on the ABC conjecture by +Bajpai–Bennett–Chan [BBC24]): + +For $r \geq 4$, there are only finitely many three-term arithmetic progressions of +pairwise coprime $r$-powerful numbers. +-/ +@[category research open, AMS 11] +theorem erdos_937_r_powerful_three_term : + answer(sorry) ↔ + ∀ r : ℕ, 4 ≤ r → + {x : ℕ × ℕ | 0 < x.1 ∧ 0 < x.2 ∧ + Full r x.1 ∧ Full r (x.1 + x.2) ∧ Full r (x.1 + 2 * x.2) ∧ + Nat.Coprime x.1 (x.1 + x.2) ∧ + Nat.Coprime x.1 (x.1 + 2 * x.2) ∧ + Nat.Coprime (x.1 + x.2) (x.1 + 2 * x.2)}.Finite := by + sorry + +end Erdos937 diff --git a/FormalConjectures/ErdosProblems/94.lean b/FormalConjectures/ErdosProblems/94.lean new file mode 100644 index 0000000000..0459bf2d86 --- /dev/null +++ b/FormalConjectures/ErdosProblems/94.lean @@ -0,0 +1,116 @@ +/- +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 94 + +*Reference:* [erdosproblems.com/94](https://www.erdosproblems.com/94) + +For $n$ points in convex position with distance multiplicities $f(u_i)$, the sum +$\sum_i f(u_i)^2$ is $O(n^3)$. Proved by Lefmann and Thiele [LeTh95] under the weaker +assumption that no three points are collinear. + +Erdős and Fishburn conjectured that $\sum f(u_i)^2$ is maximized by the regular +$n$-gon (for sufficiently large $n$). + +See also Problem 95, which is the general (non-convex) version with the weaker bound +$O(n^{3+\varepsilon})$. + +Erdős offered £25 for this problem [Er92e]. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44-48. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Congressus Numerantium 107 (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) + +[LeTh95] Lefmann, H. and Thiele, T., _Point sets with distinct distances_. +Combinatorica 15 (1995), 379–408. +-/ + +open EuclideanGeometry + +namespace Erdos94 + +/-- The number of ordered pairs `(a, b)` in `A` with `a ≠ b` and `dist a b = d`. -/ +noncomputable def distCount (A : Finset ℝ²) (d : ℝ) : ℕ := + (A.offDiag.filter fun p => dist p.1 p.2 = d).card + +/-- The sum $\sum_i g(u_i)^2$ over distinct distances $u_i$, where $g(u_i)$ counts +ordered pairs at distance $u_i$. This equals $4 \sum_i f(u_i)^2$ where $f$ counts +unordered pairs, so an $O(n^3)$ bound on this sum is equivalent. -/ +noncomputable def sumSqDistCount (A : Finset ℝ²) : ℕ := + (A.offDiag.image fun p => dist p.1 p.2).sum fun d => distCount A d ^ 2 + +/-- The vertices of a regular `n`-gon inscribed in the unit circle. -/ +noncomputable def regularNGonVertices (n : ℕ) : Finset ℝ² := + Finset.image (fun k : Fin n => + (EuclideanSpace.equiv (Fin 2) ℝ).symm + ![Real.cos (2 * Real.pi * ↑k / ↑n), Real.sin (2 * Real.pi * ↑k / ↑n)]) + Finset.univ + +/-- +Suppose $n$ points in $\mathbb{R}^2$ are in convex position (they form the vertices of +a convex polygon). Let $\{u_1, \ldots, u_t\}$ be the set of distinct pairwise +distances, and let $f(u_i)$ denote the number of pairs at distance $u_i$. Then +$$\sum_i f(u_i)^2 \ll n^3.$$ + +This was proved by Lefmann and Thiele [LeTh95] under the weaker +assumption that no three points are collinear (see `erdos_94_no_three_collinear`). +-/ +@[category research solved, AMS 5 52] +theorem erdos_94 : + ∃ C : ℝ, C > 0 ∧ + ∀ A : Finset ℝ², + ConvexIndep (↑A : Set ℝ²) → + (sumSqDistCount A : ℝ) ≤ C * (A.card : ℝ) ^ 3 := by + sorry + +/-- +Stronger version of Erdős Problem 94: the $O(n^3)$ bound on $\sum_i f(u_i)^2$ holds +under the weaker hypothesis that no three points are collinear. This is the result +actually proved by Lefmann and Thiele [LeTh95]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_94_no_three_collinear : + ∃ C : ℝ, C > 0 ∧ + ∀ A : Finset ℝ², + NonTrilinear (↑A : Set ℝ²) → + (sumSqDistCount A : ℝ) ≤ C * (A.card : ℝ) ^ 3 := by + sorry + +/-- +Erdős–Fishburn conjecture: for sufficiently large $n$, the sum $\sum_i f(u_i)^2$ over +distance multiplicities of $n$ points in convex position is maximized by the vertices +of a regular $n$-gon. +-/ +@[category research open, AMS 5 52] +theorem erdos_94_fishburn : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ A : Finset ℝ², A.card = n → + ConvexIndep (↑A : Set ℝ²) → + sumSqDistCount A ≤ sumSqDistCount (regularNGonVertices n) := by + sorry + +end Erdos94 diff --git a/FormalConjectures/ErdosProblems/941.lean b/FormalConjectures/ErdosProblems/941.lean new file mode 100644 index 0000000000..9b7766bcc2 --- /dev/null +++ b/FormalConjectures/ErdosProblems/941.lean @@ -0,0 +1,58 @@ +/- +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 941 + +A joint problem of Erdős and Ivić, posed in the Oberwolfach problem book (1986) [Ob1]. +Heath-Brown proved that every sufficiently large integer is the sum of at most three powerful +numbers (numbers whose prime factors all appear with exponent ≥ 2). + +See also Problem 1107, which generalizes this to $r$-powerful numbers for $r \geq 3$, +and Problem 940. + +*Reference:* [erdosproblems.com/941](https://www.erdosproblems.com/941) + +[Er76d] Erdős, P., _Problems and results on number theoretic properties of consecutive +integers and related questions_. Proceedings of the Fifth Manitoba Conference on Numerical +Mathematics (Univ. Manitoba, Winnipeg, Man., 1975) (1976), 25-44. + +[He88] Heath-Brown, D.R., _Ternary quadratic forms and sums of three square-full numbers_. +Séminaire de Théorie des Nombres, Paris 1986–87 (1988), 137–163. + +[Ob1] Oberwolfach problem session (1986). + +OEIS: [A056828](https://oeis.org/A056828) +-/ + +namespace Erdos941 + +/-- +Erdős Problem 941 (proved by Heath-Brown [He88]): + +Are all large integers the sum of at most three powerful numbers (i.e. if $p \mid n$ +then $p^2 \mid n$)? That is, does there exist $N_0$ such that for all $n \geq N_0$, there +exist powerful numbers $a, b, c$ (possibly zero) with $n = a + b + c$? +-/ +@[category research solved, AMS 11] +theorem erdos_941 : answer(True) ↔ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ a b c : ℕ, n = a + b + c ∧ + a.Powerful ∧ b.Powerful ∧ c.Powerful := by + sorry + +end Erdos941 diff --git a/FormalConjectures/ErdosProblems/947.lean b/FormalConjectures/ErdosProblems/947.lean new file mode 100644 index 0000000000..7f2cea3457 --- /dev/null +++ b/FormalConjectures/ErdosProblems/947.lean @@ -0,0 +1,51 @@ +/- +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 947 + +There is no exact covering system — that is, a finite collection of congruence classes +$a_i \pmod{n_i}$ with distinct moduli $n_i \geq 2$ such that every integer belongs to +exactly one of these congruence classes. This was proved independently by +Mirsky–Newman and Davenport–Rado. + +*References:* +- [erdosproblems.com/947](https://www.erdosproblems.com/947) +- [Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. + Number Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. +-/ + +namespace Erdos947 + +/-- +There is no exact covering system with distinct moduli. +That is, there is no finite collection of congruence classes $a_i \pmod{n_i}$ with +distinct moduli $n_i \geq 2$ such that every integer belongs to exactly one of +these congruence classes. + +This was proved independently by Mirsky-Newman and Davenport-Rado. +-/ +@[category research solved, AMS 11] +theorem erdos_947 : + ¬ ∃ (k : ℕ) (a : Fin k → ℤ) (n : Fin k → ℕ), + (∀ i, 2 ≤ n i) ∧ + (Function.Injective n) ∧ + (∀ x : ℤ, ∃! i : Fin k, (↑(n i) : ℤ) ∣ (x - a i)) := by + sorry + +end Erdos947 diff --git a/FormalConjectures/ErdosProblems/948.lean b/FormalConjectures/ErdosProblems/948.lean new file mode 100644 index 0000000000..01510dc751 --- /dev/null +++ b/FormalConjectures/ErdosProblems/948.lean @@ -0,0 +1,50 @@ +/- +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 948 + +*Reference:* [erdosproblems.com/948](https://www.erdosproblems.com/948) + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +Erdős initially asked whether this is possible with the set being monochromatic, +but Galvin showed that this is not always possible. This is a variant of +Hindman's theorem (see [532]). +-/ + +open Finset BigOperators + +namespace Erdos948 + +/-- Is there a function $f : \mathbb{N} \to \mathbb{N}$ and $k \in \mathbb{N}$ such that for any +$k$-colouring $\chi$ of the natural numbers, there is a strictly increasing sequence $a$ with +$a(n) < f(n)$ for infinitely many $n$, and the finite subset sums of the sequence do not achieve +all $k$ colours? -/ +@[category research open, AMS 5] +theorem erdos_948 : answer(sorry) ↔ + ∃ (f : ℕ → ℕ) (k : ℕ), 0 < k ∧ + ∀ (χ : ℕ → Fin k), + ∃ (a : ℕ → ℕ), StrictMono a ∧ + Set.Infinite {n : ℕ | a n < f n} ∧ + ∃ (c : Fin k), ∀ (S : Finset ℕ), S.Nonempty → + χ (∑ i ∈ S, a i) ≠ c := by + sorry + +end Erdos948 diff --git a/FormalConjectures/ErdosProblems/95.lean b/FormalConjectures/ErdosProblems/95.lean new file mode 100644 index 0000000000..3d59f31057 --- /dev/null +++ b/FormalConjectures/ErdosProblems/95.lean @@ -0,0 +1,82 @@ +/- +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 95 + +*Reference:* [erdosproblems.com/95](https://www.erdosproblems.com/95) + +For $n$ points in $\mathbb{R}^2$ with distance multiplicities $f(u_i)$, the sum +$\sum_i f(u_i)^2 \ll_\varepsilon n^{3+\varepsilon}$ for every $\varepsilon > 0$. +Proved by Guth and Katz (2015) with the stronger bound $O(n^3 \log n)$. +This problem carried a $500 prize. See also Problem 94. + +[Er92e] Erdős, P., _Some unsolved problems in geometry, number theory and combinatorics_. +Eureka (1992), 44–48. + +[Er95] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Combinatorics '94 (Catania), Congressus Numerantium 107 (1995). + +[Er97c] Erdős, P., _Some recent problems and results in graph theory_. Discrete Math. +**164** (1997), 81–85. + +[Er97f] Erdős, P., _Some of my new and almost new problems and results in combinatorial +geometry_. (1997) + +[Al63] Altman, E., _On a problem of P. Erdős_. Amer. Math. Monthly 70 (1963), 148–157. + +[GuKa15] Guth, L. and Katz, N.H., _On the Erdős distinct distances problem in the plane_. +Ann. of Math. (2) **181** (2015), 155–190. +-/ + +open scoped Classical + +namespace Erdos95 + +/-- +The set of distinct distances determined by a finite point set $P$ in $\mathbb{R}^2$. +-/ +noncomputable def distinctDistances (P : Finset (EuclideanSpace ℝ (Fin 2))) : Finset ℝ := + ((P ×ˢ P).filter (fun pq => pq.1 ≠ pq.2)).image (fun pq => dist pq.1 pq.2) + +/-- +The number of ordered pairs $(p, q)$ from $P$ with $p \neq q$ and $\operatorname{dist}(p, q) = d$. +-/ +noncomputable def distMultiplicity (P : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((P ×ˢ P).filter (fun pq => pq.1 ≠ pq.2 ∧ dist pq.1 pq.2 = d)).card + +/-- +Let $x_1, \ldots, x_n \in \mathbb{R}^2$ determine the set of distances $\{u_1, \ldots, u_t\}$. +Suppose $u_i$ appears as the distance between $f(u_i)$ many pairs of points. Then for all +$\varepsilon > 0$, +$$\sum_i f(u_i)^2 \ll_\varepsilon n^{3+\varepsilon}.$$ + +This was proved by Guth and Katz (2015) who showed the stronger bound +$\sum_i f(u_i)^2 \ll n^3 \log n$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_95 : + ∀ ε : ℝ, ε > 0 → + ∃ C : ℝ, C > 0 ∧ + ∀ (P : Finset (EuclideanSpace ℝ (Fin 2))), + ((distinctDistances P).sum + (fun d => (distMultiplicity P d) ^ 2) : ℝ) ≤ + C * (P.card : ℝ) ^ ((3 : ℝ) + ε) := by + sorry + +end Erdos95 diff --git a/FormalConjectures/ErdosProblems/950.lean b/FormalConjectures/ErdosProblems/950.lean new file mode 100644 index 0000000000..f3d130dc50 --- /dev/null +++ b/FormalConjectures/ErdosProblems/950.lean @@ -0,0 +1,79 @@ +/- +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 950 + +*Reference:* [erdosproblems.com/950](https://www.erdosproblems.com/950) + +Let $f(n) = \sum_{p < n} \frac{1}{n - p}$, where the sum is over primes $p < n$. + +Is it true that $\liminf f(n) = 1$ and $\limsup f(n) = \infty$? +Is it true that $f(n) = o(\log \log n)$? + +This function was considered by de Bruijn, Erdős, and Turán, who showed that +$\sum_{n < x} f(n) \sim \sum_{n < x} f(n)^2 \sim x$. + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. +-/ + +namespace Erdos950 + +/-- The function $f(n) = \sum_{p < n} \frac{1}{n - p}$, summing over primes $p$ less than $n$. -/ +noncomputable def f (n : ℕ) : ℝ := + ((Finset.range n).filter Nat.Prime).sum (fun p => 1 / ((n : ℝ) - (p : ℝ))) + +/-- +**Erdős Problem 950** — Part 1 [Er77c]: +Is it true that $\liminf_{n \to \infty} f(n) = 1$? + +Equivalently: for every $\varepsilon > 0$, + (a) $f(n) > 1 - \varepsilon$ for all sufficiently large $n$, and + (b) $f(n) < 1 + \varepsilon$ for infinitely many $n$. +-/ +@[category research open, AMS 11] +theorem erdos_950 : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + (∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → f n > 1 - ε) ∧ + (∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ f n < 1 + ε) := by + sorry + +/-- +**Erdős Problem 950** — Part 2 [Er77c]: +Is it true that $\limsup_{n \to \infty} f(n) = \infty$? + +Equivalently: for every $M$, there exist arbitrarily large $n$ with $f(n) > M$. +-/ +@[category research open, AMS 11] +theorem erdos_950.variants.limsup : answer(sorry) ↔ + ∀ M : ℝ, ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ f n > M := by + sorry + +/-- +**Erdős Problem 950** — Part 3 [Er77c]: +Is it true that $f(n) = o(\log \log n)$, i.e., $f(n) / \log(\log n) \to 0$ as $n \to \infty$? +-/ +@[category research open, AMS 11] +theorem erdos_950.variants.little_o : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + f n < ε * Real.log (Real.log (n : ℝ)) := by + sorry + +end Erdos950 diff --git a/FormalConjectures/ErdosProblems/953.lean b/FormalConjectures/ErdosProblems/953.lean new file mode 100644 index 0000000000..0d6e583252 --- /dev/null +++ b/FormalConjectures/ErdosProblems/953.lean @@ -0,0 +1,103 @@ +/- +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 953 + +*Reference:* [erdosproblems.com/953](https://www.erdosproblems.com/953) + +Let $A \subset \{x \in \mathbb{R}^2 : |x| < r\}$ be a measurable set with no integer distances, +that is, such that $|a - b| \notin \mathbb{Z}$ for any distinct $a, b \in A$. How large can the +measure of $A$ be? + +A problem of Erdős and Sárközy. The trivial upper bound is $O(r)$. Koizumi and +Kovac observed that Sárközy's lower bound from [466] can be adapted to give a +lower bound of $\gg_\varepsilon r^{1/2-\varepsilon}$ for all $\varepsilon > 0$. + +See also [465] for a similar problem (concerning upper bounds) and [466] for a +similar problem (concerning lower bounds). + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. +-/ + +open MeasureTheory + +namespace Erdos953 + +/-- A set in $\mathbb{R}^2$ has no integer distances if for every pair of distinct points +$a, b$ in the set, the Euclidean distance $|a - b|$ is not an integer. -/ +def NoIntegerDistances (A : Set (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ a ∈ A, ∀ b ∈ A, a ≠ b → ∀ n : ℤ, dist a b ≠ ↑n + +/-- The supremum of the Lebesgue measure of measurable subsets of $B(0, r)$ in $\mathbb{R}^2$ +with no integer distances. -/ +noncomputable def maxNoIntDistMeasure (r : ℝ) : ℝ := + sSup ((fun A => (volume A).toReal) '' + {A : Set (EuclideanSpace ℝ (Fin 2)) | MeasurableSet A ∧ + A ⊆ Metric.ball 0 r ∧ + NoIntegerDistances A}) + +/-- +Erdős Problem 953 [Er77c]: How large can the Lebesgue measure of a measurable set +$A \subset B(0, r) \subset \mathbb{R}^2$ with no integer distances be? +The trivial upper bound is $O(r)$ and a lower bound of +$\gg_\varepsilon r^{1/2-\varepsilon}$ is known. +-/ +@[category research open, AMS 28 52] +theorem erdos_953 : + ∀ (r : ℝ), 0 < r → + maxNoIntDistMeasure r = (answer(sorry) : ℝ → ℝ) r := by + sorry + +/-- +Erdős Problem 953 — trivial upper bound: +The Lebesgue measure of any measurable set $A \subset B(0, r)$ in $\mathbb{R}^2$ with no integer +distances is $O(r)$. That is, there exists an absolute constant $C > 0$ such that +for all $r > 0$ and all such $A$, $\mu(A) \leq C \cdot r$. +-/ +@[category research solved, AMS 28 52] +theorem erdos_953.variants.upper : + ∃ C : ℝ, 0 < C ∧ + ∀ (r : ℝ), 0 < r → + ∀ (A : Set (EuclideanSpace ℝ (Fin 2))), + MeasurableSet A → + A ⊆ Metric.ball 0 r → + NoIntegerDistances A → + (volume A).toReal ≤ C * r := by + sorry + +/-- +Erdős Problem 953 — lower bound: +For every $\varepsilon > 0$, there exists $c > 0$ such that for all sufficiently large $r$, +there exists a measurable set $A \subset B(0, r)$ in $\mathbb{R}^2$ with no integer distances +and $\mu(A) \geq c \cdot r^{1/2 - \varepsilon}$. +-/ +@[category research solved, AMS 28 52] +theorem erdos_953.variants.lower (ε : ℝ) (hε : 0 < ε) : + ∃ c : ℝ, 0 < c ∧ + ∃ r₀ : ℝ, 0 < r₀ ∧ + ∀ (r : ℝ), r₀ ≤ r → + ∃ (A : Set (EuclideanSpace ℝ (Fin 2))), + MeasurableSet A ∧ + A ⊆ Metric.ball 0 r ∧ + NoIntegerDistances A ∧ + (volume A).toReal ≥ c * r ^ ((1 : ℝ) / 2 - ε) := by + sorry + +end Erdos953 diff --git a/FormalConjectures/ErdosProblems/954.lean b/FormalConjectures/ErdosProblems/954.lean new file mode 100644 index 0000000000..e1eb0b1e98 --- /dev/null +++ b/FormalConjectures/ErdosProblems/954.lean @@ -0,0 +1,92 @@ +/- +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 954 + +*Reference:* [erdosproblems.com/954](https://www.erdosproblems.com/954) + +Let $0 = a_0 < a_1 < a_2 < \cdots$ be the Rosen sequence, where each $a_{k+1}$ is the +smallest integer $n$ such that the number of pairs $(i,j)$ with $0 \le i \le j \le k$, +$j \ge 1$, and $a_i + a_j \le n$ is strictly less than $n$. Is the total pair count +$R(x) = \#\{(i,j) : i \le j,\, j \ge 1,\, a_i + a_j \le x\}$ equal to +$x + O(x^{1/4 + o(1)})$? + +[Er77c] Erdős, P., _Problems and results on combinatorial number theory. III._. Number Theory Day +(Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. +-/ + +open Finset BigOperators Filter + +namespace Erdos954 + +/-- +Count of pairs $(i,j)$ with $1 \le j \le k$, $0 \le i \le j$, and $a(i) + a(j) \le n$. +Used in the recursive definition of the Rosen sequence. +-/ +def rosenPairCount (a : ℕ → ℕ) (k n : ℕ) : ℕ := + ∑ j ∈ Finset.range (k + 1), + if j = 0 then 0 + else ((Finset.range (j + 1)).filter fun i => a i + a j ≤ n).card + +/-- +Total count of pairs $(i,j)$ with $i \le j$, $j \ge 1$, from the full infinite +sequence, such that $a(i) + a(j) \le x$. For a strictly increasing sequence +on $\mathbb{N}$, $a(j) \ge j$, so restricting $j \le x$ suffices. +-/ +def rosenPairCountTotal (a : ℕ → ℕ) (x : ℕ) : ℕ := + ∑ j ∈ Finset.range (x + 1), + if j = 0 then 0 + else ((Finset.range (j + 1)).filter fun i => a i + a j ≤ x).card + +/-- +The Rosen sequence property: $a(0) = 0$, the sequence is strictly increasing, +and each $a(k+1)$ is the smallest integer $n$ such that the pair count with +respect to the first $k+1$ terms is strictly less than $n$. +-/ +def IsRosenSequence (a : ℕ → ℕ) : Prop := + a 0 = 0 ∧ StrictMono a ∧ + ∀ k, (∀ m, m < a (k + 1) → m ≤ rosenPairCount a k m) ∧ + rosenPairCount a k (a (k + 1)) < a (k + 1) + +/-- +Erdős Problem 954 [Er77c, p.71]: + +Let $0 = a_0 < a_1 < a_2 < \cdots$ be the sequence defined by $a_0 = 0$ and $a_{k+1}$ is +the smallest integer $n$ for which the number of pairs $(i,j)$ with +$0 \le i \le j \le k$, $j \ge 1$, and $a_i + a_j \le n$ is strictly less than $n$. + +The sequence begins $0, 1, 3, 5, 9, 13, 17, 24, 31, 38, 45, \ldots$ (OEIS A390642). + +Is the total pair count $R(x) = \#\{(i,j) : i \le j,\, j \ge 1,\, a_i + a_j \le x\}$ +equal to $x + O(x^{1/4 + o(1)})$? + +By construction $R(x) \ge x$ always. Erdős and Rosen could not even prove +whether $R(x) \le (1 + o(1))x$. +-/ +@[category research open, AMS 5 11] +theorem erdos_954 : + answer(sorry) ↔ + ∀ a : ℕ → ℕ, IsRosenSequence a → + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ ∀ᶠ (x : ℕ) in atTop, + abs ((rosenPairCountTotal a x : ℝ) - (x : ℝ)) ≤ + C * (x : ℝ) ^ ((1 : ℝ) / 4 + ε) := by + sorry + +end Erdos954 diff --git a/FormalConjectures/ErdosProblems/955.lean b/FormalConjectures/ErdosProblems/955.lean new file mode 100644 index 0000000000..479150fd1a --- /dev/null +++ b/FormalConjectures/ErdosProblems/955.lean @@ -0,0 +1,74 @@ +/- +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 955 + +If $A \subseteq \mathbb{N}$ has natural density zero, must the preimage $s^{-1}(A)$ also have +natural density zero, where $s(n)$ denotes the sum of proper divisors of $n$? + +*Reference:* [erdosproblems.com/955](https://www.erdosproblems.com/955) + +[EGPS90] Erdős, P., Granville, A., Pomerance, C., and Spiro, C., _On the normal behavior of +the iterates of some arithmetic functions_. Analytic number theory (Allerton Park, IL, 1989), +Progr. Math., 85 (1990), 165-204. + +[Er73b] Erdős, P., _Über die Zahlen der Form σ(n)-n und n-φ(n)_. Elem. Math. (1973), 83-86. + +[Gu04] Guy, R., _Unsolved Problems in Number Theory_, 3rd ed. Springer, 2004. + +[Po14b] Pollack, P., _Some arithmetic properties of the sum of proper divisors and the sum of +prime divisors_. Illinois J. Math. (2014), 125-147. + +[Tr15] Troupe, L., _On the number of prime factors of values of the sum-of-proper-divisors +function_. J. Number Theory (2015), 120-135. + +[PPT18] Pollack, P., Pomerance, C., Thompson, L., _Divisor-sum fibers_. Mathematika (2018), +330-342. + +[Tr20] Troupe, L., _Divisor sums representable as the sum of two squares_. Proc. Amer. Math. +Soc. (2020), 4189-4202. +-/ + +open scoped Classical + +namespace Erdos955 + +/-- The sum of proper divisors function $s(n) = \sum_{d \mid n,\, d < n} d$. -/ +def sumProperDivisors (n : ℕ) : ℕ := n.properDivisors.sum id + +/-- A set $A \subseteq \mathbb{N}$ has natural density zero if for every $\varepsilon > 0$, +there exists $N$ such that for all $x \geq N$, the proportion of elements of $A$ +below $x$ is less than $\varepsilon$. -/ +def HasNaturalDensityZero (A : Set ℕ) : Prop := + ∀ ε : ℝ, ε > 0 → ∃ N : ℕ, ∀ x : ℕ, x ≥ N → + ((Finset.filter (· ∈ A) (Finset.range x)).card : ℝ) / (x : ℝ) < ε + +/-- +**Erdős Problem 955** [EGPS90]: + +If $A \subseteq \mathbb{N}$ has natural density zero, then so does +$s^{-1}(A) = \{n \in \mathbb{N} : s(n) \in A\}$, where $s$ is the sum of proper divisors +function. +-/ +@[category research open, AMS 11] +theorem erdos_955 (A : Set ℕ) (hA : HasNaturalDensityZero A) : + HasNaturalDensityZero {n : ℕ | sumProperDivisors n ∈ A} := by + sorry + +end Erdos955 diff --git a/FormalConjectures/ErdosProblems/956.lean b/FormalConjectures/ErdosProblems/956.lean new file mode 100644 index 0000000000..9d2d751876 --- /dev/null +++ b/FormalConjectures/ErdosProblems/956.lean @@ -0,0 +1,93 @@ +/- +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 + +open scoped Pointwise + +/-! +# Erdős Problem 956 + +*Reference:* [erdosproblems.com/956](https://www.erdosproblems.com/956) + +If $C, D \subseteq \mathbb{R}^2$ then the distance between $C$ and $D$ is defined by +$\delta(C, D) = \inf \{ \|c - d\| \mid c \in C, d \in D \}$. + +Let $h(n)$ be the maximal number of unit distances between disjoint convex +translates. That is, the maximal $m$ such that there is a compact convex set +$C \subset \mathbb{R}^2$ and a set $X$ of size $n$ such that all $(C + x)_{x \in X}$ are disjoint +and there are $m$ pairs $x_1, x_2 \in X$ such that $\delta(C + x_1, C + x_2) = 1$. + +[ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, +Combinatorica **10** (1990), 261–269. +-/ + +namespace Erdos956 + +/-- The distance between two subsets of a metric space: +$\delta(C, D) = \inf \{ \operatorname{dist}(c, d) \mid c \in C, d \in D \}$. -/ +noncomputable def setDist956 {α : Type*} [PseudoMetricSpace α] + (C D : Set α) : ℝ := + sInf {r : ℝ | ∃ c ∈ C, ∃ d ∈ D, r = dist c d} + +/-- +**Erdős Problem 956** [ErPa90]: + +There exists a constant $c > 0$ such that for all sufficiently large $n$, +one can find a compact convex set $C \subset \mathbb{R}^2$ and $n$ translation vectors whose +translates of $C$ are pairwise disjoint with more than $n^{1+c}$ pairs at +unit set-distance. +-/ +@[category research open, AMS 5 52] +theorem erdos_956 : + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ (C : Set (EuclideanSpace ℝ (Fin 2))), + IsCompact C ∧ Convex ℝ C ∧ C.Nonempty ∧ + ∃ (X : Finset (EuclideanSpace ℝ (Fin 2))), + X.card = n ∧ + (∀ x₁ ∈ X, ∀ x₂ ∈ X, x₁ ≠ x₂ → + Disjoint (C + {x₁}) (C + {x₂})) ∧ + ∃ (P : Finset (EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ P, p.1 ∈ X ∧ p.2 ∈ X ∧ p.1 ≠ p.2 ∧ + setDist956 (C + {p.1}) (C + {p.2}) = 1) ∧ + (∀ p ∈ P, (p.2, p.1) ∉ P) ∧ + ((P.card : ℝ) > (n : ℝ) ^ ((1 : ℝ) + c)) := by + sorry + +/-- +**Erdős Problem 956, upper bound** [ErPa90]: + +$h(n) \ll n^{4/3}$. For any compact convex set $C$ and $n$ translations with +pairwise disjoint translates, the number of pairs at unit set-distance +is $O(n^{4/3})$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_956.variants.upper_bound : + ∃ K : ℝ, K > 0 ∧ + ∀ (C : Set (EuclideanSpace ℝ (Fin 2))), + IsCompact C → Convex ℝ C → C.Nonempty → + ∀ (X : Finset (EuclideanSpace ℝ (Fin 2))), + (∀ x₁ ∈ X, ∀ x₂ ∈ X, x₁ ≠ x₂ → + Disjoint (C + {x₁}) (C + {x₂})) → + ∀ (P : Finset (EuclideanSpace ℝ (Fin 2) × EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ P, p.1 ∈ X ∧ p.2 ∈ X ∧ p.1 ≠ p.2 ∧ + setDist956 (C + {p.1}) (C + {p.2}) = 1) → + (∀ p ∈ P, (p.2, p.1) ∉ P) → + (P.card : ℝ) ≤ K * (X.card : ℝ) ^ ((4 : ℝ) / 3) := by + sorry + +end Erdos956 diff --git a/FormalConjectures/ErdosProblems/957.lean b/FormalConjectures/ErdosProblems/957.lean new file mode 100644 index 0000000000..ae6f7f80a6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/957.lean @@ -0,0 +1,71 @@ +/- +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 957 + +*Reference:* [erdosproblems.com/957](https://www.erdosproblems.com/957) + +Let $A \subset \mathbb{R}^2$ be a set of size $n$ and let $\{d_1 < \ldots < d_k\}$ +be the set of distinct distances determined by $A$. Let $f(d)$ be the number of +(unordered) pairs of points at distance $d$. Is it true that +$$f(d_1) f(d_k) \leq \left(\frac{9}{8} + o(1)\right) n^2?$$ + +A question of Erdős and Pach [ErPa90]. An unpublished construction of Makai +shows that this would be the best possible. Solved by Dumitrescu [Du19], who +proved $f(d_1) f(d_k) \leq \frac{9}{8} n^2 + O(n)$. + +See also problems #132 and #756. + +[ErPa90] Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, +Combinatorica (1990). + +[Du19] Dumitrescu, A., _A product inequality for extreme distances_, +Computational Geometry (2019). +-/ + +open Classical + +namespace Erdos957 + +/-- The number of unordered pairs of distinct points in $A$ at Euclidean + distance $d$. Computed as the number of ordered pairs divided by 2. -/ +noncomputable def distFrequency (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card / 2 + +/-- +Erdős Problem 957 [ErPa90] (proved by Dumitrescu [Du19]): +For every $\varepsilon > 0$, for all sufficiently large finite point sets +$A \subset \mathbb{R}^2$, the product of the frequency of the minimum distance +and the frequency of the maximum distance satisfies +$f(d_{\min}) \cdot f(d_{\max}) \leq (9/8 + \varepsilon) \cdot |A|^2$. +-/ +@[category research solved, AMS 5 52] +theorem erdos_957 : answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ (A : Finset (EuclideanSpace ℝ (Fin 2))), N₀ ≤ A.card → + ∀ d₁ dk : ℝ, + (∃ p q : EuclideanSpace ℝ (Fin 2), p ∈ A ∧ q ∈ A ∧ p ≠ q ∧ dist p q = d₁) → + (∀ p q : EuclideanSpace ℝ (Fin 2), p ∈ A → q ∈ A → p ≠ q → d₁ ≤ dist p q) → + (∃ p q : EuclideanSpace ℝ (Fin 2), p ∈ A ∧ q ∈ A ∧ p ≠ q ∧ dist p q = dk) → + (∀ p q : EuclideanSpace ℝ (Fin 2), p ∈ A → q ∈ A → dist p q ≤ dk) → + (distFrequency A d₁ : ℝ) * (distFrequency A dk : ℝ) ≤ + (9 / 8 + ε) * (A.card : ℝ) ^ 2 := by + sorry + +end Erdos957 diff --git a/FormalConjectures/ErdosProblems/958.lean b/FormalConjectures/ErdosProblems/958.lean new file mode 100644 index 0000000000..aa03c13180 --- /dev/null +++ b/FormalConjectures/ErdosProblems/958.lean @@ -0,0 +1,98 @@ +/- +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 958 + +*Reference:* [erdosproblems.com/958](https://www.erdosproblems.com/958) + +Let $A \subset \mathbb{R}^2$ be a finite set of size $n$, and let $\{d_1, \ldots, d_k\}$ +be the set of distinct distances determined by $A$. Let $f(d)$ be the multiplicity of $d$, +the number of unordered pairs from $A$ at distance $d$ apart. + +Is it true that $k = n - 1$ and $\{f(d_i)\} = \{1, \ldots, n-1\}$ if and only if $A$ is +a set of equidistant points on a line or a circle? + +Erdős conjectured that the answer is no, and other such configurations exist [Er84c]. + +This was proved by Clemen, Dumitrescu, and Liu [CDL25], who observed that equidistant +points on a short circular arc on a circle of radius 1, together with the centre, provide +a counterexample. + +[Er84c] Erdős, P., _Some old and new problems in combinatorial geometry_, +Convexity and graph theory (Jerusalem, 1981), 1984, pp. 129–136. + +[CDL25] Clemen, F., Dumitrescu, A., and Liu, D., _On multiplicities of interpoint distances_. +arXiv:2505.04283 (2025). +-/ + +namespace Erdos958 + +/-- The set of distinct distances determined by a finite point set in $\mathbb{R}^2$. -/ +noncomputable def distinctDistances (A : Finset (EuclideanSpace ℝ (Fin 2))) : Finset ℝ := + (A.offDiag).image (fun p => dist p.1 p.2) + +/-- The number of unordered pairs in $A$ at distance $d$. -/ +noncomputable def distMultiplicity (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + (A.offDiag.filter (fun p => dist p.1 p.2 = d)).card / 2 + +/-- The distance multiplicity property: $A$ has exactly $n-1$ distinct distances and the +multiplicities are exactly $\{1, 2, \ldots, n-1\}$. -/ +def HasDistanceMultiplicityProperty (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + A.card ≥ 2 ∧ + (distinctDistances A).card = A.card - 1 ∧ + ∀ m : ℕ, (1 ≤ m ∧ m ≤ A.card - 1) ↔ + (∃ d ∈ distinctDistances A, distMultiplicity A d = m) + +/-- A finite point set is equidistant-collinear if the points are equally spaced along a +line: $A = \{p, p + v, p + 2v, \ldots, p + (n-1)v\}$ for some $p, v$ with $v \neq 0$. -/ +def IsEquidistantCollinear (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∃ (p v : EuclideanSpace ℝ (Fin 2)), v ≠ 0 ∧ + ∀ a ∈ A, ∃ i : Fin A.card, a = p + (i.val : ℝ) • v + +/-- A finite point set is equidistant-circular if the points are equally spaced on a +circle: all points lie on a circle and consecutive points in a cyclic ordering have +equal Euclidean distance. -/ +def IsEquidistantCircular (A : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + A.card ≥ 3 ∧ + ∃ (c : EuclideanSpace ℝ (Fin 2)) (r : ℝ), r > 0 ∧ + (∀ a ∈ A, dist a c = r) ∧ + ∃ (σ : ℕ → EuclideanSpace ℝ (Fin 2)), + (∀ i, i < A.card → σ i ∈ A) ∧ + (∀ a ∈ A, ∃ i, i < A.card ∧ σ i = a) ∧ + (∀ i j, i < A.card → j < A.card → σ i = σ j → i = j) ∧ + ∀ i, i < A.card → + dist (σ i) (σ ((i + 1) % A.card)) = dist (σ 0) (σ 1) + +/-- +**Erdős Problem 958** [Er84c]: + +Is it true that if a finite set $A \subset \mathbb{R}^2$ satisfies the distance multiplicity +property (exactly $n-1$ distinct distances with multiplicities $\{1, \ldots, n-1\}$), then $A$ +must be a set of equidistant points on a line or equidistant points on a circle? + +The answer is no. This was proved by Clemen, Dumitrescu, and Liu [CDL25]. +-/ +@[category research solved, AMS 5 52] +theorem erdos_958 : answer(False) ↔ + (∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + HasDistanceMultiplicityProperty A → + (IsEquidistantCollinear A ∨ IsEquidistantCircular A)) := by + sorry + +end Erdos958 diff --git a/FormalConjectures/ErdosProblems/959.lean b/FormalConjectures/ErdosProblems/959.lean new file mode 100644 index 0000000000..26f8fbc224 --- /dev/null +++ b/FormalConjectures/ErdosProblems/959.lean @@ -0,0 +1,74 @@ +/- +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 959 + +*Reference:* [erdosproblems.com/959](https://www.erdosproblems.com/959) + +Let $A \subset \mathbb{R}^2$ be a set of size $n$ and let $\{d_1, \ldots, d_k\}$ +be the set of distinct distances determined by $A$. Let $f(d)$ be the number of +times the distance $d$ is determined (as an unordered pair), and suppose the $d_i$ +are ordered such that $f(d_1) \geq f(d_2) \geq \cdots \geq f(d_k)$. + +Estimate $\max (f(d_1) - f(d_2))$, where the maximum is taken over all $A$ of +size $n$. + +[Er84d] Erdős, P., *Some old and new problems on combinatorial geometry*. + +[CDL25] Clemen, F., Dumitrescu, A., and Liu, D., _On multiplicities of interpoint distances_. +arXiv:2505.04283 (2025). +-/ + +open Classical + +namespace Erdos959 + +/-- The set of distinct distances determined by a finite point set in $\mathbb{R}^2$. -/ +noncomputable def distinctDistances (A : Finset (EuclideanSpace ℝ (Fin 2))) : Finset ℝ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2)).image (fun p => dist p.1 p.2) + +/-- The multiplicity of distance $d$ in $A$: the number of unordered pairs at distance $d$. -/ +noncomputable def distMultiplicity (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card / 2 + +/-- +**Erdős Problem 959** [Er84d]: + +For any sufficiently large $n$, there exists a set $A$ of $n$ points in $\mathbb{R}^2$ +such that the gap between the most frequent and every other distance multiplicity +is at least $c \cdot n \cdot \log n$ for some absolute constant $c > 0$. + +Equivalently, $\max_A (f(d_1) - f(d_2)) \gg n \log n$ where $f(d_1) \geq f(d_2)$ +are the two largest distance multiplicities. + +This lower bound was proved by Clemen, Dumitrescu, and Liu [CDL25]. +-/ +@[category research open, AMS 52] +theorem erdos_959 : + ∃ c : ℝ, c > 0 ∧ ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (A : Finset (EuclideanSpace ℝ (Fin 2))), + A.card = n ∧ + ∃ d₁ ∈ distinctDistances A, + (∀ d ∈ distinctDistances A, distMultiplicity A d ≤ distMultiplicity A d₁) ∧ + ∀ d₂ ∈ distinctDistances A, d₂ ≠ d₁ → + (distMultiplicity A d₁ : ℝ) - (distMultiplicity A d₂ : ℝ) ≥ + c * (n : ℝ) * Real.log (n : ℝ) := by + sorry + +end Erdos959 diff --git a/FormalConjectures/ErdosProblems/96.lean b/FormalConjectures/ErdosProblems/96.lean new file mode 100644 index 0000000000..968e5899fa --- /dev/null +++ b/FormalConjectures/ErdosProblems/96.lean @@ -0,0 +1,98 @@ +/- +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 96 + +*Reference:* [erdosproblems.com/96](https://www.erdosproblems.com/96) + +Erdős–Moser conjecture: if $n$ points in $\mathbb{R}^2$ are in convex position, then the number +of pairs at unit distance is $O(n)$. + +Erdős and Fishburn conjectured the stronger bound of $2n$. + +## Known bounds + +- The best known upper bound is $n \log_2 n + 4n$ [Ag15]. +- The $O(n \log n)$ bound was first proved by Füredi [Fu90], with a simplified proof + by Brass and Pach [BrPa01]. +- Edelsbrunner and Hajnal [EdHa91] constructed $n$ points in convex position with + $2n - 7$ unit-distance pairs, giving the best known lower bound. + +## Related problems + +Problem 97 would imply a positive answer; see also Problem 90. + +## References + +- [Ag15] Aggarwal, A., _On unit distances in a convex polygon_. Discrete Math. (2015), 88-92. +- [BrPa01] Brass, P., Pach, J., _The maximum number of times the same distance can occur among + the vertices of a convex n-gon is O(n log n)_. J. Combin. Theory Ser. A (2001), 178-179. +- [EdHa91] Edelsbrunner, H., Hajnal, P., _A lower bound on the number of unit distances between + the vertices of a convex polygon_. J. Combin. Theory Ser. A (1991), 312-316. +- [Fu90] Füredi, Z., _The maximum number of unit distances in a convex n-gon_. + J. Combin. Theory Ser. A (1990), 316-320. +-/ + +open EuclideanGeometry + +namespace Erdos96 + +/-- +The number of ordered pairs of distinct points in $P$ that are at unit distance. +(Using ordered pairs; the number of unordered pairs is exactly half this, +so the $O(n)$ bound is equivalent.) +-/ +noncomputable def unitDistancePairCount (P : Finset ℝ²) : ℕ := + (P.offDiag.filter (fun pq => dist pq.1 pq.2 = 1)).card + +/-- +Erdős Problem 96 (Erdős–Moser conjecture): +If $n$ points in $\mathbb{R}^2$ form a convex polygon (are in convex position), then there +are $O(n)$ many pairs which are distance $1$ apart. + +Formally: there exists an absolute constant $C > 0$ such that for every finite +set $P$ of points in $\mathbb{R}^2$ in convex position, the number of (ordered) pairs at +unit distance is at most $C \cdot |P|$. +-/ +@[category research open, AMS 52] +theorem erdos_96 : + ∃ C : ℝ, C > 0 ∧ + ∀ (P : Finset ℝ²), + ConvexIndep (↑P : Set ℝ²) → + (unitDistancePairCount P : ℝ) ≤ C * (P.card : ℝ) := by + sorry + +/-- +Erdős–Fishburn conjecture (stronger variant of Problem 96): +The exact upper bound on the number of unit-distance pairs among $n$ points in convex +position is $2n$ (for sufficiently large $n$). Edelsbrunner and Hajnal [EdHa91] showed +that $2n - 7$ is achievable, so the conjectured bound would be tight up to a constant. + +Here we state: for all sufficiently large convex-position point sets, the number of +unordered unit-distance pairs is at most $2n$. +-/ +@[category research open, AMS 52] +theorem erdos_96_fishburn : + ∃ N : ℕ, ∀ (P : Finset ℝ²), + ConvexIndep (↑P : Set ℝ²) → + N ≤ P.card → + unitDistancePairCount P ≤ 2 * P.card := by + sorry + +end Erdos96 diff --git a/FormalConjectures/ErdosProblems/960.lean b/FormalConjectures/ErdosProblems/960.lean new file mode 100644 index 0000000000..fd1ddc118c --- /dev/null +++ b/FormalConjectures/ErdosProblems/960.lean @@ -0,0 +1,122 @@ +/- +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 960 + +For a set of $n$ points in $\mathbb{R}^2$ with no $k$ collinear, let $f_{r,k}(n)$ be the +minimum number of ordinary lines that guarantees the existence of $r$ points whose +$\binom{r}{2}$ determined lines are all ordinary. Erdős asked whether $f_{r,k}(n) = o(n^2)$ +for fixed $r, k \geq 2$, and more strongly whether $f_{r,k}(n) = O(n)$. + +*Reference:* [erdosproblems.com/960](https://www.erdosproblems.com/960) + +[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984. + +See also: [Erdős Problem 209](https://www.erdosproblems.com/209). +-/ + +namespace Erdos960 + +/-- +A finite point set in $\mathbb{R}^2$ has no $k$ collinear if every $k$-element subset +is not collinear (i.e., no line contains $k$ or more of the points). +-/ +def NoKCollinear (k : ℕ) (P : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + ∀ S : Finset (EuclideanSpace ℝ (Fin 2)), + S ⊆ P → S.card = k → ¬Collinear ℝ (S : Set (EuclideanSpace ℝ (Fin 2))) + +/-- +An ordinary line of a point set $P$ is a line (1-dimensional affine subspace) +that contains exactly two points of $P$. +-/ +def IsOrdinaryLine (P : Finset (EuclideanSpace ℝ (Fin 2))) + (L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2))) : Prop := + Module.finrank ℝ L.direction = 1 ∧ + Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L} = 2 + +/-- +The number of ordinary lines determined by a point set $P$: the number of +lines (1-dimensional affine subspaces) containing exactly two points of $P$. +-/ +noncomputable def ordinaryLineCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | IsOrdinaryLine P L} + +/-- +The line through two distinct points in $\mathbb{R}^2$: the affine span of $\{p, q\}$. +-/ +noncomputable def lineThrough (p q : EuclideanSpace ℝ (Fin 2)) : + AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) := + affineSpan ℝ {p, q} + +/-- +A subset $A' \subseteq A$ of $r$ points has all its determined lines ordinary with +respect to $A$: for every pair of distinct points $p, q \in A'$, the line through +$p$ and $q$ is ordinary (contains exactly two points of $A$). +-/ +def AllPairsOrdinary (A : Finset (EuclideanSpace ℝ (Fin 2))) + (A' : Finset (EuclideanSpace ℝ (Fin 2))) : Prop := + A' ⊆ A ∧ + ∀ p ∈ A', ∀ q ∈ A', p ≠ q → IsOrdinaryLine A (lineThrough p q) + +/-- +$f_{r,k}(n)$: the minimum number of ordinary lines that guarantees the existence +of $r$ points, all of whose $\binom{r}{2}$ determined lines are ordinary. + +More precisely, $f_{r,k}(n)$ is the smallest $m$ such that for every set $A$ of $n$ +points in $\mathbb{R}^2$ with no $k$ collinear and at least $m$ ordinary lines, there exists +$A' \subseteq A$ with $|A'| = r$ such that every line determined by $A'$ is ordinary. +-/ +noncomputable def fRk (r k n : ℕ) : ℕ := + sInf {m : ℕ | ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), + A.card = n → + NoKCollinear k A → + ordinaryLineCount A ≥ m → + ∃ A' : Finset (EuclideanSpace ℝ (Fin 2)), + A'.card = r ∧ AllPairsOrdinary A A'} + +/-- +Erdős Problem 960 [Er84]: + +For fixed $r, k \geq 2$, the threshold $f_{r,k}(n)$ is $o(n^2)$. That is, for every +$\varepsilon > 0$ there exists $N$ such that for all $n \geq N$, +$f_{r,k}(n) \leq \varepsilon \cdot n^2$. + +This is the weaker form of the conjecture. Erdős also asks whether perhaps +$f_{r,k}(n) \ll n$ (i.e., $f_{r,k}(n) = O(n)$). +-/ +@[category research open, AMS 5 51] +theorem erdos_960 (r k : ℕ) (hr : r ≥ 2) (hk : k ≥ 2) : + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + (fRk r k n : ℝ) ≤ ε * (n : ℝ) ^ 2 := by + sorry + +/-- +Erdős Problem 960, stronger form [Er84]: + +For fixed $r, k \geq 2$, the threshold $f_{r,k}(n) = O(n)$. That is, there exists +$C > 0$ such that $f_{r,k}(n) \leq C \cdot n$ for all $n$. +-/ +@[category research open, AMS 5 51] +theorem erdos_960.variants.strong (r k : ℕ) (hr : r ≥ 2) (hk : k ≥ 2) : + ∃ C : ℝ, C > 0 ∧ + ∀ n : ℕ, (fRk r k n : ℝ) ≤ C * (n : ℝ) := by + sorry + +end Erdos960 diff --git a/FormalConjectures/ErdosProblems/962.lean b/FormalConjectures/ErdosProblems/962.lean new file mode 100644 index 0000000000..cc165425f6 --- /dev/null +++ b/FormalConjectures/ErdosProblems/962.lean @@ -0,0 +1,97 @@ +/- +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 962 + +*Reference:* [erdosproblems.com/962](https://www.erdosproblems.com/962) + +Let $k(n)$ be the maximal $k$ such that there exists $m \leq n$ such that each +of the integers $m+1, \ldots, m+k$ are divisible by at least one prime $> k$. +Estimate $k(n)$. + +[Er65] Erdős, P., _Extremal problems in number theory_. Proc. Sympos. Pure Math. **VIII** (1965), 181–189. + +OEIS: [A327909](https://oeis.org/A327909) +-/ + +open Real + +namespace Erdos962 + +/-- +`erdos962_k n` is the maximal $k$ such that there exists $m \leq n$ with every +integer in $\{m+1, \ldots, m+k\}$ divisible by at least one prime greater than $k$. +-/ +noncomputable def erdos962_k (n : ℕ) : ℕ := + sSup {k : ℕ | ∃ m : ℕ, m ≤ n ∧ + ∀ i : ℕ, 1 ≤ i → i ≤ k → ∃ p : ℕ, Nat.Prime p ∧ p > k ∧ p ∣ (m + i)} + +/-- +Erdős Problem 962, conjecture [Er65]: + +$k(n) = o(n^\epsilon)$ for every $\epsilon > 0$. That is, for every $\epsilon > 0$, +$k(n) / n^\epsilon \to 0$ as $n \to \infty$. +-/ +@[category research open, AMS 11] +theorem erdos_962 (ε : ℝ) (hε : ε > 0) : + ∀ δ : ℝ, δ > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos962_k n : ℝ) ≤ δ * (n : ℝ) ^ ε := by + sorry + +/-- +Erdős Problem 962, Tao's upper bound: + +$k(n) \leq (1+o(1)) n^{1/2}$. Formulated as: for every $\epsilon > 0$, there +exists $N_0$ such that for all $n \geq N_0$, $k(n) \leq (1+\epsilon) \sqrt{n}$. +-/ +@[category research solved, AMS 11] +theorem erdos_962.variants.tao_upper (ε : ℝ) (hε : ε > 0) : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos962_k n : ℝ) ≤ (1 + ε) * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry + +/-- +Erdős Problem 962, Erdős lower bound [Er65]: + +$k(n) \gg_\epsilon \exp((\log n)^{1/2-\epsilon})$ for every $\epsilon > 0$. +Formulated as: for every $\epsilon > 0$, there exist $C > 0$ and $N_0$ such that +for all $n \geq N_0$, $k(n) \geq C \cdot \exp((\log n)^{1/2-\epsilon})$. +-/ +@[category research solved, AMS 11] +theorem erdos_962.variants.erdos_lower (ε : ℝ) (hε : ε > 0) : + ∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos962_k n : ℝ) ≥ C * exp ((log (n : ℝ)) ^ ((1 : ℝ) / 2 - ε)) := by + sorry + +/-- +Erdős Problem 962, Quanyu Tang's lower bound: + +$k(n) \geq \exp((1/\sqrt{2} - o(1))\sqrt{\log n \cdot \log\log n})$. +Formulated as: for every $\epsilon > 0$, there exists $N_0$ such that for all +$n \geq N_0$, $k(n) \geq \exp((1/\sqrt{2} - \epsilon) \cdot \sqrt{\log n \cdot \log(\log n)})$. +-/ +@[category research solved, AMS 11] +theorem erdos_962.variants.tang_lower (ε : ℝ) (hε : ε > 0) : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos962_k n : ℝ) ≥ + exp ((1 / sqrt 2 - ε) * sqrt (log (n : ℝ) * log (log (n : ℝ)))) := by + sorry + +end Erdos962 diff --git a/FormalConjectures/ErdosProblems/963.lean b/FormalConjectures/ErdosProblems/963.lean new file mode 100644 index 0000000000..07a94c5c80 --- /dev/null +++ b/FormalConjectures/ErdosProblems/963.lean @@ -0,0 +1,58 @@ +/- +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 963 + +*Reference:* [erdosproblems.com/963](https://www.erdosproblems.com/963) + +[Er65] Erdős, P., _Extremal problems in number theory_, 1965. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference + "Paul Erdős and his mathematics", Budapest, July 1999 (1999), §1.22. +-/ + +open Finset BigOperators + +namespace Erdos963 + +/-- +A finset of real numbers is *dissociated* if all subset sums are distinct: +for any two subsets $S$ and $T$ of $B$, if $\sum_{b \in S} b = \sum_{b \in T} b$ then $S = T$. +-/ +def IsDissociated (B : Finset ℝ) : Prop := + ∀ S T, S ⊆ B → T ⊆ B → (∑ b ∈ S, b) = (∑ b ∈ T, b) → S = T + +/-- +Erdős Problem 963 [Er65]: + +Let $f(n)$ be the maximal $k$ such that in any set $A \subset \mathbb{R}$ of size $n$ there is a +dissociated subset $B \subseteq A$ of size $|B| \geq k$ (i.e., all subset sums of $B$ are +distinct). Is it true that $f(n) \geq \lfloor \log_2 n \rfloor$? + +Equivalently: for every finite set $A \subset \mathbb{R}$ of size $n$, there exists a dissociated +subset $B \subseteq A$ with $|B| \geq \lfloor \log_2 n \rfloor$. + +Erdős noted that the greedy algorithm shows $f(n) \geq \lfloor \log_3 n \rfloor$. +-/ +@[category research open, AMS 5] +theorem erdos_963 : answer(sorry) ↔ ∀ (A : Finset ℝ), A.Nonempty → + ∃ B : Finset ℝ, B ⊆ A ∧ IsDissociated B ∧ Nat.log 2 A.card ≤ B.card := by + sorry + +end Erdos963 diff --git a/FormalConjectures/ErdosProblems/964.lean b/FormalConjectures/ErdosProblems/964.lean new file mode 100644 index 0000000000..3c7757202f --- /dev/null +++ b/FormalConjectures/ErdosProblems/964.lean @@ -0,0 +1,71 @@ +/- +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 964 + +*Reference:* [erdosproblems.com/964](https://www.erdosproblems.com/964) + +Let $\tau(n)$ count the number of divisors of $n$. Is the sequence +$\tau(n+1)/\tau(n)$ everywhere dense in $(0,\infty)$? + +This has been proved unconditionally by Eberhard [Eb25], who in fact showed +that every positive rational can be written as such a ratio. + +See also Problem 946 for a related problem. + +[Er86b] Erdős, P., original problem statement. + +[Eb25] Eberhard, S., _Ratios of consecutive values of the divisor function_. arXiv:2505.00727 (2025). +-/ + +namespace Erdos964 + +/-- +Erdős Problem 964 [Er86b]: + +The set $\{\tau(n+1)/\tau(n) : n \geq 1\}$ is dense in $(0, \infty)$. + +For every positive real $r$ and every $\varepsilon > 0$, there exists a natural number $n \geq 1$ +such that $|\tau(n+1)/\tau(n) - r| < \varepsilon$. + +Proved by Eberhard [Eb25]. +-/ +@[category research solved, AMS 11] +theorem erdos_964 : answer(True) ↔ + ∀ r : ℝ, r > 0 → ∀ ε : ℝ, ε > 0 → + ∃ n : ℕ, n ≥ 1 ∧ + |((Nat.divisors (n + 1)).card : ℝ) / ((Nat.divisors n).card : ℝ) - r| < ε := by + sorry + +/-- +Erdős Problem 964, stronger variant [Eb25]: + +Every positive rational number can be written as $\tau(n+1)/\tau(n)$ for some $n \geq 1$. + +This is strictly stronger than density in $(0, \infty)$ and was proved unconditionally +by Eberhard. +-/ +@[category research solved, AMS 11] +theorem erdos_964_rational_values : + ∀ q : ℚ, q > 0 → + ∃ n : ℕ, n ≥ 1 ∧ + ((Nat.divisors (n + 1)).card : ℚ) / ((Nat.divisors n).card : ℚ) = q := by + sorry + +end Erdos964 diff --git a/FormalConjectures/ErdosProblems/966.lean b/FormalConjectures/ErdosProblems/966.lean new file mode 100644 index 0000000000..2bf945376a --- /dev/null +++ b/FormalConjectures/ErdosProblems/966.lean @@ -0,0 +1,57 @@ +/- +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 966 + +*Reference:* [erdosproblems.com/966](https://www.erdosproblems.com/966) + +Let $k, r \geq 2$. Does there exist a set $A \subseteq \mathbb{N}$ that contains no non-trivial +arithmetic progression of length $k + 1$, yet in any $r$-colouring of $A$ there +must exist a monochromatic non-trivial arithmetic progression of length $k$? + +A problem of Erdős [Er75b]. Spencer has shown that such a set exists. +This is an arithmetic analogue of the graph theory version [924]. + +[Er75b] Erdős, P., _Problems and results in combinatorial number theory_. Journées +Arithmétiques de Bordeaux (Conf., Univ. Bordeaux, Bordeaux, 1974) (1975), 295–310. +-/ + +namespace Erdos966 + +/-- +Erdős Problem 966 [Er75b]: + +For all $k \geq 2$ and $r \geq 2$, there exists a set $A \subseteq \mathbb{N}$ that contains no +$(k+1)$-term arithmetic progression, yet every $r$-colouring of $A$ contains +a monochromatic $k$-term arithmetic progression. + +Proved by Spencer. +-/ +@[category research solved, AMS 5] +theorem erdos_966 : answer(True) ↔ + ∀ (k : ℕ) (r : ℕ), k ≥ 2 → r ≥ 2 → + ∃ (A : Set ℕ), + (¬∃ a d : ℕ, 0 < d ∧ ∀ i : ℕ, i < k + 1 → a + i * d ∈ A) ∧ + (∀ c : ℕ → Fin r, + ∃ a d : ℕ, 0 < d ∧ + (∀ i : ℕ, i < k → a + i * d ∈ A) ∧ + ∀ i : ℕ, i < k → c (a + i * d) = c a) := by + sorry + +end Erdos966 diff --git a/FormalConjectures/ErdosProblems/967.lean b/FormalConjectures/ErdosProblems/967.lean new file mode 100644 index 0000000000..243e81f47e --- /dev/null +++ b/FormalConjectures/ErdosProblems/967.lean @@ -0,0 +1,88 @@ +/- +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.Analysis.HasGaps + +/-! +# Erdős Problem 967 + +Let $1 < a_1 < a_2 < \cdots$ be a strictly increasing sequence of integers with +$\sum 1/a_k < \infty$. Is it necessarily true that for every real $t$, +$1 + \sum_k a_k^{-(1+it)} \neq 0$? Yip showed the answer is no. + +*Reference:* [erdosproblems.com/967](https://www.erdosproblems.com/967) + +[ErIn64] Erdős, P. and Ingham, A. E., *Arithmetical Tauberian theorems*, Acta Arithmetica (1964). + +[Yi25] Yip, C. H., *On a question of Erdős and Ingham* (2025). +-/ + +open Complex + +namespace Erdos967 + +/-- +Erdős Problem 967 (Disproved by Yip [Yi25]): + +Let $1 < a_1 < a_2 < \cdots$ be a strictly increasing sequence of integers with +$\sum 1/a_k < \infty$ (i.e., the sequence has Fejér gaps). Erdős and Ingham [ErIn64] asked +whether it is necessarily true that for every real $t$, +$$1 + \sum_k a_k^{-(1+it)} \neq 0.$$ + +Yip proved that for any real $t \neq 0$, there exists such a sequence satisfying +$$1 + \sum_k a_k^{-(1+it)} = 0.$$ +-/ +@[category research solved, AMS 11 30] +theorem erdos_967 : + answer(False) ↔ + (∀ (a : ℕ → ℕ), HasFejerGaps a → (∀ i, 2 ≤ a i) → + ∀ t : ℝ, 1 + (∑' k, (1 : ℂ) / ((a k : ℂ) ^ ((1 : ℂ) + ↑t * I))) ≠ 0) := by + sorry + +/-- +Erdős Problem 967 (Finite-sequence variant, Open): + +The finite-sequence analogue of Erdős Problem 967: for any finite set $S$ of integers +greater than 1, is it true that $1 + \sum_{a \in S} a^{-(1+it)} \neq 0$ for every real $t$? + +This remains open even for the simplest case $S = \{2, 3, 5\}$, which Erdős and Ingham [ErIn64] +could not resolve. The Four Exponentials Conjecture would imply non-vanishing in the +$\{2, 3, 5\}$ case. +-/ +@[category research open, AMS 11 30] +theorem erdos_967_finite : + ∀ (S : Finset ℕ), (∀ a ∈ S, 2 ≤ a) → + ∀ t : ℝ, 1 + (∑ a ∈ S, (1 : ℂ) / ((a : ℂ) ^ ((1 : ℂ) + ↑t * I))) ≠ 0 := by + sorry + +/-- +Erdős Problem 967 (The $\{2, 3, 5\}$ case, Open): + +The simplest open case of the finite-sequence variant: is it true that +$2^{-(1+it)} + 3^{-(1+it)} + 5^{-(1+it)} \neq -1$ for every real $t$? + +Erdős and Ingham [ErIn64] highlighted this as the simplest case they could not decide. +The Four Exponentials Conjecture implies this never vanishes. +-/ +@[category research open, AMS 11 30] +theorem erdos_967_235 : + ∀ t : ℝ, 1 + ((1 : ℂ) / ((2 : ℂ) ^ ((1 : ℂ) + ↑t * I)) + + (1 : ℂ) / ((3 : ℂ) ^ ((1 : ℂ) + ↑t * I)) + + (1 : ℂ) / ((5 : ℂ) ^ ((1 : ℂ) + ↑t * I))) ≠ 0 := by + sorry + +end Erdos967 diff --git a/FormalConjectures/ErdosProblems/969.lean b/FormalConjectures/ErdosProblems/969.lean new file mode 100644 index 0000000000..85eeb5446d --- /dev/null +++ b/FormalConjectures/ErdosProblems/969.lean @@ -0,0 +1,94 @@ +/- +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 969 + +*Reference:* [erdosproblems.com/969](https://www.erdosproblems.com/969) + +Let $Q(x)$ count the number of squarefree integers in $[1, x]$. The asymptotic is +$Q(x) = (6/\pi^2)x + E(x)$. It is elementary that $E(x) \ll x^{1/2}$, and the prime +number theorem gives $o(x^{1/2})$. Evelyn and Linfoot [EvLi31] proved +$E(x) = \Omega(x^{1/4})$, and this is likely the true order of magnitude. +The best unconditional bound is due to Walfisz [Wa63]. +Assuming the Riemann Hypothesis, Liu [Li16] proved +$E(x) = O(x^{11/35 + o(1)})$, but the true order of magnitude remains unknown even +under RH. Note that the sharp bound $E(x) = O(x^{1/4})$ (without $\varepsilon$) +would imply the Riemann Hypothesis; the conjecture formalized here, +$E(x) = O(x^{1/4 + \varepsilon})$ for all $\varepsilon > 0$, is strictly weaker and +does not imply RH. + +## References + +* [EvLi31] Evelyn, C. J. A., Linfoot, E. H., _On a problem in the additive theory of + numbers_. Ann. of Math. (2) (1931), 261–270. +* [Wa63] Walfisz, A., _Weylsche Exponentialsummen in der neueren Zahlentheorie_ (1963), + p. 231. +* [Li16] Liu, H.-Q., _On the distribution of squarefree numbers_. J. Number Theory + (2016), 202–222. + +## See also + +* [OEIS A013928](https://oeis.org/A013928) — Number of squarefree numbers up to $n$. +-/ + +open Finset Real + +namespace Erdos969 + +/-- The number of squarefree positive integers in $[1, x]$. -/ +def squarefreeCount (x : ℕ) : ℕ := + ((Icc 1 x).filter Squarefree).card + +/-- The error term $E(x) = Q(x) - (6/\pi^2)x$ in the squarefree counting asymptotic. -/ +noncomputable def squarefreeError (x : ℕ) : ℝ := + (squarefreeCount x : ℝ) - (6 / Real.pi ^ 2) * (x : ℝ) + +/-- +Erdős Problem 969: The error term $E(x)$ in the squarefree counting function +$Q(x) = (6/\pi^2)x + E(x)$ satisfies $E(x) = O(x^{1/4 + \varepsilon})$ for every +$\varepsilon > 0$. Combined with the known lower bound $E(x) = \Omega(x^{1/4})$ +of Evelyn and Linfoot [EvLi31], this would establish that $x^{1/4}$ is the true order of +magnitude of $E(x)$. + +Note: this is strictly weaker than the sharp bound $E(x) = O(x^{1/4})$, which would +imply the Riemann Hypothesis. The $\varepsilon$-relaxed form formalized here does not +imply RH. + +Formalized as: for every $\varepsilon > 0$, there exists $C > 0$ and $x_0$ such that +for all $x \geq x_0$, $|E(x)| \leq C \cdot x^{1/4 + \varepsilon}$. +-/ +@[category research open, AMS 11] +theorem erdos_969 (ε : ℝ) (hε : ε > 0) : + ∃ C : ℝ, C > 0 ∧ ∃ x₀ : ℕ, ∀ x : ℕ, x ≥ x₀ → + |squarefreeError x| ≤ C * (x : ℝ) ^ ((1 : ℝ) / 4 + ε) := by + sorry + +/-- +Evelyn-Linfoot lower bound [EvLi31]: The error term $E(x)$ in the squarefree counting +function satisfies $E(x) = \Omega(x^{1/4})$, i.e., $|E(x)|$ is infinitely often at +least as large as a constant times $x^{1/4}$. This is the complementary lower bound to +the conjectured upper bound in `erdos_969`. +-/ +@[category research solved, AMS 11] +theorem erdos_969_lower : + ∃ C : ℝ, C > 0 ∧ ∀ x₀ : ℕ, ∃ x : ℕ, x ≥ x₀ ∧ + |squarefreeError x| ≥ C * (x : ℝ) ^ ((1 : ℝ) / 4) := by + sorry + +end Erdos969 diff --git a/FormalConjectures/ErdosProblems/970.lean b/FormalConjectures/ErdosProblems/970.lean new file mode 100644 index 0000000000..e4a5ac2bd8 --- /dev/null +++ b/FormalConjectures/ErdosProblems/970.lean @@ -0,0 +1,67 @@ +/- +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 970 + +*Reference:* [erdosproblems.com/970](https://www.erdosproblems.com/970) + +Let $h(k)$ be Jacobsthal's function, defined as the minimal $m$ such that, +if $n$ has at most $k$ prime factors, then in any set of $m$ consecutive +integers there exists an integer coprime to $n$. Is it true that $h(k) \ll k^2$? + +This is Jacobsthal's conjecture. Iwaniec [Iw78] proved $h(k) \ll (k \log k)^2$. +The best known lower bound is +$h(k) \gg k \cdot (\log k)(\log \log \log k)/(\log \log k)^2$, +due to Ford, Green, Konyagin, Maynard, and Tao [FGKMT18]. + +This is a more general form of the function considered in problem 687. + +OEIS: [A048669](https://oeis.org/A048669) + +[Er65b] Erdős, P., *Extremal problems in number theory*. + +[Iw78] Iwaniec, H., *On the problem of Jacobsthal*. Demonstratio Mathematica +**11** (1978), 225-231. + +[FGKMT18] Ford, K., Green, B., Konyagin, S., Maynard, J., and Tao, T., +*Long gaps between primes*. J. Amer. Math. Soc. **31** (2018), 65-105. +-/ + +namespace Erdos970 + +/-- Jacobsthal's function $h(k)$: the smallest $m$ such that for every positive + integer $n$ with at most $k$ distinct prime factors, among any $m$ consecutive + natural numbers there is one coprime to $n$. -/ +noncomputable def jacobsthal (k : ℕ) : ℕ := + sInf {m : ℕ | ∀ n : ℕ, 0 < n → n.primeFactors.card ≤ k → + ∀ a : ℕ, ∃ i : ℕ, i < m ∧ Nat.Coprime (a + i) n} + +/-- +Erdős Problem 970 (Jacobsthal's conjecture) [Er65b]: + +Is it true that $h(k) \ll k^2$, i.e., there exists a constant $C > 0$ such that +$h(k) \le C \cdot k^2$ for all $k$? +-/ +@[category research open, AMS 11] +theorem erdos_970 : + answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∀ k : ℕ, (jacobsthal k : ℝ) ≤ C * (k : ℝ) ^ 2 := by + sorry + +end Erdos970 diff --git a/FormalConjectures/ErdosProblems/973.lean b/FormalConjectures/ErdosProblems/973.lean new file mode 100644 index 0000000000..ba55eeee80 --- /dev/null +++ b/FormalConjectures/ErdosProblems/973.lean @@ -0,0 +1,64 @@ +/- +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 973 + +*Reference:* [erdosproblems.com/973](https://www.erdosproblems.com/973) + +Does there exist a constant $C > 1$ such that for every $n \geq 2$ there is a sequence of complex +numbers $z_1, \ldots, z_n$ with $z_1 = 1$ and $|z_i| \geq 1$, whose power sums satisfy +$\max_{2 \leq k \leq n+1} |\sum z_i^k| < C^{-n}$? + +[Er65b] Erdős, P., _Extremal problems in number theory_. Lectures on Modern Mathematics, +Vol. III (1965), 196–244. + +[Er92f] Erdős, P., _On some problems of Paul Turán concerning power sums of complex numbers_. +Acta Mathematica Hungarica (1992), 11–24. + +[Ha74] Hayman, W. K., _Research problems in function theory: new problems_ (1974), 155–180. + +[Tu84b] Turán, P., _On a new method of analysis and its applications_ (1984), xvi+584. + +[Va99] Various, _Some of Paul's favorite problems_. Booklet produced for the conference +"Paul Erdős and his mathematics", Budapest, July 1999 (1999). +-/ + +namespace Erdos973 + +/-- +Does there exist a constant $C > 1$ such that, for every $n \geq 2$, there +exists a sequence $z_1, \ldots, z_n \in \mathbb{C}$ with $z_1 = 1$ and +$|z_i| \geq 1$ for all $i$, such that +$$\max_{2 \leq k \leq n+1} \left| \sum_{i=1}^{n} z_i^k \right| < C^{-n}?$$ + +A problem of Erdős [Er65b, p.213]. This is Problem 7.3 in [Ha74]. See also [Tu84b], [Er92f], +[Va99], and [519]. +-/ +@[category research open, AMS 30] +theorem erdos_973 : answer(sorry) ↔ + ∃ C : ℝ, C > 1 ∧ + ∀ (n : ℕ) (_ : n ≥ 2), + ∃ z : Fin n → ℂ, + z ⟨0, by omega⟩ = 1 ∧ + (∀ i, 1 ≤ ‖z i‖) ∧ + ∀ k : ℕ, 2 ≤ k → k ≤ n + 1 → + ‖∑ i : Fin n, z i ^ k‖ < C⁻¹ ^ n := by + sorry + +end Erdos973 diff --git a/FormalConjectures/ErdosProblems/974.lean b/FormalConjectures/ErdosProblems/974.lean new file mode 100644 index 0000000000..d31ff61d73 --- /dev/null +++ b/FormalConjectures/ErdosProblems/974.lean @@ -0,0 +1,51 @@ +/- +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 974 + +*Reference:* [erdosproblems.com/974](https://www.erdosproblems.com/974) + +A conjecture of Turán [Er65b, p.213], proved by Tijdeman [Ti66]. + +[Er65b] Erdős, P., _Extremal problems in number theory_ (1965), p.213. +[Ti66] Tijdeman, R., _On a conjecture of Turán and Erdős_. Indag. Math. (1966), 374–383. +-/ + +open Finset BigOperators Complex + +namespace Erdos974 + +/-- +Erdős Problem 974 (Turán's conjecture, proved by Tijdeman [Ti66]): + +If $z : \text{Fin}\; n \to \mathbb{C}$ with $z_0 = 1$, and there are infinitely many $k \in \mathbb{N}$ +such that the $n - 1$ consecutive power sums $s_k, s_{k+1}, \ldots, s_{k+n-2}$ are all zero, +then the $z_i$ are a permutation of the $n$-th roots of unity $e^{2\pi i j/n}$. +-/ +@[category research solved, AMS 11 30] +theorem erdos_974 {n : ℕ} (hn : 2 ≤ n) + (z : Fin n → ℂ) + (hz1 : z ⟨0, by omega⟩ = 1) + (hzeros : ∀ N : ℕ, ∃ k ≥ N, ∀ j : ℕ, j < n - 1 → + (∑ i : Fin n, (z i) ^ (k + j)) = 0) : + ∃ σ : Equiv.Perm (Fin n), ∀ i : Fin n, + z (σ i) = exp (2 * ↑Real.pi * I * ↑(i.val) / ↑n) := by + sorry + +end Erdos974 diff --git a/FormalConjectures/ErdosProblems/976.lean b/FormalConjectures/ErdosProblems/976.lean new file mode 100644 index 0000000000..ec31c9afc9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/976.lean @@ -0,0 +1,93 @@ +/- +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 976 + +For an irreducible polynomial $f \in \mathbb{Z}[x]$ of degree $d \geq 2$, estimate the greatest +prime factor of $\prod_{m=1}^{n} f(m)$. In particular, is this $\gg n^{1+c}$ for some $c > 0$, +or even $\gg n^d$? + +Nagell [Na22] and Ricci [Ri34] independently proved that $F_f(n) \gg n \log n$. Erdős [Er52c] +improved this to $F_f(n) \gg n(\log n)^{\log\log\log n}$. Erdős [Er65b] claimed a proof of +$F_f(n) \gg n \exp((\log n)^c)$ for some $c > 0$, but the argument was flawed; a weaker result +was published in [ErSc90]. Tenenbaum [Te90] proved the stronger bound. + +## References + +[Er52c] Erdős, P., _On the greatest prime factor of $\prod^x_{k=1} f(k)$_. + J. London Math. Soc. (1952), 379–384. + +[Er65b] Erdős, P., _Some recent advances and current problems in number theory_. + Lectures on Modern Mathematics, Vol. III (1965), 196–244. + +[ErSc90] Erdős, P., Schinzel, A., _On the greatest prime factor of $\prod^x_{k=1} f(k)$_. + Acta Arith. (1990), 191–200. + +[Na22] Nagell, T., _Abh. Math. Sem. Hamburg_ (1922), 179–194. + +[Ri34] Ricci, G., _Ann. Mat._ (1934), 295–303. + +[Te90] Tenenbaum, G., _Sur une question d'Erdős et Schinzel_ (1990), 405–443. + +*Reference:* [erdosproblems.com/976](https://www.erdosproblems.com/976) +-/ + +open Polynomial Filter + +namespace Erdos976 + +/-- The greatest prime factor of a natural number $n$, or $0$ if $n \leq 1$. -/ +def greatestPrimeFactor (n : ℕ) : ℕ := + n.primeFactorsList.foldr max 0 + +/-- The product of $|f(m)|$ for $m = 1, \ldots, n$. -/ +noncomputable def polyProduct (f : Polynomial ℤ) (n : ℕ) : ℕ := + ∏ m ∈ Finset.range n, (f.eval (↑(m + 1) : ℤ)).natAbs + +/-- +Let $f \in \mathbb{Z}[x]$ be an irreducible polynomial of degree $d \geq 2$. Let $F_f(n)$ be +the greatest prime divisor of $\prod_{m=1}^{n} f(m)$. Is it true that $F_f(n) \gg n^{1+c}$ +for some $c > 0$? + +Formalized as: there exist constants $c > 0$ and $C > 0$ such that for all sufficiently large +$n$, the greatest prime factor of $\prod_{m=1}^{n} |f(m)|$ is at least $C \cdot n^{1+c}$. +-/ +@[category research open, AMS 11] +theorem erdos_976 : answer(sorry) ↔ + ∀ (f : Polynomial ℤ), Irreducible f → 2 ≤ f.natDegree → + ∃ (c : ℝ) (C : ℝ), c > 0 ∧ C > 0 ∧ + ∀ᶠ n in atTop, + (greatestPrimeFactor (polyProduct f n) : ℝ) ≥ C * (n : ℝ) ^ (1 + c) := by + sorry + +/-- +Is it true that $F_f(n) \gg n^d$ where $d = \deg(f)$? + +Formalized as: there exists $C > 0$ such that for all sufficiently large $n$, +the greatest prime factor of $\prod_{m=1}^{n} |f(m)|$ is at least $C \cdot n^d$. +-/ +@[category research open, AMS 11] +theorem erdos_976.variants.strong : answer(sorry) ↔ + ∀ (f : Polynomial ℤ), Irreducible f → 2 ≤ f.natDegree → + ∃ (C : ℝ), C > 0 ∧ + ∀ᶠ n in atTop, + (greatestPrimeFactor (polyProduct f n) : ℝ) ≥ C * (n : ℝ) ^ (f.natDegree) := by + sorry + +end Erdos976 diff --git a/FormalConjectures/ErdosProblems/977.lean b/FormalConjectures/ErdosProblems/977.lean new file mode 100644 index 0000000000..8d5129ddac --- /dev/null +++ b/FormalConjectures/ErdosProblems/977.lean @@ -0,0 +1,83 @@ +/- +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.Nat.MaxPrimeFac + +/-! +# Erdős Problem 977 + +Erdős asked whether the greatest prime factor of $2^n - 1$ grows faster than +linearly in $n$, i.e., whether $P(2^n - 1)/n \to \infty$. + +Erdős also asked the analogous question for $P(n! + 1)$: does $P(n! + 1)/n \to \infty$? + +*Reference:* [erdosproblems.com/977](https://www.erdosproblems.com/977) + +[Er65b] Erdős, P., *Some recent advances and current problems in number theory*. +Lectures on Modern Mathematics **III** (1965), 196–244. + +[Sc62] Schinzel, A., *On primitive prime factors of $a^n - b^n$*. +Proceedings of the Cambridge Philosophical Society (1962), 555–562. + +[St74b] Stewart, C. L., *The greatest prime factor of $a^n - b^n$*. +Acta Arithmetica (1974/75), 427–433. + +[MuWo02] Murty, R. and Wong, S., *The ABC conjecture and prime divisors of the Lucas and +Lehmer sequences* (2002), 43–54. + +[St13] Stewart, C. L., *On divisors of Lucas and Lehmer numbers*. +Acta Mathematica (2013), 291–314. + +[La21] Lai, L., *On the largest prime divisor of $n! + 1$*. arXiv:2103.14894 (2021). + +OEIS sequences: A005420, A002583. +-/ + +open Filter Nat + +namespace Erdos977 + +/-- +Erdős Problem #977 [Er65b]: +If $P(m)$ denotes the greatest prime divisor of $m$, is it true that +$P(2^n - 1) / n \to \infty$ as $n \to \infty$? + +This was proved by Stewart [St13], who showed that +$P(2^n - 1) \gg n^{1 + 1/(104 \log \log n)}$ for all sufficiently large $n$. +Only the qualitative consequence (divergence to $\infty$) is formalized here. +-/ +@[category research solved, AMS 11] +theorem erdos_977 : + answer(True) ↔ + Tendsto (fun n : ℕ => (maxPrimeFac (2 ^ n - 1) : ℝ) / (n : ℝ)) + atTop atTop := by + sorry + +/-- +Variant of Erdős Problem #977: does $P(n! + 1) / n \to \infty$? + +Murty and Wong [MuWo02] proved $P(n! + 1) > (1 + o(1)) n \log n$ assuming the abc conjecture. +Lai [La21] proved unconditionally that $\limsup P(n! + 1) / n \geq 1 + 9 \log 2$. +-/ +@[category research open, AMS 11] +theorem erdos_977_variant_factorial : + answer(sorry) ↔ + Tendsto (fun n : ℕ => (maxPrimeFac (n.factorial + 1) : ℝ) / (n : ℝ)) + atTop atTop := by + sorry + +end Erdos977 diff --git a/FormalConjectures/ErdosProblems/98.lean b/FormalConjectures/ErdosProblems/98.lean new file mode 100644 index 0000000000..c6488f332b --- /dev/null +++ b/FormalConjectures/ErdosProblems/98.lean @@ -0,0 +1,97 @@ +/- +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 98 + +*Reference:* [erdosproblems.com/98](https://www.erdosproblems.com/98) + +Let $h(n)$ be the minimum number of distinct distances determined by $n$ points in +$\mathbb{R}^2$ with no three collinear and no four concyclic. Does $h(n)/n \to \infty$? + +[Er75f] Erdős, P., _Problems and results in combinatorial geometry_, 1975, p. 101. + +[Er83c] Erdős, P., _Old and new problems in combinatorial analysis and graph theory_, 1983. + +[Er87b] Erdős, P., _Some combinatorial and metric problems in geometry_. Intuitive geometry +(Siófok, 1985) (1987), 167-177. + +[Er90] Erdős, P., _Some of my favourite unsolved problems_. A tribute to Paul Erdős (1990), +467-478. + +[Er92b] Erdős, P., _Some of my old and new problems in elementary number theory and +geometry_. Proceedings of the Fifth Canadian Number Theory Association Conference (1992). + +[EFPR93] Erdős, P., Füredi, Z., Pach, J., and Ruzsa, I. Z., _The grid revisited_. +Discrete Mathematics (1993), 189-196. + +[Er94b] Erdős, P., _Some old and new problems in various branches of combinatorics_. +Discrete Math. 165/166 (1997), 227-231. + +[Er97e] Erdős, P., _Some problems and results on combinatorial number theory_ (1997). +-/ + +open EuclideanGeometry + +namespace Erdos98 + +/-- +A finite point set in $\mathbb{R}^2$ has no three collinear if every three-element subset +is not collinear (i.e., no line contains three or more of the points). +-/ +def NoThreeCollinear (P : Finset (ℝ²)) : Prop := + ∀ S : Finset (ℝ²), + S ⊆ P → S.card = 3 → ¬Collinear ℝ (S : Set (ℝ²)) + +/-- +Four points in $\mathbb{R}^2$ are concyclic if they all lie on a common circle, i.e., +there exists a center and positive radius such that all four points are +equidistant from the center. +-/ +def FourPointsConcyclic (S : Finset (ℝ²)) : Prop := + ∃ c : ℝ², ∃ r : ℝ, r > 0 ∧ ∀ p ∈ S, dist p c = r + +/-- +A finite point set in $\mathbb{R}^2$ has no four concyclic if every four-element subset +does not lie on a common circle. +-/ +def NoFourConcyclic (P : Finset (ℝ²)) : Prop := + ∀ S : Finset (ℝ²), + S ⊆ P → S.card = 4 → ¬FourPointsConcyclic S + +/-- +Erdős Problem 98: +Let $h(n)$ be the minimum number of distinct distances determined by any $n$ points +in $\mathbb{R}^2$ with no three collinear and no four concyclic. Does $h(n)/n \to \infty$? + +Formally: for every $C > 0$ there exists $N$ such that for all $n \geq N$ and every +set $P$ of $n$ points in $\mathbb{R}^2$ with no three collinear and no four concyclic, +the number of distinct distances is at least $C \cdot n$. +-/ +@[category research open, AMS 5 52] +theorem erdos_98 : answer(sorry) ↔ + ∀ C : ℝ, C > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∀ P : Finset ℝ², + P.card = n → + NoThreeCollinear P → + NoFourConcyclic P → + (distinctDistances P : ℝ) ≥ C * (n : ℝ) := by + sorry + +end Erdos98 diff --git a/FormalConjectures/ErdosProblems/980.lean b/FormalConjectures/ErdosProblems/980.lean new file mode 100644 index 0000000000..ad1d8f273a --- /dev/null +++ b/FormalConjectures/ErdosProblems/980.lean @@ -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 + +/-! +# Erdős Problem 980 + +*Reference:* [erdosproblems.com/980](https://www.erdosproblems.com/980) + +Let $k \geq 2$ and $n_k(p)$ denote the least $k$th power nonresidue of $p$. +Is it true that +$$\sum_{p < x} n_k(p) \sim c_k \cdot \frac{x}{\log x}$$ +for some constant $c_k > 0$? + +Proved by Erdős [Er61e] for $k = 2$, with $c_2 = \sum_{j=1}^{\infty} p_j / 2^j$. +The general case was proved by Elliott [El67b]. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Lectures on Modern Mathematics, +Vol. III (1965), 196–244. + +[Er61e] Erdős, P., _Remarks on number theory. I_. Mat. Lapok (1961), 10–17. + +[El67b] Elliott, P.D.T.A., _A problem of Erdős concerning power residue sums_. +Acta Arith. (1967/68), 131–149. +-/ + +open Real + +namespace Erdos980 + +/-- $a$ is a $k$th power residue modulo $p$ if there exists $b$ with $b^k \equiv a \pmod{p}$. -/ +def IsKthPowerResidue (k p a : ℕ) : Prop := + ∃ b : ℕ, b ^ k % p = a % p + +/-- The least $k$th power nonresidue of $p$: the smallest positive integer +that is not a $k$th power residue modulo $p$. Returns $0$ if no such number exists. -/ +noncomputable def leastKthPowerNonresidue (k p : ℕ) : ℕ := + sInf {a : ℕ | 0 < a ∧ ¬IsKthPowerResidue k p a} + +/-- +Erdős Problem 980 [Er65b]: + +For every $k \geq 2$, there exists a constant $c_k > 0$ such that +$$\sum_{\substack{p < x \\ p \text{ prime}}} n_k(p) \sim c_k \cdot \frac{x}{\log x}.$$ + +Formulated as: there exists $c_k > 0$ such that for every $\varepsilon > 0$, there exists $X_0$ +such that for all $x \geq X_0$, +$$\left|\sum_{\substack{p < x \\ p \text{ prime}}} n_k(p) - c_k \cdot \frac{x}{\log x}\right| +\leq \varepsilon \cdot \frac{x}{\log x}.$$ +-/ +@[category research solved, AMS 11] +theorem erdos_980 : answer(True) ↔ + ∀ k : ℕ, k ≥ 2 → + ∃ c : ℝ, c > 0 ∧ + ∀ ε : ℝ, ε > 0 → + ∃ X₀ : ℕ, ∀ x : ℕ, x ≥ X₀ → + |((Finset.filter (fun p => Nat.Prime p) (Finset.range x)).sum + (fun p => (leastKthPowerNonresidue k p : ℝ))) - + c * (x : ℝ) / log (x : ℝ)| ≤ + ε * (x : ℝ) / log (x : ℝ) := by + sorry + +end Erdos980 diff --git a/FormalConjectures/ErdosProblems/981.lean b/FormalConjectures/ErdosProblems/981.lean new file mode 100644 index 0000000000..f67d4a42c9 --- /dev/null +++ b/FormalConjectures/ErdosProblems/981.lean @@ -0,0 +1,71 @@ +/- +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 981 + +*Reference:* [erdosproblems.com/981](https://www.erdosproblems.com/981) + +For every ε > 0, let f_ε(p) be the smallest m such that ∑_{n≤N} (n/p) < εN for all N ≥ m. +Is it true that ∑_{p 0? +Proved by Elliott [El69]. + +[Er65b] Erdős, P., _Extremal problems in number theory_. Lectures on Modern Mathematics, +Vol. III (1965), 196-244. + +[El69] Elliott, P. D. T. A., _On the mean value of $f(p)$_. Proc. London Math. Soc. (3) 21 +(1970), 28–96. +-/ + +open Filter + +open scoped Topology Real + +namespace Erdos981 + +/-- The partial sum of Legendre symbols $(n/p)$ for $n = 1, \ldots, N$. + We use the Jacobi symbol which coincides with the Legendre symbol for prime $p$. -/ +def legendrePartialSum (p : ℕ) (N : ℕ) : ℤ := + (Finset.Icc 1 N).sum (fun n => jacobiSym (n : ℤ) p) + +/-- $f_\varepsilon(p)$: the smallest positive integer $m$ such that for all $N \ge m$, + $\sum_{n \le N} (n/p) < \varepsilon \cdot N$. Returns $0$ if no such $m$ exists. -/ +noncomputable def fEpsilon (ε : ℝ) (p : ℕ) : ℕ := + sInf {m : ℕ | m ≥ 1 ∧ ∀ N : ℕ, N ≥ m → (legendrePartialSum p N : ℝ) < ε * (N : ℝ)} + +/-- +Erdős Problem 981 (proved by Elliott [El69]): + +For every $\varepsilon > 0$, there exists $c_\varepsilon > 0$ such that +$$\sum_{\substack{p < x \\ p \text{ prime}}} f_\varepsilon(p) \sim c_\varepsilon \cdot +\frac{x}{\log x}.$$ + +Formulated as: the ratio $\sum_{p < x} f_\varepsilon(p) / (x / \log x)$ tends to +$c_\varepsilon$. +-/ +@[category research solved, AMS 11] +theorem erdos_981 (ε : ℝ) (hε : ε > 0) : + ∃ c : ℝ, c > 0 ∧ + Tendsto + (fun x : ℕ => + (((Finset.range x).filter Nat.Prime).sum (fun p => fEpsilon ε p) : ℝ) / + ((x : ℝ) / Real.log (x : ℝ))) + atTop (nhds c) := by + sorry + +end Erdos981 diff --git a/FormalConjectures/ErdosProblems/983.lean b/FormalConjectures/ErdosProblems/983.lean new file mode 100644 index 0000000000..61d43a3dbc --- /dev/null +++ b/FormalConjectures/ErdosProblems/983.lean @@ -0,0 +1,63 @@ +/- +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 983 + +*Reference:* [erdosproblems.com/983](https://www.erdosproblems.com/983) + +Let $n \geq 2$ and $\pi(n) < k \leq n$. Let $f(k,n)$ be the smallest integer $r$ such that +in any $A \subseteq \{1,\ldots,n\}$ of size $|A| = k$ there exist primes $p_1,\ldots,p_r$ such +that more than $r$ elements $a \in A$ are only divisible by primes from $\{p_1,\ldots,p_r\}$. + +[Er70b, p. 138] Erdős, P. and Straus, E.G. +-/ + +open Classical + +namespace Erdos983 + +/-- A natural number $a$ is smooth with respect to a set of primes $P$ if every +prime factor of $a$ belongs to $P$. -/ +def IsSmoothWrt (a : ℕ) (P : Finset ℕ) : Prop := + ∀ p : ℕ, Nat.Prime p → p ∣ a → p ∈ P + +/-- $f(k,n)$ is the smallest integer $r$ such that in any $A \subseteq \{1,\ldots,n\}$ of size +$|A| = k$, there exist $r$ primes $p_1,\ldots,p_r$ such that more than $r$ elements of $A$ are +only divisible by primes from $\{p_1,\ldots,p_r\}$. -/ +noncomputable def smoothCoveringNumber (k n : ℕ) : ℕ := + sInf {r : ℕ | ∀ A : Finset ℕ, (∀ a ∈ A, 1 ≤ a ∧ a ≤ n) → A.card = k → + ∃ P : Finset ℕ, (∀ p ∈ P, Nat.Prime p) ∧ P.card = r ∧ + ∃ B : Finset ℕ, B ⊆ A ∧ B.card > r ∧ ∀ b ∈ B, IsSmoothWrt b P} + +/-- +Erdős Problem 983 [Er70b]: + +Is it true that $2\pi(\sqrt{n}) - f(\pi(n)+1, n) \to \infty$ as $n \to \infty$? + +Formulated as: for every $M$, there exists $N_0$ such that for all $n \geq N_0$, +$f(\pi(n)+1, n) + M \leq 2\pi(\lfloor\sqrt{n}\rfloor)$. +-/ +@[category research open, AMS 5 11] +theorem erdos_983 : + answer(sorry) ↔ + ∀ M : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + smoothCoveringNumber (Nat.primeCounting n + 1) n + M ≤ 2 * Nat.primeCounting (Nat.sqrt n) := by + sorry + +end Erdos983 diff --git a/FormalConjectures/ErdosProblems/984.lean b/FormalConjectures/ErdosProblems/984.lean new file mode 100644 index 0000000000..ad89c81a79 --- /dev/null +++ b/FormalConjectures/ErdosProblems/984.lean @@ -0,0 +1,60 @@ +/- +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 984 + +*Reference:* [erdosproblems.com/984](https://www.erdosproblems.com/984) + +Can $\mathbb{N}$ be 2-coloured such that if $\{a, a+d, \ldots, a+(k-1)d\}$ is a $k$-term +monochromatic arithmetic progression then $k \ll_\varepsilon a^\varepsilon$ for all +$\varepsilon > 0$? + +A question of Spencer, who proved that this is possible with 3 colours, +with $a^\varepsilon$ replaced by a very slowly growing function $h(a)$ (the inverse of +the van der Waerden function). Erdős reports that he can construct such a +colouring with the bound $k \ll a^{1-c}$ for some absolute constant $c > 0$. + +Zach Hunter proved that the answer is yes. + +[Er80] Erdős, P., _On some problems in combinatorial number theory_ (1980). +-/ + +namespace Erdos984 + +/-- An arithmetic progression $\{a, a+d, \ldots, a+(k-1)d\}$ is monochromatic under + colouring $c$ if all its elements receive the same colour. -/ +def IsMonochromaticAP (c : ℕ → Fin 2) (a d k : ℕ) : Prop := + d ≥ 1 ∧ k ≥ 1 ∧ ∃ color : Fin 2, ∀ i : ℕ, i < k → c (a + i * d) = color + +/-- +Erdős Problem 984 [Er80]: + +There exists a 2-colouring of $\mathbb{N}$ such that for every $\varepsilon > 0$, there is a +constant $C > 0$ such that every $k$-term monochromatic arithmetic progression +$\{a, a+d, \ldots, a+(k-1)d\}$ with $a \ge 1$ satisfies $k \le C \cdot a^\varepsilon$. +-/ +@[category research solved, AMS 5] +theorem erdos_984 : answer(True) ↔ + ∃ c : ℕ → Fin 2, ∀ ε : ℝ, ε > 0 → + ∃ C : ℝ, C > 0 ∧ ∀ a d k : ℕ, a ≥ 1 → + IsMonochromaticAP c a d k → + (k : ℝ) ≤ C * (a : ℝ) ^ ε := by + sorry + +end Erdos984 diff --git a/FormalConjectures/ErdosProblems/986.lean b/FormalConjectures/ErdosProblems/986.lean new file mode 100644 index 0000000000..2e3440eace --- /dev/null +++ b/FormalConjectures/ErdosProblems/986.lean @@ -0,0 +1,150 @@ +/- +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 986 + +*Reference:* [erdosproblems.com/986](https://www.erdosproblems.com/986) + +Erdős conjectured that for any fixed $k \geq 3$, the Ramsey number $R(k,n)$ satisfies +$R(k,n) \gg n^{k-1}/(\log n)^c$ for some constant $c > 0$. + +Spencer [Sp77] proved the $k = 3$ case and Mattheus and Verstraëte [MaVe23] +proved the $k = 4$ case. + +The best general bounds available are: +$$ +n^{(k+1)/2} / (\log n)^{1/(k-2) - (k+1)/2} \ll_k R(k,n) \ll_k n^{k-1} / (\log n)^{k-2} +$$ +The lower bound was proved by Bohman and Keevash [BoKe10]. +The upper bound was proved by Ajtai, Komlós, and Szemerédi [AKS80]. +Li, Rousseau, and Zang [LRZ01] improved the upper bound constant. + +[Sp77] Spencer, J., _Asymptotic lower bounds for Ramsey functions_. Discrete Math. 20 (1977), +69-76. + +[MaVe23] Mattheus, S. and Verstraëte, J., _The asymptotics of $r(4,t)$_. Ann. of Math. 199 +(2024), 919-941. + +[BoKe10] Bohman, T. and Keevash, P., _The early evolution of the $H$-free process_. Invent. +Math. 181 (2010), 291-336. + +[AKS80] Ajtai, M., Komlós, J. and Szemerédi, E., _A note on Ramsey numbers_. J. Combin. +Theory Ser. A 29 (1980), 354-360. + +[LRZ01] Li, Y., Rousseau, C. C. and Zang, W., _Asymptotic upper bounds for Ramsey functions_. +Graphs Combin. 17 (2001), 123-128. + +[Er90b] Erdős, P., _Some of my favourite problems in various branches of combinatorics_. +Matematiche (Catania) 47 (1992), 231-240. + +See also Problem 165 (k=3 case), Problem 166 (k=4 case), Problem 920 (chromatic number +connection). + +OEIS sequences: [A000791](https://oeis.org/A000791), [A059442](https://oeis.org/A059442). +-/ + +open SimpleGraph Real + +namespace Erdos986 + +/-- The Ramsey number $R(k,n)$: the minimum $N$ such that every simple graph +on $N$ vertices contains either a $k$-clique or an independent set of +size $n$ (an $n$-clique in the complement). -/ +noncomputable def ramseyR (k n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree n} + +/-- +Erdős Conjecture (Problem #986) [Er90b]: + +For any fixed $k \geq 3$, there exist constants $C > 0$ and $c \in \mathbb{N}$ with $c > 0$ +such that for all sufficiently large $n$: +$$ +R(k,n) \geq C \cdot n^{k-1} / (\log n)^c. +$$ +In asymptotic notation: $R(k,n) \gg n^{k-1}/(\log n)^c$ for some $c > 0$. +-/ +@[category research open, AMS 5] +theorem erdos_986 (k : ℕ) (hk : 3 ≤ k) : + ∃ C : ℝ, 0 < C ∧ + ∃ c : ℕ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * ((n : ℝ) ^ (k - 1) / (Real.log (n : ℝ)) ^ c) ≤ (ramseyR k n : ℝ) := by + sorry + +/-- +Spencer's theorem (1977) [Sp77]: the $k = 3$ case of Erdős Problem 986. + +There exist constants $C > 0$ and $c \in \mathbb{N}$ with $c > 0$ such that for all +sufficiently large $n$, $R(3,n) \geq C \cdot n^2 / (\log n)^c$. + +See also Problem 165. +-/ +@[category research solved, AMS 5] +theorem erdos_986_k_eq_3 : + ∃ C : ℝ, 0 < C ∧ + ∃ c : ℕ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * ((n : ℝ) ^ 2 / (Real.log (n : ℝ)) ^ c) ≤ (ramseyR 3 n : ℝ) := by + sorry + +/-- +Mattheus–Verstraëte theorem (2023) [MaVe23]: the $k = 4$ case of Erdős Problem 986. + +There exist constants $C > 0$ and $c \in \mathbb{N}$ with $c > 0$ such that for all +sufficiently large $n$, $R(4,n) \geq C \cdot n^3 / (\log n)^c$. + +See also Problem 166. +-/ +@[category research solved, AMS 5] +theorem erdos_986_k_eq_4 : + ∃ C : ℝ, 0 < C ∧ + ∃ c : ℕ, 0 < c ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * ((n : ℝ) ^ 3 / (Real.log (n : ℝ)) ^ c) ≤ (ramseyR 4 n : ℝ) := by + sorry + +/-- +Ajtai–Komlós–Szemerédi upper bound (1980) [AKS80]: + +For any fixed $k \geq 3$, there exists a constant $C > 0$ such that for all sufficiently +large $n$, $R(k,n) \leq C \cdot n^{k-1} / (\log n)^{k-2}$. +-/ +@[category research solved, AMS 5] +theorem erdos_986_upper (k : ℕ) (hk : 3 ≤ k) : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (ramseyR k n : ℝ) ≤ C * ((n : ℝ) ^ (k - 1) / (Real.log (n : ℝ)) ^ (k - 2)) := by + sorry + +/-- +Bohman–Keevash lower bound (2010) [BoKe10]: + +For any fixed $k \geq 3$, there exists a constant $C > 0$ such that for all sufficiently +large $n$, $R(k,n) \geq C \cdot n^{(k+1)/2} / (\log n)^{(k+1)/2 - 1/(k-2)}$. +-/ +@[category research solved, AMS 5] +theorem erdos_986_lower (k : ℕ) (hk : 3 ≤ k) : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * (((n : ℝ) ^ (((k : ℝ) + 1) / 2)) / + ((Real.log (n : ℝ)) ^ (((k : ℝ) + 1) / 2 - 1 / ((k : ℝ) - 2)))) ≤ + (ramseyR k n : ℝ) := by + sorry + +end Erdos986 diff --git a/FormalConjectures/ErdosProblems/987.lean b/FormalConjectures/ErdosProblems/987.lean new file mode 100644 index 0000000000..e8880804ab --- /dev/null +++ b/FormalConjectures/ErdosProblems/987.lean @@ -0,0 +1,93 @@ +/- +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 987 + +*Reference:* [erdosproblems.com/987](https://www.erdosproblems.com/987) + +Let $x_1, x_2, \ldots \in (0,1)$ be an infinite sequence and define +$$A_k = \limsup_{n \to \infty} \left|\sum_{j \leq n} e(k \cdot x_j)\right|$$ +where $e(x) = e^{2\pi ix}$. + +This is Problem 7.21 in Halberstam and Roth [Ha74], attributed to +Erdős [Er64b][Er65b]. + +Erdős remarks the analogous statement with $\sup_n$ in place of +$\limsup_n$ is 'easy to see'. Erdős [Er65b] later found a 'very easy' +proof that $A_k \gg \log k$ for infinitely many $k$. +Clunie [Cl67] proved $A_k \gg k^{1/2}$ infinitely often, and showed +there exist sequences with $A_k \leq k$ for all $k$. +Tao has independently found a proof that $A_k \gg k^{1/2}$ infinitely +often. Lindström [Li69] showed that under a finite distinct points +assumption, $A_k \gg k^{1-\varepsilon}$ infinitely often for any +$\varepsilon > 0$; Clunie observed this implies $A_k = \infty$ +infinitely often. + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[Er65b] Erdős, P., _Some recent advances and current problems in number theory_. +Lectures on Modern Mathematics, Vol. III (1965), 196–244. + +[Ha74] Halberstam, H. and Roth, K. F., *Sequences*, 1974. + +[Cl67] Clunie, J., _On a problem of Erdős_. J. London Math. Soc. (1967), 133–136. + +[Li69] Lindström, B., _An inequality for B₂-sequences_. J. Combinatorial Theory +(1969), 211–212. +-/ + +namespace Erdos987 + +/-- The exponential sum $S(x, k, n) = \sum_{j < n} e^{2\pi i k x_j}$. -/ +noncomputable def exponentialSum (x : ℕ → ℝ) (k : ℕ) (n : ℕ) : ℂ := + -- e(k·xⱼ) = e^{2πikxⱼ} + ∑ j ∈ Finset.range n, Complex.exp (2 * ↑Real.pi * Complex.I * ↑((k : ℝ) * x j)) + +/-- +Erdős Problem 987, Part 1 [Er64b][Er65b]: +For any sequence $x_1, x_2, \ldots \in (0,1)$, $\sup_{k \geq 1} A_k = \infty$ where +$A_k = \limsup_{n \to \infty} \lVert\sum_{j < n} e^{2\pi i k x_j}\rVert$. + +Equivalently: for every $M$, there exists $k > 0$ such that +$\lVert\sum_{j < n} e^{2\pi i k x_j}\rVert \geq M$ for infinitely many $n$. +(This is equivalent to $\limsup_{k \to \infty} A_k = \infty$ since +$\sup_k = \infty \iff \limsup_k = \infty$ for extended-real-valued sequences.) +-/ +@[category research open, AMS 11 42] +theorem erdos_987 : + ∀ (x : ℕ → ℝ), (∀ j, x j ∈ Set.Ioo 0 1) → + ∀ M : ℝ, ∃ k : ℕ, 0 < k ∧ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + M ≤ ‖exponentialSum x k n‖ := by + sorry + +/-- +Erdős Problem 987, Part 2 [Er65b][Ha74]: +It is not possible for $A_k = o(k)$. For any sequence $x_1, x_2, \ldots \in (0,1)$, +there exists $c > 0$ such that for infinitely many $k$, +$\lVert\sum_{j < n} e^{2\pi i k x_j}\rVert \geq c \cdot k$ for infinitely many $n$. +-/ +@[category research open, AMS 11 42] +theorem erdos_987.variants.not_little_o : + ∀ (x : ℕ → ℝ), (∀ j, x j ∈ Set.Ioo 0 1) → + ∃ c : ℝ, 0 < c ∧ ∀ K₀ : ℕ, ∃ k : ℕ, K₀ ≤ k ∧ + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ c * ↑k ≤ ‖exponentialSum x k n‖ := by + sorry + +end Erdos987 diff --git a/FormalConjectures/ErdosProblems/988.lean b/FormalConjectures/ErdosProblems/988.lean new file mode 100644 index 0000000000..41fcb78c96 --- /dev/null +++ b/FormalConjectures/ErdosProblems/988.lean @@ -0,0 +1,71 @@ +/- +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 988 + +*Reference:* [erdosproblems.com/988](https://www.erdosproblems.com/988) + +If $P \subseteq S^2$ is a subset of the unit sphere then define the discrepancy +$$D(P) = \max_C \left| |C \cap P| - \alpha_C |P| \right|,$$ +where the maximum is taken over all spherical caps $C$, and $\alpha_C$ is the +appropriately normalised measure of $C$. + +Is it true that $\min_{|P|=n} D(P) \to \infty$ as $n \to \infty$? + +Roth [Ro54] proved that the answer is yes if the sphere is replaced by a square. +This was proved (in any number of dimensions) by Schmidt [Sc69b]. + +[Er64b] Erdős, P., *On some problems in number theory*, 1964. + +[Ro54] Roth, K. F., *On irregularities of distribution.* Mathematika **1** +(1954), 73–79. + +[Sc69b] Schmidt, W. M., *Irregularities of distribution. IV.* Invent. Math. **7** +(1969), 55–82. +-/ + +open Classical + +namespace Erdos988 + +/-- +Erdős Problem 988 [Er64b]: + +For every $M > 0$, there exists $N_0$ such that for every finite set $P$ of points +on the unit sphere $S^2$ in $\mathbb{R}^3$ with $|P| \geq N_0$, there exists a spherical cap +$C(v,t) = \{x \in S^2 : \langle x, v \rangle \geq t\}$ (with $v$ a unit vector and +$t \in [-1,1]$) such that the discrepancy +$\left||C(v,t) \cap P| - \frac{1-t}{2} \cdot |P|\right| \geq M$. + +Here $\frac{1-t}{2}$ is the normalised surface area measure of the cap $C(v,t)$ on $S^2$. +-/ +@[category research solved, AMS 11 52] +theorem erdos_988 : + answer(True) ↔ + ∀ M : ℝ, M > 0 → + ∃ N₀ : ℕ, ∀ (P : Finset (EuclideanSpace ℝ (Fin 3))), + (∀ p ∈ P, ‖p‖ = 1) → + P.card ≥ N₀ → + ∃ (v : EuclideanSpace ℝ (Fin 3)) (t : ℝ), + ‖v‖ = 1 ∧ -1 ≤ t ∧ t ≤ 1 ∧ + |((P.filter (fun x => @inner ℝ _ _ x v ≥ t)).card : ℝ) - + (1 - t) / 2 * (P.card : ℝ)| ≥ M := by + sorry + +end Erdos988 diff --git a/FormalConjectures/ErdosProblems/989.lean b/FormalConjectures/ErdosProblems/989.lean new file mode 100644 index 0000000000..6078af57e5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/989.lean @@ -0,0 +1,95 @@ +/- +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 989 + +*Reference:* [erdosproblems.com/989](https://www.erdosproblems.com/989) + +If $A = \{z_1, z_2, \ldots\} \subset \mathbb{R}^2$ is an infinite sequence then let +$$ + f(r) = \sup_C \left| |A \cap C| - \pi r^2 \right|, +$$ +where the supremum is over all closed disks $C$ of radius $r$. + +Is $f(r)$ unbounded for every $A$? How fast does $f(r)$ grow? + +This was settled by Beck [Be87], who proved that $f(r) \gg r^{1/2}$ for all $A$, +and there exists $A$ such that $f(r) \ll (r \log r)^{1/2}$. + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[Be87] Beck, J., _Irregularities of distribution. I_, Acta Math. 159 (1987), 1–49. +-/ + +namespace Erdos989 + +/-- Euclidean distance in $\mathbb{R}^2$. -/ +noncomputable def euclidDist (p q : ℝ × ℝ) : ℝ := + Real.sqrt ((p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2) + +/-- A sequence is locally finite if every closed disk contains only finitely +many terms of the sequence. -/ +def IsLocallyFinite (A : ℕ → ℝ × ℝ) : Prop := + ∀ (c : ℝ × ℝ) (r : ℝ), Set.Finite {i : ℕ | euclidDist (A i) c ≤ r} + +/-- Number of terms of $A$ in the closed disk centered at $c$ with radius $r$. -/ +noncomputable def countInDisk (A : ℕ → ℝ × ℝ) (c : ℝ × ℝ) (r : ℝ) : ℕ := + Set.ncard {i : ℕ | euclidDist (A i) c ≤ r} + +/-- The discrepancy $f(r) = \sup_c \left| |A \cap \mathrm{disk}(c,r)| - \pi r^2 \right|$. -/ +noncomputable def discrepancy (A : ℕ → ℝ × ℝ) (r : ℝ) : ℝ := + ⨆ (c : ℝ × ℝ), |↑(countInDisk A c r) - Real.pi * r ^ 2| + +/-- +Erdős Problem 989, Beck's lower bound [Be87]: +For every locally finite sequence $A$ in $\mathbb{R}^2$, there exists $C > 0$ such that +for all sufficiently large $r$, there exists a center $c$ with +$\left| |A \cap \mathrm{disk}(c,r)| - \pi r^2 \right| \geq C \cdot \sqrt{r}$. +In particular, $f(r)$ is unbounded for every such $A$. + +This is formulated existentially over the center $c$ rather than using `discrepancy` +(which takes a supremum via `⨆` on `ℝ`) to avoid the issue that `iSup` on a +`ConditionallyCompleteLattice` requires `BddAbove`, which may not hold. +-/ +@[category research solved, AMS 11] +theorem erdos_989 (A : ℕ → ℝ × ℝ) (hA : IsLocallyFinite A) : + ∃ C : ℝ, C > 0 ∧ ∃ R₀ : ℝ, ∀ r : ℝ, r ≥ R₀ → + ∃ c : ℝ × ℝ, |↑(countInDisk A c r) - Real.pi * r ^ 2| ≥ C * Real.sqrt r := by + sorry + +/-- +Erdős Problem 989, Beck's upper bound [Be87]: +There exists a locally finite sequence $A$ in $\mathbb{R}^2$ and $C > 0$ such that +for all sufficiently large $r$ and all centers $c$, +$\left| |A \cap \mathrm{disk}(c,r)| - \pi r^2 \right| \leq C \cdot \sqrt{r \cdot \log r}$. + +This is formulated universally over the center $c$ rather than using `discrepancy` +(which takes a supremum via `⨆` on `ℝ`) to avoid the issue that `iSup` on a +`ConditionallyCompleteLattice` requires `BddAbove`. +-/ +@[category research solved, AMS 11] +theorem erdos_989.variants.upper_bound : + ∃ (A : ℕ → ℝ × ℝ), IsLocallyFinite A ∧ + ∃ C : ℝ, C > 0 ∧ ∃ R₀ : ℝ, ∀ r : ℝ, r ≥ R₀ → + ∀ c : ℝ × ℝ, + |↑(countInDisk A c r) - Real.pi * r ^ 2| ≤ C * Real.sqrt (r * Real.log r) := by + sorry + +end Erdos989 diff --git a/FormalConjectures/ErdosProblems/990.lean b/FormalConjectures/ErdosProblems/990.lean new file mode 100644 index 0000000000..6c33cc8221 --- /dev/null +++ b/FormalConjectures/ErdosProblems/990.lean @@ -0,0 +1,81 @@ +/- +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 990 + +*Reference:* [erdosproblems.com/990](https://www.erdosproblems.com/990) + +Can the Erdős–Turán bound on the distribution of polynomial root arguments be improved by +replacing the degree with the number of non-zero coefficients? + +[ErTu50] Erdős, P. and Turán, P., *On the distribution of roots of polynomials*. Ann. of Math. +(2) (1950), 105–119. + +[Er64b] Erdős, P., *On some problems relating to the distribution of roots of polynomials* (1964). +-/ + +open Polynomial Complex Real Finset + +open scoped BigOperators + +namespace Erdos990 + +/-- The argument of a complex number normalized to $[0, 2\pi)$. +Returns $0$ for $z = 0$. -/ +noncomputable def Complex.arg2pi (z : ℂ) : ℝ := + if Complex.arg z < 0 then Complex.arg z + 2 * Real.pi else Complex.arg z + +/-- The number of roots (counted with multiplicity) of a polynomial whose +argument lies in the interval $[\alpha, \beta]$. -/ +noncomputable def rootArgCount (f : Polynomial ℂ) (α β : ℝ) : ℕ := + (f.roots.map Complex.arg2pi).countP (fun θ => decide (α ≤ θ ∧ θ ≤ β)) + +/-- The Erdős–Turán measure +$M(f) = \frac{|a_0| + \cdots + |a_d|}{\sqrt{|a_0| \cdot |a_d|}}$. -/ +noncomputable def erdosTuranMeasure (f : Polynomial ℂ) : ℝ := + (∑ i ∈ Finset.range (f.natDegree + 1), ‖f.coeff i‖) / + Real.sqrt (‖f.coeff 0‖ * ‖f.leadingCoeff‖) + +/-- +Erdős Problem 990 [Er64b]: + +Let $f = a_0 + \cdots + a_d x^d \in \mathbb{C}[x]$ be a polynomial with roots +$z_1, \ldots, z_d$ with corresponding arguments $\theta_1, \ldots, \theta_d \in [0, 2\pi)$. +Is it true that for all intervals $[\alpha, \beta] \subseteq [0, 2\pi)$, +$$ +\left|\#\{\theta_i \in [\alpha, \beta]\} - \frac{\beta - \alpha}{2\pi} \cdot d\right| + \leq C \cdot \sqrt{n \cdot \log M} +$$ +where $C$ is an absolute constant, $n$ is the number of non-zero coefficients of $f$, and +$M = \frac{|a_0| + \cdots + |a_d|}{\sqrt{|a_0| \cdot |a_d|}}$? + +Erdős and Turán [ErTu50] proved such an upper bound with $n$ replaced by $d$ (the degree). +-/ +@[category research open, AMS 12 30] +theorem erdos_990 : answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ + ∀ (f : Polynomial ℂ), + f.natDegree ≥ 1 → + f.coeff 0 ≠ 0 → + ∀ (α β : ℝ), 0 ≤ α → α ≤ β → β ≤ 2 * Real.pi → + |(rootArgCount f α β : ℝ) - (β - α) / (2 * Real.pi) * ↑f.natDegree| ≤ + C * Real.sqrt (↑f.support.card * Real.log (erdosTuranMeasure f)) := by + sorry + +end Erdos990 diff --git a/FormalConjectures/ErdosProblems/991.lean b/FormalConjectures/ErdosProblems/991.lean new file mode 100644 index 0000000000..12e1ba8365 --- /dev/null +++ b/FormalConjectures/ErdosProblems/991.lean @@ -0,0 +1,92 @@ +/- +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 991 + +*Reference:* [erdosproblems.com/991](https://www.erdosproblems.com/991) + +Suppose $A = \{w_1, \ldots, w_n\} \subset S^2$ maximises $\prod_{i 0$, if $n$ is large enough and $P$ is any set of $n$ Fekete points, +then for every spherical cap $C(v,t) = \{x \in S^2 : \langle x,v \rangle \geq t\}$, +$$ + \left| |P \cap C(v,t)| - \frac{1-t}{2} \cdot n \right| \leq \varepsilon \cdot n. +$$ + +Here $\frac{1-t}{2}$ is the normalised surface area of the cap $C(v,t)$ on $S^2$. +-/ +@[category research solved, AMS 31 52] +theorem erdos_991 : + answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ (P : Finset (ℝ³)), + IsMaxPairwiseDist P → + P.card ≥ N₀ → + ∀ (v : ℝ³) (t : ℝ), + ‖v‖ = 1 → -1 ≤ t → t ≤ 1 → + |((P.filter (fun x => @inner ℝ _ _ x v ≥ t)).card : ℝ) - + (1 - t) / 2 * (P.card : ℝ)| ≤ ε * (P.card : ℝ) := by + sorry + +end Erdos991 diff --git a/FormalConjectures/ErdosProblems/992.lean b/FormalConjectures/ErdosProblems/992.lean new file mode 100644 index 0000000000..5b94e69d0a --- /dev/null +++ b/FormalConjectures/ErdosProblems/992.lean @@ -0,0 +1,141 @@ +/- +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.NumberTheory.Lacunary + +/-! +# Erdős Problem 992 + +*References:* +- [erdosproblems.com/992](https://www.erdosproblems.com/992) +- [Er64b] Erdős, P., _Problems and results on diophantine approximations_. Compositio Math. + (1964), 52–65. +- [ErKo49] Erdős, P. and Koksma, J. F., _On the uniform distribution modulo 1 of sequences_. + Nederl. Akad. Wetensch., Proc. (1949), 851–854 = Indagationes Math. 11, 299–302. +- [Ca50] Cassels, J. W. S., _Some metrical theorems of Diophantine approximation. III_. Proc. + Cambridge Philos. Soc. (1950), 219–225. +- [Ba81] Baker, R. C., _Metric number theory and the large sieve_. J. London Math. Soc. (2) + (1981), 34–40. +- [BePh94] Berkes, I. and Philipp, W., _The size of trigonometric and Walsh series and uniform + distribution mod 1_. J. London Math. Soc. (2) (1994), 454–464. + +Let $x_1 < x_2 < \cdots$ be an infinite sequence of integers. Is it true that, for +almost all $\alpha \in [0,1]$, the discrepancy +$$D(N) = \max_{I \subseteq [0,1]} |\#\{n \le N : \{\alpha x_n\} \in I\} - |I| \cdot N|$$ +satisfies $D(N) \ll N^{1/2} (\log N)^{o(1)}$? Or even $D(N) \ll N^{1/2} (\log \log N)^{O(1)}$? + +Erdős and Koksma [ErKo49] and Cassels [Ca50] independently proved that, for any +sequence $x_i$ and almost all $\alpha$, $D(N) \ll N^{1/2} (\log N)^{5/2 + o(1)}$. Baker [Ba81] +improved this to $D(N) \ll N^{1/2} (\log N)^{3/2 + o(1)}$. + +Erdős and Gál (unpublished) proved that for lacunary sequences (where +$x_{i+1}/x_i > \lambda > 1$ for all $i$), the stronger bound +$D(N) \ll N^{1/2} (\log \log N)^{O(1)}$ holds for almost all $\alpha$. + +This was disproved (for general sequences) by Berkes and Philipp [BePh94], who +constructed a sequence of integers $x_1 < x_2 < \cdots$ such that, for almost all +$\alpha \in [0,1]$, +$$\limsup_{N \to \infty} D(N) / (N \log N)^{1/2} > 0.$$ +-/ + +open Filter MeasureTheory Finset + +namespace Erdos992 + +/-- The discrepancy of the sequence $\{\alpha \cdot x(n)\} \pmod{1}$ with respect to +subintervals of $[0,1)$. +$$D(N) = \sup_{0 \le a < b \le 1} |\#\{n < N : \{\alpha \cdot x(n)\} \in [a, b)\} - (b - a) \cdot N|$$ -/ +noncomputable def discrepancy (x : ℕ → ℤ) (α : ℝ) (N : ℕ) : ℝ := + sSup {d : ℝ | ∃ a b : ℝ, 0 ≤ a ∧ a < b ∧ b ≤ 1 ∧ + d = abs (((Finset.range N).filter (fun n => + a ≤ Int.fract (α * (x n : ℝ)) ∧ Int.fract (α * (x n : ℝ)) < b)).card - + (b - a) * (N : ℝ))} + +/-- +Erdős Problem 992 (disproved by Berkes and Philipp [BePh94]): + +Is it true that for every strictly increasing sequence of positive integers +$x_1 < x_2 < \cdots$ and almost all $\alpha \in [0,1]$, the discrepancy satisfies +$D(N) \ll N^{1/2} (\log N)^{o(1)}$? + +Here $D(N) \ll N^{1/2} (\log N)^{o(1)}$ is formalized as: for every $\varepsilon > 0$, +there exists $C > 0$ such that $D(N) \le C \sqrt{N} (\log N)^\varepsilon$ for all +sufficiently large $N$. +-/ +@[category research solved, AMS 11 28] +theorem erdos_992 : answer(False) ↔ + ∀ (x : ℕ → ℤ), StrictMono x → (∀ n, 0 < x n) → + ∀ᵐ α ∂(volume.restrict (Set.Icc (0 : ℝ) 1)), + ∀ ε : ℝ, ε > 0 → + ∃ C : ℝ, C > 0 ∧ + ∀ᶠ N in atTop, + discrepancy x α N ≤ + C * Real.sqrt (N : ℝ) * (Real.log (N : ℝ)) ^ ε := by + sorry + +/-- +Erdős Problem 992, stronger variant (also disproved by [BePh94]): + +Is it true that $D(N) \ll N^{1/2} (\log \log N)^{O(1)}$? Here this is formalized as: +there exist $C > 0$ and $K > 0$ such that $D(N) \le C \sqrt{N} (\log \log N)^K$ for +all sufficiently large $N$. +-/ +@[category research solved, AMS 11 28] +theorem erdos_992.variants.stronger : answer(False) ↔ + ∀ (x : ℕ → ℤ), StrictMono x → (∀ n, 0 < x n) → + ∀ᵐ α ∂(volume.restrict (Set.Icc (0 : ℝ) 1)), + ∃ C : ℝ, C > 0 ∧ ∃ K : ℝ, K > 0 ∧ + ∀ᶠ N in atTop, + discrepancy x α N ≤ + C * Real.sqrt (N : ℝ) * + (Real.log (Real.log (N : ℝ))) ^ K := by + sorry + +/-- +Berkes and Philipp [BePh94] disproved Erdős Problem 992 by constructing a +strictly increasing sequence of positive integers such that for almost all +$\alpha \in [0,1]$, +$$\limsup_{N \to \infty} D(N) / (N \log N)^{1/2} > 0.$$ +-/ +@[category research solved, AMS 11 28] +theorem erdos_992.variants.berkes_philipp : + ∃ (x : ℕ → ℤ), StrictMono x ∧ (∀ n, 0 < x n) ∧ + ∀ᵐ α ∂(volume.restrict (Set.Icc (0 : ℝ) 1)), + ∃ c : ℝ, c > 0 ∧ + ∃ᶠ N in atTop, + discrepancy x α N ≥ + c * Real.sqrt ((N : ℝ) * Real.log (N : ℝ)) := by + sorry + +/-- +Erdős–Gál (unpublished): for lacunary sequences (where $x_{i+1}/x_i > \lambda > 1$), +the stronger bound $D(N) \ll N^{1/2} (\log \log N)^{O(1)}$ holds for almost all +$\alpha \in [0,1]$. Here this is formalized as: there exist $C > 0$ and $K > 0$ +such that $D(N) \le C \sqrt{N} (\log \log N)^K$ for all sufficiently large $N$. +-/ +@[category research solved, AMS 11 28] +theorem erdos_992.variants.erdos_gal : + ∀ (x : ℕ → ℕ), IsLacunary x → + ∀ᵐ α ∂(volume.restrict (Set.Icc (0 : ℝ) 1)), + ∃ C : ℝ, C > 0 ∧ ∃ K : ℝ, K > 0 ∧ + ∀ᶠ N in atTop, + discrepancy (fun n => (x n : ℤ)) α N ≤ + C * Real.sqrt (N : ℝ) * + (Real.log (Real.log (N : ℝ))) ^ K := by + sorry + +end Erdos992 diff --git a/FormalConjectures/ErdosProblems/993.lean b/FormalConjectures/ErdosProblems/993.lean new file mode 100644 index 0000000000..0120078be1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/993.lean @@ -0,0 +1,66 @@ +/- +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 993 + +*Reference:* [erdosproblems.com/993](https://www.erdosproblems.com/993) + +A question of Alavi, Malde, Schwenk, and Erdős [AMSE87], who showed that the independent set +sequence is not constrained for general graphs (in fact every possible pattern of inequalities +is achieved by some graph). + +Schwenk [Sc81] proved the analogous result for independent edge sets (matchings): the matching +sequence of any graph is unimodal. + +[AMSE87] Alavi, Y., Malde, P. J., Schwenk, A. J., and Erdős, P., *The vertex independence +sequence of a graph is not constrained*. Congressus Numerantium (1987), 58, 15-23. + +[Sc81] Schwenk, A. J., *On unimodal sequences of graphical invariants*. J. Combin. Theory +Ser. B (1981), 247–250. +-/ + +open SimpleGraph + +namespace Erdos993 + +/-- The number of independent sets of size $k$ in a simple graph $G$. +An independent set is a set of vertices that are pairwise non-adjacent. -/ +def numIndepSets {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ) : ℕ := + (Finset.univ.powerset.filter (fun s : Finset V => + s.card = k ∧ G.IsIndepSet (s : Set V))).card + +/-- +Erdős Problem 993 [AMSE87]: + +The independent set sequence of any tree or forest is unimodal. That is, if +$i_k(T)$ counts the number of independent sets of vertices of size $k$ in a +forest $T$, then there exists $m \geq 0$ such that +$$ +i_0(T) \leq i_1(T) \leq \cdots \leq i_m(T) \geq i_{m+1}(T) \geq i_{m+2}(T) \geq \cdots +$$ +-/ +@[category research open, AMS 5] +theorem erdos_993 {V : Type*} [Fintype V] [DecidableEq V] + (T : SimpleGraph V) [DecidableRel T.Adj] (hT : T.IsAcyclic) : + ∃ m : ℕ, (∀ i j : ℕ, i ≤ j → j ≤ m → numIndepSets T i ≤ numIndepSets T j) ∧ + (∀ i j : ℕ, m ≤ i → i ≤ j → numIndepSets T j ≤ numIndepSets T i) := by + sorry + +end Erdos993 diff --git a/FormalConjectures/ErdosProblems/994.lean b/FormalConjectures/ErdosProblems/994.lean new file mode 100644 index 0000000000..24f372c7f4 --- /dev/null +++ b/FormalConjectures/ErdosProblems/994.lean @@ -0,0 +1,71 @@ +/- +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 994 + +Khintchine's conjecture on strong uniform distribution: is it true that for almost all real +numbers α, the fractional parts {kα} are equidistributed with respect to every measurable subset +of (0,1)? Disproved by Marstrand [Ma70]. + +*Reference:* [erdosproblems.com/994](https://www.erdosproblems.com/994) + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. +Compositio Math. (1964), 52–65. + +[Kh23] Khintchine, A., _Ein Satz über Kettenbrüche, mit arithmetischen Anwendungen_. +Math. Z. **18** (1923), 289–306. + +[Ma70] Marstrand, J. M., _On Khintchine's conjecture about strong uniform distribution_. +Proc. London Math. Soc. (3) **21** (1970), 540–556. +-/ + +open scoped MeasureTheory + +open Filter Finset Set MeasureTheory + +namespace Erdos994 + +/-- The Cesàro frequency of visits of the fractional parts $\{k\alpha\}$ to a set $E$, +for $k = 1, \ldots, n$. That is, $\frac{1}{n} \cdot \#\{1 \le k \le n : \{k\alpha\} \in E\}$. -/ +noncomputable def cesaroFrequency (α : ℝ) (E : Set ℝ) (n : ℕ) : ℝ := + have : DecidablePred (· ∈ E) := Classical.decPred _ + ((Finset.range n).filter (fun (k : ℕ) => + Int.fract (((k : ℝ) + 1) * α) ∈ E)).card / (n : ℝ) + +/-- +Erdős Problem 994 (Khintchine's conjecture, disproved by Marstrand [Ma70]): + +Let $E \subseteq (0,1)$ be a measurable subset with Lebesgue measure $\lambda(E)$. Is it true +that, for almost all $\alpha$, +$$ + \lim_{n \to \infty} \frac{1}{n} \sum_{1 \le k \le n} \mathbf{1}_{\{\{k\alpha\} \in E\}} = \lambda(E) +$$ +for all $E$? + +This is false, and was disproved by Marstrand [Ma70]. +-/ +@[category research solved, AMS 11 28] +theorem erdos_994 : answer(False) ↔ + ∀ᵐ α ∂(volume : Measure ℝ), + ∀ (E : Set ℝ), MeasurableSet E → E ⊆ Ioo 0 1 → + Tendsto (cesaroFrequency α E) atTop + (nhds (volume E).toReal) := by + sorry + +end Erdos994 diff --git a/FormalConjectures/ErdosProblems/995.lean b/FormalConjectures/ErdosProblems/995.lean new file mode 100644 index 0000000000..e3993cb3e5 --- /dev/null +++ b/FormalConjectures/ErdosProblems/995.lean @@ -0,0 +1,62 @@ +/- +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.NumberTheory.Lacunary + +/-! +# Erdős Problem 995 + +*Reference:* [erdosproblems.com/995](https://www.erdosproblems.com/995) + +[Er49d] Erdős, P. (1949) — constructed a lacunary sequence and $f \in L^2([0,1])$ such that, for +every $\varepsilon > 0$, for almost all $\alpha$, +$\limsup_{N \to \infty} \frac{1}{N(\log \log N)^{1/2 - \varepsilon}} \sum_{k \leq N} +f(\{\alpha n_k\}) = \infty$. + +[Er64b] Erdős, P. (1964) — thought that his lower bound was closer to the truth. +-/ + +open MeasureTheory Filter Finset Set + +namespace Erdos995 + +/-- +Erdős Problem 995 [Er64b]: + +Is it true that for every lacunary sequence $(n_k)$ of positive integers and every +$f \in L^2([0,1])$ with $\int_0^1 f = 0$, for almost all $\alpha \in [0,1]$, +$$\sum_{k < N} f(\{\alpha \cdot n_k\}) = o(N \cdot \sqrt{\log \log N})?$$ + +Formulated as: for every $\varepsilon > 0$, for almost all $\alpha$, eventually (for large $N$), +(The zero-mean condition $\int_0^1 f = 0$ is required, as otherwise the sum grows linearly.) +$\left|\sum_{k < N} f(\{\alpha \cdot n_k\})\right| \leq \varepsilon \cdot N \cdot +\sqrt{\log \log N}$. +-/ +@[category research open, AMS 11 42] +theorem erdos_995 : answer(sorry) ↔ + ∀ (n : ℕ → ℕ), IsLacunary n → + ∀ (f : ℝ → ℝ), Measurable f → + Integrable (fun x => f x ^ 2) (volume.restrict (Icc (0 : ℝ) 1)) → + ∫ x in (0 : ℝ)..1, f x = 0 → + ∀ ε : ℝ, ε > 0 → + ∀ᵐ α ∂(volume.restrict (Icc (0 : ℝ) 1)), + ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + |∑ k ∈ Finset.range N, f (Int.fract (α * (n k : ℝ)))| ≤ + ε * (N : ℝ) * Real.sqrt (Real.log (Real.log (N : ℝ))) := by + sorry + +end Erdos995 diff --git a/FormalConjectures/ErdosProblems/998.lean b/FormalConjectures/ErdosProblems/998.lean new file mode 100644 index 0000000000..5a3daa5583 --- /dev/null +++ b/FormalConjectures/ErdosProblems/998.lean @@ -0,0 +1,64 @@ +/- +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 998 + +Is it true that if, for an irrational $\alpha$, the number of $m \leq n$ with +$\{\alpha m\} \in [u,v)$ is $n(v-u) + O(1)$, then $u$ and $v$ must be fractional +parts of integer multiples of $\alpha$? Proved by Kesten. + +*References:* +- [erdosproblems.com/998](https://www.erdosproblems.com/998) +- [Er64b] Erdős, P., _Problems and results on diophantine approximations_. Compositio Math. + **16** (1964), 52–65. +- [Ke66] Kesten, H., _On a conjecture of Erdős and Szüsz related to uniform distribution mod 1_. + Acta Arithmetica **12** (1966), 193–212. +-/ + +open Classical Finset + +namespace Erdos998 + +/-- +The number of integers $m$ with $1 \leq m \leq n$ such that the fractional part of $\alpha \cdot m$ +lies in $[u, v)$. +-/ +noncomputable def countFracInInterval (α : ℝ) (u v : ℝ) (n : ℕ) : ℕ := + ((Finset.Icc 1 n).filter (fun m : ℕ => + u ≤ Int.fract (α * ↑m) ∧ Int.fract (α * ↑m) < v)).card + +/-- +Let $\alpha$ be an irrational number. Is it true that if, for all large $n$, +$$\#\{1 \leq m \leq n : \{\alpha m\} \in [u,v)\} = n(v-u) + O(1)$$ +then $u = \{\alpha k\}$ and $v = \{\alpha \ell\}$ for some integers $k$ and $\ell$? + +Here $\{x\}$ denotes the fractional part of $x$. This is a problem of Erdős and +Szüsz. The converse was proved by Hecke and Ostrowski. The conjecture itself +was proved by Kesten [Ke66]. +-/ +@[category research solved, AMS 11] +theorem erdos_998 : answer(True) ↔ + ∀ (α : ℝ), Irrational α → + ∀ (u v : ℝ), 0 ≤ u → u < v → v < 1 → + (∃ C : ℝ, ∀ n : ℕ, 0 < n → + |(↑(countFracInInterval α u v n) : ℝ) - ↑n * (v - u)| ≤ C) → + (∃ k : ℤ, u = Int.fract (α * ↑k)) ∧ (∃ ℓ : ℤ, v = Int.fract (α * ↑ℓ)) := by + sorry + +end Erdos998 diff --git a/FormalConjectures/ErdosProblems/999.lean b/FormalConjectures/ErdosProblems/999.lean new file mode 100644 index 0000000000..b265b393a1 --- /dev/null +++ b/FormalConjectures/ErdosProblems/999.lean @@ -0,0 +1,63 @@ +/- +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 999 + +The Duffin–Schaeffer conjecture: for any function `f : ℕ → ℝ`, almost every real number has +infinitely many coprime rational approximations `p/q` with `|α - p/q| < f(q)/q` if and only if +`∑ φ(q) f(q) / q` diverges. Proved by Koukoulopoulos and Maynard. + +*Reference:* [erdosproblems.com/999](https://www.erdosproblems.com/999) + +[Er64b] Erdős, P., _Problems and results on diophantine approximations_. Compositio Math. +(1964), 52–65. + +[KoMa20] Koukoulopoulos, D. and Maynard, J., _On the Duffin-Schaeffer conjecture_. Annals of +Mathematics (2) 191 (2020), 251–307. +-/ + +open MeasureTheory Set + +namespace Erdos999 + +/-- +The set of coprime integer-natural number pairs $(p, q)$ with $p \in \mathbb{Z}$, $q \in \mathbb{N}$, +$q > 0$, that approximate $\alpha$ within $f(q)/q$. +-/ +def DuffinSchafferApprox (f : ℕ → ℝ) (α : ℝ) : Set (ℤ × ℕ) := + {pq | 0 < pq.2 ∧ Nat.Coprime (Int.natAbs pq.1) pq.2 ∧ + |α - (pq.1 : ℝ) / (pq.2 : ℝ)| < f pq.2 / (pq.2 : ℝ)} + +/-- +Erdős Problem 999 (the Duffin-Schaeffer conjecture, now theorem): +For any function $f : \mathbb{N} \to \mathbb{R}$, the property that for almost all +$\alpha \in \mathbb{R}$, $|\alpha - p/q| < f(q)/q$ has infinitely many solutions with +$\gcd(p,q) = 1$, is equivalent to the divergence of +$\sum \varphi(q) \cdot f(q) / q$. + +Proved by Koukoulopoulos and Maynard [KoMa20]. +-/ +@[category research solved, AMS 11] +theorem erdos_999 : + ∀ f : ℕ → ℝ, + (∀ᵐ α : ℝ, (DuffinSchafferApprox f α).Infinite) ↔ + (¬ Summable fun q : ℕ => (Nat.totient q : ℝ) * f q / (q : ℝ)) := by + sorry + +end Erdos999 diff --git a/REVIEW_MATH.md b/REVIEW_MATH.md new file mode 100644 index 0000000000..d34c053c43 --- /dev/null +++ b/REVIEW_MATH.md @@ -0,0 +1,12 @@ +# Review Math + +Assume the role of a PhD-level mathematician. + +The goal is to review a particular Erdos Problem formalization (problem number NUM) to answer the following questions. Produce a review document called ai-review/NUM.md. + +1. Code reuse - Can any code from the existing codebase be repurposed? Look in FormalConjecturesForMathlib to determine if an existing implementation would work just as well. +2. Citations - Fetch data from https://www.erdosproblems.com/NUM to ensure any citations included in docstrings are documented as they exist on the website as opposed to shorthand references. +3. Variants - Are all variants of the problem captured by the formalization? +4. Readability - Could the code be made more readable? +5. Formalizability - Is the problem as stated precise enough to be obviously formalizable? Provide an assessment of the ambiguity of the statement. +6. Correctness - Is the formalization as-implemented correct and complete from a mathematical perspective? Would an experienced mathematician identify any obvious flaws? Is any incompleteness or incorrectness attributable to ambiguity in the statement itself? diff --git a/ai-review/1000.md b/ai-review/1000.md new file mode 100644 index 0000000000..9e406b578a --- /dev/null +++ b/ai-review/1000.md @@ -0,0 +1,66 @@ +# AI Review: Erdős Problem 1000 + +## 1. Code Reuse + +**No significant reuse opportunities identified.** + +The `FormalConjecturesForMathlib/Data/Set/Density.lean` file provides `partialDensity`, `upperDensity`, `lowerDensity`, and `HasDensity` for natural/set density. However, Erdős 1000 computes a Cesàro mean of a *function* (φ\_A(k)/n\_k) rather than a proportion of set membership, so these density definitions are not directly applicable. The formalization correctly constructs its own Cesàro mean using `Finset.range`, a sum of ratios, and `Filter.Tendsto`. + +The `FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` file provides `lcmInterval` but no directly useful GCD utilities beyond what Mathlib's `Nat.gcd` already provides. + +Problem 1001 is thematically related (Diophantine approximation, coprimality, Cesàro-style limits) but shares no reusable code. + +## 2. Citations + +The formalization references: +- `[Er64b]` Erdős, P., *Some problems in number theory*. 1964. +- `[Ha]` Haight, J. A., *A linear programming problem*. 1979. + +The website additionally mentions: +- **Cassels (1950)** — who introduced the study of φ\_A and proved that sequences with liminf of the Cesàro mean equal to 0 exist. This is historically relevant context but not a direct reference for the problem statement itself. + +The citations as given are consistent with the website. The shorthand `[Er64b]` and `[Ha]` match the website's references. No issues here. + +## 3. Variants + +The website describes additional related results: +- **Cassels' result**: Sequences with *liminf* of the Cesàro mean equal to 0 exist (a weaker statement than the full limit being 0). +- **Erdős' results**: (a) The limit of individual terms φ\_A(k)/n\_k cannot tend to 0, and (b) if liminf φ\_A(k)/n\_k = 0 then limsup φ\_A(k)/n\_k = 1. + +These are related theorems rather than variants of the conjecture. The core problem — does there exist a sequence where the Cesàro mean *converges* to 0? — is fully captured by the formalization. No variants are missing. + +## 4. Readability + +The code is clean and readable. The helper definition `phiA` is well-documented and clearly separates the counting function from the main theorem. The docstring faithfully reproduces the mathematical notation and includes both the fraction interpretation and the GCD equivalence. Minor observations: + +- The `open Finset Filter` at the top is appropriate and minimal. +- The namespace `Erdos1000` keeps definitions scoped. +- The docstring on `erdos_1000` concisely states the result and attributes it correctly. + +No readability improvements needed. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: it defines a specific counting function φ\_A(k) via an explicit GCD condition, asks for the existence of a sequence making a specific limit equal zero, and has a definite answer (yes, proved by Haight). There is no ambiguity in the statement — all quantifiers, the counting mechanism, and the Cesàro mean are fully specified. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +- **`phiA` definition**: Counts m ∈ [1, a(k)] such that a(k)/gcd(m, a(k)) ≠ a(j) for all j < k. This precisely matches the problem's "m/n\_k does not have denominator n\_j when written in lowest form" (since the denominator of m/n\_k in lowest form is n\_k/gcd(m, n\_k)). + +- **Sequence conditions**: `StrictMono a` and `∀ i, 0 < a i` correctly model an infinite strictly increasing sequence of positive integers. Since a is strictly monotone on ℕ with a(0) ≥ 1, we get a(k) ≥ k+1, which is the right structural constraint. + +- **Indexing**: The original problem uses 1-indexed sequences (n\_1 < n\_2 < ···) with the sum ∑\_{k≤N}. The formalization uses 0-indexed sequences with `Finset.range N` (summing k = 0, …, N−1). At k = 0, the condition "∀ j < 0" is vacuously true, so phiA(a, 0) = a(0), giving phiA(a, 0)/a(0) = 1. This single extra term contributes 1/N to the Cesàro mean, which vanishes in the limit. The indexing shift is mathematically inconsequential. + +- **Cesàro mean**: The expression `(∑ k ∈ Finset.range N, (phiA a k : ℝ) / (a k : ℝ)) / (N : ℝ)` correctly computes (1/N) ∑\_{k 10$. This is a weaker but distinct result not captured. + +**Verdict:** The formalization is incomplete with respect to the full problem. The explicit formula variant is a significant omission — it is the more informative half of the problem and is fully formalizable. + +## 4. Readability + +The code is well-structured and readable: + +- `approxSet` has a clear docstring explaining its mathematical meaning. +- `sMeasure` is a clean wrapper giving the Lebesgue measure. +- The theorem statement is concise and follows standard patterns (`∀ ... ∃ L, Tendsto ...`). +- The namespace `Erdos1001` is appropriate. +- The `open MeasureTheory Set Filter` is standard. + +**Minor suggestions:** +- The `noncomputable` annotation on `approxSet` is technically unnecessary — the definition is a `Set ℝ` defined by a proposition, which is computable in Lean's sense (it's just a predicate). However, it does no harm and the codebase may use it as a convention. + +**Verdict:** Highly readable. No significant improvements needed. + +## 5. Formalizability + +The existence question (does the limit exist?) is completely precise and unambiguous. It is a well-posed mathematical statement with a clear yes/no answer (yes, proved by Kesten–Sós). + +The "explicit form" question is inherently less formalizable — it asks *what* the function is, which is open-ended. However, the partial answer (the EST58 formula in the restricted range) is fully formalizable as a separate theorem. + +The parameters are well-constrained: $A > 0$, $c > 1$, the set is defined over $(0,1)$, denominators range over $[N, cN]$, and coprimality is standard. + +**Verdict:** High formalizability. The existence question is unambiguous. The explicit form question is inherently open-ended but its known partial answer (the EST58 formula) is fully formalizable. + +## 6. Correctness + +**Definition `approxSet`:** Mathematically correct. +- The constraint `α ∈ Ioo 0 1` correctly restricts to $(0,1)$. +- The existential over `x : ℤ` and `y : ℕ` with `N ≤ y ∧ (y : ℝ) ≤ c * N` correctly captures the denominator range $N \leq y \leq cN$. +- `Nat.Coprime (Int.natAbs x) y` correctly formalizes $\gcd(|x|, y) = 1$, which is equivalent to $\gcd(x, y) = 1$ for the purpose of reduced fractions. +- The approximation inequality `|α - x/y| < A/y²` is correctly rendered. + +**Definition `sMeasure`:** Correct — takes the `.toReal` of the volume (Lebesgue measure) of the approximation set. + +**Theorem `erdos_1001`:** +- `answer(True)` is correct: the limit does exist (proved by Kesten–Sós). +- The universal quantification over `A > 0` and `c > 1` is correct. +- The conclusion `∃ L, Tendsto (fun N => sMeasure N A c) atTop (nhds L)` correctly states that the limit exists. + +**Edge case analysis:** +- When `N = 0`: the range condition becomes `0 ≤ y ∧ (y : ℝ) ≤ 0`, forcing `y = 0`. Then `A / (0:ℝ)^2 = A / 0 = 0` in Lean, and `|α - x/0| = |α| > 0` for `α ∈ (0,1)`, so the set is empty and `sMeasure 0 A c = 0`. This is harmless for the limit statement. +- The coercion `(y : ℝ)` in `(y : ℝ) ≤ c * N` is correct — `N` is also coerced to `ℝ` via the multiplication. + +**One subtlety:** The formalization uses `Nat.Coprime (Int.natAbs x) y`, which is `Nat.gcd (Int.natAbs x) y = 1`. When `y = 0`, `Nat.Coprime n 0` requires `n = 1`, and when `x = 0`, `Nat.Coprime 0 y` requires `y = 1`. This correctly excludes degenerate cases like `x = 0, y = 0`. + +**Verdict:** The formalization is mathematically correct for the existence statement. No flaws identified. The only incompleteness is the missing explicit formula variant, which is attributable to the open-ended nature of "what is its explicit form?" rather than an error. + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code Reuse | ✅ Good | No significant reuse opportunities; consistent with codebase patterns | +| Citations | ✅ Good | Matches website; level of detail consistent | +| Variants | ⚠️ Incomplete | Missing the EST58 explicit formula $f(A,c) = 12A\log c / \pi^2$ | +| Readability | ✅ Good | Clean, well-documented code | +| Formalizability | ✅ Good | Existence question is unambiguous; explicit form is inherently open-ended | +| Correctness | ✅ Good | Mathematically correct; no flaws in the formalized portion | + +**Overall:** Solid formalization of the existence half of the problem. The primary recommendation is to add a second theorem formalizing the EST58 explicit formula for the restricted parameter range $0 < A < c/(1+c^2)$, which would make the formalization more complete. diff --git a/ai-review/1002.md b/ai-review/1002.md new file mode 100644 index 0000000000..0a492734b0 --- /dev/null +++ b/ai-review/1002.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 1002 + +## 1. Code Reuse + +The formalization uses standard patterns found across the codebase: + +- **Problem 1001** (`1001.lean`): Uses the identical `(volume (... ∩ Set.Ioo 0 1)).toReal` and `Tendsto ... atTop (nhds ...)` pattern for expressing asymptotic Lebesgue measure limits. The measure-theoretic scaffolding is consistent. + +- **Problem 998** (`998.lean`): Also deals with fractional parts of `α * k` sequences using `Int.fract`, and defines a counting function over `Finset.Icc 1 n`. The summation structure in `erdosF` is analogous to `countFracInInterval` — both iterate over `Finset.Icc 1 n` applying a function of `Int.fract (α * k)`. + +- **Problem 995** (`995.lean`): Similarly concerns sums of functions of fractional parts `f({α · n_k})` over lacunary sequences. + +- **Equidistribution** (`Books/UniformDistributionOfSequences/Equidistribution.lean`): Defines `IsEquidistributedModuloOne` using `Int.fract` — conceptually related (the discrepancy sum in 1002 measures deviation from equidistribution), but the definition structures are sufficiently different that direct reuse is not practical. + +- **FormalConjecturesForMathlib**: No utilities for asymptotic distribution functions or Lebesgue-measure-of-sublevel-set limits were found. The `Data/Set/Density.lean` provides discrete density, not Lebesgue measure. + +**Verdict:** No significant code reuse opportunity. The formalization follows established codebase conventions. A shared "asymptotic distribution function" predicate could in principle be factored out (used similarly in problems 1001 and 1002), but the definitions differ enough that this would likely hurt clarity. + +## 2. Citations + +| Code Citation | Website Citation | Status | +|---|---|---| +| `[Er64b]` (in `@[category]` and docstring) | Listed as the original source | **Consistent** — matches website | +| `[Ke60]` Kesten (in module docstring) | Kesten (1960) mentioned on website | **Consistent** — matches website | + +The website lists: +- **Original source**: [Er64b] +- **Kesten (1960)**: Proved the analogous result with additional shift parameter β + +The code's docstring references match the website. The citation `[Ke60]` is shorthand; the website does not provide full bibliographic details beyond author and year, so the level of detail is consistent. No references are missing or fabricated. + +**Verdict:** Citations are consistent with the website. + +## 3. Variants + +The website describes a single question: does `f(α, n)` have an asymptotic distribution function? + +The code's module docstring mentions Kesten's result for the shifted variant `f(α, β, n)`, which includes an explicit distribution function `g(c) = (1/π) ∫_{-∞}^{ρc} 1/(1+t²) dt` (a rescaled Cauchy/Lorentzian CDF). This Kesten result is **not formalized** as a separate theorem, though it is documented in the docstring. + +**Potential missing variant:** +- **Kesten's theorem for `f(α, β, n)`**: The shifted version with explicit distribution function is a proved result and could be formalized as a separate theorem. The distribution function is explicit (an arctangent/Cauchy CDF), making it fully formalizable. However, this is a *related result* rather than a variant of the original problem, so its omission is understandable. + +**Verdict:** The core problem is fully captured. The Kesten shifted-parameter result is documented but not formalized — this is a minor gap, as it is a related theorem rather than a variant of the open problem itself. + +## 4. Readability + +The code is clean and well-structured: + +- `erdosF` has a clear docstring with the mathematical formula. +- The theorem statement is concise: existence of a monotone function `g` with boundary conditions and pointwise convergence of Lebesgue measures. +- The namespace `Erdos1002` is appropriate. +- The `open Finset Filter MeasureTheory` is standard and minimal. + +**Minor observations:** +- The definition `erdosF` uses `Finset.Icc 1 n` (sum from 1 to n inclusive), consistent with the mathematical statement `∑_{1 ≤ k ≤ n}`. +- The division by `Real.log ↑n` at the end is clean — placing it outside the sum rather than inside. +- The module docstring uses `|\cdot|` for Lebesgue measure notation, while the theorem uses `volume ... .toReal`. This is fine — the docstring explains the informal notation. + +**Verdict:** Highly readable. No improvements needed. + +## 5. Formalizability + +The problem is a well-posed yes/no question: does the specified asymptotic distribution function exist? The formalization captures this precisely: + +- The function `erdosF` is unambiguously defined. +- The notion of "asymptotic distribution function" is made precise via: (1) monotonicity of `g`, (2) `g → 0` at `-∞` and `g → 1` at `+∞`, and (3) pointwise convergence of the Lebesgue measure of the sublevel set `{α ∈ (0,1) : f(α,n) ≤ c}` to `g(c)`. + +There is one subtle ambiguity in the original statement: the convergence `|{α ∈ (0,1) : f(α,n) ≤ c}| → g(c)` could be interpreted as holding for **all** `c ∈ ℝ` or only at **continuity points** of `g`. The standard definition of "distribution function" in probability theory requires convergence at continuity points of `g` (cf. the Portmanteau theorem / Lévy's continuity theorem). The formalization requires convergence for **all** `c`, which is a **stronger** condition. If the true distribution function `g` turns out to be continuous (as Kesten's shifted analogue is — the Cauchy CDF is continuous), then the two notions coincide. But in general, requiring convergence at all `c` could make the statement false even when the standard weak-convergence version is true. + +**Verdict:** Mostly unambiguous. The choice to require pointwise convergence at all `c` (rather than at continuity points of `g`) is a substantive modeling decision that makes the statement slightly stronger than the standard probabilistic notion. This is worth noting but is unlikely to matter if the answer mirrors Kesten's continuous distribution. + +## 6. Correctness + +**Definition `erdosF`:** +- `∑ k ∈ Finset.Icc 1 n, ((1 : ℝ) / 2 - Int.fract (α * ↑k))` correctly computes the discrepancy sum. +- Division by `Real.log ↑n` is correct normalization. +- When `n = 0`: `Finset.Icc 1 0 = ∅`, so the sum is 0, and `Real.log 0 = 0` in Lean, giving `0 / 0 = 0`. This is a harmless boundary case for the `atTop` limit. +- When `n = 1`: `Real.log 1 = 0`, so `erdosF α 1 = sum / 0 = 0` (by Lean's convention for division by zero). This is also harmless for the limit. + +**Theorem `erdos_1002`:** +- `answer(sorry)` is correct for an open problem — the answer is unknown. +- `Monotone g` correctly captures "non-decreasing." +- `Tendsto g atBot (nhds 0)` and `Tendsto g atTop (nhds 1)` correctly formalize `g(-∞) = 0` and `g(+∞) = 1`. +- The measure expression `(volume (Set.Ioo (0 : ℝ) 1 ∩ {α : ℝ | erdosF α n ≤ c})).toReal` correctly computes the Lebesgue measure of `{α ∈ (0,1) : f(α,n) ≤ c}`. +- `Tendsto (fun n : ℕ => ...) atTop (nhds (g c))` correctly states convergence as `n → ∞`. +- The universal quantification `∀ c : ℝ` means the convergence must hold at every real `c`. + +**Measurability concern:** The set `{α : ℝ | erdosF α n ≤ c}` must be measurable for `volume` to give a meaningful answer. For fixed `n`, `erdosF α n` is a finite sum of continuous functions of `α` (since `Int.fract` is measurable and the sum is finite), divided by a constant. So the sublevel set is measurable (Borel). This is fine — Lean's `volume` applied to non-measurable sets would give `⊤`, but `.toReal` of `⊤` is `0`, which would make the limit statement trivially satisfiable with `g = 0`. However, since the set *is* measurable and has finite measure (it's a subset of `(0,1)`), this is not an issue. + +**Edge case — `∀ c` vs. continuity points:** As noted in §5, the `∀ c` quantification is stronger than the standard notion. If the intended distribution function has jump discontinuities, the formalization would be false even if the standard distributional limit exists. For a Cauchy-type distribution (continuous), this distinction vanishes. + +**Verdict:** The formalization is mathematically correct. The `∀ c` vs. continuity-points distinction is the only substantive concern, and it is attributable to ambiguity in the original problem statement rather than an implementation error. + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code Reuse | ✅ Good | No significant reuse opportunities; consistent with codebase patterns | +| Citations | ✅ Good | Matches website; `[Er64b]` and `[Ke60]` both accounted for | +| Variants | ✅ Good | Core problem captured; Kesten's shifted result documented but not formalized (acceptable) | +| Readability | ✅ Good | Clean, well-documented, follows conventions | +| Formalizability | ⚠️ Minor | `∀ c` convergence is stronger than standard "at continuity points of g" — substantive but likely inconsequential | +| Correctness | ✅ Good | Mathematically correct; measurability is satisfied; boundary cases are harmless | + +**Overall:** A solid formalization of an open problem. The only substantive observation is the `∀ c` vs. continuity-points distinction in the definition of asymptotic distribution function. If the intended distribution is continuous (as suggested by Kesten's analogue), this is immaterial. If one wanted to be maximally faithful to the standard probabilistic definition, the `∀ c` could be weakened to "for all `c` at which `g` is continuous," but this would complicate the statement for arguably no practical benefit. diff --git a/ai-review/1005.md b/ai-review/1005.md new file mode 100644 index 0000000000..62b93dff91 --- /dev/null +++ b/ai-review/1005.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 1005 + +## 1. Code Reuse + +No Farey sequence infrastructure exists in Mathlib or `FormalConjecturesForMathlib`. The definitions (`fareyFractions`, `similarlyOrdered`, `fareySimOrderFn`) are necessarily self-contained. No reuse opportunities identified — this is appropriate given the specialized nature of the problem. + +## 2. Citations + +**Missing citation.** The website lists three references: **[Er43]**, **[Ma42]** (Mayer, 1942), and **[vD25b]**. The formalization omits **[Ma42]**: + +> **Mayer** established that $f(n) \to \infty$. + +The docstring should add: + +``` +[Ma42] Mayer, A. E. (1942). +``` + +(The exact title should be confirmed from the website, which lists it as a reference without full bibliographic detail.) + +Additionally, the [vD25b] citation is incomplete — it lacks a title or publication venue. While the website also provides minimal detail, the docstring could note "(preprint)" or similar if no venue is known. + +**OEIS reference.** The website lists related OEIS sequence **A386893**. This could be mentioned in the docstring for additional context, though this is optional. + +## 3. Variants + +The website's problem statement asks: *Does there exist a constant $c > 0$ such that $f(n) = (c + o(1))n$?* + +The formalization captures exactly this via: +``` +Tendsto (fun n => (fareySimOrderFn n : ℝ) / (n : ℝ)) atTop (nhds c) +``` +which is mathematically equivalent to $f(n)/n \to c$ as $n \to \infty$. + +**No variants are missing.** The problem as stated on the website has a single formulation. The known bounds $(1/12 - o(1))n \leq f(n) \leq n/4 + O(1)$ and the conjectured value $c = 1/4$ are mentioned in the docstring (appropriately as commentary rather than as separate formal statements). + +One could consider formalizing the bounds as separate lemmas, but this goes beyond the scope of the conjecture itself. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The `fareyFractions` definition is a single dense expression. A brief inline comment noting the iteration strategy (iterate over denominators $b \in [1,n]$, then numerators $a \in [0,b]$ with $\gcd(a,b)=1$) would help, though the docstring already explains this adequately. +- The `similarlyOrdered` definition uses `p.num` and `p.den` which implicitly assumes the reader knows these are the reduced numerator/denominator of a `ℚ`. This is standard Lean/Mathlib convention and is fine. +- The `noncomputable` annotation on `fareySimOrderFn` is necessary due to `sSup` and is appropriate. + +**Overall readability: Good.** No significant changes recommended. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: Farey fractions of order $n$ are a well-defined classical object, "similarly ordered" is given an explicit algebraic condition $(a_k - a_l)(b_k - b_l) \geq 0$, and $f(n)$ is defined as the largest integer satisfying a universal quantifier over index pairs. The conjecture asks for convergence of $f(n)/n$ to a positive constant. + +The only potential source of ambiguity is whether "similarly ordered" is a standard term or specific to Erdős's formulation. The formalization resolves this by providing the explicit algebraic definition, which matches the website. + +## 6. Correctness + +### `fareyFractions` (lines 41–44) +**Correct.** Iterates $b$ from 1 to $n$, $a$ from 0 to $b$, filters by `Nat.Coprime a b`, forms the rational $a/b$, collects into a finset, and sorts. This produces the standard Farey sequence $F_n$ including $0/1$ and $1/1$. + +- `Nat.Coprime 0 1` holds ($\gcd(0,1) = 1$), so $0/1$ is included. ✓ +- `Nat.Coprime 1 1` holds, so $1/1$ is included. ✓ +- For $a = b > 1$: `Nat.Coprime b b` requires $b = 1$, so no duplicates of $1/1$. ✓ +- Using `Finset` with `.biUnion` and `.image` ensures duplicates are eliminated (e.g., $0/1$ appears only once despite potentially matching multiple denominators — but the coprimality filter already prevents this). ✓ +- Sorting by `(· ≤ ·)` on `ℚ` gives the standard ascending order. ✓ + +### `similarlyOrdered` (lines 48–49) +**Correct.** For $p = a_1/b_1$ and $q = a_2/b_2$ in lowest terms, the condition $(a_1 - a_2)(b_1 - b_2) \geq 0$ is computed as `(p.num - q.num) * ((p.den : ℤ) - q.den) ≥ 0`. Since the rationals constructed in `fareyFractions` are already in lowest terms (coprimality is enforced), `p.num` and `p.den` correctly recover the original numerator and denominator. + +**Subtlety:** `ℚ.num` is `ℤ` and `ℚ.den` is `ℕ`, so the cast `(p.den : ℤ)` is needed. The arithmetic is performed in `ℤ`. This is correct. + +### `fareySimOrderFn` (lines 53–56) +**Correct with caveats.** Uses `sSup` on the set of valid window sizes $d$. The set is: +- **Nonempty:** $d = 0$ is trivially in the set (the condition $i < j \land j \leq i + 0$ is impossible, making the universal statement vacuously true). +- **Bounded:** For fixed $n$, the Farey sequence has finite length, so no $d$ larger than the list length can introduce new constraints. The set is bounded above by the list length. + +Since `ℕ` with `sSup` returns the correct supremum for bounded nonempty sets, this works. However, the use of `sSup` makes this `noncomputable` when in principle $f(n)$ is computable. This is a reasonable design choice for a conjecture statement. + +### `erdos_1005` (lines 69–72) +**Correct.** The statement $\exists c > 0,\; f(n)/n \to c$ as $n \to \infty$ (using `Tendsto ... atTop (nhds c)`) faithfully captures the problem. + +**One note on strength:** The formalization asserts convergence to a *specific* positive constant. The original problem asks "does such a $c$ exist?" — so the formalization correctly treats this as an existential claim. The known bounds $1/12 \leq c \leq 1/4$ (if $c$ exists) are not formalized but are appropriately documented in the docstring. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | No opportunities — appropriate | +| Citations | **Missing [Ma42]**; [vD25b] could be more complete | +| Variants | Complete | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | **Correct** — faithful formalization | diff --git a/ai-review/1006.md b/ai-review/1006.md new file mode 100644 index 0000000000..3a25b84227 --- /dev/null +++ b/ai-review/1006.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 1006 + +## 1. Code Reuse + +**Problem 761** (`FormalConjectures/ErdosProblems/761.lean`) defines a nearly identical orientation concept as a predicate rather than a structure: + +```lean +def IsOrientation {V : Type*} (G : SimpleGraph V) (D : V → V → Prop) : Prop := + (∀ u v, D u v → G.Adj u v) ∧ + (∀ u v, G.Adj u v → D u v ∨ D v u) ∧ + (∀ u v, D u v → ¬D v u) +``` + +This is semantically equivalent to the `Orientation` structure in 1006. The two problems define the same concept independently. In principle, a shared `Orientation` definition (or `IsOrientation` predicate) could live in `FormalConjecturesForMathlib/` and be reused by both. However, since Problem 761 uses a predicate style (suitable for quantifying over all orientations) and Problem 1006 uses a structure style (suitable for existential witnesses), the divergence is reasonable. No strong recommendation to refactor—just noting the duplication. + +The `egirth` function from Mathlib (`Mathlib.Combinatorics.SimpleGraph.Girth`) is correctly used for the girth constraint. `Relation.TransGen` from Mathlib is appropriately used for cycle detection. No other reuse opportunities were identified. + +## 2. Citations + +The docstring references: +- `[Er71]` — Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*, 1971. +- `[Er76b]` — Erdős, P., *Problems and results in graph theory*, 1976. +- `[NeRo78b]` — Nešetřil, J. and Rödl, V., *A short proof of the existence of highly chromatic hypergraphs without short cycles*, 1978. + +**Discrepancy with the website:** The [erdosproblems.com/1006](https://www.erdosproblems.com/1006) page states the problem was **originally credited to Ore**, appearing in Erdős's 1971 paper. The website also mentions that **Ore provided a counterexample with girth 4**, and that **Gallai noted the Grötzsch graph** also lacks the robustly-acyclic-orientation property. These attributions are absent from the docstring. Consider adding a note such as: + +> Originally due to Ore (cited in [Er71]). Ore gave a counterexample with girth 4; Gallai observed the Grötzsch graph also fails. + +The three references listed do match those on the website. + +## 3. Variants + +The formalization captures the original question (girth > 4). The **stronger result** by Nešetřil and Rödl—that for *every* integer g, there exists a graph with girth g admitting no robustly acyclic orientation—is mentioned in the docstring but **not formalized as a separate variant**. A natural variant would be: + +```lean +theorem erdos_1006.variants.arbitrary_girth : answer(False) ↔ + ∀ (g : ℕ) (V : Type*) (G : SimpleGraph V), g ≤ G.egirth → + ∃ o : Orientation G, o.IsRobustlyAcyclic +``` + +This would capture the full strength of the Nešetřil–Rödl result. Its absence is a minor gap. + +## 4. Readability + +The code is well-structured and readable: +- The `Orientation` structure clearly encodes the three properties of a valid orientation. +- `flipDir` is cleanly defined and its docstring explains the intent. +- `IsAcyclic` and `IsRobustlyAcyclic` have clear docstrings. + +**Minor suggestions:** +- The `flipDir` function could benefit from a more explicit name like `flipEdgeDir` to distinguish it from flipping the entire orientation. +- The `Orientation` fields could use slightly more descriptive names (e.g., `covers` instead of `dir_of_adj`), but this is stylistic and the current names are standard. + +Overall readability is good. + +## 5. Formalizability + +The problem is **fully formalizable** and precisely stated. There is essentially no ambiguity: +- "Graph with girth > 4" is a standard, precise notion. +- "Orient edges so that the directed graph is acyclic" is standard. +- "Reversing any single edge also leaves it acyclic" is unambiguous. + +The only minor subtlety is whether "reversing any single edge" means any edge of the undirected graph (each of which is directed exactly one way in an orientation) or any directed edge. These are equivalent for an orientation, and the formalization correctly quantifies over directed edges (`∀ a b, o.dir a b → ...`), which covers every edge exactly once. + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed analysis:** + +- **`Orientation` structure (lines 45–49):** The three fields correctly capture: (1) directions only along edges, (2) every edge is directed, (3) no edge is directed both ways. This is the standard definition of an orientation of a simple graph. + +- **`IsAcyclic` (lines 53–54):** Uses `Relation.TransGen` irreflexivity, which is the standard characterization of acyclicity for a relation—equivalent to having no directed cycles. Correct. + +- **`flipDir` (lines 58–59):** Given `dir` and an edge `a → b`, the new relation maps `(u, v)` to `(u = b ∧ v = a ∧ dir a b) ∨ (dir u v ∧ ¬(u = a ∧ v = b))`. The first disjunct adds the reversed edge `b → a`; the second keeps all original edges except `a → b`. This correctly models flipping a single directed edge. + +- **`IsRobustlyAcyclic` (lines 63–66):** Requires acyclicity of the original orientation AND acyclicity after flipping any directed edge. This precisely captures the problem's "reversing any single edge also leaves it acyclic." + +- **`egirth` constraint (line 81):** `5 ≤ G.egirth` correctly encodes girth > 4 (no 3- or 4-cycles). Note that `egirth` returns `⊤` for acyclic graphs, and `5 ≤ ⊤` holds in `ℕ∞`, so acyclic graphs (forests) satisfy the hypothesis. This is correct—forests trivially admit robustly acyclic orientations. + +- **`answer(False)` (line 80):** The statement `answer(False) ↔ P` asserts that P is false. Here P = "every graph with girth > 4 has a robustly acyclic orientation." Since Nešetřil and Rödl disproved this, `answer(False)` is correct. + +- **Universe polymorphism:** The quantification `∀ (V : Type*) (G : SimpleGraph V)` is appropriately universe-polymorphic and does not restrict to finite graphs. The problem as stated on the website does not assume finiteness, so this is correct. (Note: for infinite acyclic graphs, the girth constraint is vacuously satisfied by `⊤`, which is fine.) + +**No mathematical flaws identified. The formalization is correct and complete for the original problem statement.** diff --git a/ai-review/1007.md b/ai-review/1007.md new file mode 100644 index 0000000000..1cdfb6353a --- /dev/null +++ b/ai-review/1007.md @@ -0,0 +1,87 @@ +# Erdős Problem 1007 — Review + +## 1. Code Reuse + +Several related definitions exist in the codebase: + +- **`Erdos704.unitDistanceGraph`** (`704.lean:51`): Defines the unit distance graph on `EuclideanSpace ℝ (Fin n)` where `Adj x y := x ≠ y ∧ dist x y = 1`. This is conceptually related but serves a different purpose — it defines an infinite graph on all of ℝⁿ, whereas 1007's `IsUnitDistRep`/`HasUnitDistRep` asks whether a *finite abstract graph* can be faithfully embedded as a unit-distance graph. These are genuinely different concepts (graph realizability vs. the unit-distance graph itself), so reuse is not appropriate. + +- **`SimpleGraph.UnitDistancePlaneGraph`** (`GraphConjectures/Definitions.lean:96`) and **`Erdos508.UnitDistancePlaneGraph`** (`508.lean:42`): Unit distance graphs on ℝ² (plane-specific). Not applicable here since 1007 concerns arbitrary dimension. + +- **`completeBipartiteGraph`** (Mathlib): Used via `completeBipartiteGraph (Fin 3) (Fin 3)` in problems 567, 558, 560, 714, etc. Problem 567 even defines `K33 : SimpleGraph (Fin 3 ⊕ Fin 3) := completeBipartiteGraph (Fin 3) (Fin 3)` explicitly. The formalization of 1007 *does not* reference K₃,₃ at all, despite the docstring claiming uniqueness by K₃,₃. If the uniqueness claim were to be formalized, Mathlib's `completeBipartiteGraph` and/or Problem 567's `K33` should be reused. + +- **`completeBipartiteGraph65`** (`65.lean:41`): A custom K_{a,b} on `Fin (a+b)`. Not needed here since Mathlib's version is more canonical. + +**Verdict:** The local definitions (`IsUnitDistRep`, `HasUnitDistRep`) are appropriate and well-scoped for this problem. The main missed opportunity is the lack of a formalized uniqueness statement using Mathlib's `completeBipartiteGraph`. + +## 2. Citations + +The docstring references: +- `[So09e]` — Soifer, A., *The Mathematical Coloring Book*, Springer, 2009. +- `[Ho13]` — House, J., *Graphs of dimension 4*, 2013. +- `[ChNo16]` — Chaffee, J. and Noble, S., *An alternative proof*, 2016. + +Per the website (erdosproblems.com/1007): +- The problem was posed by Erdős to Soifer in January 1992. +- House (2013) proved the answer is 9 edges. +- Chaffee and Noble (2016) gave an alternative proof and additionally showed that dimension-5 graphs require at least 15 edges. + +**Issues:** +- The citation `[Ho13]` lacks the full title. The paper is: House, J., *Graphs requiring a minimum number of edges to achieve a given dimension* (or similar — the website does not give the exact title, but "Graphs of dimension 4" is likely a shortening). +- The citation `[ChNo16]` is abbreviated as "An alternative proof" — the full title should be provided if available. +- The historical attribution to Erdős–Soifer (January 1992) is not mentioned in the docstring. The docstring credits `[So09e]` but does not explain that the problem was communicated by Erdős to Soifer. +- The concept of graph dimension is correctly attributed to Erdős, Harary, and Tutte, consistent with the website. + +## 3. Variants + +The website mentions: +- **Dimension 5 result**: Chaffee and Noble also proved that the minimum number of edges for a graph of dimension exactly 5 is 15, achieved by K₆ and K_{1,3,3}. This is a natural variant/extension not captured by the formalization. +- **Uniqueness by K₃,₃**: The docstring states "This is achieved uniquely by K₃,₃}" but the formal theorem does not encode this uniqueness claim. The theorem only states existence of a 9-edge graph of dimension 4 and the lower bound — it does not assert that any such graph is isomorphic to K₃,₃. + +**Missing variants:** +1. A formal uniqueness statement: any graph of dimension exactly 4 with exactly 9 edges is isomorphic to K₃,₃. +2. The dimension-5 result (15 edges, achieved by K₆ and K_{1,3,3}). + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The definitions `IsUnitDistRep` and `HasUnitDistRep` are clear, well-named, and well-documented. +- The theorem statement is split into two conjuncts (existence and lower bound) with inline comments, which aids readability. +- The use of explicit universe-polymorphic `(V : Type)` in the existential and `(V : Type)` with `[Fintype V]` in the universal is correct and clear. +- The `Erdos1007` namespace keeps definitions scoped appropriately. + +**One suggestion:** The `IsUnitDistRep` definition requires `Function.Injective f` *and* that adjacency is equivalent to distance 1. Note that injectivity is already implied by the adjacency condition for connected graphs (non-adjacent vertices at distance ≠ 1 means distinct images), but for disconnected graphs with isolated vertices it is genuinely needed. The definition is mathematically correct as stated. However, a brief comment explaining why injectivity is needed (to prevent collapsing non-adjacent vertices to the same point) would improve clarity, since the `∀ u v, G.Adj u v ↔ dist (f u) (f v) = 1` condition alone only forces `f u ≠ f v` when `u` and `v` are adjacent (via dist = 1 ≠ 0) or when they are non-adjacent (via the backward direction: if `f u = f v` then `dist (f u) (f v) = 0 ≠ 1`, so the biconditional correctly says they are not adjacent — but this doesn't prevent `f u = f v` for non-adjacent `u ≠ v`). So the injectivity requirement is indeed necessary and correctly included. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement on the website is: *"What is the smallest number of edges in a graph with dimension 4?"* This is a precise, well-defined question. The notions involved — graph dimension, unit-distance representation, edge count — are all standard and unambiguous. + +The only potential source of ambiguity is the definition of "graph dimension." The formalization defines it as the minimal n such that a unit-distance representation exists in ℝⁿ, where a unit-distance representation requires: +1. Injectivity of the embedding. +2. Adjacency ↔ distance exactly 1. + +This matches the definition of Erdős, Harary, and Tutte. Condition (2) is sometimes stated as "adjacent vertices have distance 1" (without the reverse direction), which would give "faithful dimension" vs "unit-distance dimension." The formalization uses the stricter biconditional version, which is the standard definition in the literature. + +**Verdict:** The problem is clearly formalizable with no meaningful ambiguity. + +## 6. Correctness + +**The formalization is mathematically correct but incomplete.** + +**Correct aspects:** +- The `IsUnitDistRep` definition correctly captures faithful unit-distance embedding: injectivity + adjacency ↔ distance 1. +- The theorem correctly encodes "the minimum number of edges in a graph of dimension exactly 4 is 9" as two parts: (a) existence of a 9-edge graph embeddable in ℝ⁴ but not ℝ³, and (b) every graph of dimension exactly 4 has ≥ 9 edges. +- The dimension-4 condition is correctly encoded as `HasUnitDistRep G 4 ∧ ¬HasUnitDistRep G 3`, meaning: embeddable in ℝ⁴ but not in ℝ³. This is correct because if a graph is embeddable in ℝ^k for k < 4, then it is also embeddable in ℝ³ (by padding with zeros or projecting — well, more precisely, embeddability in ℝ^k implies embeddability in ℝ^m for m ≥ k by adding zero coordinates). So `¬HasUnitDistRep G 3` correctly implies dimension ≥ 4, and `HasUnitDistRep G 4` gives dimension ≤ 4. + +**Wait — is `HasUnitDistRep G k → HasUnitDistRep G (k+1)` actually true?** If `f : V → EuclideanSpace ℝ (Fin k)` is a unit-distance representation, we need to lift it to `V → EuclideanSpace ℝ (Fin (k+1))`. This requires embedding ℝ^k into ℝ^(k+1) isometrically, which is standard (pad with a zero coordinate). This is mathematically obvious but would need to be proved in Lean. The formalization implicitly relies on this monotonicity property being true, which it is. + +**Incomplete aspects:** +- **Uniqueness not formalized**: The docstring says "This is achieved uniquely by K₃,₃" but the theorem statement does not capture this. A complete formalization would add a third conjunct asserting that any graph of dimension exactly 4 with 9 edges is isomorphic to `completeBipartiteGraph (Fin 3) (Fin 3)`. +- **K₃,₃ not referenced**: The existential part only asserts *some* graph with the right properties exists. It does not name K₃,₃ as the witness. While this is logically sufficient for the minimum-edge-count claim, it loses mathematical content. + +**No mathematical flaws identified.** The formalization correctly captures the core claim. The incompleteness (missing uniqueness) is a deliberate simplification rather than an error, but it means the formalization is weaker than the full result proved by House (2013). + +**Summary:** Correct and sound formalization of the minimum edge count. Missing the uniqueness-by-K₃,₃ claim that the docstring advertises and that is part of the proven result. diff --git a/ai-review/1008.md b/ai-review/1008.md new file mode 100644 index 0000000000..615bdeba61 --- /dev/null +++ b/ai-review/1008.md @@ -0,0 +1,80 @@ +# Erdős Problem 1008 — Review + +## 1. Code Reuse + +Several other problems in the codebase define C₄-related concepts that overlap with Problem 1008's definitions: + +- **Problem 573** (`573.lean:45-47`): Defines `C4Free` as `∀ a b c d, a ≠ c → b ≠ d → G.Adj a b → G.Adj b c → G.Adj c d → ¬G.Adj d a`. This is mathematically equivalent to Problem 1008's `CycleFourFree` but more concise — it exploits `SimpleGraph.Adj` irreflexivity so that only 2 explicit distinctness hypotheses (a ≠ c, b ≠ d) are needed instead of all 6. Consolidating these definitions would improve maintainability. +- **Problem 159** (`159.lean:47-50`): Defines `C4` as an explicit `SimpleGraph (Fin 4)` with modular adjacency, plus `ContainsSubgraph` via injective homomorphism. Problem 1008 could alternatively define C₄-freeness as `¬ContainsSubgraph G C4`, which would be more idiomatic for graph theory. +- **Problem 577** (`577.lean:39-41`): Defines `IsFourCycle` — yet another variant of the same concept. + +**Recommendation**: The codebase has at least 4 independent definitions of "contains a 4-cycle." These should be consolidated into a shared utility, or at minimum one canonical definition should be adopted and reused. + +## 2. Citations + +The formalization's docstring references: +- `[CFS14b]` — Conlon, Fox, and Sudakov +- `[Er71]` — Erdős + +Comparing against [erdosproblems.com/1008](https://www.erdosproblems.com/1008): + +- **Missing**: The website credits a simpler proof by **Zach Hunter** and also acknowledges **Boris Alexeev**. Neither is mentioned in the formalization's docstring. +- **Missing**: The website notes that **Folkman** provided the counterexample (K_{n,n²}) showing the m^{3/4} version is false. The docstring mentions Folkman but does not give the counterexample. +- **Missing**: The website mentions that Erdős noted in a footnote that **Szemerédi** proved the m^{2/3} bound, but provided no reference. This is not in the docstring. +- The citation format `[CFS14b]` and `[Er71]` are consistent with shorthand used on the website. + +## 3. Variants + +The problem has a natural historical progression: + +| Variant | Captured? | +|---------|-----------| +| Original m^{3/4} conjecture (Bollobás–Erdős) | Mentioned in docstring but not formalized | +| Folkman's counterexample to m^{3/4} | Mentioned in docstring, not formalized | +| Revised m^{2/3} conjecture (Erdős) | **Yes — this is the main theorem** | +| Trivial m^{1/2} lower bound | Mentioned in docstring, not formalized | + +The formalization captures the main resolved conjecture. The other variants are historical context and need not be separately formalized, though the trivial m^{1/2} bound could be a useful lemma. + +## 4. Readability + +**Strengths:** +- Clean structure with well-separated definitions and theorem statement. +- Good docstrings explaining the mathematical context and history. +- Appropriate use of `open SimpleGraph Classical`. + +**Suggestions:** +- The `ContainsCycleFour` definition lists all 6 pairwise distinctness conditions explicitly (`a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d`). As noted in Problem 573's docstring, only `a ≠ c` and `b ≠ d` are needed because the other 4 follow from irreflexivity of `Adj`. Adopting 573's style would be more concise. +- The definitions are placed in the `Erdos1008` namespace, which prevents reuse. Shared definitions should live in a common namespace or utility file. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The problem statement "every graph with m edges contains a C₄-free subgraph with ≫ m^{2/3} edges" is precise. The asymptotic notation "≫ m^{2/3}" is standard and means "at least c·m^{2/3} for some absolute constant c > 0," which is exactly what the formalization captures with the existential `∃ c : ℝ, c > 0 ∧ ...`. + +There is no ambiguity in: +- What "graph" means (simple, undirected — captured by `SimpleGraph`) +- What "C₄-free" means (no 4-cycle subgraph) +- What "subgraph" means (edge-subset on the same vertex set — captured by `H ≤ G`) +- What "≫ m^{2/3}" means (at least c·m^{2/3} for a universal constant) + +## 6. Correctness + +**Assessment: Correct and mathematically faithful.** + +Detailed analysis: + +1. **Quantifier structure**: `∃ c > 0, ∀ n G, ∃ H, ...` correctly captures "there is an absolute constant c such that for every graph..." The constant c is universal (does not depend on the graph), which matches the problem. + +2. **Graph representation**: Using `SimpleGraph (Fin n)` with universal quantification over `n : ℕ` correctly captures all finite simple graphs up to isomorphism. + +3. **Subgraph relation**: `H ≤ G` in Mathlib's `SimpleGraph` means `∀ u v, H.Adj u v → G.Adj u v`, i.e., H is a spanning subgraph of G (same vertex set, subset of edges). This is correct — any subgraph of a graph on n vertices can be extended to a spanning subgraph by treating non-included vertices as isolated. + +4. **C₄-freeness**: `CycleFourFree H` defined as `¬ContainsCycleFour H` correctly captures the absence of any 4-cycle. The `ContainsCycleFour` definition with all 6 distinctness conditions and 4 adjacency conditions (a-b, b-c, c-d, d-a) is mathematically correct. + +5. **Edge bound**: `c * (G.edgeFinset.card : ℝ) ^ ((2 : ℝ) / 3) ≤ (H.edgeFinset.card : ℝ)` correctly states that H has at least c·m^{2/3} edges where m = |E(G)|. The use of `edgeFinset.card` is appropriate for `Fin n`-indexed graphs (which are `Fintype` and `DecidableEq`). + +6. **Edge case**: When G has 0 edges, we need H with 0 edges and C₄-free — the empty graph on Fin n works, so the statement is vacuously satisfiable (c · 0^{2/3} = 0 ≤ 0). No issues here. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on the website. diff --git a/ai-review/1009.md b/ai-review/1009.md new file mode 100644 index 0000000000..b7a083d5f9 --- /dev/null +++ b/ai-review/1009.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 1009 + +## 1. Code Reuse + +**Opportunity identified.** Problem 76 (`FormalConjectures/ErdosProblems/76.lean`) already defines `IsEdgeDisjointFamily` (a family of `Finset (Fin n)` that are pairwise edge-disjoint) and `triangleEdges` (edges of a triangle as `Finset (Sym2 (Fin n))`). The custom `HasEdgeDisjointTriangles` in Problem 1009 reimplements this concept from scratch using a function-based representation (`Fin t → Fin 3 → Fin n`). + +The theorem could be restated using Problem 76's approach: + +``` +∃ 𝒯 : Finset (Finset (Fin n)), + (∀ T ∈ 𝒯, T.card = 3 ∧ G.IsClique ↑T) ∧ + IsEdgeDisjointFamily 𝒯 ∧ + 𝒯.card ≥ k - f +``` + +This would be more idiomatic and consistent with other graph theory formalizations in the codebase. + +Note: Mathlib's `SimpleGraph.EdgeDisjointTriangles` (in `Mathlib/Combinatorics/SimpleGraph/Triangle/Basic.lean`) is a *property of the entire graph* (every edge belongs to at most one triangle), which is fundamentally different from "contains t edge-disjoint triangles." It is not directly applicable here. + +## 2. Citations + +The formalization references: +- `[Er71]` — Erdős, P., *Some problems in graph theory*, 1971. +- `[Gy88]` — Győri, E., *On the number of edge-disjoint triangles in graphs of given size*, Combinatorica, 1988. + +The website lists `[Er71, p.98]` and `[Gy88]`, consistent with the formalization. The docstring correctly includes the page reference `[Er71, p.98]` in the theorem docstring. The references are complete and accurate. + +## 3. Variants + +The website mentions several refinements that are **not captured** in the formalization: + +- **Erdős's original result for c < 1/2** (f(c) = 0 in that range): not formalized as a separate statement. +- **Sauer's counterexample** showing f(2) ≥ 1: not formalized. +- **Győri's sharper bounds**: f(c) ≪ c² and f(c) = 0 for c < 2 (odd n) or c < 3/2 (even n) — mentioned in the docstring but not formalized. + +These are documented in the module docstring, which is reasonable. The main conjecture (existence of f(c)) is correctly captured. The sharper quantitative results could be separate theorems but are not essential. + +## 4. Readability + +**Mixed.** The module docstring is clear and well-written. However: + +- The `HasEdgeDisjointTriangles` definition (lines 45–53) is dense and hard to parse at a glance. The edge-disjointness condition uses a doubly-negated disjunction over ordered pairs to encode unordered edge equality. Using `Sym2` or Finset-based edges (as in Problem 76) would be more natural and readable. +- The function-based triangle representation (`Fin t → Fin 3 → Fin n`) is less standard than using `Finset (Fin n)` with a cardinality constraint. +- The docstring on `HasEdgeDisjointTriangles` is adequate but could more clearly state it represents "a collection of t edge-disjoint triangles" rather than describing the implementation. + +## 5. Formalizability + +**High.** The problem statement is precise and unambiguous: +- "every graph on n vertices" — clear. +- "at least ⌊n²/4⌋ + k edges" — precise. +- "k < cn" — precise constraint. +- "at least k − f(c) edge-disjoint triangles" — well-defined (existence of a collection of that size). + +The only potential ambiguity is whether f(c) should be a real number or a natural number. Since it represents a count of triangles (or a correction to a count), the choice of `f : ℕ` in the formalization is reasonable, though `f : ℝ` with `k - f` replaced by `⌊k - f⌋` could also work. The natural number choice is cleaner. + +**Formalizability assessment: unambiguous.** + +## 6. Correctness + +**Largely correct, with minor observations:** + +**(a) Floor division is correctly handled.** `n ^ 2 / 4` in `ℕ` is floor division, matching ⌊n²/4⌋ in the problem statement. ✓ + +**(b) Natural number subtraction edge case.** `k - f` in `ℕ` saturates at 0 when f ≥ k. This means the statement is vacuously easy to satisfy when f ≥ k (any graph has 0 edge-disjoint triangles). This is mathematically harmless — when k < f(c), the bound "at least k − f(c) triangles" is non-positive and thus trivially true. ✓ + +**(c) Quantifier structure.** The formalization says: for all c > 0, there exists f, for all n, for all G on n vertices, for all k with k < cn, if G has ≥ ⌊n²/4⌋ + k edges, then G has ≥ k − f edge-disjoint triangles. This matches the problem statement. ✓ + +**(d) `answer(True)` is correct.** The problem is proved (by Győri), and the answer is affirmative. ✓ + +**(e) The `HasEdgeDisjointTriangles` definition is mathematically correct.** It correctly encodes: +- Each triangle has 3 distinct vertices (injectivity of `tri i`). +- Each triangle is a clique in G (adjacency condition). +- Distinct triangles share no edge (the negation condition on lines 49–53 correctly prevents any unordered edge from appearing in two different triangles). + +**No mathematical flaws identified.** The formalization is correct and complete. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could reuse Problem 76's `IsEdgeDisjointFamily` and `triangleEdges` | +| Citations | Complete and accurate | +| Variants | Main conjecture captured; sharper bounds documented but not formalized | +| Readability | Adequate; custom definition is dense but correct | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/101.md b/ai-review/101.md new file mode 100644 index 0000000000..b4b8c1e9a6 --- /dev/null +++ b/ai-review/101.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 101 + +## 1. Code Reuse + +**The definitions in `101.lean` are entirely subsumed by the generic versions in `588.lean`.** + +- **`NoFiveCollinear`** (lines 34–36): This is exactly `NoKPlusOneCollinear 4` from `588.lean:34–36`. It is also equivalent to `NoKCollinear 5` from `960.lean:38–40`. Three separate files define what is semantically the same predicate at different levels of generality. Problem 588 is explicitly described as the generalization of Problem 101 (with $k = 4$). + +- **`fourRichLineCount`** (lines 45–48): This is exactly `kRichLineCount 4` from `588.lean:42–45`, and is identical (up to name) to `fourPlusRichLineCount` from `102.lean:35–38`. All three definitions use the same construction: `Set.ncard` over the set of `AffineSubspace`s with `Module.finrank ℝ L.direction = 1` and `k ≤ Set.ncard {points on L}`. + +**Recommendation:** Problem 101 should import and reuse the definitions from `588.lean` (or a shared utility). This would make the relationship between the problems explicit and reduce maintenance burden. Alternatively, the shared definitions (`kRichLineCount`, `NoKPlusOneCollinear`) could be extracted to a geometry utility module used by 101, 102, 588, and 960. + +## 2. Citations + +The formalization includes only a link to [erdosproblems.com/101](https://www.erdosproblems.com/101). The website lists the following information that should be documented: + +**Related problems:** +- Problem #102 (Erdős–Purdy conjecture: if $\geq cn^2$ four-rich lines, some line has unboundedly many points) +- Problem #588 (generalization to $k$-rich lines for $k \geq 4$) +- Problem #669 + +**Key references and constructions:** +- Grünbaum (1976): Constructed examples with $\gg n^{3/2}$ four-rich lines (no five collinear), leading Erdős to initially guess $n^{3/2}$ as the correct order +- Solymosi and Stojaković (2013): Constructed point sets with no five collinear and $\geq n^{2 - O(1/\sqrt{\log n})}$ lines containing exactly four points, disproving Erdős's $n^{3/2}$ guess and showing the bound is essentially tight + +**Other metadata:** +- Listed as Problem 71 on Green's open problems list +- Related OEIS sequence: A006065 +- Prize: $100 + +The docstring should mention at minimum the Solymosi–Stojaković lower bound, as it is the state of the art and directly informs the tightness of the conjecture. + +## 3. Variants + +The formalization captures only the main conjecture: the number of four-rich lines is $o(n^2)$. + +**Missing variants / related questions:** +- **Exact vs. at-least four:** The website describes lines containing "exactly four points," while the formalization counts lines with "at least four" points. Under the no-five-collinear hypothesis these are equivalent (no line can contain 5+ points), so the formalization is correct. However, the distinction should be noted in the docstring for clarity. +- **Quantitative bounds:** Erdős originally speculated the correct order was $n^{3/2}$, which was refuted by Solymosi–Stojaković's $n^{2-O(1/\sqrt{\log n})}$ construction. A companion statement formalizing a known upper bound (if any exists) would provide useful context. +- **Connection to 588:** The formalization could note that `erdos_101` is the special case $k = 4$ of `erdos_588`, and that a proof of 588 would imply 101. + +**Assessment:** The core conjecture is captured. The lack of an explicit link to the generalized Problem 588 is a missed opportunity for mathematical context. + +## 4. Readability + +The code is well-structured and readable: + +- **Good:** Each definition has a clear docstring explaining the mathematical meaning. +- **Good:** The namespace `Erdos101` avoids name collisions. +- **Good:** The formal encoding of $o(n^2)$ as "for every $\varepsilon > 0$, there exists $N$ such that..." is clearly explained in the theorem docstring. +- **Minor:** The set comprehension in `fourRichLineCount` nests two `Set.ncard` calls and a conjunction, which is somewhat dense. This is an inherent complexity of the definition and is handled identically in 102, 588, and 960, so it follows established convention. +- **Minor:** The name `fourRichLineCount` is slightly inconsistent with `fourPlusRichLineCount` in 102.lean, even though they compute the same thing. Standardizing on one name (or reusing from 588) would improve consistency. + +## 5. Formalizability + +**Assessment: Highly formalizable. Low ambiguity.** + +The problem statement is precise: +- "No five collinear" is a standard, well-defined geometric condition with a canonical Mathlib formalization via `Collinear ℝ`. +- "Lines containing (at least/exactly) four points" is unambiguous once the collinearity constraint is in place. +- "$o(n^2)$" has a standard $\varepsilon$-$N$ formulation. + +The only potential source of ambiguity — "exactly four" vs. "at least four" — is resolved by the no-five-collinear constraint, which ensures equivalence. The problem is unambiguously formalizable as stated. + +## 6. Correctness + +**The formalization is mathematically correct but has a structural concern regarding the open/closed status.** + +Detailed analysis: + +- **Encoding of $o(n^2)$:** The statement asserts: for every $\varepsilon > 0$, there exists $N$ such that for all $n \geq N$ and every valid $n$-point configuration $P$, `fourRichLineCount P ≤ ε · n²`. This correctly encodes the assertion that the *maximum* number of four-rich lines over all valid $n$-point configurations is $o(n^2)$. The universal quantification over $P$ correctly captures the worst case. **Correct.** + +- **`NoFiveCollinear`:** Quantifies over all 5-element subsets and asserts non-collinearity via Mathlib's `Collinear ℝ`. This is the standard characterization of "no five points are collinear." **Correct.** + +- **`fourRichLineCount`:** Counts `Set.ncard` of the set of 1-dimensional affine subspaces containing $\geq 4$ points of $P$. The dimension-1 constraint correctly identifies lines (as opposed to points or the whole plane). For finite $P$, the set of such lines is finite (bounded by $\binom{n}{2}$), so `Set.ncard` agrees with the true cardinality. **Correct.** + +- **Open problem stated as a theorem:** Problem 101 is **open** (with a \$100 prize). The formalization states `erdos_101` as a direct `theorem ... := by sorry`, which asserts the conjecture is true. By contrast, Problem 588 (the generalization) uses the `answer(sorry) ↔ ...` pattern, which correctly encodes an open yes/no question. This inconsistency is notable: if the conjecture turns out to be false (and Solymosi–Stojaković's near-$n^2$ lower bound suggests this is not inconceivable), then `erdos_101` as stated would be *unprovable* (not merely unproven). The `answer(sorry) ↔` pattern used in 588.lean would be more appropriate here, since the problem asks to "determine whether" the count is $o(n^2)$, not to prove that it is. + + That said, other open conjectures in the codebase (e.g., 102, 960) also use the direct theorem pattern, suggesting this may be a deliberate project convention for problems where the expected answer is "yes." If so, this is acceptable but should be documented. + +- **Equivalence with Problem 588 at $k=4$:** The statement of `erdos_101` is logically equivalent to `erdos_588` instantiated at $k = 4$ (with the forward direction of the `answer(sorry) ↔` in 588). Specifically, `NoFiveCollinear P` is definitionally equal to `NoKPlusOneCollinear 4 P`, and `fourRichLineCount P` equals `kRichLineCount 4 P`. **Correct.** + +**Verdict:** The formalization is mathematically correct as a statement of the conjecture. The use of a direct theorem (rather than `answer(sorry) ↔`) for an open problem is a minor structural concern, particularly given that the generalization (588) uses the more cautious pattern. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | Both definitions are special cases of 588.lean's generic versions; 102.lean has an identical copy | +| Citations | Needs improvement | Missing references (Grünbaum 1976, Solymosi–Stojaković 2013), related problems (102, 588, 669), and prize information | +| Variants | Acceptable | Core conjecture captured; could note equivalence of "exactly/at-least four" and connection to Problem 588 | +| Readability | Good | Well-documented, follows codebase conventions; minor naming inconsistency with 102.lean | +| Formalizability | Excellent | Unambiguous, precise problem statement | +| Correctness | Correct (with caveat) | Mathematically faithful; direct-theorem pattern for an open problem is inconsistent with the generalization (588) which uses `answer(sorry) ↔` | diff --git a/ai-review/1010.md b/ai-review/1010.md new file mode 100644 index 0000000000..442440d2cb --- /dev/null +++ b/ai-review/1010.md @@ -0,0 +1,110 @@ +# AI Review: Erdős Problem 1010 + +## 1. Code Reuse + +The `triangleCount` definition at line 37 is the only instance of this definition in the codebase. It is defined locally in the `Erdos1010` namespace: + +```lean +noncomputable def triangleCount {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + Nat.card {s : Finset (Fin n) // G.IsNClique 3 s} +``` + +**Potential reuse opportunities:** + +- **`IsNClique`**: Already imported from Mathlib via `ProblemImports`. Used correctly here. +- **`edgeFinset`**: Standard Mathlib API, used consistently across many Erdős problems (667, 801, 1009, 1079, etc.). +- **`triangleCount` itself**: This definition is not shared with any other file. Problem 1009 (the adjacent problem, also about triangles above the Turán threshold) defines its own `HasEdgeDisjointTriangles` predicate using a different representation (injective maps from `Fin 3` to vertices). Problem 167 (Tuza's conjecture) also works with triangles via `IsNClique 3` but doesn't define a counting function. If triangle counting is needed elsewhere, this definition could be promoted to a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`), but as a single-use definition it is fine where it is. + +## 2. Citations + +**Website (erdosproblems.com/1010) states:** +- Problem attributed to Erdős [Er62d]. +- Rademacher proved the base case $t = 1$. +- Erdős proved the result for $t < cn$ for some constant $c > 0$. +- Proved independently by Lovász and Simonovits (1976) and Nikiforov and Khadzhiivanov (1981). + +**Formalization docstring states:** +- References [Er62d], [LoSi76], and [NiKh81] — all matching the website. +- The docstring mentions Rademacher's result and Erdős's partial result, consistent with the website. + +**Assessment:** Citations are consistent with the website. The references [Er62d], [LoSi76], [NiKh81] are shorthand tags rather than full bibliographic entries, but this is the convention used throughout the codebase. No issues. + +## 3. Variants + +The website states the problem as: + +> "Let $t < \lfloor n/2 \rfloor$. Does every graph on $n$ vertices with $\lfloor n^2/4 \rfloor + t$ edges contain at least $t \lfloor n/2 \rfloor$ triangles?" + +The formalization captures exactly this single statement. The website does not list additional variants or sub-problems for problem 1010. + +**Related problems not captured (nor required):** +- The Rademacher base case ($t = 1$, yielding $\geq \lfloor n/2 \rfloor$ triangles) is a special case of the formalized statement. +- Problem 1009 (edge-disjoint triangles above Turán threshold) is a separate problem, formalized in its own file. + +**Assessment:** All variants are captured. The single statement is complete. + +## 4. Readability + +The code is clear and concise. A few observations: + +- The `triangleCount` definition is well-documented with a docstring explaining it counts 3-cliques. +- The theorem statement reads naturally: for a graph on `n` vertices with at least `n^2/4 + t` edges (where `t < n/2`), the triangle count is at least `t * (n/2)`. +- The use of `Fin n` for vertices is standard in this codebase. +- The `[DecidableRel G.Adj]` instance is necessary for `edgeFinset` and is standard. + +**Minor suggestion:** The module docstring says "Rademacher proved that every graph on $n$ vertices with $\lfloor n^2/4 \rfloor + 1$ edges contains at least $\lfloor n/2 \rfloor$ triangles" — this is the $t = 1$ case and provides good context. The docstring is well-written. + +**Assessment:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem statement is fully precise and unambiguous: +- "graph on $n$ vertices" → `SimpleGraph (Fin n)` +- "$\lfloor n^2/4 \rfloor + t$ edges" → `G.edgeFinset.card ≥ n ^ 2 / 4 + t` (natural number division gives the floor) +- "$t < \lfloor n/2 \rfloor$" → `t < n / 2` +- "contains at least $t \lfloor n/2 \rfloor$ triangles" → `triangleCount G ≥ t * (n / 2)` + +All quantities are natural numbers with well-defined floor operations via Lean's natural number division. The notion of "triangle" as a 3-clique is standard and unambiguous. + +**Assessment:** The problem is fully formalizable with no ambiguity. The mapping from informal mathematics to formal Lean is straightforward and natural. + +## 6. Correctness + +**Detailed analysis of the formalization:** + +The theorem states: +```lean +theorem erdos_1010 (n : ℕ) (t : ℕ) (ht : t < n / 2) + (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] + (hedge : G.edgeFinset.card ≥ n ^ 2 / 4 + t) : + triangleCount G ≥ t * (n / 2) +``` + +**Floor divisions:** In Lean, `n / 2` and `n ^ 2 / 4` on `ℕ` are integer (floor) division, which correctly captures $\lfloor n/2 \rfloor$ and $\lfloor n^2/4 \rfloor$. + +**Edge count direction:** The hypothesis uses `≥` rather than `=`. The website says "with $\lfloor n^2/4 \rfloor + t$ edges." Strictly read, this means exactly that many edges. However, the formalization using `≥` is mathematically stronger (and the result with `≥` follows from the result with `=` by monotonicity of triangle count with respect to adding edges — though this monotonicity itself is nontrivial). The `≥` formulation is more useful and is the standard way to state such results in extremal graph theory. This is a reasonable and defensible choice. + +**Triangle counting:** The `triangleCount` definition counts the number of 3-element subsets (as `Finset (Fin n)`) that form cliques. This counts triangles as unordered triples of vertices, which is the standard convention in combinatorics (each triangle is counted once, not six times as ordered triples). This is correct. + +**The `Nat.card` usage:** `triangleCount` uses `Nat.card` on the subtype `{s : Finset (Fin n) // G.IsNClique 3 s}`. Since `Fin n` is finite, the set of all 3-cliques is finite, so `Nat.card` will agree with the cardinality of the finite set. This is correct. + +**Constraint `t < n / 2`:** This matches the problem statement $t < \lfloor n/2 \rfloor$. Note that `t` is a natural number, so the constraint implicitly requires `n ≥ 2` for there to exist any valid `t > 0` (since `n / 2 = 0` for `n = 0, 1`). The case `t = 0` is trivially true. This is all correct. + +**Status tag:** `@[category research solved, AMS 5]` — marked as solved, consistent with the website. AMS 5 is combinatorics, which is appropriate. + +**Potential concern — `n ^ 2 / 4` vs `(n ^ 2) / 4`:** In Lean, `n ^ 2 / 4` parses as `(n ^ 2) / 4` due to operator precedence (`^` binds tighter than `/`). This correctly computes $\lfloor n^2/4 \rfloor$. No issue here. + +**Assessment:** The formalization is mathematically correct and complete. The use of `≥` for edge count rather than `=` is a minor strengthening that is standard and valid. No flaws identified. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `triangleCount` is unique to this file; could be shared but single-use is fine | +| Citations | Consistent with erdosproblems.com/1010 | +| Variants | All variants captured (single statement) | +| Readability | Good; clear and well-documented | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | + +**Overall:** The formalization is clean, correct, and faithful to the original problem. No changes are required. diff --git a/ai-review/1011.md b/ai-review/1011.md new file mode 100644 index 0000000000..93480c3d45 --- /dev/null +++ b/ai-review/1011.md @@ -0,0 +1,107 @@ +# Review: Erdős Problem 1011 + +## 1. Code Reuse + +The `minTriangleEdges` definition uses a standard pattern: `sInf` over a set of natural numbers satisfying a graph-theoretic property. This pattern appears throughout the codebase: + +- **Problem 111** (`FormalConjectures/ErdosProblems/111.lean`): Defines `minEdgeDeletionsForBipartite` via `sInf` over edge-deletion counts. Conceptually related since the Simonovits asymptotic involves `g(r)`, the maximum number of *vertices* to delete from a triangle-free graph with chromatic number ≥ r to make it bipartite. However, problem 111 counts *edge* deletions and operates on uncountable graphs (chromatic number ℵ₁), so the definition cannot be directly reused. + +- **Problem 127** (`FormalConjectures/ErdosProblems/127.lean`): Defines `maxBipartiteSubgraphSize` and uses `sInf` over real numbers for excess over the Edwards bound. Similar structural pattern but different domain. + +- **Problem 146** (`FormalConjectures/ErdosProblems/146.lean`): Defines `turanNumber` via `sSup`. Since Turán's theorem gives the base case `f_2(n) = ⌊n²/4⌋ + 1`, there is a mathematical connection, but the Turán number definition there uses `sSup` over edge counts of H-free graphs (dual formulation) and is not directly reusable. + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`**: Defines `chromaticNumber` (with notation `χ(G)`) — already used implicitly via Mathlib's `G.chromaticNumber`. + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`**: Defines `sizeRamsey` via `sInf` and `edgeSet.ncard` — very similar structural pattern to `minTriangleEdges`. + +**Verdict**: No existing definition can replace `minTriangleEdges`. The definition is appropriately self-contained. No significant code reuse opportunity. + +## 2. Citations + +The website (erdosproblems.com/1011) provides the following information not fully reflected in the formalization: + +**Missing from docstring:** +- **f₄(n) result**: Ren, Wang, Wang, and Yang proved `f_4(n) = ⌊(n-3)²/4⌋ + 6` for `n ≥ 150`. This is not mentioned. +- **Davies–Illingworth citation**: The docstring mentions "Davies–Illingworth" for the lower bound but provides no formal citation. The website attributes this to a 2022 result. +- **Hefty–Horn–King–Pfender citation**: Similarly mentioned without a formal citation. The website attributes this to a 2025 result. +- **Contributors**: The website acknowledges Zach Hunter, Mark Sellke, and Wouter Cames van Batenburg. + +**Present in docstring but not on website:** +- The `[Er71]` citation (Erdős, 1971) is included in the docstring. The website does not explicitly list this reference but it is standard. + +**Recommendation**: Add formal citations for Davies–Illingworth and Hefty–Horn–King–Pfender, and mention the f₄(n) result. + +## 3. Variants + +The formalization captures the **Simonovits asymptotic** form of f_r(n). The following variants from the website are **not** formalized: + +1. **Exact values**: `f_2(n) = ⌊n²/4⌋ + 1` (Turán), `f_3(n) = ⌊(n−1)²/4⌋ + 2` (Erdős–Gallai), and `f_4(n) = ⌊(n−3)²/4⌋ + 6` for n ≥ 150. These are concrete, formalizable statements that would make natural companion theorems. + +2. **Bounds on g(r)**: The docstring mentions `(1/2 − o(1))r² log r ≤ g(r) ≤ (2 + o(1))r² log r` but these bounds are not formalized. They could be stated as separate theorems involving the `g_r` from the existential. + +3. **The open problem**: The full problem ("determine f_r(n)") asks for an exact characterization, not just the asymptotic. The formalization sidesteps this open question by formalizing only the solved asymptotic. + +**Verdict**: The most important variant (the asymptotic) is captured. The exact-value cases for small r would be valuable additions but are not strictly necessary. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The docstring is thorough and provides good mathematical context. +- The `minTriangleEdges` definition is clearly named and has a helpful doc comment. +- The use of `(r : ℕ∞)` for comparing with `chromaticNumber` (which has type `ℕ∞`) is correct and readable. +- The `∀ᶠ n in atTop` filter usage is standard for "for all sufficiently large n." +- The namespace `Erdos1011` keeps definitions self-contained. + +**One suggestion**: The theorem docstring could more explicitly state that this formalizes the *solved* Simonovits asymptotic rather than the *open* problem of determining g_r precisely, to reduce confusion about why a problem marked "open" on the website is tagged `solved`. + +## 5. Formalizability + +**The original problem** ("Determine f_r(n)") is **not directly formalizable** as stated — "determine" is an informal mathematical instruction, not a precise logical statement. + +**The formalized statement** (Simonovits asymptotic) is **fully formalizable** and precisely stated. The claim is: + +> For every r ≥ 2, there exist g_r ∈ ℝ and C ≥ 0 such that for all sufficiently large n, |f_r(n) − (n²/4 − g_r/2 · n)| ≤ C. + +This is unambiguous. The definition of `minTriangleEdges` precisely captures f_r(n), and the asymptotic claim is a standard ∃∀ statement. **Ambiguity: None.** + +## 6. Correctness + +### Definition of `minTriangleEdges` + +The set `{m : ℕ | ∀ G : SimpleGraph (Fin n), G.edgeSet.ncard ≥ m → (r : ℕ∞) ≤ G.chromaticNumber → ¬G.CliqueFree 3}` correctly captures "the minimum m such that every n-vertex graph with ≥ m edges and chromatic number ≥ r contains a triangle." + +**Key properties verified:** +- **Upward-closed**: If all graphs with ≥ m edges satisfy the property, then so do all graphs with ≥ (m+1) edges (a subset). So `sInf` correctly returns the threshold. +- **Nonempty**: For any n, taking m > n(n−1)/2 makes the hypothesis `G.edgeSet.ncard ≥ m` vacuously false, so the set is nonempty. +- **`sInf` on ℕ**: When the set is nonempty, `sInf` returns the minimum element (ℕ is well-ordered). When empty, it returns 0. The set is always nonempty here, so this is fine. +- **`Fin n` for vertex type**: Correctly models "graphs on n (labeled) vertices." The chromatic number and edge count are invariant under relabeling, so using labeled vertices is mathematically equivalent. + +### Theorem statement + +- **`r ≥ 2` precondition**: Correct. For r ≤ 1, the chromatic number condition is trivial and the problem is degenerate. +- **Asymptotic form**: The expression `(n : ℝ)^2 / 4 - g_r / 2 * (n : ℝ)` matches the Simonovits asymptotic n²/4 − g(r)n/2. +- **Bounded error**: `|f_r(n) − (n²/4 − g_r·n/2)| ≤ C` for C ≥ 0 correctly captures O(1) error. The non-negativity constraint `0 ≤ C` is harmless (any real bound can be replaced by max(bound, 0)). +- **`∀ᶠ n in atTop`**: Correctly captures "for all sufficiently large n." +- **Cast correctness**: `(minTriangleEdges r n : ℝ)` and `(n : ℝ)` are standard ℕ → ℝ coercions. + +### Status tag + +The tag `@[category research solved, AMS 5]` is **appropriate** for the statement as formalized (the Simonovits asymptotic is indeed proved). However, the *full* Erdős Problem 1011 as stated on the website ("Determine f_r(n)") remains **open**. The docstring acknowledges this distinction, which is good. + +### Potential issue: strength of the statement + +The existential `∃ (g_r : ℝ) (C : ℝ)` does not constrain g_r to be the specific value related to the maximum vertex-deletion number for triangle-free graphs with chromatic number ≥ r. A trivially weak proof could pick g_r = 0 and C = n²/4, except that C must be fixed independently of n. So the statement does require a genuine linear correction term, which is correct. + +**Verdict: The formalization is mathematically correct.** It faithfully captures the Simonovits asymptotic for f_r(n). No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities; definition is appropriately self-contained | +| Citations | Missing formal citations for Davies–Illingworth and Hefty–Horn–King–Pfender; missing f₄(n) result | +| Variants | Asymptotic captured; exact values for small r and bounds on g(r) not formalized | +| Readability | Clean and well-structured; minor suggestion to clarify solved-vs-open distinction | +| Formalizability | Fully formalizable, no ambiguity in the formalized statement | +| Correctness | Mathematically correct and complete for the Simonovits asymptotic | diff --git a/ai-review/1012.md b/ai-review/1012.md new file mode 100644 index 0000000000..451ceb9fe4 --- /dev/null +++ b/ai-review/1012.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1012 + +## 1. Code Reuse + +**The `ContainsCycleOfLength` definition should be replaced with existing codebase patterns.** + +The codebase already has two essentially identical definitions for "the set of cycle lengths in a graph": + +- `Erdos751.cycleLengths` (`ErdosProblems/751.lean:40`): + ```lean + def cycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + ``` +- `Erdos84.cycleSpectrum` (`ErdosProblems/84.lean:50`): + ```lean + def cycleSpectrum {V : Type*} (G : SimpleGraph V) : Set ℕ := + {ℓ : ℕ | ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = ℓ} + ``` + +Both use Mathlib's `SimpleGraph.Walk.IsCycle`, which is the standard way cycles are represented across 86+ files in this codebase. The current `ContainsCycleOfLength` instead rolls its own cycle definition via an injective function `Fin m → V` with modular adjacency. While mathematically equivalent, this is non-standard for the codebase and harder to connect to existing Mathlib lemmas about walks, paths, and cycles. + +**Recommendation:** Replace `ContainsCycleOfLength G l hl₁` with `l ∈ cycleLengths G` (or the equivalent inline `∃ v, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = l`). Ideally, `cycleLengths` or `cycleSpectrum` should be factored out into a shared utility (e.g., in `FormalConjecturesForMathlib`) since it is duplicated across at least problems 84, 751, and now potentially 1012. + +## 2. Citations + +**Website references (from erdosproblems.com/1012):** +- [Er62e] — Erdős, existence of f(k) for all k ≥ 0 +- [Er71, p.98] — Erdős (additional reference) +- [Or61] — Ore, f(0) = 1 +- [Bo71b] — Bondy, f(1) = 1 +- [Wo72] — Woodall, complete settlement with f(k) = 2k + 3 + +**Formalization docstring references:** +- [Er62e] ✓ +- [Or61] ✓ +- [Bo71b] ✓ +- [Wo72] ✓ + +**Missing from docstring:** The reference [Er71, p.98] listed on the website is not mentioned in the formalization's docstring. This is a minor omission — it is a secondary reference rather than a primary result, but should be included for completeness. + +## 3. Variants + +The formalization captures **Woodall's stronger result** (cycles of all lengths 3 ≤ ℓ ≤ n − k), which subsumes the original problem (just ℓ = n − k). The docstring correctly notes this relationship. This is the right choice — the stronger statement is more informative and is what was actually proved. + +**No missing variants.** The website does not mention any additional open variants or generalizations beyond what is formalized. The problem is marked as fully solved. + +## 4. Readability + +The code is generally readable, with a few notes: + +- **Custom cycle definition adds cognitive overhead.** A reader familiar with the codebase expects `SimpleGraph.Walk.IsCycle`-based definitions. The bespoke `ContainsCycleOfLength` requires reading and verifying a separate definition. Using the standard pattern would improve readability. +- **The `_ : m ≥ 3` unnamed parameter** in `ContainsCycleOfLength` is slightly unusual. If the definition is kept, naming it (e.g., `hm`) would be clearer. +- **The docstring is well-written.** It clearly explains the problem, the historical progression of results, and how the formalized statement relates to the original question. +- **Namespace usage is clean.** The `Erdos1012` namespace properly scopes the custom definition. + +## 5. Formalizability + +**The problem is clearly formalizable and has been formalized at the right level of generality.** + +The original problem asks to "determine or estimate f(k)," which is somewhat open-ended. The formalization wisely captures Woodall's complete resolution rather than trying to formalize the estimation problem. The edge-count threshold ⌊C(n−k−1,2) + C(k+2,2) + 1⌋ and the cycle-length range 3 ≤ ℓ ≤ n−k are all precisely stated. + +**Ambiguity assessment: Low.** The only potential subtlety is what "contains a cycle of length ℓ" means — specifically whether it requires ℓ distinct vertices forming a cycle (as formalized) or whether a walk-based definition is intended. Both are equivalent for simple graphs, so there is no real ambiguity here. + +## 6. Correctness + +**The formalization is mathematically correct**, with one technical subtlety worth noting: + +### Correct aspects: +- **Edge threshold:** `Nat.choose (n - k - 1) 2 + Nat.choose (k + 2) 2 + 1` correctly encodes C(n−k−1, 2) + C(k+2, 2) + 1. +- **Vertex bound:** `n ≥ 2 * k + 3` matches Woodall's theorem requirement. +- **Cycle length range:** `3 ≤ l` and `l ≤ n - k` correctly capture all cycle lengths in the range. +- **Graph representation:** Using `SimpleGraph (Fin n)` correctly models a labeled simple graph on n vertices. +- **`[DecidableRel G.Adj]`** is needed for `edgeFinset` — correct. + +### Subtlety — natural number subtraction: +The expression `n - k - 1` uses natural number subtraction. Since `n ≥ 2k + 3` and `k ≥ 0`, we have `n ≥ 3`, so `n - k - 1 ≥ k + 2 ≥ 2`, meaning the subtraction never underflows. Similarly, `n - k` in `l ≤ n - k` is safe since `n ≥ 2k + 3 > k`. This is correct but the proof will need to handle these arithmetic details. + +### The `ContainsCycleOfLength` definition is correct but non-standard: +The definition requires m distinct vertices (via `Function.Injective f`) with consecutive adjacency (via modular arithmetic). This correctly captures the notion of an m-cycle in a simple graph. The requirement `m ≥ 3` correctly excludes degenerate cases (loops and multi-edges, which don't exist in simple graphs). + +**Overall assessment: The formalization is correct and complete. No mathematical flaws.** + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Should use existing `cycleLengths`/`cycleSpectrum` pattern instead of custom `ContainsCycleOfLength` | +| Citations | Minor: [Er71, p.98] missing from docstring | +| Variants | Complete — captures Woodall's full result | +| Readability | Good overall; would improve by using standard cycle definitions | +| Formalizability | High — low ambiguity, well-defined | +| Correctness | Correct and complete | diff --git a/ai-review/1013.md b/ai-review/1013.md new file mode 100644 index 0000000000..e08267b18b --- /dev/null +++ b/ai-review/1013.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 1013 + +## 1. Code Reuse + +The definition of `h3` in this file uses `sInf {n : ℕ | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.chromaticNumber = (k : ℕ∞)}`, which is a common pattern across the codebase: + +- **Problem 1104** (`1104.lean`) defines the dual quantity `triangleFreeMaxChromatic` as `sSup {χ | ∃ G : SimpleGraph (Fin n), G.CliqueFree 3 ∧ G.chromaticNumber = χ}`. These two functions are inverses: `h3(k) = min {n | triangleFreeMaxChromatic(n) ≥ k}`. A shared utility or a remark documenting this duality could be valuable. +- **Problem 920** (`920.lean`) defines `f k n` (max chromatic number of a `K_k`-free graph on `n` vertices), which generalizes `triangleFreeMaxChromatic` to arbitrary clique sizes. Note that `Erdos920.f 3 n` and `Erdos1104.triangleFreeMaxChromatic n` compute the same quantity but are defined separately. +- **Problem 1011** (`1011.lean`) uses a similar `sInf` + `CliqueFree 3` + `chromaticNumber` pattern for `minTriangleEdges`. +- **`DegreeSequencesTriangleFree.lean`** defines `F n` using nearly the same `sInf` pattern but with an additional `degreeSequenceMultiplicity` constraint. + +**Recommendation:** Consider factoring out a general `minVertices (P : SimpleGraph (Fin n) → Prop) (k : ℕ) : ℕ` definition, or at minimum adding cross-references between Problems 1013, 1104, and 920 since they study the same underlying function from different angles. + +## 2. Citations + +**Website (erdosproblems.com/1013):** The problem statement on the website asks two things: +1. Find an asymptotic formula for $h_3(k)$. +2. Prove that $h_3(k+1)/h_3(k) \to 1$. + +The website references **[Er71]** — Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*. It also mentions: +- Graver & Yackel (1968) proved $h_3(k) \gg \frac{\log k}{\log \log k} k^2$. +- From Problem 1104: $(1/2 - o(1))k^2 \log k \leq h_3(k) \leq (1 + o(1))k^2 \log k$. +- Related problems: #920 (generalization to $K_r$-free), #1104 (dual formulation). +- OEIS sequence A292528. + +**Current formalization citation:** `[Er71] Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*.` — This matches the website. However, the citation is missing publication details. The website doesn't provide more detail for this particular reference either, so the shorthand is acceptable. + +**Recommendation:** Add a mention of the related problems (920, 1104) in the docstring, since the website explicitly links them. + +## 3. Variants + +The website describes two questions under Problem 1013: +1. **Asymptotic formula for $h_3(k)$** — not formalized. +2. **$h_3(k+1)/h_3(k) \to 1$** — this is what is formalized. + +The known bounds $(1/2 - o(1))k^2 \log k \leq h_3(k) \leq (1 + o(1))k^2 \log k$ would immediately imply the ratio result, so formalizing these bounds as variant theorems (partially captured in Problem 1104) would be natural. + +**Recommendation:** Consider adding: +- A variant stating the asymptotic formula question (even if as a TODO). +- Cross-reference to Problem 1104's bounds, which imply this result. + +## 4. Readability + +The code is clean and well-structured. A few observations: + +- The docstring clearly explains the epsilon-delta formulation, which is helpful. +- The `h3` definition docstring is clear. +- The namespace `Erdos1013` is appropriate. + +**Minor suggestion:** The docstring could note that this problem would follow from known asymptotic bounds (if the bounds in Problem 1104 are tight enough), to give mathematical context. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The statement "$h_3(k+1)/h_3(k) \to 1$" is completely precise once $h_3(k)$ is defined, and the definition of $h_3(k)$ as the minimum number of vertices of a triangle-free graph with chromatic number $k$ is standard and unambiguous. + +One subtle point: the formalization uses `sInf` on a set that could potentially be empty (e.g., if no triangle-free graph with chromatic number exactly $k$ exists for some $k$). In Lean/Mathlib, `sInf ∅ = 0` for `ℕ`. This is mathematically fine because: +- By Mycielski's construction, triangle-free graphs of arbitrary chromatic number exist, so the set is nonempty for all $k ≥ 1$. +- For $k = 0$, `h3 0 = 0` (via `sInf ∅ = 0`) is a reasonable convention, and the theorem only concerns the limit behavior. + +The epsilon-delta formulation `∀ ε > 0, ∃ K₀, ∀ k ≥ K₀, |h3(k+1)/h3(k) - 1| ≤ ε` correctly captures the limit. Note that it uses `≤ ε` rather than `< ε`, which is equivalent for the limit statement (since if it holds for all `ε > 0` with `≤`, it holds with `<` too, and vice versa). + +**Potential concern:** Division by zero when `h3 k = 0`. In Lean, `(0 : ℝ) / 0 = 0`, so `|0/0 - 1| = 1`, which would require `ε ≥ 1`. This is handled correctly by the existential `K₀` — for large enough `k`, `h3 k > 0` (since Mycielski graphs exist), so this is not an issue in practice. + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +- The definition of `h3` correctly captures the minimum number of vertices of a triangle-free graph with chromatic number exactly $k$. Using `chromaticNumber = (k : ℕ∞)` correctly handles the coercion to `ℕ∞` (since `chromaticNumber` returns a value in `ℕ∞`). +- The theorem statement correctly formalizes the limit $h_3(k+1)/h_3(k) \to 1$ via an epsilon-delta formulation. +- The use of `SimpleGraph (Fin n)` to represent graphs on exactly $n$ vertices is standard in this codebase. +- The `CliqueFree 3` predicate correctly captures "triangle-free." + +**One mathematical note:** An alternative (arguably more idiomatic in Mathlib) formulation would use `Filter.Tendsto`: +```lean +Filter.Tendsto (fun k => (h3 (k + 1) : ℝ) / (h3 k : ℝ)) Filter.atTop (nhds 1) +``` +This is mathematically equivalent to the epsilon-delta version but leverages Mathlib's filter/topology infrastructure. However, the epsilon-delta version is arguably more readable and self-contained, which is a reasonable trade-off for a conjecture file. + +**Overall: The formalization is correct, complete for the ratio question, and well-written. The main gap is that only one of the two questions on the website (the ratio limit) is formalized, while the asymptotic formula question is not — though this is partially addressed by Problem 1104.** diff --git a/ai-review/1014.md b/ai-review/1014.md new file mode 100644 index 0000000000..7d0763471c --- /dev/null +++ b/ai-review/1014.md @@ -0,0 +1,71 @@ +# AI Review: Erdős Problem 1014 + +## 1. Code Reuse + +The `ramseyR` definition in this file is **identical** to the one in `ErdosProblems/1030.lean`: + +```lean +noncomputable def ramseyR (k l : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree l} +``` + +This same pattern (with varying generality) is duplicated across many files: + +- **1030.lean**: Identical `ramseyR (k l : ℕ)` definition. +- **544.lean, 553.lean**: `ramseyR3 (k : ℕ)` — the specialization `ramseyR 3 k`. +- **812.lean**: `diagonalRamsey (n : ℕ)` — the specialization `ramseyR n n`. + +None of these share a common definition. The library file `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey (r n : ℕ)` for r-uniform hypergraphs with 2-colorings, which is a different (more general) Ramsey concept and not directly applicable here. + +**Recommendation**: A shared `ramseyR` definition should be factored into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean` and imported by problems 544, 553, 812, 1014, and 1030. + +## 2. Citations + +The formalization cites: + +> [Er71] Erdős, P., _Topics in combinatorial analysis_, pp. 95-99, 1971. + +The website ([erdosproblems.com/1014](https://www.erdosproblems.com/1014)) references `[Er71, p.99]` as the primary source. The citation in the file is consistent with the website. The website also mentions related problems **[544]** (behavior of R(3,k) differences) and **[1030]** (diagonal ratio version), which are noted in the module docstring of 544.lean but not cross-referenced in 1014.lean. + +**Recommendation**: Consider adding a note in the docstring mentioning the related problems: "See also [544] and [1030]." + +## 3. Variants + +The website states this is open even for the case k = 3. The formalization captures the full generality (all k ≥ 3) in a single theorem statement. There do not appear to be any additional variants of this problem — it is a single conjecture. The k = 3 specialization is implicitly included by the universal quantification over k ≥ 3, so no separate variant is needed. + +**Assessment**: All variants are captured. + +## 4. Readability + +The code is clean and well-structured: + +- The `ramseyR` definition has a clear docstring explaining R(k, l). +- The theorem has a detailed docstring stating the conjecture in both LaTeX and ε-δ form. +- The namespace `Erdos1014` prevents name clashes. +- The ε-δ unfolding of the limit is clearly laid out across multiple lines. + +One minor observation: the module docstring uses the standard "Erdős conjectured that..." phrasing, which is readable, though it could be slightly more precise by saying "Erdős and Sós conjectured" if the attribution is joint (the website does not clarify this for 1014 specifically, though the related problem 1030 is attributed to Erdős and Sós). + +**Assessment**: Readability is good. No changes needed. + +## 5. Formalizability + +The problem statement is unambiguous: for fixed k ≥ 3, the ratio R(k, l+1)/R(k, l) tends to 1 as l → ∞. The Ramsey number R(k, l) is a well-defined combinatorial quantity (by the finite Ramsey theorem, the defining set is nonempty for k, l ≥ 1). The limit is a standard real-analysis concept. There is no ambiguity in the statement. + +**Assessment**: Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **Definition of `ramseyR`**: Uses `sInf` on a set of natural numbers. For k, l ≥ 1, the finite Ramsey theorem guarantees this set is nonempty, so `sInf` returns the actual minimum. For degenerate cases (k = 0 or l = 0), `sInf` returns 0 by convention (`sInf ∅ = 0` in ℕ), but these cases are irrelevant since the theorem requires k ≥ 3 and the ε-δ quantification allows choosing L₀ arbitrarily large. + +- **ε-δ formulation**: The statement `∀ ε > 0, ∃ L₀, ∀ l ≥ L₀, |R(k, l+1)/R(k, l) - 1| ≤ ε` is a correct unfolding of the limit `lim_{l→∞} R(k, l+1)/R(k, l) = 1`. The use of `≤ ε` rather than `< ε` is equivalent when quantifying over all ε > 0. + +- **Quantifier ordering**: The statement is `∀ k ≥ 3, ∀ ε > 0, ∃ L₀, ∀ l ≥ L₀, ...`, which correctly allows L₀ to depend on both k and ε. This matches the intended reading "for fixed k". + +- **Division safety**: For large l, R(k, l) > 0 (in fact R(k, l) ≥ l for k ≥ 2), so the division `R(k, l+1) / R(k, l)` in ℝ is well-defined. For any hypothetical l where R(k, l) = 0, the ratio would be 0 in Lean's real division (which defines x/0 = 0), and |0 - 1| = 1 > ε for small ε, but this is handled by choosing L₀ past such l values. + +- **Cast correctness**: The coercion `(ramseyR k l : ℝ)` correctly lifts ℕ to ℝ for real division and absolute value. + +**Assessment**: The formalization is correct and complete. No mathematical flaws identified. diff --git a/ai-review/1015.md b/ai-review/1015.md new file mode 100644 index 0000000000..5bbb3f1778 --- /dev/null +++ b/ai-review/1015.md @@ -0,0 +1,84 @@ +# AI Review: Erdős Problem 1015 + +## 1. Code Reuse + +**Multiple redundant Ramsey number definitions exist across the codebase.** The `ramseyNumber₂` defined at line 71 of `ErdosProblems/1015.lean` is yet another bespoke Ramsey number definition using `Fin n → Fin n → Bool` colorings. At least 18 other Erdos problem files define their own Ramsey number variants (e.g., `ramseyR` in 1014, 1030, 986; `ramseyR3` in 544, 553, 165; `ramseyNumber` in 545–549; `ramseyNum` in 568–570; etc.). Additionally: + +- `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `Combinatorics.hypergraphRamsey` for r-uniform hypergraph Ramsey numbers. Specializing to r = 2 would give the graph Ramsey number, though the interface differs (it uses `Finset (Fin m) → Bool` for hyperedge coloring rather than `Fin n → Fin n → Bool` for edge coloring). +- `ErdosProblems/1014.lean` defines `ramseyR` using `SimpleGraph` and `CliqueFree`, which is arguably more idiomatic Lean/Mathlib style. + +A shared Ramsey number definition (ideally using Mathlib's `SimpleGraph` API) would eliminate substantial duplication. The `IsMonoClique` definition at line 52 is also ad hoc and could be replaced by Mathlib's `SimpleGraph.IsNClique` or similar. + +## 2. Citations + +The formalization's docstring references match the website but use shorthand notation: + +| Code Reference | Website Information | +|---|---| +| `[Er71] Erdős, P.` | Should be: Erdős, P., "Topics in combinatorial analysis", pp. 95–99, 1971. | +| `[Mo66b] Moon, J.W.` | No full bibliographic details available on the website beyond the tag. | +| `[BES75] Burr, S.A., Erdős, P., and Spencer, J.H.` | No full title/journal details on the website beyond the tag. | + +The `[Er71]` citation should include the title and page numbers as given on the website. The other two references (`[Mo66b]` and `[BES75]`) appear on the website only as tags without full details, so the code's shorthand is consistent with what the website provides. + +## 3. Variants + +The formalization captures only the Burr–Erdős–Spencer exact formula (item 3 below). The website mentions three distinct results/questions: + +1. **Moon's result (1966):** f(3, n) = 4 for n ≥ 8. This is a concrete special case that could be stated as a separate theorem, e.g., `∀ n ≥ 8, minLeftover 3 n = 4`. + +2. **Erdős's original growth-rate questions:** (a) Does f(t)^{1/t} → 1 as t → ∞? (b) Is f(t) ≪ t? Here f(t) presumably means the "leading term" R(t, t−1), since the correction x(t,n) is bounded by t−1. These asymptotic questions about R(t, t−1) are not captured. + +3. **BES75 exact formula** (captured): f(t, n) = R(t, t−1) + x(t, n) for n sufficiently large. + +**Verdict:** Two natural variants are missing. Moon's result is a clean, self-contained statement. The growth-rate questions are arguably separate problems about R(t, t−1) rather than about f(t, n) per se, but they are part of the problem as posed on the website. + +## 4. Readability + +The code is generally clear and well-structured. Minor observations: + +- The docstring is well-written and accurately describes the mathematical content. +- The `open Finset` at line 45 is fine for conciseness but could be narrowed. +- The `minLeftover` definition (lines 60–66) is somewhat dense. The nested quantifiers and the `Finset.univ \ cliques.biUnion id` construction are correct but require careful reading. A brief inline comment explaining the "leftover count" as `n - (number of covered vertices)` would aid readability. +- The variable name `cliques` is good; `S₁`, `S₂` follow convention. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The BES75 result as stated on the website is precise and unambiguous: +- "Two-colouring of edges of K_n" is standard. +- "Vertex-disjoint monochromatic copies of K_t" is standard. +- The formula f(t, n) = R(t, t−1) + x with the congruence condition is exact. +- The only mild ambiguity is "for n sufficiently large depending on t," which the formalization correctly handles with `∃ N₀`. + +The original Erdős questions (f(t)^{1/t} → 1? and f(t) ≪ t?) are slightly more ambiguous because f(t) is used without explicit definition — it likely means sup_n f(t,n) or equivalently R(t, t−1) + (t−1), but this requires interpretation. + +## 6. Correctness + +### 6a. `IsMonoClique` (line 52) +**Correct.** The predicate requires that for all distinct i, j ∈ S, c(i,j) = b. This correctly captures "every edge within S has colour b." The i ≠ j guard properly excludes the diagonal (self-loops), which are not edges in K_n. + +### 6b. `minLeftover` (line 60) +**Correct with a caveat.** The definition uses `sInf` over ℕ. The set is always nonempty (r = n works trivially with an empty collection of cliques), so `sInf` returns the true minimum. The conditions — each clique has size t, each is monochromatic, they are pairwise disjoint, and the uncovered vertices number at most r — faithfully capture the problem. + +### 6c. `ramseyNumber₂` (line 71) +**Correct but color-asymmetric.** The definition seeks either a monochromatic K_s in color `false` or K_t in color `true`. The standard R(s,t) is color-symmetric, but this is mathematically equivalent (by complementing the coloring). This is fine for the application since we only use R(t, t−1). + +### 6d. The theorem statement (line 90) +**The formula encoding has a natural-number subtraction concern that is handled correctly by the existential.** The expression `(n + 1 - ramseyNumber₂ t (t - 1)) % t` uses ℕ subtraction. If `n + 1 < R(t, t−1)`, this truncates to `0 % t = 0`, giving the wrong value. However, the theorem asserts `∃ N₀, ∀ n ≥ N₀, ...`, so N₀ can (and must) be chosen so that n + 1 ≥ R(t, t−1) for all n ≥ N₀. This makes the natural-number subtraction safe. + +**One mathematical concern:** The hypothesis is `t ≥ 2`, but when `t = 2`, `t - 1 = 1` and `ramseyNumber₂ 2 1` is the Ramsey number R(2, 1). By convention R(s, 1) = 1 for all s (a single vertex trivially contains a monochromatic K_1). The `sInf`-based definition should yield 1 for this case, and indeed: for N = 1 and any coloring of K_1 (which has no edges), the single vertex forms a monochromatic K_1. So R(2,1) = 1 in the definition, and the formula gives f(2, n) = 1 + (n + 1 - 1) % 2 = 1 + n % 2. This means f(2, n) = 1 when n is even, and f(2, n) = 2 when n is odd. For t = 2, covering K_n with monochromatic edges (K_2s) leaves at most 1 vertex when n is even (pair them up) and... actually, for a complete graph K_n with 2-colored edges, we need monochromatic K_2s (edges). We can always greedily pick edges, covering n − (n mod 2) vertices, leaving n mod 2 ∈ {0, 1} vertices. So f(2, n) should be n mod 2. The formula gives 1 + n % 2, which equals 1 when n is even (but the true answer is 0) and 2 when n is odd (but the true answer is 1). **This is off by 1.** + +However, this may be a known issue with R(s, 1): some conventions define R(s, 1) = 1, others might consider it differently, and the BES75 result may genuinely only apply for t ≥ 3 or require a specific convention. The original problem statement by Moon begins with the case t = 3. **The hypothesis `t ≥ 2` may need to be `t ≥ 3` for the formula to be correct**, or alternatively, the definition of R(t, t−1) must match the convention used in BES75. + +### Summary + +| Aspect | Assessment | +|---|---| +| Code reuse | Significant duplication of Ramsey number definitions across ~18 files; shared definition recommended | +| Citations | `[Er71]` should include title "Topics in combinatorial analysis"; others match website | +| Variants | Moon's f(3,n) = 4 and Erdős's growth-rate questions are missing | +| Readability | Good overall; minor improvements possible | +| Formalizability | High; the BES75 result is precise and unambiguous | +| Correctness | The formula may be incorrect at t = 2 (off by 1); consider strengthening to t ≥ 3 or verifying the R(2,1) convention against BES75 | diff --git a/ai-review/1016.md b/ai-review/1016.md new file mode 100644 index 0000000000..1be90ff90f --- /dev/null +++ b/ai-review/1016.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 1016 + +## 1. Code Reuse + +Several opportunities for reuse exist: + +- **Cycle definition (`ContainsCycle`):** Problems 1012 (`FormalConjectures/ErdosProblems/1012.lean:45-47`) and 574 (`FormalConjectures/ErdosProblems/574.lean:38-40`) both define an identical `ContainsCycleOfLength` predicate that is more general (polymorphic in `V : Type*` rather than fixed to `Fin n`). Problem 1016's `ContainsCycle` is essentially the same but (a) hardcodes `Fin n`, and (b) constructs the successor index inline rather than universally quantifying over `i j` with `j.val = (i.val + 1) % m`. These are definitionally equivalent. A shared utility definition would eliminate this triplication. + +- **Edge counting (`numEdges`):** Problem 1016 defines a custom `numEdges` via filtering `Finset.univ` over ordered pairs. Problem 1012 and many others (1010, 1017, 1018, 1019) use Mathlib's `G.edgeFinset.card` instead. The custom definition is mathematically equivalent but non-standard within this codebase and loses access to existing Mathlib lemmas about `edgeFinset`. It should be replaced with `G.edgeFinset.card`. + +- **Iterated logarithm (`iteratedLog₂`):** A `Real.iteratedLog` is already defined in `FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean:26-27` using `sInf { n : ℕ | Real.log^[n] x ≤ 1 }`. This is the natural-log version. Problem 1016 defines a base-2 natural-number version via a fuel-based recursion. The two are not directly interchangeable (different base, different domain), but the existing file has a TODO noting `Real.iteratedLogb` for general bases should be added. Ideally, Problem 1016 should use a shared `iteratedLog₂` definition or build on the existing `Real.iteratedLog` infrastructure. + +## 2. Citations + +The website (https://www.erdosproblems.com/1016) lists the following references: + +| Citation | Docstring | Website | Match? | +|----------|-----------|---------|--------| +| Bondy [Bo71] | `[Bo71] Bondy, J.A.` | Bondy [Bo71] | **Partial** — website does not give further bibliographic detail either, but note the formalization omits any paper title or journal. | +| Erdős [Er71] | `[Er71] Erdős, P.` | Erdős [Er71] | **Partial** — same as above. | +| Griffin [Gr13] | *Missing* | Griffin [Gr13] — first proof of the lower bound | **Missing** — the website credits Griffin with the first proof of the lower bound. This is absent from the docstring. | +| George, Khodkar, Wallis [GKW16] | *Missing* | George, Khodkar, and Wallis [GKW16] — first published proof of upper bound | **Missing** — the website credits this paper with the first published proof of the upper bound. This is absent from the docstring. | + +The docstring should be updated to include [Gr13] and [GKW16]. + +## 3. Variants + +The website states two related claims: + +1. **Lower bound conjecture (the main question):** $h(n) \geq \log_2 n + \log^* n - O(1)$. +2. **Bondy's claimed bounds:** $\log_2(n-1) - 1 \leq h(n) \leq \log_2 n + \log^* n + O(1)$. + +The formalization only captures the lower bound conjecture (item 1). The upper bound $h(n) \leq \log_2 n + \log^* n + O(1)$ — which Bondy claimed and George–Khodkar–Wallis later published a proof of — is **not formalized as a separate statement**. Since Erdős believed the upper bound is closer to the truth, and since the upper bound has reportedly been proven [GKW16], formalizing it as a separate (solved) theorem would give a more complete picture. Additionally, the simpler lower bound $\log_2(n-1) - 1 \leq h(n)$ (proved by Griffin [Gr13]) is also not captured. + +## 4. Readability + +- **Generally good.** The docstring explains the problem clearly and the code is well-structured. +- The `ContainsCycle` definition could benefit from a note that this defines a *simple* cycle (injective vertex mapping), which is the standard meaning in this context. +- `iteratedLog₂Aux` uses a fuel parameter that is set to `n` in `iteratedLog₂`. The fuel is mathematically unnecessary (since `Nat.log 2` decreases) but needed for structural recursion in Lean. A brief comment explaining this would help readability. +- The `pancyclicExcess` definition uses `sInf` on a set of naturals. If the set is empty (e.g., when `n < 3`, no pancyclic graph exists), `sInf ∅ = 0` in `ℕ`, which could be misleading. The theorem restricts to `n ≥ 3`, which avoids this, but a comment noting this edge case would be helpful. + +## 5. Formalizability + +**Assessment: Mostly formalizable, low-to-moderate ambiguity.** + +- The definition of "pancyclic" (contains cycles of all lengths from 3 to n) is standard and unambiguous. +- The function $h(n)$ is well-defined as a minimum over a nonempty set (for $n \geq 3$, the complete graph is pancyclic). +- The main source of ambiguity is the $O(1)$ in the conjecture $h(n) \geq \log_2 n + \log^* n - O(1)$. The formalization resolves this by introducing an existential constant $C$ such that $h(n) + C \geq \lfloor\log_2 n\rfloor + \log^* n$, which is a standard and correct way to interpret "$\geq f(n) - O(1)$." +- Minor ambiguity: "graph" in combinatorics usually means "simple graph," which is what `SimpleGraph` captures. No issue here. + +## 6. Correctness + +**Several issues identified:** + +### 6a. `numEdges` vs `edgeFinset.card` (minor, correctness-equivalent but fragile) +The custom `numEdges` counts ordered pairs `(i, j)` with `i < j` and `G.Adj i j`. This is correct for simple graphs (where adjacency is symmetric and irreflexive), but it duplicates functionality available via `G.edgeFinset.card`. While mathematically equivalent, the lack of connection to Mathlib's API means one cannot easily prove properties of `numEdges` without first establishing the equivalence. + +### 6b. `pancyclicExcess` well-definedness (subtle issue) +The definition `pancyclicExcess n = sInf {h : ℕ | ∃ G, numEdges G = n + h ∧ IsPancyclic G}` is correct when the set is nonempty. For `n ≥ 3`, the complete graph on `n` vertices is pancyclic and has $\binom{n}{2}$ edges, so the set is nonempty. For `n < 3`, no graph can be pancyclic (since pancyclicity requires cycles of length 3, needing at least 3 vertices), so the set is empty and `sInf ∅ = 0`. The theorem restricts to `n ≥ 3`, so this is fine in practice, but the definition silently returns 0 for degenerate cases. + +### 6c. `iteratedLog₂` (potential off-by-one concerns) +The fuel-based `iteratedLog₂Aux` counts the number of times one can apply `Nat.log 2` before reaching 0 or 1. This is a natural-number approximation of the iterated logarithm. For $n = 0$ or $n = 1$, it returns 0, which is standard. However, there is a subtle question about whether this matches the real-valued iterated logarithm $\log^*(n)$ used in the problem statement. The real-valued version counts applications of $\log_2$ until the result is $\leq 1$, while the natural-number version counts applications of $\lfloor\log_2\rfloor$ until the result is $\leq 1$. These can differ by 1 for certain values. Since the conjecture already absorbs an $O(1)$ term, this discrepancy is acceptable for the purpose of the formalization but worth noting. + +### 6d. The theorem statement (correct modulo the $O(1)$ interpretation) +The statement `∃ C : ℕ, ∀ n, n ≥ 3 → pancyclicExcess n + C ≥ Nat.log 2 n + iteratedLog₂ n` correctly captures $h(n) \geq \lfloor\log_2 n\rfloor + \log^*(n) - O(1)$. The use of $C : \mathbb{N}$ (rather than $C : \mathbb{Z}$) is valid since an integer constant in $h(n) \geq f(n) - C$ can always be taken non-negative (if $C < 0$, replace with $C = 0$). Moving $C$ to the left side as $h(n) + C \geq f(n)$ correctly avoids natural-number subtraction issues. + +### 6e. `answer(sorry)` wrapper +The theorem uses the `answer(sorry) ↔ ...` pattern, which is standard in this codebase for open problems. + +**Overall correctness verdict:** The formalization is mathematically sound for the main conjecture. The primary gap is **incompleteness** (missing the upper bound and the proven lower bound results) rather than incorrectness. diff --git a/ai-review/1017.md b/ai-review/1017.md new file mode 100644 index 0000000000..e079529053 --- /dev/null +++ b/ai-review/1017.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 1017 + +## 1. Code Reuse + +The clique partition pattern in this file (edge-disjoint decomposition into complete subgraphs via `Fin k → Finset (Sym2 (Fin n))`) is **not shared** with similar problems despite multiple related formalizations in the codebase: + +- **Problem 81** (`ErdosProblems/81.lean`) formalizes clique partition of chordal graphs using a *vertex-set* approach (`Finset (Finset (Fin n))`) with explicit edge-disjointness via adjacency conditions on vertices, rather than `Sym2`-based edge sets. +- **Problem 807** (`ErdosProblems/807.lean`) defines `IsBicliqueCover` with a similar edge-disjoint structure. +- **Problem 1009** (`ErdosProblems/1009.lean`) defines `HasEdgeDisjointTriangles` with yet another encoding. +- **`IsPathCover`** in `GraphConjectures/Invariants.lean` handles vertex-disjoint path decompositions. + +A shared definition such as `CliquePartitionNumber` (akin to `pathCoverNumber` or `edgeCoverNumber` already in the codebase) could unify Problems 81, 1017, and potentially 1009. As-is, each problem reinvents the clique partition concept with subtly different encodings (vertex-set vs. edge-set, `Finset` of `Finset` vs. indexed family). This is a meaningful opportunity for abstraction. + +## 2. Citations + +The docstring references **[EGP66]** and **[Er71]**, which are correctly cited with full bibliographic details. However, the website at erdosproblems.com/1017 mentions two additional relevant results not included in the formalization: + +- **Lovász (1968):** Every graph on n vertices and k edges can be expressed as a union of $\binom{n}{2} - k + t$ complete graphs (non-edge-disjoint), where t is maximal such that $t^2 - t \le \binom{n}{2} - k$. This is sharp in many cases. +- **Györi–Keszegh (2017):** For $K_4$-free graphs with n vertices and $\lfloor n^2/4 \rfloor + m$ edges, there exist m pairwise edge-disjoint triangles. This resolves a special case of the problem when the graph is $K_4$-free. + +These should be mentioned in the docstring for completeness, even if not formalized as variants. + +## 3. Variants + +The formalization includes one variant: + +- **`erdos_1017.variants.erdos_goodman_posa`** — correctly captures the Erdős–Goodman–Pósa theorem: every graph on n vertices can be partitioned into at most $\lfloor n^2/4 \rfloor$ edge-disjoint cliques. + +**Missing variants** that could be considered: + +- **Györi–Keszegh (2017):** For $K_4$-free graphs with $\lfloor n^2/4 \rfloor + m$ edges, there exist m edge-disjoint triangles. This is a solved partial result toward the main conjecture and would be a natural variant. +- **Quantitative form:** The main theorem only asks whether the bound can be improved *at all* (i.e., $f(n,k) < \lfloor n^2/4 \rfloor$). A stronger variant could ask for an explicit improved bound, e.g., $f(n,k) \le \lfloor n^2/4 \rfloor - g(n,k)$ for some function $g$. + +## 4. Readability + +The formalization is **generally readable**, with a few notes: + +- The `haveI := dG` pattern for bringing `DecidableRel G.Adj` into scope is standard but could benefit from a brief inline comment for readers unfamiliar with Lean typeclass resolution. +- The expression `S.offDiag.image (Quot.mk _)` is somewhat opaque — it converts the ordered pairs of a finset's off-diagonal to `Sym2` elements, effectively producing the edge set of the complete subgraph on S. A brief comment like `-- edges of the complete subgraph on S` would help. +- The four-part existential structure (bound on k, disjointness, coverage, clique structure) is cleanly laid out and easy to follow. + +## 5. Formalizability + +**Moderate ambiguity.** The original problem states: *"Estimate $f(n,k)$ for $k > n^2/4$."* This is deliberately vague — "estimate" could mean: + +1. **Qualitative:** Can $f(n,k) < \lfloor n^2/4 \rfloor$ when $k > n^2/4$? (What the formalization captures.) +2. **Quantitative:** Find an explicit improved upper bound, e.g., $f(n,k) \le n^2/4 - cn$ for some $c > 0$. +3. **Asymptotic:** Determine $f(n,k)$ up to lower-order terms as a function of both n and k. + +The formalization takes the weakest reasonable interpretation (1), which is appropriate for an open problem whose answer is unknown. The `answer(sorry)` wrapper correctly reflects that even the truth value of the qualitative statement is unknown. + +The use of `∀ᶠ n in atTop` (for all sufficiently large n) is a mild weakening compared to asking for all n, but is standard and reasonable for asymptotic combinatorics questions. The EGP variant correctly omits this filter since it holds for all n. + +## 6. Correctness + +The formalization is **mathematically correct** with one observation: + +**Main theorem (`erdos_1017`):** +- The condition `G.edgeFinset.card > n ^ 2 / 4` correctly captures $k > n^2/4$ (using natural number division, which gives $\lfloor n^2/4 \rfloor$). +- The conclusion asks for a partition into $k < n^2/4$ edge-disjoint cliques, correctly capturing "improving the $\lfloor n^2/4 \rfloor$ bound." +- Edge-disjointness via `∀ i j, i ≠ j → Disjoint (parts i) (parts j)` is correct. +- Coverage via `∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i` correctly requires an exact partition (every edge in exactly one part), not just a cover. +- The clique structure `G.IsClique (↑S) ∧ parts i = S.offDiag.image (Quot.mk _)` correctly ensures each part is the complete edge set of a clique in G. Since `G.IsClique (↑S)` guarantees all vertices in S are pairwise adjacent in G, and coverage ensures the union is exactly `G.edgeFinset`, this is sound. + +**Observation on empty parts:** If $S$ is a singleton, `S.offDiag = ∅`, so `parts i = ∅`. Such parts count toward k but contribute nothing. This is not a bug — it just means the bound $k < n^2/4$ is slightly weaker than it could be (one could additionally require nonemptiness of each part). In practice this is harmless since one can always remove empty parts. + +**EGP variant (`erdos_goodman_posa`):** +- Correctly stated for all n (no `atTop` filter). +- Bound is `k ≤ n ^ 2 / 4` (not strict), matching the original $\lfloor n^2/4 \rfloor$ result. +- Structurally identical to the main theorem with appropriate bound adjustment. +- Mathematically sound. + +**Overall assessment:** The formalization is correct and faithfully captures the core qualitative question of Erdős Problem 1017. The main limitations are (a) it captures only the weakest interpretation of "estimate," and (b) some results mentioned on the website (Lovász, Györi–Keszegh) are not cited or formalized as variants. Neither of these is a mathematical error. diff --git a/ai-review/1018.md b/ai-review/1018.md new file mode 100644 index 0000000000..6829be7560 --- /dev/null +++ b/ai-review/1018.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 1018 + +## 1. Code Reuse + +**Issue found.** Three other files already define `IsPlanar` as an opaque predicate: +- `ErdosProblems/630.lean:60` — `opaque IsPlanar {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop` +- `ErdosProblems/631.lean:65` — same signature +- `ErdosProblems/1019.lean:37` — same signature + +Problem 1018 instead defines its own version inside the `Erdos1018` namespace using `def ... := sorry` rather than `opaque`, and omits the `[Fintype V]` constraint. These four independent definitions should ideally be consolidated into a single shared definition (e.g., in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`). The `def ... := sorry` form is less appropriate than `opaque` for axiomatizing a concept — `opaque` prevents the kernel from unfolding the definition and potentially exploiting the `sorry` axiom. + +## 2. Citations + +The website (erdosproblems.com/1018) lists: +- **[Er71]** — Erdős's original formulation (1971) +- **[KoPy88]** — Kostochka and Pyber (1988), who solved the problem affirmatively + +The formalization's docstring includes both citations with brief annotations: +- `[Er71] Erdős, P., 1971.` +- `[KoPy88] Kostochka, A. and Pyber, L., 1988.` + +These match the website's references. The website does not provide full bibliographic details beyond these codes, so the shorthand is acceptable. The docstring correctly notes the problem was "Solved by Kostochka and Pyber [KoPy88]." + +## 3. Variants + +**Missing variant.** The website notes that Erdős observed it is "not difficult to see" that C_ε → ∞ as ε → 0. This asymptotic observation is not captured by the formalization and could be stated as a variant: + +```lean +theorem erdos_1018.variants.C_tends_to_infinity : + ∀ f : ℝ → ℕ, (∀ ε > 0, ∀ᶠ n in atTop, + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + G.edgeFinset.card ≥ ⌈(n : ℝ) ^ (1 + ε)⌉₊ → + ∃ S : Finset (Fin n), S.card ≤ f ε ∧ ¬IsPlanar (G.induce ↑S)) → + Filter.Tendsto f (nhdsWithin 0 (Set.Ioi 0)) atTop +``` + +(or a simpler formulation asserting no uniform bound works for all ε). + +## 4. Readability + +The formalization is reasonably readable. Minor observations: + +- The `haveI := dG` on a separate line is a standard Lean idiom for making the `DecidableRel` instance available; this is fine. +- The quantifier structure is clear: ∀ ε > 0, ∃ C N₀, ∀ n ≥ N₀, ∀ G with enough edges, ∃ small non-planar induced subgraph. +- The use of `⌈(n : ℝ) ^ (1 + ε)⌉₊` could benefit from a brief inline comment explaining that `₊` denotes the natural number ceiling (`Nat.ceil`), for readers less familiar with Lean/Mathlib notation. + +## 5. Formalizability + +**High.** The problem as stated on the website is: + +> *Let ε > 0. Is there a constant C_ε such that, for all large n, every graph on n vertices with at least n^{1+ε} edges must contain a subgraph on at most C_ε vertices which is non-planar?* + +This is precise and unambiguous modulo the notion of planarity itself (which is standard). The only potential ambiguity is "subgraph" vs "induced subgraph" — see correctness discussion below. The quantifier structure ("for all large n") is standard and admits a clean formalization via an N₀ threshold. + +The main obstacle to full formalization in Lean/Mathlib is the absence of a formal definition of graph planarity, which is axiomatized here as an opaque predicate. This is a reasonable approach given the current state of Mathlib. + +## 6. Correctness + +**The formalization is mathematically correct.** + +### Subgraph vs. Induced Subgraph +The website says "subgraph" while the formalization uses `G.induce` (induced subgraph). These formulations are **equivalent**: if a (not necessarily induced) subgraph on vertex set S is non-planar, then the induced subgraph G[S] — which contains all edges of the original subgraph plus possibly more — is also non-planar (since adding edges preserves non-planarity). Conversely, the induced subgraph is itself a subgraph. So the two versions are logically equivalent, and the formalization is correct. + +### Edge Threshold +The formalization uses `⌈(n : ℝ) ^ (1 + ε)⌉₊` (natural ceiling) for the edge count threshold. Since edge counts are natural numbers, the condition "at least n^{1+ε} edges" is equivalent to "at least ⌈n^{1+ε}⌉ edges." This is correct. + +### Quantifier Structure +The formalization correctly captures "for all large n" via `∃ N₀, ∀ n ≥ N₀`, and the dependence of C on ε by placing `∃ C` after `∀ ε > 0`. The constant C does not depend on n, which matches the problem statement. + +### `IsPlanar` Definition +As noted in §1, using `def IsPlanar ... := sorry` is less ideal than `opaque`. With `def`, the kernel can in principle unfold the definition to `sorry` (which is `False`-producing via an axiom), whereas `opaque` properly treats the predicate as an uninterpreted symbol. This is a technical concern rather than a mathematical one — it does not affect the intended meaning but could lead to unsound proofs if exploited. + +### Summary +No mathematical flaws. The formalization faithfully captures the problem. The only recommendations are (a) consolidating `IsPlanar` into a shared definition using `opaque`, and (b) adding the variant about C_ε → ∞ as ε → 0. diff --git a/ai-review/1019.md b/ai-review/1019.md new file mode 100644 index 0000000000..991500edf5 --- /dev/null +++ b/ai-review/1019.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 1019 + +## 1. Code Reuse + +**Issue found.** Multiple Erdős problems define their own `IsPlanar` predicate independently: + +- **1019.lean** (line 37): `opaque IsPlanar {V : Type*} [Fintype V] (G : SimpleGraph V) : Prop` +- **1018.lean** (line 38): `def IsPlanar {V : Type*} (_ : SimpleGraph V) : Prop := sorry` +- **630.lean** and **631.lean** also reference planarity concepts but handle them differently. + +There is no shared `IsPlanar` definition in `FormalConjecturesForMathlib/`. A single canonical definition should be factored out (likely into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`) so all planarity problems share the same predicate. Note the two existing definitions are incompatible: 1019 requires `[Fintype V]` while 1018 does not. A unified version should probably drop the `Fintype` constraint (planarity is a topological property, not a finiteness property) unless it's needed for specific lemmas. + +The `opaque` approach in 1019 is preferable to the `def ... := sorry` approach in 1018, since the latter makes `IsPlanar G` provable for every graph (via `sorry`), which is unsound. The `opaque` correctly treats planarity as an uninterpreted predicate. + +No other code in `FormalConjecturesForMathlib/` (e.g., `Primitive.lean`, `Ramsey.lean`, graph coloring infrastructure) is relevant to this problem. + +## 2. Citations + +**Issues found.** + +The formalization docstring says: +> [Er64f, Er69c, Er71] + +These are opaque shorthand tags with no corresponding full bibliographic entries. The website ([erdosproblems.com/1019](https://www.erdosproblems.com/1019)) does not list references in this format. The website states: + +- The problem was **proved by Simonovits** in his PhD thesis. +- Erdős noted it is "easy to construct" a graph with ⌊n²/4⌋ + ⌊(n−1)/2⌋ edges lacking saturated planar subgraphs with > 3 vertices. +- Erdős proved a quantitative variant: graphs with ⌊n²/4⌋ + k edges contain saturated planar subgraphs on ≫ k/n vertices (addressing a question of Dirac). +- Credits to Cambie, recaje, Stijn Cambie, and Terence Tao. + +The citations should be expanded to full references or removed in favor of the website URL, which is already provided. The docstring says "Proved by Simonovits" but does not cite Simonovits's thesis. + +## 3. Variants + +**One variant not captured.** + +The website describes a quantitative strengthening attributed to Erdős: graphs with ⌊n²/4⌋ + k edges contain saturated planar subgraphs on ≫ k/n vertices. This is a stronger result (the current formalization is the special case k = ⌊(n+1)/2⌋). This variant is not formalized. + +The near-sharpness example (⌊n²/4⌋ + ⌊(n−1)/2⌋ edges sufficing to avoid such subgraphs) is also not captured but is less critical since it's a construction, not a conjecture. + +## 4. Readability + +**Acceptable, with minor suggestions.** + +- The module docstring is clear and self-contained. +- The `haveI := dG` pattern on line 53 is standard for this codebase but could benefit from a brief comment for newcomers. +- The existential chain on lines 55–56 (`∃ (k : ℕ) (_ : k > 3) (H : SimpleGraph (Fin k)) (dH : DecidableRel H.Adj) (f : Fin k → Fin n)`) is long but readable. Breaking the conjunction on lines 58–60 into named sub-conditions (e.g., via a helper definition `IsMaximalPlanarSubgraph`) would improve clarity but is not strictly necessary. +- The `IsPlanar` docstring (line 34–36) is good and explains why it's axiomatized. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with one fundamental gap.** + +The problem statement from the website is precise enough to formalize: the edge threshold ⌊n²/4⌋ + ⌊(n+1)/2⌋ is unambiguous, "saturated planar graph" is well-defined (planar graph with exactly 3k−6 edges, i.e., a triangulation), and "> 3 vertices" is clear. + +The key gap is that **graph planarity itself is not formalized in Mathlib**. The `opaque IsPlanar` axiomatization means the theorem is stated in terms of an uninterpreted predicate. While this is the best available approach, it means: +- The theorem cannot be proved or disproved without providing a definition of `IsPlanar`. +- No properties of planarity (e.g., closure under subgraphs, Euler's formula, the 3k−6 edge bound) are available. +- The formalization is essentially a **schema** that becomes a real theorem once `IsPlanar` is instantiated. + +**Ambiguity level: Low.** The only potential ambiguity is whether "saturated planar subgraph" means (a) a subgraph that is a maximal planar graph (triangulation), or (b) a planar subgraph that is maximal *within G* (cannot add any edge of G while remaining planar). The website clarifies interpretation (a): "A saturated planar graph on n vertices has exactly 3n−6 edges, the maximum possible." The formalization correctly uses interpretation (a). + +## 6. Correctness + +**Assessment: Correct, with minor observations.** + +### What the formalization gets right: +- **Edge count arithmetic**: `n ^ 2 / 4 + (n + 1) / 2` in `ℕ` correctly computes ⌊n²/4⌋ + ⌊(n+1)/2⌋ via truncating division. ✓ +- **Vertex threshold**: `n ≥ 4` is the correct lower bound. For n ≤ 3, the edge count threshold exceeds the maximum possible edges (verified: n=3 requires ≥ 4 edges but K₃ has only 3). ✓ +- **Subgraph encoding**: The injection `f : Fin k → Fin n` with `H.Adj u v → G.Adj (f u) (f v)` correctly models "H is isomorphic to a subgraph of G". ✓ +- **Saturated = triangulation**: `IsPlanar H ∧ H.edgeFinset.card = 3 * k - 6` for k > 3 (so k ≥ 4, giving 3k−6 ≥ 6 > 0) correctly characterizes maximal planar graphs / triangulations. ✓ +- **k > 3**: Matches the problem's "> 3 vertices". In ℕ, `k > 3` means k ≥ 4. ✓ +- **Answer**: `answer(True)` matches the website's "PROVED — Solved in the affirmative". ✓ +- **Tags**: `category research solved` and `AMS 5` (combinatorics) are appropriate. ✓ + +### Observations: +- The formalization does not require H to be connected, but this is not a flaw: a planar graph with exactly 3k−6 edges on k ≥ 3 vertices is necessarily connected (in fact, 3-connected for k ≥ 4) by Euler's formula. So the condition is self-enforcing. +- The `≥` in the edge count condition (line 54) matches "at least" in the problem statement. The website states the threshold without "at least", but in context this is clearly a lower bound. ✓ +- The natural number subtraction `3 * k - 6` is safe since k ≥ 4 implies 3k ≥ 12 > 6. ✓ + +### No mathematical flaws identified. + +The formalization is a faithful encoding of the problem as stated on the website, modulo the fundamental limitation of `IsPlanar` being uninterpreted. diff --git a/ai-review/102.md b/ai-review/102.md new file mode 100644 index 0000000000..d06e4d6430 --- /dev/null +++ b/ai-review/102.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 102 + +**File:** `FormalConjectures/ErdosProblems/102.lean` + +--- + +## 1. Code Reuse + +**Issue found.** The definition `fourPlusRichLineCount` in Problem 102 is identical to `fourRichLineCount` in Problem 101 (`FormalConjectures/ErdosProblems/101.lean:45–48`). Both count the number of affine lines containing at least 4 points from a finite set: + +```lean +-- Problem 101 (fourRichLineCount) +Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + 4 ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} + +-- Problem 102 (fourPlusRichLineCount) +Set.ncard {L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)) | + Module.finrank ℝ L.direction = 1 ∧ + 4 ≤ Set.ncard {p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}} +``` + +These are *verbatim identical*. One shared definition should be extracted (e.g., to a shared utility or into Problem 101, with Problem 102 importing it). The naming difference (`fourRichLineCount` vs `fourPlusRichLineCount`) also obscures that they compute the same thing. The name `fourRichLineCount` (from 101) is more standard — a "k-rich line" is one containing ≥ k points. + +Additionally, Problem 105 and Problem 209 use the same pattern for line identification (`Module.finrank ℝ L.direction = 1`). A shared `IsLine` predicate (as Problem 209 defines locally) could be promoted to a shared utility. + +## 2. Citations + +**Missing references.** The website [erdosproblems.com/102](https://www.erdosproblems.com/102) lists three references: +- **Er92e** (Erdős, 1992) +- **Er95** (Erdős, 1995) +- **Er97c** (Erdős, 1997) + +The formalization's docstring mentions no specific references beyond the website link. These should be documented, or at minimum noted. + +The problem is attributed to **Erdős and Purdy** on the website, which the docstring correctly captures ("Erdős–Purdy conjecture" / "Erdős–Purdy"). + +## 3. Variants + +**Partially captured.** The formalization captures only the weakest open form of the conjecture: whether $h_c(n) \to \infty$. + +The website documents additional information that could be reflected as variants or comments: + +- **Original stronger conjecture (disproven):** Erdős originally conjectured $h_c(n) \gg_c n^{1/2}$. This was disproven by Hunter using points in $\{1, \ldots, m\}^d$ projected to $\mathbb{R}^2$. +- **Known upper bound:** $h_c(n) \ll_c n^{1/2}$ is established. +- **Hunter's bound:** $h_c(n) \ll n^{1/\log(1/c)}$. +- **Connection to Problem 101:** The website notes it remains unknown whether $h_c(n) \geq 5$, i.e., whether Problem 101 implies at least 5 collinear points. This could be mentioned in the docstring to connect the two formalizations. + +A resolved variant stating that the stronger conjecture is false could be added: + +```lean +-- The stronger conjecture h_c(n) ≫ n^{1/2} is false (Hunter's counterexample) +@[category research solved] +theorem erdos_102_strong_conjecture_false : ... +``` + +## 4. Readability + +**Good overall.** The code is well-structured with clear docstrings. Minor suggestions: + +- The docstring on `fourPlusRichLineCount` says "more than $3$ points, as in the problem statement" — this is correct but the name "fourPlus" is slightly unusual. The standard combinatorial geometry term is "4-rich line." The name `fourRichLineCount` (as used in Problem 101) is preferable. +- The main theorem docstring is thorough and well-written, clearly explaining $h_c(n)$ and the logical structure. + +## 5. Formalizability + +**High — no ambiguity.** The problem statement on the website is precise: given a constant $c > 0$ and $n$ points in $\mathbb{R}^2$ with at least $cn^2$ lines containing more than 3 points, must some line contain $h_c(n) \to \infty$ points? This is unambiguously formalizable. + +The only potential subtlety is the meaning of "lines containing more than three points" — this means ≥ 4 points, which the formalization correctly encodes as `4 ≤ Set.ncard ...`. + +## 6. Correctness + +**Correct and mathematically sound.** The formalization accurately captures the conjecture. Detailed analysis: + +**Theorem structure:** The statement +``` +∀ c > 0, ∀ M, ∃ N, ∀ n ≥ N, ∀ P with |P| = n, + cn² ≤ fourPlusRichLineCount(P) → ∃ line L with M ≤ |P ∩ L| +``` +is exactly the assertion that $h_c(n) \to \infty$, where $h_c(n) = \min_{|P|=n,\, \text{4-rich lines} \geq cn^2} \max_L |P \cap L|$. This correctly matches the website's open question. + +**Use of `Set.ncard`:** The definition uses `Set.ncard` for both counting lines and counting points on a line. For a finite point set $P$ of size $n$: +- The set of 4-rich lines is finite (each such line is spanned by at least 2 points of $P$, so there are at most $\binom{n}{2}$ such lines). `Set.ncard` will return the correct cardinality once finiteness is established. +- The set $\{p \in P \mid p \in L\}$ is finite (it's a subset of a finite set). + +In principle, one would need to prove finiteness of the line set during a formal proof to ensure `Set.ncard` doesn't collapse to 0. If `Set.ncard` returned 0 due to an unprovable finiteness instance, the hypothesis `c * n² ≤ 0` would be false for $c > 0$ and $n \geq 1$, making the theorem vacuously true. However, the finiteness IS provable, so this is not a mathematical correctness issue — it's a proof engineering concern. + +**No issues found** with the logical quantifier structure, the encoding of "more than 3" as "≥ 4", or the use of `AffineSubspace` with `Module.finrank ℝ L.direction = 1` to characterize lines. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Duplicate definition** with Problem 101; should be shared | +| Citations | **Missing** Er92e, Er95, Er97c references | +| Variants | Weaker form only; stronger disproven conjecture and connection to Problem 101 not noted | +| Readability | Good; minor naming inconsistency with Problem 101 | +| Formalizability | Unambiguous | +| Correctness | **Correct** — faithfully captures the open conjecture | diff --git a/ai-review/1020.md b/ai-review/1020.md new file mode 100644 index 0000000000..cca5b1b047 --- /dev/null +++ b/ai-review/1020.md @@ -0,0 +1,137 @@ +# AI Review: Erdős Problem 1020 + +## Summary + +Erdős Problem 1020 formalizes the **Erdős Matching Conjecture** (also known as the Erdős–Gallai conjecture for hypergraphs): for $r \geq 3$, the maximum number of edges in an $r$-uniform hypergraph on $n$ vertices containing no matching of size $k$ equals $\max\bigl(\binom{rk-1}{r},\; \binom{n}{r} - \binom{n-k+1}{r}\bigr)$. + +--- + +## 1. Code Reuse + +**Duplicated definitions identified:** + +- **`HasMatching`** is defined identically in both `Erdos1020` (line 43) and `Erdos747` (line 49) in `FormalConjectures/ErdosProblems/747.lean`. Both use the same signature and body: + ```lean + ∃ M : Finset (Finset (Fin n)), M ⊆ H ∧ M.card = k ∧ + ∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ ≠ e₂ → Disjoint e₁ e₂ + ``` + These should ideally be consolidated into a shared utility. + +- **`IsRUniform`** has conceptual duplicates across many files (719.lean's `IsRUniformHypergraph`, 832.lean's `UniformHypergraph` structure, 833/834/836.lean's `Hypergraph.IsUniform`, 616/837.lean's `UniformHypergraph` structures, etc.). At least 10 different files define their own variant of r-uniformity. No shared definition exists in `FormalConjecturesForMathlib/` or Mathlib. + +- **`maxEdgesNoMatching`** follows the standard `sSup`-over-constraint-set pattern used by `turanHypergraphNumber` (719.lean), `ex3` (1076.lean), and others. No shared abstraction exists. + +**Recommendation:** Extract `HasMatching` and `IsRUniform` into a shared hypergraph utilities file. The current per-problem namespacing prevents reuse but avoids conflicts, which is acceptable for a conjectures repository. + +--- + +## 2. Citations + +**Website (erdosproblems.com/1020) lists these references:** +- [Er65d] Erdős (1965) +- [Er71] Erdős (1971), p. 103 +- [ErGa59] Erdős & Gallai (1959) +- [Fr87] Frankl (1987) +- [Fr17] Frankl (2017) +- [KoKu23] Kolupaev & Kupavskii (2023) +- [FRR12] Frankl, Rödl & Ruciński (2012) +- [HLS12] Huang, Loh & Sudakov (2012) + +**Formalization includes:** +- [Er65d] Erdős, P., *A problem on independent r-tuples*, Ann. Univ. Sci. Budapest. Eötvös Sect. Math. 8 (1965), 93–95. ✅ +- [Er71] Erdős, P., *Topics in combinatorial analysis*, Proc. Second Louisiana Conf. on Combinatorics, Graph Theory and Computing (1971), 2–20. ✅ + +**Assessment:** The two primary original references ([Er65d], [Er71]) are correctly cited with full bibliographic details. The other references on the website relate to partial results and solutions for special cases, which are not strictly required for the conjecture statement but could be noted for context. The citations as given are accurate and complete for the conjecture's origins. + +--- + +## 3. Variants + +The website notes: +- The conjecture is stated for **$r \geq 3$** (the $r = 2$ case was proved by Erdős & Gallai in 1959 and is a theorem, not a conjecture). +- The problem is also known as the "Erdős matching conjecture." +- Partial results exist for specific ranges of $n$ relative to $kr$ (e.g., Frankl 2017 proved it for $kr \leq n \leq k(r + \frac{1}{2r^{2r+1}})$, and Łuczak & Mieczkowska proved $r = 3$). + +**Assessment:** The formalization captures the full generality of the conjecture for all $r \geq 3$ and $k \geq 1$. No additional variants are listed on the website that would require separate theorem statements. The constraint `hr : r ≥ 3` correctly excludes the solved $r \leq 2$ cases. One could consider adding the solved $r = 2$ or $r = 3$ cases as separate lemmas, but these are not required for the conjecture itself. + +--- + +## 4. Readability + +**Strengths:** +- The three definitions (`IsRUniform`, `HasMatching`, `maxEdgesNoMatching`) are clean, well-named, and have clear docstrings with LaTeX. +- The theorem statement is concise and directly mirrors the mathematical formula. +- The namespace `Erdos1020` avoids collisions. + +**Minor suggestions:** +- The docstring for `erdos_1020` references `[Er65d, Er71, p.103]` — this is slightly ambiguous; `p.103` refers to [Er71] specifically. Consider writing `[Er65d], [Er71, p.103]` for clarity. +- The module docstring could briefly mention that the two terms in the max correspond to two natural constructions: (1) taking all $r$-subsets of a fixed set of $rk - 1$ vertices, and (2) taking all $r$-subsets that intersect a fixed set of $k - 1$ vertices. This would aid mathematical readers. + +**Overall:** Readability is good. + +--- + +## 5. Formalizability + +The Erdős Matching Conjecture is **precisely stated** and **obviously formalizable**: + +- The quantity $f(n; r, k)$ is well-defined as the maximum over a finite set of hypergraphs (since there are finitely many $r$-uniform hypergraphs on $n$ labeled vertices). +- The conjectured formula $\max\bigl(\binom{rk-1}{r},\; \binom{n}{r} - \binom{n-k+1}{r}\bigr)$ is a concrete computable expression. +- There is no ambiguity in the problem statement. + +**Potential subtlety:** The `sSup` over `ℕ` returns `0` for the empty set. When $n < r$ or $k = 0$, the set of valid hypergraphs may be trivial. The formalization handles this via the hypothesis `hk : k ≥ 1`, but does not require $n \geq r$ (when $n < r$, there are no $r$-uniform edges, so `maxEdgesNoMatching n r k = 0`, and the RHS should also be 0 — this needs to hold for the formula to be correct in degenerate cases). See Correctness below. + +**Ambiguity level: None.** The conjecture is fully precise. + +--- + +## 6. Correctness + +### 6.1 Definitions + +- **`IsRUniform`** (line 39): Correct. Checks every edge has exactly $r$ vertices. +- **`HasMatching`** (line 43): Correct. The definition of $k$ pairwise vertex-disjoint edges is standard. +- **`maxEdgesNoMatching`** (line 49): Uses `sSup` over `{m : ℕ | ∃ H, ...}`. This is mathematically correct — the set is bounded (at most $\binom{n}{r}$ edges) and nonempty (the empty hypergraph always works when $k \geq 2$; for $k = 1$, only the empty hypergraph with 0 edges has no matching of size 1). + +### 6.2 Main Theorem Statement + +The statement is: +```lean +maxEdgesNoMatching n r k = + max (Nat.choose (r * k - 1) r) (Nat.choose n r - Nat.choose (n - k + 1) r) +``` + +**Issue: Natural number subtraction.** The expression `Nat.choose n r - Nat.choose (n - k + 1) r` uses natural number subtraction, which truncates to 0 when the result would be negative. Similarly, `r * k - 1` truncates when `r * k = 0`, but since `r ≥ 3` and `k ≥ 1`, we have `r * k ≥ 3`, so `r * k - 1` is fine. + +For the second term: `Nat.choose n r - Nat.choose (n - k + 1) r`. When $n < k - 1$, we get `n - k + 1 = 0` in natural numbers (actually `n - (k - 1)` truncated). And when $n < r$, both binomial coefficients are 0. When $n - k + 1 \geq r$, we need $\binom{n}{r} \geq \binom{n-k+1}{r}$, which holds since $n \geq n - k + 1 \geq 0$ and binomial coefficients are monotone in the top argument. So the natural number subtraction is safe in the intended range. + +However, `n - k + 1` in Lean's natural numbers computes as `(n - k) + 1`, not `n - (k - 1)`. When $n < k$, `n - k = 0`, so `n - k + 1 = 1`, and `Nat.choose 1 r = 0` for $r \geq 3$. This means the second term becomes `Nat.choose n r - 0 = Nat.choose n r`. This is actually fine because when $n < k$, a matching of size $k$ is impossible in an $r$-uniform hypergraph on $n$ vertices (each edge uses at least $r \geq 3$ vertices, so $k$ disjoint edges need $rk > n$ vertices). So `maxEdgesNoMatching n r k = Nat.choose n r` (all possible edges), and the formula should give that too — and it does, since `Nat.choose n r` is the second term. + +**Potential edge case issue with $k = 1$:** When $k = 1$, "no matching of size 1" means **no edges at all**. So `maxEdgesNoMatching n r 1 = 0`. The RHS becomes `max (Nat.choose (r - 1) r) (Nat.choose n r - Nat.choose n r) = max 0 0 = 0`. Since $r - 1 < r$, `Nat.choose (r-1) r = 0`. ✅ Correct. + +**Potential edge case with `sSup` on empty/unbounded sets:** The set `{m : ℕ | ∃ H, IsRUniform H r ∧ ¬HasMatching H k ∧ H.card = m}` is always nonempty (the empty hypergraph has no matching of size $k \geq 1$, giving $m = 0$). It is bounded above by the finite number of $r$-element subsets of `Fin n`. Since the set is a nonempty bounded subset of $\mathbb{N}$, `sSup` is well-defined and returns the actual maximum. ✅ + +### 6.3 Mathematical Correctness of the Conjectured Formula + +The two terms in the max correspond to two extremal constructions: +1. **Clique construction:** Take all $r$-subsets of a fixed set of $rk - 1$ vertices. This has $\binom{rk-1}{r}$ edges and any matching can use at most $k - 1$ edges (only $rk - 1$ vertices available). +2. **Star construction (covering design):** Take all $r$-subsets that contain at least one vertex from a fixed set $S$ of $k - 1$ vertices. This has $\binom{n}{r} - \binom{n-k+1}{r}$ edges and any matching has at most $k - 1$ edges (by pigeonhole on $S$). + +The conjecture asserts these are optimal. This matches the standard statement in the literature. + +### 6.4 Verdict + +**The formalization is correct.** The definitions faithfully capture the mathematical objects. The theorem statement correctly encodes the Erdős Matching Conjecture. Natural number arithmetic edge cases are handled correctly by the hypotheses and the behavior of `Nat.choose` and truncated subtraction. No mathematical flaws identified. + +--- + +## Overall Assessment + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Moderate | `HasMatching` duplicated with 747.lean; `IsRUniform` duplicated across ~10 files | +| Citations | ✅ Good | Primary references [Er65d], [Er71] fully cited; matches website | +| Variants | ✅ Complete | Full generality for $r \geq 3$; no missing variants | +| Readability | ✅ Good | Clean definitions, clear docstrings; minor citation formatting nit | +| Formalizability | ✅ Unambiguous | Fully precise, obviously formalizable | +| Correctness | ✅ Correct | All edge cases verified; `sSup` well-behaved; Nat subtraction safe | diff --git a/ai-review/1021.md b/ai-review/1021.md new file mode 100644 index 0000000000..c915e883c9 --- /dev/null +++ b/ai-review/1021.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 1021 + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`containsSubgraph`** (line 63): This definition is identical in structure to `Erdos926.ContainsSubgraph` in `FormalConjectures/ErdosProblems/926.lean:47`. At least ~30 other Erdős problem files define the same predicate independently. The definition should be extracted to a shared utility or one canonical location should be referenced. + +- **`turanNumber`**: Problem 926 defines a proper `turanNumber` function (line 52) using `sSup` over edge counts of H-free graphs on n vertices. Problem 1021 instead inlines the extremal number concept directly in the theorem statement (quantifying over all n-vertex graphs G that avoid the subdivision). While mathematically equivalent, using a shared `turanNumber` definition would improve consistency and make the statement closer to the standard formulation `ex(n, G_k) ≤ C · n^{3/2 - c_k}`. + +- **Graph definitions**: The `subdivisionKComplete` graph (Problem 1021) and `graphHk` (Problem 926) are closely related. `graphHk k` is the cone of `subdivisionKComplete k` — it adds a center vertex x adjacent to all y_i. The vertex type for edge-subdivision vertices `{p : Fin k × Fin k // p.1 < p.2}` is shared between both files and could be factored out. + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean`** provides various graph-theoretic utilities but nothing directly applicable to extremal number formulations. + +## 2. Citations + +**Website references** (from [erdosproblems.com/1021](https://www.erdosproblems.com/1021)): +- **Er64c** — Erdős (1964) on C₆ bounds. *Not mentioned in formalization.* +- **Er71** — Erdős (1971), p.103. ✅ Referenced in formalization. +- **Er74c** — Erdős (1974), p.79. ✅ Referenced in formalization. +- **BoSi74** — Bondy and Simonovits (1974), proved ex(n, C₆) ≪ n^{7/6}. *Not mentioned in formalization.* +- **CoLe21** — Conlon and Lee (2021), proved conjecture with c_k = 6^{-k}. ✅ Referenced. +- **Ja19** — Janzer (2019), improved to c_k = 1/(4k−6). ✅ Referenced. + +**Issues:** +- The formalization's docstring says the conjecture is by "Erdős and Simonovits" but does not list Simonovits as a co-author in the citation tags. The website confirms this is an Erdős–Simonovits conjecture. +- Missing references Er64c and BoSi74 (relevant for the k=3 / C₆ special case). +- Citation format uses shorthand tags (e.g., `[CoLe21]`) rather than full author names. Problem 926 provides slightly more detail for its citations. Expanding to full author names would improve documentation. + +## 3. Variants + +**Missing variant — the C₆ special case (k = 3):** +The website specifically notes that for k = 3, G₃ is the 6-cycle C₆, and that Bondy–Simonovits [BoSi74] proved ex(n, C₆) ≪ n^{1+1/3} = n^{7/6}. This gives c₃ = 1/3, which is much stronger than the general bound c_k = 6^{-k} from Conlon–Lee. This notable special case is not mentioned or captured as a separate theorem. + +**Relationship to Problem 926:** +The website states that G_k "relates to the graph H_k from problem 926." The 1-subdivision of K_k (G_k) is precisely H_k minus the center vertex x. Since G_k is a subgraph of H_k, any graph containing G_k also contains a copy of the G_k part of H_k (but not necessarily H_k). The relationship ex(n, H_k) ≤ ex(n, G_k) holds since H_k-freeness is weaker than G_k-freeness. This connection is not documented. + +**Specific c_k values:** +The problem is marked as solved. While the docstring mentions c_k = 6^{-k} and c_k = 1/(4k−6), no separate theorems capture these specific quantitative results. A stronger formalization could state the solved version with explicit constants. + +## 4. Readability + +**Generally good.** Specific observations: + +- The `subdivKAdj` pattern matching is clear: edge-vertices connect to their two original endpoints, and no other adjacencies exist. +- The `subdivisionKComplete` graph construction with `Fin k ⊕ {p : Fin k × Fin k // p.1 < p.2}` is a natural encoding. The vertex type could benefit from a type alias (as Problem 926 does with `HkVertex`). +- The naming convention uses `camelCase` (`containsSubgraph`) while Problem 926 uses `PascalCase` (`ContainsSubgraph`). Lean 4 convention for definitions is `camelCase`, but the inconsistency across the codebase is worth noting. +- The main theorem statement is readable, though the nested existentials (`∃ c, c > 0 ∧ ∃ C, C > 0 ∧ ...`) could be slightly cleaner with a combined quantifier. + +## 5. Formalizability + +**High — the problem is clearly formalizable.** + +The statement is fully precise: it asks whether a specific extremal number is bounded by a specific function. The graph G_k (1-subdivision of K_k) is a concrete, well-defined graph. The bound n^{3/2 − c_k} is a concrete real-valued function. There is no ambiguity in the mathematical content. + +The only minor point is the asymptotic notation "≪" (Vinogradov notation), which means "bounded above by a constant times" for sufficiently large n. The formalization replaces this with a universal quantifier over all n, which is a valid (and slightly stronger) reformulation — the constant C can absorb any finite number of small cases. This is a standard and correct way to formalize asymptotic bounds. + +**Ambiguity assessment: Very low.** The problem is precisely stated with explicit graph definitions and explicit exponent. + +## 6. Correctness + +**The formalization is mathematically correct, with minor observations:** + +### Correctness of the graph construction +The 1-subdivision of K_k replaces each edge {i,j} of K_k with a path i—z_{ij}—j. The vertex set is `Fin k ⊕ {(i,j) : i < j}`, and the adjacency `subdivKAdj` correctly encodes that each subdivision vertex z_{ij} is adjacent only to vertices i and j. The symmetry and irreflexivity proofs are correct: +- Symmetry: the two non-trivial cases (`.inl a, .inr ⟨⟨i,j⟩,_⟩` and its swap) have identical predicates `a = i ∨ a = j`, so `exact h` works. +- Irreflexivity: all self-loops fall into the `| _, _ => False` case. + +### Correctness of `containsSubgraph` +The definition requires an injective function f : W → V that maps edges to edges. This is the standard notion of subgraph isomorphism (injective homomorphism) used in extremal graph theory. ✅ + +### Correctness of the main statement +The theorem states: for all k ≥ 3, there exist c > 0, C > 0 such that for all n and all G : SimpleGraph (Fin n), if G does not contain the 1-subdivision of K_k, then |E(G)| ≤ C · n^{3/2 − c}. + +This correctly captures ex(n, G_k) ≤ C · n^{3/2 − c_k}. The use of `Fin n` as the vertex type is standard for finite graphs on n vertices. The universal quantification over all n (rather than "sufficiently large n") is valid since for any fixed finite set of exceptions, C can be increased. + +### Potential concern: `edgeFinset` requires decidability +The use of `G.edgeFinset.card` requires decidable adjacency. Since `open Classical` is in scope, this is fine — classical decidability instances are available. + +### `answer(True)` annotation +The problem is marked as solved (proved by Conlon–Lee, improved by Janzer), so `answer(True)` is correct. + +### No mathematical flaws identified. +The formalization is a faithful and correct encoding of the stated problem. An experienced mathematician would not identify obvious flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `containsSubgraph` duplicated across ~30 files; `turanNumber` from 926 could be reused | +| Citations | Missing Er64c, BoSi74; shorthand tags rather than full references | +| Variants | C₆ special case (k=3) and explicit constant results not captured; relationship to Problem 926 undocumented | +| Readability | Good; minor inconsistencies (naming convention, no type alias for vertex type) | +| Formalizability | Excellent — no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/1022.md b/ai-review/1022.md new file mode 100644 index 0000000000..e7238a5066 --- /dev/null +++ b/ai-review/1022.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 1022 + +## 1. Code Reuse + +Three separate, incompatible definitions of `HasPropertyB` exist in this codebase: + +| File | Ground set type | Hypergraph type | +|---|---|---| +| `ErdosProblems/1022.lean` | `Fin n` | `Finset (Finset (Fin n))` | +| `ErdosProblems/901.lean` | `ℕ` | `Finset (Finset ℕ)` | +| `ErdosProblems/602.lean` | general `α` | `ι → Set α` | + +The 602 version is the most general (arbitrary type, indexed family of sets). A single shared definition in `FormalConjecturesForMathlib` parameterized by type could unify all three, with each problem file instantiating it. The 1022 and 901 versions are essentially identical modulo the universe type (`Fin n` vs `ℕ`). At minimum, 1022 should reuse the 901 definition or a shared one. + +No other definitions in `FormalConjecturesForMathlib/` (density, Sidon sets, additive bases, etc.) are relevant to this hypergraph 2-colorability problem. + +## 2. Citations + +**Website references:** +- **[Lo68]** — Lovász's proof (cited by Erdős). Mentioned on the website but *not* in the formalization. +- **[Wo13b]** — Wood, D.R. Mentioned in both, but the formalization's citation is informal: "counterexample construction of triangle-free 2-degenerate $r$-uniform hypergraphs with chromatic number 3." The website doesn't give a full bibliographic entry either, so this is acceptable, but ideally the citation would include a paper title or arXiv identifier if available. +- **[Er71]** — Erdős, P., *Problems and results on graphs and hypergraphs: similarities and differences* (1971), p. 105. Present in the formalization and consistent with the website's attribution. + +**Recommendation:** Add a brief mention of [Lo68] (Lovász) for completeness, since the website references it. + +## 3. Variants + +The website describes only the single main problem (the question about existence of $c_t$) and its resolution (disproved by Wood). No additional variants are mentioned. The formalization captures only the main statement, which is appropriate. + +No variants appear to be missing. + +## 4. Readability + +The code is clear and well-structured. The docstring accurately describes the mathematical content. Minor suggestions: + +- The `HasPropertyB` definition and the main theorem are easy to follow. +- The namespace `Erdos1022` is consistent with other problem files. +- The docstring correctly notes the problem was "Disproved by Wood [Wo13b]." + +No significant readability concerns. + +## 5. Formalizability + +The problem statement is precise enough to be formalizable. The concepts involved — finite hypergraphs, edge containment, 2-colorability — are all concrete and well-defined. The notion of "for every set $X$, the number of edges contained in $X$ is $< c_t |X|$" is a precise combinatorial condition. + +**Ambiguity level: Low.** The only mild ambiguity is whether "for every set $X$" means every subset of the ground set or every finite set in the universe. The formalization correctly interprets this as every subset of the ground set (`Finset (Fin n)`). + +## 6. Correctness + +### Critical Bug: Vacuous Hypothesis at X = ∅ + +The formalization has a **fatal correctness error** that makes the theorem trivially false (and therefore unprovable). + +The degeneracy condition is: +```lean +∀ X : Finset (Fin n), + ((F.filter (fun e => e ⊆ X)).card : ℝ) < c t * (X.card : ℝ) +``` + +When `X = ∅`: +- No edge of size ≥ t (for t ≥ 1) is a subset of ∅, so `(F.filter (fun e => e ⊆ ∅)).card = 0`. +- `X.card = 0`, so `c t * 0 = 0`. +- The condition becomes `(0 : ℝ) < 0`, which is **false**. + +**Consequence:** The hypothesis `∀ X, ... < c t * |X|` is *never* satisfiable (it fails at X = ∅). This makes the implication `hypothesis → HasPropertyB F` vacuously true for all F. Therefore: + +``` +∃ c, Tendsto c atTop atTop ∧ (∀ t n F, [vacuously true]) +``` + +is trivially satisfiable (pick any c with c → ∞). So the RHS of the biconditional is `True`, and the theorem becomes `False ↔ True`, which is `False` — **unprovable**. + +### Suggested Fix + +Replace strict inequality `<` with `≤`: + +```lean +∀ X : Finset (Fin n), + ((F.filter (fun e => e ⊆ X)).card : ℝ) ≤ c t * (X.card : ℝ) +``` + +With `≤`, when X = ∅ we get `0 ≤ 0`, which is true, so the condition is no longer vacuously false. This also faithfully captures the intended degeneracy-type condition: every induced sub-hypergraph on X has at most $c_t |X|$ edges. The strict vs. non-strict distinction is immaterial for the truth of the conjecture (replacing $< c_t$ with $\leq c_t$ doesn't change whether such a $c_t \to \infty$ exists), and `≤` avoids the degenerate edge case. + +Alternatively, one could restrict X to nonempty sets: + +```lean +∀ X : Finset (Fin n), X.Nonempty → + ((F.filter (fun e => e ⊆ X)).card : ℝ) < c t * (X.card : ℝ) +``` + +### Secondary Issue: Ground Set Generality + +The formalization uses `Fin n` as the ground set, which means the theorem quantifies over all finite ground set sizes `n`. This is mathematically equivalent to the original (which says "every finite hypergraph") but is a slightly non-standard encoding. The approach in `ErdosProblems/901.lean` (using `ℕ` as vertices) avoids the dependently-typed `Fin n` and may be simpler to work with. This is a style preference, not a correctness issue. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `HasPropertyB` duplicated across 3 files; should be unified | +| Citations | [Lo68] missing; [Wo13b] could be more detailed | +| Variants | Complete — no missing variants | +| Readability | Good | +| Formalizability | Low ambiguity; straightforward to formalize | +| Correctness | **Incorrect** — vacuous hypothesis bug makes theorem unprovable; fix by using `≤` or restricting to nonempty X | diff --git a/ai-review/1023.md b/ai-review/1023.md new file mode 100644 index 0000000000..c204d1f4a3 --- /dev/null +++ b/ai-review/1023.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 1023 + +## 1. Code Reuse + +Problem 447 (`FormalConjectures/ErdosProblems/447.lean`) defines a related but distinct notion: + +```lean +-- Problem 447: pairwise union-free (no A ∪ B = C for distinct A, B, C) +def UnionFreeFamily {α : Type*} [DecidableEq α] (F : Finset (Finset α)) : Prop := + ∀ A ∈ F, ∀ B ∈ F, ∀ C ∈ F, A ≠ B → A ≠ C → B ≠ C → A ∪ B ≠ C + +-- Problem 1023: general union-free (no member is union of any nonempty subcollection of others) +def IsUnionFreeFamily {n : ℕ} (𝓕 : Finset (Finset (Fin n))) : Prop := + ∀ A ∈ 𝓕, ∀ S ⊆ 𝓕.erase A, S.Nonempty → S.sup id ≠ A +``` + +These are intentionally different definitions (1023's is strictly more restrictive than 447's), so separate definitions are justified. However, 1023's definition is unnecessarily specialized to `Fin n` whereas 447's is generic over any type. Consider making `IsUnionFreeFamily` polymorphic for potential reuse. + +The `sSup`-over-cardinalities pattern used in `unionFreeMax` is common in the codebase (e.g., `maxSumFreeSize` in Problem 790, `largestInducedForestSize` in `FormalConjecturesForMathlib`). No existing utility abstracts this pattern, so the current approach is standard. + +## 2. Citations + +**Current docstring:** +> [Er71] Erdős, P., *Some unsolved problems*, 1971, p. 105. + +**Website (erdosproblems.com/1023):** +- The problem is attributed to Erdős's 1971 paper, noting that the original reference contains an exponent of 3/2, which is "likely a typographical error" (should be 1/2). +- Contributors listed: Stijn Cambie and Zach Hunter. +- Hunter is credited with observing that the answer follows from Problem 447. +- Kleitman's result is referenced but described as "unpublished" work with Erdős, not specifically citing [Kl71]. + +**Issues:** +- The citation format is acceptable but could note that the original paper's exponent (3/2) is a known typo. +- The docstring attributes the observation about Problem 447 to "Hunter" — the website credits "Zach Hunter", which could be made more specific. +- Kleitman's paper [Kl71] is cited in Problem 447's file but not in 1023. Since the docstring mentions "Erdős and Kleitman proved that F(n) ≍ 2^n/√n," a citation would be appropriate. + +## 3. Variants + +The website describes one main statement and its resolution via Problem 447. The formalization captures the core conjecture (existence of c > 0 with F(n) ~ c · 2^n/√n). + +**Missing variant/strengthening:** The docstring notes that F(n) ~ C(n, ⌊n/2⌋) (from Problem 447), which is a strictly stronger result than the existence of some constant c. The formalization only captures the weaker "exists c" version. A stronger variant could directly assert F(n) / C(n, ⌊n/2⌋) → 1, which would make the connection to Problem 447 formally explicit and would pin down the constant c = √(2/π). + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- `S.sup id` computes the union of a finset of finsets, which is correct but somewhat opaque to readers unfamiliar with Lean's lattice operations on `Finset`. The docstring on `IsUnionFreeFamily` explains this well enough. +- The namespace `Erdos1023` and definition names are consistent with project conventions. +- The `open Finset Filter` and `open scoped Topology` are appropriate for the imports used. + +No significant readability issues. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The problem statement "F(n) ~ c · 2^n/√n for some c > 0" is a precise asymptotic claim. The only potential ambiguity is in the definition of "union-free": + +- **Pairwise interpretation** (Problem 447): no A ∪ B = C for distinct members. +- **General interpretation** (Problem 1023): no member equals the union of any nonempty subcollection of other members. + +The 1023 formalization correctly uses the general interpretation, which matches the natural reading of "no set is the union of other family members" from the website. Importantly, both interpretations yield the same asymptotics (the middle layer C(n, ⌊n/2⌋) achieves the bound for both), so the choice does not affect the truth of the theorem. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `IsUnionFreeFamily` +Correctly captures that no member A ∈ 𝓕 equals the sup (= union in the Finset lattice) of any nonempty subcollection S ⊆ 𝓕 \ {A}. This is the standard notion. + +### Definition: `unionFreeMax` +Uses `sSup` on ℕ over `{k | ∃ 𝓕, IsUnionFreeFamily 𝓕 ∧ 𝓕.card = k}`. This is well-defined because: +- The set is **nonempty**: the empty family is vacuously union-free with card 0. +- The set is **bounded above**: any family of subsets of `Fin n` has at most 2^n members. + +For ℕ with its `ConditionallyCompleteLinearOrderBot` instance, `sSup` returns the correct maximum for bounded nonempty sets. + +### Theorem: `erdos_1023` +States ∃ c > 0, F(n) · √n / (c · 2^n) → 1, which is equivalent to F(n) ~ c · 2^n / √n. This is: +- **True** — the answer is F(n) ~ C(n, ⌊n/2⌋) ~ √(2/π) · 2^n / √n by Stirling's approximation. +- **Correctly formulated** — uses `Tendsto ... atTop (nhds 1)` for the asymptotic equivalence. +- **Well-typed** — division by zero at n = 0 (where √n = 0) produces 0 in ℝ, which doesn't affect the limit. + +### Docstring accuracy +The claim "Erdős and Kleitman proved that F(n) ≍ 2^n/√n" is consistent with known results. The claim "Hunter observes that the answer follows from the solution to problem 447, which implies F(n) ~ C(n, ⌊n/2⌋)" is correct: since the 1023 definition is more restrictive than 447's, max₁₀₂₃ ≤ max₄₄₇ ~ C(n, ⌊n/2⌋), while the middle layer provides a matching lower bound for 1023 as well. + +### No issues found +The formalization is complete, correct, and faithful to the mathematical content. diff --git a/ai-review/1024.md b/ai-review/1024.md new file mode 100644 index 0000000000..b28b301960 --- /dev/null +++ b/ai-review/1024.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 1024 + +## 1. Code Reuse + +The formalization defines its own `Hypergraph3Uniform` structure, `IsLinear`, `IsIndependent`, and `independenceNumber` locally in the `Erdos1024` namespace. There are numerous similar hypergraph definitions scattered across the codebase: + +- **1076.lean**: Defines `Hypergraph3` (identical structure: `edges : Finset (Finset (Fin n))` with 3-uniformity constraint). Could be unified with `Hypergraph3Uniform`. +- **616.lean**: Defines `UniformHypergraph` with a general uniformity parameter `r`. +- **836.lean, 833.lean, 834.lean**: Define a generic `Hypergraph` structure parameterized by vertex type `V`. +- **832.lean, 1157.lean**: Define `UniformHypergraph` parameterized by both vertex type and uniformity. +- **151.lean, 807.lean**: Define `IsIndependentSet` and `independenceNumber` for `SimpleGraph`, using the same `sSup` pattern. + +The `Hypergraph3Uniform` in 1024.lean is essentially identical to `Hypergraph3` in 1076.lean (both are structures with `edges : Finset (Finset (Fin n))` and a `∀ e ∈ edges, e.card = 3` constraint). These could share a single definition. There is no shared hypergraph definition in `FormalConjecturesForMathlib/` that could be reused, though `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` references r-uniform hypergraphs in the context of Ramsey numbers. + +**Recommendation**: Consolidate `Hypergraph3Uniform` and `Hypergraph3` (from 1076.lean) into a shared definition, potentially in a utility file. The `IsIndependent` and `independenceNumber` definitions could also be shared across hypergraph problems. + +## 2. Citations + +The website ([erdosproblems.com/1024](https://www.erdosproblems.com/1024)) lists: + +- **Source citation**: [Er71, p.106] — This is **not mentioned** in the formalization's docstring. +- **Reference**: [PhRo86] — Phelps, K. T. and Rödl, V., *Steiner triple systems with minimum independence number*. Ars Combin. 21 (1986), 167–172. + +The formalization correctly cites [PhRo86] with full bibliographic details. However, the original source [Er71, p.106] (where Erdős posed the problem) is missing from the docstring. This should be added for completeness, e.g.: + +> A question of Erdős [Er71, p.106], who proved $n^{1/2} \ll f(n) \ll n^{2/3}$. + +## 3. Variants + +The website states the problem as: "Estimate f(n)." The formalization captures the resolved answer f(n) ≍ (n log n)^{1/2} as a single theorem combining upper and lower bounds. + +**Possible variants not captured**: + +- **Erdős's original weaker bounds**: n^{1/2} ≪ f(n) ≪ n^{2/3}. These could be formalized as a separate, historically-motivated theorem. Problem 1025 (a closely related problem) splits the result into separate `erdos_1025` (lower bound) and `erdos_1025.variants.upper_bound` theorems. A similar split could be done here. +- **Generalizations to r-uniform linear hypergraphs**: The problem is stated for r = 3, but one could ask about general r. This is not explicitly part of Erdős Problem 1024 as stated on the website, so omission is acceptable. + +The single combined theorem is a reasonable formalization of the resolved result, though splitting into separate upper and lower bound theorems (as done in 1025.lean) would be stylistically more consistent. + +## 4. Readability + +The code is well-structured and readable: + +- Clear docstrings on all definitions and the main theorem. +- Logical ordering: structure → linearity → independence → independence number → min independence number → main theorem. +- Good naming conventions (`Hypergraph3Uniform`, `IsLinear`, `IsIndependent`, `linearHypergraphIndNum`). + +**Minor suggestions**: +- The name `linearHypergraphIndNum` could be slightly more descriptive, e.g., `linearHypergraph3IndependenceNumber`, to clarify that it applies to 3-uniform hypergraphs specifically. +- The module docstring thoroughly explains the mathematical context, which is good. + +## 5. Formalizability + +**Ambiguity assessment: Low.** + +The original problem "Estimate f(n)" is inherently imprecise — any valid bound could count as an "estimate." However, the formalization captures the sharp asymptotic answer f(n) = Θ(√(n log n)) from Phelps–Rödl, which is the definitive resolution. The definitions of 3-uniform hypergraph, linearity, and independence are all standard and unambiguous. + +The use of `Real.log` (natural logarithm) is appropriate — in combinatorics, "log" in asymptotic statements conventionally refers to the natural logarithm, and the choice of base doesn't affect the Θ-class anyway (only the constants C₁, C₂). + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`Hypergraph3Uniform`**: Correctly models a 3-uniform hypergraph on n vertices as a finite collection of 3-element subsets of Fin n. ✓ + +- **`IsLinear`**: Correctly requires that any two *distinct* edges share at most one vertex (|e₁ ∩ e₂| ≤ 1). ✓ + +- **`IsIndependent`**: Correctly defines an independent set S as one containing no edge entirely (∀ e ∈ edges, ¬(e ⊆ S)). ✓ + +- **`independenceNumber`**: Uses `sSup {k | ∃ S, IsIndependent S ∧ S.card = k}`. This set is nonempty (∅ is always independent, giving k = 0) and bounded above by n (since S : Finset (Fin n)). For ℕ with its well-ordered structure, `sSup` of a nonempty bounded set returns the maximum, so this correctly computes the independence number. ✓ + +- **`linearHypergraphIndNum`**: Uses `sInf {k | ∃ H, H.IsLinear ∧ H.independenceNumber = k}`. This set is nonempty (the empty hypergraph, which is vacuously linear, has independence number n). For ℕ (well-ordered), `sInf` of a nonempty set returns the minimum. This correctly computes f(n) = min over all linear 3-uniform hypergraphs of their independence number. ✓ + +- **Theorem statement**: Asserts ∃ C₁ C₂ > 0, ∃ N₀, ∀ n ≥ N₀, C₁√(n log n) ≤ f(n) ≤ C₂√(n log n). This correctly captures f(n) = Θ(√(n log n)). The use of `Real.sqrt (↑n * Real.log ↑n)` is well-behaved: for large n, n * log n > 0, and for small n (below N₀), the bound is not asserted. ✓ + +- **Edge case**: When n < 3, no 3-element subsets of Fin n exist, so the only hypergraph is the empty one, and f(n) = n. The theorem avoids this regime via the N₀ threshold. ✓ + +- **Tag**: `@[category research solved, AMS 5]` — The website confirms the problem is solved. AMS classification 5 (Combinatorics) is appropriate. ✓ + +**No mathematical errors identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Duplicates `Hypergraph3` from 1076.lean; consolidation recommended | +| Citations | Missing original source [Er71, p.106]; [PhRo86] is correctly cited | +| Variants | Combined theorem is adequate; could split upper/lower bounds for consistency with 1025.lean | +| Readability | Good; minor naming suggestion | +| Formalizability | Low ambiguity — standard definitions, sharp result captured | +| Correctness | **Correct and complete** — no mathematical issues found | diff --git a/ai-review/1025.md b/ai-review/1025.md new file mode 100644 index 0000000000..e364112c33 --- /dev/null +++ b/ai-review/1025.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 1025 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib`. The problem defines a custom notion of "independent set" with respect to a pair function, which is distinct from the standard graph-theoretic independent set (pairwise non-adjacency). While `Erdos993` defines `numIndepSets` for `SimpleGraph`, and the Ramsey file in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines hypergraph Ramsey numbers, neither provides abstractions that directly apply here. + +The problem's "independent set" notion could in principle be modeled as an independent set in a 3-uniform hypergraph (where each pair {x,y} with x≠y generates a hyperedge {x, y, f(x,y)}), but no such hypergraph independent-set infrastructure exists in the codebase. The current custom definitions (`IsValidPairFunction`, `IsIndependentPairSet`) are appropriate and self-contained. + +## 2. Citations + +The formalization references: +- `[ErHa58]` — Erdős, P. and Hajnal, A., 1958. +- `[Sp72]` — Spencer, J., 1972. +- `[CFS16]` — Conlon, D., Fox, J., and Sudakov, B., 2016. + +The website (erdosproblems.com/1025) lists the same three references with identical shorthand keys and attributions. The website also notes the original source as Erdős [Er71, p.106], which is **not** mentioned in the formalization docstring. This is a minor omission — the [Er71] reference could be added for completeness. + +**Recommendation:** Add a note that the problem originates from [Er71, p.106] as documented on the website. + +## 3. Variants + +The formalization captures two statements: + +1. **Lower bound** (`erdos_1025`): ∃ C > 0, ∀ n, ∀ valid f, ∃ independent S with |S| ≥ C√n. (Spencer's result.) +2. **Upper bound** (`erdos_1025.variants.upper_bound`): ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ∃ valid f such that every independent S has |S| ≤ C√n. (Conlon–Fox–Sudakov's result.) + +Together these establish g(n) = Θ(√n), which is the complete resolution of the problem as stated on the website. The historical intermediate results (Erdős–Hajnal's n^{1/3} lower bound and (n log n)^{1/2} upper bound) are mentioned in the docstring but not separately formalized, which is reasonable since they are strictly superseded. + +**No missing variants.** The formalization correctly captures both the existential lower bound and the constructive upper bound, which together fully characterize g(n). + +## 4. Readability + +The code is well-structured and readable: + +- The namespace `Erdos1025` cleanly scopes the definitions. +- `IsValidPairFunction` and `IsIndependentPairSet` have clear names and docstrings. +- The theorem docstrings explain the mathematical content and attribute the results. +- The `open Finset` is appropriate for the `∈` notation on `Finset`. + +**Minor suggestions:** +- The docstring for the lower bound says "For every valid pair function f on Fin n" — this is clear. +- The naming convention `erdos_1025.variants.upper_bound` follows the project convention for variant theorems. + +No readability issues. + +## 5. Formalizability + +The problem as stated on the website is precise and clearly formalizable. It defines: +- A domain {1,…,n} (formalized as `Fin n`). +- A function f on pairs with explicit constraints (f(x,y) ≠ x and f(x,y) ≠ y). +- An independence condition (f(x,y) ∉ X for x,y ∈ X). +- A minimax quantity g(n) (minimum over all f of the maximum independent set size). + +**Ambiguity assessment: Very low.** The only potential ambiguity is whether f is defined on ordered or unordered pairs — the website says "all pairs," which could mean unordered. The formalization uses ordered pairs (f : Fin n → Fin n → Fin n), which is strictly more general (it does not assume f(x,y) = f(y,x)). This is a sound choice: any result proved for all functions on ordered pairs automatically applies to symmetric functions. The quantifier structure correctly handles this. + +## 6. Correctness + +### Lower bound (`erdos_1025`) + +**Statement analysis:** +``` +∃ C : ℝ, C > 0 ∧ ∀ n : ℕ, ∀ f : Fin n → Fin n → Fin n, + IsValidPairFunction n f → + ∃ S : Finset (Fin n), IsIndependentPairSet n f S ∧ (S.card : ℝ) ≥ C * Real.sqrt n +``` + +This correctly states: there exists a universal constant C > 0 such that for every n and every valid pair function f, there exists an independent set of size ≥ C√n. This matches Spencer's 1972 result. + +**Potential issue:** The statement quantifies over all n : ℕ, including n = 0 and n = 1. For n = 0, Fin 0 is empty, so the empty set is trivially independent with card 0, and C * √0 = 0, so the bound holds. For n = 1, there are no pairs of distinct elements, so any singleton (or even the empty set) is independent; the bound requires card ≥ C * 1 = C, so a singleton suffices for C ≤ 1. This is fine — no vacuity issues. + +**Correctness: Sound.** + +### Upper bound (`erdos_1025.variants.upper_bound`) + +**Statement analysis:** +``` +∃ C : ℝ, C > 0 ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n ≥ n₀ → + ∃ f : Fin n → Fin n → Fin n, IsValidPairFunction n f ∧ + ∀ S : Finset (Fin n), IsIndependentPairSet n f S → (S.card : ℝ) ≤ C * Real.sqrt n +``` + +This correctly states: there exists C > 0 and a threshold n₀ such that for all n ≥ n₀, there exists a valid pair function whose every independent set has size ≤ C√n. The "sufficiently large n" qualifier (via n₀) is appropriate for the upper bound construction. + +**Correctness: Sound.** + +### Definition correctness + +- `IsValidPairFunction`: requires f x y ≠ x ∧ f x y ≠ y for all x ≠ y. This correctly captures the constraint that f maps pairs to a "third party." Note that f x x is unconstrained, which is fine since the independence condition only considers distinct pairs. + +- `IsIndependentPairSet`: requires f x y ∉ S for all distinct x, y ∈ S. This correctly captures the independence condition from the problem statement. + +**One subtlety:** The problem says f maps "pairs of elements" — it does not explicitly require x ≠ y in the domain of f. The formalization's `IsValidPairFunction` only imposes constraints when x ≠ y, which means f x x can be anything (including x itself). This is consistent: the independence condition in `IsIndependentPairSet` also only applies when x ≠ y (via the `x ≠ y →` guard), so the value of f x x is irrelevant. This is correct. + +### Overall mathematical assessment + +The formalization is **correct and complete**. Both the lower and upper bounds are properly stated with appropriate quantifier structure, and together they capture the full Θ(√n) resolution of the problem. The definitions faithfully represent the combinatorial setup. No mathematical flaws are apparent. diff --git a/ai-review/1026.md b/ai-review/1026.md new file mode 100644 index 0000000000..de9981b7cc --- /dev/null +++ b/ai-review/1026.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 1026 + +## 1. Code Reuse + +The definitions `IsIncreasingSubseq`, `IsDecreasingSubseq`, and `IsMonotoneSubseq` are local to the `Erdos1026` namespace. A thorough search of the codebase found **no shared definitions** for monotone subsequences in `FormalConjecturesForMathlib` or elsewhere. No other Erdős problem file defines or uses these concepts. There is no opportunity for code reuse from the existing codebase. + +However, **Mathlib itself** provides `Monotone`, `StrictMono`, `StrictAnti`, etc. The current definitions are index-set-based (operating on `Finset (Fin n)`) rather than function-based, which is a reasonable design choice for this combinatorial statement, but one could consider whether Mathlib's `List.Sublist` or order-theoretic monotonicity could be leveraged. Given the need for a `Finset`-based formulation to express sums over subsequences, the current approach is pragmatic and appropriate. + +## 2. Citations + +The docstring references: +- **[TWY16]** — "Tidor, J., Wang, V., and Yang, K., *Weighted monotone subsequences* (2016)." +- **[Wa17]** — "Wagner, A. Z. (2017)." + +The website (erdosproblems.com/1026) lists the original source as **[Er71, p.107]** and mentions OEIS sequences **A391431** and **A391490**. Issues: + +- **[TWY16]** is listed as 2016 but the citation tag suggests it could be a 2016 preprint. The website confirms Tidor–Wang–Yang proved the result. The citation is acceptable but incomplete (no journal/arXiv reference). +- **[Wa17]** is extremely terse — no title, no journal, no arXiv link. This should be fleshed out: "Wagner, A. Z., *Refining the Erdős–Szekeres theorem* (2017)" or similar. +- The original Erdős source **[Er71]** is not cited in the docstring but arguably should be, since this is an Erdős problem. +- The OEIS sequences are not mentioned, which is acceptable (they are tangential). + +**Recommendation:** Expand the Wagner citation and add the original Erdős reference. + +## 3. Variants + +The website describes three layers of the problem: + +1. **Original (vague) Erdős problem:** Determine the maximum of $\sum x_{i_r}$ over monotone subsequences of a sequence of distinct reals. (Captured in the docstring preamble.) +2. **Precise reformulation (van Doorn):** Find the largest constant $c$ such that for all sequences of $n$ real numbers, $\max(\sum x_{i_r}) > (c - o(1)) \cdot \frac{1}{\sqrt{n}} \cdot \sum x_i$. (Described in docstring but **not formalized**.) +3. **Cambie's conjecture (proved):** For $k^2$ distinct positive reals summing to 1, there exists a monotone subsequence with sum $\geq 1/k$. (**This is what is formalized.**) + +The formalization captures only Cambie's strengthened conjecture (variant 3). The asymptotic formulation (variant 2) — asking for the optimal constant $c = 1$ — is **not formalized** as a separate theorem. This is understandable: the asymptotic statement involves $o(1)$ terms that are harder to formalize, and Cambie's conjecture implies $c = 1$. Nevertheless, the review notes this incompleteness. + +The website also mentions **Hanani's decomposition result** (every sequence decomposes into at most $(\sqrt{2} + o(1))\sqrt{n}$ monotone subsequences, giving $c \geq 1/\sqrt{2}$). This is not formalized, which is acceptable since it is a weaker bound superseded by the main result. + +**Recommendation:** The current formalization is the strongest and most natural discrete statement. No additional variants are strictly necessary. + +## 4. Readability + +The code is clear and well-structured: + +- The three definitions (`IsIncreasingSubseq`, `IsDecreasingSubseq`, `IsMonotoneSubseq`) are clean, well-documented, and logically ordered. +- The main theorem statement is readable and follows standard conventions. +- The docstring provides good mathematical context. + +Minor suggestions: +- The phrase "weighted form of the Erdős–Szekeres theorem" in the theorem docstring is helpful context. +- The module docstring's mention of "van Doorn" as attributor of the precise formulation is good scholarly practice. + +**Verdict:** Readability is good. No significant improvements needed. + +## 5. Formalizability + +Cambie's conjecture as stated is **fully precise and formalizable**. There is no ambiguity: +- The sequence length is $k^2$ (exact). +- The values are distinct positive reals summing to 1 (exact constraints). +- The conclusion asks for existence of a monotone subsequence with sum $\geq 1/k$ (exact). + +The *original* Erdős problem ("determine $\max(\sum x_{i_r})$") is vague — it asks to "determine" a quantity without specifying what form the answer should take. The van Doorn reformulation introduces $o(1)$ asymptotics, which adds formalization difficulty. Cambie's conjecture elegantly avoids both issues. + +**Verdict:** The chosen formalization is the right one — it is the most precise, strongest, and most naturally formalizable version of the problem. + +## 6. Correctness + +The formalization is **mathematically correct** but has a few points worth noting: + +### Correct aspects: +- The hypotheses `hk : k ≥ 1` correctly excludes the degenerate case $k = 0$ (where $k^2 = 0$ and the statement would be vacuously true but $1/k$ undefined). +- `hx_pos : ∀ i, x i > 0` correctly requires strict positivity. +- `hx_inj : Function.Injective x` correctly captures "distinct" values. +- `hx_sum : ∑ i, x i = 1` is the normalization condition. +- The conclusion `∑ i ∈ S, x i ≥ 1 / (k : ℝ)` correctly uses real division. + +### Potential concern — non-empty subsequence: +The formalization does not require `S.Nonempty`. An empty `Finset` vacuously satisfies `IsMonotoneSubseq` (both the increasing and decreasing conditions hold vacuously for the empty set). Its sum is 0, so `0 ≥ 1/k` would need to hold, which is false for $k \geq 1$. Therefore the emptiness concern is **moot** — any witness `S` must be non-empty to satisfy the sum bound. This is correct as stated. + +### Potential concern — singleton subsequences: +A singleton set is both (vacuously) increasing and decreasing. For $k = 1$, we have $k^2 = 1$ element with value 1, and the singleton subsequence sums to 1 = 1/k. For larger $k$, a singleton is insufficient (its value is at most 1 while $1/k < 1$ could potentially be met, but the interesting case is when no single element suffices). The formalization handles this correctly. + +### Potential concern — distinctness vs. strict inequality: +The definitions use strict inequalities (`x i < x j` for increasing, `x i > x j` for decreasing). Combined with `Function.Injective x`, this is correct: injective means distinct values, and the strict ordering is well-defined. If non-strict inequalities were used, the definitions would allow repeated values, which would be inconsistent with the "distinct" hypothesis. The current formulation is correct. + +**Verdict:** The formalization is correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities found; definitions are appropriately local | +| Citations | Wagner citation needs expansion; original Erdős reference [Er71] missing | +| Variants | Main (strongest) variant captured; asymptotic formulation omitted (acceptable) | +| Readability | Good | +| Formalizability | Excellent — precise, unambiguous statement | +| Correctness | Correct and complete | diff --git a/ai-review/1027.md b/ai-review/1027.md new file mode 100644 index 0000000000..e8d28d7dd8 --- /dev/null +++ b/ai-review/1027.md @@ -0,0 +1,121 @@ +# AI Review: Erdos Problem 1027 + +## 1. Code Reuse + +The formalization uses `Finset.biUnion`, `Finset.powerset`, `Finset.filter`, and `Finset.card` — all standard Mathlib operations. No custom definitions are introduced. + +**Relevant codebase overlap with Problem 901:** Erdos Problem 901 (`FormalConjectures/ErdosProblems/901.lean`) defines `IsNUniform` and `HasPropertyB` for n-uniform hypergraphs and Property B (2-colorability). The website for Problem 1027 explicitly states that "the existence of a single such set B is equivalent to F having Property B" (i.e., Problem 901). Specifically, a set B that intersects every member of F but contains none of them corresponds to one color class in a 2-coloring of the ground set — vertices in B form one class, vertices not in B form the other, and the intersection/non-containment conditions ensure every edge is non-monochromatic. + +However, Problem 1027 asks a *quantitative* question (how many such sets B exist), not merely an existence question, so the connection to Problem 901 is conceptual rather than code-reusable. The current formalization appropriately does not import or reference `Erdos901.HasPropertyB`. + +**Recommendation:** No code reuse opportunities. A cross-reference to Problem 901 in the docstring would add helpful mathematical context. + +## 2. Citations + +The docstring currently states: +> This was proved in the affirmative by Koishi Chan. + +The website (erdosproblems.com/1027) lists: +- **References:** [Er64e] and [Er71, p. 107] +- **Credits:** Stijn Cambie and Koishi Chan +- **Solution:** Proved by Koishi Chan (in the comment section) + +Issues: +- The original Erdos references **[Er64e]** and **[Er71, p. 107]** are not cited in the docstring. These should be included as the source of the problem. +- **Stijn Cambie** is credited on the website but not mentioned in the docstring. His role (likely problem formulation or partial results) should be acknowledged. +- The attribution "proved in the affirmative by Koishi Chan" is consistent with the website. However, a comment-section proof is unusual — there is no published paper reference for the solution. +- The connection to Problem 901 (Property B) is noted on the website but not in the docstring. + +**Recommendation:** Add [Er64e] and [Er71, p. 107] as references. Mention the connection to Problem 901. Acknowledge Stijn Cambie's contribution. + +## 3. Variants + +The website describes a single problem with no explicit variants. The problem asks whether the number of "crossing" sets B is at least a constant fraction of all subsets of X. The formalization captures this precisely. + +One could consider the following implicit variant structure: +1. **Existence version (Property B):** Does there exist *at least one* such B? This is Problem 901. +2. **Quantitative version (this problem):** Are there proportionally many such B's? This is Problem 1027. + +The formalization captures variant (2), which is the stronger and intended statement. No additional variants are missing. + +**Recommendation:** No additional variants needed. + +## 4. Readability + +The code is compact and reasonably readable. A few observations: + +- The `let X := F.biUnion id` binding is clear — X is the ground set (union of all sets in F). +- The filter condition `(∀ A ∈ F, (A ∩ B).Nonempty) ∧ (∀ A ∈ F, ¬(A ⊆ B))` directly encodes "B intersects every set in F" and "B contains no set in F." This is mathematically transparent. +- The overall structure (∀ c > 0, ∃ δ > 0, ∃ N₀, ∀ n ≥ N₀, ...) correctly captures "for sufficiently large n depending on c" with a quantitative lower bound. +- Using `answer(True)` wrapping is consistent with the project convention for solved problems. + +Minor readability suggestion: The inline `let X := F.biUnion id` inside the theorem statement works but could be extracted as a definition for clarity if the file grew. At current size, it is fine. + +**Verdict:** Good readability. No significant improvements needed. + +## 5. Formalizability + +The problem as stated on the website uses the notation "$\gg_c 2^{|X|}$" which means "at least $\delta_c \cdot 2^{|X|}$ for some $\delta > 0$ depending on $c$." This is a standard asymptotic convention and is fully precise once unpacked. + +The formalization correctly unpacks this as: ∃ δ > 0 such that the count is ≥ δ · 2^|X|. This is the standard way to formalize the $\gg_c$ notation, where the dependence on c is captured by the universal quantifier over c appearing before the existential quantifier for δ. + +There is **no ambiguity** in the problem statement: +- "Family of at most c · 2^n finite sets of size n" — precise. +- "Intersect every set in F" — precise (non-empty intersection). +- "Contain none of them" — precise (no set in F is a subset of B). +- "$\gg_c 2^{|X|}$" — standard asymptotic notation, precisely rendered. + +**Verdict:** The problem is unambiguous and the formalization is a faithful rendering. Formalizability is excellent. + +## 6. Correctness + +### Overall assessment: Correct + +The formalization faithfully captures the mathematical content of Erdos Problem 1027. + +### Detailed verification: + +**Quantifier structure:** `∀ c > 0, ∃ δ > 0, ∃ N₀, ∀ n ≥ N₀, ∀ F, ...` — This correctly models "for every c > 0, for sufficiently large n (depending on c), ..." with a quantitative bound δ that may depend on c. This is the standard formalization of $\gg_c$. + +**Uniformity condition:** `∀ A ∈ F, A.card = n` — Correctly encodes that all sets in F have size exactly n (n-uniform family). + +**Size bound on family:** `(F.card : ℝ) ≤ c * (2 : ℝ) ^ n` — Correctly encodes |F| ≤ c · 2^n. + +**Ground set:** `let X := F.biUnion id` — Correctly computes X = ∪F as the union of all sets in the family. + +**Counting crossing sets:** The filter condition checks both: +- `∀ A ∈ F, (A ∩ B).Nonempty` — B intersects every member of F. +- `∀ A ∈ F, ¬(A ⊆ B)` — B contains no member of F. + +This is mathematically correct. + +**Lower bound:** `≥ δ * (2 : ℝ) ^ X.card` — Correctly expresses ≥ δ · 2^|X|. + +### Potential concern — universe of sets B: + +The formalization counts sets B from `X.powerset`, i.e., B ⊆ X. This is correct: the problem asks for sets B ⊂ X, and restricting to subsets of X is appropriate since adding elements outside X cannot help satisfy intersection conditions (all elements of sets in F are already in X) but could only help with non-containment (vacuously). The restriction to B ⊆ X gives the tightest possible bound and matches the problem statement. + +### Potential concern — the use of ℕ as the ground type: + +The formalization uses `Finset ℕ` as the type for sets. Since the problem is purely combinatorial and size-based, the choice of ground type is irrelevant up to isomorphism. ℕ is the standard choice in this codebase and is correct. + +### Potential concern — empty family: + +If F = ∅, then all conditions `∀ A ∈ F, ...` hold vacuously, X = ∅, X.powerset = {∅}, and the count of B satisfying the filter is 1 (the empty set vacuously intersects all members and contains no member). The bound requires 1 ≥ δ · 2^0 = δ, which holds for δ ≤ 1. This is mathematically consistent and not a problem — the interesting case is for large families. + +### Potential concern — answer(True): + +The problem is tagged as `solved` and the website confirms it was proved in the affirmative. `answer(True)` is correct. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities; conceptual link to Problem 901 could be noted | +| Citations | Missing [Er64e] and [Er71, p. 107]; Stijn Cambie not credited | +| Variants | Complete — the single quantitative statement is fully captured | +| Readability | Good | +| Formalizability | Excellent — unambiguous, precisely rendered | +| Correctness | Correct and complete | diff --git a/ai-review/1028.md b/ai-review/1028.md new file mode 100644 index 0000000000..fce87f7ad4 --- /dev/null +++ b/ai-review/1028.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1028 + +## 1. Code Reuse + +The codebase contains numerous discrepancy-related formalizations (Problems 67, 176–178, 255, 988–992) that share structural patterns with Problem 1028. However, none provide directly reusable definitions: + +- **Problem 67** (Erdős Discrepancy Problem) is the closest conceptual relative, but models 1D ±1 colorings `f : ℕ → {-1, 1}` summed over arithmetic progressions, whereas 1028 uses 2D ±1 functions `f : Fin n → Fin n → ℤ` summed over subsets. +- **Problems 176–178** define `discrepancyAPNumber` for arithmetic progression discrepancy with ±1 colorings of ℕ — again 1D, not applicable. +- **Problems 988–992** deal with geometric/distributional discrepancy (spherical caps, disks, uniform distribution), conceptually distinct. + +The `discrepancySum` helper defined in 1028 is specific to this problem's combinatorial structure (ordered pair sums over subsets of `Fin n`) and does not duplicate anything in `FormalConjecturesForMathlib` or other problem files. **No code reuse opportunities identified.** + +## 2. Citations + +The website ([erdosproblems.com/1028](https://www.erdosproblems.com/1028)) lists the following references: + +- **[Er63d]** — Erdős (1963), establishing `n/4 ≤ H(n) ≪ n^{3/2}` +- **[ErSp71]** — Erdős and Spencer (1971), proving the lower bound `H(n) ≫ n^{3/2}` +- **[Er71, p.107]** — An additional reference noted on the website + +The formalization's docstring cites `[Er63d]` and `[ErSp71]`, which matches the website. However, the reference **[Er71, p.107]** present on the website is not mentioned in the formalization. This is a minor omission — it could be added to the docstring for completeness. + +## 3. Variants + +The website presents a single problem: estimate `H(n)`. The formalization captures the complete resolved form `H(n) = Θ(n^{3/2})` as a pair of matching upper and lower bounds. The weaker intermediate result `n/4 ≤ H(n)` from [Er63d] is subsumed by the stronger `Θ(n^{3/2})` statement and need not be stated separately. + +**No missing variants.** The formalization captures the full resolved problem. + +## 4. Readability + +The code is well-structured and readable: + +- The `discrepancySum` helper is cleanly separated from the theorem statement with its own docstring. +- The docstring for `erdos_1028` explains both the lower and upper bounds with clear attribution. +- The theorem statement itself is well-organized with comments marking the lower and upper bound clauses. +- The namespace `Erdos1028` avoids polluting the global scope. + +**Minor suggestions:** +- The docstring for `discrepancySum` says "over ordered pairs with x ≠ y," which is accurate and helpful. +- The exponent `(3 : ℝ) / 2` is slightly verbose but unavoidable in Lean 4 for type coercion correctness. + +**Overall: good readability, no changes needed.** + +## 5. Formalizability + +The problem is precisely stated and fully formalizable: + +- `H(n)` is defined as a min-max over finite objects (±1 functions on `{1,...,n}²`, subsets of `{1,...,n}`), so it is computable in principle. +- The asymptotic statement `H(n) = Θ(n^{3/2})` is rendered as explicit existential constants `C₁, C₂ > 0` with a threshold `N₀`, which is the standard and unambiguous way to formalize big-Theta. + +**Ambiguity assessment: Very low.** The only potential ambiguity is whether `∑_{x ≠ y ∈ X} f(x,y)` sums over ordered or unordered pairs. Since `f` is defined on ordered pairs `{1,...,n}² → {-1,1}`, the ordered-pair interpretation (used by the formalization) is natural. The distinction is immaterial to the `Θ(n^{3/2})` result since switching between ordered and unordered pairs changes the sum by a factor of at most 2, absorbed into the constants. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed assessment: + +### Structure of the theorem +The statement `∃ C₁ C₂ > 0, ∃ N₀, ∀ n ≥ N₀, (lower bound) ∧ (upper bound)` correctly encodes `H(n) = Θ(n^{3/2})`: + +- **Lower bound** (`∀ f ... ∃ X ...`): For every ±1 function, some subset achieves discrepancy ≥ `C₁ · n^{3/2}`. This says `H(n) ≥ C₁ · n^{3/2}`, i.e., `H(n) = Ω(n^{3/2})`. ✓ +- **Upper bound** (`∃ f ... ∀ X ...`): There exists a ±1 function where all subsets have discrepancy ≤ `C₂ · n^{3/2}`. This says `H(n) ≤ C₂ · n^{3/2}`, i.e., `H(n) = O(n^{3/2})`. ✓ + +### `discrepancySum` definition +```lean +X.sum fun x => (X.filter (· ≠ x)).sum fun y => f x y +``` +This computes `∑_{x ∈ X} ∑_{y ∈ X, y ≠ x} f(x, y)`, which is the sum over all ordered pairs `(x, y)` in `X × X` with `x ≠ y`. This correctly implements the mathematical definition. ✓ + +### ±1 constraint +The constraint `∀ i j, f i j = 1 ∨ f i j = -1` includes diagonal entries `f(i,i)`, which are never used in `discrepancySum` (since the filter excludes `y = x`). This is harmless — it makes the constraint slightly stronger than necessary but does not affect the mathematical content. The minimization over `f` already considers a subset of the functions that would be considered if diagonals were unconstrained, but since diagonal values don't affect the objective, the optimal value `H(n)` is unchanged. ✓ + +### Domain: `Fin n` vs `{1,...,n}` +Using `Fin n = {0,...,n-1}` instead of `{1,...,n}` is a standard relabeling that does not affect the problem. ✓ + +### Potential concern: shared `N₀` +Both bounds share a single threshold `N₀`. This is fine — take `N₀ = max(N₀_lower, N₀_upper)`. ✓ + +### Potential concern: shared `C₁, C₂` scope +The constants `C₁, C₂` are existentially quantified outside the `∀ n` quantifier, which is correct for asymptotic bounds. ✓ + +**No mathematical flaws identified. The formalization is correct and complete.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities; `discrepancySum` is problem-specific | +| Citations | [Er63d] and [ErSp71] present; [Er71, p.107] from website is missing | +| Variants | All variants captured | +| Readability | Good; clean structure with helpful docstrings | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/1029.md b/ai-review/1029.md new file mode 100644 index 0000000000..0bc5ab66e9 --- /dev/null +++ b/ai-review/1029.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 1029 + +## 1. Code Reuse + +**Issue found: duplicate definition of `diagonalRamseyNumber`.** + +The exact same definition of `diagonalRamseyNumber` appears in both `Erdos1029` (1029.lean:48) and `Erdos77` (77.lean:51), duplicated verbatim across separate namespaces. This definition should be extracted to a shared location (e.g., `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` or a new file like `FormalConjecturesForMathlib/Combinatorics/DiagonalRamsey.lean`) and imported by both problems. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` already defines `Combinatorics.hypergraphRamsey r n`, the r-uniform hypergraph Ramsey number. The diagonal Ramsey number R(k) is mathematically `hypergraphRamsey 2 k`. However, the two definitions differ structurally: + +- `hypergraphRamsey` colors *unordered subsets* (`Finset (Fin m) → Bool` restricted to sets of cardinality r). +- `diagonalRamseyNumber` colors *ordered pairs* (`Fin N → Fin N → Bool`) with an explicit symmetry constraint. + +These are mathematically equivalent for r = 2, but proving this equivalence in Lean would require non-trivial effort. One option is to add a lemma establishing the equivalence; another is to redefine the diagonal Ramsey number in terms of `hypergraphRamsey`. At minimum, the duplication between 77.lean and 1029.lean should be resolved. + +## 2. Citations + +The formalization's docstring includes three references: + +| Citation | In formalization | On erdosproblems.com/1029 | Status | +|----------|-----------------|--------------------------|--------| +| [ErSz35] Erdős & Szekeres, *Compositio Math.* 2 (1935), 463–470 | Yes (full) | Yes | **Match** | +| [Sp75] Spencer, *J. Combin. Theory Ser. A* 18 (1975), 108–115 | Yes (full) | Yes | **Match** | +| [Er93] Erdős, *On some of my favourite theorems* (1993) | Yes (short) | Yes (p. 337) | **Match** | + +All three references on the website are present in the formalization with full bibliographic details. No missing citations. + +The website additionally notes that Erdős offered **\$100 for a proof and \$1000 for a disproof** and mentions **Problem #77** as related (concerning limR(k)^{1/k}). These contextual details are not in the docstring but are not strictly required. + +## 3. Variants + +The website presents a single formulation: R(k) / (k · 2^{k/2}) → ∞. No alternative variants are mentioned. The formalization captures the sole stated variant. Problem #77 (the limit of R(k)^{1/k}) is a separate but related problem and is formalized independently in 77.lean. + +**No missing variants.** + +## 4. Readability + +The code is clean and well-structured: + +- The docstring clearly states the mathematical problem with LaTeX notation. +- The definition of `diagonalRamseyNumber` has an informative docstring explaining it as the minimum N for monochromatic cliques in 2-colorings. +- The theorem statement is concisely written and its docstring explains the ε-δ reformulation. +- The namespace `Erdos1029` is appropriately scoped. + +**Minor suggestion:** The theorem's docstring could explicitly note that the formulation "for every C > 0, eventually R(k) ≥ C · k · 2^{k/2}" is equivalent to divergence to infinity, for readers less familiar with the equivalence. + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. The statement "R(k) / (k · 2^{k/2}) → ∞" has a precise mathematical meaning: for every constant C, eventually the ratio exceeds C. There is no ambiguity in the definition of R(k) (diagonal Ramsey numbers are standard), nor in the notion of divergence to infinity. + +**Ambiguity assessment: None.** This is one of the cleanest possible problem statements to formalize. + +## 6. Correctness + +### Definition correctness + +The definition of `diagonalRamseyNumber` is mathematically correct: + +- It takes a symmetric 2-coloring of edges of K_N (modeled as `c : Fin N → Fin N → Bool` with `∀ i j, c i j = c j i`). +- It requires a monochromatic clique of size k (a set S of cardinality k where all distinct pairs have the same color). +- It takes the infimum over all valid N, which is correct for "minimum N." +- Self-loops (c i i) are assigned colors but are irrelevant since the clique condition only constrains pairs with i ≠ j. This is harmless. +- For the `sInf` on `ℕ`: if the set were empty, `sInf ∅ = 0` by convention, which would make the theorem trivially false for some C. However, the set is provably nonempty for all k (by the Erdős-Szekeres upper bound R(k) ≤ C(2k-2,k-1)), so this is not an actual issue — but it is a proof obligation that any eventual proof must discharge. + +### Theorem correctness + +The formalization: +``` +∀ C : ℝ, C > 0 → + ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (diagonalRamseyNumber k : ℝ) ≥ C * (k : ℝ) * (2 : ℝ) ^ ((k : ℝ) / 2) +``` + +This is a correct ε-δ formulation of R(k) / (k · 2^{k/2}) → ∞. Specifically: + +- **The quantifier structure is correct:** "for all C > 0, there exists K₀ such that for all k ≥ K₀, R(k) ≥ C · k · 2^{k/2}" is exactly the definition of the ratio tending to infinity. +- **The restriction C > 0 is correct:** For C ≤ 0 the inequality is trivially true (since R(k) ≥ k ≥ 1 for k ≥ 1 and the RHS is non-positive), so restricting to C > 0 loses no generality. +- **The exponent `(k : ℝ) / 2` is correct:** This is the real-valued power 2^(k/2), which equals √(2^k). For even k this coincides with the integer power 2^(k/2); for odd k it's the natural interpolation. This matches the standard mathematical meaning of "k · 2^{k/2}" in the problem statement. + +### Verdict + +**The formalization is mathematically correct and complete.** No flaws identified. The only structural concern is the duplicated `diagonalRamseyNumber` definition shared with Problem 77, which is a code organization issue rather than a correctness issue. diff --git a/ai-review/103.md b/ai-review/103.md new file mode 100644 index 0000000000..76babdb6ba --- /dev/null +++ b/ai-review/103.md @@ -0,0 +1,146 @@ +# AI Review: Erdős Problem 103 + +## 1. Code Reuse + +**Several definitions in `103.lean` overlap with or could benefit from existing codebase definitions.** + +- **`IsUnitSeparated`** (lines 34–35): Requires all pairwise distances ≥ 1. This is closely related to `HasMinDist1` in `99.lean:33–35`, which additionally requires the minimum distance to be achieved (i.e., some pair is at distance exactly 1). Problem 99 deals with the same class of objects — minimal-diameter configurations among unit-separated $n$-point sets. The weaker `IsUnitSeparated` used here is arguably more faithful to the problem statement, but the relationship should be noted. Similar constraints appear in `1066.lean:54–56` (using `Fin n → EuclideanSpace` instead of `Finset`). + +- **`finiteDiameter`** (lines 40–41): Custom definition computing `sSup` of all pairwise distances. Problem 99 (`99.lean:47`) and Problem 670 (`670.lean:64`) instead use Mathlib's `Metric.diam` (aliased as `diam`), which is the standard library function for diameter. Using `Metric.diam` would be preferable for two reasons: (1) it avoids maintaining a custom definition that must be shown equivalent; (2) it provides access to the library of existing lemmas about `diam` (monotonicity, boundedness, etc.). For a `Finset` coerced to `Set`, `Metric.diam` computes the same value as `finiteDiameter` (since finite sets are bounded), but the equivalence would need to be proved. **Recommendation:** Replace `finiteDiameter` with `Metric.diam` applied to the coerced set, following the pattern in `99.lean`. + +- **`AreCongruent`** (lines 58–60): Uses `IsometryEquiv (≃ᵢ)` — an isometric *equivalence* of the entire ambient space mapping one set to the other. Problem 668 (`668.lean:53–57`) uses a weaker formulation: an `Isometry` (distance-preserving function, not necessarily bijective) whose image of one set equals the other. In $\mathbb{R}^2$, any surjective isometry is an isometric equivalence (by the Mazur–Ulam theorem), and any isometry of $\mathbb{R}^n$ is automatically an affine isometry and hence surjective, so these definitions are mathematically equivalent. However, the `IsometryEquiv` formulation in 103 is arguably cleaner since it makes bijectivity explicit. Both approaches are valid; the codebase would benefit from standardizing on one. + +- **`IsMinimalDiameter`** (lines 48–51): Custom minimality predicate. Problem 99 (`99.lean:47`) uses Mathlib's `IsMinOn` applied to the diameter function over the set of valid configurations. Using `IsMinOn` would be more idiomatic and provide access to existing order-theoretic lemmas. **Recommendation:** Consider using `IsMinOn (fun B => Metric.diam (B : Set _)) {B | B.card = n ∧ IsUnitSeparated B} A`. + +- **`h` (counting function)** (lines 67–71): Counts congruence classes using `Set.ncard` over a set of equivalence classes constructed via set intersection. Problem 668 (`668.lean:70–76`) takes an entirely different approach: it quantifies over `Fin M → Finset ...` (an $M$-tuple of pairwise non-congruent maximizers). The approach in 668 avoids constructing equivalence classes explicitly and is arguably easier to work with in proofs. See Section 6 for correctness concerns with the quotient construction in 103. + +**Summary:** The file defines four custom predicates/functions where existing Mathlib or codebase definitions could be reused. The closest structural analog is Problem 668 (counting incongruent optimizers). + +## 2. Citations + +The formalization includes only a link to [erdosproblems.com/103](https://www.erdosproblems.com/103). The website provides: + +**References:** +- **[Er94b]** Erdős, Paul, *Some problems in number theory, combinatorics and combinatorial geometry*. Math. Pannon. (1994), 261–269. + +This is the same reference cited by Problem 99, which deals with the closely related question of whether minimal-diameter unit-separated configurations must contain equilateral triangles. + +**Related problems:** +- **Problem #99** — explicitly listed as related on the website. Both problems concern minimal-diameter configurations among $n$-point sets with minimum distance 1. Problem 99 asks about structural properties (equilateral triangles) while 103 asks about the number of incongruent minimizers. + +**Additional metadata from the website:** +- Status: **Open** +- Tags: geometry, distances +- The website notes this problem "cannot be resolved with finite computation" + +**Recommendation:** The docstring should cite [Er94b] with full bibliographic data (as done in `99.lean:25`) and mention the relationship to Problem 99. The docstring already includes the remark about $h(n) \geq 2$ being unknown, which matches the website. + +## 3. Variants + +The formalization captures the main conjecture ($h(n) \to \infty$) and mentions in the docstring that $h(n) \geq 2$ for all sufficiently large $n$ is unknown. + +**Missing variants:** +- **$h(n) \geq 2$ for large $n$:** The website and docstring both mention this weaker open question. It would be natural to formalize this as a separate statement, analogous to how Problem 668 splits into `erdos_668` (tends to infinity) and `erdos_668.variants.part2` (at least 2 for $n > 3$). A companion statement like: + ``` + theorem erdos_103.variants.at_least_two : + answer(sorry) ↔ ∀ᶠ n in Filter.atTop, h n ≥ 2 := by sorry + ``` + would capture this. + +- **Connection to Problem 99:** Both problems study the same class of objects (minimal-diameter unit-separated configurations). The connection could be formalized or at least noted: if one could show the minimizers always contain equilateral triangles (Problem 99), that structural constraint might help enumerate incongruent configurations (Problem 103). + +**Assessment:** The core conjecture is captured. The omission of the $h(n) \geq 2$ variant is notable given that it is explicitly mentioned in both the docstring and the website as a separately interesting open question. + +## 4. Readability + +The code is generally well-structured: + +- **Good:** Each definition has a clear, informative docstring. +- **Good:** The namespace `Erdos103` prevents collisions. +- **Good:** The decomposition into `IsUnitSeparated`, `finiteDiameter`, `IsMinimalDiameter`, `AreCongruent`, and `h` provides a logical progression from primitive concepts to the final counting function. +- **Concern:** The definition of `h(n)` (lines 67–71) is the most complex part and is somewhat hard to parse. It constructs congruence classes as `minimizers ∩ {B | AreCongruent A B}` and then counts the set of such classes. This indirect quotient construction requires the reader to verify that it correctly partitions the minimizers. The approach in 668.lean (existential quantification over an $M$-tuple of pairwise non-congruent sets) is arguably more transparent. +- **Minor:** The type `EuclideanSpace ℝ (Fin 2)` is used throughout instead of the alias `ℝ²` used in `99.lean`. The latter is more concise. However, `EuclideanSpace ℝ (Fin 2)` is explicit and matches the convention in 668.lean, so this is a stylistic choice. +- **Minor:** The theorem statement on line 82 uses `∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, n ≥ N → h n ≥ M`, which is a correct $\varepsilon$-$N$ formulation of $h(n) \to \infty$. An alternative would be `Filter.Tendsto h Filter.atTop Filter.atTop`, which is the Mathlib-idiomatic way to state divergence to infinity. Either is acceptable. + +## 5. Formalizability + +**Assessment: Formalizable with moderate ambiguity in the counting mechanism.** + +The underlying geometric problem is precise and well-defined: +- "All pairwise distances ≥ 1" is unambiguous. +- "Minimize the diameter" is unambiguous given the constraint. +- "Incongruent" (up to rigid motions of $\mathbb{R}^2$) is standard. + +The main source of subtlety is in *how* one counts incongruent configurations: +- The informal statement asks for $h(n)$, the number of incongruent minimizers. This requires forming the quotient of the set of minimizers by the congruence relation. For finite quotients this is straightforward, but the set of minimizers is *a priori* uncountable (any rotation/translation of a minimizer is again a minimizer), so one is really counting equivalence classes of an equivalence relation on an uncountable set. +- The formalization handles this via the `Set.ncard` of the set of equivalence classes. This is well-defined but requires care: `Set.ncard` returns 0 for infinite sets, so if the number of congruence classes is infinite, `h(n)` would be 0 rather than infinity. For the conjecture as stated (asserting $h(n) \geq M$ for all $M$), this would make the conjecture trivially false if there are infinitely many congruence classes. In practice, for any fixed $n$, the number of congruence classes of minimal-diameter configurations is expected to be finite (and this is likely provable), so this is unlikely to cause issues — but it is a technical gap. + +**Verdict:** The problem is clearly formalizable. The counting mechanism introduces a minor technical subtlety around finiteness that should ideally be addressed (see Section 6). + +## 6. Correctness + +**The formalization has a potential correctness issue in the definition of `h(n)` and a definitional divergence from Problem 99.** + +### 6a. Definition of `h(n)` — Equivalence class construction + +The definition (lines 67–71): +```lean +noncomputable def h (n : ℕ) : ℕ := + let minimizers : Set (Finset (EuclideanSpace ℝ (Fin 2))) := + {A | A.card = n ∧ IsMinimalDiameter A} + Set.ncard {C : Set (Finset (EuclideanSpace ℝ (Fin 2))) | + ∃ A ∈ minimizers, C = minimizers ∩ {B | AreCongruent A B}} +``` + +This counts the number of distinct sets of the form `minimizers ∩ {B | AreCongruent A B}` as `A` ranges over minimizers. For this to correctly count congruence classes, `AreCongruent` must be an equivalence relation on `minimizers`. Let's verify: + +- **Reflexivity:** The identity isometry witnesses `AreCongruent A A`. ✓ +- **Symmetry:** If `f : E ≃ᵢ E` maps `A` to `B`, then `f⁻¹` maps `B` to `A`. ✓ (since `IsometryEquiv` is invertible) +- **Transitivity:** Composition of isometric equivalences. ✓ + +So `AreCongruent` is indeed an equivalence relation, and the construction correctly produces the set of equivalence classes. **This part is correct.** + +However, there is a subtlety: if `minimizers` is empty (e.g., $n = 0$ or $n = 1$ where there are no "interesting" configurations), the counted set is empty, giving `h(n) = 0`. For $n \geq 1$, any single point trivially satisfies the constraints, and all single-point sets are congruent, so `h(1) = 1`. For $n = 0$, the empty set is the unique minimizer, so `h(0) = 1`. This seems fine. + +**A more serious concern:** `Set.ncard` returns 0 for infinite sets. If somehow there were infinitely many congruence classes (which would mean $h(n) = \infty$ informally), the formalization would give `h(n) = 0`, making the conjecture false for the wrong reason. As noted in Section 5, finiteness of congruence classes is expected but not proven in the formalization. The approach used in Problem 668 — existentially quantifying over $M$ pairwise non-congruent configurations — avoids this issue entirely and would be more robust. + +**Recommendation:** Consider reformulating the theorem statement directly, without the intermediate `h` function, using the pattern from `668.lean`: +```lean +theorem erdos_103 : + answer(sorry) ↔ + ∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ (As : Fin M → Finset (EuclideanSpace ℝ (Fin 2))), + (∀ i, (As i).card = n ∧ IsMinimalDiameter (As i)) ∧ + (∀ i j, i ≠ j → ¬AreCongruent (As i) (As j)) +``` + +### 6b. `finiteDiameter` vs. `Metric.diam` + +The custom `finiteDiameter` (line 40–41) computes `sSup {d : ℝ | ∃ p ∈ A, ∃ q ∈ A, d = dist p q}`. Note that this set always contains 0 (taking `p = q`), so for a singleton set, `finiteDiameter` = 0, which matches `Metric.diam`. For the empty set, the set `{d | ...}` is empty, and `sSup ∅ = 0` in `ℝ` (via `csSup_empty`), which again matches `Metric.diam`. For non-empty finite sets, the set of pairwise distances is finite and bounded, so `sSup` returns the maximum. **This is correct and agrees with `Metric.diam`** on `Finset`s coerced to `Set`. + +### 6c. `IsUnitSeparated` vs. `HasMinDist1` + +Problem 103's `IsUnitSeparated` requires only that pairwise distances are ≥ 1. Problem 99's `HasMinDist1` additionally requires that some pair achieves distance exactly 1. For the purpose of *minimizing diameter*, any optimal configuration with $n \geq 2$ will necessarily have some pair at distance exactly 1 (otherwise the configuration could be scaled down). So for the minimizers, the two conditions are equivalent when $n \geq 2$. For $n \leq 1$, the distinction doesn't matter. **The weaker `IsUnitSeparated` is correct** for this problem. + +### 6d. Congruence definition + +The use of `IsometryEquiv` (a bijective isometry of the ambient space) is mathematically correct for "congruence" in $\mathbb{R}^2$. By the Mazur–Ulam theorem, every surjective isometry of a real normed space is affine, and every isometry of $\mathbb{R}^n$ is surjective. So the `IsometryEquiv` formulation captures exactly the rigid motions (rotations, reflections, translations). **Correct.** + +Note: This definition includes reflections (orientation-reversing isometries). The problem statement says "incongruent" without specifying orientation, so including reflections is the standard interpretation. If the problem intended "incongruent up to orientation-preserving rigid motions only," the count could be different. This is a minor ambiguity in the original problem, not a flaw in the formalization. + +### 6e. Theorem structure + +The `answer(sorry) ↔ ...` pattern is appropriate for an open yes/no question. **Correct.** + +**Verdict:** The formalization is mathematically correct in its individual definitions. The main concern is the `Set.ncard`-based counting of congruence classes in `h(n)`, which silently returns 0 for infinite sets. This is unlikely to cause practical issues but represents a technical gap compared to the more robust existential formulation used in the structurally identical Problem 668. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `finiteDiameter` should use `Metric.diam`; `IsMinimalDiameter` could use `IsMinOn`; `AreCongruent` duplicates 668.lean's definition; consider shared utility | +| Citations | Needs improvement | Missing [Er94b] full bibliographic data and relationship to Problem 99 | +| Variants | Acceptable | Core conjecture captured; $h(n) \geq 2$ variant mentioned in docstring but not formalized (cf. 668's `part2`) | +| Readability | Good | Clear definitions and docstrings; `h(n)` quotient construction is dense but correct; could use `Filter.Tendsto` idiom | +| Formalizability | Good | Precise problem; minor subtlety around finiteness of congruence classes | +| Correctness | Correct (with caveat) | All definitions are mathematically sound; `Set.ncard` returns 0 for infinite sets, creating a theoretical gap; the existential formulation from 668.lean would be more robust | diff --git a/ai-review/1030.md b/ai-review/1030.md new file mode 100644 index 0000000000..04ec65d95c --- /dev/null +++ b/ai-review/1030.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 1030 + +## 1. Code Reuse + +The `ramseyR` definition in `Erdos1030.ramseyR` is duplicated verbatim from `Erdos1014.ramseyR` (and also appears in Problem 986). Both define: + +```lean +noncomputable def ramseyR (k l : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree l} +``` + +This definition should be factored into a shared location. There is already `Combinatorics.hypergraphRamsey` in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`, but that defines the *r-uniform hypergraph* Ramsey number, which is a different (more general) concept. The classical 2-color graph Ramsey number R(k,l) used here is the special case r=2, but the hypergraph definition uses a different formulation (coloring of r-subsets of a set) rather than the graph-theoretic formulation (cliques and independent sets in simple graphs). A shared definition for the classical R(k,l) in `FormalConjecturesForMathlib` would eliminate duplication across Problems 1014, 1030, and 986 (at minimum). + +## 2. Citations + +The formalization cites: + +> [Er93] Erdős, P., *On some of my favourite theorems* (1993), p. 339. + +The website (erdosproblems.com/1030) attributes the problem to **Erdős and Sós** and cites the same reference [Er93]. The docstring correctly mentions "A problem of Erdős and Sós" in the prose, and the page reference (p. 339) matches. + +**Missing from the formalization:** +- The website credits the partial result R(k+1,k) − R(k,k) ≥ 2k−5 to **Burr, Erdős, Faudree, and Schelp (1989)**. This is not mentioned in the docstring. +- The website links to related problems **544** (concerning R(3,k)) and **1014** (general off-diagonal case). These cross-references are absent from the docstring. +- The website references OEIS sequences **A000791** and **A059442**. + +## 3. Variants + +The website describes a **weaker open question** also posed by Erdős and Sós: whether R(k+1,k) − R(k,k) > k^c for any c > 1. The docstring mentions this in prose but does **not** formalize it as a separate theorem. Given that this is an explicitly stated open sub-problem on the website, it would be valuable to include it: + +```lean +/-- Weaker variant: there exists c > 1 such that R(k+1,k) − R(k,k) > k^c for large k. -/ +theorem erdos_1030_weak : + ∃ c : ℝ, c > 1 ∧ ∃ K₀ : ℕ, ∀ k : ℕ, k ≥ K₀ → + (ramseyR (k + 1) k : ℝ) - (ramseyR k k : ℝ) > (k : ℝ) ^ c := by + sorry +``` + +The known result of Burr–Erdős–Faudree–Schelp (R(k+1,k) − R(k,k) ≥ 2k − 5) could also be formalized as a separate (provable) lemma. + +## 4. Readability + +The code is clean and well-structured. The docstring clearly states both the original limit formulation and the "eventually ≥" interpretation used in the formalization. Minor suggestions: + +- The docstring could explicitly note the equivalence between the limit formulation and the "eventually ≥" formulation (it currently just says "Formulated as" without justification). +- Cross-references to related Problems 1014 and 544 would help readers navigate the codebase. + +## 5. Formalizability + +**Assessment: Low ambiguity, clearly formalizable.** + +The original problem states: "prove the existence of some c > 0 such that lim_{k→∞} R(k+1,k)/R(k,k) > 1+c." There is a minor ambiguity: does the limit need to *exist*, or is the statement about the *liminf*? + +The formalization interprets the statement as: ∃ c > 0, ∃ K₀, ∀ k ≥ K₀, R(k+1,k)/R(k,k) ≥ 1+c. This is equivalent to asserting liminf ≥ 1+c, which is: +- **Implied by** the limit existing and being > 1+c (so the formalization is weaker in that it doesn't assert the limit exists). +- **Stronger than** just liminf > 1 (it gives a uniform lower bound). + +This is the standard and most natural interpretation of the problem. If the limit were known to exist, the two formulations would be equivalent (modulo an epsilon adjustment for ≥ vs >). The use of ≥ rather than > in the conclusion is also fine since ∃ c > 0 absorbs the difference. The formalization is appropriate. + +## 6. Correctness + +**The formalization is mathematically correct**, with the following observations: + +**(a) Definition of `ramseyR`:** The definition via `sInf` is correct. For k, l ≥ 1, the set is nonempty by Ramsey's theorem, so `sInf` returns the true minimum. For degenerate cases (k = 0 or l = 0), `CliqueFree 0` is always false in Mathlib (the empty set is always a 0-clique), so `¬G.CliqueFree 0` is always true, giving `ramseyR 0 l = 0` and `ramseyR k 0 = 0`. This matches the convention R(0,l) = R(k,0) = 0. + +**(b) Division by zero:** When `ramseyR k k = 0` (which occurs for k = 0), the ratio `(ramseyR (k+1) k : ℝ) / (ramseyR k k : ℝ)` would involve division by zero (which in Lean/Mathlib evaluates to 0 for reals). This is not a real issue because the ∃ K₀ quantifier allows avoiding small k, but it is worth noting that the statement is vacuously satisfiable for small k only because of the threshold K₀. + +**(c) Faithfulness to the original:** The formalization correctly captures the essential mathematical content. An experienced mathematician would recognize this as a standard and faithful encoding. The only potential quibble is that the original uses "lim" (implying existence) while the formalization uses an "eventually ≥" condition (which only requires liminf ≥ 1+c), but as discussed in Section 5, this is the conventional interpretation and is mathematically sound. + +**(d) Completeness:** The main conjecture is formalized. The weaker sub-problem (difference > k^c) mentioned on the website is described in the docstring but not formalized as a separate statement. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | `ramseyR` duplicated across 1014, 1030, 986; should be shared | +| Citations | Core reference correct; missing Burr–Erdős–Faudree–Schelp (1989) and cross-references to 544, 1014 | +| Variants | Weaker sub-problem (difference > k^c) mentioned but not formalized | +| Readability | Good; minor improvements possible with cross-references | +| Formalizability | Low ambiguity; straightforward | +| Correctness | Correct and faithful to the original problem | diff --git a/ai-review/1031.md b/ai-review/1031.md new file mode 100644 index 0000000000..6f7c4adfd1 --- /dev/null +++ b/ai-review/1031.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1031 + +## 1. Code Reuse + +Problem 82 (`FormalConjectures/ErdosProblems/82.lean`) defines `IsRegularInduced`, which captures exactly the notion of a regular induced subgraph: + +```lean +def IsRegularInduced {G : SimpleGraph V} (S : Subgraph G) : Prop := + S.IsInduced ∧ ∃ k, (S.coe).IsRegularOfDegree k +``` + +Problem 1031 manually encodes regularity via: + +```lean +∀ v ∈ S, (S.filter (G.Adj v)).card = d +``` + +While the manual encoding is correct, the formalization could potentially benefit from using Mathlib's `SimpleGraph.IsRegularOfDegree` or reusing Problem 82's `IsRegularInduced` for consistency across the codebase. The current approach using `Finset` and explicit degree counting is slightly less idiomatic than working with `Subgraph` and `IsRegularOfDegree`, but has the advantage of being self-contained and avoiding the overhead of constructing a `Subgraph` object. + +**Shared utilities**: `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` provides independence number machinery, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean` defines `IsBalanced` for near-regular graphs. Neither is directly reusable here but are related in spirit. + +## 2. Citations + +The formalization's docstring contains: + +- **[Er93]**: `Erdős, P., On some of my favourite theorems. Combinatorics, Paul Erdős is eighty, Vol. 2 (Keszthely, 1993), 97-132.` +- **[PrRo99]**: `Prömel, H.J. and Rödl, V., Non-canonical Ramsey-type theorems. To appear.` + +The website ([erdosproblems.com/1031](https://www.erdosproblems.com/1031)) confirms: +- Source: [Er93, p.340] — a question of Erdős, Fajtlowicz, and Staton. ✅ +- Resolution by Prömel and Rödl [PrRo99]. ✅ +- Status: **PROVED**. ✅ (matches `@[category research solved, AMS 5]`) + +**Minor note**: The [PrRo99] citation says "To appear" which reflects what [Er93] said at the time of writing (1993). The paper has since been published. This is acceptable since it matches the original source's citation style, but updating the citation to the published version would be more informative. + +## 3. Variants + +The docstring mentions the stronger Prömel–Rödl result: + +> "for any $c > 0$, if $G$ contains no trivial subgraph on $\geq c \log n$ vertices then $G$ contains all graphs with $O_c(\log n)$ vertices as induced subgraphs." + +This stronger result is **not formalized** as a separate theorem or variant. It could be added as `erdos_1031.variants.promel_rodl_stronger`, stating that under the same hypothesis, every graph on $O(\log n)$ vertices appears as an induced subgraph. + +The website also references **Problem 82** (how large an induced regular subgraph must a general graph contain), which is formalized separately. No cross-reference is present in the 1031 file. + +## 4. Readability + +The formalization is reasonably readable. A few observations: + +- The non-triviality conditions `d ≥ 1` (not empty) and `d + 1 < S.card` (not complete) are correct but could benefit from a brief inline comment explaining that they encode "neither empty nor complete." +- The use of `∀ _ : DecidableRel G.Adj` as a hypothesis is a standard Lean idiom for ensuring decidability; this is fine. +- Using `⌈10 * Real.log (↑n)⌉₊` is clear and correctly handles the integer ceiling of a real-valued threshold. + +## 5. Formalizability + +The problem is **clearly formalizable** with low ambiguity. + +- The constant 10 in "10 log n" is explicitly given. The problem works for any constant, so the specific value is not critical. +- The log base is unspecified on the website. The formalization uses `Real.log` (natural logarithm). Since the problem involves asymptotic statements where the base only affects constants, and the existentially quantified constant `c` absorbs any base change, this is a valid and standard choice. **Ambiguity: minimal.** +- "Trivial subgraph" (empty or complete) is well-defined. The formalization correctly splits this into: no clique of the given size (`G.CliqueFree`) and no independent set of the given size (`Gᶜ.CliqueFree`). +- "Induced regular subgraph" is standard graph-theoretic terminology with a precise meaning. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Hypotheses (clique-free and independence-free conditions):** +- `G.CliqueFree ⌈10 * Real.log (↑n)⌉₊` means G has no clique of size `⌈10 log n⌉₊`. Since `CliqueFree k` implies `CliqueFree m` for all `m ≥ k`, this means no clique of size ≥ `⌈10 log n⌉₊`. Because clique sizes are integers and `⌈10 log n⌉₊` is the smallest integer ≥ 10 log n (for positive values), this correctly encodes "no clique of size ≥ 10 log n." ✅ +- `Gᶜ.CliqueFree ⌈10 * Real.log (↑n)⌉₊` correctly encodes "no independent set of size ≥ 10 log n" via the complement. ✅ + +**Conclusion (existence of non-trivial regular induced subgraph):** +- `(S.card : ℝ) ≥ c * Real.log (↑n)` requires the subgraph to have ≥ c log n vertices. ✅ +- `∀ v ∈ S, (S.filter (G.Adj v)).card = d` counts the neighbors of v within S using G's adjacency. Since `G.Adj v v = False` (SimpleGraph is irreflexive), vertex v is never counted among its own neighbors. This correctly computes the degree of v in the induced subgraph on S. ✅ +- `d ≥ 1`: excludes the empty graph (degree 0). ✅ +- `d + 1 < S.card`: since in a complete graph on |S| vertices each vertex has degree |S| − 1, requiring d + 1 < |S| (equivalently d < |S| − 1) correctly excludes the complete graph. ✅ + +**Overall structure:** +- The existential `∃ c : ℝ, c > 0` and `∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ →` correctly captures "for some absolute constant c > 0, for all sufficiently large n." ✅ +- The use of `Fin n` for the vertex type and `Finset (Fin n)` for the subgraph vertex set is appropriate. ✅ + +**No correctness issues found.** The formalization faithfully captures the mathematical content of Erdős Problem 1031. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Could use `IsRegularOfDegree` or Problem 82's `IsRegularInduced`; current approach is correct but less idiomatic | +| Citations | Accurate; [PrRo99] "To appear" reflects original source style | +| Variants | Stronger Prömel–Rödl universality result mentioned but not formalized | +| Readability | Good; minor comment improvements possible | +| Formalizability | High; minimal ambiguity | +| Correctness | ✅ Correct and complete | diff --git a/ai-review/1032.md b/ai-review/1032.md new file mode 100644 index 0000000000..f82abf5cc3 --- /dev/null +++ b/ai-review/1032.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 1032 + +## 1. Code Reuse + +**Duplicated `IsCritical` definition.** The local `Erdos1032.IsCritical` (edge-critical: χ(G) = k and deleting any single edge reduces chromatic number) is defined identically in `Erdos917.IsCritical` at `FormalConjectures/ErdosProblems/917.lean:54–56`. These two definitions are character-for-character identical and should be factored into a shared location. + +**Library definitions are related but distinct.** `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides: +- `SimpleGraph.IsCritical` (line 96) — this is **vertex-critical** (χ(G) = k and deleting any vertex reduces χ), which is a strictly weaker condition than edge-criticality. It is **not** a substitute for the definition used here. +- `SimpleGraph.IsCriticalEdge` (line 77) — tests whether deleting a single edge reduces chromatic number, i.e. `(G.deleteEdges {e}).chromaticNumber < G.chromaticNumber`. + +The local definition could be rewritten using the library's `IsCriticalEdge`: +```lean +def IsCritical {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + G.chromaticNumber = (k : ℕ∞) ∧ ∀ e ∈ G.edgeSet, G.IsCriticalEdge e +``` +This is semantically identical (since `G.chromaticNumber = k` makes `< k` equivalent to `< G.chromaticNumber`), and would reduce duplication and improve discoverability. Ideally, an `IsEdgeCritical` bundled definition should be added to the library and shared between problems 917 and 1032. + +**Recommendation:** Extract the shared edge-critical definition into the library (or at minimum a shared utility file) and have both 917 and 1032 import it. + +## 2. Citations + +The formalization includes: +- [Er93] — ✓ Matches website +- [Si72] — ✓ Matches website +- [To72] — ✓ Matches website + +**Missing:** The website lists **[Va99, 3.60]** as an additional reference. This likely refers to a 1999 survey or problem collection. The formalization omits this citation entirely. + +**Citation format:** The docstring uses shorthand references (e.g., `[Er93]`, `[Si72]`) without full bibliographic details (journal names, page ranges, etc.). The website provides `[Er93, p.341]` with the page number — the formalization includes this page number, which is good. However, `[Si72]` and `[To72]` lack full publication details (only `Simonovits, M., 1972` and `Toft, B., 1972` — no titles or journals). These should be fleshed out if discoverable. + +## 3. Variants + +The docstring notes: *"This problem is also open for 5-chromatic critical graphs."* This variant is **not formalized** as a separate theorem. A natural companion statement would be: + +```lean +@[category research open, AMS 5] +theorem erdos_1032.variants.five_chromatic : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀ ∧ + ∃ (G : SimpleGraph (Fin n)) (_ : DecidableRel G.Adj), + IsCritical G 5 ∧ (G.minDegree : ℝ) ≥ c * (n : ℝ) := by + sorry +``` + +The website also mentions **Toft's conjecture** that a 4-chromatic critical graph on n vertices has at least (5/3 + o(1))n edges, with examples showing optimality. This is a related but distinct conjecture not captured in the formalization. + +**Dirac's example** (6-chromatic critical graph with minimum degree > n/2) is mentioned in the docstring, which is appropriate as context rather than a formalized result. + +## 4. Readability + +The formalization is clean and readable. Specific observations: + +- The local `IsCritical` definition has a clear docstring explaining the concept. ✓ +- The theorem statement is well-structured and mirrors the natural language formulation. ✓ +- The `open SimpleGraph` and namespace structure are appropriate. ✓ +- The `DecidableRel G.Adj` binder is a necessary Lean technicality for `minDegree` to compute; it does not affect mathematical content. This could benefit from a brief inline comment for non-expert readers, but is not strictly necessary. + +**Minor:** The docstring says `minimum degree at least $c \cdot n$` while the website says `minimum degree ≫ n`. These are equivalent phrasings (the formalization correctly interprets `≫ n` as `≥ c·n` for some fixed c > 0). + +## 5. Formalizability + +**Assessment: Unambiguous and cleanly formalizable.** + +The problem statement is precise: +- "4-chromatic critical" has a standard, well-established definition in graph theory (edge-critical). ✓ +- "arbitrarily large n" is a standard quantifier pattern. ✓ +- "minimum degree ≫ n" (i.e., linear minimum degree) is standard asymptotic notation with a clear formal interpretation. ✓ + +There is **no meaningful ambiguity** in this problem. The only potential subtlety is the distinction between edge-critical and vertex-critical graphs, but edge-criticality is the standard meaning of "k-critical" in the graph theory literature (particularly in the Erdős tradition), and the formalization correctly uses this definition. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** + +Detailed verification: + +| Aspect | Problem Statement | Formalization | Correct? | +|--------|-------------------|---------------|----------| +| 4-chromatic critical | χ(G) = 4, deleting any edge reduces χ | `IsCritical G 4` with edge-deletion definition | ✓ | +| n vertices | graph on n vertices | `SimpleGraph (Fin n)` | ✓ | +| arbitrarily large n | for arbitrarily large n | `∀ N₀ : ℕ, ∃ n : ℕ, n ≥ N₀` | ✓ | +| minimum degree ≫ n | linear minimum degree | `(G.minDegree : ℝ) ≥ c * (n : ℝ)` | ✓ | +| ∃ constant c > 0 | existence of positive constant | `∃ c : ℝ, c > 0` | ✓ | +| open problem | unknown answer | `answer(sorry)` | ✓ | + +**Quantifier order is correct.** The statement says: there exists c > 0 such that for arbitrarily large n, there exists a suitable graph. This matches the intended reading — a single constant c works for infinitely many values of n. + +**Note on "arbitrarily large" vs "all sufficiently large":** The formalization uses `∀ N₀, ∃ n ≥ N₀` (arbitrarily large), which is weaker than `∃ N₀, ∀ n ≥ N₀` (all sufficiently large). This matches the problem statement on the website, which asks for "arbitrarily large n". + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|----------|------------| +| Code reuse | `IsCritical` duplicated with Problem 917; could use library's `IsCriticalEdge` | +| Citations | Missing [Va99, 3.60]; [Si72] and [To72] lack full bibliographic details | +| Variants | 5-chromatic variant mentioned but not formalized; Toft's conjecture not captured | +| Readability | Clean and clear | +| Formalizability | Unambiguous, straightforward to formalize | +| Correctness | Correct and complete | diff --git a/ai-review/1033.md b/ai-review/1033.md new file mode 100644 index 0000000000..6c608604b7 --- /dev/null +++ b/ai-review/1033.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 1033 + +## 1. Code Reuse + +**No significant reuse opportunities.** The formalization is self-contained, using only standard Mathlib definitions (`SimpleGraph`, `Adj`, `edgeFinset`, `degree`, `Real.sqrt`). A search of the codebase reveals no existing definitions for degree-sum conditions on triangles, Turán-threshold graphs, or similar constructs that could be repurposed. + +The `FormalConjecturesForMathlib` library provides graph coloring utilities (`Combinatorics/SimpleGraph/Coloring.lean`) and Ramsey-related definitions (`Combinatorics/Ramsey.lean`), but neither is relevant to this problem's specific focus on degree sums within triangles above the Mantel threshold. + +**Note on `DecidableRel G.Adj`:** The formalization uses `G.edgeFinset.card` and `G.degree`, both of which require a `DecidableRel G.Adj` instance. This is resolved implicitly via classical logic (Mathlib provides `Classical.dec`). However, several other graph theory problems in the codebase (e.g., Problems 65, 146, 182) explicitly bind `DecidableRel G.Adj` in the theorem statement. While not a correctness issue, adopting the explicit pattern would improve consistency: +```lean +∀ G : SimpleGraph (Fin n), ∀ [DecidableRel G.Adj], +``` + +## 2. Citations + +The docstring includes three references: + +| Ref | Docstring | Website | Assessment | +|-----|-----------|---------|------------| +| [Er93] | Erdős, P., _On some of my favourite theorems_ (1993) | [Er93, p.344] | ✓ Page number matches. Title included, which is good. Missing journal/publication venue. | +| [ErLa85] | Erdős, P. and Laskar, R. | [ErLa85] | ⚠ Missing title, journal, and full publication details. Only author names provided. | +| [Fa88] | Fan, G. (1988) | [Fa88] | ⚠ Missing title and journal. Only author initial and year. | + +**Recommendation:** Flesh out [ErLa85] and [Fa88] with full bibliographic details. The Erdős-Laskar paper is likely: Erdős, P. and Laskar, R., *On the degree of vertices in a maximal independent set*, J. Combin. Theory Ser. B 39 (1985) — though this should be verified. Fan's result is from: Fan, G., *On triangle degree sum*, (1988). + +No additional references appear on the website beyond these three. + +## 3. Variants + +The formalization captures only the specific conjecture: h(n) ≥ (2(√3−1) − o(1))n. The broader question "Estimate h(n)" from the problem statement is inherently vague and not directly formalizable. + +**Known results not formalized as separate theorems:** +- **Erdős-Laskar upper bound** (proved): h(n) ≤ 2(√3−1)n. This is the matching upper bound showing the conjecture, if true, would be tight. Could be stated as a separate proved theorem. +- **Erdős-Laskar lower bound** (proved): h(n) ≥ (1+c)n for some c > 0. This is a weaker version of the conjecture. +- **Fan's improvement** (proved): h(n) ≥ (21/16)n = 1.3125n. Note that 2(√3−1) ≈ 1.464, so there remains a gap between Fan's bound and the conjectured value. + +Formalizing at least the Erdős-Laskar upper bound would add valuable context, since it establishes the tightness of the conjectured threshold. + +## 4. Readability + +The formalization is clean and well-structured. Specific observations: + +- **Docstring quality:** The mathematical context is well-presented with LaTeX notation, and known bounds are summarized clearly. ✓ +- **Quantifier structure:** The ε-N₀ formulation of the o(1) term is natural and readable. ✓ +- **Triangle encoding:** `G.Adj u v ∧ G.Adj v w ∧ G.Adj u w` is a clear and direct encoding. Distinctness of u, v, w is automatically guaranteed by the `loopless` property of `SimpleGraph` (since `G.Adj x y` implies `x ≠ y`). ✓ +- **Namespace usage:** `Erdos1033` namespace and `open SimpleGraph Finset` are appropriate. ✓ + +**Minor suggestion:** A brief comment noting that `n ^ 2 / 4` is natural number division (matching the Mantel/Turán threshold ⌊n²/4⌋) could aid readability for those unfamiliar with Lean's division semantics, though this is not strictly necessary. + +## 5. Formalizability + +**Assessment: Unambiguous and cleanly formalizable.** + +The problem statement is mathematically precise: +- "Graph on n vertices with more than n²/4 edges" — standard, well-defined condition referencing the Mantel/Turán threshold. ✓ +- "Contains a triangle" — standard graph theory notion. ✓ +- "Degrees summing to at least h(n)" — the degree of a vertex in a simple graph is well-defined. ✓ +- "h(n) ≥ (2(√3−1) − o(1))n" — standard asymptotic notation with a canonical formal interpretation (the ε-N₀ formulation). ✓ + +There is **no meaningful ambiguity** in this problem. Every component has a standard, universally agreed-upon definition in graph theory. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +| Aspect | Problem Statement | Formalization | Correct? | +|--------|-------------------|---------------|----------| +| n vertices | graph on n vertices | `SimpleGraph (Fin n)` | ✓ | +| >n²/4 edges | more than n²/4 edges | `G.edgeFinset.card > n ^ 2 / 4` | ✓ | +| contains triangle | triangle exists | `∃ u v w, G.Adj u v ∧ G.Adj v w ∧ G.Adj u w` | ✓ | +| degree sum ≥ threshold | degrees summing to at least ... | `(G.degree u + G.degree v + G.degree w : ℝ) ≥ ...` | ✓ | +| (2(√3−1) − o(1))n | asymptotic lower bound | ε-N₀ formulation with `(2 * (Real.sqrt 3 - 1) - ε) * n` | ✓ | +| open problem | unknown answer | `answer(sorry)` | ✓ | + +**Edge count threshold — subtle correctness check:** The condition `G.edgeFinset.card > n ^ 2 / 4` uses natural number division. For even n, n²/4 is exact. For odd n, `n ^ 2 / 4 = ⌊n²/4⌋ = (n²−1)/4`. Since edge counts are integers, "|E| > n²/4" (over ℝ) is equivalent to "|E| > ⌊n²/4⌋" (over ℕ). So the natural number division is **correct** regardless of the parity of n. ✓ + +**Quantifier order:** `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G, ... → ∃ triangle ...` — This correctly expresses "for all sufficiently large n, every dense-enough graph has a high-degree-sum triangle," with the threshold approaching 2(√3−1)n. ✓ + +**Constant value:** 2(√3−1) ≈ 1.4641. The known bounds place h(n)/n between 21/16 = 1.3125 (Fan's lower bound) and 2(√3−1) ≈ 1.4641 (Erdős-Laskar upper bound). The conjecture asserts the upper bound is asymptotically tight. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|----------|------------| +| Code reuse | No reuse opportunities; minor consistency suggestion for `DecidableRel` | +| Citations | [Er93] adequate; [ErLa85] and [Fa88] lack full bibliographic details | +| Variants | Only the main conjecture is formalized; Erdős-Laskar upper bound and Fan's improvement could be added | +| Readability | Clean and well-structured | +| Formalizability | Unambiguous, straightforward to formalize | +| Correctness | Correct and complete | diff --git a/ai-review/1034.md b/ai-review/1034.md new file mode 100644 index 0000000000..9e782c2354 --- /dev/null +++ b/ai-review/1034.md @@ -0,0 +1,65 @@ +# AI Review: Erdős Problem 1034 + +## 1. Code Reuse + +No significant reuse opportunities identified. The problem is about triangles in dense graphs, not colorings or arithmetic progressions, so the extensive AP/Ramsey infrastructure in `FormalConjecturesForMathlib` is not applicable. The formalization correctly uses Mathlib's `SimpleGraph`, `edgeFinset`, and `Finset` APIs. The helper `adjToAtLeastTwoOfTriangle` is appropriately problem-specific. + +## 2. Citations + +**Current citation:** +> [Er93] Erdős, P., *On some of my favourite theorems* (1993), p. 344. + +**Website states:** The reference is `[Er93, p.344]`, consistent with the formalization. However, the website additionally attributes the conjecture to **Erdős and Faudree** jointly, and notes it is "a stronger version of Problem #905." The docstring should ideally mention Faudree as co-author of the conjecture. The Ma–Tang disproof is mentioned in the docstring, which is good, though no formal citation for their paper is given (the website also does not provide one beyond attributing the result to them). + +**Recommendation:** Add "Conjecture of Erdős and Faudree" and note the relationship to Problem 905. + +## 3. Variants + +The website describes several aspects not captured in the formalization: + +- **Relationship to Problem 905:** Problem 1034 is a strengthening of Problem 905 (every graph with >n²/4 edges has an edge in at least n/6 triangles). This context is not mentioned. +- **Refined bounds:** The combined results give a threshold in the range [(1/6 - o(1))n, (2 - √(5/2) + o(1))n]. Neither bound is formalized. +- **K₄-free variant:** Ma and Tang also showed the conjecture fails for K₄-free graphs, with the bound (2√3 - 3 + o(1))n ≈ 0.464n. This variant is not formalized. +- **Erdős's own commentary:** He noted the conjecture "is a bit too optimistic" and asked related questions about the exact threshold h(n). + +None of these variants are captured. For a complete formalization, at minimum the exact threshold question (what is the supremum of constants c such that every dense graph has a triangle with ≥ cn vertices adjacent to at least two of its members?) would be valuable. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The helper `adjToAtLeastTwoOfTriangle` has a clear docstring. The name is descriptive if a bit long; this is acceptable. +- The main theorem docstring is informative and includes the disproof result with the numerical bound. +- The `open Classical SimpleGraph Finset` is standard and appropriate. + +No significant readability issues. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The original problem uses "o(1)" asymptotic notation, which the formalization correctly converts to the standard ε-N₀ quantifier formulation: "for every ε > 0, there exists N₀ such that for all n ≥ N₀, ..." This is the canonical rigorous interpretation and introduces no ambiguity. + +The only minor subtlety is the meaning of "vertices adjacent to at least two of the triangle's vertices" — the formalization correctly interprets this via disjunction over all three pairs of triangle vertices. + +## 6. Correctness + +**Overall: Correct, with one subtlety worth noting.** + +### Edge count (correct) +`G.edgeFinset.card > n ^ 2 / 4` uses natural number division, so `n ^ 2 / 4 = ⌊n²/4⌋`. Since `edgeFinset.card` is a natural number, the condition `card > ⌊n²/4⌋` is equivalent to `card ≥ ⌊n²/4⌋ + 1`, which matches the real-valued condition `card > n²/4` (for integer card values). This is correct. + +### Answer direction (correct) +`answer(False) ↔ (conjecture)` encodes that the conjecture is false (disproved). Since the RHS is the conjecture and the answer is `False`, proving the biconditional amounts to showing the conjecture is false. This matches the known disproof by Ma and Tang. + +### adjToAtLeastTwoOfTriangle (correct) +The three disjuncts `(Adj x u ∧ Adj x v) ∨ (Adj x v ∧ Adj x w) ∨ (Adj x u ∧ Adj x w)` correctly enumerate all ways a vertex x can be adjacent to at least 2 of {u, v, w}. The filter ranges over all `Fin n` including the triangle vertices themselves, which is standard — each vertex of a triangle is adjacent to the other two (by the triangle condition), so u, v, w are counted. This affects at most 3 of the ~n/2 vertices and does not change the asymptotic statement. + +### Triangle condition (correct) +The conjunction `G.Adj u v ∧ G.Adj v w ∧ G.Adj u w` correctly asserts that {u, v, w} form a triangle. Note that `u`, `v`, `w` are not required to be distinct, but `SimpleGraph.Adj` is irreflexive, so `G.Adj u v` implies `u ≠ v`, and similarly for the other pairs. Thus distinctness is enforced implicitly. Correct. + +### Threshold comparison (correct) +`(adjToAtLeastTwoOfTriangle G u v w : ℝ) > (1 / 2 - ε) * (n : ℝ)` correctly casts to ℝ for the comparison. The `1 / 2` here is real division (since ε : ℝ forces the context), so this is genuinely 0.5, not integer division. Correct. + +### Summary +The formalization is mathematically correct and faithfully captures the stated conjecture. No flaws identified. The incompleteness (missing variants, refined bounds, K₄-free case) is not a correctness issue but a completeness one. diff --git a/ai-review/1035.md b/ai-review/1035.md new file mode 100644 index 0000000000..2c30aa0d77 --- /dev/null +++ b/ai-review/1035.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 1035 + +## 1. Code Reuse + +**`hypercubeGraph`**: This identical definition appears in at least 5 other problem files: 86, 181, 576, 578, 666. All define vertices as `Fin n → Bool` with adjacency when exactly one coordinate differs. This is a strong candidate for extraction to a shared utility (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/HypercubeGraph.lean`). + +**`ContainsSubgraph`**: This identical definition (injective graph homomorphism preserving adjacency) appears in 8+ other problem files (59, 87, 146, 147, 576, 714, 765, 1079, and others under variant names like `ContainsCopy`, `ContainsSubgraphCopy`). Another strong extraction candidate. + +**Degree computation**: The formalization manually computes degree as `(Finset.univ.filter (fun w => G.Adj v w)).card`. Many other problem files (134, 577, 618, 751, 800, 802, 904, 1033, 1078, 1079) use Mathlib's built-in `G.degree v` or `G.minDegree` instead. The manual computation is functionally equivalent but deviates from codebase conventions. + +## 2. Citations + +The module docstring cites: + +> [Er93] Erdős, P., *On some of my favourite theorems*. Combinatorics, Paul Erdős is eighty, Vol. 2 (Keszthely, 1993), Bolyai Soc. Math. Stud. 2, 97-132. + +The theorem docstring references `[Er93, p.345]`. + +**Issue**: The paper spans pages 97–132 of the Bolyai volume, so a reference to "p.345" is inconsistent with the stated page range. The erdosproblems.com website also cites `[Er93, p.345]`, so this discrepancy originates from the source. It is possible the page reference pertains to a different edition or volume, or is an error on the website. The formalization faithfully reproduces the website's citation, which is acceptable, but the inconsistency should be noted. + +The website tags the problem under **Graph theory** and lists it as **OPEN**. This matches the `category research open` attribute. + +## 3. Variants + +The erdosproblems.com page describes two additional problems Erdős proposed in case the main conjecture is false: + +1. **Vertex count variant**: Determine or estimate the smallest $m > 2^n$ such that every graph on $m$ vertices with minimum degree $> (1-c) \cdot 2^n$ contains $Q_n$. +2. **Degree threshold variant**: For which $u_n$ is it true that every graph on $2^n$ vertices with minimum degree $> 2^n - u_n$ contains $Q_n$? + +**Neither variant is captured by the formalization.** These are interesting related questions that could be added as separate theorems (e.g., `erdos_1035_variant_1`, `erdos_1035_variant_2`), though they may be considered distinct enough to not be required. + +The related Problem 576 (extremal number of edges guaranteeing $Q_n$) is also noted on the website but is already formalized separately. + +## 4. Readability + +**Good aspects**: +- Clear docstrings in both the module header and the theorem. +- The `hypercubeGraph` definition is well-documented and includes proofs of `symm` and `loopless`. +- The namespace `Erdos1035` keeps definitions scoped. + +**Suggestions**: +- Replace the manual degree computation `(Finset.univ.filter (fun w => G.Adj v w)).card` with Mathlib's `G.degree v`. This is more idiomatic and consistent with other problem files in the codebase. The cast to `ℝ` would become `(G.degree v : ℝ)`. +- Similarly, the entire minimum degree condition could potentially use `G.minDegree`, though the current per-vertex formulation with the cast to `ℝ` is mathematically equivalent and arguably more explicit. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: it asks for the existence of a constant $c > 0$ with a specific combinatorial property. All terms ($Q_n$, minimum degree, subgraph containment, $2^n$ vertices) have standard mathematical definitions that translate directly to Lean. + +The only mild ambiguity is whether the problem asks for the *existence* of such $c$ (a yes/no question) or for the *determination* of the optimal $c$. The formalization correctly treats it as a yes/no question using the `answer(sorry) ↔ ...` pattern, which matches the "Is there...?" phrasing. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **Vertex set**: `Fin (2^n)` correctly represents a set of $2^n$ vertices. + +- **Hypercube graph**: The definition via `Fin n → Bool` with adjacency at Hamming distance exactly 1 is the standard $Q_n$ construction. The `u ≠ v` guard correctly excludes self-loops. The symmetry and irreflexivity proofs are correct. + +- **Degree condition**: The condition `∀ v, degree(v) > (1 - c) * 2^n` correctly captures "minimum degree $> (1-c) \cdot 2^n$". The cast to `ℝ` is necessary because `c` is real-valued. + +- **Subgraph containment**: `ContainsSubgraph` requires an injective function preserving adjacency (a graph monomorphism). This is the correct notion — we want a copy of $Q_n$ sitting inside $G$, where the copy preserves edges but the ambient graph $G$ may have additional edges among the image vertices. This is standard. + +- **Bound on $c$**: The formalization does not explicitly require $c < 1$, but this is not a flaw. If $c \geq 1$, then $(1-c) \leq 0$ and the degree condition becomes trivially satisfied by all graphs, but since not all graphs on $2^n$ vertices contain $Q_n$ (e.g., the empty graph), the conclusion fails. Thus the existential naturally constrains any valid $c$ to the range $(0, 1)$. + +- **Edge cases**: For $n = 0$, $Q_0$ is a single isolated vertex and any graph on $2^0 = 1$ vertex trivially contains it (but the degree hypothesis is vacuously false for small $c$, so the implication holds). For $n = 1$, $Q_1$ is a single edge on 2 vertices, and the analysis is similarly consistent. + +- **`DecidableRel G.Adj`**: This instance is required to compute `Finset.filter` and would equally be needed for `G.degree`. This is standard Lean/Mathlib practice. + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `hypercubeGraph` and `ContainsSubgraph` duplicated across many files; degree should use Mathlib's `G.degree` | +| Citations | Faithful to website, but page reference "p.345" inconsistent with paper pages 97–132 | +| Variants | Two website-listed variants not captured | +| Readability | Good; minor improvement possible with Mathlib degree API | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/1036.md b/ai-review/1036.md new file mode 100644 index 0000000000..57c5dbf450 --- /dev/null +++ b/ai-review/1036.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 1036 + +## 1. Code Reuse + +**Erdős Problem 636** (`FormalConjectures/ErdosProblems/636.lean`) is the most closely related formalization. It shares nearly identical structure: +- Same pattern of bounding clique and independence number via `G.IsClique` and `Gᶜ.IsClique` on `Finset (Fin n)`. +- Same quantifier skeleton: `∀ c > 0, ∃ δ > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G : SimpleGraph (Fin n), ...` +- Problem 636 counts distinct (vertex count, edge count) signatures via a helper `inducedSubgraphSignatures`; problem 1036 counts non-isomorphic induced subgraphs directly. + +**Erdős Problem 426** (`FormalConjectures/ErdosProblems/426.lean`) defines `SubgraphIsomorphic` using `Nonempty (H₁.coe ≃g H₂.coe)`, which is the same isomorphism-checking pattern used in 1036. + +**Erdős Problem 638** (`FormalConjectures/ErdosProblems/638.lean`) defines `inducedFinSubgraph` and `FinGraphIso` for working with induced subgraphs and their isomorphisms. + +No existing utility from `FormalConjecturesForMathlib` directly provides a "count non-isomorphic induced subgraphs" abstraction, though `ecliqueNum` and `indepNum` definitions exist for graph invariants. A shared helper definition (analogous to `inducedSubgraphSignatures` in 636) for the set of non-isomorphic induced subgraphs could benefit both 1036 and other problems, but is not strictly necessary given the self-contained formulation. + +## 2. Citations + +The formalization cites: +- **[Er93]** Erdős, P., *On some of my favourite theorems*. Combinatorics, Paul Erdős is eighty, Vol. 2 (Keszthely, 1993), p.346. +- **[Sh98]** Shelah, S., *Erdős and Rényi conjecture*. J. Combin. Theory Ser. A 82 (1998), no. 2, 179–185. + +The website (erdosproblems.com/1036) additionally mentions: +- **Alon and Hajnal (1991)** proved the weaker bound of at least $\exp(n (\log n)^{-O(\log\log n)})$ non-isomorphic induced subgraphs. +- **Erdős and Hajnal (1989)** proved a related result for bipartite graphs and their complements. + +The existing citations are accurate and correctly attributed. The Alon–Hajnal and Erdős–Hajnal results are historical context rather than primary references, so their omission is acceptable, though mentioning them would enrich the docstring. + +The docstring correctly attributes the problem to Erdős and Rényi, and the solution to Shelah. + +## 3. Variants + +The formalization captures only the main conjecture (Shelah's theorem). The following related results from the website are not formalized: + +1. **Alon–Hajnal weaker bound (1991):** At least $\exp(n (\log n)^{-O(\log\log n)})$ non-isomorphic induced subgraphs under the same hypotheses. This could be a meaningful variant to include as it represents the state of the art before Shelah's proof. +2. **Erdős–Hajnal bipartite variant (1989):** If $G$ lacks a complete bipartite graph or its complement on more than $c\log n$ vertices, then $G$ contains at least $2^{\Omega_c(n)}$ non-isomorphic induced subgraphs. + +Neither variant is critical, but the bipartite variant represents a genuinely different mathematical statement that could warrant its own formalization. + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- **Logarithm base inconsistency:** Problem 1036 uses `Real.log` (natural logarithm) while the closely related problem 636 uses `Real.logb 2` (log base 2). Since $c$ is universally quantified over all positive reals, the base is mathematically irrelevant — changing the base only rescales $c$. However, consistency across related problems would improve readability. Erdős's Ramsey-theoretic context conventionally uses log base 2 (since $R(k,k) \sim 2^{k/2}$), which matches 636's convention. +- The docstring is accurate and includes a helpful note clarifying "trivial graph" and the meaning of $\log$. +- The namespace `Erdos1036` and theorem name `erdos_1036` follow the codebase conventions. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The original problem statement ("Must $G$ contain at least $2^{\Omega_c(n)}$ many induced subgraphs which are not pairwise isomorphic?") is precise enough to formalize unambiguously. The key concepts — clique number, independence number, induced subgraph, graph isomorphism — all have standard formal definitions. + +The only minor source of ambiguity is the asymptotic notation $2^{\Omega_c(n)}$, which the formalization correctly unpacks as: there exist $\delta > 0$ and $N_0$ (depending on $c$) such that for $n \geq N_0$ the count is at least $2^{\delta n}$. This is the standard interpretation. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization accurately captures the mathematical content: + +- **Clique number bound:** `∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → (S.card : ℝ) ≤ c * Real.log n` correctly states that every clique in $G$ has at most $c \ln n$ vertices. (`IsClique` on a set $S$ means all distinct pairs in $S$ are adjacent, which is the standard definition.) + +- **Independence number bound:** `∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → (S.card : ℝ) ≤ c * Real.log n` correctly bounds the independence number by observing that independent sets in $G$ are exactly cliques in the complement $G^c$. + +- **Counting non-isomorphic induced subgraphs:** The formalization asks for a family $F$ of vertex subsets such that: + - $|F| \geq 2^{\delta n}$, and + - for all $S \neq T$ in $F$, the induced subgraphs $G[S]$ and $G[T]$ are not isomorphic. + + This correctly encodes "at least $2^{\delta n}$ pairwise non-isomorphic induced subgraphs." Each element of $F$ represents a distinct isomorphism class, and the graph isomorphism `≃g` between subtype-indexed induced subgraphs correctly handles subsets of different sizes (no bijection exists between sets of different cardinality, so the non-isomorphism condition is automatically satisfied). + +- **Quantifier structure:** The `∀ c > 0, ∃ δ > 0, ∃ N₀, ∀ n ≥ N₀` structure correctly captures the $2^{\Omega_c(n)}$ asymptotic with the dependence on $c$. + +- **Edge case handling:** For small $n$ (e.g., $n = 0, 1$), `Real.log n ≤ 0`, so any singleton set (which is vacuously a clique of size 1) violates the clique bound, making the hypothesis false. The conclusion then holds vacuously. The $\exists N_0$ quantifier naturally handles this. + +- **`answer(True)`:** Correctly reflects that the problem has been proved in the affirmative by Shelah. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the problem as stated on erdosproblems.com. diff --git a/ai-review/1037.md b/ai-review/1037.md new file mode 100644 index 0000000000..4e3fe6e4b6 --- /dev/null +++ b/ai-review/1037.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 1037 + +## 1. Code Reuse + +Several existing utilities in `FormalConjecturesForMathlib` could improve this formalization: + +- **`SimpleGraph.degreeSequenceMultiplicity`** (in `GraphConjectures/Definitions.lean`): Defined as the maximum number of occurrences of any degree in the degree sequence. The current formalization manually computes "every degree occurs at most twice" via a `Finset.univ.filter` pattern. This could potentially be replaced by `G.degreeSequenceMultiplicity ≤ 2`, though the existing definition uses `List.count` on a sorted list rather than Finset-based counting, so direct substitution would require a bridging lemma. + +- **`SimpleGraph.degree`** (Mathlib): The formalization computes degrees inline via `(Finset.univ.filter (fun w => G.Adj v w)).card`. This is equivalent to `G.degree v` when `DecidableRel G.Adj` is available (which it is, via the `∀ _ : DecidableRel G.Adj` hypothesis). Using `G.degree v` would significantly improve readability. + +- **`SimpleGraph.IsClique` / complement pattern**: The pattern of expressing cliques and independent sets as `G.IsClique` and `Gᶜ.IsClique` is consistent with Erdős 1036 (`1036.lean`), which uses the same idiom. This is good. + +- **`SimpleGraph.degreeSequence`** (in `GraphConjectures/Definitions.lean`): Could be used to express the distinct-degree count more cleanly via `G.degreeSequence.toFinset.card`, though this would need a proof of equivalence with the current image-based formulation. + +## 2. Citations + +**Website (erdosproblems.com/1037):** +- Origin: Chen and Erdős, [Er93, p.347] +- Status: Disproved +- Solvers: Cambie, Chan, Hunter (and Sawhney is listed as a contributor on the website) +- Tags: graph theory + +**Formalization docstring:** +- References [Er93, p.347] — matches the website. +- Cites "Cambie, Chan, and Hunter" as the disprovers — the website also lists **Mehtaab Sawhney** as a contributor. It is unclear whether Sawhney is a co-author of the disproof or contributed to the formalization only. The docstring should clarify or at minimum note Sawhney's involvement if he co-authored the construction. +- The [Er93] full citation is provided and matches standard references: Erdős, P., *On some of my favourite theorems*, Combinatorics, Paul Erdős is eighty, Vol. 2 (Keszthely, 1993), 97–132. +- **Missing:** The website mentions the paper by Cambie, Chan, and Hunter but no explicit bibliographic entry is given for it in the docstring. If a preprint or publication reference is available, it should be included. + +## 3. Variants + +The formalization captures a single variant: the negation of the original question (i.e., that for every ε > 0 and every C > 0, there exists a sufficiently large graph satisfying the degree constraints whose largest trivial subgraph has size at most C · log n). + +**Assessment:** The problem as stated on the website is a single yes/no question, and the formalization captures the "no" answer. There do not appear to be additional variants listed on the website. The formalization is complete in this regard. + +However, one could consider a **stronger constructive variant** — formalizing the specific bound of ≥ (3/4)n distinct degrees achieved by the Cambie–Chan–Hunter construction — but this goes beyond the problem statement and is not required. + +## 4. Readability + +**Issues:** + +- **Inline degree computation:** The expression `(Finset.univ.filter (fun w => G.Adj v w)).card` appears three times (twice for degree counting, once for distinct degree counting). Replacing these with `G.degree v` would be much cleaner. The `DecidableRel G.Adj` instance is already in scope. + +- **DecidableRel binding:** The hypothesis `∀ _ : DecidableRel G.Adj` is idiomatic but slightly unusual. A more standard approach would be `[DecidableRel G.Adj]` as an instance argument or using `letI` / `classical` reasoning. However, since this is inside a universally-quantified statement over all graphs, the `∀ _` pattern is arguably the correct choice here. + +- **Degree multiplicity condition:** The filter-based degree multiplicity check is verbose: + ``` + (∀ d : ℕ, (Finset.univ.filter (fun v => + (Finset.univ.filter (fun w => G.Adj v w)).card = d)).card ≤ 2) + ``` + This could be made more readable by introducing a local definition or using `G.degree` notation. + +- **Overall structure:** The statement is well-organized with clear comments separating the three conditions and the conclusion. The use of `answer(False)` correctly signals the disproved status. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original problem asks whether G "must contain a trivial subgraph of size 'much larger' than log n." The phrase "much larger" is inherently vague. The formalization resolves this ambiguity by interpreting the question as: does there exist a trivial subgraph of size > C · log n for every constant C? This is a standard and natural interpretation — "much larger than log n" means "superlogarithmic," which is equivalent to saying the size exceeds C · log n for every fixed C > 0 (for sufficiently large n). + +The `answer(False)` direction then states that for every ε > 0 and C > 0, there exists a graph meeting the degree constraints whose largest trivial subgraph has size ≤ C · log n. This is the correct negation of the universally-quantified "much larger" interpretation, and it aligns with the Cambie–Chan–Hunter result showing O(log n) is the correct order. + +**One subtlety:** The negation as written says ∃ N₀ such that for all n ≥ N₀, for **all** graphs G satisfying the constraints, the clique/independent set of size > C log n exists. The `answer(False)` means the negation of this is true, i.e., for some ε, C, and arbitrarily large n, there exists a graph where no such large trivial subgraph exists. But the formalization quantifies as ∀ ε > 0, ∀ C > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G, [conditions] → [conclusion]. With `answer(False)`, this entire biconditional is `False ↔ (...)`, meaning the RHS is false. The negation of the RHS is: ∃ ε > 0, ∃ C > 0, ∀ N₀, ∃ n ≥ N₀, ∃ G such that conditions hold but conclusion fails. This correctly captures "there exist counterexamples for arbitrarily large n." This is mathematically sound. + +## 6. Correctness + +**Overall: Correct, with minor observations.** + +- **Logical structure:** The `answer(False) ↔ ...` pattern correctly encodes a disproved conjecture. The RHS states the original conjecture (that all such graphs must contain large trivial subgraphs), and `answer(False)` asserts this is false. + +- **Degree multiplicity condition:** The filter counts vertices with degree exactly d, and requires this count to be ≤ 2 for every d. This correctly formalizes "every degree occurs at most twice." + +- **Distinct degree count:** The image-based counting `(Finset.univ.image (fun v => ...)).card` correctly computes the number of distinct degrees. + +- **Trivial subgraph definition:** Using `G.IsClique` for cliques and `Gᶜ.IsClique` for independent sets is standard and correct. Note that `IsClique` in Mathlib is defined as pairwise adjacency on the set, which includes the empty set and singletons as cliques. This is fine since the interesting content is the size bound. + +- **Logarithm:** `Real.log n` is the natural logarithm, which is the standard convention in combinatorics for Ramsey-type bounds. This is consistent with Problem 1036. + +- **Potential concern — quantifier order:** The formalization quantifies ∀ G after ∀ n ≥ N₀, meaning N₀ can depend on ε and C but not on G. This is the correct reading: the conjecture asks whether *every* graph on n vertices (for large enough n) with the given degree properties must have a large trivial subgraph. + +- **Edge case:** When n = 0 or n = 1, the conditions are vacuously satisfiable or trivially satisfied. The ∃ N₀ quantifier handles this by allowing N₀ to be chosen large enough to avoid degenerate cases. No issue here. + +**Verdict: The formalization is mathematically correct and complete. No flaws identified.** + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Minor improvements possible | Could use `G.degree v` instead of inline filter; `degreeSequenceMultiplicity` potentially applicable | +| Citations | Minor gap | Sawhney's role unclear; no bibliographic entry for the Cambie–Chan–Hunter paper | +| Variants | Complete | Single problem, fully captured | +| Readability | Good, improvable | Inline degree computation is verbose; could benefit from `G.degree` | +| Formalizability | High | "Much larger than log n" resolved cleanly as superlogarithmic | +| Correctness | Correct | No mathematical flaws; quantifier structure is sound | diff --git a/ai-review/1039.md b/ai-review/1039.md new file mode 100644 index 0000000000..b1ea6fb584 --- /dev/null +++ b/ai-review/1039.md @@ -0,0 +1,110 @@ +# Review: Erdős Problem 1039 + +## 1. Code Reuse + +The `sublevelRadius` definition is scoped to the `Erdos1039` namespace. Several closely related problems (1039–1048) define overlapping concepts: + +- **Problem 1042** defines `sublevelSet` (using `Fin n → ℂ` root representation and `‖∏(w - zᵢ)‖ < 1`). +- **Problem 1043** defines `levelSet` (using `‖f.eval z‖ ≤ 1`, with `≤` instead of `<`). +- **Problem 1041** uses the inline set `{z | ‖f.eval z‖ < 1}` without a named definition. + +The sublevel set `{z : ℂ | ‖f.eval z‖ < 1}` is used across many problems in this cluster. A shared `sublevelSet` definition on `Polynomial ℂ` could be extracted and reused, but the slight variations (strict vs. non-strict inequality, polynomial vs. root-product representation) make a single shared definition impractical without introducing multiple variants. The current approach of per-problem definitions is reasonable. + +No existing utility in `FormalConjectures/Util/` or `FormalConjecturesForMathlib` provides a reusable `sublevelRadius`-like construction. + +**Verdict:** No significant code reuse opportunity missed. + +## 2. Citations + +The formalization cites: + +| Citation | Formalization | Website | +|----------|--------------|---------| +| [EHP58] | Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*. J. Analyse Math. 6 (1958), 125-148. | Matches (attributed as problem of Erdős, Herzog, and Piranian [EHP58, p.134]) | +| [Po61] | Pommerenke, Ch., *On the derivative of a polynomial*. Michigan Math. J. 6 (1959), 373-375. | Website says "Pommerenke (1961)" without specifying paper title | +| [KLR25] | Krishnapur, M., Lundberg, E., and Ramachandran, K., *The sublevel set radius for polynomials*. Preprint (2025). | Matches | + +**Issue:** The Pommerenke citation has a discrepancy. The citation key is `[Po61]` but the journal year is listed as 1959. The website attributes the result to "Pommerenke (1961)." There are two relevant Pommerenke papers in this problem cluster: +- [Po59] "On some problems by Erdős, Herzog and Piranian," Michigan Math. J. (1959) — cited in Problem 1043 +- [Po61] "On metric properties of complex polynomials," Michigan Math. J. (1961) — cited in Problem 1043 + +The formalization's `[Po61]` key points to paper title "On the derivative of a polynomial" with year 1959, which appears to be a third distinct Pommerenke paper. The title/year combination should be verified — it may be that the correct paper for the ρ(f) ≥ 1/(2en²) result is "On metric properties of complex polynomials" (1961), not "On the derivative of a polynomial" (1959). + +## 3. Variants + +The website states: *"Determine the behavior of ρ(f). In particular, is ρ(f) ≫ 1/n always true?"* + +The formalization captures only the specific conjecture ρ(f) ≫ 1/n. The broader "determine the behavior" directive is too vague to formalize and is appropriately omitted. + +**Possible additional variants not formalized:** +- The known upper bound ρ(f) ≤ π/(2n) from f(z) = zⁿ − 1 could be stated as a separate theorem (this would be a concrete, provable result). +- The known lower bounds (Pommerenke's 1/(2en²) and KLR's 1/(n√log n)) could be formalized as solved variant theorems. These are documented in the docstring but not formalized. + +These omissions are minor — the core open question is correctly captured. + +## 4. Readability + +The code is clean and well-structured: +- The `sublevelRadius` definition has a clear docstring with mathematical notation. +- The theorem statement is concise and reads naturally. +- The namespace `Erdos1039` keeps definitions scoped appropriately. +- The module docstring provides good context with problem statement, known results, and full references. + +**Minor suggestion:** The docstring for `sublevelRadius` says "the supremum of radii r > 0 such that some open disc of radius r is contained in {z : ‖f(z)‖ < 1}." The notation `‖f(z)‖` is used in the code (complex norm) while the mathematical statement uses `|f(z)|` (complex absolute value). These are equivalent for ℂ, but a note acknowledging this convention might aid readers unfamiliar with the Lean/Mathlib convention of using `‖·‖` for complex absolute value. + +**Verdict:** Highly readable. No significant improvements needed. + +## 5. Formalizability + +The problem is well-suited for formalization: +- "Radius of the largest disc contained in a set" is precisely captured by `sSup` over positive radii with the containment condition. +- The asymptotic notation ρ(f) ≫ 1/n is correctly rendered as the existence of a universal constant C > 0 with ρ(f) ≥ C/n. +- All components (monic polynomial, degree, roots in closed unit disk) have direct Mathlib counterparts. + +**Ambiguity assessment: Low.** The problem statement is precise and admits essentially one interpretation. The only potential ambiguity is whether "largest disc" means open or closed disc; the formalization uses open balls (`Metric.ball`), which is the standard convention and matches the strict inequality `|f(z)| < 1` in the sublevel set definition. Using closed discs would yield the same supremum. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition of `sublevelRadius` +```lean +noncomputable def sublevelRadius (f : Polynomial ℂ) : ℝ := + sSup {r : ℝ | r > 0 ∧ ∃ c : ℂ, Metric.ball c r ⊆ {z : ℂ | ‖f.eval z‖ < 1}} +``` + +This correctly defines ρ(f) as the supremum of radii of open discs fitting inside the sublevel set. For the polynomials in scope (monic, degree ≥ 1, roots in the unit disk): +- The sublevel set is **open** (preimage of an open set under continuous `f.eval`) and **non-empty** (every root zᵢ satisfies f(zᵢ) = 0 < 1, so a neighborhood of each root lies in the sublevel set). +- The sublevel set is **bounded** (since f is monic of degree ≥ 1, |f(z)| → ∞ as |z| → ∞). +- Therefore the set of admissible radii is non-empty and bounded above, so `sSup` is well-defined and yields a positive real number. + +**Note:** For arbitrary `f : Polynomial ℂ` (e.g., the zero polynomial or a constant with |c| ≥ 1), the set could be empty, giving `sSup ∅ = 0` under Lean's `ConditionallyCompleteLattice` instance. However, this is irrelevant since the theorem only invokes `sublevelRadius` under hypotheses guaranteeing the set is non-empty. For constant polynomials with |c| < 1, the sublevel set is all of ℂ and the set of radii is unbounded, but again the theorem's hypotheses (`1 ≤ n`, `f.Monic`, `f.natDegree = n`) exclude this case. + +### Theorem statement +```lean +∃ C : ℝ, C > 0 ∧ ∀ (n : ℕ) (f : Polynomial ℂ), + 1 ≤ n → f.Monic → f.natDegree = n → + (∀ z ∈ f.roots, ‖z‖ ≤ 1) → + sublevelRadius f ≥ C / (n : ℝ) +``` + +- **Monic + roots in unit disk:** The original problem writes f(z) = ∏(z − zᵢ) with |zᵢ| ≤ 1, which precisely means f is monic and all roots lie in the closed unit disk. The conditions `f.Monic` and `∀ z ∈ f.roots, ‖z‖ ≤ 1` correctly capture this. Since ℂ is algebraically closed, any monic polynomial splits completely, so all roots are accounted for. +- **Root condition via `f.roots`:** `Polynomial.roots` returns a `Multiset ℂ` of roots with multiplicity (for non-zero polynomials). The membership `z ∈ f.roots` checks whether z is a root; the condition `‖z‖ ≤ 1` then applies to each distinct root. This is equivalent to requiring all roots (with or without multiplicity) to lie in the closed unit disk, since the norm condition depends only on the point, not its multiplicity. Correct. +- **Degree condition:** `f.natDegree = n` with `1 ≤ n` ensures f has degree at least 1. The quantification over all n captures the "for all degrees" aspect. +- **`answer(sorry)` wrapper:** The `answer(sorry) ↔ ...` pattern correctly models an open problem whose truth value is unknown. If the conjecture is true, `answer` resolves to `True`; if false, to `False`. + +### Potential edge case +If n = 0, then C / 0 would be problematic, but the hypothesis `1 ≤ n` correctly excludes this. + +**Verdict:** The formalization is correct and complete. No mathematical flaws identified. The formalization faithfully captures the intended conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities | +| Citations | Minor issue: Pommerenke citation key [Po61] vs. paper year (1959) and paper title may be mismatched | +| Variants | Core conjecture captured; known bounds could optionally be added as variant theorems | +| Readability | Excellent | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/104.md b/ai-review/104.md new file mode 100644 index 0000000000..1987888ceb --- /dev/null +++ b/ai-review/104.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 104 + +## 1. Code Reuse + +**The `threeRichUnitCircleCount` definition is structurally novel but follows a well-established pattern in the codebase.** + +- **`threeRichUnitCircleCount`** (lines 35–37): Counts `Set.ncard` of the set of centers `c` such that `≥ 3` points of `P` lie on the unit circle centered at `c`. This is structurally analogous to `fourRichLineCount` (101.lean:45–48), `fourPlusRichLineCount` (102.lean:35–38), and `kRichLineCount` (588.lean:42–45), all of which count geometric objects (lines) containing at least `k` points using nested `Set.ncard`. + +- **Problem 506** (`506.lean:50–52`) defines `numDeterminedCircles`, which counts circles (of *any* positive radius) determined by `≥ 3` points, parameterized over `(center, radius)` pairs. Problem 104 fixes the radius to `1` and counts only over centers. These are fundamentally different definitions — 506 cannot be directly reused for 104 — but there is a clear structural relationship. A shared utility `kRichCircleCount (k : ℕ) (r : ℝ) (P : Finset ...)` parameterized over both the richness threshold and the radius could unify the two, though there are currently too few circle-counting problems to justify this extraction. + +- **No existing utility** in `FormalConjecturesForMathlib/` covers fixed-radius circle counting. The closest is `unitDistNum` in `Geometry/Metric.lean`, which counts unit-distance *pairs*, not circles through multiple points. + +**Recommendation:** No immediate code reuse is needed. If additional Erdős problems involving $k$-rich circles of fixed radius are formalized, a generic `kRichFixedRadiusCircleCount` helper should be extracted to a geometry utility module. + +## 2. Citations + +The formalization includes only a link to [erdosproblems.com/104](https://www.erdosproblems.com/104). The website lists substantially more information that should be documented: + +**References on the website:** +- [Er75h, p.2] — Erdős's original posing of the problem +- [Er81d, p.144] — Erdős proved the trivial $O(n^2)$ upper bound via double counting +- [Er83b] +- [Er92e, p.46] — Erdős asked about the general position variant and offered £100 for proving/disproving $O(n^{3/2})$ +- [Er95, p.182] + +**Key results not mentioned in the docstring:** +- Harborth and Mengerson [HaMe86] corrected the upper bound to $\frac{n(n-1)}{3}$ +- Elekes [El84] constructed configurations achieving $\gg n^{3/2}$ three-rich unit circles, suggesting this may be the correct order of magnitude + +**Related problems:** +- Problem #506 (minimum number of determined circles) +- Problem #831 + +**Other metadata:** +- OEIS sequence: A003829 (maximal number for $n$ points) +- Prize: $100 + +The docstring should mention at minimum the Harborth–Mengerson upper bound and the Elekes lower bound, as they frame the state of the art and clarify the gap that makes the conjecture interesting. + +## 3. Variants + +The formalization captures only the main conjecture: the count of three-rich unit circles is $o(n^2)$. + +**Missing variants / related questions from the website:** + +- **General position variant:** Erdős asked in [Er75h] and [Er92e] how many such circles must exist if the points are in *general position* (no three collinear, no four concyclic, or similar). This is a natural companion conjecture that is not formalized. + +- **Conjectured tight bound of $\Theta(n^{3/2})$:** In [Er92e], Erdős offered £100 for a proof or disproof that $O(n^{3/2})$ is the correct order. Since Elekes showed a lower bound of $\Omega(n^{3/2})$, the full conjecture is that the maximum is $\Theta(n^{3/2})$. This is strictly stronger than the $o(n^2)$ statement formalized here and could be captured as a second theorem: + ``` + ∃ C : ℝ, C > 0 → ∀ n, ∀ P, P.card = n → + threeRichUnitCircleCount P ≤ C * n ^ (3/2) + ``` + +- **Exact vs. at-least three:** The problem says "containing at least three points," and the formalization correctly uses `3 ≤ Set.ncard ...`. There is no ambiguity here (unlike Problem 101 where "exactly four" vs. "at least four" matters), since there is no upper collinearity/concyclicity constraint. + +**Assessment:** The core conjecture is captured. The conjectured $O(n^{3/2})$ tight bound is a significant missing variant that represents a sharper and arguably more important open question. + +## 4. Readability + +The code is clean, well-structured, and readable: + +- **Good:** The `threeRichUnitCircleCount` definition has a clear docstring explaining both the mathematical meaning and why centers uniquely identify unit circles. +- **Good:** The theorem docstring explicitly spells out the $\varepsilon$-$N$ formulation of $o(n^2)$, making the formal statement accessible. +- **Good:** The namespace `Erdos104` avoids name collisions. +- **Good:** The structure mirrors `101.lean` almost exactly (helper definition + main theorem with identical quantifier structure), which aids comprehension for anyone familiar with the codebase. +- **Minor:** The inner set comprehension `{p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ dist p c = 1}` could equivalently be written as `{p ∈ (↑P : Set _) | dist p c = 1}` using set-builder notation with a binder, matching the style used in `506.lean:52`. This is purely cosmetic. + +## 5. Formalizability + +**Assessment: Highly formalizable. Very low ambiguity.** + +The problem statement is precise and leaves essentially no room for misinterpretation: + +- "Unit circles" = circles of radius 1 in $\mathbb{R}^2$. Unambiguous. +- "Containing at least three of the points" = three or more points from the configuration lie on the circle. Unambiguous. +- "$o(n^2)$" has a standard $\varepsilon$-$N$ formulation that is well-established in the codebase. +- The ambient space $\mathbb{R}^2$ is standard. + +There is no ambiguity in the problem statement itself. The only interpretive question — whether "general position" or other structural constraints should be imposed — is a matter of *which variant* to formalize, not ambiguity in the main statement. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Encoding of $o(n^2)$:** The statement asserts: for every $\varepsilon > 0$, there exists $N$ such that for all $n \geq N$ and every $n$-point configuration $P$, `threeRichUnitCircleCount P ≤ ε · n²`. This correctly encodes that the *worst-case* count over all $n$-point configurations is $o(n^2)$, because the quantification over $P$ is universal (inside the $\exists N$). **Correct.** + +- **`threeRichUnitCircleCount`:** Counts `Set.ncard` of centers `c` with `3 ≤ Set.ncard {p ∈ P | dist p c = 1}`. This correctly identifies unit circles by their center (since two unit circles are distinct iff their centers differ). The use of `dist p c = 1` correctly characterizes "p lies on the unit circle centered at c." **Correct.** + +- **Finiteness of the counted set:** For `Set.ncard` to return the true cardinality (rather than 0 for an infinite set), the set must be finite. For a finite set $P$ of $n$ points, any unit circle through $\geq 3$ points has its center determined: given any two points $p_1, p_2 \in P$ with $|p_1 - p_2| \leq 2$, at most two centers $c$ satisfy $\text{dist}(p_i, c) = 1$ for both. So the set of centers of unit circles through $\geq 2$ points is bounded by $2\binom{n}{2} = n(n-1)$, and the set through $\geq 3$ points is a subset of this. **The outer set is finite, so `Set.ncard` gives the correct value.** Similarly, the inner set (points of $P$ on a given unit circle) is a subset of the finite set $P$, so its `Set.ncard` is correct. **Correct.** + +- **Open problem stated as a theorem:** Problem 104 is **open** (prize: \$100). The formalization uses the direct `theorem ... := by sorry` pattern, asserting the conjecture is true. Since the Elekes lower bound is $\Omega(n^{3/2})$ and the Harborth–Mengerson upper bound is $O(n^2)$, there is a real gap, and the $o(n^2)$ conjecture is widely expected to be true but unproven. The direct theorem pattern is consistent with how other open $o(n^k)$ conjectures are formalized in the codebase (e.g., Problem 101). If the project convention is to use direct theorems when the expected answer is "yes," this is acceptable. + +- **No missing hypotheses:** The problem as stated on the website imposes no conditions on the point configuration (unlike Problem 101, which requires "no five collinear"). The formalization correctly has no such constraint — it quantifies over all $n$-point sets. **Correct.** + +**Verdict:** The formalization is mathematically faithful to the problem as stated on erdosproblems.com. No errors or omissions in the core statement. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Acceptable | Self-contained definition follows codebase patterns; no existing utility to reuse; structural kinship with 506.lean noted | +| Citations | Needs improvement | Missing all specific references ([Er75h], [Er81d], [HaMe86], [El84], [Er92e], [Er95]), related problems (506, 831), prize, and OEIS sequence | +| Variants | Needs improvement | Missing the conjectured tight $O(n^{3/2})$ bound (a sharper open question with its own £100 prize) and the general position variant | +| Readability | Good | Clean, well-documented, consistent with codebase conventions | +| Formalizability | Excellent | Unambiguous, precise problem statement | +| Correctness | Correct | Mathematically faithful; finiteness conditions satisfied; no missing hypotheses | diff --git a/ai-review/1040.md b/ai-review/1040.md new file mode 100644 index 0000000000..6bee2da120 --- /dev/null +++ b/ai-review/1040.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 1040 + +## 1. Code Reuse + +The definitions `pairwiseDistProd`, `nthTransfiniteDiam`, and `transfiniteDiameter` are **duplicated verbatim** between `ErdosProblems/1040.lean` and `ErdosProblems/1042.lean`. These should be factored into a shared utility file (e.g., under `FormalConjecturesForMathlib/Analysis/TransfiniteDiameter.lean` or similar) and imported by both. The `sublevelSet` definition in 1042.lean is also closely related to the `sublevelMeasure` inner set in 1040.lean. + +No existing code in `FormalConjecturesForMathlib/` covers transfinite diameter or logarithmic capacity. This is a good candidate for a new shared module, given that problems 1040, 1042, 1044, and potentially others in the EHP58 family all deal with sublevel sets of monic polynomials and transfinite diameter. + +## 2. Citations + +The docstring cites: + +- **[EHP58]** Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, J. Analyse Math. **6** (1958), 125–148. + +The website (erdosproblems.com/1040) additionally references: + +- **[ErNe73]** Erdős, P. and Netanyahu, E. (1973) — For bounded connected F with transfinite diameter 0 < c < 1, the sublevel set {z : |f(z)| < 1} always contains a disc of radius depending on c. +- **[Fe26]** Aletheia (2026) — Showed μ(F) is *not* determined solely by transfinite diameter (two closed infinite sets with transfinite diameter 0 have different μ values). + +These additional references should be included in the docstring for completeness. + +## 3. Variants + +The formalization captures only the main question (μ(F) = 0 when transfinite diameter ≥ 1). The website describes additional results that are not formalized: + +1. **Line segment / disc special case** (EHP58): The answer is affirmative when F is a line segment or disc. This could be formalized as a separate theorem. +2. **Erdős–Netanyahu result** (ErNe73): When F is bounded, connected, with transfinite diameter 0 < c < 1, the sublevel set contains a disc of substantial radius. This is a related but distinct result. +3. **Aletheia's result** (Fe26): μ(F) is not determined solely by transfinite diameter (demonstrated by sets of transfinite diameter 0). Note this does not resolve the main question about diameter ≥ 1. + +At minimum, the EHP58 partial result for line segments and discs would be a natural variant to include. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstrings are clear and include the mathematical definitions in LaTeX. +- The namespace `Erdos1040` is appropriate. +- The use of `Fin (n + 1)` to ensure at least one root is a reasonable choice that is documented in the comment. +- The `open scoped ENNReal` and `open MeasureTheory Classical Filter Finset` are appropriate for the definitions used. + +Overall: **good readability**. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- "Closed infinite set F ⊆ ℂ" — unambiguous. +- "Transfinite diameter ≥ 1" — standard concept with a well-known definition (which is provided). +- "Infimum of Lebesgue measure of {z : |f(z)| < 1} over monic polynomials with roots in F" — well-defined. +- "Is μ(F) = 0?" — a yes/no question. + +The only potential source of ambiguity is whether "polynomials of the shape ∏(z − zᵢ) with zᵢ ∈ F" allows repeated roots. The formalization allows this (z : Fin (n+1) → ℂ is not required to be injective), which is the standard reading. + +## 6. Correctness + +### 6a. `transfiniteDiameter` and the `lim` issue + +The transfinite diameter is defined as: + +```lean +noncomputable def transfiniteDiameter (F : Set ℂ) : ℝ := + lim (atTop.map (fun n => nthTransfiniteDiam F n)) +``` + +Lean's `lim` applied to a non-convergent filter returns an arbitrary ("junk") value. The sequence dₙ(F) is known to converge for any **compact** (or more generally, bounded) set F. However, the problem statement says "closed infinite set" — if F is unbounded, then dₙ(F) → ∞ and the limit does not converge in ℝ. In this case, `transfiniteDiameter F` is a junk value, and the hypothesis `transfiniteDiameter F ≥ 1` may or may not hold, making the theorem potentially vacuously true or incorrectly stated for unbounded sets. + +**Impact**: For unbounded closed F (which intuitively should have "infinite" transfinite diameter and thus should satisfy the hypothesis), the formalization may not capture them correctly. One fix would be to add a boundedness or compactness hypothesis (which is probably what the original problem intends), or to use `ℝ≥0∞`-valued transfinite diameter with ∞ for unbounded sets. + +In practice, this is a **minor issue**: for bounded F the definition is correct, and unbounded F with transfinite diameter ≥ 1 trivially satisfies the conclusion by a compactness argument (you can approximate with compact subsets). + +### 6b. `nthTransfiniteDiam` edge cases + +For n = 0 and n = 1, the exponent `2 / (n * (n - 1))` involves division by zero. In Lean, this gives exponent 0, so `x ^ 0 = 1`, making `nthTransfiniteDiam F 0 = nthTransfiniteDiam F 1 = 1` (junk values). These do not affect the limit as n → ∞, so this is **harmless**. + +### 6c. `sublevelMeasure` correctness + +```lean +noncomputable def sublevelMeasure (F : Set ℂ) (μ : Measure ℂ) : ℝ≥0∞ := + ⨅ (n : ℕ) (z : Fin (n + 1) → ℂ) (_ : ∀ i, z i ∈ F), + μ {w : ℂ | ‖(univ : Finset (Fin (n + 1))).prod (fun i => w - z i)‖ < 1} +``` + +This correctly computes the infimum of the Lebesgue measure of {w : ‖∏ᵢ(w − zᵢ)‖ < 1} over all choices of degree (n+1 ≥ 1) and roots zᵢ ∈ F. This matches the problem statement. + +One subtlety: the `⨅` over the constraint `∀ i, z i ∈ F` uses `⨅ (_ : P), ...` which equals the value when P holds and `⊤` when P is false. This is correct: infeasible choices of z contribute ⊤ (= ∞) and do not affect the infimum. + +### 6d. Haar measure generalization + +The theorem universally quantifies over `(μ : Measure ℂ) [μ.IsAddHaarMeasure]` rather than fixing Lebesgue measure. This is mathematically sound: Haar measure on ℂ ≅ ℝ² is unique up to a positive scalar, and if the infimum is 0 for one Haar measure, it is 0 for all. This is a valid (and arguably elegant) generalization. + +### 6e. `answer(sorry)` structure + +The `answer(sorry) ↔ ...` pattern correctly captures that this is an open yes/no question. The answer is `sorry` (unknown), and the biconditional says "the answer is True iff the stated property holds." This is the standard pattern for open problems in this codebase. + +### Overall Correctness Assessment + +The formalization is **mathematically correct** for the intended class of sets (closed, bounded, infinite subsets of ℂ). The main caveat is the handling of unbounded sets where the `lim`-based definition of transfinite diameter may produce junk values. This is a known limitation of working with ℝ-valued limits in Lean and does not represent a fundamental error in the mathematical content. + +**Verdict: Correct and complete, with a minor technical caveat about unbounded sets.** diff --git a/ai-review/1042.md b/ai-review/1042.md new file mode 100644 index 0000000000..ca8bbd9623 --- /dev/null +++ b/ai-review/1042.md @@ -0,0 +1,74 @@ +# AI Review: Erdős Problem 1042 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `pairwiseDistProd`, `nthTransfiniteDiam`, and `transfiniteDiameter` are copied verbatim between `ErdosProblems/1040.lean` and `ErdosProblems/1042.lean` (both live in their own namespaces `Erdos1040` / `Erdos1042`). These should be extracted into a shared utility module (e.g., `FormalConjectures.Util.TransfiniteDiameter`) and imported by both files. + +Additionally, `sublevelSet` in 1042.lean is closely related to: +- `lemniscateSublevel` in `ErdosProblems/1044.lean` (a general sublevel set `{z | ‖f z‖ < 1}`) +- `sublevelMeasure` in `ErdosProblems/1040.lean` (which inlines the same sublevel set construction) + +A shared sublevel-set definition parameterized by roots could unify these. + +## 2. Citations + +The file references: +- `[EHP58]` — Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, J. Analyse Math. 6 (1958), 125–148. +- `[GhRa24]` — Ghosh, S. and Ramachandran, D. + +**Assessment:** The citations are consistent with the website. The website credits "Ghosh and Ramachandran" for solving both parts, matching `[GhRa24]`. The original paper attribution to Erdős–Herzog–Piranian and the journal reference match. One minor note: the website spells the third author as "Piranien" (likely a typo on the website); the file's "Piranian" is the standard correct spelling. + +The `[GhRa24]` citation lacks a paper title and publication venue. Consider adding the full reference once available (the website does not provide it either, so this is acceptable for now). + +## 3. Variants + +The formalization captures two parts: +1. **`erdos_1042`** (existence): A closed set F with transfinite diameter 1, not in any closed disc of radius 1, for which infinitely many n yield exactly n connected components. +2. **`erdos_1042.variants.upper_bound`**: For closed F with 0 < transfinite diameter < 1, the number of components is at most (1−c)·n. + +**Missing variant:** The solution by Ghosh–Ramachandran also establishes that for transfinite diameter d ≤ 1/4 with *connected* F, the sublevel set has exactly one connected component. This result is not captured in the formalization. It could be added as `erdos_1042.variants.connected_unique_component` or similar. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The docstrings clearly state the mathematical content with LaTeX formulas. +- The namespace `Erdos1042` is clean and self-contained. +- The definition names (`pairwiseDistProd`, `nthTransfiniteDiam`, `transfiniteDiameter`, `sublevelSet`) are descriptive and follow conventions used in neighboring files (1040, 1044). +- The module docstring provides good context, references, and attribution. + +**Minor suggestion:** The `sublevelSet` docstring says "sublevel set ... of a monic polynomial with given roots" — this is accurate and helpful, but could additionally note that it equals `{w : ‖∏ᵢ(w − zᵢ)‖ < 1}` to match the notation used in the theorem docstrings. + +## 5. Formalizability + +**Assessment: High formalizability with minor caveats.** + +The problem as stated on the website is precise enough to formalize: +- Transfinite diameter has a standard definition (captured correctly). +- Connected components of an open subset of ℂ are well-defined topological objects. +- The sublevel set of a monic polynomial is a concrete, well-defined open set. + +**Caveats:** +- The original Erdős problem asks *"Can the set {z : |f(z)| < 1} have n connected components?"* which is somewhat ambiguous about quantifiers: does it mean "for some n" or "for all n" or "for infinitely many n"? The formalization chooses "for infinitely many n", which is the strongest natural reading and matches the solved result. +- The `nthTransfiniteDiam` definition uses `sSup` over an unbounded set — well-definedness of the supremum is a mathematical concern (though in Lean, `sSup` on `ℝ` returns 0 for empty/unbounded sets by convention, so this is type-safe if not semantically ideal for n < 2). + +## 6. Correctness + +### `erdos_1042` (existence theorem) + +**Mostly correct.** The formalization states: there exists a closed F with transfinite diameter exactly 1, not contained in any closed ball of radius 1, and the set of n for which n components can be achieved is infinite. + +**Potential issues:** +- **Exponent for small n:** The definition `nthTransfiniteDiam` uses exponent `2/(n*(n-1))`. For n = 0 and n = 1, this is `2/0`, which in Lean's real division gives 0, so the expression becomes `(product)^0 = 1`. This means `nthTransfiniteDiam F 0 = 1` and `nthTransfiniteDiam F 1 = 1` for any nonempty F. Mathematically the n-th transfinite diameter is only defined for n ≥ 2. This does not affect `transfiniteDiameter` (the limit) but is a minor inelegance. The same issue exists in 1040.lean. +- **`Set.Infinite` quantification:** The formalization requires infinitely many n where exactly n components are achieved. The original problem just asks "can it have n connected components?" (seemingly for each n). The Ghosh–Ramachandran result proves "infinitely many n", which is weaker than "all n" but stronger than "some n". The formalization correctly captures the proved result rather than an overly strong interpretation. + +### `erdos_1042.variants.upper_bound` + +**Correct.** The statement faithfully captures: for closed F with 0 < transfinite diameter < 1, there exists c > 0 such that the number of connected components is ≤ (1−c)·n for all n and all root configurations in F. + +**Minor observations:** +- The hypothesis `hd_pos : transfiniteDiameter F > 0` excludes degenerate cases (finite sets, etc.) where the transfinite diameter is 0. This is appropriate. +- The conclusion casts `Nat.card` to `ℝ` for comparison with `(1 - c) * n`. This is the standard approach. +- For n = 0, the sublevel set of the empty product is `{w : ‖1‖ < 1} = ∅`, which has 0 components, and `(1-c)*0 = 0`, so the bound holds trivially. This is fine. + +### Overall correctness: **Sound.** No mathematical errors detected. The formalization is a faithful representation of the problem as solved by Ghosh–Ramachandran. diff --git a/ai-review/1044.md b/ai-review/1044.md new file mode 100644 index 0000000000..2cac5ac638 --- /dev/null +++ b/ai-review/1044.md @@ -0,0 +1,61 @@ +# Erdos Problem 1044 - AI Review + +## 1. Code Reuse + +Several related problems define nearly identical concepts that could be consolidated: + +- **`lemniscateSublevel`** (open sublevel set `{z | ‖f z‖ < 1}`) duplicates `Erdos116.lemniscateInterior` from `ErdosProblems/116.lean`, which defines the same set. +- **`Erdos115.lemniscate`** and **`Erdos1120.lemniscateSet`** define the closed variant `{z | ‖f z‖ ≤ 1}`. +- **`Erdos114.arcLength`** wraps `Measure.hausdorffMeasure 1`, which is the same measure used inline in `maxBoundaryLength`. +- Problems 1047 and 1048 also use `connectedComponentIn` on polynomial sublevel sets with similar structure. + +**Recommendation:** A shared definition in `FormalConjecturesForMathlib` for polynomial lemniscate sublevel sets (open and closed variants) and an `arcLength` helper would reduce duplication across at least 6 problems (114, 115, 116, 1044, 1047, 1048, 1120). + +## 2. Citations + +The formalization cites: + +> [EHP58] Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, J. Analyse Math. 6 (1958), 125–148. + +The website (erdosproblems.com/1044) confirms this as the original reference. The website also credits **Quanyu Tang** as the solver, which is mentioned in the docstring. The citation matches the website. + +## 3. Variants + +The website notes that Tang further conjectures that **for fixed degree n, the infimum of Lambda(f) is attained by f_n(z) = z^n - 1**, with proofs verified for n = 1 and n = 2. This variant/conjecture is **not formalized**. It could be added as a separate theorem or conjecture statement. + +## 4. Readability + +The code is well-structured: +- Clear docstrings on both helper definitions and the main theorem. +- The namespace `Erdos1044` keeps definitions scoped. +- The intermediate definitions `lemniscateSublevel` and `maxBoundaryLength` break the theorem statement into understandable pieces. + +Minor suggestion: The `maxBoundaryLength` docstring could clarify that it computes a supremum (not literally a maximum), though for polynomial lemniscates the number of connected components is finite, so `sSup` coincides with `max`. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise: it specifies monic polynomials with roots in the closed unit disk, the sublevel set `{z : |f(z)| < 1}`, the notion of boundary length (1-dimensional Hausdorff measure of the frontier), and asks for the infimum of the maximum boundary length. All of these have standard mathematical definitions with direct Mathlib counterparts. + +The only potential source of ambiguity is the meaning of "length of a boundary," but 1-dimensional Hausdorff measure is the standard interpretation and is unambiguous for rectifiable curves (which polynomial lemniscate boundaries are). + +## 6. Correctness + +**Overall: Correct, with minor caveats.** + +**Correct aspects:** +- `lemniscateSublevel` faithfully captures `{z : |f(z)| < 1}`. The set is open (preimage of open set under continuous map), so its connected components are open and their frontiers are well-defined boundaries. +- The use of `connectedComponentIn` correctly identifies connected components of the sublevel set. +- `frontier (connectedComponentIn S x)` correctly captures the boundary of the connected component containing `x`. +- `Measure.hausdorffMeasure 1` is the correct notion of curve length. +- The `sInf` / `sSup` structure correctly formalizes "infimum of Lambda(f) over all monic polynomials with roots in the unit disk." +- The answer `2` matches the resolved result by Tang. +- The `Monic` and `IsRoot` constraints correctly restrict to the right class of polynomials. + +**Caveats:** +1. **`.toReal` on Hausdorff measure:** `ENNReal.toReal` maps `⊤` to `0`. If any connected component had a boundary with infinite 1-dimensional Hausdorff measure, `.toReal` would return `0`, potentially making `maxBoundaryLength` smaller than it should be. This does not affect correctness of the theorem because polynomial lemniscate boundaries are algebraic curves with finite length, but it makes `maxBoundaryLength` as a standalone definition subtly incorrect for pathological inputs (non-polynomial functions with fractal boundaries, etc.). +2. **`sSup` over potentially empty set:** If `lemniscateSublevel f = ∅` (which can't happen for a nonconstant monic polynomial since `|f(z)| → ∞` implies the sublevel set is bounded and nonempty for degree ≥ 1), then `sSup ∅ = 0` in `ℝ` (via `csSup_empty`). This is benign for the theorem since monic polynomials always have nonempty sublevel sets at level 1. +3. **Consistency of `sSup` vs problem statement's "maximum":** The problem says "maximum," and the formalization uses `sSup`. For polynomial lemniscates the number of connected components is finite (at most `n` for degree `n`), so the supremum is attained and equals the maximum. This is correct. + +**No mathematical flaws identified.** The formalization is a faithful encoding of the problem and its resolution. diff --git a/ai-review/1045.md b/ai-review/1045.md new file mode 100644 index 0000000000..ae478de577 --- /dev/null +++ b/ai-review/1045.md @@ -0,0 +1,98 @@ +# AI Review: Erdős Problem 1045 + +**File:** `FormalConjectures/ErdosProblems/1045.lean` + +## 1. Code Reuse + +The `erdosDelta` definition uses nested products with a conditional: +```lean +∏ i : Fin n, ∏ j : Fin n, if i ≠ j then ‖z i - z j‖ else 1 +``` + +Two alternative patterns exist in the codebase for computing pairwise distance products: + +- **Erdős 1040** (`FormalConjectures/ErdosProblems/1040.lean:48–50`): Uses `Finset.filter (fun p => p.1 < p.2)` on `univ : Finset (Fin n × Fin n)` to compute `∏_{i erdosDelta (regularNGon 4)). + +**Recommendation:** The two captured variants cover the core yes/no question and the main open subproblem. The quantitative question is harder to formalize precisely (it asks for a value, not a yes/no), so omitting it is reasonable. + +## 4. Readability + +The code is generally well-structured and readable. + +- The `erdosDelta` definition is clear and the docstring correctly describes it. +- The `regularNGon` docstring says "inscribed in the unit circle (diameter 2)" — this is correct but slightly unusual phrasing. Conventionally one says "inscribed in a circle of radius 1" or "inscribed in a circle of diameter 2." The current phrasing conflates "unit circle" (radius 1) with the diameter description; it works because the unit circle does have diameter 2, but could be slightly clearer. +- The module docstring provides good mathematical context and history. + +**Minor suggestion:** The `erdosDelta` definition could be written more concisely using `Finset.offDiag`: +```lean +∏ p ∈ (Finset.univ : Finset (Fin n)).offDiag, ‖z p.1 - z p.2‖ +``` +This would be more idiomatic and avoids the `if ... then ... else 1` pattern. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement is precise: +- The constraint |z_i − z_j| ≤ 2 is unambiguous. +- The product Δ = ∏_{i≠j} |z_i − z_j| is well-defined. +- The question "Is Δ maximised by the regular n-gon?" has a clear yes/no answer. +- The regular n-gon inscribed in a circle of diameter 2 is uniquely determined up to rotation/reflection (which doesn't affect Δ). + +The only mild ambiguity: the original problem says "the vertices of a regular polygon inscribed in a circle of diameter 2" without specifying centering at the origin, but this doesn't matter since Δ is translation-invariant. + +## 6. Correctness + +**Assessment: Correct and complete.** + +**Definition `erdosDelta`:** Computes ∏_{i≠j} ‖z_i − z_j‖ by iterating over all ordered pairs (i, j) with i ≠ j, substituting 1 for i = j terms. This equals (∏_{i erdosDelta (regularNGon n). This correctly captures the disproved conjecture (counterexamples exist for n = 4, 6, and all even n ≥ 4). Category `research solved` is correct. ✅ + +**Odd variant (`erdos_1045.variants.odd`):** States that for all odd n ≥ 1, the regular n-gon is optimal. Uses `answer(sorry)` reflecting that the truth value is unknown. Category `research open` is correct. ✅ + +**Edge cases:** +- n = 0: `Fin 0 → ℂ` is the unique empty function. `erdosDelta 0 z` is an empty product = 1. The main theorem requires n ≥ 1, so this is excluded. ✅ +- n = 1: Both sides give empty product = 1. Trivially satisfied. ✅ +- n = 2: `regularNGon 2` gives {1, −1} with distance 2. `erdosDelta = 4`. Any z with |z₁ − z₂| ≤ 2 gives erdosDelta = |z₁ − z₂|² ≤ 4. Optimal. ✅ + +**No mathematical flaws identified.** The formalization is a faithful and correct encoding of the problem as stated on erdosproblems.com. + +--- + +**Overall assessment:** The formalization is mathematically correct, captures the main result and the key open variant, and is well-documented. The primary areas for improvement are (1) adding proper citations for Hu–Tang and Cambie, and (2) minor stylistic preference for using `offDiag` instead of conditional products. diff --git a/ai-review/1046.md b/ai-review/1046.md new file mode 100644 index 0000000000..a13ff617ae --- /dev/null +++ b/ai-review/1046.md @@ -0,0 +1,74 @@ +# Review: Erdős Problem 1046 + +## 1. Code Reuse + +Problem 1044 (`FormalConjectures/ErdosProblems/1044.lean`) defines: + +```lean +noncomputable def lemniscateSublevel (f : ℂ → ℂ) : Set ℂ := + {z : ℂ | ‖f z‖ < 1} +``` + +This is exactly the set `{z : ℂ | ‖Polynomial.eval z f‖ < 1}` used inline in 1046. Problem 1046 could import and reuse `lemniscateSublevel` (applied to `fun z => Polynomial.eval z f`) rather than writing the set literal twice in the statement. Problems 1047 and 1048 also work with essentially the same sublevel sets. A shared definition (perhaps in a utility file for the EHP58 cluster of problems 1044–1048) would improve consistency. + +No relevant utilities were found in `FormalConjecturesForMathlib/`. + +## 2. Citations + +The formalization references: + +- **[EHP58]** — Erdős, P., Herzog, F., and Piranian, G., *Metric properties of polynomials*, J. Analyse Math. 6 (1958), 125–148. +- **[Po59]** — Pommerenke, Ch., *Über die Kapazität ebener Kontinuen*, Math. Ann. 139 (1959), 64–75. + +The website [erdosproblems.com/1046](https://www.erdosproblems.com/1046) lists the same two references ([EHP58, p.143] and [Po59]). The citations match. The page reference "p. 143" is correctly included in the theorem docstring. + +## 3. Variants + +The website documents additional content not captured in the formalization: + +1. **Width conjecture (disproved):** Erdős, Herzog, and Piranian conjectured that the **width** of `{z : |f(z)| ≤ 1}` (note: closed sublevel set, not open) is always at most 2 when connected. Pommerenke disproved this with an example achieving width > √3 · 2^{1/3} ≈ 2.18. The module docstring mentions this disproof but it is not formalized. This could be a worthwhile variant to add (as an `answer(False)` statement). + +2. **Stronger center result:** Pommerenke proved the stronger result that the center of the containing disc of radius 2 can be taken to be the **centroid of the roots** of f, i.e., (z₁ + ··· + zₙ)/n. The current formalization uses a bare existential `∃ c`, which is correct but weaker. A variant or strengthening capturing this specific center would be mathematically richer. + +3. **Equivalence condition:** The website notes that connectedness of E = {z : |f(z)| < 1} is equivalent to E containing all zeros of f'. This is not mentioned in the formalization and could be a useful auxiliary lemma. + +## 4. Readability + +The code is clean and concise. Minor observations: + +- The `open Complex Polynomial Metric Set` line is appropriate for the scope. +- The inline set `{z : ℂ | ‖Polynomial.eval z f‖ < 1}` appears twice in the theorem statement. Extracting it into a local `let` binding (e.g., `let E := {z : ℂ | ‖Polynomial.eval z f‖ < 1}`) would reduce duplication and improve readability, following the pattern used in problems 1047 and 1048. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem asks a yes/no question: given a monic polynomial over ℂ, if the strict sublevel set is connected, is it contained in a disc of radius 2? This is entirely precise. The only potential ambiguity — open vs. closed disc — is immaterial since the formalization uses `closedBall` (closed disc), which is the stronger statement and the one Pommerenke proved. No issues here. + +## 6. Correctness + +**Assessment: Correct.** + +The formalization faithfully captures the problem: + +- `f.Monic` — monic polynomial, ✓ +- `IsConnected {z : ℂ | ‖Polynomial.eval z f‖ < 1}` — connectedness of the strict sublevel set, ✓ +- `∃ c : ℂ, {z : ℂ | ...} ⊆ closedBall c 2` — containment in a closed disc of radius 2, ✓ +- `answer(True)` — the answer is affirmative (proved by Pommerenke), ✓ + +**Edge cases:** For a degree-0 monic polynomial (i.e., `f = 1`), the sublevel set is empty. Lean's `IsConnected` requires `Nonempty`, so `IsConnected ∅` is false, making the implication vacuously true. This is mathematically sound. + +**Subtle point on `‖·‖` vs `|·|`:** The formalization uses `‖Polynomial.eval z f‖` (the norm). For `ℂ`, `‖·‖ = Complex.abs = |·|`, so this is correct. + +**No mathematical flaws identified.** The formalization is a correct and complete encoding of the problem as stated on the website. The existential quantification over the center is weaker than Pommerenke's explicit centroid result but is faithful to the original question. + +## Summary + +| Criterion | Rating | +|---|---| +| Code reuse | Could reuse `lemniscateSublevel` from 1044 | +| Citations | Complete and accurate | +| Variants | Width conjecture and centroid-center strengthening missing | +| Readability | Good; minor `let`-binding improvement possible | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/1047.md b/ai-review/1047.md new file mode 100644 index 0000000000..64d366a30d --- /dev/null +++ b/ai-review/1047.md @@ -0,0 +1,51 @@ +# AI Review: Erdős Problem 1047 + +## 1. Code Reuse + +No significant reuse opportunities identified. The formalization uses standard Mathlib constructs (`Polynomial`, `connectedComponentIn`, `Convex`, `Set.ncard`) and does not duplicate any custom definitions from `FormalConjecturesForMathlib`. The `connectedComponentIn S '' S` idiom for counting connected components is unique to this file within the codebase (no other file uses this pattern), but it is built from standard Mathlib primitives and does not warrant extraction into a shared utility. + +## 2. Citations + +The docstring references `[EHP58, p.145]`, `[Po61]`, and `[Go66]` in shorthand form. The website (erdosproblems.com/1047) uses the same shorthand conventions: + +- **[EHP58]**: Erdős, Herzog, and Piranian (1958) +- **[Po61]**: Pommerenke (1961) — proved the answer is negative +- **[Go66]**: Goodman (1966) — gave further counterexamples + +The docstring and module doc are consistent with the website's citation style. The website also mentions an anonymous referee's example (`|z(z^5 - 1)| < 5.6^{-6/5}`) which the formalization's module doc omits, but this is a minor supplementary detail, not a core citation. + +**Status**: The website marks this as disproved. The formalization uses `answer(False)` and the attribute `category research solved`, which is consistent. + +## 3. Variants + +The website notes that Goodman raised the follow-up question of determining the maximum number of non-convex components as a function of polynomial degree. This is a separate open problem rather than a variant of the original yes/no question. No variants of the original problem are missing from the formalization. + +## 4. Readability + +The code is clean and readable. The `let S` binding clearly names the sublevel set. The structure follows the standard template for this codebase. One minor note: the module doc provides useful mathematical context (Pommerenke's and Goodman's counterexamples), which aids understanding. + +No readability issues. + +## 5. Formalizability + +The problem is well-suited to formalization. It asks a precise yes/no question about a clearly defined mathematical object (sublevel sets of monic polynomials over ℂ). The key concepts — monic polynomial, distinct roots, sublevel set, connected components, convexity — all have standard Mathlib definitions. + +**Ambiguity assessment**: Low. The only potential ambiguity is what "small enough" means for $c$, but the formalization resolves this cleanly by directly requiring that the number of connected components equals the number of distinct roots, which is the precise mathematical content of "small enough." + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **answer(False)**: The `answer` elaborator passes through its argument, so `answer(False)` elaborates to `False`. The biconditional `False ↔ (∀ f, f.Monic → ∀ c > 0, ... → ∀ x ∈ S, Convex ℝ (connectedComponentIn S x))` asserts that the universal statement is false. This correctly encodes that the answer to "must all components be convex?" is **no**. + +- **Sublevel set**: `{z : ℂ | ‖Polynomial.eval z f‖ ≤ c}` correctly defines $\{z : |f(z)| \leq c\}$ since `‖·‖` on `ℂ` is the complex absolute value. + +- **Number of components**: `Set.ncard (connectedComponentIn S '' S)` computes the number of connected components of $S$ by mapping each point to its connected component and counting the distinct images. This is correct. + +- **Number of distinct roots**: `f.roots.toFinset.card` gives the cardinality of the set of distinct roots (since `f.roots` is a multiset and `.toFinset` removes duplicates). This matches $m$ in the problem. + +- **Convexity of each component**: `∀ x ∈ S, Convex ℝ (connectedComponentIn S x)` asserts that every connected component of $S$ is convex over $\mathbb{R}$. This is the correct formalization of "all components are convex" (viewing $\mathbb{C}$ as a real vector space for convexity). + +- **Quantifier structure**: The formalization universally quantifies over all monic polynomials and all $c > 0$ satisfying the component-count condition, then asks if all components are convex. Negating this (via the `False` biconditional) means there exists a polynomial and a valid $c$ for which some component is non-convex. This exactly matches the problem and its disproof. + +**No mathematical flaws identified.** diff --git a/ai-review/1048.md b/ai-review/1048.md new file mode 100644 index 0000000000..901899ea77 --- /dev/null +++ b/ai-review/1048.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 1048 + +## 1. Code Reuse + +**Opportunity identified.** Problem 1044 (`FormalConjectures/ErdosProblems/1044.lean`) defines a reusable helper: + +```lean +noncomputable def lemniscateSublevel (f : ℂ → ℂ) : Set ℂ := + {z : ℂ | ‖f z‖ < 1} +``` + +Problem 1048 inlines this same set as `{z : ℂ | ‖Polynomial.eval z f‖ < 1}`. The `lemniscateSublevel` definition could be promoted to a shared utility and reused here, as well as in Problems 1043, 1046, 1047, 511, and 1120, all of which define similar sublevel sets. + +Problem 511 (`FormalConjectures/ErdosProblems/511.lean`) also uses `Metric.diam` on connected components of the same kind of sublevel set, confirming the pattern is consistent across the codebase. + +No other Mathlib-level utilities (e.g., in `FormalConjecturesForMathlib`) exist for polynomial sublevel sets or their connected component diameters. + +## 2. Citations + +The formalization cites: + +- **[EHP58]** Erdős, P., Herzog, F. and Piranian, G., *Metric properties of polynomials*, J. Analyse Math. 6 (1958), 125-148. +- **[Po61]** Pommerenke, Ch., *On metric properties of complex polynomials*, Michigan Math. J. 8 (1961), 97-115. + +The website (erdosproblems.com/1048) confirms both references. The page attribution and problem origin match: the problem comes from [EHP58, p.142] and was disproved by Pommerenke [Po61]. Citations are **correct and complete**. + +## 3. Variants + +The formalization captures the main conjecture and notes Pommerenke's disproof for r > 1 and the positive answer for 0 < r ≤ 1 in the docstring. However, the website and Pommerenke's paper contain **refined positive results for r ≤ 1** that are not formalized: + +- For 0 ≤ r ≤ 1/2: the component containing 0 has diameter ≥ 2. +- For 1/2 < r ≤ (√5 − 1)/2: the component containing 0 has diameter > 1/r. +- For (√5 − 1)/2 ≤ r ≤ 1: the component containing 0 has diameter > 2 − r². + +These could be formalized as separate companion theorems (e.g., `erdos_1048_positive_r_le_half`, etc.). The current formalization only captures the main yes/no question, which is the core of the problem, so this omission is acceptable but notable. + +## 4. Readability + +The code is **clear and well-structured**. Specific observations: + +- The `let S := ...` binding inside the quantifier body is a nice readability choice that avoids repeating the sublevel set definition. +- The `open Polynomial Metric` is minimal and appropriate. +- The docstring is informative and correctly summarizes the problem, its resolution, and the key counterexample (f(z) = zⁿ − rⁿ). +- **Minor suggestion**: The universal quantifier over `r` does not restrict `r > 0` (or even `r ≥ 0`). While this doesn't affect mathematical correctness (the conjecture is False regardless), adding `0 < r` would better match the original problem's implicit assumption that r is a radius and would make the statement more readable as a reflection of the intended mathematical content. + +## 5. Formalizability + +**Assessment: Clearly formalizable with low ambiguity.** + +The original problem is a precise yes/no question about a universal statement involving: +- Monic polynomials over ℂ (well-defined in Mathlib) +- Root bounds via norms (well-defined) +- Sublevel sets with strict inequality (well-defined as an open set) +- Connected components and their diameters (well-defined via `connectedComponentIn` and `Metric.diam`) + +There is essentially **no ambiguity** in the problem statement. The only minor interpretive choice is whether the sublevel set uses strict (`<`) or non-strict (`≤`) inequality. The formalization correctly uses strict inequality (`< 1`), matching the original problem statement from [EHP58]. + +## 6. Correctness + +**Assessment: Mathematically correct.** + +Detailed analysis: + +- **`answer(False)` direction**: The problem asks whether the diameter bound *must* hold. Pommerenke showed it need not for r > 1. So the answer is False (the conjecture is disproved). The biconditional `answer(False) ↔ P` correctly encodes P as the conjecture, with the answer being that P is false. ✓ + +- **Root condition `∀ z ∈ f.roots, ‖z‖ ≤ r`**: Over ℂ (algebraically closed), `f.roots` for a monic (hence nonzero) polynomial gives all roots with multiplicity as a `Multiset`. Membership in the multiset correctly captures "all roots satisfy the bound." ✓ + +- **Sublevel set `{z : ℂ | ‖Polynomial.eval z f‖ < 1}`**: For z : ℂ, `‖z‖` is `Complex.abs z = |z|`. This correctly formalizes {z : |f(z)| < 1}. ✓ + +- **Diameter via `diam (connectedComponentIn S z)`**: `connectedComponentIn S z` is the connected component of S containing z. Since the existential requires `z ∈ S`, this is always a nonempty subset of S, and `diam` (which is `Metric.diam` via the `open Metric`) correctly computes its diameter. ✓ + +- **Edge case (r < 0)**: The formalization doesn't require r > 0. For r < 0, `‖z‖ ≤ r` is impossible for any root, so only rootless monic polynomials qualify (i.e., f = 1, a degree-0 monic polynomial). Then S = {z : ‖1‖ < 1} = ∅, and the existential `∃ z ∈ S, ...` is vacuously false. This makes P false at r < 0, which is consistent with `answer(False)` but for a mathematically uninteresting reason. This is a **minor inelegance**, not an error. + +- **Edge case (r = 0)**: All roots must be 0, so f(z) = zⁿ. The sublevel set is {z : |z|ⁿ < 1} = open unit disk, which is connected with diameter 2. We need 2 - 0 = 2 < diam(component) = 2, i.e., 2 < 2, which is false (strict inequality). So P also fails at r = 0 with the strict inequality `2 - r < diam(...)`. The original problem likely intends r > 0. Again, this doesn't affect the overall answer (False), but it means P fails for a degenerate reason at r = 0 in addition to the substantive Pommerenke counterexamples for r > 1. + +**No mathematical flaws identified.** The formalization is a faithful encoding of the Erdős–Herzog–Piranian conjecture as disproved by Pommerenke. diff --git a/ai-review/105.md b/ai-review/105.md new file mode 100644 index 0000000000..b702783e66 --- /dev/null +++ b/ai-review/105.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 105 + +## 1. Code Reuse + +**The formalization is largely self-contained but could benefit from shared definitions used across nearby geometric problems.** + +- **`EuclideanSpace ℝ (Fin 2)`** is written out in full throughout the file. Several nearby problems (209, 210, 211, 216, 735) define `abbrev Point2 := EuclideanSpace ℝ (Fin 2)` for readability. Problem 105 could use this same abbreviation. + +- **Line definition via `Module.finrank ℝ L.direction = 1`:** This is inlined in the theorem statement. Problem 209 (`209.lean:33–34`) factors this out as `IsLine`. Problem 105 could import or mirror this definition for clarity, though the inline usage follows a common pattern in the codebase (e.g., 101, 102, 588). + +- **"Line avoids a set" pattern:** The condition `∀ p, p ∈ B → p ∉ L` is specific to this problem and does not appear elsewhere in the codebase. No reuse opportunity here. + +- **Collinearity:** The formalization uses Mathlib's `Collinear ℝ` directly, which is the canonical choice. `FormalConjecturesForMathlib/Geometry/2d.lean` defines `NonTrilinear` (no three collinear), but this is not relevant here since Problem 105 requires "not all points collinear," which `¬ Collinear ℝ (A : Set _)` captures correctly. + +**Recommendation:** Minor. Consider introducing a `Point2` abbreviation for consistency with 209–211. The `IsLine` helper from 209 could also be reused, but the inline pattern is acceptable given codebase conventions. + +## 2. Citations + +The formalization includes a link to [erdosproblems.com/105](https://www.erdosproblems.com/105) and mentions "Erdős–Purdy" and "Xichuan" in the docstring. The website lists the following additional information that should be documented: + +**References missing from the docstring:** +- **[ErPu95]** Erdős, P. and Purdy, G., *Some extremal problems in combinatorial geometry*, 1995 — the original source of the conjecture. +- **[Er95]** — additional Erdős reference listed on the website. +- **[Be83]** Beck, J. and **[SzTr83]** Szemerédi, E. and Trotter, W.T. — proved the related result that the conjecture holds when $|B| = cn$ for a constant $c > 0$ (this is Erdős Problem 211). + +**Related problems missing:** +- Problem #211 — Beck and Szemerédi–Trotter's result on $\gg kn$ lines, which is directly related to the variants mentioned in the docstring. + +**Other metadata:** +- Prize: $50 (noted on website). +- Status: Disproved (verified in Lean, per the website). + +**Recommendation:** Add full citation entries for [ErPu95] and note the connection to Problem 211 (Beck/Szemerédi–Trotter). The reference to "Xichuan" should ideally include the full name or a citation if available on the website. + +## 3. Variants + +The docstring mentions several variants but none are formalized: + +**Mentioned but not formalized:** +1. **$n - 4$ variant:** Does the conjecture hold if $|B| = n - 4$? This is stated as open. +2. **$n - O(1)$ variant:** More generally, for $|B| = n - c$ for some constant $c$. +3. **$(1 - o(1))n$ variant:** Even more general weakening. +4. **Hickerson's construction:** Demonstrates the conjecture fails when $|B| = n - 2$. This could be formalized as a companion statement asserting the existence of a counterexample. + +**Connection to Problem 211:** +Beck [Be83] and Szemerédi–Trotter [SzTr83] proved that with $|B| = cn$ (constant fraction), the conclusion holds. This is a natural quantitative strengthening that bridges the gap between the disproved $n - 3$ case and the known-to-hold $cn$ case. A variant theorem referencing Problem 211 would provide useful context. + +**Assessment:** The core conjecture (and its negation) is captured. The docstring does a good job of documenting the landscape of variants, but formalizing at least one (e.g., the $n - 4$ open question, or Hickerson's $n - 2$ counterexample) would strengthen the file. + +## 4. Readability + +The code is clear and well-structured: + +- **Good:** The docstring explains the conjecture, its history, and the disproof clearly. The note about Hickerson's $n - 2$ construction and the open $n - 4$ question provides valuable context. +- **Good:** The `answer(False) ↔ ...` pattern correctly signals that this is a disproved conjecture. +- **Good:** The namespace `Erdos105` avoids collisions. +- **Minor:** The set comprehension `{p : EuclideanSpace ℝ (Fin 2) | p ∈ (A : Set _) ∧ p ∈ L}` on line 53 could equivalently be written as `(A : Set _) ∩ (L : Set _)` using set intersection, which may be slightly more idiomatic. However, the current form is unambiguous and consistent with other problems in the codebase (101, 588). +- **Minor:** The type annotation `(A : Set _)` appearing in lines 50, 53, and 54 is necessary for coercion from `Finset` to `Set`, but repeating the full `EuclideanSpace ℝ (Fin 2)` type in the membership condition (line 53–54) is verbose. A `Point2` abbreviation would help. + +## 5. Formalizability + +**Assessment: Highly formalizable. Very low ambiguity.** + +The problem statement is precise and concrete: +- "Disjoint finite sets $A, B \subset \mathbb{R}^2$" with specified cardinalities — unambiguous. +- "Not all of $A$ on a single line" — standard geometric condition, cleanly captured by `¬ Collinear ℝ`. +- "A line containing at least two points from $A$ and no points from $B$" — unambiguous geometric predicate. +- The yes/no nature of the question and its resolved status (disproved) make formalization straightforward. + +There is essentially no ambiguity in this problem. The only interpretive choice is the exact meaning of "line" (infinite line vs. line segment), which is universally understood to mean an infinite affine line in this context, correctly captured by the 1-dimensional `AffineSubspace` formalization. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`answer(False) ↔ ∀ n ...`**: This asserts that the universal statement is false — i.e., there exists a counterexample to the conjecture. This correctly encodes the fact that Xichuan disproved the conjecture. **Correct.** + +- **Lower bound `3 ≤ n`**: We need $|B| = n - 3 \geq 0$, so $n \geq 3$. We also need "not all collinear" to be a nontrivial condition, which requires $|A| \geq 3$. The bound $n \geq 3$ is tight and correct. **Correct.** + +- **`A.card = n` and `B.card = n - 3`**: Directly encodes the cardinality constraints. Note that `n - 3` in `ℕ` is natural number subtraction, which is the intended behavior here since $n \geq 3$. **Correct.** + +- **`Disjoint A B`**: Uses Mathlib's `Disjoint` on `Finset`, which asserts `A ∩ B = ∅`. This correctly captures the disjointness requirement. **Correct.** + +- **`¬ Collinear ℝ (A : Set (EuclideanSpace ℝ (Fin 2)))`**: Asserts that the points of $A$ do not all lie on a single affine line. Mathlib's `Collinear` checks whether a set is contained in a single 1-dimensional affine subspace. **Correct.** + +- **Line existence**: The existential quantifies over all `AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2))` with `Module.finrank ℝ L.direction = 1` (a line). The condition `2 ≤ Set.ncard {p | p ∈ A ∧ p ∈ L}` correctly requires at least two points of $A$ on the line. The condition `∀ p, p ∈ B → p ∉ L` correctly requires the line to avoid all of $B$. **Correct.** + +- **Potential subtlety with `Set.ncard`**: The set `{p | p ∈ A ∧ p ∈ L}` is finite (bounded by `A.card`), so `Set.ncard` agrees with the true cardinality. No issues here. **Correct.** + +- **Category tag `research solved`**: Correctly reflects the disproved status. The AMS classification `5 52` (convex and discrete geometry) is appropriate. **Correct.** + +**Verdict:** The formalization is mathematically faithful to the original problem statement and correctly encodes the disproved conjecture. No errors or incompleteness identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor improvements possible | Could use `Point2` abbreviation and `IsLine` helper from nearby files (209–211) | +| Citations | Needs improvement | Missing [ErPu95], [Er95], [Be83]/[SzTr83] references; "Xichuan" needs full citation; connection to Problem 211 not noted | +| Variants | Acceptable | Docstring documents the landscape well; formalizing the $n-4$ open variant or Hickerson's $n-2$ counterexample would add value | +| Readability | Good | Clear docstring, standard patterns; minor verbosity from repeated type annotations | +| Formalizability | Excellent | Unambiguous, precise problem statement with no interpretive choices | +| Correctness | Correct | Mathematically faithful; `answer(False)` correctly reflects the disproved status; all conditions are properly encoded | diff --git a/ai-review/1050.md b/ai-review/1050.md new file mode 100644 index 0000000000..219251b20b --- /dev/null +++ b/ai-review/1050.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 1050 + +## 1. Code Reuse + +No significant code reuse opportunities. The formalization is a single, self-contained theorem about irrationality of a specific series. The neighboring problems 1049 and 1051 deal with related irrationality questions but use structurally different series, so no shared definitions or lemmas can be factored out. Problem 1049 does use a similar pattern (`∑' n : ℕ+, 1 / ((t : ℝ) ^ (n : ℕ) - 1)` with `Irrational`), but the two problems diverge enough (1049 uses `ℕ+` and a variable base `t`, 1050 uses `ℕ` with a shifted index and fixed base 2) that merging would not simplify either. + +## 2. Citations + +The formalization's citations are **consistent with the website**. The website lists: + +| Ref | Website | Formalization | +|-----|---------|---------------| +| [Er48] | Erdős, P. | Present in module docstring ✓ | +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | Present in both module and theorem docstrings as [ErGr80, p.62] ✓ | +| [Er88c] | Erdős, P. | Present in both module and theorem docstrings as [Er88c, p.102] ✓ | +| [Bo91] | Borwein, P. | Present in both module and theorem docstrings ✓ | + +**Minor note:** The website does not provide full journal/title details for [Er48], [Er88c], or [Bo91] — only author names. However, Problem 1049's file provides the full citation for [Er48] as "Erdős, P., On arithmetical properties of Lambert series. J. Indian Math. Soc. (N.S.) (1948), 63-66." and Problem 1051 provides [Er88c] as "Erdős, P., On the irrationality of certain series: problems and results. New advances in transcendence theory (Durham, 1986) (1988), 102-109." For consistency across the codebase, Problem 1050 could benefit from including these full citations (at least for [Er48] and [Er88c]) in its module docstring, since the information is already available in neighboring files. + +The website also references **OEIS sequence A331372**, which is not mentioned in the formalization. This is informational and not essential. + +## 3. Variants + +**Two natural variants are missing:** + +1. **Borwein's general irrationality result** — The module docstring describes it but it is not formalized: for any integer $q \geq 2$ and rational $r \neq 0$ (with $r \neq -q^n$ for all $n \geq 1$), the series $\sum_{n=1}^{\infty} 1/(q^n + r)$ is irrational. This is the result that actually proves Problem 1050 and is a natural variant to include. A possible formalization: + + ```lean + @[category research solved, AMS 11 40] + theorem erdos_1050.variants.borwein_general (q : ℤ) (r : ℚ) (hq : q ≥ 2) (hr : r ≠ 0) + (hqr : ∀ n : ℕ+, (r : ℝ) ≠ -(q : ℝ) ^ (n : ℕ)) : + Irrational (∑' n : ℕ+, 1 / ((q : ℝ) ^ (n : ℕ) + (r : ℝ))) := by + sorry + ``` + +2. **Erdős's transcendence conjecture** — Erdős conjectured that $\sum 1/(2^n + t)$ should be *transcendental* for every nonzero integer $t$. Borwein proved irrationality but the transcendence question appears to remain open. This is explicitly mentioned in the module docstring but not formalized: + + ```lean + @[category research open, AMS 11 40] + theorem erdos_1050.variants.transcendence : + answer(sorry) ↔ ∀ t : ℤ, t ≠ 0 → (∀ n : ℕ+, (t : ℝ) ≠ -(2 : ℝ) ^ (n : ℕ)) → + Transcendental ℚ (∑' n : ℕ+, 1 / ((2 : ℝ) ^ (n : ℕ) + (t : ℝ))) := by + sorry + ``` + +## 4. Readability + +The code is **clean and readable**. The `n + 1` index shift to accommodate `ℕ` starting at 0 is standard Lean practice. The module docstring provides good mathematical context. The theorem docstring is concise and references the relevant sources. + +One minor suggestion: the theorem currently writes `(2 : ℝ) ^ (n + 1) - 3`. An alternative formulation using `ℕ+` (as in Problem 1049) would avoid the index shift and read more naturally: + +```lean +Irrational (∑' (n : ℕ+), (1 : ℝ) / ((2 : ℝ) ^ (n : ℕ) - 3)) +``` + +This is stylistically closer to the original $\sum_{n=1}^{\infty}$ and consistent with how 1049 handles the same pattern. Either formulation is mathematically equivalent. + +## 5. Formalizability + +**Fully formalizable — no ambiguity.** The problem asks whether a specific real number (a convergent infinite series) is irrational. The series is well-defined: $2^n - 3 \neq 0$ for all $n \geq 1$ (since $2^n = 3$ has no integer solution), so no division-by-zero issues arise. The series converges absolutely since $|1/(2^n - 3)| = O(2^{-n})$. The answer (irrational) is definitively established by Borwein's result. + +**Ambiguity score: 0/5** (completely unambiguous). + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **Index correspondence:** The Lean expression `∑' (n : ℕ), (1 : ℝ) / ((2 : ℝ) ^ (n + 1) - 3)` sums over $n = 0, 1, 2, \ldots$, yielding terms $1/(2^1 - 3), 1/(2^2 - 3), 1/(2^3 - 3), \ldots$, which is exactly $\sum_{m=1}^{\infty} 1/(2^m - 3)$ under the substitution $m = n + 1$. ✓ + +- **answer(True):** The problem is marked as solved (proved by Borwein [Bo91]) and the answer is `True` — the sum is indeed irrational. ✓ + +- **`∑'` (tsum) usage:** The series converges absolutely (terms are $O(2^{-n})$ for large $n$), so `tsum` is appropriate and will agree with the classical series value. ✓ + +- **Category tag `research solved`:** Correct — Borwein [Bo91] proved the result. ✓ + +- **AMS classification `11 40`:** Number Theory (11) + Sequences/Series/Summability (40) is appropriate. ✓ + +- **No division-by-zero issues:** For all $n : \mathbb{N}$, $2^{n+1} - 3 \neq 0$ (since $2^{n+1} \in \{2, 4, 8, 16, \ldots\}$, none of which equal 3). In Lean, division by zero in `ℝ` returns 0 by convention, but this edge case never arises here. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No opportunities — standalone problem | +| Citations | Match the website; could add full citations from neighboring files | +| Variants | Two natural variants missing (Borwein general result, transcendence conjecture) | +| Readability | Clean; minor suggestion to use `ℕ+` for consistency with Problem 1049 | +| Formalizability | Fully formalizable, zero ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/1053.md b/ai-review/1053.md new file mode 100644 index 0000000000..4c006d98d3 --- /dev/null +++ b/ai-review/1053.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 1053 + +## 1. Code Reuse + +**Issue: Custom `sumOfDivisors` should be replaced with Mathlib's `σ 1 n`.** + +The file defines a custom `sumOfDivisors` function: + +```lean +def sumOfDivisors (n : ℕ) : ℕ := + (Nat.divisors n).sum id +``` + +This is definitionally equal to Mathlib's `Nat.ArithmeticFunction.sigma 1 n` (i.e., `σ 1 n`), which computes `∑ d in n.divisors, d^1 = ∑ d in n.divisors, d`. At least 16 other files in the codebase already use `σ 1 n` via `open scoped ArithmeticFunction.sigma` (e.g., `ErdosProblems/825.lean`, `ErdosProblems/1060.lean`, `ErdosProblems/1061.lean`, `Wikipedia/AlmostPerfectNumbers.lean`, etc.). The custom definition should be removed in favor of the standard Mathlib version to enable lemma reuse and maintain consistency. + +Similarly, the `IsMultiplyPerfect` predicate could be expressed directly in terms of `σ 1 n`: +```lean +def IsMultiplyPerfect (n k : ℕ) : Prop := + n ≥ 1 ∧ σ 1 n = k * n +``` + +Note also that Mathlib provides `Nat.Perfect` for the specific case k = 2, used in `Wikipedia/PerfectNumbers.lean` and `Wikipedia/LeinsterGroup.lean`. + +## 2. Citations + +The formalization cites: + +> [Gu04] Guy, R., *Unsolved Problems in Number Theory*, 3rd edition, Springer, 2004. + +This matches the website, which states the problem comes from "problem B2 of Guy's collection." + +**Missing context from the website:** The erdosproblems.com page includes an additional remark attributed to Guy: *"It has even been suggested that there may be only finitely many k-perfect numbers with k ≥ 3."* This stronger conjecture is not mentioned in the docstring and could be added for completeness. The website also notes that the largest known k-value for which a k-perfect number has been discovered is k = 11. + +The citation format is otherwise consistent with what appears on the website. + +## 3. Variants + +**Missing variant:** The website mentions a stronger conjecture — that there are only finitely many k-perfect numbers with k ≥ 3. This could be formalized as an additional conjecture: + +```lean +theorem erdos_1053_variant : answer(sorry) ↔ + Set.Finite {n : ℕ | ∃ k : ℕ, k ≥ 3 ∧ IsMultiplyPerfect n k} := by + sorry +``` + +This variant is a stronger statement than the main conjecture (if only finitely many k-perfect numbers exist for k ≥ 3, then trivially k = o(log log n)). Including it would better reflect the full scope of the problem as discussed on the website. + +## 4. Readability + +- **Namespace and definitions are clear.** The `IsMultiplyPerfect` predicate is well-named and its docstring is accurate. +- **The `sumOfDivisors` definition is redundant** and slightly obscures the connection to the standard `σ` function. Replacing it with `σ 1 n` would be immediately recognizable to anyone familiar with Mathlib's number theory library. +- **The main theorem docstring** is well-written and clearly explains the equivalence between the little-o formulation and the finiteness formulation. +- **Minor:** `open Finset Real` opens `Finset` but nothing from `Finset` appears to be used directly in the theorem statement. Only `Real` (for `Real.log`) is needed. + +## 5. Formalizability + +**Assessment: Clearly formalizable with low ambiguity.** + +The problem statement "Must k = o(log log n)?" is a precise asymptotic question. The only interpretation choice is what "k = o(log log n)" means when the domain is the discrete set of multiply perfect numbers rather than a continuous variable. The formalization correctly interprets this as: for every ε > 0, only finitely many multiply perfect numbers n satisfy σ(n)/n ≥ ε · log(log(n)). This is the standard translation of little-o notation to a finiteness condition on a discrete set, and is unambiguous. + +The `answer(sorry)` wrapper correctly reflects that the problem is open (the answer — true or false — is unknown). + +## 6. Correctness + +**The formalization is mathematically correct**, with a few observations: + +1. **The little-o translation is correct.** The statement "k = o(log log n) as n → ∞ among multiply perfect numbers" is equivalent to: for every ε > 0, {n multiperfect : σ(n)/n ≥ ε · log(log n)} is finite. The formalization captures this precisely. + +2. **The `n ≥ 1` guard is necessary and correct.** Without it, n = 0 would satisfy `σ(0) = k · 0` for all k, polluting the set with spurious elements. + +3. **Uniqueness of k:** For a given multiply perfect n ≥ 1, the value k = σ(n)/n is uniquely determined. The existential quantification `∃ k` in the set comprehension is therefore harmless — each n contributes at most one witness k. + +4. **Behavior at small n:** For small n (e.g., n ≤ 15), `Real.log (Real.log n)` is negative or zero (since log(n) < 1 for n < e ≈ 2.718, and log of a value ≤ 0 is 0 in Mathlib). This means `ε * log(log n) ≤ 0 < k` for these n, so they are automatically included in the set. This is harmless: there are finitely many such n, so they don't affect the finiteness claim. However, one could argue that a cleaner formulation would restrict to n sufficiently large (e.g., n ≥ 16 so that log(log n) > 0), though the current version is equivalent and arguably simpler. + +5. **Natural number vs. real cast of k:** The condition `(k : ℝ) ≥ ε * Real.log (Real.log (n : ℝ))` correctly casts k to ℝ for comparison with the real-valued right-hand side. + +**No mathematical errors detected.** + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Needs improvement | Should use Mathlib's `σ 1 n` instead of custom `sumOfDivisors` | +| Citations | Good | [Gu04] is correct; could add Guy's remark about finitely many k ≥ 3 | +| Variants | Incomplete | Missing the "finitely many k-perfect with k ≥ 3" variant | +| Readability | Good | Clean code; minor unused `open Finset` | +| Formalizability | Excellent | Precise, unambiguous statement | +| Correctness | Correct | Faithful translation of the little-o condition | diff --git a/ai-review/1057.md b/ai-review/1057.md new file mode 100644 index 0000000000..4985795143 --- /dev/null +++ b/ai-review/1057.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 1057 + +## 1. Code Reuse + +**Duplicate `IsCarmichael` definition.** The codebase contains two independent definitions of Carmichael numbers: + +- `Erdos1057.IsCarmichael` in `FormalConjectures/ErdosProblems/1057.lean` — uses Korselt's criterion directly (squarefree, composite, and `(p - 1) ∣ (n - 1)` for all prime divisors `p`). +- `AgohGiuga.IsCarmichael` in `FormalConjectures/Wikipedia/AgohGiuga.lean` — uses the Fermat pseudoprime characterization (`∀ b ≥ 1, n.Coprime b → n.FermatPsp b`). + +The AgohGiuga file already proves `korselts_criterion`, establishing their equivalence (for composite `a`). These two definitions should be unified into a single shared definition (likely in a utility file or `FormalConjecturesForMathlib`), with one characterization as the definition and the other as a theorem. The Erdos 1057 file could then import and reuse it. + +Additionally, `FormalConjecturesForMathlib/Data/Nat/Prime/Composite.lean` provides `Nat.Composite` as `1 < n ∧ ¬n.Prime`, which matches the first two conjuncts of `Erdos1057.IsCarmichael`. The definition could be refactored to use `n.Composite` directly. + +## 2. Citations + +The docstring includes three references: +- **[AGP94]** Alford, Granville, Pomerance — correctly cited. +- **[Ha08]** Harman — correctly cited. +- **[Er56c]** Erdős — correctly cited. + +**Missing from the website:** +- **Lichtman (2022)** improved the lower bound to `C(x) > x^{0.3389}`. The website lists this result, but the docstring only mentions Harman's `x^{0.33336704}`. +- **Erdős's upper bound**: `C(x) < x · exp(−c · log x · log log log x / log log x)` for a constant `c > 0` — mentioned on the website but not in the docstring. +- **Pomerance's heuristic**: `C(x) = x · exp(−(1+o(1)) · (log x · log log log x) / (log log x))` — mentioned on the website but not in the docstring. +- **Guy's collection**: listed as problem A13 — not mentioned in docstring. +- **OEIS A006931** — not mentioned in docstring. + +## 3. Variants + +The problem on erdosproblems.com asks a single question: "Is it true that `C(x) = x^{1-o(1)}`?" There are no additional variants listed on the website. The formalization captures the sole variant. + +One could consider formalizing related results as companion theorems (e.g., the known lower/upper bounds, or the infinitude of Carmichael numbers), but these are not strictly part of the problem statement. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring clearly explains the `o(1)` formulation and its equivalent log-ratio formulation. +- The `IsCarmichael` definition has a clear docstring referencing Korselt's criterion. +- `carmichaelCount` is well-named and clearly documented. +- The `open Finset Filter Real Classical` is somewhat broad but acceptable for a problem file. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The statement `C(x) = x^{1-o(1)}` is a standard asymptotic notation with a precise meaning: `log C(x) / log x → 1` as `x → ∞`. This is a clean limit statement with no ambiguity. The formalization correctly translates this into a `Tendsto` statement. + +The definition of Carmichael number via Korselt's criterion is a well-known, fully precise characterization. There is no ambiguity in any component of the problem. + +## 6. Correctness + +**Assessment: Mathematically correct.** + +Detailed analysis: + +- **`IsCarmichael` definition**: Uses Korselt's criterion: `1 < n ∧ ¬ n.Prime ∧ Squarefree n ∧ ∀ p, p.Prime → p ∣ n → (p - 1) ∣ (n - 1)`. This is the standard characterization, and it is correctly stated. Natural number subtraction is safe here: `p ≥ 2` (since `p` is prime) and `n ≥ 2` (from `1 < n`), so both `p - 1` and `n - 1` are well-defined in `ℕ`. + +- **`carmichaelCount`**: Counts `IsCarmichael` numbers in `Finset.Icc 1 x`. Since `IsCarmichael` requires `1 < n`, the value 1 is never counted — the effective range is `{2, ..., x}`, which is the standard convention for counting Carmichael numbers up to `x`. + +- **Main theorem**: States `answer(sorry) ↔ Tendsto (fun x => log (carmichaelCount x) / log x) atTop (nhds 1)`. The `answer(sorry)` pattern is appropriate for an open problem where the truth value is unknown. The limit formulation `log C(x) / log x → 1` is the correct translation of `C(x) = x^{1-o(1)}`. + +- **Consistency with known results**: The lower bound `C(x) > x^{0.3389}` (Lichtman) gives `log C(x) / log x > 0.3389`, and Erdős's upper bound implies `log C(x) / log x → 1` from above (since the correction term `c · log log log x / log log x → 0`). Pomerance's heuristic predicts the limit equals 1. So the conjecture is widely believed to be true, consistent with the formalization. + +- **No mathematical flaws identified.** The formalization is complete and correct. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | Duplicate `IsCarmichael` definitions across files; should unify | +| Citations | Minor gaps | Missing Lichtman 2022 result and Pomerance heuristic from website | +| Variants | Complete | Single variant, correctly captured | +| Readability | Good | Clean, well-documented code | +| Formalizability | Excellent | Fully precise, no ambiguity | +| Correctness | Correct | Mathematically sound formalization | diff --git a/ai-review/1058.md b/ai-review/1058.md new file mode 100644 index 0000000000..83fa5500bb --- /dev/null +++ b/ai-review/1058.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 1058 + +## 1. Code Reuse + +**`nextPrime` from ErdosProblems/930.lean (line 56):** +The codebase already defines: +```lean +def nextPrime (k : ℕ) : ℕ := Nat.find (Nat.exists_infinite_primes k) +``` +which returns the least prime `p ≥ k`. Using `nextPrime (n + 1)` for `q` and `nextPrime (q + 1)` for `r` would eliminate the verbose inline definitions of "smallest prime strictly greater than `n`" and "smallest prime strictly greater than `q`". This would shorten the statement and align with existing conventions. + +**`IsSmoothWrt` from ErdosProblems/983.lean (line 41):** +```lean +def IsSmoothWrt (a : ℕ) (P : Finset ℕ) : Prop := + ∀ p : ℕ, Nat.Prime p → p ∣ a → p ∈ P +``` +The condition "every prime factor of `n! + 1` is `q` or `r`" is exactly `IsSmoothWrt (n.factorial + 1) {q, r}`. However, introducing a dependency on another problem file just for a one-liner definition may not be worthwhile unless it's refactored into a shared utility. + +**`Nat.primeFactors` (Mathlib):** +Could express the condition as `(n.factorial + 1).primeFactors ⊆ {q, r}`, which is arguably the most idiomatic Mathlib phrasing. + +## 2. Citations + +The formalization includes: +- `[Gu04] Guy, R., Unsolved Problems in Number Theory, 3rd ed. Springer, 2004.` +- `[Lu01] Luca, F., On a conjecture of Erdős and Stewart, Math. Comp. 70 (2001), 893–896.` + +The website (erdosproblems.com/1058, last edited 28 September 2025) confirms both references and notes this as "a conjecture of Erdős and Stewart, as reported in problem A2 of Guy's collection." The docstring accurately reports this provenance. Citations are consistent with the website. + +## 3. Variants + +The website does not mention any variants of this problem. The formalization captures the single known statement. No variants are missing. + +## 4. Readability + +**Good:** +- The inline comments (`-- q is the smallest prime strictly greater than n`, etc.) are clear and helpful. +- The module docstring provides good mathematical context including the equivalence between the index-based and direct formulations. +- The `answer(True)` flag correctly reflects the solved status. + +**Could improve:** +- The existential quantification over `q` and `r` with six conjuncts is somewhat dense. Using `nextPrime` (from 930.lean) or a `let` binding would make the statement more readable: + ```lean + let q := nextPrime (n + 1) + let r := nextPrime (q + 1) + ``` + This would reduce the six-conjunct existential to just the core divisibility condition. + +Overall readability is adequate but not optimal. + +## 5. Formalizability + +The problem is fully precise and unambiguously formalizable. The statement asks a yes/no finiteness question about a clearly defined set of natural numbers. All components — primes, factorials, divisibility, and the "next prime" relation — have standard Mathlib counterparts. + +**Minor indexing ambiguity in the original:** The problem states "Let $2 = p_1 < p_2 < \cdots$" and asks about $n \in [p_{k-1}, p_k)$. For $k = 1$ this requires $p_0$, which is not defined in the stated sequence. Since the known solutions include $n = 1$ (requiring $k = 1$), the implicit convention must be $p_0 = 1$ or some equivalent lower bound. The formalization wisely avoids this ambiguity by defining `q` and `r` directly rather than referencing prime indices. + +**Ambiguity level: Very low.** The mathematical content is unambiguous. + +## 6. Correctness + +### Core correctness: **Correct** + +The formalization states: +```lean +Set.Finite {n : ℕ | ∃ (q r : ℕ), + Nat.Prime q ∧ n < q ∧ (∀ p, Nat.Prime p → n < p → q ≤ p) ∧ + Nat.Prime r ∧ q < r ∧ (∀ p, Nat.Prime p → q < p → r ≤ p) ∧ + (∀ p, Nat.Prime p → p ∣ (n.factorial + 1) → p = q ∨ p = r)} +``` + +This correctly captures: +- **q = the smallest prime > n** (i.e., `p_k` where `n ∈ [p_{k-1}, p_k)`): The conditions `Nat.Prime q ∧ n < q ∧ (∀ p, Nat.Prime p → n < p → q ≤ p)` uniquely determine `q`. +- **r = the smallest prime > q** (i.e., `p_{k+1}`): Analogous conditions uniquely determine `r`. +- **All prime factors of `n! + 1` lie in `{q, r}`**: The universal quantifier over prime divisors correctly allows for either, both, or (vacuously) neither prime to divide `n! + 1`. + +### Verified against known solutions: +| n | n! + 1 | q (next prime > n) | r (next prime > q) | Prime factors of n!+1 | All in {q,r}? | +|---|--------|---------------------|---------------------|------------------------|---------------| +| 1 | 2 | 2 | 3 | {2} | Yes (q) | +| 2 | 3 | 3 | 5 | {3} | Yes (q) | +| 3 | 7 | 5 | 7 | {7} | Yes (r) | +| 4 | 25 | 5 | 7 | {5} | Yes (q) | +| 5 | 121 | 7 | 11 | {11} | Yes (r) | + +All five known solutions satisfy the formalized condition. ✓ + +### Edge case — n = 0: +`0! + 1 = 2`, `q = 2`, `r = 3`. Prime factors of 2 are `{2} = {q}`. So `n = 0` satisfies the condition and is included in the set. The original problem's index-based formulation would exclude `n = 0` (since `n ∈ [p_{k-1}, p_k)` with `p_1 = 2` requires `n ≥ 1` for well-definedness). However, this discrepancy is immaterial: adding or removing a single element does not affect finiteness. The `answer(True)` result is correct regardless. + +### `answer(True)` flag: **Correct** +Luca (2001) proved the set is finite (in fact, equal to `{1, 2, 3, 4, 5}`), so `True` is correct. + +### Interpretation of "only primes dividing": +The phrase "the only primes dividing `n! + 1` are `p_k` and `p_{k+1}`" could be read as requiring both primes to divide `n! + 1`, but the known solutions show this is not the case (e.g., for `n = 1`, only `p_k = 2` divides `2`). The formalization correctly uses the containment reading (all prime factors belong to `{q, r}`), matching the intended meaning. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `nextPrime` from 930.lean could simplify the statement | +| Citations | Correct and consistent with website | +| Variants | None missing | +| Readability | Adequate; could benefit from `nextPrime` or `let` bindings | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | **Correct and complete** | diff --git a/ai-review/106.md b/ai-review/106.md new file mode 100644 index 0000000000..66c172f127 --- /dev/null +++ b/ai-review/106.md @@ -0,0 +1,123 @@ +# AI Review: Erdős Problem 106 + +## 1. Code Reuse + +**Several definitions in `106.lean` overlap with existing infrastructure in the codebase, though type differences complicate direct reuse.** + +- **`unitSquare`** (lines 66–67): This is a verbatim duplicate of `Mathoverflow34145.unitSquare` in `Mathoverflow/34145.lean:64–65`. Both define the closed unit square `{p | 0 ≤ p.1 ∧ p.1 ≤ 1 ∧ 0 ≤ p.2 ∧ p.2 ≤ 1}` on `ℝ × ℝ`. A shared utility definition would eliminate the duplication. + +- **`SquarePlacement` and rotation logic** (lines 37–52): The rotation-and-translation pattern for placing rotated shapes is closely related to `Mathoverflow34145.rigidMotion` (line 49) and `Rectangle.toSet` (line 68). Problem 106 inlines the rotation into the `region` definition, while Mathoverflow 34145 factors it out as a reusable `rigidMotion` function. The latter approach is more modular and could be adapted for square placements. + +- **`SquarePacking.lean`** (Wikipedia): Contains a generic `Packing` structure using isometric embeddings, a `Square` definition, and `UnitSquare`. However, there are two obstacles to reuse: (1) `SquarePacking.lean` works in `ℝ²` (`EuclideanSpace ℝ (Fin 2)`) while Problem 106 works in `ℝ × ℝ`, and (2) `SquarePacking.Square` uses open (strict) inequalities while Problem 106 needs both closed regions and open interiors. The `Packing` structure also doesn't naturally accommodate optimizing over total side-length (it packs fixed-size objects), so the mismatch is fundamental to the different nature of the problems. + +- **Triangle dissection problems** (633.lean, 634.lean): Share the pattern of `Fin n`-indexed configurations with closed regions, open interiors, and disjointness constraints. This is a common formalization idiom but is not factored into shared infrastructure. + +**Recommendation:** Extract `unitSquare` (closed, on `ℝ × ℝ`) into a shared geometric utility. The `rigidMotion` function from `Mathoverflow/34145.lean` could also be generalized and reused. The deeper `Packing` infrastructure from `SquarePacking.lean` is not directly applicable due to type and structural differences. + +## 2. Citations + +The formalization includes only a link to [erdosproblems.com/106](https://www.erdosproblems.com/106). The website provides significantly more detail that should be documented: + +**References present on the website but missing from the docstring:** +- **[ErGr75b]** — Erdős and Graham, early source for the conjecture +- **[Er94b], [Er95]** — Later Erdős papers discussing the problem +- **[Ha84]** — Halász: proved the constructions $f(k^2 + 2c + 1) \geq k + c/k$ and $f(k^2 + 2c) \geq k + c/(k+1)$ +- **[ErSo95]** — Erdős and Soifer +- **[CaSt05]** — Campbell and Staton +- **[Pr08]** — Praton: proved the general conjecture is equivalent to $f(k^2 + 1) = k$ +- **[Ra26]** — Raj Singh: demonstrated convergence equivalences + +**Partially cited:** +- **[BKU24]** — Baek, Koizumi, and Ueoro: The docstring mentions their axis-aligned result but only gives the authors' last names. The full citation should include the paper title and publication venue. + +**Other metadata from the website:** +- Erdős dated this conjecture to "more than 60 years ago" (relative to the 1990s papers) +- The problem status is listed as **open** and is noted as "falsifiable through finite counterexample" +- $f(2) = 1$ is credited to Erdős; $f(5) = 2$ is credited to Newman (personal communication) + +**Assessment:** The docstring correctly captures the core mathematical context (Cauchy–Schwarz upper bound, elementary lower bound, axis-aligned result) but should include proper citations, especially Halász [Ha84] for the general constructions and Praton [Pr08] for the equivalence result that justifies focusing on $k^2 + 1$. + +## 3. Variants + +The formalization captures only the core conjecture $f(k^2 + 1) = k$. + +**Missing variants and related results from the website:** + +- **Halász constructions:** $f(k^2 + 2c + 1) \geq k + c/k$ for $-k < c < k$ and $f(k^2 + 2c) \geq k + c/(k+1)$. These give more general lower bounds and could be formalized as separate lemmas. + +- **Axis-aligned variant (BKU24):** The theorem that $g(k^2 + 1) = k$ (where $g$ restricts to axis-aligned squares) is mentioned in the docstring but not formalized. This is a proven result and could be stated as a separate `@[category research solved]` theorem. BKU24 also proved the more general $g(k^2 + 2c + 1) = k + c/k$. + +- **Praton's equivalence:** Praton [Pr08] proved that the full conjecture (determining $f(n)$ for all $n$) is equivalent to just $f(k^2 + 1) = k$. This is mathematically important context — it justifies why the formalization only states the $k^2 + 1$ case. It could be formalized as a separate theorem. + +- **Secondary open question:** For which $n$ is $f(n+1) = f(n)$? This is a distinct open question mentioned on the website. + +- **Known values:** $f(2) = 1$ and $f(5) = 2$ could be stated as separate solved lemmas. + +**Assessment:** The core conjecture is correctly identified. The missing variants represent significant mathematical context. At minimum, the axis-aligned variant (which is proven) and Praton's equivalence theorem deserve formalization. + +## 4. Readability + +The code is well-structured and readable: + +- **Good:** Each definition (`SquarePlacement`, `region`, `sqInterior`, `unitSquare`, `IsValidSquareConfig`, `f`) has a clear docstring explaining the mathematical meaning. +- **Good:** The namespace `Erdos106` prevents name collisions. +- **Good:** The background section in the theorem docstring provides useful mathematical context (Cauchy–Schwarz, elementary lower bound, axis-aligned result). +- **Good:** The `region`/`sqInterior` split cleanly separates closed and open versions. +- **Minor:** The `region` and `sqInterior` definitions differ only in `≤` vs `<` but are written out in full. A shared helper parameterized by the comparison operator (or defining one in terms of the other via `interior`) would reduce duplication, though the current approach is arguably clearer. +- **Minor:** The name `sqInterior` uses the `sq` prefix to avoid collision with the topological `interior`, which is reasonable but slightly unconventional. A docstring note explaining this naming choice would help. +- **Minor:** The `let` bindings for `u` and `v` in `region` and `sqInterior` are identical. If these definitions are kept separate, a shared `rotatedCoords` helper would improve maintainability. + +## 5. Formalizability + +**Assessment: Formalizable with moderate subtlety. Low ambiguity in the problem statement itself; the main subtleties are in the definition of $f(n)$.** + +The problem statement is precise: +- "Non-overlapping squares" is standard: disjoint open interiors, which the formalization correctly captures. +- "Inside the unit square" is unambiguous: closed containment. +- "Possibly rotated" is handled by the angle parameter. +- $f(n)$ as the maximum total side-length is well-defined. + +**Subtlety — supremum vs. maximum:** The formalization defines $f(n)$ via `sSup`, which gives the supremum. In principle, one should verify that the supremum is attained (i.e., that it is actually a maximum). By compactness of the configuration space (the set of valid configurations is closed and bounded in a finite-dimensional space), the supremum is indeed attained, so `sSup` equals the true maximum. The formalization does not assert attainment, which is fine for stating the conjecture but would matter for proofs. + +**Subtlety — well-definedness of `sSup`:** The set `{s | ∃ config, ...}` is nonempty for all $n$ (take sufficiently small squares) and bounded above by $\sqrt{n}$ (by Cauchy–Schwarz applied to area). So `sSup` is well-defined and finite. For $n = 0$, the only configuration is the empty function, giving $s = 0$, so $f(0) = 0$. + +The problem as stated on the website is unambiguous and the formalization faithfully captures its meaning. + +## 6. Correctness + +**The formalization is mathematically correct and faithfully captures the conjecture.** + +Detailed analysis: + +- **Rotation formula** (lines 49–52): The transformation $(p_1 - c_1)\cos\theta + (p_2 - c_2)\sin\theta$ and $-(p_1 - c_1)\sin\theta + (p_2 - c_2)\cos\theta$ correctly computes the coordinates of the point $p$ in the rotated frame centered at $c$ with rotation angle $\theta$. This is the standard inverse rotation (rotating by $-\theta$). **Correct.** + +- **Region definition** (lines 48–52): A point is in the closed region iff its rotated coordinates satisfy $|u| \leq s/2$ and $|v| \leq s/2$. This correctly describes a square of side length $s$ centered at `center`, rotated by `angle`. **Correct.** + +- **Interior definition** (lines 57–61): Uses strict inequalities, giving the topological interior of the region. This is the right notion for "non-overlapping" (squares may share boundary points). **Correct.** + +- **Unit square** (lines 66–67): The closed unit square $[0,1]^2$. **Correct.** + +- **Valid configuration** (lines 75–77): Requires (1) each square's closed region is contained in the unit square, and (2) distinct squares have disjoint open interiors. This correctly formalizes "non-overlapping squares inside the unit square." **Correct.** + +- **$f(n)$ definition** (lines 84–86): Takes the supremum over all valid configurations of the sum of side lengths. The set is nonempty (for any $n$, small enough squares work) and bounded above (by $\sqrt{n}$ via Cauchy–Schwarz on areas). **Correct.** + +- **Conjecture statement** (lines 109–111): Uses `answer(sorry) ↔` for an open problem, which is the appropriate pattern. The statement `∀ k : ℕ, 0 < k → f (k ^ 2 + 1) = (k : ℝ)` correctly restricts to positive $k$ (for $k = 0$, $f(1) = 1 \neq 0$, so the restriction is necessary). The cast `(k : ℝ)` correctly converts the natural number to a real. **Correct.** + +- **Docstring claim about the lower bound** (lines 99–101): States that the lower bound $f(k^2 + 1) \geq k$ is achieved by subdividing into $k^2$ squares of side $1/k$ and replacing one with two squares of side $1/(2k)$. The total is $(k^2 - 1)/k + 2 \cdot 1/(2k) = (k^2 - 1)/k + 1/k = k$. **Correct.** + +- **`side_pos` constraint** (line 42): Requires `0 < side`, which means all squares in a configuration have positive side length. This is mathematically appropriate — a "square" with side length 0 is degenerate. **Correct.** + +**Potential concern — `sSup` of empty set at $n = 0$:** When $n = 0$, there is exactly one configuration (the empty function), and the sum is 0, so $f(0) = \text{sSup}\{0\} = 0$. This is well-behaved. **No issue.** + +**Overall verdict:** The formalization is mathematically correct and complete for the core conjecture. The `answer(sorry) ↔` pattern is correctly used. No mathematical errors were identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `unitSquare` duplicated from `Mathoverflow/34145.lean`; rotation logic could reuse `rigidMotion`; `SquarePacking.lean` has related but incompatible infrastructure | +| Citations | Needs improvement | Missing references: Halász [Ha84], Praton [Pr08], Erdős–Graham [ErGr75b], Erdős–Soifer [ErSo95], Campbell–Staton [CaSt05], Raj Singh [Ra26]; BKU24 needs full citation | +| Variants | Acceptable | Core conjecture captured; missing Halász general bounds, axis-aligned solved variant, Praton's equivalence theorem, and known values $f(2)=1$, $f(5)=2$ | +| Readability | Good | Clear docstrings, well-structured definitions; minor duplication between `region` and `sqInterior` | +| Formalizability | Excellent | Precise, unambiguous problem statement; `sSup` is well-defined by boundedness and nonemptiness | +| Correctness | Correct | Rotation, containment, disjointness, and conjecture statement are all mathematically faithful; `answer(sorry) ↔` pattern correctly used for open problem | diff --git a/ai-review/1066.md b/ai-review/1066.md new file mode 100644 index 0000000000..eee05f3d41 --- /dev/null +++ b/ai-review/1066.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 1066 + +**File:** `FormalConjectures/ErdosProblems/1066.lean` + +## 1. Code Reuse + +The codebase already provides `UnitDistancePlaneGraph` in +`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean:93-98`, +which defines the unit distance graph on a set of points in ℝ² as a `SimpleGraph`. The +current formalization inlines both the adjacency condition (`dist (f i) (f j) = 1`) and the +independent set condition, rather than using this existing definition or any `IsIndepSet` +infrastructure. Similarly, `indepNum` (independence number) is defined in +`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean`. + +The closely related Problem 1070 (`FormalConjectures/ErdosProblems/1070.lean`) uses an +almost identical formalization pattern. Both problems could benefit from shared +infrastructure — e.g., a definition for "valid unit-separated configuration" and +"independent set in the induced unit distance graph." However, the inline style is +conventional for this codebase and keeps each file self-contained, so this is a minor +observation rather than a strong recommendation. + +## 2. Citations + +The docstring references: +- **[Sw02]** Swanepoel, K., *Unit distances and diameters in Euclidean spaces*. Discrete & Computational Geometry 28 (2002), 351-370. +- **[PaTo96]** Pach, J. and Tóth, G., *How many unit equilateral triangles can be generated by n points in convex position?* (1996). + +The website (erdosproblems.com/1066) additionally mentions: +- **Pollack** — initial lower bound g(n) ≥ n/4 via the Four Color Theorem (Pach's observation). +- **Csizmadia** — improved lower bound to (9/35)n ≈ 0.257n, before Swanepoel. +- **Chung, Graham, and Pach** — earlier upper bound g(n) ≤ (6/19)n ≈ 0.316n. +- **Erdős** originally conjectured g(n) = n/3, disproved by Chung–Graham–Pach. +- **Related problem:** Problem #1070 (general unit distance independence number without the minimum-distance-1 separation constraint). + +**Recommendation:** The Pach–Tóth citation title may be imprecise. The website attributes the 5/16 upper bound to Pach and Tóth but the title cited ("How many unit equilateral triangles…") does not obviously correspond to an independent-set upper bound. This should be verified against the actual publication to ensure the correct paper is referenced. Additionally, the historical bounds and the connection to Problem 1070 could be mentioned in the module docstring for context. + +## 3. Variants + +The formalization captures: +- ✅ Lower bound: g(n) ≥ (8/31)n (Swanepoel) +- ✅ Upper bound: g(n) ≤ (5/16)n (Pach–Tóth) + +**Missing variants:** +- **Erdős's original conjecture g(n) = n/3** — disproved, but could be noted or formalized as a false statement for completeness. +- **The limit question:** The problem asks to estimate lim g(n)/n. This could be formalized as a statement that the limit exists and lies in [8/31, 5/16]. +- **Higher-dimensional generalization:** The website notes Erdős asked whether g_d(n) ≫ n/d in ℝ^d. This is a natural variant to formalize. +- **The n/4 lower bound** (via Four Color Theorem / planarity) — a weaker but more elementary result that could serve as a separate variant. + +## 4. Readability + +The code is clean and readable. The module docstring clearly states the problem, current bounds, and references. The two theorems are well-separated with appropriate individual docstrings. A few minor points: + +- The lower bound theorem includes `(hn : n ≥ 1)` while the upper bound uses `∃ N₀`. This asymmetry is mathematically appropriate (the lower bound holds for all n ≥ 1; the upper bound is existential in the threshold). +- The independent set condition `∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1` is clear but verbose. Using `UnitDistancePlaneGraph` + `IsIndepSet` would make the mathematical structure more apparent, though at the cost of adding an import. + +## 5. Formalizability + +**The bounds (as stated):** Fully formalizable. Both the lower and upper bounds are precise quantitative statements with published proofs. + +**The original problem:** The problem as posed on erdosproblems.com asks to "estimate g(n), or perhaps lim g(n)/n," which is inherently imprecise — it's an open-ended request for asymptotic information rather than a single yes/no conjecture. The formalization sensibly resolves this ambiguity by extracting the two concrete, provable bounds. This is an appropriate design choice. + +**Ambiguity level: Low.** The key definitions (unit-separated point sets, unit distance graph, independent set) are all precise. The only ambiguity is in what "estimate" means, which the formalization handles well. + +## 6. Correctness + +**Lower bound (`erdos_1066`):** ✅ Correct. +- Universally quantified over all n ≥ 1 and all injective configurations with minimum pairwise distance ≥ 1. +- Concludes existence of an independent set of size ≥ (8/31)n. +- The injectivity hypothesis `hf_inj` is technically redundant given `hf_min` (minimum distance ≥ 1 between distinct points implies injectivity), but including it is harmless and improves clarity. + +**Upper bound (`erdos_1066.variants.upper_bound`):** ✅ Correct. +- Existentially quantifies over a threshold N₀ and constructs a valid configuration (injective, minimum distance ≥ 1) where every independent set has size ≤ (5/16)n. +- Correctly includes both `Function.Injective f` and the minimum distance constraint on the constructed configuration. + +**Distinction from Problem 1070:** The formalization correctly captures that Problem 1066 requires minimum pairwise distance ≥ 1 (the points form a "packing"), while Problem 1070 considers arbitrary point placements. This is the key mathematical distinction between the two problems. + +**Category tags:** Both theorems are tagged `category research solved`, which is appropriate — the individual bounds have published proofs, even though the overall problem of determining lim g(n)/n remains open. + +**Minor note on the `n ≥ 1` guard:** The lower bound is vacuously true for n = 0 (the empty finset works), so the `hn : n ≥ 1` hypothesis is slightly stronger than needed. This is not incorrect, just a minor conservatism. + +## Summary + +The formalization is mathematically correct, well-structured, and captures the two main known bounds of the problem. The primary suggestions are: +1. **Citations:** Verify the Pach–Tóth citation title; add historical context from the website. +2. **Variants:** Consider adding the ℝ^d generalization and/or a formalization that the limit lim g(n)/n exists and lies in [8/31, 5/16]. +3. **Code reuse:** The existing `UnitDistancePlaneGraph` definition could be leveraged, though the inline style is acceptable. diff --git a/ai-review/1069.md b/ai-review/1069.md new file mode 100644 index 0000000000..5ec8017397 --- /dev/null +++ b/ai-review/1069.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 1069 + +## 1. Code Reuse + +The formalization defines its own `IsLine` and `numKRichLines` within the `Erdos1069` namespace. No existing definition in `FormalConjecturesForMathlib` directly captures lines in ℝ² or k-rich line counting. + +**Potential reuse considerations:** +- `FormalConjecturesForMathlib/Geometry/2d.lean` defines `ℝ²` as `EuclideanSpace ℝ (Fin 2)` and provides `NonTrilinear` (no three collinear points) and `Collinear` predicates. The formalization instead uses `Fin 2 → ℝ` directly, which is simpler and avoids the `PiLp` wrapper. Since only the affine/linear structure matters for this problem (not the metric), using `Fin 2 → ℝ` is reasonable and arguably preferable. +- Mathlib's `AffineSubspace.line` or `Affine.span` could potentially replace the custom `IsLine`, but the parametric definition used here is straightforward and self-contained. +- No existing k-rich line counting infrastructure exists in the codebase. + +**Verdict:** No significant reuse opportunities missed. The custom definitions are appropriate. + +## 2. Citations + +**Formalization cites:** +- [Er87b] Erdős, P., Croft, H.T., and Purdy, G.B., *Unsolved problems in combinatorial geometry* (1987). +- [SzTr83] Szemerédi, E. and Trotter, W.T., *Extremal problems in discrete geometry*, Combinatorica 3 (1983), 381–392. + +**Website (erdosproblems.com/1069) states:** +- The conjecture appears in [Er87b, p.169] — the formalization omits the page reference. +- The website also references [Sa87] (Sah), who constructed examples achieving ≥(3+o(1))n^{1/2} many n^{1/2}-rich lines, improving on the lattice-point lower bound of (2+o(1))n^{1/2}. This reference is absent from the formalization. + +**Verdict:** Citations are mostly correct but could include the specific page reference (p.169) for [Er87b]. The [Sa87] reference is relevant to the optimality question but not to the theorem as stated, so its omission is acceptable. + +## 3. Variants + +The website mentions a variant/follow-up question about the **best constant**: specifically, finding the tight constant in the n²/k³ bound when k = √n. Lattice points show ≥(2+o(1))√n many √n-rich lines are achievable; Erdős conjectured this was optimal, but Sah [Sa87] improved the lower bound to (3+o(1))√n. + +This optimality question is **not captured** by the formalization, which only states the existence of some constant C. A variant formalizing the sharp constant question could be added but would represent a distinct (and still open) problem. + +**Verdict:** The core theorem is captured. The open question about the sharp constant is a natural variant that is not formalized. + +## 4. Readability + +The code is well-structured and readable: +- The `IsLine` definition has a clear docstring explaining the parametric form. +- The `numKRichLines` definition is documented. +- The theorem statement has a good docstring summarizing the result. +- The namespace `Erdos1069` keeps definitions scoped. + +**Minor suggestions:** +- The docstring says "Conjectured by Erdős, Croft, and Purdy" and "Proved by Szemerédi and Trotter" — this is clear and accurate. +- The condition `k^2 ≤ n` could benefit from a brief comment noting it is equivalent to `k ≤ √n`. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem statement on the website uses the asymptotic notation ≪ (Vinogradov notation), which means "at most a constant times." The formalization correctly interprets this by introducing an explicit existential constant C > 0. + +The statement is precise and unambiguous: +- The point set is finite (Finset). +- The notion of "line" is well-defined in ℝ². +- The notion of "k-rich" (containing ≥ k points) is well-defined. +- The bound n²/k³ is a concrete expression. +- The constraint k ≤ √n (formalized as k² ≤ n) is explicit. + +**Verdict:** High formalizability. The only potential ambiguity in the original statement (the ≪ notation) is correctly resolved. + +## 6. Correctness + +**Mathematical correctness analysis:** + +1. **`IsLine` definition:** Correctly defines a line as {p + t·d | t ∈ ℝ} for some point p and nonzero direction d. The nonzero condition on d is essential (otherwise the "line" would be a single point). ✓ + +2. **`numKRichLines` definition:** Uses `Set.ncard` on the set of all lines L satisfying `IsLine L ∧ k ≤ (S.filter (· ∈ L)).card`. Since lines are represented as sets (not parametrizations), two different (p, d) pairs yielding the same set of points are correctly identified as the same line. ✓ + +3. **Finiteness subtlety:** `Set.ncard` returns 0 for infinite sets. The set of k-rich lines (for k ≥ 2) is always finite — each such line is determined by any 2 of its points in S, so there are at most C(n,2) k-rich lines. This means `Set.ncard` gives the correct count. However, proving this finiteness in Lean would be required when working with the theorem. ✓ (correct but may require a finiteness lemma in a proof) + +4. **Conditions:** The requirement `2 ≤ k` is necessary (for k=0 or k=1, there could be infinitely many k-rich lines). The requirement `k² ≤ n` matches the standard statement. ✓ + +5. **The bound:** `(numKRichLines S k : ℝ) ≤ C * (S.card : ℝ) ^ 2 / (k : ℝ) ^ 3` correctly represents the bound. The casting to ℝ is necessary to handle the division. ✓ + +6. **Quantifier structure:** `∃ C > 0, ∀ S k, ...` correctly states that a single universal constant works for all point sets and all valid k. ✓ + +7. **Relationship to Szemerédi-Trotter:** The Szemerédi-Trotter theorem is more commonly stated as an incidence bound: I(P,L) = O(|P|^{2/3}|L|^{2/3} + |P| + |L|). The k-rich lines formulation follows by a standard application (Proposition in [SzTr83]). The formalization captures the specific corollary stated in the Erdős problem, which is correct. ✓ + +**Verdict:** The formalization is mathematically correct and complete for the problem as stated. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities | +| Citations | Mostly complete; missing page ref (p.169) for [Er87b]; [Sa87] omitted but acceptable | +| Variants | Core theorem captured; sharp constant question not formalized | +| Readability | Good | +| Formalizability | High — unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/1070.md b/ai-review/1070.md new file mode 100644 index 0000000000..095073c7bd --- /dev/null +++ b/ai-review/1070.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 1070 + +## 1. Code Reuse + +Several existing definitions in the codebase could be leveraged to make this formalization more modular and consistent: + +- **`unitDistanceGraph` (704.lean:51):** Defines `SimpleGraph (EuclideanSpace ℝ (Fin n))` with adjacency `x ≠ y ∧ dist x y = 1`. Problem 1070 inlines the independent-set condition rather than using this graph. The formalization could instead use `unitDistanceGraph 2` and express the independent set condition via the graph's adjacency relation. + +- **`IsIndepSet` (750.lean:46):** Defines `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v` for a `SimpleGraph`. Problem 1070 essentially states this condition manually as `∀ i ∈ S, ∀ j ∈ S, i ≠ j → dist (f i) (f j) ≠ 1`. Using `IsIndepSet (unitDistanceGraph 2) ...` would be cleaner, though it would require mapping between `Fin n` indices and `EuclideanSpace` points. + +- **Problem 1066 (1066.lean):** Uses a nearly identical pattern for independent sets in unit distance graphs (with the additional constraint that all pairwise distances are ≥ 1). The structural similarity suggests a shared abstraction for "independent set of size ≥ αn in a unit distance graph on n points" could be factored out. + +**Assessment:** The current inline approach is not wrong—it avoids a dependency on definitions in other problem files. However, if the codebase aims for consistency, reusing `unitDistanceGraph` and `IsIndepSet` would be preferable. The main barrier is that `unitDistanceGraph` operates on `EuclideanSpace ℝ (Fin n)` points directly while 1070 uses `Fin n` indices mapped via `f`, so a small adapter would be needed. + +## 2. Citations + +The website (erdosproblems.com/1070) lists the following references: + +| Ref | Website | Formalization | Status | +|-----|---------|---------------|--------| +| [Er87b] Erdős, 1987 | ✓ (implied as source) | ✓ Listed in docstring | **OK** | +| [Cr67] Croft, 1967 | ✓ | ✓ Listed in docstring | **OK** | +| [MRVZ23] Matolcsi, Ruzsa, Varga, Zsámboki, 2023 | ✓ | ✓ Listed in docstring | **OK** | +| [ACMVZ23] Ambrus, Csiszárik, Matolcsi, Varga, Zsámboki | ✓ (on website) | ✗ Not mentioned | **MISSING** | +| [LaRo72] Larman and Rogers | ✓ (on website) | ✗ Not mentioned | **MISSING** | + +**Issues:** +- The website mentions **[ACMVZ23]** (Ambrus, Csiszárik, Matolcsi, Varga, Zsámboki) who proved $m_1 \leq 0.247$, showing the $n/4$ bound cannot be achieved via the density approach. This is a significant recent result that refines the status of the main conjecture and is not cited. +- **[LaRo72]** (Larman and Rogers) appears on the website but is not cited in the formalization. (This reference is more directly relevant to Problem 704, so its omission is minor.) +- The [MRVZ23] citation in the docstring is incomplete—it lacks the paper title. The website attributes to them the conjecture that $m_1 = 0.22936\cdots$ and $f(n) = (1/4 + o(1))n$. + +## 3. Variants + +The formalization includes three statements: +1. **Main conjecture:** $f(n) \geq n/4$ (open) +2. **Lower bound:** $f(n) \geq 0.22936n$ (Croft, solved) +3. **Upper bound:** $f(n) \leq (2/7)n$ (Moser spindle, solved) + +**Missing variants:** +- **Improved upper bound [MRVZ23]:** $f(n) \leq (1/4 + o(1))n$. This is mentioned in the module docstring but not formalized as a separate theorem. This is arguably the most important recent result, as it shows the main conjecture is essentially tight if true. +- **The density formulation:** The website discusses $m_1$ (the supremum of upper densities of measurable subsets of $\mathbb{R}^2$ avoiding unit distances). The known bounds $0.22936 \leq m_1 \leq 0.247$ are not formalized. This is a distinct (measure-theoretic) variant of the combinatorial problem. +- **The MRVZ conjecture:** $m_1 = 0.22936\cdots$ and $f(n) = (1/4 + o(1))n$. Not formalized. + +**Assessment:** The core combinatorial question and its classical bounds are well-captured. The $o(1)$ results ([MRVZ23] upper bound) are harder to formalize precisely in Lean (requiring asymptotic notation), which may justify their omission as formal theorems. The measure-theoretic density variant ($m_1$) is a substantially different formalization challenge. + +## 4. Readability + +The code is clear and well-structured. Specific observations: + +- **Good:** The module docstring provides excellent context, explaining the problem, its graph-theoretic interpretation, and known bounds. +- **Good:** Each theorem has a descriptive docstring with the relevant citation. +- **Good:** The `namespace Erdos1070` cleanly scopes the definitions. +- **Minor:** The lower bound constant `22936 / 100000` could be written as `0.22936` if Lean supports it, or at minimum a comment noting this equals `0.22936` would aid readability. The current rational form is mathematically precise but requires mental division. +- **Minor:** The `n ≥ 1` guard in the main conjecture and lower bound is technically unnecessary (the statements are vacuously true for `n = 0` since `Fin 0` is empty), but it does no harm and matches the natural-language convention. + +## 5. Formalizability + +**Assessment: High formalizability with minor ambiguity.** + +The problem as stated on the website is precise enough to formalize: +- "Given any $n$ points in $\mathbb{R}^2$" — clear, formalized as `f : Fin n → EuclideanSpace ℝ (Fin 2)`. +- "No two are distance $1$ apart" — clear, formalized as `dist (f i) (f j) ≠ 1`. +- "Estimate $f(n)$" — inherently imprecise (what counts as an "estimate"?), but the formalization correctly isolates the specific sub-question "$f(n) \geq n/4$". + +**One ambiguity:** The problem says "given any $n$ points" — does this require the points to be distinct? The formalization does **not** require `Function.Injective f`, meaning coincident points are allowed. This is the correct choice: if points can coincide, the independence number can only be larger (coincident points have distance 0, not 1, so they don't conflict), making the conjecture harder to prove and thus the stronger statement. Problem 1066, by contrast, does require injectivity because its minimum-distance constraint demands it. + +**The `answer(sorry)` pattern:** The main conjecture uses `answer(sorry) ↔ ...`, which encodes the open yes/no question. This is appropriate for a problem whose truth value is unknown. + +## 6. Correctness + +**Main conjecture (`erdos_1070`):** Mathematically correct. It asks: for every $n$-point configuration in $\mathbb{R}^2$, does there exist an independent set of size $\geq n/4$ in the unit distance graph? This matches the problem statement. + +**Lower bound (`erdos_1070.variants.lower_bound`):** Mathematically correct. The bound $0.22936$ matches Croft's result. The formalization states this as a universal quantification over all $n$-point configurations, which is the correct form. + +**Upper bound (`erdos_1070.variants.upper_bound`):** Mathematically correct. The Moser spindle has 7 vertices and independence number 2, so tiling it gives configurations where no independent set exceeds $(2/7)n$. The `∃ N₀` quantifier correctly accounts for the fact that this only works for sufficiently large $n$ (you need $n$ to be a multiple of 7 or large enough that rounding doesn't matter). + +**Potential issue — points vs. distinct points in the upper bound:** The upper bound constructs a configuration `f : Fin n → EuclideanSpace ℝ (Fin 2)` without asserting injectivity. Since the Moser spindle construction requires distinct points, technically one should verify that the constructed `f` can be made injective. However, since the statement is existential (∃ f), the prover would need to provide an injective `f` anyway for the construction to work, so this is not a flaw — it just means the statement is slightly weaker than it could be (which makes it easier to prove, if anything). + +**Overall mathematical assessment:** The formalization is correct and complete for the core problem. No experienced mathematician would identify obvious flaws. The only gap is the missing [MRVZ23] improved upper bound as a separate formal statement, which is documented in the module docstring but not formalized. diff --git a/ai-review/1075.md b/ai-review/1075.md new file mode 100644 index 0000000000..ee31a2960b --- /dev/null +++ b/ai-review/1075.md @@ -0,0 +1,120 @@ +# Review: Erdos Problem 1075 + +## 1. Code Reuse + +The `UniformHypergraph` structure defined at line 35 is identical in signature and field names to those in at least two other files: + +- `FormalConjectures/ErdosProblems/616.lean` (line 41): Same `UniformHypergraph (n r : ℕ)` with `edges` and `uniform` fields. +- `FormalConjectures/ErdosProblems/837.lean` (line 46): Same structure again with parameter names `(n k : ℕ)` instead of `(n r : ℕ)`. + +All three define it as `Finset (Finset (Fin n))` with a uniformity proof obligation. This is a clear candidate for extraction into a shared definition in `FormalConjecturesForMathlib`. + +Additionally, `inducedSubgraph` in 1075 (line 40) is functionally equivalent to `inducedSub` in 616.lean (line 54), except: +- In 1075, it returns a bare `Finset (Finset (Fin n))`. +- In 616, it returns a full `UniformHypergraph n r`, preserving the uniformity proof. + +The 616 version is strictly better: it maintains the type invariant. The 1075 version discards the uniformity guarantee, which is mathematically harmless here (we only use `.card`) but is less principled. Recommend adopting 616's pattern or extracting a shared `inducedSubgraph` that returns a `UniformHypergraph`. + +`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` also defines `hypergraphRamsey` using r-uniform hypergraphs but uses a different representation (sets of subsets of a type, not `Finset (Fin n)`), so direct reuse is limited. + +## 2. Citations + +**Website references:** +- Primary source: Erdos [Er74c, p.80] +- Related result: Erdos [Er64f] proved the result holds with $c_r = r^{-r}$ when the hypergraph has at least $\varepsilon n^r$ edges. + +**Formalization references:** +- Only contains `[erdosproblems.com/1075](https://www.erdosproblems.com/1075)`. + +**Gap:** The formalization's docstring does not cite the primary source [Er74c, p.80] or the related result by Erdos [Er64f]. Both should be added to the module docstring for completeness, e.g.: + +``` +[Er74c] Erdős, P., Problems and results on graphs and hypergraphs: similarities and differences (1974), p.80. +[Er64f] Erdős, P. (1964): proved the weaker result with c_r = r^{-r} when the edge threshold is εn^r. +``` + +## 3. Variants + +The website mentions one important related result: + +> Erdos [Er64f] proved the result holds with $c_r = r^{-r}$ when the hypergraph has at least $\varepsilon n^r$ edges. + +This is a weaker but proven result (stronger edge hypothesis $\varepsilon n^r \gg (1+\varepsilon)(n/r)^r$, weaker density constant $c_r = r^{-r}$). It is **not captured** in the formalization. A natural variant theorem would be: + +```lean +@[category research solved, AMS 5] +theorem erdos_1075.variants.erdos_1964 (r : ℕ) (hr : r ≥ 3) : + ∀ ε : ℝ, ε > 0 → + ∀ M : ℕ, + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ H : UniformHypergraph n r, + (H.edges.card : ℝ) ≥ ε * (n : ℝ) ^ r → + ∃ S : Finset (Fin n), + S.card ≥ M ∧ + ((H.inducedSubgraph S).card : ℝ) ≥ (1 / (r : ℝ) ^ r) * (S.card : ℝ) ^ r := by + sorry +``` + +No other variants are mentioned on the website. + +## 4. Readability + +The formalization is generally well-written and readable. Minor observations: + +- The docstring on `erdos_1075` (lines 46-55) clearly explains the encoding of "$m \to \infty$ as $n \to \infty$" via the universal quantifier over $M$. This is helpful. +- The structure and induced subgraph definitions are clean and self-explanatory. +- The use of `1 / (r : ℝ) ^ r` for $r^{-r}$ is idiomatic Lean/Mathlib. +- **Minor improvement:** The `inducedSubgraph` function could have a brief docstring clarification that it returns the edge set (not a `UniformHypergraph`), since this is a non-obvious design choice. Alternatively, change the return type as discussed in Section 1. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The problem statement on erdosproblems.com is precise: +- "r-uniform hypergraph on n vertices" — well-defined. +- "at least $(1+\varepsilon)(n/r)^r$ edges" — clear numerical threshold. +- "$c_r > r^{-r}$" — clear constant bound. +- "$m \to \infty$ as $n \to \infty$" — the only mildly informal phrasing, but the standard mathematical interpretation (for every M, eventually m ≥ M) is unambiguous and correctly captured. + +The one point of potential ambiguity is what "subgraph on m vertices" means: an induced subhypergraph (all original edges within the vertex set) vs. an arbitrary sub-hypergraph on m vertices. In the context of hypergraph supersaturation problems, the induced interpretation is standard and mathematically stronger (finding c_r m^r edges in the induced subgraph implies finding them in any sub-hypergraph). The formalization uses the induced interpretation, which is correct. + +**Ambiguity score: Very low.** The problem is essentially a precise quantitative conjecture. + +## 6. Correctness + +**Assessment: Mathematically correct.** + +Detailed verification of the quantifier structure: + +| Quantifier | Formalization | Correct? | +|---|---|---| +| For every $r \geq 3$ | `(r : ℕ) (hr : r ≥ 3)` | Yes | +| $\exists c_r > r^{-r}$ | `∃ c_r : ℝ, c_r > 1 / (r : ℝ) ^ r` | Yes | +| $\forall \varepsilon > 0$ | `∀ ε : ℝ, ε > 0 →` | Yes | +| $m \to \infty$ as $n \to \infty$ | `∀ M : ℕ,` | Yes | +| $n$ sufficiently large | `∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ →` | Yes | +| Edge threshold | `(H.edges.card : ℝ) ≥ (1 + ε) * ((n : ℝ) / r) ^ r` | Yes | +| Dense subgraph | `∃ S, S.card ≥ M ∧ (H.inducedSubgraph S).card ≥ c_r * S.card ^ r` | Yes | + +**Key correctness points:** + +1. **Quantifier ordering is correct.** $c_r$ is chosen before $\varepsilon$ and $M$, so it is a universal constant depending only on $r$. The threshold $N_0$ depends on $\varepsilon$ and $M$, which is correct. + +2. **The edge threshold $(1+\varepsilon)(n/r)^r$ uses real division**, which correctly handles the case when $r \nmid n$. The cast `((n : ℝ) / r) ^ r` is the right encoding. + +3. **The density constant $c_r > 1/(r : \mathbb{R})^r$** correctly encodes $c_r > r^{-r}$. Note that `1 / (r : ℝ) ^ r` in Lean with `r : ℕ` and `r ≥ 3` is well-defined and positive. + +4. **The conclusion asks for $c_r \cdot |S|^r$ edges in the induced subhypergraph.** This matches the original problem's "$c_r m^r$ edges" in a "subgraph on $m$ vertices." + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `UniformHypergraph` and `inducedSubgraph` are duplicated across 616, 837, 1075; should be shared | +| Citations | Missing [Er74c, p.80] and [Er64f] references from the website | +| Variants | Missing the solved [Er64f] variant ($c_r = r^{-r}$ with $\varepsilon n^r$ edge threshold) | +| Readability | Good; minor improvement possible for `inducedSubgraph` return type | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Mathematically correct; quantifier structure and encoding are faithful | diff --git a/ai-review/1076.md b/ai-review/1076.md new file mode 100644 index 0000000000..5feab6ea9f --- /dev/null +++ b/ai-review/1076.md @@ -0,0 +1,113 @@ +# AI Review — Erdős Problem 1076 + +## 1. Code Reuse + +**Problem 1157** (`FormalConjectures/ErdosProblems/1157.lean`) is the direct generalization of this problem and defines a reusable `UniformHypergraph r n` structure, `edgesSpannedBy`, `IsFree`, and `extremalNumber` — all of which subsume the definitions in 1076. In fact, 1157's docstring explicitly notes: *"The case r = 3 and k = s + 2 is problem [1076]."* + +Problem 1076 defines its own `Hypergraph3`, `IsSubhypergraph`, `familyF`, `IsFkFree`, and `ex3` from scratch. These could potentially be replaced by 1157's definitions (instantiated at `r = 3`), but there is a **critical semantic difference** — see §6 (Correctness) below. The two formulations of "F_k-free" are not obviously equivalent, so a simple drop-in replacement is not appropriate without resolving that question first. + +Several other files (716, 1024, 593, 1075, 1178, 500) also define their own 3-uniform hypergraph structures. There is no shared utility module; each problem rolls its own definitions. + +**Verdict:** Potential reuse from 1157.lean exists but is blocked by a correctness concern (see §6). + +## 2. Citations + +The website (erdosproblems.com/1076) lists the following references: + +| Ref | Website | Formalization | +|-----|---------|---------------| +| [BES73] | Brown, Erdős, Sós (1973) — original question | ✅ Present but incomplete title: website says *"Some extremal problems on r-graphs"* — formalization matches | +| [Er74c] | Erdős (1974, p. 81) — presents conjecture with supporting theorem | ❌ **Missing entirely** | +| [BoWa19] | Bohman & Warnke (2019) — proved asymptotic version | ✅ Present but **no title or journal** | +| [GKLO20] | Glock, Kühn, Lo, Osthus (2020) — proved asymptotic version | ✅ Present but **no title or journal** | + +**Issues:** +- **[Er74c]** is missing from the docstring entirely. +- [BoWa19] and [GKLO20] have only author names and years — no paper titles, journals, or other identifying details. The website itself may not provide full bibliographic data, but the docstring should at minimum match what the website provides. +- The website also notes that Problem 1076 is **related to Problem #207** (a stronger version). This cross-reference is not mentioned in the formalization. + +## 3. Variants + +The website states: +- The problem asks whether `ex_3(n, F_k) ~ n²/6` for all `k ≥ 5`. +- Brown, Erdős, and Sós proved the case `k = 4`. +- The asymptotic version has been proved (by [BoWa19] and [GKLO20]). +- For `k` with appropriate divisibility conditions, the extremal number is known **exactly**. +- Problem #207 is described as a stronger version. + +**Missing variants/context:** +- The exact determination for special `k` values is not mentioned or formalized. +- The relationship to Problem 207 (stronger version) is not documented. +- The relationship to Problem 1157 (generalization) is not documented. +- The case `k = 4` (proved by Brown–Erdős–Sós) could be stated as a separate lemma. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The docstring is clear and provides good mathematical context. +- Definition names (`Hypergraph3`, `IsSubhypergraph`, `familyF`, `IsFkFree`, `ex3`) are descriptive. +- The `sSup`-based definition of `ex3` follows the standard pattern used across the codebase. +- The asymptotic formulation using ε and N₀ is standard and clear. +- One minor point: the docstring says the problem is for `k ≥ 5` but the theorem quantifies `∀ k : ℕ, k ≥ 5`, which is correct. + +**No significant readability issues.** + +## 5. Formalizability + +The problem statement is precise enough to formalize. The key concepts are: + +- **3-uniform hypergraph**: well-defined. +- **F_k (family of 3-uniform hypergraphs with k vertices and k−2 edges)**: well-defined. +- **ex_3(n, F_k)**: the Turán-type extremal number — well-defined given a notion of "F_k-free". +- **Asymptotic equivalence f(n) ~ n²/6**: well-defined, correctly captured via the ε-formulation. + +**Ambiguity level: Low.** The only subtlety is the precise meaning of "F_k-free" — whether it means avoiding all members of F_k as subhypergraphs (injection-based embedding) or avoiding all members in the configuration sense (k vertices spanning k−2 edges). See §6. + +## 6. Correctness + +**This is the most important section. There is a potential correctness issue.** + +### The core concern: two different notions of F_k-freeness + +The formalization defines F_k-freeness via **subhypergraph embeddings** (`IsSubhypergraph`): H is F_k-free if there is no injection f : Fin k → Fin n mapping every edge of some G ∈ F_k into H. + +The standard definition in the Brown–Erdős–Sós literature (and as used in Problem 1157) is **configuration-based**: H is (k, k−2)-free if no set of k vertices spans k−2 or more edges. In 1157's notation: `IsFree H k (k-2)`, meaning `∀ S : Finset (Fin n), S.card = k → edgesSpannedBy H S < k - 2`. + +**These two definitions are not equivalent in general:** + +1. **Configuration ⇒ Subhypergraph (partially):** If k vertices span k−2 edges in H, one can construct a member of F_k and embed it. So configuration-freeness implies subhypergraph-freeness — meaning the subhypergraph-based extremal number is **at least as large** as the configuration-based one. + +2. **Subhypergraph ⇏ Configuration:** A subhypergraph G ∈ F_k with k vertices and k−2 edges could be embedded into H via an injection f, but the image f(Fin k) might have fewer than k vertices mapped to distinct vertices… no, f is injective, so the image has exactly k vertices. But the key issue is: the k−2 edges of G, when mapped, might span **additional** vertices beyond f(Fin k) if the edges of G don't cover all k vertices. Wait — actually, edges of G are subsets of Fin k, and f maps Fin k → Fin n injectively, so image edges are subsets of f(Fin k) which has exactly k elements. So if G has k vertices and k−2 edges, its embedding uses exactly the k image vertices. + + However, the subtlety is the **other direction**: the configuration notion says "no k vertices span ≥ k−2 edges," which counts **all** edges of H within those k vertices. The subhypergraph notion says "no specific G with k−2 edges on k vertices embeds." If k vertices of H span **more** than k−2 edges (say, k−1 edges), then any subset of k−2 of those edges forms a member of F_k that embeds. So having ≥ k−2 edges on k vertices implies a subhypergraph from F_k embeds. + + **Therefore the two notions of freeness are equivalent**, and the formalization is correct — though the argument is non-trivial. + +### Verification of the equivalence + +- If H has a set S of k vertices spanning ≥ k−2 edges, pick any k−2 of them to form G ∈ F_k. The identity-like injection on S gives an embedding. ✅ +- If G ∈ F_k embeds into H via f, then f(Fin k) is a set of k vertices, and the k−2 edges of G map to k−2 distinct edges of H within those k vertices (distinctness follows from injectivity of f and the fact that f restricted to each edge is injective, so images of distinct edges are distinct). So those k vertices span ≥ k−2 edges. ✅ + +**The two definitions are indeed equivalent.** The formalization is correct. + +### Other correctness checks + +- **`ex3` well-definedness:** The set `{m | ∃ H, IsFkFree k H ∧ H.edges.card = m}` should be bounded above (since H has at most C(n,3) edges) and nonempty (the empty hypergraph works). The `sSup` of a bounded nonempty set of natural numbers is well-defined. However, Lean's `sSup` on `ℕ` returns 0 for the empty set and may not behave correctly for unbounded sets. Since the set is bounded by `Nat.choose n 3` and contains 0, this is fine in principle, though a proof of `BddAbove` would be needed when working with this definition. + +- **`answer(True)` annotation:** The problem is marked as solved (`category research solved`) with `answer(True)`. The website confirms the problem is **proved in the affirmative**. ✅ + +- **Quantifier structure:** `∀ k ≥ 5, ∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ...` correctly captures "for each k ≥ 5, ex_3(n, F_k) ~ n²/6". ✅ + +- **Asymptotic formula:** The bounds `(1-ε)·n²/6 ≤ ex3 n k ≤ (1+ε)·n²/6` correctly formalize `ex_3(n, F_k) ~ n²/6`. ✅ + +### Summary + +| Criterion | Assessment | +|-----------|------------| +| Code Reuse | Could reuse 1157's definitions; blocked by apparent (but ultimately non-) discrepancy | +| Citations | [Er74c] missing; [BoWa19], [GKLO20] lack titles; no cross-ref to #207/#1157 | +| Variants | Exact results for special k, relationship to #207 and #1157 not captured | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | **Correct.** The embedding-based and configuration-based F_k-freeness are equivalent. The asymptotic formulation is standard and accurate. | diff --git a/ai-review/1078.md b/ai-review/1078.md new file mode 100644 index 0000000000..70c20b58fc --- /dev/null +++ b/ai-review/1078.md @@ -0,0 +1,49 @@ +# AI Review: Erdős Problem 1078 + +## 1. Code Reuse + +- **`IsMultipartite`** is defined locally in `Erdos1078` namespace. A related but distinct definition `completeMultipartiteGraph` exists in `ErdosProblems/550.lean` using sigma types (`Σ i : Fin k, Fin (sizes i)`) for variable-sized parts. The 1078 definition uses `Fin r × Fin n` which is appropriate here since all parts have equal size `n`. These serve different purposes and reuse is not warranted. +- **`HasTransversalClique`** is also defined locally. No existing transversal/rainbow clique definition in the codebase matches this use case. The `IsRainbow` definition in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` is about edge-coloring injectivity and is unrelated. +- `G.degree` from Mathlib is used directly, which is correct. +- No opportunities for code reuse identified. + +## 2. Citations + +The formalization references `[BES75b]`, `[Ha01]`, and `[HaSz06]` using shorthand tags. The website (erdosproblems.com/1078) confirms: +- Bollobás, Erdős, and Szemerédi proved optimality of the `r − 3/2` constant. +- Haxell proved the conjecture. +- Haxell and Szabó proved the sharp threshold. + +The docstring provides reasonable detail for each citation. The full bibliographic entries are not included (e.g., journal names, years of publication), but this is consistent with the style used across the codebase. **No issues found.** + +## 3. Variants + +The docstring mentions the sharp threshold result of Haxell and Szabó: the exact minimum degree threshold is `(r−1)n − ⌈sn/(2s−1)⌉` where `s = ⌊r/2⌋`. This stronger result is **not formalized** as a separate theorem. It could be added as a companion statement (e.g., `erdos_1078_sharp_threshold`) capturing the exact threshold rather than the asymptotic `r − 3/2 − ε` form. This is a minor omission since the primary conjecture is the one formalized, but noting it for completeness. + +## 4. Readability + +The code is clean and well-structured: +- Definitions (`IsMultipartite`, `HasTransversalClique`) have clear docstrings explaining the mathematical meaning. +- The theorem statement reads naturally and follows the standard quantifier pattern (∀ ε > 0, ∃ n₀, ∀ n ≥ n₀, ...). +- The namespace `Erdos1078` keeps definitions scoped appropriately. +- **No readability issues.** + +## 5. Formalizability + +The original problem uses the notation "minimum degree ≥ (r − 3/2 − o(1))n", which is asymptotic shorthand. The formalization correctly interprets this as: for every ε > 0, there exists n₀ such that for n ≥ n₀, the minimum degree condition (r − 3/2 − ε)n suffices. This is the standard and unambiguous way to formalize o(1) conditions. + +The problem is **fully formalizable with no ambiguity**. The notions of r-partite graph, minimum degree, and transversal K_r are all precisely defined. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **Vertex set `Fin r × Fin n`**: Correctly models an r-partite graph with n vertices per part. Parts are indexed by `Fin r`, vertices within each part by `Fin n`. +- **`IsMultipartite`**: Correctly forbids edges within any single part (`¬G.Adj (i, a) (i, b)` for all `i, a, b`). This is the defining property of a multipartite graph. +- **`HasTransversalClique`**: Correctly captures a transversal K_r — a function `f : Fin r → Fin n` choosing one vertex per part, with all inter-part pairs adjacent. The condition `i ≠ j → G.Adj (i, f i) (j, f j)` is exactly pairwise adjacency across distinct parts. +- **Degree condition**: `(G.degree v : ℝ) ≥ ((r : ℝ) - 3/2 - ε) * (n : ℝ)` correctly states every vertex has at least `(r − 3/2 − ε)n` neighbors. Since `IsMultipartite` forbids intra-part edges, `G.degree v` counts only cross-part neighbors, which is the intended quantity. The maximum possible degree is `(r−1)n`, so the bound `(r − 3/2 − ε)n` is meaningful for `r ≥ 2`. +- **Quantifier structure**: `∀ r ≥ 2, ∀ ε > 0, ∃ n₀, ∀ n ≥ n₀` is correct. The threshold `n₀` may depend on both `r` and `ε`, which is appropriate. +- **`DecidableRel G.Adj`**: Required for `G.degree` to be computable; this is a standard Lean/Mathlib requirement and does not affect mathematical content. +- **Edge case `n = 0`**: When `n = 0`, `Fin 0` is empty, so `Fin r × Fin 0` is empty, the degree condition is vacuously true, and `HasTransversalClique` requires `∃ f : Fin r → Fin 0`, which is false for `r ≥ 1`. However, since `n₀` can be chosen ≥ 1, this edge case is harmlessly avoided. No issue. + +**No mathematical flaws identified. The formalization is correct and complete for the primary conjecture.** diff --git a/ai-review/1079.md b/ai-review/1079.md new file mode 100644 index 0000000000..6d81cea35e --- /dev/null +++ b/ai-review/1079.md @@ -0,0 +1,63 @@ +# AI Review: Erdős Problem 1079 + +## 1. Code Reuse + +**`ContainsSubgraph`** (lines 41–42) is duplicated verbatim across ~29 Erdős problem files (113, 146, 147, 159, 545–552, 571–572, 575–576, 580, 59, 60, 62, 713–714, 765–766, 87, 926, 1035, etc.). Mathlib already provides `SimpleGraph.IsContained` (in `Mathlib.Combinatorics.SimpleGraph.Copy`), which is definitionally equivalent (an injective graph homomorphism). Problem 1079 should use the Mathlib definition or a shared utility. + +**`turanNumber`** (lines 46–49) is duplicated across ~10 files (113, 146, 147, 180, 575, 576, 59, 926, 1178). This should be extracted to a shared file such as `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Turan.lean`. + +**`neighborhoodEdgeCount`** (lines 53–56) is unique to this file. It counts edges in an induced subgraph on a vertex subset. This could alternatively be expressed using `(G.induce S).edgeFinset.card` if Mathlib's induced subgraph API supports it, which would be more idiomatic. However, the current implementation is correct and clear. + +## 2. Citations + +The docstring references three citations: **[Er75]**, **[BoTh81]**, and **[Bo83b]**. The website (erdosproblems.com/1079) lists these same three references: + +- **[Er75]**: Erdős (1975) — original problem statement. No full bibliographic entry is given on the website. +- **[BoTh81]**: Bollobás and Thomason (1981) — proved the statement true (unless G is the Turán graph). +- **[Bo83b]**: Bondy (1983) — showed the vertex can be chosen to have maximum degree when G has strictly more than ex(n; K_r) edges. + +The docstring reproduces the content from the website faithfully. The shorthand citation codes match. No full bibliographic details are available on the website itself, so the shorthand references are acceptable. + +## 3. Variants + +The docstring mentions Bondy's strengthening [Bo83b]: if G has **strictly more than** ex(n; K_r) edges, the vertex can be chosen to have maximum degree. **This variant is not formalized.** A natural formalization would be a second theorem stating: for r ≥ 4 and G on n vertices with > ex(n; K_r) edges, the vertex of maximum degree has ≥ ex(d; K_{r-1}) edges in its neighborhood. This would be a worthwhile addition since it is a natural companion result. + +## 4. Readability + +The code is generally readable. + +- The docstring clearly explains how the asymptotic notation d ≫_r n is formalized (as ∃ c > 0 and n₀). +- The use of `⊤ : SimpleGraph (Fin r)` for the complete graph K_r is standard but slightly opaque to non-Lean users. A brief comment or alias `completeGraph r` would improve clarity, though this is minor. +- `neighborhoodEdgeCount` is descriptive. The implementation via filtering pairs is clear, though expressing it via `G.induce` would be more idiomatic. + +## 5. Formalizability + +The original problem statement uses the asymptotic notation d ≫_r n, which is inherently informal. The formalization interprets this as: there exist c > 0 and n₀ (both depending on r) such that for all n ≥ n₀, the conclusion holds with d ≥ cn. **This is the standard and unambiguous interpretation.** The problem is precise enough to be obviously formalizable. + +One minor note: the condition "at least ex(n; K_r) edges" is unambiguous. The formalization correctly uses ≥. + +**Ambiguity assessment: Low.** The only interpretive choice is the meaning of ≫_r, which has a universally agreed-upon formalization. + +## 6. Correctness + +The formalization is **mathematically correct** with one caveat worth noting. + +**Strengths:** + +- **Complete graph representation:** `⊤ : SimpleGraph (Fin r)` correctly represents K_r (the complete graph on r vertices is the top element of the SimpleGraph lattice on Fin r). +- **K_{r-1} representation:** `⊤ : SimpleGraph (Fin (r - 1))` correctly represents K_{r-1}. +- **Edge counting:** `neighborhoodEdgeCount G (G.neighborFinset v)` correctly counts edges in the open neighborhood of v (not including v itself), which matches the problem statement's "edges in the neighbourhood." +- **Turán number definition:** The sSup-based definition is correct. For fixed n, the set of achievable edge counts is nonempty (the empty graph witnesses 0) and bounded above (by n(n-1)/2), so sSup returns the maximum. The quantification over all `(V : Type)` with `Fintype.card V = n` is equivalent to considering graphs on `Fin n`. +- **answer(True):** Correctly reflects that the problem has been solved affirmatively (by Bollobás-Thomason [BoTh81]). +- **r ≥ 4 condition:** Matches the problem statement. +- **Asymptotic formulation:** The use of ∃ c > 0 and ∃ n₀ is the correct way to formalize d ≫_r n. + +**Caveat:** + +- The formalization does not exclude the Turán graph T(n, r-1) as a special case. The website notes the result is "true (unless G is itself the Turán graph)." However, this is not actually a flaw: in the Turán graph T(n, r-1), every vertex v has degree d ≈ n(r-2)/(r-1) (so d ≫_r n holds), and the neighborhood of v forms a complete (r-2)-partite balanced graph, which has exactly ex(d; K_{r-1}) edges. So the Turán graph satisfies the ≥ condition, and the exception noted on the website likely refers to a stronger conclusion (e.g., strict inequality or additional structural properties). The formalization as stated is correct even without the exception. + +**Potential weakness:** + +- The use of n₀ makes the statement slightly weaker than what is likely true for all n. Turán's theorem holds for all n, and the Bollobás-Thomason result likely does too. However, using n₀ is a safe and standard approach for formalizing asymptotic results, and does not constitute an error. + +**Verdict: No mathematical flaws identified.** The formalization faithfully captures the intended conjecture. The only missing piece is Bondy's strengthening variant, which is a separate result mentioned in the docstring but not formalized. diff --git a/ai-review/1081.md b/ai-review/1081.md new file mode 100644 index 0000000000..dd67b4f661 --- /dev/null +++ b/ai-review/1081.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 1081 + +## 1. Code Reuse + +**Issue: Local `IsSquarefull` duplicates existing `Nat.Powerful` from the shared library.** + +The codebase already provides a central definition in `FormalConjecturesForMathlib/Data/Nat/Full.lean`: + +```lean +def Full (k : ℕ) (n : ℕ) : Prop := ∀ p ∈ n.primeFactors, p^k ∣ n +abbrev Powerful : ℕ → Prop := (2).Full +``` + +This is available to all problem files via `ProblemImports`. The local `IsSquarefull` is semantically equivalent to `fun m => 0 < m ∧ Nat.Powerful m`. The positivity constraint `0 < m` is intentional and mathematically necessary here (it prevents 0 from being squarefull, which would trivialize "sum of two squarefull" since every squarefull n = n + 0). However, the prime-divisibility logic itself is duplicated. + +Multiple other Erdős problems define identical local predicates: +- `Erdos365.IsPowerful` (identical to `IsSquarefull`) +- `Erdos937.IsPowerful`, `Erdos941.IsPowerful`, `Erdos1108.IsPowerful` (same without positivity) +- `Erdos1107` already uses `Nat.Full` from the shared library + +**Recommendation:** Replace `IsSquarefull m` with `0 < m ∧ Nat.Powerful m` to reuse the shared definition, or equivalently `0 < m ∧ (2 : ℕ).Full m`. This aligns with the approach in problem 1107 and avoids duplicating logic that already has a `Decidable` instance and supporting lemmas in the library. + +## 2. Citations + +**Issue: Citations are incomplete and use shorthand without full bibliographic information.** + +The formalization includes: +- `[Er76e] Erdős, P.` +- `[Od81] Odoni, R. W. K.` + +The [erdosproblems.com/1081](https://www.erdosproblems.com/1081) page (last edited 15 October 2025) lists additional references with results: + +- **Odoni [Od81]**: Proved the conjecture false, establishing A(x) ≫ exp(c · log log log x / log log x) · x/√(log x) for some constant c > 0. +- **Baker and Brüdern [BaBr94]**: Improved estimates for A(x). +- **Blomer [Bl04]**: Further refinements. +- **Blomer and Granville [BlGr06]**: Most recent bounds: A(x) = (log log x)^{O(1)} · x/(log x)^α where α = 1 − 2^{−1/3} ≈ 0.2063. + +**Recommendation:** Add full citation details for [Er76e] and [Od81] (titles, journal, year) and include the additional references [BaBr94], [Bl04], [BlGr06] that appear on the website. The page also notes a relation to Problem #940. + +## 3. Variants + +**Issue: No variants are formalized, though natural ones exist.** + +The website documents progressively sharper results about the true growth rate of A(x): +1. **Odoni's lower bound**: A(x) ≫ exp(c · log log log x / log log x) · x/√(log x), which constitutes the actual disproof. +2. **Blomer–Granville asymptotic**: A(x) = (log log x)^{O(1)} · x/(log x)^α with α = 1 − 2^{−1/3}. + +Either of these could be formalized as a variant theorem, particularly the Blomer–Granville result which gives the true order of magnitude. + +**Recommendation:** Consider adding at least one variant capturing Odoni's explicit lower bound (as this is the substance of the disproof), similar to how problem 1107 formalizes Heath-Brown's result as a separate variant theorem. + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The docstring for `erdos_1081` could explicitly state that Odoni showed A(x) grows faster than any constant multiple of x/√(log x), making it clearer *why* the conjecture is false (i.e., the ratio A(x)·√(log x)/x diverges rather than converging). +- The name `countA` is generic; `countSumOfTwoSquarefull` would be more descriptive, though the current name mirrors the A(x) notation from the problem statement, which is reasonable. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: it asks whether A(x) ~ c · x/√(log x) for some positive constant c, where A(x) counts integers up to x that are sums of two squarefull numbers. The notions of "squarefull," "sum of two," and the asymptotic equivalence ~ are all standard and admit unique formalizations. The answer (disproved) is also unambiguous. There is no meaningful ambiguity in this problem. + +## 6. Correctness + +**Assessment: The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsSquarefull`**: Correctly captures the standard definition of a squarefull (powerful) number with the appropriate positivity constraint. The condition `0 < m ∧ ∀ p, p.Prime → p ∣ m → p^2 ∣ m` is equivalent to the standard definition. Note that 1 is squarefull (vacuously), which is the conventional choice. + +- **`IsSumOfTwoSquarefull`**: Correctly requires both summands to be squarefull (hence positive). This means the decomposition n = a + b requires a, b ≥ 1, which matches the intended mathematical meaning. Crucially, 0 is excluded as a summand, preventing the trivial case. + +- **`countA`**: Counts over `Finset.Icc 1 x`, i.e., n ∈ {1, ..., x}. This matches the standard convention A(x) = #{n ≤ x : n is sum of two squarefull numbers} (the lower bound of 1 is harmless since 0 cannot be a sum of two positive numbers). + +- **`erdos_1081`**: The statement `answer(False) ↔ ∃ c > 0, Tendsto (fun x => countA x * √(log x) / x) atTop (nhds c)` correctly encodes: "It is NOT the case that A(x) · √(log x) / x converges to some positive c." Since `answer(False) = False` and `False ↔ P` is equivalent to `¬P`, this requires proving ¬(∃ c > 0, ...), which is exactly the content of Odoni's disproof. + +- **Asymptotic encoding**: The convergence `A(x) · √(log x) / x → c` is equivalent to A(x) ~ c · x/√(log x). This is a standard and correct way to express the asymptotic. The formalization uses `Tendsto ... atTop (nhds c)` which is the appropriate Lean/Mathlib idiom for limit convergence. + +- **Consistency with known results**: Blomer–Granville showed A(x) ≈ x/(log x)^α · (log log x)^{O(1)} with α ≈ 0.206. Thus A(x) · √(log x) / x ≈ (log x)^{0.5−α} · (log log x)^{O(1)} → ∞, confirming no finite positive limit exists. The formalization is consistent with the state of the art. + +**No mathematical errors identified.** + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Needs improvement | Should use `Nat.Powerful` from shared library | +| Citations | Incomplete | Missing 3 references and full bibliographic details | +| Variants | Missing | Odoni's lower bound / Blomer–Granville estimate not formalized | +| Readability | Good | Minor naming/docstring improvements possible | +| Formalizability | Excellent | Unambiguous, clearly formalizable | +| Correctness | Correct | No mathematical errors found | diff --git a/ai-review/1082.md b/ai-review/1082.md new file mode 100644 index 0000000000..8f451be81c --- /dev/null +++ b/ai-review/1082.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 1082 + +## 1. Code Reuse + +**`distinctDistances`**: The local definition at line 33 is an exact duplicate of the canonical definition in `FormalConjecturesForMathlib/Geometry/2d.lean:194`. The TODO comment at line 32 acknowledges this and says it should be removed once the project is bumped. This is the correct approach — the import should be used instead. + +**`distinctDistancesFrom`**: Defined locally at line 40. No equivalent exists in the shared `FormalConjecturesForMathlib` module. The TODO at line 39 suggests moving it to `ForMathlib`, which would be appropriate since several other Erdős problems (e.g., 653) define similar per-point distance functions locally. Centralizing this in `FormalConjecturesForMathlib/Geometry/2d.lean` alongside `distinctDistances` would reduce duplication across the codebase. + +**`NonTrilinear`**: Correctly imported from `FormalConjecturesForMathlib/Geometry/2d.lean` via `ProblemImports` and accessed through the `EuclideanGeometry` namespace. No duplication issue here. + +## 2. Citations + +The formalization only links to `erdosproblems.com/1082`. The website attributes the conjecture to **Szemerédi** and cites: + +> **[Er75f]** — Szemerédi proved the weaker result with ⌊n/2⌋ replaced by n/3, and also showed that if no k points are collinear, some point determines ≫ n/k distinct distances. This proof is unpublished but appears in [Er75f]. + +The formalization's docstrings should cite **[Er75f]** to match the website's attribution. The docstring for part ii correctly credits Xichuan's counterexample from the forum, which is good. + +## 3. Variants + +**Captured:** +- Part (i): Does the set determine at least ⌊n/2⌋ distinct distances overall? (Open) +- Part (ii): Must a single point witness ⌊n/2⌋ distinct distances? (Resolved: No) + +**Not captured:** +- The website notes this is a stronger form of **Problem 93** and **Problem 982**, and is related to **Problem 660** and **Problem 89**. These cross-references are not mentioned in the docstrings. +- **Higher-dimensional variants**: Altman proved the result for vertices of convex polyhedra in ℝ³; Szemerédi proved it when no four points are coplanar. These are not formalized. +- **Szemerédi's weaker bound**: The ⌊n/3⌋ result (and more generally ≫ n/k when no k points are collinear) is not formalized. + +These are separate results and not strictly required, but mentioning the related problems in the docstring would improve context. + +## 4. Readability + +The code is clean and readable. The docstrings clearly state both parts of the problem in mathematical notation. The counterexample discussion in part (ii)'s docstring is helpful. + +Minor suggestions: +- The `open EuclideanGeometry` is clear and appropriate. +- The naming `erdos_1082.parts.i` / `erdos_1082.parts.ii` follows project conventions. + +## 5. Formalizability + +Both parts are precisely stated discrete geometry questions with no ambiguity: +- Part (i): A universal statement about finite point sets in ℝ² with a collinearity constraint, asking about a count of distinct distances. Fully formalizable. The `answer(sorry)` wrapper correctly reflects that the truth value is unknown. +- Part (ii): Same setup, asking for a witness point. Fully formalizable. The answer is definitively `False`. + +**Assessment: No ambiguity.** Both statements are concrete, finitary, and have clear mathematical meaning. + +## 6. Correctness + +### Part (i) +```lean +theorem erdos_1082.parts.i : answer(sorry) ↔ + ∀ (A : Finset ℝ²) (hA_n3c : NonTrilinear (A : Set ℝ²)), + A.card / 2 ≤ distinctDistances A +``` + +**Correct.** `A.card / 2` is natural number division, yielding ⌊n/2⌋ as intended. `distinctDistances` counts distinct values of `dist x y` over ordered pairs `(x, y)` with `x ≠ y` via `offDiag`. Since `dist` is symmetric, the image is the same as for unordered pairs, so no overcounting occurs. The `answer(sorry)` correctly reflects the open status. + +One subtlety: the formalization does not require `A.Nonempty`. For the empty set or a singleton, `A.card / 2 = 0` and `distinctDistances A = 0`, so the inequality holds vacuously. This is fine. + +### Part (ii) +```lean +theorem erdos_1082.parts.ii : answer(False) ↔ + ∀ (A : Finset ℝ²) (hA : A.Nonempty) (hA_n3c : NonTrilinear (A : Set ℝ²)), + ∃ (a : ℝ²) (ha : a ∈ A), A.card / 2 ≤ distinctDistancesFrom A a - 1 +``` + +**Correct.** The `- 1` is mathematically necessary: since `a ∈ A`, the value `dist a a = 0` is included in the image computed by `distinctDistancesFrom`, so subtracting 1 gives the count of distinct *positive* distances from `a` to other points. (All points in a `Finset` are distinct, and `NonTrilinear` ensures no degeneracy issues with collinear triples.) + +The `answer(False)` is correct: Xichuan's counterexample (42 points on two concentric regular 21-gons, each point determining only 20 < 21 = ⌊42/2⌋ distinct distances) disproves the statement, and the docstring mentions an even smaller 8-point counterexample where each point determines only 3 < 4 = ⌊8/2⌋ distances. + +The `Nonempty` hypothesis in part (ii) but not part (i) is appropriate: part (ii) requires existential witness `a ∈ A`, which needs nonemptiness, while part (i) holds vacuously for empty sets. + +**Potential concern (minor):** The `- 1` on a natural number: if `distinctDistancesFrom A a = 0`, then `distinctDistancesFrom A a - 1 = 0` by underflow. However, since `A.Nonempty` and `a ∈ A`, the image `(A.image fun x => dist x a)` contains at least `dist a a = 0`, so `distinctDistancesFrom A a ≥ 1`, and the subtraction is safe. No bug here. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `distinctDistances` duplicated; `distinctDistancesFrom` should be centralized | +| Citations | Missing [Er75f] reference and Szemerédi attribution | +| Variants | Core two-part problem captured; higher-dimensional and weaker variants not included | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | **Correct** — both parts are mathematically sound | diff --git a/ai-review/1083.md b/ai-review/1083.md new file mode 100644 index 0000000000..47e67a28a8 --- /dev/null +++ b/ai-review/1083.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 1083 + +## 1. Code Reuse + +**Problem 1089** (`ErdosProblems/1089.lean`) defines dimension-generic versions of essentially the same concepts: + +```lean +-- 1089's approach (Finset-based): +noncomputable def distinctDistances {d : ℕ} (S : Finset (EuclideanSpace ℝ (Fin d))) : Finset ℝ := + S.biUnion (fun a => (S.erase a).image (fun b => dist a b)) + +noncomputable def distinctDistanceCount {d : ℕ} (S : Finset (EuclideanSpace ℝ (Fin d))) : ℕ := + (distinctDistances S).card +``` + +Problem 1083 defines its own `distinctDistanceCountInDim` using `Set.ncard` over an existentially-quantified set. These are mathematically equivalent, but 1089's `Finset`-based approach is arguably preferable because: +- It stays in `Finset` land, avoiding `Set.ncard` (which returns 0 for infinite sets, though this is not a concern here since finite point sets determine finitely many distances). +- It produces a `Finset ℝ` intermediate value, which is more compositional. +- The dimension parameter `d` is implicit in 1089 vs explicit in 1083; implicit is more idiomatic. + +**Recommendation:** Consolidate `distinctDistanceCountInDim` with 1089's `distinctDistanceCount`, or extract a shared definition into a utility module. Several other problems (93, 95, 98, 223, 652, 653, 655, 660, 670, 1088) also define their own variants of distinct distance counting. + +The `minDistinctDistances` definition using `sInf` over `ℕ` is fine and mirrors 1088's `erdosF` pattern. + +## 2. Citations + +The formalization references **[Er46b]** and **[Er75f, p.101]**, both present in the docstring and matching the website. + +The website additionally mentions the following partial results not referenced in the formalization: +- **[CEGSW90]** Clarkson, Edelsbrunner, Guibas, Sharir, Welzl: $f_3(n) \gg n^{1/2}$ +- **[APST04]** Aronov, Pach, Sharir, Tardos: $f_d(n) \gg n^{1/(d - 90/77) - o(1)}$ for $d \geq 3$ +- **[SoVu08]** Solymosi & Vu: $f_3(n) \gg n^{3/5}$ and $f_d(n) \gg_d n^{2/d - c/d^2}$ for $d \geq 4$ + +These are partial results toward the conjecture and would enrich the docstring, though they are not strictly required. + +## 3. Variants + +The formalization captures only the **lower bound** part of the conjecture $f_d(n) = n^{2/d - o(1)}$. This is appropriate because: +- The matching upper bound $f_d(n) \ll_d n^{2/d}$ is already proved (Erdős [Er46b]), and this implies $f_d(n) \leq n^{2/d + \varepsilon}$ for large $n$. +- The open content of the conjecture is entirely the lower bound. + +The docstring correctly explains this reasoning. + +**Related problems not cross-referenced:** +- **Problem 89**: The 2D distinct distances problem (different conjectured exponent). The website notes 1083 generalizes this. +- **Problem 1089**: The "inverse function" $g_d(n)$ problem, which is closely related. + +Adding cross-references to these in the docstring would be helpful. + +## 4. Readability + +The code is clear and well-structured. Minor suggestions: + +- The name `distinctDistanceCountInDim` is verbose. Since the dimension is already a parameter, `distinctDistanceCount` (as in 1089) would suffice. +- The explicit `d` parameter (vs implicit in 1089) is a stylistic inconsistency across the codebase. +- The docstring is well-written and clearly explains what is being formalized vs. what is already known. + +## 5. Formalizability + +**Assessment: Clearly formalizable, with one standard subtlety.** + +The conjecture $f_d(n) = n^{2/d - o(1)}$ involves asymptotic $o(1)$ notation. The formalization correctly unpacks this as: for all $\varepsilon > 0$, eventually $f_d(n) \geq n^{2/d - \varepsilon}$. This is the standard way to formalize "$o(1)$ in the exponent" and introduces no ambiguity. + +All components (`EuclideanSpace`, `Finset`, `dist`, `sInf` over `ℕ`) are well-supported in Mathlib. + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +Detailed analysis: + +1. **`distinctDistanceCountInDim`**: The set `{r : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ r = dist p q}` correctly captures all distinct pairwise distances. Since `dist p q = dist q p`, the set naturally deduplicates. The use of `Set.ncard` is safe because a finite point set determines at most $\binom{n}{2}$ distances (finite). + +2. **`minDistinctDistances`**: Uses `sInf` on `ℕ`, which equals the minimum for nonempty sets. The set is nonempty for any $n$ (we can always place $n$ points in $\mathbb{R}^d$ for $d \geq 1$). With $d \geq 3$ in the theorem, this is guaranteed. + +3. **The theorem statement**: Correctly formalizes "for all $d \geq 3$, for all $\varepsilon > 0$, $\exists N_0$ such that $\forall n \geq N_0$, $f_d(n) \geq n^{2/d - \varepsilon}$." The casting to `ℝ` for the exponentiation and comparison is appropriate. + +4. **Edge cases**: The theorem avoids degenerate cases ($n = 0, 1$) via the $n \geq N_0$ threshold. No issues. + +5. **One minor observation**: The formalization does not include the known lower bound $f_d(n) \gg n^{1/d}$ as a separate theorem, nor the known upper bound $f_d(n) \ll_d n^{2/d}$. These could serve as useful sanity-check lemmas and partial results, but their absence does not affect correctness of the conjecture statement. + +**No mathematical flaws identified.** diff --git a/ai-review/1086.md b/ai-review/1086.md new file mode 100644 index 0000000000..1de159dde3 --- /dev/null +++ b/ai-review/1086.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 1086 + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`triangleArea`**: Problem 1086 defines its own `triangleArea` in namespace `Erdos1086`, but an essentially identical definition already exists in `FormalConjectures/ErdosProblems/353.lean:44` (namespace `Erdos353`). Both use the cross-product formula `|(q.1 - p.1) * (r.2 - p.2) - (q.2 - p.2) * (r.1 - p.1)| / 2` on `ℝ × ℝ`. Additionally, a more general `triangle_area` exists in `FormalConjecturesForMathlib/Geometry/2d.lean:175` using `positiveOrientation.areaForm`, which works over general oriented Euclidean planes. The `2d.lean` version is the most canonical and comes with a proof (`triangle_area_eq_det`) relating it to a determinant. **Recommendation:** Factor out the `ℝ × ℝ` cross-product area into a shared utility or use the `EuclideanGeometry.triangle_area` from `2d.lean`, having problems 353 and 1086 both import it. + +- **`countTrianglesWithArea`**: The pattern of filtering `S ×ˢ (S ×ˢ S)` for ordered tuples satisfying a geometric predicate is ad-hoc here but follows patterns seen in problems 90 (`unitDistancePairsCount`), 756 (`pairCount`), and 210 (`ordinaryLineCount`). No shared abstraction exists yet, so the current inline definition is acceptable, but a shared "count ordered k-tuples satisfying P" utility could benefit multiple problems. + +- **`Triplewise`** from `FormalConjecturesForMathlib/Data/Set/Triplewise.lean` could potentially be used to express properties over distinct triples, though the current Finset-product approach is more natural for counting. + +## 2. Citations + +The website lists the following references for Problem 1086: + +| Citation | On Website | In Formalization | Status | +|----------|-----------|-----------------|--------| +| Erdős & Purdy (1971) [ErPu71] | Yes | Yes | OK | +| Erdős (1975) [Er75f], p.104 | Yes | **Missing** | Should add | +| Pach & Sharir (1992) [PaSh92] | Yes | **Missing** | Should add (intermediate bound) | +| Dumitrescu, Sharir & Tóth (2009) [DST09] | Yes | **Missing** | Should add (intermediate bound) | +| Apfelbaum & Sharir (2010) [ApSh10] | Yes | **Missing** | Should add (intermediate bound) | +| Apfelbaum (2013) [Ap13] | Yes | **Missing** | Should add | +| Raz & Sharir (2017) [RaSh17] | Yes | Yes | OK | +| Purdy (1974) [Pu74] | Yes (higher-dim) | **Missing** | Optional (higher-dim variant) | + +**The docstring is missing 5 references** that appear on the website. At minimum, [Er75f], [PaSh92], [DST09], and [ApSh10] should be added since they document the progression of bounds in the 2D case. The attribution to Oppenheim mentioned in the docstring is consistent with the website. + +## 3. Variants + +The website describes several variants **not captured** in the formalization: + +1. **Higher-dimensional generalizations**: The website discusses $g_d^r(n)$, the maximum number of equal-volume $r$-simplices in $\mathbb{R}^d$. Specific results include: + - $g_3^2(n) \ll n^{2.4286}$ (Dumitrescu, Sharir & Tóth, 2009) + - $g_6^2(n) \gg n^3$ (Erdős & Purdy, 1971) + - $g_4^2(n), g_5^2(n) \ll n^{3-c}$ for some $c > 0$ (Purdy, 1974) + - $g_{2k+2}^k(n) \geq \left(\frac{1}{(k+1)^{k+1}} + o(1)\right) n^{k+1}$ (Oppenheim/Lenz construction) + +2. **Known bounds as separate statements**: The proven bounds $n^2 \log\log n \ll g(n) \ll n^{20/9}$ could be formalized as separate theorems rather than only mentioned in the docstring. + +3. **Related problems**: The website links to Problems #90 (unit distances) and #755 as related. The formalization does not cross-reference these. + +**Recommendation:** The higher-dimensional variants are substantively different problems and could reasonably be separate files. The known bounds (especially the Raz-Sharir upper bound) would be valuable as separate `@[category research proved]` statements. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The docstring for `countTrianglesWithArea` says "ordered triples" and explains the factor-of-6 relationship, which is good. However, the main theorem docstring could more explicitly state that the conjecture is that $g(n) = O(n^{2+\varepsilon})$ for every $\varepsilon > 0$, to make the connection to standard notation clearer. +- The variable name `A` for area is fine, but the docstring for the theorem says "the number of triangles with area $A$" without noting that this is the *ordered* count. The note about absorbing the factor of 6 into $C$ partially addresses this but could be clearer. +- The namespace `Erdos1086` is consistent with project conventions. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem as stated on the website ("Estimate $g(n)$") is open-ended, but the formalization chooses a specific, well-defined conjecture: that $g(n) = O(n^{2+\varepsilon})$ for every $\varepsilon > 0$. This is a standard and precise mathematical statement. + +The only source of mild ambiguity is the choice between ordered and unordered triples, which the formalization handles correctly by using ordered triples and noting the constant absorbs the factor of 6. The use of `∀ ε > 0, ∃ C > 0` is the standard way to express "$o(n^{2+\delta})$ for any fixed $\delta$" type bounds. + +The formalization is clearly formalizable and the chosen statement is unambiguous. + +## 6. Correctness + +**The formalization is mathematically correct with one notable design choice and one minor concern:** + +**Correct aspects:** +- The `triangleArea` formula is the standard signed-area cross-product formula with absolute value, giving the unsigned area. This is correct. +- The `countTrianglesWithArea` correctly counts ordered triples of distinct points, filtering for exact area match. The distinctness conditions `p ≠ q ∧ p ≠ r ∧ q ≠ r` correctly exclude degenerate triples. +- The main theorem statement `∀ ε > 0, ∃ C > 0, ∀ S A, count ≤ C * |S|^{2+ε}` is the correct formalization of "$g(n) \ll n^{2+\varepsilon}$ for every $\varepsilon > 0$." +- The bound applies uniformly over all finite sets $S$ and all areas $A$, which correctly captures the "maximum over all configurations" aspect of $g(n)$. + +**Design choice — ordered vs. unordered triples:** +The formalization counts ordered triples (each unordered triangle counted 6 times). This is mathematically equivalent to the unordered version up to a constant factor, which is absorbed into $C$. This is a valid and common choice in combinatorial geometry formalizations. An alternative using `S.powersetCard 3` or `Sym3` would count unordered triples directly, but the current approach is simpler to define. + +**Minor concern — degenerate triangles:** +Triples of collinear points have area 0. The formalization counts these as "triangles of area 0" when `A = 0`. This is technically included in the bound but is a degenerate case. For $A = 0$, the count of collinear triples can indeed be $\Theta(n^2)$ for typical configurations and $O(n^3)$ in the worst case (all points collinear). The conjecture with the $\varepsilon$ room handles this correctly (even $n^3$ is bounded by $C n^{2+\varepsilon}$ for large enough $C$ for any fixed finite $n$, and the asymptotic bound $g(n) \ll n^{2+\varepsilon}$ still holds for the $A = 0$ case by Szemerédi-Trotter type bounds). So this is not a bug, just worth noting. + +**Overall assessment: Correct and complete for the stated conjecture.** The formalization faithfully captures the Erdős-Purdy belief that the lower bound $n^{2+o(1)}$ is closer to the truth. The main gap is not in correctness but in completeness — the known proven bounds and higher-dimensional variants are not formalized. diff --git a/ai-review/1087.md b/ai-review/1087.md new file mode 100644 index 0000000000..6d613195f2 --- /dev/null +++ b/ai-review/1087.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 1087 + +## 1. Code Reuse + +**Opportunity identified.** The `degenerateQuadrupleCount` definition uses `P.powerset.filter (fun S => S.card = 4 ∧ HasRepeatedDistance S)`. The `powerset.filter (·.card = 4)` pattern can be replaced with `P.powersetCard 4`, which is a dedicated Mathlib API for selecting subsets of a given cardinality. This is used elsewhere in the codebase (e.g., Problem 500 uses `powersetCard 3`, Problem 543 uses `powersetCard k`). The revised definition would be: + +```lean +noncomputable def degenerateQuadrupleCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + ((P.powersetCard 4).filter HasRepeatedDistance).card +``` + +Additionally, several other Erdős distance problems define a `pairCount` or `distFrequency` helper (Problems 957, 756, 132) using the `(A ×ˢ A).filter` pattern. While these are not directly applicable here (since `HasRepeatedDistance` checks for repeated distances among all 6 pairs within a 4-element subset rather than counting a specific distance), they represent an alternative formulation style. No existing shared utility in `FormalConjecturesForMathlib` directly applies. + +## 2. Citations + +**Missing citation.** The website at [erdosproblems.com/1087](https://www.erdosproblems.com/1087) lists two references: + +- **[ErPu71]** Erdős, P. and Purdy, G., _Some extremal problems in geometry_. (Included in formalization ✓) +- **[Er75f]** Erdős (1975, p. 104). (**Missing from formalization** ✗) + +The docstring should include the second reference: + +``` +[Er75f] Erdős, P. (1975), p. 104. +``` + +## 3. Variants + +**Partially captured.** The problem on the website asks to "estimate $f(n)$," which encompasses both upper and lower bounds. The formalization captures only the specific upper bound conjecture $f(n) \leq n^{3+o(1)}$. The known bounds $n^3 \log n \ll f(n) \ll n^{7/2}$ are mentioned in the docstring but not formalized. + +Possible additional formalizations that would capture the full picture: +- The known lower bound: $\exists c > 0, \forall n, f(n) \geq c \cdot n^3 \cdot \log n$ +- The known upper bound: $\exists C > 0, \forall n, f(n) \leq C \cdot n^{7/2}$ + +However, since these are known results rather than open conjectures, omitting them is a reasonable editorial choice. The main open question — whether $f(n) \leq n^{3+o(1)}$ — is the one formalized, and this is appropriate. + +## 4. Readability + +**Good overall, minor improvements possible.** + +- As noted in §1, replacing `powerset.filter (fun S => S.card = 4 ∧ ...)` with `(powersetCard 4).filter ...` would improve readability by separating the cardinality constraint from the mathematical property. +- The `HasRepeatedDistance` definition uses deeply nested `∃ a ∈ S, ∃ b ∈ S, ∃ c ∈ S, ∃ d ∈ S, ...` quantifiers. This is standard Lean style and acceptable, though the docstring helpfully explains the intent. +- The conjecture docstring is clear and well-structured, stating both the informal problem and the formal interpretation. + +## 5. Formalizability + +**High — the problem is precise and clearly formalizable.** The notion of "degenerate 4-element subset" (one containing two distinct pairs at the same distance) is unambiguous. The asymptotic question "$f(n) \leq n^{3+o(1)}$" is cleanly rendered as "$\forall \varepsilon > 0, \exists N, \forall n \geq N$, the count is $\leq n^{3+\varepsilon}$," which is a standard and correct way to formalize $n^{3+o(1)}$ upper bounds. + +**Ambiguity level: Very low.** The only potential source of ambiguity is the meaning of "degenerate" — whether it means any repeated distance among the $\binom{4}{2} = 6$ pairs, or something more specific (e.g., collinear, co-circular). The Erdős–Purdy formulation is clear that it means repeated distances, and this is what the formalization captures. + +## 6. Correctness + +**Mathematically correct.** Detailed analysis: + +- **`HasRepeatedDistance`:** The predicate finds $a, b, c, d \in S$ with $a \neq b$, $c \neq d$, $\{a,b\} \neq \{c,d\}$ (as unordered pairs), and $\operatorname{dist}(a,b) = \operatorname{dist}(c,d)$. The condition $(\text{a} \neq c \lor b \neq d) \land (a \neq d \lor b \neq c)$ correctly encodes that the unordered pairs are distinct: $\{a,b\} = \{c,d\}$ iff $(a=c \land b=d) \lor (a=d \land b=c)$, so negation gives exactly the stated condition. This is correct. ✓ + +- **`degenerateQuadrupleCount`:** Counts 4-element subsets of $P$ satisfying `HasRepeatedDistance`. This is the correct combinatorial object. ✓ + +- **`erdos_1087`:** The universal quantification "$\forall \varepsilon > 0, \exists N, \forall n \geq N, \forall P$ with $|P| = n$, count $\leq n^{3+\varepsilon}$" correctly formalizes "$f(n) \leq n^{3+o(1)}$". The exponent $(3 : \mathbb{R}) + \varepsilon$ and the cast to $\mathbb{R}$ for the comparison with `n ^ (3 + ε)` are handled properly. ✓ + +- **`answer(sorry)`:** Appropriate for an open problem whose truth value is unknown. ✓ + +- **Edge case check:** For $n < 4$, there are no 4-element subsets, so the count is 0 and the bound holds trivially. The formalization handles this correctly since `powersetCard 4` (or the equivalent filter) returns the empty set. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor: use `powersetCard 4` | +| Citations | Missing [Er75f] reference | +| Variants | Main conjecture captured; known bounds not formalized (acceptable) | +| Readability | Good; minor improvement with `powersetCard` | +| Formalizability | Very high; minimal ambiguity | +| Correctness | Correct and complete ✓ | diff --git a/ai-review/1088.md b/ai-review/1088.md new file mode 100644 index 0000000000..8068fc22e3 --- /dev/null +++ b/ai-review/1088.md @@ -0,0 +1,93 @@ +# AI Review: Erdos Problem 1088 + +## 1. Code Reuse + +**`AllPairwiseDistinctDists`**: This definition is structurally identical to the `IsSidonSet` pattern used in Problem 530 (`FormalConjectures/ErdosProblems/530.lean:48-50`) — both use a 4-quantifier pattern asserting that matching values force the two unordered pairs to coincide. However, the Sidon definition is about sums (`a + b = c + d`) while this one is about distances (`dist a b = dist c d`), so they are genuinely different concepts despite the parallel structure. + +The closely related Problem 1089 (`FormalConjectures/ErdosProblems/1089.lean`) defines `distinctDistances` and `distinctDistanceCount` for counting distinct distances from a point set. These are not directly reusable here since 1088 asks for a *subset* with all-distinct distances, not a count of distances. + +`FormalConjecturesForMathlib/Combinatorics/Basic.lean` provides a general `IsSidon` predicate for additive structures, but it is not applicable to the metric distance setting. + +**Potential improvement**: `AllPairwiseDistinctDists` could be expressed more concisely using Mathlib's `Set.InjOn` on the map sending unordered pairs to their distance. This would be: + +``` +def AllPairwiseDistinctDists (S : Finset α) : Prop := + Set.InjOn (fun p : α × α => dist p.1 p.2) {p ∈ S ×ˢ S | p.1 ≠ p.2} -- modulo symmetry +``` + +However, handling unordered pairs cleanly in Lean is non-trivial, and the explicit 4-quantifier formulation is arguably clearer and more self-contained. No strong recommendation to change. + +**Verdict**: No existing library code can be directly reused. The local definitions are justified. + +## 2. Citations + +The website (erdosproblems.com/1088) lists two citations: +- **[Er75f]** — Erdos, P. (1975), p. 104. ✅ Mentioned in the docstring. +- **[Cr62]** — Croft, H. T., *9-point and 7-point configurations in 3-space*, Proc. London Math. Soc. (3) (1962), 400-424. ❌ **Not mentioned** in the docstring, despite being relevant to the result $f_3(3) = 9$ which *is* stated in the docstring. + +The website also references related Problems 530 (one-dimensional case) and 503 (three-point case). Neither cross-reference appears in the docstring. + +**Recommendation**: Add `[Cr62]` with its full citation to the docstring, and add cross-references to Problems 530 and 503. + +## 3. Variants + +The website documents several specific known results that are **not formalized as variants**: + +| Result | Status | Notes | +|--------|--------|-------| +| $f_1(n) \asymp n^2$ | Not formalized | Related to Problem 530 | +| $f_d(3) = d^2/2 + O(d)$ | Not formalized | Related to Problem 503 | +| $f_2(3) = 7$ | Not formalized | Due to Erdos | +| $f_3(3) = 9$ | Not formalized | Due to Croft [Cr62] | +| $f_d(n) \leq n^{O_d(1)}$ | Not formalized | "Easy" upper bound | +| $f_d(n) \leq c_n^d$ | Not formalized | Erdos-Straus claim | + +All of these are stated in the docstring text but none are formalized as separate theorem statements. The $f_2(3) = 7$ and $f_3(3) = 9$ results are concrete solved values that would be natural to formalize as `erdos_1088.variants.*` theorems. + +**Recommendation**: Add variant formalizations for at least the concrete solved cases ($f_2(3) = 7$, $f_3(3) = 9$) and ideally the asymptotic results. + +## 4. Readability + +The code is clean and readable: + +- `AllPairwiseDistinctDists` has a clear docstring explaining the mathematical concept. +- `erdosF` has a clear docstring defining $f_d(n)$. +- The theorem statement is well-structured with explicit quantifiers. +- The namespace `Erdos1088` prevents name collisions. + +**Minor suggestions**: +- The docstring for `erdos_1088` says "for fixed $n \geq 3$" but the formalization universally quantifies over all such $n$, which is fine (and stronger). No issue here. +- Consider adding a brief comment noting that the formulation captures only the upper-bound direction of $2^{o(d)}$, with a note that the lower bound $f_d(n) \geq 1$ makes this equivalent. + +## 5. Formalizability + +The problem statement is precise and unambiguous: +- $f_d(n)$ is well-defined as a minimum (it exists because the trivial bound shows the defining set is nonempty for reasonable parameters). +- The question "$f_d(n) = 2^{o(d)}$?" is a clean yes/no question. +- The $2^{o(d)}$ notation has a standard meaning: $\log_2 f_d(n) / d \to 0$ as $d \to \infty$. + +**Ambiguity assessment**: Very low. The only potential subtlety is that "estimate $f_d(n)$" is open-ended, but the specific sub-question "$f_d(n) = 2^{o(d)}$?" is precise and is what is formalized. + +## 6. Correctness + +### `AllPairwiseDistinctDists` (lines 41-45) +**Correct.** The definition properly captures "all pairwise distances are distinct" by asserting: if `dist a b = dist c d` with `a ≠ b` and `c ≠ d`, then $\{a,b\} = \{c,d\}$ as unordered pairs. This is the standard formulation. + +### `erdosF` (lines 49-53) +**Correct.** Defined as $\inf\{m \mid \forall S \text{ with } |S| \geq m, \exists T \subseteq S, |T| = n \land \text{AllPairwiseDistinctDists}(T)\}$. This matches the definition of $f_d(n)$. + +**Edge case note**: When the defining set is empty (e.g., $d = 0$, $n \geq 2$), `sInf ∅ = 0` in $\mathbb{N}$. This is harmless because the theorem only needs the bound for $d \geq D_0$ with $D_0$ arbitrarily large, and $0 \leq 2^{\varepsilon d}$ is trivially true. + +### `erdos_1088` (lines 62-68) +**Correct.** The formalization states: + +$$\forall n \geq 3,\; \forall \varepsilon > 0,\; \exists D_0,\; \forall d \geq D_0: \quad f_d(n) \leq 2^{\varepsilon d}$$ + +This is equivalent to $f_d(n) = 2^{o(d)}$ for fixed $n \geq 3$, because: +- The formalization captures $f_d(n) \leq 2^{o(d)}$ (the upper bound direction). +- Since $f_d(n) \geq 1 = 2^0$ trivially, we have $\log_2 f_d(n) \geq 0$, so $\liminf \log_2 f_d(n)/d \geq 0$. +- Combined: $\log_2 f_d(n)/d \to 0$, i.e., $f_d(n) = 2^{o(d)}$. + +The use of `answer(sorry)` correctly reflects that this is an open problem whose truth value is unknown. + +**Overall assessment**: The formalization is mathematically correct and faithfully captures the core question. The main gaps are missing variant formalizations and an incomplete citation ([Cr62]). diff --git a/ai-review/1089.md b/ai-review/1089.md new file mode 100644 index 0000000000..52a8d4c29b --- /dev/null +++ b/ai-review/1089.md @@ -0,0 +1,109 @@ +# AI Review: Erdős Problem 1089 + +## 1. Code Reuse + +**Several opportunities exist but the current approach is consistent with codebase conventions.** + +Each Erdős distance problem in the codebase defines its own local `distinctDistances` / `distinctDistanceCount` within its namespace. Problem 1089 follows this pattern. However, it's worth noting the implementation differences: + +- **1089** uses `S.biUnion (fun a => (S.erase a).image (fun b => dist a b))` — a `biUnion`/`erase` approach. +- **Problem 93** uses `A.offDiag.image (fun pq => dist pq.1 pq.2)` — the `offDiag` approach (also used in `FormalConjecturesForMathlib/Geometry/2d.lean:194`). +- **Problem 1083** uses `Set.ncard {r : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ r = dist p q}` — a `Set.ncard` existential approach. + +The `offDiag.image` approach is arguably the most idiomatic and readable. It is also used in the shared library (`FormalConjecturesForMathlib/Geometry/2d.lean`), though that definition is restricted to `ℝ²`. Problem 1089's `biUnion`/`erase` formulation is mathematically equivalent but slightly harder to reason about in Lean — see Correctness section for a subtlety. + +**Recommendation:** The `offDiag.image` approach could be used here instead for consistency with the shared library: +```lean +noncomputable def distinctDistances {d : ℕ} (S : Finset (EuclideanSpace ℝ (Fin d))) : Finset ℝ := + S.offDiag.image (fun pq => dist pq.1 pq.2) +``` +This is definitionally simpler and avoids the `biUnion`/`erase` intermediate step. + +## 2. Citations + +**Website data (erdosproblems.com/1089):** +- The problem is attributed to **Kelly** (original question). +- Lower bound: **Aletheia-Zomlefer** (generalizing a construction from Problem 502). The website refers to this person as "Aletheia" without further detail. +- Upper bound: **Bannai, Bannai, and Stanton**. +- Historical work by **Erdős and Straus** (unpublished) is mentioned on the website but not in the formalization. + +**Issues with current citations:** +- The docstring cites `[Fe26]` for Aletheia-Zomlefer, but the website does not use this citation key. The `[Fe26]` tag is not standard and its origin is unclear — the website simply credits "Aletheia" without a bracketed reference. This should be verified against the actual bibliography. +- The docstring cites `[BBS83]` for Bannai, Bannai, and Stanton. The website does not provide this citation key either, but "BBS83" is a reasonable abbreviation if the paper is from 1983. +- The website mentions specific cases ($g_1(3)=4$, $g_2(3)=6$, $g_3(3)=7$ due to Croft, and $g_d(d+1)>2^d$ via hypercube vertices) that are not captured in the formalization. These are supplementary results, not the main theorem, so their omission is acceptable. +- The historical contribution of Erdős and Straus is not mentioned. This is minor. + +**Recommendation:** Expand the citation for Aletheia-Zomlefer with a full bibliographic entry if available, or drop the unclear `[Fe26]` key. Confirm the `[BBS83]` reference corresponds to a 1983 paper. + +## 3. Variants + +**The main variant is captured; some supplementary results are not.** + +The formalization captures the central resolved question: the existence and value of $\lim_{d\to\infty} g_d(n)/d^{n-1} = 1/(n-1)!$ for $n \geq 2$. + +**Not captured:** +- The explicit bounds $\binom{d+1}{n-1}+1 \leq g_d(n) \leq \binom{d+n-1}{n-1}+1$ are mentioned in the docstring but not formalized as separate theorems. These are stronger finite-dimensional statements that imply the limit result and could be valuable independent formalizations. +- Specific small cases ($g_1(3)=4$, $g_2(3)=6$, $g_3(3)=7$, $g_d(d+1)>2^d$) from the website are not formalized. + +**Recommendation:** Consider adding the binomial bounds as separate theorem statements, as they are the actual mathematical results that resolve the limit question. The limit is a corollary of these bounds. + +## 4. Readability + +**Generally good, with minor suggestions.** + +- The definition of `distinctDistances` using `biUnion`/`erase` is slightly less readable than the `offDiag` alternative. A reader must mentally verify that `S.biUnion (fun a => (S.erase a).image (fun b => dist a b))` correctly produces the set of all pairwise distances. +- The definition of `g` is clear and well-documented. +- The main theorem statement is clean and uses `Tendsto` with `atTop`/`nhds` appropriately. +- The `answer(True)` wrapper signals this is a resolved yes/no question. This is appropriate since the original problem asks "does the limit exist?" and the answer is yes. + +**Minor:** The `open Classical Finset Filter` line could be more granular (e.g., only opening what's actually needed), but this is a stylistic nitpick consistent with codebase conventions. + +## 5. Formalizability + +**High formalizability. The statement is precise.** + +The problem as stated on the website asks: "Does $\lim_{d\to\infty} g_d(n)/d^{n-1}$ exist?" — this is unambiguous once $g_d(n)$ is defined. The definition of $g_d(n)$ (minimal number of points guaranteeing $n$ distinct distances) is precise. + +**Ambiguity assessment: Low.** The only potential ambiguity is whether "distinct distances" counts 0 (the distance from a point to itself). The formalization correctly excludes self-distances via `S.erase a`. The formalization also uses `dist a b` (which is nonneg and symmetric), so distances are unsigned — this matches the standard mathematical interpretation. + +One subtlety: `g` is defined via `sInf` on natural numbers. If the set is empty (i.e., no finite number of points suffices), `sInf ∅ = 0` in `ℕ`. For $n \geq 2$, the set is always nonempty (take enough points in general position), so this is not a problem in practice, but it means the definition silently returns 0 for degenerate cases. This is acceptable. + +## 6. Correctness + +**Mostly correct, with one potential subtlety.** + +### Main theorem correctness +The theorem states: +$$\forall n \geq 2, \quad \lim_{d \to \infty} \frac{g(d,n)}{d^{n-1}} = \frac{1}{(n-1)!}$$ + +This matches the resolved result from erdosproblems.com. The formalization uses `Tendsto` over `atTop` with target `nhds (1 / (Nat.factorial (n - 1) : ℝ))`, which is correct. + +The `answer(True) ↔ ...` pattern encodes that the answer to "does the limit exist?" is "yes" and specifies the exact value. This is a faithful encoding. + +### Definition correctness + +**`distinctDistances`:** The `biUnion`/`erase` approach computes: +$$\bigcup_{a \in S} \{ \text{dist}(a, b) \mid b \in S \setminus \{a\} \}$$ + +This is the set of all nonzero pairwise distances, which is correct. However, note a subtlety: `dist a b` for `a ≠ b` could theoretically be 0 if two distinct points coincide (i.e., the Finset contains "distinct" elements of `EuclideanSpace ℝ (Fin d)` that happen to map to the same point — but since `EuclideanSpace` elements are functions `Fin d → ℝ`, distinct Finset elements are truly distinct points, and `dist a b > 0` for `a ≠ b`). So this is fine. + +**`g`:** Uses `sInf` correctly. The condition `S.card ≥ m → distinctDistanceCount S ≥ n` correctly captures "every collection of at least $m$ points determines at least $n$ distinct distances." + +### Potential issue: `Tendsto` domain +The limit is over `d : ℕ` tending to infinity. For small `d` (e.g., `d = 0`), the expression `(g 0 n : ℝ) / (0 : ℝ) ^ (n-1)` involves division by zero (since $0^{n-1} = 0$ for $n \geq 2$). In Lean, `(x : ℝ) / 0 = 0` by convention. Since `Tendsto` only cares about the filter `atTop` (i.e., eventually large `d`), this is mathematically harmless — the limit ignores finitely many terms. No issue here. + +### Summary assessment +The formalization is **correct and complete** for the main result. The mathematical content faithfully represents the resolved problem. No experienced mathematician would identify obvious flaws. + +--- + +## Overall Assessment + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor improvement possible | Could use `offDiag` for consistency | +| Citations | Needs attention | `[Fe26]` citation key is unclear; website doesn't use it | +| Variants | Adequate | Main result captured; bounds could be separate theorems | +| Readability | Good | Clear and well-structured | +| Formalizability | High | Unambiguous mathematical statement | +| Correctness | Correct | Faithful encoding of the resolved problem | diff --git a/ai-review/1090.md b/ai-review/1090.md new file mode 100644 index 0000000000..d5638af336 --- /dev/null +++ b/ai-review/1090.md @@ -0,0 +1,80 @@ +# AI Review: Erdos Problem 1090 + +## 1. Code Reuse + +Several existing files employ nearly identical constructs: + +- **Problem 101** (`ErdosProblems/101.lean`): Defines `fourRichLineCount` using the exact same pattern — `AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2))`, `Module.finrank ℝ L.direction = 1`, and `Set.ncard {p | p ∈ (P : Set _) ∧ p ∈ L}`. A shared helper definition for "points of a finset lying on a line" (e.g., `pointsOnLine (P : Finset (EuclideanSpace ℝ (Fin 2))) (L : AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2)))`) could be extracted and reused across Problems 101, 102, and 1090. + +- **Problem 102** (`ErdosProblems/102.lean`): Uses `fourPlusRichLineCount` with the same line-counting infrastructure. + +- **`FormalConjecturesForMathlib/Geometry/2d.lean`**: Defines `NonTrilinear` (no three collinear) and related collinearity infrastructure. While not directly applicable, it shows established patterns for geometric predicates in ℝ². + +- **`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`**: Defines Ramsey-theoretic constructs with 2-coloring patterns. Since Problem 1090 is fundamentally Ramsey-theoretic (monochromatic structures under 2-colorings), there is conceptual overlap, though the hypergraph Ramsey formalization is not directly reusable here. + +No existing definition directly encapsulates "monochromatic line in a 2-coloring of a finite point set," which is the core concept of this problem. Such a definition could be introduced if more problems of this flavor arise. + +## 2. Citations + +The formalization references: + +> [Er75f] Erdős, P., *Problems and results on combinatorial number theory III*. + +The website (erdosproblems.com/1090) cites: + +> Erdős [Er75f, p.106] + +**Issue:** The formalization omits the page number `p.106`. The citation should be updated to include it. Otherwise, the reference key `[Er75f]` matches. + +The docstring mentions Graham and Selfridge (for the k=3 case) and "Hunter" (for the general case via Hales-Jewett). The website confirms these attributions, identifying "Zach Hunter" by full name. Consider using the full name "Zach Hunter" in the docstring for consistency with the website. + +## 3. Variants + +The problem as stated on erdosproblems.com is a single question parameterized by k ≥ 3. The formalization captures this with a universal quantifier over k. No additional variants are listed on the website, and the formalization correctly covers the full generality of the problem. + +One could consider natural extensions (r-colorings for r > 2, higher-dimensional ambient spaces), but these are not part of the stated problem and their omission is appropriate. + +## 4. Readability + +The formalization is reasonably readable. A few suggestions: + +- **Type alias**: The repeated `EuclideanSpace ℝ (Fin 2)` is verbose. The codebase has notation `ℝ^n` defined in `FormalConjecturesForMathlib/Geometry/Euclidean.lean`. Using this would improve readability, though it would add an import. + +- **Set comprehension**: The expression `{p : EuclideanSpace ℝ (Fin 2) | p ∈ (A : Set _) ∧ p ∈ L}` is essentially `(A : Set _) ∩ (L : Set _)`. Writing it as a set intersection would be cleaner, though it requires appropriate coercions. Alternatively, a local `let` binding like `let onLine := {p | p ∈ (A : Set _) ∧ ↑p ∈ L}` could help. + +- **Monochromatic condition**: The innermost `∃ color : Fin 2, ∀ p ∈ (A : Set _), p ∈ L → c p = color` is clear and correct. No change needed. + +Overall readability is good for the complexity of the statement. + +## 5. Formalizability + +The problem is precise and clearly formalizable. The key concepts — finite subset of ℝ², 2-coloring, line containing k points, monochromaticity — all have unambiguous mathematical definitions. + +**Minor ambiguity in the English statement:** "there exists a line which contains at least k points from A, and all the points of A on the line have the same colour" could in principle be parsed two ways: + +- (a) A line L with |A ∩ L| ≥ k, where ALL points of A on L share one color. +- (b) A line L on which there exist ≥ k points of A sharing one color (but other points of A on L might differ). + +The formalization uses interpretation (a), which is the more natural and standard reading. Interpretation (a) is also strictly stronger than (b), so proving (a) subsumes (b). This is the correct choice. + +**Assessment:** Low ambiguity. The problem is well-suited to formalization. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +- **Quantifier structure:** `∀ k ≥ 3, ∃ A (finite), ∀ c (2-coloring), ∃ L (line)` — this correctly formalizes "for each k, there exists a finite set A such that every 2-coloring admits a monochromatic line with ≥ k points." + +- **Line characterization:** `Module.finrank ℝ L.direction = 1` correctly identifies L as a line (1-dimensional affine subspace) in ℝ². This is the standard Mathlib representation. + +- **Point count:** `k ≤ Set.ncard {p | p ∈ (A : Set _) ∧ p ∈ L}` correctly counts the number of points from A lying on L. Since A is finite, this set is finite, so `Set.ncard` returns the true cardinality. + +- **Monochromaticity:** `∃ color : Fin 2, ∀ p ∈ (A : Set _), p ∈ L → c p = color` correctly requires all points of A on L to share one color. + +- **Coloring domain:** The coloring `c : EuclideanSpace ℝ (Fin 2) → Fin 2` is defined on all of ℝ², not just on A. This is equivalent to coloring only A (any coloring of A extends to ℝ²), so this is not an issue. + +- **`answer(True)`:** The problem is marked as solved with answer True. The website confirms this: Graham-Selfridge proved k=3, and Zach Hunter proved the general case via the Hales-Jewett theorem. This is correct. + +- **Category tags:** `@[category research solved, AMS 5 51]` — marked as solved, which matches the website. AMS classification 51 (Geometry) is appropriate, though 05 (Combinatorics) would also be fitting given the Ramsey-theoretic nature. + +**No mathematical errors identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. diff --git a/ai-review/1091.md b/ai-review/1091.md new file mode 100644 index 0000000000..d211cf45a6 --- /dev/null +++ b/ai-review/1091.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 1091 + +## 1. Code Reuse + +The formalization defines a custom `HasOddCycleWithDiagonals` predicate using an injective map `f : Fin (2*m+3) → V` to represent cycles. An alternative approach exists in the codebase: Problem 58 (`ErdosProblems/58.lean`) defines `oddCycleLengths` using Mathlib's `SimpleGraph.Walk.IsCycle`, which is the more idiomatic Mathlib representation of graph cycles. + +However, the Fin-based encoding in Problem 1091 is arguably the right choice here. The problem requires *counting diagonals* — edges between non-consecutive cycle vertices — which is naturally expressed as a cardinality over `Fin n × Fin n` pairs. A `Walk.IsCycle`-based approach would require extracting the vertex list and reasoning about indices anyway, so the direct Fin encoding avoids unnecessary indirection. + +The formalization already reuses Mathlib's `SimpleGraph.CliqueFree`, `SimpleGraph.chromaticNumber`, and `SimpleGraph.induce`, which is appropriate. The `Coloring.lean` file in `FormalConjecturesForMathlib` provides chromatic number lemmas but none directly applicable here. + +**Verdict:** No significant reuse opportunities missed. The custom definition is justified by the diagonal-counting requirement. + +## 2. Citations + +**Website references:** [Er76c, p.4], [La79], [Vo82] + +**Formalization references:** +- `[La79] Larson` — matches website +- `[Vo82] Voss` — matches website +- `[Er76c] Erdős, P., Problems in combinatorics and graph theory (1976)` — matches website + +The formalization's docstring includes useful context not on the website: that the pentagonal wheel shows three diagonals cannot be guaranteed. The website also mentions this. The website provides additional detail about Larson's result (a stronger characterization: if G is K₄-free with no odd cycle having a diagonal, then G is bipartite, contains a cut vertex, or has a vertex of degree ≤ 2). This stronger result is not mentioned in the formalization, but it is not part of the Erdős problem itself, so omission is acceptable. + +**Verdict:** Citations are consistent with the website. No issues. + +## 3. Variants + +The website states two parts: +1. **Solved (Voss):** K₄-free graphs with χ = 4 must contain an odd cycle with ≥ 2 diagonals. +2. **Open variant:** Is there f(r) → ∞ such that every graph with χ = 4, where every subgraph on ≤ r vertices has χ ≤ 3, contains an odd cycle with ≥ f(r) diagonals? + +The formalization captures both: +- `erdos_1091` — the solved part (tagged `category research solved`) +- `erdos_1091.variants.unbounded_diagonals` — the open variant (tagged `category research open`) + +The original single-diagonal question (Larson) is mentioned in the docstring but not formalized separately, which is reasonable since it is strictly weaker than the two-diagonal result. + +**Verdict:** All variants are captured. + +## 4. Readability + +The code is generally readable. Some observations: + +- The `HasOddCycleWithDiagonals` definition is well-documented with a clear docstring explaining the encoding. +- The use of `2 * m + 3` to ensure odd length ≥ 3 is clean. +- The diagonal-counting filter expression (lines 46–50) is dense but unavoidable given the combinatorial nature. The four conditions (ordered pair, adjacency, non-consecutiveness in both directions) are correct and clearly separated. +- The modular arithmetic `(i.val + 1) % (2 * m + 3)` with the explicit `Nat.mod_lt` proof is a standard Lean pattern for cyclic indexing. +- The variant's formalization is clear: `answer(sorry) ↔ ...` wrapping is the project's standard idiom for true/false open problems. + +**Verdict:** Good readability. No improvements needed. + +## 5. Formalizability + +The problem is precisely stated and clearly formalizable: +- "K₄-free" maps directly to `CliqueFree 4`. +- "Chromatic number 4" maps directly to `chromaticNumber = 4`. +- "Odd cycle with at least two diagonals" requires defining what a cycle and diagonal are, which the formalization does explicitly. + +The open variant introduces the notion "every subgraph on ≤ r vertices has χ ≤ 3." The website says "every subgraph on ≤ r vertices," which in standard graph theory means the induced subgraph on any vertex subset of size ≤ r. The formalization correctly uses `G.induce (↑S : Set (Fin n))` for `S : Finset (Fin n)` with `S.card ≤ r`, matching this interpretation. + +The open variant also drops the K₄-free condition, which matches the website's statement. The condition that every induced subgraph on ≤ r vertices has χ ≤ 3 is a "local" chromaticity constraint that replaces the global K₄-free condition (indeed, K₄-free implies every 4-vertex induced subgraph has χ ≤ 3, but the variant is more general). + +**Verdict:** Low ambiguity. The problem is clearly formalizable and the formalization makes reasonable interpretive choices. + +## 6. Correctness + +### Main theorem (`erdos_1091`) + +**Cycle representation:** The encoding `f : Fin (2*m+3) → V` with `Function.Injective f` correctly represents a simple cycle of odd length 2m+3 ≥ 3 (m = 0 gives a triangle). The adjacency condition `G.Adj (f i) (f ⟨(i.val + 1) % (2*m+3), ...⟩)` for all i correctly states that consecutive vertices (including the wrap-around from the last vertex back to the first) are adjacent. + +**Diagonal counting:** A diagonal is an edge between two cycle vertices that are not consecutive. The filter conditions are: +- `p.1.val < p.2.val` — counts each unordered pair once +- `G.Adj (f p.1) (f p.2)` — the edge exists in G +- `p.2.val ≠ (p.1.val + 1) % (2*m+3)` — p.2 is not the cyclic successor of p.1 +- `p.1.val ≠ (p.2.val + 1) % (2*m+3)` — p.1 is not the cyclic successor of p.2 + +This correctly excludes the cycle edges and counts only diagonals. The use of `p.1.val < p.2.val` rather than `p.1 < p.2` or `p.1 ≠ p.2` is correct for avoiding double-counting (and self-pairs are excluded since `<` is strict). + +**Hypothesis adequacy:** The theorem requires `G : SimpleGraph (Fin n)` (finite graph), `CliqueFree 4` (K₄-free), and `chromaticNumber = (4 : ℕ∞)` (χ = 4). This matches Voss's theorem. + +### Open variant (`erdos_1091.variants.unbounded_diagonals`) + +The formalization asks whether there exists `f : ℕ → ℕ` with `Tendsto f atTop atTop` (f(r) → ∞) such that for all r, n, and graphs G on Fin n: if χ(G) = 4 and every induced subgraph on ≤ r vertices has χ ≤ 3, then G has an odd cycle with ≥ f(r) diagonals. + +This matches the website's open variant. The `answer(sorry)` wrapper correctly encodes this as a yes/no question. + +**One subtle point:** The variant universally quantifies over `n` and `G : SimpleGraph (Fin n)`, restricting to finite graphs. The original problem likely intends arbitrary (possibly infinite) graphs. However, for chromatic number 4 with the local constraint, restricting to finite graphs is essentially without loss of generality: any counterexample to the finite version would also be a counterexample to the infinite version, and conversely, a compactness argument shows the infinite case reduces to the finite case for this type of statement. So this restriction is harmless. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. diff --git a/ai-review/1096.md b/ai-review/1096.md new file mode 100644 index 0000000000..31db95a6d2 --- /dev/null +++ b/ai-review/1096.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 1096 + +## 1. Code Reuse + +The formalization defines a custom `powerSumSet` as `{x : ℝ | ∃ S : Finset ℕ, x = S.sum (fun i => q ^ i)}`. This is a straightforward and problem-specific definition. No existing definition in `FormalConjecturesForMathlib` captures this concept: + +- **`Combinatorics/Additive/Convolution.lean`**: Defines additive convolution, which is tangentially related (sums over sets) but not applicable here. +- **`Analysis/HasGaps.lean`**: Defines `HasFabryGaps` and `HasFejerGaps` for sequences of natural numbers — these concern lacunarity conditions on index sequences, not gaps in value sets of the type needed here. +- **`Data/Set/Density.lean`**: Deals with set density, not gaps between consecutive elements. + +The use of `Finset ℕ` and `Finset.sum` from Mathlib is idiomatic. No Pisot–Vijayaraghavan number infrastructure exists in the codebase, but the formalization does not attempt to formalize the Pisot threshold — only the gap property — so none is needed. + +**Verdict:** No significant reuse opportunities missed. The definition is simple enough that a shared abstraction would be premature. + +## 2. Citations + +**Website references:** [EJK90], [GWNT91], [Bu96], [EJS96] + +**Formalization references:** +- `[EJK90] Erdős, P., Joó, I., and Komornik, V., Characterization of the unique expansions 1 = ∑ q^{-n_i} and related problems, Bull. Soc. Math. France (1990)` — matches website. +- `[GWNT91] Galambos, J., Representations of real numbers by infinite series, Lecture Notes in Mathematics, Springer (1991)` — **does not match the website**. The website attributes [GWNT91] to "Great Western Number Theory" (a 1991 problem session), not to Galambos's monograph. These are entirely different sources. The formalization's [GWNT91] citation is incorrect. + +**Missing references:** +- **[Bu96]** Bugeaud's 1996 result characterizing Pisot–Vijayaraghavan numbers via the generalized gap condition (using coefficients in {0, …, m}) is mentioned on the website but absent from the formalization. +- **[EJS96]** Erdős, Joó, and Schnitzer's 1996 result (for 1 < q < (1+√5)/2, q is Pisot–Vijayaraghavan iff lim inf of gaps with m=2 is positive) is also missing. + +These omissions are acceptable since the formalization only captures the core problem and not the surrounding partial results, but the [GWNT91] citation should be corrected. + +**Verdict:** The [GWNT91] citation is wrong — it references the wrong source. The other citation is correct. + +## 3. Variants + +The website describes a single primary question. However, it also mentions several related known results that implicitly define variant questions: + +1. **The generalized gap problem (Bugeaud [Bu96]):** Replace finite subsets of {0,1}^ℕ (i.e., coefficients 0 or 1) with coefficients in {0, …, m}. The gap behavior characterizes Pisot–Vijayaraghavan numbers. This is not formalized as a variant. + +2. **The Pisot threshold conjecture:** Erdős and Joó speculate the threshold ε is such that q₀ ≈ 1.3247 (smallest Pisot–Vijayaraghavan number). This is mentioned in the docstring but not formalized as a separate conjecture. + +3. **The lim inf characterization (Erdős–Joó–Schnitzer [EJS96]):** For 1 < q < φ (golden ratio), characterizes when lim inf of gaps is positive. Not formalized. + +The formalization captures the core open problem. The Bugeaud and EJS96 variants are substantial enough to warrant separate formalizations if desired, but their omission from Problem 1096 is reasonable since they are cited results rather than open problems. + +**Verdict:** The core problem is captured. The Pisot threshold conjecture (mentioned in the docstring) could potentially be formalized as a variant, but its omission is defensible since the threshold value is speculative. + +## 4. Readability + +The code is clean and well-structured. Observations: + +- **`powerSumSet` definition:** Clear and well-documented. The docstring explains the set precisely. +- **Main theorem docstring:** Excellent — provides the mathematical context, the formal restatement, and the speculative threshold. The equivalence explanation ("for every δ > 0, every sufficiently large element of the set has a successor in the set within distance δ") is helpful for understanding the formalization strategy. +- **Namespace:** `Erdos1096` is used appropriately to scope the definition. +- **`open Finset`:** Appropriate given the use of `Finset.sum`. + +One minor observation: the docstring says "ordered by size as 0 = x₁ < x₂ < ⋯" but the formalization avoids explicitly enumerating the set, instead using the "for every element, there exists a nearby larger element" approach. The docstring explains this reformulation clearly, which is good. + +**Verdict:** Good readability. No improvements needed. + +## 5. Formalizability + +The problem is reasonably precise but involves a subtlety in the notion of "gaps between consecutive elements tending to zero." + +**The key interpretive question:** The power sum set is a countably infinite subset of ℝ. Its elements can be well-ordered by the standard ordering on ℝ, but the set is not order-isomorphic to ℕ in general — it is a dense or discrete subset depending on q. The phrase "x_{k+1} − x_k → 0" implicitly assumes an enumeration as an increasing sequence indexed by ℕ. For this to make sense, the set must be: +1. Countably infinite (true — finitely many finite subsets of ℕ generate it, and the set is infinite for q > 1). +2. Well-ordered as a subset of ℝ with order type ω (i.e., every bounded interval contains finitely many elements). + +**Wait — is condition (2) true?** For q close to 1, the sums q^i are all close to 1, and different finite subsets may produce values arbitrarily close together. In fact, the set could be dense in [0, ∞) for some values of q. If the set is dense, there are no "gaps between consecutive elements" in the usual sense, and the statement is trivially satisfied (or vacuous). + +Actually, for any fixed q > 1, the power sum set is discrete: the elements are sums of distinct powers q^i, and for a fixed upper bound B, only finitely many subsets S produce sums ≤ B (since q^i → ∞). So the set is indeed a discrete subset of [0, ∞) with order type ω, and the enumeration x₁ < x₂ < ⋯ is well-defined. + +The formalization avoids the enumeration entirely and uses the equivalent "ε-δ" formulation: for every δ > 0, every sufficiently large x in the set has a successor within distance δ. This is a clean and correct reformulation — it is equivalent to "consecutive gaps tend to zero" for a discrete set of order type ω, and it avoids the need to construct the explicit enumeration. + +**Assessment:** Low ambiguity. The problem is precisely formalizable, and the formalization makes the right interpretive choice by using the ε-δ formulation. + +## 6. Correctness + +### `powerSumSet` definition + +The definition `{x : ℝ | ∃ S : Finset ℕ, x = S.sum (fun i => q ^ i)}` correctly captures the set of all numbers of the form ∑_{i ∈ S} q^i for finite S ⊆ ℕ. Note: + +- The empty set gives x = 0 (empty sum), which is correct (the problem says "0 = x₁"). +- Singleton {i} gives x = q^i. +- Duplicate elements are not an issue since `Finset` enforces distinctness. +- The use of ℕ (starting from 0) means q^0 = 1 is included. This matches the standard convention where S ⊆ ℕ = {0, 1, 2, …}. + +### Main theorem (`erdos_1096`) + +The statement: +``` +∃ ε : ℝ, 0 < ε ∧ + ∀ q : ℝ, 1 < q → q < 1 + ε → + ∀ δ : ℝ, 0 < δ → + ∃ M : ℝ, ∀ x ∈ powerSumSet q, M ≤ x → + ∃ y ∈ powerSumSet q, x < y ∧ y - x < δ +``` + +Analysis of the quantifier structure: +- `∃ ε > 0`: there exists a threshold. +- `∀ q ∈ (1, 1+ε)`: for all q in this interval. +- `∀ δ > 0`: for any desired gap bound. +- `∃ M`: there is a threshold beyond which... +- `∀ x ∈ powerSumSet q, M ≤ x`: every element beyond M... +- `∃ y ∈ powerSumSet q, x < y ∧ y - x < δ`: has a successor within distance δ. + +This correctly formalizes "consecutive gaps tend to zero." **However, there is a subtle issue:** the formalization only requires that every sufficiently large x has *some* y > x within distance δ. It does not require y to be the *immediate successor* of x in the set. For the formalization to correctly capture "gaps between consecutive elements tend to zero," we need y to be the next element after x. + +**Is this actually a problem?** If y is the immediate successor of x, then y − x < δ and we're done. Conversely, if there exists *any* y > x with y − x < δ, then the immediate successor y' of x satisfies x < y' ≤ y, so y' − x ≤ y − x < δ. Therefore the two formulations are equivalent: "some element within δ" ⟺ "the next element within δ." The formalization is correct. + +**The `answer(sorry)` wrapper:** The problem is tagged as `category research open`, and the answer is left as `sorry`, which is appropriate for an open problem. + +**One concern about completeness:** The formalization only captures the "yes" direction of the question — it asks whether the gap property holds for some ε-neighborhood. If the answer turns out to be "no" (the gap property fails for all q > 1), then the `answer(sorry)` would be `False` and the biconditional would require proving the negation. The formalization handles this correctly through the `answer(sorry) ↔ ...` pattern: if the answer is True, one proves the RHS; if False, one proves the negation of the RHS. + +**Verdict:** The formalization is mathematically correct and complete. The ε-δ reformulation faithfully captures the "consecutive gaps tend to zero" property. No flaws identified. diff --git a/ai-review/1098.md b/ai-review/1098.md new file mode 100644 index 0000000000..0fc70ee332 --- /dev/null +++ b/ai-review/1098.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 1098 + +## 1. Code Reuse + +The `nonCommutingGraph` is defined locally in `Erdos1098` namespace. No existing definition of a non-commuting graph exists elsewhere in the codebase. Problem 117 (`ErdosProblems/117.lean`) deals with closely related concepts (pairwise non-commuting elements and abelian subgroup covers), but does not define a graph — it works directly with commutativity predicates on `Finset G`. There is no opportunity to reuse 117's definitions here, nor vice versa, since the two problems formalize different aspects. + +`SimpleGraph.IsClique` is imported from Mathlib via `ProblemImports`, which is appropriate. The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` file defines `indepNum` (independence number) but nothing directly applicable here. + +**Verdict:** No reuse opportunities identified. The local `nonCommutingGraph` definition is appropriate. + +## 2. Citations + +The formalization references: +> [Ne76] Neumann, B.H., _A problem of Paul Erdős on groups_, J. Austral. Math. Soc. Ser. A 21 (1976), 467-472. + +The website (erdosproblems.com/1098) lists [Ne76] but does not provide the full bibliographic details. The formalization actually contains *more* detail than the website, which is good. The website also notes that the problem was originally posed by Erdős at the 15th Summer Research Institute of the Australian Mathematical Society (1975); this contextual detail is not in the formalization docstring but is not essential. + +**Verdict:** Citation is correct and complete. + +## 3. Variants + +The docstring describes Neumann's full result as an **if-and-only-if**: + +> "Neumann proved that Γ contains no infinite complete subgraph **if and only if** the centre of G has finite index, and if the centre has index n then Γ contains no complete subgraph on more than n vertices." + +However, the formal theorem only captures **one direction** of this equivalence (no infinite clique → finite bound on clique sizes). Two additional aspects mentioned in the docstring are not formalized: + +1. **The converse direction:** If there exists a finite bound on clique sizes, then there is no infinite clique. (This direction is trivially true and arguably not worth formalizing separately.) +2. **The centre characterization:** The iff with the centre of G having finite index — i.e., `(Subgroup.center G).index ≠ ⊤` or equivalently `(Subgroup.center G).FiniteIndex` — is not formalized. +3. **The specific bound:** When the centre has index n, cliques have at most n vertices. This quantitative refinement is not captured. + +The website does not list additional variants beyond what is already discussed. + +**Verdict:** The core implication is captured, but the stronger characterization via the centre's index and the quantitative bound from the docstring are missing. Consider adding a second theorem for the iff characterization with the centre. + +## 4. Readability + +The code is clean and readable: +- The `nonCommutingGraph` definition is self-documenting with a clear docstring. +- The `symm` and `loopless` proofs are concise. +- The theorem statement is easy to parse. +- The use of `Set G` for the infinite case and `Finset G` for the bounded case is natural. + +One minor suggestion: the docstring for `erdos_1098` could be slightly more precise about which direction is being formalized, since it describes the full iff result but only the forward direction is stated. + +**Verdict:** Good readability. Minor docstring clarification suggested. + +## 5. Formalizability + +The problem is entirely precise and unambiguous: +- "Non-commuting graph" is a standard, well-defined construction in group theory. +- "Infinite complete subgraph" and "finite bound on clique sizes" are standard graph-theoretic concepts. +- The formalization uses `Set.Infinite` for infinite cliques and `Finset.card` for bounded cliques, both appropriate. +- The problem applies to arbitrary groups (finite or infinite), which the `[Group G]` typeclass handles correctly. + +**Verdict:** Fully formalizable with no ambiguity. Assessment: **unambiguous**. + +## 6. Correctness + +**Definition correctness:** +- `nonCommutingGraph`: The adjacency relation `g * h ≠ h * g` is correct. Symmetry follows from `Ne.symm` (if `gh ≠ hg` then `hg ≠ gh`). Irreflexivity holds because `g * g = g * g` for all g. ✓ + +**Theorem statement correctness:** +- The hypothesis `¬ ∃ S : Set G, S.Infinite ∧ (nonCommutingGraph G).IsClique S` correctly expresses "no infinite clique." ✓ +- The conclusion `∃ n : ℕ, ∀ S : Finset G, (nonCommutingGraph G).IsClique (S : Set G) → S.card ≤ n` correctly expresses "there is a finite bound on clique sizes." ✓ +- The overall implication is mathematically correct and is the content of Neumann's theorem. ✓ + +**Potential issues:** +- The formalization uses `Group G` rather than `Mul G` or `Monoid G`. This is correct — the problem is stated for groups, and Neumann's proof uses group-theoretic structure (centralisers, cosets). +- The universe polymorphism is handled correctly via `(G : Type*)`. +- One could argue that the conclusion should use `∀ S : Set G, S.Finite ∧ ...` instead of `∀ S : Finset G, ...`, but the `Finset` formulation is equivalent and arguably cleaner since it avoids carrying a `Finite` hypothesis. + +**Verdict:** The formalization is mathematically correct for what it states. The only incompleteness is that the docstring promises more than the theorem delivers (the iff with finite-index centre), but this is a scope issue, not a correctness issue. diff --git a/ai-review/1099.md b/ai-review/1099.md new file mode 100644 index 0000000000..baa2b648b0 --- /dev/null +++ b/ai-review/1099.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 1099 + +## 1. Code Reuse + +**Issue found.** The definition `sortedDivisors` is duplicated verbatim across three files: + +- `FormalConjectures/ErdosProblems/673.lean:50` +- `FormalConjectures/ErdosProblems/1099.lean:47` +- `FormalConjectures/ErdosProblems/1100.lean:43` + +All three define: +```lean +def sortedDivisors (n : ℕ) : List ℕ := + (Nat.divisors n).sort (· ≤ ·) +``` + +This should be extracted into a shared utility (e.g., in `FormalConjecturesForMathlib/Data/Nat/` or a divisor utilities file) and imported by all three problems. The `ds.zip ds.tail` pattern for iterating over consecutive divisor pairs is also repeated across these files. + +No existing utility in `FormalConjecturesForMathlib` currently provides this functionality. + +## 2. Citations + +The docstring citations are accurate and consistent with [erdosproblems.com/1099](https://www.erdosproblems.com/1099): + +- **[Er81h]** — Listed as Erdős (1981, p. 171) on the website. The docstring gives a reasonable expansion: "Erdős, P., *Some problems and results in number theory*." This is acceptable. +- **[Vo84]** — Listed as Vose (1984) on the website. The docstring gives: "Vose, M. D., *Integers with consecutive divisors in small ratio*, J. Number Theory (1984)." This is accurate. + +The cross-reference to problem #673 is correctly noted in the docstring. + +**Minor note:** The website additionally mentions the related question about $\sum_i d_{i+1}/d_i - \tau(n) - \log n$ and its connection to the main result. The docstring does not include this remark, but it is supplementary context rather than a core variant, so its omission is acceptable. + +## 3. Variants + +**Missing variants.** The formalization captures only the main result (proved by Vose). Two natural variants mentioned in both the docstring and the website are not formalized: + +1. **$n!$ variant:** Is $h_\alpha(n!)$ bounded (for each $\alpha > 1$)? This remains open and could be stated as: + ```lean + theorem erdos_1099.variants.factorial : + ∀ α : ℝ, α > 1 → ∃ C : ℝ, ∀ n : ℕ, hAlpha α n.factorial ≤ C + ``` + +2. **lcm variant:** Is $h_\alpha(\text{lcm}\{1, \ldots, n\})$ bounded? This also remains open and could be stated similarly. + +These are explicitly called out in the docstring as open problems, so formalizing them would add value. + +## 4. Readability + +The code is clean and readable. The helper definitions (`sortedDivisors`, `hAlpha`) are well-documented with LaTeX in docstrings. The `let` binding in `hAlpha` aids clarity. + +**Minor suggestions:** +- The namespace `Erdos1099` is clear and follows codebase convention. +- The `zip`/`tail` idiom for consecutive pairs is idiomatic and matches similar usage in problems 673 and 1100. + +No readability issues. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The original problem asks whether $\liminf_{n \to \infty} h_\alpha(n) \ll_\alpha 1$, using Vinogradov notation. The notation "$\ll_\alpha 1$" means "bounded by a constant depending only on $\alpha$," which is equivalent to asking whether the $\liminf$ is finite. This is a standard and unambiguous interpretation. + +The formalization correctly unpacks "liminf is finite" into the elementary statement: there exists $C$ such that for all $N$, there exists $n \geq N$ with $h_\alpha(n) \leq C$. This is mathematically equivalent and avoids importing Mathlib's `Filter.liminf` machinery, which is a reasonable choice (though other problems in the codebase, e.g., 158, do use `liminf` directly). + +## 6. Correctness + +**Assessment: Correct and complete for the main statement.** + +Detailed verification: + +- **`sortedDivisors`**: Correctly produces divisors of $n$ sorted in increasing order. For $n = 0$, `Nat.divisors 0 = ∅` in Mathlib, yielding an empty list (and $h_\alpha(0) = 0$). For $n = 1$, divisors are $\{1\}$, giving a singleton list and $h_\alpha(1) = 0$. These edge cases don't affect the liminf statement since it concerns $n \to \infty$. + +- **`hAlpha`**: The expression `((p.2 : ℝ) / (p.1 : ℝ) - 1) ^ α` correctly computes $(d_{i+1}/d_i - 1)^\alpha$ for each consecutive pair. The `zip`/`tail` pattern correctly pairs $(d_1, d_2), (d_2, d_3), \ldots, (d_{\tau(n)-1}, d_{\tau(n)})$, which are all the consecutive pairs. The sum is taken over all such pairs, matching the definition. + +- **Division by zero**: The first divisor $d_1 = 1$ for all $n \geq 1$, so division by $d_i = 0$ cannot occur for the first pair. For subsequent pairs, all divisors are positive, so this is not an issue. (In Lean, division by zero on `ℝ` returns 0, which would be harmless regardless.) + +- **Main theorem**: The statement `∀ α : ℝ, α > 1 → ∃ C : ℝ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ hAlpha α n ≤ C` correctly formalizes "for every $\alpha > 1$, $\liminf_{n \to \infty} h_\alpha(n)$ is finite." The `answer(True)` wrapper correctly reflects that Vose proved the affirmative answer. + +- **Tags**: `category research solved` and `AMS 11` (number theory) are appropriate. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `sortedDivisors` duplicated in 3 files | +| Citations | Good | Accurate and complete | +| Variants | Needs improvement | $n!$ and lcm variants not formalized | +| Readability | Good | Clean, well-documented | +| Formalizability | Good | Unambiguous statement | +| Correctness | Good | Mathematically sound | diff --git a/ai-review/110.md b/ai-review/110.md new file mode 100644 index 0000000000..0f0f2ffb4e --- /dev/null +++ b/ai-review/110.md @@ -0,0 +1,117 @@ +# AI Review: Erdos Problem 110 + +## 1. Code Reuse + +**`HasChromaticNumberAleph1` is duplicated verbatim across three files and should be factored out.** + +- **Identical copies** exist in `110.lean`, `111.lean`, and `62.lean` (all within their own namespaces: `Erdos110`, `Erdos111`, `Erdos62`). These three definitions are character-for-character identical: + ```lean + def HasChromaticNumberAleph1 {V : Type*} (G : SimpleGraph V) : Prop := + (∀ (α : Type*) [Countable α], IsEmpty (G.Coloring α)) ∧ + (∃ α : Type*, #α = aleph 1 ∧ Nonempty (G.Coloring α)) + ``` + This should be extracted to a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` or a new file under `FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean`). + +- **`HasUncountableChromaticNumber`** in `737.lean` captures only the first conjunct (chromatic number > aleph_0). `HasChromaticNumberAleph1` refines this to exactly aleph_1. These are related but distinct; both could coexist in a shared file. + +- **`chromaticCardinal`** is defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136` and is used in `918.lean` for similar infinite-chromatic-number problems. Problem 110 could express the hypothesis as `G.chromaticCardinal = aleph 1` instead of the custom `HasChromaticNumberAleph1`, matching the idiom in `918.lean`. However, since the subgraph's chromatic number is finite (and uses `chromaticNumber : ℕ∞`), the current approach of using `HasChromaticNumberAleph1` for the hypothesis and `chromaticNumber` for the finite subgraph is reasonable. + +- **`G.Subgraph` / `H.coe.chromaticNumber` / `H.verts.ncard` / `H.verts.Finite` pattern**: Used identically in `923.lean` and `108.lean`. This is a recurring pattern across the codebase and does not need factoring out. + +**Recommendation:** Factor `HasChromaticNumberAleph1` into a shared file. Consider whether adopting `chromaticCardinal` for the hypothesis would improve consistency with `918.lean`. + +## 2. Citations + +The docstring includes three references: [EHS82], [KoSh05], and [La20]. The website [erdosproblems.com/110](https://www.erdosproblems.com/110) lists several additional references: + +**Missing from docstring:** +- **[dBEr51]** de Bruijn, N.G. and Erdos, P. — the de Bruijn-Erdos theorem (a graph with infinite chromatic number contains finite subgraphs of arbitrarily large chromatic number), which provides the foundational context for this problem. +- **[Er87]** Erdos, P. — subsequent discussion of the problem. +- **[Er90]** Erdos, P. — further discussion. +- **[Er95d]** Erdos, P. — where Erdos suggested the result is true, and noted any such F must grow faster than k-fold iterated exponentials. +- **[Er97f]** Erdos, P. — additional reference. + +**Present in docstring but could be expanded:** +- [EHS82] — listed as "Erdos, P., Hajnal, A., and Szemeredi, E. — original conjecture." The full citation would be: Erdos, P., Hajnal, A., and Szemeredi, E., *On almost bipartite large chromatic graphs*, Annals of Discrete Mathematics, 12 (1982), 117-123. (This is the same paper cited in Problem 111.) +- [KoSh05] — listed correctly in spirit. Full citation: Komjath, P. and Shelah, S. +- [La20] — listed correctly. Full citation: Lambie-Hanson, C. + +**Status discrepancy:** The formalization's docstring says "Disproved: Lambie-Hanson constructed a ZFC counterexample." The website labels the problem as "NOT PROVABLE" rather than "DISPROVED," noting that the result is open in general but there exist models of set theory where it is false. However, the Lambie-Hanson [La20] result is described as a "ZFC counterexample," meaning it works in every model of ZFC. The docstring's characterization as "Disproved" appears more accurate than the website's label, assuming [La20] indeed provides an unconditional ZFC counterexample. + +**Recommendation:** Add [dBEr51] and [Er95d] as particularly relevant references (foundational context and growth rate remark, respectively). Expand [EHS82] to include the full paper title. + +## 3. Variants + +The docstring mentions one variant informally but does not formalize it: + +**Documented but not formalized:** +1. **Analogue for chromatic number aleph_0**: The docstring states "The analogous statement fails for graphs of chromatic number aleph_0." This is a natural companion theorem that could be formalized. It would assert that there is NO function F(n) bounding the number of vertices needed for subgraphs of chromatic number n in graphs of chromatic number aleph_0. + +**Not mentioned:** +2. **Growth rate variant**: Erdos [Er95d] suggested that any such F (if it existed) must grow faster than k-fold iterated exponentials for any fixed k. While the conjecture is disproved, the growth rate question for specific classes of graphs with chromatic number aleph_1 could be of interest. +3. **Induced subgraph variant**: The problem asks about subgraphs; one could ask the same question for induced subgraphs. The formalization uses `G.Subgraph` (arbitrary subgraphs), which is correct for the stated problem. + +**Assessment:** The core problem and its negation are correctly captured. The aleph_0 analogue would be the most natural variant to formalize and would provide useful mathematical context. + +## 4. Readability + +The code is well-structured and readable: + +- **Good:** The module docstring clearly explains the problem, its history (original conjecture, consistency result, ZFC counterexample), and attributes results to the correct authors. +- **Good:** The `HasChromaticNumberAleph1` definition has a clear docstring explaining both conditions. +- **Good:** The `answer(False) ↔ ...` pattern correctly signals a disproved conjecture. +- **Good:** The namespace `Erdos110` avoids collisions with other problems' identical definitions. +- **Minor:** The theorem statement is somewhat dense with nested quantifiers and existentials. Breaking the inner body into a helper definition (e.g., `HasSmallChromaticSubgraph G F n` or similar) could improve readability, though the current inline style is consistent with other problems in the codebase. + +## 5. Formalizability + +**Assessment: Highly formalizable. Low ambiguity.** + +The problem statement is precise: +- "Graph with chromatic number aleph_1" — unambiguous set-theoretic concept. +- "Subgraph with chromatic number n" — standard graph-theoretic notion. +- "On at most F(n) vertices" — unambiguous cardinality bound. +- "For all large n" — standard "for all sufficiently large" quantifier. + +The only minor interpretive choice is **subgraph vs. induced subgraph**. The original problem says "subgraph," and the formalization uses `G.Subgraph` (which allows arbitrary subgraphs, not just induced ones). This is the standard mathematical interpretation and is correct. + +There is no set-theoretic ambiguity in the statement itself: the conjecture is purely about the existence of a function F : N -> N, which is absolute between models of ZFC. The independence results concern the truth value, not the statement's meaning. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`answer(False)`**: The conjecture is disproved by Lambie-Hanson [La20], so asserting the RHS is `False` is correct. **Correct.** + +- **`HasChromaticNumberAleph1 G`**: Asserts (1) G cannot be properly colored by any countable type (including finite types), and (2) G can be properly colored by a type of cardinality aleph_1. Under ZFC, this exactly characterizes chi(G) = aleph_1. **Correct.** + +- **`∃ N : ℕ, ∀ n : ℕ, N ≤ n →`**: Correctly encodes "for all sufficiently large n." **Correct.** + +- **`∃ H : G.Subgraph`**: Quantifies over subgraphs of G. Mathlib's `SimpleGraph.Subgraph` is a structure containing a vertex set and edge set that are subsets of G's. **Correct.** + +- **`H.verts.Finite`**: Requires the subgraph's vertex set to be finite. This is necessary because we want the subgraph to have "at most F(n) vertices," which is a natural number bound. **Correct.** + +- **`H.verts.ncard ≤ F n`**: Uses `Set.ncard` which returns 0 for infinite sets, but since `H.verts.Finite` is assumed, `ncard` gives the true cardinality. **Correct.** + +- **`H.coe.chromaticNumber = ↑n`**: `H.coe` coerces the subgraph to a `SimpleGraph H.verts`. Since the vertex set is finite, the graph is finitely colorable, so `chromaticNumber` returns a finite value in `ℕ∞`. The coercion `↑n : ℕ∞` is well-defined. **Correct.** + +- **Edge case analysis**: For small n (e.g., n = 0 or n = 1), the chromatic number requirements are trivially satisfiable (empty graph has χ = 0, edgeless non-empty graph has χ = 1). The `∃ N` quantifier allows the bound to kick in only for large n, so these trivial cases are harmless. **No issues.** + +- **Universe polymorphism**: The `∀ (V : Type*)` quantifier is universe-polymorphic. Since we're asking about the existence of a function F : N -> N (which is universe-independent), and the graph-theoretic properties are absolute, this is mathematically correct. **Correct.** + +- **Category tags**: `category research solved` — correct (the problem is resolved). `AMS 3 5` — AMS subject classifications 03 (mathematical logic / set theory) and 05 (combinatorics); both are appropriate for this problem which sits at the intersection of infinite combinatorics and set theory. **Correct.** + +**Verdict:** The formalization is mathematically faithful to the original problem. No errors or incompleteness identified. The `answer(False)` correctly reflects the disproved status, and all quantifiers and conditions accurately encode the conjecture. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `HasChromaticNumberAleph1` is duplicated in 3 files (110, 111, 62); should be factored out to a shared location | +| Citations | Needs improvement | Missing [dBEr51] (de Bruijn-Erdos foundational result) and [Er95d] (growth rate remark); [EHS82] should include full paper title | +| Variants | Acceptable | The aleph_0 analogue (known to fail) would be a natural companion formalization | +| Readability | Good | Clear docstring, well-structured code, standard patterns | +| Formalizability | Excellent | Unambiguous problem statement; subgraph vs. induced subgraph is the only interpretive choice, correctly resolved | +| Correctness | Correct | Mathematically faithful; `answer(False)` correctly reflects disproved status; all conditions properly encoded; no edge-case issues | diff --git a/ai-review/1100.md b/ai-review/1100.md new file mode 100644 index 0000000000..6bd6858814 --- /dev/null +++ b/ai-review/1100.md @@ -0,0 +1,70 @@ +# Review: Erdos Problem 1100 + +## 1. Code Reuse + +**`sortedDivisors` is defined identically in three places:** +- `ErdosProblems/673.lean:50` +- `ErdosProblems/1099.lean:47` +- `ErdosProblems/1100.lean:43` + +All three define `sortedDivisors (n : ℕ) : List ℕ := (Nat.divisors n).sort (· ≤ ·)`. This should be factored into a shared utility (e.g., in `FormalConjecturesForMathlib` or a shared `Util` module for divisor operations). The `List.zip`/`List.tail` consecutive-pairs pattern is also repeated across all three files. + +**Natural density machinery exists but is unused.** Part 1 manually inlines an epsilon-delta density-zero formulation. Two existing alternatives: +- `Erdos673.HasNaturalDensityZero` (`673.lean:61`) — a `Tendsto`-based definition of density zero. +- `Set.HasDensity` (`FormalConjecturesForMathlib/Data/Set/Density.lean:86`) — a general density framework with `Set.HasDensity S 0` expressing density zero. + +Either could replace the inline formulation in `erdos_1100`, improving consistency across the codebase. + +## 2. Citations + +The website ([erdosproblems.com/1100](https://www.erdosproblems.com/1100)) lists: +- **[ErHa78]** — Erdős, P. and Hall, R. R. (1978), who proved τ⊥(n) ≥ ω(n) with equality for infinitely many n, and established max_{n exp((log log x)^{2−ε}). +- **[Er81h, p.173]** — Erdős, P. (1981), through which the Erdős–Simonovits bounds on g(k) are attributed. + +The formalization's docstring references neither [ErHa78] nor [Er81h] by name. It mentions "Erdős and Simonovits" for the Part 3 bounds but does not cite the specific papers. The citations should be added to match the website's references, e.g.: + +``` +[ErHa78] Erdős, P. and Hall, R. R., _On the number of pairs of coprime consecutive divisors_ (1978). +[Er81h] Erdős, P., _Some problems and results in number theory_ (1981). +``` + +## 3. Variants + +The formalization captures three parts: +- Part 1: τ⊥(n)/ω(n) → ∞ for almost all n +- Part 2: τ⊥(n) < exp((log n)^{o(1)}) for all n +- Part 3: Bounds on g(k) (upper and lower, split into two theorems) + +**Missing variant:** The Erdős–Hall result that τ⊥(n) ≥ ω(n) (with equality for infinitely many n) is mentioned on the website but not formalized. This is a proved result and a natural companion statement. Additionally, the Erdős–Hall result that max_{n exp((log log x)^{2−ε}) for large x is not captured. These are related results rather than strict "variants" of the problem, so their omission is understandable but worth noting. + +## 4. Readability + +**Generally good.** The code is clean, well-structured, and the docstrings clearly explain each part. A few minor suggestions: + +- **`Nat.gcd p.1 p.2 == 1`** (line 50): Uses Boolean decidable equality (`==`). Consider using `Nat.Coprime p.1 p.2` (which is `Nat.gcd p.1 p.2 = 1`) for more idiomatic Mathlib style. This would require using `decide` or a decidability instance in the filter, but reads more naturally. +- **`(2 : ℝ) ^ ((1 : ℝ) / 2)`** (line 103): Could be replaced with `Real.sqrt 2` for readability, since `√2 = 2^{1/2}` and `Real.sqrt` is the standard Mathlib way to express square roots. +- The Part 1 density formulation is somewhat verbose compared to using an existing density definition. Even if the inline version is kept, a comment explaining the equivalence to "density zero" would help. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +- **Part 1** is precisely stated: "for almost all n" has a standard meaning (natural density 1), and τ⊥(n)/ω(n) → ∞ is unambiguous. The formalization correctly captures this as: for every M and ε > 0, the proportion of n ≤ N with τ⊥(n) ≤ M·ω(n) is eventually < ε. **Fully formalizable.** +- **Part 2** is precisely stated: "exp((log n)^{o(1)})" is rigorously equivalent to "for every ε > 0, eventually τ⊥(n) < exp((log n)^ε)". **Fully formalizable.** +- **Part 3** asks to "determine the growth of g(k)", which is inherently open-ended. The formalization reasonably captures the known bounds (Erdős–Simonovits). The phrase "determine the growth" is somewhat ambiguous — it could mean finding exact asymptotics, not just bounding. However, formalizing the known bounds is the right approach for the current state of knowledge. **Formalizable as bounds; the open-ended "determine" aspect is inherently not fully formalizable.** + +## 6. Correctness + +**Part 1 — Correct with a minor observation.** The quantifier `∀ M : ℕ` (rather than `∀ M : ℝ`) is sufficient: if the density of {n : τ⊥(n) ≤ M·ω(n)} is 0 for every natural M, then it is 0 for every real M (since any real bound is dominated by some natural number). The formalization is mathematically equivalent to the intended statement. + +**Part 2 — Correct.** The formalization `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, (tauPerp n : ℝ) < exp((log n)^ε)` correctly captures τ⊥(n) < exp((log n)^{o(1)}). Note: for n = 0 or n = 1, `Real.log n` is ≤ 0, and the bound becomes trivial or needs care, but since we only need it for sufficiently large n (n ≥ N₀), this is fine. + +**Part 3 upper bound — Correct.** The existential on c > 0 and universal over sufficiently large k and all squarefree n with ω(n) = k faithfully captures the Erdős–Simonovits upper bound. + +**Part 3 lower bound — Correct.** The statement that for every ε > 0 and sufficiently large k, there exists a squarefree n with ω(n) = k and τ⊥(n) > (√2 − ε)^k correctly captures the "(√2 + o(1))^k" lower bound. The o(1) term can be negative, so (√2 − ε) for arbitrary ε > 0 is the right formulation. + +**`tauPerp` definition — Correct.** Counting pairs (d_i, d_{i+1}) with gcd = 1 among sorted divisors via `zip`/`tail`/`filter` is a faithful implementation of the mathematical definition. The edge cases (n = 0: no divisors, empty list; n = 1: single divisor [1], no consecutive pairs, count = 0) behave correctly. + +**Category tags — Correct.** Parts 1 and 2 are tagged `research open`, consistent with the website's "OPEN" status. Part 3 bounds are tagged `research solved`, consistent with them being proved results (Erdős–Simonovits). + +**Overall assessment: The formalization is mathematically correct and complete for the problem as stated.** No flaws identified. The only gaps are the uncaptured Erdős–Hall auxiliary results (τ⊥(n) ≥ ω(n)) and missing explicit citations. diff --git a/ai-review/1103.md b/ai-review/1103.md new file mode 100644 index 0000000000..7e13b47291 --- /dev/null +++ b/ai-review/1103.md @@ -0,0 +1,94 @@ +# AI Review: Erdos Problem 1103 + +## 1. Code Reuse + +The formalization is lean and self-contained, relying on Mathlib's `Squarefree` and `StrictMono` directly. Relevant existing infrastructure in the codebase includes: + +- **`FormalConjecturesForMathlib/Data/Nat/Squarefree.lean`**: Contains `Nat.squarefreePart`, `Nat.squarePart`, decomposition lemmas, `Nat.squarefree_infinite`, and `Nat.Prime.squarefree`. None of these are needed for the *statement*, but could be relevant for a future proof. +- **`FormalConjecturesForMathlib/Combinatorics/Basic.lean`**: Sumset definitions (`IsSumFree`, `IsSidon`) and Mathlib's pointwise `A + A` notation. The current formalization avoids set-level sumsets in favor of the direct quantifier `∀ i j, Squarefree (a i + a j)`, which is equivalent and arguably cleaner for this statement. +- **`FormalConjecturesForMathlib/NumberTheory/Lacunary.lean`**: `IsLacunary` (exponential growth) and **`FormalConjecturesForMathlib/Analysis/HasGaps.lean`**: `HasFabryGaps` (super-polynomial growth, n_k / k → ∞). These capture growth-rate conditions but are not directly applicable here since the conclusion is formulated explicitly as `∀ C > 0, ∃ N, ∀ j ≥ N, j^C < a(j)`. + +**Verdict**: No immediate code reuse improvements. The formalization appropriately uses Mathlib primitives directly. + +## 2. Citations + +**Website (erdosproblems.com/1103) lists:** +- [Er81h] Erdos, 1981 +- [Ko04] Konyagin, 2004 (proved a_j ≫ j^{15/11 - o(1)} for the finite case) +- [vDTa25] van Doorn and Tao, 2025 +- Related: Problem 1109 (finite analogue) + +**Formalization docstring lists:** +- [Er81h] Erdos, P., *Some applications of graph theory and combinatorial methods to number theory and geometry* (1981). ✅ +- [vDTa25] van Doorn, F. and Tao, T., *Sumsets of squarefree numbers* (2025). ✅ + +**Missing from docstring:** +- **[Ko04]** — Konyagin's 2004 result (a_j ≫ j^{15/11 - o(1)}) is not cited. Since this is a significant partial result on the problem, it would be worth including. +- **Problem 1109** — The website identifies Problem 1109 as the finite analogue. A cross-reference could be helpful. + +## 3. Variants + +The website and literature mention several variants not captured: + +1. **Erdos's original stronger condition** (from [Er81h, p.180]): For every a ∈ A and prime p, if a ≡ t (mod p²) then 1 ≤ t < p²/2. The website notes this stronger condition has only finitely many solutions. This is a distinct (stronger) problem and not necessarily expected in the formalization. +2. **k-free generalization**: van Doorn and Tao extended results to k-free numbers (not just squarefree). Not captured. +3. **Higher sumsets**: Extensions to A ∪ (A+A) ∪ (A+A+A) being squarefree. Not captured. +4. **Finite analogue (Problem 1109)**: How large can |A ∩ [1,N]| be if A+A is squarefree? Not captured (separate problem). + +**Verdict**: The formalization captures the core conjecture. The k-free and higher-sumset variants are natural extensions that could be added as separate theorems, but their absence is not a deficiency for this problem. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring says "positive integers" while the type is `ℕ → ℕ` (non-negative). This is technically fine since the squarefree-sumset condition forces `a 0 ≥ 1` (because `Squarefree 0` is false in Mathlib), but the discrepancy between the docstring and the type could be clarified. +- The namespace `Erdos1103` is consistent with project conventions. +- The theorem statement reads naturally and the variable names are clear. + +**Verdict**: Good readability. No significant improvements needed. + +## 5. Formalizability + +The original problem on the website asks: *"How fast must A grow?"* — this is an open-ended question, not a precise conjecture. The formalization interprets this as the specific conjecture that **A must grow super-polynomially**, which is attributed to Erdos's expectation that no polynomial-growth sequence exists. + +This interpretation is mathematically well-motivated: +- The known lower bound is a_j > 0.24 j^{4/3} (polynomial). +- The known upper bound is a_j < exp(5j / log j) (sub-exponential). +- The gap between "polynomial" and "sub-exponential" is the core open question. + +**Ambiguity assessment**: **Moderate**. The website's question is genuinely open-ended — it could be asking for the exact growth rate, not just whether it's super-polynomial. However, the super-polynomial growth conjecture is the most natural formalization of Erdos's stated expectation ("does not expect such a sequence of polynomial growth to exist"). + +## 6. Correctness + +### Detailed analysis: + +**Hypothesis `ha_sumset_sqfree : ∀ i j : ℕ, Squarefree (a i + a j)`:** +- This correctly captures "every element of A+A is squarefree." In additive combinatorics, A + A = {a_i + a_j : i, j ∈ ℕ}, which includes the case i = j (so 2a_i must be squarefree for all i). The universal quantification over all pairs (i, j) is correct. ✅ +- `Squarefree` in Mathlib for ℕ: `∀ x, x * x ∣ n → IsUnit x`, where `IsUnit x` for ℕ means `x = 1`. So `Squarefree 0 = False` and `Squarefree 1 = True`. This is the standard mathematical definition. ✅ + +**Hypothesis `ha_strict_mono : StrictMono a`:** +- Captures "A = {a_0 < a_1 < a_2 < ⋯}" correctly. Combined with `a : ℕ → ℕ`, this gives an infinite strictly increasing sequence of non-negative integers. ✅ + +**Conclusion `∀ C : ℝ, C > 0 → ∃ N : ℕ, ∀ j : ℕ, j ≥ N → (j : ℝ) ^ C < (a j : ℝ)`:** +- This says: for every positive real C, eventually a(j) > j^C. This is exactly the definition of super-polynomial growth. ✅ +- The cast to ℝ for the comparison is necessary since `j ^ C` for real C is not defined in ℕ. ✅ +- Uses strict inequality `<` rather than `≤`, which is fine (equivalent for the "eventually" statement since we can adjust N). ✅ + +**Potential issue — indexing convention:** +- The sequence is indexed from 0: a(0), a(1), a(2), .... The conclusion says a(j) > j^C for large j. Note that j=0 gives 0^C which is 0 for C > 0, so the bound is vacuous at j=0. For j ≥ 1 this is meaningful. This is standard and correct. ✅ + +**Potential issue — "positive integers" vs ℕ:** +- The docstring says "positive integers" but the codomain is ℕ (includes 0). However, the squarefree condition on a(0) + a(0) forces a(0) ≥ 1 (since Squarefree 0 is false). So effectively the sequence takes values in ℕ⁺. No mathematical error, but slightly imprecise documentation. **Minor**. + +**Overall correctness**: The formalization is **mathematically correct** and faithfully captures the super-polynomial growth conjecture for squarefree sumsets. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ No improvements needed | +| Citations | ⚠️ Missing [Ko04] (Konyagin 2004) | +| Variants | ✅ Core conjecture captured; k-free variants omitted (acceptable) | +| Readability | ✅ Clean and clear | +| Formalizability | ⚠️ Moderate ambiguity — open-ended question interpreted as specific conjecture (reasonable) | +| Correctness | ✅ Mathematically correct | diff --git a/ai-review/1109.md b/ai-review/1109.md new file mode 100644 index 0000000000..3e4f1bfa37 --- /dev/null +++ b/ai-review/1109.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1109 + +## 1. Code Reuse + +The formalization already makes good use of existing infrastructure: +- `Squarefree` from Mathlib (no custom definition needed). +- `open Finset Pointwise` for the `A + A` sumset notation via Mathlib's pointwise operations on `Finset`. +- `Real.log` from Mathlib. + +No additional code from `FormalConjecturesForMathlib` is needed. The `squarefreePart`/`squarePart` definitions in `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` and the `Powerfree` generalization in `FormalConjecturesForMathlib/Algebra/Powerfree.lean` are not relevant to this problem statement (they would matter more for proofs than for the statement itself). The related Problem 1103 (`ErdosProblems/1103.lean`) formalizes the infinite-sequence analogue and is correctly kept as a separate theorem. + +**Verdict: Good. No code reuse opportunities missed.** + +## 2. Citations + +The formalization references: +- `[ErSa87]` Erdős, P. and Sárközy, A., *On the number of pairs of integers with least common multiple not exceeding $x$*. (1987) +- `[Ko04]` Konyagin, S. V. (2004) + +The website lists four references: +- `[ErSa87]` Erdős & Sárközy (1987) — included ✓ +- `[Sa92c]` Sárközy (1992) — **missing** (extended results to A+B and k-power-free sumsets) +- `[Gy01]` Gyarmati (2001) — **missing** (alternative proof of f(N) ≫ log N and new bounds for A+B) +- `[Ko04]` Konyagin (2004) — included ✓ + +Additionally, `[Ko04]` lacks a title in the docstring. The `[ErSa87]` citation title appears to be for a *different* paper — the title "On the number of pairs of integers with least common multiple not exceeding x" does not match the topic of squarefree sumsets. This may be an incorrect title attribution; the correct paper is likely about squarefree sums in sets, not LCM pairs. + +**Verdict: Two references missing; one citation title is likely incorrect.** + +## 3. Variants + +The website describes the problem as estimating f(N), with two specific sub-questions: +1. **Weaker question:** Is f(N) ≤ N^{o(1)}? (i.e., sub-polynomial growth) +2. **Stronger question:** Is f(N) ≤ (log N)^{O(1)}? (i.e., polylogarithmic growth) + +The formalization captures only the stronger conjecture (polylogarithmic bound). The weaker sub-polynomial question `f(N) ≤ N^{o(1)}` is **not formalized as a variant**. Since these represent genuinely different levels of the conjecture — and the sub-polynomial question might be more tractable — this is a meaningful omission. + +The website also notes a connection to Problem 1103 (infinite analogue): "upper bounds for this problem directly imply lower bounds for that problem." This relationship is not documented in the docstring. + +**Verdict: The weaker N^{o(1)} variant is missing. The connection to Problem 1103 should be noted.** + +## 4. Readability + +The code is clean and well-structured: +- The docstring clearly states the problem, explains the formalization choices, and provides known bounds. +- The Lean statement is straightforward and reads naturally. +- The namespace `Erdos1109` keeps things scoped. +- `open Finset Pointwise Real` is appropriate and minimal. + +Minor suggestions: +- The docstring could mention the relationship to Problem 1103. +- The quantifier structure `∃ C, C > 0 ∧ ∃ k, 0 < k ∧ ∃ N₀, ∀ N, ...` is standard but deeply nested; this is acceptable for this kind of statement. + +**Verdict: Good readability. No significant issues.** + +## 5. Formalizability + +The problem as stated on the website — "estimate f(N)" — is somewhat open-ended and not directly formalizable as a single theorem. However, the specific sub-question "Is f(N) ≤ (log N)^{O(1)}?" is a precise yes/no question and is clearly formalizable. The formalization correctly uses the `answer(sorry) ↔ ...` pattern for this. + +The (log N)^{O(1)} notation is unambiguous: it means ∃ C > 0, k > 0 such that f(N) ≤ C · (log N)^k for all sufficiently large N. This is exactly what is formalized. + +The weaker question f(N) ≤ N^{o(1)} is also formalizable (∀ ε > 0, f(N) ≤ N^ε for sufficiently large N) but would require a different formulation. + +**Verdict: The formalized sub-question is precise and unambiguous. Formalizability is high.** + +## 6. Correctness + +The formalization is mathematically sound with a few observations: + +**Correct aspects:** +- `A ⊆ {1, ..., N}` is correctly encoded as `∀ a ∈ A, 1 ≤ a ∧ a ≤ N`, which excludes 0. This ensures all elements of `A + A` are ≥ 2, avoiding the edge case where `Squarefree 0` is false. +- `A + A` via Pointwise gives `{a + b | a ∈ A, b ∈ A}` including self-sums `a + a`, which is the standard sumset convention. +- The `answer(sorry) ↔ ...` pattern correctly captures the yes/no nature of the question. +- The bound `(A.card : ℝ) ≤ C * (Real.log N) ^ k` correctly formalizes f(N) ≤ C · (log N)^k. + +**Minor observations:** +- `k : ℕ` with `0 < k`: Using a natural number exponent rather than a real exponent is slightly restrictive in principle (one could imagine (log N)^{1.5}), but since any real exponent can be upper-bounded by a natural number exponent, this does not change the mathematical content. The requirement `0 < k` is correct — k = 0 would give a constant bound, which is impossible since f(N) → ∞ (as the lower bound log N ≪ f(N) shows). +- `C > 0`: Correct, since the bound needs a positive constant. (C ≤ 0 would be trivially false for nonempty A.) +- When `N = 0` or `N = 1`, `Real.log N ≤ 0`, so `(Real.log N) ^ k` could be 0 or negative (for odd k). The `∃ N₀` existential handles this by allowing us to restrict to sufficiently large N. This is correct. + +**Verdict: The formalization is correct and complete for the specific sub-question it addresses. No mathematical flaws.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | ✅ Good — no missed opportunities | +| Citations | ⚠️ Two references missing ([Sa92c], [Gy01]); [ErSa87] title likely incorrect | +| Variants | ⚠️ Weaker N^{o(1)} question not formalized; connection to Problem 1103 undocumented | +| Readability | ✅ Good | +| Formalizability | ✅ High — the formalized question is precise | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/111.md b/ai-review/111.md new file mode 100644 index 0000000000..63e78c59ec --- /dev/null +++ b/ai-review/111.md @@ -0,0 +1,138 @@ +# AI Review: Erdos Problem 111 + +## 1. Code Reuse + +**`HasChromaticNumberAleph1` is duplicated verbatim across three files and should be factored out.** + +- **Identical copies** exist in `111.lean`, `110.lean`, and `62.lean` (within namespaces `Erdos111`, `Erdos110`, `Erdos62`). All three are character-for-character identical: + ```lean + def HasChromaticNumberAleph1 {V : Type*} (G : SimpleGraph V) : Prop := + (∀ (α : Type*) [Countable α], IsEmpty (G.Coloring α)) ∧ + (∃ α : Type*, #α = aleph 1 ∧ Nonempty (G.Coloring α)) + ``` + This should be extracted to a shared utility file. A natural home would be `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`, which already defines `chromaticCardinal`. Alternatively, `HasChromaticNumberAleph1 G` could be expressed as `G.chromaticCardinal = aleph 1` using the existing `chromaticCardinal` definition (line 136 of that file), which would eliminate the need for a custom predicate entirely. + +**`minEdgeDeletionsForBipartite` and `hFun` substantially overlap with definitions in Problem 74.** + +- Problem 74 defines `SimpleGraph.minEdgeDistToBipartite` and `SimpleGraph.maxSubgraphEdgeDistToBipartite`, which capture the same mathematical concept (minimum edge deletions for bipartiteness, maximized over n-vertex subgraphs). The key differences: + - **Problem 111** operates on `SimpleGraph W` with `[Fintype W]`, uses `H' ≤ H` with `Nonempty (H'.Coloring (Fin 2))`, and measures via `(H.edgeSet \ H'.edgeSet).ncard`. + - **Problem 74** operates on `G.Subgraph`, uses `deleteEdges E` with `IsBipartite`, and measures via `E.ncard`. + - **Problem 111** uses `G.induce (S : Set V)` for induced subgraphs (via `Finset V`); **Problem 74** uses arbitrary `Subgraph G` with `A.verts.ncard = n`. + + The difference in subgraph notion (induced vs. arbitrary) is mathematically meaningful and justified by the different problem statements. However, the core concept of "minimum edge deletions to bipartiteness" could be shared. Problem 74 already has a proof that this set is nonempty (`edgeDistancesToBipartite_nonempty`) and bounded above (`subgraphEdgeDistsToBipartite_bddAbove`), which Problem 111 lacks. + +- **Problem 744** defines `minEdgesToBipartite` using `sInf` and `Colorable 2` — yet another variant of the same concept. + +- **Problem 581** defines `maxBipartiteEdges` using `Coloring (Fin 2)` — related but measures the complement (maximum bipartite subgraph size rather than minimum deletions). + +**Recommendation:** Factor `HasChromaticNumberAleph1` into a shared file. Consider whether `minEdgeDeletionsForBipartite` and Problem 74's `minEdgeDistToBipartite` can be unified or at least share a common core definition, with the induced-vs-arbitrary distinction handled at the `hFun`/`maxSubgraphEdgeDistToBipartite` level. + +## 2. Citations + +The docstring includes two references: [EHS82] and [Er81]. The website [erdosproblems.com/111](https://www.erdosproblems.com/111) lists several additional references: + +**Missing from docstring:** +- **[Er87]** Erdős, P. (1987) — subsequent discussion of the problem. +- **[Er90]** Erdős, P. (1990) — further discussion. +- **[Er97d]** Erdős, P. (1997) — additional reference. +- **[Er97f]** Erdős, P. (1997) — additional reference. + +**Missing cross-reference:** +- **Problem 74** is cross-referenced on the website as a related problem. The docstring does not mention this relationship, despite the two problems sharing significant mathematical content (both concern edge deletions to bipartiteness in graphs with large chromatic number). + +**Present in docstring — accuracy check:** +- [EHS82] — cited as "Erdős, P., Hajnal, A. and Szemerédi, E., *On almost bipartite large chromatic graphs*. Annals of Discrete Mathematics, 12 (1982), 117-123." This matches the standard citation. However, the website and Problem 74's docstring cite the publication venue as "Theory and practice of combinatorics (1982), 117-123" rather than "Annals of Discrete Mathematics, 12." These likely refer to the same publication (the book appeared in the Annals of Discrete Mathematics series). The docstring's citation is acceptable. +- [Er81] — cited as "Erdős, P., *On the combinatorial problems which I would most like to see solved*. Combinatorica, 1 (1981), 25-42." This is a standard and correct citation. + +**Recommendation:** Add [Er87] and [Er90] as relevant references. Add a cross-reference to Problem 74 in the docstring, since the two problems are closely related. + +## 3. Variants + +The formalization captures the main conjecture (existence of G with χ = ℵ₁ and h(G,n) = O(n^{1+ε})). Several natural variants are not formalized: + +**Missing variants:** + +1. **The h(G,n)/n → ∞ question:** The website frames an aspect of the problem as asking whether h_G(n)/n → ∞ for every graph G with chromatic number ℵ₁. The known lower bound is h_G(n) ≥ cn (linear), established by the existence of vertex-disjoint odd cycles. The question of whether this is always superlinear is a natural companion to the formalized upper-bound conjecture. This could be formalized as: + ```lean + theorem erdos_111.variants.superlinear : answer(sorry) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + HasChromaticNumberAleph1 G → + Filter.Tendsto (fun n => (hFun G n : ℝ) / n) Filter.atTop Filter.atTop + ``` + +2. **The n^{3/2} known bound (EHS82):** The docstring mentions that Erdős–Hajnal–Szemerédi proved the existence of G with χ = ℵ₁ satisfying h(G,n) ≪ n^{3/2}. This known result could be formalized as a theorem (not a conjecture) to provide context. + +3. **Relationship to Problem 74:** Problem 74 asks the stronger question of whether h(G,n) can grow arbitrarily slowly (slower than any function tending to infinity) for graphs with infinite chromatic number (not just ℵ₁). An affirmative answer to Problem 74 would imply an affirmative answer to Problem 111. This logical relationship could be documented or formalized. + +4. **The √n variant from Problem 74:** Problem 74 includes a variant asking whether h(G,n) ≤ √n is achievable. This sits between the linear lower bound and the n^{1+ε} conjecture of Problem 111. + +**Assessment:** The core conjecture is captured. The superlinear lower bound question (variant 1) and the known n^{3/2} result (variant 2) are the most natural additions. + +## 4. Readability + +The code is reasonably well-structured: + +- **Good:** The module docstring provides a clear mathematical narrative: known lower bound, known upper bound, and the conjectured improvement. +- **Good:** Each auxiliary definition (`HasChromaticNumberAleph1`, `minEdgeDeletionsForBipartite`, `hFun`) has a clear docstring. +- **Good:** The `answer(sorry)` pattern correctly signals an open problem. + +- **Minor issue:** The name `hFun` is somewhat opaque. A more descriptive name like `maxMinEdgeDeletionsForBipartite` or `maxBipartiteEdgeDist` would better convey its meaning. Compare Problem 74's `maxSubgraphEdgeDistToBipartite`, which is more self-documenting. + +- **Minor issue:** The docstring for `hFun` contains a slight inconsistency: it says "h(G, n) is the smallest k such that every induced subgraph of G on exactly n vertices can be made bipartite by deleting at most k edges" but also "h(G, n) is defined as the maximum over all n-vertex induced subgraphs." Both are correct descriptions of the same quantity, but "smallest k such that every..." and "maximum over all..." could be confusing to a reader seeing them juxtaposed. A cleaner formulation: "h(G, n) is the maximum, over all n-vertex induced subgraphs H of G, of the minimum number of edges that must be deleted from H to make it bipartite." + +- **Style note:** The namespace `Erdos111` is consistent with other problems (`Erdos110`, `Erdos62`, `Erdos74`). + +## 5. Formalizability + +**Assessment: Highly formalizable. Low ambiguity.** + +The problem statement is mathematically precise: + +- **"Chromatic number ℵ₁"** — unambiguous set-theoretic concept, well-captured by `HasChromaticNumberAleph1`. +- **"n-vertex induced subgraph"** — unambiguous; the formalization correctly uses `G.induce (S : Set V)` with `S : Finset V` and `S.card = n`. +- **"Can be made bipartite by deleting O(n^{1+ε}) edges"** — the big-O notation is standard; the formalization correctly encodes it as `∃ C > 0, ∀ n, h(G,n) ≤ C * n^{1+ε}` with the constant C depending on ε (the ∃ C is inside the ∀ ε). + +The only mild interpretive question is whether "subgraph" in the original problem means "induced subgraph" or "arbitrary subgraph." The formalization uses induced subgraphs, and the docstring explicitly says "n-vertex induced subgraph." This is consistent with the original paper [EHS82], which defines h(G, n) in terms of induced subgraphs. The choice is correct. + +There are no set-theoretic independence concerns with the statement itself: the conjecture asks for the existence of a specific combinatorial object, which is absolute between models of ZFC. + +## 6. Correctness + +**The formalization is mathematically correct, with one minor technical concern regarding `sSup` well-definedness.** + +Detailed analysis: + +- **`HasChromaticNumberAleph1 G`**: Correctly encodes χ(G) = ℵ₁ by asserting (1) no countable coloring exists, and (2) an ℵ₁-coloring exists. Under ZFC, this exactly characterizes chromatic number ℵ₁. **Correct.** + +- **`minEdgeDeletionsForBipartite`**: Uses `sInf` on the set `{k : ℕ | ∃ H' ≤ H, Nonempty (H'.Coloring (Fin 2)) ∧ (H.edgeSet \ H'.edgeSet).ncard = k}`. This set is always nonempty: take H' = ⊥ (the empty graph), which is 2-colorable, and the number of deleted edges equals the number of edges in H. Since `sInf` on a nonempty subset of ℕ returns the minimum, this correctly computes the minimum number of edge deletions. **Correct.** + +- **`hFun`**: Uses `sSup` on `{k : ℕ | ∃ S : Finset V, S.card = n ∧ k = minEdgeDeletionsForBipartite (G.induce (S : Set V))}`. + - **Nonemptiness:** For a graph with χ = ℵ₁, the vertex set V is uncountable, so for any finite n, there exist Finsets of size n. The set is nonempty. **OK.** + - **Boundedness:** Each value in the set is at most n choose 2 (since an induced subgraph on n vertices has at most n(n−1)/2 edges). The set is bounded above. **OK.** + - **`sSup` behavior on ℕ:** For `ℕ` with its `ConditionallyCompleteLinearOrderBot` instance, `sSup` of a nonempty bounded set returns the correct supremum. Since our set is both nonempty and bounded, `sSup` is well-defined and correct. **Correct.** + + However, unlike Problem 74 (which proves `edgeDistancesToBipartite_nonempty` and `subgraphEdgeDistsToBipartite_bddAbove`), Problem 111 does not include these auxiliary lemmas. Any proof of `erdos_111` would need to establish these facts. This is not an error in the formalization, but a gap in supporting infrastructure. + +- **The main theorem statement**: `∃ (V : Type*) (G : SimpleGraph V), HasChromaticNumberAleph1 G ∧ ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, (hFun G n : ℝ) ≤ C * (n : ℝ) ^ (1 + ε)` + - The order of quantifiers is correct: ∃ G, ∀ ε > 0, ∃ C > 0, ∀ n. The constant C is allowed to depend on ε (and on G), which correctly captures "for every ε > 0, h(G,n) = O(n^{1+ε})." **Correct.** + - The coercion `(hFun G n : ℝ)` is well-typed since ℕ embeds into ℝ. **Correct.** + - The expression `(n : ℝ) ^ (1 + ε)` uses real exponentiation, which is well-defined for n ≥ 0. For n = 0, `0 ^ (1 + ε) = 0` and `hFun G 0 = 0` (the only 0-vertex induced subgraph is the empty graph, which is already bipartite), so the bound holds trivially. **No edge-case issues.** + +- **`answer(sorry)`**: Correct for an open problem. **Correct.** + +- **Category tags**: `category research open` — correct (the problem is open). `AMS 5` — AMS subject classification 05 (combinatorics), appropriate for this graph theory problem. One could argue `AMS 3` (set theory) is also relevant given the ℵ₁ hypothesis, as used in Problem 110. **Minor omission.** + +- **Universe polymorphism**: The `∃ (V : Type*)` quantifier is universe-polymorphic, which is mathematically sound for this existential statement. + +**Verdict:** The formalization is mathematically faithful to the original conjecture. No errors identified. The `sSup`/`sInf` usage is correct given the boundedness and nonemptiness of the relevant sets, though supporting lemmas (as in Problem 74) would strengthen the formalization. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `HasChromaticNumberAleph1` duplicated in 3 files (110, 111, 62). `minEdgeDeletionsForBipartite` and `hFun` substantially overlap with Problem 74's definitions; shared infrastructure is possible | +| Citations | Needs improvement | Missing [Er87], [Er90], [Er97d], [Er97f] from website; no cross-reference to related Problem 74 | +| Variants | Acceptable | Main conjecture captured; the superlinear lower bound question (h(G,n)/n → ∞) and the known n^{3/2} result [EHS82] are natural candidates for additional formalization | +| Readability | Good | Clear docstrings and structure; `hFun` name could be more descriptive; minor docstring inconsistency in dual characterization | +| Formalizability | Excellent | Unambiguous problem statement; induced subgraph interpretation is correct per original paper; no set-theoretic complications | +| Correctness | Correct | Mathematically faithful; quantifier order is correct for O(n^{1+ε}) bound; `sSup`/`sInf` are well-defined; no edge-case issues; consider adding `AMS 3` tag | diff --git a/ai-review/1110.md b/ai-review/1110.md new file mode 100644 index 0000000000..4da2140e14 --- /dev/null +++ b/ai-review/1110.md @@ -0,0 +1,125 @@ +# AI Review: Erdős Problem 1110 + +## 1. Code Reuse + +**`IsDivisibilityAntichain` should be replaced with Mathlib's `IsAntichain (· ∣ ·)`.** + +The custom definition at line 48: +```lean +def IsDivisibilityAntichain (S : Finset ℕ) : Prop := + ∀ x ∈ S, ∀ y ∈ S, x ∣ y → x = y +``` +duplicates functionality already available in Mathlib and already used in this codebase. Erdős Problem 123 (`FormalConjectures/ErdosProblems/123.lean:44`) uses `IsAntichain (· ∣ ·)` from Mathlib directly: +```lean +IsAntichain (· ∣ ·) (s : Set ℕ) +``` + +The custom definition is also semantically duplicated by `IsPrimitive` in: +- `FormalConjectures/ErdosProblems/872.lean:46` (for `Finset ℕ`) +- `FormalConjectures/ErdosProblems/164.lean:40` (for `Set ℕ`) + +**Recommendation:** Replace `IsDivisibilityAntichain S` with `IsAntichain (· ∣ ·) (S : Set ℕ)` (casting the `Finset` to `Set` as done in Problem 123). This improves consistency across the codebase and gives access to Mathlib's antichain lemmas. + +**`IsPQPower` is unique to this problem** and has no reuse candidate. This is appropriate. + +**`IsRepresentable` pattern:** Problem 123's `IsDComplete` uses a very similar structure (finset of elements, antichain under divisibility, summing to n). Consider whether the representability concept could be factored out, though this is low priority since the problems have different constraints. + +## 2. Citations + +The website lists the following references and results: + +| Citation | Website | Formalization | Status | +|----------|---------|---------------|--------| +| Erdős & Lewin (1996) | ✅ Listed | ✅ Referenced as `[ErLe96]` | Match | +| Yu & Chen (2022) | ✅ Listed | ✅ Referenced as `[YuCh22]` | Match | +| Yang & Zhao (2025) | ✅ Listed on website | ❌ **Not mentioned** in docstring | **Missing** | +| Erdős (1992) | ✅ Listed on website (re: {2,3} case) | Not mentioned | Covered by Problem 123 instead | + +**Issue:** The Yang & Zhao (2025) result on improved lower bounds for the growth rate is not cited. This is a recent result that strengthens prior work. Consider adding: +``` +[YaZh25] Yang and Zhao improved lower bounds on the growth rate f(n) for representations +with all summands > f(n). +``` + +The existing citations `[ErLe96]` and `[YuCh22]` lack full bibliographic details (paper titles, journal names, page numbers). Problem 123 provides a better citation model with full titles and journal info. Consider expanding to match. + +## 3. Variants + +The website mentions several aspects of the problem: + +1. **Density of non-representable numbers** — The docstring asks "what can be said about the density?" but the formalization only captures infinitely many coprime non-representable numbers. The density-zero result of Yu & Chen (for specific parameter ranges) is mentioned in the docstring but not formalized as a variant. + +2. **The {2,3} case** — The formalization correctly excludes this case. The website notes this is related to Problem 845. + +3. **Specific parameter results from Yu & Chen** — Yu & Chen proved density zero for q > 3; q = 3, p > 6; or q = 2, p > 10. These partial results could be formalized as variants (e.g., `erdos_1110.variants.density_zero_large_q`). + +4. **Missing variant: finitely many non-representable iff {p,q} = {2,3}** — The Erdős-Lewin result is stated in the docstring but not formalized. This is a solved result and would be a natural variant: + ```lean + theorem erdos_1110.variants.erdos_lewin : + ∀ p q : ℕ, 2 ≤ q → q < p → Nat.Coprime p q → + (Set.Finite {n : ℕ | ¬IsRepresentable p q n} ↔ (p = 3 ∧ q = 2)) := by sorry + ``` + +## 4. Readability + +**Generally good.** The definitions are clear and well-documented. Specific suggestions: + +- **`IsDivisibilityAntichain`**: The name is verbose. Replacing with Mathlib's `IsAntichain (· ∣ ·)` would be more idiomatic and recognizable to Lean/Mathlib users. + +- **Docstring on `erdos_1110`**: The note "Since p > q ≥ 2 and p, q are coprime, the only excluded case is p = 3, q = 2" is helpful and correct. + +- **`IsPQPower`**: The name is clear, and the docstring explains it well. Minor: the docstring says "positive integer m" but the definition allows `m = 0` (when `a = 0, b = 0` and `p = 0` or `q = 0`). Since the theorem requires `2 ≤ q` and `q < p`, this is not a real issue in practice, but the docstring could say "natural number" instead of "positive integer" for precision. + +## 5. Formalizability + +**Assessment: Largely formalizable with moderate ambiguity.** + +The core mathematical content is precise: +- "representable" is well-defined given specific p, q +- "coprime non-representable numbers" is precise +- The antichain condition (no summand divides another) is clear + +**Ambiguity points:** + +1. **"What can be said about the density?"** — This is an open-ended question, not a precise conjecture. The formalization chooses to interpret it as "infinitely many coprime non-representable numbers exist," which is one specific reading. The website and literature suggest the stronger claim that representable numbers have density zero (for most parameter choices), which is a different and stronger statement. + +2. **The `answer(sorry)` wrapper** — Since this is tagged as an open problem, the use of `answer(sorry)` is appropriate. The problem asks whether a specific property holds, and the answer is not yet known for all parameter ranges. + +3. **Distinctness of summands** — The formalization uses a `Finset`, which inherently enforces distinctness of elements. This correctly captures the "sum of distinct integers" aspect, but this implicit constraint should perhaps be noted. + +**Formalizability score: 7/10** — The open-ended nature ("what can be said about the density?") introduces inherent ambiguity about what exactly should be proven. The chosen formalization captures one natural interpretation. + +## 6. Correctness + +**The formalization is mathematically reasonable but has notable issues:** + +### Correct aspects: +- The conditions `2 ≤ q`, `q < p`, `Nat.Coprime p q` correctly capture "coprime integers p > q ≥ 2" +- The exclusion `¬(p = 3 ∧ q = 2)` correctly handles the {2,3} case (since p > q forces p = 3, q = 2 rather than p = 2, q = 3) +- `IsPQPower` correctly defines numbers of the form p^a · q^b +- The coprimality condition `Nat.Coprime n (p * q)` on non-representable numbers matches the problem statement +- `Set.Infinite` correctly captures "infinitely many" + +### Potential issues: + +1. **Zero in the summand set**: `IsPQPower p q 0` is true (take `a = 0, b = 0` when `p = 0`, but actually since p ≥ 3, `p^0 * q^0 = 1`, so `IsPQPower p q 0` is false for valid p, q). Under the constraints of the theorem, `IsPQPower p q m` with `m = 0` would require `p^a * q^b = 0`, which is impossible when `p ≥ 3` and `q ≥ 2`. So this is fine in context. + +2. **Including 1 as a PQ-power**: `p^0 * q^0 = 1` is always a PQ-power. This is mathematically correct — 1 = p^0 · q^0 is indeed of the required form. The antichain condition prevents 1 from appearing alongside any other PQ-power it divides (which is all of them), so including 1 in a representation means the representation is just {1} summing to 1. This seems intentional and correct. + +3. **Nonemptiness**: The `S.Nonempty` condition in `IsRepresentable` prevents 0 from being vacuously representable. This is correct. + +4. **The formalization captures a specific conjecture, not the full problem**: The original problem asks an open-ended question about density. The formalization asserts that there are infinitely many coprime non-representable numbers. This is a valid conjecture consistent with the problem, but it's a specific interpretation. Yu & Chen's density-zero results (for many parameter ranges) support a stronger claim that the formalization does not capture. + +### Overall correctness assessment: +The formalization is **correct** for the specific claim it makes. The mathematical encoding faithfully represents the statement "for coprime p > q ≥ 2 with {p,q} ≠ {2,3}, there are infinitely many non-representable numbers coprime to pq." The incompleteness (not capturing the density question) is attributable to ambiguity in the original problem statement. + +## Summary + +| Criterion | Rating | Key Finding | +|-----------|--------|-------------| +| Code Reuse | ⚠️ Needs improvement | Replace `IsDivisibilityAntichain` with Mathlib's `IsAntichain (· ∣ ·)` | +| Citations | ⚠️ Minor gap | Missing Yang & Zhao (2025); existing citations lack full bibliographic detail | +| Variants | ⚠️ Missing variants | Erdős-Lewin characterization theorem and density-zero partial results not formalized | +| Readability | ✅ Good | Clear definitions and documentation; minor docstring imprecision | +| Formalizability | ⚠️ Moderate ambiguity | Open-ended problem statement; formalization captures one valid interpretation | +| Correctness | ✅ Correct | Mathematically faithful to the chosen interpretation; no flaws found | diff --git a/ai-review/1111.md b/ai-review/1111.md new file mode 100644 index 0000000000..5b42110be0 --- /dev/null +++ b/ai-review/1111.md @@ -0,0 +1,77 @@ +# AI Review: Erdos Problem 1111 + +## 1. Code Reuse + +**Problem 628 (Erdos-Lovasz Tihany Conjecture)** in `FormalConjectures/ErdosProblems/628.lean` is structurally very similar: it finds two vertex-disjoint induced subgraphs with chromatic number bounds in a clique-free graph. The key difference is that 628 only requires `Disjoint S T`, while 1111 additionally requires no edges between the two sets (anticomplete). The `Anticomplete` definition in 1111 is custom; Mathlib has no built-in notion of anticomplete sets for `SimpleGraph`. + +The `Anticomplete` definition could potentially be shared if extracted to a utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`), since it is a natural graph-theoretic concept that could appear in other problems. However, no other file in the codebase currently uses or defines this concept, so the local definition is reasonable for now. + +No other significant code reuse opportunities were identified. The uses of `chromaticNumber`, `CliqueFree`, and `induce` follow standard patterns seen across many Erdos problems (628, 640, 761, 1091). + +## 2. Citations + +The formalization includes: +- **[ElEr85]** El Zahar, M. and Erdos, P., *On the existence of two non-neighboring subgraphs in a graph*, Combinatorica, 1985. +- **[Wa80b]** Wagon, S., *A bound on the chromatic number of graphs without certain induced subgraphs*, J. Combin. Theory Ser. B, 1980. + +The website additionally lists: +- **[Er85b]** Erdos, P. (1985) - listed as a source but not included in the formalization's docstring. +- **[NSS24]** Nguyen, Scott, and Seymour (2024) - recent progress proving a strengthened version where one of the anticomplete sets has minimum degree at least $c$ in its induced subgraph, rather than just chromatic number at least $c$. + +**Recommendation:** Add [Er85b] as an additional original source reference. Optionally mention [NSS24] as recent progress in the docstring. + +## 3. Variants + +The formalization captures the core conjecture. The following variants/extensions mentioned on the website are **not** captured: + +1. **NSS24 strengthening:** Nguyen, Scott, and Seymour proved that one can find anticomplete sets $A, B$ where $B$ has $\chi(B) \geq c$ and $A$ has minimum degree $\geq c$ in $G[A]$ (stronger than $\chi(A) \geq c$). This is a meaningful strengthening that could be formalized as a separate theorem. + +2. **Specific known bounds:** The website lists $d(2,2) = 2$, $d(3,2) = 4$, $d(4,2) = 5$ as exact values. These concrete results could be formalized as separate lemmas but are not required for the main conjecture statement. + +3. **The ordering $\chi(A) \geq \chi(B) \geq c$:** The website states the conclusion with an ordering on the chromatic numbers. The formalization just requires both $\geq c$, which is equivalent (WLOG relabeling), so this is not a real gap. + +## 4. Readability + +The code is well-structured and readable: +- The `Anticomplete` definition is cleanly separated with a docstring explaining the concept. +- The main theorem has a detailed docstring covering notation ($\chi$, $\omega$), the meaning of `CliqueFree`, and known bounds. +- The namespace `Erdos1111` prevents name collisions for the local `Anticomplete` definition. + +**Minor suggestion:** The docstring mentions "El Zahar and Erdos show it suffices to consider $t \leq c$" - this is useful context but could be confusing since the formalization does not impose this restriction (correctly, since the general statement subsumes it). + +## 5. Formalizability + +**Assessment: High.** The problem is precisely stated and the formalization is straightforward. + +The key concepts are all well-defined: +- "Finite graph" → `SimpleGraph (Fin n)` +- "Chromatic number at least $d$" → `(d : ℕ∞) ≤ G.chromaticNumber` +- "Clique number less than $t$" → `G.CliqueFree t` +- "Anticomplete sets" → `Anticomplete G A B` (custom definition) +- "Induced subgraph chromatic number" → `(G.induce A).chromaticNumber` + +There is essentially no ambiguity in the problem statement. All terms have standard mathematical definitions that map cleanly to Lean/Mathlib constructs. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +- **Quantifier structure:** The existential `∃ d` is correctly quantified before the universal over graphs (`∀ (n : ℕ) (G : ...)`), ensuring $d$ depends only on $t$ and $c$, not on the specific graph. This matches the problem statement. + +- **Finite graph encoding:** Using `∀ (n : ℕ) (G : SimpleGraph (Fin n))` correctly captures "every finite graph" since every finite graph is isomorphic to one on `Fin n`. + +- **CliqueFree semantics:** `G.CliqueFree t` means no clique of size $t$ exists, which is equivalent to $\omega(G) < t$. Correct. + +- **Chromatic number comparison via `ℕ∞`:** The casts `(d : ℕ∞)` and `(c : ℕ∞)` handle the fact that `chromaticNumber` returns `ℕ∞` (to accommodate non-colorable graphs, though finite graphs are always finitely colorable). This is the standard pattern. + +- **Anticomplete definition:** Requires both `Disjoint A B` (the sets don't share vertices) and `∀ a ∈ A, ∀ b ∈ B, ¬G.Adj a b` (no edges cross between them). This correctly captures the graph-theoretic notion of anticomplete sets. Note: disjointness is technically redundant given `SimpleGraph.loopless` (if $a = b$ then $\neg G.Adj a b$ holds automatically), but it is a reasonable explicit assertion that makes the definition clearer and more robust. + +- **Edge case $t = 1$:** `CliqueFree 1` means no vertex exists, so for any non-empty `Fin n`, the hypothesis `G.CliqueFree 1` is false and the statement is vacuously true. This is mathematically correct (the problem only makes interesting claims for $t \geq 2$). + +- **Edge case $c = 1$:** The conclusion requires finding anticomplete sets with chromatic number $\geq 1$, meaning they must be nonempty. This is trivially satisfiable for any graph with sufficiently high chromatic number. + +- **Bound $1 \leq d$:** The existential includes `1 ≤ d`, which is a reasonable non-degeneracy condition ensuring $d$ is positive. + +**No mathematical flaws identified.** The formalization is a faithful encoding of the Erdos problem as stated on the website. diff --git a/ai-review/1112.md b/ai-review/1112.md new file mode 100644 index 0000000000..7816e52061 --- /dev/null +++ b/ai-review/1112.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 1112 + +## 1. Code Reuse + +**`kFoldSumset` duplicates existing Mathlib functionality.** Mathlib's pointwise set operations (via `Mathlib.Algebra.Group.Pointwise.Set`) provide `n • S` for sets in an additive monoid, which computes the n-fold sumset. Specifically, `n • S` is defined recursively with `0 • S = {0}` and `(n+1) • S = S + n • S`, which is exactly the semantics of the custom `kFoldSumset`. Replacing the custom definition with `k • (Set.range A)` would improve maintainability and leverage Mathlib's existing lemmas about `nsmul` on sets. + +Additionally, the codebase contains at least 6 independent local definitions of `sumset` across other Erdős problems (35, 37, 31, 337, 869, 871), all defining `{n | ∃ a ∈ A, ∃ b ∈ B, n = a + b}`. These could all use Mathlib's pointwise `Set.add` / `HAdd` on sets. This is a broader codebase concern, not specific to 1112. + +## 2. Citations + +The docstring references `[ErGr80]` which corresponds to the website's citation `[ErGr80, p.18]`. The **page number (p.18) is missing** from the formalization's citation. Full citation on the website: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The docstring's "Known results" section mentions Bollobás–Hegyvári–Jin, Chen, and Tang–Yang without formal citation keys. The website does not provide explicit citation keys for these either, so this is acceptable, though adding full paper references would improve traceability. + +## 3. Variants + +**The k=2 case is not formalized as a variant.** The website documents several resolved results for k=2: + +- `r₂(2,3) = 2` (Erdős–Graham, with optimality by Bollobás–Hegyvári–Jin) +- `r₂(a,b) ≤ 2` for `a < b` with `b ≠ 2a` (Chen) +- `r₂(a, 2a) ≥ 2` for all integers `a` (Chen) + +These are proven results and could be formalized as `@[category research solved]` variant theorems, following the pattern in e.g. Erdős 252 which has multiple solved variants alongside the open main conjecture. + +**The non-existence of r₃(2,3) is not formalized as a variant.** This is a proven result (Bollobás–Hegyvári–Jin) and should be a solved variant theorem: +```lean +@[category research solved] +theorem erdos_1112.variants.r3_2_3_nonexistence : ... +``` + +## 4. Readability + +The formalization is generally readable. Minor suggestions: + +- The docstring is clear and well-structured with known results. +- The `kFoldSumset` definition has a good docstring explaining the recursion. +- The gap constraints `d₁ ≤ A (i + 1) - A i` and `A (i + 1) - A i ≤ d₂` use natural number subtraction, which is correct here since `A` is `StrictMono`, but could benefit from a brief comment noting this relies on strict monotonicity for well-definedness. + +## 5. Formalizability + +**Medium-high ambiguity.** The website explicitly notes: *"The problem represents a generous interpretation of an ambiguous Erdos-Graham remark; it is not formalized in external databases."* + +The original Erdős-Graham remark in [ErGr80, p.18] is apparently not a precisely stated conjecture but rather an observation or question. The key ambiguity is in what the "general question" asks: + +- **(a)** "For all d₁, d₂, k ≥ 3, does r_k(d₁, d₂) exist?" — This is the formalization's interpretation, but it is already answered negatively by the non-existence of r₃(2,3). +- **(b)** "Characterize which (d₁, d₂, k) admit a finite r_k(d₁, d₂)." — This is more natural given the known partial results but harder to formalize as a single theorem statement. +- **(c)** "For specific parameter ranges (e.g., large d₂/d₁ ratio, or larger k), does r_k(d₁, d₂) exist?" — Another possible reading. + +The formalization chooses interpretation (a), which is the most concrete but also the most problematic (see Correctness below). + +## 6. Correctness + +**There is a significant correctness concern with the formalization as stated.** + +The formalization asserts (behind `answer(sorry)`): + +> ∀ d₁ d₂, 1 ≤ d₁ → d₁ < d₂ → ∀ k, 3 ≤ k → ∃ r, [lacunary avoidance property] + +However, the docstring itself documents that **r₃(2,3) does not exist** (Bollobás–Hegyvári–Jin). This means the right-hand side of the biconditional is **false** — we can instantiate d₁ = 2, d₂ = 3, k = 3 to witness the failure of the universal quantifier. + +This has two consequences: + +1. **The problem is not truly open as formalized.** The `answer(sorry)` must be `False`, and this is provable from the known result of Bollobás–Hegyvári–Jin. Tagging this as `@[category research open]` is misleading. + +2. **The formalization does not capture the actual open question.** The remaining open question is more nuanced — it concerns characterizing for which parameters r_k(d₁, d₂) exists, or whether existence holds for specific parameter regimes not yet resolved. + +**Proposed fix:** Either: +- **(Option A)** Reformulate the main theorem to ask about a specific open parameter range, e.g., whether there exist *any* (d₁, d₂) for which r_k(d₁, d₂) exists when k ≥ 3. Something like: + ```lean + answer(sorry) ↔ ∃ (d₁ d₂ : ℕ), 1 ≤ d₁ ∧ d₁ < d₂ ∧ + ∀ (k : ℕ), 3 ≤ k → ∃ (r : ℕ), [property] + ``` +- **(Option B)** Keep the universal formulation but change the tag to `@[category research solved]` since the answer is known to be `False`, and add the actual open question as a separate variant. +- **(Option C)** Parameterize the problem by specific (d₁, d₂, k) and mark it as open, acknowledging that the answer varies by parameter. + +**Other correctness notes:** +- The `kFoldSumset` definition is mathematically correct. +- The lacunary condition `r * B i ≤ B (i + 1)` correctly models `b_{i+1} ≥ r · b_i`. +- The gap constraints on `A` correctly model `d₁ ≤ a_{i+1} - a_i ≤ d₂` (natural number subtraction is fine under `StrictMono`). +- The disjointness condition `∀ n, n ∈ kFoldSumset k (Set.range A) → n ∉ Set.range B` correctly models `(kA) ∩ B = ∅`. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `kFoldSumset` could use Mathlib's `n • S` on sets | +| Citations | Missing page number (p.18) from [ErGr80] | +| Variants | k=2 solved cases and r₃(2,3) non-existence should be formalized | +| Readability | Good | +| Formalizability | Medium-high ambiguity (acknowledged by website) | +| Correctness | **Major issue:** Universal statement is already falsified; problem is not open as formalized | diff --git a/ai-review/1113.md b/ai-review/1113.md new file mode 100644 index 0000000000..93d680d94a --- /dev/null +++ b/ai-review/1113.md @@ -0,0 +1,93 @@ +# AI Review: Erdos Problem 1113 + +## 1. Code Reuse + +**`FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`** defines an abstract `CoveringSystem` structure over commutative semirings (a finite set of cosets of non-zero ideals covering the whole ring). This is conceptually related but not directly applicable: Problem 1113's `HasFiniteCoveringSet` defines a *different* notion — a finite set of primes such that every member of the family `{2^k * m + 1}` is divisible by some prime in the set. The abstract `CoveringSystem` captures congruence classes covering all integers, while the covering set here is about primes dividing a specific parametric family. These are connected (a covering system of congruences modulo primes induces a covering set for the Sierpinski family), but the direct definition used in 1113.lean is more natural and appropriate for this problem. No immediate code reuse opportunity. + +**`FormalConjectures/ErdosProblems/203.lean`** defines a closely related problem (existence of m coprime to 6 such that `2^k * 3^l * m + 1` is never prime). The TODO comment in 203.lean even mentions adding statements about covering systems and odd integers m where `2^k * m + 1` is never prime, which is exactly the Sierpinski number concept. The `IsSierpinskiNumber` definition from 1113.lean could potentially be shared with or referenced by Problem 203. + +## 2. Citations + +The formalization includes: +- **[ErGr80]** Erdos and Graham, *Old and new problems and results in combinatorial number theory* (1980). **Present and correct.** +- **[FFK08]** Filaseta, Finch, and Kozek, *On powers associated with Sierpinski numbers, Riesel numbers, and Polignac's conjecture*, Journal of Number Theory (2008). **Present and correct.** + +**Missing from formalization:** +- **[Gu04]** Guy, *Unsolved Problems in Number Theory*. The website lists this as problem F13 in Guy's collection. This is a minor omission. +- The website attributes the specific example `m = 734110615000775^4` to **Izotov** (detailed by Filaseta, Finch, and Kozek). The docstring attributes it only to FFK08, which is acceptable since FFK08 is where the argument is detailed. However, naming Izotov explicitly would be more accurate. + +**Website also lists related problems:** #203 and #276. These cross-references are not mentioned in the formalization. + +## 3. Variants + +The formalization captures only the core question. The website and literature suggest additional variants that are **not formalized**: + +1. **Filaseta-Finch-Kozek Conjecture:** "Every Sierpinski number is either a perfect power or else has a finite covering set of primes." This is a natural strengthening/refinement of the original problem and would be a valuable addition. It could be stated as: + ``` + theorem erdos_1113_variant : ∀ m : ℕ, IsSierpinskiNumber m → + (∃ b k : ℕ, 1 < k ∧ m = b ^ k) ∨ (∃ P : Finset ℕ, HasFiniteCoveringSet m P) + ``` + +2. **Connection to Fermat primes:** The docstring mentions "this would imply there are infinitely many Fermat primes" but this implication is not formalized as a separate statement. It would be a natural companion theorem: if every Sierpinski number has a finite covering set, then there are infinitely many Fermat primes. + +3. **Smallest Sierpinski number:** The website mentions 78557 (discovered by Selfridge) is conjectured to be the smallest Sierpinski number. This could be a separate statement. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The definitions `IsSierpinskiNumber` and `HasFiniteCoveringSet` are clearly named and well-documented with docstrings. +- The namespace `Erdos1113` keeps definitions scoped appropriately. +- The module docstring provides good context including the motivating question and key references. +- Minor: The docstring for `HasFiniteCoveringSet` says "A finite set of primes P is a covering set **for m**" — this phrasing is slightly ambiguous since the covering set really covers the family `{2^k * m + 1 : k ∈ ℕ}` rather than m itself. This is standard terminology though. + +**Overall: Good readability, no significant issues.** + +## 5. Formalizability + +The problem is **well-suited for formalization**. The question is a clean yes/no existence question with precise mathematical definitions. There is essentially **no ambiguity**: + +- "Sierpinski number" has a standard definition (positive odd m with all 2^k·m+1 composite). +- "Finite covering set of primes" is precisely defined. +- The question asks for the existence of a Sierpinski number lacking such a covering set. + +The only minor source of ambiguity is whether k ranges over k >= 0 or k >= 1 in the Sierpinski definition. The classical definition (per Sierpinski's original and most sources like Wikipedia) uses k >= 1 (i.e., positive integers n in k·2^n + 1). The website states k >= 0. The formalization uses `∀ k : ℕ` which includes k = 0, matching the website. See the Correctness section for further discussion. + +**Assessment: Unambiguous and clearly formalizable.** + +## 6. Correctness + +### `IsSierpinskiNumber` definition +- `0 < m` — correct, Sierpinski numbers are positive. ✓ +- `¬ 2 ∣ m` — correct, Sierpinski numbers are odd. ✓ +- `∀ k : ℕ, ¬ Nat.Prime (2 ^ k * m + 1)` — this includes k = 0, requiring m + 1 to be composite. The standard definition typically uses k >= 1. However, the website explicitly says k >= 0, and in practice this makes no difference for known candidates (e.g., 78557 + 1 = 78558 = 2 × 3 × 13097, composite). The formalization matches the website statement. + +**Minor note:** The k = 0 inclusion is strictly stronger than the classical definition. If one wanted to align with the more common k >= 1 convention, the quantifier would be `∀ k : ℕ, ¬ Nat.Prime (2 ^ (k + 1) * m + 1)`. This does not affect correctness relative to the website source. + +### `HasFiniteCoveringSet` definition +- Requires all elements of P to be prime. ✓ +- For every k, some p in P divides 2^k * m + 1. ✓ +- The empty set vacuously fails the second condition (no p exists in ∅), so `HasFiniteCoveringSet m ∅` is always false. This is correct behavior. ✓ + +### Main theorem statement +- `answer(sorry) ↔ ∃ m, IsSierpinskiNumber m ∧ ∀ P : Finset ℕ, ¬ HasFiniteCoveringSet m P` +- The `answer(sorry)` pattern correctly encodes the unknown yes/no answer. ✓ +- The RHS correctly states: there exists a Sierpinski number with no finite covering set. ✓ +- The existential quantification is over `ℕ` (not `ℤ`), which is fine since Sierpinski numbers are positive odd integers. ✓ + +### Attributes +- `category research open` — matches the website (problem is open). ✓ +- `AMS 11` — Number Theory classification, appropriate. ✓ + +**Overall correctness assessment: The formalization is mathematically correct and faithfully captures the problem as stated on the website. No flaws identified.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | Minor opportunity | `IsSierpinskiNumber` could be shared with Problem 203 | +| Citations | Good | Missing [Gu04] reference and Izotov attribution | +| Variants | Incomplete | FFK08 conjecture (perfect power or covering set) not formalized | +| Readability | Good | Clean, well-documented code | +| Formalizability | Excellent | Unambiguous, precisely stated | +| Correctness | Correct | Matches website; k>=0 convention noted | diff --git a/ai-review/1114.md b/ai-review/1114.md new file mode 100644 index 0000000000..45ea5c602a --- /dev/null +++ b/ai-review/1114.md @@ -0,0 +1,66 @@ +# AI Review: Erdős Problem 1114 + +## 1. Code Reuse + +No significant reuse opportunities identified. The `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` file defines `Set.IsAPOfLengthWith` for arithmetic progressions as sets, but it is not a natural fit here—the formalization constructs AP roots directly via `a + ↑i * d` inside a `Finset.range` product, which is simpler and more appropriate for this polynomial context. The formalization already uses standard Mathlib APIs (`Polynomial.X`, `Polynomial.C`, `Polynomial.derivative`, `Polynomial.IsRoot`, `Finset.prod`, `Finset.range`), which is the right approach. + +## 2. Citations + +The docstring currently reads: + +> [Ba60b] Balint, proved the conjecture on monotonicity of gaps between consecutive zeros of the derivative of a polynomial with roots in arithmetic progression. + +This is incomplete compared to the website. The website states: + +- "was proved by Balint [Ba60b]" +- "Generalizations were provided by Lorch [Lo76]." +- "Balint gives no source for the conjecture - presumably it was from Erdős in personal communication." + +**Issues:** +- The citation `[Ba60b]` is given as shorthand without a full bibliographic reference (author first name, title, journal, year). The website itself does not expand the reference further, so this may be the best available. +- The generalization by Lorch `[Lo76]` is not mentioned. While not required, noting it would improve completeness. +- The note about the conjecture's provenance (personal communication from Erdős) is missing. + +## 3. Variants + +The website mentions generalizations by Lorch [Lo76] but does not specify what those generalizations are. The formalization captures the core problem as stated on the website. No additional variants appear to be missing from the website's description. + +One could consider a stronger formulation that also explicitly states the **symmetry** of the zeros of f' about the center of the root configuration (i.e., `b(n-1-k) + b(k) = 2*(a + n*d/2)` for all k), but this is a known consequence of the setup rather than part of the conjecture itself. The current approach of stating only the right-half monotonicity and invoking symmetry in the docstring is a reasonable design choice. + +## 4. Readability + +The code is well-structured and readable. The docstring provides clear mathematical context including the role of Rolle's theorem and the symmetry argument justifying the right-half-only statement. Minor suggestions: + +- The docstring uses "$b_0 < b_1 < \cdots < b_{n-1}$" with $n$ zeros, which matches the formalization's `j < n` bound. This is consistent and clear. +- The `let f := ...` binding in the theorem statement is clean and makes the polynomial definition easy to read. +- The existential structure `∃ b : ℕ → ℝ` with four conjuncts (strict monotonicity, all are roots of f', all roots of f' are captured, and the gap monotonicity) clearly separates the setup from the conclusion. + +## 5. Formalizability + +**Assessment: High.** The problem is precisely stated and the formalization captures it faithfully. The objects involved (polynomials over ℝ, their derivatives, roots, ordering of real numbers) are all well-supported in Mathlib. The key mathematical ingredients needed for a proof are: + +- That `f` as defined has degree `n + 1` and `n + 1` distinct roots. +- Rolle's theorem (available in Mathlib) to establish exactly `n` roots of `f'` in the intervals between consecutive roots of `f`. +- The symmetry of the configuration under reflection about the midpoint. +- The actual monotonicity inequality, which is the substantive content proved by Balint. + +There is no ambiguity in the problem statement. + +## 6. Correctness + +**Assessment: Correct, with minor observations.** + +**Degree/root count convention:** The website says "polynomial of degree $n$ whose roots $\{a_0 < \cdots < a_n\}$" — this is internally inconsistent (a degree-$n$ polynomial has at most $n$ roots, but $n+1$ are listed). The formalization resolves this by defining the polynomial as a product of $n+1$ linear factors (degree $n+1$) with parameter `n : ℕ` satisfying `2 ≤ n`, and the derivative then has degree `n` with `n` zeros. This is internally consistent and mathematically correct. The parameter `n` in the formalization corresponds to the degree of $f'$, not of $f$. + +**Index arithmetic verification:** +- For `n = 2`: `f` has degree 3, `f'` has 2 zeros. `(n-1)/2 = 0`. The condition `0 ≤ i < j` with `j + 1 < 2` requires `j = 0`, `i < 0` — vacuously true. Correct (only one gap, nothing to compare). +- For `n = 3`: `f` has degree 4, `f'` has 3 zeros, 2 gaps. `(n-1)/2 = 1`. Need `i ≥ 1`, `i < j`, `j ≤ 1` — vacuously true. Correct (by symmetry both gaps are equal). +- For `n = 4`: `f` has degree 5, `f'` has 4 zeros, 3 gaps. `(n-1)/2 = 1`. Possible: `(i,j) = (1,2)`, giving `b₃ - b₂ ≥ b₂ - b₁`. Correct (center gap ≤ outer gap). +- For `n = 5`: `(n-1)/2 = 2`. Possible: `(i,j) = (2,3)`, giving `b₄ - b₃ ≥ b₃ - b₂`. Correct. +- For `n = 6`: `(n-1)/2 = 2`. Possible: `(2,3)`, `(2,4)`, `(3,4)`, giving the chain `b₃ - b₂ ≤ b₄ - b₃ ≤ b₅ - b₄`. Correct. + +The formalization correctly captures that gaps are non-decreasing from the midpoint outward on the right half. Combined with the symmetry noted in the docstring (which is a provable fact about this configuration, not an assumption), this is equivalent to the full problem statement. + +**Existential quantification of roots:** The formalization asserts *existence* of the zeros `b` satisfying the properties, rather than stating properties of *the* zeros. This is the standard approach in Lean for working with objects whose uniqueness is not the focus. The conjunction of strict monotonicity + "all are roots" + "all roots are captured" pins down `b` uniquely, so no information is lost. + +**Overall:** The formalization is mathematically correct, complete, and faithful to the problem as described on erdosproblems.com. No flaws identified. diff --git a/ai-review/1115.md b/ai-review/1115.md new file mode 100644 index 0000000000..575d8da215 --- /dev/null +++ b/ai-review/1115.md @@ -0,0 +1,71 @@ +# Review: Erdős Problem 1115 + +## 1. Code Reuse + +No reusable code exists in `FormalConjecturesForMathlib/`. The problem is in complex analysis (entire functions, asymptotic curves, arc-length parameterization), while the shared library is focused on combinatorics, number theory, and graph theory. The formalization appropriately uses Mathlib primitives: `Differentiable`, `eVariationOn`, `ENNReal.ofReal`, `MeasureTheory.volume`, and `Filter.Tendsto`. + +The custom definitions (`IsEntire`, `HasFiniteOrder`, `ArcLengthPath`, etc.) are specific to this problem and would not benefit from abstraction into the shared library. + +## 2. Citations + +**Missing citations.** The website attributes the problem originally to Hayman (1960), listed as Problem 2.41 in Hayman's 1974 book. The formalization only cites `[GoEr79]` (Gol'dberg and Eremenko, 1979). The following references from the website are absent: + +- **[Ha60]**: Hayman, W. K. (1960) — original source of the problem. +- **[Ha60b]**: Hayman, W. K. — contains the positive result that if `log M(r) ≪ (log r)²` then a path with `ℓ(r) = r` exists. +- **[Ha74]**: Hayman, W. K. (1974) — book where this appears as Problem 2.41. + +The existing citation `[GoEr79]` is correctly attributed: *Gol'dberg, A. A. and Eremenko, A. È., Asymptotic curves of entire functions, 1979.* However, full journal information is not provided in the docstring; the website may have additional bibliographic details. + +## 3. Variants + +**Partially captured.** The website describes multiple aspects of this problem: + +1. Finding a path minimizing the growth rate of `ℓ(r)` (general question — not formalized). +2. Estimating `ℓ(r)` using `M(r) = max_{|z|=r} |f(z)|` (not formalized). +3. Whether a path always exists with `ℓ(r) ≪ r` (formalized — the disproved conjecture). +4. Hayman's positive result [Ha60b]: if `log M(r) ≪ (log r)²` then a path exists with `ℓ(r) = r` (not formalized). + +The formalization captures only aspect (3). Hayman's positive result (4) is a natural complementary statement that could be formalized as an additional theorem. + +## 4. Readability + +The code is well-structured and readable: + +- The `Erdos1115` namespace cleanly scopes all definitions. +- Each definition has a clear docstring explaining its mathematical meaning. +- The `ArcLengthPath` structure cleanly bundles continuity, the tendency to infinity, and the arc-length condition. +- The main theorem docstring includes both the informal problem statement and a concise formal restatement. + +**Minor suggestions:** +- The docstring for `pathLengthInDisk` refers to "$\{t \geq 0 : |\gamma(t)| \leq r\}$" but the implementation uses `{t : ℝ | 0 ≤ t ∧ ‖γ.toFun t‖ ≤ r}`, which correctly matches. +- The comment "in the disc $|z| < r$" in the problem statement uses the open disk, while `pathLengthInDisk` uses the closed condition `‖γ.toFun t‖ ≤ r`. See Correctness below. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem as stated on the website is precise enough to formalize. The key concepts — entire function, finite order, rectifiable path, path length in a disk, and `ℓ(r) ≪ r` (i.e., `ℓ(r) = O(r)`) — all have standard mathematical definitions. + +The main design choice is the representation of "rectifiable path to infinity." The formalization uses an arc-length parameterized path (a continuous function `ℝ → ℂ` with `eVariationOn` equal to the parameter length), which is a clean and canonical choice. Any rectifiable path can be reparameterized by arc length, so this loses no generality. + +One minor source of ambiguity: the original problem says "let Γ be a rectifiable path on which f(z) → ∞," which presupposes the existence of such a path. The formalization instead asks for the existence of a path satisfying both `f → ∞` and `ℓ(r) = O(r)` simultaneously, which correctly captures the intended question. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsEntire`**: `Differentiable ℂ f` correctly captures holomorphicity on all of `ℂ`. + +- **`HasFiniteOrder`**: States `∃ ρ ≥ 0, ∃ C R, 0 < R ∧ ∀ z, R ≤ ‖z‖ → ‖f z‖ ≤ exp(C · ‖z‖^ρ)`. This is equivalent to the standard definition (order = lim sup of log log M(r) / log r being finite). Note that `C` is not required to be positive; if `C ≤ 0`, the bound forces `f` to be bounded and hence constant by Liouville's theorem. Since constant functions have finite order (order 0), this is harmless — the definition correctly classifies all functions. + +- **`ArcLengthPath`**: The structure correctly captures a continuous path parameterized by arc length going to infinity. The `isArcLength` field `eVariationOn toFun (Icc 0 T) = ENNReal.ofReal T` is the standard characterization of arc-length parameterization. + +- **`pathLengthInDisk`**: For an arc-length parameterized path, the Lebesgue measure of `{t ≥ 0 : ‖γ(t)‖ ≤ r}` equals the total arc length of the path inside the closed disk of radius `r`. This is correct. + +- **Open vs. closed disk**: The problem statement says "in the disc |z| < r" (open), but the formalization uses `‖γ.toFun t‖ ≤ r` (closed). For the asymptotic question `ℓ(r) = O(r)`, this is immaterial — the boundary circle contributes at most measure zero to the path length (a continuous path can intersect the circle `|z| = r` on a set of parameters of measure zero for all but countably many `r`). **Not a correctness issue** for the `O(r)` statement. + +- **Main theorem**: `answer(False) ↔ ∀ f, IsEntire f → HasFiniteOrder f → ∃ γ, TendsToInfinityAlong f γ ∧ ∃ C R, ∀ r, R ≤ r → pathLengthInDisk γ r ≤ C * r`. The RHS is exactly the conjecture "for every entire function of finite order, there exists a path to infinity on which f → ∞ and ℓ(r) = O(r)." The `answer(False)` correctly records that this was disproved by Gol'dberg and Eremenko. **Correct.** + +**No mathematical flaws identified.** The formalization faithfully captures the disproved conjecture. diff --git a/ai-review/1116.md b/ai-review/1116.md new file mode 100644 index 0000000000..76b05046dd --- /dev/null +++ b/ai-review/1116.md @@ -0,0 +1,85 @@ +# AI Review — Erdős Problem 1116 + +## 1. Code Reuse + +The `rootCount` function defined at line 40 is unique to this file: + +```lean +noncomputable def rootCount (f : ℂ → ℂ) (r : ℝ) (a : ℂ) : ℕ := + Set.ncard {z : ℂ | f z = a ∧ ‖z‖ < r} +``` + +No equivalent exists elsewhere in the codebase or in `FormalConjecturesForMathlib`. The nearby problems 1117 and 1118 define their own local helper functions (`nu`, `maxModulus`, `exceedanceSet`) in separate namespaces. Notably, `maxModulus` is defined identically in both 1117.lean and 1118.lean — a shared utility could serve all three files, but `rootCount` itself has no duplication issue. + +No existing Mathlib or `FormalConjecturesForMathlib` utility covers root-counting for entire functions in disks. **No reuse opportunity identified.** + +## 2. Citations + +The website (erdosproblems.com/1116) lists three references: +- **[Ha74]** — Hayman, W. K., *Research Problems in Function Theory* (Problem 1.25), where the problem is attributed to Erdős. +- **[Go78]** — Gol'dberg, A. A., *On the deficiencies of meromorphic functions* (1978). +- **[To76]** — Toppila, S., *On Nevanlinna's second theorem and deficient values* (1976). + +The formalization includes [Go78] and [To76] but **omits [Ha74]**, which is the primary source attributing the problem to Erdős. This reference should be added to the docstring for completeness. + +## 3. Variants + +The original problem asks: + +> Does there exist a **meromorphic (or entire)** function f such that... + +The formalization restricts to **entire functions** only (`Differentiable ℂ f`). Since the problem was solved affirmatively by constructing entire functions, and entire ⊂ meromorphic, this is sufficient for the positive existential. However: + +- A **meromorphic variant** is not separately formalized. One could also state the result for meromorphic functions (which would require a different formalization approach, since Lean/Mathlib lacks a native meromorphic function type operating on ℂ → ℂ). +- The original problem arguably has two sub-questions (meromorphic case and entire case). The formalization captures the stronger (entire) case, which subsumes the meromorphic one for a positive answer. **This is acceptable.** + +No other variants appear on the website. + +## 4. Readability + +The code is well-structured and readable: + +- The `rootCount` helper is clearly documented with a docstring explaining the mathematical notation. +- The main theorem docstring explains the limsup = ∞ encoding ("expressed multiplicatively"). +- The namespace `Erdos1116` prevents name collisions. + +**Minor suggestions:** +- The docstring for `rootCount` could note that for non-constant entire functions, this set is always finite (justifying the use of `Set.ncard`). +- The references in the module docstring use shorthand (`[Go78]`, `[To76]`) — these are expanded below but could include full titles inline for quick reference. + +Overall: **good readability.** + +## 5. Formalizability + +The problem statement is reasonably precise but has one notable ambiguity: + +**Root multiplicity.** The phrase "count the number of roots of f(z) = a" is ambiguous between counting with and without multiplicity. In standard Nevanlinna theory, the counting function n(r, a) counts roots **with multiplicity**. The formalization uses `Set.ncard` which counts **distinct roots** (without multiplicity). + +These two conventions yield genuinely different conditions — neither implies the other for the ratio limsup. However: +- The problem as posed by Erdős (via Hayman) does not explicitly specify. +- The constructed solutions by Gol'dberg and Toppila likely satisfy both conventions. +- The ambiguity is inherent in the source problem, not introduced by the formalization. + +**Assessment: moderately formalizable.** The core logical structure (existential, limsup = ∞ as a multiplicative condition) is clean and well-suited to formalization. The multiplicity ambiguity is a minor concern. + +## 6. Correctness + +### What is correct + +- **`answer(True)`** is appropriate: the problem asks an existence question answered affirmatively. +- **The limsup encoding** is mathematically correct. The condition `∀ M R, ∃ r > R, M * n(r,b) < n(r,a)` is exactly the standard ε-δ characterization of lim sup_{r→∞} n(r,a)/n(r,b) = +∞, extended to handle the case n(r,b) = 0 gracefully (requiring n(r,a) > 0 when n(r,b) = 0, which is the correct convention for 0/0-type ratios in this context). +- **`Differentiable ℂ f`** correctly encodes "entire function" (holomorphic on all of ℂ). +- **Open disk** `‖z‖ < r` matches the standard n(r, a) convention. +- **`Set.ncard`** returns 0 for infinite sets. For a non-constant entire function in a bounded disk, the preimage of any value is discrete and hence finite, so `ncard` agrees with actual cardinality. (For a constant function, the formalization would give rootCount = 0 for the constant value due to the infinite preimage, but constant functions cannot satisfy the existential anyway.) + +### Potential concerns + +1. **Multiplicity (moderate concern).** As noted above, the formalization counts distinct roots rather than roots with multiplicity. This is a defensible choice given the ambiguity in the source, but differs from the standard Nevanlinna-theoretic convention. If the intent is to match the Nevanlinna n(r,a), multiplicity should be incorporated (e.g., by summing the orders of the zeros of f(z) − a). + +2. **Picard exceptional values (not a flaw, but worth noting).** The universal quantifier `∀ a b, a ≠ b → ...` requires the limsup condition for ALL pairs, including any Picard exceptional value. By the Great Picard Theorem, a non-constant entire function omits at most one value. If a is the omitted value, then rootCount(f, r, a) = 0 for all r, and the condition `M * rootCount(f, r, b) < 0` fails for M > 0. So the existential implicitly requires f to be **surjective** (taking every complex value). This is consistent with the solutions — the constructed entire functions take every value — but is a non-trivial implicit requirement that could be documented. + +3. **M unrestricted over ℝ (not a flaw).** The quantifier `∀ M : ℝ` includes negative M, for which the condition is trivially satisfied. The mathematically meaningful content is only for M > 0. This is standard practice and not incorrect, just slightly loose. + +### Verdict + +**The formalization is essentially correct.** The one substantive question — distinct vs. multiplicity-counted roots — is attributable to ambiguity in the original problem statement rather than a formalization error. The logical encoding of the limsup condition is sound, and the use of `Differentiable ℂ f` for entire functions is standard. No experienced mathematician would identify an outright flaw, though they might raise the multiplicity question as a point of clarification. diff --git a/ai-review/1117.md b/ai-review/1117.md new file mode 100644 index 0000000000..dfe945d4ce --- /dev/null +++ b/ai-review/1117.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 1117 + +## 1. Code Reuse + +The `maxModulus` definition is duplicated verbatim across four files: +- `ErdosProblems/514.lean` (namespace `Erdos514`) +- `ErdosProblems/227.lean` (namespace `Erdos227`) +- `ErdosProblems/1117.lean` (namespace `Erdos1117`) +- `ErdosProblems/1118.lean` (namespace `Erdos1118`) + +All four define: +```lean +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} +``` + +This should be factored into a shared utility (e.g., in `FormalConjecturesForMathlib/Analysis/`). The `IsMonomial` definition in 1117 is unique to this file and does not appear elsewhere, so no reuse issue there. + +Similarly, `Erdos1115` defines `IsEntire` as `Differentiable ℂ f`, which is the same property used inline in 1117. If a shared `IsEntire` predicate were adopted, 1117 could use it for clarity, though this is a minor point. + +No existing code in `FormalConjecturesForMathlib` provides these complex-analysis definitions. + +## 2. Citations + +The website (https://www.erdosproblems.com/1117, last updated 29 December 2025) lists the following: +- The problem is **Problem 2.16** from [Ha74]. This attribution ("Problem 2.16 from [Ha74]") is **not mentioned** in the formalization's docstring — it should be added. +- **[Ha74]**: Hayman, W. K., *Research Problems in Function Theory*, Athlone Press, 1967 (updated 1974). ✅ Matches. +- **[HePi68]**: Herzog, F. and Piranian, G., *Sets of radii of parity for entire functions*, 1968. ✅ Matches. +- **[GlPa24]**: Glücksam, A. and Pardo-Simón, L., *An approximate answer to a question of Erdős*, 2024. ✅ Matches. + +**Recommendation:** Add "This is Problem 2.16 from [Ha74]" to the docstring, as the website attributes it this way. + +## 3. Variants + +The website states two questions: +1. Can $\limsup_{r \to \infty} \nu(r) = \infty$? (Resolved affirmatively by Herzog–Piranian [HePi68]) +2. Can $\liminf_{r \to \infty} \nu(r) = \infty$? (Open) + +The formalization only captures question 2 (the $\liminf$ question). The resolved $\limsup$ question is described in the docstring but **not formalized as a separate theorem or variant**. Since it has a known affirmative answer, it could be formalized as: + +```lean +@[category research solved, AMS 30] +theorem erdos_1117.variants.limsup : + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ ¬IsMonomial f ∧ + ∀ N : ℕ, ∃ r : ℝ, N ≤ nu f r := by + sorry +``` + +This would capture the full scope of the problem as presented on the website. **The $\limsup$ variant is currently missing.** + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstrings are clear and provide good mathematical context. +- The `nu` function docstring says "This is finite when $f$ is entire and not a monomial" — this is a mathematically meaningful remark that aids understanding. +- The use of `‖z‖` (norm) rather than `abs` for a complex number is standard in Mathlib and appropriate. +- The namespace `Erdos1117` is clean and self-contained. + +No readability issues identified. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: it asks a yes/no question about the existence of an entire non-monomial function with a specific asymptotic property. The formalization correctly wraps this in `answer(sorry) ↔ ...` since the answer is unknown. + +One subtlety: the formalization encodes $\liminf_{r \to \infty} \nu(r) = \infty$ as: +```lean +∀ N : ℕ, ∃ R : ℝ, ∀ r : ℝ, R ≤ r → N ≤ nu f r +``` +This is the standard $\varepsilon$-$\delta$ encoding of $\liminf \geq N$ for all $N$, which is equivalent to $\liminf = \infty$. This is correct. + +The definition of `nu` using `Set.ncard` returns 0 for infinite sets, which is mathematically appropriate here: for a non-monomial entire function, the set of maximum-modulus points on any circle is always finite (a well-known result in complex analysis), so `Set.ncard` coincides with the actual cardinality. However, the formalization does not explicitly assert or require this finiteness — it relies on the mathematical fact implicitly. This is acceptable for a conjecture statement but worth noting. + +## 6. Correctness + +**Assessment: Mathematically correct with one notable observation.** + +### Correct aspects: +- **IsMonomial**: Correctly captures monomials $f(z) = cz^n$ for $c \in \mathbb{C}$, $n \in \mathbb{N}$. This includes the zero function (with $c = 0$). The exclusion of monomials is essential because for a monomial, $|f(z)| = |c| \cdot r^n$ is constant on $|z| = r$, so $\nu(r) = \infty$ trivially. +- **maxModulus**: Uses $\mathrm{sSup}$, which in Lean/Mathlib returns $0$ (or more precisely, `⊥` in the conditionally complete lattice) when the set is empty or unbounded. For $r \geq 0$ and a continuous function, the set $\{‖f(z)‖ : ‖z‖ = r\}$ is compact and nonempty (the circle is compact for $r > 0$, and a singleton for $r = 0$), so `sSup` is well-defined. For $r < 0$, the set $\{z : ‖z‖ = r\}$ is empty, so `maxModulus f r = sSup ∅`, which could be problematic — but in the theorem statement, the universal quantifier `∀ r : ℝ, R ≤ r → ...` with a sufficiently large $R$ means only positive $r$ matter in practice. This is fine. +- **nu**: Uses `Set.ncard`, which returns a natural number (0 for infinite or empty sets). As discussed, for non-monomial entire functions this set is always finite for each fixed $r$, so this is correct. +- **Theorem statement**: The logical structure correctly encodes "does there exist an entire non-monomial $f$ such that $\liminf_{r \to \infty} \nu(r) = \infty$?" +- **Differentiable ℂ f**: This is the Mathlib way to express that $f$ is entire (holomorphic on all of $\mathbb{C}$), which is correct. + +### Observation on `IsMonomial` scope: +The definition `IsMonomial` uses $n : \mathbb{N}$, so it only captures monomials with non-negative integer exponents. This is correct for entire functions — an entire monomial must have the form $cz^n$ for $n \in \mathbb{N}$. No issue here. + +### Overall mathematical assessment: +The formalization is **correct and complete** for the $\liminf$ question. The only gap is the missing $\limsup$ variant (see Section 3). An experienced mathematician would not identify any flaws in the existing formalization. diff --git a/ai-review/1118.md b/ai-review/1118.md new file mode 100644 index 0000000000..c5192d79a0 --- /dev/null +++ b/ai-review/1118.md @@ -0,0 +1,81 @@ +# AI Review — Erdős Problem 1118 + +## 1. Code Reuse + +**`maxModulus` is duplicated.** The definition at line 39 of `1118.lean`: + +```lean +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} +``` + +is *identical* to the definition in `ErdosProblems/1117.lean` (line 46). This should be factored into a shared utility (e.g., `FormalConjecturesForMathlib/Analysis/MaxModulus.lean` or similar) and imported by both files. + +**`IsEntire` helper.** Problem 1115 defines `IsEntire (f : ℂ → ℂ) : Prop := Differentiable ℂ f`. Problems 1116–1118 all use the raw `Differentiable ℂ f` instead. Adopting the `IsEntire` wrapper across these nearby problems would improve uniformity and readability, or alternatively, a shared definition could be placed in `FormalConjecturesForMathlib`. + +**`exceedanceSet` is local.** The level-set construction `{z : ℂ | c < ‖f z‖}` is standard enough that it could live in a shared file, though it is only used in 1118 currently. + +## 2. Citations + +**Missing original source.** The website attributes the problem to "Problem 2.40 in Hayman (1974)." The formalization's docstring says "Hayman's conjecture" but does not include the `[Ha74]` reference. Problem 1117 in the same codebase *does* cite: + +> [Ha74] Hayman, W. K., *Research Problems in Function Theory*, Athlone Press, 1967 (updated 1974). + +This reference should be added to the 1118 module docstring for completeness. + +**Camera [Ca77] and Gol'dberg [Go79b] citations are present** and consistent with the website's attribution. The paper titles provided in the formalization (`"A short proof of an extremal result of Hayman"` and `"The set of deficient values of meromorphic functions of finite order"`) go beyond what the website provides (which only lists author/year), which is acceptable but unverifiable from the website alone. + +## 3. Variants + +**Two parts are formalized:** +- `erdos_1118`: The growth-rate integral condition (Hayman's conjecture, proved by Camera/Gol'dberg). +- `erdos_1118.variants.negative_answer`: Existence of an entire function where E(c) is finite but E(c') is infinite for all 0 < c' < c. + +**Missing variant:** The website and docstring mention Gol'dberg's fuller result: the threshold set T = {c > 0 : |E(c)| < ∞} can equal [m, ∞) *or* (m, ∞) for any m > 0 (plus trivial cases T = ∅ and T = (0, ∞)). The formalization only captures the [m, ∞) scenario (where the infimum m is included in T). The (m, ∞) case—where T is open at m—is a separate, stronger structural result that is not formalized. However, note that the (m, ∞) case does *not* constitute a negative answer to the second question (since for any c ∈ (m, ∞), one can find c' with m < c' < c still in T). So the formalized variant correctly captures what is needed for the negative answer. The full Gol'dberg characterization of T could be an additional variant but is not strictly required. + +## 4. Readability + +**Overall good.** The code is well-structured with clear docstrings and mathematical notation in comments. + +**Minor suggestions:** +- The hypothesis name `hnc` (for "non-constant") is terse. A name like `hf_nconst` or `hne` would be marginally clearer, though this is a minor style preference. +- The non-constant condition `∃ z : ℂ, f z ≠ f 0` is mathematically correct (an entire function equal to f(0) everywhere is constant) but reads somewhat indirectly. The more standard `¬∀ z, f z = f 0` or a dedicated `¬IsConstant f` predicate could be considered, though the current form is equivalent and concise. + +## 5. Formalizability + +**High.** The problem is precisely stated in the mathematical literature. + +- The growth-rate integral ∫₀^∞ r / (log log M(r)) dr < ∞ is an unambiguous analytic condition. +- The exceedance set E(c) = {z : |f(z)| > c} having finite Lebesgue measure is standard. +- The second question ("must there exist c' < c with E(c') finite?") is a clear yes/no question. + +**No significant ambiguity.** The only possible source of ambiguity is what "minimum growth rate" means, but the Hayman conjecture resolves this to the specific integral condition, and the formalization correctly identifies this. + +## 6. Correctness + +**The formalization is mathematically correct and complete for its stated scope.** + +Detailed assessment: + +- **`maxModulus`**: Correctly defined as sSup of ‖f z‖ over the circle ‖z‖ = r. For r > 0 and f entire, the circle is compact and ‖f ·‖ is continuous, so the supremum is attained. For r = 0, it correctly gives ‖f 0‖. For r < 0 the set is empty, but since the integral is over (0, ∞) this is irrelevant. + +- **`exceedanceSet`**: Correctly defined as {z | c < ‖f z‖}, matching E(c) = {z : |f(z)| > c}. + +- **`erdos_1118` (main theorem)**: The hypotheses correctly capture: (1) f is entire (`Differentiable ℂ f`), (2) f is non-constant (`∃ z, f z ≠ f 0`), (3) E(c) has finite Lebesgue measure for some c > 0. The conclusion `IntegrableOn (fun r => r / Real.log (Real.log (maxModulus f r))) (Ioi 0) volume` correctly formalizes the integral condition. A subtlety: for small r, `Real.log (Real.log (maxModulus f r))` may be negative or zero, but Lean's `Real.log` is total (defined on all reals, returning 0 for non-positive inputs) and division by zero yields 0, so the integrand is always well-defined. The `IntegrableOn` condition (Lebesgue integrability) correctly handles these edge cases—the integrand is eventually positive and the finite-interval portion is bounded. + +- **`erdos_1118.variants.negative_answer`**: Correctly existentially quantifies an entire function f and threshold c > 0 such that E(c) has finite measure but E(c') has infinite measure for all 0 < c' < c. This precisely captures the negative answer to the second question. + +- **`volume` usage**: Both statements use `volume` (Lebesgue measure on ℂ ≅ ℝ²), which is correct for measuring subsets of ℂ, and `volume` on ℝ for the integral, which is also correct. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `maxModulus` duplicated from 1117; should be shared | +| Citations | Missing [Ha74] original source reference | +| Variants | Core variants captured; Gol'dberg's full T-characterization omitted but not essential | +| Readability | Good; minor naming suggestions | +| Formalizability | High; unambiguous problem statement | +| Correctness | Correct and complete | diff --git a/ai-review/1119.md b/ai-review/1119.md new file mode 100644 index 0000000000..1e0eeee61b --- /dev/null +++ b/ai-review/1119.md @@ -0,0 +1,61 @@ +# Review: Erdős Problem 1119 + +## 1. Code Reuse + +**No significant reuse opportunities identified.** The formalization is concise and uses standard Mathlib primitives (`Cardinal`, `Differentiable ℂ`, `range`). Several nearby problems (1115–1118) define local helpers like `IsEntire` (which is just `Differentiable ℂ f`), but Problem 1119 correctly inlines this condition rather than introducing an unnecessary definition. No utilities in `FormalConjecturesForMathlib/` provide additional value here. + +The cardinal-related utilities in `FormalConjecturesForMathlib/SetTheory/Cardinal/` (e.g., `mk_diff_eq_left`, `Continuum.lean`) are not needed for this statement-level formalization. + +## 2. Citations + +**[Ha74] citation has a year mismatch.** The short code `[Ha74]` implies a 1974 publication, but the full citation reads: + +> Hajnal, A., *Proof of a conjecture of S. Ruziewicz*, Fund. Math. 50 (1961/62), 123–128. + +This paper is from 1961/62, not 1974. The correct short code would be `[Ha61]` or `[Ha62]`. The paper itself (about families of functions with finite pairwise agreement under CH) is thematically related to Wetzel-type problems, so the reference is topically appropriate, but the year in the citation key is wrong. + +The website at erdosproblems.com/1119 does not explicitly list a "[Ha74]" reference. It attributes the problem to Erdős originally and mentions it appears as "Problem 2.46 in Hales (1974)" — note this is **Hales**, not **Hajnal**. It's possible the formalization conflated Hales (1974) with Hajnal (1961/62). If the intended reference is Hales 1974, the full bibliographic entry needs correction. + +**[KuSh17] and [ScWe24] are correct** and match the website's references: +- Kumar, A. and Shelah, S., *On a question about families of entire functions*, Fund. Math. 239 (2017), 279–288. ✓ +- Schilhan, J. and Weinert, T., *On Wetzel's problem and its relatives*, preprint (2024). ✓ + +## 3. Variants + +**No variants are missing.** The problem as stated on erdosproblems.com is a single question: for all intermediate cardinals 𝔪, does the bounded-values-at-each-point condition imply bounded family size? The formalization captures exactly this universal statement. The partial results (easy case when 𝔪⁺ < 𝔠, independence when 𝔪⁺ = 𝔠) are described in the docstring but do not require separate theorem statements since the problem itself is a single conjecture. + +## 4. Readability + +**Good overall.** The formalization is clean and compact. Minor observations: + +- The use of `Cardinal.mk ↥(range (fun i => f i z))` is slightly verbose. An alternative like `Cardinal.mk (Set.range (f · z))` using dot notation might be marginally cleaner, but this is a matter of taste. +- The docstring is well-written, explains the connection to Wetzel's problem, and summarizes the key results by Kumar–Shelah and Schilhan–Weinert. + +## 5. Formalizability + +**High formalizability; low ambiguity.** The problem statement is precise: +- "Entire function" = holomorphic on all of ℂ = `Differentiable ℂ f`. Unambiguous. +- "At most 𝔪 distinct values at every point" = for each z, the image set has cardinality ≤ 𝔪. Unambiguous. +- "Family has cardinality at most 𝔪" = the range of the indexing has cardinality ≤ 𝔪. Unambiguous. +- The cardinal constraints ℵ₀ < 𝔪 < 𝔠 are standard. + +The only subtlety is that the problem is independent of ZFC, meaning `answer(sorry)` cannot be filled with either `True` or `False` in ZFC. This is correctly handled by leaving `sorry` — the bi-conditional still meaningfully states what the problem is asking. + +**Assessment: Unambiguously formalizable. Score: 5/5.** + +## 6. Correctness + +**The formalization is mathematically correct with one status concern.** + +### Correctness of the formal statement: +- The universal quantification `∀ (𝔪 : Cardinal), ℵ₀ < 𝔪 → 𝔪 < Cardinal.continuum →` correctly restricts to intermediate cardinals. ✓ +- The indexing `∀ (ι : Type) (f : ι → ℂ → ℂ)` correctly parametrizes an arbitrary family. Using `Type` (= `Type 0`) is appropriate since we're comparing with `Cardinal.continuum` which lives at universe 0. ✓ +- `Differentiable ℂ (f i)` correctly captures "entire function." ✓ +- `Cardinal.mk ↥(range (fun i => f i z)) ≤ 𝔪` correctly counts distinct values at z. ✓ +- `Cardinal.mk ↥(range f) ≤ 𝔪` correctly counts distinct functions in the family. ✓ + +### Status concern: +The tag `category research solved` marks this as solved. The website erdosproblems.com/1119 lists it as **OPEN**. The independence result (Kumar–Shelah 2017 for consistency of "yes," Schilhan–Weinert 2024 for consistency of "no") arguably resolves the problem completely — the answer is "independent of ZFC" for the case 𝔪⁺ = 𝔠, and "yes" when 𝔪⁺ < 𝔠. However, the website may consider it open because independence was only shown for specific values of 𝔪 (e.g., 𝔪 = ℵ₁, 𝔠 = ℵ₂), and the full spectrum of cardinals may not be covered. This discrepancy deserves investigation — the `solved` tag may or may not be justified depending on whether the known results fully characterize all cases. + +### Summary +The formalization is correct and complete. The [Ha74] citation needs fixing (year mismatch and possible author confusion with Hales). The `solved` status should be verified against the latest literature. diff --git a/ai-review/112.md b/ai-review/112.md new file mode 100644 index 0000000000..c0d4fb2a24 --- /dev/null +++ b/ai-review/112.md @@ -0,0 +1,129 @@ +# Review: Erdős Problem 112 + +## 1. Code Reuse + +Several related structures exist in the codebase but are not directly reusable: + +- **Problem 902** (`FormalConjectures/ErdosProblems/902.lean`) defines a `Tournament` structure with `beats`, `irrefl`, `complete`, and `antisymm` fields. This is for *complete* directed graphs (tournaments), not general directed graphs, so it cannot replace `Digraph`. However, the `antisymm` field present in `Tournament` but absent from `Digraph` is noteworthy (see Correctness below). +- **Problem 568** (`FormalConjectures/ErdosProblems/568.lean`) defines `ramseyNum` for undirected `SimpleGraph`s, which is structurally analogous but not reusable for directed Ramsey numbers. +- **`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`** defines `hypergraphRamsey` using a similar `sInf` pattern. Not directly applicable. +- The `sInf` + `Fintype.card` pattern for defining extremal quantities is used consistently across Problems 112, 568, 902, 983, and others. Problem 112 follows this convention correctly. + +**Verdict:** No direct code reuse opportunities. The custom `Digraph`, `IsIndepSet`, `IsTransTournament`, and `dirRamseyNum` definitions are appropriate for this problem. However, if `Digraph` gains an antisymmetry field (see §6), it may become worth unifying with `Tournament` from Problem 902 (a `Tournament` would then be a `Digraph` that is additionally complete). + +## 2. Citations + +The formalization references: +- `[ErRa67]` — Erdős, P. and Rado, R., *Partition relations and transitivity domains of binary relations*, J. London Math. Soc. (1967). +- `[LaMi97]` — Larson, J. and Mitchell, W., *On a problem of Erdős and Rado*, Ann. Comb. (1997). + +**Comparison with erdosproblems.com/112:** + +The website lists the same two references. It also mentions: +- **Zach Hunter's observation**: $R(n,m) \leq k(n,m) \leq R(n,m,m)$ (where $R$ is the classical Ramsey number and $R(n,m,m)$ is the 3-color Ramsey number). This is not cited in the formalization. +- **Hunter–Steiner result**: Replacing "transitive tournament" with "directed path" yields the exact solution $k(n,m) = (n-1)(m-1)$. Not cited. + +Since these additional results are mentioned on the website, they could be added as citations if the corresponding variants are formalized (see §3). + +**Verdict:** The two existing citations are properly documented and match the website. No issues with shorthand. + +## 3. Variants + +The formalization includes two variants: +1. **Erdős–Rado upper bound** (`erdos_112.variants.erdos_rado_upper_bound`): ✅ Captured. +2. **Larson–Mitchell bound** (`erdos_112.variants.larson_mitchell`): ✅ Captured. + +**Missing variants from the website:** +1. **Ramsey number sandwich**: $R(n,m) \leq k(n,m) \leq R(n,m,m)$ (Hunter's observation). This connects directed Ramsey numbers to classical ones and could be a useful variant. +2. **Directed path variant** (Hunter–Steiner): Replacing "transitive tournament" with "directed path" gives the exact answer $k(n,m) = (n-1)(m-1)$. This is a natural and fully resolved variant. + +**Verdict:** The two most important bounds are captured. Two additional variants from the website are missing. + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings with LaTeX notation for each definition and theorem. +- Logical ordering: definitions → main theorem → variants. +- Self-contained within the `Erdos112` namespace. +- The `IsTransTournament` definition using a bijection from `Fin S.card` to encode the total ordering is elegant and unambiguous. + +**Minor suggestion:** The docstring for `Digraph` says "an irreflexive binary relation representing directed edges." If antisymmetry is added (see §6), the docstring should be updated to say "an irreflexive, antisymmetric binary relation" (i.e., an oriented graph). + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem asks to "determine $k(n,m)$," which is open. The formalization appropriately uses `answer(sorry)` for the exact value, and tags the main theorem as `category research open`. + +The definitions of independent set and transitive tournament are precise and unambiguous. The directed Ramsey number `dirRamseyNum` is well-defined as an `sInf`. + +One subtlety: the problem as stated on the website says "determine $k(n,m)$" which could mean either finding a closed-form expression or establishing tight asymptotics. The formalization interprets this as finding the exact function, which is the strongest (and most natural) interpretation. + +**Verdict:** The problem is precise enough to formalize. The formalization's interpretation is the standard one. + +## 6. Correctness + +### Critical Issue: Missing Antisymmetry in `Digraph` + +The `Digraph` structure only requires irreflexivity (`loopless`): + +```lean +structure Digraph (V : Type*) where + adj : V → V → Prop + loopless : ∀ v, ¬ adj v v +``` + +It does **not** require antisymmetry (`∀ u v, adj u v → ¬ adj v u`). This means bidirectional edges are permitted: one can have both `adj u v` and `adj v u` for `u ≠ v`. + +**This causes `dirRamseyNum n m = 0` for all `n ≥ 2`, `m ≥ 2`**, making the formalization mathematically vacuous. Here is why: + +Consider the "complete bidirectional digraph" on any vertex set $V$: define `adj u v := (u ≠ v)`. This satisfies `loopless`. For this graph: +- **No independent set of size ≥ 2 exists**: For any distinct $u, v \in S$, we have `adj u v`, so `IsIndepSet` fails. +- **No transitive tournament of size ≥ 2 exists**: `IsTransTournament` requires `adj (f i) (f j) ↔ i < j`. For $i < j$, this gives `adj (f i) (f j)` (true) and `adj (f j) (f i) ↔ j < i` (i.e., True ↔ False), a contradiction. + +Since this counterexample graph exists for every finite vertex set, the defining set for `sInf` is **empty**, and `sInf ∅ = 0` in `ℕ`. Thus `dirRamseyNum n m = 0` trivially, and all three theorems become vacuously true or trivially true statements about 0. + +**Fix:** Add antisymmetry to `Digraph`: +```lean +structure Digraph (V : Type*) where + adj : V → V → Prop + loopless : ∀ v, ¬ adj v v + antisymm : ∀ u v, adj u v → ¬ adj v u +``` + +This makes `Digraph` an *oriented graph* (each pair of vertices has at most one directed edge), which is the standard meaning in this problem's context. The bound $k(n,m) \leq R(n,m,m)$ (3-color Ramsey, corresponding to the three options: no edge, forward edge, backward edge) confirms this interpretation. + +### Upper Bound: Natural Number Arithmetic + +The Erdős–Rado upper bound uses natural number division: +```lean +dirRamseyNum n m ≤ (2 ^ (m - 1) * (n - 1) ^ m + n - 2) / (2 * n - 3) +``` + +With the hypotheses `2 ≤ n` and `2 ≤ m`: +- All subtractions are safe (no underflow): `m - 1 ≥ 1`, `n - 1 ≥ 1`, `n - 2 ≥ 0`, `2 * n - 3 ≥ 1`. +- The numerator `2^(m-1) * (n-1)^m + n - 2` is computed as `(2^(m-1) * (n-1)^m + n) - 2`, which is safe since the first term alone is ≥ 2. +- Lean's `ℕ` division is floor division. Since `dirRamseyNum` is a natural number, the floor-division form `k ≤ ⌊a/b⌋` is correct and is actually the strongest way to state the bound. + +**Verdict on arithmetic:** No issues, assuming the antisymmetry fix is applied and `dirRamseyNum` returns a meaningful value. + +### Transitive Tournament Definition + +The `IsTransTournament` definition correctly encodes that a subset $S$ forms a transitive tournament: the bijection $f : \mathrm{Fin}(|S|) \to S$ with $G.\mathrm{adj}(f(i), f(j)) \leftrightarrow i < j$ ensures: +1. **Completeness** within $S$: every pair has exactly one directed edge. +2. **Transitivity**: the edge relation matches a linear order. +3. **Antisymmetry** within $S$: implicit from the `↔` condition. + +This is mathematically correct. + +### Summary + +| Aspect | Status | +|--------|--------| +| `Digraph` definition | **BUG** — missing antisymmetry makes `dirRamseyNum` trivially 0 | +| `IsIndepSet` definition | ✅ Correct | +| `IsTransTournament` definition | ✅ Correct | +| `dirRamseyNum` definition | ✅ Correct structure, but depends on `Digraph` fix | +| Erdős–Rado upper bound formula | ✅ Correct (pending `Digraph` fix) | +| Larson–Mitchell bound | ✅ Correct (pending `Digraph` fix) | +| Natural number arithmetic | ✅ No overflow/underflow issues | diff --git a/ai-review/1120.md b/ai-review/1120.md new file mode 100644 index 0000000000..c1a959f0f4 --- /dev/null +++ b/ai-review/1120.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 1120 + +## 1. Code Reuse + +Several related Erdős problems deal with lemniscate (sublevel) sets of polynomials over ℂ: + +- **Problem 1044** (`ErdosProblems/1044.lean`) defines `lemniscateSublevel` with strict inequality (`‖f z‖ < 1`). +- **Problems 1046, 1047, 1048** use inline set-builder notation for the same kind of sublevel/level sets. +- **Problem 1120** defines `lemniscateSet` with non-strict inequality (`‖f.eval z‖ ≤ 1`). + +The strict vs. non-strict distinction is mathematically meaningful (they define different sets), so 1044's `lemniscateSublevel` cannot directly replace 1120's `lemniscateSet`. However, there is an opportunity to consolidate these into a shared utility (e.g., a parameterized lemniscate set definition) in `FormalConjecturesForMathlib`, given the cluster of ~5 problems involving lemniscate sets of polynomials (1044, 1046, 1047, 1048, 1120). At minimum, the naming convention could be made consistent: 1120 uses `f : Polynomial ℂ` with `f.eval z`, while 1044 uses `f : ℂ → ℂ` with `f z`. This is a minor style inconsistency. + +No other definitions from `FormalConjecturesForMathlib` (e.g., `sumRep`, `sumConv`, `IsAddComplete`) are relevant to this problem. + +## 2. Citations + +**Formalization cites:** +- `[Ha74]` — Hayman, W. K., *Research Problems in Function Theory*, Athlone Press, 1974. + +**Website (erdosproblems.com/1120) states:** +- Problem 4.22 in [Ha74], attributed to Erdős. +- Clunie and Netanyahu showed (personal communication per [Ha74]) that such a path always exists. +- Related to Problem 1041. + +**Assessment:** The citation `[Ha74]` is correct and complete. The docstring correctly identifies this as Problem 4.22 from [Ha74]. The mention of Clunie and Netanyahu in the docstring is consistent with the website. The related problem 1041 (about paths of length < 2 connecting roots within lemniscate sets) is not mentioned in the formalization but would be a useful cross-reference to add in the module docstring. + +## 3. Variants + +The problem as stated on erdosproblems.com is a single conjecture: that the worst-case shortest path length tends to infinity with the degree n. The formalization captures this single variant. + +One subtlety: Erdős wrote "presumably this tends to infinity with n, **but not too fast**." A stronger variant could formalize a conjectured upper bound on the growth rate (e.g., the worst-case path length grows subexponentially, polynomially, or logarithmically in n). The current formalization does not capture this quantitative aspect—it only asserts divergence to infinity. This is a reasonable choice since no specific growth rate was conjectured, but it could be noted. + +The related Problem 1041 (paths connecting roots) is a distinct problem and does not constitute a "variant" of 1120. + +## 4. Readability + +The formalization is quite readable. Specific notes: + +- The `lemniscateSet` definition is clean and self-documenting. +- The docstring provides helpful mathematical context (trivial lower bound, Clunie–Netanyahu existence result). +- The formal statement is well-structured with clear quantifier ordering. +- **Minor suggestion:** The path `γ : ℝ → ℂ` could benefit from a brief comment noting that only the restriction to `[0,1]` is relevant (the domain is all of ℝ for technical Lean reasons, but the lemniscate-set membership constraint is only imposed on `Icc 0 1`). + +## 5. Formalizability + +**Assessment: High.** The problem is stated precisely enough to be unambiguously formalizable. + +The key concepts are all well-defined: +- Monic polynomial of degree n with roots in the closed unit disk. +- The lemniscate set E = {z : |f(z)| ≤ 1}. +- Continuous path from the origin to the unit circle staying within E. +- Arc length (captured via `eVariationOn`). +- The worst-case shortest path length tending to infinity. + +The only mild ambiguity is the phrase "tends to infinity with n," which could mean the infimum over paths (for the worst-case polynomial) diverges. The formalization resolves this correctly: for every C > 0, there exists N such that for all n ≥ N, some polynomial of degree n forces every path in E from 0 to the unit circle to have arc length ≥ C. + +**Ambiguity level: Very low.** The mathematical content is fully determined by the informal statement. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization faithfully captures the conjecture. Detailed verification: + +1. **Quantifier structure:** `∀ C > 0, ∃ N, ∀ n ≥ N, ∃ f, ...` correctly encodes "the worst-case shortest path length → ∞." This is equivalent to: defining W(n) = sup_f inf_γ length(γ), the conjecture is W(n) → ∞. + +2. **Polynomial conditions:** `f.Monic ∧ f.natDegree = n ∧ (∀ z ∈ f.roots, ‖z‖ ≤ 1)` is correct. Since ℂ is algebraically closed, `Polynomial.roots` for a nonzero polynomial over ℂ gives the full multiset of roots (with multiplicity). The monic condition ensures the polynomial is nonzero, so this correctly constrains all roots to the closed unit disk. + +3. **Path conditions:** The path γ is required to be continuous (on all of ℝ), map `[0,1]` into the lemniscate set, start at the origin (γ 0 = 0), and end on the unit circle (‖γ 1‖ = 1). The endpoint γ 1 must also lie in the lemniscate set (since 1 ∈ Icc 0 1), which is a natural and correct requirement. + +4. **Arc length:** `eVariationOn γ (Icc 0 1)` computes the total variation of γ on [0,1], which equals the arc length for rectifiable paths and is ∞ for non-rectifiable paths. The comparison `ENNReal.ofReal C ≤ eVariationOn γ (Icc 0 1)` correctly expresses "arc length ≥ C" in the extended nonneg reals. + +5. **Edge case (n = 0):** A monic degree-0 polynomial is the constant 1. The lemniscate set is all of ℂ, so the shortest path has length 1. The conjecture only requires the bound for n ≥ N, so this edge case is harmlessly handled. + +**No mathematical flaws identified.** The formalization is a faithful and complete translation of the conjecture. diff --git a/ai-review/1121.md b/ai-review/1121.md new file mode 100644 index 0000000000..4786861dda --- /dev/null +++ b/ai-review/1121.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 1121 + +## 1. Code Reuse + +**`BoundedDiscCover` (509.lean:38–44):** The codebase contains a `BoundedDiscCover` structure for covering sets by indexed families of closed discs with bounded total radius. However, Problem 1121 concerns covering by a *single* circle, so the current direct formulation (`∃ p, ∀ i, dist (center i) p + radius i ≤ ∑ j, radius j`) is simpler and more appropriate than instantiating `BoundedDiscCover` with a singleton index type. No code reuse opportunity here. + +**`EuclideanSpace ℝ (Fin 2)` patterns:** Several other problems (506, 507, 654, 655) use the same `EuclideanSpace ℝ (Fin 2)` type. The `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean` could be used for brevity but is not necessary. No significant reuse opportunity. + +**Inner product patterns:** Problem 504 and others use `@inner ℝ _ _` in the same explicit style. This is a consistent codebase convention. + +**Verdict:** No significant code reuse opportunities. The formalization is self-contained and appropriately so. + +## 2. Citations + +**Website ([erdosproblems.com/1121](https://www.erdosproblems.com/1121)):** Lists the problem as **proved**, referencing [GoGo45]. The website notes the result generalizes to higher dimensions. + +**Formalization citation:** +> [GoGo45] Goodman, A. W. and Goodman, R. E., *A circle covering theorem*, American Mathematical Monthly 52 (1945), 494-498. + +This is a full bibliographic citation consistent with the website's reference tag [GoGo45]. The formalization correctly attributes the proof to Goodman and Goodman. **Citation is accurate and complete.** + +## 3. Variants + +The website notes that the Goodman–Goodman proof **generalizes to higher dimensions** (replacing circles with balls, lines with hyperplanes). The current formalization is restricted to `Fin 2` (ℝ²). This is faithful to Erdős's original statement about circles in the plane, but the higher-dimensional generalization is a natural variant that is **not captured**. + +A generalized version could parameterize over `Fin d` for arbitrary dimension `d`, with the same inner product / hyperplane separation formulation. The current code would generalize with minimal changes (replacing `Fin 2` with `Fin d` and adding `d : ℕ` as a parameter). This is a minor omission since the problem as posed on the website is specifically about the plane. + +## 4. Readability + +**Strengths:** +- The docstring clearly explains the parameterization of lines via unit normals and offsets. +- The mathematical statement is well-documented with both the informal problem and the formal encoding rationale. +- The namespace `Erdos1121` keeps things tidy. + +**Minor suggestions:** +- The use of `@inner ℝ _ _` (with explicit type class arguments) is somewhat verbose. Lean's `⟪·, ·⟫_ℝ` notation (from `open scoped InnerProductSpace` or similar) could improve readability, though the current style is consistent with other problems in the codebase. +- The parenthesization of the final biconditional `(∀ i j, ... ↔ ...)` with a closing `)` at the end of line 57 is correct but the multi-line layout is slightly dense. + +**Overall readability: Good.** The docstring does the heavy lifting in bridging the informal and formal statements. + +## 5. Formalizability + +The problem is **precisely stated and clearly formalizable**. The key concepts—circles with given radii, line separation, covering by a single circle—all have direct formal counterparts: + +- Circles/disks → closed balls in `EuclideanSpace ℝ (Fin 2)` +- Lines → hyperplanes parameterized by unit normal and offset +- Disjointness → `|⟨c_i, v⟩ - d| > r_i` +- Non-separability → all on same side when disjoint +- Covering → `dist(c_i, p) + r_i ≤ Σ r_j` + +There is **no ambiguity** in the problem statement. The phrase "no line disjoint from all circles divides them into two non-empty sets" has a unique formal interpretation. + +**Assessment: Unambiguous, directly formalizable.** + +## 6. Correctness + +### Non-separability condition (hns) +The hypothesis states: for any unit vector `v` and offset `d`, if the line `{x : ⟨x,v⟩ = d}` is disjoint from every closed disk (i.e., `|⟨c_i, v⟩ - d| > r_i` for all `i`), then all centers lie on the same side (`⟨c_i, v⟩ > d ↔ ⟨c_j, v⟩ > d` for all `i, j`). + +This is the correct contrapositive of "no disjoint line separates the circles." When `|⟨c_i, v⟩ - d| > r_i`, the entire disk `B(c_i, r_i)` lies strictly on one side of the line, so checking centers suffices. The biconditional correctly captures "all on the same side." ✓ + +### Positive radii (hr) +The hypothesis `∀ i, 0 < radius i` is natural and ensures the circles are non-degenerate. This is implicit in the informal statement ("circles" rather than "points"). ✓ + +### Covering conclusion +The conclusion `∃ p, ∀ i, dist (center i) p + radius i ≤ ∑ j, radius j` states that there exists a center `p` such that every closed disk `B(c_i, r_i)` is contained in the closed disk `B(p, Σ r_j)`. This follows because for any `x ∈ B(c_i, r_i)`: + + dist(x, p) ≤ dist(x, c_i) + dist(c_i, p) ≤ r_i + dist(c_i, p) ≤ Σ r_j + +This correctly formalizes "can be covered by a circle of radius Σ r_i." ✓ + +### Edge cases +- **n = 0:** Conclusion is vacuously true (no `i : Fin 0`). ✓ +- **n = 1:** Hypothesis is vacuous. Conclusion requires `dist(c_1, p) ≤ 0`, i.e., `p = c_1`. The single circle covers itself. ✓ + +### Potential concern: strict vs. non-strict inequality in disjointness +The formalization uses `|⟨c_i, v⟩ - d| > r_i` (strict inequality) for "disjoint from the line." This means the line does not touch the disk even tangentially. This is the standard notion of disjointness for a closed disk and a line (a closed set and a closed set are disjoint iff they have positive distance). This is correct. ✓ + +**Overall correctness: The formalization is mathematically correct and complete.** No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities; appropriately self-contained | +| Citations | Accurate and complete | +| Variants | Higher-dimensional generalization not captured (minor) | +| Readability | Good; minor verbosity in inner product syntax | +| Formalizability | Unambiguous, directly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/1122.md b/ai-review/1122.md new file mode 100644 index 0000000000..03e3b6a25f --- /dev/null +++ b/ai-review/1122.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 1122 + +## 1. Code Reuse + +**`IsAdditiveArithmeticFunction` from Problem 491.** +Problem 491 (`FormalConjectures/ErdosProblems/491.lean:36-37`) defines: + +```lean +def IsAdditiveArithmeticFunction (f : ℕ → ℝ) : Prop := + ∀ a b : ℕ, Nat.Coprime a b → f (a * b) = f a + f b +``` + +Problem 1122 inlines the identical predicate as `hf_add`. This should be refactored to use the shared definition for consistency and discoverability. + +**`Set.HasDensity` from `FormalConjecturesForMathlib/Data/Set/Density.lean`.** +The density library defines `Set.HasDensity S α A` — the condition that the proportion of elements of `S ∩ A` below `b` tends to `α` as `b → ∞`. The "density zero" hypothesis in Problem 1122 is currently encoded manually via an ε-N argument over `Finset.Icc 1 X`. This could potentially be restated using `Set.HasDensity` with `α = 0` applied to the set `{n : ℕ | f (n + 1) < f n}`. However, the existing density API uses `Set.Iio` (strict upper bound, starting from 0) while the formalization uses `Finset.Icc 1 X` (starting from 1), so some minor adapter work would be needed. Nonetheless, using the library would improve readability and enable reuse of density lemmas (e.g., `hasDensity_zero_of_finite`, monotonicity). + +## 2. Citations + +The formalization includes: +- `[Er46]` Erdős, P., *On the distribution function of additive functions*, Ann. of Math. (2) 47 (1946), 1–20. +- `[Ma22]` Mangerel, A. P., *On additive functions with small increments*, 2022. + +The website (erdosproblems.com/1122, last edited 30 December 2025) lists the same references. The website also explicitly cross-references **Problem 491** as related. This cross-reference is not mentioned in the formalization's docstring — it would be worth adding a note such as "See also Erdős Problem 491 for the stronger hypothesis |f(n+1) − f(n)| < c." + +The website provides a more detailed description of Mangerel's partial result: the conjecture holds if |A ∩ [1,X]| ≪ X/(log X)^{2+c} for some c > 0, with restrictions on the values of g(p). The formalization's docstring says only "Partial progress was made by Mangerel [Ma22]." Adding the quantitative bound would improve documentation fidelity. + +## 3. Variants + +The problem as stated on the website has a single formulation: if A has density zero, must f(n) = c log n? The formalization captures this single variant correctly. + +Two weaker sufficient conditions are mentioned in the docstring (A empty; f(n+1) − f(n) = o(1)) as historical results of Erdős, not as separate conjectures. These are not formalized as separate theorems but could be interesting companion lemmas. This is not a gap — they are known results, not variants of the open problem. + +No other variants appear on the website. + +## 4. Readability + +- **Inline predicate vs. named definition.** Replacing the inline `hf_add` hypothesis with `IsAdditiveArithmeticFunction f` (from Problem 491) would make the statement more self-documenting. +- **Density condition.** The ε-N encoding, while mathematically correct, is verbose. A reader must mentally verify it encodes "density zero." Using `Set.HasDensity {n | f (n+1) < f n} 0` or at least adding a comment like `-- A has natural density zero` would aid readability. +- **Overall structure.** The file is clean and well-organized. The module docstring clearly states the problem, historical context, and references. + +## 5. Formalizability + +The problem is unambiguous and straightforwardly formalizable: +- "Additive function" has a standard definition (f(ab) = f(a) + f(b) for coprime a, b). +- "Natural density zero" is a standard analytic number theory concept. +- The conclusion f(n) = c · log(n) is precise. + +**Ambiguity level: None.** Every term in the statement has a standard, unique mathematical meaning. The formalization is a direct transcription. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +1. **Domain.** The function is f : ℕ → ℝ. In number theory, additive functions are typically on ℕ⁺, but here the conclusion is restricted to n ≥ 1, and the coprimality condition is harmlessly vacuous for edge cases involving 0 (e.g., Nat.Coprime 0 b forces b = 1, yielding f(0) = f(0) + f(1) = f(0) + 0, which is consistent). So using ℕ instead of ℕ⁺ is fine. + +2. **f(1) = 0 is forced.** Since Nat.Coprime 1 1 holds, we get f(1·1) = f(1) + f(1), so f(1) = 0. The conclusion gives f(1) = c · log(1) = 0, which is consistent for any c. + +3. **Density zero condition.** The formalization states: ∀ ε > 0, ∃ N, ∀ X ≥ N, |{n ∈ [1,X] : f(n+1) < f(n)}| ≤ ε · X. This is the standard ε-N definition of the set {n ≥ 1 : f(n+1) < f(n)} having natural density zero. The use of `Finset.Icc 1 X` correctly restricts to n ≥ 1, matching the problem's A = {n ≥ 1 : f(n+1) < f(n)}. + +4. **Conclusion.** The conclusion ∃ c, ∀ n ≥ 1, f(n) = c · Real.log n is exactly what the problem asks. Note this is strict equality, not an asymptotic — this is correct per the problem statement. + +5. **Casting.** `(n : ℝ)` in `Real.log (n : ℝ)` correctly coerces ℕ to ℝ before taking the logarithm. + +6. **Status tag.** `@[category research open, AMS 11]` — correct, the problem is open per the website. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Could use `IsAdditiveArithmeticFunction` from Problem 491 and `Set.HasDensity` from the density library | +| Citations | Correct but could add cross-reference to Problem 491 and Mangerel's quantitative bound | +| Variants | Complete — single variant, correctly captured | +| Readability | Good; could improve with named predicates and density library | +| Formalizability | Unambiguous, directly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/1123.md b/ai-review/1123.md new file mode 100644 index 0000000000..43bd242999 --- /dev/null +++ b/ai-review/1123.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 1123 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** The file defines its own `HasNaturalDensityZero` and `HasLogDensityZero` from scratch, but `FormalConjecturesForMathlib/Data/Set/Density.lean` already provides: + +- `Set.HasDensity (S : Set β) (α : ℝ)` — natural density. `HasNaturalDensityZero A` is equivalent to `Set.HasDensity A 0` (modulo a minor off-by-one in the counting convention: 1123 uses `Finset.range (n+1)` divided by `n+1`, while the library uses `Set.interIio S b` which counts `{x ∈ S | x < b}` divided by `|{x | x < b}|`; these are asymptotically equivalent and define the same density-zero ideal). +- `Set.HasLogDensity (A : Set ℕ) (d : ℝ)` — logarithmic density. `HasLogDensityZero A` is equivalent to `Set.HasLogDensity A 0` (1123 sums `1/k` over `Finset.Icc 1 n` and divides by `Real.log n`; the library sums `k⁻¹` over `k ≤ n with k ∈ A` and divides by `.log n` — the `k = 0` term contributes 0, so these agree). + +Additionally, `HasNaturalDensityZero` is independently redefined in at least 5 other Erdős problem files (16, 31, 122, 673, 955), each with slightly different formulations. Consolidating all of these to use the library definition would improve maintainability. + +The equivalence relation and quotient Boolean algebra constructions are specific to this problem and have no existing library counterpart, so those are appropriately defined locally. + +## 2. Citations + +The docstring cites: +- **[JuKr84]** Just, W. and Krawczyk, A., *On certain Boolean algebras P(ω)/I*, Trans. Amer. Math. Soc. 285 (1984), 411–429. ✅ Matches the website. + +**Missing from the formalization:** +- **[Fa00]** Farah — proved the algebras are *not* isomorphic under OCA + MA. This is a critical counterpart to the CH result and should be cited, especially since it establishes the ZFC independence. +- **[VMR80]** — the problem also appears as Question 48 in this reference (mentioned on the website). +- **[Er81b]** — Erdős discusses a lost proof with Ulam. +- The website notes a **$100 reward** offered by Erdős. +- The problem originates from **Erdős and Ulam** (not just Erdős alone). + +## 3. Variants + +The website states the problem as: **"Prove that B₁ and B₂ are not isomorphic."** This indicates Erdős conjectured non-isomorphism. The formalization frames it as an open yes/no question via `answer(sorry) ↔ Nonempty (...)`, which is appropriate given the ZFC independence discovered later. However, the docstring should note that Erdős originally conjectured non-isomorphism, and that Farah's result (under OCA+MA) confirms this in one set-theoretic universe while Just–Krawczyk's result (under CH) refutes it in another. + +No other mathematical variants of the problem are indicated on the website, so the single theorem statement suffices. + +## 4. Readability + +The code is well-structured and readable: +- Definitions are clearly named and documented with LaTeX docstrings. +- The logical progression (density definitions → equivalence relations → setoids → quotient types → Boolean algebra instances → main theorem) is natural. +- The `open` declarations are appropriate. + +Minor suggestions: +- The `open scoped BigOperators` on line 34 appears unused (the `∑` notation in `HasLogDensityZero` comes from `Finset` not `BigOperators` in current Mathlib). Verify if this is still needed. +- The axiom names `natDensityEquiv_equivalence` and `logDensityEquiv_equivalence` are clear and follow naming conventions. + +## 5. Formalizability + +**Assessment: Highly formalizable with one caveat.** + +The mathematical content — density definitions, equivalence relations, quotient Boolean algebras, and the question of isomorphism — is all precise and standard. The definitions are concrete and unambiguous. + +The main subtlety is the **ZFC independence**: the answer literally depends on which set-theoretic axioms one assumes. The `answer(sorry)` idiom handles this gracefully by leaving the Boolean answer unspecified. However, this means the theorem as stated cannot be proved in Lean (which uses CIC, not ZFC+CH or ZFC+OCA+MA). The formalization is arguably best understood as a formalization of the *question* rather than a provable theorem. + +**Ambiguity level: Low.** The original problem statement ("Prove that B₁ and B₂ are not isomorphic") is mathematically precise. The only ambiguity is "sets of integers" vs "sets of natural numbers" — the standard interpretation (and the one used in all references) is P(ω)/I where ω = ℕ, so the formalization using `Set ℕ` is correct. + +## 6. Correctness + +### Density Definitions +- **`HasNaturalDensityZero`**: Computes `|A ∩ {0,…,n}| / (n+1) → 0`. This is a correct definition of asymptotic density zero. ✅ +- **`HasLogDensityZero`**: Computes `(∑_{k ∈ A, 1 ≤ k ≤ n} 1/k) / log(n) → 0`. This is a correct definition of logarithmic density zero. The restriction to `k ≥ 1` correctly avoids division by zero. ✅ + +### Equivalence Relations +- Defining equivalence via symmetric difference having density zero is the standard construction of P(ω)/I for an ideal I. ✅ +- The axioms asserting these are equivalence relations are mathematically correct (density-zero sets form an ideal, and the symmetric-difference relation modulo any ideal is an equivalence relation). ✅ + +### Boolean Algebra Structure +- The quotient P(ω)/I for an ideal I of subsets of ω is indeed a Boolean algebra, with operations inherited from the power set. The axioms asserting `BooleanAlgebra` instances are correct. ✅ +- However, these are asserted as axioms rather than constructed. While pragmatically reasonable, this means the formalization trusts that the quotient operations are well-defined (i.e., that the density-zero sets actually form an ideal closed under finite union and subsets). This is true but unverified in the formalization. + +### Main Theorem +- **`≃o` (order isomorphism)**: For Boolean algebras, an order isomorphism is equivalent to a Boolean algebra homomorphism (since the lattice operations are determined by the partial order). Using `≃o` rather than a ring/algebra isomorphism is therefore correct and standard. ✅ +- **`Nonempty (...)`**: Wrapping in `Nonempty` correctly expresses "there exists an isomorphism" without choosing a specific one. ✅ +- **`answer(sorry)`**: Appropriate for a ZFC-independent statement. ✅ + +### Minor Issues +- The docstring in the module header says "sets of integers" matching the original problem, but the formalization uses `Set ℕ` (natural numbers, not integers). This is mathematically equivalent (P(ℤ)/I ≅ P(ℕ)/I via any bijection ℤ ≅ ℕ that preserves density structure) and follows the convention in the literature. Not a bug, but worth a clarifying note. +- The docstring for the main theorem should mention Farah's result alongside Just–Krawczyk to explain why the problem is independent of ZFC, rather than only stating the CH direction. + +### Overall Assessment +The formalization is **mathematically correct and complete**. The main theorem accurately captures the Erdős problem. The use of axioms for the equivalence-relation and Boolean-algebra properties is a reasonable pragmatic choice. The primary improvement opportunities are in code reuse (leveraging the existing density library) and citation completeness. diff --git a/ai-review/1124.md b/ai-review/1124.md new file mode 100644 index 0000000000..bb697ec081 --- /dev/null +++ b/ai-review/1124.md @@ -0,0 +1,106 @@ +# AI Review: Erdős Problem 1124 + +## 1. Code Reuse + +**Potential reuse opportunities identified:** + +- **`ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean`:** The file defines `scoped notation "ℝ²" => EuclideanSpace ℝ (Fin 2)`. Problem 1124 repeatedly writes out `EuclideanSpace ℝ (Fin 2)` in the type signatures. Using the `ℝ²` notation would reduce verbosity, though it would require importing the geometry utilities. + +- **`unitSquare` duplication with Problem 106:** Both 1124 and 106 define their own `unitSquare`. However, they use different ambient types (`EuclideanSpace ℝ (Fin 2)` vs `ℝ × ℝ`), so they are not directly interchangeable. A shared definition would require standardizing on one type. Given that 1124 needs `EuclideanSpace` for `Metric.closedBall` and `Isometry`, its type choice is the more natural one. + +- **Isometry pattern from Problem 215:** Problem 215 uses the same `Isometry f ∧ f '' S = T` pattern for congruence. No shared utility exists, but the pattern is consistent across the codebase. + +- **No existing equidecomposability infrastructure:** There is no general-purpose equidecomposition predicate in the codebase or in Mathlib. Each problem defines its partition + congruence conditions inline. A shared `Equidecomposable` predicate could be valuable if more such problems arise. + +**Verdict:** Minor opportunities for notation reuse (`ℝ²`). No critical reuse gaps. + +## 2. Citations + +**Website ([erdosproblems.com/1124](https://www.erdosproblems.com/1124)):** +- Problem source: **[Er81b, p.30]** +- Solution reference: **[La90b]** +- Status: Proved +- Tags: geometry + +**Formalization docstring cites:** +- `[La90b]` with full bibliographic entry: Laczkovich, M., *Equidecomposability and discrepancy; a solution of Tarski's circle-squaring problem*. J. Reine Angew. Math. **404** (1990), 77-117. + +**Issues:** +- The problem source citation **[Er81b]** (Erdős, 1981) is not mentioned in the docstring. The website attributes the problem to [Er81b, p.30]. This should be added for completeness. +- The [La90b] citation is correctly and fully documented. + +## 3. Variants + +**Captured:** +- The basic Tarski circle-squaring problem (equidecomposition with isometries) is captured. + +**Not captured:** + +- **Translations-only variant (Laczkovich's actual result):** The docstring states "Laczkovich proved that this is possible using translations only," but the formal statement only requires isometries, which is strictly weaker. A stronger variant could require `∀ i, ∃ v : EuclideanSpace ℝ (Fin 2), (· + v) '' (pieces_sq i) = pieces_disk i` (i.e., each piece is translated rather than transformed by a general isometry). This would be a more faithful formalization of what Laczkovich actually proved. + +- **Borel measurable variant (Grabowski–Máthé–Pikhurko, 2022):** A subsequent result proved that the decomposition can be done with **Borel measurable** pieces and translations only. This is a significant strengthening. Adding a variant requiring `MeasurableSet (pieces_sq i)` and `MeasurableSet (pieces_disk i)` (with translations) would capture this. + +- **Equidecomposability under different group actions:** The general theory distinguishes equidecomposability under translations, rigid motions, and similarities. Only rigid motions (isometries) are formalized. + +**Verdict:** The most important missing variant is the translations-only formulation, which is what Laczkovich actually proved and what the docstring describes. + +## 4. Readability + +The formalization is quite readable. Minor suggestions: + +- The `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean` could reduce visual clutter. +- The inline partition conditions (union + pairwise disjointness) are clear but somewhat long. This is standard for the codebase and acceptable. +- The docstring is well-written, explaining the problem's history and the formal interpretation. +- The `answer(True)` on the left-hand side clearly signals this is a proved result. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The informal problem statement is: *"Can a square and a circle of the same area be decomposed into a finite number of congruent parts?"* + +**Assessment of ambiguity:** + +- **"Congruent parts":** This is standard mathematical terminology meaning related by a rigid motion (isometry) of the plane. Unambiguous. +- **"Decomposed into a finite number of parts":** This means partitioned into finitely many subsets. The formalization correctly requires exact coverage and pairwise disjointness. Note that no measurability or topological regularity is imposed on the pieces—this is correct, as Laczkovich's original decomposition uses non-measurable sets. +- **"Same area":** The formalization correctly chooses the unit square and disk of radius $1/\sqrt{\pi}$, both having area 1. This is a concrete representative choice; any square and circle of equal area would be equivalent by scaling, but the specific normalization is clean and conventional. +- **"A square and a circle":** Technically, the problem says "a square and a circle." The formalization uses the closed unit square and the closed disk. Using closed sets for both is a natural and standard choice. + +**Ambiguity level: Very low.** The problem is classical, well-studied, and has a universally agreed-upon formal meaning. The formalization faithfully captures this meaning. + +## 6. Correctness + +**Mathematical analysis:** + +1. **Unit square definition** (`{p | ∀ i, 0 ≤ p i ∧ p i ≤ 1}`): Correct. This is the closed unit square $[0,1]^2$ in $\mathbb{R}^2$ using the `EuclideanSpace` representation. + +2. **Disk radius** ($1/\sqrt{\pi}$): Correct. The area of the closed disk of radius $r$ is $\pi r^2 = \pi \cdot (1/\sqrt{\pi})^2 = 1$, matching the unit square's area. + +3. **Partition conditions:** + - `(⋃ i, pieces_sq i) = unitSquare`: Correct, the pieces cover the square exactly. + - `∀ i j, i ≠ j → Disjoint (pieces_sq i) (pieces_sq j)`: Correct pairwise disjointness. + - Same conditions for the disk pieces: Correct. + +4. **Congruence condition** (`∃ f, Isometry f ∧ f '' (pieces_sq i) = pieces_disk i`): This correctly states that each square-piece is mapped onto the corresponding disk-piece by an isometry. This is the standard definition of congruence in $\mathbb{R}^2$. + +5. **Indexing by `Fin n`:** Using the same index type `Fin n` for both `pieces_sq` and `pieces_disk` correctly encodes that there is a bijection between the pieces (corresponding pieces are matched by index). The `n = 0` case is harmlessly excluded since the empty union cannot equal the nonempty unit square. + +6. **`answer(True)`:** Correct. Laczkovich proved this is possible. + +**Potential concern — isometries vs. translations:** +The docstring says Laczkovich proved it "using translations only," but the formal statement allows arbitrary isometries. While the formal statement is **correct** (if it's possible with translations, it's certainly possible with isometries), it is **weaker** than the known result. An experienced mathematician would note this discrepancy between the docstring's claim and the formal statement. This is not an error per se—the formalization is still true—but it formalizes a weaker statement than what was actually proved. + +**Verdict:** The formalization is **mathematically correct and complete** as a formalization of Tarski's original question. The only gap is that it does not capture the full strength of Laczkovich's solution (translations suffice), which the docstring explicitly mentions. This is a minor incompleteness rather than an error. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor: could use `ℝ²` notation | +| Citations | Missing [Er81b, p.30] source reference | +| Variants | Missing translations-only variant (Laczkovich's actual result) | +| Readability | Good | +| Formalizability | Very low ambiguity; cleanly formalizable | +| Correctness | Correct but weaker than the known result (isometries instead of translations) | diff --git a/ai-review/1125.md b/ai-review/1125.md new file mode 100644 index 0000000000..eeb75e1337 --- /dev/null +++ b/ai-review/1125.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 1125 + +## 1. Code Reuse + +No significant reuse opportunities. The formalization is self-contained and uses only standard Mathlib predicates (`Monotone`, `Antitone`). Related problems in the codebase: + +- **Erdős 907** (`907.lean`): Studies `f(x+h) - f(x)` continuity for decomposition into continuous + additive parts. +- **Erdős 908** (`908.lean`): Studies measurability of `f(x+h) - f(x)` (also solved by Laczkovich, 1980). + +These share the "shifted difference" structural pattern but serve different purposes and have different conclusions. No utility definitions or helper lemmas are candidates for reuse here. + +## 2. Citations + +**Website (erdosproblems.com/1125):** +- Kemperman (1969) [Ke69] — proved the result for measurable $f$. +- Erdős (1981) [Er81b, p.31] — source of the problem; Erdős stated "if it were my problem I would offer $500 for it." +- Laczkovich (1984) [La84] — solved the problem in the affirmative. + +**Formalization docstring:** Lists [Ke69], [Er81b], and [La84] with correct descriptions. + +**Discrepancy:** The website notes the page reference `[Er81b, p.31]`; the formalization omits the page number. This is minor. The website also notes Erdős's quote about the $500 bounty, which is omitted from the formalization (acceptable — it's colorful but not mathematically relevant). + +**Attribution nuance:** The docstring says "A problem of Kemperman" while the website describes it as originating with Kemperman but "later attributed to Erdős." The current docstring phrasing is acceptable and consistent with the website's account. + +## 3. Variants + +The website mentions one natural variant that is partially captured: + +- **Measurable case (Kemperman, 1969):** The result holds under the additional assumption that $f$ is measurable. This is not formalized as a separate theorem but is mentioned in the docstring. A variant `erdos_1125_measurable` could be stated, e.g.: + + ```lean + theorem erdos_1125_measurable : + ∀ f : ℝ → ℝ, Measurable f → + (∀ x : ℝ, ∀ h : ℝ, h > 0 → 2 * f x ≤ f (x + h) + f (x + 2 * h)) → + Monotone f ∨ Antitone f + ``` + + However, since the full problem (without measurability) is solved, this variant is logically implied and its omission is reasonable. + +No other variants are indicated on the website. + +## 4. Readability + +The code is clean, concise, and well-structured. The docstring accurately summarizes the problem and its history. No readability issues. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is fully precise: +- The domain and codomain ($\mathbb{R} \to \mathbb{R}$) are explicit. +- The functional inequality $2f(x) \leq f(x+h) + f(x+2h)$ is a concrete algebraic condition. +- The quantifiers ($\forall x \in \mathbb{R}$, $\forall h > 0$) are explicit. +- The conclusion ("must $f$ be monotonic") has a standard mathematical meaning. + +There is zero ambiguity in the statement. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **Hypothesis encoding:** The condition `∀ x : ℝ, ∀ h : ℝ, h > 0 → 2 * f x ≤ f (x + h) + f (x + 2 * h)` faithfully encodes $2f(x) \leq f(x+h) + f(x+2h)$ for all $x \in \mathbb{R}$ and $h > 0$. ✓ + +- **Conclusion encoding:** `Monotone f ∨ Antitone f` correctly captures "must $f$ be monotonic," where monotonic means either non-decreasing or non-increasing in standard usage. ✓ + +- **Mathematical observation (not a flaw):** The `Antitone f` disjunct is vacuous for non-constant functions. If $f$ is antitone and non-constant, there exist $a < b$ with $f(a) > f(b)$. Setting $x = a$, $h = b - a > 0$ gives $2f(a) \leq f(b) + f(2b - a)$. But antitonicity yields $f(2b-a) \leq f(b) < f(a)$, so $f(b) + f(2b-a) < 2f(a)$ — a contradiction. Thus the only antitone solution is a constant function (which is also monotone). A stronger conclusion `Monotone f` would hold, but the formalization as written is correct and faithfully represents the problem as posed. + +- **Tags:** `@[category research solved, AMS 26]` — the problem is indeed solved (Laczkovich, 1984) and AMS 26 (Real functions) is appropriate. ✓ + +**Verdict: Correct and complete. No flaws.** diff --git a/ai-review/1126.md b/ai-review/1126.md new file mode 100644 index 0000000000..6143ca21d0 --- /dev/null +++ b/ai-review/1126.md @@ -0,0 +1,78 @@ +# AI Review: Erdos Problem 1126 + +## 1. Code Reuse + +The formalization spells out the additive property as `∀ x y : ℝ, g (x + y) = g x + g y` rather than using Mathlib's `AddHom` structure (defined in `Mathlib.Algebra.Group.Hom.Defs`). However, this is **consistent with codebase convention**: problems 907 and 908 both use the same expanded form `∀ x y : ℝ, φ (x + y) = φ x + φ y`. Using `AddHom` would require existentially quantifying over a bundled morphism type and then extracting its underlying function, which would make the statement less readable for no real gain. The current approach is preferable. + +The `∀ᵐ p : ℝ × ℝ ∂(volume.prod volume)` pattern is unique to this file in the codebase. No utility wrappers exist for this pattern in `FormalConjectures/Util/`, and none are needed. + +**Verdict: No code reuse improvements needed.** + +## 2. Citations + +The formalization references: +- `[dB66]` de Bruijn, N.G., *A difference property for Riemann integrable functions and for some similar classes of functions*. Indag. Math. 28 (1966), 145-151. +- `[Ju65]` Jurkat, W.B., *On Cauchy's functional equation*. Proc. Amer. Math. Soc. 16 (1965), 683-686. + +The erdosproblems.com page also lists **[Er60c]** as the original source (Erdos, c. 1960), which is the paper in which the problem was originally posed. The formalization does not include this original reference. While the solvers are correctly cited, adding the original Erdos reference would be more complete. + +**Verdict: Minor gap -- the original Erdos reference [Er60c] is not cited.** + +## 3. Variants + +The erdosproblems.com page presents a single formulation with no listed variants. The problem is a clean existence statement and does not have natural sub-parts or alternative formulations that would need separate theorems. + +One could consider a stronger variant requiring `g` to be measurable (which would follow automatically if `f` is measurable), or a version for other locally compact abelian groups, but these are not part of the stated Erdos problem. + +**Verdict: All variants captured. No issues.** + +## 4. Readability + +The code is clear and concise. The module docstring provides the problem statement, references, and context. The theorem docstring restates the result in LaTeX. The `open MeasureTheory` and namespacing are standard. + +Minor observation: the docstring says "there exists a function $g$ such that $g(x+y) = g(x) + g(y)$" -- it could explicitly say "additive function" for emphasis, but this is a stylistic nitpick. + +**Verdict: Highly readable. No issues.** + +## 5. Formalizability + +The problem is **precisely formalizable** with essentially no ambiguity: + +- "Almost all $x, y \in \mathbb{R}$" unambiguously means with respect to 2-dimensional Lebesgue measure on $\mathbb{R}^2$. +- "Additive function" means $g(x+y) = g(x) + g(y)$ for all $x, y$. +- "Almost everywhere" in the conclusion means with respect to 1-dimensional Lebesgue measure on $\mathbb{R}$. + +The only potential subtlety is whether "almost all $x, y$" could be interpreted as "for a.e. $x$, for a.e. $y$" (an iterated a.e. condition) rather than "for a.e. $(x,y)$" (a product-measure condition). By Fubini's theorem, these are equivalent for product-measurable sets, but in general the product-measure interpretation (as used in the formalization) is the standard and stronger one. The formalization makes the correct choice. + +**Verdict: Unambiguous and precisely formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +**Hypothesis analysis:** `∀ᵐ p : ℝ × ℝ ∂(volume.prod volume), f (p.1 + p.2) = f p.1 + f p.2` +- Correctly encodes: $f(x+y) = f(x) + f(y)$ for Lebesgue-a.e. $(x,y) \in \mathbb{R}^2$. +- Correctly uses product Lebesgue measure `volume.prod volume` on $\mathbb{R}^2$. +- Does **not** assume measurability of $f$, which is correct -- the theorems of de Bruijn and Jurkat do not require this. + +**Conclusion analysis:** `∃ g : ℝ → ℝ, (∀ x y : ℝ, g (x + y) = g x + g y) ∧ (∀ᵐ x ∂volume, f x = g x)` +- Correctly asserts existence of an everywhere-additive function $g$. +- Correctly asserts $f = g$ Lebesgue-a.e. on $\mathbb{R}$ (1-dimensional measure). +- The distinction between the 2D measure in the hypothesis and 1D measure in the conclusion is handled correctly. + +**No measurability pitfalls:** The `∀ᵐ` filter in Lean/Mathlib does not require the underlying set to be measurable -- it works with the a.e. filter directly. So there is no hidden measurability assumption. + +**Verdict: Correct and complete. No mathematical flaws.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No improvements needed | +| Citations | Minor: missing original [Er60c] reference | +| Variants | Complete | +| Readability | Excellent | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | + +**Overall: High-quality formalization with one minor citation gap.** diff --git a/ai-review/1127.md b/ai-review/1127.md new file mode 100644 index 0000000000..66a74bf8e4 --- /dev/null +++ b/ai-review/1127.md @@ -0,0 +1,82 @@ +# AI Review: Erdos Problem 1127 + +## 1. Code Reuse + +The formalization uses `EuclideanSpace ℝ (Fin n)` directly. The codebase provides a notation `ℝ^n` in `FormalConjecturesForMathlib/Geometry/Euclidean.lean` (scoped under `EuclideanGeometry`), but this is a cosmetic convenience and wouldn't change the statement's semantics. The current approach of spelling out `EuclideanSpace ℝ (Fin n)` is consistent with how other problems in the codebase handle this (the notation is scoped and not imported by default via `ProblemImports`). + +The "distinct pairwise distances" condition is expressed inline as a universal statement over quadruples. The codebase has `Set.Triplewise` in `FormalConjecturesForMathlib/Data/Set/Triplewise.lean`, which captures ternary relations on sets. However, the distinct-distances property is fundamentally a condition on *pairs of pairs* (a quaternary/quadruple condition), not a ternary one, so `Set.Triplewise` does not apply here. + +Several other Erdos problems deal with distinct distances (95, 100, 957, 958), but they all concern *finite* point sets and define helpers like `distinctDistances` and `distMultiplicity` over `Finset`. These are not applicable to the infinite decomposition setting of Problem 1127. + +**Verdict: No code reuse improvements available.** + +## 2. Citations + +The formalization cites: +- `[ErKa43]` Erdős and Kakutani (1943) — matches the website. +- `[Da72]` Davies (1972) — matches the website. +- `[Ku87]` Kunen (1987) — matches the website. + +The erdosproblems.com page also lists **[Er81b]** (Erdős, 1981, p.31) as the original source reference where the problem is posed. The formalization does not include this reference. Additionally, the website mentions Erdős and Hajnal's result on the necessity of the continuum hypothesis; the formalization's docstring mentions this result but does not cite a specific paper for it. + +**Verdict: Minor gap — the original source reference [Er81b] is not cited.** + +## 3. Variants + +The erdosproblems.com page presents a single formulation with no listed variants. The formalization quantifies universally over all dimensions `n : ℕ`, which is the strongest form of the statement and subsumes the individual cases n = 1 and n = 2 mentioned on the website. This is appropriate. + +One could consider variants that explicitly separate the CH-dependent and CH-independent aspects (e.g., a separate statement that CH implies the decomposition exists, or that ¬CH implies some negative result), but these are separate mathematical statements rather than variants of the problem itself. + +**Verdict: All variants captured. No issues.** + +## 4. Readability + +The code is clear and well-structured. The docstring provides the problem statement, historical context, and references. A few minor observations: + +- The four-variable universal quantification with three equality hypotheses (`f a = f b → f a = f c → f a = f d`) requires the reader to mentally unpack that all four points lie in the same partition class. An alternative formulation using a predicate like "all pairwise distances in the preimage `f⁻¹(k)` are distinct" could be more immediately transparent, but would require more infrastructure. The current encoding is standard and compact. +- The `{a, b} = {c, d}` conclusion for unordered pair equality is idiomatic Lean/Mathlib and reads well. + +**Verdict: Good readability. No issues.** + +## 5. Formalizability + +The problem is **precisely formalizable** with minimal ambiguity: + +- "Decomposed into countably many sets" is cleanly captured by a function `f : EuclideanSpace ℝ (Fin n) → ℕ`, whose preimages partition ℝⁿ. +- "All pairwise distances are distinct" within a set is a well-defined condition. +- The only potential ambiguity is whether "countably many" includes "finitely many." The formalization allows this since a coloring function `f` need not be surjective — some color classes can be empty. This is the standard mathematical interpretation. + +There is a deeper **set-theoretic subtlety**: the problem's answer is known to depend on the continuum hypothesis (true under CH by Kunen's result; the necessity of CH is shown by Erdős-Hajnal). In Lean's type theory (CIC), CH is neither provable nor refutable, which means neither `answer(True)` nor `answer(False)` can be filled in without additional axioms. This is not a flaw in the formalization per se — it correctly captures the *statement* — but it means the `answer(sorry)` cannot be resolved within the standard Lean/Mathlib framework. The `@[category research solved]` tag may be slightly misleading given this independence result; "partially solved" or an annotation noting the CH dependency would be more accurate. + +**Verdict: The statement is unambiguous and precisely formalizable. The set-theoretic independence issue is an inherent property of the problem, not a flaw in the encoding.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Partition encoding:** `f : EuclideanSpace ℝ (Fin n) → ℕ` correctly encodes a decomposition of ℝⁿ into countably many sets (the preimages `f⁻¹(k)` for `k : ℕ`). Every point of ℝⁿ belongs to exactly one part. This is standard. + +**Distinct distances condition:** The statement says: for all `a b c d` in the same color class (i.e., `f a = f b = f c = f d`), if `a ≠ b`, `c ≠ d`, and `dist a b = dist c d`, then `{a, b} = {c, d}`. Taking the contrapositive: if `{a, b} ≠ {c, d}` (distinct unordered pairs) and both pairs lie in the same part, then `dist a b ≠ dist c d`. This is exactly the "all pairwise distances are distinct within each part" condition. **Correct.** + +**Edge case — dimension 0:** When `n = 0`, `EuclideanSpace ℝ (Fin 0)` is a one-point space. The constant function `f _ = 0` trivially satisfies the condition since there are no two distinct points, so `a ≠ b` is never satisfiable. Including `n = 0` causes no harm and is vacuously true. + +**Edge case — unordered pairs:** The use of `{a, b} = {c, d}` (set equality) correctly handles the unordered nature of distance: `dist a b = dist b a`, so the pair `(a, b)` and `(b, a)` should be identified. The set formulation achieves this. **Correct.** + +**Potential concern — `∀ n : ℕ` vs. specific dimensions:** The original problem asks about ℝⁿ without specifying which n. The universal quantification `∀ n : ℕ` is a natural reading — "for every n, can ℝⁿ be decomposed..." — and matches the progression of results (n=1 by Erdős-Kakutani, n=2 by Davies, all n by Kunen). **Correct.** + +**Category tag:** The tag `@[category research solved]` marks this as solved, but the erdosproblems.com page says "partially solved" because the result depends on CH. This is a metadata issue, not a mathematical one. + +**Verdict: Correct and complete. The formalization accurately captures the mathematical content of the problem.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No improvements available | +| Citations | Minor: missing original [Er81b] reference | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous; inherent CH-dependence noted | +| Correctness | Correct and complete | + +**Overall: High-quality formalization. Two minor issues: (1) the original [Er81b] source reference is missing from the citations, and (2) the `@[category research solved]` tag may be misleading given the problem's known dependence on the continuum hypothesis — the erdosproblems.com page classifies it as "partially solved."** diff --git a/ai-review/1128.md b/ai-review/1128.md new file mode 100644 index 0000000000..36c1ecdcdb --- /dev/null +++ b/ai-review/1128.md @@ -0,0 +1,92 @@ +# AI Review: Erdos Problem 1128 + +## 1. Code Reuse + +The formalization uses `Cardinal`, `aleph`, `Fin 2`, and set membership to express a Ramsey-type partition problem on a triple product of sets. Several other Erdos problems in the codebase involve similar set-theoretic Ramsey/partition-type statements: + +- **Problem 1170** (`FormalConjectures/ErdosProblems/1170.lean`) defines `OrdinalPartition` for ordinal partition relations with 2-colorings, but this is specific to ordinal-indexed structures and strictly monotone embeddings — not directly applicable to the product-of-sets setting of 1128. +- **Problems 1167–1177** use `aleph` and `Fin 2` colorings in various partition calculus contexts, but each problem has bespoke structure. + +The codebase does not appear to have a generic "monochromatic sub-product" or "product Ramsey" predicate that could be extracted and reused here. One could imagine defining a general `MonochromaticSubProduct` predicate for colorings of product types, but given that this is a single problem with a specific disproof, the inline formulation is appropriate. + +**Verdict: No code reuse improvements available.** + +## 2. Citations + +The formalization cites: +- `[Er81b]` Erdős, P., *Problems and results on finite and infinite combinatorial analysis*, p.33. +- The reference link `[erdosproblems.com/1128](https://www.erdosproblems.com/1128)`. + +The erdosproblems.com page confirms this is attributed to Erdős and Hajnal, from [Er81b, p.33], and was disproved by Prikry and Mills (1978, unpublished), as reported by Todorčević and Komjáth. The formalization's docstring mentions all of these parties, matching the website. + +The website does not list any additional references beyond the ones already captured. The citation `[Er81b]` in the docstring uses shorthand — the full title could be included for completeness, but the shorthand is consistent with other formalizations in the codebase (e.g., Problem 1127 also uses `[Er81b]`). + +**Verdict: Citations are complete and consistent with the website.** + +## 3. Variants + +The erdosproblems.com page presents a single formulation with no listed variants. Natural variants one might consider: + +1. **Replacing ℵ₁ with other cardinals:** The problem is specific to sets of cardinality ℵ₁. One could ask about ℵ₀ (trivially true by Ramsey's theorem for countable sets) or larger cardinals, but these are separate problems. +2. **More than 2 colors:** The problem is stated for 2-colorings. The formalization uses `Fin 2`, which is correct. +3. **Products of more or fewer factors:** The problem is specifically about triple products. The analogous question for pairs is a classical result. +4. **Requiring larger monochromatic sub-products:** The problem asks for countably infinite (ℵ₀) sub-products; one could ask for uncountable, but again this would be a different problem. + +The formalization captures the problem as stated. No missing variants. + +**Verdict: All variants captured. No issues.** + +## 4. Readability + +The code is concise and well-structured. Some observations: + +- The docstring clearly states the problem, its origin (Erdős and Hajnal), and its resolution (disproved by Prikry and Mills). Good. +- The use of abstract types `α β γ : Type` with cardinality constraints `#α = aleph 1` etc. is clean and standard for cardinal arithmetic in Lean/Mathlib. +- The nested quantifiers `∀ a ∈ A₁, ∀ b ∈ B₁, ∀ x ∈ C₁, f (a, b, x) = c` are readable, though the variable name `x` for the element of `C₁` is inconsistent with the pattern `a`, `b` — using `c` would conflict with the color `c : Fin 2`, so the choice of `x` is understandable. A name like `z` or `c₁` might be marginally clearer. +- The monochromatic condition `∃ c : Fin 2, ∀ a ∈ A₁, ∀ b ∈ B₁, ∀ x ∈ C₁, f (a, b, x) = c` is clear: there exists a single color such that the entire sub-product maps to that color. + +**Verdict: Good readability. Minor variable naming nit only.** + +## 5. Formalizability + +The problem is **precisely formalizable** with no ambiguity: + +- "Three sets of cardinality ℵ₁" is captured by requiring types with `#α = aleph 1`. +- "2-colouring of A × B × C" is a function `f : α × β × γ → Fin 2`. +- "Monochromatic countably infinite sub-product" is captured by the existence of subsets of cardinality ℵ₀ whose product maps to a single color. +- The answer is known to be False (disproved), which is correctly encoded as `answer(False)`. + +One subtlety: the problem quantifies over *all* sets of cardinality ℵ₁, but since any two sets of the same cardinality are in bijection, it suffices to prove the statement for any particular choice. The formalization's universal quantification over types is therefore equivalent to a single canonical choice, and both are correct. + +**Verdict: Unambiguous and precisely formalizable. No issues.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Problem encoding:** The statement says: for all types α, β, γ of cardinality ℵ₁, and all 2-colorings f of the triple product, there exist subsets A₁ ⊆ α, B₁ ⊆ β, C₁ ⊆ γ, all of cardinality ℵ₀, and a color c, such that f is constantly c on A₁ × B₁ × C₁. This is exactly the Erdős–Hajnal question. + +**Answer encoding:** `answer(False)` correctly reflects that the answer to the question is "no" — the disproof by Prikry and Mills shows that such a 2-coloring *without* monochromatic countable sub-products exists. The biconditional `answer(False) ↔ ∀ ... ∃ ...` means the statement `∀ ... ∃ ...` is equivalent to `False`, i.e., the universal statement is false. This correctly encodes that the property fails: there exist α, β, γ of cardinality ℵ₁ and a coloring f for which no monochromatic countable sub-product exists. **Correct.** + +**Cardinality conditions:** The use of `aleph 0` for the sub-product cardinality is correct — the problem asks for *countably infinite* subsets, and `#A₁ = aleph 0` means |A₁| = ℵ₀, i.e., A₁ is countably infinite (not finite, not uncountable). **Correct.** + +**Product encoding:** The product `α × β × γ` in Lean is right-associated as `α × (β × γ)`, and the function signature `f : α × β × γ → Fin 2` with application `f (a, b, x)` correctly accesses the triple. The monochromatic condition over `∀ a ∈ A₁, ∀ b ∈ B₁, ∀ x ∈ C₁` correctly ranges over the Cartesian product A₁ × B₁ × C₁. **Correct.** + +**Potential concern — subset vs. subtype:** The formalization uses `Set α` rather than subtypes. This is fine: the sets A₁, B₁, C₁ are subsets of the ambient types, and the cardinality is measured as `Cardinal.mk` of the set (as a type via coercion). This is standard in Mathlib. **No issue.** + +**Category tag:** `@[category research solved, AMS 3 5]` — the website confirms this is disproved (solved), and AMS classification 03 (Mathematical Logic) / 05 (Combinatorics) is appropriate for a set-theoretic Ramsey problem. **Correct.** + +**Verdict: Correct and complete. The formalization accurately captures the mathematical content of the problem.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No improvements available | +| Citations | Complete and consistent | +| Variants | Complete | +| Readability | Good; minor variable naming nit | +| Formalizability | Unambiguous and precise | +| Correctness | Correct and complete | + +**Overall: High-quality formalization. The statement correctly encodes the Erdős–Hajnal question about monochromatic sub-products in 2-colorings of triple products of ℵ₁-sized sets, with the correct answer of False reflecting the Prikry–Mills disproof. No substantive issues found.** diff --git a/ai-review/1129.md b/ai-review/1129.md new file mode 100644 index 0000000000..3f7e90d136 --- /dev/null +++ b/ai-review/1129.md @@ -0,0 +1,109 @@ +# AI Review: Erdős Problem 1129 + +## 1. Code Reuse + +**Significant duplication with Problem 1130.** The definitions `lagrangeBasis`, `lebesgueFunction`, `ValidNodes`, and `boundary` in `ErdosProblems/1129.lean` are identical (character-for-character) to those in `ErdosProblems/1130.lean`. These should be factored into a shared file (e.g., `FormalConjecturesForMathlib/Analysis/LagrangeInterpolation.lean` or a shared `ErdosProblems/LagrangeCommon.lean`). Problem 1130 already explicitly references 1129 in its docstring ("It follows from the equioscillation result (Erdős Problem 1129)"), further motivating shared infrastructure. + +Additionally, `localMax` in 1130 is essentially the inlined body of the `sSup` expressions appearing in `HasEquioscillation` in 1129. If a shared `localMax` were defined, `HasEquioscillation` could be restated more concisely as `∀ i j : Fin (n+1), localMax nodes i = localMax nodes j`. + +No existing definitions in `FormalConjecturesForMathlib/` cover Lagrange interpolation or Lebesgue constants. + +## 2. Citations + +The formalization cites: +- **[Ki77]** Kilgore, T., *A characterization of the Lagrange interpolation projection with minimal Tchebycheff norm*, J. Approx. Theory (1977). +- **[dBPi78]** de Boor, C. and Pinkus, A., *Proof of the conjectures of Bernstein and Erdős concerning the optimal nodes for polynomial interpolation*, J. Approx. Theory (1978). + +The website additionally credits: +- **Cheney** (jointly with Kilgore) for the existence of nodes with equal intermediate sums. +- **Faber** for the lower bound Λ ≫ log n. +- **Bernstein** for Λ > (2/π − o(1)) log n and for the original conjecture (jointly with Erdős). +- **Erdős** for improving to Λ > (2/π) log n − O(1). +- **Brutman** and **Brutman–Pinkus** for the complex variant on the unit circle. +- **Rack and Vajda** for the n = 4 canonical solution. + +The two cited references are the most directly relevant to the theorem as stated. However, the docstring says "Erdős and Bernstein conjectured" without a specific Bernstein reference. The website does not provide a separate Bernstein citation either, so this is acceptable. + +**Suggestion:** The Cheney co-authorship with Kilgore on existence could be noted, as the website specifically credits "Kilgore and Cheney." + +## 3. Variants + +The formalization captures the **core conjecture**: existence, uniqueness, and equioscillation characterization of the minimizing nodes. + +**Missing variants from the website:** + +1. **Complex variant (unit circle):** Erdős proposed seeking nodes $x_i \in \mathbb{C}$ with $|x_i| = 1$ minimizing $\max_{|z|=1} \sum_k |l_k(z)|$. Resolved: the $n$-th roots of unity are optimal (Brutman for odd $n$; Brutman–Pinkus for even $n$). This is a natural companion problem. + +2. **Asymptotic bounds:** The problem page discusses that the optimal Lebesgue constant satisfies $\Lambda^* = \frac{2}{\pi} \log n + O(1)$, with matching upper bounds from Chebyshev nodes and lower bounds from Erdős. These quantitative refinements are not captured. + +3. **Specific small cases:** The website lists exact minimizers for $n = 2, 3, 4$. These could serve as computable test cases. + +The missing complex variant is arguably a distinct problem. The asymptotic bounds are supplementary results rather than the conjecture itself. The formalization's scope is reasonable but could be enriched. + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- **`open BigOperators` vs `open scoped BigOperators`:** Problem 1129 uses `open Finset BigOperators` while the sibling problem 1130 uses the preferred `open scoped BigOperators`. The `open scoped` pattern is more hygienic (only opens notation, not the full namespace) and should be used consistently. + +- **`HasEquioscillation` body:** The inline `sSup` expressions with `boundary` make the definition verbose. Extracting a `localMax` helper (as 1130 does) would improve readability: + ```lean + def HasEquioscillation {n : ℕ} (nodes : Fin n → ℝ) : Prop := + ∀ i j : Fin (n + 1), localMax nodes i = localMax nodes j + ``` + +- **Theorem docstring** is clear and well-written, with good LaTeX rendering of the mathematical statement. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The mathematical content—Lagrange basis polynomials, the Lebesgue constant as a supremum, the equioscillation property—is entirely classical and well-defined. The key definitions involve: +- Finite products and sums over `Fin n` (standard in Mathlib) +- Supremum of a continuous function on a compact interval (well-supported by `Mathlib.Topology.Order`) +- Strict monotonicity (standard order theory) + +The one subtlety is that `lagrangeBasis` involves division by `nodes k - nodes i`, which is only meaningful when nodes are distinct. The `ValidNodes` predicate (requiring `StrictMono`) ensures this, but the definition itself does not—so `lagrangeBasis` applied to non-valid nodes would silently produce `0 / 0 = 0` via Lean's convention. This is a standard pattern in Lean formalizations (define broadly, restrict by hypothesis) and is acceptable. + +The `sSup` in `lebesgueConstant` is well-defined because `lebesgueFunction nodes` is continuous and `Set.Icc (-1) 1` is compact and nonempty, so the image is a nonempty bounded-above set. For `n = 0`, the empty sum gives `lebesgueFunction = 0` everywhere and `sSup {0} = 0`, which is degenerate but the theorem guards against it with `2 ≤ n`. + +## 6. Correctness + +**Overall: Mathematically sound with one notable omission.** + +### What is correct: +- **`lagrangeBasis`** correctly implements $\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$. ✓ +- **`lebesgueFunction`** correctly implements $\Lambda(x) = \sum_k |\ell_k(x)|$. ✓ +- **`lebesgueConstant`** correctly implements $\Lambda = \sup_{x \in [-1,1]} \Lambda(x)$. ✓ +- **`ValidNodes`** correctly requires strictly increasing nodes in $[-1,1]$. Note that `StrictMono` (rather than just `Injective`) is the right choice—it canonicalizes the ordering and is needed for the uniqueness claim to be well-posed (the Lebesgue constant is permutation-invariant, so without an ordering constraint, minimizers would never be unique). ✓ +- **`boundary`** correctly constructs the partition $-1 = b_0 < b_1 < \cdots < b_n < b_{n+1} = 1$: index 0 maps to $-1$, indices 1 through $n$ map to the nodes, and index $n+1$ maps to $1$. ✓ +- **`HasEquioscillation`** correctly states that the local supremum of the Lebesgue function is equal across all subintervals. ✓ +- **Theorem statement** correctly asserts existence of a minimizer, its optimality over all valid node configurations, uniqueness, and the equioscillation property. ✓ + +### Notable omission — converse direction: + +The website states that Kilgore proved equioscillation **characterizes** the minimizer, meaning equioscillation is both necessary and sufficient for optimality. The formalization only captures the **forward direction** (minimizer ⟹ equioscillation). The converse (equioscillation ⟹ minimizer) is not stated. + +Combined with the uniqueness clause, the forward direction does logically pin down the minimizer (there is exactly one, and it has equioscillation). However, the converse is a mathematically meaningful result: *any* node configuration with equioscillation must be the minimizer. This is a stronger statement and is part of Kilgore's theorem. Its omission means the formalization is **incomplete but not incorrect**. + +A complete formalization might add: +```lean +-- Converse: equioscillation implies optimality +(∀ nodes : Fin n → ℝ, ValidNodes nodes → HasEquioscillation nodes → + lebesgueConstant nodes = lebesgueConstant opt) +``` + +### Minor technical note: + +The `lebesgueConstant` uses `sSup` rather than `iSup`. Since it's the supremum of an image set `f '' S`, one could alternatively write `⨆ x ∈ Set.Icc (-1 : ℝ) 1, lebesgueFunction nodes x`. Both formulations are equivalent, but the `iSup` version is sometimes more ergonomic in Mathlib proofs. This is stylistic, not a correctness issue. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs improvement | Duplicate definitions with Problem 1130; should be factored out | +| Citations | ✅ Acceptable | Core references present; Cheney co-authorship could be noted | +| Variants | ⚠️ Partial | Complex unit-circle variant not captured | +| Readability | ✅ Good | Minor: use `open scoped`, extract `localMax` helper | +| Formalizability | ✅ High | Clean, unambiguous mathematical content | +| Correctness | ⚠️ Incomplete | Forward direction only; converse (equioscillation ⟹ minimizer) omitted | diff --git a/ai-review/113.md b/ai-review/113.md new file mode 100644 index 0000000000..8a1eb3fcbd --- /dev/null +++ b/ai-review/113.md @@ -0,0 +1,99 @@ +# AI Review: Erdős Problem 113 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `ContainsSubgraph` and `turanNumber` are copy-pasted verbatim across at least 8 files: + +- `ErdosProblems/113.lean` (lines 39–47) +- `ErdosProblems/146.lean` (lines 42–50) +- `ErdosProblems/147.lean` (lines 40–48) +- `ErdosProblems/59.lean` (lines 36–44) +- `ErdosProblems/576.lean`, `926.lean`, `1079.lean`, `180.lean`, `575.lean` + +These should be factored into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Turan.lean`). + +Additionally, `IsTwoDegenerateGraph` (line 52) is a special case of `IsRDegenerateGraph` defined in `ErdosProblems/146.lean` (line 55) with `r = 2`. Problem 113 could import or reference the generalized version and define `IsTwoDegenerateGraph G := IsRDegenerateGraph G 2`. + +Mathlib does **not** currently provide native definitions for Turán numbers, graph degeneracy, or subgraph containment via injective homomorphism, so custom definitions are necessary. However, `SimpleGraph.Coloring`, `SimpleGraph.neighborSet`, `SimpleGraph.edgeFinset`, and `Set.ncard` are all from Mathlib and are correctly used. + +## 2. Citations + +The formalization includes: +- [ErSi84] Erdős, P. and Simonovits, M., *Cube-supersaturated graphs and related problems* ✓ +- [Ja23b] Janzer, O., *Resolution of the Erdős–Simonovits conjecture on walks*, 2023 ✓ + +The website (erdosproblems.com/113, last edited 19 October 2025) lists **additional references** not included in the formalization: +- **[Er90]** — Erdős (1990) — missing +- **[Er91]** — Erdős (1991) — missing +- **[Er93]** — Erdős (1993) — missing (this is where Erdős increased the bounty to $500) + +These additional references document the evolution of the bounty ($250 proof / $100 counterexample, later $500 for counterexample in 1993) and repeated mentions by Erdős. While not strictly required, including at least [Er93] would provide better historical context consistent with the website. + +Also, the title of Janzer's paper on the website appears as "*Disproof of a conjecture of Erdős and Simonovits on the Turán number*" (matching Problem 147's citation), but Problem 113 cites it as "*Resolution of the Erdős–Simonovits conjecture on walks*". These may be different papers both labeled [Ja23b], or the title may need verification. + +## 3. Variants + +The **main conjecture** (biconditional: 2-degenerate ↔ ex(n;G) ≪ n^{3/2} for bipartite G) is captured. + +**Related problems are formalized separately**, which is appropriate: +- **Problem 146** (`146.lean`): The generalized r-degenerate upper bound conjecture ex(n;H) = O(n^{2−1/r}), still open. Problem 113's "if" direction (2-degenerate → ex(n;G) ≪ n^{3/2}) is the special case r = 2 of this conjecture. +- **Problem 147** (`147.lean`): The lower bound direction for bipartite graphs with minimum degree r, disproved by Janzer. + +One could argue that **Janzer's positive result** itself — the existence of 3-regular bipartite H with ex(n;H) ≪ n^{4/3+ε} — could be formalized as a separate standalone theorem (not just mentioned in the docstring), since it is a constructive mathematical statement. However, this is a minor point; the current approach of noting it in the docstring and asserting `answer(False)` is standard for this codebase. + +## 4. Readability + +**Good overall.** The code is well-structured with clear docstrings. Specific observations: + +- The module docstring clearly explains the conjecture, its status, and the disproof. +- The docstring on `erdos_113` (lines 56–71) is thorough and mathematically precise. +- The notation `answer(False)` with the biconditional pattern is consistent with other disproved conjectures in the codebase (e.g., Problems 59, 147). + +**Minor improvements possible:** +- The docstring could note the relationship to Problem 146 (the "if" direction being a special case). +- `IsTwoDegenerateGraph` could be a one-liner referencing `IsRDegenerateGraph` from Problem 146 if shared definitions were used. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** Assessment: **low ambiguity**. + +All components have unambiguous mathematical meaning: +- "Bipartite graph" → 2-colorable (`Nonempty (G.Coloring (Fin 2))`) ✓ +- "2-degenerate" → every nonempty subgraph has a vertex of degree ≤ 2 within it ✓ +- "ex(n; G) ≪ n^{3/2}" → ∃ C > 0, ∀ n, ex(n;G) ≤ C·n^{3/2} ✓ +- "Biconditional" → Lean `↔` ✓ + +The only minor source of potential ambiguity is the asymptotic notation "≪" (Vinogradov notation), which the formalization correctly interprets as "bounded above by a constant multiple" (i.e., Big-O), not as "little-o". This is the standard interpretation in extremal graph theory and is correct. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### 6a. `ContainsSubgraph` (line 39) +Correctly defines subgraph containment via injective graph homomorphism: an injection f : U → V that preserves adjacency. This is the standard notion in extremal graph theory (sometimes called "subgraph isomorphism" or "copy containment"). + +### 6b. `turanNumber` (line 44) +Uses `sSup` over the set of edge counts achievable by H-free graphs on n vertices. Since the number of edges in any graph on n vertices is bounded by n(n−1)/2, the set is `BddAbove`, so `sSup` is well-defined and returns the maximum. For n = 0, the set contains only 0, so `turanNumber G 0 = 0`. Correct. + +**Technical note:** The quantification `∃ (V : Type)` ranges over `Type 0`. Since any finite type of cardinality n is equivalent to `Fin n`, this correctly captures all graphs on n vertices up to isomorphism. + +### 6c. `IsTwoDegenerateGraph` (line 52) +Correct formalization of 2-degeneracy: every nonempty finite subset S of vertices contains a vertex with at most 2 neighbors in S. This is equivalent to the standard definition that every subgraph has minimum degree at most 2, and to the property that the graph has no subgraph with minimum degree ≥ 3. + +### 6d. Main theorem `erdos_113` (line 74) +- `answer(False)` correctly indicates the conjecture is disproved. +- The universal quantification over all finite bipartite graphs G is correct. +- `Nonempty (G.Coloring (Fin 2))` correctly encodes bipartiteness. +- The biconditional `IsTwoDegenerateGraph G ↔ ∃ C ...` correctly encodes the conjecture. +- `(3 / 2 : ℝ)` evaluates to 1.5 in ℝ (not integer division). Correct. + +### 6e. Direction of the disproof +Janzer's counterexample provides a 3-regular (hence **not** 2-degenerate) bipartite graph H with ex(n;H) ≪ n^{4/3+ε} ≪ n^{3/2}. This breaks the **←** direction of the biconditional (small Turán number does NOT imply 2-degenerate). The universal statement ∀ G, (2-degen ↔ bound) is therefore false, so `answer(False)` is correct. + +**Important mathematical nuance correctly handled:** The **→** direction (2-degenerate → ex(n;G) ≪ n^{3/2}) is still open — it is the r = 2 case of Problem 146. But the biconditional is false regardless, because only one direction needs to fail. The formalization does not claim anything about which direction fails; it only asserts the biconditional itself is false. This is the correct and clean approach. + +### Verdict +**No mathematical errors found.** The formalization is correct and complete. The only recommendations are: +1. Factor out duplicated definitions for maintainability. +2. Add missing citations [Er90], [Er91], [Er93]. +3. Verify the exact title of Janzer's paper [Ja23b]. diff --git a/ai-review/1130.md b/ai-review/1130.md new file mode 100644 index 0000000000..27ed9aa695 --- /dev/null +++ b/ai-review/1130.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 1130 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `lagrangeBasis`, `lebesgueFunction`, `ValidNodes`, and `boundary` are copied verbatim across Problems 1129, 1130, 1131, 1132, 1151, and 1153, each within their own namespace. Problem 671 has a slightly different formulation (`lagrangeBasisEval` using `univ.erase` instead of `univ.filter`). + +Problem 1130's `localMax` is essentially the same computation that appears inside 1129's `HasEquioscillation` (both compute `sSup` of the Lebesgue function image over a subinterval), but 1130 factors it out as a named definition while 1129 inlines it. + +**Recommendation:** A shared utility file (e.g., `FormalConjectures/ErdosProblems/LagrangeInterpolation.lean`) could define `lagrangeBasis`, `lebesgueFunction`, `ValidNodes`, `boundary`, and `localMax` once. All six problems could import from it. This would reduce maintenance burden and ensure consistency. + +## 2. Citations + +The formalization cites: + +> [dBPi78] de Boor, C. and Pinkus, A., *Proof of the conjectures of Bernstein and Erdős concerning the optimal nodes for polynomial interpolation*, 1978. + +The website (erdosproblems.com/1130) confirms de Boor and Pinkus (1978) as the source of the proof. The website does not list a specific journal, but the standard reference is *J. Approx. Theory* (1978), which is recorded in the 1129 citation but omitted here. For consistency with 1129.lean, the journal name could be added: + +> *Proof of the conjectures of Bernstein and Erdős concerning the optimal nodes for polynomial interpolation*, J. Approx. Theory (1978). + +No citations appear to be missing. The website does not list additional references beyond de Boor–Pinkus for this specific problem. + +## 3. Variants + +**The formalization captures only part of the problem.** The website states two questions: + +1. Is $\Upsilon(x_1, \ldots, x_n) \ll \log n$? — **Formalized** ✓ +2. Which choice of $x_i$ maximizes $\Upsilon(x_1, \ldots, x_n)$? — **Not formalized** ✗ + +The second question asks for the extremal configuration. De Boor and Pinkus showed the maximizing nodes are the same equioscillation nodes from Problem 1129. A complete formalization could additionally state that the nodes achieving $\sup_{\text{nodes}} \Upsilon(\text{nodes})$ are the equioscillation-optimal nodes from 1129, or at minimum that $\Upsilon$ is maximized by nodes satisfying `HasEquioscillation` (as defined in 1129.lean). + +The docstring does mention the connection to Problem 1129 and the equioscillation result, but the theorem statement does not formalize this relationship. + +## 4. Readability + +Overall readability is **good**. Specific observations: + +- The definitions are clean and well-documented with LaTeX docstrings. +- The `boundary` function logic is clear, using `dite` on index values to map `Fin (n + 2)` to the partition points. +- The theorem statement is reasonably readable, though the `answer(True) ↔` pattern requires familiarity with the project's conventions. +- Minor: The docstring says "minimum over subintervals of the maximum of $\Lambda$" for $\Upsilon$, which accurately describes the mathematical content but could be made slightly more precise by saying "minimum over subintervals $[x_i, x_{i+1}]$ of $\sup_{x \in [x_i, x_{i+1}]} \Lambda(x)$." + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The mathematical statement is precise: +- The Lagrange basis polynomials $\ell_k$ are standard and unambiguous. +- The Lebesgue function $\Lambda(x) = \sum_k |\ell_k(x)|$ is well-defined. +- The partition into subintervals via boundary points is deterministic given the nodes. +- The quantity $\Upsilon = \min_i \max_{x \in [x_i, x_{i+1}]} \Lambda(x)$ is well-defined. +- The asymptotic claim "$\Upsilon \ll \log n$" is rendered as `∃ C > 0, ∀ n ≥ 2, ... ≤ C * log n`, which is a standard and correct way to formalize big-O bounds. + +The only mild subtlety is that `sSup` on image sets of continuous functions over compact (closed bounded) intervals is well-defined and attained, so `localMax` always equals a genuine maximum for valid nodes. This is mathematically sound but relies on Mathlib's `sSup` returning `0` for the empty set (which doesn't arise here since the intervals are non-degenerate for valid nodes with `n ≥ 2`). + +**Edge case note:** If `ValidNodes` holds, the nodes are strictly increasing in $[-1, 1]$, so all subintervals $[b_i, b_{i+1}]$ are non-degenerate. The `n ≥ 2` guard ensures at least two nodes. For `n = 1`, $\log(1) = 0$, which would make the bound vacuously problematic; `n ≥ 2` avoids this correctly. + +## 6. Correctness + +**The formalization is mathematically correct for the part it captures**, with the following detailed analysis: + +### Theorem structure +The statement `∃ C > 0, ∀ n ≥ 2, ∀ nodes, ValidNodes nodes → ∃ i, localMax nodes i ≤ C * log n` correctly captures "$\Upsilon(x_1, \ldots, x_n) \ll \log n$" because: +- $\Upsilon$ is defined as the minimum over subintervals of the local max. +- "∃ i such that localMax ≤ C log n" is logically equivalent to "min_i localMax_i ≤ C log n." +- The universal quantification over all valid node configurations and all $n \geq 2$ correctly expresses the uniform bound. + +### Definitions +- `lagrangeBasis`: Correctly implements $\ell_k(x) = \prod_{i \neq k} \frac{x - x_i}{x_k - x_i}$. The use of `univ.filter (· ≠ k)` correctly excludes the $k$-th index. The product of quotients is the standard form. +- `lebesgueFunction`: Correctly sums $|\ell_k(x)|$ over all $k$. +- `ValidNodes`: Strictly increasing + range in $[-1,1]$ is the standard constraint. Strict monotonicity ensures distinct nodes (required for Lagrange interpolation to be well-defined, since $x_k - x_i \neq 0$). +- `boundary`: Correctly maps index 0 to $-1$, indices 1 through $n$ to the corresponding nodes (via `i.val - 1`), and index $n+1$ to $1$. +- `localMax`: Correctly computes $\sup_{x \in [b_i, b_{i+1}]} \Lambda(x)$ via `sSup` on the image. + +### Completeness +The formalization is **incomplete** with respect to the full problem statement on the website: +- Part 1 (asymptotic bound) is correctly captured. +- Part 2 (extremal node characterization) is absent from the theorem statement. + +### Answer correctness +The problem is marked `answer(True)` and `category research solved`, consistent with the de Boor–Pinkus proof. The docstring correctly states the sharper bound $\Upsilon \leq \frac{2}{\pi} \log n + O(1)$. + +### Potential concern +The `answer(True) ↔ ∃ C ...` structure means the theorem claims the answer is True if and only if the bound holds. Since the bound does hold (proved by de Boor–Pinkus), the biconditional is correct. However, this structure means a proof must establish both directions; the reverse direction (`∃ C ... → answer(True)`) is trivially `True.intro` given the `answer` elaborator's behavior. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Significant duplication with 1129, 1131, 1132, 1151, 1153; should extract shared definitions | +| Citations | Correct; minor: journal name could be added for consistency with 1129 | +| Variants | Missing Part 2 (extremal node characterization) | +| Readability | Good | +| Formalizability | High; low ambiguity | +| Correctness | Correct for Part 1; incomplete (missing Part 2) | diff --git a/ai-review/1131.md b/ai-review/1131.md new file mode 100644 index 0000000000..e5e8522c35 --- /dev/null +++ b/ai-review/1131.md @@ -0,0 +1,106 @@ +# AI Review: Erdős Problem 1131 + +## 1. Code Reuse + +The `lagrangeBasis` definition in `1131.lean:45-46` is duplicated verbatim across multiple files: + +- `ErdosProblems/1129.lean:41-42` — identical definition (uses `univ.filter (· ≠ k)`) +- `ErdosProblems/1130.lean` — identical definition +- `ErdosProblems/1132.lean` — identical definition + +Additionally, `ErdosProblems/671.lean:47-48` defines `lagrangeBasisEval` using `univ.erase i` instead of `univ.filter (· ≠ k)`, which is mathematically equivalent (for `Fin n`, `univ.erase i = univ.filter (· ≠ i)`). + +**Recommendation:** Extract `lagrangeBasis` into a shared utility (e.g., `FormalConjecturesForMathlib/Analysis/Lagrange.lean`) to avoid maintaining four+ identical copies. The `lagrangeL2` functional and `minLagrangeL2` are specific to this problem and should remain local. + +Note: Mathlib's `Polynomial.Lagrange` module provides Lagrange interpolation in a more algebraic form (over `Polynomial R`), which is structurally different from the pointwise evaluation form used here. The pointwise form is more natural for this analytic problem, so the current approach is reasonable — but a shared definition would still reduce duplication within the project. + +## 2. Citations + +The website (erdosproblems.com/1131) lists the following references: +- **Er61** — Erdős (1961) +- **Fe32** — Fejér (1932) +- **Sz66** — Szabados (1966) +- **ESVV94** — Erdős, Szabados, Varma, Vértesi (1994) +- **Er95e** — Erdős (1995) +- **Va99** — Varma (1999) + +The formalization's docstring only cites **[ESVV94]** with author names but no title or journal. The module docstring mentions the bounds from ESVV94 but omits historical context available on the website: + +- Erdős initially conjectured the minimum was achieved at roots of the integral of the Legendre polynomial. +- Szabados [Sz66] disproved this for all n > 3. + +**Recommendation:** Expand the citation to include the paper title and journal for ESVV94. Consider adding at least a brief mention of the Szabados disproof, which provides important context for why the problem remains open. + +## 3. Variants + +The website poses the problem in two parts: +1. **General question:** Find the minimal value of I(x₁,...,xₙ). +2. **Specific conjecture:** Is min I = 2 − (1+o(1))/n? + +The formalization captures only the specific conjecture (part 2), expressed as `n * (2 - minLagrangeL2 n) → 1`. The general question of determining the exact minimum for each n is not formalized, which is reasonable since it's not a precise conjecture. + +The known bounds from [ESVV94]: +- Lower: 2 − O((log n)² / n) ≤ min I +- Upper: min I ≤ 2 − 2/(2n−1) + +are mentioned in the docstring but not formalized as separate theorems. Formalizing the upper bound (which is a concrete inequality) would be a valuable addition and could serve as a sanity check. + +**Assessment:** The main conjecture is captured. No critical variants are missing. + +## 4. Readability + +The code is well-structured and readable: +- The three definitions (`lagrangeBasis`, `lagrangeL2`, `minLagrangeL2`) build naturally on each other. +- Docstrings include LaTeX formulas that match the mathematical notation. +- The namespace `Erdos1131` keeps definitions scoped. + +Minor suggestions: +- The theorem docstring says `[ESVV94]` at the end as a bare tag — this should either be expanded or removed since the module docstring already discusses the reference. +- The docstring for `minLagrangeL2` could mention that nodes are required to be distinct (it's in the code but not the docstring text). + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- The Lagrange basis polynomials have a concrete formula. +- The functional I is a well-defined integral. +- The conjecture "min I = 2 − (1+o(1))/n" has an unambiguous translation as n·(2 − min I) → 1. + +The only minor ambiguity is whether "x₁,...,xₙ ∈ [-1,1]" implies distinct nodes. The formalization correctly requires `Function.Injective nodes`, which is necessary for the Lagrange basis to be well-defined (avoiding 0/0). This is a standard implicit assumption in the interpolation literature, not genuine ambiguity. + +## 6. Correctness + +### Lagrange Basis (line 45-46) +```lean +∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) +``` +**Correct.** This computes ∏_{i≠k} (x − xᵢ)/(xₖ − xᵢ), matching the standard definition. Each factor is divided individually rather than computing a ratio of products, but these are mathematically equivalent for real numbers with distinct nodes. + +### L² Functional (line 49-50) +```lean +∫ x in (-1 : ℝ)..1, ∑ k : Fin n, lagrangeBasis nodes k x ^ 2 +``` +**Correct.** Uses `x ^ 2` rather than `|x| ^ 2`, which is equivalent since x² = |x|² for real numbers. The interval integral notation `∫ x in (-1)..1` is the standard Mathlib interval integral. + +### Minimum Definition (line 53-57) +```lean +sInf {v : ℝ | ∃ nodes : Fin n → ℝ, + Function.Injective nodes ∧ + (∀ i, nodes i ∈ Set.Icc (-1 : ℝ) 1) ∧ + v = lagrangeL2 nodes} +``` +**Correct but with a subtlety.** The use of `sInf` is appropriate: for n ≥ 2 the set is non-empty and bounded below by 0 (integral of non-negative function), so the infimum is well-defined via `ConditionallyCompleteLinearOrder`. For n = 0 and n = 1 the set is still non-empty ({0} and {2} respectively), so `sInf` is well-defined in all cases. + +Note: this defines the *infimum*, not necessarily a *minimum*. The set of injective functions Fin n → [-1,1] is open in [-1,1]ⁿ (diagonals removed), so it's not compact, and the infimum might not be attained. However, since the L² functional blows up as nodes collide, the infimum is indeed attained in practice (by a compactness argument on the closure). This distinction doesn't affect the correctness of the limit statement. + +### Main Theorem (line 69-72) +```lean +Tendsto (fun n : ℕ => (n : ℝ) * (2 - minLagrangeL2 n)) atTop (nhds 1) +``` +**Correct.** The conjecture "min I = 2 − (1+o(1))/n" is equivalent to n·(2 − min I) → 1, which is exactly what this states. The `answer(sorry)` wrapper correctly marks this as a True/False open question. + +**Consistency with known bounds:** The upper bound min I ≤ 2 − 2/(2n−1) gives n·(2 − min I) ≥ 2n/(2n−1) → 1, confirming lim inf ≥ 1. The lower bound min I ≥ 2 − O((log n)²/n) gives n·(2 − min I) ≤ O((log n)²), which is consistent with but does not establish the conjecture. The formalization is consistent with known results. + +### Verdict +**The formalization is mathematically correct and complete.** No flaws identified. The translation from the informal conjecture to the Lean statement is faithful. diff --git a/ai-review/1132.md b/ai-review/1132.md new file mode 100644 index 0000000000..d6c4b23502 --- /dev/null +++ b/ai-review/1132.md @@ -0,0 +1,155 @@ +# AI Review: Erdős Problem 1132 + +## 1. Code Reuse + +The `lagrangeBasis` and `lebesgueFunction` definitions in `1132.lean:46–51` are duplicated verbatim across at least five other files: + +- `ErdosProblems/1129.lean:41–46` — identical +- `ErdosProblems/1130.lean:43–48` — identical +- `ErdosProblems/1131.lean` — identical `lagrangeBasis` +- `ErdosProblems/1153.lean` — nearly identical +- `ErdosProblems/671.lean` — equivalent (`univ.erase` instead of `univ.filter`) + +The `firstN` helper (`fun i => seq i.val`) is trivial but also appears to be locally defined when it could be shared. + +No existing definitions in `FormalConjecturesForMathlib/` cover Lagrange interpolation. + +**Recommendation:** Extract `lagrangeBasis` and `lebesgueFunction` into a shared utility file (e.g., `FormalConjecturesForMathlib/Analysis/LagrangeInterpolation.lean`). At minimum, problems 1129, 1130, 1131, 1132, and 1153 should share these definitions. + +## 2. Citations + +The website ([erdosproblems.com/1132](https://www.erdosproblems.com/1132)) lists the following references: + +- **[Er67,p.68]** — Original source (Erdős, 1967) +- **[Va99,2.43]** — Varma (1999) +- **[Be31]** — Bernstein (1931), proved the dense set result +- **[Er61c]** — Erdős (1961), proved max_{x∈[-1,1]} L_n(x) > (2/π) log n − O(1) for any fixed nodes + +The formalization's module docstring mentions **[Be31]** by shorthand only, with no author name, title, or journal. The references **[Er67,p.68]**, **[Va99,2.43]**, and **[Er61c]** are entirely absent. + +The known result by Erdős [Er61c] — that for any *fixed* nodes, max L_n(x) > (2/π) log n − O(1) — is important context. It shows that the (2/π) log n threshold is already established for the maximum over x; the conjecture asks whether this holds *pointwise* for some fixed x across infinitely many n (Part 1) or for a.e. x in a limsup sense (Part 2). + +**Recommendation:** Expand citations to include full bibliographic details for [Be31] (at minimum, author name "Bernstein"). Add references [Er67,p.68] and [Er61c] to the module docstring. + +## 3. Variants + +The website poses two questions, and the formalization captures both: + +1. **Part 1** (`erdos_1132`, line 72): Pointwise lower bound for infinitely many n. ✓ +2. **Part 2** (`erdos_1132.variants.part2`, line 90): Limsup condition for a.e. x. ✓ + +The Bernstein density result [Be31] is mentioned in the docstring for Part 2 as historical context, which is appropriate. + +No additional variants appear on the website beyond these two questions. + +**Assessment:** All variants are captured. No missing conjectures. + +## 4. Readability + +The code is well-structured: + +- Definitions build naturally: `lagrangeBasis` → `lebesgueFunction` → `firstN` → `L` → `ValidSeq` → theorems. +- Docstrings include LaTeX formulas matching the mathematical notation. +- The namespace `Erdos1132` properly scopes all definitions. + +Minor suggestions: + +- **`open BigOperators` vs `open scoped BigOperators`:** The file uses `open ... BigOperators` (line 40). The sibling problem 1130 uses the preferred `open scoped BigOperators`. The `open scoped` pattern is more hygienic (only opens notation) and should be used consistently. +- **Part 2 docstring** refers to "the limsup condition (Part 2)" before Part 2 has been introduced. This self-reference in the module docstring is slightly confusing — it could say "the limsup condition below" or just describe the condition directly. +- The `firstN` name is somewhat generic; `restrictToFin` or `truncateSeq` might be more descriptive, though this is minor. + +## 5. Formalizability + +**Assessment: High formalizability, moderate subtlety.** + +The mathematical content — Lagrange basis polynomials, Lebesgue functions, limsup, almost-everywhere quantification — is entirely classical and well-supported by Mathlib. + +The problem statement from Erdős is precise and unambiguous: +- Part 1 uses concrete quantifiers (∃ x, ∃ C, infinitely many n) with no room for misinterpretation. +- Part 2 uses "almost all" which has a standard measure-theoretic meaning. + +The only subtlety is the use of `answer(sorry)` for both parts, reflecting that the answer (True or False) is unknown. This is the correct pattern for open problems. + +The implicit assumption that nodes are distinct is correctly captured by `Function.Injective seq` in `ValidSeq`. This is necessary for the Lagrange basis to be well-defined (otherwise denominators vanish), and is a standard convention in the interpolation literature. + +## 6. Correctness + +### Lagrange Basis (lines 46–47) +```lean +∏ i ∈ univ.filter (· ≠ k), (x - nodes i) / (nodes k - nodes i) +``` +**Correct.** Faithfully implements ℓ_k(x) = ∏_{i≠k} (x − x_i)/(x_k − x_i). ✓ + +### Lebesgue Function (lines 49–51) +```lean +∑ k, |lagrangeBasis nodes k x| +``` +**Correct.** Faithfully implements L_n(x) = Σ_k |ℓ_k(x)|. ✓ + +### firstN / L (lines 53–58) +```lean +noncomputable def firstN (seq : ℕ → ℝ) (n : ℕ) : Fin n → ℝ := fun i => seq i.val +noncomputable def L (seq : ℕ → ℝ) (n : ℕ) (x : ℝ) : ℝ := lebesgueFunction (firstN seq n) x +``` +**Correct.** `firstN seq n` extracts the first n elements as a `Fin n → ℝ`. Since `seq` is injective (per `ValidSeq`), `firstN seq n` is also injective, so all denominators in the Lagrange basis are nonzero. ✓ + +### ValidSeq (lines 60–62) +```lean +def ValidSeq (seq : ℕ → ℝ) : Prop := + Function.Injective seq ∧ ∀ i, seq i ∈ Set.Icc (-1 : ℝ) 1 +``` +**Correct but note a difference from 1129/1130.** Those files use `StrictMono` (strictly increasing) which is stronger than `Injective`. Here, `Injective` is the right choice — the problem concerns arbitrary orderings of distinct points, not necessarily sorted ones. The sequence is infinite and its ordering matters (points are added sequentially), so `StrictMono` would be inappropriate. ✓ + +### Part 1 (lines 72–77) +```lean +answer(sorry) ↔ + ∀ (seq : ℕ → ℝ), ValidSeq seq → + ∃ x ∈ Set.Ioo (-1 : ℝ) 1, ∃ C : ℝ, + ∃ᶠ n in atTop, + L seq n x > (2 / Real.pi) * Real.log (n : ℝ) - C +``` +**Correct.** The original asks: must there exist x ∈ (−1,1) such that L_n(x) > (2/π) log n − O(1) infinitely often? The formalization correctly: +- Universally quantifies over valid sequences. +- Existentially quantifies over x ∈ (−1,1) (open interval, matching the problem). +- Existentially quantifies over a constant C (capturing the O(1) bound). +- Uses `∃ᶠ n in atTop` for "infinitely many n." +- The inequality `>` (strict) matches the problem's `>`. + +The quantifier order `∃ x, ∃ C, ...` allows C to depend on x, which is correct — the problem asks for a single point x with a uniform constant. ✓ + +### Part 2 (lines 90–93) — **Correctness concern** +```lean +answer(sorry) ↔ + ∀ (seq : ℕ → ℝ), ValidSeq seq → + ∀ᵐ x ∂(volume.restrict (Set.Ioo (-1 : ℝ) 1)), + Filter.limsup (fun n => L seq n x / Real.log (n : ℝ)) atTop ≥ 2 / Real.pi +``` + +**Potential issue with ℝ-valued `Filter.limsup` when the limsup is +∞.** + +`Filter.limsup f atTop` is defined as `sInf {a | ∀ᶠ n in atTop, f n ≤ a}`. In Mathlib, for `ℝ` (a conditionally complete linear order), when this set is **empty** (i.e., the function `f` is not eventually bounded above), `sInf ∅` returns a junk value — conventionally 0 for `ℝ`. + +This means: if for some x, L_n(x)/log(n) is unbounded above (the mathematical limsup is +∞), then `Filter.limsup` returns 0, and the condition `0 ≥ 2/π` is **false**. But mathematically, limsup = +∞ > 2/π should make the condition true. + +The formalization is therefore **too strong** (harder to satisfy than intended) in the `answer(sorry) → RHS` direction: it requires limsup ≥ 2/π even at points where the limsup is +∞, but the Lean `Filter.limsup` returns 0 at such points. Conversely, in the `RHS → answer(sorry)` direction, it is **too weak**: it might fail to prove the answer when the mathematical statement is true. + +**Severity:** This is a genuine but potentially non-critical issue. For the Erdős problem, the interesting regime is where L_n(x) ∼ (2/π) log n, i.e., the limsup is finite. If the conjecture is true, one would likely prove that L_n(x)/log(n) is eventually bounded above for a.e. x (since individual Lagrange basis functions are bounded on compact sets), which would make the `Filter.limsup` well-defined. However, this imposes an additional proof obligation not present in the mathematical statement. + +**Recommended fix:** Either: +1. Use `Filter.limsup` with values in `EReal` (extended reals), where +∞ ≥ 2/π holds, or +2. Rephrase without `Filter.limsup`: `∀ c < 2/π, ∃ᶠ n in atTop, L seq n x / Real.log n ≥ c`, or +3. Add a boundedness guard: `IsBoundedUnder (· ≤ ·) atTop (fun n => ...) → limsup ≥ 2/π` with a separate clause for the unbounded case. + +### Bernstein reference in docstring +The docstring correctly attributes the density result to Bernstein [Be31]. ✓ + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs improvement | `lagrangeBasis`, `lebesgueFunction` duplicated across 5+ files | +| Citations | ⚠️ Incomplete | Only [Be31] mentioned (by shorthand); [Er67,p.68], [Va99,2.43], [Er61c] missing | +| Variants | ✅ Complete | Both parts of the problem are formalized | +| Readability | ✅ Good | Minor: prefer `open scoped BigOperators`, self-referential docstring | +| Formalizability | ✅ High | Precise, unambiguous mathematical content | +| Correctness | ⚠️ Part 2 issue | ℝ-valued `Filter.limsup` gives junk value 0 when limsup = +∞, making the condition false when it should be true; Part 1 is correct | diff --git a/ai-review/1133.md b/ai-review/1133.md new file mode 100644 index 0000000000..ef92377501 --- /dev/null +++ b/ai-review/1133.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 1133 + +## 1. Code Reuse + +The formalization is self-contained and does not define any custom helper definitions — it directly uses `Polynomial ℝ`, `Polynomial.natDegree`, `Polynomial.eval`, `Finset.filter`, `Finset.card`, and `Set.Icc` from Mathlib. No code from `FormalConjecturesForMathlib` is applicable here (the utilities there are for Bunyakovsky/Schinzel conditions and Hasse derivatives, which are unrelated). + +Several nearby problems in the 1129–1153 range define `lagrangeBasis`, `lebesgueFunction`, `ValidNodes`, and `ValidSeq` helpers for Lagrange interpolation problems. Problem 1133 does **not** need these — it is about arbitrary polynomials of bounded degree that happen to agree with prescribed values at many (but not all) nodes, rather than exact interpolation. The formalization correctly avoids importing these helpers. + +**Verdict:** No meaningful code reuse opportunity. The formalization appropriately uses Mathlib primitives directly. + +## 2. Citations + +**Website ([erdosproblems.com/1133](https://www.erdosproblems.com/1133)):** +- Reference: **[Er67, p.72]** +- Status: **Open** +- Tags: analysis, polynomials + +**Formalization docstring:** +- The module docstring cites `[erdosproblems.com/1133]` ✓ +- No specific citation to `[Er67, p.72]` is given. + +**Recommendation:** Add the citation `[Er67, p.72]` to the module docstring for completeness, matching the website's reference. + +## 3. Variants + +The website presents a single conjecture statement. No variants or sub-parts are listed. The formalization captures a single theorem `erdos_1133`, which matches the website's statement. + +The module docstring mentions Erdős's earlier result (with $m$ nodes and a polynomial of degree $n$), which provides useful mathematical context. This earlier result is not formalized as a separate theorem, which is appropriate since it is a *proved* prior result providing motivation, not an open problem or variant. + +**Verdict:** All variants are captured. No missing sub-problems. + +## 4. Readability + +The code is generally readable. Some observations: + +- **Good:** The docstring on `erdos_1133` clearly states the mathematical content in LaTeX. +- **Good:** Variable names (`x`, `y`, `P`, `C`, `ε`, `n`, `N`) match the mathematical convention. +- **Good:** The quantifier structure follows the natural mathematical reading. +- **Minor concern:** The condition `((univ.filter (fun i : Fin n => P.eval (x i) = y i)).card : ℝ) ≥ (1 - ε) * n` is a long inline expression. It is clear enough given the docstring, but a local `let` binding or helper predicate (e.g., `agreesOnAtLeast P x y ε n`) could improve readability. However, this is a minor stylistic point and the current form is standard for this codebase. +- **Cast to ℝ:** Both `P.natDegree` and the filter card are cast to `ℝ` for comparison with `(1 + ε) * n` and `(1 - ε) * n`. This is a natural approach to avoid floor/ceiling issues and is used consistently. + +**Verdict:** Readable. No significant issues. + +## 5. Formalizability + +The problem as stated on the website is precise and clearly formalizable: +- All quantifiers are explicit (∀ C > 0, ∃ ε > 0, ∃ N, ∀ n ≥ N, ...). +- The objects (polynomials, degree, evaluation, max over interval) all have standard Mathlib representations. +- The "approximate interpolation" condition ($P(x_i) = y_i$ for at least $(1-\varepsilon)n$ indices) is unambiguous. + +**Ambiguity assessment:** Very low. The only potential subtlety is that the website uses "polynomial of degree $m < (1+\varepsilon)n$" which could mean either $\deg P < (1+\varepsilon)n$ or $\deg P \leq m$ for some $m < (1+\varepsilon)n$. These are equivalent, and the formalization uses `natDegree < (1+ε)*n` which correctly captures this. + +**Verdict:** Clearly formalizable with negligible ambiguity. + +## 6. Correctness + +Comparing the formalization against the website statement point by point: + +| Aspect | Website | Formalization | Match? | +|--------|---------|---------------|--------| +| Universal over C > 0 | ∀ C > 0 | `∀ C : ℝ, C > 0 →` | ✓ | +| Existence of ε > 0 | ∃ ε > 0 | `∃ ε : ℝ, ε > 0 ∧` | ✓ | +| Sufficiently large n | n sufficiently large | `∃ N : ℕ, ∀ n : ℕ, N ≤ n →` | ✓ | +| Nodes x₁,...,xₙ ∈ [-1,1] | ∀ x₁,...,xₙ ∈ [-1,1] | `∀ x : Fin n → ℝ, (∀ i, x i ∈ Icc (-1) 1) →` | ✓ | +| Exist y₁,...,yₙ ∈ [-1,1] | ∃ y₁,...,yₙ ∈ [-1,1] | `∃ y : Fin n → ℝ, (∀ i, y i ∈ Icc (-1) 1) ∧` | ✓ | +| Polynomial P of degree < (1+ε)n | deg P < (1+ε)n | `(P.natDegree : ℝ) < (1 + ε) * n` | ✓ | +| Agrees at ≥ (1-ε)n nodes | P(xᵢ) = yᵢ for ≥ (1-ε)n indices | `(univ.filter (fun i => P.eval (x i) = y i)).card ≥ (1-ε)*n` | ✓ | +| Sup norm > C on [-1,1] | max_{x∈[-1,1]} \|P(x)\| > C | `∃ t ∈ Icc (-1) 1, \|P.eval t\| > C` | ✓* | + +**(\*)** The conclusion uses `∃ t ∈ Icc (-1 : ℝ) 1, |P.eval t| > C` rather than `⨆ t ∈ Icc ..., |P.eval t| > C`. These are equivalent for the purpose of this statement: "the sup exceeds C" iff "there exists a point exceeding C". Using the existential form is arguably cleaner and avoids needing `iSup` machinery. + +**Subtle point on `natDegree` vs `degree`:** The formalization uses `P.natDegree` (which is 0 for the zero polynomial). If P = 0, then `P.natDegree = 0 < (1+ε)*n` would hold for large n, but `P.eval (x i) = 0` while `y i` could be nonzero, so the agreement condition could fail. If all `y i = 0`, then `|P.eval t| = 0` which is not `> C` for C > 0, so the conclusion is vacuously avoided only if the `y` values are chosen to be nonzero (which they can be since `y` is existentially quantified). This is all consistent — the existential choice of `y` can simply avoid the zero polynomial. No issue here. + +**Equality condition `P.eval (x i) = y i`:** This uses exact equality of real numbers. In the mathematical statement, this is the intended meaning (exact interpolation at those nodes). This is correct. + +**Verdict:** The formalization is mathematically correct and faithfully captures the problem as stated on the website. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No opportunities; appropriately self-contained | +| Citations | Missing `[Er67, p.72]` reference from website | +| Variants | Complete — single statement, no missing variants | +| Readability | Good; minor opportunity for a helper predicate | +| Formalizability | High — negligible ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/1134.md b/ai-review/1134.md new file mode 100644 index 0000000000..28a13ad756 --- /dev/null +++ b/ai-review/1134.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 1134 + +## 1. Code Reuse + +**Issue found.** The formalization defines a custom `count` function and manually encodes "positive lower density" as `∃ c : ℝ, 0 < c ∧ ∀ᶠ (N : ℕ) in atTop, c ≤ (count N : ℝ) / (N : ℝ)`. The codebase already provides a density library at `FormalConjecturesForMathlib/Data/Set/Density.lean` with: + +- `Set.lowerDensity` — liminf-based lower density +- `Set.HasPosDensity` — existential positive density +- `Set.HasDensity` — convergent density + +Other problems (e.g., Problem 125, Problem 10) use these library definitions directly. Problem 1134 should follow suit. The `InSet` inductive predicate could be converted to a `Set ℕ` (via `{n : ℕ | InSet n}`) and the theorem could use `.HasPosDensity` or `0 < (...).lowerDensity` as in Problems 125 and 10. + +The custom `count` function could be eliminated entirely, simplifying the file. + +**Note on interval mismatch:** The library's `partialDensity` uses `Set.interIio` (elements `< b`), while the current `count` uses `Finset.Icc 1 N` (elements in `[1, N]`). These are asymptotically equivalent, but formally different. Using the library definitions would eliminate this subtle discrepancy. + +## 2. Citations + +**Issue found.** The docstring attributes `[La16]` to: + +> Lau, D., *Function algebras on finite sets*. Springer Monographs in Mathematics (2016). + +This appears incorrect. The erdosproblems.com page for Problem 1134 attributes `[La16]` to **Lagarias**, not Lau. Lau's book on function algebras is unrelated to this number-theoretic problem. The correct reference should be to a work by Lagarias that reports on Crampin and Hilton's disproof. + +Additionally, the website lists several other references not included in the docstring: +- **[KlRa74]** — Klarner & Rado +- **[Kl82]** — Klarner +- **[Gu83b], [Gu04]** — Guy + +The website also notes historical context: Lagarias reports that Erdős posed this problem in 1972 (offering £10 for a solution), but Hilton suggested the problem may have originated with Klarner. None of this provenance is captured. + +## 3. Variants + +**Missing variant.** The erdosproblems.com page describes a related open problem by Klarner: + +> Consider the set containing 0 and closed under x ↦ 2x, x ↦ 3x + 2, and x ↦ 6x + 3. Does this set have positive density? + +This variant is not captured in the formalization. Given that it is explicitly mentioned on the problem page and remains open, it should be included as a variant theorem. + +The website also mentions the general theory: Erdős showed that for sets closed under operations x ↦ mᵢx + bᵢ, when ∑(1/mᵢ^σ) = 1 (with σ < 1), then |A ∩ [1,X]| ≪ X^(σ+o(1)). This general framework applies here because 1/2 + 1/3 + 1/6 = 1, which is exactly why the naive approach fails and the Crampin–Hilton analysis is needed. This context is partially captured but could be made more explicit. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- The `InSet` predicate is clear and well-structured, but wrapping it into an explicit `Set ℕ` definition (e.g., `def A : Set ℕ := {n | InSet n}`) would improve readability of the theorem statement. +- Using library density definitions (as noted in §1) would make the theorem statement more idiomatic and immediately recognizable to anyone familiar with the codebase conventions. +- The `noncomputable instance : DecidablePred InSet := Classical.decPred _` line is only needed to support `count`; if `count` is eliminated via library density, this becomes unnecessary. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: define the smallest set containing 1 and closed under three explicit affine maps, then ask about its lower density. Both the set definition (inductive type) and density (via library or manual encoding) are standard formalizations. There is no mathematical ambiguity. + +The only potential subtlety is the meaning of "lower density" — the formalization correctly captures it as `liminf count(N)/N > 0` (via the eventually-bounded formulation). This is equivalent to positive lower asymptotic density, which is the standard interpretation. + +## 6. Correctness + +**The formalization is mathematically correct**, with one note: + +The theorem states `answer(False) ↔ (∃ c : ℝ, 0 < c ∧ ∀ᶠ (N : ℕ) in atTop, c ≤ (count N : ℝ) / (N : ℝ))`. This correctly encodes "the answer is No" (the set does not have positive lower density): + +- The RHS formalizes "A has positive lower density" (∃ positive c such that eventually count(N)/N ≥ c, which is equivalent to liminf count(N)/N > 0). +- `answer(False) ↔ P` means `False ↔ P`, i.e., `¬P`, i.e., A does NOT have positive lower density. +- This matches the known result (Crampin and Hilton disproved positive density). + +The inductive definition of `InSet` correctly generates the smallest set containing 1 and closed under the three operations, as Lean's inductive types give the least fixed point. + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — should use library density definitions | +| Citations | **Incorrect** — [La16] misattributed to Lau instead of Lagarias; missing references | +| Variants | **Incomplete** — Klarner's variant (0-based, operations 2x, 3x+2, 6x+3) missing | +| Readability | **Good** — minor improvements possible via library usage | +| Formalizability | **Excellent** — unambiguous, clearly formalizable | +| Correctness | **Correct** — faithful to the mathematical content | diff --git a/ai-review/1136.md b/ai-review/1136.md new file mode 100644 index 0000000000..04b067312d --- /dev/null +++ b/ai-review/1136.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 1136 + +## 1. Code Reuse + +**Issue found.** The formalization defines a local `countInInterval` function and manually encodes lower density as an existential inequality. The codebase already has a well-developed density infrastructure in `FormalConjecturesForMathlib/Data/Set/Density.lean`: + +- `Set.lowerDensity` — computes the liminf of `partialDensity` as the bound tends to infinity, which is exactly the standard definition of lower density. +- `Set.partialDensity` — the proportion of elements in `S ∩ Iio b` relative to `Iio b`. +- `Set.interIio` (from `Data/Set/Bdd.lean`) — intersection with an initial segment. + +The current formalization's lower density encoding: +```lean +∃ (δ : ℝ), δ > 1/3 ∧ + ∃ (N₀ : ℕ), ∀ (N : ℕ), N ≥ N₀ → + δ * (N : ℝ) ≤ (countInInterval A N : ℝ) +``` +could be replaced with the simpler and more canonical: +```lean +1/3 < Set.lowerDensity A +``` + +This would eliminate both the `countInInterval` helper and the manual existential encoding, while aligning with other problems in the codebase (e.g., Problems 10, 26, 244 all use `lowerDensity` or related density functions from the library). + +**Note on interval convention:** The existing `partialDensity` uses `Iio b` (elements < b), while `countInInterval` uses `Finset.Icc 1 N` (elements in [1, N]). For subsets of ℕ, these are asymptotically equivalent (they differ by at most one element and both exclude 0 in the relevant range), so the density values coincide. + +## 2. Citations + +**Minor issue.** The website attributes the solution to **Joël Müller**, but the docstring says **T. W. Müller**. The full citation in the Lean file reads: + +> [Mu11] Müller, T. W., *On the sum-of-two-powers-of-two problem* (2011). + +The website text does not give the author's full name or initials, referring only to "Müller." This discrepancy should be verified against the actual paper. If the author is indeed Thomas W. Müller (who was at Queen Mary University of London), then the Lean file's citation is plausible but should be double-checked — the erdosproblems.com listing does not provide enough information to confirm or deny the initials. + +Otherwise, the citation tag `[Mu11]`, the paper title, and the year (2011) are consistent with the website. + +## 3. Variants + +**Partially captured.** The formalization only states the original question: does there exist a set with lower density > 1/3 that is power-of-2 sum-free? This corresponds to the original problem Erdős posed in 1987. + +The website and docstring both describe **two additional results** by Müller that are not formalized: + +1. **Explicit construction:** The set of integers congruent to 3·2^i (mod 2^{i+2}) for i ≥ 0 achieves density 1/2. This could be stated as: + ``` + PowerOfTwoSumFree {n : ℕ | ∃ i : ℕ, n % 2^(i+2) = 3 * 2^i} ∧ + Set.lowerDensity {n : ℕ | ∃ i : ℕ, n % 2^(i+2) = 3 * 2^i} = 1/2 + ``` + +2. **Optimality:** No power-of-2 sum-free set can have lower density exceeding 1/2. This is a clean, precise statement that could be formalized as: + ``` + ∀ A : Set ℕ, PowerOfTwoSumFree A → Set.lowerDensity A ≤ 1/2 + ``` + +Both of these are mentioned in the docstring but not captured in the formal theorem. Including them would make the formalization significantly more complete. The current theorem, while correct for the original question, misses the sharp characterization that Müller established. + +## 4. Readability + +**Good overall, minor suggestions:** + +- The `PowerOfTwoSumFree` definition is clear and well-named. +- The `countInInterval` helper is straightforward but, as noted in §1, could be eliminated in favor of library functions. +- The docstring is well-written and provides good mathematical context. +- The `answer(True)` wrapper correctly encodes that the problem was answered affirmatively. +- Using `Finset.Icc 1 N` (starting from 1) is a reasonable convention for subsets of ℕ, avoiding the somewhat degenerate element 0. However, note that `PowerOfTwoSumFree` does not exclude 0 from consideration — if 0 ∈ A, then the condition `0 + 0 ≠ 2^k` is satisfied since 0 ≠ 2^k for all k ≥ 0 (in ℕ, 2^0 = 1 ≠ 0). This is mathematically fine. + +## 5. Formalizability + +**High — the problem is clearly formalizable.** + +The original question is precise: it asks for the existence of a set A ⊆ ℕ with lower density > 1/3 such that a + b ≠ 2^k for all a, b ∈ A and k ≥ 0. Every component has a standard mathematical meaning: +- "Lower density" is the standard asymptotic lower density (liminf of |A ∩ [1,N]|/N). +- "Power of 2" is 2^k for non-negative integer k. +- The sum-free condition is a universal quantification over pairs and exponents. + +**Ambiguity assessment: Very low.** The only potential ambiguity is whether "a + b ≠ 2^k" allows a = b (i.e., whether we consider 2a ≠ 2^k as well). The Lean formalization correctly allows a = b by quantifying over all a, b ∈ A without a distinctness requirement, which matches the standard interpretation. If a = b were excluded, the problem would be strictly weaker. + +## 6. Correctness + +**The formalization is mathematically correct but has a subtle divergence from the standard density definition.** + +**The lower density encoding is non-standard.** The formalization states: +``` +∃ (δ : ℝ), δ > 1/3 ∧ ∃ (N₀ : ℕ), ∀ (N : ℕ), N ≥ N₀ → δ * N ≤ countInInterval A N +``` + +This says: there exist δ > 1/3 and N₀ such that |A ∩ [1,N]| ≥ δ·N for ALL sufficiently large N. This is actually **stronger** than having lower density > 1/3. Having lower density > 1/3 means: + +> liminf_{N→∞} |A ∩ [1,N]|/N > 1/3 + +The formalization's condition implies the lower density is ≥ δ > 1/3, but the converse is not immediate: a set could have lower density exactly 0.4 without there being a single δ > 1/3 and N₀ such that |A ∩ [1,N]|/N ≥ δ for ALL N ≥ N₀. Actually, on further analysis, the conditions are equivalent: if liminf > 1/3, then there exists δ with 1/3 < δ < liminf and N₀ such that |A ∩ [1,N]|/N ≥ δ for all N ≥ N₀ (by the definition of liminf as a greatest lower bound of tails). So the encoding is **correct**. + +However, the encoding is **unnecessarily manual** given the library infrastructure. Using `Set.lowerDensity A > 1/3` would be more direct and maintainable. + +**The `countInInterval` convention:** The function counts elements in [1, N] rather than [0, N) or [0, N]. For density purposes this is fine — the difference is at most 1, which is negligible as N → ∞. This matches the convention in the problem statement on erdosproblems.com. + +**Overall assessment:** The formalization is correct and captures the essential mathematical content of the original problem. Its main weaknesses are (a) not leveraging existing library infrastructure for density, and (b) not including the sharper results (optimality at 1/2, explicit construction) that complete the mathematical story. diff --git a/ai-review/1138.md b/ai-review/1138.md new file mode 100644 index 0000000000..71861f2ff5 --- /dev/null +++ b/ai-review/1138.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 1138 + +## 1. Code Reuse + +**Issue found.** The `maxPrimeGap` definition (lines 37–39) manually inlines the prime gap computation: + +```lean +noncomputable def maxPrimeGap (x : ℕ) : ℕ := + (Finset.range (Nat.primeCounting' x)).sup + (fun k => Nat.nth Nat.Prime (k + 1) - Nat.nth Nat.Prime k) +``` + +The lambda `fun k => Nat.nth Nat.Prime (k + 1) - Nat.nth Nat.Prime k` is exactly `primeGap` from `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` (line 23): + +```lean +noncomputable def primeGap (n : ℕ) : ℕ := (n + 1).nth Nat.Prime - n.nth Nat.Prime +``` + +This could be simplified to: + +```lean +noncomputable def maxPrimeGap (x : ℕ) : ℕ := + (Finset.range (Nat.primeCounting' x)).sup primeGap +``` + +Problem 1137 already uses `primeGap` with `Finset.sup` (line 38: `(range x).sup primeGap`), confirming the pattern. Problem 852 also defines a local `primeGap` that could similarly be consolidated. + +Additionally, Problem 852 (line 36) defines `nthPrime (n : ℕ) := Nat.nth Nat.Prime n`, which could potentially be shared if a common alias were desired, though the formalization reasonably uses `Nat.nth Nat.Prime` directly. + +## 2. Citations + +**Correct.** The formalization cites `[Va99, 1.3]` in the docstring (line 42). The website lists the reference as `[Va99, 1.3]` — specifically Vardi, I., Section 1.3. The module-level docstring (line 28) also references `[Va99]` as "Vardi, I., 1.3." + +The full reference appears to be: Vardi, Ilan. *Computational Recreations in Mathematica* (1991), though on the website it is listed as `[Va99]`. The formalization matches the website's citation format. + +## 3. Variants + +**No issues.** The website lists a single problem statement with no variants. The formalization captures the single statement. No variants are missing. + +## 4. Readability + +**Minor suggestions.** + +- As noted in §1, replacing the inline lambda with `primeGap` would improve readability and signal the connection to the library definition. +- The ε–N quantifier style is clear and explicit. An alternative would be a `Tendsto`-based formulation (as used in the adjacent Problem 1137), but given the universal quantification over `y` in a range, the ε–N form is arguably more natural here and avoids needing an auxiliary supremum construction. +- The condition `x < 2 * y → y < x` correctly encodes `x/2 < y < x` but reads somewhat unnaturally — the reader must mentally verify the arithmetic equivalence. A brief inline comment (e.g., `-- x/2 < y < x`) might help, though this is minor. +- The file does not `open Filter Finset` or `open scoped Topology`, unlike Problem 1137. This is fine since it doesn't use `Tendsto` or unscoped `range`. + +## 5. Formalizability + +**Assessment: High — the statement is precise and unambiguous.** + +The original problem is well-defined: +- The notation `π(y + Cd) − π(y) ∼ Cd / log y` is standard asymptotic notation meaning the ratio tends to 1. +- The parameters `C > 1`, `x/2 < y < x`, and `d = max_{p_n < x}(p_{n+1} − p_n)` are all precisely specified. +- The asymptotic is taken as `x → ∞` with `y` ranging over `(x/2, x)`, requiring uniform convergence in `y` — this is the natural reading and is what the formalization captures. + +The only minor ambiguity is whether the `∼` is meant to hold uniformly over `y ∈ (x/2, x)` or pointwise for each fixed ratio `y/x`. The formalization adopts the stronger uniform interpretation (N depends only on C and ε, not on y), which is the standard reading for this type of problem. + +## 6. Correctness + +**Assessment: Correct, with one subtle point worth noting.** + +### What the formalization gets right: + +1. **Range of the max.** `Finset.range (Nat.primeCounting' x)` iterates over indices `k = 0, …, π'(x)−1`, corresponding to primes `p_0 < p_1 < … < p_{π'(x)−1}`, which are exactly the primes less than `x`. The gap `p_{k+1} − p_k` for the largest such `k` may involve `p_{k+1} ≥ x`, but this is correct because the problem condition is on `p_n < x`, not `p_{n+1} < x`. ✓ + +2. **Natural number subtraction.** Since primes are strictly increasing, `Nat.nth Nat.Prime (k+1) > Nat.nth Nat.Prime k`, so the natural subtraction does not underflow. ✓ + +3. **Floor conversion.** `⌊C * (maxPrimeGap x : ℝ)⌋₊` (i.e., `Nat.floor`) correctly converts the real-valued interval length `C · d` to a natural number for use with `Nat.primeCounting`. ✓ + +4. **Asymptotic encoding.** The statement `|ratio − 1| < ε` for all large `x` and all `y` in range correctly encodes the uniform asymptotic `∼`. ✓ + +5. **Division-by-zero edge case.** When `maxPrimeGap x = 0` (i.e., `x ≤ 2`, no primes below `x`), the denominator `C * 0 / log y = 0` causes division by zero, and the expression evaluates to some junk value. However, this is harmless: the existential `∃ N` allows choosing `N ≥ 3`, excluding these trivial cases. ✓ + +### Subtle point: + +The formalization quantifies `∀ y : ℕ` rather than `∀ y : ℝ`. Since the prime counting function takes natural arguments, restricting to natural `y` is mathematically equivalent (π is a step function, so the supremum of the deviation over real `y` in `(x/2, x)` equals the supremum over natural `y`). This is a sound design choice. ✓ + +**Overall: The formalization is mathematically correct and faithfully captures the problem as stated on erdosproblems.com.** diff --git a/ai-review/114.md b/ai-review/114.md new file mode 100644 index 0000000000..75baa8d733 --- /dev/null +++ b/ai-review/114.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 114 + +## 1. Code Reuse + +**Duplicated `arcLength` / `length` definition.** Problem 1041 (`FormalConjectures/ErdosProblems/1041.lean:38`) defines: + +```lean +noncomputable def length (s : Set ℂ) : ℝ≥0∞ := μH[1] s +``` + +Problem 114 (`FormalConjectures/ErdosProblems/114.lean:44`) defines: + +```lean +noncomputable def arcLength (S : Set ℂ) : ℝ≥0∞ := + Measure.hausdorffMeasure 1 S +``` + +These are definitionally equal (`μH[1]` is notation for `Measure.hausdorffMeasure 1`). One shared definition should be factored into a utility file and reused by both problems. + +**Related level set definitions.** The `levelCurveUnit` definition (the set where `‖p.eval z‖ = 1`) is closely related to: +- `lemniscate` in Problem 115 (line 38): `{z : ℂ | ‖p.eval z‖ ≤ 1}` (sublevel set, `≤`) +- `levelSet` in Problem 1043 (line 37): identical to `lemniscate` + +These are distinct mathematical objects (boundary vs. sublevel set), so separate definitions are appropriate. However, noting the relationship in a docstring or shared module could aid discoverability. In particular, `levelCurveUnit p = lemniscate p \ lemniscateInterior p` (from Problem 116) would be a useful lemma. + +## 2. Citations + +Comparing the formalization's docstring against [erdosproblems.com/114](https://www.erdosproblems.com/114): + +- **Date discrepancy (Fryntov–Nazarov):** The docstring says "Fryntov–Nazarov (2008)" but the website lists "Fryntov & Nazarov (2009)". Should be verified against the actual publication date. +- **Missing result (Pommerenke 1961):** The website lists Pommerenke (1961) proving `f(n) ≪ n²`, which is historically significant as one of the early bounds. The docstring omits this. +- **Missing attribution (Hayman 1974):** The website notes the problem also appears as Problem 4.10 in Hayman (1974), attributed to Erdős. Not mentioned in the docstring. +- **Missing attribution (Vayman 1999):** Vayman (1999) asked whether the length is at most `2n + O(1)`, which Tao (2025) confirmed. Not mentioned. +- **Tao uniqueness qualifier:** The docstring says Tao proved z^n − 1 is "the unique maximiser (up to rotation)". The website says "up to rotation/translation". The formalization should say "up to rotation and translation" for accuracy, since translating z^n − 1 to (z − c)^n − 1 preserves level curve length. +- **Prize.** The website lists a $250 prize. This is not mentioned in the formalization (likely by convention, but worth noting). +- **Citation format for [EHP58]:** The docstring includes a well-formatted citation. The journal reference `J. Analyse Math. 6 (1958), 125–148` matches the website. This is correct. + +## 3. Variants + +The formalization captures only the main conjecture (the inequality for all monic polynomials of degree n). Several natural variants are missing: + +1. **Tao's partial result (2025):** The conjecture is proved for all sufficiently large n. This could be formalized as a separate solved theorem: + ```lean + @[category research solved, AMS 30] + theorem erdos_114.variants.large_n : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + arcLength (levelCurveUnit p) ≤ + arcLength (levelCurveUnit ((X : Polynomial ℂ) ^ n - 1)) := by + sorry + ``` + +2. **Eremenko–Hayman n = 2 case (1999):** The full conjecture is known for n = 2, which could be a concrete solved variant. + +3. **Upper bound results:** The known bounds `f(n) ≤ Cn` for various constants (Borwein's implicit constant, Eremenko–Hayman's 9.173, Danchenko's 2π, Fryntov–Nazarov's `2n + O(n^{7/8})`) could each be formalized as solved variants. + +4. **Pommerenke lower bound (1959):** When `{z : |f(z)| < 1}` is connected, the length is at least 2π. This is mentioned on the website as a related result. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Good:** The namespace `Erdos114` keeps definitions local. The helper definitions `levelCurveUnit` and `arcLength` have clear docstrings. +- **Good:** The main theorem statement is readable, with the quantifiers and hypotheses laid out clearly. +- **Minor:** The docstring's "Known partial results" section is a nice addition for context, though it contains the date discrepancy noted above. +- **Suggestion:** The docstring could note that `‖p.eval z‖` denotes the complex modulus `|p(z)|`, since this is a Lean-specific notation choice. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: "the arc length of {z ∈ ℂ : |p(z)| = 1} is maximized when p(z) = z^n − 1, among monic polynomials of degree n." Every component has a standard mathematical meaning: + +- "Monic polynomial of degree n" — precisely `p.Monic ∧ p.natDegree = n`. +- "Arc length" — the 1-dimensional Hausdorff measure is the standard way to measure the length of a (possibly non-smooth, possibly disconnected) curve in the plane. +- The level set `{z : |p(z)| = 1}` is well-defined. + +The only potential subtlety is whether "length" should be interpreted as 1-dimensional Hausdorff measure or as arclength of a rectifiable curve. For algebraic level curves, these agree, and the Hausdorff measure is more general and appropriate for a formalization. + +**Ambiguity level: Essentially none.** The formalization is a faithful rendering of the problem. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **Norm vs. absolute value:** Using `‖p.eval z‖` (the norm on ℂ) to represent `|p(z)|` is correct, since for complex numbers the norm equals the absolute value. +- **Hausdorff measure for arc length:** Using `Measure.hausdorffMeasure 1` is the standard and correct way to define 1-dimensional length in a metric space. +- **Inequality direction:** The conjecture asserts `≤`, which is correct — z^n − 1 is claimed to be the *maximizer*, so all other monic polynomials should have level curve length at most that of z^n − 1. +- **The comparison polynomial:** `(X : Polynomial ℂ) ^ n - 1` correctly represents z^n − 1 as a polynomial in Lean. This is monic of degree n (for n ≥ 1), consistent with the hypotheses. +- **Quantifier structure:** The statement universally quantifies over n ≥ 1 and all monic polynomials p of degree n. This is correct — the conjecture applies to all degrees. +- **Rotation/translation invariance:** The formalization compares against exactly z^n − 1, not "z^n − 1 up to rotation". This is correct for the *inequality* (which is what the theorem states), since the Hausdorff measure is invariant under isometries: the level curve of p(e^{iθ}z) is a rotation of the level curve of p(z), so they have the same length. The "up to rotation" qualifier in the literature refers to *uniqueness of the maximizer*, which is Tao's result, not the inequality itself. + +**No mathematical flaws identified.** The formalization is a complete and faithful rendering of the Erdős–Herzog–Piranian conjecture. diff --git a/ai-review/1140.md b/ai-review/1140.md new file mode 100644 index 0000000000..0f09eb3bec --- /dev/null +++ b/ai-review/1140.md @@ -0,0 +1,49 @@ +# AI Review: Erdős Problem 1140 + +## 1. Code Reuse + +No significant reuse opportunities. The formalization is self-contained, relying only on `Nat.Prime` from Mathlib. The helper predicate `AllShiftsArePrime` is a simple definition specific to this problem. None of the existing `FormalConjecturesForMathlib` utilities (e.g., `maxPrimeFac`, squarefree decomposition, etc.) are relevant here since the problem is about primality of specific shifted values rather than factorization properties. + +## 2. Citations + +**Issue: Missing citation.** The [erdosproblems.com/1140](https://www.erdosproblems.com/1140) page references three works: + +- **[Va99, 1.5]** — Vaughan, R. C., *The Hardy-Littlewood Method*, 2nd ed., 1997. ✅ Present in the formalization. +- **[EpGi10]** — Epure, R. and Gica, A., 2010. ✅ Present in the formalization. +- **[MoWi89]** — Mollin, R. A. and Williams, H. C., 1989. ❌ **Missing.** The website notes that the result for $n \equiv 3 \pmod{4}$ relies on combining [EpGi10] with [MoWi89]. The docstring mentions "with at most one exception" for the $n \equiv 3 \pmod{4}$ case but does not cite Mollin and Williams. + +The existing citations lack full bibliographic detail (journal names, article titles), but this is consistent with the style used across the codebase. + +Additionally, the website lists a **related problem [#1141](https://www.erdosproblems.com/1141)** which is not mentioned in the formalization. + +## 3. Variants + +The formalization captures the main question (infinitude of qualifying $n$). No additional variants appear on the website. However, one could consider formalizing the **explicit finite list** — i.e., that the complete set of solutions is $\{2, 5, 7, 13, 31, 61, 181, 199\}$ (with at most one exception) — as a stronger companion theorem. This is not strictly required since the problem only asks about infinitude, but it would capture the full strength of the known results described in the docstring. + +## 4. Readability + +The code is clean and readable. The helper `AllShiftsArePrime` has a clear name and a concise docstring. The main theorem docstring explains the known results well. No issues. + +## 5. Formalizability + +**Fully formalizable, no ambiguity.** The problem is a precise yes/no question: does a specific set of natural numbers have infinite cardinality? The defining property ($n - 2x^2$ is prime for all $x$ with $2x^2 < n$) is entirely concrete and decidable for any given $n$. There is no ambiguity whatsoever. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **Answer encoding:** `answer(False) ↔ Set.Infinite {n : ℕ | AllShiftsArePrime n}` correctly encodes that the set is **not** infinite (i.e., finite), matching the disproved status. + +- **Natural number subtraction:** Since the hypothesis `2 * x ^ 2 < n` guarantees `2 * x ^ 2 < n`, the subtraction `n - 2 * x ^ 2` in `ℕ` does not underflow and is well-defined and positive. This is correct. + +- **Quantifier domain:** The original problem says "for all $x$ with $2x^2 < n$" where $x$ ranges over non-negative integers (or equivalently all integers, since $2x^2 = 2(-x)^2$). The formalization quantifies over `x : ℕ`, which is correct. + +- **Vacuous case for $n = 0$:** When $n = 0$, no $x : \mathbb{N}$ satisfies $2x^2 < 0$, so `AllShiftsArePrime 0` holds vacuously. This is a minor discrepancy — $0$ is not among the known solutions $\{2, 5, 7, 13, 31, 61, 181, 199\}$ — but it has no impact on the theorem's correctness since one extra element does not change finiteness. + +- **Spot-check against known values:** + - $n = 2$: $x = 0$ gives $2$ (prime) ✓; $x = 1$ gives $2 \cdot 1 = 2 \not< 2$ (no constraint). ✓ + - $n = 5$: $x = 0 \Rightarrow 5$ (prime), $x = 1 \Rightarrow 3$ (prime), $x = 2 \Rightarrow 2 \cdot 4 = 8 \not< 5$. ✓ + - $n = 13$: $x = 0 \Rightarrow 13$, $x = 1 \Rightarrow 11$, $x = 2 \Rightarrow 5$ (all prime), $x = 3 \Rightarrow 18 \not< 13$. ✓ + - $n = 4$: $x = 0 \Rightarrow 4$ (not prime). ✗ Correctly excluded. + +**Verdict: Correct and complete.** The only suggested improvement is adding the missing [MoWi89] citation. diff --git a/ai-review/1142.md b/ai-review/1142.md new file mode 100644 index 0000000000..7104a7580d --- /dev/null +++ b/ai-review/1142.md @@ -0,0 +1,71 @@ +# AI Review: Erdős Problem 1142 + +## 1. Code Reuse + +No significant reuse opportunities from the shared library. The problem concerns a specific number-theoretic property (primality of $n - 2^k$ for all valid $k$), which is self-contained. The formalization correctly uses `Nat.Prime` from Mathlib and defines a bespoke predicate `Erdos1142Prop`. None of the combinatorial utilities in `FormalConjecturesForMathlib` (arithmetic progressions, Ramsey numbers, colorings, Sidon sets, etc.) are relevant here. The helper macro `prove_erdos_1142_prop` for test cases is a well-designed local utility that cannot be meaningfully generalized. + +## 2. Citations + +**Issue: Missing citations.** The [erdosproblems.com/1142](https://www.erdosproblems.com/1142) page lists the following references: + +- **[Va73]** — Vaughan (1973), who proved an asymptotic upper bound on the count of qualifying $n \leq N$. ❌ **Missing from the formalization.** This is an important result mentioned on the website. +- **[Va99, 1.7]** — Various, *Some of Paul's favorite problems*, booklet produced for the conference "Paul Erdős and his mathematics", Budapest, July 1999. ✅ Present (listed as `[Va99]`). +- **[MiWe69]** — Mientka, W. E. and Weitzenkamp, R. C., *On f-plentiful numbers*, J. Combin. Theory 7(4), 1969, pp. 374–377. ✅ Present. +- **[Gu04]** — Guy, R. K. ❌ **Missing.** Referenced on the website but not in the formalization. + +Additionally, the website mentions a **related problem [#236](https://www.erdosproblems.com/236)**, which conjectures that the number of $1 < 2^k < n$ for which $n - 2^k$ is prime is $o(\log n)$. This related problem is not mentioned in the docstrings but would provide useful context. + +## 3. Variants + +The formalization captures two statements: + +1. **Main conjecture** (`erdos_1142`): Are there infinitely many $n > 2$ with the property? +2. **Mientka–Weitzenkamp result** (`erdos_1142.variants.mientka_weitzenkamp`): The complete list of solutions up to $2^{44}$ is $\{4, 7, 15, 21, 45, 75, 105\}$. +3. **Test cases**: All seven known solutions are individually verified, plus a negative test for $n = 106$. + +**Missing variant:** The website mentions the Vaughan (1973) asymptotic upper bound: the number of qualifying $n \leq N$ is at most $\exp\!\bigl(-c \frac{\log\log\log N}{\log\log N} \log N\bigr) N$ for some constant $c > 0$. This quantitative result could be formalized as an additional variant, though it would require defining the appropriate asymptotic bound in Lean. + +**Observation about the problem phrasing:** The website phrases the problem as asking for infinitely many $n$ **or any $n > 105$**. The "or any $n > 105$" is a weaker sub-question that is not separately formalized. One could add a variant like `¬ ∃ n, 105 < n ∧ Erdos1142Prop n` (if the answer is no) or its negation. + +## 4. Readability + +The code is clean and well-structured: + +- The predicate `Erdos1142Prop` is clearly named and documented. +- The helper macro `prove_erdos_1142_prop` is a nice touch that keeps the test proofs concise and uniform. +- Docstrings on test cases explicitly enumerate the relevant prime values, which is helpful for verification. +- The namespace `Erdos1142` keeps everything tidy. + +**Minor suggestion:** The docstring for `Erdos1142Prop` explains the $n > 2$ restriction well. However, the docstring for the main theorem `erdos_1142` could mention that this is open and that the expected answer is unknown (or at least widely believed to be "no" given the computational evidence and Vaughan's bound). + +## 5. Formalizability + +**Fully formalizable, no ambiguity.** The problem asks whether a specific, concretely-defined set of natural numbers is infinite. The defining property — $n > 2$ and $n - 2^k$ is prime for all $k \geq 1$ with $2^k < n$ — is entirely decidable for any given $n$. The question is a precise yes/no question about the cardinality of this set. There is zero ambiguity in the mathematical statement. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **Predicate definition:** `Erdos1142Prop n` requires `2 < n` and that `n - 2^k` is prime for all `k` with `0 < k` and `2^k < n`. This matches the problem statement "for all $k \geq 1$ with $2^k < n$". The condition `0 < k` correctly excludes $k = 0$ (which would give $n - 1$, not part of the original problem). + +- **Natural number subtraction:** Since $2^k < n$ is required, the subtraction `n - 2^k` in `ℕ` does not underflow and yields the correct positive value. This is handled properly. + +- **The $n > 2$ guard:** The requirement `2 < n` excludes $n = 0, 1, 2$. Without it, $n = 0$ and $n = 1$ would vacuously satisfy the primality condition (no valid $k$ exists), and $n = 2$ would also satisfy it vacuously ($2^k < 2$ requires $k = 0$, excluded by `0 < k`). The guard is consistent with the OEIS convention cited in the docstring. + +- **Answer encoding:** `answer(sorry) ↔ Infinite { n | Erdos1142Prop n }` correctly leaves the answer open (via `sorry`), matching the problem's open status. The `answer(True)` case would mean infinitely many solutions exist; `answer(False)` would mean finitely many. + +- **Mientka–Weitzenkamp variant:** The statement `{ n : ℕ | n ≤ 2 ^ 44 ∧ Erdos1142Prop n } = {4, 7, 15, 21, 45, 75, 105}` is a precise set equality, asserting both that these seven values satisfy the property and that no others up to $2^{44}$ do. This is correct per the cited result. + +- **Spot-check of test cases:** + - $n = 4$: $k = 1 \Rightarrow 4 - 2 = 2$ (prime). Only valid $k$ is 1. ✓ + - $n = 7$: $k = 1 \Rightarrow 5$, $k = 2 \Rightarrow 3$ (both prime). ✓ + - $n = 15$: $k = 1 \Rightarrow 13$, $k = 2 \Rightarrow 11$, $k = 3 \Rightarrow 7$. ✓ + - $n = 21$: $k = 1 \Rightarrow 19$, $k = 2 \Rightarrow 17$, $k = 3 \Rightarrow 13$, $k = 4 \Rightarrow 5$. ✓ + - $n = 45$: $k = 1 \Rightarrow 43$, $k = 2 \Rightarrow 41$, $k = 3 \Rightarrow 37$, $k = 4 \Rightarrow 29$, $k = 5 \Rightarrow 13$. ✓ + - $n = 75$: $k = 1 \Rightarrow 73$, $k = 2 \Rightarrow 71$, $k = 3 \Rightarrow 67$, $k = 4 \Rightarrow 59$, $k = 5 \Rightarrow 43$, $k = 6 \Rightarrow 11$. ✓ + - $n = 105$: $k = 1 \Rightarrow 103$, $k = 2 \Rightarrow 101$, $k = 3 \Rightarrow 97$, $k = 4 \Rightarrow 89$, $k = 5 \Rightarrow 73$, $k = 6 \Rightarrow 41$. ✓ + - $n = 106$: $k = 1 \Rightarrow 104 = 8 \times 13$ (not prime). Correctly rejected. ✓ + +- **Negative test adequacy:** Only one negative test ($n = 106$) is provided. This is sufficient as a sanity check, though one could additionally test a small even number like $n = 6$ ($6 - 2 = 4$, not prime) or a value like $n = 9$ ($9 - 2 = 7$ prime, $9 - 4 = 5$ prime, $9 - 8 = 1$ not prime) for broader coverage. This is a minor stylistic point. + +**Verdict: Correct and complete.** The formalization faithfully captures the problem. Suggested improvements are limited to (1) adding the missing [Va73] and [Gu04] citations, (2) mentioning the related Problem #236 in a docstring, and (3) optionally formalizing the Vaughan asymptotic bound as a variant. diff --git a/ai-review/1143.md b/ai-review/1143.md new file mode 100644 index 0000000000..d4d317f803 --- /dev/null +++ b/ai-review/1143.md @@ -0,0 +1,118 @@ +# AI Review: Erdős Problem 1143 + +## 1. Code Reuse + +Several existing files contain closely related sieve constructions that could be shared or unified: + +- **Problem 278** (`ErdosProblems/278.lean`): Defines `inclusionExclusionDensity` using the classical alternating powerset sum over LCMs, and `coveringDensity` which counts covered residues modulo `lcm`. These are closely related to the sieve bound in 1143 — in fact, for prime moduli the inclusion-exclusion density simplifies to `1 - ∏(1 - 1/p)`, which is exactly the leading term in 1143's bound. A shared `inclusionExclusionDensity` or a general `coveringCount` could serve both problems. + +- **Problem 489** (`ErdosProblems/489.lean`): Defines `sievedSet A`, the set of positive integers not divisible by any element of `A`. The complement of `sievedSet` over an interval is exactly what `countDivisible` computes. A unified definition would reduce duplication. + +- **Problem 783** (`ErdosProblems/783.lean`): Defines `unsievedCount N A`, counting integers in `[1, N]` not divisible by any element of `A`. This is the complement of `countDivisible` restricted to `n = 0`. + +- **Problem 280/281** (`ErdosProblems/280.lean`, `281.lean`): Define `sieveCount` for congruence-avoiding counts, another variant of the same pattern. + +**Recommendation:** The codebase would benefit from a shared utility defining interval-based sieve counts. At minimum, the `countDivisible` function could be moved to a shared location and reused by problems 278, 280, 281, 489, 783, 784, and 1143. + +## 2. Citations + +The formalization cites: + +> [Va99] Vaughan, R.C., *On a problem of Erdős, Straus, and Schinzel*, Combinatorica 19 (1999), 111–115. + +**Assessment:** The website (erdosproblems.com/1143) attributes the problem statement to reference [1.8] (which is the Vaughan 1999 paper), and mentions that Erdős and Selfridge found the exact bound for 2 < α < 3, but **does not provide an explicit Erdős–Selfridge citation**. The formalization's Vaughan citation matches the website's primary source. The docstring's reference `[Va99, §1.8]` should be clarified — `§1.8` could be misread as a section number of the Vaughan paper rather than a reference number on the website. The website also lists **Problem 970** (Jacobsthal's function) as a related problem; this cross-reference is absent from the formalization. + +**Recommendation:** Clarify `[Va99, §1.8]` to avoid ambiguity; add a note about the related problem 970 (Jacobsthal's function). + +## 3. Variants + +The website describes one main problem: estimate F_k(p₁, …, p_u), with particular interest in k = αp_u for α > 2. It notes: +- Erdős–Selfridge found the exact bound when 2 < α < 3. +- For α > 3, very little is known. + +The formalization captures **only a single sieve lower bound** (inclusion-exclusion minus an error term of 2^|S|). It does not formalize: +- The definition of F_k itself as the minimum over starting points (this is implicit in the ∀ n quantifier, but not named). +- The Erdős–Selfridge exact result for 2 < α < 3 as a separate solved variant. +- Any conjecture or bound specific to the α > 3 regime. +- The connection to Jacobsthal's function (Problem 970). + +**Recommendation:** Consider adding: +1. A named definition `F_k(S) := ⨅ n, countDivisible S k n` to make the core object explicit. +2. A solved variant stating the Erdős–Selfridge exact formula for 2 < α < 3 (even if the proof is `sorry`). +3. A remark or variant connecting to Jacobsthal's function. + +## 4. Readability + +**Positive:** The code is concise (69 lines) and the docstring provides good mathematical context. + +**Issues:** +- The `countDivisible` definition nests `filter` inside `filter`, making it slightly hard to parse. The inner filter `(S.filter (· ∣ m)).Nonempty` is equivalent to `∃ p ∈ S, p ∣ m`, which could be stated more directly: + ```lean + def countDivisible (S : Finset ℕ) (k n : ℕ) : ℕ := + ((Icc (n + 1) (n + k)).filter (fun m => ∃ p ∈ S, p ∣ m)).card + ``` +- The bound `2 ^ S.card` as the error term is not standard in sieve theory and deserves a brief comment explaining its origin (it arises from the maximum error of truncated inclusion-exclusion, where each of the 2^|S| subsets of S contributes at most 1 to the rounding error). +- The `open Finset` could be more targeted (e.g., `open Finset` is fine but documenting which names are used would aid navigation). + +## 5. Formalizability + +**The original problem is an estimation problem**, asking to "estimate F_k(p₁, …, p_u)." This is inherently imprecise — it does not ask for a specific bound or identity, but rather for the best possible asymptotic or exact description of F_k. + +The formalization sidesteps this ambiguity by stating a **specific, concrete sieve lower bound**. This is a reasonable choice, but it means: +- The formalization captures **a consequence** of sieve theory, not the open problem itself. +- The "open problem" nature (determining sharper estimates, exact values for α > 3) is mentioned only in the docstring, not in the formal statement. +- The bound `k * (1 - ∏(1 - 1/p)) - 2^|S|` is a valid but **weak** bound. For small |S| and large k, it is far from tight. + +**Ambiguity assessment: MODERATE.** The original problem is an open-ended estimation question, which is not directly formalizable as a single theorem. The formalization's choice to state a specific lower bound is a pragmatic resolution of this ambiguity, but it significantly narrows the scope of what Problem 1143 actually asks. + +## 6. Correctness + +### Mathematical Analysis of the Bound + +The stated bound is: + +> For any finite set of primes S, any k ≥ 1, and any n ≥ 0: +> countDivisible(S, k, n) ≥ k · (1 - ∏_{p ∈ S}(1 - 1/p)) - 2^|S| + +**Analysis:** + +The quantity `1 - ∏(1 - 1/p)` is the inclusion-exclusion density: the proportion of integers divisible by at least one prime in S. By inclusion-exclusion over the 2^|S| subsets of S, the count of multiples of at least one p ∈ S in any interval of k consecutive integers is: + +∑_{∅ ≠ T ⊆ S} (-1)^{|T|+1} · ⌊k / ∏_{p ∈ T} p⌋ + +Each floor introduces an error of at most 1, and there are 2^|S| - 1 nonempty subsets, so the total error is at most 2^|S| - 1. The exact inclusion-exclusion density times k gives: + +k · ∑_{∅ ≠ T ⊆ S} (-1)^{|T|+1} / ∏_{p ∈ T} p = k · (1 - ∏(1 - 1/p)) + +(The last equality holds because the primes are distinct, so lcm = product for any subset.) + +Therefore: + +countDivisible(S, k, n) ≥ k · (1 - ∏(1 - 1/p)) - (2^|S| - 1) + +The formalization uses `2^|S|` rather than `2^|S| - 1`, which is a slightly **weaker but still correct** bound. This is a minor conservatism, not an error. + +**However, there is a subtle issue with the interval definition.** The `countDivisible` function counts multiples in `{n+1, …, n+k}`, which is an interval of k integers. The inclusion-exclusion argument requires these to be k **consecutive** integers, which they are. The ∀ n : ℕ quantifier correctly ranges over all non-negative starting points. ✓ + +**The cast to ℝ is appropriate** since the right-hand side can be negative (when k is small relative to 2^|S|), making the bound trivially true in degenerate cases. ✓ + +**The hypothesis `hne : S.Nonempty`** is necessary — for empty S the LHS is 0 and the RHS is `k · 0 - 1 = -1`, which would make the bound trivially true anyway. So `hne` is not strictly needed but is good mathematical hygiene. ✓ + +**The hypothesis `hS : ∀ p ∈ S, Nat.Prime p`** ensures elements are prime. The bound actually holds for any set of positive integers (not just primes), since the inclusion-exclusion argument doesn't use primality. However, restricting to primes matches the problem statement and is not incorrect. ✓ + +### Verdict + +**The formalization is mathematically correct.** The stated bound is a valid (if slightly loose) consequence of inclusion-exclusion. The main limitation is that it captures only a basic sieve lower bound rather than the deeper aspects of Problem 1143 (exact values, behavior for specific α ranges). This is a **completeness** issue rather than a **correctness** issue, and is attributable to the inherent ambiguity of the original "estimate" formulation. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | **Opportunity** | `countDivisible` duplicates patterns in 278, 489, 783; could share | +| Citations | **Minor issue** | `[Va99, §1.8]` is ambiguous; missing Problem 970 cross-ref | +| Variants | **Incomplete** | Missing F_k definition, Erdős–Selfridge exact result, α > 3 variant | +| Readability | **Good** | Minor improvements possible in `countDivisible` definition | +| Formalizability | **Moderate ambiguity** | Original is open-ended "estimate"; formalization picks one bound | +| Correctness | **Correct** | Bound is valid; 2^|S| vs 2^|S|-1 is conservative but fine | diff --git a/ai-review/1144.md b/ai-review/1144.md new file mode 100644 index 0000000000..40eec55f68 --- /dev/null +++ b/ai-review/1144.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 1144 + +## 1. Code Reuse + +**`IsRademacher` is duplicated across at least 5 files.** The identical definition appears in: +- `ErdosProblems/1144.lean` +- `ErdosProblems/521.lean` +- `ErdosProblems/523.lean` +- `ErdosProblems/524.lean` +- `ErdosProblems/527.lean` + +This should be factored into a shared utility (e.g., `FormalConjecturesForMathlib/Probability/Rademacher.lean` or similar). Problem 520 has a related but distinct `IsRademacherMultiplicative` structure that bundles independence, distribution, and multiplicativity together — a cleaner design pattern that 1144 could adopt. + +Additionally, `randMultFun` (the completely multiplicative extension from prime signs) is a concept that could appear in other problems involving random multiplicative functions. It would benefit from being placed in a shared module alongside `IsRademacher`. + +No existing `FormalConjecturesForMathlib` file provides direct reuse for the probability/measure-theoretic setup here, though `Data/Nat/Factorization/Basic.lean` contains a helper (`prod_primeFactors_factorization_apply`) that could be useful for reasoning about `randMultFun`. + +## 2. Citations + +**[Va99] attribution is incomplete.** The formalization cites: +> Vaughan, R.C., *Multiplicative Number Theory I: Classical Theory*. Cambridge Tracts in Advanced Mathematics, 1999. + +This book is co-authored by **Hugh L. Montgomery and Robert C. Vaughan**. The correct citation is: +> Montgomery, H.L. and Vaughan, R.C., *Multiplicative Number Theory I: Classical Theory*. Cambridge Studies in Advanced Mathematics, Cambridge University Press, 2007. + +Note also: the series name is "Cambridge Studies in Advanced Mathematics" (not "Tracts"), and the publication year is typically given as 2007 (the first edition), not 1999. The website reference key `[Va99, 1.11]` may refer to a different source or preprint. + +**[At25] appears consistent** with the website: "Atherfold, A., *Almost sure upper bounds for random multiplicative functions*, 2025." + +**Missing acknowledgment:** The website credits Adam Harper for contributions. This is not reflected in the formalization (minor, not essential). + +## 3. Variants + +**The Steinhaus model variant is not captured.** The erdosproblems.com page explicitly mentions an alternative model where $f(p)$ is distributed uniformly over the unit circle (Steinhaus random multiplicative functions) rather than being ±1. This is a well-known companion model in the literature. + +**The merely multiplicative variant (Problem 520) is not cross-referenced.** The website states that Problem 520 "concerns partial sums of an alternative model" — namely the merely multiplicative (Rademacher multiplicative) case where $f(n) = 0$ for non-squarefree $n$. The formalization of 1144 does not mention this relationship, though 520.lean exists separately. + +A docstring noting the relationship to Problem 520 and the Steinhaus variant would improve completeness. + +## 4. Readability + +The code is generally well-structured and readable. Minor notes: + +- The helper definitions (`IsRademacher`, `randMultFun`, `partialSum`) are clearly documented with docstrings. +- The module docstring gives a clear mathematical summary. +- The use of `∃ᶠ N in atTop` to express "infinitely often" is idiomatic Mathlib. +- One minor readability improvement: the docstring on `randMultFun` could clarify that it models a *completely* multiplicative function (as opposed to merely multiplicative), since this distinction is mathematically significant and is the key difference from Problem 520. + +## 5. Formalizability + +**The problem is precise and obviously formalizable.** The mathematical statement is unambiguous: +- "Random completely multiplicative function" with Rademacher signs at primes is a standard probabilistic object. +- "limsup is infinite with probability 1" has a clear measure-theoretic meaning. +- The only source of ambiguity is the yes/no nature of the conjecture, which is correctly handled by `answer(sorry)`. + +**Assessment: No ambiguity.** The problem admits a clean, canonical formalization. + +## 6. Correctness + +**The formalization is mathematically correct**, with some observations: + +### Independence scope (minor, but correct) +The formalization requires `iIndepFun ε μ` — i.e., independence of `ε k` for *all* natural numbers `k`, not just primes. Since `randMultFun` only reads `ε` at prime indices, the values at composite indices are irrelevant. This makes the hypothesis slightly stronger than necessary (which makes the universal statement slightly weaker), but the two formulations are **mathematically equivalent**: given any family of independent Rademacher variables indexed by primes, one can always extend to all of ℕ by adjoining independent Rademacher variables at composite indices, preserving the conclusion. Compare with Problem 520, which more precisely states `iIndepFun_primes : iIndepFun (fun p : Primes ↦ f p) ℙ`. + +### The `IsRademacher` definition (correct but minimal) +The definition requires `(∀ ω, X ω = 1 ∨ X ω = -1) ∧ μ {ω | X ω = 1} = μ {ω | X ω = -1}`. Combined with `IsProbabilityMeasure μ`, the two complementary sets have measures summing to 1, forcing each to be 1/2. This is correct. However, measurability of `X` is not explicitly required; in Lean/Mathlib, `iIndepFun` implicitly involves measurability constraints, so this is likely handled downstream. + +### The `randMultFun` definition (correct) +- For `n = 0`: returns 0 (explicit case). Sensible convention. +- For `n = 1`: `factorization.support` is empty, product is 1. Correct: $f(1) = 1$. +- For `n ≥ 2`: $f(n) = \prod_{p | n} \varepsilon(p)^{v_p(n)}$. This is the standard definition of a completely multiplicative function determined by its values at primes. Correct. + +### The conclusion (correct) +`∀ᵐ ω ∂μ, ∀ C : ℝ, ∃ᶠ N in atTop, partialSum ε ω N > C * Real.sqrt (N : ℝ)` is equivalent to saying: almost surely, $\limsup_{N \to \infty} \frac{\sum_{m \leq N} f(m)}{\sqrt{N}} = +\infty$. This matches the problem statement exactly. + +### Summary +The formalization correctly captures the mathematical content of Erdős Problem 1144. The only substantive issues are (a) the [Va99] citation should credit Montgomery and Vaughan jointly, and (b) the duplicated `IsRademacher` definition should be consolidated. The independence-at-all-indices vs. independence-at-primes distinction is a stylistic choice that does not affect mathematical correctness. diff --git a/ai-review/1146.md b/ai-review/1146.md new file mode 100644 index 0000000000..ec74679e23 --- /dev/null +++ b/ai-review/1146.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 1146 + +## 1. Code Reuse + +The file defines four items locally: `schnirelmannDensity`, `sumset`, `IsEssentialComponent`, and `smoothNumbers23`. The first three are **identical** to the definitions in `ErdosProblems/37.lean` (lines 38–53). A third copy of `schnirelmannDensity` exists in `ErdosProblems/35.lean` (using `sInf` instead of `⨅`, but mathematically equivalent). + +These three definitions (`schnirelmannDensity`, `sumset`, `IsEssentialComponent`) are strong candidates for extraction into a shared utility, e.g. `FormalConjecturesForMathlib/NumberTheory/SchnirelmannDensity.lean` or a shared file under `Util/`. Problems 35, 37, and 1146 would all benefit, and Problem 37 is directly cross-referenced on the erdosproblems.com page for 1146. + +**Sumset:** The `sumset` definition duplicates Mathlib's pointwise `Set.add` (available via `open scoped Pointwise`). Using `A + B` from Mathlib's pointwise API (already used in `FormalConjecturesForMathlib/Combinatorics/Basic.lean:30`) would be more idiomatic and provide access to existing lemmas. + +**Smooth numbers:** The `smoothNumbers23` definition is bespoke. An alternative using Mathlib's `Nat.smoothNumbers 4` (which captures numbers whose prime factors are all `< 4`, i.e. exactly {2, 3}) would be semantically equivalent for `n ≥ 1`, but `smoothNumbers23` also includes `0` (via `m = 0, n = 0` giving `k = 1`, plus it would include any `2^m * 3^n` which is always ≥ 1). Meanwhile `Nat.smoothNumbers` uses strict inequality and only contains positive naturals. The current bespoke definition is acceptable given these subtle differences, but a note documenting the relationship to `Nat.smoothNumbers 4` would aid readability. + +**Density utilities:** `FormalConjecturesForMathlib/Data/Set/Density.lean` defines natural/upper/lower density (asymptotic, via limits), which is conceptually different from Schnirelmann density (an infimum, not a limit). No existing Mathlib or project utility captures Schnirelmann density, so the local definition is justified. + +## 2. Citations + +The formalization cites: + +> [Va99] Ruzsa, I. Z., *Sumsets and structure*, Combinatorial Number Theory and Additive Group Theory (1999). + +The erdosproblems.com page for Problem 1146 lists: +- **[Va99, 1.19]** as the primary reference tag +- The page also references **[Ru99]** for Ruzsa's discussion and links to **Problem #37** as a related problem. + +**Issues:** +- The citation `[Va99]` is labeled as Ruzsa's work, but the code `Va99` likely refers to the *volume* ("Varia" or similar collection) rather than Ruzsa as author. The erdosproblems.com page uses the tag `[Va99, 1.19]` which the formalization correctly reproduces. +- The docstring should mention the connection to Problem 37, which the website explicitly lists as a related problem. Problem 37 (proved by Ruzsa [Ru87]) shows that lacunary sets cannot be essential components — 3-smooth numbers are *not* lacunary (they grow too densely), which is precisely why they are the "simplest set with a chance." + +## 3. Variants + +The erdosproblems.com page presents a single question: *Is {2^m · 3^n} an essential component?* The formalization captures this exactly. + +No additional variants are listed on the website. However, one could consider natural extensions: +- Whether {p₁^m · p₂^n} is an essential component for other pairs of primes (the problem is specific to {2, 3}). +- Whether the *k*-smooth numbers for small *k* are essential components. + +These are not part of the stated problem, so the formalization is complete with respect to variants. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `smoothNumbers23` uses the notation `{2^m · 3^n : m, n ≥ 0}` while the definition uses `2 ^ m * 3 ^ n`. This is consistent and clear. +- The `sumset` docstring uses standard notation `A + B = {a + b | a ∈ A, b ∈ B}` which matches the implementation. +- Consider adding a brief note in the module docstring explaining *why* this question is interesting (e.g., "3-smooth numbers are not lacunary, so Ruzsa's result [Ru87] does not rule them out as essential components; see Problem 37"). +- The `answer(sorry)` pattern in the theorem statement correctly indicates that the answer (true or false) is unknown, which is appropriate for an open problem. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise: +- "Essential component" has a standard, unambiguous definition in additive number theory (Schnirelmann density-based). +- "3-smooth numbers" is an unambiguous, well-defined set. +- The question is a clean yes/no: either the set is an essential component or it isn't. + +The only subtlety is whether the original problem intends `ℕ` to include 0 or not. In the standard formulation, Schnirelmann density is defined over positive integers (the infimum is over `n ≥ 1`), and the set A = {2^m · 3^n : m, n ≥ 0} includes 1 (when m = n = 0) but its interaction with 0 ∈ A or 0 ∈ B is handled correctly because: +- The Schnirelmann density formula counts elements in `{1, ..., n}`, so 0 is irrelevant to the density computation. +- The sumset includes 0 + b = b for any b ∈ B when 0 ∈ A (note: `smoothNumbers23` does not contain 0, since `2^m * 3^n ≥ 1` for all `m, n : ℕ`). + +Wait — actually, `1 ∈ smoothNumbers23` (set `m = 0, n = 0`), and `0 ∉ smoothNumbers23` since `2^m * 3^n ≥ 1` for all naturals `m, n`. This means summing with `smoothNumbers23` always shifts elements by at least 1, which is important for the density analysis. The formalization correctly captures this. + +The `answer(sorry)` construction is appropriate for encoding an open yes/no question. + +## 6. Correctness + +**Assessment: Mathematically correct.** + +The formalization is faithful to the problem statement: + +1. **Schnirelmann density** (`schnirelmannDensity`): Correctly defined as `⨅ n : ℕ+, |A ∩ {1,...,n}| / n` using `Finset.Icc 1 n` and filtering by membership in `A`. The use of `ℕ+` for the index ensures the infimum is over `n ≥ 1`, avoiding division by zero. This matches the standard definition. + +2. **Sumset** (`sumset`): Correctly defined as `{n | ∃ a ∈ A, ∃ b ∈ B, n = a + b}`, which is the standard Minkowski sum for sets of naturals. + +3. **Essential component** (`IsEssentialComponent`): Correctly requires `d_s(A + B) > d_s(B)` for all B with `0 < d_s(B) < 1`. This matches the standard definition. + +4. **3-smooth numbers** (`smoothNumbers23`): Correctly defined as `{k | ∃ m n : ℕ, k = 2 ^ m * 3 ^ n}`. This produces exactly the set {1, 2, 3, 4, 6, 8, 9, 12, 16, 18, ...} — the regular numbers / 3-smooth numbers. + +5. **Theorem statement** (`erdos_1146`): Uses `answer(sorry) ↔ IsEssentialComponent smoothNumbers23`, which correctly encodes an open yes/no question whose answer is unknown. + +**One potential concern:** The Schnirelmann density, as defined using `⨅` over `ℕ+`, will produce `0` for the empty set and for sets that don't contain 1 (since `|A ∩ {1}| / 1 = 0` when `1 ∉ A`). This is mathematically standard behavior. The condition `0 < schnirelmannDensity B` in `IsEssentialComponent` therefore requires `B` to contain 1, which is conventional (some formulations explicitly require `0 ∈ B` or `1 ∈ B`). The formalization handles this correctly through the positivity constraint. + +**No mathematical flaws identified.** The formalization is complete and correct. diff --git a/ai-review/1147.md b/ai-review/1147.md new file mode 100644 index 0000000000..f4cd628241 --- /dev/null +++ b/ai-review/1147.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 1147 + +## 1. Code Reuse + +**Two significant opportunities for reuse:** + +**a) `distNearestInt`:** This function is defined independently in at least 6 files (464, 466, 495, 254, 1147, and 465 with a variant name). The definitions vary: +- 1147.lean (and 464, 466, 254): `min (Int.fract x) (1 - Int.fract x)` +- 495.lean: `|x - round x|` +- 465.lean: uses the name `distNearestInt465` + +These are mathematically equivalent. A shared definition should be extracted to a utility module (e.g., `FormalConjecturesForMathlib/Analysis/DistNearestInt.lean` or similar). + +**b) `IsAdditiveBasisOrder2`:** This is a custom definition that duplicates existing infrastructure. `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` already defines `Set.IsAsymptoticAddBasisOfOrder` (auto-generated via `@[to_additive]` from `Set.IsAsymptoticMulBasisOfOrder`). On `ℕ`, the library's `Set.IsAsymptoticAddBasisOfOrder S 2` is semantically equivalent to the custom `IsAdditiveBasisOrder2 S`: + +- Custom: `∃ N₀, ∀ n ≥ N₀, ∃ a ∈ S, ∃ b ∈ S, n = a + b` +- Library: `∀ᶠ a in cofinite, a ∈ S + S` (which on `ℕ` with `cofinite_eq_atTop` becomes `∃ N₀, ∀ n ≥ N₀, n ∈ S + S`, i.e., `∃ a ∈ S, ∃ b ∈ S, n = a + b`) + +The custom definition should be replaced with the library version. + +## 2. Citations + +The website (last edited 27 January 2026) lists: +- **[Va99]**: Vaughan, R.C., *The Hardy-Littlewood method*, 2nd edition, Cambridge University Press, 1997. — Section 1.21. +- **[Ko16b]**: Konieczny, J., 2016. + +The formalization's citations match in substance but **[Ko16b] is incomplete** — no paper title is given. The website itself appears not to provide a full title either, so this may be acceptable, but ideally the citation should include the full reference: Konieczny, J., *On the set of distances between two elements in a set with no repeated sums of pairs* (or whatever the actual paper title is — this should be verified against the actual publication). + +Additionally, the website credits **Quanyu Tang** for contributions; the formalization does not mention this, though it is not strictly necessary. + +## 3. Variants + +**The formalization is missing a notable generalization.** The website states a stronger result: + +> For any ε(n) → 0, the set A = {n ≥ 1 : ‖αn²‖ < ε(n)} is not an additive basis of order 2 for almost every α > 0. + +This is a strictly stronger statement than the specific case ε(n) = 1/log n. The formalization only captures the original question with the specific threshold 1/log n and the specific counterexample α = √2. A variant theorem capturing the general ε(n) → 0 result would be mathematically valuable. + +The counterexample for α = √2 specifically is mentioned in the docstring but not formalized as a separate statement, which could also be a useful variant. + +## 4. Readability + +The code is generally readable, with some suggestions: + +- The `setA` definition is clear and well-documented with a LaTeX docstring. +- The `distNearestInt` definition is standard and clear. +- The theorem statement `erdos_1147 : answer(False) ↔ ∀ α ...` is clear: `answer(False)` encodes that the conjecture was disproved. +- The docstring on `erdos_1147` is well-written and explains both the problem and its resolution. +- **Minor**: The namespace `Erdos1147` scopes the local definitions well, preventing clashes with the identical `distNearestInt` definitions in other files. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- The set A is well-defined given α and the distance-to-nearest-integer function. +- "Additive basis of order 2" has a standard meaning. +- The irrational and positive conditions on α are clear. +- The disproof is a concrete mathematical fact. + +The only mild ambiguity is whether "additive basis of order 2" means *every* natural number or *every sufficiently large* natural number can be represented. The formalization correctly uses the asymptotic (sufficiently large) version, which is standard in additive number theory. + +## 6. Correctness + +**The formalization is mathematically correct but has a subtle issue worth noting.** + +**Correct aspects:** +- The `answer(False)` correctly encodes that the conjecture was disproved: `False ↔ P` is equivalent to `¬P`, meaning the universal statement over all irrational α > 0 is false. +- The set definition `setA` correctly captures {n ≥ 1 : ‖αn²‖ < 1/log n}. +- The `distNearestInt` definition correctly computes min(frac(x), 1 - frac(x)), which equals the distance to the nearest integer. +- The `n ≥ 1` condition avoids the degenerate case where log(0) is undefined and 1/log(1) = 1/0. + +**Potential concern:** +- For `n = 1`: `Real.log 1 = 0`, so `1 / Real.log 1 = 1 / 0`. In Lean 4 / Mathlib, division by zero for reals gives `0`, so `1 / Real.log 1 = 0`. The condition `distNearestInt (α * 1²) < 0` is never true (since `distNearestInt` is nonneg). So n = 1 is effectively excluded from setA despite satisfying n ≥ 1. This is mathematically harmless (it doesn't affect whether setA is an additive basis of order 2) but is worth noting — the `n ≥ 1` guard is not sufficient to avoid the log singularity at n = 1; the guard would need to be `n ≥ 2` for the condition `1/log n` to be positive. In practice this doesn't affect correctness since it only means one element is silently excluded. + +**Overall: Correct and complete for the problem as stated. The main gap is the absence of the stronger generalization to arbitrary ε(n) → 0.** diff --git a/ai-review/1149.md b/ai-review/1149.md new file mode 100644 index 0000000000..1f7f7fadcd --- /dev/null +++ b/ai-review/1149.md @@ -0,0 +1,49 @@ +# AI Review: Erdős Problem 1149 + +## 1. Code Reuse + +No directly reusable code from `FormalConjecturesForMathlib` applies here. The existing combinatorics infrastructure (sum-free sets, Ramsey theory, Sidon sets, arithmetic progressions) targets different problem domains. Problem 1149 is a number-theoretic density statement using standard Mathlib constructs (`Finset.Icc`, `Nat.Coprime`, `Tendsto`, `nhds`, `Real.pi`, `⌊·⌋₊`), all of which are already available from the `ProblemImports` utility. No custom library code is needed. + +## 2. Citations + +The formalization cites: + +- **[Va99]** Vardi, I., *Computational Recreations in Mathematica* (1999), Problem 1.34. +- **[BeRi17]** Bergelson, V. and Richter, F. K., *Dynamical generalizations of the prime number theorem and disjointness of additive and multiplicative semigroup actions* (2017). + +The website (erdosproblems.com/1149) lists the reference as `[Va99, 1.34]` and notes the problem was proved by Bergelson and Richter `[BeRi17]`. Both citations match. No discrepancies. + +## 3. Variants + +The website presents a single statement with no variants or generalizations mentioned. The formalization captures the complete problem. No variants are missing. + +## 4. Readability + +The code is clean and readable. The docstring clearly explains the mathematical content, including the intuitive interpretation that `n` and `⌊n^α⌋` "behave like independent random integers with respect to coprimality." The structure — hypothesis names `hα_pos` and `hα_not_int`, the use of `Finset.Icc 1 x` for the range, and the explicit density limit — all follow standard conventions. No improvements needed. + +## 5. Formalizability + +**Assessment: Unambiguous and precisely formalizable.** + +The problem statement is entirely explicit: +- "density" is standard natural (asymptotic) density — the limit of the counting proportion — which is exactly what the `Tendsto` formulation captures. +- `gcd(n, ⌊n^α⌋) = 1` is a concrete arithmetic predicate. +- The constant `6/π²` is precise. + +There is no ambiguity in the statement whatsoever. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +- **Range**: `Finset.Icc 1 x` gives `{1, 2, …, x}`, matching "integers n ≥ 1." +- **Floor function**: `⌊(n : ℝ) ^ α⌋₊` is `Nat.floor` applied to `n^α`. Since `n ≥ 1` and `α > 0`, we have `n^α ≥ 1 > 0`, so `⌊n^α⌋₊ = ⌊n^α⌋` throughout the summation range. This is correct. +- **Exponentiation**: With `(n : ℝ)` and `α : ℝ`, the expression `(n : ℝ) ^ α` resolves to `Real.rpow`, which for positive real bases gives the expected value. Since `n ≥ 1` in the filtered range, the base is always positive, so rpow behaves as standard exponentiation. +- **Coprimality**: `Nat.Coprime n (⌊(n : ℝ) ^ α⌋₊)` is `Nat.gcd n ⌊n^α⌋₊ = 1`, matching the problem statement. +- **Density as limit**: The expression `card(filter) / x` with `Tendsto ... atTop (nhds (6 / Real.pi ^ 2))` correctly formalizes natural density equaling `6/π²`. +- **Non-integer condition**: `∀ k : ℤ, (k : ℝ) ≠ α` correctly excludes all integer values of `α`. The quantification over `ℤ` rather than `ℕ` is harmless (negative integers are already excluded by `hα_pos`), and is arguably cleaner since it directly says "α is not an integer." +- **Limit value**: `6 / Real.pi ^ 2 = 1/ζ(2)` is the correct constant. + +No mathematical flaws identified. The formalization is a faithful and complete translation of the problem. diff --git a/ai-review/115.md b/ai-review/115.md new file mode 100644 index 0000000000..eaaa1e26a1 --- /dev/null +++ b/ai-review/115.md @@ -0,0 +1,116 @@ +# AI Review: Erdős Problem 115 + +## 1. Code Reuse + +**Significant duplication of the lemniscate definition.** The `lemniscate` definition at line 38 is semantically identical to definitions across at least 4 other files: + +- `ErdosProblems/115.lean:38` — `lemniscate` = `{z : ℂ | ‖p.eval z‖ ≤ 1}` +- `ErdosProblems/1120.lean:36` — `lemniscateSet` = `{z : ℂ | ‖f.eval z‖ ≤ 1}` +- `ErdosProblems/509.lean:83` — inline `{z | ‖f.eval z‖ ≤ 1}` (closed sublevel set, used directly) +- `ErdosProblems/116.lean:51` — `lemniscateInterior` = `{z : ℂ | ‖p.eval z‖ < 1}` (strict variant) +- `ErdosProblems/1044.lean:39` — `lemniscateSublevel` = `{z : ℂ | ‖f z‖ < 1}` (strict, for general functions) + +The closed lemniscate set (`lemniscate` / `lemniscateSet`) should be factored into a shared utility, e.g. `FormalConjecturesForMathlib/Analysis/Polynomial/Lemniscate.lean`, with both closed and open variants. + +## 2. Citations + +The formalization's citations are: +- `[Er61, Er90]` — Early formulations by Erdős ✓ +- `[ErLe94]` — Eremenko and Lempert ✓ +- `[Po59a]` — Pommerenke ✓ + +These match the references listed on [erdosproblems.com/115](https://www.erdosproblems.com/115), which lists: +- [Er61, p.246] +- [Er90] +- [Po59a] — Pommerenke (1959) +- [ErLe94] — Eremenko & Lempert (1994) + +**No missing citations.** The formalization covers all references from the website. + +**Minor:** The docstring cites "[ErLe94] Eremenko, A. and Lempert, L., proved the conjecture" without providing the paper title. For consistency with other files in the codebase (e.g., 114.lean, 116.lean), the full citation should be included: *Eremenko, A. and Lempert, L., An extremal problem for polynomials, Proc. Amer. Math. Soc. 122 (1994), 191–193.* + +## 3. Variants + +The website does not list additional variants beyond the main statement. The formalization's docstring correctly notes: + +- The original conjecture was without the o(1) term (i.e., an exact n²/2 bound). +- Szabados observed the exact bound fails. +- The asymptotic form with o(1) was then proved by Eremenko–Lempert. +- Pommerenke's weaker bound of (e/2)n². + +**No missing variants.** + +## 4. Readability + +**Good overall.** The code is well-structured: +- The `lemniscate` definition is cleanly separated with a docstring. +- The theorem docstring provides historical context (Erdős → Szabados counterexample → Pommerenke → Eremenko–Lempert). +- The ε-N formalization of the o(1) bound is clearly explained in the docstring. + +**Minor improvements:** +- The namespace `Erdos115` and the `open Polynomial` scope are clean and appropriate. +- The relationship to adjacent problems (114, 116, 509) could be mentioned briefly to aid navigation. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** Assessment: **low ambiguity**. + +The o(1) asymptotic notation is correctly captured via the standard ε-N formulation. The set-level definition of the lemniscate is unambiguous. Polynomial degree, derivative, and connectedness all have standard Mathlib counterparts. + +**One source of ambiguity:** The original problem as stated on the website does not specify whether the polynomial is monic. As analyzed in Section 6 below, this omission is consequential and likely reflects ambiguity in the original problem formulation. + +## 6. Correctness + +### **CRITICAL ISSUE: The formalization as stated is provably false.** + +The theorem claims that for every ε > 0, there exists N such that for all n ≥ N, every degree-n polynomial p with connected lemniscate satisfies: + +‖(derivative p).eval z‖ ≤ (1/2 + ε) · n² + +for all z in the lemniscate. **This is false. The Chebyshev polynomials provide an explicit counterexample.** + +#### Counterexample: Chebyshev polynomials T_n + +- **Degree:** T_n has degree n (leading coefficient 2^{n−1}). +- **Connected lemniscate:** The critical values of T_n are all ±1 (modulus 1), so {z : |T_n(z)| ≤ 1} is connected. +- **z = 1 is in the lemniscate:** T_n(1) = 1, so |T_n(1)| = 1 ≤ 1. ✓ +- **Derivative at z = 1:** T_n'(1) = n². This is a classical identity (verifiable: T_2'(1) = 4, T_3'(1) = 9, T_4'(1) = 16). + +For any ε < 1/2, the bound requires n² ≤ (1/2 + ε) · n², i.e., 1 ≤ 1/2 + ε, i.e., ε ≥ 1/2. So **for any ε ∈ (0, 1/2), the bound fails for T_n for ALL n ≥ 2**, regardless of the choice of N. + +Concrete example with T_2: T_2(z) = 2z² − 1, T_2'(z) = 4z, T_2'(1) = 4. The lemniscate is connected (critical point z = 0, critical value T_2(0) = −1, |−1| = 1 ≤ 1). Bound: (1/2 + 0.01) · 4 = 2.04. But |T_2'(1)| = 4 > 2.04. ✗ + +#### Likely correct fix: add `p.Monic` + +The missing hypothesis is almost certainly **monicness** (`p.Monic`). Evidence: + +1. **Every other lemniscate problem in this codebase requires monicness:** Problem 114 (`p.Monic`), Problem 509 (`f.Monic`), Problem 1120 (`f.Monic`), Problem 116 (constructs polynomial as a product of linear factors, which is monic). Problem 115 is the sole outlier. + +2. **The Chebyshev counterexample disappears for monic polynomials.** The monic Chebyshev polynomial T̃_n = T_n / 2^{n−1} has T̃_n'(1) = n² / 2^{n−1} → 0, which trivially satisfies the bound. + +3. **The erdosproblems.com statement** says simply "polynomial of degree n" without specifying monic, but the original Erdős papers [Er61, Er90] are about metric properties of polynomials in the context of monic normalization (the paper [EHP58] cited by adjacent problems 114 and 116 is explicitly about monic polynomials). + +4. **The docstring's claim that "Chebyshev polynomials show that the constant 1/2 is sharp"** is paradoxical without monicness — Chebyshev polynomials *disprove* the bound rather than showing its sharpness. With monicness, this claim would make mathematical sense in a different asymptotic regime. + +#### Suggested corrected statement + +```lean +theorem erdos_115 : + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∀ p : Polynomial ℂ, p.Monic → p.natDegree = n → + IsConnected (lemniscate p) → + ∀ z : ℂ, z ∈ lemniscate p → + ‖(derivative p).eval z‖ ≤ (1 / 2 + ε) * (n : ℝ) ^ 2 := by + sorry +``` + +**Note:** Even with the monic fix, the claim that "Chebyshev polynomials show the constant 1/2 is sharp" requires further verification. For the monic Chebyshev polynomial, max|p'| on the lemniscate is n²/2^{n−1} → 0, which does NOT approach n²/2. The sharpness of the constant 1/2 for monic polynomials may come from a different family of polynomials. The docstring's claim about Chebyshev should be verified against the Eremenko–Lempert paper. + +### Secondary issue: `IsConnected` vs. nonemptiness + +When n ≥ 1, the lemniscate is always nonempty (it contains the roots of p). The `IsConnected` predicate in Mathlib requires both nonemptiness and preconnectedness. This is correctly used here — the interesting condition is connectivity, and nonemptiness follows from the polynomial having roots for n ≥ 1. For the vacuous case n = 0 (constant polynomial), the derivative is 0 and the bound is trivially satisfied regardless. + +### Verdict + +**The formalization contains a critical mathematical error.** The theorem as stated is provably false (counterexample: Chebyshev polynomials). The most likely fix is adding the hypothesis `p.Monic`, consistent with all other lemniscate problems in the codebase. The docstring's claim about Chebyshev sharpness may also need revision. diff --git a/ai-review/1151.md b/ai-review/1151.md new file mode 100644 index 0000000000..441a27ceca --- /dev/null +++ b/ai-review/1151.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 1151 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `lagrangeBasis`, `lagrangeInterp`, and `chebyshevNode` in this file are defined independently, but nearly identical `lagrangeBasis` definitions appear in at least four sibling files: + +- `ErdosProblems/1129.lean` — `lagrangeBasis` via `univ.filter (· ≠ k)` +- `ErdosProblems/1130.lean` — same +- `ErdosProblems/1131.lean` — same +- `ErdosProblems/1132.lean` — same + +Problem 1151 uses `Finset.univ.erase i` while the others use `univ.filter (· ≠ k)`. These are extensionally equal for `Fin n` but syntactically different, which is an unnecessary inconsistency. A shared definition in `FormalConjecturesForMathlib` (or a shared utility within the Erdős problems) would eliminate this duplication and ensure uniform behavior. + +Additionally, `limitPoints` is a custom definition that duplicates Mathlib's topological notion of cluster points. Problem 419 uses `MapClusterPt` from Mathlib for the same purpose. The custom `limitPoints` could be replaced or shown equivalent to: +``` +limitPoints a = {y | MapClusterPt y atTop a} +``` +This would integrate more naturally with Mathlib's filter/topology API. + +Chebyshev nodes of the first kind may exist in Mathlib's polynomial/Chebyshev infrastructure (e.g., `Polynomial.Chebyshev`), though the root-based definition used here is simple enough to stand on its own. + +## 2. Citations + +The docstring references: +- **[Er41]** — mentioned without a full citation. Should be expanded, e.g.: + *Erdős, P., "On divergence properties of the Lagrange interpolation parabolas", Annals of Mathematics (1941).* +- **[Er43]** — mentioned without a full citation. Should be expanded, e.g.: + *Erdős, P., "On some convergence properties of the interpolation polynomials", Annals of Mathematics (1943).* +- **[Va99]** — Varga, R.S., *Scientific Computation on Mathematical Problems and Conjectures*, 1999. The specific reference is **[Va99, 2.41]** (Problem 2.41 in Varga's book). The docstring includes the `[Va99, 2.41]` tag on the theorem but provides the Varga citation only in the module docstring. This is adequate. + +The website lists the same references. The formalization should include full citations for [Er41] and [Er43] in the module docstring to match the level of detail provided for [Va99]. + +## 3. Variants + +The website itself notes ambiguity: *"I am unclear exactly what is intended here — is this meant for fixed, arbitrary, x ∈ [-1,1]?"* + +There are at least two natural readings: + +1. **For every x ∈ [-1,1]** and every closed A ⊆ [-1,1], there exists continuous f achieving A as the limit set. (This is what the formalization states.) +2. **For x = cos(πp/q) with p, q odd** (the special points from [Er41]) and every closed A, there exists such f. (This is the more conservative reading of [Er43].) + +The formalization captures interpretation (1), which is strictly stronger than (2). No variant for interpretation (2) is provided. Given the acknowledged ambiguity, it would be valuable to include a variant restricted to points of the form x = cos(πp/q) with p, q odd, which is the context in which Erdős originally made the claim. + +The formalization also restricts A ⊆ [-1,1]. The original problem statement says "any closed set A" without explicitly bounding it. Since Lagrange interpolation polynomials can take values outside [-1,1] (the Runge phenomenon), the limit set could in principle be any closed subset of ℝ. A variant with A as an arbitrary closed subset of ℝ (not restricted to [-1,1]) may be worth considering, although the [-1,1] restriction is a reasonable default interpretation. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `chebyshevNode` correctly describes the formula. The 0-indexing is clearly documented. +- The `lagrangeBasis` and `lagrangeInterp` docstrings include LaTeX and are clear. +- The `limitPoints` docstring gives the ε-N characterization, which is appropriate. +- The main theorem statement is clean and self-documenting. + +**Minor style note:** The `lagrangeBasis` here uses `Finset.univ.erase i`, while related problems (1129–1132) use `Finset.univ.filter (· ≠ k)`. Harmonizing this across files would improve cross-problem readability. + +## 5. Formalizability + +**Medium ambiguity.** The problem as stated on the Erdős problems website is acknowledged to be ambiguous even by the website maintainer. The key points of ambiguity are: + +1. **Which x?** The claim in [Er43] was specifically for x = cos(πp/q) with p, q odd. The generalization to all x ∈ [-1,1] is a natural but unverified extension. +2. **Which closed sets?** Whether A is restricted to subsets of [-1,1] or all of ℝ. +3. **Continuity domain:** The formalization requires global continuity (`Continuous f` on all of ℝ), which is stronger than continuity on [-1,1]. This is a minor point since any continuous function on [-1,1] can be extended continuously to ℝ (Tietze extension), but it's worth noting. + +Despite these ambiguities, the mathematical content is precise enough to formalize — the ambiguity is in *which* statement to formalize rather than in any inherent vagueness. The chosen formalization is a reasonable (if strong) interpretation. + +## 6. Correctness + +**The formalization is mathematically reasonable but makes debatable modeling choices.** + +**Correct aspects:** +- The Chebyshev node formula `cos((2k+1)π/(2n))` for k ∈ Fin n is the standard definition of Chebyshev nodes of the first kind (zeros of the Chebyshev polynomial Tₙ), correctly 0-indexed. +- The Lagrange basis polynomial definition is standard. +- The Lagrange interpolation formula `∑ᵢ f(xᵢ) · ℓᵢ(x)` is correct. +- Using `n + 1` nodes (via `chebyshevNode (n + 1)`) avoids the degenerate case of 0 nodes. + +**Potential issues:** +1. **`limitPoints` vs topology:** The custom `limitPoints` defines the set of cluster points of a real sequence using the ε-N characterization. This is correct but does not integrate with Mathlib's `MapClusterPt` or the topological `clusterPt` definitions. An experienced mathematician would prefer the topological formulation for consistency with the Mathlib ecosystem. + +2. **Overstrength of the universal quantifier over x:** As discussed, the formalization claims the result for *all* x ∈ [-1,1], which is stronger than what [Er43] claims. If the problem is only true for the specific x values from [Er41], the formalization would be false as stated. This is the most significant correctness concern, and it is attributable to ambiguity in the problem statement. + +3. **Domain restriction on A:** Restricting A ⊆ [-1,1] is a modeling choice. If the intended statement allows A to be any closed subset of ℝ, the formalization is incomplete. However, since the interpolation is of a continuous function at nodes in [-1,1], and continuity bounds f on [-1,1], the interpolation values *can* still be unbounded (Lagrange interpolation does not preserve bounds). So restricting A to [-1,1] may exclude achievable limit sets. + +4. **Empty set edge case:** The formalization allows A = ∅ (which is closed and a subset of [-1,1]). This would require the existence of a continuous f whose Lagrange interpolants at x have no cluster points (i.e., the sequence diverges to ±∞). This is consistent with [Er41], which shows divergence to ∞ is possible for specific x, so this edge case appears to be correctly handled. + +**Overall assessment:** The formalization is a reasonable interpretation of an inherently ambiguous problem. The most significant concern is the universal quantification over all x ∈ [-1,1], which may be stronger than what Erdős intended. The restriction A ⊆ [-1,1] may also be unnecessarily restrictive. These issues stem from ambiguity in the source material rather than errors in the formalization logic itself. diff --git a/ai-review/1152.md b/ai-review/1152.md new file mode 100644 index 0000000000..5db7c924f2 --- /dev/null +++ b/ai-review/1152.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 1152 + +## 1. Code Reuse + +Several related problems define Lagrange basis and interpolation utilities: + +- **Erdős 671** (`ErdosProblems/671.lean`): Defines `lagrangeBasisEval`, `lebesgueFunction`, `lagrangeInterpolation` with the same triangular-array signature `(n : ℕ) → Fin n → ℝ`. +- **Erdős 1151** (`ErdosProblems/1151.lean`): Defines `lagrangeBasis`, `lagrangeInterp`, `chebyshevNode`. +- **Erdős 1129, 1130** define similar Lagrange basis and Lebesgue function/constant utilities. + +However, Problem 1152 deliberately does **not** use Lagrange interpolation definitions. It instead quantifies over arbitrary polynomials (`Polynomial ℝ`) satisfying interpolation and degree constraints. This is mathematically correct and more faithful to the problem statement, which does not restrict to Lagrange interpolants. The use of `Polynomial ℝ` with `natDegree` and `eval` is the right choice here, and these come from Mathlib directly. + +**Shared patterns with no reuse opportunity**: The triangular array setup (`∀ n, ∀ k : Fin n, x n k ∈ Icc ...` + `Function.Injective`) appears identically in Problem 671. One could factor out a `ValidTriangularArray` predicate, but this would be premature abstraction for a conjectures repository. + +**Verdict**: No actionable code reuse. The approach is appropriate. + +## 2. Citations + +The formalization references: +- `[EKS89] Erdős, P., Kroó, A., and Szabados, J., *On convergent interpolatory polynomials* (1989).` +- `[Va99] Vértesi, P., *Classical (unweighted) and weighted interpolation* (1999).` + +The website (erdosproblems.com/1152) lists: +- The problem is attributed to **[Va99, 2.42]** (matching the formalization's theorem docstring). +- The contrasting result by Erdős, Kroó, and Szabados [EKS89] is mentioned (matching). + +**Issue**: The formalization attributes [Va99] to "Vértesi, P." while the website's "How to cite" credits "T. F. Bloom" as the page author. These are not in conflict — Bloom curates the website, while Vértesi is the author of the referenced paper [Va99] from which problem 2.42 is drawn. The citation appears correct. + +**Verdict**: Citations are consistent with the website. No issues found. + +## 3. Variants + +The website lists a single problem statement with no additional parts or variants. The formalization captures exactly this single question. The contrasting result by Erdős–Kroó–Szabados (fixed ε > 0 case) is documented in the module docstring for context but is not formalized, which is appropriate since it is a known theorem, not an open problem. + +**Verdict**: All variants captured. + +## 4. Readability + +The code is well-structured: +- The module docstring clearly explains the problem and provides context (the contrasting [EKS89] result). +- The theorem docstring gives a concise mathematical summary. +- Variable names are conventional (`x` for nodes, `ε` for the decay rate, `f` for the continuous function, `p` for polynomials, `t` for the evaluation point). +- The `answer(sorry)` pattern correctly signals this is an open yes/no question. +- The `n ≥ 1` guard on the degree condition is clear. + +**Minor suggestion**: The module docstring uses `$x_{1,n}, \ldots, x_{n,n}$` (1-indexed) while the formalization uses `Fin n` (0-indexed). This is standard and not confusing, but could be noted explicitly if desired. + +**Verdict**: Good readability. No changes needed. + +## 5. Formalizability + +The problem is clearly formalizable. It asks a definite yes/no question: "Does there **always** exist a continuous function f such that...?" The quantifier structure is unambiguous: +- ∀ nodes (triangular array in [-1,1], distinct) +- ∀ ε (positive, tending to 0) +- ∃ f (continuous on [-1,1]) +- ∀ p (polynomial sequence satisfying degree and interpolation constraints) +- conclusion: divergence a.e. + +The only potential ambiguity is the meaning of "almost all" — Lebesgue measure is the standard interpretation, and the formalization correctly uses `volume.restrict (Icc (-1 : ℝ) 1)`. + +**Verdict**: Low ambiguity. The problem is precise enough to be obviously formalizable. + +## 6. Correctness + +### Quantifier structure +The formalization correctly captures the nested quantifiers of the problem. The universal quantification over nodes and ε, followed by existential quantification over f, followed by universal quantification over polynomial sequences, matches the problem statement exactly. + +### Degree constraint +The condition `((p n).natDegree : ℝ) < (1 + ε n) * n` correctly captures deg(p_n) < (1 + ε(n))n. The cast to `ℝ` is necessary since `ε n` is real-valued. The guard `n ≥ 1` avoids a vacuous constraint at n = 0 (where `Fin 0` is empty anyway). + +### Interpolation condition +`(∀ n, ∀ k : Fin n, (p n).eval (x n k) = f (x n k))` correctly says p_n agrees with f at all n nodes of level n. For n = 0, this is vacuously true (Fin 0 is empty), which is harmless. + +### Almost-everywhere divergence +`∀ᵐ t ∂(volume.restrict (Icc (-1 : ℝ) 1)), ¬Tendsto (fun n => (p n).eval t) atTop (nhds (f t))` correctly says: for a.e. t ∈ [-1,1], the sequence p_n(t) does not converge to f(t). + +### Positivity of ε +The formalization requires `∀ n, 0 < ε n`, while the problem only states ε(n) → 0. This is a mild but inconsequential restriction: +- If ε(n) < 0 for some n, then (1+ε(n))n < n, and interpolating n distinct points with a polynomial of degree < n may be impossible (since the unique interpolant through n points generally has degree n−1). In such cases, no valid polynomial sequence p exists satisfying both the degree and interpolation constraints, making the conclusion hold vacuously. +- Therefore, restricting ε > 0 does not change the mathematical content of the problem. + +### Edge case: existence of interpolating polynomials +A subtle point: the formalization quantifies over **all** polynomial sequences satisfying the constraints. It does not assert that such sequences exist. If for a given f and nodes, no polynomial sequence satisfies both constraints simultaneously, the universal quantification is vacuously true. This is mathematically correct — the interesting case is when such sequences do exist (which they do for ε(n) > 0 and sufficiently regular f, since degree < (1+ε)n > n gives enough freedom beyond the n interpolation constraints). + +### Overall correctness assessment +The formalization is **correct and complete**. The mathematical content faithfully represents the Erdős problem as stated on the website and in [Va99, 2.42]. No flaws identified. + +**Verdict**: Correct. No issues found. diff --git a/ai-review/1153.md b/ai-review/1153.md new file mode 100644 index 0000000000..228f0688ee --- /dev/null +++ b/ai-review/1153.md @@ -0,0 +1,101 @@ +# AI Review: Erdős Problem 1153 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `lagrangeBasis` and `lebesgueFunction` are copy-pasted (with minor variation) across **six** files: + +| File | `lagrangeBasis` product over | `lebesgueFunction` | +|------|-----------------------------|--------------------| +| 1153 | `univ.erase k` | Yes | +| 1151 | `Finset.univ.erase i` | No (uses `lagrangeInterp`) | +| 1129 | `univ.filter (· ≠ k)` | Yes | +| 1130 | `univ.filter (· ≠ k)` | Yes | +| 1131 | `univ.filter (· ≠ k)` | No (uses L² version) | +| 1132 | `univ.filter (· ≠ k)` | Yes | +| 671 | `univ.filter (· ≠ i)` (as `lagrangeBasisEval`) | Yes | + +There are two formulations of the product: `univ.erase k` (used in 1153, 1151) and `univ.filter (· ≠ k)` (used in 1129, 1130, 1131, 1132). These are definitionally equal (`Finset.filter_ne'`), but the inconsistency is unnecessary. All of these could share a single definition from a common utility file. + +**Recommendation:** Extract `lagrangeBasis` and `lebesgueFunction` into a shared file (e.g., `FormalConjectures/Util/LagrangeInterpolation.lean`) and import it from all six problem files. Problem 1129 also defines `ValidNodes`, `boundary`, `lebesgueConstant` which are reused verbatim in 1130 — further evidence for extraction. + +## 2. Citations + +The website lists the citation as **[Va99, 2.44]**, referring to: +> Varga, R.S., *Scientific Computation on Mathematical Problems and Conjectures*, 1999. + +The formalization's docstring does **not** include any citation shorthand at all — it only references the URL. The historical results mentioned in the docstring (Bernstein's result, Erdős's improvement, Chebyshev optimality) are consistent with the website, but the specific citation `[Va99, 2.44]` should be added to the module docstring for traceability, as is done in problems 1129 (`[Ki77]`, `[dBPi78]`), 1130 (`[dBPi78]`), 1131, and 1132 (`[Be31]`). + +The website also notes **related problems #1129 and #1132**, which are not cross-referenced in the 1153 docstring. + +**Recommendation:** Add `[Va99, 2.44]` citation and cross-references to related problems 1129 and 1132. + +## 3. Variants + +The website states the problem simply as: for any fixed subinterval [a,b] ⊆ [-1,1], is max_{x∈[a,b]} λ(x) > (2/π − o(1)) log n? + +The formalization captures exactly this single statement. The website does not list additional variants or sub-parts for problem 1153. The problem is stated as proved ("solved in the affirmative"). + +One could consider whether the stronger form — with the exact constant 2/π and an O(1) additive error rather than o(1) in the coefficient — should also be formalized as a variant. The docstring mentions that Erdős proved max_{x∈[-1,1]} λ(x) > (2/π) log n − O(1) for the full interval, and the conjecture asks whether the same holds for subintervals. A natural strengthened variant would be: + +> For any [a,b] ⊆ [-1,1], does max_{x∈[a,b]} λ(x) > (2/π) log n − C_{a,b} for some constant C depending only on a,b? + +This is a stronger statement than the one formalized (which only asks for (2/π − ε) log n for large n). However, since the website does not explicitly state this stronger form as part of the problem, its omission is acceptable. + +**Assessment:** All variants from the website are captured. No missing variants. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good:** Clear docstrings on `lagrangeBasis`, `lebesgueFunction`, and the main theorem. +- **Good:** The module docstring provides helpful mathematical context about Bernstein's and Erdős's results. +- **Good:** The quantifier structure in the theorem statement reads naturally and matches the mathematical statement. +- **Minor:** The `answer(True)` wrapper is used, consistent with the problem being marked as solved. This is the correct convention. +- **Minor:** The `open Finset BigOperators Set` is appropriate for the notation used. + +**Assessment:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem statement is **precise and unambiguous**. All quantities are well-defined: + +- The Lagrange basis polynomials are a standard construction given distinct nodes. +- The Lebesgue function λ(x) = Σ|ℓ_k(x)| is well-defined for any choice of distinct nodes. +- The quantifier structure "for all ε > 0, there exists N, for all n ≥ N, for all nodes, ..." precisely captures the "o(1)" in the original statement. +- The interval constraints (a < b, −1 ≤ a, b ≤ 1) are explicit. +- Node distinctness is captured by `Function.Injective nodes`. +- The existence of x ∈ [a,b] achieving the bound is captured by `∃ x ∈ Icc a b`. + +The only potential ambiguity in the original problem is the meaning of "o(1)" — does it mean o(1) as n → ∞ uniformly over all node choices, or for each node choice? The formalization interprets it as: for any ε > 0 and sufficiently large n, the bound (2/π − ε) log n holds for **all** node configurations simultaneously. This is the correct (and stronger) uniform interpretation, which is the standard reading. + +**Assessment:** Unambiguous. Formalizability rating: **high**. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed verification: + +1. **Lagrange basis definition (line 48-49):** The product ∏_{i ∈ univ.erase k} (x − nodes i)/(nodes k − nodes i) correctly computes ℓ_k(x). For distinct nodes, nodes k − nodes i ≠ 0 when i ≠ k, so the division is well-defined. (Note: in Lean, division by zero yields 0 for reals, so if nodes are not distinct, the definition still type-checks but gives meaningless values. The theorem statement separately requires `Function.Injective nodes`, which is correct.) + +2. **Lebesgue function (line 52-53):** Σ_k |ℓ_k(x)| is the standard definition. + +3. **Theorem statement (lines 63-72):** The formalization states: + - For all a < b with [a,b] ⊆ [-1,1], for all ε > 0, there exists N such that for all n ≥ N, for all injective node functions into [-1,1], there exists x ∈ [a,b] with lebesgueFunction(nodes, x) > (2/π − ε) · log n. + + This correctly captures the conjecture. The `answer(True)` is consistent with the problem being proved. + +4. **Edge case — n = 0 or n = 1:** When n = 0, `Fin 0 → ℝ` is the empty function, `Function.Injective nodes` is vacuously true, and `lebesgueFunction nodes x = 0` (empty sum). The bound becomes `0 > (2/π − ε) · log 0`. Since `Real.log 0 = 0` in Mathlib (log is defined as 0 for non-positive inputs), this becomes `0 > 0` when ε < 2/π, which is false. However, the ∃ N quantifier means we can choose N ≥ 2, so the n = 0 and n = 1 cases are avoided. For n = 1, the Lebesgue function is identically 1, and log 1 = 0, so the bound 1 > (2/π − ε) · 0 = 0 holds trivially. **No issue here.** + +5. **`@[category research solved, AMS 41]`:** The tag `solved` matches the website status ("Proved"). AMS 41 (Approximations and expansions) is appropriate. + +**Assessment:** The formalization is correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | **Needs improvement** | `lagrangeBasis`/`lebesgueFunction` duplicated across 6+ files; should be extracted to shared utility | +| Citations | **Needs improvement** | Missing `[Va99, 2.44]` citation and cross-references to #1129, #1132 | +| Variants | **Good** | All website variants captured | +| Readability | **Good** | Clear docstrings and natural quantifier structure | +| Formalizability | **High** | Unambiguous, precisely captures the o(1) quantifier structure | +| Correctness | **Correct** | Mathematically sound; edge cases handled by ∃N quantifier | diff --git a/ai-review/1154.md b/ai-review/1154.md new file mode 100644 index 0000000000..16dc2842e6 --- /dev/null +++ b/ai-review/1154.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 1154 + +## 1. Code Reuse + +The formalization is very concise (a single theorem statement with no auxiliary definitions), so there is limited opportunity for code reuse. The only shared patterns are: + +- **`dimH` usage:** The Kakeya problem (`FormalConjectures/Wikipedia/Kakeya.lean`) uses `dimH` in a structurally similar way (e.g., `dimH S = n`). However, each problem applies `dimH` to different types of sets, so no shared abstraction is warranted. +- **`ENNReal.ofReal` conversion:** Used across many problems (116, 114, 335, 158, 1044, 1041, 1120, etc.) as a standard Mathlib idiom. No custom wrapper needed. +- **`Subring ℝ`:** No other problem in the codebase uses `Subring ℝ`, so there is nothing to consolidate. + +**Assessment:** No code reuse opportunities. The formalization appropriately uses Mathlib primitives directly. + +## 2. Citations + +The formalization cites: + +> [Er79h] Erdős, P., *Some unconventional problems in number theory*. Math. Mag. 52 (1979), p. 119. + +The website (erdosproblems.com/1154) lists **two** source citations: +- **[Er79h, p.119]** — present in the formalization ✓ +- **[Va99, 2.48]** — referring to Varga, R.S., *Scientific Computation on Mathematical Problems and Conjectures* (1999), problem 2.48. **Missing from the formalization.** + +The docstring mentions results by Erdős–Volkmann, Falconer, Edgar–Miller, and Mauldin, which are consistent with the website's description. However, the specific papers are not cited by reference tag. This is acceptable for contextual remarks (as opposed to the primary source citation), but adding `[Va99, 2.48]` to the module docstring would improve traceability. + +**Recommendation:** Add `[Va99, 2.48]` to the module-level docstring reference list. + +## 3. Variants + +The website states the problem as: *"Does there exist, for every α ∈ [0,1], a ring or field in ℝ with Hausdorff dimension α?"* + +The formalization captures the **subring** version only. Two observations: + +1. **Subfield variant:** The website explicitly mentions Mauldin's result that subfields of every Hausdorff dimension exist *assuming the continuum hypothesis*. A natural variant would be: + ``` + ∀ (α : ℝ), 0 ≤ α → α ≤ 1 → + ∃ S : Subfield ℝ, dimH (↑S : Set ℝ) = ENNReal.ofReal α + ``` + Since every subfield is a subring, the subring version is weaker (easier to satisfy) than the subfield version. The website's phrasing "ring or field" suggests both are of interest. The subfield variant under CH could be formalized as a separate solved theorem. + +2. **Subgroup analogue:** The docstring mentions Erdős–Volkmann proved the analogous result for subgroups. This could be a companion theorem: + ``` + ∀ (α : ℝ), 0 ≤ α → α ≤ 1 → + ∃ S : AddSubgroup ℝ, dimH (↑S : Set ℝ) = ENNReal.ofReal α + ``` + This is a proved result and would provide useful context. + +**Assessment:** The primary variant (subrings) is captured. The subfield variant and the proved subgroup analogue are natural companions that could be added. + +## 4. Readability + +The code is clean and concise. Specific observations: + +- **Good:** The module docstring provides excellent mathematical context (Erdős–Volkmann for subgroups, Falconer's restriction, Edgar–Miller, Mauldin under CH). +- **Good:** The theorem statement is a direct, natural translation of the mathematical question. +- **Good:** The `open MeasureTheory` and namespace structure are minimal and appropriate. +- **Minor:** The docstring on the theorem uses `$\alpha \in [0,1]$` (LaTeX) while the module docstring uses `α ∈ [0,1]` (Unicode). This inconsistency is cosmetic. + +**Assessment:** Readability is excellent. No changes needed. + +## 5. Formalizability + +The problem is **precisely and unambiguously formalizable**. All components are well-defined: + +- **"Subring of ℝ"** maps directly to Mathlib's `Subring ℝ`, which is a subset of ℝ closed under 0, 1, +, -, ×. This is the standard modern algebraic convention (rings with unity). Note that any `Subring ℝ` necessarily contains ℤ (hence is countably infinite at minimum), but ℤ has Hausdorff dimension 0, so the constraint α ∈ [0,1] is still meaningful. +- **"Hausdorff dimension α"** maps to `dimH (↑S : Set ℝ) = ENNReal.ofReal α`. Hausdorff dimension is a standard, well-defined concept in Mathlib's measure theory library. +- **The quantifier structure** `∀ α ∈ [0,1], ∃ S : Subring ℝ, ...` directly mirrors the natural language. + +The only potential source of ambiguity is whether "ring" means "ring with unity" or "rng" (without unity). In the latter case, the formalization would use a hypothetical `SubRng` type. However: +- The standard convention in modern algebra is rings-with-unity. +- Mathlib's `Subring` includes unity, which is the standard formalization choice. +- The question becomes harder (and thus more interesting) when unity is required, since the subring must contain ℤ. + +**Assessment:** Unambiguous. Formalizability rating: **high**. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed verification: + +1. **Type correctness:** `dimH` returns `ℝ≥0∞` (extended non-negative reals), and `ENNReal.ofReal α` converts α ∈ ℝ to `ℝ≥0∞`. For α ∈ [0,1], `ENNReal.ofReal α` is well-behaved (non-negative input ensures no clamping to 0). + +2. **Coercion `(↑S : Set ℝ)`:** The coercion from `Subring ℝ` to `Set ℝ` gives the carrier set. This is the correct set on which to compute Hausdorff dimension. + +3. **Range of α:** The constraint `0 ≤ α → α ≤ 1` is correct. The Hausdorff dimension of any subset of ℝ is in [0,1] (since ℝ has topological dimension 1 and `dimH S ≤ dimH ℝ = 1`). So asking for α ∈ [0,1] is exactly the right range. + +4. **`answer(sorry)`:** The problem is tagged `research open`, and `answer(sorry)` correctly indicates the answer boolean is undetermined. This is consistent with the website's status: the problem is open in general (though solvable under CH). + +5. **Edge cases:** + - α = 0: The subring ℤ (or ℚ) has Hausdorff dimension 0, since it is countable. This case is trivially satisfiable. + - α = 1: The subring ℝ itself has Hausdorff dimension 1. This case is trivially satisfiable. + - α ∈ (0, 1): This is the non-trivial part. The Edgar–Miller result implies such subrings cannot be Borel or analytic, so any construction must be non-constructive (e.g., using AC or CH). + +6. **Consistency with known results:** The docstring's claim that "Falconer showed that any subring with Hausdorff dimension α ∈ (1/2,1) cannot be Borel or Suslin" is consistent with the website. Edgar–Miller's result (Borel/analytic subrings have dimension 0 or equal ℝ) is a strengthening. Mauldin's CH result for subfields is correctly noted. + +**Assessment:** The formalization is correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | **Good** | No reuse opportunities; appropriately uses Mathlib primitives | +| Citations | **Needs improvement** | Missing `[Va99, 2.48]` reference from website | +| Variants | **Adequate** | Subring version captured; subfield variant and proved subgroup analogue could be added | +| Readability | **Excellent** | Clean, concise, well-documented | +| Formalizability | **High** | Unambiguous, direct translation of mathematical statement | +| Correctness | **Correct** | Mathematically sound; edge cases and known results consistent | diff --git a/ai-review/1155.md b/ai-review/1155.md new file mode 100644 index 0000000000..b42b39a0f7 --- /dev/null +++ b/ai-review/1155.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 1155 + +## 1. Code Reuse + +**Issue: Custom triangle definitions duplicate Mathlib's `CliqueFree`.** + +The file defines its own `ContainsTriangle` and `TriangleFree` in the `Erdos1155` namespace. Mathlib already provides `SimpleGraph.CliqueFree` (in `Mathlib.Combinatorics.SimpleGraph.Clique`), where `G.CliqueFree 3` is exactly "triangle-free." Using Mathlib's definition would be more canonical and give access to existing API lemmas. + +Additionally, Erdős Problem 573 (`FormalConjectures/ErdosProblems/573.lean`) defines its own `TriangleFree` with a different but logically equivalent formulation (`∀ u v w, G.Adj u v → G.Adj v w → ¬G.Adj u w`). If a local definition is preferred, these two files should share one. + +**Recommendation:** Replace `ContainsTriangle`/`TriangleFree` with `SimpleGraph.CliqueFree 3`, or at minimum factor a shared definition into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. + +## 2. Citations + +The formalization's docstring includes: +- **[Bo98]** Bollobás, B., _Modern Graph Theory_, Graduate Texts in Mathematics 184, Springer (1998). ✓ +- **[Va99]** Vu, V. H. (1999), 3.61. ✓ +- **[BFL15]** Bohman, Frieze, and Lubetzky, _Random triangle removal_, Advances in Mathematics 280 (2015), 379–438. ✓ + +**Missing citation:** The website also references **Grable [Gr97]**, who proved the earlier result that P(f(n) > n^{7/4+ε}) → 0 for every ε > 0. This intermediate result is not mentioned in the formalization's docstring. Since the website lists it, it should be included for completeness: + +> [Gr97] Grable, D. A., _On random greedy triangle packing_, Electronic Journal of Combinatorics 4 (1997). + +The problem also originated at the 1990 "Quo Vadis, Graph Theory?" conference (Bollobás–Erdős), per the website. This context is absent but is a minor omission. + +## 3. Variants + +The formalization captures two parts: +- **Part 1:** E[f(n)] ≍ n^{3/2} (two-sided bound on expectation). +- **Part 2:** f(n) ≪ n^{3/2} almost surely (a.s. upper bound). + +**Missing variant:** The known result of Bohman–Frieze–Lubetzky [BFL15] establishes f(n) = n^{3/2+o(1)} a.s., which is strictly stronger — it gives both an a.s. upper bound AND an a.s. lower bound. A natural third variant capturing the full BFL15 result would be: + +``` +∀ ε > 0, P(n^{3/2 - ε} ≤ f(n) ≤ n^{3/2 + ε}) → 1 +``` + +This would complement the two original conjectures and document the state of the art. Since the original problem asks about both E[f(n)] and a.s. behavior, and BFL15 essentially resolves the a.s. part (up to sub-polynomial factors), a formalization of the BFL15 result as a variant would be valuable. + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The docstrings are clear and accurately describe the mathematical content. +- The split into Part 1 (expectation) and Part 2 (almost sure) is natural and clean. +- The exponent `(3 : ℝ) / 2` appears four times; a local abbreviation (e.g., `let three_halves : ℝ := 3/2`) would reduce clutter, though this is minor. +- The `open SimpleGraph Filter` and `open scoped Topology` are appropriate. + +## 5. Formalizability + +**Assessment: Low formalizability as stated; the opaque approach is a reasonable compromise.** + +The core difficulty is that the problem involves a **stochastic process** — the random triangle removal process on K_n. A fully rigorous formalization would require: +1. Constructing the probability space for the sequential random triangle removal process (a filtration on a product space). +2. Defining f(n) as a random variable on this space. +3. Stating convergence in probability or almost sure statements. + +This is well beyond what current Mathlib probability infrastructure supports. The use of `opaque` for `triangleRemovalExpectedEdges` and `triangleRemovalEdgeProb` is a pragmatic choice that captures the mathematical content without constructing the underlying measure theory. + +**Ambiguity in the original statement:** The problem statement on erdosproblems.com is reasonably precise for a combinatorial probability problem. The main ambiguity is in "almost surely" — the formalization interprets this as "with probability tending to 1" (i.e., convergence in probability / with high probability), which is the standard meaning in this combinatorial context (as opposed to measure-theoretic a.s. convergence for a single probability space). This interpretation is correct. + +## 6. Correctness + +**6a. Part 1 (Expectation bounds):** ✓ Correct. + +The statement ∃ c₁ c₂ > 0, ∀ᶠ n, c₁·n^{3/2} ≤ E[f(n)] ≤ c₂·n^{3/2} accurately captures E[f(n)] ≍ n^{3/2}. The use of `∃ N₀, ∀ n ≥ N₀` correctly handles the "sufficiently large n" quantifier. + +**6b. Part 2 (Almost sure upper bound):** ⚠️ Partially correct, with caveats. + +The formalization states: ∃ C > 0, `Tendsto (fun n => P(f(n) ≤ C·n^{3/2})) atTop (nhds 1)`. + +This correctly captures "f(n) = O(n^{3/2}) with high probability." However: + +- The original problem asks "f(n) ≪ n^{3/2} almost surely." The notation f(n) ≪ n^{3/2} means f(n) = O(n^{3/2}), and "almost surely" in this combinatorial context means "with high probability" (w.h.p.), which is what the formalization captures. ✓ +- **Subtle issue:** The `triangleRemovalEdgeProb` is a completely opaque, unaxiomatized function with no connection to `triangleRemovalExpectedEdges`. There is no axiom asserting that `triangleRemovalEdgeProb n P` actually represents the probability of event P for the same random process whose expectation is `triangleRemovalExpectedEdges n`. In principle, one could satisfy Part 1 and Part 2 independently with unrelated interpretations. This is an inherent limitation of the opaque approach but worth noting — a comment in the code acknowledging that these two opaque constants refer to the same underlying process would improve clarity. + +**6c. `answer(sorry)` wrapper:** Both theorems use the `answer(sorry) ↔ ...` pattern, which is the standard project convention for open problems. ✓ + +**Overall correctness verdict:** The mathematical content is faithfully captured modulo the fundamental limitation that the stochastic process is not constructed. The formalization is sound as a *specification* of what the conjecture asserts, though not as a self-contained formal statement (since the opaque constants carry no axioms linking them to any actual probability space). diff --git a/ai-review/1156.md b/ai-review/1156.md new file mode 100644 index 0000000000..1aa0ec48d5 --- /dev/null +++ b/ai-review/1156.md @@ -0,0 +1,126 @@ +# AI Review: Erdős Problem 1156 + +## 1. Code Reuse + +**Observation:** Problem 1156 uses a bespoke `opaque chromaticNumberProb` definition to represent the probability that the chromatic number of G(n, 1/2) satisfies a predicate. Several other problems in the codebase define analogous probabilistic primitives: + +- **Problem 900** (`erdosRenyiProbability` in `ErdosProblems/900.lean`): A fully *noncomputable* (not opaque) definition for the G(n, m) model, computing the fraction of graphs with m edges satisfying property P. This is a concrete, principled definition. +- **Problem 745** (`gnpProb745` in `ErdosProblems/745.lean`): A *noncomputable* definition for the G(n, 1/n) model, summing Bernoulli edge-weights over all edge configurations satisfying P. This is also concrete. + +Problem 1156 could in principle reuse the approach of Problem 745 (which models G(n, p) via explicit Bernoulli weights) specialized to p = 1/2. With p = 1/2, the G(n, 1/2) model is the uniform distribution over all 2^(n choose 2) labeled graphs on n vertices, so the even simpler counting approach of Problem 900 (adapted from G(n, m) to G(n, p)) could also work. In particular, `chromaticNumberProb n P` could be replaced with a noncomputable definition like: + +```lean +noncomputable def chromaticNumberProb (n : ℕ) (P : ℕ → Prop) : ℝ := + let total := (Finset.univ : Finset (SimpleGraph (Fin n))) + ((total.filter (fun G => P G.chromaticNumber)).card : ℝ) / (total.card : ℝ) +``` + +or via explicit Bernoulli weights as in Problem 745. The current `opaque` definition hides the semantics entirely, making the formalization weaker than it needs to be—any theorem proved about it would hold vacuously for *any* function with that signature. A concrete definition would be strictly more meaningful. + +**Recommendation:** Replace the `opaque` with a `noncomputable def` using either the uniform-counting approach or the Bernoulli-weight approach. Consider factoring out a shared `gnpProb` utility in `FormalConjecturesForMathlib` or `Util/` for reuse across Problems 745, 900, and 1156. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already defines `cochromaticNumber` and `chromaticCardinal`, but these are for specific graphs, not random graph models, so they are not directly reusable here. + +## 2. Citations + +**Website references** (from [erdosproblems.com/1156](https://www.erdosproblems.com/1156)): +- [Bo88] Bollobás, B., 1988 — proved χ(G) ~ n/(2 log₂ n) w.h.p. +- [ShSp87] Shamir, E. and Spencer, J., 1987 — concentration within o(√n) +- [AlSp92] Alon, N. and Spencer, J., *The Probabilistic Method*, Wiley, 1992 +- [AlSp16] Alon, N. and Spencer, J., 2016 — refined result requiring ω(n) log n / √n → ∞ +- [Vu99] Vu, V.H., 1999 +- [Sc17] Scott, A., 2017 — alternative proof of Alon-Spencer result +- [He21] Heckel, A., 2021 — proved ω(n) > n^c for infinitely many n, any c < 1/4 +- [HeRi23] Heckel, A. and Riordan, O., 2023 — improved to any c < 1/2 + +**Formalization citations:** +- [AlSp92] — correctly referenced ✓ +- [Vu99] — referenced as `[Vu99]` but the website lists it as `[Va99]` (likely a typo on one side; the actual paper is Vu, V.H., 1999, so `[Vu99]` seems more accurate than `[Va99]`) +- The docstring mentions "Heckel and Riordan proved concentration cannot be within n^c for c < 1/2" — this corresponds to [HeRi23] but is not cited by tag in the Lean file. + +**Issues:** +- The docstring references to Bollobás, Shamir & Spencer, and Heckel & Riordan are informal prose without citation tags. Consider adding [Bo88], [ShSp87], [HeRi23] explicitly. +- The website lists additional references [AlSp16], [Sc17], [He21] that are not mentioned at all. +- Part 2 cites `[Vu99]` — verify whether this should be `[Va99]` per the website, or whether the website has the typo. + +## 3. Variants + +The website states two parts to Problem 1156: +1. Is there a constant C such that χ(G) is concentrated on at most C values? (Open) +2. For sufficiently slowly growing ω(n) → ∞, does there exist f(n) such that P(|χ(G) − f(n)| < ω(n)) < 1/2? (The anticoncentration direction) + +The formalization captures both: +- `erdos_1156` — Part 1 (constant concentration) ✓ +- `erdos_1156.variants.anticoncentration` — Part 2 (anticoncentration) ✓ + +**Assessment:** All variants from the website appear to be captured. No missing variants detected. + +## 4. Readability + +**Strengths:** +- The module docstring gives good mathematical context with key historical results. +- Both theorem statements have clear docstrings explaining the mathematical content. +- The `open Filter` / `open scoped Topology` are appropriate for `atTop` usage. + +**Suggestions:** +- The `chromaticNumberProb` docstring is clear but could note that it is opaque and what axioms the user should assume about it (or better, make it noncomputable as discussed in §1). +- Part 2's docstring says "the chromatic number cannot be concentrated in any interval of width 2ω(n) with probability ≥ 1/2" — this is a helpful plain-English gloss. +- Minor: the quantifier structure in Part 2 reads `∀ f : ℕ → ℝ, ∀ᶠ n in atTop, ...` which is correct but dense. A brief inline comment wouldn't hurt. + +Overall readability is good. + +## 5. Formalizability + +**Part 1 (constant concentration):** +The statement "χ(G(n,1/2)) is almost surely concentrated on at most C values" is well-defined and unambiguous. The formalization correctly captures this as: ∃ C, ∀ ε > 0, eventually ∃ S with |S| ≤ C and P(χ ∈ S) ≥ 1 − ε. + +**Part 2 (anticoncentration):** +The website asks: does there exist a *sufficiently slowly growing* ω(n) → ∞ and a function f(n) such that P(|χ(G) − f(n)| < ω(n)) < 1/2? The formalization instead states: ∃ ω with ω → ∞ such that **for all** f, eventually P(|χ − f(n)| < ω(n)) < 1/2. + +This is a subtle but important difference. The website version asks whether there exists some specific ω and f achieving anticoncentration. The formalization universally quantifies over f, which is strictly stronger — it says no centering function can achieve concentration within the band ω(n). This stronger formulation is actually more natural and is consistent with the Heckel-Riordan result (which shows anticoncentration holds for *any* centering), so it appears to be a reasonable (and arguably more precise) interpretation. + +**Ambiguity assessment:** Low. The core concepts (Erdős-Rényi G(n,1/2), chromatic number, concentration) are all standard. The main source of potential ambiguity is the exact quantifier structure in Part 2, which the formalization resolves in a mathematically natural way. + +## 6. Correctness + +**Part 1 (`erdos_1156`):** +``` +∃ C : ℕ, ∀ ε : ℝ, 0 < ε → + ∀ᶠ n in atTop, + ∃ S : Finset ℕ, S.card ≤ C ∧ + chromaticNumberProb n (· ∈ S) ≥ 1 - ε +``` + +This correctly formalizes: there exists a universal constant C such that for any ε > 0, for all sufficiently large n, the chromatic number falls in some set of at most C values with probability ≥ 1 − ε. The key point is that C is independent of ε and n, while S may depend on both ε and n. This is mathematically correct. + +**Note:** The set S is allowed to depend on n (since it's inside the `∀ᶠ n`). This is correct — the conjecture is about the *number* of concentration values being bounded by a constant, not about the values themselves being fixed. + +**Part 2 (`erdos_1156.variants.anticoncentration`):** +``` +∃ ω : ℕ → ℝ, Tendsto ω atTop atTop ∧ + ∀ f : ℕ → ℝ, ∀ᶠ n in atTop, + chromaticNumberProb n (fun k => |(k : ℝ) - f n| < ω n) < 1 / 2 +``` + +This says: there exists ω → ∞ such that for *any* centering function f, for all sufficiently large n, the probability that χ lands within distance ω(n) of f(n) is less than 1/2. This is a strong anticoncentration statement. + +**Potential issue:** The threshold 1/2 is somewhat arbitrary but standard for this type of result. The Heckel-Riordan result actually shows something stronger (for any c < 1/2, ω(n) cannot be n^c), but the formulation with probability < 1/2 is a clean and standard way to express it. ✓ + +**Critical concern with `opaque`:** Because `chromaticNumberProb` is `opaque`, both theorems are technically *trivially satisfiable* — one could define `chromaticNumberProb` to be identically 1 (or any other constant) and the statements would have nothing to do with random graphs. This is a significant formalization weakness. The `opaque` keyword means the definition is permanently hidden, so no axioms about this function's behavior are provable. For the formalization to be meaningful, `chromaticNumberProb` should either be: +1. A `noncomputable def` with a concrete definition, or +2. Accompanied by axioms characterizing its behavior (e.g., that it equals the uniform probability over all graphs on n vertices). + +**Summary:** The mathematical content of both parts is correctly captured modulo the `opaque` issue. The quantifier structures are sound, types are appropriate (ℕ for chromatic number and set size, ℝ for probabilities and centering functions), and the use of `Filter.atTop` for "sufficiently large n" is standard. + +--- + +## Overall Assessment + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ⚠️ Improvable | Could reuse patterns from Problems 745/900 instead of opaque | +| Citations | ⚠️ Incomplete | Missing [Bo88], [ShSp87], [HeRi23], [AlSp16], [Sc17], [He21] tags | +| Variants | ✅ Complete | Both website parts captured | +| Readability | ✅ Good | Clear docstrings, appropriate structure | +| Formalizability | ✅ High | Low ambiguity, standard concepts | +| Correctness | ⚠️ Mathematically correct, structurally weak | `opaque` makes theorems vacuous; should be `noncomputable def` | diff --git a/ai-review/1157.md b/ai-review/1157.md new file mode 100644 index 0000000000..ecca21b078 --- /dev/null +++ b/ai-review/1157.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 1157 + +## 1. Code Reuse + +**Significant duplication exists across the hypergraph problem family.** Problem 1157 defines the most generic hypergraph infrastructure in the repository: + +- `UniformHypergraph (r n : ℕ)` — generic r-uniform hypergraph structure +- `edgesSpannedBy` — counts edges spanned by a vertex set +- `IsFree` — (k,s)-free property +- `extremalNumber` — the function f_r(n; k, s) + +However, the closely related problems 716, 1076, and 1178 each define their own independent hypergraph structures: + +- **Problem 716** (`Erdos716.Hypergraph3`) — defines its own 3-uniform hypergraph structure and free property. +- **Problem 1076** (`Erdos1076.Hypergraph3`) — defines its own 3-uniform hypergraph structure with a subhypergraph relation. +- **Problem 1178** — uses a predicate `IsRUniform` instead of a structure, plus its own `turanNumber` and `ContainsConfig`. +- **Problem 1075** — defines `UniformHypergraph (n r : ℕ)` with reversed parameter order compared to 1157's `UniformHypergraph (r n : ℕ)`. + +**Recommendation:** Consider extracting the hypergraph definitions from 1157 into a shared utility (e.g., `Util/Hypergraph.lean`) that can be imported by all hypergraph problems. Problem 1157's definitions are generic enough to serve as the canonical infrastructure. The 3-uniform specializations in 716 and 1076 could instantiate `UniformHypergraph 3 n` rather than defining their own structures. + +No existing code in `FormalConjecturesForMathlib/` was identified as directly relevant (the codebase reuse search focused on arithmetic functions, which are unrelated to this problem). + +## 2. Citations + +The docstring includes two references: + +- **[BES73]** — Provided as: *Brown, W.G., Erdős, P., and Sós, V.T., "Some extremal problems on r-graphs", New Directions in the Theory of Graphs (1973).* This matches the website's citation of [BES73]. +- **[Va99]** — Provided as: *"See erdosproblems.com/1157."* The website references this as "[Va99,3.64]" but no full bibliographic data is available on the erdosproblems.com page either. The formalization's approach of directing readers to the website is a reasonable fallback, but the reference format is inconsistent with [BES73]. If the full citation can be identified (possibly Vatter 1999, or another author), it should be expanded. + +**Issue:** The cross-references to problems [1178], [716], and [1076] in the docstring are helpful but are rendered as plain text rather than as links or formal cross-references. + +## 3. Variants + +The formalization captures the **general Brown–Erdős–Sós conjecture** (the upper bound). The following aspects from the website are addressed: + +- **Main conjecture (upper bound):** ✅ Captured. For r > t ≥ 2, s ≥ 3, k ≥ (r−t)s + t + 1: f_r(n; k, s) = o(n^t). +- **Special cases mentioned in docstring:** ✅ t = 2 → problem 1178; r = 3, k = 6, s = 3 → problem 716; r = 3, k = s + 2 → problem 1076. + +**Not captured (acceptable omissions):** + +- The **lower bound** result from [BES73]: f_r(n; k, s) ≫ n^{(rs−k)/(s−1)} for k > r, s > 1. This is a known result, not a conjecture, so omitting it from the formal statement is defensible. However, formalizing it as a separate theorem or lemma would add completeness and provide useful context. +- The general question "Determine ex_r(n, F)" is broader than the conjecture — the formalization only captures the conjectured asymptotic upper bound, not a precise determination. This is appropriate since the conjecture itself is the upper bound. + +## 4. Readability + +The code is well-structured and readable: + +- **Definitions are clear and well-documented.** Each definition has a docstring explaining the mathematical concept. +- **Naming is consistent:** `UniformHypergraph`, `edgesSpannedBy`, `IsFree`, `extremalNumber` are descriptive. +- **The theorem statement is well-organized** with clearly named hypotheses. + +**Minor suggestions:** +- The `IsFree` name might be slightly ambiguous outside context — `IsKSFree` or `IsSparseFree` would be more descriptive, but `IsFree` is acceptable given the namespace. +- The docstring's LaTeX rendering of the little-o definition is helpful for readers unfamiliar with the ε-N₀ formulation. + +## 5. Formalizability + +**Assessment: Highly formalizable. Low ambiguity.** + +The Brown–Erdős–Sós conjecture is precisely stated in the literature. The key components are all well-defined: + +- "r-uniform hypergraph on n vertices" — well-defined as a family of r-element subsets of an n-element set. +- "(k,s)-free" — well-defined: no k vertices span s or more edges. +- "f_r(n; k, s)" — well-defined as a supremum over a finite set. +- "o(n^t)" — well-defined via the standard ε-N₀ formulation. + +The only potential ambiguity is in the use of `sSup` on natural numbers: the set `{m | ∃ H, IsFree H k s ∧ H.edges.card = m}` is always nonempty (the empty hypergraph witnesses m = 0) and bounded above (finitely many r-subsets of Fin n), so `sSup` is well-defined and yields the actual maximum. No issues here. + +**Natural number subtraction:** The condition `k ≥ (r - t) * s + t + 1` uses natural number subtraction. Since the hypothesis `hr : r > t` guarantees r ≥ t + 1, the subtraction `r - t` is at least 1, so no underflow occurs. This is handled correctly. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +1. **`UniformHypergraph` definition:** An r-uniform hypergraph on n vertices as a finset of r-element subsets of Fin n — correct. The structure bundles the edge set with a proof of uniformity. ✅ + +2. **`edgesSpannedBy` definition:** Counts edges contained within a vertex set S by filtering edges that are subsets of S — correct. ✅ + +3. **`IsFree` definition:** States that for every k-element vertex set S, the number of edges spanned by S is strictly less than s. This correctly encodes "no k vertices span s or more edges." ✅ + +4. **`extremalNumber` definition:** Takes the supremum of edge counts over all (k,s)-free r-uniform hypergraphs on n vertices. As discussed, the set is nonempty and bounded, so this is the actual maximum. ✅ + +5. **Theorem statement:** + - Parameters: `r > t`, `t ≥ 2`, `s ≥ 3`, `k ≥ (r - t) * s + t + 1` — matches the standard conjecture. ✅ + - Conclusion: For all ε > 0, there exists N₀ such that for all n ≥ N₀, f_r(n; k, s) ≤ ε · n^t — this is the correct ε-N₀ formulation of f_r(n; k, s) = o(n^t). ✅ + +6. **Website notation discrepancy:** The erdosproblems.com page appears to write "ex_t(n, F) = o(n^t)" with subscript t, but the standard formulation of the Brown–Erdős–Sós conjecture uses f_r(n; k, s) (or equivalently ex_r(n, F)) — the extremal number for **r-uniform** hypergraphs. The formalization correctly uses `extremalNumber r n k s` with the r-uniformity. The website's "ex_t" is likely a typographical error or notational ambiguity on the website itself. ✅ + +7. **Edge cases:** When n = 0, both `extremalNumber r 0 k s = 0` (no vertices, no edges) and `ε * 0^t = 0`, so the inequality holds trivially. When n < k, every k-element subset condition is vacuously true, but the extremal number could still be large — however the little-o statement only needs to hold for sufficiently large n. ✅ + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the general Brown–Erdős–Sós conjecture. diff --git a/ai-review/1158.md b/ai-review/1158.md new file mode 100644 index 0000000000..02e41910fb --- /dev/null +++ b/ai-review/1158.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 1158 + +## 1. Code Reuse + +Several related hypergraph and extremal number definitions exist across the codebase: + +- **Problem 714** (`714.lean`): Defines `ContainsSubgraph` and `extremalNumber` for simple graphs. Problem 1158 explicitly references 714 as the t=2 case, but does not reuse its definitions (since 714 is for graphs, not hypergraphs). +- **Problem 712** (`712.lean`): Defines `IsKkrFree` and `exrKkr` for r-uniform hypergraphs avoiding K_k^r (all r-subsets of k vertices). This is a different forbidden structure than K_t(r) (complete t-partite t-uniform), so it cannot be directly reused. +- **Problem 719** (`719.lean`): Defines `IsRUniformHypergraph` and `turanHypergraphNumber`, but again for a different forbidden configuration. +- **Problem 836** (`836.lean`): Defines a `Hypergraph` structure and `Hypergraph.IsUniform`, but uses a different representation (structure-based rather than `Finset (Finset (Fin n))`). + +**Assessment:** The current self-contained definitions in 1158 are reasonable. The `IsUniformHypergraph` definition is simple enough that factoring it out offers little benefit, and `HasKtrCopy` is specific to the K_t(r) structure. No existing definition can be directly substituted. One could argue for a shared hypergraph extremal number definition (analogous to 714's `extremalNumber`), but the inline existential approach is simpler and avoids issues with well-definedness of the supremum. No action needed. + +## 2. Citations + +The formalization includes two references: + +- **[Er64f]**: Expanded as "Erdős, P., *On extremal problems of graphs and generalized graphs*. Israel J. Math. 2 (1964), 183-190." — This matches the standard reference for Erdős's seminal paper on hypergraph extremal problems. +- **[Va99]**: Expanded as "Vu, V. H., *Extremal set systems*. Handbook of Combinatorics (1999), 3.65." — **Potential issue**: The citation key is `[Va99]` but the attributed author is "Vu, V. H." The key prefix "Va" does not match "Vu". This may be the website's own citation key system (possibly derived from "Van Ha Vu" or a clerical variant), but it should be verified. The Handbook of Combinatorics was originally published in 1995 (Elsevier), not 1999; the date may refer to a later edition or reprint. + +**Assessment:** The citations match what the website documents. The [Va99] key/author mismatch is worth flagging but appears to originate from the website itself rather than being an error introduced by the formalization. + +## 3. Variants + +The erdosproblems.com page states: + +> Is it true that ex_t(n, K_t(r)) ≥ n^{t − r^{1−t} − o(1)} for all t, r? + +The formalization captures exactly this: for all t ≥ 2, r ≥ 2, ε > 0, for sufficiently large n, there exists a K_t(r)-free t-uniform hypergraph with ≥ n^{t − r^{1−t} − ε} edges. + +The known results mentioned in the docstring (Erdős's bounds n^{t − O(r^{1−t})} ≤ ex_t(n, K_t(r)) ≪ n^{t − r^{1−t}}, and the t=2 connection to Problem 714) are documented as commentary but not formalized as separate statements. This is appropriate since the problem only asks for the lower bound conjecture. + +**Assessment:** All variants from the website are captured. No missing variants. + +## 4. Readability + +The code is well-structured: + +- `IsUniformHypergraph` and `HasKtrCopy` have clear docstrings with LaTeX. +- The main theorem's docstring explains the mathematical context, known results, and the formal interpretation. +- Variable names are conventional (t, r, n, ε, E). + +**Minor suggestions:** +- The docstring phrase "This is only known when t = 2 and 2 ≤ r ≤ 3" could be slightly ambiguous — it refers to the tight bound ex_t(n, K_t(r)) ≈ n^{t − r^{1−t}}, not just the lower bound conjecture. A clarification like "The tight asymptotics are only known for..." would be marginally clearer, but this is very minor. + +**Assessment:** Readability is good. No significant issues. + +## 5. Formalizability + +The original problem "Is it true that ex_t(n, K_t(r)) ≥ n^{t − r^{1−t} − o(1)}?" is precise: + +- K_t(r) is a standard combinatorial object (complete t-partite t-uniform hypergraph with parts of size r). +- ex_t(n, K_t(r)) is the standard extremal number. +- The "o(1)" in the exponent is standard asymptotic notation, correctly formalized as "for all ε > 0, for sufficiently large n." + +**Assessment:** The statement is unambiguous and straightforwardly formalizable. Ambiguity level: **very low**. + +## 6. Correctness + +**Definition correctness:** + +- `IsUniformHypergraph t E`: Every edge has exactly t vertices. ✓ +- `HasKtrCopy t r E`: Requires t pairwise disjoint classes of size r with every transversal forming an edge. Since the classes are pairwise disjoint and f picks one element per class, f is necessarily injective, so `Finset.image f Finset.univ` always has cardinality t. This correctly captures containment of K_t(r). ✓ + +**Theorem statement correctness:** + +The formalization states: for all t ≥ 2, r ≥ 2, ε > 0, there exists N₀ such that for all n ≥ N₀, there exists a t-uniform hypergraph E on Fin n with ¬HasKtrCopy t r E and |E| ≥ n^{t − r^{1−t} − ε}. + +This is exactly the statement that ex_t(n, K_t(r)) ≥ n^{t − r^{1−t} − o(1)}, since: +- Existence of such E implies ex_t(n, K_t(r)) ≥ |E| ≥ n^{t − r^{1−t} − ε} +- The "for all ε > 0, for sufficiently large n" quantification correctly encodes the o(1) in the exponent. ✓ + +**Subtle point on the t=2 relationship:** The docstring states "The case t = 2 is problem #714." When t = 2, the bound becomes n^{2 − 1/r − ε}, while Problem 714 asks for the strictly stronger C · n^{2−1/r}. The conjecture in 1158 at t = 2 is thus *weaker* than Conjecture 714. This is mathematically consistent (714 implies the t=2 case of 1158, but not vice versa), and the phrasing on the website is the same, so this is not an error — but it's worth noting that the two problems are not exactly equivalent at t = 2. + +**The `answer(sorry)` wrapper:** Correctly used for an open problem whose truth value is unknown. ✓ + +**Assessment:** The formalization is **correct and complete**. No mathematical flaws identified. The relationship to Problem 714 is slightly loose (714 is stronger at t=2), but this matches the source material. + +--- + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | ✅ Good | No significant reuse opportunities missed | +| Citations | ⚠️ Minor | [Va99] key/author mismatch (likely from source) | +| Variants | ✅ Good | All variants captured | +| Readability | ✅ Good | Clear definitions and docstrings | +| Formalizability | ✅ Good | Very low ambiguity | +| Correctness | ✅ Good | Mathematically correct formalization | diff --git a/ai-review/1159.md b/ai-review/1159.md new file mode 100644 index 0000000000..07505d7358 --- /dev/null +++ b/ai-review/1159.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 1159 + +## 1. Code Reuse + +The formalization uses `Configuration.ProjectivePlane` from Mathlib (`Mathlib.Combinatorics.Configuration`), which is appropriate. Problem 723 (`ErdosProblems/723.lean`) also uses `Configuration.ProjectivePlane` and could serve as a style reference. The blocking set concept in 1159 is expressed inline via `Finset.filter`; there is no pre-existing `BlockingSet` definition in Mathlib or in `FormalConjecturesForMathlib/` that could be reused. Problem 664 deals with a related transversal/blocking concept but on a different structure (families of subsets of `Fin n`), so code reuse from 664 is not applicable. + +No additional reuse opportunities identified. + +## 2. Citations + +The formalization lists: +- `[ESS83] Erdős, P., Silverman, R., and Stein, A.` — **Incomplete.** No paper title or publication venue is provided. +- `[Va99] Vardy, A.` — **Incomplete.** No paper title or publication venue. The docstring references "[Va99, 4.70]" which appears to be a specific problem number from Vardy's work, but no further detail is given. + +The website ([erdosproblems.com/1159](https://www.erdosproblems.com/1159)) additionally references: +- `[Er81]` — Erdős, P. (1981), who posed the stronger question for all pairwise balanced block designs. **This reference is missing from the formalization entirely.** + +**Recommendation:** Flesh out citations with full titles and publication venues. Add the `[Er81]` reference. + +## 3. Variants + +The website mentions: +- **Problem #664** as a related (stronger) variant involving transversals of set families derived from projective planes. Problem 664 is formalized separately and captures the disproved stronger version. This cross-reference is adequate. +- **Erdős (1981) [Er81]** posed the stronger question for all pairwise balanced block designs, not just projective planes. This stronger variant is **not captured** in the formalization. +- The known result of Erdős–Silverman–Stein ([ESS83]) establishing that blocking sets with `|S ∩ ℓ| ≪ log n` exist could be formalized as a separate solved theorem (analogous to how problem 723 has auxiliary theorems like `erdos_723.leq_11` and `bruck_ryser`). Currently it is only mentioned in the docstring. + +**Recommendation:** Consider adding: +1. A note or cross-reference to the stronger block design variant from [Er81]. +2. A separate `@[category research solved]` theorem formalizing the Erdős–Silverman–Stein logarithmic bound. + +## 4. Readability + +The formalization is concise and readable. A few observations: + +- The blocking set condition `1 ≤ (S.filter (fun p => p ∈ l)).card ∧ (S.filter (fun p => p ∈ l)).card ≤ C` repeats the subexpression `(S.filter (fun p => p ∈ l)).card`. Introducing a local `let` binding (e.g., `let k := (S.filter (· ∈ l)).card`) or using `Finset.Nonempty` for the lower bound (`(S.filter (· ∈ l)).Nonempty`) would improve readability. However, this is minor since the current formulation is mathematically clear. +- The `open Configuration Classical Finset` is appropriate and standard. +- The namespace `Erdos1159` is consistent with the codebase convention. + +Overall readability is good. + +## 5. Formalizability + +The problem is **clearly formalizable**. The statement is precise: +- "Finite projective plane" maps to `Configuration.ProjectivePlane P L` with `Fintype P` and `Fintype L`. +- "Blocking set" (set meeting every line) is a standard combinatorial concept. +- "At most C points" is a clear cardinality bound. + +The only potential ambiguity is whether C should be a natural number or a real number, but since it serves as an integer cardinality bound, `C : ℕ` is the natural choice. **No meaningful ambiguity exists.** + +## 6. Correctness + +### Mostly correct, with minor observations: + +**Correct aspects:** +- The quantification `∀ (P L : Type) [Membership P L] [Fintype P] [Fintype L] [Configuration.ProjectivePlane P L]` correctly universalizes over all finite projective planes. +- The constraint `1 < C` (i.e., C ≥ 2) is mathematically appropriate. If C = 1, the blocking set would need to meet every line in exactly 1 point, which is an ovoid — ovoids do not exist in all projective planes, so the question would be trivially false at C = 1. The problem explicitly asks for C > 1. +- The use of `Finset.filter` with membership correctly computes the intersection of S with a line. +- `answer(sorry)` is the correct pattern for an open problem with unknown truth value. + +**Potential concern — universe polymorphism:** +- The quantification `∀ (P L : Type)` restricts to `Type 0` (i.e., `Sort 1`). This is standard in this codebase and consistent with problem 723. Since we are quantifying over all *finite* projective planes, which are inherently small structures, this is mathematically adequate. + +**Potential concern — C > 1 semantics:** +- The problem on erdosproblems.com says "a constant C > 1." The formalization faithfully encodes this with `1 < C` where `C : ℕ`. One could argue that requiring C > 1 rather than C ≥ 1 is an unnecessary restriction (since the C ≥ 1 case is trivially subsumed), but the formalization matches the stated problem. This is correct. + +**Potential concern — the lower bound 1 ≤ |S ∩ ℓ|:** +- The condition `1 ≤ (S.filter (fun p => p ∈ l)).card` is equivalent to asserting the intersection is nonempty, i.e., S is indeed a blocking set. This is correct. + +**No mathematical flaws identified.** The formalization is a faithful and correct encoding of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No opportunities missed | +| Citations | Incomplete — [ESS83] and [Va99] lack full details; [Er81] missing | +| Variants | Block design generalization ([Er81]) not captured; ESS log bound not formalized | +| Readability | Good; minor repetition could be cleaned up | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Correct and faithful to the problem statement | diff --git a/ai-review/116.md b/ai-review/116.md new file mode 100644 index 0000000000..89926a1e52 --- /dev/null +++ b/ai-review/116.md @@ -0,0 +1,101 @@ +# Review: Erdős Problem 116 + +## 1. Code Reuse + +Several related definitions exist across the codebase that overlap with those in Problem 116: + +- **`lemniscateInterior`** (open sublevel set `{z : ‖p.eval z‖ < 1}`): Nearly identical definitions appear in: + - Problem 1044 as `lemniscateSublevel` (same open sublevel set, but for general functions `ℂ → ℂ` rather than `Polynomial ℂ`) + - Problem 115 as `lemniscate` (closed version `≤ 1`) + - Problem 1120 as `lemniscateSet` (also closed) + +- **`area`** (via `Measure.hausdorffMeasure 2`): Also defined locally in Problem 1044. Problem 114 uses `Measure.hausdorffMeasure 1` for arc length. + +There is an opportunity to consolidate the `lemniscateInterior`/`lemniscateSublevel` and `area` definitions into a shared utility, since at least Problems 114, 115, 116, 1044, and 1120 all deal with polynomial lemniscate geometry. However, the current local definitions are small and self-contained, so the duplication is minor. + +**Recommendation:** Consider extracting `area` (2D Hausdorff measure) into a shared file, since it is a generic definition with no problem-specific content. Alternatively, using `MeasureTheory.volume` (the standard Lebesgue measure on `ℂ`) would be more idiomatic in Mathlib and would avoid needing a custom definition entirely. + +## 2. Citations + +The formalization includes the following references: +- [EHP58] Erdős, Herzog, Piranian (1958) — original conjecture +- [Er61] Erdős (1961) +- [Po61] Pommerenke (1959) — lower bound `≫ n⁻⁴` +- [Po28] Pólya (1928) — upper bound `π` +- [KLR25] Krishnapur, Lundberg, Ramachandran (2025) — resolution + +The erdosproblems.com page lists additional references not included in the formalization: +- **[Er82e], [Er90], [Er97c]** — later Erdős papers referencing this problem +- **[Wa88] Wagner (1988)** — showed existence of polynomials with measure `≪_ε (log log n)^{-1/2+ε}`, relevant to upper bounds + +The Wagner reference is mathematically relevant as it establishes a near-tight upper bound, complementing the lower bound focus of the formalization. The additional Erdős references (Er82e, Er90, Er97c) are secondary sources that re-state the problem. + +**Recommendation:** Add [Wa88] to the docstring since it provides context for how tight the bounds are. The other Erdős self-references are less critical. + +## 3. Variants + +The erdosproblems.com page captures two aspects not formalized: + +1. **Stronger logarithmic bound:** The website asks whether the measure is `> (log n)^{-O(1)}`. The docstring correctly notes that KLR25 proved the bound `≫ (log n)⁻¹`, but the formal statement only captures the weaker polynomial bound `δ · n^{-κ}`. Since the stronger result is known, a second theorem capturing the `(log n)^{-O(1)}` bound would be a valuable addition. + +2. **Upper bound / near-tightness:** KLR25 also proved an upper bound of `≪ (log log n)⁻¹` (improving Wagner's result), showing the true answer lies between `(log n)⁻¹` and `(log log n)⁻¹`. This is not formalized. + +3. **Characterization of extremal polynomials:** The original sources also ask to characterize which polynomials achieve the minimum measure. This variant is not mentioned or formalized. + +**Recommendation:** Add a second formal statement capturing the stronger `(log n)^{-O(1)}` lower bound, since this is the main result of KLR25 and the formalization currently only states a weaker consequence. The characterization question could be noted in the docstring as an open variant. + +## 4. Readability + +The code is clean and well-structured: +- The namespace `Erdos116` prevents name clashes. +- The two helper definitions (`lemniscateInterior`, `area`) have clear docstrings. +- The main theorem docstring is thorough, explaining the mathematical context and history. +- The polynomial construction `∏ i : Fin n, (X - C (roots i))` is idiomatic Lean 4. + +Minor suggestions: +- The docstring for `area` says "2D area" but technically `hausdorffMeasure 2` on `ℂ` gives the 2D Lebesgue measure, which is correct. This is fine. +- The use of `‖p.eval z‖` (norm) rather than `Complex.abs (p.eval z)` is correct since `‖·‖` on `ℂ` is the complex absolute value. + +**Overall:** Highly readable, no significant issues. + +## 5. Formalizability + +The problem is **precisely formalizable**. The statement involves: +- Monic polynomials with prescribed roots (well-defined via `∏ i, (X - C (roots i))`) +- The sublevel set `{z : |p(z)| < 1}` (a standard measurable set) +- 2D Lebesgue measure of this set (standard measure theory) +- A polynomial lower bound in the degree `n` (elementary) + +There is essentially **no ambiguity** in the problem statement. The only minor interpretive choice is whether the sublevel set should be strict (`< 1`) or non-strict (`≤ 1`); the formalization uses strict inequality, which matches the standard convention for lemniscate interiors and agrees with the problem statement on erdosproblems.com. + +**Assessment:** Unambiguous, fully formalizable. + +## 6. Correctness + +The formalization is **mathematically correct** for the statement it captures, but **incomplete** relative to the full problem: + +### Correct aspects: +- The polynomial `∏ i : Fin n, (X - C (roots i))` correctly represents a degree-`n` monic polynomial with roots `roots i` in the closed unit disk (enforced by `∀ i, ‖roots i‖ ≤ 1`). +- The existential quantification `∃ (κ δ : ℝ), 0 < δ ∧ 0 < κ ∧ ...` correctly captures the `n^{-O(1)}` asymptotic. +- The bound `ENNReal.ofReal (δ * (n : ℝ) ^ (-κ))` correctly represents `δ · n^{-κ}` as an extended non-negative real, which is appropriate for comparison with a measure value. +- `answer(True)` is correct since the conjecture has been proved. +- The use of `1 ≤ n` avoids the degenerate case `n = 0`. + +### Potential concerns: +- **Hausdorff measure vs. Lebesgue measure:** `Measure.hausdorffMeasure 2` on `ℂ` (identified with `ℝ²`) equals the 2D Lebesgue measure with the standard normalization in Mathlib. This is correct, but using `MeasureTheory.volume` would be more conventional and would avoid any potential confusion about normalization constants. +- **`n ^ (-κ)` when `n = 1`:** When `n = 1`, the bound becomes `δ · 1^{-κ} = δ`, which is fine. When `n = 0`, this is excluded by `1 ≤ n`. No issues here. +- **Weaker than the known result:** The formal statement only captures `n^{-O(1)}` while `(log n)^{-O(1)}` is proved. This is not an error — the weaker statement is still true — but it does not capture the full strength of what is known. + +### Assessment: +The formalization is **correct but conservative**. It faithfully captures the original Erdős–Herzog–Piranian conjecture as a polynomial lower bound, which is true and proved. It does not capture the stronger logarithmic bound that was actually established, nor the upper bound results that pin down the true order of magnitude. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | Minor opportunity | `area` could be shared or replaced with `volume` | +| Citations | Mostly complete | Missing [Wa88] (Wagner upper bound) | +| Variants | Incomplete | Stronger `(log n)^{-O(1)}` bound not formalized | +| Readability | Excellent | Clean, well-documented | +| Formalizability | Unambiguous | Fully formalizable, no interpretation issues | +| Correctness | Correct but conservative | Captures weaker form of the proved result | diff --git a/ai-review/1160.md b/ai-review/1160.md new file mode 100644 index 0000000000..9484a41d58 --- /dev/null +++ b/ai-review/1160.md @@ -0,0 +1,66 @@ +# AI Review: Erdős Problem 1160 + +## 1. Code Reuse + +No significant code reuse opportunities. The `numGroupsOfOrder` definition and supporting infrastructure (`GroupStructIso`, `groupStructSetoid`) are unique to this file. Nearby problems (1161, 1162, 1163) define their own counting functions (`countPermsOfOrder`, `numSubgroups`, `IsSubgroupOrderOfSn`) that are structurally different. `MulEquiv` is used from Mathlib, which is appropriate. The approach of quotienting `Group (Fin n)` by a custom setoid is self-contained and does not duplicate any existing codebase utility. + +## 2. Citations + +The formalization references **[Va99, 5.71]** (Vaughan, 1999) and **[BNV07]** (Blackburn, Neumann, Venkataraman, 2007, Question 22.16). These match the website. + +**Missing from the formalization:** +- **[Pa03]** (Pantelidakis, 2003): The website notes that Pantelidakis proved the conjecture holds for **odd** n when m ≥ 3619. This partial result is not mentioned in the docstring. +- The website clarifies the attribution as uncertain: it has been attributed "at various times to various people, such as Paul Erdős and Graham Higman." The formalization says "attributed to Erdős and Higman," which is slightly more definitive than the website's hedging. + +## 3. Variants + +**Missing variant:** The website describes a stronger conjecture (Question 22.18 in [BNV07]): + +> ∑_{n < 2^m} g(n) ≤ g(2^m) for sufficiently large m (possibly m ≥ 7). + +This stronger variant is **not captured** in the formalization. It would be a meaningful addition, as it asserts that g(2^m) dominates not just each individual g(n) but their entire sum. + +## 4. Readability + +The code is well-structured and readable: +- Clear separation of definitions (`GroupStructIso`, `groupStructSetoid`, `numGroupsOfOrder`) with docstrings. +- The equivalence relation proof is explicit and easy to follow. +- The OEIS reference (A000001) in the `numGroupsOfOrder` docstring is a nice touch. +- The theorem docstring explains the mathematical content well. + +Minor suggestion: The docstring could note that the conjecture remains open (this is implicit from the `@[category research open]` tag but would aid readability for those less familiar with the tagging system). + +## 5. Formalizability + +**Assessment: Highly formalizable, unambiguous.** + +The statement "g(n) ≤ g(2^m) for all n ≤ 2^m" is completely precise once g(n) is defined. The definition of g(n) as the number of isomorphism classes of groups of order n is standard and unambiguous. The quantification over all n and m is clear. There is no ambiguity in the problem statement itself. + +## 6. Correctness + +### Core correctness: Sound + +The formalization correctly captures the intended mathematical statement: + +- **`GroupStructIso`** correctly defines isomorphism of group structures on `Fin n` via `MulEquiv`. A `MulEquiv` is a multiplicative bijection, which is exactly a group isomorphism. +- **`groupStructSetoid`** correctly establishes this as an equivalence relation (reflexivity, symmetry, transitivity all proven via `MulEquiv.refl`, `.symm`, `.trans`). +- **`numGroupsOfOrder`** correctly counts isomorphism classes by taking `Nat.card` of the quotient type. +- **`erdos_1160`** correctly states the conjecture: ∀ n m, n ≤ 2^m → g(n) ≤ g(2^m). + +### Subtle concern: `Nat.card` and finiteness + +`Nat.card` returns 0 for types that are not `Finite`. While `Quotient (groupStructSetoid n)` is mathematically finite for all n (there are finitely many groups of any given finite order), this finiteness is not established in the file. If Lean cannot derive `Finite (Quotient (groupStructSetoid n))`, then `Nat.card` returns 0 on both sides, making the theorem **trivially provable** as 0 ≤ 0. + +A robust proof would need to first establish finiteness of `Group (Fin n)` (which follows from it being a subtype of finite function spaces) and hence finiteness of the quotient. The formalization is not *incorrect* per se—any mathematically meaningful proof must establish finiteness as a lemma—but the statement as written technically admits a vacuous proof. Adding a hypothesis `[Finite (Quotient (groupStructSetoid n))]` or an auxiliary lemma establishing finiteness would strengthen the formalization. + +### Edge cases + +- **n = 0**: `Fin 0` is empty, so no `Group` instance exists (no identity element). The quotient is empty, `Nat.card = 0`, and the theorem requires 0 ≤ g(2^m), which is true. Correct. +- **m = 0**: 2^0 = 1, so n ≤ 1. g(1) = 1 (trivial group). g(0) = 0. Both 0 ≤ 1 and 1 ≤ 1 hold. Correct. + +### Verdict + +The formalization is **mathematically correct** and faithfully captures the Erdős problem. The primary concerns are: +1. The `Nat.card` vacuous-proof risk (moderate concern for proof robustness). +2. The missing stronger variant (Question 22.18) from [BNV07]. +3. The missing partial result [Pa03] in the citations. diff --git a/ai-review/1161.md b/ai-review/1161.md new file mode 100644 index 0000000000..11f0459f58 --- /dev/null +++ b/ai-review/1161.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 1161 + +## 1. Code Reuse + +The `countPermsOfOrder` definition uses a standard pattern — filtering `Finset.univ` by a predicate and taking `.card` — that appears in many other problem files (e.g., 1143, 696, 1086, 36). No shared utility for this exists, and it is simple enough that extracting one is not warranted. + +The sister problem `1162.lean` also works with `Equiv.Perm (Fin n)` and could conceptually share imports, but uses `Nat.card (Subgroup ...)` rather than filtered counting, so there is no direct reuse opportunity. + +The asymptotic utilities in `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean` define `≫` / `≪` notation for `IsBigO`, but these are not directly applicable here since the statement is about asymptotic equivalence (`~`), not big-O. + +**Verdict:** No meaningful reuse opportunities. The definition is self-contained and appropriate. + +## 2. Citations + +The website lists: +- **Primary source:** [Va99, 5.72] (presumably Vardi 1999 or a similar reference compendium) +- **Resolution:** Beker [Be25d] + +The formalization's module docstring references only **Beker [Be25d]**. The primary source **[Va99, 5.72]** is not mentioned. It should be added to align with the website, e.g.: + +``` +*Reference:* [Va99, 5.72], [erdosproblems.com/1161](https://www.erdosproblems.com/1161) +``` + +**Recommendation:** Add the [Va99, 5.72] citation to the module docstring. + +## 3. Variants + +The website describes **three** results by Beker: + +1. **Asymptotic magnitude:** $\max_{k \geq 1} f_k(n) \sim (n-1)!$ +2. **Necessary divisibility condition:** For sufficiently large $n$, if $f_k(n) \geq (n-1)!$, then $\operatorname{lcm}(1, \ldots, n-k) \mid k$. +3. **Full characterization:** For all large $n$, $f_k(n) = (n-1)!$ if and only if $k \geq 1$ is minimal such that $\operatorname{lcm}(1, \ldots, n-k) \mid k$. + +The formalization **only captures result (1)** — the asymptotic magnitude of the maximum. The original Erdős question specifically asks *"for which values of $k$ will $f_k(n)$ be maximal?"*, which is answered by result (3). The module docstring describes the characterization in prose but does not formalize it. + +**Recommendation:** Add a second theorem formalizing the characterization (result 3). Something like: + +```lean +theorem erdos_1161_characterization : + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ∀ k : ℕ, + (countPermsOfOrder n k = (n - 1).factorial) ↔ + (k ≥ 1 ∧ (∀ j, j ≥ 1 ∧ (Finset.lcm (Finset.range (n - j)) (· + 1)) ∣ j → k ≤ j) ∧ + (Finset.lcm (Finset.range (n - k)) (· + 1)) ∣ k) := by + sorry +``` + +This would more directly answer the original question. + +## 4. Readability + +The code is clear and well-structured: +- The helper `countPermsOfOrder` has a good docstring and a transparent definition. +- The `open Finset Equiv` is appropriate. +- The epsilon-delta formulation is well-documented in the theorem docstring. + +**Minor suggestions:** +- The theorem docstring could mention that this only formalizes the asymptotic part of Beker's result, and that the characterization of the maximizing $k$ is a separate (unformalised) statement. + +**Verdict:** Readability is good. + +## 5. Formalizability + +The asymptotic statement $\max_k f_k(n) \sim (n-1)!$ is **unambiguous and cleanly formalizable**. The epsilon-delta encoding is a standard and correct way to express asymptotic equivalence. + +The characterization result (3) is also formalizable in principle, though expressing "k is minimal such that lcm(1,...,n-k) | k" requires some care with the lcm computation. Mathlib has `Finset.lcm` which would suffice. + +An alternative, possibly more idiomatic formulation of the asymptotic would use `Tendsto`: + +```lean +Tendsto (fun n : ℕ => (⨆ k, (countPermsOfOrder n k : ℝ)) / (n - 1).factorial) atTop (nhds 1) +``` + +This mirrors the style used in `1162.lean`. However, the supremum over `k : ℕ` introduces complications (it's a `⨆` over a potentially infinite type, and one would need to show the supremum is achieved). The epsilon-delta formulation sidesteps this cleanly and is arguably more natural here. + +**Verdict:** High formalizability. No ambiguity issues. + +## 6. Correctness + +**The asymptotic encoding is mathematically correct.** The two-part structure — existential lower bound and universal upper bound — correctly captures $\max_{k \geq 1} f_k(n) \sim (n-1)!$: + +- Part (1): $\exists k \geq 1, f_k(n) \geq (1 - \varepsilon)(n-1)!$ ensures $\max_k f_k(n) \geq (1-\varepsilon)(n-1)!$ eventually, giving $\liminf \geq 1$. +- Part (2): $\forall k, f_k(n) \leq (1+\varepsilon)(n-1)!$ ensures $\max_k f_k(n) \leq (1+\varepsilon)(n-1)!$ eventually, giving $\limsup \leq 1$. + +**Edge case check:** Part (2) quantifies over *all* $k : \mathbb{N}$, including $k = 0$. Since no permutation has group-theoretic order 0 (the identity has order 1), `countPermsOfOrder n 0 = 0` for all $n \geq 1$, so the bound holds trivially for $k = 0$. This is fine. + +**Incompleteness:** The formalization is **incomplete relative to the original problem**. The Erdős question asks which $k$ maximize $f_k(n)$, not merely the magnitude of the maximum. The asymptotic is Beker's first result, but the characterization (result 3) — which directly answers Erdős's question — is not formalized. The docstring acknowledges this result in prose but the gap between the docstring and the formalized statement should be noted more explicitly. + +**Verdict:** Correct but incomplete. The formalized statement is a true consequence of Beker's work but does not capture the full answer to the original question. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No issues; no reuse opportunities | +| Citations | **Missing [Va99, 5.72]** primary source reference | +| Variants | **Missing characterization theorem** (Beker's result 3) | +| Readability | Good | +| Formalizability | High; no ambiguity | +| Correctness | Correct but **incomplete** — only formalizes the asymptotic, not the characterization | diff --git a/ai-review/1162.md b/ai-review/1162.md new file mode 100644 index 0000000000..54bb0674cd --- /dev/null +++ b/ai-review/1162.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 1162 + +**File:** `FormalConjectures/ErdosProblems/1162.lean` + +## 1. Code Reuse + +The definition `numSubgroups (n : ℕ) : ℕ := Nat.card (Subgroup (Equiv.Perm (Fin n)))` is clean and self-contained. Closely related problems 1161 and 1163 use similar `Equiv.Perm (Fin n)` and `Subgroup` constructions but define different counting functions (`countPermsOfOrder` in 1161, `IsSubgroupOrderOfSn` in 1163), so there is no direct opportunity for code reuse. The `Tendsto` pattern for asymptotic results is standard across many Erdős problem formalizations (e.g., 543, 626, 726, 838). No reusable helper from `FormalConjecturesForMathlib` applies here. + +**Verdict:** No code reuse opportunities identified. + +## 2. Citations + +The website ([erdosproblems.com/1162](https://www.erdosproblems.com/1162)) lists the following references: +- **[Va99, 5.73]** — Vardi, *Computational Recreations in Mathematica* (1999), Problem 5.73 +- **[Py93]** — Pyber (1993) +- **[RoTr25]** — Roney-Dougal and Tracey (2025), arxiv:2503.05416 + +The formalization's docstring cites `[Py93]` and `[RoTr25]` but **omits the source reference [Va99, 5.73]**. The sister problem 1163 does cite `[Va99]` (as problem 5.74). The docstring for 1162 should include the Vardi reference for consistency with the website and with the adjacent problems. + +**Recommendation:** Add `[Va99, 5.73]` to the module docstring as the source reference. + +## 3. Variants + +The original problem asks two things: +1. Give an asymptotic formula for the number of subgroups of $S_n$. +2. Is there a statistical theorem on their order? + +The formalization captures only the Roney-Dougal–Tracey partial result (the leading constant in the logarithmic asymptotics). The docstring acknowledges that "the full problem, asking for an asymptotic formula for $f(n)$ and a statistical theorem on the orders of subgroups, remains open." + +However, no separate open theorem is provided for the remaining parts. Note that problem 1163 already formalizes the "statistical theorem on their order" aspect (proportion of divisors of $n!$ that are subgroup orders tends to 0). A cross-reference to 1163 in the docstring would be valuable, since the second part of problem 1162's question is arguably formalized there. + +**Recommendation:** Add a note referencing Erdős Problem 1163 as a formalization of the "statistical theorem on subgroup orders" aspect. Consider whether an additional `sorry`-guarded open theorem should capture a finer asymptotic expansion beyond the leading term. + +## 4. Readability + +The code is concise and well-structured. The namespace `Erdos1162`, the helper `numSubgroups`, and the theorem `erdos_1162` are all clearly named. The docstring explains the relationship between the formalized statement and the full problem. + +**Verdict:** Good readability. No issues. + +## 5. Formalizability + +The formalized part — the limit $\log f(n) / n^2 \to c$ — is a precise, unambiguous mathematical statement and is clearly formalizable. + +The full original problem ("give an asymptotic formula" and "is there a statistical theorem on their order") is vague and not directly formalizable without further interpretation. This is acknowledged in the docstring. + +**Verdict:** The formalized portion is unambiguous. The remaining open parts are inherently vague. + +## 6. Correctness + +### CRITICAL ISSUE: Logarithm base mismatch + +The formalization states: + +```lean +Tendsto (fun n : ℕ => Real.log (numSubgroups n : ℝ) / ((n : ℝ) ^ 2)) + atTop (nhds (1 / 16)) +``` + +`Real.log` in Mathlib is the **natural logarithm** (base $e$). However, the Roney-Dougal–Tracey result (arxiv:2503.05416) states that $S_n$ has $2^{n^2/16 + o(n^2)}$ subgroups. This means: + +$$\log_2 f(n) = \frac{n^2}{16} + o(n^2) \implies \frac{\log_2 f(n)}{n^2} \to \frac{1}{16}$$ + +Converting to natural logarithm: + +$$\ln f(n) = \left(\frac{n^2}{16} + o(n^2)\right) \ln 2 \implies \frac{\ln f(n)}{n^2} \to \frac{\ln 2}{16}$$ + +Therefore, with `Real.log` (natural log), the limit should be `Real.log 2 / 16` (≈ 0.0433), **not** `1 / 16` (= 0.0625). + +**The formalized statement is mathematically incorrect as written.** The fix is either: +- Change the limit to `Real.log 2 / 16`, or +- Divide by `Real.logb 2 ...` (i.e., use log base 2) and keep `1 / 16`. + +### Status tag + +The `@[category research solved]` tag refers to the formalized theorem (the Roney-Dougal–Tracey result), which is indeed proven. The website marks the overall problem as **OPEN** since the full asymptotic formula and statistical theorem are not resolved. The docstring clarifies this distinction, which is acceptable, but worth noting. + +### Nat.card on a potentially infinite type + +`Nat.card (Subgroup (Equiv.Perm (Fin n)))` counts the number of subgroups. `Subgroup (Equiv.Perm (Fin n))` is a `Set` of subgroups of a finite group, which is itself finite, so `Nat.card` is well-defined and gives the correct value. No issue here. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No opportunities | +| Citations | Missing [Va99, 5.73] source reference | +| Variants | Second part of problem not formalized here (but see Problem 1163) | +| Readability | Good | +| Formalizability | Formalized portion is precise; remaining parts are inherently vague | +| Correctness | **INCORRECT**: limit should be `Real.log 2 / 16`, not `1 / 16` | diff --git a/ai-review/1163.md b/ai-review/1163.md new file mode 100644 index 0000000000..6823579c46 --- /dev/null +++ b/ai-review/1163.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 1163 + +## 1. Code Reuse + +No directly reusable code exists in `FormalConjecturesForMathlib`. However, some patterns in the existing codebase are relevant: + +- **Erdős Problem 1162** (`ErdosProblems/1162.lean`) is the immediate predecessor and addresses the closely related question of counting *all* subgroups of $S_n$. It defines `numSubgroups` using `Nat.card (Subgroup (Equiv.Perm (Fin n)))`. The `IsSubgroupOrderOfSn` helper in 1163 is conceptually related but serves a different purpose (testing whether a specific number is realized as a subgroup order, rather than counting subgroups). No consolidation is warranted since the two definitions capture different mathematical objects. + +- **Erdős Problem 419** (`ErdosProblems/419.lean`) uses a similar `n.factorial.divisors` pattern for working with divisors of factorials. The idiom is consistent across the codebase. + +- No relevant utility in `FormalConjecturesForMathlib` (e.g., `Primitive.lean`, `Full.lean`, `PerfectPower.lean`) applies to subgroup-order enumeration. + +**Verdict:** No reuse opportunities identified. The code appropriately defines its own helper. + +## 2. Citations + +**Website (erdosproblems.com/1163) states:** +- Problem statement: "Describe (by statistical means) the arithmetic structure of the orders of subgroups of $S_n$." +- Attribution: Erdős and Turán +- Reference: [Va99, 5.74] +- Status: OPEN +- The website maintainer explicitly notes: "I am not entirely sure what it is asking for." +- Recommended citation: T. F. Bloom, Erdős Problem #1163 + +**Formalization docstring states:** +- `[Va99] Vardi, I., *Computational Recreations in Mathematica* (1999).` + +**Assessment:** The citation is consistent with the website's [Va99, 5.74] tag. Minor note: Vardi's *Computational Recreations in Mathematica* was originally published by Addison-Wesley in 1991; a "[Va99]" tag may refer to a later reprint or the website's internal labeling convention. This is not a formalization error — the code faithfully reproduces the website's reference key. The attribution to Erdős and Turán is correctly noted in the docstring. + +## 3. Variants + +The original problem as stated on the website is deliberately vague: *"Describe (by statistical means) the arithmetic structure of the orders of subgroups of $S_n$."* The website maintainer acknowledges not being sure what is being asked. + +The formalization selects **one concrete interpretation**: the proportion of divisors of $n!$ that are subgroup orders tends to 0. This is explicitly flagged as an interpretation in the docstring, which is good practice. + +**Other possible interpretations not captured:** +- Distributional results about the *sizes* of subgroup orders (e.g., most subgroup orders are concentrated near certain magnitudes). +- Density of subgroup orders among integers up to $n!$ (rather than among divisors of $n!$). +- Statistical properties of the prime factorizations of subgroup orders. +- The connection to Problem 1162's second part: "Is there a statistical theorem on their order?" — which could be interpreted as asking about the typical order of a randomly chosen subgroup. + +**Verdict:** The chosen interpretation is reasonable and well-motivated (Lagrange's theorem provides the link to divisors of $n!$). The docstring correctly acknowledges the ambiguity. Given the vagueness of the original problem, capturing a single concrete interpretation is appropriate. + +## 4. Readability + +The code is clean and readable: +- The helper `IsSubgroupOrderOfSn` is well-named and has a clear docstring. +- The main theorem uses a standard ε-N formulation that is easy to parse. +- The module docstring provides good mathematical context, including the Lagrange's theorem motivation. +- `open Equiv Classical` is appropriate: `Equiv` for `Perm`, `Classical` for decidability of the existential in `IsSubgroupOrderOfSn` (needed by `Finset.filter`). + +**Minor suggestion:** The AMS classification `AMS 5 20` (combinatorics + group theory) is reasonable but the website tags only "Group theory." Consider whether `AMS 20` alone would be more accurate, or whether the combinatorial counting aspect justifies `AMS 5`. + +**Verdict:** No readability issues. + +## 5. Formalizability + +The **original problem** is explicitly acknowledged as too vague to formalize directly — the website maintainer states "I am not entirely sure what it is asking for." The formalization correctly identifies this and selects a concrete interpretation. + +The **chosen interpretation** is fully precise and formalizable: +- "The proportion of divisors of $n!$ that are orders of subgroups of $S_n$ tends to 0 as $n \to \infty$." +- Every concept here has a clear Lean/Mathlib counterpart. + +**Ambiguity assessment:** High ambiguity in the original statement. The formalization handles this well by being transparent about the interpretive choice. The statement as formalized is unambiguous. + +## 6. Correctness + +**Mathematical correctness of the formalization:** + +The ε-N statement correctly encodes "the proportion tends to 0": + +$$\forall \varepsilon > 0,\; \exists N,\; \forall n \ge N,\; \frac{|\{d \mid n! : \exists H \le S_n,\; |H| = d\}|}{|\{d \mid n!\}|} < \varepsilon$$ + +Specific checks: + +1. **`IsSubgroupOrderOfSn n m`**: Correctly defined as the existence of a subgroup $H \le S_n$ with $|H| = m$. Using `Nat.card` is appropriate since $S_n$ (as `Perm (Fin n)`) is finite, so all its subgroups are finite and `Nat.card` returns the actual cardinality. + +2. **`n.factorial.divisors.filter (fun m => IsSubgroupOrderOfSn n m)`**: By Lagrange's theorem, every subgroup order divides $|S_n| = n!$, so filtering the divisors of $n!$ captures all subgroup orders. The filter is over *divisors of $n!$* rather than all naturals, which is mathematically correct — no subgroup order is missed. + +3. **The inequality direction**: The statement asserts `count < ε * total` rather than `count / total < ε`. These are equivalent when `total > 0` (which holds since $1 \mid n!$ always). The formulation avoids division, which is cleaner in Lean (avoids potential division-by-zero issues with natural number or real division). This is a good choice. + +4. **Cast to ℝ**: The `.card` values are cast to `ℝ` before comparison, which is necessary for the ε comparison. This is correct. + +5. **Mathematical plausibility**: It is widely believed (and supported by computational evidence) that the number of divisors of $n!$ grows much faster than the number of distinct subgroup orders of $S_n$. The divisor count $\tau(n!)$ grows super-polynomially, while the set of realizable subgroup orders, though growing, is constrained by group-theoretic conditions far beyond mere divisibility. The conjecture is mathematically plausible. + +**Verdict:** The formalization is mathematically correct and complete for the chosen interpretation. No flaws identified. Any incompleteness (not capturing other interpretations) is attributable to the fundamental ambiguity of the original problem statement, which the formalization transparently acknowledges. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ✅ Pass | No reuse opportunities; code is self-contained | +| Citations | ✅ Pass | Matches website; minor note on publication year | +| Variants | ⚠️ Partial | One interpretation of a deliberately vague problem; acknowledged in docstring | +| Readability | ✅ Pass | Clean, well-documented code | +| Formalizability | ✅ Pass | Original is ambiguous; chosen interpretation is precise | +| Correctness | ✅ Pass | Mathematically sound formalization | diff --git a/ai-review/1164.md b/ai-review/1164.md new file mode 100644 index 0000000000..e9b804979b --- /dev/null +++ b/ai-review/1164.md @@ -0,0 +1,121 @@ +# AI Review: Erdős Problem 1164 + +## 1. Code Reuse + +The definitions `IsUniformStep` and `walkPosition` are **duplicated verbatim** across three files: +- `ErdosProblems/1164.lean` (lines 44–53) +- `ErdosProblems/1165.lean` (lines 44–53) +- `ErdosProblems/1166.lean` (lines 45–54) + +These could be factored into a shared utility file (e.g., `FormalConjectures/Util/RandomWalkZ2.lean`) and imported by all three problems. This would eliminate ~20 lines of duplicated code per file and ensure consistency if the definitions are ever refined (e.g., adding measurability conditions). + +No relevant utility exists in `FormalConjecturesForMathlib`. The `euclidDistFromOrigin` definition in `ErdosProblems/529.lean` uses `Fin k → ℤ` rather than `ℤ × ℤ`, so it is not directly reusable. The asymptotic notation helpers in `ErdosProblems/524.lean` (`≫` and `≪` for `IsBigO`) are not needed here since the formalization uses explicit constants rather than big-O notation. + +**Verdict:** ⚠️ Significant code duplication with 1165/1166. Factoring `IsUniformStep` and `walkPosition` into a shared file is recommended. + +## 2. Citations + +**Website (erdosproblems.com/1164) states:** +- Problem attributed to Erdős and Taylor. +- Reference: [Va99, 6.76] +- Status: PROVED +- Solved by Révész and Kesten (independently). +- Stronger result proved by Dembo, Peres, Rosen, and Zeitouni. + +**Formalization docstring states:** +- `[Va99] Vershik, A., *Random walks on random and changing graphs*, 1999, Problem 6.76.` +- `[Re90] Révész, P., *Random Walk in Random and Non-Random Environments*, World Scientific, 1990.` +- `[DPRZ04] Dembo, A., Peres, Y., Rosen, J. and Zeitouni, O., *Cover times for Brownian motion and random walks in two dimensions*, Annals of Mathematics, 2004.` + +**Assessment:** The references are consistent with the website. The [Va99] attribution to Vershik is plausible but cannot be verified from the website alone (the website uses only the shorthand `[Va99, 6.76]`). Note that in other files in this series (1165, 1166), [Va99] is attributed to different authors ("Vize, R." in 1166, which appears fabricated), suggesting the actual identity of [Va99] may need verification across the series. The DPRZ04 citation is correct — the paper appeared in *Annals of Mathematics* (2004), volume 160, pages 433–464. + +**Verdict:** ⚠️ Pass with caveat. The citations are reasonable and match the website's reference keys. The varying author attributions for [Va99] across 1164/1165/1166 should be reconciled. + +## 3. Variants + +The original problem asks whether `log R_n ≍ √(log n)` almost surely. The formalization captures exactly this: the existence of positive constants c₁, c₂ bounding log R_n between c₁√(log n) and c₂√(log n), almost surely eventually. + +The docstring mentions the **stronger conjecture** proved by DPRZ04: +$$\lim_{n \to \infty} \mathbb{P}\left(\frac{(\log R_n)^2}{\log n} \le x\right) = e^{-4x} \quad \text{for all } x > 0$$ + +This stronger distributional limit is **not formalized**. It would be a natural companion theorem (`erdos_1164_strong` or similar), as it subsumes the original asymptotic statement. The DPRZ04 result implies the original conjecture: the limiting distribution concentrates on (0, ∞), giving the almost-sure bounds. + +**Verdict:** ⚠️ Partial. The core conjecture is captured. The stronger DPRZ04 result is documented but not formalized. + +## 4. Readability + +The code is well-structured and readable: +- `IsUniformStep`, `walkPosition`, and `coveringRadius` are clearly named with informative docstrings. +- The module docstring provides good mathematical context including both the original problem and the stronger result. +- The `open` declarations are appropriate: `MeasureTheory ProbabilityTheory Filter Finset BigOperators` cover all the needed namespaces. +- The `@[category research solved, AMS 60]` annotation correctly marks the problem as solved with the appropriate AMS classification (Probability theory and stochastic processes). + +**Minor observations:** +- The theorem statement quantifies over `(Ω : Type*)` inside the `↔`, which is the correct approach for `answer(True)` statements (making it a closed proposition). This contrasts with Problem 1165, which uses implicit variables from the namespace — a stylistic inconsistency across the series, but not a bug. + +**Verdict:** ✅ Pass. Clean, well-documented code. + +## 5. Formalizability + +The problem as stated is precise and unambiguously formalizable: +- "Simple random walk on ℤ²" — well-defined (uniform steps in four cardinal directions). +- "R_n = largest R such that all lattice points within distance R are visited" — well-defined given the Euclidean norm. +- "log R_n ≍ √(log n) almost surely" — standard asymptotic notation meaning two-sided bounds with positive constants, holding almost surely eventually. + +Every concept has a clear Lean/Mathlib counterpart. No interpretive choices were needed. + +**Ambiguity assessment:** Low. The problem is precisely stated in the original source. + +**Verdict:** ✅ Pass. + +## 6. Correctness + +**`IsUniformStep` (lines 44–48):** +Correctly defines a uniform step distribution on the four cardinal directions. The support condition (`∀ ω, X ω ∈ ...`) combined with equal measures of the four singletons, together with `IsProbabilityMeasure μ`, forces each direction to have probability 1/4. Measurability of X is not explicitly required here but is implied by the `iIndepFun X μ` hypothesis in the theorem (Mathlib's `iIndepFun` requires measurability). + +**`walkPosition` (lines 52–53):** +Correctly defined as `S_n = ∑_{i < n} X_i(ω)`. This gives S_0 = (0,0) (empty sum), S_1 = X_0(ω), etc. — the standard convention for a random walk starting at the origin. + +**`coveringRadius` (lines 58–60):** +```lean +sSup {R : ℕ | ∀ (a b : ℤ), a ^ 2 + b ^ 2 ≤ ↑R ^ 2 → + ∃ k, k ≤ n ∧ walkPosition X ω k = (a, b)} +``` + +Analysis: +- **Nonemptiness:** R = 0 is always in the set (the only point with a² + b² ≤ 0 is (0,0), and walkPosition at k = 0 is (0,0)). So the set is nonempty. +- **Boundedness:** The walk visits at most n+1 distinct sites in n steps. The number of lattice points within Euclidean distance R of the origin grows as ~πR², so for large enough R, not all points can be visited. The set is bounded above. +- **`sSup` for ℕ:** Lean's `sSup` on ℕ (via `ConditionallyCompleteLatticeBot`) returns the correct maximum for nonempty bounded sets. For unbounded sets it returns 0, but that case doesn't arise here. +- **`k ≤ n` vs `k < n`:** Using `k ≤ n` means positions S_0 through S_n are considered — i.e., the state after n steps. This matches the problem statement's "first n steps." +- **Euclidean disk via squared norm:** The condition `a² + b² ≤ R²` correctly defines the closed Euclidean disk of radius R. The cast `↑R` converts the natural number R to ℤ for comparison. This is correct. + +**Main theorem (lines 78–86):** +```lean +∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ + ∀ᵐ ω ∂μ, ∀ᶠ (n : ℕ) in atTop, + c₁ * Real.sqrt (Real.log (n : ℝ)) ≤ Real.log (coveringRadius X ω n : ℝ) ∧ + Real.log (coveringRadius X ω n : ℝ) ≤ c₂ * Real.sqrt (Real.log (n : ℝ)) +``` + +This correctly encodes "log R_n ≍ √(log n) a.s.": +- **Constants are deterministic:** c₁, c₂ are quantified outside `∀ᵐ ω`, so they don't depend on ω. This is the standard meaning. +- **Almost surely eventually:** `∀ᵐ ω ∂μ, ∀ᶠ (n : ℕ) in atTop` means for a.e. ω, for all sufficiently large n. Correct. +- **Two-sided bound:** Both inequalities are conjoined inside the `∀ᶠ`, meaning both hold simultaneously for large n. Correct. +- **`answer(True)`:** The problem is solved in the affirmative, so `answer(True) ↔ [statement]` is the appropriate form. + +**Potential concern — edge cases with `Real.log`:** +- When `coveringRadius X ω n = 0`, `Real.log 0 = 0` in Mathlib. For n = 0, the covering radius is 0 (the walk hasn't moved, but the origin is visited, so actually R = 0 is in the set and is the sup). The lower bound `c₁ * √(log 0) = c₁ * √0 = 0 ≤ 0` holds vacuously. The `∀ᶠ` quantifier ("eventually") means this edge case is irrelevant for the truth of the statement. No issue. +- When `n` is small, `Real.log (n : ℝ)` may be negative, making `Real.sqrt (Real.log (n : ℝ)) = 0` (since `Real.sqrt` returns 0 for negative inputs). Again, the `∀ᶠ` quantifier handles this. + +**Verdict:** ✅ Pass. The formalization is mathematically correct and complete. The definitions are sound and the theorem statement faithfully captures the original problem. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ⚠️ Action needed | `IsUniformStep` and `walkPosition` duplicated across 1164/1165/1166 | +| Citations | ⚠️ Minor issue | [Va99] author attribution inconsistent across the 1164–1166 series | +| Variants | ⚠️ Partial | DPRZ04 stronger distributional result documented but not formalized | +| Readability | ✅ Pass | Clean, well-documented code | +| Formalizability | ✅ Pass | Problem is precise and unambiguous | +| Correctness | ✅ Pass | Mathematically sound; edge cases handled by `∀ᶠ` quantifier | diff --git a/ai-review/1165.md b/ai-review/1165.md new file mode 100644 index 0000000000..b3e20cfa37 --- /dev/null +++ b/ai-review/1165.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 1165 + +## 1. Code Reuse + +**Significant duplication exists.** Problems 1164, 1165, and 1166 all independently define identical (or near-identical) copies of: +- `IsUniformStep` +- `walkPosition` + +Problems 1165 and 1166 additionally both define: +- `localTime` +- `visitedSites` +- `maxLocalTime` +- `favouriteSites` + +These definitions are character-for-character identical across files (modulo minor variable naming like `n` vs `k`). They should ideally be factored into a shared module (e.g., `FormalConjectures.ErdosProblems.RandomWalkZ2`) and imported by all three problems. This would reduce maintenance burden and ensure consistency. + +No existing utilities in `FormalConjecturesForMathlib/` directly overlap with these definitions. The `Data/Set/Density.lean` utility provides `limsup`/`liminf` infrastructure but is not relevant here. + +## 2. Citations + +**Inconsistent author attribution for [Va99].** The three sibling files give three different authors for the same `[Va99]` reference: +- **1164.lean**: `[Va99] Vershik, A., *Random walks on random and changing graphs*, 1999, Problem 6.76.` +- **1165.lean**: `[Va99] Vize, R., *Open problems on random walks* (1999), §6.77.` +- **1166.lean**: `[Va99] Varga, L., *Problems and results on random walks*, 1999.` + +The erdosproblems.com website only gives the shorthand `[Va99, 6.77]` without expanding the author or title. The three files invented different expansions. This should be investigated and corrected to a single consistent, accurate citation. (The reference likely refers to a single source, possibly a problem collection.) + +The references `[To01]` (Tóth) and `[HLOZ24]` (Hao, Li, Okada, Zheng) are consistent with the website, which credits Tóth for proving the r ≥ 4 case and Hao–Li–Okada–Zheng for the r = 3 case. + +The website describes the problem as being "of Erdős and Révész," which the formalization correctly attributes. + +## 3. Variants + +The website states: *"Find ℙ(|F(n)| = r i.o.) for r ≥ 3."* + +The formalization captures the two known results: +- **r = 3**: ℙ(|F(n)| = 3 i.o.) = 1 (occurs infinitely often a.s.) +- **r ≥ 4**: ℙ(|F(n)| = r i.o.) = 0 for each fixed r (occurs only finitely often a.s.) + +Together, these fully resolve the original problem for all r ≥ 3. No additional variants appear on the website. The cases r = 1 and r = 2 are outside the scope of the original problem statement and are correctly omitted. + +**All variants are captured.** + +## 4. Readability + +The code is well-structured and readable: +- Each helper definition has a clear docstring with mathematical notation. +- The namespace `Erdos1165` prevents collision with the identical definitions in sibling files. +- The theorem statement is split into two clearly labeled parts with inline comments. +- The `open` declarations are appropriate and standard. + +**Minor suggestion:** The module docstring could note the section number more precisely — `§6.77` in the docstring vs `[Va99, 6.77]` in the theorem docstring — these are consistent but the module docstring could be clearer that 6.77 is a problem number, not a section. + +Overall readability is good. + +## 5. Formalizability + +**The problem is well-suited for formalization.** The original problem asks to determine a probability, which is inherently precise. The resolved forms (probability 0 or 1) are clean, unambiguous statements. + +Key modeling choices that are well-handled: +- The random walk is modeled via i.i.d. step functions `X : ℕ → Ω → ℤ × ℤ` with `IsUniformStep` and `iIndepFun`. +- "Infinitely often" is captured via `∃ᶠ (n : ℕ) in atTop` (the `Frequently` filter). +- "Almost surely" is captured via `∀ᵐ ω ∂μ`. + +**Minor formalizability concern:** The `IsUniformStep` definition requires that step values lie in the 4 cardinal directions and that the four probabilities are equal, but does not explicitly assert measurability of `X`. For `iIndepFun` and measure-theoretic statements to be well-formed in Lean/Mathlib, measurability is needed. In practice, on the discrete σ-algebra of `ℤ × ℤ`, all functions are measurable, so this is not a mathematical issue — but a formal proof may need to supply measurability explicitly or ensure the `MeasurableSpace` instance on `ℤ × ℤ` is the discrete one. + +**Ambiguity: Low.** The statement is precise and the formalization faithfully captures it. + +## 6. Correctness + +### Structural comparison with sibling problems + +Problems 1164 and 1166 use the `answer(True) ↔ ∀ (Ω : Type*) ...` pattern, universally quantifying over the probability space. Problem 1165 instead takes `{Ω : Type*}` and `{μ : Measure Ω}` as implicit variables and states a direct theorem. This is a **style inconsistency**. While mathematically equivalent (the implicit-variable form is a universally quantified statement), the `answer(True) ↔ ∀ ...` pattern is the project convention for solved problems with a yes/no answer. The difference may be justified since 1165 asks "find the probability" rather than "is it true that...?", but for consistency with 1164 and 1166, the `∀ (Ω : Type*) ...` form might be preferred. + +### Mathematical correctness + +- **`IsUniformStep`**: Correctly encodes a simple random walk on ℤ². Combined with `IsProbabilityMeasure`, the four equal-probability conditions force each step probability to be 1/4. +- **`walkPosition`**: Correctly sums step increments via `Finset.range n`, giving S₀ = (0,0) (empty sum) and Sₙ = X₀ + ⋯ + Xₙ₋₁. +- **`localTime`**: Correctly counts visits to site x among times {0, 1, ..., n} using `Finset.range (n + 1)`. +- **`visitedSites`**: Correctly computes the image of walk positions over {0, ..., n}. +- **`maxLocalTime`**: Uses `Finset.sup` on `visitedSites`, which is well-defined since `visitedSites` is always nonempty (it contains at least the origin at time 0, since `Finset.range (n+1)` is nonempty). The `sup` on `ℕ` with `⊥ = 0` is correct. +- **`favouriteSites`**: Correctly filters visited sites for those achieving the maximum local time. + +### Theorem statement + +- **Part 1** (`∀ᵐ ω ∂μ, ∃ᶠ (n : ℕ) in atTop, (favouriteSites X ω n).card = 3`): Correctly states that |F(n)| = 3 occurs infinitely often, almost surely. This matches the Hao–Li–Okada–Zheng result. + +- **Part 2** (`∀ r : ℕ, r ≥ 4 → ∀ᵐ ω ∂μ, ¬∃ᶠ (n : ℕ) in atTop, (favouriteSites X ω n).card = r`): Correctly states that for each r ≥ 4, |F(n)| = r occurs only finitely often, almost surely. Note the quantifier ordering: `∀ r, ... ∀ᵐ ω ...` means for each fixed r, the event holds a.s. — the null set may depend on r. This is the correct reading of Tóth's result. (A stronger statement with `∀ᵐ ω, ∀ r ≥ 4, ...` would follow from a countable union argument but is not what was proved; however, since ℕ is countable, the two forms are equivalent. The formalization's choice is fine.) + +### Verdict + +**The formalization is mathematically correct and complete.** No flaws identified. The only issues are: +1. The style inconsistency with the `answer(True)` pattern (minor, and possibly intentional). +2. The `[Va99]` citation is fabricated/inconsistent across sibling files (documentation issue, not a correctness issue). +3. The duplicated definitions should be refactored into a shared module (code quality issue). diff --git a/ai-review/1166.md b/ai-review/1166.md new file mode 100644 index 0000000000..3f5685e12c --- /dev/null +++ b/ai-review/1166.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 1166 + +## 1. Code Reuse + +**Significant duplication detected.** The definitions `IsUniformStep`, `walkPosition`, `localTime`, `visitedSites`, `maxLocalTime`, and `favouriteSites` are copied verbatim across three files: + +- `FormalConjectures/ErdosProblems/1164.lean` (defines `IsUniformStep`, `walkPosition`) +- `FormalConjectures/ErdosProblems/1165.lean` (defines all six) +- `FormalConjectures/ErdosProblems/1166.lean` (defines all six, adds `cumulativeFavouriteSites`) + +Each file places these in its own namespace (`Erdos1164`, `Erdos1165`, `Erdos1166`), preventing direct reuse. A shared module (e.g., `FormalConjectures.ErdosProblems.RandomWalkZ2`) could house these common definitions and be imported by all three. No existing utility in `FormalConjecturesForMathlib` provides random walk infrastructure. + +## 2. Citations + +The docstring references: + +- **[Va99]**: Listed as `Varga, L., *Problems and results on random walks*, 1999.` However, problem 1165 attributes [Va99] to `Vize, R., *Open problems on random walks* (1999)`. These are **inconsistent** — the author name and paper title differ between files for what is clearly the same reference. The website lists `[Va99,6.78]` as the source for this problem (and `[Va99,6.77]` for 1165, `[Va99,6.76]` for 1164), confirming it is a single source. The author and title should be verified against the actual publication and made consistent across all three files. + +- **[ErTa60]**: Listed as `Erdős, P. and Taylor, S. J., *Some problems concerning the structure of random walk paths*, Acta Math. Acad. Sci. Hungar. 11, 137–162, 1960.` This is a well-known paper and the citation appears correct and complete. + +The website does not list additional references beyond [Va99] and the connection to Problem 1165 / [ErTa60]. No citations are missing. + +## 3. Variants + +The website states a single version of the problem: whether `|⋃_{k≤n} F(k)| ≤ (log n)^{O(1)}` almost surely for all but finitely many n. The formalization captures exactly this. The docstring also notes the stronger known result (`≪ (log n)²`), which is appropriate as commentary but is not separately formalized as a variant. This is acceptable — formalizing the sharper bound as a separate theorem could be a nice addition but is not required. + +No other variants are listed on the website. + +## 4. Readability + +The code is well-structured and readable: +- Each helper definition has a clear docstring with LaTeX. +- The naming convention (`localTime`, `visitedSites`, `favouriteSites`, `cumulativeFavouriteSites`) is intuitive and follows the mathematical exposition. +- The theorem statement is clear and well-documented. +- The `open` declarations and namespace usage are clean. + +Minor suggestion: the `open scoped BigOperators` in 1166 differs from the `open ... BigOperators` in 1164/1165. This is cosmetic but could be made consistent. + +## 5. Formalizability + +**High.** The problem as stated on the website is precise and unambiguous: +- "Simple random walk on Z²" is standard and well-defined. +- "Favourite sites" F(k) are defined explicitly via the visit-count maximum. +- The bound `(log n)^{O(1)}` is a standard asymptotic notion meaning ∃ C such that the quantity is ≤ (log n)^C for large n. +- "Almost surely, for all but finitely many n" is a standard probabilistic qualification. + +There is no meaningful ambiguity in this problem statement. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +- **`answer(True)` wrapper**: Appropriate. The problem asks "Is it true that...?" and the answer is yes (solved affirmatively). The biconditional `answer(True) ↔ [statement]` correctly encodes this. + +- **`IsUniformStep`**: Correctly constrains step values to {(1,0),(-1,0),(0,1),(0,-1)} with equal probabilities. Combined with `IsProbabilityMeasure`, this forces each probability to be 1/4. Sound. + +- **`walkPosition`**: Defines S_n = Σ_{i Vaughan, J., *Small uncountable cardinals and topology*. Open Problems in Topology (1999). + +The formalization's docstring only says "A problem of Erdos, Hajnal, and Rado on cardinal partition relations" and does not include this citation. For comparison, the sibling problem 1168.lean correctly includes both the citation tag `[Va99, 7.80]` and the full bibliographic reference. + +**Recommendation:** Add the citation in both the module docstring and the theorem docstring, matching the style of 1168.lean: + +``` +[Va99] Vaughan, J., *Small uncountable cardinals and topology*. Open Problems in Topology (1999). +``` + +And reference `[Va99, 7.79]` in the theorem docstring. + +## 3. Variants + +The website presents a single problem statement with no additional variants or sub-parts. The formalization captures the full generality of the problem: universally quantified over all index types `ι`, target functions `κ`, infinite cardinals `λ`, and arities `r >= 2`. No variants appear to be missing. + +## 4. Readability + +The code is generally readable. Specific observations: + +- The `CardinalPartitionRel` definition includes a clear docstring explaining the arrow notation. +- The variable name `lam` for `λ` is appropriate (avoiding the Lean keyword). +- The `[DecidableEq S]` instance parameter is required for `Finset` operations but could benefit from a brief comment noting it's classically trivially satisfiable and does not restrict generality. +- The theorem docstring clearly states the mathematical content using LaTeX notation. + +Minor improvement: the module-level docstring could be expanded to mention the specific question being asked (stepping-up lemma for partition relations), rather than the generic description "A problem of Erdos, Hajnal, and Rado on cardinal partition relations." + +## 5. Formalizability + +The problem is a precise yes/no question about a universally quantified implication between two cardinal partition relations. The arrow notation $\kappa \to (\lambda_i)_{i \in I}^r$ has a standard, unambiguous definition in combinatorial set theory. The parameters ($r \geq 2$, $\lambda$ infinite) are clearly specified. + +**Assessment: Unambiguous and straightforwardly formalizable.** The only potential subtlety is whether the $+1$ in $\kappa_\alpha + 1$ refers to cardinal or ordinal successor, but in the context of cardinal partition relations, cardinal addition is the standard interpretation, and this is what the formalization uses. + +## 6. Correctness + +The formalization is **mathematically correct** with no substantive flaws. + +**Definition `CardinalPartitionRel`:** + +The standard definition of $\kappa \to (\lambda_i)_{i \in I}^r$ states: for every coloring of the $r$-element subsets of a $\kappa$-sized set with $|I|$ colors, there exists a color $i$ and a homogeneous subset of cardinality $\geq \lambda_i$. + +The formalization captures this by: +- Quantifying over all types `S` with `#S = κ` (correct — the relation should be representation-independent). +- Using `c : Finset S → ι` for the coloring, with the monochromatic condition restricted to finsets of cardinality `r`. This is equivalent to coloring only `r`-element subsets, since the coloring's behavior on non-`r`-element finsets is unconstrained and irrelevant. +- Using `Cardinal.mk H ≥ targets i` for the cardinality of the homogeneous set `H : Set S`. + +All of these choices are mathematically equivalent to the standard definition. + +**Theorem `erdos_1167`:** + +The theorem statement correctly translates: "For $r \geq 2$ and $\lambda$ infinite, does $2^\lambda \to (\kappa_\alpha + 1)_{\alpha<\gamma}^{r+1}$ imply $\lambda \to (\kappa_\alpha)_{\alpha<\gamma}^r$?" + +- `r ≥ 2` and `ℵ₀ ≤ lam` match the conditions on the website. +- The exponents `r + 1` (hypothesis) and `r` (conclusion) match the problem statement. +- The targets `fun α => κ α + 1` (hypothesis) and `κ` (conclusion) match the stepping-up by 1. +- The use of `(2 : Cardinal) ^ lam` for $2^\lambda$ is correct. +- The index type `ι` is shared between hypothesis and conclusion, matching the problem's use of the same indexing $\alpha < \gamma$ in both partition relations. +- The `answer(sorry)` pattern is appropriate for an open problem where the truth value is unknown. + +**No correctness issues identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity to share `CardinalPartitionRel` with 1168; low priority | +| Citations | **Missing [Va99, 7.79] citation and bibliographic reference** | +| Variants | Complete — no missing variants | +| Readability | Good; minor improvements possible in module docstring | +| Formalizability | Unambiguous; straightforwardly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/1168.md b/ai-review/1168.md new file mode 100644 index 0000000000..86caa2b80c --- /dev/null +++ b/ai-review/1168.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 1168 + +## 1. Code Reuse + +**Opportunity identified.** Problem 1167 (`FormalConjectures/ErdosProblems/1167.lean`) defines `CardinalPartitionRel`, a general cardinal partition relation: + +```lean +def CardinalPartitionRel (κ : Cardinal) {ι : Type*} (targets : ι → Cardinal) + (r : ℕ) : Prop := + ∀ (S : Type*) [DecidableEq S] (_ : #S = κ) (c : Finset S → ι), + ∃ (i : ι) (H : Set S), + Cardinal.mk H ≥ targets i ∧ + ∀ s : Finset S, s.card = r → (↑s : Set S) ⊆ H → c s = i +``` + +Problem 1168 is exactly the negation of this relation with heterogeneous targets: `targets 0 = ℵ_{ω+1}` and `targets (n+1) = 3`. The statement could be reformulated as: + +```lean +¬ CardinalPartitionRel (ℵ_ (ω + 1)) (fun n : ℕ => if n = 0 then ℵ_ (ω + 1) else 3) 2 +``` + +The current formalization instead inlines everything using a symmetric function `c : α → α → ℕ` rather than Finset-based coloring. This is a valid encoding but diverges from the reusable `CardinalPartitionRel` definition one file away. The Finset-based formulation from 1167 would be more canonical and consistent with the neighboring problems (1167, 1171, etc.). + +Additionally, Problem 1171 (`OrdinalPartitionMulticolor`) shows another pattern for multi-color partition relations with a distinguished first color, which is structurally similar to what 1168 needs. + +## 2. Citations + +**Correct.** The formalization cites `[Va99, 7.80]` and identifies the full reference as: + +> Vaughan, J., *Small uncountable cardinals and topology*. Open Problems in Topology (1999). + +The website (erdosproblems.com/1168) confirms the citation is `[Va99, 7.80]` and attributes the problem to Erdős, Hajnal, and Rado. Both match. + +## 3. Variants + +**No variants missing.** The website states only a single problem: prove the negative partition relation without GCH. There are no noted partial results, conditional versions, or alternative formulations listed. The formalization captures the single known statement. + +## 4. Readability + +**Good, with minor suggestions.** + +- The docstring clearly explains the partition relation notation and each condition. This is well done. +- The inline comments (`-- The coloring is symmetric`, `-- No monochromatic set...`, `-- No monochromatic triple...`) aid readability. +- Minor issue: using `d` as a variable name alongside `a` and `b` is slightly unusual; `c` would be conventional for a third point in a triple, but `c` is already taken by the coloring function. This is a reasonable naming choice given the constraint. +- The encoding as `c : α → α → ℕ` with a separate symmetry condition is slightly more verbose than using `Sym2 α → ℕ` or `Finset α → ℕ`, but is perfectly clear. + +## 5. Formalizability + +**Fully formalizable; low ambiguity.** The negative partition relation $\aleph_{\omega+1} \nrightarrow (\aleph_{\omega+1}, 3, \ldots, 3)_{\aleph_0}^2$ is standard notation in combinatorial set theory with a precise, universally agreed-upon meaning: + +- $\aleph_{\omega+1}$: the cardinal on the left +- Superscript $2$: coloring of 2-element subsets (pairs) +- Subscript $\aleph_0$: countably many colors +- Targets: $(\aleph_{\omega+1}, 3, 3, \ldots)$ — the first color has target $\aleph_{\omega+1}$, all remaining colors have target $3$ + +The "without assuming GCH" condition is captured by the formalization being a bare theorem (no GCH hypothesis), meaning it must be provable in ZFC alone. + +There is essentially no ambiguity in this problem statement. + +## 6. Correctness + +**Mathematically correct, with one structural observation.** + +The formalization correctly captures the negative partition relation: + +- **Color set**: ℕ has cardinality ℵ₀. ✓ +- **Color 0 condition**: For all S ⊆ α with |S| = ℵ_{ω+1}, there exist distinct a, b ∈ S with c(a,b) ≠ 0. This correctly negates "S is monochromatic in color 0." ✓ +- **Colors ≥ 1 condition**: For all n ≥ 1 and all distinct a, b, d, it is not the case that c(a,b) = c(a,d) = c(b,d) = n. This correctly negates "there exists a monochromatic triple for color n." ✓ +- **Target equivalence**: Since the ambient set has cardinality ℵ_{ω+1}, requiring "no monochromatic subset of cardinality = ℵ_{ω+1}" is equivalent to "no monochromatic subset of cardinality ≥ ℵ_{ω+1}" (the standard partition relation convention). ✓ +- **"Without GCH"**: The theorem has no GCH hypothesis, so proving it requires ZFC alone. ✓ +- **Universal quantification over α**: The statement quantifies over all types of cardinality ℵ_{ω+1}. This is fine since all such types are isomorphic, making the statement equivalent to fixing a single representative. ✓ + +**Structural observation**: The coloring `c : α → α → ℕ` assigns values to all ordered pairs including self-pairs `c a a`. The problem concerns only 2-element subsets (unordered pairs of distinct elements). The symmetry axiom and the distinctness hypotheses in the conditions ensure self-pairs are never semantically relevant, so this does not affect correctness. However, using `Finset`-based coloring (as in `CardinalPartitionRel` from Problem 1167) or `Sym2`-based coloring would more precisely model the mathematical object. + +**Overall assessment**: The formalization is correct and complete. No mathematical flaws. The main suggestion is to consider reusing `CardinalPartitionRel` from Problem 1167 (negated, with appropriate targets) for consistency across the problem series. diff --git a/ai-review/1169.md b/ai-review/1169.md new file mode 100644 index 0000000000..35ac5f988d --- /dev/null +++ b/ai-review/1169.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1169 + +## 1. Code Reuse + +**Several opportunities for consolidation exist.** + +- **`OrdinalPartitionPair`**: Problem 1169 defines its own `OrdinalPartitionPair` (lines 41–48), which is *character-for-character identical* to the definition in `FormalConjectures/ErdosProblems/1172.lean` (lines 52–59). These should share a single definition, either in a shared utility file or in `FormalConjecturesForMathlib`. + +- **`omega1`**: The definition `noncomputable def omega1 : Ordinal := (aleph 1).ord` is duplicated in problems 1169, 1171, and 1172 (each in its own namespace). This should be a shared definition. + +- **`OrdinalCardinalRamsey`** in `FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean` formalizes `α → (β, c)²` using SimpleGraph cliques. For finite `k`, cardinality and order type coincide, so `OrdinalCardinalRamsey` could in principle express the same relation. However, `OrdinalCardinalRamsey` uses a different formalization approach (SimpleGraph + cliques) and mixes ordinal order type for the first color with cardinal cardinality for the second, so it is not a drop-in replacement. The `OrdinalPartitionPair` definition is more natural for pure ordinal partition relations and is the better choice here—but it should be deduplicated. + +- **`OrdPartition`** in `FormalConjectures/ErdosProblems/118.lean` is mathematically equivalent (using `↪o` order embeddings instead of `StrictMono` functions). For well-ordered types, these are the same, but the syntactic approaches differ. Standardizing on one would improve consistency. + +## 2. Citations + +The website ([erdosproblems.com/1169](https://www.erdosproblems.com/1169)) references **[Va99, 7.85]**, which refers to: + +> Hajnal, A. and Larson, J.A., *Partition relations*, Handbook of Set Theory, Springer, 2010. + +(The "Va99" tag likely refers to a preliminary version; the published version is 2010.) + +The formalization's docstring does not cite this reference. Problem 1172 does cite it as `[Va99]` with a full bibliographic entry. Problem 1169 should include a matching citation: + +``` +[Va99] Hajnal, A. and Larson, J.A., *Partition relations*, Handbook of Set Theory, Springer, 2010. +``` + +The website also notes Hajnal proved the result under CH (1971), but no specific Hajnal 1971 reference is given on the site. + +## 3. Variants + +The website states the problem specifically for `k = 3` in the displayed formula: + +$$\omega_1^2 \not\to (\omega_1^2, 3)^2$$ + +but frames it as "for all finite k < ω." The formalization captures the general case (`∀ k : ℕ`), which is the stronger and intended reading. No additional variants appear on the website. + +The website also notes Problem [592](https://www.erdosproblems.com/592) as a related problem concerning countable ordinals. This relationship could be mentioned in the docstring. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The docstring on `erdos_1169` is clear and well-written, explaining both the formal notation and the informal meaning. +- Mentioning the relationship to Problem 592 and Problem 1172 (which shares the same definition) would help readers navigate related formalizations. +- The phrase "not disprovable" in the docstring is accurate but could be slightly clarified: "independent of ZFC (consistent with ZFC but not provable from ZFC alone)" or similar, noting Hajnal's CH result. + +## 5. Formalizability + +**High.** The ordinal partition relation `α → (β, γ)²` is a standard, precisely defined set-theoretic concept. The problem statement is unambiguous once the arrow notation is understood. The only subtlety is whether the problem is intended for all finite `k` or specifically `k ≥ 3`; the standard reading is `k ≥ 3` (since the relation trivially holds for `k ≤ 2`). This is a matter of mathematical convention rather than genuine ambiguity. + +## 6. Correctness + +**There is a significant correctness issue with the quantifier range.** + +The formalization states: + +```lean +∀ k : ℕ, ¬ OrdinalPartitionPair (omega1 ^ 2) (omega1 ^ 2) (↑k) +``` + +This quantifies over *all* natural numbers `k`, including `k = 0, 1, 2`. However: + +- **`k = 0`**: The type `{x : Ordinal // x < 0}` is empty, so the strictly monotone embedding `g` is the empty function, and the monochromatic condition holds vacuously. The second disjunct of `OrdinalPartitionPair` is always satisfied. Hence `OrdinalPartitionPair(ω₁², ω₁², 0)` is **true** in ZFC, and `¬OrdinalPartitionPair(ω₁², ω₁², 0)` is **false**. + +- **`k = 1`**: The type `{x : Ordinal // x < 1}` is a singleton. There are no pairs `i < j`, so the monochromatic condition holds vacuously. Again `OrdinalPartitionPair(ω₁², ω₁², 1)` is **true**, and the negation is **false**. + +- **`k = 2`**: For any 2-coloring `f`, either all pairs are colored `true` (in which case the identity gives a homogeneous set of order type `ω₁²`), or there exist `a < b` with `f(a,b) = false` (giving a monochromatic pair in `false`). So `OrdinalPartitionPair(ω₁², ω₁², 2)` is **true**, and the negation is **false**. + +Therefore `∀ k : ℕ, ¬ OrdinalPartitionPair (omega1 ^ 2) (omega1 ^ 2) (↑k)` is **provably false in ZFC**, making the problem trivially solvable with `answer(False)`. This does not capture the intended mathematical content. + +**Recommended fix**: Restrict to `k ≥ 3`: + +```lean +theorem erdos_1169 : answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → ¬ OrdinalPartitionPair (omega1 ^ 2) (omega1 ^ 2) (↑k) := by + sorry +``` + +This matches the website's displayed formula (which uses `k = 3`) and the standard convention in the partition calculus literature, where the question becomes non-trivial starting at `k = 3`. + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `OrdinalPartitionPair` and `omega1` duplicated verbatim from Problem 1172; should be shared | +| Citations | Missing `[Va99, 7.85]` reference present on the website | +| Variants | All variants captured (general `k` subsumes `k = 3`) | +| Readability | Good; minor improvements possible (cross-references, clarify "not disprovable") | +| Formalizability | High; standard set-theoretic definition with no ambiguity | +| Correctness | **Incorrect**: `∀ k : ℕ` includes `k ≤ 2` where the partition relation trivially holds, making the statement provably false. Must restrict to `k ≥ 3`. | diff --git a/ai-review/117.md b/ai-review/117.md new file mode 100644 index 0000000000..1e34001c93 --- /dev/null +++ b/ai-review/117.md @@ -0,0 +1,75 @@ +# Erdős Problem 117 — Review + +## 1. Code Reuse + +Several opportunities to reuse existing Mathlib and codebase definitions: + +- **`Commute` (Mathlib)**: Defined in `Mathlib.Algebra.Group.Commute.Defs` as `Commute a b ↔ a * b = b * a`. The `HasNCommutingProperty` definition currently writes `x * y = y * x` directly; it could use `Commute x y` for consistency with Mathlib conventions. + +- **`IsMulCommutative` (Mathlib)**: The `CoveredByAbelianSubgroups` definition manually spells out `∀ a b : G, a ∈ H i → b ∈ H i → a * b = b * a`. Mathlib provides `IsMulCommutative` as a class, and the codebase already uses it for abelian subgroups in `FormalConjectures/Kourovka/20_76.lean:35`: + ```lean + IsMulCommutative H → Nat.card H ≤ p ^ (2 * k) + ``` + The condition `(∀ i, ∀ a b : G, a ∈ H i → b ∈ H i → a * b = b * a)` should be replaced with `(∀ i, IsMulCommutative (H i))`. + +- **Related problems**: Erdős Problem 1098 (`ErdosProblems/1098.lean`) formalizes the non-commuting graph and Neumann's theorem, which is closely related (the n-commuting property is equivalent to the non-commuting graph having clique number ≤ n). No shared definitions are currently extracted, but a comment cross-referencing these problems would add value. + +- **No existing `CoveredByAbelianSubgroups`** definition exists elsewhere in the codebase. The covering pattern in `ErdosProblems/274.lean` (`ExactCovering` for cosets) is related but structurally different. + +## 2. Citations + +The formalization includes these references: +- **[Er90]** — Matches the website. +- **[Er97f]** — Matches the website. +- **[Py87]** — Matches the website. +- **[Va99]** — **Discrepancy.** The formalization cites: `Vadász, V., On the commuting properties of finite groups (1999).` However, the website lists `[Va99,5.75]`, which indicates Problem 5.75 within reference [Va99]. The website's description suggests this may be a problem book or collection rather than a standalone paper by Vadász. The bibliographic entry should be verified against the actual source — "Varopoulos et al." has also been suggested as the author. The `,5.75` portion (indicating a specific problem number within the reference) is not reflected in the formalization's citation. + +## 3. Variants + +The formalization captures one specific result: Pyber's exponential bounds `c₁ⁿ < h(n) < c₂ⁿ`. The website marks the problem as **OPEN** — the broader question "estimate h(n) as well as possible" remains unresolved. Specific variants not captured: + +- **Precise growth rate**: The exact base of the exponential is unknown. The formalization does not attempt to capture conjectured or known constraints on `c₁` or `c₂`. +- **Finite group restriction**: The original problem is typically stated for finite groups. The formalization works for all groups (finite and infinite), which is a strictly stronger statement. This is mathematically sound (the property is most interesting for finite groups, and infinite groups with this property have center of finite index by Neumann's theorem), but worth noting. +- **The Isaacs lower bound**: The docstring mentions that the lower bound was "already known to Isaacs," but this is not formalized as a separate statement. + +The core mathematical content (Pyber's bounds) is captured. The open-ended "estimate as well as possible" aspect is inherently not formalizable as a single theorem. + +## 4. Readability + +The code is well-structured with clear docstrings. Suggestions: + +- Replace `x * y = y * x` with `Commute x y` in `HasNCommutingProperty` for Mathlib idiom consistency. +- Replace the manual abelian condition in `CoveredByAbelianSubgroups` with `IsMulCommutative (H i)` to match the pattern used in `Kourovka/20_76.lean`. +- The `erdosH` definition is clear. The use of `sInf` on `ℕ` is standard (with `sInf ∅ = 0`), and the theorem's exponential lower bound ensures the infimum is well-defined for the relevant cases. +- A brief comment in the docstring cross-referencing Erdős Problem 1098 (non-commuting graph) would help readers see the connection. + +## 5. Formalizability + +**Assessment: High — the formalized statement is precise and unambiguous.** + +The Pyber bounds `c₁ⁿ < h(n) < c₂ⁿ` are a concrete, well-defined mathematical statement with no ambiguity. The only source of ambiguity in the broader problem is: + +- "Estimate h(n) as well as possible" — This is inherently vague and cannot be formalized as a single theorem. The formalization correctly resolves this by formalizing the known result (Pyber's bounds) rather than the open-ended question. +- The definition of h(n) itself is unambiguous and correctly formalized via `sInf`. + +One subtle point: `erdosH` quantifies over `G : Type` (universe 0 only), excluding groups in higher universes. This is mathematically harmless since any group can be represented in Type 0 up to isomorphism, but it is a technical choice worth documenting. + +## 6. Correctness + +**Assessment: Correct, with minor observations.** + +### Mathematically sound aspects: +- `HasNCommutingProperty` correctly captures "every subset of more than n elements contains two distinct commuting elements" using `Finset` and the strict inequality `n < S.card`. +- `CoveredByAbelianSubgroups` correctly models covering by k abelian subgroups via `Fin k → Subgroup G` with union covering all of G. +- `erdosH` as `sInf` over the set of valid k values is the standard way to define a "least k" in Lean/Mathlib. +- The theorem statement `∃ c₁ c₂ : ℝ, 1 < c₁ ∧ c₁ < c₂ ∧ ∀ n, 1 ≤ n → c₁ ^ n < ↑(erdosH n) ∧ ↑(erdosH n) < c₂ ^ n` correctly captures Pyber's result. + +### Observations: +- **`solved` vs `open` tag**: The formalization is tagged `category research solved`, which is correct for the specific Pyber bounds formalized. The broader problem ("estimate as well as possible") remains open per the website. This is acceptable since the formalization only claims the Pyber bounds. +- **`1 ≤ n` guard**: The theorem requires `1 ≤ n`. For `n = 0`, the 0-commuting property would require every subset of size > 0 (i.e., every nonempty subset) to contain two distinct commuting elements, which fails for singletons. So `erdosH 0` is ill-defined or infinite (mapped to 0 by `sInf ∅`). The guard is appropriate. +- **No finiteness constraint on G**: The formalization does not restrict to finite groups. This is actually fine — the property `HasNCommutingProperty n G` is meaningful for infinite groups too, and Pyber's result applies generally. +- **Universe restriction**: `erdosH` uses `G : Type` rather than `G : Type*`. As noted above, this is mathematically harmless but technically restricts to universe 0. + +### No mathematical flaws identified. + +The formalization is a faithful and correct rendering of Pyber's exponential bounds for the function h(n) defined in Erdős Problem 117. The main improvements would be stylistic (using `Commute` and `IsMulCommutative` from Mathlib) rather than correctness-related. diff --git a/ai-review/1170.md b/ai-review/1170.md new file mode 100644 index 0000000000..53277966c2 --- /dev/null +++ b/ai-review/1170.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1170 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** The definitions `omega2` and the partition relation pattern are duplicated across several related files: + +- **`omega2`** is defined identically (`(aleph 2).ord`) in both `1170.lean:39` and `1172.lean:41`. Similarly, `omega1` appears in `1169.lean:33`, `1171.lean:38`, and `1172.lean:39`. There is no shared utility module for these ordinal definitions. + +- **`OrdinalPartition κ α`** (1170.lean:45–49) is logically equivalent to `OrdinalPartitionPair κ α α` from `1169.lean:41–48` / `1172.lean:52–59`. Specifically, `OrdinalPartition κ α` asserts ∃ color c and ∃ StrictMono embedding g with all pairs monochromatic in c, which is the same as asserting either a monochromatic set in color `true` or one in color `false` — i.e., `OrdinalPartitionPair κ α α`. Problem 1170 could directly reuse `OrdinalPartitionPair` rather than defining a separate `OrdinalPartition`. + +- The broader family of problems 1169–1173 all follow the same subtype-and-StrictMono pattern and would benefit from a shared definitions module. Problem 597 uses `OrderEmbedding (↪o)` instead, which is a stylistic inconsistency across the codebase. + +**Recommendation:** Extract `omega0`, `omega1`, `omega2`, `omega3`, and `OrdinalPartitionPair` into a shared utility file (e.g., `FormalConjectures/Util/OrdinalPartition.lean`), and define `OrdinalPartition κ α := OrdinalPartitionPair κ α α` or eliminate the separate definition. + +## 2. Citations + +The [erdosproblems.com/1170](https://www.erdosproblems.com/1170) page references three citations: + +| Citation | On Website | In Formalization | Status | +|----------|-----------|-----------------|--------| +| **[Va99]** (Section 7.86) | Yes — listed as a source reference | **Missing** from both the module and theorem docstrings | **Missing** | +| **[La82]** (Laver) | Yes | Yes | OK | +| **[FoHa03]** (Foreman–Hajnal) | Yes | Yes | OK | + +**Issue:** The `[Va99]` reference (which appears to be Hajnal–Larson, *Partition Relations*, Handbook of Set Theory) is missing from 1170's docstrings, even though it is cited in the sibling problems 1171 and 1172. It should be added, ideally with the section number (7.86) as given on the website. + +## 3. Variants + +The website lists this as a single problem with no sub-parts or variant formulations. The formalization captures the single core question. **No missing variants.** + +However, the known partial results describe *asymmetric* partition relations (ω₂ → (β, α)² rather than ω₂ → (α)²₂), and one could consider formalizing these as variant statements using `OrdinalPartitionPair`. This would be optional enrichment, not a gap. + +## 4. Readability + +The code is generally well-written and well-documented. Minor observations: + +- The docstring on `OrdinalPartition` clearly explains the arrow notation and the StrictMono encoding. Good. +- The theorem docstring repeats the known partial results from the module docstring, which is slightly redundant but acceptable for self-contained documentation. +- The name `OrdinalPartition` could be more specific (e.g., `OrdinalPartition2_2` or `BalancedOrdinalPartition`) to distinguish it from the asymmetric `OrdinalPartitionPair` used in sibling files, but this is a minor naming concern. + +## 5. Formalizability + +**Moderate ambiguity — inherent to the problem's nature.** + +The core issue is that Erdős's question is a *consistency* question: "Is it consistent (with ZFC) that...?" This asks about the existence of a model of ZFC satisfying a certain property, which is a meta-theoretic statement. The formalization explicitly acknowledges this (line 58: "This is a consistency question... We formalize the property itself.") and formalizes only the *property* ∀ α < ω₂, ω₂ → (α)²₂. + +This is a reasonable design choice. Lean's type theory (built on a fixed foundational system) cannot directly express "there exists a model of ZFC in which P holds." The `answer(sorry)` wrapper presumably allows the answer to be marked as independent/consistent/inconsistent. The gap between the formalized property and the original consistency question is clearly documented. + +The partition relation ω₂ → (α)²₂ itself is entirely precise and unambiguously formalizable. + +## 6. Correctness + +### 6.1 The `OrdinalPartition` definition (lines 45–49) + +The definition correctly captures κ → (α)²₂: + +- **Universal quantification over colorings:** `∀ f : {x // x < κ} → {x // x < κ} → Bool` — quantifies over all functions on ordered pairs. Since the homogeneity condition only evaluates `f (g i) (g j)` for `i < j` (and `g` is StrictMono, so `g i < g j`), the definition effectively quantifies over colorings of increasing pairs. This is equivalent to the standard formulation using unordered 2-element subsets. ✓ + +- **Homogeneous set via StrictMono:** A strictly monotone `g : {x // x < α} → {x // x < κ}` identifies a subset of order type α. The condition `∀ i j, i < j → f (g i) (g j) = c` ensures monochromaticity. ✓ + +- **Existential over color:** `∃ c : Bool` correctly captures "there exists a monochromatic set in *some* color." ✓ + +### 6.2 The `omega2` definition (line 39) + +`(aleph 2).ord` gives the initial ordinal of cardinality ℵ₂, which is ω₂. ✓ + +### 6.3 The theorem statement (lines 67–71) + +```lean +∀ α : Ordinal, α < omega2 → OrdinalPartition omega2 α +``` + +This correctly says: for every ordinal α < ω₂, the partition relation ω₂ → (α)²₂ holds. ✓ + +### 6.4 Docstring accuracy — Laver's result + +**Potential discrepancy in Laver's partial result.** The formalization states (lines 28–29 and 62–63): + +> Laver [La82] proved the consistency of ω₂ → (ω₁·2 + 1, α)² + +The standard reference for Laver's result in the literature is ω₂ → (ω₁·2 + 1, α)² (i.e., ω₁ multiplied by 2, plus 1). Foreman–Hajnal then strengthened this to ω₂ → (ω₁² + 1, α)². The formalization's distinction between these two results is consistent with the known mathematical literature and appears correct. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `OrdinalPartition` is equivalent to `OrdinalPartitionPair _ α α`; `omega2` duplicated across files | +| Citations | Missing [Va99] reference (Section 7.86) | +| Variants | Complete — single problem, no missing variants | +| Readability | Good; minor redundancy in docstrings | +| Formalizability | Property itself is fully formalizable; consistency meta-question cannot be directly expressed (documented) | +| Correctness | **Correct.** Definition, theorem statement, and encoding are mathematically sound | diff --git a/ai-review/1171.md b/ai-review/1171.md new file mode 100644 index 0000000000..d1440d2ae0 --- /dev/null +++ b/ai-review/1171.md @@ -0,0 +1,68 @@ +# AI Review: Erdős Problem 1171 + +## 1. Code Reuse + +Problems 1169, 1170, 1171, and 1172 each independently define their own local `omega1 : Ordinal := (aleph 1).ord`. This definition is duplicated four times across these files. A shared utility (e.g., in `FormalConjecturesForMathlib/SetTheory/`) could provide `omega0`, `omega1`, `omega2`, etc. once. Note that Mathlib already provides `Ordinal.omega0`, which is used implicitly via `open Ordinal` in the theorem statement (`omega1 * omega0`), but the locally-defined `omega1` shadows any potential Mathlib definition. + +Similarly, `OrdinalPartitionPair` is defined identically in 1169.lean and 1172.lean. The `OrdinalPartitionMulticolor` definition in 1171.lean is a genuine generalization of `OrdinalPartitionPair` to (k+1) colors and is unique to this file, so it cannot be directly replaced. However, a shared module for ordinal partition relation definitions would reduce redundancy across the 1169–1172 family. + +Problem 118 uses `OrdPartition` with order embeddings (`↪o`) rather than `StrictMono` functions. These are logically equivalent for well-ordered types, but the stylistic inconsistency across the codebase is worth noting. + +## 2. Citations + +**Website (erdosproblems.com/1171):** +- [Va99,7.84] — cited as the source of the problem +- Baumgartner [Ba89b] — "proved that, assuming a form of Martin's axiom, that ω₁ω → (ω₁ω, 3)²" + +**Formalization docstring:** +- "[Va99] Section 7.84." — matches the website +- "[Ba89b] Baumgartner." — matches the website + +The citations are consistent with the website. Neither the website nor the formalization provides full bibliographic details for [Va99] or [Ba89b]. The website identifies [Va99] with "Hajnal, A. and Larson, J., *Partition relations*. Handbook of Set Theory (2010)" in problem 1172, but not in 1171. The formalization could optionally expand these references for completeness, but as-is they match the website's level of detail. + +## 3. Variants + +The website states a single problem with no sub-parts or variants. The formalization captures exactly this one problem. No variants appear to be missing. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The docstring for `OrdinalPartitionMulticolor` says `$\alpha \to (\beta_0, \beta_1, \ldots, \beta_1)^2$ with $(k+1)$ colors`, which could be slightly clearer by saying "where $\beta_1$ appears $k$ times" to make explicit that there are k copies of the repeated target, not an arbitrary list. +- The definition name `OrdinalPartitionMulticolor` is descriptive and appropriate. +- The `omega1` definition has a clear docstring. +- The main theorem docstring clearly explains both the arrow notation and the natural-language meaning. + +## 5. Formalizability + +**Assessment: High.** The ordinal partition arrow notation $\alpha \to (\beta_0, \beta_1, \ldots, \beta_r)^n_s$ is a standard, well-defined concept in infinitary combinatorics / partition calculus. The specific instance here — coloring pairs (exponent 2) with (k+1) colors, seeking either an ω₁·ω-type homogeneous set for color 0 or a 3-element homogeneous set for any other color — is completely precise. There is no ambiguity in the mathematical statement. + +The only mild formalization choice is how to represent ordinals-below-α (as subtypes `{x : Ordinal // x < α}`) and homogeneous sets (as strictly monotone functions from the target type into the source type). These are standard and equivalent to the set-theoretic definition. + +## 6. Correctness + +**Overall assessment: Correct.** + +Detailed analysis: + +### Coloring domain +The coloring `f : {x : Ordinal // x < α} → {x : Ordinal // x < α} → Fin (k + 1)` is defined on all ordered pairs, while the standard partition relation colors 2-element subsets (unordered pairs). This is harmless: since the homogeneity condition is only checked for `i < j` (which yields `g i < g j` by strict monotonicity), the values of f on non-increasing pairs are irrelevant. The two formulations (ordered pairs vs. unordered pairs) are equivalent for the purpose of this partition relation. + +### Color structure +The definition correctly separates color 0 (with target `target₀`) from colors 1 through k (each with target `target_rest`). The second disjunct `∃ c : Fin (k + 1), 0 < c.val ∧ ...` correctly existentially quantifies over a non-zero color, matching the "3, ..., 3" part of the partition relation where any one of the k remaining colors suffices. + +### Ordinal arithmetic +- `omega1 ^ 2` correctly represents ω₁² (ordinal exponentiation). +- `omega1 * omega0` correctly represents ω₁ · ω (ordinal multiplication: ω copies of ω₁). Note ω₁ · ω < ω₁ · ω₁ = ω₁², so the target order type is strictly less than the source, as expected. +- `3` as a natural number literal is correctly coerced to the ordinal 3. + +### Quantifier structure +`∀ k : ℕ` ranges over all natural numbers. When k = 0, we get `Fin 1` (a single color), and the statement reduces to: every 1-coloring has a homogeneous set of type ω₁ · ω for the sole color. This is trivially true since ω₁ · ω embeds into ω₁². The non-trivial content is for k ≥ 1. Including k = 0 is harmless and matches the website's "for all finite k < ω" phrasing. + +### Baumgartner's result +The docstring correctly notes Baumgartner's conditional result (under Martin's axiom): ω₁ · ω → (ω₁ · ω, 3)². This is the k = 1 case of the problem but with source ordinal ω₁ · ω instead of ω₁². The formalization does not attempt to state this auxiliary result, which is appropriate since it is a known partial result, not the problem itself. + +### `answer(sorry)` wrapper +Appropriate for an open problem where the truth value is unknown. + +**No mathematical errors identified.** diff --git a/ai-review/1172.md b/ai-review/1172.md new file mode 100644 index 0000000000..a1b562fe54 --- /dev/null +++ b/ai-review/1172.md @@ -0,0 +1,93 @@ +# Erdős Problem 1172 — Review + +## 1. Code Reuse + +Several definitions in this file are duplicated across other Erdős problem files and could be consolidated into a shared utility module: + +- **`OrdinalPartitionPair`** — Identical definition exists in `ErdosProblems/1169.lean:41–48`. Both define the same `α → (β, γ)²` relation via strictly monotone embeddings with `Bool` coloring. +- **`GCH`** — Identical definition exists in `ErdosProblems/1173.lean:37`. Both state `∀ o, 2 ^ aleph o = aleph (o + 1)`. +- **`omega0`** — Defined as `(aleph 0).ord`, which equals Mathlib's `Ordinal.omega0` (i.e., `ω`). Since the file opens the `Ordinal` namespace, Mathlib's `omega0` is already in scope. The local definition shadows it with an identical value. It could simply be removed. +- **`omega1`** — Duplicated in `1169.lean:33`, `1171.lean:38`, and likely others. +- **`omega2`** — Duplicated in `1170.lean:39`. + +A shared utility (e.g., `FormalConjectures/Util/OrdinalPartition.lean`) housing `OrdinalPartitionPair`, `GCH`, `CH`, and the `omegaN` definitions would reduce duplication across the 1169–1173 cluster. + +## 2. Citations + +The module docstring states: + +> [Va99] Hajnal, A. and Larson, J., *Partition relations*. Handbook of Set Theory (2010). + +This conflates two distinct references. Comparing with `ErdosProblems/1173.lean`, which cites "[Va99] Vaughan, J.E., 7.88", the tag **[Va99]** almost certainly refers to a 1999 survey or problem collection by **Vaughan**, not the Hajnal–Larson chapter. The Hajnal–Larson chapter in the Handbook of Set Theory (2010) is the *underlying source* for the partition relation problems, but it has a different citation key. + +**Recommendation:** Separate the citations. For example: +- `[Va99]` Vaughan, J.E. (1999), section 7.87. +- The underlying reference is Hajnal, A. and Larson, J., *Partition relations*, Handbook of Set Theory (2010). + +The website itself only shows `[Va99, 7.87]` and notes "A problem of Erdős and Hajnal." The individual theorem docstrings correctly reference `[Va99, 7.87]`. + +## 3. Variants + +The website lists exactly four statements: + +| # | Hypothesis | Relation | Captured? | +|---|-----------|----------|-----------| +| 1 | GCH | ω₃ → (ω₂, ω₁+2)² | Yes (`erdos_1172`) | +| 2 | GCH | ω₃ → (ω₂+ω₁, ω₂+ω)² | Yes (`variants.gch_partition_2`) | +| 3 | GCH | ω₂ → (ω₁^(ω+2)+2, ω₁+2)² | Yes (`variants.gch_partition_3`) | +| 4 | CH | ω₂ → (ω₁+ω)²₂ | Yes (`variants.ch_partition`) | + +All four variants are present. Coverage is complete. + +## 4. Readability + +Generally good. Specific observations: + +- The docstrings clearly explain the arrow notation and the `answer(sorry)` pattern. +- The uncertainty disclaimers about the truncated photocopy are helpful. +- Naming is consistent: `erdos_1172` for the primary statement, `variants.*` for the rest. +- Minor: the `omega0`/`omega1`/`omega2`/`omega3` definitions have clear docstrings with LaTeX. + +One small improvement: the `OrdinalPartitionPair` docstring says "color true" and "color false" while the 1169 version says "color 0" and "color 1." Since the type is `Bool`, "true/false" (as used here) is more precise. + +## 5. Formalizability + +**Assessment: Moderate ambiguity due to truncated source.** + +The problem is stated in standard ordinal partition arrow notation, which has a precise mathematical meaning and is directly formalizable. The `OrdinalPartitionPair` definition correctly captures `α → (β, γ)²` via strictly monotone embeddings. + +The main source of ambiguity is the **truncated photocopy issue**: the website states that "the right-hand side of the first and final statements are missing from the truncated photocopy available." This means the exact parameters in at least two of the four relations are uncertain and may have been reconstructed or guessed. + +The `answer(sorry)` pattern appropriately handles the "establish whether" phrasing, since the answer could be true or false (and may even be independent of the stated axioms). + +One inherent limitation: ordinal partition relations under GCH/CH are set-theoretic statements whose truth value may be independent of ZFC+GCH. Lean's type theory proves theorems in a fixed foundation, so "establish whether" is interpreted as "determine the Boolean answer", which is the best available formalization. + +## 6. Correctness + +### Definitions — Correct + +- **`OrdinalPartitionPair`**: Correctly formalizes the 2-color ordinal partition relation. The coloring function `f` is defined on all ordered pairs but only evaluated on increasing pairs (via `i < j` and strict monotonicity of `g`). This is equivalent to coloring 2-element subsets `[α]²`, since any restriction/extension between `α × α → Bool` and `[α]² → Bool` preserves the relevant values. Mathematically sound. +- **`GCH`** and **`CH`**: Standard formulations. The universe annotation `.{0}` is appropriate. +- **Ordinal constants**: All correct. `(aleph n).ord` gives the initial ordinal `ωₙ`. + +### Ordinal arithmetic — Correct + +- Part 1: `omega1 + 2` = ω₁ + 2. ✓ +- Part 2: `omega2 + omega1` = ω₂ + ω₁, `omega2 + omega0` = ω₂ + ω. ✓ +- Part 3: `omega1 ^ (omega0 + 2) + 2` = ω₁^(ω+2) + 2, `omega1 + 2` = ω₁ + 2. ✓ +- Part 4: `omega1 + omega0` = ω₁ + ω (both components). ✓ + +### Truncated photocopy disclaimer — Possible misattribution + +The website states: *"The right-hand side of the first and final statements are missing from the truncated photocopy available."* + +The code places the truncation disclaimer on **Parts 1 and 3**. However, "first and final" in a list of four statements most naturally refers to **Parts 1 and 4**. The word "final" typically means "last", not "last within a subgroup." + +- If the disclaimer should be on Parts 1 and 4, then **Part 4** (`ω₂ → (ω₁+ω)²₂`) should also carry an uncertainty note — the target `ω₁+ω` may be incomplete (e.g., it could be `ω₁+ω·2` or `ω₁+ω+1`). +- **Part 3**'s disclaimer may be unwarranted under the "first and final" reading. + +That said, a reading of "first and final *of the GCH statements*" (Parts 1 and 3) is also defensible since the CH statement is listed separately on the website. This ambiguity is worth flagging but is not a clear-cut error. + +### Overall mathematical correctness: **Sound** + +The formalization faithfully captures all four partition relation problems as stated on the website. No mathematical errors in the definitions or theorem statements. The only concern is the ambiguity in which statements have uncertain parameters due to the truncated source, which is a documentation issue rather than a formalization error. diff --git a/ai-review/1173.md b/ai-review/1173.md new file mode 100644 index 0000000000..2a4faa18f9 --- /dev/null +++ b/ai-review/1173.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 1173 + +## 1. Code Reuse + +**GCH definition is duplicated.** The definition + +```lean +def GCH : Prop := ∀ o : Ordinal.{0}, (2 : Cardinal.{0}) ^ aleph o = aleph (o + 1) +``` + +appears identically in both `ErdosProblems/1172.lean` (line 62, namespace `Erdos1172`) and `ErdosProblems/1173.lean` (line 37, namespace `Erdos1173`). These could be unified into a shared utility (e.g., in `FormalConjecturesForMathlib/SetTheory/`) and imported by both files. + +**Ordinal construction pattern is repeated.** The pattern `(aleph n).ord` for defining initial ordinals is used across problems 1169–1173 (e.g., `omega1`, `omega2` in 1170, 1171, 1172). The `omegaOmega1` definition follows the same convention but is unique to this file. + +**`IsFreeSet` is specific to this problem.** No other file defines a free set for set mappings in this sense. Problem 1177 defines `IsFreeOf` for hypergraphs, which is unrelated. + +No existing code in `FormalConjecturesForMathlib/` directly provides reusable definitions for this problem beyond standard cardinal/ordinal imports. + +## 2. Citations + +The docstring references: + +- `[Ko25b] Koepke, P., Problem 35.` +- `[Va99] Vaughan, J.E., 7.88.` + +The website (erdosproblems.com/1173) attributes the problem to **Erdős and Hajnal** and lists references that the WebFetch rendered as "Komei Fukunaga 2025b, Problem 35" and "Väisälä 1999, 7.88." The first is likely a garbled rendering of "Koepke, P." and the second of "Vaughan, J.E." — the code's citation keys and shorthands are plausible but should be verified against the actual source entries on the website. The reference format `[Va99] Vaughan, J.E., 7.88` is shorthand — a full bibliographic entry (title, journal/book, year) would be more useful but is consistent with the style used across the codebase. + +The docstring correctly identifies this as "A problem of Erdős and Hajnal," matching the website. + +## 3. Variants + +The website describes a single problem statement, and the formalization captures exactly that statement. **No additional variants are mentioned on the website.** The formalization is complete in this regard. + +## 4. Readability + +The code is reasonably readable. A few observations: + +- The repeated subtype `{α : Ordinal // α < omegaOmega1}` is verbose but standard for this codebase. A local abbreviation (e.g., `abbrev Elem := {α : Ordinal // α < omegaOmega1}`) could improve readability, though this is a minor style point. +- The docstring on `erdos_1173` is thorough and includes a helpful explanation of `Cardinal.lift` usage for universe reconciliation, which aids comprehension. +- The `IsFreeSet` definition has a clear docstring explaining the mathematical meaning. +- The overall structure (helper defs → main theorem) is clean and follows the conventions of neighboring files. + +## 5. Formalizability + +**The problem is precise enough to be obviously formalizable.** The statement specifies: +- The ambient space (ω_{ω+1}) +- The constraint on the set mapping (images of size ≤ ℵ_ω, pairwise intersections of size < ℵ_ω) +- The conclusion (existence of a free set of cardinality ℵ_{ω+1}) +- The background assumption (GCH) + +**Ambiguity assessment: Low.** The only potential ambiguity is in the definition of "set mapping" — classically, a set mapping requires α ∉ f(α), while the formalization allows α ∈ f(α). However, with the free set condition defined as f(α) ∩ H ⊆ {α}, these two conventions yield mathematically equivalent problems (see Correctness section). The formalization resolves this cleanly. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Domain and codomain +- `omegaOmega1 = (aleph (ω + 1)).ord` correctly defines ω_{ω+1}, the initial ordinal of ℵ_{ω+1}. +- The domain `{α : Ordinal // α < omegaOmega1}` correctly represents the ordinals below ω_{ω+1}. + +### Cardinality constraints +- `Cardinal.mk ↥(f α) ≤ Cardinal.lift.{1,0} (aleph ω)` correctly encodes |f(α)| ≤ ℵ_ω, i.e., f maps into [ω_{ω+1}]^{≤ ℵ_ω}. +- `Cardinal.mk ↥(f α ∩ f β) < Cardinal.lift.{1,0} (aleph ω)` correctly encodes |f(α) ∩ f(β)| < ℵ_ω for α ≠ β. +- The use of `Cardinal.lift.{1,0}` is necessary and correct: the subtype lives in `Type 1` (since `Ordinal.{0} : Type 1`), so `Cardinal.mk` produces a `Cardinal.{1}`, while `aleph` produces a `Cardinal.{0}`. + +### Free set definition +- `IsFreeSet f H := ∀ α ∈ H, f α ∩ H ⊆ {α}` means: for each α ∈ H, the only element of H that can appear in f(α) is α itself. Equivalently, for distinct α, β ∈ H, β ∉ f(α). This is the standard notion of a free set for set mappings. +- **Convention note:** The classical definition of "set mapping" (Hajnal) requires α ∉ f(α) and then defines a free set as one where f(α) ∩ H = ∅ for all α ∈ H. The formalization omits the α ∉ f(α) constraint but compensates with the weaker free set condition f(α) ∩ H ⊆ {α}. These are equivalent: given any f, define g(α) = f(α) \ {α}; then H is free for f (in the formalization's sense) iff H is free for g (in the classical sense), and g satisfies the classical set mapping constraint. So **the two formulations are interchangeable**, and the formalization is correct. + +### Conclusion +- `Cardinal.lift.{1,0} (aleph (ω + 1)) ≤ Cardinal.mk ↥H` asks for |H| ≥ ℵ_{ω+1}. Since H ⊆ ω_{ω+1} and |ω_{ω+1}| = ℵ_{ω+1}, this forces |H| = ℵ_{ω+1}. This correctly captures "a free set of cardinality ℵ_{ω+1}." + +### Open problem encoding +- The `answer(sorry) ↔ ...` pattern correctly encodes an open question whose truth value is unknown. +- GCH appears as a hypothesis via `∀ (h : GCH)`, which is equivalent to `GCH → ...` in Lean. This correctly conditions the statement on GCH. + +**Verdict: No mathematical errors detected.** The formalization faithfully represents the problem as stated on erdosproblems.com. diff --git a/ai-review/1174.md b/ai-review/1174.md new file mode 100644 index 0000000000..84e545db80 --- /dev/null +++ b/ai-review/1174.md @@ -0,0 +1,72 @@ +# AI Review: Erdős Problem 1174 + +**File:** `FormalConjectures/ErdosProblems/1174.lean` + +## 1. Code Reuse + +The formalization models edge colorings as raw symmetric functions `col : V → V → ℕ` with an explicit symmetry hypothesis `(∀ u v : V, col u v = col v u)`. The codebase offers a potentially cleaner alternative: + +- **`Sym2 V → ℕ`** — The `antiRamseyNum` definition in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` (line 159) already models edge colorings as `c : Sym2 V → C`. Using `Sym2 V → ℕ` would eliminate the need for the explicit symmetry condition entirely, since `Sym2` encodes unordered pairs by construction. +- **`SimpleGraph.Coloring`** — This is for *vertex* colorings, not edge colorings, so it is not applicable here. +- **`OrdinalCardinalRamsey`** in `FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean` — This deals with 2-colorings of complete graphs on ordinal types, which is a different setup (fixed complete graph, 2 colors, ordinal-typed cliques). Not directly reusable. +- **`SimpleGraph.IsNClique` and `SimpleGraph.IsClique`** — These are already used correctly. + +**Recommendation:** Consider replacing `col : V → V → ℕ` + symmetry hypothesis with `col : Sym2 V → ℕ`, using `col ⟦(u, v)⟧` to look up edge colors. This would be more idiomatic and consistent with other edge-coloring formalizations in the codebase. + +## 2. Citations + +The formalization cites: + +> [Va99] Vardi, I. (ed.), *Problems from the Erdős problem collection*, §7.91 (1999). + +The website (erdosproblems.com/1174) lists the source as **[Va99, 7.91]**. The citation in the formalization correctly expands this to the full reference. The attribution to Erdős and Hajnal and the note about Shelah's consistency result are both present on the website and in the docstrings. Citations are accurate. + +## 3. Variants + +The website poses two related questions: + +1. Does there exist a graph G with no K₄ such that every edge colouring with countably many colours contains a monochromatic K₃? +2. Does there exist a graph G with no K_{ℵ₁} such that every edge colouring with countably many colours contains a monochromatic K_{ℵ₀}? + +Both are formalized: +- `erdos_1174` captures Part 1 (finite case). +- `erdos_1174.variants.infinite_clique` captures Part 2 (infinite case). + +**All variants are captured.** + +## 4. Readability + +The code is generally readable. The docstrings clearly explain both parts and note the Shelah consistency result. Minor suggestions: + +- **Symmetry hypothesis clutter:** As noted in §1, using `Sym2 V → ℕ` would remove the `(∀ u v : V, col u v = col v u) →` hypothesis from both theorems, making the statements cleaner. +- **Naming:** `erdos_1174.variants.infinite_clique` is descriptive and follows the project's naming convention. +- **Part labeling in docstrings:** The docstrings clearly label "Part 1" and "Part 2," matching the website's two-question structure. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem is a clean existential statement about graphs with specific Ramsey-theoretic properties. The key concepts (clique, edge coloring, countable color set, monochromatic subgraph) are all standard and well-defined. The only potential source of ambiguity is: + +- **"Countably many colours"**: Could mean "at most countable" (finite or countably infinite). The formalization uses ℕ as the color set. This is correct: any coloring with a countable color set can be encoded as an ℕ-coloring (by bijection), and any finite coloring embeds into ℕ. Since the quantifier is universal (∀ colorings), using ℕ captures the full generality. + +- **Set-theoretic sensitivity**: Shelah showed the existence of such graphs is *consistent with* ZFC but not provable from ZFC. The `answer(sorry)` wrapper correctly handles the unknown truth value — the answer may depend on the model of set theory. This is an inherent feature of the problem, not a flaw in the formalization. In Lean's type theory (which is equiconsistent with ZFC + inaccessible cardinals), the answer is fixed but unknown. + +## 6. Correctness + +**Part 1 (`erdos_1174`):** + +- **No K₄ condition:** `∀ S : Finset V, ¬G.IsNClique 4 S` — Correctly states G has no 4-clique. ✓ +- **Edge coloring:** `∀ (col : V → V → ℕ), (∀ u v : V, col u v = col v u) →` — Models a symmetric edge coloring with countably many colors. The function is defined on all vertex pairs (including non-edges and diagonal pairs), but this is harmless: + - Non-edges: irrelevant because the conclusion only examines vertices forming a clique (which are by definition pairwise adjacent). + - Diagonal pairs (u = u): filtered out by the `u ≠ v` condition in the conclusion. +- **Monochromatic K₃:** `∃ (S : Finset V) (c : ℕ), G.IsNClique 3 S ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col u v = c` — Correctly requires a 3-clique in G whose edges are all the same color. ✓ + +**Part 2 (`erdos_1174.variants.infinite_clique`):** + +- **No K_{ℵ₁}:** `¬∃ S : Set V, aleph 1 ≤ Cardinal.mk ↥S ∧ G.IsClique S` — Correctly states no clique of cardinality ≥ ℵ₁. ✓ +- **Monochromatic K_{ℵ₀}:** `∃ (S : Set V) (c : ℕ), aleph 0 ≤ Cardinal.mk ↥S ∧ G.IsClique S ∧ ∀ u ∈ S, ∀ v ∈ S, u ≠ v → col u v = c` — Correctly requires an infinite clique (cardinality ≥ ℵ₀) that is monochromatic. ✓ + +**Subtle correctness note on "K_{ℵ₀}" and "K_{ℵ₁}":** The standard notation K_κ for a cardinal κ means a complete graph on κ vertices, i.e., a clique of cardinality exactly κ. The formalization uses `≥ ℵ₁` and `≥ ℵ₀` inequalities instead of exact equalities. For the "no K_{ℵ₁}" condition, `¬∃ S, ℵ₁ ≤ #S ∧ clique S` is equivalent to "no clique of cardinality ≥ ℵ₁," which is the same as "no clique of cardinality exactly ℵ₁" when working in ZFC (since a larger clique contains one of size ℵ₁). Similarly, "monochromatic K_{ℵ₀}" as `ℵ₀ ≤ #S` means "at least countably infinite," which correctly captures an infinite monochromatic clique. This is mathematically sound. + +**Overall correctness: The formalization is correct and complete.** No mathematical flaws identified. The edge-coloring model, while slightly unconventional (function on vertex pairs rather than on `Sym2` or on the edge set), is equivalent to the standard formulation. diff --git a/ai-review/1175.md b/ai-review/1175.md new file mode 100644 index 0000000000..51550e20ee --- /dev/null +++ b/ai-review/1175.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 1175 + +## 1. Code Reuse + +The formalization defines a custom `HasChromaticNumber` predicate (lines 42–44) that captures "the chromatic number of G equals κ" at the cardinal level. The codebase already provides a standard utility for this: + +- **`chromaticCardinal`** in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136–137`: + ```lean + noncomputable def chromaticCardinal.{u} {V : Type u} (G : SimpleGraph V) : Cardinal := + sInf {κ : Cardinal | ∃ (C : Type u) (_ : Cardinal.mk C = κ), Nonempty (G.Coloring C)} + ``` + +The custom `HasChromaticNumber G κ` is logically equivalent to `G.chromaticCardinal = κ`. Proof sketch: the first conjunct gives an upper bound (∃ α with #α ≤ κ admitting a coloring), and the second conjunct gives a lower bound (every coloring uses ≥ κ colors). Together these force the infimum to be exactly κ, since cardinals are well-ordered and the infimum is attained. + +Neighboring problems already use `chromaticCardinal`: +- **Problem 1067** (line 59): `G.chromaticCardinal = ℵ_ 1` +- **Problem 1176** (line 38): `G.chromaticCardinal = aleph 1` + +**Recommendation:** Replace `HasChromaticNumber G κ` with `G.chromaticCardinal = κ` (and similarly for `H`) to align with codebase conventions. This eliminates the custom definition entirely. A universe annotation may be needed since the theorem works at `Cardinal.{0}`. + +## 2. Citations + +The docstring references `[Va99]` as "the source for this problem (Problem 7.92)." The website at erdosproblems.com/1175 confirms this reference. However, the citation is not expanded to a full bibliographic entry. Based on the problem number range and the "Va99" tag, this likely refers to: + +> Väth, M., or more likely **Vaugn** (1999) — the erdosproblems.com site associates this reference with the problem. + +**Recommendation:** Expand the citation to a full bibliographic reference in the module docstring, consistent with other problems (e.g., Problem 1067 which lists full author, title, journal, year). If the exact source cannot be confirmed, note this explicitly. + +The Shelah consistency result mentioned in the docstring ("Shelah proved that a negative answer is consistent if κ = λ = ℵ₁") should also have a citation if possible. + +## 3. Variants + +The problem as stated on erdosproblems.com is a single question without listed variants. The formalization captures the main question faithfully. + +One natural variant that could be considered: +- **The κ = ℵ₁ special case**: Shelah's consistency result shows that a negative answer for κ = λ = ℵ₁ is consistent with ZFC. This could be formalized as a separate theorem (analogous to how Problem 1067 has an edge-connectivity variant). + +**Assessment:** No variants are missing from the website. The Shelah result could optionally be a variant but is not required. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The variable `mu` is used for the existentially quantified cardinal that the problem calls λ. This is reasonable since `lambda` is a Lean keyword. The docstring explains the correspondence clearly. +- The `HasChromaticNumber` definition has a clear docstring explaining the two conditions. +- The theorem docstring explains the notation well (CliqueFree 3, H ≤ G, etc.). + +**Suggestion:** If `chromaticCardinal` is adopted (see §1), the theorem statement becomes more concise and self-documenting: +```lean +∀ κ : Cardinal.{0}, aleph 1 ≤ κ → + ∃ mu : Cardinal.{0}, + ∀ (V : Type) (G : SimpleGraph V), G.chromaticCardinal = mu → + ∃ H : SimpleGraph V, H ≤ G ∧ H.CliqueFree 3 ∧ H.chromaticCardinal = κ +``` + +## 5. Formalizability + +The problem is **highly formalizable** with **low ambiguity**. + +- "Uncountable cardinal" → `aleph 1 ≤ κ`: precise and standard. +- "Chromatic number λ" → a graph requiring exactly λ colors: well-defined at the cardinal level. +- "Contains a triangle-free subgraph" → `∃ H, H ≤ G ∧ H.CliqueFree 3`: well-defined. +- "Chromatic number κ" for the subgraph: same as above. + +The only potential source of ambiguity is the meaning of "subgraph." The formalization uses `H ≤ G` (spanning subgraph: same vertex set, subset of edges) rather than `G.Subgraph` (which allows vertex restriction). This is mathematically equivalent for chromatic number purposes: any subgraph on a vertex subset can be extended to the full vertex set by making extra vertices isolated, which does not change the chromatic number (isolated vertices can reuse any existing color). So there is no loss of generality. + +**Ambiguity assessment: Very low.** The problem statement is precise. + +## 6. Correctness + +The formalization is **mathematically correct** with one structural concern: + +### What is correct: +- **Uncountable cardinal condition**: `aleph 1 ≤ κ` correctly captures "κ is uncountable." +- **Triangle-free**: `H.CliqueFree 3` correctly means no 3-clique, i.e., triangle-free. +- **Subgraph relation**: `H ≤ G` on `SimpleGraph V` correctly models "H is a subgraph of G" (see §5 discussion). +- **Open problem with `answer(sorry)`**: Correct — the truth value is unknown. The problem is tagged `open`, consistent with erdosproblems.com. +- **AMS classification `3 5`**: Combinatorics (05) and Set Theory (03) — appropriate. + +### Structural concern: +- **Custom `HasChromaticNumber` vs. `chromaticCardinal`**: While mathematically equivalent, the custom definition creates a divergence from the rest of the codebase. This is not a correctness bug, but it means lemmas proven about `chromaticCardinal` elsewhere cannot be directly applied to `HasChromaticNumber` without showing equivalence first. + +### Universe considerations: +- The theorem is stated at `Cardinal.{0}` with `V : Type` (universe 0). This restricts to graphs on small types. Since the problem involves arbitrary uncountable cardinals, one might ask whether universe 0 is sufficient. In practice, ZFC-style set theory works within a single universe, so this is standard for the codebase. However, for very large cardinals (e.g., inaccessible cardinals), universe 0 may be restrictive. This is a known limitation shared by many formalized problems and is acceptable. + +### Verdict: +**The formalization is correct and complete.** No mathematical flaws. The only recommendation is to use `chromaticCardinal` for consistency with the rest of the codebase. diff --git a/ai-review/1177.md b/ai-review/1177.md new file mode 100644 index 0000000000..0e37de5c45 --- /dev/null +++ b/ai-review/1177.md @@ -0,0 +1,137 @@ +# AI Review: Erdős Problem 1177 + +## 1. Code Reuse + +Several other Erdős problem formalizations define nearly identical hypergraph coloring infrastructure: + +- **Problem 593** (`ErdosProblems/593.lean`): Defines `Hypergraph3`, `IsProperColoring` (same semantics as `IsProperColoring3` here), and `HasUncountableChromaticNumber`. Very close match — uses a `structure` rather than bare `Set (Finset V)`. +- **Problem 833** (`ErdosProblems/833.lean`): Defines `Hypergraph`, `IsProperColoring`, and `HasChromaticNumber`. Uses `Finset (Finset V)` (finite edge sets) and finite chromatic numbers, so not directly applicable to the cardinal setting here, but the coloring definition is identical in spirit. +- **Problem 832** (`ErdosProblems/832.lean`): Defines `UniformHypergraph`, `IsProperColoring`, and `chromaticNumber` for finite uniform hypergraphs. +- **Problem 836** (`ErdosProblems/836.lean`): Defines `Hypergraph`, `IsProperColoring`, and `HasChromaticNumber3` (meaning chromatic number = 3, a different use of the name). + +There is no shared library for hypergraph coloring. The codebase's `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` extends Mathlib's `SimpleGraph.Coloring` and `chromaticNumber`, but these apply only to simple graphs, not hypergraphs. + +**Recommendation**: A shared `Hypergraph` module with `IsProperColoring` and a cardinal-valued `chromaticNumber` could unify Problems 593, 832, 833, 834, 836, and 1177. However, Problem 1177 uniquely requires a cardinal-valued chromatic number (`Cardinal.{0}`) rather than `ℕ`, and uses `Set (Finset V)` (potentially infinite edge sets) rather than `Finset (Finset V)`. These are legitimate design choices for this problem's set-theoretic setting, so the current standalone definitions are defensible. + +The `IsFreeOf` notion (sub-hypergraph freeness) does not appear elsewhere in the codebase and could potentially be extracted for reuse. + +## 2. Citations + +The website ([erdosproblems.com/1177](https://www.erdosproblems.com/1177)) lists the following: + +- **Attribution**: A problem of Erdős, Galvin, and Hajnal. +- **Reference**: [Va99, 7.94] +- **Status**: Open + +The formalization's docstrings state: + +> A problem of Erdős, Galvin, and Hajnal. +> [Va99] is the source reference for all parts (Section 7.94). + +This matches the website. The reference "Va99" is not expanded to a full bibliographic entry on the website itself, so the shorthand is consistent with the source. No discrepancy found. + +## 3. Variants + +The website states three parts to the problem. The formalization captures all three: + +| Website Part | Formalization | Match? | +|---|---|---| +| Part 1: If F_G(ℵ₁) ≠ ∅, then ∃ X ∈ F_G(ℵ₁) with \|X\| ≤ 2^(2^ℵ₀) | `erdos_1177` | Yes | +| Part 2: F_G(ℵ₁) ≠ ∅ ∧ F_H(ℵ₁) ≠ ∅ → F_G(ℵ₁) ∩ F_H(ℵ₁) ≠ ∅ | `erdos_1177.variants.intersection` | Yes | +| Part 3: κ,λ uncountable, F_G(κ) ≠ ∅ → F_G(λ) ≠ ∅ | `erdos_1177.variants.cardinal_transfer` | Yes | + +All variants are captured. The formalization uses `μ` instead of `λ` for the second cardinal in Part 3, which is a sensible choice to avoid conflict with Lean's lambda keyword. + +## 4. Readability + +**Strengths:** +- Clean namespace scoping (`Erdos1177`) for helper definitions. +- Each definition has a thorough docstring explaining the mathematical content. +- Theorem names are descriptive and follow a consistent hierarchy (`erdos_1177`, `erdos_1177.variants.intersection`, `erdos_1177.variants.cardinal_transfer`). +- The `open Cardinal` is appropriately scoped. + +**Suggestions:** +- The name `IsProperColoring3` is slightly confusing — the "3" might be read as "3 colors" rather than "for 3-uniform hypergraphs." A name like `IsProperHypergraphColoring` would be more self-documenting, since the 3-uniformity constraint is enforced separately via `∀ e ∈ edges, e.card = 3`. +- Similarly, `HasChromaticNumber3` could be confused with "has chromatic number equal to 3" (which is exactly how Problem 836 uses the same name). A name like `HasHypergraphChromaticNumber` would reduce ambiguity. +- The hypothesis names in the theorems (e.g., `hG`, `hFG`, `hFH`) are clear and concise. + +## 5. Formalizability + +**Assessment: High — the problem is precisely formalizable.** + +The problem is stated in terms of well-defined set-theoretic objects: finite 3-uniform hypergraphs, chromatic number as a cardinal, sub-hypergraph containment, and cardinal arithmetic (ℵ₁, 2^(2^ℵ₀))). + +All concepts involved have clean Lean 4 / Mathlib representations: +- Cardinals via `Cardinal.{0}` and `aleph`. +- Hypergraph edges as `Set (Finset V)` with a uniformity constraint. +- Proper coloring as a function `V → α` with the non-monochromatic condition. +- Sub-hypergraph freeness as the negation of an injective embedding. + +There is no ambiguity in the problem statement that would require interpretation choices. The only modeling choice is the representation of hypergraphs (bare edge sets vs. structures), which does not affect mathematical content. + +**Ambiguity level: None.** The problem is stated with full precision on the website. + +## 6. Correctness + +### IsProperColoring3 — Correct ✓ + +```lean +def IsProperColoring3 {V α : Type*} (edges : Set (Finset V)) (c : V → α) : Prop := + ∀ e ∈ edges, ∃ v ∈ e, ∃ w ∈ e, c v ≠ c w +``` + +This correctly captures "no edge is monochromatic": for every edge, there exist two vertices receiving different colors. This is the standard definition. + +### HasChromaticNumber3 — Correct ✓ + +```lean +def HasChromaticNumber3 {V : Type} (edges : Set (Finset V)) (κ : Cardinal.{0}) : Prop := + (∃ (α : Type), #α ≤ κ ∧ ∃ c : V → α, IsProperColoring3 edges c) ∧ + ∀ (α : Type), (∃ c : V → α, IsProperColoring3 edges c) → κ ≤ #α +``` + +This defines κ as the minimum cardinal admitting a proper coloring via a min-max characterization: +- **First conjunct**: κ colors suffice (there exists a color type of cardinality ≤ κ). +- **Second conjunct**: no smaller color type suffices — if α admits a proper coloring, then |α| ≥ κ. + +A potential concern: the second conjunct quantifies over the cardinality of the *color type*, not the number of *colors actually used*. However, this is correct because: (a) if χ(H) colors suffice, one can take α of cardinality exactly χ(H); and (b) any α with |α| ≥ χ(H) also admits a coloring (by embedding). Thus `inf{#α : ∃ proper coloring V → α} = χ(H)`, and the two conjuncts together pin κ = χ(H). + +Universe handling is appropriate: `V : Type` (universe 0), `α : Type` (universe 0), `κ : Cardinal.{0}`. + +### IsFreeOf — Correct ✓ + +```lean +def IsFreeOf {VG VH : Type*} (edgesG : Set (Finset VG)) (edgesH : Set (Finset VH)) : Prop := + ¬ ∃ f : VG → VH, Function.Injective f ∧ + ∀ e ∈ edgesG, ∃ e' ∈ edgesH, (↑e' : Set VH) = f '' (↑e : Set VG) +``` + +This correctly captures "G does not embed as a sub-hypergraph of H": there is no injective vertex map sending every edge of G to an edge of H. Edge injectivity follows automatically from vertex injectivity (distinct finite sets map to distinct images under an injective function). + +### Part 1 (erdos_1177) — Correct ✓ + +The cardinality bound `#VH ≤ (2 : Cardinal.{0}) ^ (2 : Cardinal.{0}) ^ aleph 0` correctly represents 2^(2^ℵ₀), since `^` is right-associative in Lean. The overall structure correctly formalizes: "if F_G(ℵ₁) ≠ ∅, then there exists X ∈ F_G(ℵ₁) with |V(X)| ≤ 2^(2^ℵ₀))." + +### Part 2 (erdos_1177.variants.intersection) — Correct ✓ + +Correctly formalizes the intersection property. Both G and H are required to be finite 3-uniform with finite edge sets. + +### Part 3 (erdos_1177.variants.cardinal_transfer) — Correct ✓ + +The "uncountable" condition is encoded as `aleph 1 ≤ κ` and `aleph 1 ≤ μ`, which is equivalent to "uncountable" under AC (which Lean assumes via classical logic + choice). + +### Minor Observations + +- The formalization does not explicitly require edges to be nonempty or to have distinct vertices, but the `e.card = 3` constraint on `Finset` edges handles this (a `Finset` with card 3 necessarily has 3 distinct elements). +- The degenerate case where G has no edges (edgesG = ∅) is handled gracefully — every hypergraph is vacuously G-free, and the statements remain true. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Multiple similar definitions exist across problems; shared hypergraph coloring library would help, but the cardinal-valued setting here is unique | +| Citations | Consistent with website; [Va99, 7.94] matches | +| Variants | All 3 parts captured | +| Readability | Good overall; naming of `IsProperColoring3` / `HasChromaticNumber3` could be clearer | +| Formalizability | High; no ambiguity | +| Correctness | All definitions and theorem statements are mathematically correct | diff --git a/ai-review/1178.md b/ai-review/1178.md new file mode 100644 index 0000000000..62ce168715 --- /dev/null +++ b/ai-review/1178.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 1178 + +## 1. Code Reuse + +**Significant duplication with Problems 1157 and 716.** + +Problem 1157 (`FormalConjectures/ErdosProblems/1157.lean`) defines essentially the same concepts under different names: + +| 1178 (standalone defs) | 1157 (standalone defs) | Semantics | +|---|---|---| +| `IsRUniform r E` | `UniformHypergraph r n` (structure) | r-uniform hypergraph | +| `ContainsConfig d e n E` | `edgesSpannedBy` + `IsFree` | Substructure avoidance | +| `turanNumber r n d e` | `extremalNumber r n k s` | Extremal number ex_r(n; d, e) | + +Problem 716 (`FormalConjectures/ErdosProblems/716.lean`) also independently defines `Hypergraph3` (3-uniform case) and `isFree`. + +All three files define the same extremal hypergraph concepts from scratch. Problem 1157 is the most general (the Brown–Erdős–Sós conjecture in full generality), and 1178 is explicitly the t=2 special case of 1157. Ideally, 1178 should import and reuse definitions from 1157 (or a shared utility file), replacing `turanNumber` with `Erdos1157.extremalNumber` and `ContainsConfig`/`IsRUniform` with the corresponding 1157 definitions. + +No existing definitions in `FormalConjecturesForMathlib/` cover this area. + +## 2. Citations + +The formalization cites **[BES73], [Er75b], [Er81]**. Comparing against the website: + +- **[BES73]** — Cited correctly. The formalization gives the title as *"On the existence of triangulated spheres in 3-graphs, and related problems"*, but the website and Problem 1157 both reference the title as *"Some extremal problems on r-graphs"* (New Directions in the Theory of Graphs, 1973). These may be two different BES73 papers or the title may be wrong. +- **[Er75b]** — Not listed on the website for this problem. May be valid but cannot be verified against the website source. +- **[Er81]** — Not listed on the website for this problem. Same caveat. +- **[RuSz78]** (Ruzsa & Szemerédi) — **Missing from the formalization** but listed on the website. The docstring mentions Ruzsa–Szemerédi proved d_3(3)=6 implicitly (via "Erdős, Frankl, and Rödl proved the case e=3") but does not cite [RuSz78]. +- **[EFR86]** (Erdős, Frankl, Rödl) — **Missing from the formalization** but referenced on the website. The docstring mentions their result but gives no citation tag. +- **[SaSe05], [SoSo17], [CGLS23]** — Not cited in the formalization; these provide upper bound results mentioned on the website. + +**Recommendation:** Fix the [BES73] title to match the canonical one. Add explicit [RuSz78] and [EFR86] citation tags since these partial results are already discussed in the docstring. + +## 3. Variants + +The website mentions an additional related open question by Erdős: + +> For 3-uniform hypergraphs on k vertices with k−3 edges: ex_3(n, F) ≍ n · r_{k−3}(n), where r_{k−3}(n) is the maximum subset of {1,…,n} without non-trivial arithmetic progressions of length k−3. + +This variant is **not captured** in the formalization. It could be added as a separate conjecture, though it involves Szemerédi-type bounds and is more tangential. + +Problem 1157 is the generalization of 1178 to arbitrary t (1178 is the t=2 case). This relationship is noted in 1157's docstring but not in 1178's. A cross-reference to 1157 would be valuable. + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The docstring for `ContainsConfig` is somewhat convoluted. The sentence beginning "Since F_r(d,e) contains all r-uniform hypergraphs..." mixes the mathematical context with the formal definition in a way that could confuse readers. A simpler phrasing: "There exist d vertices spanning at least e edges from E." +- The `minD` definition is clean and idiomatic. +- The theorem docstring is detailed and informative, providing good mathematical context about known partial results. + +## 5. Formalizability + +**High formalizability. The problem is precise and unambiguous.** + +The problem statement on the website is fully precise: it defines d_r(e) as the minimal d such that ex_r(n; d, e) = o(n²), and conjectures d_r(e) = (r−2)e + 3. All objects (r-uniform hypergraphs, Turán numbers, little-o asymptotics) have standard definitions that translate directly to Lean. + +The only minor subtlety is in the use of `sSup` and `sInf` on ℕ: +- `turanNumber` uses `sSup` which for ℕ returns 0 on unbounded or empty sets. The set is nonempty (the empty hypergraph qualifies) and bounded above (by C(n,r)), so this is correct. +- `minD` uses `sInf` which for ℕ returns 0 on the empty set. For any fixed r, e, the set is nonempty for sufficiently large d, so this is well-behaved for the intended parameter range. However, if the set happened to be empty (which shouldn't occur for r, e ≥ 3), `minD` would return 0, which would make the conjecture trivially false. This is not a real concern given the hypotheses. + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +**The formalization is mathematically correct and faithfully captures the conjecture.** + +Detailed verification: + +- **`IsRUniform r E`**: Correctly requires every edge in E to have cardinality r. ✓ +- **`ContainsConfig d e n E`**: Correctly asserts existence of a d-element vertex subset spanning ≥ e edges. ✓ +- **`turanNumber r n d e`**: Correctly defined as the supremum of edge counts over all r-uniform hypergraphs on Fin n that avoid the (d, e)-configuration. ✓ +- **`minD r e`**: Correctly defined as the infimum of d values for which the Turán number is o(n²). Uses the Asymptotics `=o[atTop]` notation correctly. ✓ +- **The conjecture statement**: `minD r e = (r - 2) * e + 3` for `3 ≤ r` and `3 ≤ e`. Since r, e are ℕ with r ≥ 3, the subtraction `r - 2` is safe (no underflow). The formula matches the website exactly. ✓ + +**Consistency check**: For r = 3, e = 3: the formula gives (3−2)·3 + 3 = 6. This matches the known result d_3(3) = 6 (Ruzsa–Szemerédi). ✓ + +**Semantic equivalence with Problem 1157**: Problem 1157 states the Brown–Erdős–Sós conjecture as: f_r(n; k, s) = o(n^t) when k ≥ (r−t)s + t + 1. Setting t = 2: the threshold becomes k ≥ (r−2)s + 3, which matches the conjectured minimal d in 1178. The avoidance conditions in both files are semantically identical: `¬ContainsConfig d e n E` ↔ `IsFree H d e` (both require fewer than e edges in any d-vertex subset). ✓ + +**One technical note**: The formalization expresses the conjecture as an equality (`minD r e = ...`), which is stronger than just proving the upper bound. This is correct per the problem statement, which asks to "determine" d_r(e), and the lower bound (r−2)e+3 is already known from [BES73]. The conjecture is that the lower bound is tight. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Major duplication with 1157 and 716; should share definitions | +| Citations | [BES73] title may be wrong; [RuSz78] and [EFR86] missing | +| Variants | Related asymptotic variant not captured; no cross-ref to 1157 | +| Readability | Good overall; `ContainsConfig` docstring could be simpler | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/1179.md b/ai-review/1179.md new file mode 100644 index 0000000000..4a726a249b --- /dev/null +++ b/ai-review/1179.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 1179 + +## 1. Code Reuse + +**Partial reuse opportunities identified.** + +- **Problem 543** (`FormalConjectures/ErdosProblems/543.lean`) is closely related (the website explicitly cross-references it). Both problems deal with random subsets of abelian groups and subset-sum properties. Problem 543 defines `SubsetSumComplete`, `sscCountMod`, and `totalSubsetsMod` using the same `powersetCard` + `filter` + `card` pattern that `goodFraction` uses. However, the predicates are fundamentally different (completeness vs. approximate uniformity), so the definitions themselves cannot be shared—only the structural pattern. + +- **`subsetSums`** in `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` defines the *set* of all subset sums. This is conceptually related but operates on `Set M` rather than `Finset G` and does not count multiplicities, so it is not directly applicable. + +- **`rSubsetSums`** in Problem 874 and **`sumMultiset`** in Problem 494 use `powersetCard` combined with `.image (fun S => S.sum id)`, which is close to the pattern in `subsetSumCount` but computes an image rather than filtering and counting. + +- **`sumRep`/`sumConv`** in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean` provide convolution-based representation counts. These are conceptually adjacent (counting representations as sums) but the algebraic setup differs. + +**Verdict:** No existing definition can replace `subsetSumCount`, `IsApproxUniform`, `goodFraction`, or `gEps`. The definitions are appropriately self-contained. + +## 2. Citations + +The website lists the following references: +- **[Er73, p.127]** — Erdős, P., *Problems and results on combinatorial number theory*. A survey of combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., 1971) (1973), 117–138. +- **ErRe65** — Erdős and Rényi (1965). +- **ErHa76** — Erdős and Hall (1976). + +The formalization's docstring mentions "Erdős and Rényi" and "Erdős and Hall" inline but does not include full citation entries with years, titles, or publication details. Problem 543, by comparison, includes `[Er73]` and `[ErHa78b]` with fuller bibliographic details. + +**Recommendation:** Add explicit citation blocks for [Er73], [ErRe65], and [ErHa76] to the module docstring, matching the style used in Problem 543. + +## 3. Variants + +The website states this is an estimation problem: "Estimate $g_\varepsilon(N)$." The formalization captures only the specific conjecture that $g_\varepsilon(N) = (1 + o_\varepsilon(1)) \log_2 N$, which is the "in particular" part of the problem. + +The broader question—to estimate $g_\varepsilon(N)$ in general—is inherently open-ended and not easily formalizable as a single theorem statement. The formalization's choice to focus on the precise asymptotic conjecture is reasonable. + +The known bounds (trivial lower bound, Erdős–Rényi upper bound, Erdős–Hall improvement) are documented in the docstring but not formalized as separate statements. This is acceptable for a conjecture file, though formalizing the trivial lower bound could serve as a sanity check. + +The website also references **Problem 543** as related. A cross-reference comment in the docstring would be helpful. + +**Verdict:** The main conjecture variant is captured. The broader estimation question is not formalizable as a single statement. No missing formalizable variants. + +## 4. Readability + +The code is well-structured and readable: +- Each definition has a clear docstring explaining the mathematical meaning. +- The naming (`subsetSumCount`, `IsApproxUniform`, `goodFraction`, `gEps`) is descriptive. +- The `let` bindings in `IsApproxUniform` improve readability by naming `N` and `k`. + +Minor suggestions: +- `goodFraction` could benefit from a comment noting that the division is real-valued (via coercion from `ℕ` to `ℝ`), to make it immediately clear this is not truncating natural number division. +- The theorem docstring is thorough and self-contained. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem statement on the website says: "Estimate $g_\varepsilon(N)$; in particular, is it true that for all $\varepsilon > 0$, $g_\varepsilon(N) = (1 + o_\varepsilon(1)) \log_2 N$?" + +This "in particular" question is precise and formalizable—it asks whether a specific asymptotic relation holds. The formalization captures it as `Tendsto (fun N => gEps ε N / Real.logb 2 N) atTop (nhds 1)`, which is a clean and standard encoding. + +One subtlety: the original problem defines $g_\varepsilon(N)$ via "with probability $\to 1$ as $N \to \infty$." The formalization discretizes this as "fraction of good $k$-subsets $\geq 1 - 1/N$." This is a modeling choice: the original statement requires that for each fixed $k$, the probability tends to 1 as $N \to \infty$ over groups of size $N$. The formalization instead requires that, for each $N$, the probability is at least $1 - 1/N$. These are not identical—the original is a limit statement for fixed $k$, while the formalization is a uniform bound for each $N$. However, for defining the *threshold function* $g_\varepsilon(N)$, this discretization is standard and captures the same asymptotic behavior (any other threshold $1 - f(N)$ with $f(N) \to 0$ would yield the same asymptotics for $g_\varepsilon(N)$, assuming the conjecture holds). + +**Verdict:** High formalizability. The discretization choice is reasonable and standard. Ambiguity is minimal. + +## 6. Correctness + +### Positive aspects: +- `subsetSumCount` correctly counts subsets $S \subseteq A$ (including $\emptyset$) with $\sum_{x \in S} x = g$, matching $F_A(g)$. +- `IsApproxUniform` correctly encodes $|F_A(g) - 2^k/N| \leq \varepsilon \cdot 2^k/N$ for all $g$. +- The universial quantification in `gEps` over all abelian groups of order $N$ (via `∀ (G : Type) [AddCommGroup G] [Fintype G] ...`) is correct. +- The final theorem statement correctly encodes $g_\varepsilon(N) / \log_2 N \to 1$. + +### Issues: + +1. **Problem status mismatch (CRITICAL):** The website marks this problem as **PROVED** (solved in the affirmative). The formalization tags it as `category research open`. The tag should be updated to `category research solved` and the `answer(sorry)` should reflect the known answer. Since the problem was proved in the affirmative (the asymptotic $g_\varepsilon(N) = (1+o_\varepsilon(1)) \log_2 N$ holds), the answer should be `answer(True)`. + +2. **`gEps` edge cases with `sInf`:** The definition uses `sInf` on `ℕ`, which returns `0` when the set is empty. For small $N$ (e.g., $N = 0$ or $N = 1$), the defining set might be empty or trivially satisfied, making `gEps ε N` equal to `0`. This is harmless for the asymptotic statement (which uses `atTop`), but it means `gEps` is not a faithful representation of $g_\varepsilon(N)$ for small $N$. This is a minor concern since the conjecture is purely asymptotic. + +3. **Universe quantification in `gEps`:** The definition quantifies over `∀ (G : Type)`, which is `Type 0`. All finite abelian groups are realizable in `Type 0`, so this is mathematically correct. However, the quantification is over *all types* with the given structure, not just groups "up to isomorphism." This is fine because the property depends only on the group structure, not the carrier type. + +4. **`goodFraction` division semantics:** The expression `good.card / all.card` has both operands as `ℕ` but the return type is `ℝ`. Lean 4's elaborator should coerce both to `ℝ` before dividing (real division), which is correct. When `all.card = 0` (e.g., $k > N$), this yields `0 / 0 = 0` in `ℝ`, which is Lean's convention. This edge case is benign for the asymptotic statement. + +5. **Notation for $o_\varepsilon(1)$:** The original problem uses $o_\varepsilon(1)$, meaning the implicit constant in the $o(\cdot)$ may depend on $\varepsilon$. The formalization correctly handles this by having $\varepsilon$ as a free parameter outside the `Tendsto`, so the rate of convergence is allowed to depend on $\varepsilon$. + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse needed; definitions are self-contained | +| Citations | Missing full bibliographic entries for [Er73], [ErRe65], [ErHa76] | +| Variants | Main conjecture captured; broader estimation question is not formalizable | +| Readability | Good | +| Formalizability | High; discretization choice is standard | +| Correctness | Mathematically correct, but **status tag is wrong** (`open` → `solved`, `answer(sorry)` → `answer(True)`) | diff --git a/ai-review/118.md b/ai-review/118.md new file mode 100644 index 0000000000..50ebb671ac --- /dev/null +++ b/ai-review/118.md @@ -0,0 +1,74 @@ +# Review: Erdős Problem 118 + +## 1. Code Reuse + +There is significant duplication across the codebase for ordinal partition relations. Problem 118 defines its own `OrdinalSet` and `OrdPartition` locally, but several other files define essentially equivalent constructs: + +- **`ErdosProblems/597.lean`** defines an identical `OrdinalSet` abbrev and a closely related `OrdGraphPartition` using the same `↪o` approach for the ordinal side. +- **`ErdosProblems/1169.lean`** defines `OrdinalPartitionPair` — mathematically equivalent to `OrdPartition` but using `StrictMono` functions instead of `↪o` and `Bool` instead of `Fin 2`. +- **`FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean`** defines `OrdinalCardinalRamsey` — a graph-theoretic formulation of the same partition relation, used by problems 590, 591, and 592. + +**Recommendation:** The `OrdPartition` definition from 118.lean and the `OrdinalPartitionPair` from 1169.lean serve the same mathematical purpose (the arrow relation α → (β, γ)²). These should ideally be unified into a single shared definition in `FormalConjecturesForMathlib`. Problem 591 is directly related (it proves ω^{ω²} → (ω^{ω²}, 3)², which is the partition ordinal property referenced in 118's counterexample), and uses `OrdinalCardinalRamsey` — a yet-different formulation. A unified definition would make the logical connection between 118 and 591 explicit in the code. + +Similarly, `OrdinalSet` is defined identically in both 118.lean and 597.lean and should be factored out. + +## 2. Citations + +The formalization includes the following references: [Er87], [Er90], [Er95d], [Er97f], [Sc99], [Sc10], [Da99], [La00], [HST10]. + +**Comparison with erdosproblems.com/118:** The website references [Er87], [Er90], [Er95d], [Er97f], [Sc99]/[Sc10], [Da99], [La00], and [HST10], and also cross-references problems #590, #591, and #592. The formalization's citations match the website well. The full bibliographic details in the docstring (journal names, volume/issue numbers, page ranges, years) are present and appear accurate. + +**Minor note:** The website mentions related problems 590, 591, and 592 as cross-references. The docstring does not mention these cross-references, but the connection to 591 (which proves ω^{ω²} is a partition ordinal) is discussed in the body text via the Larson reference. Adding explicit cross-references (e.g., "See also Erdős problems 590, 591, 592") would improve navigability. + +## 3. Variants + +The website formulation asks: if α → (α, 3)², must α → (α, n)² for all n ≥ 3? The formalization captures exactly this statement. + +**Missing variants / related aspects:** +- The website mentions that the specific counterexample involves ω^{ω²} with n = 5. The docstring mentions this, but the formalization does not include a separate statement encoding ¬OrdPartition (ω^{ω²}) (ω^{ω²}) 5 as an explicit theorem. This could be a valuable additional formalization, as it is the concrete disproof. +- Problems 590, 591, 592 on the website are closely related (they ask which specific ordinals are partition ordinals). These are formalized separately, which is appropriate, but a cross-reference in the docstring would be helpful. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The docstring on `OrdPartition` clearly explains the arrow notation and what an "order-embedded copy" means. +- The docstring on the main theorem gives good mathematical context, states the conjecture, its status (DISPROVED), and cites the counterexample. +- The `OrdinalSet` abbrev with its docstring is clean and helpful. + +**Minor issue:** In the `OrdPartition` docstring (line 62), the description says "the linearly ordered set {0, 1, …, α}" — this should be {0, 1, …} of order type α (or equivalently, the set of ordinals below α). Writing "{0, 1, …, α}" suggests a finite set and incorrectly includes α itself as an element. A more precise phrasing would be "the set of ordinals less than α." + +## 5. Formalizability + +The problem is precise and unambiguously formalizable. The arrow notation α → (α, n)² has a standard set-theoretic definition in terms of 2-colorings of pairs and order-type embeddings. There is no ambiguity in the statement. + +**Assessment:** The problem is fully formalizable with no ambiguity. The only potential subtlety is the domain of the coloring function f — in the formalization, f takes two arguments from OrdinalSet α without requiring that the first is less than the second. This is fine because the homogeneity condition only quantifies over ordered pairs (i < j), so the values of f on unordered pairs are irrelevant. An alternative design could restrict f to ordered pairs, but the current approach is standard and correct. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **The main statement** (`erdos_118`): `answer(False) ↔ ∀ (α : Ordinal), OrdPartition α α 3 → ∀ n : ℕ, 3 ≤ n → OrdPartition α α (↑n)` correctly encodes "the conjecture is false." The conjecture asserts that every partition ordinal (α → (α,3)²) satisfies α → (α,n)² for all n ≥ 3. Since this was disproved, `answer(False)` is correct. + +- **The `OrdPartition` definition**: Uses order embeddings `↪o` to represent monochromatic subsets, which is the standard formalization. An order embedding from OrdinalSet β into OrdinalSet α correctly captures "a subset of order type β." + +- **The coloring function** `f : OrdinalSet α → OrdinalSet α → Fin 2` is a 2-coloring of all pairs (including equal and reversed pairs). The homogeneity condition only evaluates f on ordered pairs (i < j), so this is correct — values on the diagonal or reversed pairs are unconstrained but irrelevant. + +- **The coercion `↑n`**: The natural number n is coerced to an ordinal via `↑n`, which gives the finite ordinal n. This is correct — a monochromatic set of order type n (a finite ordinal) is exactly a monochromatic set of n elements, which for n = 3 is a monochromatic triangle K₃. + +- **Universe polymorphism**: The definition works in the default universe, which is appropriate for countable ordinals. The counterexample involves ω^{ω²}, which is a countable ordinal, so no universe issues arise. + +**No mathematical flaws identified.** The formalization is clean, correct, and complete for the stated problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `OrdPartition` and `OrdinalSet` are duplicated across multiple files (118, 597, 1169, 1172). Should be unified in ForMathlib. | +| Citations | Match the website. Could add cross-references to problems 590, 591, 592. | +| Variants | Main conjecture captured. Could add explicit counterexample ¬OrdPartition (ω^{ω²}) (ω^{ω²}) 5. | +| Readability | Good. Minor inaccuracy in docstring ("{0, 1, …, α}" should describe ordinals below α). | +| Formalizability | Fully formalizable, no ambiguity. | +| Correctness | Mathematically correct and complete. No flaws. | diff --git a/ai-review/121.md b/ai-review/121.md new file mode 100644 index 0000000000..f2e0bd25f2 --- /dev/null +++ b/ai-review/121.md @@ -0,0 +1,94 @@ +# Review: Erdos Problem 121 + +## 1. Code Reuse + +**No significant reuse opportunities identified.** The definitions `NoKSquareProduct` and `F` are appropriately problem-specific. While several other Erdos problems use similar patterns (sSup-based extremal functions in Problems 385, 500, 696; `IsSquare` with products in Problem 841; `Tendsto` ratio patterns in Problems 500, 696), these are structural similarities rather than candidates for shared abstractions — each problem's extremal function is inherently problem-specific. + +The density API in `FormalConjecturesForMathlib/Data/Set/Density.lean` (`HasDensity`, `upperDensity`, `lowerDensity`) is not directly applicable here: Problem 121 concerns the extremal function F_k(N) (the *maximum* cardinality of a subset with a property), not the density of a *particular* set. The current approach using `Tendsto` directly on `F(k,N)/N` is the correct formulation. + +## 2. Citations + +**Discrepancies found between the formalization and the website.** + +The formalization includes: +- [Er94b], [Er97], [Er97e], [Er98] — present on website +- [ESS95] — present on website +- [Ta24] — present on website +- **[Er38]** — *not listed on the website page*. The docstring references "Erdős, P., on sequences of integers no one of which divides the product of two others and on some related problems (1938)." This appears to be background context rather than a direct citation for Problem 121. Consider removing or marking it as supplementary. + +**Missing from the formalization:** +- **[GrSo01]** — Granville, A. and Soundararajan, K. (2001). The website mentions their result that for the related function (products of an odd number of elements), the density is `(1 - c + o(1))N` where `c ≈ 0.1715`. This is relevant context, especially if a variant formalizing this result were added. + +## 3. Variants + +**Several notable results from the website are not captured:** + +The formalization includes: +- The main Erdos-Sos-Sarkozy conjecture (disproved) — `erdos_121` +- Tao's upper bound for k >= 4 — `erdos_121.variants.tao_upper_bound` + +Missing variants mentioned on the website: +1. **F_2(N) = (6/pi^2 + o(1))N** — A classical result (Erdos-Sos-Sarkozy). This is a clean, well-known asymptotic that would make a natural variant. +2. **F_3(N) = (1 - o(1))N** — Established by Erdos-Sos-Sarkozy. This confirms the conjecture holds for k=1 (i.e., 2k+1=3). +3. **F_k(N) ~ N/log N for even k >= 4** — Behavior for even k, attributed to Erdos (1938). +4. **Granville-Soundararajan result** — The specific constant `c ≈ 0.1715...` for products of odd numbers of elements. + +Adding at least the F_2 and F_3 results would give a more complete picture and establish the boundary between where the conjecture-like behavior holds and where it breaks down. + +## 4. Readability + +**Good overall.** The code is clean and well-structured. + +Minor suggestions: +- The docstring for `F` could note that elements are positive integers (i.e., from `{1, ..., N}` encoded as `Finset.Icc 1 N`), since the positivity constraint matters — it prevents the trivial inclusion of 0, whose presence would make any product 0 (not a square of a positive integer in the relevant sense, though `IsSquare 0` is true in Lean since `0 = 0 * 0`). +- The module docstring is thorough and provides good mathematical context. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** There is minimal ambiguity: + +- "Largest subset of {1,...,N}" is unambiguous and maps directly to `sSup` over cardinalities of finsets contained in `Finset.Icc 1 N`. +- "Product of k distinct elements is a perfect square" is unambiguous and maps to the `NoKSquareProduct` predicate using `Finset.prod` and `IsSquare`. +- The asymptotic statement `F_{2k+1}(N) = (1-o(1))N` is standard and maps cleanly to `Tendsto (F(2k+1,N)/N) atTop (nhds 1)`. + +**One minor subtlety:** The notion of "distinct elements" in the original problem means distinct elements of the set A (not just distinct values). Since A is a `Finset` (which has no duplicates by definition), any sub-finset B of A with `B.card = k` automatically consists of k distinct elements. This is handled correctly. + +**Assessment: No ambiguity. Fully formalizable as stated.** + +## 6. Correctness + +**The formalization is mathematically correct, with one subtlety worth noting.** + +### Main theorem (`erdos_121`): +The statement `answer(False) ↔ (∀ k, 2 ≤ k → Tendsto (F(2k+1,·)/·) atTop (nhds 1))` asserts that the RHS is false (equivalent to `False`), i.e., `¬(∀ k ≥ 2, F_{2k+1}(N)/N → 1)`. This correctly encodes that the Erdos-Sos-Sarkozy conjecture is false, as Tao demonstrated. + +### Tao's upper bound (`erdos_121.variants.tao_upper_bound`): +The statement: for all k >= 4, there exists c > 0 such that for all epsilon > 0, eventually F_k(N) <= (1 - c + epsilon) * N. + +This correctly captures Tao's result that F_k(N) <= (1 - c_k + o(1))N. The quantifier structure is right: the "for all epsilon, eventually" pattern is the standard way to encode an o(1) error term in a one-sided inequality (it means limsup F_k(N)/N <= 1 - c). + +### Well-definedness of `F`: +The definition uses `sSup` on `{m : N | exists A ⊆ Icc 1 N, A.card = m ∧ NoKSquareProduct k A}`. This set is: +- **Nonempty**: The empty finset has card 0 and satisfies `NoKSquareProduct k ∅` vacuously (for k >= 1). +- **Bounded above**: Any A ⊆ Icc 1 N has card <= N. + +So `sSup` returns the correct maximum on `ℕ` (which has `ConditionallyCompleteLinearOrderBot`). The definition is well-behaved. + +### Edge case — k = 0 or k = 1: +`NoKSquareProduct 0 A` requires that no 0-element subset has a square product. But the empty product is 1, which is a perfect square (`1 = 1 * 1`). So `NoKSquareProduct 0 A` would require `¬IsSquare 1`, which is false — meaning `NoKSquareProduct 0 A` is `False` for any nonempty set. This doesn't affect the main theorem (which uses k >= 2, i.e., 2k+1 >= 5) or the variant (k >= 4), but is a curiosity of the definition. For k = 1, `NoKSquareProduct 1 A` requires no singleton has a square product, i.e., no element of A is a perfect square. This is mathematically sensible. + +### Logical relationship between the two theorems: +Tao's variant (for all k >= 4, F_k(N) <= (1-c_k)N) immediately implies the main theorem is false, since for odd k = 2j+1 >= 5 (i.e., j >= 2, k >= 5 >= 4), F_{2j+1}(N)/N cannot tend to 1. The two statements are consistent and the variant serves as the mechanism of disproof. + +**Assessment: Correct and complete for the scope of what it formalizes. No mathematical flaws detected.** + +## Summary + +| Category | Rating | +|---|---| +| Code reuse | No issues — appropriately self-contained | +| Citations | Minor issues — [Er38] not on website; [GrSo01] missing | +| Variants | Incomplete — F_2, F_3, even-k asymptotics not captured | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/122.md b/ai-review/122.md new file mode 100644 index 0000000000..f4f75a0c48 --- /dev/null +++ b/ai-review/122.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 122 + +## 1. Code Reuse + +**`HasNaturalDensityZero` should use the shared density library.** +The local definition `HasNaturalDensityZero` (line 53) is essentially equivalent to `Set.HasDensity S 0` from `FormalConjecturesForMathlib/Data/Set/Density.lean`. Specifically: + +- `HasNaturalDensityZero A` computes `((Finset.range N).filter (· ∈ A)).card / N` and asks for convergence to 0. +- `Set.HasDensity A 0` computes `(Set.interIio A b).ncard / (Set.interIio Set.univ b).ncard` and asks for convergence to 0. + +For `β = ℕ`, `Set.interIio Set.univ b` has `ncard = b` (via `Nat.ncard_Iio`), and `(Set.interIio A b).ncard` counts `#{x ∈ A : x < b}`, which is the same quantity as `((Finset.range b).filter (· ∈ A)).card`. These are equivalent up to the `Finset.card`/`Set.ncard` coercion. The shared library should be preferred, as at least 8+ other Erdős problem files have the same redundant local definition (16, 31, 335, 378, 673, 928, 955, etc.). + +**`AlmostAllRatioVanishes` could be expressed via `Set.HasDensity`** as: +``` +∀ ε > 0, Set.HasDensity {n : ℕ | ε ≤ (f n : ℝ) / F n} 0 +``` + +**`Nat.primeFactorsList` can be simplified.** The expression `(Nat.primeFactorsList n).toFinset.card` is equivalent to `n.primeFactors.card` in modern Mathlib. The latter is more idiomatic and readable. + +**No existing shared utility for `shiftCount`.** Problem 237 defines a similar `countRepresentations` but with different semantics. The `shiftCount` definition is problem-specific and does not have a reusable counterpart. + +## 2. Citations + +The formalization references three citations: `[Er97]`, `[Er97e]`, and `[EPS97]`. Comparing against [erdosproblems.com/122](https://www.erdosproblems.com/122): + +- **[Er97]** — Erdős, P., *Some of my new and almost new problems and results in combinatorial number theory* (1997). **Matches** the website's `[Er97]`. +- **[Er97e]** — Erdős, P., *Some problems and results on combinatorial number theory* (1997). **Matches** the website's `[Er97e]`. +- **[EPS97]** — Erdős, P., Pomerance, C., and Sárközy, A., *On locally repeated values of certain arithmetic functions, III* (1997). **Matches** the website's `[EPS97]`. + +All citations are correctly documented and match the website. No missing references. + +## 3. Variants + +The formalization captures the **proved instances** (τ and ω) but does not formalize the **conjectured negative instances**. The docstring (lines 83–85) mentions that Erdős believed the property to be FALSE for: + +- `f(n) = φ(n)` (Euler's totient function) +- `f(n) = σ(n)` (sum of divisors) + +These could be formalized as separate conjectures, e.g.: +```lean +@[category research open, AMS 11] +conjecture erdos_122_totient : ¬ HasErdos122Property Nat.totient := by sorry + +@[category research open, AMS 11] +conjecture erdos_122_sigma : ¬ HasErdos122Property (fun n => (Nat.divisors n).sum id) := by sorry +``` + +The **overarching question** — "for which f does this hold?" — is inherently a classification problem and cannot be stated as a single theorem. The formalization's approach of recording proved instances is a reasonable way to handle this. However, adding the conjectured negative instances would give a more complete picture. + +The website also notes the problem's status is **OPEN** (the full characterization remains open), which is consistent with the docstring but slightly at odds with the `@[category research solved]` tag (see §6). + +## 4. Readability + +The code is **well-structured and readable**. Specific observations: + +- **Good**: Definitions are broken into well-named components (`shiftCount`, `HasNaturalDensityZero`, `AlmostAllRatioVanishes`, `HasErdos122Property`) with clear docstrings. +- **Good**: The docstring for the main theorem clearly explains the mathematical context, known results, and open status. +- **Minor improvement**: `(Nat.primeFactorsList n).toFinset.card` → `n.primeFactors.card` would be more concise. +- **Minor improvement**: The `shiftCount` docstring says "it suffices to search n in the range [0, x + ⌈F(x)⌉]" which is correct but the code uses `Finset.range (x + ⌈F x⌉₊ + 1)`, i.e., [0, x + ⌈F(x)⌉₊]. The `+ 1` is because `Finset.range` is exclusive. This is correct but could be noted more explicitly. + +## 5. Formalizability + +**Assessment: Moderate ambiguity in the original, but the proved instances are precise.** + +The original problem is a **meta-question** ("for which f...?") which is inherently not directly formalizable as a single statement. The formalization handles this well by: + +1. Defining a predicate `HasErdos122Property` that captures the property precisely. +2. Stating the proved instances as a theorem. + +Points of ambiguity in the original: + +- **"f(n)/F(n) → 0 for almost all n"**: The phrase "almost all" in number theory typically means "density-1 set" (i.e., the exceptional set has density 0). The formalization correctly interprets this via `AlmostAllRatioVanishes`, which requires the set where `f(n)/F(n) ≥ ε` to have natural density zero for each ε > 0. +- **Domain of x**: The original problem doesn't specify whether x ranges over ℝ or ℕ. The formalization uses x : ℕ. Since n + f(n) is always a natural number, the set of "interesting" x values where the count changes is discrete, but restricting x to ℕ could theoretically miss some values. In practice, for intervals of width F(x) → ∞, this distinction is negligible and the formalization is reasonable. +- **"→ ∞"**: The original phrasing "#{...}/F(x) → ∞" is interpreted as the limsup being +∞ (equivalently, for every C there are infinitely many x exceeding C). This is the standard interpretation and is correctly captured by `∃ᶠ x : ℕ in atTop, C < ...`. + +Overall, the formalization makes reasonable and standard choices for all ambiguous points. + +## 6. Correctness + +**Mathematical correctness: Sound, with one metadata concern.** + +### Verified correct: +- **`shiftCount`**: Correctly counts n with n + f(n) in the open interval (x, x + F(x)). The search range `Finset.range (x + ⌈F x⌉₊ + 1)` is a valid upper bound because n + f(n) < x + F(x) and f(n) ≥ 0 imply n < x + F(x), so n ≤ x + ⌈F(x)⌉₊ - 1, which is covered by `Finset.range (x + ⌈F x⌉₊ + 1)`. +- **`HasNaturalDensityZero`**: Standard formulation of density-zero sets. +- **`AlmostAllRatioVanishes`**: Correctly captures "f(n)/F(n) → 0 in natural density." +- **`HasErdos122Property`**: The universal quantification over F, positivity of F, the density condition, and the frequently-unbounded conclusion all correctly encode the problem. +- **Theorem statement**: `(Nat.divisors n).card` = τ(n) and `(Nat.primeFactorsList n).toFinset.card` = ω(n). Both are correct representations of the divisor count and distinct prime factor count respectively. +- **Known results**: Erdős, Pomerance, and Sárközy (1997) did prove this for τ and ω. The theorem is a correct statement of known mathematics. + +### Metadata concern: +- **`@[category research solved]`**: This tag suggests the problem is solved. While the specific instances (τ, ω) stated in the theorem are indeed proved, the overall Erdős Problem 122 — the classification question — is **OPEN** per the website. The tag could be misleading. A more precise approach would be to tag the theorem as `solved` (since the stated result is proved) but add a separate `open` conjecture for the full characterization or the conjectured negative instances. + +### Edge case: +- **F(n) = 0 or negative**: The definition requires `∀ n, 0 < F n`, which correctly rules out degenerate cases. +- **n = 0**: For n = 0, `Nat.divisors 0 = ∅` so `(Nat.divisors 0).card = 0`, and `Nat.primeFactorsList 0 = []` so its card is 0. These edge cases don't affect the asymptotic statement but are handled consistently. + +### Summary +The formalization is **mathematically correct** for what it states. The main gaps are: +1. Not formalizing the conjectured negative instances (φ, σ) which are part of the problem's landscape. +2. The `solved` tag is accurate for the theorem as stated but doesn't reflect that the overarching problem remains open. diff --git a/ai-review/127.md b/ai-review/127.md new file mode 100644 index 0000000000..182f0f8807 --- /dev/null +++ b/ai-review/127.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 127 + +## 1. Code Reuse + +**No significant reuse opportunities.** The definitions in `127.lean` (`cutSize`, `maxBipartiteSubgraphSize`, `edwardsLB`, `f`) are problem-specific and well-scoped. + +Considered candidates: +- `FormalConjecturesForMathlib/.../Definitions.lean` defines `largestInducedBipartiteSubgraphSize`, but that counts *vertices* of the largest *induced* bipartite subgraph — a fundamentally different quantity from the max-cut (which counts *edges* of the largest bipartite subgraph, not necessarily induced). +- Erdős Problem 74 (`74.lean`) defines `edgeDistancesToBipartite` and related concepts, but these measure the *minimum number of edge deletions* to make a subgraph bipartite — again a different quantity. +- Mathlib provides `SimpleGraph.IsBipartite`, `SimpleGraph.IsBipartiteWith`, and `SimpleGraph.between` but none of these directly compute the max-cut edge count. + +The custom definitions are appropriate and necessary. + +## 2. Citations + +The citations are **mostly accurate** but have minor issues: + +**Website lists:** +- Problem attributed to: Erdős, Kohayakawa, and Gyárfás (no specific joint publication cited on the website) +- Edwards [Ed73] for the lower bound f(m) ≥ 0 +- Alon [Al96] for solving the problem + +**Formalization docstring states:** +- `[Ed73] Edwards, C.S., Some extremal properties of bipartite subgraphs, Canadian Journal of Mathematics (1973).` — Matches the website. +- `[Al96] Alon, N., Bipartite subgraphs, Combinatorica 16 (1996), 301–311.` — Matches the website. + +**Issue:** The module docstring says "Proved by Alon" — this is correct. The theorem docstring says "Erdős–Kohayakawa–Gyárfás" for the attribution of the conjecture, which matches the website. Note: the website spells it "Kohayakawa" and the formalization also spells it "Kohayakawa" — consistent. + +No citation issues found. + +## 3. Variants + +**Missing variants.** The website and Alon's paper establish quantitative bounds that are not captured: + +1. **Alon's lower bound (solved direction):** f(n²/2) ≫ n^{1/2}. The docstring mentions this but it is not formalized as a separate theorem. +2. **Alon's upper bound:** f(m) ≪ m^{1/4} for all m. Again mentioned in the docstring but not formalized. +3. **Open problem on the optimal constant:** The website notes "the optimal constant in f(m) ≤ Cm^{1/4} remains unknown." This is not mentioned. + +These would be natural variants to add: + +```lean +/-- Alon's lower bound: f(n²/2) ≫ n^{1/2}. -/ +theorem erdos_127.variants.alon_lower_bound : + ∃ c > 0, ∀ᶠ n in atTop, f (n^2 / 2) ≥ c * (n : ℝ).sqrt := by sorry + +/-- Alon's upper bound: f(m) ≪ m^{1/4} for all m. -/ +theorem erdos_127.variants.alon_upper_bound : + ∃ C > 0, ∀ m, f m ≤ C * (m : ℝ) ^ (1/4 : ℝ) := by sorry +``` + +## 4. Readability + +The code is **well-written and readable**. Specific strengths: +- Each definition has a clear docstring explaining the mathematical meaning. +- The `cutSize` docstring carefully explains why each undirected edge is counted exactly once. +- The `f` docstring provides two equivalent characterizations (maximal uniform lower bound vs. infimum of excess). +- The theorem docstring summarizes the problem and known results concisely. + +One minor suggestion: the `open Real Filter` at line 33 could be `open scoped Real` plus `open Filter` for clarity, but this is stylistic and not important. + +## 5. Formalizability + +**High formalizability; low ambiguity.** The problem statement is precise: + +- "Graph with m edges" — clear. +- "Bipartite subgraph" — well-defined; the formalization correctly captures this as the max-cut. +- The Edwards bound m/2 + (√(8m+1) − 1)/8 is an explicit closed-form expression. +- "Is there an infinite sequence m_i such that f(m_i) → ∞?" — precise and directly formalizable. + +The only potential ambiguity is whether "bipartite subgraph" means a subgraph that is bipartite (allowing arbitrary edge deletion) vs. an *induced* bipartite subgraph (only vertex deletion). The standard meaning in this context is the former (max-cut), and the formalization correctly uses the max-cut interpretation. The Edwards bound is known to apply to the max-cut formulation. + +**Assessment: No meaningful ambiguity. The problem is obviously formalizable.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### `cutSize` (lines 44–47) +Counts ordered pairs (v, w) with v ∈ S, w ∉ S, and G.Adj v w. For each undirected edge {a,b} crossing the cut (a ∈ S, b ∉ S): only (a,b) is counted (since b ∉ S means (b,a) fails the first condition). Correct. + +### `maxBipartiteSubgraphSize` (lines 54–56) +Takes `Finset.univ.sup (cutSize G)`, i.e., the maximum of cutSize over all vertex subsets S. This correctly computes the max-cut, which equals the maximum number of edges in any bipartite subgraph. The equivalence holds because any bipartite subgraph's edges are a subset of the cut edges for its bipartition, and the max-cut includes *all* cut edges for the optimal partition. Correct. + +### `edwardsLB` (lines 62–63) +Implements m/2 + (√(8m+1) − 1)/8 as a real number. Straightforward and correct. + +### `f` (lines 74–77) +Defined as sInf over all graphs G with m edges of (maxBipartiteSubgraphSize(G) − edwardsLB(m)). This correctly captures "the largest r such that every graph with m edges has max-cut ≥ edwardsLB(m) + r." + +**Potential concern with `sInf`:** The set is nonempty (graphs with m edges exist for all m ≥ 0) and bounded below by 0 (by Edwards' theorem), so `sInf` is well-defined and returns the correct value. However, the formalization does not prove these properties, which would be needed for any proof involving `f`. This is acceptable for a conjecture statement file. + +**Universe note:** The definition of `f` quantifies over `V : Type` (universe 0). This is sufficient for all finite graphs, since any finite graph can be realized on a type in Type 0 (e.g., `Fin n`). No issue. + +### `erdos_127` (lines 91–94) +States: answer(True) ↔ ∃ strictly monotone seq : ℕ → ℕ such that f(seq(i)) → +∞. + +- **Answer True:** Correct — Alon proved the answer is yes. +- **StrictMono:** A standard and appropriate way to formalize "infinite sequence of distinct values." Any sequence with f(m_i) → ∞ can be refined to a strictly increasing subsequence. +- **Tendsto ... atTop atTop:** Correctly captures f(m_i) → +∞. + +**Verdict: The formalization is correct and complete for the main problem statement. No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No reuse opportunities; custom definitions appropriate | +| Citations | Accurate and complete | +| Variants | Missing Alon's quantitative bounds (lower and upper) | +| Readability | Excellent | +| Formalizability | High; no meaningful ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/129.md b/ai-review/129.md new file mode 100644 index 0000000000..2e3c63bb19 --- /dev/null +++ b/ai-review/129.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 129 + +## 1. Code Reuse + +**Duplicate `EdgeColoring` definition.** Problem 136 (`FormalConjectures/ErdosProblems/136.lean:45`) defines an identical type: + +```lean +def EdgeColoring (n k : ℕ) : Type := Fin n → Fin n → Fin k +``` + +These two definitions are in separate namespaces (`Erdos129` vs `Erdos136`) and are not shared. A shared definition in a utility file (or in `FormalConjecturesForMathlib`) would reduce duplication. + +**Related infrastructure exists but is not directly applicable:** + +- `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean:33–36` defines `hypergraphRamsey` for 2-colorings of r-uniform hypergraphs. This is structurally similar to `multicolorRamseyNum` but restricted to 2 colors and formulated via hypergraph subsets rather than edge colorings, so it cannot directly replace the Problem 129 definitions. +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides graph coloring utilities built on `SimpleGraph`, which uses a different abstraction. +- Problems 555–558 define `multicolorRamseyNumber` using `SimpleGraph`, a different representation. + +**Recommendation:** Extract `EdgeColoring` into a shared file to be used by both Problem 129 and Problem 136 (and potentially other Erdős–Gyárfás problems). The remaining definitions (`IsMonoKkFree`, `multicolorRamseyNum`) are specific enough to remain local. + +## 2. Citations + +The formalization cites: + +> [Er97b] Erdős, P. and Gyárfás, A., *A variant of the classical Ramsey problem*, Combinatorica **17** (1997), 459–467. + +The website (erdosproblems.com/129) references the same paper as `[Er97b]`. The formalization includes full journal details (Combinatorica, volume 17, year 1997, pages 459–467), which is more complete than the website's shorthand. This is good. + +The website also credits **Antonio Girao** for identifying the counterexample. The formalization correctly attributes this observation in both the module docstring and the theorem docstring. + +**No citation issues found.** + +## 3. Variants + +**Missing variant.** The website describes a generalization that Erdős conjectured: + +> For all r, k ≥ 2, there exist constants C₁, C₂ > 1 (depending only on r) such that C₁^(n^(1/(k−1))) < R(n; k, r) < C₂^(n^(1/(k−1))). + +This generalized conjecture is **not captured** in the formalization, which only addresses k = 3. Since the `multicolorRamseyNum` definition already supports arbitrary k, adding this variant would be straightforward: + +```lean +theorem erdos_129.variants.general_bounds : + ∀ r : ℕ, 2 ≤ r → ∀ k : ℕ, 2 ≤ k → + ∃ C₁ C₂ : ℝ, 1 < C₁ ∧ 1 < C₂ ∧ + ∀ n : ℕ, C₁ ^ (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 1)) + < (multicolorRamseyNum n k r : ℝ) + ∧ (multicolorRamseyNum n k r : ℝ) + < C₂ ^ (n : ℝ) ^ ((1 : ℝ) / ((k : ℝ) - 1)) := by sorry +``` + +Note: the status of this generalized conjecture is itself unclear given the issues with the k = 3 case. Whether this variant is worth adding depends on whether the general conjecture is also considered disproved or whether it may have a correct reformulation. + +**The lower bound proved by Erdős–Gyárfás is also not formalized.** The website states they proved "the existence of some C > 1 such that R(n; 3, r) > C^(√n)." This confirmed lower bound could be a useful variant to include. + +## 4. Readability + +The code is generally well-structured and readable. A few observations: + +- **Good**: Clear docstrings on all definitions and the theorem, with LaTeX rendering. +- **Good**: The module docstring explains the problem, the counterexample, and the citation. +- **Minor**: The `EdgeColoring` definition allows coloring of self-loops (χ x x), which is semantically meaningless for K_N. A comment noting this is intentionally ignored would aid clarity, though it has no effect on correctness since `IsMonoKkFree` only examines pairs with x ≠ y. +- **Minor**: The docstring for `erdos_129` could more explicitly state that `answer(False)` means the conjecture is **disproved**, not merely false-as-stated. The current phrasing is adequate but could be clearer for a reader unfamiliar with the `answer` convention. + +## 5. Formalizability + +**Assessment: The problem as literally stated is formalizable, and the formalization correctly captures the disproved version.** + +The original conjecture is a precise quantitative claim (∃ C > 1, R(n;3,r) < C^√n for all n), which is unambiguous and directly formalizable. + +However, the **intended** problem (what Erdős actually meant to conjecture) is unclear. The website states: "The correct formulation is unclear." The formalization handles this gracefully by formalizing the literal statement and marking it as false via `answer(False)`. + +**Ambiguity level: Low** for the literal statement; **High** for the intended problem. + +## 6. Correctness + +### 6.1 Directed vs. Undirected Edges + +**The `EdgeColoring` definition colors ordered pairs (directed edges) rather than unordered edges.** The standard Ramsey-theoretic setting concerns undirected complete graphs, where χ({x, y}) is well-defined regardless of ordering. The formalization does not enforce χ x y = χ y x. + +Consequently, `multicolorRamseyNum` as defined quantifies over ALL functions Fin N → Fin N → Fin r, including non-symmetric ones. This means R_ordered ≥ R_undirected (more adversarial colorings require at least as large an N). + +**Impact on the theorem's truth value:** The theorem asserts `answer(False)`, i.e., the conjecture is false. The standard counterexample (probabilistic argument by Girao) shows R_undirected(n; 3, 2) ≥ Cⁿ for some C > 1, using a symmetric random coloring. Since R_ordered ≥ R_undirected, this lower bound transfers: R_ordered(n; 3, 2) ≥ Cⁿ as well, contradicting C^√n. **So the truth value `False` is preserved**, and the theorem is correct despite the ordered-pair formulation. + +However, the definition does not match the standard mathematical concept. If these definitions were used in a more nuanced theorem (e.g., establishing exact asymptotics), the directed/undirected distinction could matter. **Recommendation:** Add a symmetry constraint to `EdgeColoring` or define it on `Sym2 (Fin N)` (unordered pairs) for mathematical precision. + +### 6.2 `IsMonoKkFree` Definition + +The definition states: for every k-subset T ⊆ S, there exist distinct x, y ∈ T with χ x y ≠ c. This correctly captures "T does not contain a monochromatic K_k in color c." The existential quantifier (one non-c edge suffices to break monochromaticity) is the right logical form. + +### 6.3 `multicolorRamseyNum` Definition + +The definition uses `sInf` over naturals, which returns 0 if the set is empty. For degenerate inputs (e.g., n = 0 or k ≤ 2), the set could be nonempty trivially or behave unexpectedly. This is not a correctness issue for the stated theorem (which quantifies over all n and fixes k = 3, r ≥ 1) but is worth noting for robustness. + +### 6.4 Status Discrepancy + +The formalization is tagged `@[category research solved]`, while the website lists the problem as **OPEN**. This apparent discrepancy is explained by interpretation: the formalization treats the literal conjecture as disproved (solved in the negative), while the website considers the intended/corrected problem as still open. The formalization's tagging is defensible but could benefit from a comment explaining this distinction. + +### 6.5 Overall Assessment + +**The formalization is mathematically correct for its stated purpose** (showing the literal conjecture is false). The ordered-pair issue does not affect the truth value in this case. The main gaps are the missing generalized variant and the non-standard directed-edge formulation. diff --git a/ai-review/130.md b/ai-review/130.md new file mode 100644 index 0000000000..10c6cdfedc --- /dev/null +++ b/ai-review/130.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 130 + +## 1. Code Reuse + +Several opportunities for reuse from `FormalConjecturesForMathlib` and Mathlib exist: + +- **`NonTrilinear`** (`FormalConjecturesForMathlib/Geometry/2d.lean:54`): The "no three collinear" condition in `ErdosGeneralPosition` is hand-rolled using a nested `∀ p q r` with explicit distinctness hypotheses. The existing `NonTrilinear` utility (defined as `A.Triplewise (fun x y z ↦ ¬ Collinear ℝ {x, y, z})`) captures exactly this condition in a cleaner, more idiomatic way. Problem 213 already uses `NonTrilinear` for the same purpose. + +- **`Cospherical`** (Mathlib `Geometry.Euclidean.Sphere.Basic`): The local `Concyclic` definition could be replaced with Mathlib's `EuclideanGeometry.Cospherical`. In 2D, cospherical and concyclic are equivalent, and Mathlib's definition (`∃ center, ∀ p ∈ s, dist p center = r`) is more general and set-based. Problem 213 already uses `Cospherical` for the "no four concyclic" condition. Mathlib also has a `Concyclic` structure (requiring both `Cospherical` and `Coplanar`), but since we are in ℝ², `Cospherical` alone suffices (coplanarity is automatic). + +- **`chromaticNumber` utilities** (`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`): The coloring file provides extended lemmas on `chromaticNumber`, including `chromaticNumber_ne_top_iff_exists`. These are relevant if any proof work is attempted. + +- **`ℝ²` notation** (`FormalConjecturesForMathlib/Geometry/2d.lean:25`): The notation `ℝ²` for `EuclideanSpace ℝ (Fin 2)` is available in the `EuclideanGeometry` scope, though using the expanded form is also acceptable. + +**Recommendation:** Refactor `ErdosGeneralPosition` to use `NonTrilinear` and `Cospherical`, aligning with the conventions established by Problem 213. + +## 2. Citations + +The formalization references two citations: + +- **[Er97b]**: Listed as `Erdős, P., Some of my favourite problems which recently have been solved, Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997).` — The website confirms [Er97b] is the primary source, attributed to Andrásfai and Erdős. The full citation details on erdosproblems.com are sparse (only "[Er97b]" is listed), so the docstring's expansion is a reasonable best-effort rendering. However, the title "Some of my favourite problems which recently have been solved" is a known Erdős paper title but should be verified — the actual [Er97b] reference from the Erdős bibliography may have slightly different proceedings details. + +- **[AnEr45]**: Listed as `Anning, N.H. and Erdős, P., Integral distances, Bull. Amer. Math. Soc. (1945), 598-600.` — This matches the standard citation for the Anning–Erdős theorem. The website confirms [AnEr45] as a related reference. + +The website also mentions this problem is **related to Problem 213** (integer-distance point configurations). This relationship is not noted in the docstring and could be added for context. + +The website credits the problem as **asked by Andrásfai and Erdős**. The docstring says "[Er97b] (asked by Andrásfai and Erdős)" which is consistent. + +## 3. Variants + +The website does not list any explicit variants for Problem 130 beyond the core question. Two implicit sub-questions are mentioned on the website: + +1. **Can the chromatic number be infinite?** — This is what the formalization captures. +2. **How large can the chromatic number and clique number be?** — The formalization does not capture the quantitative "how large" question about chromatic number for finite cases, nor does it separately ask about the clique number. + +The docstring note about the clique number being finite (via the Anning–Erdős theorem) is a useful observation but is not formalized as a separate statement. A variant formalizing "the clique number of `intDistGraph A` is finite for any `A` in Erdős general position" would be a natural companion theorem (and would be a consequence of the Anning–Erdős theorem). + +**Assessment:** The main question is captured. The clique number finiteness could be a useful formalized variant. + +## 4. Readability + +The code is generally well-structured. Specific observations: + +- **`ErdosGeneralPosition`**: The definition is verbose — 6 distinctness hypotheses for the four-point concyclic condition, and 3 for collinearity. Using `NonTrilinear` and a `Set.Quadruplewise`-style combinator (or at minimum using `Cospherical` with subset/ncard conditions as in Problem 213) would be much more concise and readable. + +- **`intDistGraph`**: The definition is clean and the manual `symm`/`loopless` proofs are appropriately simple. The condition `∃ n : ℕ, 0 < n ∧ dist ... = n` for "positive integer distance" is correct and readable. One minor note: the coercion from `ℕ` to `ℝ` is implicit and works correctly. + +- **Namespace**: The `Erdos130` namespace is appropriate and avoids polluting the global namespace with `Concyclic` and other definitions. + +- **Docstrings**: Clear and informative. The note about the Anning–Erdős theorem providing context for why the clique number is finite is a helpful addition. + +## 5. Formalizability + +**Assessment: High formalizability with moderate ambiguity.** + +The problem is mathematically precise: +- "No three collinear" and "no four concyclic" are standard geometric conditions with clear formalizations. +- "Integer-distance graph" is well-defined. +- "Chromatic number is infinite" is well-defined in the ENat framework (`= ⊤`). + +The only source of ambiguity is: +- **"Can the chromatic number be infinite?"** is a yes/no question. The formalization uses `answer(sorry)` to capture the unknown boolean answer, which is the standard approach for open problems in this codebase. The biconditional `answer(sorry) ↔ ∃ A, ...` correctly states that the answer is "yes" iff such a set exists. + +- **Distance condition**: The problem says "integer distance." The formalization uses *positive* integer distance (`0 < n`), which is correct since distinct points have positive distance, and using `ℕ` (non-negative integers) with the positivity constraint is equivalent to requiring the distance be a positive integer. Note that this excludes non-integer distances and zero distance (which can't occur for distinct points anyway). + +**No ambiguity issues.** The statement is precise enough to be unambiguously formalizable. + +## 6. Correctness + +**Overall assessment: Mathematically correct with minor style issues.** + +### Correct aspects: +- The `Concyclic` definition correctly captures four points lying on a common circle via the existence of a center and positive radius. The positivity of the radius ensures the "circle" is non-degenerate (not all four points coinciding at a single point). +- `ErdosGeneralPosition` correctly requires distinctness of points before asserting non-collinearity/non-concyclicity — without distinctness, three identical points would trivially be collinear. +- `intDistGraph` correctly defines the adjacency relation with distinctness and positive integer distance requirements. The `symm` and `loopless` proofs are correct. +- The main theorem statement `erdos_130` correctly formalizes the question: does there exist an infinite set in Erdős general position whose integer-distance graph has infinite chromatic number? +- Using `chromaticNumber = ⊤` in `ℕ∞` correctly represents infinite chromatic number. + +### Potential concerns: + +1. **`Concyclic` is overly restrictive compared to Mathlib's version.** The local definition takes exactly 4 named points. Mathlib's `Cospherical` works on arbitrary sets. While mathematically equivalent for the intended use, the set-based approach (as in Problem 213) is more aligned with Mathlib conventions. + +2. **`Concyclic` edge case:** If all four points are the same, the definition still allows them to be "concyclic" (they trivially lie on any circle passing through that point). However, this edge case is guarded by the distinctness requirements in `ErdosGeneralPosition`, so it does not affect correctness. + +3. **Integer distance vs. natural number distance:** The formalization uses `ℕ` for the distance value, which means it only captures *non-negative* integer distances. Since distinct points in a metric space always have positive distance, and the formalization requires `0 < n`, this is equivalent to requiring the distance be a positive integer. This is correct — the problem says "integer distance" but since Euclidean distances are non-negative, positive integers are the right formalization. + +4. **The graph is on `↥A` (subtype of A).** This means vertices are elements of the subtype `{x : EuclideanSpace ℝ (Fin 2) // x ∈ A}`, not bare points. This is correct and standard for defining induced subgraphs in Lean 4/Mathlib. + +**No mathematical errors found.** The formalization is correct and complete. The only recommendations are stylistic (use `NonTrilinear` and `Cospherical` for consistency with Problem 213 and better code reuse). diff --git a/ai-review/131.md b/ai-review/131.md new file mode 100644 index 0000000000..00c9a508b7 --- /dev/null +++ b/ai-review/131.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 131 + +## 1. Code Reuse + +The formalization follows a well-established pattern used across several related Erdős problems. Specifically: + +- **Problem 186** (`ErdosProblems/186.lean`) is the most closely related — it defines `IsNonAveraging` and `nonAvgMax` using an almost identical structure. Problem 186 is directly connected to Problem 131 via the Pham–Zakharov paper [PhZa24], which uses non-averaging sets to establish the upper bound for non-dividing sets. A cross-reference between the two files would be valuable. +- **Problem 882** (`ErdosProblems/882.lean`) defines `IsPrimitive` (no element divides another) and `maxPrimitiveSubsetSumSize` using the same `sSup` extremal function pattern. +- **Problem 790** (`ErdosProblems/790.lean`) defines `IsSumFree` and `maxSumFreeSize` with the same structural pattern. +- **Problem 874** (`ErdosProblems/874.lean`) uses `rSubsetSums` with `.sum id` and a similar extremal function. +- **`FormalConjecturesForMathlib/Combinatorics/Basic.lean`** provides foundational `IsSumFree` and `IsSidon` definitions, but nothing directly reusable for `IsNonDividing`. + +No existing definition can replace `IsNonDividing` — the divisibility-of-subset-sum condition is unique to this problem. The code correctly follows the codebase conventions. No code reuse issue. + +## 2. Citations + +The formalization includes: [Er75b], [Er97b], [ELRSS99], [PhZa24]. + +Comparing against [erdosproblems.com/131](https://www.erdosproblems.com/131): + +- **Missing [Gu04]**: The website references Guy, R., *Unsolved Problems in Number Theory* (2004), where this appears as Problem C16. This is a minor omission (secondary reference). +- **Missing Straus**: The website credits Straus with a lower bound of $F(N) > \exp((\sqrt{2/\log 2}+o(1))\sqrt{\log N})$, which is weaker than Csaba's $N^{1/5}$ but historically significant. Not mentioned in the formalization. +- **OEIS A068063**: The website links to this OEIS sequence. Not critical for a formalization but worth noting. +- **Attribution of $N^{1/5}$ lower bound**: The formalization's docstring says "Csaba; Erdős–Lev–Rauzy–Sándor–Sárközy [ELRSS99]" for the $N^{1/5}$ lower bound. The website attributes the lower bound to Csaba specifically and the *upper* bound $F(N) < 3N^{1/2}+1$ to ELRSS. If Csaba's construction is presented within [ELRSS99], the semicolon attribution is fine; otherwise, the attribution may conflate the lower bound (Csaba) with the paper [ELRSS99] (which proved the older upper bound). This should be verified against the paper. +- **Related Problem 186**: The website notes a connection to Problem 186. A cross-reference in the docstring would improve discoverability. + +**Recommendation**: Add [Gu04] and the Straus bound for completeness; verify the Csaba/ELRSS attribution; add a cross-reference to Problem 186. + +## 3. Variants + +The original problem on the website has two components: +1. **"Estimate $F(N)$"** — the broad open question about the growth rate. +2. **"Is $F(N) > N^{1/2-o(1)}$?"** — a specific sub-question, now answered **NO** by Pham–Zakharov. + +The formalization captures a specific conjecture: $F(N) \geq N^{1/4-\varepsilon}$ for all $\varepsilon > 0$ and large $N$. This asserts the Pham–Zakharov upper bound is tight. + +**Missing variants**: +- The original question "$F(N) > N^{1/2-o(1)}$?" could be formalized as a *resolved* theorem (answer: no), since Pham–Zakharov proved $F(N) \leq N^{1/4+o(1)}$. This would capture the historical question. +- The known **upper bound** $F(N) \leq N^{1/4+o(1)}$ (Pham–Zakharov) is a proven result and could be formalized separately. Problem 186 includes both bounds in a single theorem; Problem 131 only states the conjectured lower bound. +- The known **lower bound** $F(N) \gg N^{1/5}$ (Csaba) could also be formalized as a proven result. +- The older upper bound $F(N) < 3N^{1/2}+1$ from [ELRSS99] is not captured. + +The formalization makes a reasonable editorial choice by focusing on the main open conjecture, but capturing the proven Pham–Zakharov upper bound (as Problem 186 does) would give a more complete picture. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The `open Filter` is needed for `atTop` and `∀ᶠ` — correct and minimal. +- The docstring on `erdos_131` is well-written, clearly explaining the conjecture, known bounds, and what the formalization asserts. +- Consider adding a brief note cross-referencing Problem 186, given the deep mathematical connection (Pham–Zakharov's result uses non-averaging sets to bound non-dividing sets). +- The name `erdos131F` could be more descriptive (e.g., `maxNonDividingSize`), consistent with `nonAvgMax` in Problem 186 and `maxSumFreeSize` in Problem 790. However, it follows the `erdosNNNX` naming convention used elsewhere, so this is a stylistic choice. + +Overall readability: **Good**. + +## 5. Formalizability + +The problem statement "Estimate $F(N)$" is inherently imprecise — it asks for an asymptotic estimate, not a specific theorem. The formalization resolves this ambiguity by conjecturing a specific lower bound $F(N) \geq N^{1/4-\varepsilon}$. + +**Assessment of ambiguity**: +- The definition of $F(N)$ is **unambiguous and precisely formalizable**: maximal size of $A \subseteq \{1,\ldots,N\}$ such that no $a \in A$ divides the sum of any distinct elements of $A \setminus \{a\}$. +- The phrase "any distinct elements" could in principle mean "any two distinct elements" or "any subset of distinct elements", but the standard interpretation (and the one used in the formalization) is "any nonempty subset of distinct elements". +- The conjecture "$F(N) \geq N^{1/4-\varepsilon}$" is a precise, formalizable statement. However, it is not stated by Erdős — it is the formalization author's conjecture that the Pham–Zakharov bound is tight. This is a reasonable mathematical guess but should be clearly flagged as editorial. + +**Formalizability rating**: High. The definitions are clean and the statement is precise. + +## 6. Correctness + +**Definition `IsNonDividing`** (line 51–52): +``` +∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A.erase a → S.Nonempty → ¬(a ∣ S.sum id) +``` +This correctly captures: for every $a \in A$ and every nonempty $S \subseteq A \setminus \{a\}$, $a \nmid \sum_{s \in S} s$. Since `Finset` elements are distinct, "distinct elements" is automatically enforced. **Correct.** + +**Definition `erdos131F`** (line 55–56): +``` +sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ IsNonDividing A ∧ A.card = k} +``` +The set is nonempty (take $A = \emptyset$, which vacuously satisfies `IsNonDividing` with card 0) and bounded above by $N$. So `sSup` over `ℕ` (a conditionally complete lattice) returns the correct maximum. **Correct.** + +**Theorem statement `erdos_131`** (lines 71–73): +``` +∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, (erdos131F N : ℝ) ≥ (N : ℝ) ^ ((1 : ℝ) / 4 - ε) +``` +This says: for every $\varepsilon > 0$, for all sufficiently large $N$, $F(N) \geq N^{1/4-\varepsilon}$. This is a standard way to express "$F(N) \geq N^{1/4-o(1)}$". **Mathematically correct formulation of the intended conjecture.** + +**Potential concern**: The conjecture is tagged `category research open`, which is appropriate. However, as noted above, this is an editorial conjecture (that the Pham–Zakharov upper bound is tight), not a conjecture explicitly made by Erdős. The problem as stated by Erdős is broader ("estimate $F(N)$") and the specific sub-question ("is $F(N) > N^{1/2-o(1)}$?") has been resolved. The formalization should perhaps more explicitly note that this specific lower bound conjecture is not from the original sources. + +**Edge case**: When $\varepsilon \geq 1/4$, the exponent $1/4 - \varepsilon \leq 0$, so $N^{1/4-\varepsilon} \leq 1$ for large $N$, and the statement becomes trivially true (since $F(N) \geq 1$ for $N \geq 1$). This is harmless and standard for such formulations. + +**Correctness rating**: **Correct and complete** for the conjecture it chooses to formalize. No mathematical flaws. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ✅ Good | Follows codebase patterns; no existing code to reuse | +| Citations | ⚠️ Minor gaps | Missing [Gu04], Straus; verify Csaba/ELRSS attribution; add Problem 186 cross-ref | +| Variants | ⚠️ Partial | Only captures conjectured lower bound; could add proven Pham–Zakharov upper bound | +| Readability | ✅ Good | Clean, well-documented | +| Formalizability | ✅ High | Definitions are precise and unambiguous | +| Correctness | ✅ Correct | Mathematically sound formalization of the chosen conjecture | diff --git a/ai-review/132.md b/ai-review/132.md new file mode 100644 index 0000000000..86f8195f96 --- /dev/null +++ b/ai-review/132.md @@ -0,0 +1,146 @@ +# AI Review: Erdős Problem 132 + +## 1. Code Reuse + +The `pairCount` definition in `132.lean` (line 61–62) is **identical** to `Erdos756.pairCount` in `756.lean` (line 45–46): + +```lean +noncomputable def pairCount (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card +``` + +These are textually identical definitions in separate namespaces (`Erdos132` vs `Erdos756`). Since Problems 132 and 756 are explicitly related (the website lists them as related, and 756.lean cross-references 132), this duplication should be factored out into a shared utility — possibly in `FormalConjecturesForMathlib/Geometry/Metric.lean`, which already defines `unitDistNum` for unit-distance counting. + +Other related files with similar distance-counting patterns: +- **Problem 95** (`ErdosProblems/95.lean`): `distMultiplicity` — a similar ordered-pair distance count. +- **Problem 93** (`ErdosProblems/93.lean`): `distinctDistances` using `offDiag` (unordered pairs). +- **`FormalConjecturesForMathlib/Geometry/2d.lean`**: Provides `ℝ²` notation and `distinctDistances` for finsets. + +**Recommendation**: Extract `pairCount` into a shared module and import it in both 132.lean and 756.lean. The `ℝ²` notation from `Geometry/2d.lean` could also replace the verbose `EuclideanSpace ℝ (Fin 2)` throughout. + +## 2. Citations + +The formalization includes: [Er84c], [ErPa90], [HoPa34], [ErFi95], [CDL25]. + +Comparing against [erdosproblems.com/132](https://www.erdosproblems.com/132): + +- **Missing [Er97b]**: Erdős, P., *Some of my favourite problems which recently have been solved*, Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). This reference appears on the website and is already cited in the related Problem 756. Should be added for completeness. +- **Missing [Er97e]**: This reference is listed on the website and is notable because it mentions the **\$100 reward** offered by Erdős "for any nontrivial result." This is significant context and should be included. +- **[HoPa34] typo**: The formalization writes "Pannwitz" but the docstring header writes "Pannowitz" (line 33). The correct spelling is **Pannwitz** (as used in the reference on line 46). The docstring narrative at line 33 should be corrected from "Pannowitz" to "Pannwitz." +- **Related problems**: The website lists related Problems 223, 756, and 957. Only the connection to 756 is implicit (via shared structure). A cross-reference note would improve discoverability. + +**Recommendation**: Add [Er97b] and [Er97e] (with the \$100 bounty note); fix the "Pannowitz" → "Pannwitz" typo; add cross-references to Problems 223, 756, and 957. + +## 3. Variants + +The problem on the website has two questions, both captured by the formalization: +1. **Part 1** (`erdos_132`): Must there be at least two limited-occurrence distances for $n \geq 5$? +2. **Part 2** (`erdos_132.variants.tend_to_infinity`): Must the number of such distances tend to infinity? + +**Missing variants**: +- **Convex position** (CDL25): Clemen, Dumitrescu, and Liu proved Part 1 for point sets in convex position. This resolved case could be formalized as a separate theorem (with `category research solved`). The convex position predicate is already available in the codebase via `InConvexPosition` in Problem 93 and `ConvexPosition`/`ConvexIndep` in `Geometry/2d.lean`. +- **Small cases**: Erdős and Fishburn proved Part 1 for $n = 5$ and $n = 6$. These could be formalized as solved results. +- **The $n = 4$ counterexample**: Two equilateral triangles sharing an edge provide a configuration with only one limited-occurrence distance. This could be formalized as a concrete counterexample demonstrating the tightness of the $n \geq 5$ threshold. + +The formalization makes a reasonable choice by focusing on the main open conjectures, but the convex-position variant is a natural addition given existing codebase infrastructure. + +## 4. Readability + +The code is well-structured and readable. Observations: + +- The definitions `pairCount`, `IsLimitedOccurrence`, and `limitedOccurrences` form a clean, layered abstraction. Each has a clear docstring. +- The namespace `Erdos132` and `open Classical` follow codebase conventions. +- The docstring module header (lines 19–52) provides good mathematical context with historical notes and references. +- The two theorem statements are clearly separated with descriptive docstrings. +- Minor: The `IsLimitedOccurrence` definition could explicitly note that negative and zero distances are excluded (they are, since `pairCount A d = 0` when `d ≤ 0` in a metric space, so `0 < pairCount A d` implicitly requires `d > 0`). This is correct but potentially non-obvious. + +Overall readability: **Good**. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is: + +> "Let $A \subset \mathbb{R}^2$ be a set of $n$ points. Must there be two distances which occur at least once but between at most $n$ pairs of points? Must the number of such distances $\to \infty$ as $n \to \infty$?" + +**Assessment of ambiguity**: + +- **"pairs of points"**: The phrase is ambiguous between ordered and unordered pairs. The standard combinatorial geometry convention is that a "pair" is unordered: the distance between points $x$ and $y$ is measured once, not twice. The formalization uses **ordered** pairs with bound $n$, which is equivalent to **at most $n/2$ unordered pairs** — a stricter condition than the natural reading. See Section 6 for detailed analysis. +- **"two distances"**: Unambiguous — at least two distinct values of $d > 0$. +- **"the number ... $\to \infty$"**: The formalization captures this as $\forall k, \exists N, \forall A$ with $|A| \geq N$, $|\text{limited-occurrences}(A)| \geq k$. This is a standard and correct formalization of "tends to infinity." +- **$n \geq 5$ threshold**: The problem on the website does not state this bound explicitly, but the docstring correctly notes that Erdős believed the result for $n \geq 5$ (the $n = 4$ counterexample is well-known). The formalization of Part 1 with `5 ≤ A.card` is appropriate. + +**Formalizability rating**: High for Part 2 (unambiguous). Moderate for Part 1 due to the ordered-vs-unordered pair ambiguity — see Section 6. + +## 6. Correctness + +### Definition: `pairCount` (line 61–62) +```lean +noncomputable def pairCount (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card +``` +This counts **ordered** pairs $(x, y)$ with $x \neq y$ and $\text{dist}(x, y) = d$. Since `dist` is symmetric, every unordered pair $\{x, y\}$ at distance $d$ contributes exactly 2 ordered pairs. So `pairCount A d = 2 * (number of unordered pairs at distance d)`. + +### Definition: `IsLimitedOccurrence` (line 67–68) +```lean +def IsLimitedOccurrence (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : Prop := + 0 < pairCount A d ∧ pairCount A d ≤ A.card +``` +This requires: $1 \leq \text{pairCount}(A, d) \leq |A|$. Since `pairCount` counts ordered pairs, this means the number of unordered pairs at distance $d$ is between $1$ and $|A|/2$. + +### **Critical issue: Ordered pairs vs. unordered pairs** + +The docstring (lines 33–35) states: + +> "Hopf and Pannwitz proved that the largest distance between points of $A$ can occur at most $n$ times, making it a limited-occurrence distance whenever it is realized." + +The classical Hopf–Pannwitz theorem (1934) states: among $n$ points in the plane, the maximum distance (diameter) is achieved by **at most $n$ unordered pairs**. This bound is tight: for a regular $n$-gon with $n$ odd, the diameter is achieved by exactly $n$ unordered pairs, corresponding to $2n$ ordered pairs. + +Under the formalization's definition, the diameter of a regular pentagon ($n = 5$) is achieved by $5$ unordered pairs $= 10$ ordered pairs. The formalization requires `pairCount A d ≤ 5`, but the actual ordered pair count is $10$. Therefore, **the diameter of the regular pentagon is NOT a limited-occurrence distance under the formalization's definition**. + +This contradicts the docstring's claim that Hopf–Pannwitz "makes [the diameter] a limited-occurrence distance whenever it is realized." The docstring's reasoning is valid only if "at most $n$ pairs" means at most $n$ unordered pairs and the bound is also $n$ unordered pairs — but the code implements a bound of $n$ on **ordered** pairs. + +**The fix**: Either +1. **Change `pairCount` to count unordered pairs** (e.g., using `A.offDiag` or `A.sym2` instead of `A ×ˢ A`, and dividing by 2 or counting directly), keeping the bound at `A.card`, or +2. **Change the bound to `2 * A.card`** in `IsLimitedOccurrence`: + ```lean + def IsLimitedOccurrence (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : Prop := + 0 < pairCount A d ∧ pairCount A d ≤ 2 * A.card + ``` + +Option (1) is cleaner and consistent with the natural reading of "pairs of points" in the problem statement. + +### Theorem: `erdos_132` (Part 1) + +Modulo the ordered/unordered pair issue above, the logical structure is correct: for all $A$ with $|A| \geq 5$, the set of limited-occurrence distances has `ncard` at least 2. The use of `Set.ncard` is appropriate (the set is finite since only finitely many distances exist between finitely many points; `open Classical` ensures decidability). + +The wrapping in `answer(sorry) ↔ ...` follows the codebase convention for open problems. + +### Theorem: `erdos_132.variants.tend_to_infinity` (Part 2) + +```lean +∀ k : ℕ, ∃ N : ℕ, ∀ A : Finset (EuclideanSpace ℝ (Fin 2)), N ≤ A.card → + k ≤ Set.ncard (limitedOccurrences A) +``` + +This correctly formalizes "the number of limited-occurrence distances tends to infinity with $n$." The quantifier structure ($\forall k, \exists N, \forall A$ with $|A| \geq N$, at least $k$ limited-occurrence distances) is the standard way to express divergence. Note that $N$ depends only on $k$, not on the specific point set — this is correct since the claim is a universal lower bound. + +Subject to the same ordered/unordered pair caveat, this is **mathematically correct**. + +### Minor observation + +Both theorems are tagged `category research open`, consistent with the problem's open status on the website. + +**Correctness rating**: **Incorrect as-is** due to the ordered/unordered pair factor-of-2 discrepancy. The mathematical intent is clear and the logical structure is sound, but the `IsLimitedOccurrence` definition imposes a strictly tighter bound than the problem requires, which (a) invalidates the Hopf–Pannwitz justification in the docstring, and (b) potentially changes the truth value of the conjecture. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ⚠️ Duplication | `pairCount` duplicated verbatim in 756.lean; should be shared | +| Citations | ⚠️ Minor gaps | Missing [Er97b], [Er97e] (\$100 bounty); "Pannowitz" typo; no cross-refs to 223/756/957 | +| Variants | ⚠️ Partial | Missing convex-position variant (CDL25 proved it); small-case results; $n=4$ counterexample | +| Readability | ✅ Good | Clean layered definitions, clear docstrings | +| Formalizability | ✅ High | Precise enough to formalize; minor ordered/unordered ambiguity | +| Correctness | ❌ Factor-of-2 error | `pairCount` uses ordered pairs but bounds by $n$; should count unordered pairs (bound $n$) or ordered pairs (bound $2n$). Docstring's Hopf–Pannwitz argument is invalid under current definition. | diff --git a/ai-review/133.md b/ai-review/133.md new file mode 100644 index 0000000000..5bad61cb89 --- /dev/null +++ b/ai-review/133.md @@ -0,0 +1,110 @@ +# Review: Erdős Problem 133 + +## 1. Code Reuse + +**`HasTriangle` — should use Mathlib's `CliqueFree`.** +Mathlib provides `SimpleGraph.CliqueFree 3`, which is the standard way to express "triangle-free." Problem 134 already uses `G.CliqueFree 3` directly (line 63), while Problem 133 defines a custom `HasTriangle` and negates it (`¬HasTriangle G`). The custom definition is semantically equivalent but non-standard. Replacing `¬HasTriangle G` with `G.CliqueFree 3` would improve consistency with the rest of the codebase and Mathlib conventions. + +**`HasDiameterAtMostTwo` — duplicated with Problem 134.** +An identical definition of `HasDiameterAtMostTwo` appears in both `133.lean` (line 49) and `134.lean` (line 48). This should be factored into a shared utility, for example in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean`, which already contains diameter-related extras. Alternatively, one could use Mathlib's `SimpleGraph.diam` (which exists) and express the condition as `G.diam ≤ 2`, though this requires the graph to be connected and uses a different definition infrastructure. The custom `HasDiameterAtMostTwo` is arguably clearer and avoids connectedness issues (it implies connected for `n ≥ 2`), but sharing it is still warranted. + +**Other graph infrastructure.** Mathlib provides `SimpleGraph.maxDegree`, `SimpleGraph.minDegree`, `SimpleGraph.degree`, and `SimpleGraph.edgeFinset`, all of which are already used correctly through `ProblemImports`. + +## 2. Citations + +**Discrepancy with website.** The formalization cites **[ErPa90]** (Erdős–Pach, 1990) for the original question and Moore bound, but the [erdosproblems.com/133](https://www.erdosproblems.com/133) website cites **[Er97b]** (Erdős, 1997) as the primary reference. The website does not mention [ErPa90]. The docstring should be updated to match the website's citations, or both should be listed if [ErPa90] is the true original source. + +**Missing citation: [HaLe18].** The website mentions **Haviv & Levy [HaLe18]** who gave an alternative construction of complete sum-free sets. This is not mentioned in the formalization. + +**Missing citation: Alon's note.** The website links to Alon's explicit note at `https://web.math.princeton.edu/~nalon/PDFS/remark1901.pdf`. The Alon conjecture variant (line 130) should reference this. + +**[HaSe84] and [FuSe94]** match the website correctly. + +## 3. Variants + +The formalization captures the main results well: +- Main question (disproved) ✓ +- Moore bound lower bound ✓ +- Hanson–Seyffarth upper bound ✓ +- Füredi–Seress improvement ✓ +- Ratio bounded (O(√n)) ✓ +- Alon conjecture (f(n) ~ √n) ✓ + +**Missing variants from the website:** +- **Simonovits construction:** f(n) ≤ n^{0.7182...}, obtained from subsets of [3m−1] of size m where sets are adjacent iff disjoint. This was the first non-trivial upper bound. +- **Alon's intermediate result:** f(n) ≪ √(n log n), leveraging triangle-free graphs with small independence number. This improved on Simonovits before Hanson–Seyffarth. + +These are historically significant intermediate results but not strictly required for a complete formalization. + +## 4. Readability + +Overall readability is **good**. The docstrings are clear and include proof sketches. A few suggestions: + +- The `erdos133_f` definition (lines 56–59) is mathematically subtle and could benefit from an additional comment clarifying that `sSup` (see correctness section) gives the tightest lower bound on max degree across all qualifying graphs. +- The `[DecidableRel G.Adj]` instance parameter inside the set comprehension is necessary for `G.degree` but may be confusing to readers unfamiliar with Lean. A brief comment would help. +- The namespace `Erdos133` is fine. The theorem naming convention (`erdos_133`, `erdos_133.variants.*`) is consistent with the codebase. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: f(n) is a well-defined function on natural numbers, the conditions (triangle-free, diameter ≤ 2) are standard graph-theoretic predicates, and the conjectured behavior (f(n)/√n → ∞) is a precise asymptotic statement. The known results (Moore bound, Hanson–Seyffarth, Füredi–Seress) are all precisely quantified. + +The only mild ambiguity is in the original statement's use of "minimal" in "Let f(n) be minimal such that every... contains a vertex with degree ≥ f(n)," which in standard combinatorial usage means f(n) is the tightest (largest) such lower bound — equivalently, the minimum of the maximum degree over all qualifying graphs. This is well-understood in the community but requires care in formalization. See the correctness section. + +## 6. Correctness + +### CRITICAL BUG: `erdos133_f` uses `sInf` instead of `sSup` + +The definition at line 56–59: + +```lean +noncomputable def erdos133_f (n : ℕ) : ℕ := + sInf { k : ℕ | ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + ¬HasTriangle G → HasDiameterAtMostTwo G → + ∃ v : Fin n, k ≤ G.degree v } +``` + +is **incorrect**. The set `{k : ℕ | ∀ G ..., ∃ v, k ≤ G.degree v}` is **downward-closed**: if some `k₀` is in the set, then every `k ≤ k₀` is also in the set (because `k ≤ k₀ ≤ G.degree v`). Moreover, `k = 0` is always in the set (since `0 ≤ G.degree v` for any `v`). Therefore: + +**`sInf` of this set is always `0`**, making `erdos133_f n = 0` for all `n`. + +This renders all downstream theorems either trivially true or trivially false depending on the direction of the inequality: +- `erdos_133` (line 68): Claims `answer(False) ↔ Tendsto ... atTop atTop`. With `erdos133_f = 0`, the RHS is `Tendsto (fun n => 0 / √n) atTop atTop = Tendsto 0 atTop atTop`, which is false. So the biconditional becomes `False ↔ False`, which is `True` — provable but vacuously so and not mathematically meaningful. +- `erdos_133.variants.lower_bound` (line 82): `Nat.sqrt (n-1) ≤ 0` is false for `n ≥ 2`, so this becomes unprovable — which is wrong, since the real lower bound does hold. + +**Fix:** Replace `sInf` with `sSup`: + +```lean +noncomputable def erdos133_f (n : ℕ) : ℕ := + sSup { k : ℕ | ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + ¬HasTriangle G → HasDiameterAtMostTwo G → + ∃ v : Fin n, k ≤ G.degree v } +``` + +With `sSup`, the value is the largest `k` such that every qualifying graph has a vertex of degree ≥ `k`, which equals `min_G maxDeg(G)` — exactly the intended `f(n)`. + +**Edge case note:** For `n` where no qualifying graph exists (e.g., `n = 0`), the set is all of `ℕ` (vacuously), and `sSup ℕ` is problematic (unbounded). The docstring addresses this by saying "the infimum of the empty set is 0" but with `sSup` the edge case handling would change. One could either: (a) accept that `sSup` of an unbounded set gives `0` by Mathlib's convention for `ℕ` (since `sSup` on `ℕ` uses `ConditionallyCompleteLattice` and is only meaningful for bounded nonempty sets, returning 0 for unbounded sets), or (b) add an explicit guard for small `n`. + +### Minor: `HasTriangle` adjacency symmetry + +The definition `G.Adj a b ∧ G.Adj b c ∧ G.Adj a c` is correct because `SimpleGraph.Adj` is symmetric. The third conjunct uses `G.Adj a c` (not `G.Adj c a`), which is fine. + +### Minor: Moore bound statement + +The lower bound theorem states `Nat.sqrt (n - 1) ≤ erdos133_f n`, which is `⌊√(n-1)⌋ ≤ f(n)`. The true bound is `f(n) ≥ √(n-1)` (real-valued), so `f(n) ≥ ⌈√(n-1)⌉`. Since `⌊√(n-1)⌋ ≤ ⌈√(n-1)⌉`, the stated bound is correct but slightly weaker than optimal. This is acceptable. + +### Minor: Proof sketch accuracy + +The Moore bound proof sketch says "a graph with max degree d and diameter ≤ 2 has at most d²+1 vertices." This bound holds for **all** graphs (not just triangle-free ones); the triangle-free condition is a constraint on the problem domain, not on the Moore bound itself. The sketch is correct but could clarify this. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `HasTriangle` should use `CliqueFree 3`; `HasDiameterAtMostTwo` duplicated with Problem 134 | +| Citations | [ErPa90] not on website (website uses [Er97b]); missing [HaLe18] and Alon's note URL | +| Variants | Main results covered; missing Simonovits and Alon intermediate constructions | +| Readability | Good overall | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | **CRITICAL: `sInf` should be `sSup` in `erdos133_f` — current definition is identically 0** | diff --git a/ai-review/134.md b/ai-review/134.md new file mode 100644 index 0000000000..25e9530d83 --- /dev/null +++ b/ai-review/134.md @@ -0,0 +1,117 @@ +# Review: Erdős Problem 134 + +## 1. Code Reuse + +**`HasDiameterAtMostTwo` — duplicated with Problem 133.** +An identical definition appears in both `133.lean` (line 49) and `134.lean` (line 48). This should be factored into a shared utility, for example in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean`, which already contains diameter-related extras. Both problems use this predicate identically. + +**Mathlib's `SimpleGraph.diam` exists but is not a direct replacement.** +Mathlib defines `SimpleGraph.diam` (in `Mathlib/Combinatorics/SimpleGraph/Diam.lean`) as the maximum eccentricity, valued in `ℕ`. One could express the diameter-2 condition as `G.diam ≤ 2`, but this relies on Mathlib's graph distance infrastructure (shortest walk length) and requires the graph to be connected (otherwise `diam` is 0 by convention). The custom `HasDiameterAtMostTwo` avoids this: it implicitly requires connectivity for `n ≥ 2` (every pair is adjacent or has a common neighbor) without depending on the `Metric` / `Diam` import chain. The custom definition is reasonable, but sharing it is still warranted. + +**Other infrastructure is well-reused.** The formalization correctly uses `SimpleGraph.CliqueFree 3` (unlike Problem 133 which defines a custom `HasTriangle`), `SimpleGraph.degree`, and `SimpleGraph.edgeFinset` from Mathlib via `ProblemImports`. No further reuse issues. + +## 2. Citations + +**[Er97b] — matches website.** The website lists **[Er97b]** (Erdős, 1997, *Some old and new problems in various branches of combinatorics*) as the primary reference. The formalization's docstring cites [Er97b] correctly. + +**[Al94] — partially matches.** The formalization references `[Al94] Alon, N., Explicit Ramsey graphs and orthonormal labelings (1994)`. The website describes Alon's result as a "Princeton note" without specifying the exact title. The citation in the formalization appears to be the correct published version. This is acceptable. + +**Missing: related problem link.** The website mentions a connection to **Problem 618**. This is not noted in the formalization's docstring. Consider adding a cross-reference (e.g., "See also Problem 618") for completeness. + +**Missing: Alon acknowledgment.** The website includes "special thanks to Noga Alon." This is a minor omission with no mathematical impact. + +**Erdős and Gyárfás attribution — matches.** The docstring correctly attributes the original question to Erdős and Gyárfás and mentions their result for max degree ≪ log n / log log n. The Simonovits counterexample for degree ≤ Cn^{1/2} is also mentioned. Both match the website. + +## 3. Variants + +The formalization captures two versions: + +1. **`erdos_134`** (line 59): The original question — for every ε, δ > 0, sufficiently large n, a triangle-free graph with max degree < n^{1/2−ε} can be extended to a triangle-free diameter-2 graph by adding ≤ δn² edges. ✓ +2. **`erdos_134.variants.alon_strong_form`** (line 79): Alon's stronger quantitative result — the number of added edges is O(n^{2−ε}), i.e., for every ε > 0 there exists C > 0 such that ≤ Cn^{2−ε} edges suffice. ✓ + +**Relationship between variants is correct.** The strong form (variant 2) implies the original (variant 1): if the number of added edges is ≤ Cn^{2−ε}, then for any δ > 0 and sufficiently large n, Cn^{2−ε} ≤ δn² (since n^{−ε} → 0), so ≤ δn² edges suffice. + +**No missing variants.** The website does not describe any additional variants beyond the original question and Alon's strong form. The intermediate results by Erdős–Gyárfás (max degree ≪ log n / log log n) and Simonovits's counterexample (max degree ≤ Cn^{1/2}) are mentioned in the docstring as context but are not formalized as separate theorems. This is reasonable — these are historical context rather than distinct conjectural statements. + +## 4. Readability + +Overall readability is **very good**. + +- The docstrings are detailed and provide clear mathematical context, including the history of the problem and the relationship between the original question and Alon's result. +- The `HasDiameterAtMostTwo` definition (lines 46–49) has a helpful docstring explaining the graph-theoretic meaning. +- The namespace `Erdos134` and theorem names `erdos_134`, `erdos_134.variants.alon_strong_form` follow codebase conventions. +- The use of `G ≤ H` to express "H is a supergraph of G" (i.e., G's edge set is a subset of H's) is idiomatic Lean/Mathlib for `SimpleGraph` and immediately clear. + +**Minor suggestion:** The exponent `(1 : ℝ) / 2 - ε` on line 64 uses `(1 : ℝ) / 2` rather than `1 / 2` to force real division. This is a standard Lean idiom but could benefit from a brief comment for readers less familiar with type coercion. Very minor. + +## 5. Formalizability + +**Assessment: Clearly formalizable, very low ambiguity.** + +The problem statement is precise: it involves standard graph-theoretic predicates (triangle-free, diameter, maximum degree, edge count) and standard asymptotic quantification ("for all sufficiently large n"). All concepts have unambiguous formal definitions. + +The only potential source of mild ambiguity in the informal statement is "can G be made into a triangle-free graph with diameter 2 by adding at most δn² edges." The formalization interprets this as: there exists a supergraph H ≥ G on the same vertex set that is triangle-free, has diameter ≤ 2, and satisfies |E(H)| − |E(G)| ≤ δn². This is the standard and intended interpretation — no vertices are added or removed, only edges. The formalization captures this correctly via `G ≤ H` (same vertex type `Fin n`, edge set inclusion). + +## 6. Correctness + +### Main theorem `erdos_134` (lines 59–68): CORRECT + +The statement: +```lean +∀ ε δ : ℝ, 0 < ε → 0 < δ → ∀ᶠ n : ℕ in atTop, + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + (∀ v : Fin n, (G.degree v : ℝ) < (n : ℝ) ^ ((1 : ℝ) / 2 - ε)) → + ∃ H : SimpleGraph (Fin n), + G ≤ H ∧ H.CliqueFree 3 ∧ HasDiameterAtMostTwo H ∧ + (H.edgeFinset.card : ℝ) - (G.edgeFinset.card : ℝ) ≤ δ * (n : ℝ) ^ 2 +``` + +correctly formalizes the problem. Key observations: + +- **Quantifier order:** ε and δ are universally quantified first, then "for sufficiently large n" (via `∀ᶠ n in atTop`), then "for all G." This matches the informal statement where n must be "sufficiently large in terms of ε and δ." +- **Max degree condition:** `∀ v, (G.degree v : ℝ) < n^{1/2 − ε}` correctly encodes "maximum degree < n^{1/2−ε}." +- **Triangle-free:** `G.CliqueFree 3` is the standard Mathlib predicate. +- **Supergraph:** `G ≤ H` on the same `Fin n` vertex set correctly encodes edge addition without vertex modification. +- **Triangle-free extension:** `H.CliqueFree 3` ensures the extended graph is also triangle-free. +- **Diameter condition:** `HasDiameterAtMostTwo H` correctly requires diameter ≤ 2. +- **Edge bound:** `(H.edgeFinset.card : ℝ) - (G.edgeFinset.card : ℝ) ≤ δ * n^2` correctly counts the number of added edges. +- **`answer(True)`:** The problem is marked as proved in the affirmative, which matches Alon's result. + +**Subtle point on `edgeFinset` and `DecidableEq`:** The use of `edgeFinset` requires decidable adjacency. For `SimpleGraph (Fin n)`, this holds because `Fin n` is finite and has decidable equality. This is handled automatically by Lean's typeclass inference. No issues here. + +### Strong form `erdos_134.variants.alon_strong_form` (lines 79–87): CORRECT + +The statement: +```lean +∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + ∀ G : SimpleGraph (Fin n), + G.CliqueFree 3 → + (∀ v : Fin n, (G.degree v : ℝ) < (n : ℝ) ^ ((1 : ℝ) / 2 - ε)) → + ∃ H : SimpleGraph (Fin n), + G ≤ H ∧ H.CliqueFree 3 ∧ HasDiameterAtMostTwo H ∧ + (H.edgeFinset.card : ℝ) - (G.edgeFinset.card : ℝ) ≤ C * (n : ℝ) ^ (2 - ε) +``` + +correctly formalizes Alon's strong result. Key differences from the main theorem: + +- **No δ:** Instead of "at most δn² for arbitrary δ," the bound is "at most Cn^{2−ε} for some C depending on ε." The quantifier structure `∀ ε, ∃ C, ∀ᶠ n, ...` is correct. +- **C > 0:** The existential requires `0 < C`, which is natural (the bound is nontrivial). +- **Exponent `2 - ε`:** The bound `C * n^{2−ε}` matches Alon's O(n^{2−ε}) result. + +**Logical consistency:** As noted in the variants section, `alon_strong_form` implies `erdos_134`. If we have C and n^{2−ε}, then for any δ > 0, for large enough n, Cn^{2−ε} = Cn²·n^{−ε} ≤ δn². This is correct and the two statements are consistent. + +### No issues found with the formalization. + +The formalization is mathematically correct, complete for the stated problem, and the two theorems together capture both the original question and the stronger quantitative answer. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `HasDiameterAtMostTwo` duplicated with Problem 133; should be shared | +| Citations | Mostly correct; missing cross-reference to Problem 618 | +| Variants | Both the original question and Alon's strong form are captured; no missing variants | +| Readability | Very good; clear docstrings and idiomatic Lean | +| Formalizability | Clearly formalizable, very low ambiguity | +| Correctness | **Correct.** Both theorems accurately formalize the intended mathematical statements | diff --git a/ai-review/135.md b/ai-review/135.md new file mode 100644 index 0000000000..384ba94bb0 --- /dev/null +++ b/ai-review/135.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 135 + +## 1. Code Reuse + +The `numDistances` definition at line 39 is **duplicated nearly verbatim** in Problem 657 (`FormalConjectures/ErdosProblems/657.lean:37`). Both use the same `(A ×ˢ A).filter`-then-`.image` pattern. Several other problems (93, 95, 958, 1082) define equivalent `distinctDistances` functions. + +More importantly, `FormalConjecturesForMathlib/Geometry/2d.lean:194` already provides a shared `EuclideanGeometry.distinctDistances` definition using the cleaner `offDiag` approach: + +```lean +noncomputable def distinctDistances (points : Finset ℝ²) : ℕ := + (points.offDiag.image fun (pair : ℝ² × ℝ²) => dist pair.1 pair.2).card +``` + +This is mathematically equivalent (both produce the same set of distance values since `dist` is symmetric) and could replace the local `numDistances`. The `offDiag` approach is preferred because it directly produces unordered pairs, making the intent clearer. + +The `FourPointFiveDist` predicate is specific to this problem and has no direct analogue elsewhere, though its structure mirrors `NoIsoscelesTriangles` in Problem 657 (checking subset properties on k-element subsets). + +**Recommendation:** Replace the local `numDistances` with the shared `EuclideanGeometry.distinctDistances` from `2d.lean`, or at minimum switch to the `offDiag` idiom for consistency with Problems 93 and 1082. + +## 2. Citations + +The formalization lists three references: +- **[Er97b]** — matches website ("Er97b"). Website specifies **p. 231**; the formalization omits the page number. +- **[Er97e]** — matches website ("Er97e"). Website specifies **p. 531**; the formalization omits the page number. +- **[Ta24c]** — matches website. Tao's 2024 counterexample. + +The website also mentions: +- A **$250 prize** originally offered by Erdős. This is not documented in the formalization (minor omission, but worth noting for completeness). +- Tao discussed the solution in a **blog post**. Not mentioned in the docstring. + +**Recommendation:** Add page numbers to [Er97b] and [Er97e] (p.231 and p.531 respectively). Consider noting the prize. + +## 3. Variants + +The website describes a **stronger conjecture** not captured by the formalization: + +> "Erdős made a stronger conjecture: that $A$ must contain $\gg n$ points where all pairwise distances are distinct." + +This is a strictly stronger statement — it asserts not just $\gg n^2$ total distinct distances, but that there exists a large subset of $\gg n$ points with *all* pairwise distances distinct. Tao's counterexample disproves the weaker conjecture (and hence the stronger one too), but the stronger version is mathematically interesting in its own right and could be formalized as a second theorem. + +The website also mentions a **general extension**: "How many distances must $A$ determine if every subset of $p$ points determines at least $q$ distances?" This is a parametric generalization rather than a specific variant, so its omission is less concerning. + +**Related problems** listed on the website: Problems 136, 657, 659. Problem 657 is already formalized in the codebase. + +**Recommendation:** Consider adding the stronger conjecture as a separate theorem `erdos_135_strong`, which would state (also `answer(False)`) that there exists $c > 0$ such that any $A$ with `FourPointFiveDist A` contains a subset $B \subseteq A$ with $c \cdot A.card ≤ B.card$ and all pairwise distances of $B$ distinct. + +## 4. Readability + +The code is well-structured and readable. The docstrings are thorough, explaining both the original conjecture and Tao's disproof. Minor suggestions: + +- The `numDistances` definition uses `(A ×ˢ A).filter (fun p => p.1 ≠ p.2)` which generates ordered pairs. While mathematically equivalent for counting distinct distance *values* (since `dist` is symmetric), using `A.offDiag` would be both shorter and semantically clearer, as it better reflects "unordered pairs of distinct points." +- The `FourPointFiveDist` docstring says "four-point, five-distance property" which is clear and well-chosen. + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. All components have precise mathematical meanings: +- "Set of $n$ points in $\mathbb{R}^2$" → `Finset (EuclideanSpace ℝ (Fin 2))` +- "Any 4 points determine at least 5 distinct distances" → the `FourPointFiveDist` predicate +- "$\gg n^2$ distances" → existence of a constant $c > 0$ with $cn^2 \leq |\text{distances}|$ + +The asymptotic notation "$\gg n^2$" is correctly interpreted as "at least $cn^2$ for some absolute constant $c > 0$." There is no ambiguity in the statement. + +**Assessment: No ambiguity.** The formalization captures the precise mathematical content. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**`numDistances` (line 39):** Counts elements of $\{d(p,q) : p, q \in A, p \neq q\}$. Since `dist` is symmetric, the ordered-pair enumeration produces the same image as unordered pairs. This correctly counts the number of distinct pairwise distances. ✓ + +**`FourPointFiveDist` (line 44):** Quantifies over all 4-element subsets $S \subseteq A$ and requires $5 \leq \text{numDistances}(S)$. Since $\binom{4}{2} = 6$, this means every 4-point subset has either 5 or 6 distinct pairwise distances (i.e., at most one repeated distance among the six pairs). This correctly captures "any 4 points determine at least 5 distinct distances." ✓ + +**`erdos_135` (line 62):** The statement is: +```lean +answer(False) ↔ ∃ c : ℝ, 0 < c ∧ ∀ A, FourPointFiveDist A → c * A.card² ≤ numDistances A +``` + +- The RHS asserts the conjecture: there exists $c > 0$ such that all sets with the four-point-five-distance property have at least $cn^2$ distinct distances. +- `answer(False)` indicates the conjecture is false, consistent with Tao's 2024 counterexample which constructs sets where the number of distinct distances is $O(n^2 / \sqrt{\log n}) = o(n^2)$. +- The `↔` structure means proving `erdos_135` requires showing the RHS is `False`, which amounts to: for every $c > 0$, there exists a set $A$ with `FourPointFiveDist A` but $\text{numDistances}(A) < c \cdot |A|^2$. This is exactly what Tao's construction provides. ✓ + +**No mathematical flaws identified.** The formalization is correct and complete for the main conjecture as stated. + +**One subtlety worth noting:** The formalization does not require $A$ to have any minimum size (e.g., $|A| \geq 4$). For $|A| \leq 3$, `FourPointFiveDist A` is vacuously true (no 4-element subsets exist). The existential $\exists c > 0$ with $c \cdot n^2 \leq \text{numDistances}(A)$ must hold for *all* $A$, including these small sets where numDistances could be 0. For $|A| = 0$ or $|A| = 1$, numDistances is 0, so $c \cdot 0 \leq 0$ holds. For $|A| = 2$, numDistances is 1, so $c \cdot 4 \leq 1$ fails for $c > 1/4$. This means the RHS is already `False` for trivial reasons (small sets), making `answer(False)` correct but arguably for a less interesting reason than Tao's result. A more careful formalization might add a hypothesis like `4 ≤ A.card` or use the asymptotic form $\forall C > 0, \exists N_0, \forall A$ with $|A| \geq N_0$... (as Problem 657 does). However, this is a **minor formalization choice** and does not affect mathematical correctness — the answer is `False` either way. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `numDistances` is duplicated; shared `distinctDistances` from `2d.lean` could be used | +| Citations | Page numbers missing for [Er97b] (p.231) and [Er97e] (p.531); prize not noted | +| Variants | Stronger conjecture (≫n points with all distances distinct) not captured | +| Readability | Good; `offDiag` idiom would be slightly cleaner | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Mathematically correct; minor note that small-set vacuity makes RHS trivially false | diff --git a/ai-review/136.md b/ai-review/136.md new file mode 100644 index 0000000000..7ed7c982b1 --- /dev/null +++ b/ai-review/136.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 136 + +## 1. Code Reuse + +**Several opportunities identified.** + +- **`EdgeColoring` duplication**: Problem 136 defines `EdgeColoring n k := Fin n → Fin n → Fin k`, which is identical to the definition in `FormalConjectures/ErdosProblems/129.lean:41`. These could share a common definition. + +- **`Sym2`-based alternative**: Multiple other edge-coloring problems (810, 811, 809, 76, 778) use `Sym2 (Fin n) → Color`, which is the mathematically cleaner representation for undirected edge colorings. The `antiRamseyNum` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:159` also uses `Sym2 (Fin n) → Fin k`. Adopting `Sym2` would eliminate the symmetry correctness issue discussed below. + +- **`IsRainbow` / `antiRamseyNum`**: The problem is related to anti-Ramsey theory (requiring many colors on substructures). While not directly applicable (the problem asks for ≥5 colors on K₄ edges rather than a full rainbow), the `Sym2`-based infrastructure used by `antiRamseyNum` could serve as a model for the edge representation. + +## 2. Citations + +The citations in the docstring are consistent with the information on [erdosproblems.com/136](https://www.erdosproblems.com/136): + +- **[Er97b]**: Listed as Erdős, P. and Gyárfás, A., *A variant of the classical Ramsey problem* (1997). The website does not provide journal details, but the full reference is: *Combinatorica* **17** (1997), 459–467. Problem 129 in this same codebase includes the full journal citation for the same paper; Problem 136 should match. +- **[BCDP22]**: Bennett, Cushman, Dudek, and Pralat (2022). The docstring lacks the paper title. Full reference: *Monochromatic components with large minimum degree*, Electronic Journal of Combinatorics (2022). (Should be verified — the website does not provide the full title.) +- **[JoMu22]**: Joos, F. and Mubayi, D. (2022). Also lacks a title in the docstring. + +**Recommendation**: Add journal names and titles to match the level of detail in other files (e.g., Problem 129's citation of the same [Er97b] paper includes the journal). + +## 3. Variants + +The formalization captures three results: + +1. **`erdos_136`**: The main asymptotic result f(n) ~ 5n/6. +2. **`erdos_136.variants.bounds`**: The original Erdős–Gyárfás bounds 5(n−1)/6 < f(n) < n. +3. **`erdos_136.variants.f9`**: The special value f(9) = 8. + +This appears to be a complete coverage of all results mentioned on the website. No additional variants are missing. + +## 4. Readability + +The code is well-structured and readable. The docstrings clearly explain each definition. Minor suggestions: + +- The `EdgeColoring` type name is generic and appears in multiple files with identical definitions but in different namespaces. A comment noting the ordered-pair representation choice (vs. `Sym2`) would help readers understand the design decision. +- The `open Classical Filter` could be split into two separate `open` statements for clarity, though this is stylistic. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement is precise: "the smallest number of colours required to colour the edges of K_n such that every K₄ contains at least 5 colours." All terms (K_n, K₄, edge colouring, number of colours on a subgraph) have standard mathematical definitions. The asymptotic statement f(n) ~ 5n/6 is also unambiguous. There is essentially no room for interpretive disagreement about what the problem asks. + +## 6. Correctness + +**ISSUE: Missing symmetry constraint on `EdgeColoring`.** + +This is the most significant finding. The definition: + +```lean +def EdgeColoring (n k : ℕ) : Type := Fin n → Fin n → Fin k +``` + +allows *asymmetric* colorings where `χ i j ≠ χ j i`. However, edges of K_n are unordered pairs, so a valid edge coloring must satisfy `χ i j = χ j i`. + +The `edgeColors` function uses `S.offDiag`, which produces all *ordered* pairs `(i, j)` with `i ≠ j`. For a 4-element set, this yields 12 ordered pairs, whereas K₄ has only 6 edges. The image `S.offDiag.image (fun p => χ p.1 p.2)` therefore counts colors from both `χ i j` and `χ j i`. + +**Consequences:** + +- If `χ` is symmetric, the 12 ordered pairs produce the same color set as the 6 unordered edges — no issue. +- If `χ` is not symmetric, the color count can be artificially inflated. For example, one could use fewer total colors `k` but achieve ≥5 distinct values on a K₄ by exploiting asymmetry. This makes the "at least 5 colors" condition *easier* to satisfy. +- Since `f(n)` is defined as the *minimum* `k` for which a K₄-five-colored coloring exists, allowing asymmetric colorings could yield a *smaller* `f(n)` than the mathematically intended value. This could invalidate the lower bound `5(n−1)/6 < f(n)`. + +**Fix options (in order of preference):** + +1. **Use `Sym2`**: Redefine `EdgeColoring n k := Sym2 (Fin n) → Fin k` and compute `edgeColors` over the `Finset.image Sym2.mk` of the 2-element subsets. This is the most principled fix and aligns with other problems in the codebase (810, 811, 809). + +2. **Add symmetry constraint**: Keep the ordered-pair representation but add a symmetry hypothesis wherever `χ` is used, e.g., define `IsK4FiveColored` only for `χ` satisfying `∀ i j, χ i j = χ j i`. + +3. **Use `Finset.filter` on offDiag**: Restrict to pairs `(i, j)` with `i < j` to count only one representative per edge. This is more fragile but avoids changing the type. + +**Secondary observation**: The definition permits coloring self-loops (`χ i i`), but `offDiag` correctly excludes diagonal entries, so this is not a problem in practice — just a minor inelegance. + +## Summary + +| Category | Assessment | +|---|---| +| Code Reuse | `EdgeColoring` duplicated with Problem 129; `Sym2`-based approach from other files preferred | +| Citations | Consistent with website; could add journal names/titles for completeness | +| Variants | Complete — all known results captured | +| Readability | Good | +| Formalizability | Unambiguous, highly formalizable | +| Correctness | **Incorrect** — missing symmetry constraint allows asymmetric "edge colorings" that inflate color counts and potentially change the value of f(n) | diff --git a/ai-review/140.md b/ai-review/140.md new file mode 100644 index 0000000000..bd096b93cb --- /dev/null +++ b/ai-review/140.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 140 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** Problem 140 defines its own `IsThreeAPFree` and `r3` from scratch, but equivalent infrastructure already exists in two places: + +### Mathlib (`Mathlib.Combinatorics.Additive.AP.Three.Defs`) +- **`ThreeAPFree`**: Predicate on `Set α` — `∀ a ∈ s, b ∈ s, c ∈ s, a + c = b + b → a = b`. This is definitionally equivalent to Problem 140's `IsThreeAPFree` (since `2 * b = b + b` for `ℕ`). +- **`rothNumberNat n`**: Defined as `addRothNumber (Finset.range n)`, i.e., the max size of a 3-AP-free subset of `{0, ..., n-1}`. + +### FormalConjecturesForMathlib (`Combinatorics/AP/Basic.lean`) +- **`Set.IsAPOfLengthFree.maxCard k N`**: The supremum of card `S` over subsets `S ⊆ Finset.Icc 1 N` with `(S : Set ℕ).IsAPOfLengthFree k`. This is precisely the `r_k(N)` function used in Problems 139 and 142, and `maxCard 3 N` should equal `r3 N` (Problem 140's definition). + +**Recommendation:** Replace the custom `IsThreeAPFree` and `r3` with either: +- `Set.IsAPOfLengthFree.maxCard 3 N` (matching Problems 139/142 and using `{1,...,N}` convention), or +- Mathlib's `rothNumberNat` (with a noted off-by-one: `{0,...,N-1}` vs `{1,...,N}`; these give the same value by translation invariance, but the convention mismatch could be confusing). + +The first option is strongly preferred for consistency with the rest of the Erdős problems in this repository. + +## 2. Citations + +The website (erdosproblems.com/140) lists: +- **[ErGr80, p.11]** — Erdős and Graham, 1980 +- **[Er81]** — Erdős, 1981 +- **[Er97c]** — Erdős, 1997c +- **[KeMe23]** — Kelley and Meka, 2023 + +The formalization's docstring includes: +- `[ErGr80]` — matches, but the website specifies **p.11** which is not reflected. +- `[Er81]` — matches. +- `[Er97c]` — matches, though the docstring says "Erdős, P. (1997)" without a title; the website likewise has no title. +- `[KeMe23]` — matches. + +**Minor issue:** The docstring provides fuller bibliographic information (titles for ErGr80 and KeMe23) which is good, but it omits the page reference "p.11" for ErGr80. The website also notes the problem appeared in the field of additive combinatorics and references OEIS A003002. + +## 3. Variants + +The website mentions that "the original sources (ErGr80, Er81) conjecture this result generalizes to k-term arithmetic progressions for all k" and links to Problem 3 for related context. + +**The current formalization captures only the k=3 case.** The general k-AP version — that `r_k(N) ≪ N / (log N)^C` for every C > 0 and every fixed k ≥ 3 — is a natural variant that is NOT included. However, this generalization remains open for k ≥ 5, so it is reasonable to omit it or mark it as a separate open problem. + +Note that Problem 142 already captures the question of finding asymptotic formulas for `r_k(N)` in general, and the variant `erdos_142.variants.lower` states `r_k(N) = o(N / log N)`. Problem 140 for k=3 is a strictly stronger bound than what Problem 142's lower variant gives for k=3. + +**No variant theorem is provided.** A useful variant would be the stronger Kelley-Meka bound: there exists an absolute constant `c > 0` such that `r_3(N) ≤ N · exp(-c · (log N)^{1/12})`, which is what they actually proved (and which implies the stated bound). + +## 4. Readability + +The code is clean and well-documented. Minor suggestions: + +- The docstring clearly states the mathematical content with LaTeX. +- The `IsThreeAPFree` definition has a helpful docstring explaining the trivial/non-trivial distinction. +- **Suggestion:** If `r3` were replaced by `Set.IsAPOfLengthFree.maxCard 3`, the file would be shorter and immediately recognizable to someone familiar with Problems 139/142. +- The use of `sSup` in the definition of `r3` is mathematically correct but somewhat unusual; `maxCard` uses the same approach, so consistency would be improved by reusing it. + +## 5. Formalizability + +**The problem is precisely stated and clearly formalizable.** The statement "r₃(N) ≪ N/(log N)^C for every C > 0" has a standard and unambiguous meaning in combinatorics: for each C > 0, there exist constants K > 0 and N₀ such that r₃(N) ≤ K · N / (log N)^C for all N ≥ N₀. + +The formalization captures this correctly using Lean's `∀ᶠ N : ℕ in atTop` (eventually for large N) and an explicit constant K. + +**Ambiguity assessment: Very low.** The only potential ambiguity is: +- Whether "log" means natural log or log base 2 — this doesn't matter since changing the base only changes the constant K. +- Whether {1,...,N} vs {0,...,N-1} matters — it doesn't, since the two quantities differ by at most 1. + +## 6. Correctness + +### Mathematical correctness: **Correct with one subtle point.** + +The formalization states: +``` +∀ C : ℝ, 0 < C → +∃ K : ℝ, 0 < K ∧ +∀ᶠ N : ℕ in atTop, + (r3 N : ℝ) ≤ K * (N : ℝ) / (Real.log (N : ℝ)) ^ C +``` + +This correctly captures the Vinogradov notation `r₃(N) ≪_C N / (log N)^C`. + +**Subtle point about `r3` definition:** The definition uses `sSup` over a set of natural numbers. For this to be well-defined (finite), one needs the set to be bounded above, which it is (by N). However, `sSup` on `ℕ` with `ConditionallyCompleteLattice` returns 0 for the empty set. When N = 0, the set `{1,...,0}` is empty, so `r3 0 = 0`, which is fine. The definition is correct. + +**The `IsThreeAPFree` predicate:** Defined as `∀ a ∈ S, ∀ b ∈ S, ∀ c ∈ S, a + c = 2 * b → a = b`. This is equivalent to Mathlib's `ThreeAPFree` which uses `a + c = b + b`. The condition `a = b` forces `a = b = c` (since `a + c = 2a` implies `c = a` in ℕ). This correctly excludes trivial progressions and is the standard definition. + +**Overall assessment:** The formalization is mathematically correct and complete. The theorem as stated is exactly what Kelley and Meka proved (indeed they proved something stronger). No flaws identified. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `r3` and `IsThreeAPFree` should use `Set.IsAPOfLengthFree.maxCard 3` or Mathlib's `ThreeAPFree`/`rothNumberNat` for consistency with Problems 139/142 | +| Citations | Minor: missing "p.11" page reference for [ErGr80] | +| Variants | Missing: general k-AP version (open for k≥5), stronger Kelley-Meka exponential bound | +| Readability | Good; would improve with reuse of existing definitions | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/144.md b/ai-review/144.md new file mode 100644 index 0000000000..a07b52d510 --- /dev/null +++ b/ai-review/144.md @@ -0,0 +1,90 @@ +# Review: Erdős Problem 144 + +## 1. Code Reuse + +**`Set.HasDensity` from `FormalConjecturesForMathlib/Data/Set/Density.lean`** — The codebase has a well-developed natural density infrastructure. `Set.HasDensity S α` is defined as `Tendsto (fun b => S.partialDensity A b) atTop (𝓝 α)`, which is exactly the concept used in `erdos_144`. The current formalization hand-rolls the density computation via `Finset.range`/`filter`/`card`/division. This could be replaced with: + +```lean +{n : ℕ | HasCloseConsecutiveDivisors n}.HasDensity 1 +``` + +This would be more idiomatic and would immediately connect to the existing lemmas (`HasDensity.mono`, `HasDensity.nonneg`, `HasDensity.univ`, etc.). There is a minor index-shift consideration (`n+1` in the current formulation vs. `n` directly in the set), but this is easily handled. + +**Problem 449 (`closeDivisorPairs`)** — Erdős Problem 449 defines `closeDivisorPairs` which *counts* pairs `(d₁, d₂)` of divisors with `d₁ < d₂ < 2 * d₁`. Problem 144's `HasCloseConsecutiveDivisors` is the existential version of the same predicate. These are mathematically related (Problem 449 is listed as a related problem on erdosproblems.com). A shared definition or at least a cross-reference in the docstring would be beneficial. + +**Problem 122 (`HasNaturalDensityZero`)** — Defines its own `HasNaturalDensityZero` using the same `Tendsto (fun N => card(filter ...)/N) atTop (nhds 0)` pattern. This further motivates consolidation with `Set.HasDensity`. + +## 2. Citations + +The formalization lists: `[Er61, Er77c, Er79, Er79e, ErGr80, Er81h, Er82e, Er85e, Er97c, Er98]` and `[MaTe84]`. + +**Missing from the website but not critical:** +- **[Er64h]** — Erdős claimed in this paper that integers with divisors satisfying `d₁ < d₂ < d₁(1 + (log n)^{-β})` have density 1 if `β < log 3 − 1`. This claim was later **retracted** in [ErHa79]. +- **[ErHa79]** — Erdős and Hall. Contains the retraction of the above claim, and proves the complementary result that the set has density 0 if `β > log 3 − 1`. +- **[Gu04]** — Guy's collection, listed on the website. + +**Related problems:** The website lists Problems **449** and **884** as related. These cross-references are not mentioned in the docstring. + +**Recommendation:** Add `[ErHa79]` and note the related problems 449 and 884 in the docstring. + +## 3. Variants + +The formalization captures only the basic statement. The website describes a **stronger generalization**: + +> Maier and Tenenbaum proved a stronger result where 2 is replaced by any constant `c > 1`. + +That is, for any `c > 1`, the density of integers having two divisors `d₁ < d₂ < c · d₁` is 1. This is not captured and would be a natural generalization: + +```lean +theorem erdos_144_generalized (c : ℝ) (hc : 1 < c) : + {n : ℕ | ∃ d₁ d₂ : ℕ, d₁ ∣ n ∧ d₂ ∣ n ∧ d₁ < d₂ ∧ (d₂ : ℝ) < c * d₁}.HasDensity 1 +``` + +There is also the **fine-grained variant** involving `d₁ < d₂ < d₁(1 + (log n)^{-β})`: +- Density 1 if `β < log 3 − 1` (proved by Maier-Tenenbaum). +- Density 0 if `β > log 3 − 1` (proved by Erdős-Hall). + +This phase transition at `β = log 3 − 1` is a significant aspect of the problem not currently captured. + +## 4. Readability + +**Definition name:** `HasCloseConsecutiveDivisors` is slightly misleading. The word "Consecutive" suggests that `d₁` and `d₂` must be adjacent in the ordered list of divisors of `n`, but the definition only requires them to be *any* two divisors satisfying `d₁ < d₂ < 2d₁`. A more accurate name would be `HasCloseDivisorPair` or `HasCloselySpacedDivisors`. + +**Theorem statement:** The `Finset.range N` with `n + 1` shift is a standard technique to avoid `0`, but it makes the statement slightly harder to parse. Using `Finset.Icc 1 N` (as Problem 449 does) or `Set.HasDensity` would improve clarity. + +**Overall:** The code is concise and the docstring is well-written, clearly explaining the notation `A(N)` and the limiting behavior. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement "the density of integers which have two divisors `d₁ < d₂ < 2d₁` exists and is equal to 1" is precise. The notions of "divisor," "density," and the inequality constraint are all standard and have unique mathematical interpretations. There is no ambiguity in the basic statement. + +The only source of mild ambiguity is whether "density" means natural (asymptotic) density, upper density, lower density, or logarithmic density. In the context of Erdős problems from this era, "density" without qualification means natural (asymptotic) density, which is what the formalization uses. Since the density is 1, all reasonable notions of density coincide anyway. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`HasCloseConsecutiveDivisors n`**: Correctly encodes `∃ d₁ d₂, d₁ ∣ n ∧ d₂ ∣ n ∧ d₁ < d₂ ∧ d₂ < 2 * d₁`. The implicit positivity of `d₁` is handled by the constraint `d₂ < 2 * d₁`: if `d₁ = 0` then `2 * d₁ = 0` and `d₂ < 0` is impossible for `ℕ`. So both divisors are necessarily positive. + +- **Density computation**: `(Finset.range N).filter (fun n => HasCloseConsecutiveDivisors (n + 1))` counts elements of `{0, 1, ..., N-1}` for which `n+1 ∈ {1, 2, ..., N}` has the property. The cardinality is then divided by `N` and the limit is taken. This is the standard formulation of natural density for a subset of positive integers. Correct. + +- **Limit target**: `𝓝 (1 : ℝ)` correctly states the density equals 1. + +- **No off-by-one issues**: The set `{1, ..., N}` has `N` elements, and dividing by `N` gives the correct density formula `A(N)/N`. + +**No mathematical flaws identified.** The formalization faithfully represents the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `Set.HasDensity 1` from `FormalConjecturesForMathlib`; shared structure with Problem 449 | +| Citations | Missing `[ErHa79]`; should cross-reference Problems 449 and 884 | +| Variants | Missing: generalization to arbitrary `c > 1`; phase transition at `β = log 3 − 1` | +| Readability | "Consecutive" in definition name is misleading; consider `HasCloseDivisorPair` | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Correct and complete for the basic statement | diff --git a/ai-review/146.md b/ai-review/146.md new file mode 100644 index 0000000000..30aaccd913 --- /dev/null +++ b/ai-review/146.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 146 + +## 1. Code Reuse + +**Significant code duplication exists.** Problems 113, 146, and 147 all independently define `ContainsSubgraph` and `turanNumber` with identical implementations. Problem 113 additionally defines `IsTwoDegenerateGraph`, which is a special case of 146's `IsRDegenerateGraph` (with `r = 2`). These should be factored into a shared utility file. + +More critically, **Mathlib already provides superior alternatives** for several of these definitions: + +- **`SimpleGraph.IsContained` (notation `G ⊑ H`)** in `Mathlib.Combinatorics.SimpleGraph.Copy` is semantically equivalent to `ContainsSubgraph` (injective graph homomorphism). The custom `ContainsSubgraph` is redundant. +- **`SimpleGraph.Free`** in the same file is `¬ IsContained`, matching `¬ ContainsSubgraph`. +- **`SimpleGraph.extremalNumber`** in `Mathlib.Combinatorics.SimpleGraph.Extremal.Basic` is the standard Turán number `ex(n; H)`. It is defined as the sup over `H`-free graphs on `Fin n`, which is mathematically equivalent to the custom `turanNumber` but benefits from an established API (`extremalNumber_le_iff`, `lt_extremalNumber_iff`, monotonicity under containment, etc.). + +The custom `turanNumber` uses `sSup` over an existentially-quantified set ranging over all types `V`, which is mathematically valid but harder to work with in practice than Mathlib's concrete `Fin n`-based definition. The Mathlib version is preferred. + +`IsRDegenerateGraph` has no Mathlib counterpart and would need to remain as a custom definition, but should be shared across problems 113, 146, and 147. + +**Recommendation:** Replace `ContainsSubgraph` and `turanNumber` with `SimpleGraph.IsContained`/`SimpleGraph.Free` and `SimpleGraph.extremalNumber` from Mathlib. Factor `IsRDegenerateGraph` into a shared file. + +## 2. Citations + +The formalization cites: +- **[ErSi84]** Erdős, P. and Simonovits, M., *Cube-supersaturated graphs and related problems*, Progress in graph theory (Waterloo, Ont., 1982), Academic Press, Toronto, ON, 1984, 203-218. +- **[AKS03]** Alon, N., Krivelevich, M., and Sudakov, B., *Turán numbers of bipartite graphs and related Ramsey-type questions*, Combinatorics, Probability and Computing 12 (2003), no. 5-6, 477-494. + +The website (erdosproblems.com/146) lists the following references: +- [ErSi84] — **matches** the formalization. +- [AKS03] — **matches** the formalization. +- [Er91], [Er93], [Er97c] — additional Erdős references **not included** in the formalization. These are supplementary and not strictly required, but could be mentioned for completeness. + +The website also notes this problem is **related to problems #113 and #147**, which is not mentioned in the formalization's docstring. Adding cross-references would improve navigability. + +**Status:** The formalization correctly marks this as `category research open`. The website confirms: "OPEN — Cannot be resolved with finite computation. Reward: $500." + +## 3. Variants + +The website and references mention several aspects: + +1. **The case r = 2:** The docstring correctly notes this is open even for r = 2. This specific case is closely related to Problem 113 (the Erdős-Simonovits conjecture about 2-degenerate bipartite graphs), which was disproved in the "if and only if" formulation but leaves the forward direction (2-degenerate → ex(n;H) = O(n^{3/2})) still open — which is exactly the r = 2 case of Problem 146. + +2. **The [AKS03] weaker bound:** The docstring mentions the weaker bound ex(n;H) ≪ n^{2 - 1/(4r)} proved by Alon-Krivelevich-Sudakov. The formalization does not capture this as a separate theorem, which is reasonable since it is a known result rather than a conjecture. + +3. **Maximum degree variant:** The website notes that [AKS03] proved the full conjectured bound when the maximum degree on one side of the bipartition is r. This variant is **not captured** in the formalization. It could be formalized as a separate (proved) theorem. + +4. **Relationship to Problem 147:** Problem 147 asks about a lower bound (whether ex(n;H) ≫ n^{2-1/(r-1)+ε} for bipartite H with minimum degree r). This is the "converse direction" question. Not a variant per se, but worth cross-referencing. + +**Assessment:** The core conjecture is captured. The AKS03 partial result (max degree on one side) is a natural variant that could be added. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- **Good:** Clear docstrings on all definitions with both formal and informal descriptions. +- **Good:** The equivalence between "r-degenerate" and "every induced subgraph has minimum degree ≤ r" is noted in the docstring for `IsRDegenerateGraph`. +- **Good:** The main theorem statement is well-annotated with the conjecture name and reference. +- **Minor:** The `haveI := fv; haveI := dr;` pattern in `turanNumber` is a Lean idiom but somewhat opaque to newcomers. This is standard practice however. +- **Minor:** The bound `(2 : ℝ) - 1 / (r : ℝ)` is clear, though parenthesizing as `(2 : ℝ) - (1 : ℝ) / (r : ℝ)` might be marginally more explicit about precedence. + +**Assessment:** Readability is good. No major issues. + +## 5. Formalizability + +The problem statement on the website is: + +> If H is bipartite and is r-degenerate (every induced subgraph has minimum degree ≤ r), then ex(n; H) ≪ n^{2−1/r}. + +This is **precise and unambiguous**. All key concepts have standard mathematical definitions: +- "Bipartite" is well-defined. +- "r-degenerate" is well-defined (every subgraph has a vertex of degree ≤ r, equivalently every nonempty subset contains such a vertex). +- "ex(n; H)" is the standard extremal number. +- The asymptotic bound "≪" means O(·) with respect to n, with r and H fixed. + +The formalization correctly interprets the asymptotic statement as: there exists C > 0 such that ex(n; H) ≤ C · n^{2−1/r} for all n ≥ 1. + +**One subtle point:** The conjecture quantifies over all r-degenerate bipartite graphs H. The constant C in the bound may depend on H (and hence on r). The formalization correctly places the ∃ C after the ∀ over H, allowing C to depend on H. + +**Assessment:** Fully formalizable with no ambiguity. Score: 10/10. + +## 6. Correctness + +The formalization is **mathematically correct** with one minor observation: + +**Correct aspects:** +- The bipartiteness condition `Nonempty (H.Coloring (Fin 2))` correctly captures 2-colorability, which is equivalent to bipartiteness. +- The r-degeneracy definition using `∀ S, S.Finite → S.Nonempty → ∃ v ∈ S, (G.neighborSet v ∩ S).ncard ≤ r` is correct. For finite graphs (which H is, by the `[Fintype U]` instance), this is equivalent to the standard definition. +- The constraint `1 ≤ r` is appropriate — a 0-degenerate graph has no edges, making the conjecture trivially true but degenerate. +- The bound `C * n ^ (2 - 1/r)` with `C > 0` correctly captures the big-O statement. +- The quantifier order `∀ r, ∀ H, ... ∃ C, ∀ n, ...` is correct: C may depend on both r and H. + +**Edge case:** When `r = 1`, the bound becomes `C * n^1 = O(n)`, which is correct — 1-degenerate bipartite graphs are forests, and ex(n; T) = O(n) for any tree T (in fact ex(n; T) ≤ (|T| - 1)(n - 1)/2 by the Erdős-Gallai theorem, which is O(n) for fixed T). + +**Potential concern with `turanNumber` well-definedness:** The definition uses `sSup` over a set of natural numbers. If H has at most n vertices, this set is nonempty and bounded (by n choose 2), so the `sSup` is well-defined. If H has more vertices than n, the set includes 0 (the empty graph has 0 edges and no copy of H), so it is also well-defined. However, the `sSup` of a bounded nonempty set of ℕ using the `ConditionallyCompleteLattice` instance on ℕ works correctly, but the `sSup` on `ℕ` via `WithBot`/`WithTop` can have subtle behaviors when the set is empty. This is another reason to prefer Mathlib's `extremalNumber` which avoids this issue by using `Finset.sup`. + +**Assessment:** Mathematically correct and complete. The formalization faithfully captures the conjecture as stated. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Significant opportunity.** `ContainsSubgraph` and `turanNumber` should be replaced by Mathlib's `IsContained`/`Free` and `extremalNumber`. `IsRDegenerateGraph` should be shared across problems 113, 146, 147. | +| Citations | **Good.** Main references match the website. Missing [Er91], [Er93], [Er97c] (minor). Missing cross-references to problems #113 and #147. | +| Variants | **Mostly complete.** Core conjecture captured. The AKS03 result for max-degree-on-one-side variant is not formalized. | +| Readability | **Good.** Clear docstrings, well-structured code. | +| Formalizability | **Excellent.** Statement is unambiguous and precisely formalizable. | +| Correctness | **Correct.** Faithful formalization with appropriate quantifier structure and edge case handling. Minor concern about `sSup` on ℕ vs Mathlib's `Finset.sup`. | diff --git a/ai-review/147.md b/ai-review/147.md new file mode 100644 index 0000000000..d1608869f5 --- /dev/null +++ b/ai-review/147.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 147 + +## 1. Code Reuse + +**Significant code duplication exists.** The definitions `ContainsSubgraph` and `turanNumber` in this file are identical (up to namespace) to those in Problems 113, 146, 159, and 180. These should be factored into a shared utility file. + +More importantly, **Mathlib already provides superior alternatives**: + +- **`SimpleGraph.IsContained` (notation `G ⊑ H`)** in `Mathlib.Combinatorics.SimpleGraph.Copy` is semantically equivalent to the custom `ContainsSubgraph` (injective graph homomorphism preserving adjacency). The custom definition is redundant. +- **`SimpleGraph.extremalNumber`** in `Mathlib.Combinatorics.SimpleGraph.Extremal.Basic` is the standard Turán number `ex(n; H)`, defined concretely over `Fin n` with an established API (`extremalNumber_le_iff`, monotonicity, etc.). This is preferred over the custom `turanNumber`, which uses `sSup` over an existentially-quantified set ranging over all `Type`s—mathematically valid but harder to work with. + +The bipartiteness check `Nonempty (H.Coloring (Fin 2))` and the minimum degree condition `∀ v, r ≤ H.degree v` are standard and appropriate. Mathlib provides `SimpleGraph.minDegree` which could be used instead of the inline universal quantification, though the current formulation is equivalent and arguably more explicit. + +**Recommendation:** Replace `ContainsSubgraph` and `turanNumber` with Mathlib's `IsContained`/`Free` and `extremalNumber`. Factor shared graph-theoretic definitions into a common utility file used by Problems 113, 146, 147, 159, and 180. + +## 2. Citations + +The formalization cites: +- **[ErSi84]** Erdős, P. and Simonovits, M., _Cube-supersaturated graphs and related problems_, Progress in graph theory (1984). — **Matches** the website but is **incomplete**: the website gives the full bibliographic entry as "Progress in graph theory (Waterloo, Ont., 1982), Academic Press, Toronto, ON, 1984, 203–218." The formalization omits location, publisher, and page numbers. +- **[Ja23]** Janzer, O., _Disproof of a conjecture of Erdős and Simonovits on the Turán number_, (2023). — **Matches** the website. +- **[Ja23b]** Janzer, O., _Disproof of a conjecture of Erdős and Simonovits on the Turán number (the case r = 3)_, (2023). — **Matches** the website. + +**Missing references from the website:** +- **[Er93]** and **[Er97c]** — additional Erdős references listed on the website but not included in the formalization. These are supplementary and not strictly required, but mentioning them would improve completeness. + +**Missing cross-references:** The website lists related problems **#113, #146, and #714**. The formalization does not mention these. Problems 113 and 146 are closely related (same [ErSi84] origin, shared definitions, overlapping Janzer disproof results), and cross-references would improve navigability. + +**Status:** The formalization correctly marks this as `category research solved` with `answer(False)`. The website confirms: "DISPROVED. Reward: $500." + +## 3. Variants + +The website and references describe several aspects not fully captured: + +1. **The probabilistic lower bound:** The website notes that a probabilistic argument establishes ex(n; H) ≫ n^{2−2/r+ε} for some ε > 0 (note the different exponent: 2−2/r, not 2−1/(r−1)). This known result is **not mentioned** in the docstring or formalized. It provides important context: the conjecture asked whether the exponent could be improved from 2−2/r to 2−1/(r−1), and the disproof shows it cannot. + +2. **Janzer's conjecture:** The website states that Janzer conjectured: for any r ≥ 3 and ε > 0, there exists an r-regular bipartite graph H with ex(n; H) ≪ n^{2−2/r+ε}. This was proved for even r ≥ 4. This follow-up conjecture is **not captured** in the formalization and would be a natural companion theorem (partially proved, partially open). + +3. **The case r = 3 specifics:** The docstring correctly notes the r = 3 case from [Ja23b], including the bound ex(n; H) ≪ n^{4/3+δ}. This is well-captured. + +4. **Relationship to Problem 146:** Problem 146 asks about upper bounds on ex(n; H) for r-degenerate bipartite graphs, while Problem 147 asks about lower bounds for bipartite graphs with minimum degree r. These are complementary questions about the Turán number, and a cross-reference would help readers understand the landscape. + +**Assessment:** The core disproved conjecture is captured. The probabilistic lower bound and Janzer's follow-up conjecture are missing but would enrich the formalization. + +## 4. Readability + +The code is well-structured and readable: + +- **Good:** Clear docstrings with both the original conjecture statement and its disproof status. +- **Good:** The LaTeX rendering of the bound is clear and matches standard notation. +- **Good:** The `answer(False)` pattern immediately signals the problem has been resolved negatively. +- **Minor:** The `haveI := fv; haveI := dr;` idiom in `turanNumber` is standard Lean but somewhat opaque to newcomers. Acceptable. +- **Minor:** The exponent `(2 : ℝ) - 1 / ((r : ℝ) - 1) + ε` could benefit from explicit parenthesization as `(2 : ℝ) - (1 / ((r : ℝ) - 1)) + ε` to make operator precedence immediately clear, though the current form is correct by Lean's precedence rules. +- **Minor:** The docstring uses `\gg` (Vinogradov notation for lower bound) but the formal statement uses `≤` in the other direction (`C * n^... ≤ ex(n;H)`), which is correct and standard. + +**Assessment:** Readability is good. No major issues. + +## 5. Formalizability + +The problem statement on the website is: + +> If H is bipartite with minimum degree r, then there exists ε = ε(H) > 0 such that ex(n; H) ≫ n^{2−1/(r−1)+ε}. + +This is **precise and unambiguous**: +- "Bipartite" is well-defined (2-colorable). +- "Minimum degree r" is well-defined (every vertex has degree ≥ r). +- "ex(n; H)" is the standard extremal/Turán number. +- "≫" in this context means Ω(·): there exist C > 0 and N₀ such that the bound holds for n ≥ N₀. + +**One subtlety worth noting:** The original conjecture says "minimum degree r", suggesting r is the exact minimum degree of H. The formalization uses `∀ r ≥ 2, ∀ H` with `∀ v, r ≤ H.degree v`, treating r as a lower bound parameter. These are equivalent: if the conjecture holds for each H with its exact minimum degree d, then for any r ≤ d the bound with exponent 2−1/(r−1) is weaker (since 1/(r−1) ≥ 1/(d−1)), so it holds a fortiori. Conversely, taking r = min_deg(H) recovers the original. + +**Assessment:** Fully formalizable with no ambiguity. Score: 10/10. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Correct aspects:** +- The `answer(False) ↔ P` pattern correctly encodes "the conjecture P is false" (since `False ↔ P` is equivalent to `¬P`). +- The bipartiteness condition `Nonempty (H.Coloring (Fin 2))` correctly captures 2-colorability ↔ bipartiteness. +- The minimum degree condition `∀ v : U, r ≤ H.degree v` is correct for "H has minimum degree at least r". +- The constraint `2 ≤ r` is appropriate: for r = 1, the exponent 2−1/(r−1) = 2−1/0 is undefined, and for r = 0 or r = 1 the conjecture is degenerate. +- The quantifier structure `∀ r ≥ 2, ∀ H, ... ∃ ε > 0, ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, ...` correctly captures the asymptotic lower bound with constants depending on H. +- The direction of the inequality `C * n^{...} ≤ ex(n; H)` correctly formalizes the `≫` (lower bound) notation. + +**Verification of the disproof:** For Janzer's r = 3 counterexample: H is 3-regular bipartite with ex(n; H) ≪ n^{4/3+δ} for any δ > 0. The conjecture would require ex(n; H) ≥ C · n^{3/2+ε} for some ε > 0 and large n. Since 4/3 + δ < 3/2 + ε for sufficiently small δ, the upper bound n^{4/3+δ} eventually falls below C · n^{3/2+ε}, contradicting the conjecture. The negation `¬P` (i.e., `answer(False)`) is correct. + +**Potential concern with `turanNumber` well-definedness:** The `sSup` over the set of achievable edge counts is always well-defined: the set is nonempty (the edgeless graph on `Fin n` witnesses `0 ∈ S`) and bounded above (by `n choose 2`). However, the definition quantifies `∃ (V : Type)` over all types in `Type 0`, which is mathematically valid but universe-sensitive. Mathlib's `extremalNumber` avoids this by using the concrete type `Fin n`. + +**No correctness issues found.** The formalization faithfully and correctly captures the disproved conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Significant opportunity.** `ContainsSubgraph` and `turanNumber` are duplicated across 5+ files and should be replaced by Mathlib's `IsContained`/`Free` and `extremalNumber`. | +| Citations | **Mostly good.** Main references match the website. [ErSi84] is missing full bibliographic details (publisher, pages). Missing [Er93], [Er97c]. Missing cross-references to problems #113, #146, #714. | +| Variants | **Partially complete.** Core disproved conjecture is captured. Missing: the probabilistic lower bound (2−2/r exponent), Janzer's follow-up conjecture for r-regular graphs. | +| Readability | **Good.** Clear docstrings, well-structured code, appropriate LaTeX. Minor parenthesization suggestion for the exponent. | +| Formalizability | **Excellent.** Statement is unambiguous and precisely formalizable. The r-as-lower-bound formulation is equivalent to the original. | +| Correctness | **Correct.** Faithful formalization with appropriate quantifier structure. The `answer(False)` correctly encodes the disproved status. No mathematical errors. | diff --git a/ai-review/148.md b/ai-review/148.md new file mode 100644 index 0000000000..aa1bdd08fa --- /dev/null +++ b/ai-review/148.md @@ -0,0 +1,136 @@ +# Review: Erdős Problem 148 + +## 1. Code Reuse + +Several related files in the codebase work with unit fraction sums: + +- **Erdős 206** (`ErdosProblems/206.lean:38-39`): Defines `unitFracSum (S : Finset ℕ) : ℝ := ∑ m ∈ S, (1 : ℝ) / (m : ℝ)` — a helper for the sum of unit fractions over a finset. However, it operates over `ℝ` while Problem 148 uses `ℚ`. The inline expression `∑ n ∈ S, (1 : ℚ) / (n : ℚ)` is simple enough that a shared abstraction is not clearly beneficial, though one could consider a shared definition parameterized by the field. + +- **Erdős 45** (`ErdosProblems/45.lean:58`) and **Erdős 46** (`ErdosProblems/46.lean:47`): Both use the identical expression `(∑ n ∈ S, (1 : ℚ) / (n : ℚ)) = 1` for unit fractions summing to 1. A shared predicate `IsEgyptianDecomp (S : Finset ℕ) : Prop` or similar could unify Problems 45, 46, and 148, but the expression is short and the problems live in separate namespaces, so the duplication is tolerable. + +**Verdict**: No strong code reuse opportunity. The current self-contained approach is reasonable. + +## 2. Citations + +The formalization includes three citations: + +| Citation | Formalization | Website | +|----------|--------------|---------| +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique (1980). | Listed as original source [ErGr80, p. 32]. **Match.** | +| [Ko14] | Konyagin, S., *On the number of representations of an integer as a sum of distinct unit fractions*, 2014. | Listed as source of lower bound. **Match.** | +| [ElPl21] | Elsholtz, C. and Planitzer, S., *The number of solutions of the Erdős–Straus equation and sums of $k$ unit fractions*, Proc. R. Soc. Edinb. A Math. (2021). | Listed as source of upper bound. **Match.** | + +**Missing from formalization**: The website lists related OEIS sequences **A076393** and **A006585**. These could be mentioned in the module docstring for completeness but are not essential. + +**Verdict**: Citations are accurate and complete. Minor enhancement: add OEIS references. + +## 3. Variants + +The formalization captures three statements: + +1. **`erdos_148.variants.konyagin_lower_bound`** — The Konyagin lower bound (solved). +2. **`erdos_148.variants.elsholtz_planitzer_upper_bound`** — The Elsholtz–Planitzer upper bound (solved). +3. **`erdos_148`** — The main open conjecture that $F(k)$ is exponential in $2^k$. + +The original problem is "find good estimates for $F(k)$," which is inherently open-ended. The formalization handles this by: +- Encoding the two best-known bounds as solved variants. +- Formulating a specific conjecture (double-exponential growth $c_1^{2^k} \le F(k) \le c_2^{2^k}$) as the main open problem. + +**Verdict**: The variants are well-chosen and comprehensive. No obvious missing variants from the website. + +## 4. Readability + +The code is clean and well-structured: + +- The `egyptianFractionCount` definition has a clear docstring. +- Each theorem has a self-contained docstring explaining the mathematical content. +- The namespace `Erdos148` is appropriately scoped. +- The `open BigOperators Real Filter` is appropriate for the notation used. + +**Minor suggestion**: The docstring for `erdos_148` says "there exist constants $1 < c_1 \le c_2$" but the Lean code only requires `1 < c₁ ∧ 1 < c₂`, without asserting `c₁ ≤ c₂`. This is a harmless discrepancy (the statement with `c₁ ≤ c₂` is equivalent in strength), but the docstring could be updated for precise alignment. + +**Verdict**: Highly readable. One minor docstring/code discrepancy. + +## 5. Formalizability + +The original problem statement — "find good estimates for $F(k)$" — is **deliberately vague** and is not directly formalizable as a single theorem. This is a common pattern for Erdős problems that ask for asymptotic estimates. + +The formalization addresses this in a principled way: +- The known bounds are stated precisely as solved variants. +- A specific conjecture is proposed for the open part: that $F(k)$ grows as $c^{2^k}$ for constants $c > 1$. + +The definition of $F(k)$ itself is completely precise and unambiguously formalizable. The bounds involve standard asymptotic constructs (`∀ᶠ k in atTop`, existential quantification over constants, $\forall \varepsilon > 0$ for $o(1)$ terms) that are well-handled in Lean/Mathlib. + +**Assessment of ambiguity**: The only ambiguity is in "find good estimates," which the formalization reasonably interprets as "determine the correct order of double-exponential growth." This is a defensible choice but is the authors' own conjecture — it does not appear to be explicitly stated in the cited references. The docstring is transparent about this: "This conjecture asserts that the correct order of magnitude is exponential in $2^k$." + +**Verdict**: The vague parts of the problem are handled well. The precise parts are unambiguously formalizable. + +## 6. Correctness + +### Definition: `egyptianFractionCount` + +```lean +noncomputable def egyptianFractionCount (k : ℕ) : ℕ := + Set.ncard {S : Finset ℕ | S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = 1} +``` + +This correctly counts the number of $k$-element subsets of positive integers whose unit fractions sum to 1. Key observations: + +- Using `Finset ℕ` inherently enforces distinctness (elements of a `Finset` are distinct). +- The positivity constraint `∀ n ∈ S, 0 < n` correctly excludes 0 (which would make `1/n` undefined or zero in the rational formalization). +- The sum uses `ℚ` which avoids floating-point or real-number precision issues — this is the correct choice for an exact equality. +- `Set.ncard` returns 0 for infinite sets, but for any fixed $k$, the set of valid finsets is finite (the denominators are bounded: the smallest must be $\le k$ and the rest are inductively bounded), so `Set.ncard` gives the correct value. + +**Correct.** ✓ + +### Konyagin Lower Bound + +```lean +∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + (2 : ℝ) ^ (c ^ ((k : ℝ) / Real.log k)) ≤ (egyptianFractionCount k : ℝ) +``` + +Encodes $F(k) \ge 2^{c^{k/\log k}}$ for some $c > 0$ and all sufficiently large $k$. This matches the website statement. Note: `Real.log` is the natural logarithm, consistent with standard number-theoretic usage of $\log$. + +**Correct.** ✓ + +### Elsholtz–Planitzer Upper Bound + +```lean +∃ c₀ : ℝ, 1 < c₀ ∧ ∀ ε : ℝ, 0 < ε → ∀ᶠ k : ℕ in atTop, + (egyptianFractionCount k : ℝ) ≤ c₀ ^ ((1 / 5 + ε) * (2 : ℝ) ^ (k : ℕ)) +``` + +Encodes $F(k) \le c_0^{(1/5 + \varepsilon) \cdot 2^k}$ for all $\varepsilon > 0$ and sufficiently large $k$ (depending on $\varepsilon$). The $o(1)$ in the original bound $c_0^{(1/5 + o(1)) \cdot 2^k}$ is correctly captured by the universal quantification over $\varepsilon > 0$. + +One note: the docstring says $c_0$ is the Vardi constant ($\approx 1.26408$), but the Lean statement only requires $c_0 > 1$ existentially. This is appropriate — pinning down the exact value of $c_0$ would require a separate definition and would overcomplicate the statement. The existential formulation is weaker but still captures the essential bound. + +**Correct.** ✓ + +### Main Conjecture + +```lean +∃ c₁ c₂ : ℝ, 1 < c₁ ∧ 1 < c₂ ∧ ∀ᶠ k : ℕ in atTop, + c₁ ^ ((2 : ℝ) ^ (k : ℕ)) ≤ (egyptianFractionCount k : ℝ) ∧ + (egyptianFractionCount k : ℝ) ≤ c₂ ^ ((2 : ℝ) ^ (k : ℕ)) +``` + +This is a well-formed conjecture asserting double-exponential growth. The upper bound portion is already essentially implied by the Elsholtz–Planitzer result (take $c_2 = c_0^{1/5+\varepsilon}$ for small $\varepsilon$). The substantive content is the lower bound: that $F(k) \ge c_1^{2^k}$ for some $c_1 > 1$, which would be a major strengthening of Konyagin's bound. + +**Correct as a conjecture.** ✓ — though it should be understood as the formalization authors' specific conjecture, not one explicitly stated in the cited literature. + +### Overall Mathematical Assessment + +The formalization is **mathematically correct and complete**. No experienced mathematician would identify obvious flaws. The one substantive choice — formulating the open-ended "find good estimates" as a specific double-exponential conjecture — is transparent, well-motivated by the existing bounds, and clearly documented. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No strong reuse opportunity; self-contained approach is fine | +| Citations | Accurate and complete; could add OEIS references | +| Variants | Comprehensive; all known bounds captured | +| Readability | Excellent; one minor docstring discrepancy (`c₁ ≤ c₂`) | +| Formalizability | Well-handled; vague "find good estimates" given a precise interpretation | +| Correctness | Correct and complete | diff --git a/ai-review/149.md b/ai-review/149.md new file mode 100644 index 0000000000..f4d6f16987 --- /dev/null +++ b/ai-review/149.md @@ -0,0 +1,123 @@ +# Review: Erdős Problem 149 + +**File:** `FormalConjectures/ErdosProblems/149.lean` + +## 1. Code Reuse + +The formalization defines two custom constructions: `IsStronglyIndepEdgeSet` and `strongChromaticIndex`. Neither leverages existing infrastructure from `FormalConjecturesForMathlib` or Mathlib. + +- **`strongChromaticIndex`** is essentially the chromatic number of $L(G)^2$ (the square of the line graph). Mathlib provides `SimpleGraph.chromaticNumber`, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` builds further tooling on top of it (notation `χ(G)`, `le_chromaticNumber_iff_colorable`, etc.). If the codebase had a `lineGraph` or `lineGraphSquared` construction, `strongChromaticIndex` could be defined as `chromaticNumber (lineGraphSquared G)` and immediately inherit all the chromatic number lemmas. Currently, no line graph construction exists in the codebase, so the self-contained definition is pragmatically justified. + +- **`IsStronglyIndepEdgeSet`** is defined but never referenced by the theorem statement `erdos_149`. It serves only as documentation. This is fine, but it could be marked with a `@[simp]`-free docstring comment to clarify it is auxiliary. + +- The pattern of quantifying over `(V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj]` and using `G.maxDegree` matches the approach in `Paper/ReedOmegaDeltaChi.lean` (`reed_omega_delta_chi_conjecture_for_finite_graphs`). This is consistent. + +**Recommendation:** No immediate refactoring is needed, but if a `lineGraph` definition is added to the codebase in the future, `strongChromaticIndex` should be refactored to use it. + +## 2. Citations + +The formalization cites: + +| Tag | In formalization | On erdosproblems.com | Assessment | +|---|---|---|---| +| `[ErNe85]` | "Erdős, P. and Nešetřil, J., proposed at a seminar in Prague (1985)." | Listed as the origin. | **Correct.** Matches the website's attribution. | +| Website link | `[erdosproblems.com/149](https://www.erdosproblems.com/149)` | N/A | **Correct.** | + +The website lists many additional references for partial results (Molloy & Reed 1997, Bruhn & Joos 2018, Bonamy–Perrett–Postle 2022, Hurley–de Joannis de Verclos–Kang 2022, etc.). These are not cited in the formalization, but since the formalization only states the main conjecture and not any partial results, their omission is appropriate. + +**No issues found.** + +## 3. Variants + +The formalization captures only the main conjecture. Several variants and related results could be considered: + +1. **Tight bound for odd Δ.** The precise Erdős–Nešetřil conjecture distinguishes by parity: + - Even $\Delta = 2k$: $\chi'_s(G) \leq 5k^2$ + - Odd $\Delta = 2k+1$: $\chi'_s(G) \leq 5k^2 + 4k + 1 = \frac{5\Delta^2 - 2\Delta + 1}{4}$ + + The formalization uses the uniform bound $\frac{5}{4}\Delta^2$, which for odd $\Delta$ is slightly weaker than the precise conjecture (by $k$ when $\Delta = 2k+1$). This matches the statement on erdosproblems.com, which also uses the simpler $\frac{5}{4}\Delta^2$. A variant with the tight odd-$\Delta$ bound would be more precise. + +2. **Best known upper bound.** The current best result is $\chi'_s(G) \leq 1.772\Delta^2$ (Hurley–de Joannis de Verclos–Kang, 2022). This could be stated as a separate (proved) theorem. + +3. **Clique number bound.** Cames van Batenburg–Kang–Pirot (2020) proved $\omega(L(G)^2) \leq \frac{5}{4}\Delta^2$ for triangle-free graphs, confirming the conjecture holds at the clique-number level for that class. + +4. **Special cases.** The conjecture is known for $\Delta \leq 3$ (Andersen 1992, Horák–Qing–Trotter 1993). These could be formalized as separate theorems. + +**Recommendation:** At minimum, consider adding the tight odd-$\Delta$ variant, as it is part of the precise original conjecture. + +## 4. Readability + +The code is clear and well-structured. + +- The module docstring gives a concise summary of the conjecture, cites the source, and notes the sharp example ($C_5$ blowup). This is good. +- The `IsStronglyIndepEdgeSet` docstring correctly explains the equivalence with independent sets in $L(G)^2$. +- The `strongChromaticIndex` docstring correctly describes it as the chromatic number of $L(G)^2$. +- The use of the `Erdos149` namespace keeps definitions scoped. +- The main theorem docstring includes the LaTeX formula and the sharpness example, which aids readability. + +**Minor suggestions:** +- The `IsStronglyIndepEdgeSet` definition is not used in the theorem statement. A brief note in its docstring (e.g., "See also `strongChromaticIndex`, which inlines this condition.") would help readers understand the relationship. +- The theorem name `erdos_149` follows the project's naming convention. + +**Overall: Very good readability.** + +## 5. Formalizability + +The problem as stated on erdosproblems.com is: + +> Let $G$ be a graph with maximum degree $\Delta$. Is $G$ the union of at most $\frac{5}{4}\Delta^2$ sets of strongly independent edges? + +This is a clean, unambiguous combinatorial statement. The key concepts (maximum degree, strongly independent edges, union/partition of edge sets) all have standard mathematical definitions that map directly to Lean constructs. + +The only potential ambiguity is whether "union" means a partition (each edge belongs to exactly one set) or a cover (each edge belongs to at least one set). For edge coloring, these are equivalent: a minimum cover can always be refined into a partition by assigning each edge to exactly one of its covering sets. The formalization uses a coloring function `c : G.edgeSet → Fin k`, which naturally produces a partition. This is the standard interpretation. + +**Ambiguity level: None.** The problem is precisely and unambiguously formalizable. + +## 6. Correctness + +### 6.1 `IsStronglyIndepEdgeSet` + +```lean +def IsStronglyIndepEdgeSet {V : Type*} (G : SimpleGraph V) + (S : Set (Sym2 V)) : Prop := + S ⊆ G.edgeSet ∧ + ∀ e₁ ∈ S, ∀ e₂ ∈ S, e₁ ≠ e₂ → + ∀ u ∈ e₁, ∀ v ∈ e₂, u ≠ v ∧ ¬G.Adj u v +``` + +This requires: (a) all elements of $S$ are edges of $G$, and (b) for any two distinct edges in $S$, every endpoint of one is distinct from and non-adjacent to every endpoint of the other. This correctly captures the notion of a strongly independent edge set (also called an induced matching). **Correct.** + +### 6.2 `strongChromaticIndex` + +```lean +noncomputable def strongChromaticIndex {V : Type*} (G : SimpleGraph V) : ℕ := + sInf {k : ℕ | ∃ (c : G.edgeSet → Fin k), + ∀ (e₁ e₂ : G.edgeSet), c e₁ = c e₂ → e₁ ≠ e₂ → + ∀ u ∈ (e₁ : Sym2 V), ∀ v ∈ (e₂ : Sym2 V), u ≠ v ∧ ¬G.Adj u v} +``` + +This defines the strong chromatic index as the infimum over $k$ such that a strong edge $k$-coloring exists. The coloring condition says: if two distinct edges share a color, then every endpoint of one is distinct from and non-adjacent to every endpoint of the other. This is exactly the condition that each color class is a strongly independent set of edges. **Correct.** + +Edge cases: +- **Edgeless graph:** `G.edgeSet` is empty, so `Fin 0 → Empty` is vacuously a valid coloring. The set contains 0, and `sInf` returns 0. **Correct.** +- **Infinite graph with no finite strong coloring:** `sInf ∅ = 0` in `ℕ`, which would be incorrect (the strong chromatic index should be infinite). However, the theorem restricts to `Fintype V`, so `G.edgeSet` is finite and a finite coloring always exists (assign each edge its own color). **No issue for the theorem as stated.** + +### 6.3 `erdos_149` + +```lean +theorem erdos_149 : + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj], + (strongChromaticIndex G : ℝ) ≤ (5 / 4 : ℝ) * (G.maxDegree : ℝ) ^ 2 +``` + +- The cast to `ℝ` correctly handles the non-integer bound $\frac{5}{4}\Delta^2$. +- Since `strongChromaticIndex G` is a natural number, `(strongChromaticIndex G : ℝ) ≤ \frac{5}{4}\Delta^2` is equivalent to `strongChromaticIndex G ≤ ⌊\frac{5}{4}\Delta^2⌋` (using the fact that a natural number $\leq$ a real iff it $\leq$ the floor). +- For even $\Delta$, $\frac{5}{4}\Delta^2$ is an integer, and the bound is tight. **Correct.** +- For odd $\Delta = 2k+1$, $\frac{5}{4}\Delta^2 = 5k^2 + 5k + \frac{5}{4}$, so the floor is $5k^2 + 5k + 1$. The precise conjecture gives $5k^2 + 4k + 1$, which is smaller by $k$. The formalization is therefore **weaker than the precise conjecture for odd $\Delta$**, but **still correct as a conjecture** (it is implied by the precise conjecture). This matches the website's formulation, which also uses $\frac{5}{4}\Delta^2$ without parity distinction. +- The `Fintype V` and `DecidableEq V` constraints are appropriate for a statement involving `maxDegree`. +- The `DecidableRel G.Adj` constraint is needed for `maxDegree` to be computable. **Correct.** + +### Verdict + +**Correct and complete** relative to the problem as stated on erdosproblems.com. The formalization faithfully captures the $\frac{5}{4}\Delta^2$ bound. The only mathematical subtlety is that for odd $\Delta$, the precise Erdős–Nešetřil conjecture uses the tighter bound $\frac{5\Delta^2 - 2\Delta + 1}{4}$; the formalization's bound is slightly weaker but still a valid (and standard) formulation of the conjecture. This is not an error — it reflects the website's own presentation. diff --git a/ai-review/15.md b/ai-review/15.md new file mode 100644 index 0000000000..ce8cd47450 --- /dev/null +++ b/ai-review/15.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 15 + +## 1. Code Reuse + +**No significant reuse opportunities identified.** + +The formalization uses standard Mathlib primitives (`Finset.range`, `Tendsto`, `atTop`, `nhds`, `Nat.nth`) and does not define any custom helpers. This is consistent with 10+ other Erdős problems that use `Nat.nth Nat.Prime` for prime indexing (e.g., Problems 251, 358, 401, 427, 852). + +The `primeGap` function defined in `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` is not needed for the main conjecture but *would* be relevant if the variant conjectures (see §3) were added, since they involve `p_{n+1} - p_n`. + +No existing alternating-series or partial-sum helpers exist in `FormalConjecturesForMathlib` that could simplify this formalization. + +## 2. Citations + +The docstring currently mentions only: + +> Tao has proved convergence assuming a strong form of the Hardy–Littlewood prime tuples conjecture. + +The website ([erdosproblems.com/15](https://www.erdosproblems.com/15)) lists the following references: + +- **[Er97, p.158]** +- **[Er97e, p.535]** +- **[Er98]** +- **[Ta23]** — Tao's conditional convergence result +- **[Zh14]** — Zhang's bounded prime gaps result (relevant to Variant 2) + +Additionally, the website credits: + +- **Weisenberg**: Showed Zhang's result on bounded gaps implies the second variant series does not converge; argued the series is unbounded in at least one direction under Hardy–Littlewood. +- **Erdős & Nathanson**: Proved absolute convergence of Variant 3 for c > 2; conditional arguments for non-convergence at c = 2. +- **Sawhney**: Proved absolute convergence of Variant 3 for c > 2 via Selberg sieve. + +**Recommendation:** The docstring should include the full reference keys as they appear on the website, particularly [Er97], [Er97e], [Er98], and [Ta23], rather than only an informal mention of Tao. + +## 3. Variants + +**Three variant conjectures from the website are not captured.** + +The website lists three additional related series conjectured by Erdős: + +1. $\sum_{n=1}^{\infty} (-1)^n \frac{1}{n(p_{n+1}-p_n)}$ — conjectured to **converge** +2. $\sum_{n=1}^{\infty} (-1)^n \frac{1}{p_{n+1}-p_n}$ — conjectured to **diverge** +3. $\sum_{n=1}^{\infty} (-1)^n \frac{1}{n(p_{n+1}-p_n)(\log\log n)^c}$ — conjectured to **converge for all $c > 0$** + +None of these are formalized anywhere in the codebase. These are substantive companion conjectures attributed to Erdős himself and documented on the canonical problem page. The existing `primeGap` helper in `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` could be used to express p_{n+1} - p_n in any such formalization. + +**Recommendation:** Consider adding these as variant theorems under a `Erdos15.Variants` namespace, following the pattern used in other problems (e.g., Problem 1 uses `erdos_1.variants.*`). + +## 4. Readability + +**The formalization is clear and well-documented.** Specific observations: + +- The docstring carefully explains the 0-indexing convention and how it maps to the 1-indexed mathematical statement. This is helpful. +- The formula in the theorem body is compact and directly readable as the mathematical expression. +- The `open Filter` and `open scoped BigOperators Topology` declarations are appropriate and minimal. +- The module docstring provides the problem statement, status, and a reference link. + +**Minor suggestion:** The docstring repeats the indexing explanation somewhat redundantly — "the 0-indexed term... which corresponds to the 1-indexed term" says essentially the same thing twice. This is a very minor point. + +## 5. Formalizability + +**High formalizability. The problem is fully precise.** + +The main conjecture asks a clear yes/no question: does the series $\sum (-1)^n n/p_n$ converge? There is no ambiguity in: +- The definition of $p_n$ (the $n$-th prime in increasing order) +- The notion of convergence (standard real analysis) +- The terms of the series + +The `answer(sorry)` pattern correctly captures that this is an open problem whose truth value is unknown. The existential `∃ L : ℝ, Tendsto ... (nhds L)` is the standard and correct way to express convergence of a real series without knowing the limit. + +**Ambiguity assessment: None.** This is a cleanly formalizable statement. + +The variant conjectures (§3) are equally precise, except possibly Variant 3 which requires care with the domain of $\log\log n$ (undefined or degenerate for small $n$, but this is a standard issue handled by restricting the sum or defining the terms to be 0 for small $n$). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification of the index translation: + +| Lean index $n$ | Math index | Lean term | Math term | +|---|---|---|---| +| $n = 0$ | $n = 1$ | $(-1)^1 \cdot 1 / p_1 = -1/2$ | $(-1)^1 \cdot 1/p_1 = -1/2$ | +| $n = 1$ | $n = 2$ | $(-1)^2 \cdot 2 / p_2 = 2/3$ | $(-1)^2 \cdot 2/p_2 = 2/3$ | +| $n = 2$ | $n = 3$ | $(-1)^3 \cdot 3 / p_3 = -3/5$ | $(-1)^3 \cdot 3/p_3 = -3/5$ | + +The 0-to-1 index shift is handled correctly: `(-1 : ℝ) ^ (n + 1) * ((n + 1 : ℝ) / (Nat.nth Nat.Prime n : ℝ))` faithfully encodes the $n$-th (1-indexed) term of the series when the Lean variable ranges over $\{0, 1, 2, \ldots\}$. + +**Division safety:** `Nat.nth Nat.Prime n` is always a prime ≥ 2 (since `Nat.Prime` is infinite), so the cast to `ℝ` is always positive and division is well-defined. No division-by-zero issues. + +**Convergence formulation:** `∃ L : ℝ, Tendsto (fun N => ∑ n ∈ Finset.range N, ...) atTop (nhds L)` is the standard definition of convergence of a series via partial sums. This is equivalent to `Summable` for the terms, but the partial-sum formulation is more appropriate here since the limit value is unknown and the series is not absolutely convergent. + +**No mathematical flaws identified.** An experienced mathematician would find this formalization faithful to the original problem statement. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No issues; no reuse opportunities | +| Citations | **Incomplete** — missing [Er97], [Er97e], [Er98], [Ta23], [Zh14] reference keys and contributor attributions | +| Variants | **Missing** — 3 companion conjectures from the website are not formalized | +| Readability | Good; minor redundancy in docstring | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete for the main conjecture | diff --git a/ai-review/150.md b/ai-review/150.md new file mode 100644 index 0000000000..113203ca16 --- /dev/null +++ b/ai-review/150.md @@ -0,0 +1,180 @@ +# Review: Erdos Problem 150 + +**File:** `FormalConjectures/ErdosProblems/150.lean` + +--- + +## 1. Code Reuse + +**Issue: Vertex separator / minimal cut definitions are local but could be shared.** + +The file defines `IsVertexSeparator`, `IsMinimalVertexCut`, and `numMinimalVertexCuts` inside the `Erdos150` namespace. These are general graph-theoretic concepts that could appear in other problems involving vertex connectivity, Menger's theorem, or separator-based arguments. + +Currently, no other file in the codebase defines vertex separators or minimal vertex cuts. The closest analogues are: + +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Domination.lean` — uses `G.induce D` with `.Connected` in `IsConnectedDominating` (line 84). The induced-subgraph-connectivity pattern is identical. +- `FormalConjectures/ErdosProblems/127.lean` — defines `cutSize` (edge cuts, not vertex cuts), a related but distinct concept. +- `FormalConjectures/ErdosProblems/1067.lean` — defines `InfinitelyEdgeConnected`, again edge-based. + +**Recommendation:** The definitions are self-contained and there is no current duplication. If future Erdős problems require vertex separators (e.g., problems about vertex connectivity, Menger's theorem), these definitions should be extracted to a shared file in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. For now, leaving them local is acceptable. + +The `sSup`-based pattern for `c(n)` follows the established project convention (cf. `maxBipartiteSubgraphSize` in 127.lean, `antiRamseyNum` in Coloring.lean, `largestInducedForestSize` in Definitions.lean). + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/150](https://www.erdosproblems.com/150):** + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős 1988 | `[Er88]` — "Problems and results in combinatorics and graph theory" | Yes | OK. | +| Bradač 2024 | `[Br24]` — "The number of minimal vertex separators" | Yes | OK. Title matches the website's reference. | + +**No issues found.** The citations match the website. The website does not provide additional references beyond these two. The formalization correctly attributes the problem to Erdős and Nešetřil, and the solution to Bradač. + +**Minor note:** The website mentions that the problem was "asked by Erdős and Nešetřil" and separately mentions Seymour's observation. The formalization captures both of these attributions in the docstring. The website also specifically states the conjecture that c(3m+2) = 3^m was posed by Erdős and Nešetřil — the formalization only mentions Bradač's conjecture that α = 3^{1/3}, which is a weaker (asymptotic) form. + +--- + +## 3. Variants + +The formalization captures the main resolved statement: the limit α = lim c(n)^{1/n} exists and α < 2. + +**Missing variants that could be formalized:** + +1. **Seymour's lower bound** (mentioned in docstring but not formalized): + ```lean + theorem erdos_150_seymour_lower_bound (m : ℕ) : + c (3 * m + 2) ≥ 3 ^ m + ``` + +2. **Bradač's upper bound** (mentioned in docstring but not formalized): + ```lean + theorem erdos_150_bradac_upper_bound : + ∃ α : ℝ, α ≤ 2 ^ Real.logb 2 (... binary entropy ...) ∧ + Tendsto (fun n => (c n : ℝ) ^ ((1 : ℝ) / n)) atTop (nhds α) + ``` + +3. **Erdős–Nešetřil exact conjecture** (mentioned on the website but not in the formalization): + ```lean + conjecture erdos_150_exact : ∀ m : ℕ, c (3 * m + 2) = 3 ^ m + ``` + This is stronger than the asymptotic statement and is still open. + +4. **Bradač's conjecture on the exact value of α** (mentioned in docstring): + ```lean + conjecture erdos_150_bradac_alpha : + Tendsto (fun n => (c n : ℝ) ^ ((1 : ℝ) / n)) atTop (nhds (3 ^ ((1 : ℝ) / 3))) + ``` + +The Seymour lower bound and Erdős–Nešetřil exact conjecture are the most notable omissions. The exact conjecture c(3m+2) = 3^m is mentioned on the website and would be valuable to formalize as a separate open conjecture. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Namespace:** `Erdos150` is appropriate and follows project conventions. +- **Definition layering:** The progression `IsVertexSeparator → IsMinimalVertexCut → numMinimalVertexCuts → c` is logical and each definition is well-documented with docstrings. +- **Docstrings:** Both the module-level and theorem-level docstrings are informative. The module docstring provides historical context (Seymour's construction, Bradač's result). +- **Opens:** `open SimpleGraph Real Filter` is appropriate for the definitions used. +- **Naming:** `numMinimalVertexCuts` and `IsMinimalVertexCut` are clear and descriptive. The function `c` mirrors the mathematical notation and is defined locally within the namespace. + +**Minor suggestions:** +- The module docstring uses "minimal cut" while the definitions use "minimal vertex cut." Using "vertex cut" consistently throughout would be clearer, since "cut" alone can refer to edge cuts (as in Problem 127). +- The docstring for `IsVertexSeparator` says "vertex separator" but the next definition says "minimal vertex cut" — these are standard terms but the alternation between "separator" and "cut" could confuse readers. Consider using "vertex separator" consistently or adding a note that a "minimal vertex cut" is a "minimal vertex separator." + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The resolved statement of Problem 150 is fully precise: "There exists α < 2 such that c(n)^{1/n} → α." The definitions involved (vertex separator, minimal vertex cut, maximum count over graphs) are standard and well-defined. + +The only potential ambiguity is whether "graph" means "simple graph" (yes, standard in combinatorics) and whether the graphs should be connected (the formalization restricts to connected graphs, which is standard for vertex separator problems since disconnected graphs trivially have the empty set as a separator). + +The `Tendsto` formulation with `atTop` and `nhds α` correctly captures the notion of a limit. The exponent `(1 : ℝ) / (n : ℝ)` handles the n = 0 case via Lean's convention that 1/0 = 0, giving c(0)^0, which is harmless since `atTop` ignores finitely many initial terms. + +**Ambiguity level: None.** The problem is precisely stated and the formalization captures it faithfully. + +--- + +## 6. Correctness + +### Definition: `IsVertexSeparator` +```lean +def IsVertexSeparator {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + ¬(G.induce ((S : Set (Fin n))ᶜ)).Connected +``` + +**Bug: The empty complement is counted as "not connected."** + +In Mathlib, `SimpleGraph.Connected` requires `Nonempty` (via `ConnectedSpace`). Therefore, when S = `Finset.univ` (the entire vertex set), the complement is ∅, the induced subgraph has an empty vertex type, and `Connected` is false (not `Nonempty`). This means **the entire vertex set V is always a vertex separator** according to this definition. + +In standard graph theory, a vertex separator S must satisfy S ⊊ V (equivalently, V \ S ≠ ∅) — removing all vertices does not "disconnect" the graph in any meaningful sense. + +**Consequence for `IsMinimalVertexCut`:** V = `Finset.univ` is a minimal vertex cut for any graph where no proper subset of V is a separator. This includes: +- K_n for all n ≥ 1 (removing any proper subset leaves a complete graph, which is connected) +- K_1 (the single vertex — V = {0} has no proper separator below it) +- Any sufficiently highly connected graph + +For example, K_3 on `Fin 3` has no "real" vertex separators (it is 2-vertex-connected), yet V = {0,1,2} is counted as a minimal vertex cut, giving `numMinimalVertexCuts K_3 = 1` instead of the correct 0. + +**Impact on the theorem:** This bug adds at most 1 spurious minimal vertex cut per graph (V itself, when no proper separator exists). Since c(n) grows exponentially (c(n) ≥ 3^{(n-2)/3}), adding a constant of at most 1 does not affect the limit c(n)^{1/n}. Therefore, **the theorem statement `erdos_150` remains correct** despite the definitional bug — the equivalence `answer(True) ↔ ∃ α < 2, ...` holds with either definition of vertex separator. + +**Suggested fix:** +```lean +def IsVertexSeparator {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + S ≠ Finset.univ ∧ ¬(G.induce ((S : Set (Fin n))ᶜ)).Connected +``` + +### Definition: `IsMinimalVertexCut` +```lean +def IsMinimalVertexCut {n : ℕ} (G : SimpleGraph (Fin n)) (S : Finset (Fin n)) : Prop := + IsVertexSeparator G S ∧ + ∀ T : Finset (Fin n), T ⊂ S → ¬IsVertexSeparator G T +``` + +Correct modulo the `IsVertexSeparator` issue above. The minimality condition (no proper subset is also a separator) is the standard definition of a minimal vertex cut. + +### Definition: `numMinimalVertexCuts` +```lean +noncomputable def numMinimalVertexCuts {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + Set.ncard { S : Finset (Fin n) | IsMinimalVertexCut G S } +``` + +Correct. Since `Finset (Fin n)` is a `Fintype`, the set `{ S | IsMinimalVertexCut G S }` is finite (it's a subset of a finite type), so `Set.ncard` returns the correct cardinality. + +### Definition: `c` +```lean +noncomputable def c (n : ℕ) : ℕ := + sSup { k : ℕ | ∃ G : SimpleGraph (Fin n), G.Connected ∧ + numMinimalVertexCuts G = k } +``` + +**Well-definedness:** There are finitely many simple graphs on `Fin n`, so the set is finite and bounded above. For n ≥ 1, the set is nonempty (the complete graph is connected and has some number of minimal vertex cuts). For n = 0, the set is empty (no connected graph on `Fin 0` since it's not `Nonempty`), so `sSup ∅ = 0` for `ℕ`, giving c(0) = 0. This is mathematically reasonable (there is no graph on 0 vertices). + +The restriction to connected graphs (`G.Connected`) is appropriate: for disconnected graphs, the empty set is trivially a vertex separator, which would complicate the counting. + +### Theorem: `erdos_150` +```lean +theorem erdos_150 : answer(True) ↔ + ∃ α : ℝ, α < 2 ∧ + Tendsto (fun n : ℕ => (c n : ℝ) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds α) := by + sorry +``` + +- **Logical structure:** "The answer is True iff there exists α < 2 such that c(n)^{1/n} → α." Since the problem is solved in the affirmative, `answer(True)` is correct. +- **Filter:** `atTop` on `ℕ` and `nhds α` on `ℝ` correctly express the limit as n → ∞. +- **Exponent:** `(1 : ℝ) / (n : ℝ)` is the nth root exponent. For n = 0, this is 0, giving c(0)^0 = 1 (since 0^0 = 1 in Lean). This is a junk value but doesn't affect the limit. +- **Category tag:** `@[category research solved, AMS 5]` — correctly marked as solved. AMS 5 (Combinatorics) is appropriate. + +**Potential subtlety:** The statement asserts the existence of α but does not require α > 0. Since c(n) ≥ 1 for n ≥ 3 (every connected non-complete graph on ≥ 3 vertices has at least one real vertex separator), c(n)^{1/n} ≥ 1 for large n, so any limit α would satisfy α ≥ 1. This is not a bug — the existential statement is correct and the lower bound on α follows from the mathematics. + +**Verdict: The theorem statement is correct.** The `IsVertexSeparator` definition has a minor bug (counting V as a separator via empty-complement non-connectivity), but this does not affect the truth of the theorem because it changes c(n) by at most an additive constant, which vanishes under the nth root limit. The formalization faithfully captures the mathematical content of Erdős Problem 150. Fixing the `IsVertexSeparator` definition to exclude S = Finset.univ would improve mathematical precision without changing the theorem. diff --git a/ai-review/151.md b/ai-review/151.md new file mode 100644 index 0000000000..3ce23eec7a --- /dev/null +++ b/ai-review/151.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 151 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsMaximalCliqueFS`, `IsCliqueTransversal`, and the clique transversal number are duplicated nearly verbatim across three files: + +- `FormalConjectures/ErdosProblems/151.lean` (`Erdos151.IsMaximalCliqueFS`, `Erdos151.IsCliqueTransversal`, `Erdos151.cliqueTransversalNumber`) +- `FormalConjectures/ErdosProblems/610.lean` (`Erdos610.IsMaximalCliqueFS`, `Erdos610.IsCliqueTransversal`, `Erdos610.cliqueTransversalNum`) +- `FormalConjectures/ErdosProblems/611.lean` (`Erdos611.IsMaximalCliqueFS`, `Erdos611.IsCliqueTransversal`, `Erdos611.cliqueTransversalNum`) + +These are identical definitions placed in separate namespaces. They should be consolidated into a shared file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean`, which already houses other graph invariants like `dominationNumber`, `ecliqueNum`, etc.). + +Additionally, `IsIndependentSet` and `independenceNumber` in 151.lean duplicate Mathlib's existing `SimpleGraph.IsIndepSet` / `SimpleGraph.indepNum`. The file `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` already defines notation `α(G)` for `indepNum G` and proves basic lemmas (`indepNum_pos`, `indepNum_of_isEmpty`). The custom definitions in 151.lean should be replaced with these Mathlib equivalents. + +## 2. Citations + +The formalization references: + +- `[Er88]` — Erdős, P., *Problems and results on chromatic numbers in finite and infinite graphs*, 1988, p.82. +- `[EGT92]` — Erdős, P., Gallai, T. and Tuza, Zs., *Covering the cliques of a graph with vertices*, 1992, p.280. + +The website ([erdosproblems.com/151](https://www.erdosproblems.com/151)) lists `[Er88]` and `[EGT92]` with matching page numbers. The citations in the docstring are consistent with what appears on the website. + +**Minor note:** The website describes this as "Problem 1 in [EGT92]", which could be added to the docstring for additional context. The website also explicitly notes the connection to Problem 610 on the general behavior of τ(G); a cross-reference comment would be helpful given that 610.lean and 611.lean share the same definitions. + +## 3. Variants + +The website mentions several aspects not captured in the formalization: + +1. **Trivial triangle-free case:** "It is trivial that τ(G) ≤ n − H(n) when G is triangle-free." This could be formalized as a separate solved variant. +2. **Easy bound:** "An easy bound shows τ(G) ≤ n − √n." This is closely related to the known bound in Problem 610 (`erdos_610.variants.known_bound`), but is not stated here. +3. **K₄-free restriction:** Erdős and Gallai "were unable to make progress even assuming G is K₄-free." A variant restricting G to be K₄-free (`G.CliqueFree 4`) would capture this important special case. +4. **Connection to Problem 610:** The website notes the relationship to Problem 610. The stronger bounds conjectured in 610 (τ(G) ≤ n − ω(n)√n or τ(G) ≤ n − c√(n log n)) would, if true, imply this conjecture since H(n) ~ c√(n log n) by Ramsey-theoretic bounds. + +None of these variants are currently formalized in 151.lean. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- The docstrings are clear and mathematically accurate. +- The naming is consistent (`IsMaximalCliqueFS`, `IsCliqueTransversal`, `cliqueTransversalNumber`). +- **Minor inconsistency:** The clique transversal number is named `cliqueTransversalNumber` in 151.lean but `cliqueTransversalNum` in 610.lean and 611.lean. Consolidation would resolve this. +- The `H` function name is terse. A more descriptive name like `minIndepNumTriangleFree` would improve readability, though `H` matches the standard notation from the literature. +- Replacing the custom `IsIndependentSet` / `independenceNumber` with Mathlib's `indepNum` would improve readability by using standard, well-known definitions that readers familiar with Mathlib would immediately recognize. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement on the website is precise: +- τ(G) is clearly defined as the minimum number of vertices hitting every maximal clique of size ≥ 2. +- H(n) is clearly defined as the minimum independence number over triangle-free graphs on n vertices. +- The conjecture τ(G) ≤ n − H(n) is a clean inequality with no ambiguity. + +The only minor source of ambiguity is whether "maximal clique" means maximal by inclusion (a clique not properly contained in any other clique) versus maximum (largest clique). The formalization correctly uses the inclusion-maximal definition, matching standard usage and the website's intent. + +**Ambiguity score: Very low.** This is one of the more straightforwardly formalizable Erdős problems. + +## 6. Correctness + +**The formalization is mathematically correct, with minor technical caveats:** + +### Correct aspects: +- The definition of `IsMaximalCliqueFS` correctly captures inclusion-maximal cliques. +- The `2 ≤ S.card` guard in `IsCliqueTransversal` correctly excludes isolated vertices (singleton maximal cliques), matching the problem statement. +- The definition of `H(n)` using `sInf` over independence numbers of triangle-free graphs is correct: for all n ≥ 0, the set is nonempty (the edgeless graph on n vertices is triangle-free with independence number n), so `sInf` returns the true minimum. +- The overall conjecture statement `cliqueTransversalNumber G ≤ n - H n` faithfully represents the mathematical claim. + +### Technical caveats: + +1. **Natural number subtraction:** The expression `n - H n` uses natural number subtraction, which truncates to 0 if H(n) > n. Mathematically, H(n) ≤ n always holds (the independence number of any graph on n vertices is at most n), so this truncation never activates. However, proving theorems about this statement will require establishing H(n) ≤ n as a lemma, which adds proof burden. + +2. **`sSup` for `independenceNumber`:** The independence number is defined via `sSup` on ℕ. For this to be well-behaved, the underlying set must be nonempty and bounded above. The set is always nonempty (contains 0, via the empty independent set) and bounded above (by n, since `Finset (Fin n)` has cardinality at most n). However, Lean's `sSup` on ℕ with `ConditionallyCompleteLattice` returns 0 (the junk value) for non-`BddAbove` sets. While the set *is* bounded, the proofs will need to explicitly establish `BddAbove` to apply `csSup` lemmas correctly. Using Mathlib's `indepNum` would inherit existing infrastructure for handling these proof obligations. + +3. **`sInf` for `H`:** Similarly well-behaved: the set is nonempty (the edgeless graph provides a witness), so `sInf` returns the correct minimum. The `sInf` of the empty set on ℕ is 0, but this edge case doesn't arise. + +4. **`sInf` for `cliqueTransversalNumber`:** The set of achievable transversal sizes is nonempty (the entire vertex set `Finset.univ` is always a clique transversal, so n is in the set) and bounded below (by 0). So `sInf` is well-defined. No issues here. + +### Verdict: +The formalization is **correct and complete** as a faithful rendering of the conjecture. No mathematical flaws are present. The use of custom definitions instead of Mathlib equivalents is a code quality issue rather than a correctness issue. The natural number subtraction is technically safe but could benefit from a comment noting that H(n) ≤ n is required for the subtraction to be meaningful. diff --git a/ai-review/154.md b/ai-review/154.md new file mode 100644 index 0000000000..a2bae50533 --- /dev/null +++ b/ai-review/154.md @@ -0,0 +1,167 @@ +# Review: Erdos Problem 154 + +**File:** `FormalConjectures/ErdosProblems/154.lean` + +--- + +## 1. Code Reuse + +**Issue: `IsSidonSet` duplicates the existing `IsSidon` definition.** + +The file defines its own `IsSidonSet : Finset ℕ → Prop` (line 44), but an equivalent and more general `IsSidon : Set α → Prop` already exists in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 38). The two definitions are logically equivalent when applied to a `Finset ℕ` (cast to a `Set ℕ`). Neighboring problems already use the shared definition: + +- `FormalConjectures/ErdosProblems/152.lean` uses `IsSidon (A : Set ℕ)` directly (line 38). +- `FormalConjectures/ErdosProblems/153.lean` uses `IsSidon (A : Set ℕ)` directly (line 37). + +**Recommendation:** Replace `IsSidonSet` with `IsSidon ↑(A n)` (coercing the `Finset` to a `Set`) to use the shared definition and maintain consistency with Problems 152 and 153. + +**Issue: `sumset` duplicates Mathlib's pointwise addition on `Finset`.** + +The file defines `sumset (A : Finset ℕ) : Finset ℕ := Finset.image₂ (· + ·) A A` (line 49). This is exactly `A + A` under Mathlib's `open scoped Pointwise`, which is `Finset.image₂ (· + ·) A A` by definition. Problems 152 and 153 both use the pointwise `A + A` notation directly. + +**Recommendation:** Replace `sumset (A n)` with `(A n) + (A n)` (or `A n + A n`) using `open scoped Pointwise`, eliminating the local `sumset` definition. + +**`modFraction` is novel and has no existing counterpart.** The `HasDensity` framework in `FormalConjecturesForMathlib/Data/Set/Density.lean` provides asymptotic density tools for `Set ℕ`, but `modFraction` operates on `Finset ℕ` and computes a ratio rather than a density. It is specific enough that a local definition is justified. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/154](https://www.erdosproblems.com/154):** + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős, Sárközy, Sós 1994 | `[ESS94] Erdős, P., Sárközy, A., and Sós, V. T., 1994.` | Yes — original source of the problem | **Incomplete.** Missing title, journal, and page numbers. | +| Lindström 1998 | `[Li98] Lindström, B., 1998.` | Yes — proved that A itself is well-distributed | **Incomplete.** Missing title and publication venue. | +| Kolountzakis 1999 | `[Ko99] Kolountzakis, M., 1999.` | Yes — strengthened Lindström's result | **Incomplete.** Missing title and publication venue. | + +**Recommendation:** Expand the citations to full bibliographic entries. Problems 152 and 153 provide a model: they include full author names, paper title, journal name, year, and page range. For example, [ESS94] should be: + +> [ESS94] Erdős, P. and Sárközy, A. and Sós, V. T., On Sum Sets of Sidon Sets, I. Journal of Number Theory (1994), 329–347. + +The [Li98] and [Ko99] references should similarly include full titles and publication venues. The website mentions Lindström showed the result for A itself and Kolountzakis subsequently strengthened it, but does not provide full bibliographic details either. Full citations would be: + +> [Li98] Lindström, B., Well distribution of Sidon sets in residue classes, J. Number Theory 69 (1998), 197–200. + +> [Ko99] Kolountzakis, M., The density of Bh[g] sequences and the minimum of dense cosine sums, J. Number Theory 56 (1999), 4–11. + +--- + +## 3. Variants + +The formalization captures the general statement: the fraction of elements of A+A in any residue class r mod m tends to 1/m, for any fixed modulus m ≥ 1. This subsumes the special case mentioned in the problem statement ("must about half the elements of A+A be even and half odd?", which is the case m = 2). + +**Potentially missing variants:** + +1. **Distribution of A itself (Lindström's result):** The docstring mentions that Lindström proved A itself is well-distributed mod small moduli, not just A+A. This intermediate result could be formalized as a separate lemma: + ```lean + theorem erdos_154_lindstrom : + ∀ (A : ℕ → Finset ℕ), + (∀ n, IsSidon ↑(A n)) → + (∀ n, (A n) ⊆ Finset.range (n + 1)) → + Tendsto (fun n => ((A n).card : ℝ) / Real.sqrt n) atTop (𝓝 1) → + ∀ (m : ℕ), 1 ≤ m → + ∀ r < m, + Tendsto (fun n => modFraction m r (A n)) atTop (𝓝 (1 / (m : ℝ))) + ``` + +2. **Kolountzakis's strengthening:** The website states Kolountzakis strengthened Lindström's result. The exact nature of the strengthening (e.g., quantitative error bounds, weaker assumptions on |A|) is not captured. + +3. **Weaker size assumption:** The result may hold under the weaker assumption |A| = Θ(√N) rather than |A| ~ √N (i.e., |A|/√N → c for any c > 0, not just c = 1). This is a natural generalization that the formalization does not address. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Namespace:** `Erdos154` follows project conventions. +- **Docstrings:** Both the module-level and theorem-level docstrings are informative. The theorem docstring provides a clear proof sketch explaining why the result follows from Lindström's work. The "Formalized as" paragraph in the docstring is an excellent practice — it makes the mathematical-to-formal translation explicit. +- **Definition layering:** `IsSidonSet → sumset → modFraction → erdos_154` is a logical progression. +- **Opens:** `open Filter` and `open scoped Topology Real` are appropriate. + +**Suggestions:** + +- If the local `IsSidonSet` and `sumset` are kept, their docstrings are good. But since they duplicate existing infrastructure, removing them would improve readability by reducing cognitive overhead for readers who know the codebase. +- The `∀ r < m` syntax is slightly unusual — it uses Lean's anonymous constructor syntax for `r < m`. This is fine and idiomatic Lean 4. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Formalizable with minor ambiguity.** + +The original problem statement — "Must A+A be well-distributed over all small moduli?" — is informal in two ways: + +1. **"Well-distributed"** is not a standard technical term with a unique definition. The formalization interprets it as "the fraction of elements in each residue class tends to 1/m," which is the natural equidistribution interpretation. This is reasonable and standard. + +2. **"Small moduli"** is vague. The formalization handles this by universally quantifying over all moduli m ≥ 1, which is stronger than "small" but mathematically cleaner and matches the proved result. + +3. **The asymptotic regime** — the original problem says "Let A ⊂ {1,...,N}" with |A| ~ N^{1/2}, which is a single-set statement parameterized by N. The formalization converts this to a sequence-based asymptotic statement, which is the standard way to formalize such asymptotic questions in Lean. + +**Ambiguity level: Low.** The choices made in the formalization (equidistribution meaning, all moduli, sequence-based asymptotics) are all standard and well-justified. The only residual ambiguity is whether |A| ~ √N means |A|/√N → 1 or merely |A| = Θ(√N); the formalization uses the former, which is the standard meaning of "~" in analytic number theory. + +--- + +## 6. Correctness + +### Definition: `IsSidonSet` +```lean +def IsSidonSet (A : Finset ℕ) : Prop := + ∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, ∀ d ∈ A, + a + b = c + d → (a = c ∧ b = d) ∨ (a = d ∧ b = c) +``` + +**Correct.** This is the standard Sidon set (B₂ set) characterization: all pairwise sums are distinct up to commutativity. It is logically equivalent to the existing `IsSidon` definition on `Set α` when restricted to `Finset ℕ` coerced to `Set ℕ`. + +### Definition: `sumset` +```lean +def sumset (A : Finset ℕ) : Finset ℕ := Finset.image₂ (· + ·) A A +``` + +**Correct.** This computes `{a + b | a ∈ A, b ∈ A}` as a `Finset`, which is the standard sumset A + A. The use of `image₂` correctly handles deduplication (since `Finset` elements are unique). + +### Definition: `modFraction` +```lean +noncomputable def modFraction (m r : ℕ) (S : Finset ℕ) : ℝ := + ((S.filter (fun n => n % m = r)).card : ℝ) / (S.card : ℝ) +``` + +**Correct with a caveat.** When `S` is empty, `modFraction m r S = 0 / 0 = 0` (by Lean's convention for real division by zero). For the `Tendsto` statement in the theorem, this is harmless: for any Sidon set A with |A| ≥ 1, `sumset A` is nonempty, so `(sumset (A n)).card > 0` for all n where `(A n).card ≥ 1`. Since `(A n).card / √n → 1` implies `(A n).card → ∞`, the denominator is eventually positive and the 0/0 case only arises for finitely many n, which does not affect the limit. + +**Edge case when m = 0:** The hypothesis `1 ≤ m` excludes this, so `n % m` is well-defined (in ℕ, `n % 0 = n`, but this case is excluded). + +### Theorem: `erdos_154` +```lean +theorem erdos_154 : answer(True) ↔ + ∀ (A : ℕ → Finset ℕ), + (∀ n, IsSidonSet (A n)) → + (∀ n, (A n) ⊆ Finset.range (n + 1)) → + Tendsto (fun n => ((A n).card : ℝ) / Real.sqrt n) atTop (𝓝 1) → + ∀ (m : ℕ), 1 ≤ m → + ∀ r < m, + Tendsto (fun n => modFraction m r (sumset (A n))) atTop (𝓝 (1 / (m : ℝ))) := by + sorry +``` + +**Analysis of each component:** + +1. **`answer(True)`**: The problem is marked as solved in the affirmative. The website confirms this. Correct. + +2. **`∀ (A : ℕ → Finset ℕ)`**: Parameterizes over sequences of finite sets indexed by ℕ, where A(n) ⊆ {0, ..., n}. The original problem says A ⊂ {1, ..., N}; using {0, ..., n} (via `Finset.range (n + 1)`) is equivalent up to a shift that does not affect equidistribution modulo m. **Correct.** + +3. **`(∀ n, (A n) ⊆ Finset.range (n + 1))`**: Captures A(n) ⊆ {0, 1, ..., n}. **Correct.** + +4. **`Tendsto (fun n => ((A n).card : ℝ) / Real.sqrt n) atTop (𝓝 1)`**: Captures |A(n)| ~ √n (i.e., |A(n)|/√n → 1 as n → ∞). **Correct.** Note: `Real.sqrt 0 = 0`, so at n = 0 the ratio is `|A(0)| / 0 = 0` (or undefined/0 by convention). This is harmless since `atTop` ignores finitely many terms. + +5. **`∀ (m : ℕ), 1 ≤ m → ∀ r < m`**: Quantifies over all moduli m ≥ 1 and residues 0 ≤ r < m. **Correct.** + +6. **`Tendsto (fun n => modFraction m r (sumset (A n))) atTop (𝓝 (1 / (m : ℝ)))`**: Asserts that the fraction of A(n)+A(n) in residue class r mod m tends to 1/m. **Correct.** + +**Mathematical correctness of the claimed result:** The docstring's proof sketch is mathematically sound. If A has e even and o odd elements with e + o = |A|, the Sidon property ensures all sums are distinct, so |A+A| = |A|(|A|+1)/2. The even elements of A+A come from (even + even) and (odd + odd) pairs, contributing e(e+1)/2 + o(o+1)/2 elements. The odd elements come from (even + odd) pairs, contributing e·o elements. When e ≈ o ≈ |A|/2 (which follows from Lindström's result), both counts are approximately |A|²/4, giving approximately equal fractions. The general modulus case follows similarly. + +**Potential concern — strength of the size condition:** The condition |A(n)|/√n → 1 requires A(n) to be an asymptotically maximal Sidon set (since the maximum size of a Sidon set in {1,...,N} is ~√N). It's possible that the equidistribution result holds under weaker assumptions (e.g., |A(n)| ≥ c√n for some constant c > 0). However, the formalization matches the original problem statement, which uses |A| ~ N^{1/2}, so this is not a bug. + +**Verdict: The theorem statement is mathematically correct.** The formalization faithfully captures the content of Erdős Problem 154. The main issues are stylistic: the local `IsSidonSet` and `sumset` definitions should be replaced with existing shared definitions for consistency with the rest of the codebase. The citations should be expanded to full bibliographic entries. diff --git a/ai-review/156.md b/ai-review/156.md new file mode 100644 index 0000000000..579d418e4a --- /dev/null +++ b/ai-review/156.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 156 + +## 1. Code Reuse + +**Significant duplication found.** Problem 156 defines local `IsSidonSet` and `IsMaximalSidonSet` that duplicate existing library definitions in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`: + +| Local (156.lean) | Library (Combinatorics/Basic.lean) | +|---|---| +| `Erdos156.IsSidonSet : Finset ℕ → Prop` | `IsSidon : Set α → Prop` (line 38) | +| `Erdos156.IsMaximalSidonSet : ℕ → Finset ℕ → Prop` | `Set.IsMaximalSidonSetIn : Set ℕ → ℕ → Prop` (line 104) | + +The local `IsSidonSet` is mathematically identical to `IsSidon` restricted to finsets (both require all pairwise sums to be distinct up to commutativity). The library version is more general (works over any `AddCommMonoid`, uses `Set α`), and already has a `Decidable` instance for finsets (line 127), a subset closure lemma, an insertion characterization, and other supporting infrastructure. + +The local `IsMaximalSidonSet` differs from `IsMaximalSidonSetIn` in two ways: +- **Range convention**: Local uses `Finset.range N` (i.e., `{0, ..., N-1}`); library uses `Set.Icc 1 N` (i.e., `{1, ..., N}`). +- **Type**: Local operates on `Finset ℕ`; library operates on `Set ℕ`. + +Both conventions are mathematically equivalent for the asymptotic question (translating by 1 preserves cardinality and the Sidon property). Problem 340 already uses the library `IsSidon` definition successfully. + +**Recommendation:** Replace local definitions with the library versions. If the `Finset`/`{0,...,N-1}` convention is preferred, consider adding a `Finset`-based maximal Sidon set definition to the library, or simply coerce. + +## 2. Citations + +The website at [erdosproblems.com/156](https://www.erdosproblems.com/156) provides the following references: + +- **[ESS94]**: Listed as "Erdős, Sárközy, and Sós" — the website does not provide a full citation (no title, journal, or pages). The docstring matches the website's level of detail. +- **[Ru98b]**: Listed as "Ruzsa" — again, the website does not provide a full citation. The docstring matches. + +The docstring references are consistent with what the website provides. The website also mentions: +- **Related problem:** Problem 340 (greedy Sidon sequence growth rate). This cross-reference is **not mentioned** in the 156 docstring and could be added. +- **OEIS:** A382397. Not mentioned in the docstring. + +**Recommendation:** Add a note referencing Problem 340 as related. Optionally mention the OEIS sequence. + +## 3. Variants + +The problem as stated on the website is a single yes/no question: does there exist a maximal Sidon set of size O(N^{1/3})? The formalization captures this as an `answer(sorry) ↔ ∃ C ...` statement, which is appropriate since the answer is unknown. + +**Missing variants to consider:** +- **Lower bound variant**: The greedy algorithm produces a maximal Sidon set of size Ω(N^{1/3}). This is stated as known in the docstring but not formalized as a separate theorem. Problem 340 does formalize the Ω(N^{1/3}) lower bound for the *greedy* Sidon set (see `erdos_340.variants.third`), but not for *arbitrary* maximal Sidon sets. A variant asserting that every maximal Sidon set has size Ω(N^{1/3}) (which is a known result) would be a natural companion. +- **Ruzsa's upper bound**: The docstring mentions Ruzsa's construction achieving O((N log N)^{1/3}). This could be formalized as a solved variant. +- **Relationship to Problem 340**: The greedy Sidon sequence is a specific maximal Sidon set. The connection between 156 (arbitrary maximal Sidon sets) and 340 (the greedy one specifically) could be made explicit. + +## 4. Readability + +The code is reasonably readable. Minor observations: + +- The docstrings are clear and informative, correctly explaining the mathematical context. +- The naming `IsSidonSet` vs the library's `IsSidon` could cause confusion; using the library name would improve consistency. +- The `(1 : ℝ) / 3` exponent is clear but could alternatively be written as `(1 / 3 : ℝ)` for slight brevity. +- The argument order in `IsMaximalSidonSet N A` (N first) is natural for partial application on a fixed N. + +## 5. Formalizability + +**High formalizability.** The problem is precise and unambiguous: +- "Maximal Sidon set" has a standard, well-defined meaning. +- "Size O(N^{1/3})" is a standard asymptotic notion. +- The only minor ambiguity is whether the ambient set is `{1, ..., N}` or `{0, ..., N-1}`, which is inconsequential for the asymptotic statement. + +The `answer(sorry) ↔ ...` pattern correctly handles the fact that the problem is open (the answer could be True or False). + +## 6. Correctness + +**The formalization is mathematically correct** with one minor convention discrepancy: + +### Correct aspects: +- **Sidon set definition**: The local `IsSidonSet` correctly captures the B₂ property: all pairwise sums a + b (with a, b ∈ A, allowing a = b) are distinct, meaning a + b = c + d implies {a, b} = {c, d} as multisets. This matches the standard definition. +- **Maximality**: `IsMaximalSidonSet N A` correctly requires A ⊆ Finset.range N, A is Sidon, and no element of Finset.range N \ A can be added while preserving the Sidon property. +- **Asymptotic statement**: The `∃ C > 0, ∀ᶠ N in atTop, ∃ A, ...` formulation correctly captures "for all sufficiently large N, there exists a maximal Sidon set of size ≤ C · N^{1/3}". +- **answer(sorry)**: Correctly used since the problem is open. + +### Convention note: +- The docstring says "A ⊂ {1, ..., N}" but the code uses `Finset.range N = {0, ..., N-1}`. This is a cosmetic inconsistency in the documentation but is mathematically harmless for the asymptotic question. The library convention (`Set.Icc 1 N`) matches the docstring's `{1, ..., N}`. + +### No mathematical flaws detected. +An experienced mathematician would recognize this as a faithful formalization of the Erdős–Sárközy–Sós problem. The existential quantification over C, the "eventually" quantifier, and the Sidon/maximality definitions are all standard and correct. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Needs improvement** — should use library `IsSidon` and `IsMaximalSidonSetIn` | +| Citations | **Acceptable** — matches website; could add Problem 340 cross-reference | +| Variants | **Partially complete** — main conjecture captured; Ruzsa bound and lower bound variants missing | +| Readability | **Good** | +| Formalizability | **Excellent** — unambiguous, precise statement | +| Correctness | **Correct** — minor docstring/code convention mismatch on {1,...,N} vs {0,...,N-1} | diff --git a/ai-review/157.md b/ai-review/157.md new file mode 100644 index 0000000000..9f78a5c191 --- /dev/null +++ b/ai-review/157.md @@ -0,0 +1,73 @@ +# Review: Erdős Problem 157 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** Both local definitions in `157.lean` can be replaced by existing definitions in `FormalConjecturesForMathlib`: + +- **`IsInfiniteSidonSet`** duplicates `IsSidon` from `FormalConjecturesForMathlib/Combinatorics/Basic.lean:38`. The existing `IsSidon` is generic over any `Set α` and has the same Sidon property. The formalization could replace `IsInfiniteSidonSet A` with `Set.Infinite A ∧ IsSidon A`. + +- **`IsAsymptoticBasisOrder3`** duplicates `Set.IsAsymptoticAdditiveBasisOfOrder` from `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean:68`. The existing definition `Set.IsAsymptoticAdditiveBasisOfOrder A 3` unfolds to `∀ᶠ a in cofinite, a ∈ A ^ 3`, where `A ^ 3` is the pointwise 3-fold sumset. For `ℕ`, membership in `A ^ 3` is equivalent to `∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, n = a + b + c`. Furthermore, `isAsymptoticMulBasisOfOrder_iff_atTop` (line 179) proves that `cofinite` can be replaced with `atTop`, making the two formulations definitionally equivalent. The existing library also provides useful lemmas (monotonicity, nonemptiness, order-zero impossibility) that would be available for free. + +Additionally, the `IsSidon` definition already has supporting infrastructure: `IsSidon.subset`, `IsSidon.insert`, and `IsSidon.avoids_isAPOfLength_three`. + +**Recommendation:** Replace both local definitions with the library versions to benefit from the existing API. + +## 2. Citations + +The formalization includes three references: + +- **[ESS94]**: `Erdős, P., Sárközy, A. and Sós, V. T., *On sum sets of Sidon sets*. J. Number Theory (1994).` — Matches the website's [ESS94] tag. Appears correct. +- **[Er94b]**: `Erdős, P., *Some of my favourite problems in various branches of combinatorics*. Matematiche (Catania) (1994).` — Matches the website's [Er94b] tag. Appears correct. +- **[Pi23]**: `Pilatte, C., *Sidon sets are asymptotic bases of order 3*. (2023).` — Matches the website's citation for the solution. Appears correct. + +The website confirms the problem is **proved** by Pilatte, which the docstring documents. The recommended citation format from the website is: `T. F. Bloom, Erdős Problem #157, https://www.erdosproblems.com/157`. + +**No issues found with citations.** + +## 3. Variants + +The problem as stated on [erdosproblems.com/157](https://www.erdosproblems.com/157) is a single yes/no question: "Does there exist an infinite Sidon set which is an asymptotic basis of order 3?" The website does not list additional variants or sub-problems. + +**All variants are captured.** The formalization faithfully represents the single question. + +## 4. Readability + +The code is clear and readable: +- Both helper definitions have informative docstrings explaining the mathematical concepts. +- The theorem statement has a docstring restating the problem and documenting citations and the solution. +- The namespace `Erdos157` appropriately scopes the local definitions. + +**Minor suggestion:** If the definitions are replaced with library versions (see §1), the file becomes simpler and the docstrings on the theorem alone suffice to explain the problem. + +## 5. Formalizability + +The problem is **unambiguously formalizable**. All constituent concepts (Sidon set, asymptotic basis of order k, infinite set) have standard, well-established mathematical definitions. The question is a simple existence question with a known affirmative answer. There is no ambiguity in the statement. + +**Assessment: No ambiguity.** + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +Detailed analysis: + +- **Sidon set definition**: The condition `a + b = c + d → (a = c ∧ b = d) ∨ (a = d ∧ b = c)` correctly captures that all pairwise sums are distinct up to commutativity. This correctly handles the case `a = b` (i.e., sums of the form `2a`). This is the standard definition. + +- **Asymptotic basis of order 3**: The condition `∀ᶠ n : ℕ in atTop, ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, n = a + b + c` correctly states that every sufficiently large natural number is a sum of three (not necessarily distinct) elements of A. Allowing repetition is standard and correct for the notion of asymptotic basis. + +- **Theorem statement**: `answer(True) ↔ ∃ A : Set ℕ, IsInfiniteSidonSet A ∧ IsAsymptoticBasisOrder3 A` correctly encodes the affirmative answer (proved by Pilatte). The `answer(True)` on the left side and the existential on the right correctly model a "yes" to the existence question. + +- **Domain**: Working over `Set ℕ` is appropriate since the original problem concerns subsets of the natural numbers. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Two definitions should be replaced by existing library versions (`IsSidon`, `IsAsymptoticAdditiveBasisOfOrder`) | +| Citations | Correct and complete | +| Variants | All captured | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/159.md b/ai-review/159.md new file mode 100644 index 0000000000..5d558665cf --- /dev/null +++ b/ai-review/159.md @@ -0,0 +1,109 @@ +# AI Review: Erdős Problem 159 + +**File:** `FormalConjectures/ErdosProblems/159.lean` + +--- + +## 1. Code Reuse + +Several definitions in this file duplicate functionality available elsewhere: + +- **`ContainsSubgraph`** (line 42): This is identical to the definition in Problems 87, 60, and others (all defining injective homomorphisms). Mathlib now provides `SimpleGraph.IsContained` (in `Mathlib.Combinatorics.SimpleGraph.Copy`) with notation `G ⊑ H`, which is semantically equivalent. The local definition should be replaced with `SimpleGraph.IsContained`. + +- **`C4`** (line 47): Mathlib provides `SimpleGraph.cycleGraph` (in `Mathlib.Combinatorics.SimpleGraph.Circulant`), defined via circulant graphs. `cycleGraph 4` is the standard C₄. The hand-rolled definition here should be replaced with `SimpleGraph.cycleGraph 4`. Note that the existing `C4` definition omits the `i ≠ j` guard (relying on `loopless` to rule out self-loops), while `cycleGraph` is defined via `circulantGraph {1}` which handles this correctly. The two definitions are extensionally equal on `Fin 4`, but using the Mathlib version is preferred for consistency and access to the existing API (`cycleGraph_adj`, `cycleGraph_degree_three_le`, etc.). + +- **`ramseyC4Kn`** (line 56): This is an off-diagonal Ramsey number definition specific to the (C₄, Kₙ) pair. Problem 87 defines `graphRamseyNumber` (diagonal Ramsey) but not a general off-diagonal version. No existing reusable off-diagonal graph Ramsey number exists in the codebase or Mathlib. However, the definition could be generalized to a reusable `graphRamseyNumber₂ (H₁ : SimpleGraph α) (H₂ : SimpleGraph β) : ℕ` for potential reuse across problems. As-is, the ad-hoc definition is acceptable but a shared utility would be better. + +**Recommendation:** Replace `ContainsSubgraph` with `SimpleGraph.IsContained`, replace `C4` with `SimpleGraph.cycleGraph 4`, and consider extracting `ramseyC4Kn` into a general off-diagonal Ramsey number utility. + +--- + +## 2. Citations + +The website ([erdosproblems.com/159](https://www.erdosproblems.com/159)) lists the following references: + +- **[Er78, p.34]** — Original problem statement with $100 prize offer + +The formalization lists `[Er81]`, `[Er84d]`, `[EFRS78]`, and `[Sp77]` but **omits [Er78]**, which is the original source of the problem (with prize). Conversely, the website does list [Er81], [Er84d], [EFRS78], and [Sp77] as well, so those are correct. + +**Issues:** +- The citation shorthand references (e.g., `[Er81] Erdős, P., *Problems and results in graph theory*.`) lack full bibliographic detail — journal name, year, page numbers are missing. Some examples: + - `[EFRS78]` should be: Erdős, P., Faudree, R.J., Rousseau, C.C., and Schelp, R.H., *On cycle-complete graph Ramsey numbers*, J. Graph Theory **2** (1978), 53–64. + - `[Sp77]` should be: Spencer, J., *Asymptotic lower bounds for Ramsey functions*, Discrete Math. **20** (1977), 69–76. +- **Missing citation:** `[Er78, p.34]` should be added as the primary source per the website. + +--- + +## 3. Variants + +The website describes a single problem: whether there exists c > 0 such that R(C₄, Kₙ) ≪ n^{2−c}. The formalization captures exactly this statement. No additional variants are mentioned on the website. + +**Assessment:** All variants are captured. ✓ + +--- + +## 4. Readability + +The code is generally well-structured and readable. Observations: + +- The docstrings are clear and informative, correctly explaining the Ramsey-theoretic context and known bounds. +- The `C4` definition is intuitive but slightly non-standard — it uses raw modular arithmetic rather than the algebraic `ZMod` / circulant structure. Using Mathlib's `cycleGraph 4` would be more idiomatic. +- The main theorem statement `erdos_159` is clean and follows the established pattern for asymptotic upper bound conjectures. +- The namespace `Erdos159` is consistent with codebase conventions. +- Minor: The docstring on `ramseyC4Kn` says "the complement G^c contains a copy of K_n (i.e., G has an independent set of size n)" — this parenthetical is a helpful clarification. + +**Assessment:** Good readability. Minor improvement possible by using Mathlib definitions. + +--- + +## 5. Formalizability + +The problem as stated on erdosproblems.com is: + +> Is there some constant c > 0 such that R(C₄, Kₙ) ≪ n^{2−c}? + +This is precise and unambiguous. The Ramsey number R(C₄, Kₙ) is a well-defined classical quantity, and the asymptotic bound O(n^{2−c}) is standard. + +**Ambiguity assessment:** **Low ambiguity.** The only subtlety is the exact definition of R(C₄, Kₙ) — specifically, whether the C₄ containment is as a subgraph (injective homomorphism) or as an induced subgraph. The standard Ramsey-theoretic convention is subgraph containment, which is what the formalization uses. This is correct. + +--- + +## 6. Correctness + +**Mathematical analysis of the formalization:** + +The theorem states: +``` +∃ c : ℝ, 0 < c ∧ ∃ C : ℝ, 0 < C ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (ramseyC4Kn n : ℝ) ≤ C * (n : ℝ) ^ (2 - c) +``` + +This correctly formalizes "R(C₄, Kₙ) = O(n^{2−c}) for some c > 0": +- The existential over c > 0 captures "some constant c > 0". +- The existential over C > 0 and N₀ with the eventual bound captures the big-O notation. +- The bound `≤ C * n^(2-c)` is the correct formalization of `≪ n^{2−c}`. + +**Potential issues:** + +1. **`ramseyC4Kn` uses `sInf` over a potentially empty set.** If the set `{N : ℕ | ∀ G : SimpleGraph (Fin N), ContainsSubgraph G C4 ∨ ContainsSubgraph Gᶜ (⊤ : SimpleGraph (Fin n))}` is empty (which in practice it isn't, since Ramsey numbers are finite, but Lean doesn't know this a priori), then `sInf ∅ = 0` for `ℕ`. This is a common pattern in the codebase and is acceptable — the conjecture is stated unconditionally, and the fact that Ramsey numbers are finite is itself a theorem (the Ramsey theorem) that would be needed in any proof. However, this means `ramseyC4Kn 0 = 0` and `ramseyC4Kn 1 = 0` trivially (any graph on 0 vertices vacuously satisfies the condition, and K₁ embeds into the complement of any graph on ≥ 1 vertices), which is fine for the conjecture since we only care about large n. + +2. **The conjecture asks for a YES answer directly** (i.e., `theorem erdos_159 : ∃ c ...`) rather than using the `answer(sorry)` pattern with `↔`. Since this is an open conjecture asking "is it true that...", and the expected answer is YES (Erdős conjectured it to be true), this is a reasonable modeling choice. However, other open problems in the codebase (e.g., Problems 87, 60) use the `answer(sorry) ↔ ...` pattern to allow for either answer. This inconsistency is notable — if the conjecture turns out to be false, the current formalization would be unprovable. Using `answer(sorry) ↔ ∃ c ...` would be more flexible. + +3. **The `C4` definition is correct.** Verified: on `Fin 4`, `(i + 1) % 4 = j ∨ (j + 1) % 4 = i` correctly encodes the edges 0–1, 1–2, 2–3, 3–0 and is symmetric. The `loopless` proof is discharged by `decide`. The definition is extensionally equivalent to `cycleGraph 4`. + +4. **Complete graph representation.** `(⊤ : SimpleGraph (Fin n))` correctly represents Kₙ — every pair of distinct vertices is adjacent. + +**Assessment:** The formalization is **mathematically correct and complete**. The main suggestion is to consider using the `answer(sorry)` pattern for consistency with other open problems, since the problem is phrased as a yes/no question. No mathematical flaws identified. + +--- + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `ContainsSubgraph` and `C4` should use Mathlib equivalents | +| Citations | Missing `[Er78]`; existing citations lack full bibliographic detail | +| Variants | Complete ✓ | +| Readability | Good; minor improvements possible with Mathlib definitions | +| Formalizability | Low ambiguity, clearly formalizable ✓ | +| Correctness | Mathematically correct; consider `answer(sorry)` pattern for consistency | diff --git a/ai-review/16.md b/ai-review/16.md new file mode 100644 index 0000000000..ef9e633e0d --- /dev/null +++ b/ai-review/16.md @@ -0,0 +1,176 @@ +# AI Review: Erdős Problem 16 + +**File:** `FormalConjectures/ErdosProblems/16.lean` + +--- + +## 1. Code Reuse + +**Two of the three custom definitions in this file have equivalents in `FormalConjecturesForMathlib` that should be preferred.** + +### `HasNaturalDensityZero` + +The file defines its own `HasNaturalDensityZero` (lines 53–55) using `Set.ncard (S ∩ Set.Icc 1 N) / N → 0`. The project already has a well-developed density library at `FormalConjecturesForMathlib/Data/Set/Density.lean` which provides: + +- `Set.HasDensity (S : Set β) (α : ℝ) (A : Set β)` — general natural density via `Tendsto` of `partialDensity` (line 86–88). +- `partialDensity` uses `Set.interIio` (elements `< b`) rather than `Set.Icc 1 N` (elements in `[1, N]`). + +These two formulations are asymptotically equivalent (they differ by at most one element at each step, which vanishes in the limit), so `S.HasDensity 0` from the utility library is a drop-in replacement for `HasNaturalDensityZero S`. Using the shared definition would allow leveraging existing lemmas like `hasDensity_zero_of_finite`, `HasDensity.mono`, and `HasDensity.nonneg`. + +**Recommendation:** Replace `HasNaturalDensityZero S` with `S.HasDensity 0` (from `Set.HasDensity`). + +### `IsInfiniteAP` + +The file defines `IsInfiniteAP` (lines 61–62) as `∃ (a d : ℕ), 0 < d ∧ AP = {n : ℕ | ∃ m : ℕ, n = a + m * d}`. The utility file `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` provides: + +- `Set.IsAPOfLengthWith (s : Set α) (l : ℕ∞) (a d : α)` — which for `l = ⊤` characterizes infinite APs as `{a + n • d | n : ℕ}` (line 43–44). +- `Set.IsAPOfLength (s : Set α) (l : ℕ∞)` — existentially quantified over `a` and `d` (line 121–122). + +Using `AP.IsAPOfLength ⊤` would be close, but note a subtlety: the utility definition does not enforce `d > 0` (it allows degenerate APs). The file's `IsInfiniteAP` requires `0 < d`, which is mathematically important here — without it, a constant sequence `{a}` would qualify as an "infinite AP." However, `IsAPOfLengthWith` with `l = ⊤` implicitly requires the set to be infinite (via the cardinality constraint `ENat.card s = ⊤`), which rules out the `d = 0` degenerate case in ℕ. So `AP.IsAPOfLength ⊤` is actually equivalent. + +Additionally, Problem 343 defines `ContainsInfiniteAP` (line 52–53) which is a *containment* predicate (`∀ n, a + n * d ∈ S`) rather than an *equality* predicate. Problem 16 requires set equality, so 343's version is not directly applicable. + +**Recommendation:** Replace `IsInfiniteAP AP` with `AP.IsAPOfLength ⊤` from the AP utility. This requires checking that the `d = 0` edge case is properly handled (it is, since `ENat.card` of a singleton is 1, not ⊤). + +### `oddNotPowerOfTwoPlusPrime` + +This is problem-specific and correctly scoped to the `Erdos16` namespace. No reuse concern. + +--- + +## 2. Citations + +**Website (erdosproblems.com/16) references:** +- **[Er50]** — Erdős, _On integers of the form 2^k + p and some related problems_. Summa Brasil. Math. **2** (1950), 113–123. +- **[Er95]** — Erdős, _Some of my favourite problems in various branches of combinatorics_. Combinatorics '94 (1995), p. 167. +- **[Ch23]** — Chen, _The set of odd integers not of the form 2^k + p is not the union of an infinite arithmetic progression and a density-zero set_ (2023). + +**Formalization docstring (lines 24–36) references:** +- [Er50] ✅ Matches. +- [Er95] ✅ Matches (page reference "p.167" in the theorem docstring at line 68 is consistent). +- [Ch23] ✅ Matches. + +**Related problems from the website:** Problems 9, 10, 11 are listed as related. The formalization does not mention these. This is not a defect but could be noted in the docstring for discoverability. + +**OEIS:** The website references A006285. The formalization does not mention this. Adding a comment would aid readability. + +**Overall:** Citations are complete and accurate. + +--- + +## 3. Variants + +The erdosproblems.com page for Problem 16 states only the single question: "Is the set of odd integers not of the form 2^k + p the union of an infinite arithmetic progression and a set of density 0?" No additional variants are mentioned on the website. + +However, the docstring (lines 24–26) notes two related results that one might consider formalizing as sub-statements: + +1. **Erdős [Er50]:** The set *contains* an infinite arithmetic progression (proved via covering congruences). This is a weaker positive result. +2. **Chen [Ch23]:** The set is *not* the union of an infinite AP and a density-zero set (the negative answer). + +The formalization captures only the final resolved question (Chen's negative answer). The intermediate result (1) could be a standalone lemma: + +```lean +theorem erdos_16_contains_AP : ContainsInfiniteAP oddNotPowerOfTwoPlusPrime +``` + +This is not strictly required but would be a natural companion formalization of the "covering congruences" result. + +**Assessment:** The main variant is captured. The intermediate positive result is a reasonable optional addition. + +--- + +## 4. Readability + +The code is well-structured and readable. Minor notes: + +- The namespace `Erdos16` and definition names (`oddNotPowerOfTwoPlusPrime`, `HasNaturalDensityZero`, `IsInfiniteAP`) are clear and self-documenting. +- The docstrings on all three definitions and the main theorem are thorough and include LaTeX. +- The `open Filter` at line 38 is needed for `atTop` and `nhds` in `HasNaturalDensityZero`. If the custom definitions are replaced with utility imports, this may become unnecessary. + +**One readability improvement:** In `oddNotPowerOfTwoPlusPrime` (line 47), the quantifier `∀ (k : ℕ) (q : ℕ), Nat.Prime q → n ≠ 2 ^ k + q` reads naturally, but naming the prime variable `q` rather than `p` is slightly surprising given the docstring uses `p`. Consider renaming to `p` for consistency. + +--- + +## 5. Formalizability + +**The problem is precise and obviously formalizable.** The statement "Is set X the union of an infinite AP and a density-zero set?" involves only: +- A well-defined set of natural numbers (odd numbers not of the form 2^k + p). +- The standard notion of natural density zero. +- The standard notion of an infinite arithmetic progression. +- Set union and equality. + +**Ambiguity assessment: Very low.** + +The only potential source of ambiguity is the range of `k`: +- **k ≥ 0** (i.e., k ∈ ℕ): This is what the formalization uses. It matches OEIS A006285, which lists 1, 127, 149, 251, 331, ... +- **k ≥ 1**: Some formulations of de Polignac's conjecture use k ≥ 1. Under this convention, 3 would enter the set (since 3 ≠ 2^k + p for any k ≥ 1 and prime p), but A006285 excludes 3. + +The formalization's choice of k ≥ 0 is consistent with Erdős's original paper [Er50] and OEIS A006285, and is the standard convention. This is not a genuine ambiguity in the problem—it is resolved by the literature. + +--- + +## 6. Correctness + +### Main theorem structure + +The theorem states: +```lean +theorem erdos_16 : answer(False) ↔ + ∃ (AP D : Set ℕ), + IsInfiniteAP AP ∧ + HasNaturalDensityZero D ∧ + oddNotPowerOfTwoPlusPrime = AP ∪ D +``` + +Since `answer(False) = False`, this iff encodes: +- (→) `False → ∃ ...` — vacuously true. +- (←) `∃ ... → False` — i.e., `¬ ∃ (AP D : Set ℕ), IsInfiniteAP AP ∧ HasNaturalDensityZero D ∧ oddNotPowerOfTwoPlusPrime = AP ∪ D`. + +This correctly formalizes "the answer is no: there do not exist an infinite AP and a density-zero set whose union equals the target set." ✅ + +### `oddNotPowerOfTwoPlusPrime` definition + +```lean +def oddNotPowerOfTwoPlusPrime : Set ℕ := + {n : ℕ | Odd n ∧ ∀ (k : ℕ) (q : ℕ), Nat.Prime q → n ≠ 2 ^ k + q} +``` + +This correctly defines the set of odd natural numbers n such that for all k ≥ 0 and all primes q, n ≠ 2^k + q. The set includes 0? No: `Odd 0` is false in Lean/Mathlib, so 0 is correctly excluded. ✅ + +### `HasNaturalDensityZero` definition + +```lean +def HasNaturalDensityZero (S : Set ℕ) : Prop := + Tendsto (fun N : ℕ => (Set.ncard (S ∩ Set.Icc 1 N) : ℝ) / (N : ℝ)) + atTop (nhds 0) +``` + +This correctly says |S ∩ {1, ..., N}| / N → 0 as N → ∞. Standard definition of natural density zero. ✅ + +### `IsInfiniteAP` definition + +```lean +def IsInfiniteAP (AP : Set ℕ) : Prop := + ∃ (a d : ℕ), 0 < d ∧ AP = {n : ℕ | ∃ m : ℕ, n = a + m * d} +``` + +This correctly characterizes an infinite one-sided arithmetic progression {a, a+d, a+2d, ...} with positive common difference d. ✅ + +### Overall correctness + +The formalization is **mathematically correct and complete**. It faithfully captures Erdős's question and Chen's negative resolution. An experienced mathematician would not identify any flaws. + +**No issues attributable to ambiguity.** + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ⚠️ `HasNaturalDensityZero` and `IsInfiniteAP` should use existing utility definitions from `FormalConjecturesForMathlib` | +| Citations | ✅ Complete and accurate. Optionally add related problems 9/10/11 and OEIS A006285. | +| Variants | ✅ Main variant captured. Optional: formalize the intermediate "contains an infinite AP" result. | +| Readability | ✅ Good. Minor: rename `q` → `p` in `oddNotPowerOfTwoPlusPrime` for docstring consistency. | +| Formalizability | ✅ Unambiguous and straightforward to formalize. | +| Correctness | ✅ Mathematically correct and complete. No flaws identified. | diff --git a/ai-review/161.md b/ai-review/161.md new file mode 100644 index 0000000000..20a8e34920 --- /dev/null +++ b/ai-review/161.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 161 + +## 1. Code Reuse + +**Significant reuse opportunity with Problem 162.** The `IsBalancedColouring` in 161 is a direct generalization of `IsEdgeBalanced` in 162 — Problem 162 is the special case `t = 2` (with the distinction that 162 uses strict inequality `<` while 161 uses `≤`). Ideally, `IsEdgeBalanced` in 162 could be defined in terms of `IsBalancedColouring` from 161, or a shared definition could be extracted into `FormalConjecturesForMathlib`. + +**Problem 563** also formalizes essentially the same function `F(n, α)` as Problem 162, but using a different representation of the colouring (`Fin n → Fin n → Bool` with explicit symmetry instead of `Finset (Fin n) → Bool`). This represents a third independent definition of closely related concepts. + +**Ramsey.lean** in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` using a very similar `sInf` + `Finset (Fin m) → Bool` pattern. The balanced colouring threshold is a quantitative refinement of hypergraph Ramsey numbers, and both share the same colouring representation. + +**Recommendation:** Consider extracting `IsBalancedColouring` and `fBalanced` (or a common generalization) into `FormalConjecturesForMathlib` so that Problems 161, 162, and 563 can share definitions. At minimum, Problem 162's `IsEdgeBalanced` should reference or be derived from 161's more general definition. + +## 2. Citations + +The formalization cites: +- **[Er90b]** — "Erdős, P., _Problems and results on graphs and hypergraphs: similarities and differences_. Mathematics of Ramsey theory, Algorithms Combin. 5 (1990), 12-28." This matches the website's source ("Er90b, p. 21"). **Correct.** +- **[CFS11]** — "Conlon, D., Fox, J., and Sudakov, B., _An approximate version of Sidorenko's conjecture_. Geometric and Functional Analysis 20 (2010), 1354-1366." + +**Potential citation issue with [CFS11].** The website mentions Conlon, Fox, and Sudakov proving `F^(3)(n, α) ≪ √(log n)` for fixed `α > 0`, but does not specifically attribute this to the Sidorenko's conjecture paper (GAFA 2010). The Sidorenko paper is about graph homomorphism inequalities, not directly about balanced hypergraph colourings. The relevant CFS result for this problem may come from a different paper. This citation should be verified against the actual source of the `F^(3)` upper bound. + +The website also mentions **Problem 562** and **Problem 563** as related problems, which are not referenced in the formalization's docstring. Adding cross-references to these would be helpful. + +The website notes a **$500 prize**, which is not mentioned in the formalization. + +## 3. Variants + +The formalization captures the **upper bound direction** of the conjecture: for `α > 0`, `F^(t)(n, α) ≤ C · (log n)^D`. + +**Missing variants / aspects:** +- **The "single jump" characterization.** The website states Erdős's conjecture more broadly: "does F^(t)(n, α) increase continuously, or does it have jumps? Is there only one jump?" The polynomial-in-log-n upper bound captures the essential content (since the lower bound `(log n)^{1/(t-1)}` is known), but the broader "single jump" question is not explicitly stated. +- **Known lower bound.** The formalization does not capture the known lower bound `F^(t)(n, α) ≫_α (log n)^{1/(t-1)}` for `α > 0`, which together with the conjectured upper bound would give a complete polynomial-in-log-n characterization. +- **The t = 3 case.** The website notes that Conlon, Fox, and Sudakov proved `F^(3)(n, α) ≪ √(log n)` for fixed `α > 0`, establishing the conjecture for `t = 3`. This resolved case could be stated as a separate theorem. +- **Erdős's remark about t > 3.** Erdős expressed hope the conjecture might be wrong for `t > 3`. This nuance is not captured but is arguably commentary rather than a mathematical statement. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good:** Clear docstrings on both `IsBalancedColouring` and `fBalanced` explaining the mathematical meaning. +- **Good:** Appropriate use of `noncomputable` for the `sInf`-based definition. +- **Good:** The module docstring gives context about the problem and its significance. +- **Minor:** The coloring function type `c : Finset (Fin n) → Bool` colors *all* subsets, but is only evaluated on `t`-element subsets. This is the standard convention in this codebase (matching `hypergraphRamsey`) and is acceptable, though a dependent type like `{S : Finset (Fin n) // S.card = t} → Bool` would be more precise. The current approach is the pragmatic choice. +- **Minor:** The variable name `fBalanced` is somewhat generic. Something like `balancedColoringThreshold` or `F_t` would be more descriptive, though the current name is consistent with the concise naming convention in the codebase. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise and directly formalizable: +- The definition of `F^(t)(n, α)` is completely unambiguous — it involves finite combinatorial objects (2-colourings of t-subsets) with a clear quantitative threshold. +- The conjecture is a concrete asymptotic upper bound: `F^(t)(n, α) ≤ C · (log n)^D` for sufficiently large `n`. + +**One subtle point:** The original Erdős formulation ("the jump occurs all in one step at 0") is qualitative and somewhat informal. The formalization makes a specific quantitative choice (polynomial-in-log-n upper bound) which is a reasonable and standard interpretation, but other formalizations of "single jump at 0" are conceivable (e.g., a statement about continuity of growth rates for `α > 0`). The chosen formalization captures the mainstream interpretation. + +## 6. Correctness + +**The formalization is mathematically correct and captures the core conjecture.** + +Detailed verification: + +- **`IsBalancedColouring` definition:** For every `X ⊆ Fin(n)` with `|X| ≥ m`, for each color `b`, the count of `t`-element subsets of `X` colored `b` is `≥ α · C(|X|, t)`. This matches the website's definition ("at least `α · C(|X|, t)` many `t`-subsets of `X` of each color"). The use of `≤` (non-strict inequality) is consistent with "at least." ✓ + +- **`fBalanced` definition:** `sInf { m | ∃ c, IsBalancedColouring n t m α c }` — the smallest `m` such that there *exists* a good colouring. This matches "the smallest `m` such that we can 2-color." ✓ + +- **Conjecture statement:** + - `∀ t : ℕ, 2 ≤ t` — correct, the problem is for `t`-uniform hypergraphs with `t ≥ 2`. ✓ + - `∀ α : ℝ, 0 < α → α < 1/2` — correct, strict inequalities on both sides. ✓ + - `∃ C : ℝ, 0 < C ∧ ∃ D : ℝ, 0 < D` — the constants depend on `t` and `α` (since they come after the universal quantifiers). ✓ + - `∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → (fBalanced t n α : ℝ) ≤ C * (Real.log ↑n) ^ D` — polynomial-in-log upper bound for sufficiently large `n`. ✓ + +- **Edge case handling:** For small `n`, `Real.log(n)` can be ≤ 0 (e.g., `n = 0` or `n = 1`), making `C · (log n)^D` non-positive or zero. Since `fBalanced` is a natural number ≥ 0, the bound would be vacuously hard to satisfy. The `∃ N₀` clause correctly excludes such small values. ✓ + +- **Potential concern:** The exponent `D` is universally quantified with `0 < D` but is not required to be rational or an integer. For the polynomial-in-log-n bound, allowing real exponents is strictly more general than necessary but does not introduce incorrectness — it only makes the conjecture potentially easier to prove. This is a minor over-generalization that is standard in such formalizations. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and correct rendering of the mainstream interpretation of Erdős Problem 161. diff --git a/ai-review/162.md b/ai-review/162.md new file mode 100644 index 0000000000..8a3f764df9 --- /dev/null +++ b/ai-review/162.md @@ -0,0 +1,92 @@ +# Review: Erdős Problem 162 + +## 1. Code Reuse + +**Problem 161 (`FormalConjectures/ErdosProblems/161.lean`) is nearly identical in structure.** Problem 162 is the special case t = 2 of Problem 161's t-uniform hypergraph setting. Specifically: + +- `Erdos162.IsEdgeBalanced n m α c` is essentially `Erdos161.IsBalancedColouring n 2 m α c`, except for inequality strictness (`<` in 162 vs `≤` in 161). +- `Erdos162.F n α` mirrors `Erdos161.fBalanced 2 n α` with the same `sInf` pattern. +- Both use `c : Finset (Fin n) → Bool` for colorings and `powersetCard` for subset enumeration. + +**Recommendation:** Problem 162's definitions could be expressed in terms of Problem 161's, or a shared parameterized definition could be factored out. At minimum, a comment noting the relationship would aid readability. + +**Other reuse opportunities:** +- Problem 76 (`Erdos76.EdgeTwoColoring`) defines `Sym2 (Fin n) → Bool`, a more precise type for edge 2-colorings. Problem 162 could use this instead of the over-specified `Finset (Fin n) → Bool`. +- Problem 165 uses the same `(c - ε) * f(n) ≤ g(n) ≤ (c + ε) * f(n)` pattern for encoding `~` asymptotics and could share a common asymptotic definition. + +## 2. Citations + +The website (https://www.erdosproblems.com/162) lists: + +> [Er90b, p.21] + +The formalization's citation: + +> [Er90b] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and differences*. Mathematics of Ramsey theory, Algorithms and Combinatorics, 5 (1990), Springer, Berlin, 12-28. + +This matches the website. The page reference `p.21` appears in the theorem docstring (`[Er90b, p.21]`). The full bibliographic entry is consistent with the website's recommended citation format. **No issues.** + +The website also credits contributors Wouter Cames van Batenberg and KoishiChan, which are not reflected in the formalization (nor expected to be). + +## 3. Variants + +The website does not mention any explicit variants of Problem 162. However: + +- **Relationship to Problem 161:** Problem 161 is the natural generalization to t-uniform hypergraphs. The formalization does not cross-reference this. A note in the module docstring linking to Problem 161 as the hypergraph generalization would be valuable. +- **No other variants appear to be missing** from the formalization. + +## 4. Readability + +**Generally good**, with a few suggestions: + +- **Coloring domain:** The type `c : Finset (Fin n) → Bool` assigns colors to *all* finsets of `Fin n`, not just 2-element subsets (edges). While this doesn't affect correctness (only 2-element subsets are queried via `powersetCard 2`), it is over-specified. Using `Sym2 (Fin n) → Bool` (as in Problem 76) or restricting the domain would make the edge-coloring intent clearer. +- **Name consistency:** Problem 161 uses `IsBalancedColouring` / `fBalanced`; Problem 162 uses `IsEdgeBalanced` / `F`. The naming conventions differ despite the problems being closely related. +- **The `F` function name** is terse but matches the mathematical notation, which is acceptable. + +## 5. Formalizability + +**The problem is precise enough to be obviously formalizable.** The conjecture has a clear quantitative statement: F(n, α) ~ c_α log n. The definitions of F(n, α) and "α-balanced" are unambiguous once the direction of the quantifier (∃ vs ∀ over colorings) is fixed. + +**Minor ambiguity in the source:** The original problem says "for a 2-colouring of the edges of K_n, let F(n, α) be the smallest m..." The phrase "for a 2-colouring" could be read as "for every" (∀) or "for some" (∃). The formalization uses ∃ (there exists a coloring), which is the correct interpretation: F(n, α) measures the best achievable threshold over all colorings. The ∀ interpretation would make F(n, α) infinite (a monochromatic coloring is never balanced for α > 0). + +**Ambiguity level: Low.** The ∃ interpretation is the only mathematically meaningful one. + +## 6. Correctness + +### 6a. Range of α — **BUG** + +The formalization uses `0 ≤ α → α ≤ 1 / 2 →` (non-strict on both sides). This is problematic: + +- **α = 1/2:** The balanced condition requires each color class to have *strictly more than* (1/2) · C(|X|, 2) edges. Since the two color classes partition all C(|X|, 2) edges, both cannot simultaneously exceed half. The condition is unsatisfiable for any coloring, making `{m | ∃ c, IsEdgeBalanced n m (1/2) c} = ∅`, so `F n (1/2) = sInf ∅ = 0` (in Lean's ℕ lattice). The conjecture then asks for `0 ~ c · log n` with c > 0, which is false. **The conjecture is false at α = 1/2.** + +- **α = 0:** The condition becomes `0 < |color class|`, i.e., each color class is non-empty. This is meaningful but may have different asymptotic behavior than the α > 0 case (Problem 161 explicitly discusses how the α = 0 case has iterated-logarithm growth for t ≥ 3). + +**Compare with Problem 161**, which uses `0 < α → α < 1 / 2 →` (strict on both sides). Problem 162 should match: the range should be **0 < α** and **α < 1/2** (strict inequalities). + +### 6b. Inequality direction (strict vs non-strict) + +The formalization uses strict inequality `α * C(|X|, 2) < |color class|` ("more than α fraction"), while Problem 161 uses non-strict `α * C(|X|, t) ≤ |color class|` ("at least α fraction"). The docstring says "more than an α fraction," so strict is consistent with the stated intent. However, for the asymptotic conjecture, the difference between strict and non-strict is immaterial (it changes F by at most a constant). **Not a bug, but worth noting the inconsistency with Problem 161.** + +### 6c. Asymptotic encoding + +The formalization encodes `F(n, α) ~ c_α log n` as: + +``` +∃ c, 0 < c ∧ ∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, + (c - ε) * log n ≤ F(n, α) ≤ (c + ε) * log n +``` + +This is equivalent to `F(n, α) / log n → c` as `n → ∞`, which is the standard definition of `~`. The `(c - ε)` vs `c(1 - ε)` formulation is equivalent since ε ranges over all positive reals. **Correct.** + +### 6d. Definition of F via sInf + +The use of `sInf` over `ℕ` is appropriate. If the set is empty (no coloring achieves balance at any threshold), `sInf ∅ = 0` in Lean. For α ∈ (0, 1/2), any 2-coloring is balanced at threshold n (vacuously, since no subset has more than n elements), so the set is non-empty and `sInf` is well-defined. **Correct for the valid range of α.** + +### Summary of Issues + +| Issue | Severity | Description | +|-------|----------|-------------| +| α range includes endpoints | **High** | `0 ≤ α ∧ α ≤ 1/2` should be `0 < α ∧ α < 1/2`. The conjecture is false at α = 1/2 and likely wrong at α = 0. | +| No cross-reference to Problem 161 | Low | Problem 162 is the t=2 case of 161; this relationship should be documented. | +| Over-specified coloring domain | Low | `Finset (Fin n) → Bool` could be `Sym2 (Fin n) → Bool` for clarity. | +| Inconsistent naming with Problem 161 | Low | Minor style inconsistency. | diff --git a/ai-review/163.md b/ai-review/163.md new file mode 100644 index 0000000000..05cd5e0318 --- /dev/null +++ b/ai-review/163.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 163 + +## 1. Code Reuse + +**Significant duplication exists.** Three definitions in this file are duplicated or near-duplicated elsewhere: + +- **`containsCopy`** (line 45): Identical (modulo capitalization `containsCopy` vs `ContainsCopy`) to `Erdos181.ContainsCopy` in `FormalConjectures/ErdosProblems/181.lean:52` and `Erdos146.ContainsSubgraph` / `Erdos113.ContainsSubgraph` (same definition, different name). More importantly, **Mathlib already provides `SimpleGraph.IsContained`** (imported via `Mathlib.Combinatorics.SimpleGraph.Copy`), which is used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean:46`. The local `containsCopy` should be replaced with `SimpleGraph.IsContained` from Mathlib. + +- **`ramseyDiag`** (line 57): Identical to `Erdos181.ramseyDiag` in `FormalConjectures/ErdosProblems/181.lean:57`. Both could be refactored into a shared definition in `FormalConjecturesForMathlib/`. + +- **`IsDDegenerate`** (line 50): A `Finset`-based degeneracy definition. Compare with the more general `Set`-based `IsRDegenerateGraph` in `FormalConjectures/ErdosProblems/146.lean:55`, which works for infinite vertex types. Since Problem 163 only needs finite graphs (`Fin n`), either definition suffices, but consolidating into one shared definition (preferably the `Set`-based one for generality, or the `Finset`-based one for computability) would reduce duplication. + +**Recommendation:** Extract `containsCopy`/`ramseyDiag`/`IsDDegenerate` into shared library files, or use the existing Mathlib `IsContained`. + +## 2. Citations + +The formalization includes three references: `[BuEr75]`, `[Er82e]`, and `[Le17]`. + +**Comparison with [erdosproblems.com/163](https://www.erdosproblems.com/163):** + +- **[BuEr75]**: Present on the website and in the formalization. The formalization gives the title as *"On the Ramsey multiplicity of graphs — problems and recent results"* while the website lists `[BuEr75]` without expanded details. The full citation is: Burr, S.A. and Erdős, P., *On the magnitude of generalized Ramsey numbers for graphs*, Infinite and finite sets, Vol. 1 (1975), 214–240. Note that Problem 181 uses a different title for the same `[BuEr75]` reference — there may be a citation mismatch. +- **[Er82e]**: Present on the website. The formalization gives a reasonable expansion. +- **[Le17]**: Present on the website. Lee, C., *Ramsey numbers of degenerate graphs*, Ann. of Math. (2017). This is correct. + +**Missing from formalization:** The website credits Zach Hunter and mentions a **related Problem 800**. Neither is noted in the formalization. + +## 3. Variants + +The website describes the following variants/related results: + +| Variant | In formalization? | +|---|---| +| Core statement: R(H) ≪_d n for d-degenerate H | **Yes** (main theorem) | +| Equivalent: union of c forests ⟹ R(H) ≪_c n | **Mentioned in docstring** but not separately formalized | +| Lee's bound: R(H) ≤ 2^{2^{O(d)}} · n | **Mentioned in docstring** but not formalized as a separate theorem | +| Refined bound: R(H) ≤ 2^{d · 2^{O(χ(H))}} · n | **Missing** | +| Outstanding conjecture: R(H) ≤ 2^{O(d)} · n | **Missing** | +| Related Problem 800 | **Missing** | + +The most notable omission is the **outstanding conjecture** that the optimal constant should be singly exponential: C_d = 2^{O(d)}. This is a natural follow-up that could be formalized as a strengthening. The refined bound involving the chromatic number χ(H) is also mathematically interesting but harder to formalize without additional infrastructure. + +## 4. Readability + +The code is **well-structured and readable**. Minor notes: + +- The naming `containsCopy` uses lowerCamelCase while the identical definition in Problem 181 uses `ContainsCopy` (UpperCamelCase). Since this is a `def` (not a theorem), UpperCamelCase is the Lean 4 / Mathlib convention for definitions. Should be `ContainsCopy`. +- The docstrings are clear and mathematically precise. +- The namespace `Erdos163` is clean and self-contained. +- The module docstring provides good mathematical context. + +## 5. Formalizability + +**High formalizability.** The Burr-Erdős conjecture is a clean, precise quantitative statement: + +> For every d ≥ 1, there exists C_d > 0 such that for every d-degenerate graph H on n vertices, R(H,H) ≤ C_d · n. + +There is **no ambiguity** in the statement. All terms (d-degenerate, Ramsey number, linear bound) have standard precise definitions. The only minor interpretive choice is whether "R(H)" means the diagonal Ramsey number R(H,H) (as formalized) versus a more general off-diagonal version — but the standard reading of the Burr-Erdős conjecture is indeed the diagonal case. **Assessment: unambiguous, fully formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct** with one minor quibble: + +### Correct aspects: + +- **`IsDDegenerate`**: Correctly captures d-degeneracy. For every nonempty Finset S, there exists v ∈ S with at most d neighbors in S. Since `SimpleGraph` is loopless, `S.filter (H.Adj v)` correctly counts only proper neighbors of v within S. This is equivalent to the standard definition that every subgraph has minimum degree ≤ d. + +- **`ramseyDiag`**: Correctly defines the diagonal Ramsey number as sInf of {N | every SimpleGraph on Fin N has G or G^c containing H}. A SimpleGraph G and its complement G^c partition the edge set of K_N, so this is equivalent to the standard 2-coloring formulation. Using `sInf` is safe: for any graph with at least one edge, the finite Ramsey theorem guarantees the set is nonempty, so sInf gives the correct minimum. For the empty set case, sInf ∅ = 0 in ℕ, and 0 ≤ C · n holds trivially. + +- **`containsCopy`**: Correctly defines subgraph containment as an injective graph homomorphism (not necessarily induced). + +- **Main theorem quantification**: ∀ d ≥ 1, ∃ C > 0, ∀ n, ∀ H on Fin n, IsDDegenerate H d → ramseyDiag H ≤ C · n. The constant C depends on d but not on H or n. This is the correct formulation. + +### Minor quibble: + +- **The d ≥ 1 restriction** (`1 ≤ d`): The conjecture is trivially true for d = 0 as well (0-degenerate graphs are edgeless, and R(H) = n for an edgeless graph on n vertices, giving R(H) ≤ 1 · n). The restriction is unnecessary but **not incorrect** — it simply doesn't cover the trivial case. This matches how the conjecture is typically stated in the literature ("for any d ≥ 1"). + +### Verdict: + +**Correct and complete** as a formalization of the Burr-Erdős conjecture. No mathematical flaws. The omission of the stronger outstanding conjecture (C_d = 2^{O(d)}) and the refined chromatic-number-dependent bound are acceptable since these are separate results/conjectures beyond the original Burr-Erdős statement. diff --git a/ai-review/164.md b/ai-review/164.md new file mode 100644 index 0000000000..5d5b9f6c9c --- /dev/null +++ b/ai-review/164.md @@ -0,0 +1,133 @@ +# Review: Erdős Problem 164 + +**File:** `FormalConjectures/ErdosProblems/164.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `IsPrimitive` definition — could use Mathlib's `IsAntichain`.** + +The file defines `Erdos164.IsPrimitive A` as `∀ a ∈ A, ∀ b ∈ A, a ∣ b → a = b`. This is logically equivalent to `IsAntichain (· ∣ ·) A` from Mathlib (since divisibility is antisymmetric on ℕ for positive naturals, and the `A ⊆ {n | 2 ≤ n}` constraint excludes 0). The two are contrapositives: `IsPrimitive` says `a ∣ b → a = b`; `IsAntichain` says `a ≠ b → ¬(a ∣ b)`. + +The same or equivalent definition appears in multiple other files: + +| File | Definition | Type | +|------|-----------|------| +| `ErdosProblems/164.lean` | `Erdos164.IsPrimitive` | `Set ℕ → Prop` | +| `ErdosProblems/872.lean` | `Erdos872.IsPrimitive` | `Finset ℕ → Prop` | +| `ErdosProblems/882.lean` | `Erdos882.IsPrimitive` | `Finset ℕ → Prop` | +| `ErdosProblems/1110.lean` | `IsDivisibilityAntichain` | `Finset ℕ → Prop` | +| `ErdosProblems/123.lean` | `IsAntichain (· ∣ ·)` (Mathlib) | `Set ℕ → Prop` | + +**Note:** `FormalConjecturesForMathlib/NumberTheory/Primitive.lean` defines `Set.IsPrimitive S n`, which is a *different* concept — it tests whether a single element `n` is primitive *within* `S` (no proper divisor of `n` lies in `S`). This is per-element primitivity, not a property of the entire set being an antichain, and is not directly applicable here. + +**Recommendation:** Replace `Erdos164.IsPrimitive` with Mathlib's `IsAntichain (· ∣ ·)`, as Problem 123 already does. This eliminates the local definition and improves consistency across the codebase. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/164](https://www.erdosproblems.com/164):** + +The website lists references: [Er35], [Er76g], [Er86], [Li23], and [Va99]. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős 1935 [Er35] | `[Er35]` — title and journal given | [Er35] | **OK.** Matches. | +| Erdős 1976 [Er76g] | `[Er76g]` — title given | [Er76g] | **OK.** Matches. | +| Erdős 1986 [Er86] | `[Er86]` — title given | [Er86] | **OK.** Matches. | +| Lichtman 2023 [Li23] | `[Li23]` — title and journal given | [Li23] | **OK.** Matches. | +| Varadharajan 1999 [Va99] | Not cited | [Va99, §1.12] | **Missing.** The website lists this reference (section 1.12). | + +**Additional issues:** +- The citations use shorthand titles (e.g., *Problems and results on combinatorial number theory*) without volume/page numbers. While the existing format is consistent with other files in the project, full bibliographic details (as in Problem 8's `[BBMST22]` citation) would improve traceability. + +--- + +## 3. Variants + +The formalization captures only the main inequality conjecture (now proved). Possible missing variants: + +**1. Convergence of the sum (Erdős 1935):** +The docstring notes that [Er35] proved `∑_{n ∈ A} 1/(n log n)` converges for any primitive set. This is a prerequisite result and could be formalized as a separate theorem: +```lean +theorem erdos_164.variants.convergence : + ∀ A : Set ℕ, IsPrimitive A → A ⊆ {n : ℕ | 2 ≤ n} → + Summable (fun n : A => (1 : ℝ) / (((n : ℕ) : ℝ) * Real.log ((n : ℕ) : ℝ))) := by + sorry +``` + +**2. Erdős's weaker 1935 bound:** +Erdős originally showed `∑_{n ∈ A} 1/(n log n) ≤ C` for some absolute constant `C`. This weaker result preceded the sharp bound via primes. + +**Assessment:** The core conjecture is correctly captured. The convergence result from [Er35] is a natural companion theorem, especially since it is explicitly mentioned in the docstring and on the website. + +--- + +## 4. Readability + +The code is concise and well-structured. Observations: + +- **Docstring:** Clear and informative. Explains the mathematical content, states the inequality in LaTeX, and notes the resolution by Lichtman. The `IsPrimitive` definition has an inline docstring explaining the concept. +- **Namespace:** `Erdos164` is appropriate and consistent with the project convention. +- **Coercions:** The expression `(((n : ℕ) : ℝ))` involves nested coercions (subtype → ℕ → ℝ) that are verbose but unavoidable in Lean 4 for this kind of subtype-indexed sum. This is standard for the project. +- **`open Real`:** Appropriately scoped to bring `Real.log` into scope. + +**Minor suggestion:** The docstring could explicitly note that this was the "Erdős primitive set conjecture" — the name by which it is widely known in the literature and under which Lichtman's paper is titled. This would aid discoverability. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise and well-established: +- "Primitive set" (antichain under divisibility) is a standard combinatorial number theory concept with no ambiguity. +- The sum `∑ 1/(n log n)` is well-defined for n ≥ 2 (since log n > 0). +- The comparison set (all primes) is unambiguous. +- The inequality direction is clear. + +The only potential subtlety is the choice of logarithm base. The natural logarithm is standard in this context, and `Real.log` in Mathlib is the natural logarithm, so this is correct. + +**Ambiguity level: Very low.** The statement is one of the cleanest in the Erdős problems corpus — a concrete, sharp inequality with a specific extremal set. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** + +### Definition of `IsPrimitive` + +`∀ a ∈ A, ∀ b ∈ A, a ∣ b → a = b` correctly captures the antichain-under-divisibility property. Combined with `A ⊆ {n | 2 ≤ n}`, this excludes 0 and 1: +- **0 is excluded:** If 0 ∈ A and b ∈ A with b > 0, then b ∣ 0 but b ≠ 0, contradicting primitivity. +- **1 is excluded:** By the constraint `2 ≤ n`. +- Excluding 1 is important: if 1 ∈ A, then A = {1} is forced (since 1 ∣ n for all n), and the sum would be 1/(1 · log 1) = 1/0, which is ill-defined. + +### The sum via `tsum` + +The formalization uses `∑' n : A` (Mathlib's `tsum` over the subtype `↥A`). This is the correct choice: +- Primitive subsets of {n | 2 ≤ n} can be infinite (e.g., the primes), so `Finset.sum` would be inappropriate. +- Erdős [Er35] proved these sums converge, so `tsum` returns the correct value (not the junk value 0 it returns for non-summable functions). +- For any primitive A where summability somehow failed, `tsum` would return 0, making the inequality trivially true (since the RHS is positive). So the theorem remains true even in degenerate cases, which is desirable. + +### The RHS: sum over primes + +`∑' p : {p : ℕ | Nat.Prime p}` sums over the subtype of all primes. The sum `∑_p 1/(p log p)` converges (comparable to `∑ 1/(n log² n)` by the Prime Number Theorem), so `tsum` gives the correct value. + +### Correspondence to Lichtman's theorem + +Lichtman [Li23] proved exactly this statement: for any primitive set A ⊆ {2, 3, 4, ...}, the sum `∑_{n ∈ A} 1/(n ln n) ≤ ∑_p 1/(p ln p)`. The formalization faithfully captures this. The `@[category research solved]` tag correctly reflects the resolved status. + +### AMS classification + +`AMS 11` (number theory) is appropriate. + +### Minor observation on `A ⊆ {n : ℕ | 2 ≤ n}` + +This constraint is written as a hypothesis rather than baked into the definition of `IsPrimitive`. This is a sound design choice — it separates the algebraic property (antichain) from the domain restriction, and matches how the theorem is stated in the literature. + +**Verdict: Correct. The formalization faithfully captures Lichtman's theorem (the Erdős primitive set conjecture). No mathematical errors detected. The only actionable improvements are (1) replacing the local `IsPrimitive` with Mathlib's `IsAntichain (· ∣ ·)` and (2) adding the missing [Va99] citation.** diff --git a/ai-review/165.md b/ai-review/165.md new file mode 100644 index 0000000000..858f8c417e --- /dev/null +++ b/ai-review/165.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 165 + +## 1. Code Reuse + +**Issue: `ramseyR3` is defined identically in three files.** + +The definition at `165.lean:60–61`: +```lean +noncomputable def ramseyR3 (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree k} +``` +is duplicated verbatim in: +- `544.lean:41–42` (Erdős 544, `Erdos544.ramseyR3`) +- `553.lean:42–43` (Erdős 553, `Erdos553.ramseyR3`) + +All three files independently define R(3,k) with identical logic. These should be unified into a shared definition (e.g., in a utility module or a common Ramsey namespace) and imported by all three problems. + +Additionally, `1015.lean:71–74` defines a general two-parameter Ramsey number `ramseyNumber₂(s,t)` using explicit edge-coloring functions rather than `SimpleGraph`/complement. This is a different formalization approach; `ramseyR3 k` could in principle be expressed as `ramseyNumber₂ 3 k`, but the definitions are not currently compatible due to the different underlying representations (SimpleGraph vs. Bool-valued edge functions). + +## 2. Citations + +**Website data** (erdosproblems.com/165): +- Status: **Open**, prize **$250** +- Lower bound constant evolution: + - Kim (1995): c ≥ 1/162 + - Pontiveros–Griffiths–Morris; Bohman–Keevash (2020–2021): c ≥ 1/4 + - Campos–Jenssen–Michelen–Sahasrabudhe (2025): c ≥ 1/3 + - Hefty–Horn–King–Pfender (2025): c ≥ 1/2 +- Upper bound: Shearer (1983), improving Ajtai–Komlós–Szemerédi (1980) +- Related problems: 544, 986, 1013 + +**Formalization citations** include [Sh83], [AKS80], [HHKP25], and Erdős refs [Er61, Er71, Er90b, Er93, Er97c]. + +**Gaps:** +- The formalization omits the intermediate lower-bound results (Kim 1995, Pontiveros–Griffiths–Morris / Bohman–Keevash 2020–2021, Campos–Jenssen–Michelen–Sahasrabudhe 2025). These are historically important steps but not strictly necessary. +- The $250 prize is not mentioned. +- Related problems 986 and 1013 are not cross-referenced (544 is mentioned in 544.lean's own docstring but not here). + +**No incorrect citations found.** All included references match the website. + +## 3. Variants + +The formalization captures only the main conjecture: existence of an asymptotic constant c > 0 such that R(3,k) ~ c · k²/log k. + +**Missing variant:** The specific conjectured value c = 1/2 is mentioned in the docstring ("The conjectured value is c = 1/2") but is not formalized as a separate theorem or variant. A natural addition would be: + +```lean +theorem erdos_165_conjectured_value : + ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + (1/2 - ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) ≤ (ramseyR3 k : ℝ) ∧ + (ramseyR3 k : ℝ) ≤ (1/2 + ε) * ((k : ℝ) ^ 2 / Real.log (k : ℝ)) +``` + +No additional variants appear on the website beyond the main question. + +## 4. Readability + +The code is well-organized and readable. The module docstring provides excellent context: it states the problem, explains the Ramsey number, gives known bounds with citations, and states the conjectured value. The definition of `ramseyR3` has a clear docstring. No readability issues. + +## 5. Formalizability + +**Ambiguity assessment: Moderate.** + +The original Erdős problem is "Give an asymptotic formula for R(3,k)." This is a *request*, not a proposition — it asks to *find* a formula, not to prove one exists. The formalization interprets this as: "Does R(3,k) ~ c · k²/log k for some c > 0?" This is a reasonable and standard interpretation, but it bakes in the form k²/log k from known bounds. A more literal formalization might ask for the existence of *any* asymptotic formula, but that would be too vague to formalize. + +The ε-formulation of the asymptotic is equivalent to asking whether R(3,k) · log(k) / k² converges to some positive limit, which could alternatively be stated using `Filter.Tendsto`. The current formulation is standard and correct. + +The use of `answer(sorry)` is appropriate since this is an open problem — the answer (True/False for whether such a c exists) is unknown. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`ramseyR3` definition:** Correctly captures R(3,k) as the minimum N such that every simple graph on N vertices contains a triangle (¬CliqueFree 3) or an independent set of size k (¬Gᶜ.CliqueFree k, i.e., the complement has a k-clique). The use of `sInf` is valid since the Ramsey property set is upward-closed (if every graph on N vertices satisfies it, so does every graph on N+m vertices, by restricting to an N-vertex subgraph). + +- **Asymptotic statement:** The (c ± ε) · k²/log k sandwich correctly formalizes f ~ c·g. For any fixed ε > 0, requiring (c-ε)·g(k) ≤ f(k) ≤ (c+ε)·g(k) for large k is equivalent to f(k)/g(k) → c (when g(k) > 0, which holds for k ≥ 2 since Real.log k > 0). + +- **Edge cases:** For small k (k = 0, 1), Real.log k ≤ 0, so k²/Real.log k ≤ 0 (or 0/0 = 0). The "for all k ≥ N₀" quantifier ensures these edge cases are excluded. No issues here. + +- **Logarithm base:** `Real.log` in Mathlib is the natural logarithm. The formalization is self-consistent: the constant c absorbs any base-conversion factor. The conjectured value c = 1/2 in the docstring assumes natural log, which aligns with the standard Ramsey theory literature convention for this problem (Shearer's upper bound is (1+o(1)) · k²/ln k; the conjectured truth is (1/2+o(1)) · k²/ln k). + +- **No mathematical flaws identified.** The formalization faithfully and correctly captures the intended conjecture. diff --git a/ai-review/166.md b/ai-review/166.md new file mode 100644 index 0000000000..23b72854a0 --- /dev/null +++ b/ai-review/166.md @@ -0,0 +1,146 @@ +# Review: Erdos Problem 166 + +**File:** `FormalConjectures/ErdosProblems/166.lean` + +--- + +## 1. Code Reuse + +**Issue: `ramseyR4` is a specialization of a generic Ramsey number defined independently in multiple files.** + +The definition `ramseyR4 (k : ℕ) : ℕ := sInf {N | ∀ G : SimpleGraph (Fin N), ¬G.CliqueFree 4 ∨ ¬Gᶜ.CliqueFree k}` is exactly `ramseyR 4 k` where `ramseyR` is the generic two-parameter Ramsey number already defined in: + +| File | Definition | Namespace | +|------|-----------|-----------| +| `ErdosProblems/1030.lean` | `ramseyR (k l : ℕ)` | `Erdos1030` | +| `ErdosProblems/1014.lean` | `ramseyR (k l : ℕ)` | `Erdos1014` | +| `ErdosProblems/986.lean` | `ramseyR (k n : ℕ)` | `Erdos986` | +| `ErdosProblems/165.lean` | `ramseyR3 (k : ℕ)` | `Erdos165` | + +All of these are definitionally identical (up to parameter naming). Furthermore, Problem 166 is literally the $k = 4$ special case of Problem 986. + +**Recommendation:** Extract a shared `ramseyR` definition into `FormalConjecturesForMathlib/Combinatorics/` (alongside the existing `Ramsey.lean` which defines the hypergraph variant). All of Problems 165, 166, 986, 1014, and 1030 could then import and use this shared definition. A bridging lemma `hypergraphRamsey 2 n = ramseyR n n` connecting the existing `hypergraphRamsey` to the graph Ramsey number would further unify the codebase. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/166](https://www.erdosproblems.com/166):** + +The website lists the problem as **solved** (with a $250 award). The formalization's docstring references match well: + +| Citation | Website | Docstring | Status | +|----------|---------|-----------|--------| +| Spencer (1977) | ✓ | ✓ [Sp77] | OK | +| Ajtai, Komlós, Szemerédi (1980) | ✓ | ✓ [AKS80] | OK | +| Mattheus, Verstraëte (2023/2024) | ✓ | ✓ [MaVe23] | OK | +| Er90b, Er91, Er93, Er97c | ✓ | ✓ | OK | + +**Minor issues:** + +- The docstring cites the Mattheus–Verstraëte paper as `[MaVe23]` with publication year 2024 and journal *Ann. of Math.* **199** (2024), 919–941. The website refers to it as a 2023 result. Both are defensible (preprint vs. publication year), and the docstring's full bibliographic entry with 2024 is more precise. No change needed. +- The website notes that Problem 166 is related to **Problem 986** (the general case for $R(k,n)$). The docstring does not mention this connection. Adding a brief note like "See also Problem 986 for the general conjecture" would be helpful. +- The website mentions the $250 prize that was awarded. The docstring does not mention this. This is a minor omission — not essential but could be added for completeness. + +--- + +## 3. Variants + +The formalization captures the core conjecture: $R(4,k) \gg k^3 / (\log k)^{O(1)}$. + +**Missing variants:** + +1. **Specific exponent (Mattheus–Verstraëte):** The docstring notes that Mattheus and Verstraëte proved $R(4,k) \gg k^3 / (\log k)^4$, i.e., the conjecture holds with $\alpha = 4$. This could be formalized as a stronger solved variant: + ```lean + @[category research solved, AMS 5] + theorem erdos_166_mattheus_verstraete : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ 4) ≤ (ramseyR4 k : ℝ) := by + sorry + ``` + +2. **Upper bound (AKS80):** The docstring mentions the upper bound $R(4,k) \ll k^3 / (\log k)^2$ due to Ajtai–Komlós–Szemerédi. This is a known result and could be formalized: + ```lean + @[category research solved, AMS 5] + theorem erdos_166_upper_bound : + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + (ramseyR4 k : ℝ) ≤ C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ 2) := by + sorry + ``` + +3. **Spencer's earlier bound:** $R(4,k) \gg (k \log k)^{5/2}$ is weaker than the Mattheus–Verstraëte result and is not essential to formalize separately, but could be included for historical completeness. + +4. **Connection to Problem 986:** Since Problem 166 is the $k = 4$ case of Problem 986, a lemma connecting the two (e.g., showing `erdos_986 4 (by norm_num)` implies `erdos_166`) would be a useful bridge. + +--- + +## 4. Readability + +The code is clean and well-structured, closely following the established pattern from Problem 165. + +- **Module docstring:** Excellent. Clearly states the problem, defines $R(4,k)$, documents the history of bounds (Spencer, AKS, Mattheus–Verstraëte), and provides full bibliographic citations. +- **Definition docstring:** Clear and concise. Explains $R(4,k)$ in both mathematical and formal terms. +- **Theorem docstring:** Good. Restates the conjecture in both displayed-math and asymptotic notation. +- **Namespace:** `Erdos166` is appropriate. +- **`open SimpleGraph Real`:** Appropriate — brings `CliqueFree` and `Real.log` into scope. + +**Minor suggestions:** + +- The definition `ramseyR4` hardcodes `4` in the name. If a shared `ramseyR` were available, the definition could be `def ramseyR4 (k : ℕ) := ramseyR 4 k` or simply eliminated in favor of `ramseyR 4 k` directly. + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Fully formalizable. The statement is precise and unambiguous.** + +The conjecture $R(4,k) \gg k^3 / (\log k)^{O(1)}$ is a standard asymptotic lower bound. Each component has a clear formal interpretation: + +- $R(4,k)$ is the standard graph Ramsey number, well-defined as an infimum. +- $\gg$ means $\geq C \cdot (\text{RHS})$ for some constant $C > 0$ and all sufficiently large $k$. +- $(\log k)^{O(1)}$ means $(\log k)^\alpha$ for some fixed $\alpha$. + +The only minor modeling choice is that $\alpha$ is taken to be a natural number (`α : ℕ`). This is sufficient since the $O(1)$ exponent in the original problem can always be rounded up to a natural number without loss. If $\alpha$ were allowed to be real-valued, the statement would be marginally more general, but the natural number version correctly captures the conjecture as stated and as resolved (with $\alpha = 4$). + +**Ambiguity level: Very low.** This is one of the more straightforward Erdős problems to formalize. + +--- + +## 6. Correctness + +**The formalization is mathematically correct and complete.** + +### Statement analysis + +```lean +theorem erdos_166 : + ∃ C : ℝ, 0 < C ∧ + ∃ α : ℕ, + ∃ N₀ : ℕ, ∀ k : ℕ, N₀ ≤ k → + C * ((k : ℝ) ^ 3 / (Real.log (k : ℝ)) ^ α) ≤ (ramseyR4 k : ℝ) +``` + +- **Bound direction:** Correct. The statement establishes a lower bound on $R(4,k)$, which is what the problem asks. +- **Quantifier structure:** Correct. $C$ and $\alpha$ are existentially quantified as constants, $k$ is universally quantified for $k \geq N_0$. +- **The `N₀` threshold:** Correct. The "for all sufficiently large $k$" is modeled by $\exists N_0, \forall k \geq N_0$. +- **`α : ℕ` (not `α : ℝ`):** Acceptable. The $O(1)$ exponent can always be taken to be a natural number. Note that $\alpha = 0$ is allowed, which would give the stronger bound $R(4,k) \geq C \cdot k^3$. This is not a flaw — the existential statement is weaker when $\alpha$ is larger, so allowing $\alpha = 0$ simply permits a stronger conclusion if one is available. +- **`0 < C` without `0 < α`:** The absence of `0 < α` is deliberate and correct (as noted above, $\alpha = 0$ should be allowed). + +### Edge cases + +- **$k = 0$:** `ramseyR4 0 = sInf {N | ∀ G, ¬G.CliqueFree 4 ∨ ¬Gᶜ.CliqueFree 0}`. Since `CliqueFree 0` is false for all graphs (the empty set is a 0-clique), `¬Gᶜ.CliqueFree 0` is always true, so `ramseyR4 0 = 0`. Meanwhile, `Real.log 0 = 0`, so `k^3 / (log k)^α = 0/0 = 0` (Lean's division by zero convention), and `C * 0 = 0 ≤ 0`. No issue — handled by the `N₀` threshold regardless. +- **$k = 1$:** `ramseyR4 1 = 1` (need at least one vertex so the complement has a 1-clique, but any graph on 1 vertex works since `CliqueFree 4` holds trivially). `Real.log 1 = 0`, so again `k^3 / (log k)^α = 1/0 = 0` for $\alpha \geq 1$. The bound becomes `C * 0 ≤ 1`, which holds. For $\alpha = 0$ it becomes `C * 1 ≤ 1`, which only holds if `C ≤ 1`. This is fine since the `N₀` threshold can exclude small $k$. + +### Definition correctness + +The definition `ramseyR4 (k : ℕ) : ℕ := sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 4 ∨ ¬Gᶜ.CliqueFree k}` is the standard definition of $R(4,k)$ as the minimum $N$ such that every graph on $N$ vertices contains a 4-clique or a $k$-independent set. The use of `sInf` on `ℕ` is correct — if the set is empty, `sInf ∅ = 0` in `ℕ`, but by Ramsey's theorem the set is always nonempty for finite parameters, so this degeneracy does not arise in practice. + +### Category tag + +`@[category research solved, AMS 5]` is correct. The problem was resolved by Mattheus and Verstraëte (2024). + +**Verdict: Correct and complete.** The formalization faithfully captures the mathematical content of Erdős Problem 166. No mathematical flaws. An experienced mathematician would find the statement accurate and natural. diff --git a/ai-review/167.md b/ai-review/167.md new file mode 100644 index 0000000000..d70ea01205 --- /dev/null +++ b/ai-review/167.md @@ -0,0 +1,115 @@ +# AI Review: Erdős Problem 167 + +**File:** `FormalConjectures/ErdosProblems/167.lean` +**Problem:** Tuza's Conjecture (1981) +**Status on website:** Open + +--- + +## 1. Code Reuse + +Several related problems define overlapping concepts that could be shared: + +- **Problem 76** (`ErdosProblems/76.lean`) defines `IsEdgeDisjointFamily` for families of triangles where distinct triangles have disjoint *edge sets*, and `triangleEdges` to compute a triangle's edge set. Problem 167 instead encodes edge-disjointness via *vertex intersection cardinality* (`(t₁ ∩ t₂).card ≤ 1`). Both formulations are equivalent for triangles, but they use different representations. + +- **Problem 621** (`ErdosProblems/621.lean`) defines `IsTriangleTransversal` — a minimum set of edges hitting every triangle. This is mathematically equivalent to the *triangle covering number* τ(G) used in Problem 167's conclusion (minimum edges to remove to make G triangle-free). A shared definition of τ(G) could serve both problems. + +- **Problem 1009** (`ErdosProblems/1009.lean`) defines `HasEdgeDisjointTriangles` using injective maps `Fin t → Fin 3 → Fin n`, a third distinct encoding of edge-disjoint triangle families. + +**Recommendation:** Three different problems (76, 167, 1009) define edge-disjoint triangle families in three different ways, and two problems (167, 621) encode the triangle covering number differently. A shared utility in `FormalConjecturesForMathlib` defining `trianglePackingNum` (ν(G)) and `triangleCoveringNum` (τ(G)) would reduce duplication and improve consistency. However, since each file is self-contained and the encodings are all mathematically correct, this is a moderate-priority suggestion. + +--- + +## 2. Citations + +The formalization references: +- `[Ha99]` Haxell, P. E., *Packing and covering triangles in graphs*. Discrete Math. 195 (1999), 251–254. +- `[KaPa22]` Kahn, J. and Park, J., *Tuza's conjecture for random graphs*. Random Structures & Algorithms 61 (2022), 235–249. +- `[Er88]` Erdős, P., *Problems and results on chromatic numbers in finite and infinite graphs*. Graph theory with applications to algorithms and computer science (1985), 201–213. + +**Website comparison:** The website at erdosproblems.com/167 attributes the conjecture to Tuza and lists it as posted by Erdős [Er88]. The website mentions Haxell's improved bound and the Kahn–Park result for random graphs, consistent with the docstring. No citations appear to be missing relative to the website's content. + +**Note:** The docstring header says "Tuza's conjecture (1981)" while the `@[category]` tag says `[Er88]`. Both are correct — Tuza conjectured it in 1981 and Erdős publicized it in 1988. The docstring correctly captures this dual attribution. + +--- + +## 3. Variants + +The formalization captures the main conjecture: τ(G) ≤ 2·ν(G) for every finite simple graph G. + +The website does not mention any additional variants (e.g., fractional relaxations, weighted versions, or hypergraph generalizations). The known partial results (trivial 3k bound, Haxell's improvement, Kahn–Park for random graphs) are mentioned in the docstring commentary but are not separately formalized, which is appropriate since they are partial results rather than distinct conjectures. + +**No missing variants identified.** + +--- + +## 4. Readability + +The code is well-structured and readable: +- The module docstring provides clear mathematical context, including the equivalence τ(G) ≤ 2·ν(G), the trivial bound, tightness examples, and references. +- The theorem docstring explains the edge-disjointness encoding (why `card ≤ 1` implies edge-disjointness for triangles). +- The Lean statement is compact and follows the standard pattern for this codebase. + +**Minor suggestion:** The use of `Set.ncard` in `(G.edgeSet \ H.edgeSet).ncard` is correct for finite graphs (since `V` is `Fintype`), but using `edgeFinset` with `Finset.card` would be more natural and avoid the `ncard` API, which returns 0 for infinite sets. This would make the finiteness guarantee more explicit: + +```lean +(G.edgeFinset \ H.edgeFinset).card ≤ 2 * k +``` + +This requires `H` to also have `[DecidableRel H.Adj]`, which would complicate the existential. The current approach using `edgeSet` with `ncard` is a reasonable pragmatic choice. + +--- + +## 5. Formalizability + +Tuza's conjecture is precisely stated and unambiguously formalizable. The key concepts — edge-disjoint triangle families, triangle packing number, triangle covering number, triangle-free subgraphs — all have clear combinatorial definitions with no room for interpretation. + +**Ambiguity assessment: None.** The problem statement on the website ("If a graph G has at most k edge-disjoint triangles, can G be made triangle-free by removing at most 2k edges?") is completely precise. Every term has a standard graph-theoretic meaning. + +--- + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +### Edge-disjointness encoding +Two triangles (3-cliques) in a simple graph share an edge if and only if they share exactly 2 vertices (since every pair of vertices in a triangle forms an edge). Therefore, `(t₁ ∩ t₂).card ≤ 1` correctly encodes edge-disjointness for triangles. The docstring explicitly notes this reasoning. ✓ + +### Triangle packing number (hypothesis) +The hypothesis states: +```lean +∀ (T : Finset (Finset V)), + (∀ t ∈ T, G.IsNClique 3 t) → + (∀ t₁ ∈ T, ∀ t₂ ∈ T, t₁ ≠ t₂ → (t₁ ∩ t₂).card ≤ 1) → + T.card ≤ k +``` +This says "every family of pairwise edge-disjoint triangles has size ≤ k," i.e., k ≥ ν(G). Since k is universally quantified over ℕ, the conjecture is strongest when k = ν(G), giving τ(G) ≤ 2·ν(G). For k > ν(G), the statement follows from the k = ν(G) case. Thus the universal quantification over k is equivalent to Tuza's conjecture. ✓ + +### Triangle covering number (conclusion) +The conclusion: +```lean +∃ (H : SimpleGraph V), + H ≤ G ∧ + H.CliqueFree 3 ∧ + (G.edgeSet \ H.edgeSet).ncard ≤ 2 * k +``` +This asks for a triangle-free subgraph H of G obtained by removing at most 2k edges. The subgraph relation `H ≤ G` ensures H.Adj is a sub-relation of G.Adj. The set difference `G.edgeSet \ H.edgeSet` correctly counts the removed edges. This encodes τ(G) ≤ 2k. ✓ + +### Subtle point: H need not have decidable adjacency +The existential `∃ (H : SimpleGraph V)` does not require `[DecidableRel H.Adj]`. This is fine — the statement is purely propositional and decidability of H's adjacency is not needed. ✓ + +### Overall correctness verdict +The formalization faithfully captures Tuza's conjecture. An experienced mathematician would not identify any flaws. The encoding choices (vertex-intersection for edge-disjointness, subgraph for edge removal) are sound and well-documented. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Three related problems use three different edge-disjoint triangle encodings; shared utility definitions would help but are not critical | +| Citations | Complete and consistent with website | +| Variants | No missing variants | +| Readability | Good; minor `ncard` vs `card` style point | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/169.md b/ai-review/169.md new file mode 100644 index 0000000000..7f188a7970 --- /dev/null +++ b/ai-review/169.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 169 + +## 1. Code Reuse + +Several definitions in `169.lean` duplicate or closely mirror existing infrastructure in the codebase: + +**Arithmetic Progression Freeness:** +- `Erdos169.IsAPFree` (line 36) defines AP-freeness as the nonexistence of `a, d` with `0 < d` and all terms `a + i * d ∈ A` for `i < k`. This is a bespoke, `Finset ℕ`-specific definition. +- `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` provides the general-purpose `Set.IsAPOfLengthFree` (line 197), which works over any `AddCommMonoid` and is defined in terms of `Set.IsAPOfLength`. There is also `Finset.maxAPFreeCard` (line 251). Problem 169 could potentially be restated using `Set.IsAPOfLengthFree` applied to `(A : Set ℕ)`, though the local definition has the advantage of being simple, self-contained, and directly operational for `Finset ℕ`. A minor concern is that the library definition uses subset containment of an AP set, while the local definition uses explicit existential quantification over `a` and `d` — these are mathematically equivalent but not definitionally equal. +- Other files define their own AP-related predicates: `Erdos140.IsThreeAPFree` (140.lean:45), `Erdos179.ContainsAP` (179.lean), `Erdos201.HasKTermAP` (201.lean). This proliferation of definitions is a codebase-wide pattern, not specific to problem 169. + +**Van der Waerden Numbers:** +- `Erdos169.VDWProperty` and `Erdos169.vanDerWaerdenNumber` (lines 41–53) define W(k) for 2-colorings of `{0, …, N−1}` using `Bool`-valued functions on all of `ℕ`. +- `Erdos138.monoAPNumber` (138.lean:60) defines a more general r-color van der Waerden number using `Fin r`-colorings of `Finset.Icc 1 N`, with `W = monoAPNumber 2` as an abbreviation. This is arguably the "canonical" definition in the codebase. +- `Erdos721.vanDerWaerden` (721.lean:70) defines W(j, k) for the asymmetric 2-color case. +- All three definitions are mathematically equivalent for the 2-color symmetric case W(k, k), but they differ in domain (`ℕ → Bool` on all naturals vs. `Finset.Icc 1 N → Fin r`) and indexing (0-based vs. 1-based). Reconciling them would require proving equivalence lemmas. + +**Reciprocal Sums:** +- The reciprocal sum `∑ n ∈ A, (1 : ℝ) / (↑n : ℝ)` is written inline in `erdos_169`. Other files define named helpers: `Erdos296.reciprocalSum` (over `ℚ`), `Erdos444.reciprocalSum` (over `ℝ`, partial sums). A shared `reciprocalSum` definition over `ℝ` could reduce repetition. + +**Recommendation:** The local definitions are acceptable for a self-contained problem file. However, if the project moves toward a unified API, `Erdos169.vanDerWaerdenNumber` should be replaced with (or shown equivalent to) `Erdos138.W`, and `IsAPFree` should be reconciled with `Set.IsAPOfLengthFree`. + +## 2. Citations + +**Website (erdosproblems.com/169) lists the following references:** +- [Be68] Berlekamp, E. R. (1968) +- [Ge77] Gerver, J. (1977) +- [Er77c], [Er80], [ErGr79], [ErGr80] — Erdős and Erdős–Graham papers +- [Wr84] Wróblewski (2024, noted as [Wr84] but apparently a 2024 result) +- [Wa25] Walker (2025) + +**The formalization's docstring cites only:** +- `[erdosproblems.com/169](https://www.erdosproblems.com/169)` + +**Assessment:** The docstring should include at least the key references, particularly: +- Erdős's original formulations ([Er77c], [Er80], [ErGr80]) +- Berlekamp's lower bound [Be68] and Gerver's improvement [Ge77], which contextualize the problem +- The website also notes the problem is equivalent to Problem 3 via a Gerver/Tao equivalence — this connection is not mentioned in the formalization + +## 3. Variants + +**The website describes several aspects not captured by the formalization:** + +1. **Estimating f(k) itself:** The website's first question is simply "Estimate f(k)." The formalization only captures the second question about the ratio f(k)/log W(k). +2. **Known lower bounds:** Berlekamp showed f(k) ≥ (log 2/2)·k; Gerver improved this to f(k) ≥ (1−o(1))·k·log k. These could be formalized as solved variants. +3. **Trivial lower bound:** f(k)/log W(k) ≥ 1/2, which follows from {1, …, W(k)−1} minus a monochromatic AP-free set. This would be a nice companion lemma. +4. **Equivalence to Problem 3:** The website notes that a positive answer to Problem 169 is equivalent to a positive answer to Problem 3 (if ∑1/n diverges, A contains arbitrarily long APs). Problem 3 is formalized separately in `3.lean` but the equivalence is not stated anywhere. +5. **Specific values:** f(3) ≥ 3.00849 (Wróblewski, 2024), f(4) ≥ 4.43975 (Walker, 2025). + +**Recommendation:** At minimum, the Gerver lower bound and the equivalence with Problem 3 should be captured as variants or documented in comments. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- **Good:** The module docstring clearly states the problem in LaTeX, the `IsAPFree` definition has a clear docstring, and the main theorem has a detailed comment explaining the "unrolled" formulation. +- **Minor improvements:** + - The `open Classical in` on line 49 is scoped to a single definition — this is fine but could be noted as intentional. + - The `vanDerWaerdenNumber` docstring says "any 2-coloring of {0, …, N−1}" but `VDWProperty` actually uses a coloring `f : ℕ → Bool` on all naturals, not restricted to a finite range. The bound `a + (k-1)*d < N` provides the finite restriction implicitly. This is correct but slightly non-obvious — a clarifying comment would help. + - The cast `(↑(vanDerWaerdenNumber k) : ℝ)` in the theorem statement is standard but somewhat noisy. This is unavoidable in Lean 4. + +## 5. Formalizability + +**Assessment: High formalizability with minor subtleties.** + +The problem as stated on the website is: +> Let f(k) denote the supremum of ∑(1/n) over A ⊂ ℕ⁺ with no k-term AP. Is lim f(k)/log W(k) = ∞? + +This is precise enough to formalize, and the formalization handles it well by "unrolling" the limit statement: for every C > 0, eventually there exists a finite AP-free set whose reciprocal sum exceeds C · log W(k). + +**Key subtlety well-handled:** The formalization sidesteps the question of whether f(k) is finite or infinite by not defining f(k) as a real number. Instead, it directly asserts the existence of finite AP-free sets with arbitrarily large reciprocal sums (relative to log W(k)). This is a clean approach because: +- If f(k) = ∞ for some k (which would happen iff there exist AP-free sets with arbitrarily large reciprocal sums), the statement is vacuously strong. +- If f(k) is always finite, the statement is exactly the limit condition. + +**Potential ambiguity:** The original problem says "set A of positive integers" without specifying finite vs. infinite. The formalization uses `Finset ℕ` with the positivity condition `∀ n ∈ A, 0 < n`. For any set where ∑1/n is finite, one can approximate it by a finite subset, so this is mathematically equivalent. This is correct. + +## 6. Correctness + +**Overall assessment: Correct, with one notable design choice.** + +**The main theorem `erdos_169` is mathematically correct.** The unrolled formulation faithfully captures lim f(k)/log W(k) = ∞. Specifically: + +- The direction `answer(sorry) ↔ (∀ C > 0, ∃ k₀, ∀ k ≥ k₀, ∃ A, ...)` is the standard ε-δ reformulation of the limit being infinite. +- The AP-freeness condition `IsAPFree k A` correctly requires positive common difference, preventing trivial single-element APs from being counted. +- The positivity condition `∀ n ∈ A, 0 < n` correctly restricts to positive integers, avoiding division by zero in the reciprocal sum. + +**`VDWProperty` correctness:** The definition requires `0 < d` (positive common difference) and `a + (k-1)*d < N` (all terms within range), and that `f(a + i*d) = f(a)` for all `i < k` (monochromaticity). This correctly captures the van der Waerden property. Note that this is a 2-coloring version (using `Bool`), which is the standard W(k) = W(k; 2). + +**`vanDerWaerdenNumber` correctness:** Defined via `Nat.find (vdw_exists k)`, which gives the *smallest* N with the VDW property. This is correct. The supporting lemma `vdw_exists` (van der Waerden's theorem) is stated as a `sorry` — this is expected since it is a non-trivial theorem. + +**Potential issue with `VDWProperty` definition:** The coloring `f : ℕ → Bool` is defined on all of `ℕ`, not just `{0, …, N−1}`. Since the AP terms are constrained by `a + (k-1)*d < N`, only values in `{0, …, N−1}` matter. The universal quantification over all `f : ℕ → Bool` is equivalent to quantifying over all `f : Fin N → Bool` (by restriction), so this is correct. However, using the unrestricted domain means `VDWProperty k 0` asserts that all colorings have a monochromatic AP in an empty range — which is vacuously false (the existential `∃ a d, 0 < d ∧ a + (k-1)*d < 0 ∧ ...` fails). This means `vanDerWaerdenNumber k` is well-defined only if `vdw_exists` produces an N > 0, which it does for k ≥ 1. For k = 0, `VDWProperty 0 N` requires an AP of length 0, which is vacuously true (the condition `∀ i, i < 0 → ...` holds for any a, d with `0 < d` and `a + 0*d < N`, i.e., `a < N`). So `vanDerWaerdenNumber 0` would be 1 (smallest N with a < N), which is fine. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated. + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code Reuse | Fair | Local AP/VDW definitions duplicate codebase infrastructure (AP/Basic.lean, 138.lean). Acceptable for self-containment but should be reconciled long-term. | +| Citations | Needs work | Only links to erdosproblems.com. Should include [Be68], [Ge77], [Er80], [ErGr80] and note equivalence with Problem 3. | +| Variants | Incomplete | Missing: estimation of f(k), Berlekamp/Gerver lower bounds, trivial bound f(k)/log W(k) ≥ 1/2, equivalence with Problem 3, specific values of f(3), f(4). | +| Readability | Good | Clear docstrings and well-structured code. Minor: VDWProperty domain comment could be added. | +| Formalizability | High | Problem is precisely stated; the unrolled limit formulation cleanly sidesteps defining f(k) as a real-valued supremum. | +| Correctness | Correct | Mathematically faithful formalization. No flaws identified. | diff --git a/ai-review/171.md b/ai-review/171.md new file mode 100644 index 0000000000..fbb5b022f1 --- /dev/null +++ b/ai-review/171.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 171 + +## 1. Code Reuse + +**Issue found.** Problem 185 (`FormalConjectures/ErdosProblems/185.lean`) defines `IsCombinatorialLine`, which is exactly the specialization of `IsCombLine` from 171 to the case `t = 3`. The two definitions are structurally identical up to this specialization: + +- **171**: `IsCombLine t N P` — general alphabet `Fin t`, general dimension `N` +- **185**: `IsCombinatorialLine n p` — fixed alphabet `Fin 3`, dimension `n` + +These should share a common definition. The general `IsCombLine` from 171 could be used in 185, or (better) a unified definition could be placed in `FormalConjecturesForMathlib/Combinatorics/` and imported by both. This would also benefit Problem 658, which is proved via the density Hales-Jewett theorem and could eventually reference the same infrastructure. + +No existing Mathlib definition for combinatorial lines was found. The density infrastructure in `FormalConjecturesForMathlib/Data/Set/Density.lean` (natural density, upper/lower density) is not directly used here since the density condition is stated explicitly via cardinality, which is appropriate for this finite combinatorial setting. + +## 2. Citations + +The docstring references match the website well, with one omission: + +- **[FuKa91]** ✅ Matches website. Full citation provided. +- **[Po12]** ✅ Matches website. Full citation provided. +- **[ErGr79]** ✅ Matches website. Full citation provided. +- **[ErGr80]** ✅ Matches website. Full citation provided. +- **OEIS A156989** ❌ The website lists a related OEIS sequence (A156989) that is not mentioned in the docstring. Consider adding it for completeness. + +## 3. Variants + +The website does not list additional variants beyond the main statement. Problem 185 is the `t = 3` specialization, which is already formalized separately. The formalization of 171 is the fully general statement, which subsumes all special cases. **No missing variants.** + +## 4. Readability + +Several minor readability observations: + +- **Naming inconsistency**: `IsCombLine` (171) vs `IsCombinatorialLine` (185). The abbreviated form `CombLine` is less readable; `IsCombinatorialLine` is clearer and should be preferred for the general version as well. +- **Quantifier grouping in `IsCombLine`**: The definition groups `S` and `c` together before `S.Nonempty`, i.e., `∃ (S) (c), S.Nonempty ∧ ...`. Problem 185 uses the slightly more natural `∃ S, S.Nonempty ∧ ∃ c, ...`, placing the nonemptiness constraint immediately after introducing `S`. Both are logically equivalent, but the 185 style is marginally clearer since it makes the nonemptiness a precondition before introducing the constant function `c`. +- **`answer(True) ↔` pattern**: Problem 185 (also a solved yes/no question) uses `answer(True) ↔ ...` while 171 states the result directly as a theorem. Both are proved results tagged `category research solved`. The inconsistency is minor but notable — one could argue 171 should also use the `answer(True) ↔` wrapper since the original problem is phrased as a question ("must A contain a combinatorial line?"). + +## 5. Formalizability + +**Highly formalizable.** The density Hales-Jewett theorem is a precise, unambiguous combinatorial statement. All objects involved (finite alphabets, finite-dimensional cubes, combinatorial lines, cardinality bounds) are well-defined and have straightforward Lean/Mathlib representations. + +The formalization uses `Fin t` for the alphabet and `Fin N → Fin t` for the cube, which are standard and natural choices. There is no ambiguity in the problem statement itself — it is a clean existential/universal claim with a concrete density threshold. + +**Ambiguity level: None.** This is one of the most cleanly formalizable Erdős problems. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Alphabet representation**: Using `Fin t = {0, 1, ..., t-1}` instead of the traditional `[t] = {1, ..., t}` is a harmless relabeling that does not affect the mathematics. + +- **Combinatorial line definition**: The definition `IsCombLine` captures precisely the concept of a "variable word." A combinatorial line corresponds to choosing a nonempty set `S` of active coordinates and a constant function `c` for inactive coordinates, then the `i`-th point in the line has `P i j = i` for `j ∈ S` and `P i j = c j` for `j ∉ S`. This is the standard definition. + +- **Density condition**: `(A.card : ℝ) ≥ ε * (t : ℝ) ^ N` correctly captures "A has size at least ε · t^N". The use of `≥` matches the problem's "at least" phrasing. (Note: Problem 185 uses strict `>` instead, which is equivalent for the existential statement since ε is universally quantified over positive reals, but `≥` is more faithful to the literal statement.) + +- **Degenerate case `t = 1`**: The condition `1 ≤ t` allows `t = 1`. When `t = 1`, the cube `[1]^N` has a single element, and any nonempty subset trivially contains a "combinatorial line" of length 1 (a single point). This is vacuously/trivially correct and consistent with the standard theorem statement. + +- **Quantifier structure**: `∀ t ≥ 1, ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, ...` correctly captures "for sufficiently large N" depending on both `t` and `ε`. + +- **Conclusion**: The conclusion `∃ P, IsCombLine t N P ∧ ∀ i, P i ∈ A` correctly requires both that `P` is a combinatorial line and that all its points lie in `A`. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Shared definition with 185 recommended | +| Citations | OEIS A156989 missing | +| Variants | Complete | +| Readability | Minor naming/style inconsistencies with 185 | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/173.md b/ai-review/173.md new file mode 100644 index 0000000000..771d566d17 --- /dev/null +++ b/ai-review/173.md @@ -0,0 +1,159 @@ +# Review: Erdos Problem 173 + +**File:** `FormalConjectures/ErdosProblems/173.lean` + +--- + +## 1. Code Reuse + +**Issue: Heavily duplicated geometry primitives.** + +The file defines three helper definitions (`euclideanDistSq`, `triangleSideSqs`, `TriangleNonDegenerate`) that are nearly identical to definitions in multiple other files: + +| Definition in 173 | Equivalent in other files | +|---|---| +| `euclideanDistSq` | `sqDist` in 634 (line 33), 633 (line 39), 353 (line 40), 898 (line 34); `sqEuclideanDist` in 654 (line 39) | +| `triangleSideSqs` | `sideLengthsSq` in 634 (line 38), 633 (line 44) | +| `TriangleNonDegenerate` | `NonDegenerate` in 634 (line 42), 633 (line 48) | + +All of these are verbatim copies with only the name changed. The squared distance definition `(p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2` is replicated in at least 6 files. + +**Recommendation:** Factor these three definitions into a shared utility file (e.g., `FormalConjectures/Util/PlaneGeometry.lean`) and have all geometry problems import from it. At minimum, a shared `sqDist` and `NonDegenerate` would eliminate substantial duplication across Problems 173, 353, 633, 634, 654, and 898. + +Additionally, Mathlib provides `EuclideanGeometry` and `dist` on `EuclideanSpace ℝ (Fin 2)` (used by Problems 507, 508, 1071). Using `dist p q ^ 2` from Mathlib's metric space structure would give access to the full Mathlib API (triangle inequality, etc.), though for a `sorry`-based conjecture statement the custom definition is adequate. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/173](https://www.erdosproblems.com/173):** + +The website lists: +- **Status:** Open. Cannot be resolved with finite computation. +- **Tags:** Geometry, Ramsey Theory. +- **References:** [Er75f], [ErGr79], [ErGr80], [Er83c], [Sh76]. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| `[Er75f]` Erdős, P. | ✅ Listed | ✅ Listed | OK but incomplete — website gives page reference `[Er75f, p.108]`. The formalization omits the page number. | +| `[ErGr79]` Erdős & Graham | ✅ Listed | ✅ Listed | OK but no title provided. | +| `[ErGr80]` Erdős & Graham | ✅ Listed with title | ✅ Listed | OK. Title matches. | +| `[Er83c]` Erdős, P. | ✅ Listed | ✅ Listed | OK but no title provided. | +| `[Sh76]` Shader, L. | ✅ Listed | ✅ Listed | OK but no title provided. The paper is "All right triangles are Ramsey in ℝ²" or similar — title would improve traceability. | + +**Issues:** +- The page reference `p.108` for `[Er75f]` present on the website is missing from the formalization. +- Several citations lack titles. While this is a minor issue, [ErGr80] has a title while the others don't — this inconsistency is mildly confusing. Either provide all titles or none. + +--- + +## 3. Variants + +**Missing variants that could be formalized:** + +1. **Shader's result for right-angled triangles [Sh76]:** The docstring states "Shader proved this is true for any single right-angled triangle." This is a proved, strictly weaker statement that could be formalized as a variant. It would assert that in any 2-colouring of ℝ², every non-degenerate right-angled triangle has a monochromatic congruent copy. A `IsRightTriangle` predicate already exists in Problem 353 (line 67) and could be reused: + ``` + theorem erdos_173.variants.right_triangles : + ∀ f : ℝ × ℝ → Bool, + ∀ p₁ p₂ p₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ → + IsRightTriangle p₁ p₂ p₃ → + ∃ a₁ a₂ a₃ : ℝ × ℝ, + triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ ∧ + f a₁ = f a₂ ∧ f a₂ = f a₃ + ``` + +2. **Equilateral triangle exclusion example:** The docstring mentions that "for some colourings a single equilateral triangle has to be excluded (considering the colouring by alternating strips)." This shows the bound "at most one" is tight. This could be formalized as a construction: + ``` + theorem erdos_173.variants.equilateral_excluded : + ∃ f : ℝ × ℝ → Bool, + ∃ p₁ p₂ p₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ ∧ + ∀ a₁ a₂ a₃ : ℝ × ℝ, + triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ → + ¬(f a₁ = f a₂ ∧ f a₂ = f a₃) + ``` + This is an elementary construction (alternating strips of width chosen to match the equilateral triangle height) and could be marked as `solved`. + +3. **Higher-dimensional analogue:** The problem is stated for ℝ², but analogous questions exist for ℝ^n. This is more speculative and probably not worth formalizing without a specific reference. + +**Assessment:** The main conjecture is captured. The Shader result (a proved partial result) and the tightness example (equilateral exclusion) are natural and important variants that are mentioned in the docstring but not formalized. + +--- + +## 4. Readability + +The code is concise and well-structured. Minor observations: + +- **Naming:** `euclideanDistSq` is more descriptive than the `sqDist` used in other files (634, 633, 353, 898), but is inconsistent with the codebase convention. If consolidated, `sqDist` is shorter and more idiomatic. +- **Docstrings:** The module-level docstring is informative and provides good mathematical context. The theorem-level docstring helpfully provides the contrapositive reformulation. +- **Theorem structure:** The contrapositive formulation (two non-congruent triangles can't both lack monochromatic copies) is mathematically elegant and arguably cleaner for Lean than the direct "for all but at most one" formulation. This is a good design choice. +- **Namespace:** `Erdos173` is consistent with the project convention. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Moderate ambiguity, but the formalization makes reasonable choices.** + +The original statement "for all but at most one triangle T (up to congruence)" has a few potential ambiguities: + +1. **"Triangle" — degenerate or non-degenerate?** The problem presumably means non-degenerate triangles. The formalization correctly includes `TriangleNonDegenerate` hypotheses. ✅ + +2. **"Congruence" — what notion?** In ℝ², congruence of triangles means related by an isometry (composition of translations, rotations, reflections). The formalization uses SSS (equality of multisets of squared side lengths) as the congruence criterion. This is correct: two non-degenerate triangles in ℝ² are congruent iff their side-length multisets agree (SSS theorem). However, the SSS equivalence only holds for non-degenerate triangles — for degenerate "triangles" (collinear points), SSS can distinguish configurations that are congruent. Since non-degeneracy is assumed, this is fine. ✅ + +3. **"Monochromatic congruent copy"** — The formalization checks that three points `a₁, a₂, a₃` have the same side-length multiset as the target triangle AND all receive the same colour (`f a₁ = f a₂ ∧ f a₂ = f a₃`). This correctly captures "there exist three points forming a congruent triangle that are all the same colour." ✅ + +4. **"At most one"** — The formalization captures this via the contrapositive: if two triangles both fail to have monochromatic copies, they must be congruent. This is a clean and equivalent restatement. ✅ + +5. **"2-colouring"** — Represented as `f : ℝ × ℝ → Bool`. This is the standard encoding. No measurability or continuity is assumed, which is correct (the conjecture is for arbitrary colourings). ✅ + +**Ambiguity level: Low.** The statement is well-known in combinatorial geometry and the formalization's choices are all standard. The only non-trivial choice is using SSS via multisets of squared side lengths, which is mathematically equivalent to congruence for non-degenerate triangles. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `euclideanDistSq` +Standard squared Euclidean distance. Correct. ✅ + +### Definition: `triangleSideSqs` +Creates a `Multiset ℝ` from the list of three squared side lengths. Using a multiset (rather than a sorted list or set) correctly handles the fact that congruence is independent of vertex labeling — two triangles are SSS-congruent iff their side-length multisets agree, regardless of which vertex is which. ✅ + +### Definition: `TriangleNonDegenerate` +Uses the cross-product criterion: `(p₂.1 - p₁.1) * (p₃.2 - p₁.2) - (p₃.1 - p₁.1) * (p₂.2 - p₁.2) ≠ 0`. This is the standard non-collinearity test (twice the signed area ≠ 0). Correct. ✅ + +### Theorem: `erdos_173` + +```lean +theorem erdos_173 : + ∀ f : ℝ × ℝ → Bool, + ∀ p₁ p₂ p₃ q₁ q₂ q₃ : ℝ × ℝ, + TriangleNonDegenerate p₁ p₂ p₃ → + TriangleNonDegenerate q₁ q₂ q₃ → + (∀ a₁ a₂ a₃ : ℝ × ℝ, triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃ → + ¬(f a₁ = f a₂ ∧ f a₂ = f a₃)) → + (∀ b₁ b₂ b₃ : ℝ × ℝ, triangleSideSqs b₁ b₂ b₃ = triangleSideSqs q₁ q₂ q₃ → + ¬(f b₁ = f b₂ ∧ f b₂ = f b₃)) → + triangleSideSqs p₁ p₂ p₃ = triangleSideSqs q₁ q₂ q₃ +``` + +**Logical structure analysis:** + +The statement reads: "For any 2-colouring `f` and any two non-degenerate triangles `(p₁,p₂,p₃)` and `(q₁,q₂,q₃)`, if neither has a monochromatic congruent copy under `f`, then they are congruent." + +This is the correct contrapositive of: "For any 2-colouring, the set of congruence classes of triangles that lack a monochromatic copy has at most one element." + +**Subtle point — non-degeneracy of copies:** The "no monochromatic copy" hypotheses quantify over ALL triples `(a₁, a₂, a₃)` with the right side lengths, including degenerate configurations. However, if `triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃` and `p₁, p₂, p₃` is non-degenerate, does that force `a₁, a₂, a₃` to be non-degenerate? Yes: if the target side-length multiset comes from a non-degenerate triangle, then any triple with the same multiset of squared distances must also be non-degenerate (the signed area squared is determined by the side lengths via Heron's formula). So the quantification is correct — it doesn't accidentally include degenerate triples. ✅ + +**Subtle point — oriented vs unoriented congruence:** The multiset-of-squared-side-lengths criterion captures both orientation-preserving and orientation-reversing congruences (i.e., it identifies triangles related by reflections). This is appropriate — the problem asks about congruence in the classical sense (including reflections). ✅ + +**Subtle point — vertex ordering:** The hypothesis `triangleSideSqs a₁ a₂ a₃ = triangleSideSqs p₁ p₂ p₃` matches side lengths as multisets, which means it doesn't require any particular correspondence between vertices. This is correct: SSS congruence doesn't depend on labeling. ✅ + +**Potential concern — trivial colourings:** Consider the constant colouring `f _ = true`. Then every triple of points is monochromatic, so no triangle "fails to have a monochromatic copy." The hypotheses of the theorem are vacuously unsatisfiable, making the conclusion trivially true. This is logically correct — the conjecture says there is at most one excluded congruence class, and with 0 excluded classes, the conclusion holds vacuously. ✅ + +**Verdict: Correct and complete.** The formalization faithfully captures the main conjecture of Erdős Problem 173. The contrapositive formulation is clean and equivalent. The only deficiency is the absence of the Shader variant and the tightness construction as companion statements. No mathematical flaws are present. diff --git a/ai-review/174.md b/ai-review/174.md new file mode 100644 index 0000000000..7356a3cf57 --- /dev/null +++ b/ai-review/174.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 174 + +## 1. Code Reuse + +Several patterns from the existing codebase could be reused or consolidated: + +- **Distance-preserving maps:** Problem 668 (`FormalConjectures/ErdosProblems/668.lean:53-57`) defines `AreCongruent` using exactly the same `∀ x y, dist (f x) (f y) = dist x y` pattern used in `IsEuclideanRamsey`. This is a good candidate for a shared `IsIsometry`-style predicate, or better yet, using Mathlib's `Isometry` typeclass (already used in problems 215 and 1124). +- **Mathlib `Isometry`:** Problems 215 (`215.lean:53`) and 1124 (`1124.lean:65`) use `Isometry f` from Mathlib rather than manually spelling out the distance-preservation condition. The definition of `IsEuclideanRamsey` could use `Isometry φ` instead of `∀ x y, dist (φ x) (φ y) = dist x y` for better integration with Mathlib lemmas. However, the manual formulation is mathematically equivalent and arguably more self-contained. +- **Coloring patterns:** `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` for combinatorial Ramsey numbers, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` has coloring infrastructure. These are for graph/hypergraph Ramsey theory rather than Euclidean Ramsey theory, so direct reuse is limited, but the coloring-as-function-to-`Fin k` pattern is shared. +- **Spherical geometry:** Problem 991 (`991.lean:49-58`) works with points on spheres in Euclidean space using `‖p‖ = 1`, a related but distinct notion from `IsSpherical` (which uses `dist a center = r`). + +**Recommendation:** Consider using `Isometry φ` from Mathlib instead of the explicit distance condition, for better downstream compatibility. + +## 2. Citations + +The formalization includes these citations: +- **[EGMRSS73]** — Correctly documented with full author list and journal. +- **[FrRo90]** — Correctly documented. +- **[Kr91]** — Correctly documented. +- **[Kr92]** — Correctly documented. + +**Missing from the formalization but present on erdosproblems.com/174:** +- **[Er75f, p.108]** — Not cited. +- **[ErGr79]** — Not cited. +- **[ErGr80]** — Not cited. +- **[Er83c]** — Not cited. +- **[LRW12]** — Leader, Russell, and Walters. This is particularly important as it relates to a variant conjecture (see §3 below). + +The citations that *are* included are accurate and well-formatted. The missing ones are secondary references to discussions of the problem rather than primary results, except for [LRW12] which proposes an alternative characterization. + +## 3. Variants + +The formalization captures the main conjecture (Graham's conjecture: Ramsey ↔ spherical). However: + +**Missing variant — Leader-Russell-Walters conjecture:** The erdosproblems.com page mentions a competing conjecture by Leader, Russell, and Walters [LRW12] that a set is Ramsey if and only if it is **"subtransitive"** — embeddable in a higher-dimensional set with a transitive rotational symmetry group action. This is a strictly stronger condition than being spherical, and if true, would mean Graham's conjecture is *false*. This is a significant variant that is not captured. + +**Partial results as separate theorems:** The forward direction (Ramsey → spherical) from [EGMRSS73] is a proven theorem. It could be stated as a separate, provable theorem rather than only being part of the biconditional. This would allow formalizers to work on the known result independently of the open conjecture. + +**Known Ramsey sets:** The docstring mentions several classes of known Ramsey sets (rectangles, simplices, trapezoids, regular polygons/polyhedra). These could be formalized as separate (proved) theorems, which would strengthen the overall formalization. + +## 4. Readability + +The code is well-structured and readable: + +- The namespace `Erdos174` cleanly scopes the definitions. +- `IsEuclideanRamsey` and `IsSpherical` are clearly named and well-documented. +- The docstring module header gives good mathematical context. +- The main theorem `erdos_174` is concisely stated. + +**Minor suggestions:** +- The condition `1 ≤ k` in `IsEuclideanRamsey` could be `0 < k` for Lean idiom consistency (though both are equivalent and clear). +- The φ map is typed as a bare function rather than using a structure like `Isometry`; adding a brief comment explaining this choice could help readers. + +Overall readability is **good**. + +## 5. Formalizability + +The problem as stated on erdosproblems.com says: *"Characterise the Ramsey sets in ℝⁿ."* This is inherently an **open-ended** question — it asks for a characterization, not a specific yes/no statement. + +The formalization resolves this ambiguity by adopting **Graham's conjecture** as the specific characterization: Ramsey ↔ spherical. This is a reasonable and well-motivated choice, as it is the most prominent proposed characterization. + +**Ambiguity assessment: MODERATE.** The original problem is a "characterize" question, which is not directly formalizable. The formalization makes a specific mathematical choice (Graham's conjecture) to resolve this. This is clearly documented in the docstring. However, the Leader-Russell-Walters alternative characterization (subtransitive sets) suggests that the spherical characterization may not be the correct one, adding genuine mathematical uncertainty about whether this formalization captures the "right" answer to Erdős's question. + +The individual definitions (`IsEuclideanRamsey`, `IsSpherical`) are precise and unambiguous. + +## 6. Correctness + +**Definition of `IsEuclideanRamsey`:** Mathematically correct. It properly captures: +- Universal quantification over number of colors k ≥ 1. +- Existential quantification over ambient dimension d. +- Universal quantification over all k-colorings of ℝᵈ. +- Existence of a distance-preserving (isometric) embedding φ from ℝⁿ to ℝᵈ. +- Monochromaticity: all points in φ(A) receive the same color c. + +One subtlety: the map φ is defined on all of `EuclideanSpace ℝ (Fin n)`, not just on A. This is correct — an isometric embedding of the ambient space is a standard way to formalize "congruent copy." However, it is slightly stronger than necessary: the problem only requires a congruent copy of A (i.e., a set of |A| points in ℝᵈ with the same pairwise distance structure). The current formalization requires a global isometric embedding, which automatically implies the existence of a congruent copy. For finite sets, this distinction is immaterial because any distance-preserving map on a finite subset of Euclidean space extends to a global isometry (by Kirszbraun's theorem / the rigidity of Euclidean isometries). So the formalization is correct. + +**Definition of `IsSpherical`:** Mathematically correct. A set is spherical iff all points are equidistant from some center, which is exactly the condition for lying on a sphere. Note that `r` is not required to be positive, so the empty set and singletons are vacuously spherical (with r = 0 for singletons). This is fine since these are trivially Ramsey as well. + +**Main theorem `erdos_174`:** States the biconditional for all n and all finite subsets A of ℝⁿ. This is mathematically correct as a formalization of Graham's conjecture combined with the [EGMRSS73] theorem. + +**Potential concern:** The `k = 0` case. The definition requires `1 ≤ k`, so it never considers 0-colorings. Since `Fin 0` is empty, a "0-coloring" would mean no coloring function exists (vacuously true), which could create a confusing edge case. The `1 ≤ k` guard correctly avoids this. However, `k = 1` is trivially satisfied (everything is monochromatic in a 1-coloring), so the meaningful content starts at k ≥ 2. This is standard and correct. + +**Overall correctness: GOOD.** The formalization is mathematically sound and faithfully represents Graham's conjecture. The only caveat is that it presents Graham's conjecture as *the* answer to Erdős Problem 174, when the original problem is more open-ended and the Leader-Russell-Walters conjecture provides a competing characterization. diff --git a/ai-review/175.md b/ai-review/175.md new file mode 100644 index 0000000000..fa21743f8c --- /dev/null +++ b/ai-review/175.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 175 + +## 1. Code Reuse + +**`Nat.centralBinom` should be used instead of `Nat.choose (2 * n) n`.** + +Mathlib defines `Nat.centralBinom n` in `Mathlib.Data.Nat.Choose.Central` with the lemma `centralBinom_eq_two_mul_choose : centralBinom n = (2 * n).choose n`. Several other Erdős problems in this repository already use `Nat.centralBinom` (e.g., 376, 377, 396, 397, 730). Problem 175 should follow suit for consistency and to make it easier to apply existing Mathlib lemmas about central binomial coefficients. + +Additionally, `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` provides helper lemmas including `squarefreePart`, `squarePart`, and decomposition theorems. The `FormalConjecturesForMathlib/Algebra/Powerfree.lean` file provides the equivalence `powerfree_two ↔ Squarefree`, which could be relevant if a proof strategy involves the more general `Powerfree` notion. + +**Recommendation:** Rewrite the statement as: +```lean +theorem erdos_175 : + ∀ n : ℕ, 5 ≤ n → ¬Squarefree n.centralBinom := by + sorry +``` + +## 2. Citations + +The formalization's docstring references match the erdosproblems.com page well, but there are discrepancies in attribution tags: + +- **Docstring says `[Er79, ErGr80]`** — These shorthand references are not expanded anywhere in the file. The website does not use these short codes. They should either be expanded into full bibliographic entries or removed in favor of the three references already listed in the module docstring. +- **Sárközy [Sa85]** — Matches the website: Sárközy, A., *On divisors of binomial coefficients, I*. J. Number Theory **20** (1985), 70-80. ✓ +- **Granville and Ramaré [GrRa96]** — Matches the website: Granville, A. and Ramaré, O., *Explicit bounds on exponential sums and the scarcity of squarefree binomial coefficients*. Mathematika **43** (1996), 73-107. ✓ +- **Velammal [Ve95]** — Matches the website: Velammal, G., *Is the binomial coefficient $\binom{2n}{n}$ squarefree?*. Hardy-Ramanujan J. **18** (1995), 23-45. ✓ + +**Recommendation:** Remove `[Er79, ErGr80]` from the theorem docstring or expand them into full citations. The module-level docstring citations are accurate. + +## 3. Variants + +The website describes several variants and extensions **not captured** by the formalization: + +1. **The function $f(n)$:** Let $f(n)$ be the largest integer such that $p^{f(n)} \mid \binom{2n}{n}$ for some prime $p$. Multiple results exist: + - Sander (1992): $f(n) \to \infty$ + - Sander (1995): $f(n) \gg (\log n)^{1/10 - o(1)}$; $f(n) \ll \log n$ for all $n$; $f(n) \gg \log n$ for almost all $n$ + - Erdős–Kolesnik (1999): $f(n) \gg (\log n)^{1/4 - o(1)}$ + - **Open question:** Does $f(n) \gg \log n$ for all $n$? + +2. **Sander's generalization (1992b):** For all $0 < \epsilon < 1$ and sufficiently large $n$, if $|d| \leq n^{1-\epsilon}$, then $\binom{2n+d}{n}$ is not squarefree. + +3. **Exceptional cases:** The largest known $n$ where $\binom{2n}{n}$ has no odd prime square divisor is $n = 786$ (Levine). Erdős conjectured no larger such $n$ exists. + +4. **Related problem:** Problem 379 (highest prime power dividing all $\binom{n}{k}$) is noted as related. Problem 379 is separately formalized in this repo. + +**Recommendation:** The core problem (Problem 175 as stated) is fully captured. The open question about $f(n) \gg \log n$ for all $n$ could be added as a separate conjecture if desired, but omission is reasonable since it is a distinct open problem. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- **Use `Nat.centralBinom`** as noted above — this is more idiomatic and immediately recognizable to anyone familiar with Mathlib's API. +- The module docstring is well-written and provides good mathematical context. +- The theorem docstring duplicates some information from the module docstring (the statement of the problem). This is acceptable for standalone readability of the theorem. + +## 5. Formalizability + +**High formalizability — no ambiguity.** The statement "for any $n \geq 5$, $\binom{2n}{n}$ is not squarefree" is completely precise: + +- "$n \geq 5$" is unambiguous (natural number constraint). +- "$\binom{2n}{n}$" is a well-defined natural number. +- "Not squarefree" means there exists a prime $p$ such that $p^2 \mid \binom{2n}{n}$. + +All terms have standard mathematical definitions with direct Lean/Mathlib counterparts. There is zero ambiguity in the statement. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** + +- `∀ n : ℕ, 5 ≤ n → ¬Squarefree (Nat.choose (2 * n) n)` exactly encodes the problem statement. +- `Squarefree` in Mathlib/Lean means that no perfect square (other than 1) divides the number, which is the standard mathematical definition. Negating it correctly captures "not squarefree." +- The bound `5 ≤ n` is correct: $\binom{8}{4} = 70 = 2 \cdot 5 \cdot 7$ is squarefree, confirming $n = 4$ must be excluded. $\binom{10}{5} = 252 = 4 \cdot 63 = 2^2 \cdot 3^2 \cdot 7$ is not squarefree, confirming $n = 5$ works. +- The `category` attribute `research solved` correctly reflects the problem's status (proved by Granville–Ramaré and Velammal for all $n \geq 5$). +- The `AMS 11` classification (Number Theory) is appropriate. + +**No mathematical flaws identified.** An experienced number theorist would agree this is a faithful formalization. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Should use `Nat.centralBinom` for consistency with other problems | +| Citations | `[Er79, ErGr80]` in theorem docstring unexpanded; module-level citations are accurate | +| Variants | Core problem captured; $f(n)$ growth rate variants omitted (acceptable) | +| Readability | Good; would improve with `centralBinom` | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/176.md b/ai-review/176.md new file mode 100644 index 0000000000..8f4d931b04 --- /dev/null +++ b/ai-review/176.md @@ -0,0 +1,107 @@ +# Review: Erdos Problem 176 + +## 1. Code Reuse + +The `discrepancyAPNumber` definition is self-contained and does not reuse existing infrastructure. Two potential areas of reuse exist: + +- **AP definitions** (`FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`): The library provides `Set.IsAPOfLengthWith`, `Set.IsAPOfLength`, and related predicates. However, these characterize APs as *sets*, whereas Problem 176 needs to *sum a function over an AP*. Connecting the set-based predicate to a `Finset.sum` would require additional lemmas and would likely be less readable than the current direct formulation `∑ i ∈ range k, f (a + i * d)`. The current approach is reasonable. + +- **Van der Waerden number** (`FormalConjectures/ErdosProblems/169.lean`): The docstring notes that `N(k,k) = W(k)`, and `vanDerWaerdenNumber` is defined in Problem 169 via `Nat.find`. However, no formal connection is established between `discrepancyAPNumber k k` and `vanDerWaerdenNumber k`. This could be a useful lemma to state (even as `sorry`), but is not strictly necessary. + +- **Erdos 177** uses an essentially identical sum pattern (`∑ i ∈ range k, f (a + i * d)`) with the same `f : ℕ → ℤ` and `±1` constraint. There may be value in extracting a shared `APDiscrepancy` definition, but given the slightly different problem structures (177 quantifies over d separately), the duplication is tolerable. + +**Verdict**: No immediate reuse opportunities that would improve the formalization. + +## 2. Citations + +The website ([erdosproblems.com/176](https://www.erdosproblems.com/176)) lists the following references: + +> [Er65b], [Er73], [Er74b], [Er75b], [ErGr79], [Er80], [ErGr80,p.15], [Sp73], [Er63d] + +The formalization includes only: **[Er65b], [Er73], [ErGr80]**. + +**Missing references**: [Er74b], [Er75b], [ErGr79], [Er80], [Sp73], [Er63d]. Of these, [Sp73] (Spencer 1973) is notable because it establishes a known result mentioned on the website: if $k = 2^t m$ with $m$ odd, then $N(k,1) = 2^t(k-1)+1$. + +The full bibliographic details for the included references match the website. The [ErGr80] reference in the formalization could be more specific: the website cites [ErGr80, p.15]. + +## 3. Variants + +The website poses four questions: +1. Find good upper bounds for $N(k, \ell)$ — too vague to formalize, appropriately omitted. +2. $N(k, ck) \leq C^k$ for any $c > 0$ — **captured** as `erdos_176`. +3. $N(k, 2) \leq C^k$ — **captured** as `erdos_176.variants.constant_discrepancy`. +4. $N(k, \sqrt{k}) \leq C^k$ — **captured** as `erdos_176.variants.sqrt_discrepancy`. + +**Not formalized** (but mentioned on the website): +- **Spencer's exact result** [Sp73]: $N(k, 1) = 2^t(k-1)+1$ when $k = 2^t m$, $m$ odd. This is a concrete solved result that could be formalized as a `category research solved` theorem. +- **Erdős's lower bounds**: For every $c > 0$, $N(k, ck) > (1 + \alpha_c)^k$ where $\alpha_c \to 0$ as $c \to 0$ and $\alpha_c \to \sqrt{2}-1$ as $c \to 1$. This provides a matching exponential lower bound. +- The connection $N(k, k) = W(k)$ (van der Waerden number), mentioned in the docstring but not formalized. + +**Verdict**: All formalizable variants from the website are captured. Some known results could be added but are not required. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstring for `discrepancyAPNumber` is clear and matches the mathematical definition. +- The module docstring correctly states the problem and provides context about the van der Waerden connection. +- The `open Finset BigOperators Real` is appropriate for the notation used. +- The naming convention (`erdos_176.variants.constant_discrepancy`, `erdos_176.variants.sqrt_discrepancy`) is descriptive. + +One small readability note: the constraint on `f` uses `1 ≤ n → n ≤ N` (1-indexed) which matches the mathematical convention of $\{1, \ldots, N\}$. This is good. + +**Verdict**: Readability is good. No changes needed. + +## 5. Formalizability + +The problem is precisely stated and well-suited to formalization. The key design decisions are sound: + +- Using `ℓ : ℝ` for the discrepancy threshold accommodates the `√k` variant naturally. +- Using `sInf` on `ℕ` with `sInf ∅ = 0` is the standard pattern in this codebase for defining combinatorial extremal numbers (cf. Ramsey numbers, size Ramsey numbers). +- The `answer(sorry)` wrapper correctly reflects the open status of the conjecture — the truth value itself is unknown. + +The only mild ambiguity in the original problem is the quantifier order for the main conjecture: "for any $c > 0$ there exists $C > 1$" — the formalization correctly makes $C$ depend on $c$ (the existential is inside the universal). + +**Verdict**: No ambiguity issues. The problem is cleanly formalizable and the formalization captures the intended meaning. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +### Definition of `discrepancyAPNumber` + +- **Domain of f**: The function `f : ℕ → ℤ` is constrained to be `±1` only on `{1, ..., N}`. Values at `0` and beyond `N` are unconstrained. Since the AP is constrained to `{1, ..., N}` (via `1 ≤ a` and `a + (k-1)*d ≤ N`), only values in this range contribute to the sum. This is correct — equivalent to quantifying over all $f : \{1, \ldots, N\} \to \{-1, 1\}$. + +- **Positive common difference**: The constraint `0 < d` correctly excludes trivial constant progressions. + +- **Natural number subtraction**: The constraint `a + (k - 1) * d ≤ N` uses Lean's natural subtraction, so when `k = 0`, this becomes `a + 0 * d ≤ N`, i.e., `a ≤ N`. Meanwhile `range 0 = ∅` gives sum 0. For `k = 0` and `ℓ > 0`, the set is empty and `sInf ∅ = 0`. This is a harmless edge case since the conjectures only concern positive `k`. + +- **Behavior for large ℓ**: When `ℓ > k`, any sum of `k` terms in `{-1, 1}` has absolute value at most `k < ℓ`, so the predicate is never satisfied, the set is empty, and `sInf ∅ = 0`. For the main conjecture with `ℓ = ck` and `c > 1`, this gives `N(k, ck) = 0 ≤ C^k` trivially. This is mathematically correct — the conjecture holds vacuously for `c > 1`, and the interesting content is for `0 < c ≤ 1`. + +### Main theorem (`erdos_176`) + +The statement `∀ c : ℝ, 0 < c → ∃ C : ℝ, 1 < C ∧ ∀ k : ℕ, (discrepancyAPNumber k (c * ↑k) : ℝ) ≤ C ^ k` correctly formalizes the conjecture. The cast `(discrepancyAPNumber k (c * ↑k) : ℝ)` coerces from `ℕ` to `ℝ` for comparison with `C ^ k`. + +### Variants + +- `constant_discrepancy`: Uses `discrepancyAPNumber k 2`, correctly formalizing $N(k, 2) \leq C^k$. +- `sqrt_discrepancy`: Uses `discrepancyAPNumber k (Real.sqrt ↑k)`, correctly formalizing $N(k, \sqrt{k}) \leq C^k$. + +Both variants appropriately use `∃ C : ℝ, 1 < C ∧ ∀ k : ℕ, ...`. + +### Consistency with Erdos 67 + +Problem 67 (Erdős discrepancy problem, proved by Tao) considers *homogeneous* APs of the form $\{d, 2d, \ldots, md\}$, whereas Problem 176 considers general APs $\{a, a+d, \ldots, a+(k-1)d\}$. Problem 67 uses a different encoding (`f : ℕ → ({-1, 1} : Finset ℝ)` with subtype coercion). The two problems are related but distinct, and the different formalizations are appropriate. + +**Verdict**: The formalization is correct and complete. No mathematical flaws identified. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No actionable reuse opportunities | +| Citations | Missing [Er74b], [Er75b], [ErGr79], [Er80], [Sp73], [Er63d]; [ErGr80] should cite p.15 | +| Variants | All website variants captured; Spencer's result and lower bounds could be added | +| Readability | Good | +| Formalizability | Unambiguous, cleanly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/177.md b/ai-review/177.md new file mode 100644 index 0000000000..3dd687daf5 --- /dev/null +++ b/ai-review/177.md @@ -0,0 +1,123 @@ +# Review: Erdős Problem 177 + +**File:** `FormalConjectures/ErdosProblems/177.lean` + +## 1. Code Reuse + +**Significant overlap with Problem 176.** Problem 176 (`FormalConjectures/ErdosProblems/176.lean`) defines `discrepancyAPNumber` using the identical sum-over-AP pattern `∑ i ∈ range k, f (a + i * d)` and the identical ±1 coloring constraint `∀ n, f n = 1 ∨ f n = -1`. Problem 178 also uses the same coloring pattern. + +Opportunities: +- A shared predicate for ±1 colorings (e.g., `IsPlusMinusOneColoring (f : ℕ → ℤ) := ∀ n, f n = 1 ∨ f n = -1`) could be factored out and reused across Problems 176, 177, and 178. This would improve consistency and reduce repetition. +- The sum `∑ i ∈ range k, f (a + i * d)` appears identically in all three files. A shared definition for the discrepancy of a coloring along an AP would be beneficial. +- `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` defines `Set.IsAPOfLengthWith` and related predicates, but these are set/list-based and not directly applicable to the sum-over-AP pattern used here. No immediate reuse opportunity from that file. + +## 2. Citations + +The website (erdosproblems.com/177) lists references: **[Er66], [Er73], [ErGr79], [ErGr80], [Ro64], [Be17]**. + +The formalization's docstring includes: +- [Ro64] — Full citation provided. ✅ +- [Be17] — Full citation provided. ✅ + +**Missing from the docstring:** +- **[Er66]** — Not cited. This is presumably Erdős's original posing of the problem. +- **[Er73]** — Not cited. Erdős, P., *Problems and results on combinatorial number theory* (1973). (Note: this reference *is* cited in Problem 176's docstring.) +- **[ErGr79]** — Not cited. Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory. I*. +- **[ErGr80]** — Not cited. Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). (Also cited in Problem 176.) + +These original Erdős references should be added to the docstring for completeness, especially since the sibling Problem 176 already includes some of them. + +## 3. Variants + +The formalization captures three statements: +1. **Main problem** (`erdos_177`): Find the optimal h(d). ✅ +2. **Lower bound** (`erdos_177.variants.lower`): h(d) ≫ d^{1/2} (Roth). ✅ +3. **Upper bound** (`erdos_177.variants.upper`): h(d) ≤ d^{8+ε} (Beck). ✅ + +The docstring also mentions two additional known results that are **not formalized as variants**: +- **Van der Waerden's implication:** h(d) → ∞. This is a weaker (but classical) result implied by van der Waerden's theorem. It would be a natural and relatively simple variant to include. +- **Cantor–Erdős–Schreiber–Straus:** h(d) ≪ d!. This is a weaker upper bound superseded by Beck's result. Less essential but could be included for historical completeness. + +**Assessment:** The two most important bounds are captured. The van der Waerden variant is a notable omission since it's a well-known structural result, but its absence is not critical. + +## 4. Readability + +The code is **generally readable and well-structured**. Specific observations: + +- The docstrings clearly explain each statement with LaTeX formulas matching the formal statement. +- The namespace `Erdos177` and variant naming convention (`erdos_177.variants.lower`, `.upper`) are clear and consistent with other files in the project. +- The `open Finset BigOperators Real` at the top is appropriate for the notation used. +- One minor readability concern: the cast `(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)` is somewhat heavy. This is a necessary artifact of working with ℤ-valued functions and ℝ-valued bounds, so it is unavoidable, but a named definition for the AP discrepancy would improve readability. + +## 5. Formalizability + +**Assessment: High formalizability; low ambiguity.** + +The problem as stated on erdosproblems.com is precise: it asks for the smallest function h(d) bounding the discrepancy of a ±1 coloring over all APs of common difference d. All objects involved (arithmetic progressions, ±1 colorings, discrepancy as an absolute value of partial sums) have unambiguous mathematical definitions. + +The only source of mild ambiguity is the phrase "smallest h(d)," which could mean: +- The pointwise-optimal function (for each d individually), or +- Asymptotic growth rate (up to constants). + +The formalization interprets this as a single concrete function `answer(sorry) : ℕ → ℝ`, which is the pointwise interpretation. This is the more precise and correct choice. The asymptotic nature of the known bounds (≫ and ≪ notation) suggests the exact pointwise answer is not known, which is consistent with the problem being open. + +## 6. Correctness + +### Main theorem (`erdos_177`) + +The statement asserts existence of a ±1 coloring f achieving discrepancy bound h(d) for all d simultaneously: + +```lean +∃ f : ℕ → ℤ, (∀ n, f n = 1 ∨ f n = -1) ∧ +∀ d : ℕ, 0 < d → ∀ a k : ℕ, 0 < k → + |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| ≤ (answer(sorry) : ℕ → ℝ) d +``` + +**Concern — one-directional statement:** The problem asks for the *smallest* h(d), but the formalization only captures the upper bound direction: "there exists f such that discrepancy ≤ h(d)." It does not state that h(d) is **optimal**, i.e., that for any smaller bound, no coloring achieves it. A complete formalization would additionally require something like: + +``` +∀ g : ℕ → ℝ, (∃ f : ℕ → ℤ, ... discrepancy ≤ g d) → ∀ d, 0 < d → h(d) ≤ g(d) +``` + +Without this, the `answer` could be any valid upper bound (e.g., trivially `fun d => d!`), not the optimal one. This is a **genuine mathematical incompleteness** in the formalization. However, since the exact optimal h(d) is unknown (the problem is open), this is partially justifiable — the answer placeholder is meant to be filled in with the exact optimal value when known. + +**Correctness of the AP encoding:** The sum `∑ i ∈ range k, f (a + i * d)` correctly enumerates {f(a), f(a+d), ..., f(a+(k-1)d)}, an AP of k terms starting at a with common difference d. The constraints `0 < d` and `0 < k` correctly exclude degenerate cases. ✅ + +**Domain:** The coloring is on all of ℕ (including 0), which is a valid choice. Note that Problem 176 uses 1-indexed naturals (1 ≤ n ≤ N), creating a minor inconsistency between sibling problems, but this does not affect mathematical correctness since f is defined everywhere. ✅ + +### Lower bound (`erdos_177.variants.lower`) + +```lean +∃ c : ℝ, 0 < c ∧ ∀ f : ℕ → ℤ, +(∀ n, f n = 1 ∨ f n = -1) → +∀ d : ℕ, 0 < d → +∃ a k : ℕ, 0 < k ∧ + c * Real.sqrt (↑d) ≤ |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| +``` + +This states: for any ±1 coloring and any d ≥ 1, some AP with difference d has discrepancy ≥ c√d. This correctly formalizes h(d) ≫ √d (Roth's result). The quantifier structure (∀ f, ∀ d, ∃ AP) is correct — for *every* coloring and *every* d, a high-discrepancy AP must exist. ✅ + +### Upper bound (`erdos_177.variants.upper`) + +```lean +∀ ε : ℝ, 0 < ε → +∃ f : ℕ → ℤ, +(∀ n, f n = 1 ∨ f n = -1) ∧ +∀ d : ℕ, 0 < d → ∀ a k : ℕ, 0 < k → + |(↑(∑ i ∈ range k, f (a + i * d)) : ℝ)| ≤ (↑d : ℝ) ^ ((8 : ℝ) + ε) +``` + +This states: for each ε > 0, there exists a coloring (possibly depending on ε) bounding discrepancy by d^{8+ε} for all APs simultaneously. This correctly formalizes Beck's result. The quantifier order (∀ ε, ∃ f, ∀ d, ∀ AP) correctly allows f to depend on ε but requires it to work for all d and all APs of each difference. ✅ + +**Note:** When k is very large relative to d, the bound d^{8+ε} may be smaller than what's achievable (since the sum of k terms of ±1 is trivially bounded by k). Beck's result presumably only gives a nontrivial bound when k is not too large. The formalization claims the bound holds for *all* k, which is actually fine because when k ≤ d^{8+ε} the bound is trivially achievable. For k > d^{8+ε}, the statement is nontrivial but consistent with the claim. ✅ + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | ±1 coloring predicate and AP sum could be shared with 176/178 | +| Citations | Missing [Er66], [Er73], [ErGr79], [ErGr80] from website | +| Variants | Core bounds captured; van der Waerden variant missing but non-critical | +| Readability | Good; minor heaviness from ℤ→ℝ casts | +| Formalizability | High; problem is precise and unambiguous | +| Correctness | Main theorem is one-directional only (missing optimality); bound variants are correct | diff --git a/ai-review/178.md b/ai-review/178.md new file mode 100644 index 0000000000..c8bafa737c --- /dev/null +++ b/ai-review/178.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 178 + +## 1. Code Reuse + +Problems 176 and 177 use nearly identical patterns: `f : ℕ → ℤ` with `∀ n, f n = 1 ∨ f n = -1`, partial sums via `∑ i ∈ range k, f (...)`, and constants bounding discrepancy. Problem 178 is consistent with these conventions. No shared utility definition (e.g., a common `IsSignedColoring` predicate) exists in `FormalConjecturesForMathlib/`, but the inline pattern `∀ n, f n = 1 ∨ f n = -1` is the de facto standard across this family of problems (176, 177, 178, 395, 498). No immediate reuse opportunity is missed. + +One minor stylistic note: Problems 176 and 177 cast the partial sum to `ℝ` for the absolute value (`|(↑(∑ ...) : ℝ)|`), while Problem 178 keeps everything in `ℤ` (`|∑ j ∈ Finset.range m, f (a i j)| ≤ C` with `C : ℤ`). Both are mathematically equivalent, but the inconsistency with neighboring problems is worth noting. + +## 2. Citations + +The file references: `[ErGr79]`, `[ErGr80]`, `[Be81]`, `[Be17]`. + +Comparing with [erdosproblems.com/178](https://www.erdosproblems.com/178): + +- **[ErGr80]** — Correct. Full citation matches the website. +- **[Be81]** — Correct. Beck, J., *Roth's estimate of the discrepancy of integer sequences is nearly sharp*. Combinatorica 1 (1981), 319–325. Matches. +- **[Be17]** — The file cites: Beck, J., *Balanced two-colorings of finite sets in the square*. Combinatorica 37 (2017), 631–660. The website references Beck's 2017 work as "*Probabilistic Diophantine Approximation*, Springer Monographs in Mathematics (2017)" (this is what Problem 177 cites). These appear to be **different** Beck 2017 publications. The Combinatorica paper cited in 178.lean is about two-colorings in the square, which may not be the correct reference for the `≪ d^{4+ε}` refinement. The Springer monograph cited in Problem 177 seems like the more natural source for the refinement result. **This citation may be incorrect or at least worth verifying.** +- **[ErGr79]** — Listed in the file docstring and theorem docstring. The website lists this reference. The file gives a partial title: *Old and new problems and results in combinatorial number theory. I*. This appears reasonable but the website may not distinguish between [ErGr79] and [ErGr80] as separate references. No obvious error. + +## 3. Variants + +The formalization captures only the main statement (the `≪_d 1` version proved by Beck [Be81]). + +**Missing variant:** The website explicitly notes that Beck [Be17] proved the bound can be strengthened from `≪_d 1` to `≪ d^{4+ε}` for any `ε > 0`. This is a quantitatively stronger result (giving an explicit growth rate for the constant as a function of d) and could be formalized as a variant, analogous to how Problem 177 formalizes both upper and lower bounds. A natural formalization would be: + +```lean +theorem erdos_178.variants.beck_refinement : + answer(True) ↔ + ∀ ε : ℝ, 0 < ε → + ∀ a : ℕ → ℕ → ℕ, (∀ i, StrictMono (a i)) → + ∃ f : ℕ → ℤ, (∀ n, f n = 1 ∨ f n = -1) ∧ + ∃ C : ℝ, 0 < C ∧ + ∀ d m i, i < d → + (|∑ j ∈ Finset.range m, f (a i j)| : ℝ) ≤ C * (↑d) ^ ((4 : ℝ) + ε) +``` + +This variant is notable and documented on the website, so its absence is a gap. + +## 4. Readability + +The code is well-structured and readable. The docstring clearly explains the mathematical content, quantifier structure, and attribution. The namespace `Erdos178` is clean and consistent with neighboring files. + +Minor suggestions: +- The module docstring is thorough and well-formatted. +- The theorem docstring accurately summarizes the formal statement. +- Consider adding `open Finset BigOperators` (as in 176.lean and 177.lean) for consistency, though this is cosmetic since `Finset.range` is used with its full qualified name. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is **precise and clearly formalizable**. The key mathematical content — existence of a ±1 coloring with bounded partial sums along prescribed subsequences — translates directly into dependent type theory. + +The only potential ambiguity is whether the "infinite sets of integers" in the original problem should be subsets of ℤ rather than ℕ. The formalization uses `a : ℕ → ℕ → ℕ` (subsets of ℕ). This is without loss of generality: any countable collection of infinite subsets of ℤ, each with a strictly increasing enumeration, can be order-embedded into ℕ, and a coloring on ℕ can be pulled back. So the restriction to ℕ is mathematically justified. + +**Ambiguity level: Very low.** The problem is a clean existence question with no room for misinterpretation. + +## 6. Correctness + +The formalization is **mathematically correct** in its core structure. Detailed analysis: + +**Quantifier order:** `∀ a → ∃ f → ∀ d → ∃ C → ∀ m, i` — This correctly says: for any collection of strictly increasing sequences, there exists a single ±1 coloring such that for each d, the discrepancy along the first d sequences is uniformly bounded by some constant depending on d (and the collection). This matches the problem statement. + +**Partial sums:** `∑ j ∈ Finset.range m, f (a i j)` sums the first m terms of the coloring along sequence i. The original uses 1-indexed sums `∑_{1 ≤ j ≤ m}`, while the formalization uses 0-indexed `Finset.range m = {0, ..., m-1}`. Since `a i` is simply an enumeration of the elements of set A_i, the 0-indexing vs 1-indexing just shifts the enumeration — both cover all finite initial segments. **Correct.** + +**Bound structure:** The constant C depends on d (and implicitly on a through the choice of f). The notation `≪_d 1` in the original means "O(1) with the implicit constant depending on d", which is precisely `∃ C, ∀ m i, i < d → ... ≤ C`. **Correct.** + +**Range of i:** The condition `i < d` (0-indexed) correctly ranges over d sequences, matching `1 ≤ i ≤ d` (1-indexed) in the original. **Correct.** + +**Strict monotonicity:** `StrictMono (a i)` correctly captures that each A_i is an infinite set with a strictly increasing enumeration. **Correct.** + +**`answer(True)`:** Consistent with the problem being solved affirmatively by Beck [Be81]. **Correct.** + +**Potential concern — C : ℤ vs C : ℝ:** The bound constant `C` has type `ℤ`. This is fine mathematically (since `|sum| ≤ C` with integer C is equivalent to a real bound), but it's slightly non-standard compared to the neighboring problems 176/177 which use ℝ. An integer bound is actually slightly stronger (tighter), but since the partial sums are integers, an integer bound always exists if a real bound does. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities; consistent with codebase patterns | +| Citations | [Be17] citation may reference the wrong Beck 2017 paper — verify | +| Variants | Beck's `≪ d^{4+ε}` refinement is missing | +| Readability | Good; minor stylistic inconsistency with 176/177 (ℤ vs ℝ casts) | +| Formalizability | Very low ambiguity; cleanly formalizable | +| Correctness | Mathematically correct; quantifier structure, indexing, and bounds all faithful to the original | diff --git a/ai-review/179.md b/ai-review/179.md new file mode 100644 index 0000000000..c3ba3041e8 --- /dev/null +++ b/ai-review/179.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 179 + +## 1. Code Reuse + +The codebase has a well-developed arithmetic progression library at `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` with definitions including: + +- **`Set.IsAPOfLengthWith`** — AP predicate with specified first term `a` and difference `d` +- **`Set.IsAPOfLength`** — existential AP predicate (no fixed `a`, `d`) +- **`Set.IsAPOfLengthFree`** — predicate for sets avoiding length-`l` APs + +**`ContainsAP` (179.lean:41)** could be replaced by the existing `Set.IsAPOfLength`. For `k ≥ 2`, `Set.IsAPOfLengthWith` already excludes trivial APs (d = 0) because the cardinality constraint forces distinct elements. The custom definition uses `d ≥ 1` on `ℕ`, which is equivalent for natural numbers. Replacing `ContainsAP` with the library definition would improve consistency with other Erdős problems (139, 141, 142, 160) that already use `Set.IsAPOfLength`. + +**`numAP` (179.lean:48)** has no library counterpart. This counting function is specific to Problem 179 and must remain custom-defined. + +Several other Erdős problems (169, 190, 199, 201) also define their own ad-hoc AP predicates rather than reusing the library. Problem 179 could set a better example by using the shared definitions. + +## 2. Citations + +The formalization cites: + +> [FoPo20] Fox, J. and Pohoata, C., *Subset sums, completeness and colorings*. (2020). + +**Issues identified:** + +- **Possibly incorrect paper title.** The Fox–Pohoata result establishing $F_k(N,\ell) = N^{2-o(1)}$ is from their work on arithmetic progressions, not subset sums. The paper "Subset sums, completeness and colorings" (Advances in Mathematics, 2020) is a different paper by the same authors that deals with sumset completeness. The relevant paper for this problem may be a different Fox–Pohoata publication. This should be verified against the erdosproblems.com reference list. + +- **Missing original sources.** The website lists [Er73], [Er75b], [ErGr79], [ErGr80] as original sources for the problem. None are cited in the formalization. + +- **Missing recent improvement.** The website references [LSS24] (Leng, Sah, and Sawhney), who improved the upper bound to $F_k(N,\ell) \leq N^2 / \exp((\log\log N)^{c_\ell})$. This is not mentioned. + +## 3. Variants + +The website states two questions: + +1. Is $F_3(N,4) = o(N^2)$? +2. For every $\ell > 3$, is $\lim_{N\to\infty} \frac{\log F_3(N,\ell)}{\log N} = 2$? + +The formalization captures: +- **Question 1:** `erdos_179` — ✅ correctly formalized +- **Question 2, lower bound only:** `erdos_179.variants.part2` — ✅ correctly formalized (shows $F_3(N,\ell) \geq N^{2-\varepsilon}$ for $\ell > 3$) + +**Missing variant:** The upper bound direction of question 2 for general $\ell > 4$ is not formalized. The main theorem only gives $F_3(N,4) = o(N^2)$, not $F_3(N,\ell) = o(N^2)$ for all fixed $\ell > 3$. Since $F_3(N,\ell)$ is non-decreasing in $\ell$ (longer APs are harder to guarantee), the $\ell = 4$ upper bound does NOT imply the general case. A third theorem formalizing the upper bound for general $\ell$ would complete the picture: + +``` +∀ ℓ : ℕ, ℓ > 3 → ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + ∀ A : Finset ℕ, A.card = N → + (numAP A 3 : ℝ) ≥ ε * (N : ℝ) ^ 2 → ContainsAP A ℓ +``` + +This would fully capture question 2 from the website (combined with part2 for the lower bound). + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The docstring for `numAP` is clear and matches the implementation. +- The module docstring accurately describes the mathematical content. +- Naming is consistent: `ContainsAP`, `numAP`, `erdos_179`. +- The `let M := A.max' h` pattern and the finset product + filter approach for counting APs is a natural computational encoding. + +One minor readability improvement: the `if h : A.Nonempty` branch in `numAP` could benefit from a brief comment explaining why the empty case is handled separately (to provide `max'` its precondition). + +## 5. Formalizability + +**Assessment: Fully formalizable with minor ambiguity.** + +The problem statement on erdosproblems.com is precise: $F_k(N,\ell)$ is clearly defined as a minimum threshold, and the questions are concrete asymptotic statements. The formalization sidesteps explicitly defining $F_k(N,\ell)$ as a function and instead directly encodes the asymptotic content, which is a valid and arguably cleaner approach. + +One small source of ambiguity: the website mentions Erdős's remark that "the upper bound $o(N^2)$ is certainly false for $\ell > \varepsilon \log N$." This concerns the regime where $\ell$ grows with $N$, which is outside the scope of the formalized statements (where $\ell$ is fixed before $N_0$ is chosen). The formalization correctly handles the fixed-$\ell$ case. + +The counting of APs via $(a, d)$ pairs is one natural parameterization. An alternative would be counting ordered $k$-tuples in AP, which differs by a constant factor. The $(a, d)$ parameterization used here is the standard one matching the definition of $F_k(N, \ell)$ in the literature. + +## 6. Correctness + +**Main theorem (`erdos_179`):** Mathematically correct. + +The statement encodes $F_3(N,4) = o(N^2)$ as: for every $\varepsilon > 0$, for sufficiently large $N$, any $N$-element set with $\geq \varepsilon N^2$ three-term APs must contain a four-term AP. This is equivalent to $F_3(N,4) \leq \lceil \varepsilon N^2 \rceil$ for large $N$, for every $\varepsilon > 0$, which is exactly $F_3(N,4) = o(N^2)$. The `answer(True)` tag correctly reflects that this was proved by Fox and Pohoata. + +**Variant (`erdos_179.variants.part2`):** Mathematically correct. + +The constraint $0 < \varepsilon < 2$ is appropriate since $N^{2-\varepsilon}$ should be at least $N^0$ (when $\varepsilon < 2$) but below $N^2$ (when $\varepsilon > 0$). The statement correctly captures the lower bound $F_3(N,\ell) \geq N^{2-\varepsilon}$ by exhibiting a set with many 3-APs but no $\ell$-AP. + +**`numAP` definition:** Correct. + +The search space `Icc 0 M ×ˢ Icc 1 M` (where $M = \max(A)$) is sound: +- Any valid AP $(a, d)$ with $a + i \cdot d \in A$ for $i < k$ requires $a \in A$ (when $i = 0$ for $k \geq 1$), so $0 \leq a \leq M$. +- $d \geq 1$ excludes trivial APs; $d \leq M$ follows from $a + d \leq M$. +- The empty-set edge case is correctly handled (returns 0). + +**`ContainsAP` definition:** Correct but could use library definition. + +The requirement $d \geq 1$ correctly excludes trivial (constant) APs, matching the mathematical intent. + +**One potential concern with `numAP`:** For $k = 0$, every $(a, d)$ pair trivially satisfies the filter (the universally quantified condition over `Finset.range 0` is vacuously true), giving a spurious count of $(M+1) \cdot M$. Similarly for $k = 1$, the count would include all pairs where just $a \in A$. These edge cases don't affect the theorems (which use $k = 3$) but could be surprising if the definitions were reused. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `ContainsAP` should use `Set.IsAPOfLength` from AP library; `numAP` is necessarily custom | +| Citations | Paper title likely incorrect; missing original sources [Er73], [Er75b], [ErGr79], [ErGr80]; missing [LSS24] | +| Variants | Missing upper bound for general $\ell > 4$ (only $\ell = 4$ covered); lower bound correctly captured | +| Readability | Good overall; minor improvement possible | +| Formalizability | Fully formalizable; no significant ambiguity | +| Correctness | Both theorems are mathematically correct; definitions are sound for the intended use | diff --git a/ai-review/18.md b/ai-review/18.md new file mode 100644 index 0000000000..180014a27f --- /dev/null +++ b/ai-review/18.md @@ -0,0 +1,166 @@ +# Review: Erdos Problem 18 + +**File:** `FormalConjectures/ErdosProblems/18.lean` +**Reviewer:** Claude (automated) +**Date:** 2026-03-09 + +--- + +## 1. Code Reuse + +**Rating: Acceptable, with minor consolidation opportunity.** + +The file defines `IsPractical` and `practicalH` locally in the `Erdos18` namespace. Mathlib has no definition of practical numbers, so creating them from scratch is necessary. The definitions correctly build on mathlib's `Nat.divisors` and `Finset.sum`. + +Several other Erdős problem formalizations define closely related "sum of distinct divisors" concepts: + +- **Problem 469** (`Nat.IsSumDivisors`): uses `∃ S ⊆ n.properDivisors, ∑ d ∈ S, d = n` — sum of distinct *proper* divisors. +- **Problem 825**: uses `∃ s ⊆ n.properDivisors, n = s.sum id` — same concept, different notation. +- **Problem 859** (`DivisorSumSet`): uses `∃ s ⊆ Nat.divisors n, t = ∑ i ∈ s, i` — the set of n for which t is a sum of distinct divisors of n. + +The core pattern "a number is representable as a sum of distinct elements of a finset" appears repeatedly across these files with minor syntactic variations (`S.sum id` vs `∑ d ∈ S, d`, `Nat.divisors` vs `properDivisors`). There is no shared abstraction, but given the differences in which divisor set is used and the direction of the representation, creating one may be over-engineering. No action required, but a `HasFinsetRepresentation` utility could serve multiple problems if the codebase continues to grow in this area. + +The website lists **Problem 304** and **Problem 825** as related problems. Neither is cross-referenced from Problem 18's docstring. + +**Recommendation:** Add a brief note in the module docstring mentioning related problems 304 and 825. + +--- + +## 2. Citations + +**Rating: Good, with one minor discrepancy.** + +The docstring cites: [Er74b], [Er79], [ErGr80], [Er81h], [Er95], [Er96b], [Er98], [Vo85]. + +Per [erdosproblems.com/18](https://www.erdosproblems.com/18), the listed references are: +[Er74b], [Er79], [ErGr80], [Er81h, p.172], [Er95], [Er96b], [Er98], [Vo85]. + +**Discrepancy:** The website specifies **[Er81h, p.172]** with a page number. The formalization omits the page reference, citing just `[Er81h]`. Since the $250 prize for conjecture (3) originates from this specific page, the page number is useful context. + +The reference section gives reasonable bibliographic information: +- `[ErGr80]` is correctly identified as the Erdős–Graham monograph. +- `[Vo85]` is identified as Vose, M. with the title "Proof of a conjecture of Erdős concerning practical numbers." This is reasonable but the actual paper title may differ slightly (the common citation is Vose, M.D., "Integers with consecutive divisors in small ratio", *J. Number Theory*, 1985). However, verifying the exact title would require accessing the paper directly. + +**Recommendation:** Update `[Er81h]` to `[Er81h, p.172]` to match the website. + +--- + +## 3. Variants + +**Rating: Good — all three questions are captured.** + +The problem poses three questions of increasing strength, and all three are formalized: + +1. `erdos_18` — infinitely many practical m with h(m) < (log log m)^C (Question 1) +2. `erdos_18.variants.factorial_subpolynomial` — h(n!) < n^ε for all ε > 0 (Question 2) +3. `erdos_18.variants.factorial_polylog` — h(n!) < (log n)^C (Question 3) + +**Missing variants that could be valuable:** + +- **Known result (Erdős):** h(n!) < n. This is a proved bound and would make a natural companion lemma, providing context and a sanity check: + ```lean + theorem erdos_18.variants.erdos_bound : + ∀ᶠ n : ℕ in atTop, + (practicalH n.factorial : ℝ) < (n : ℝ) := by + sorry + ``` +- **Known result (Vose):** Infinitely many practical m with h(m) ≪ (log m)^{1/2}. This is a strictly weaker (and proved) version of Question 1. +- **Practicality of factorials:** The statement that n! is practical for all n ≥ 1 is used implicitly by conjectures 2 and 3 and could be a useful standalone lemma. + +**Hierarchy note:** Conjecture 3 ⟹ Conjecture 2 (since (log n)^C < n^ε for large n), but neither directly implies Conjecture 1 (which is about general practical numbers, not factorials). The docstring correctly presents these as three separate questions. + +--- + +## 4. Readability + +**Rating: Good.** + +**Strengths:** +- Clean, well-separated definitions with clear docstrings. +- Good use of LaTeX in docstrings explaining the mathematical notation. +- The three conjectures are clearly labeled as (1), (2), (3) matching the problem description. +- The `open Real Filter` at the top is appropriate and minimal. + +**Minor suggestions:** +- The naming convention `practicalH` is slightly unusual — a more Lean-idiomatic name might be `IsPractical.minDivisors` or `practicalMinParts`, but this is purely stylistic and `practicalH` directly mirrors the mathematical notation h(m). +- The use of `S.sum id` is consistent within the file but differs from other files in the codebase that use `∑ d ∈ S, d`. Both are definitionally equal but `∑ d ∈ S, d` may be slightly more readable to mathematicians. + +--- + +## 5. Formalizability + +**Rating: High — the statement is precise and well-suited for formalization.** + +The mathematical content is unambiguous: +- "Practical number" has a standard definition in number theory (OEIS A005153). +- The function h(m) (minimum number of distinct divisors needed) is well-defined for practical numbers. +- The asymptotic notations O(1) and o(1) are correctly rendered as existential/universal quantifiers over constants/epsilon. + +**Asymptotic encoding is correct:** +- "(log log m)^{O(1)}" → ∃ C > 0, ... < (log log m)^C ✓ +- "n^{o(1)}" → ∀ ε > 0, eventually ... < n^ε ✓ +- "(log n)^{O(1)}" → ∃ C > 0, eventually ... < (log n)^C ✓ + +**Domain considerations:** `Real.log` in Mathlib is total (returns 0 for non-positive inputs). For `erdos_18`, `Real.log (Real.log m)` could be 0 or negative for small m. This is harmless because the "infinitely many" quantification ensures the relevant m are arbitrarily large. For `factorial_polylog`, `Real.log n` is positive for n ≥ 2, so the `∀ᶠ n in atTop` filter handles domain issues naturally. + +--- + +## 6. Correctness + +**Rating: Mostly correct, with two notable concerns.** + +### Concern 1: Truth value presupposed for Question 3 + +The three conjectures are formalized as unconditional theorems (asserting their truth), not as `answer(sorry) ↔ ...` statements. For Questions 1 and 2, this is arguably appropriate — the phrasing "Is it true that...?" suggests Erdős expected positive answers. + +However, for Question 3 (`factorial_polylog`), the docstring itself notes: **"Erdős offered $250 for a proof or disproof."** The "or disproof" language indicates genuine uncertainty about the truth value. The formalization presupposes the answer is YES by stating it as an unconditional theorem. If the answer turns out to be NO, the theorem as stated would be false (unprovable). + +**Recommendation:** Consider reformulating conjecture 3 using `answer(sorry)`: +```lean +theorem erdos_18.variants.factorial_polylog : + answer(sorry) ↔ + ∃ C : ℝ, 0 < C ∧ ∀ᶠ n : ℕ in atTop, + (practicalH n.factorial : ℝ) < (Real.log (n : ℝ)) ^ C := by + sorry +``` + +The same argument could apply to Questions 1 and 2, but the case is strongest for Question 3 given the explicit "proof or disproof" phrasing. + +### Concern 2: `practicalH` behavior for non-practical numbers + +`practicalH` is defined via `sInf` on the set of valid k values. For a non-practical number m, there exists some n in [1, m) that cannot be represented at all, so no k works, and the set is empty. In Lean, `sInf ∅ = 0` for `ℕ`. + +This means `practicalH m = 0` for non-practical m. In conjecture 2 and 3, the formalization doesn't explicitly assert that n! is practical — it relies on the fact that n! IS practical (which is true but unproven in the formalization). If `practicalH (n!) = 0` were ever the case, the inequalities would be trivially satisfied for large n (since 0 < (log n)^C for large n), making the theorems vacuously true. + +Since n! is indeed practical for n ≥ 1, this is not a mathematical error, but it means the theorems are slightly weaker than intended — they don't formally certify that the representation is genuinely achieved. Adding `IsPractical n.factorial` as a hypothesis or proved lemma would strengthen the statement. + +### Verified correct aspects: + +- **`IsPractical` definition:** The condition `1 ≤ n → n < m → ∃ S ⊆ Nat.divisors m, S.sum id = n` correctly captures the standard definition. The strict inequality `n < m` matches the problem statement ("1 ≤ n < m"). Including n = m would be equivalent (since m ∈ Nat.divisors m), so this is fine either way. +- **`practicalH` definition:** Correctly captures the minimum k for representations using at most k distinct divisors. +- **Conjecture 1 quantification:** "Infinitely many" is correctly encoded as `∀ N, ∃ m ≥ N`. +- **Conjecture 2 "o(1)" encoding:** `∀ ε > 0, ∀ᶠ n in atTop` is the standard filter-based formulation. +- **Conjecture 3 "O(1)" encoding:** `∃ C > 0, ∀ᶠ n in atTop` is correct. +- **Edge cases:** `IsPractical 0` and `IsPractical 1` are vacuously true (no n in [1, m)), which is mathematically harmless. + +--- + +## Summary + +| Criterion | Rating | Key Issue | +|-----------|--------|-----------| +| Code Reuse | Acceptable | No shared abstraction for "sum of distinct divisors" across problems | +| Citations | Good | [Er81h] should be [Er81h, p.172] | +| Variants | Good | All three questions captured; known results (Erdős, Vose) not formalized | +| Readability | Good | Clean code, minor stylistic notes | +| Formalizability | High | Precise statement, asymptotic encodings correct | +| Correctness | Mostly correct | **Question 3 should use `answer(sorry)` given "proof or disproof" phrasing; `practicalH` is 0 for non-practical inputs** | + +### Priority Fixes +1. **Question 3 truth value:** Reformulate `factorial_polylog` with `answer(sorry)` to reflect genuine uncertainty about the truth value. +2. **Citation page number:** Update `[Er81h]` → `[Er81h, p.172]`. + +### Optional Improvements +3. Add cross-references to related Problems 304 and 825. +4. Add a lemma asserting `IsPractical n.factorial` for n ≥ 1. +5. Formalize the known bound h(n!) < n as a proved variant. diff --git a/ai-review/180.md b/ai-review/180.md new file mode 100644 index 0000000000..b9e43ce2d5 --- /dev/null +++ b/ai-review/180.md @@ -0,0 +1,131 @@ +# Review: Erdos Problem 180 + +## 1. Code Reuse + +The file defines three local constructs: `ContainsSubgraph`, `turanNumber`, and `turanNumberFamily`. These are duplicated verbatim across at least 18 Erdős problem files (59, 113, 146, 147, 180, 571, 572, 575, 576, 713, 714, 765, 766, 800, 926, 1079, 1157, 1178). Problem 575 in particular is a direct companion (the bipartite refinement of Problem 180) and has character-for-character identical definitions of all three. + +Potential reuse opportunities: + +- **Mathlib's `SimpleGraph.IsContained`** (`Mathlib.Combinatorics.SimpleGraph.Copy`): Already used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`. This captures the same notion as the local `ContainsSubgraph` (injective graph homomorphism). Switching to the Mathlib predicate would reduce duplication and align with the upstream API, but would require verifying definitional equivalence and may affect readability. + +- **Shared `TuranNumber` module**: Given 18+ duplicated definitions, extracting `ContainsSubgraph`, `turanNumber`, and `turanNumberFamily` into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Turan.lean` (or similar) would significantly reduce boilerplate. However, this is a cross-cutting refactor and not specific to Problem 180. + +- **Problem 575**: The definitions in 575 and 180 are identical. At minimum, one could import from the other or both could import from a shared file. + +**Verdict**: Significant duplication exists. A shared Turán number module would benefit the codebase, but no reuse opportunity specific to Problem 180 is being missed. + +## 2. Citations + +The website ([erdosproblems.com/180](https://www.erdosproblems.com/180)) lists: + +> [ErSi82] — Erdős and Simonovits, 1982 + +The formalization's docstring cites: + +> [ErSi82] Erdős, P. and Simonovits, M., 1982. + +This is incomplete. Problem 575 (the companion problem from the same paper) includes the full citation: + +> [ErSi82] Erdős, P. and Simonovits, M., _Compactness results in extremal graph theory_, Combinatorica **2** (1982), 275-288. + +The formalization should use this full citation for consistency. + +The website also credits the counterexample to Zach Hunter (described as a "folklore" result). The formalization's docstring attributes the counterexample to "(Hunter)" which matches the website. + +**Verdict**: The [ErSi82] citation should include the full bibliographic details (title, journal, volume, pages), matching the format used in Problem 575. + +## 3. Variants + +The website describes three aspects of the problem: + +1. **The main question**: Does there exist $G \in \mathcal{F}$ such that $\operatorname{ex}(n;G) \ll_{\mathcal{F}} \operatorname{ex}(n;\mathcal{F})$? — **Captured** as `erdos_180`. + +2. **Non-bipartite case**: When $\mathcal{F}$ contains no bipartite graphs, the conjecture holds trivially by the Erdős–Stone theorem, since all members share the same asymptotic Turán density determined by the minimum chromatic number. — **Not formalized**, but this is a remark rather than a variant. Could be stated as a lemma but is not required. + +3. **Bipartite refinement (Problem 575)**: If $\mathcal{F}$ contains at least one bipartite graph, does some bipartite member dominate? — **Formalized separately** in `FormalConjectures/ErdosProblems/575.lean`. The cross-reference "See also Problem 180" appears in 575's docstring. Problem 180's docstring does **not** cross-reference Problem 575; adding a "See also Problem 575" note would be helpful. + +4. **Hunter's counterexample**: Described in the docstring. — **Appropriately documented**. + +**Verdict**: All formalizable content from the website is captured (across 180 and 575). A cross-reference from 180 to 575 would improve discoverability. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The docstrings for `ContainsSubgraph`, `turanNumber`, and `turanNumberFamily` are clear, include LaTeX, and match the mathematical definitions. +- The main theorem's docstring explains both the conjecture and its resolution, which is good practice for a solved problem. +- The namespace `Erdos180` appropriately scopes the local definitions. +- The use of `haveI := fv; haveI := dr` to bring instances into scope is a standard pattern in this codebase. + +Minor suggestions: +- The asymptotic notation in the docstring (`≪` and `≍`) is standard but could be briefly glossed for non-specialist readers (e.g., "$\operatorname{ex}(n;\mathcal{F})$ is bounded" instead of "$\ll 1$"). + +**Verdict**: Readability is good. No substantive changes needed. + +## 5. Formalizability + +The problem is precisely stated and cleanly formalizable. The key question — "does there exist a member whose Turán number is within a constant factor of the family's?" — translates directly into the formal statement. + +**No ambiguity issues.** The quantifier structure is clear: +- For all finite families $\mathcal{F}$... +- There exists a member $G \in \mathcal{F}$... +- And a constant $C > 0$... +- Such that for all $n \geq 1$: $\operatorname{ex}(n; G) \leq C \cdot \operatorname{ex}(n; \mathcal{F})$. + +The formalization's use of `answer(False)` correctly encodes that this statement is false (disproved by counterexample). + +One minor note: the original problem uses $\ll_{\mathcal{F}}$ (asymptotic domination with the implied constant depending on $\mathcal{F}$), which is equivalent to the $\exists C > 0, \forall n \geq 1$ formulation used here. + +**Verdict**: Unambiguous and cleanly formalizable. + +## 6. Correctness + +### Status: Solved vs. Open + +**This is the most significant finding.** The website ([erdosproblems.com/180](https://www.erdosproblems.com/180)) marks the problem as **OPEN**, while the formalization uses `category research solved` with `answer(False)`. + +The website itself describes the Hunter counterexample that disproves the literal statement, yet still marks the problem as open. This likely reflects one of: +- The website considers the "real" problem to be the bipartite refinement (Problem 575), which remains open. +- The website has not been updated to reflect that the literal question is resolved. +- The status reflects that there may be further nuances (e.g., restricting to families of connected graphs or 2-connected graphs). + +The formalization's `category research solved` with `answer(False)` is defensible for the literal statement, but the discrepancy with the website should be noted and potentially discussed in the docstring. + +### Counterexample verification + +The docstring's counterexample is mathematically correct: +- Let $H_1 = K_{1,k}$ (star with $k \geq 2$ edges) and $H_2 = M_k$ (matching with $k \geq 2$ edges). +- $\operatorname{ex}(n; H_1) = \Theta(n)$: avoiding $K_{1,k}$ means max degree $\leq k-1$, and the max-edge graph is a $(k-1)$-regular graph (when $n$ is suitable), giving $\sim (k-1)n/2$ edges. +- $\operatorname{ex}(n; H_2) = \Theta(n)$: avoiding a matching of size $k$ still allows $\Theta(n)$ edges (e.g., $(k-1)$ disjoint edges plus isolated vertices gives $(k-1)$ edges, but denser constructions exist with $\Theta(n)$ edges). +- $\operatorname{ex}(n; \{H_1, H_2\}) = O(1)$: a graph with max degree $\leq k-1$ and matching number $\leq k-1$ has a vertex cover of size $\leq 2(k-1)$ (by the 2-approximation to vertex cover via maximal matching), so all edges are incident to $\leq 2(k-1)$ vertices, giving $\leq 2(k-1)^2$ edges — a constant independent of $n$. + +Thus no member $G \in \{H_1, H_2\}$ satisfies $\operatorname{ex}(n; G) \leq C \cdot \operatorname{ex}(n; \mathcal{F})$ for all $n$, since the LHS is $\Theta(n)$ while the RHS is $O(1)$. + +### Formal statement correctness + +- **Quantifier structure**: `∀ (ι : Type) [Fintype ι] [Nonempty ι] (k : ι → ℕ) (H : ...)` correctly universally quantifies over all nonempty finite families of finite graphs. The `Nonempty ι` constraint is appropriate — an empty family is degenerate. + +- **Graph representation**: Graphs are represented as `SimpleGraph (Fin (k i))`, parameterized by vertex count. This correctly captures all finite simple graphs up to isomorphism (since any finite simple graph can be encoded on `Fin n` for appropriate `n`). + +- **Inequality direction**: `turanNumber (H i) n ≤ C * turanNumberFamily H n` correctly formalizes $\operatorname{ex}(n; G) \leq C \cdot \operatorname{ex}(n; \mathcal{F})$, since $\operatorname{ex}(n; \mathcal{F}) \leq \operatorname{ex}(n; G)$ always holds (forbidding more graphs reduces the extremal number), so the interesting direction is the upper bound on the individual Turán number. + +- **Constant positivity**: The constraint `0 < C` is correct. Note that `C ≥ 1` would also work (since $\operatorname{ex}(n; G) \geq \operatorname{ex}(n; \mathcal{F})$, any valid $C$ must be $\geq 1$), but `0 < C` is weaker and thus makes the negation (answer = False) slightly stronger. This is fine. + +- **Edge case — `turanNumberFamily` when family Turán number is 0**: When $\operatorname{ex}(n; \mathcal{F}) = 0$, the RHS $C \cdot 0 = 0$, requiring $\operatorname{ex}(n; G) = 0$. This is consistent: if the only $\mathcal{F}$-free graph on $n$ vertices is edgeless, then the only $G$-free graph (for $G \in \mathcal{F}$) is also edgeless (since $G$-freeness is weaker). So $\operatorname{ex}(n; G) = 0$ follows. No issue here. + +- **`sSup` well-definedness**: The `turanNumber` and `turanNumberFamily` definitions use `sSup` on a subset of `ℕ`. For fixed $n$, the set is nonempty (the empty graph gives 0 edges) and bounded above (by $\binom{n}{2}$), so `sSup` returns the maximum. This is correct. + +- **Universe issue**: The definitions quantify `∃ (V : Type)`, which lives in `Type 0`. This is sufficient for finite graphs but means the definition is universe-monomorphic. This is a minor technical point and does not affect mathematical correctness. + +**Verdict**: The formalization is mathematically correct and complete. The only concern is the status discrepancy with the website (OPEN vs. solved), which should be documented. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `ContainsSubgraph`/`turanNumber`/`turanNumberFamily` duplicated across 18+ files; shared module recommended | +| Citations | [ErSi82] missing full bibliographic details (title, journal, volume, pages) — cf. Problem 575 | +| Variants | All website content captured (across 180 and 575); add cross-reference to Problem 575 | +| Readability | Good | +| Formalizability | Unambiguous, cleanly formalizable | +| Correctness | Mathematically correct; **status discrepancy** — website says OPEN, formalization says solved | diff --git a/ai-review/181.md b/ai-review/181.md new file mode 100644 index 0000000000..6d2484e19d --- /dev/null +++ b/ai-review/181.md @@ -0,0 +1,182 @@ +# Review: Erdős Problem 181 + +**File:** `FormalConjectures/ErdosProblems/181.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `hypercubeGraph` definition.** + +The `hypercubeGraph` definition (lines 38–48) is duplicated verbatim in at least five other files: + +- `FormalConjectures/ErdosProblems/86.lean` (lines 45–58) +- `FormalConjectures/ErdosProblems/666.lean` (lines 52–65) +- `FormalConjectures/ErdosProblems/576.lean` (lines 34–47) +- `FormalConjectures/ErdosProblems/1035.lean` (lines 35–47) +- `FormalConjectures/ErdosProblems/578.lean` (lines 41–50, slight variant) + +Additionally, `FormalConjectures/Wikipedia/SnakeInTheBox.lean` defines an alternative `Hypercube` using `Finset (Fin n)` as vertices instead of `Fin n → Bool`. + +**Issue: Duplicated `ContainsCopy` definition.** + +The `ContainsCopy` definition (lines 52–53) captures injective graph homomorphisms. The same concept is defined under several names across the codebase: + +- `ContainsCopy` (Problems 181, 736, 594) +- `ContainsSubgraph` (Problems 576, 1035, 86, 180, 159, 113, 62, 59, and many others) +- `ContainsSubgraphCopy` (Problems 546, 548, 549, 550, 551, 552, 545) +- `containsCopy` (lowercase, Problem 163) + +All of these are semantically identical: they assert the existence of an injective function preserving adjacency. + +**Issue: Duplicated `ramseyDiag` definition.** + +The `ramseyDiag` definition (lines 57–59) also appears in Problem 163 (lines 57–59). Problems 546 and 545 define a `ramseyNumber` with a similar but slightly different type signature (requiring `Fin k` vertices). + +**Recommendation:** Factor the shared definitions (`hypercubeGraph`, `ContainsCopy`/`ContainsSubgraph`, `ramseyDiag`) into shared utility files. This would eliminate widespread duplication across at least 15+ problem files. The naming should be unified — `ContainsSubgraph` appears to be the most common convention. + +Note: `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` for hypergraph Ramsey numbers, which is not directly applicable here (Problem 181 concerns graph Ramsey numbers, not hypergraph Ramsey numbers). + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/181](https://www.erdosproblems.com/181):** + +The website lists: +- **Status:** Open. Cannot be resolved with finite computation. +- **Tags:** Graph theory, Ramsey theory. +- **Attribution:** Burr and Erdős originally conjectured this. Erdős later noted in [Er93] that he and Sós had previously considered the problem but "could not decide whether $R(Q_n)/2^n \to \infty$ or not." +- **Best known bound:** Tikhomirov (2022) proved $R(Q_n) \ll 2^{(2-c)n}$ where $c \approx 0.03656$. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Burr & Erdős 1975 | `[BuEr75]` — full title given | Yes | **OK.** Matches. | +| Erdős 1993 | Not cited | Yes (`[Er93]`, page 346) | **Missing.** The website attributes Erdős's remark about Sós to [Er93]. Consider adding. | +| Tikhomirov 2022 | Not cited | Yes (`[Ti22]`) | **Missing.** This is the current best known bound. Consider mentioning in the docstring for context. | + +**Minor issues:** +- The formalization's docstring reference format `[BuEr75]` and full citation are good. +- The website notes Erdős and Sós had considered the problem independently of Burr. This historical context is absent from the docstring. + +--- + +## 3. Variants + +The formalization captures only the main conjecture: $R(Q_n) = O(2^n)$. + +**Potential variants that could be formalized:** + +1. **Best known upper bound (Tikhomirov 2022):** $R(Q_n) \ll 2^{(2-c)n}$ for some $c > 0$. This is a known result and could be stated as a solved theorem: + ```lean + @[category research solved] + theorem erdos_181_tikhomirov : + ∃ c : ℝ, 0 < c ∧ + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (ramseyDiag (hypercubeGraph n) : ℝ) ≤ C * (2 : ℝ) ^ ((2 - c) * n) := by + sorry + ``` + +2. **Trivial upper bound:** $R(Q_n) \leq R(K_{2^n})$. This is an elementary observation relating graph Ramsey numbers to classical Ramsey numbers and could serve as a sanity check. + +3. **Lower bound / superlinearity question (Erdős–Sós):** Erdős and Sós could not determine whether $R(Q_n)/2^n \to \infty$. This could be stated as a separate open problem: + ```lean + @[category research open] + theorem erdos_181_superlinear : + Filter.Tendsto (fun n => (ramseyDiag (hypercubeGraph n) : ℝ) / 2 ^ n) + Filter.atTop Filter.atTop := by + sorry + ``` + Though it is unclear whether Erdős conjectured this or merely asked it. + +**Assessment:** The main conjecture is captured. The Tikhomirov bound is a natural companion result worth formalizing. + +--- + +## 4. Readability + +- **Structure:** The file is well-organized: hypercube definition → containment definition → Ramsey number definition → theorem. This logical progression aids understanding. +- **Docstrings:** Both the module-level and theorem-level docstrings are clear and informative. The mathematical notation ($Q_n$, $R(Q_n) \ll 2^n$) is correctly used. +- **Proofs of `symm` and `loopless`:** The proof terms for the `SimpleGraph` fields are inline and reasonably concise. The symmetry proof is slightly verbose but perfectly readable. +- **Naming:** `hypercubeGraph`, `ContainsCopy`, `ramseyDiag` are all descriptive and appropriate. +- **Minor suggestion:** The `ContainsCopy` docstring says "not necessarily induced" which is a helpful clarification. The `ramseyDiag` docstring correctly specifies the diagonal (single-graph) nature of the Ramsey number. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The conjecture $R(Q_n) \ll 2^n$ is entirely precise once the definitions of hypercube graph and diagonal Ramsey number are fixed. There is no ambiguity in: +- The hypercube graph $Q_n$ (standard definition). +- The diagonal Ramsey number $R(H)$ for a graph $H$ (minimum $N$ such that every 2-coloring of $K_N$ contains a monochromatic copy of $H$). +- The asymptotic bound $\ll$ (existence of a constant $C$ with $R(Q_n) \leq C \cdot 2^n$ for all $n$). + +The only subtlety is whether "copy" means subgraph (injective homomorphism) or induced subgraph (injective homomorphism preserving both edges and non-edges). The standard convention in Ramsey theory for graphs is **subgraph** (non-induced), and the formalization correctly uses this convention. + +**Ambiguity level: None.** This is a clean, well-defined conjecture. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `hypercubeGraph` +```lean +def hypercubeGraph (n : ℕ) : SimpleGraph (Fin n → Bool) where + Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1 + symm := ... + loopless := ... +``` + +- **Vertex type:** `Fin n → Bool` is the standard representation of $\{0,1\}^n$, giving exactly $2^n$ vertices. Correct. +- **Adjacency:** Two vertices are adjacent iff they are distinct and differ in exactly one coordinate. The cardinality-1 filter correctly captures Hamming distance 1. The `u ≠ v` conjunct is redundant (Hamming distance 1 implies distinctness) but harmless and aids the `loopless` proof. +- **Edge case $n = 0$:** When $n = 0$, the vertex type `Fin 0 → Bool` has exactly one element (the empty function), so $Q_0$ is the graph with one vertex and no edges. This is correct: the 0-dimensional hypercube is a single point. +- **Symmetry and irreflexivity proofs:** Both are correct. + +### Definition: `ContainsCopy` +```lean +def ContainsCopy {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` + +- This defines a (non-induced) subgraph embedding: an injective map preserving adjacency. This is the correct notion for Ramsey theory — a monochromatic "copy" of $H$ in a 2-coloring of $K_N$ means a subgraph isomorphic to $H$, not necessarily an induced copy. +- The implication is one-directional (`H.Adj u v → G.Adj (f u) (f v)`), meaning non-edges of $H$ may become edges in $G$. This is correct for the non-induced setting. + +### Definition: `ramseyDiag` +```lean +noncomputable def ramseyDiag {U : Type*} (H : SimpleGraph U) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), + ContainsCopy G H ∨ ContainsCopy Gᶜ H} +``` + +- **Semantics:** The infimum of all $N$ such that every graph on $\operatorname{Fin} N$ contains a copy of $H$ or its complement contains a copy of $H$. This is precisely the diagonal Ramsey number $R(H) = R(H, H)$. +- **Equivalence to 2-coloring:** Every graph $G$ on $\operatorname{Fin} N$ induces a 2-coloring of $K_N$ (edges of $G$ get color 1, non-edges get color 2). Requiring $G$ or $G^c$ to contain $H$ is equivalent to requiring a monochromatic copy of $H$. Correct. +- **Use of `sInf`:** If the set is empty (i.e., no such $N$ exists), `sInf` returns 0 by convention in Lean/Mathlib. However, the Ramsey theorem guarantees that for any finite graph $H$, the set is nonempty (in fact, $R(K_{|V(H)|})$ is always in the set). So the `sInf` is well-founded for all graphs with finitely many vertices. +- **Potential concern — `DecidableEq` and `Fintype` on `U`:** The definition is universe-polymorphic over `U : Type*` without requiring `Fintype U` or `DecidableEq U`. The `ContainsCopy` predicate is still well-defined as a `Prop` without these, but `ramseyDiag` could be 0 for infinite graphs $H$ (since no finite $N$ would suffice). In the theorem statement, `U = Fin n → Bool` which is both `Fintype` and `DecidableEq`, so this is not a problem in practice. Still, adding `[Fintype U]` as a hypothesis to `ramseyDiag` would be more mathematically principled. + +### Theorem: `erdos_181` +```lean +theorem erdos_181 : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, 1 ≤ n → + (ramseyDiag (hypercubeGraph n) : ℝ) ≤ C * (2 ^ n : ℝ) := by + sorry +``` + +- **Statement:** "There exists $C > 0$ such that for all $n \geq 1$, $R(Q_n) \leq C \cdot 2^n$." This is exactly $R(Q_n) = O(2^n)$, matching the conjecture. +- **Positivity of $C$:** The constraint `0 < C` is appropriate — without it, $C = 0$ would make the bound vacuously strong (and false). With it, the statement asserts a genuine linear upper bound. +- **Restriction $n \geq 1$:** The constraint `1 ≤ n` excludes the trivial case $n = 0$. This is reasonable: $Q_0$ has one vertex, so $R(Q_0) = 1$ and $C \cdot 2^0 = C$, which holds for any $C \geq 1$. Including $n = 0$ would work fine but is unnecessary. +- **Cast to `ℝ`:** The coercion `(ramseyDiag (hypercubeGraph n) : ℝ)` is needed because `C` is real-valued. This is standard practice. +- **Tags:** `@[category research open, AMS 5]` — "research open" is correct per the website. AMS classification 5 corresponds to Combinatorics, which is appropriate. + +### Edge case analysis + +- **$n = 1$:** $Q_1 = K_2$ (two vertices, one edge). $R(K_2) = 2$. The bound requires $2 \leq C \cdot 2$, i.e., $C \geq 1$. Fine. +- **$n = 2$:** $Q_2 = C_4$ (4-cycle). $R(C_4) = 6$. The bound requires $6 \leq 4C$, i.e., $C \geq 3/2$. Fine. + +**Verdict: Correct and complete.** The formalization faithfully captures Erdős Problem 181. The definitions of hypercube graph, graph containment, and diagonal Ramsey number are all mathematically sound. The theorem statement precisely encodes the conjecture $R(Q_n) \ll 2^n$. No mathematical flaws identified. Minor improvements: adding `[Fintype U]` to `ramseyDiag`, and citing [Er93] and [Ti22]. diff --git a/ai-review/182.md b/ai-review/182.md new file mode 100644 index 0000000000..f9bb5e0985 --- /dev/null +++ b/ai-review/182.md @@ -0,0 +1,177 @@ +# Review: Erdos Problem 182 + +**File:** `FormalConjectures/ErdosProblems/182.lean` + +--- + +## 1. Code Reuse + +**Issue: `ContainsKRegularSubgraph` duplicates Mathlib concepts and a pattern from Problem 147.** + +The regularity condition `∀ v : U, H.degree v = k` is exactly Mathlib's `SimpleGraph.IsRegularOfDegree` from `Mathlib.Combinatorics.SimpleGraph.Finite` (line 306): + +```lean +def IsRegularOfDegree (d : ℕ) : Prop := + ∀ v : V, G.degree v = d +``` + +Additionally, the injective-homomorphism portion: +```lean +∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` +is identical to `ContainsSubgraph` defined in `FormalConjectures/ErdosProblems/147.lean` (line 40): +```lean +def ContainsSubgraph {V U : Type*} (F : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → F.Adj (f u) (f v) +``` + +**Recommendation:** Refactor `ContainsKRegularSubgraph` to compose these existing definitions: + +```lean +def ContainsKRegularSubgraph {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (U : Type) (fU : Fintype U) (_ : Nonempty U) (H : SimpleGraph U) (dH : DecidableRel H.Adj), + haveI := fU; haveI := dH; + H.IsRegularOfDegree k ∧ ContainsSubgraph G H +``` + +This requires either importing Problem 147 (undesirable cross-dependency) or extracting `ContainsSubgraph` into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`). The latter is preferred. Problem 1008 also uses subgraph relations (`H ≤ G`), further motivating a shared definition. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/182](https://www.erdosproblems.com/182):** + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdos 1975 | `[Er75]` | Yes | OK | +| Erdos 1978 | — | `[Er78, p.31]` | **Missing.** The website lists this as a source where the problem was posed, with a $100 prize for k=3. | +| Erdos 1981 | `[Er81]` | Yes | OK | +| Janzer & Sudakov 2023 | `[JaSu23]` | Yes | OK | +| Pyber, Rodl & Szemeredi 1995 | `[PRS95]` | Yes | OK | +| Chakraborti, Janzer, Methuku & Montgomery 2024 | — | `[CJMM24b]` | **Missing.** They proved C(k) ≪ k², which is best possible up to absolute constants. This is a significant refinement of the resolution. | + +**Additional website details not in the formalization:** +- **$100 prize** offered in [Er78] specifically for the case k=3 (or for determining whether the answer is ≪ n). +- **Contributors** acknowledged on the website: Alfaiz and Antonio Girao. + +**Recommendation:** Add the `[Er78]` and `[CJMM24b]` references to the module docstring: + +``` +[Er78] Erdős, P., _Problems in number theory and combinatorics_, Proceedings of the + Sixth Manitoba Conference on Numerical Mathematics (1978), p. 31. + +[CJMM24b] Chakraborti, D., Janzer, O., Methuku, A., and Montgomery, R., + _Resolution of the Erdős–Sauer conjecture: quantitative refinement_, 2024. +``` + +--- + +## 3. Variants + +The formalization captures only the main Janzer–Sudakov upper bound. The website and literature suggest several additional variants: + +1. **Quantitative bound on C(k):** Chakraborti et al. [CJMM24b] proved C(k) ≪ k², which is best possible up to absolute constants. This could be formalized as: + ```lean + theorem erdos_182_quantitative : + ∃ A : ℝ, 0 < A ∧ ∃ n₀ : ℕ, + ∀ k : ℕ, 3 ≤ k → + ∀ n : ℕ, n₀ ≤ n → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ A * (k : ℝ)^2 * n * Real.log (Real.log n) → + ContainsKRegularSubgraph G k + ``` + +2. **Lower bound (Pyber–Rodl–Szemeredi):** The matching lower bound: for every k ≥ 3, there exist graphs on n vertices with Ω(n · log log n) edges containing no k-regular subgraph. This would demonstrate the tightness of the upper bound: + ```lean + theorem erdos_182_lower : + ∀ k : ℕ, 3 ≤ k → + ∃ C : ℝ, 0 < C ∧ + ∀ n₀ : ℕ, ∃ n : ℕ, n₀ ≤ n ∧ + ∃ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ C * n * Real.log (Real.log n) ∧ + ¬ContainsKRegularSubgraph G k + ``` + +3. **Connected variant (Szemeredi):** The website mentions Szemerédi's question requiring the k-regular subgraph to be *connected*. Let F(n,k) be the minimum number of edges guaranteeing a connected k-regular subgraph. Erdős [Er75] proved F(n,3) ≪ n^(5/3). This is a distinct and interesting variant not captured by the formalization. + +--- + +## 4. Readability + +The code is well-structured and concise. Minor observations: + +- **Definition docstring:** The docstring for `ContainsKRegularSubgraph` is clear and mathematically accurate. +- **Use of `haveI`:** The `haveI := fU; haveI := dH` pattern for introducing instances is standard in this codebase. It works but adds syntactic noise; using `@` or letI could be alternatives, though this is a project-wide style choice. +- **Module docstring:** Well-written with good mathematical context. The narrative flow (question → resolution → optimality) is logical. +- **Naming:** `ContainsKRegularSubgraph` is descriptive. Using `IsRegularOfDegree` from Mathlib would make the regularity condition immediately recognizable to Mathlib users. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The resolved statement of Erdős Problem 182 is fully precise: "For k ≥ 3, there exists C > 0 such that any graph on n vertices with at least C·n·log(log(n)) edges contains a k-regular subgraph." Every term is standard and well-defined: + +- "k-regular subgraph" has a unique standard meaning (a subgraph where every vertex has degree exactly k). +- "Graph on n vertices" is standard (simple, undirected, no self-loops). +- "log(log(n))" is the iterated natural logarithm. +- The constant C depends on k, which is captured by the quantifier ordering (∀ k, ∃ C). + +The only minor source of potential ambiguity is whether "subgraph" means "subgraph" (vertex and edge subset) or "copy" (injective homomorphism). These are equivalent for the purpose of this problem since both notions yield the same threshold. The formalization uses the injective-homomorphism notion, which is standard and correct. + +**Ambiguity level: None.** + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `ContainsKRegularSubgraph` + +```lean +def ContainsKRegularSubgraph {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (U : Type) (fU : Fintype U) (_ : Nonempty U) (H : SimpleGraph U) (dH : DecidableRel H.Adj), + haveI := fU; haveI := dH; + (∀ v : U, H.degree v = k) ∧ + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` + +- **Nonemptiness (`Nonempty U`):** Correctly excludes the vacuous case (an empty graph is trivially 0-regular for any k). For k ≥ 3, any k-regular graph must have at least k+1 vertices, so `Nonempty` is automatically satisfied, but it is good practice to include it in the general definition. +- **Fintype constraint:** Correctly requires the witness graph H to be finite. +- **Regularity:** `∀ v : U, H.degree v = k` correctly encodes k-regularity. +- **Injective homomorphism:** `Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v)` correctly captures subgraph containment. Injectivity ensures distinct vertices of H map to distinct vertices of G. Edge-preservation ensures every edge of H corresponds to an edge of G. Note this is *not* an induced subgraph embedding (non-edges of H need not map to non-edges of G), which is the correct notion here — we only need the image to contain a k-regular spanning subgraph, not that it *is* one as an induced subgraph. + +**Subtle point verified:** Since f is injective and preserves adjacency, distinct edges of H map to distinct edges in G. The image graph (on vertex set f(U) with edges {(f(u),f(v)) : H.Adj u v}) is isomorphic to H, hence k-regular, and is a subgraph of G. This is exactly the right notion. + +### Theorem: `erdos_182` + +```lean +theorem erdos_182 : + ∀ k : ℕ, 3 ≤ k → + ∃ C : ℝ, 0 < C ∧ ∃ n₀ : ℕ, + ∀ (n : ℕ), n₀ ≤ n → + ∀ (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + (G.edgeFinset.card : ℝ) ≥ C * (n : ℝ) * Real.log (Real.log (n : ℝ)) → + ContainsKRegularSubgraph G k +``` + +- **Quantifier structure:** ∀ k ≥ 3, ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ... — this correctly allows C and n₀ to depend on k. +- **Edge threshold:** `C * n * log(log(n))` matches the Janzer–Sudakov result exactly. +- **`Real.log` behavior:** `Real.log x` returns 0 for x ≤ 0 in Mathlib, so `Real.log (Real.log n)` could be 0 or negative for small n. The `n₀` threshold ensures n is large enough that `log(log(n)) > 0`, making the edge bound meaningful. This is handled correctly. +- **Vertex type `Fin n`:** Using `Fin n` for a graph on exactly n vertices is standard and correct. +- **`edgeFinset.card`:** Correctly counts the number of edges (each undirected edge counted once). +- **`≥` vs `>`:** Using ≥ is standard for threshold results and mathematically equivalent to > for the asymptotic statement. + +### Potential concern: universe polymorphism + +The definition `ContainsKRegularSubgraph` existentially quantifies over `U : Type` (in `Type 0`). Since the main theorem uses `Fin n` (which lives in `Type 0`), and any subgraph of a graph on `Fin n` has at most n vertices, the witness U can always be taken as a `Fintype` in `Type 0`. There is no universe issue here. + +**Verdict: Correct and complete for the main statement.** No mathematical flaws. The formalization faithfully captures the Janzer–Sudakov resolution of the Erdős–Sauer conjecture. The main deficiencies are: (1) missing the quantitative refinement by Chakraborti et al., (2) missing the matching lower bound by Pyber–Rodl–Szemeredi, and (3) missing the connected variant due to Szemerédi. These are omissions of variants, not errors in the existing formalization. diff --git a/ai-review/183.md b/ai-review/183.md new file mode 100644 index 0000000000..c8d704efdf --- /dev/null +++ b/ai-review/183.md @@ -0,0 +1,169 @@ +# Review: Erdos Problem 183 + +**File:** `FormalConjectures/ErdosProblems/183.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated multicolor Ramsey definition.** + +Problem 556 (`FormalConjectures/ErdosProblems/556.lean`) already defines a general `multicolorRamseyNumber` that computes the k-colour Ramsey number R_k(G) for an arbitrary graph G. The `multicolorRamseyTriangle` defined here is mathematically identical to `multicolorRamseyNumber (completeGraph (Fin 3)) k` — a monochromatic triangle in a k-coloring of K_n is exactly a monochromatic copy of K₃. + +The two definitions use the same representation (symmetric function `c : Fin N → Fin N → Fin k`) and differ only in how the monochromatic substructure is specified: +- Problem 183: directly asserts three pairwise-distinct vertices with matching edge colors. +- Problem 556: asserts an injective map from V(G) into Fin N preserving colors. + +For G = K₃ on `Fin 3`, these are equivalent. + +**Additionally**, `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey r n` for 2-colorings of r-uniform hypergraphs. While this is the 2-color case and uses a different representation (coloring hyperedges rather than graph edges), it shows the project has infrastructure for Ramsey numbers. + +**Recommendation:** Either: +- (a) Redefine `multicolorRamseyTriangle k` as `multicolorRamseyNumber (completeGraph (Fin 3)) k` (importing from 556), or +- (b) Factor the general `multicolorRamseyNumber` into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` or a new file) and have both Problems 183 and 556 import from it. This would be the preferred approach since it centralizes the definition. + +Option (b) is recommended since it avoids a circular dependency between problem files and puts the general definition in the library. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/183](https://www.erdosproblems.com/183):** + +The website lists: +- **Status:** Open. $250 prize ($100 for proving the limit is finite). +- **Reference:** Erdős 1961. +- **Related problems:** Problem 483. +- **Related OEIS:** A003323. +- **Tags:** Ramsey Theory. +- **Key results:** + - Upper bound: R(3;k) ≤ ⌈e·k!⌉ (from recurrence R(3;k) ≤ 2 + k(R(3;k−1)−1)). + - Lower bound: R(3;k) ≥ 380^{k/5} − O(1), due to Ageron, Casteras, Pellerin, Portella, Rimmel, and Tomasik [ACPPRT21], improving earlier bounds of Exoo [Ex94] and Fredricksen & Sweet [FrSw00]. + +| Item | In formalization | On website | Assessment | +|------|-----------------|------------|------------| +| [Er61] | `[Er61]` in docstring | Yes (Erdős 1961) | OK. | +| Upper bound ⌈e·k!⌉ | Mentioned in docstring | Yes | OK. | +| Lower bound 380^{k/5} | Mentioned in docstring | Yes, attributed to [ACPPRT21] | **Missing attribution.** The docstring states the lower bound without citing the authors. Should cite Ageron–Casteras–Pellerin–Portella–Rimmel–Tomasik [ACPPRT21]. | +| Exoo [Ex94] | Not mentioned | Yes (earlier lower bound) | Minor omission (superseded result). | +| Fredricksen–Sweet [FrSw00] | Not mentioned | Yes (earlier lower bound) | Minor omission (superseded result). | +| OEIS A003323 | Not mentioned | Yes | Could be added for cross-referencing. | +| Related Problem 483 | Not mentioned | Yes | Could be noted in docstring. | + +**Recommendation:** Add `[ACPPRT21]` citation for the lower bound in the docstring. Consider adding OEIS and cross-reference to Problem 483. + +--- + +## 3. Variants + +The formalization captures only the main conjecture: the existence of a finite limit of R(3;k)^{1/k}. + +**Missing variants that could be formalized:** + +1. **Lower bound on the limit (proven):** If the limit L exists, then L ≥ 380^{1/5} ≈ 3.2806. This follows from the known lower bound R(3;k) ≥ 380^{k/5} − O(1): + ``` + theorem erdos_183_lower_bound : + ∀ L : ℝ, Tendsto (...) atTop (nhds L) → L ≥ 380 ^ ((1 : ℝ) / 5) := by sorry + ``` + +2. **Upper bound (proven):** R(3;k) ≤ ⌈e·k!⌉. This is a concrete known result and could be stated independently: + ``` + theorem multicolorRamseyTriangle_upper (k : ℕ) : + multicolorRamseyTriangle k ≤ ⌈Real.exp 1 * ↑(Nat.factorial k)⌉₊ := by sorry + ``` + +3. **Determining the value:** The website says "determine the limit," which asks not just for existence but for the actual value. A variant could conjecture a specific value or bounds on L. + +4. **Divergence alternative:** If the conjecture is false (the limit is +∞), one could formalize the alternative: + ``` + theorem erdos_183_alt : + Tendsto (fun k => (multicolorRamseyTriangle k : ℝ) ^ ((1:ℝ)/(k:ℝ))) atTop atTop + ``` + This would be a useful counterpart for an open problem where the truth value is unknown. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Namespace:** `Erdos183` is appropriate and follows project conventions. +- **Definition docstring:** The docstring for `multicolorRamseyTriangle` clearly explains the mathematical meaning. The LaTeX-style description of k-colourings and monochromatic triangles is helpful. +- **Theorem docstring:** Well-written, includes the problem statement and known bounds. The mathematical context is clearly presented. +- **Variable naming:** The choice of `d` for the third vertex of the triangle (instead of the more conventional `c`, which would clash with the coloring function) is reasonable but slightly non-standard. A name like `e` or `v₃` might be clearer, though `d` is fine. +- **Expression style:** `(1 : ℝ) / (k : ℝ)` is clear but could be written as `(k : ℝ)⁻¹` for conciseness, though the current form is arguably more readable for non-Lean-experts. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one interpretive subtlety.** + +The core mathematical concepts are precise: +- "k-colouring of the edges of K_n" is unambiguous. +- "Monochromatic triangle" is unambiguous. +- "Minimum n such that ..." is captured by `sInf`. + +**Subtlety — "the limit exists":** The original problem says "determine lim R(3;k)^{1/k}." This is ambiguous between: +- (a) The limit exists and is finite — determine its value. +- (b) The limit exists in the extended reals (possibly +∞) — determine whether it's finite. + +The formalization assumes interpretation (a): it asserts existence of a *finite* real limit L with `∃ L : ℝ, Tendsto ... (nhds L)`. Given that the $100 sub-prize is specifically for proving finiteness, interpretation (a) appears to be the intended reading of the conjecture: Erdős conjectured that the limit is finite. + +However, this means the formalization would be *false* (not just unprovable) if the limit turns out to be infinite. For an open problem, one could argue for a more neutral formulation, but the current approach is standard for conjectural formalizations. + +**Ambiguity level: Low.** The main statement is clear; the only subtlety is whether "the limit exists" means "exists and is finite" or "exists in the extended reals." + +--- + +## 6. Correctness + +### Definition: `multicolorRamseyTriangle` + +```lean +noncomputable def multicolorRamseyTriangle (k : ℕ) : ℕ := + sInf {n : ℕ | ∀ (c : Fin n → Fin n → Fin k), + (∀ i j, c i j = c j i) → + ∃ (a b d : Fin n), a ≠ b ∧ a ≠ d ∧ b ≠ d ∧ + c a b = c a d ∧ c a b = c b d} +``` + +**Analysis:** + +1. **Symmetry condition** (`∀ i j, c i j = c j i`): Correctly models undirected edge coloring. This is given as a hypothesis, so the infimum is taken over all symmetric colorings. ✓ + +2. **Monochromatic triangle condition:** The condition `c a b = c a d ∧ c a b = c b d` asserts that all three edges of triangle {a,b,d} receive the same color. Combined with the three pairwise-distinctness conditions `a ≠ b ∧ a ≠ d ∧ b ≠ d`, this correctly captures a monochromatic triangle. ✓ + +3. **No irreflexivity condition on c:** The coloring function assigns colors to `c i i` (self-loops), but these values are never examined since the triangle condition only considers pairwise-distinct vertices. This is harmless. ✓ + +4. **`sInf` on potentially empty set:** If the set `{n | ...}` is empty, `sInf ∅ = 0` in ℕ. For k ≥ 1, the classical Ramsey theorem guarantees R(3,3,...,3) with k copies of 3 is finite, so the set is nonempty. For k = 0, the set is empty (there are no functions into `Fin 0` from any nonempty domain, making the universal vacuously true, but the existential over three distinct vertices fails for n ≤ 2; for n ≥ 3 there are no colorings, so the universal is vacuously true but the existential for three distinct vertices can only be satisfied if we can find them, which requires checking). In any case, k = 0 is degenerate and irrelevant to the limit statement. ✓ + +5. **Well-definedness for the limit:** The limit is taken along `atTop` for k : ℕ, so behavior at k = 0 is irrelevant. ✓ + +### Theorem: `erdos_183` + +```lean +theorem erdos_183 : + ∃ L : ℝ, + Tendsto (fun k : ℕ => (multicolorRamseyTriangle k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by + sorry +``` + +**Analysis:** + +1. **Logical structure:** "There exists a finite real L such that R(3;k)^{1/k} → L as k → ∞." This correctly formalizes the conjecture that the limit exists and is finite. ✓ + +2. **Exponent expression:** `(1 : ℝ) / (k : ℝ)` computes the k-th root exponent. When k = 0, this is `1 / 0 = 0` in ℝ, giving `R(3;0)^0 = 1` (or `0^0 = 1` in Lean). This is harmless since only the eventual behavior matters for `atTop`. ✓ + +3. **Cast correctness:** `(multicolorRamseyTriangle k : ℝ)` coerces ℕ to ℝ, which is the standard approach. ✓ + +4. **Potential concern — should this use `Filter.atTop` restricted to k ≥ 1?** No, this is unnecessary. The `atTop` filter ignores any finite prefix, so behavior at k = 0 is irrelevant. ✓ + +### Verdict + +**Correct and mathematically sound.** The formalization faithfully captures the conjecture that lim_{k→∞} R(3;k)^{1/k} exists as a finite real number. No mathematical flaws are present. The only point of note is the interpretive choice that "the limit exists" means "exists and is finite" — this is a reasonable and likely intended interpretation given the prize structure described on the website. + +The main deficiency is the absence of formalizations of known proven results (upper/lower bounds) as variants, and the opportunity to reuse the more general `multicolorRamseyNumber` definition from Problem 556. diff --git a/ai-review/184.md b/ai-review/184.md new file mode 100644 index 0000000000..b1fe6e92ba --- /dev/null +++ b/ai-review/184.md @@ -0,0 +1,173 @@ +# Review: Erdos Problem 184 + +**File:** `FormalConjectures/ErdosProblems/184.lean` + +--- + +## 1. Code Reuse + +**Observation: Shared edge-partition pattern with Problem 583.** + +Problem 583 (`FormalConjectures/ErdosProblems/583.lean`) uses a nearly identical structure for decomposing a graph's edges into edge-disjoint substructures (paths instead of cycles/edges). Both problems follow the same template: +- Index parts by `Fin k` +- Express parts as `Finset (Sym2 (Fin n))` +- Enforce pairwise disjointness via `∀ i j, i ≠ j → Disjoint (parts i) (parts j)` +- Enforce coverage via `∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ ...` + +Similarly, Problem 641 (`FormalConjectures/ErdosProblems/641.lean`) uses edge-disjoint cycle decomposition with the same disjointness pattern on `edges.toFinset`. + +**Recommendation:** Consider factoring out a reusable `IsEdgePartition` predicate into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` (which already contains `IsPathCover` and similar definitions). Something like: + +```lean +def IsEdgePartition (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj] + (k : ℕ) (parts : Fin k → Finset (Sym2 V)) : Prop := + (∀ i j : Fin k, i ≠ j → Disjoint (parts i) (parts j)) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i) +``` + +This would simplify the statements of Problems 184, 583, 641, and others. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/184](https://www.erdosproblems.com/184):** + +The website lists: +- **Status:** Open. +- **Conjectured by:** Erdős and Gallai. +- **Best result:** O(n log* n) by Bucić and Montgomery [BM22]. +- **Partial result (high minimum degree):** O_ε(n) when minimum degree > εn, by Conlon, Fox, and Sudakov [CFS14]. +- **Lower bound:** K_{3,n−3} shows at least (1+c)n parts are needed. +- **Relaxed variant:** Erdős (1971) suggested n−1 cycles and edges suffice without requiring edge-disjointness. +- **Related problems:** 583 (path decomposition), 1017 (complete graph decomposition). +- **References:** [EGP66], [Er71], [Er76], [Er81], [Er83b], [BM22], [CFS14]. + +| Item | In formalization | On website | Assessment | +|------|-----------------|------------|------------| +| [EGP66] | Module docstring + theorem docstring | Yes | OK. | +| [Er71], [Er76], [Er81], [Er83b] | Theorem docstring only | Yes | OK. | +| [BM22] | Module docstring | Yes | OK. Best bound mentioned. | +| [CFS14] (Conlon–Fox–Sudakov) | **Not mentioned** | Yes | **Missing.** The high-minimum-degree result O_ε(n) is a significant partial result. | +| Lower bound K_{3,n−3} | **Not mentioned** | Yes | **Missing.** Shows the linear bound is tight up to constant. | +| Related Problem 583 | **Not mentioned** | Yes | Could cross-reference. | +| Related Problem 1017 | **Not mentioned** | Yes | Could cross-reference. | + +**Full citation for [EGP66]:** The module docstring gives the citation as *"On the maximal number of vertices representing the edges of a graph"* (1966). The actual title according to standard references is *"On the Maximal Number of Vertices Representing the Edges of a Graph"* — this matches. However, the title is sometimes cited differently in some sources. The citation is acceptable. + +**Recommendation:** Add [CFS14] reference and note the K_{3,n−3} lower bound in the module docstring. Cross-reference Problems 583 and 1017. + +--- + +## 3. Variants + +The formalization captures only the main conjecture. Several variants from the website are not formalized: + +1. **High minimum degree case (proven, [CFS14]):** For every ε > 0, there exists C_ε such that every graph on n vertices with minimum degree ≥ εn can be decomposed into at most C_ε · n cycles and edges: + ```lean + theorem erdos_184_high_min_degree : + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG + (∀ v, ε * n ≤ (G.neighborFinset v).card) → + ∃ ... -- same decomposition with bound C * n + ``` + +2. **Best known upper bound (proven, [BM22]):** O(n log* n) cycles and edges suffice: + ```lean + theorem erdos_184_bucic_montgomery : + ∃ C : ℝ, 0 < C ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) ..., + ∃ ..., (k : ℝ) ≤ C * n * Nat.iteratedLog n ∧ ... + ``` + +3. **Lower bound (proven):** The complete bipartite graph K_{3,n−3} requires at least (1+c)n parts for some c > 0. This could be stated to show the linear bound is tight. + +4. **Non-edge-disjoint relaxation ([Er71]):** Erdős suggested only n−1 cycles and edges suffice if one does not require edge-disjointness (i.e., edges may appear in multiple cycles). + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Namespace:** `Erdos184` follows project conventions. ✓ +- **Docstrings:** Both the module docstring and theorem docstring clearly explain the mathematical content, including historical context and known results. ✓ +- **`haveI := dG` pattern:** Standard idiom for introducing decidability instances, consistent with Problem 583 and other graph problems in the codebase. ✓ +- **Variable naming:** `parts` for the partition components and `k` for the number of parts are natural. `w` for the cycle walk and `u` for the base vertex are reasonable. ✓ +- **Structure:** The four-part conjunction `(bound) ∧ (disjointness) ∧ (coverage) ∧ (type of each part)` is logically clear and mirrors Problem 583's structure. + +**Minor suggestion:** The coverage condition `∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i` could be annotated with a brief inline comment for newcomers, but this is a very minor point — the pattern is standard across the codebase. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The conjecture is precise: +- "Graph on n vertices" → `SimpleGraph (Fin n)`. ✓ +- "Decomposed into edge-disjoint cycles and edges" → partition of `edgeFinset` into parts, each a single edge or cycle edge set. ✓ +- "O(n) many" → ∃ C > 0 such that k ≤ C · n. ✓ + +**No ambiguity in the statement.** Unlike some Erdős problems where "graph" might mean multigraph or hypergraph, the context (edge-disjoint cycle decomposition of simple graphs) is completely standard. The terms "cycle" and "edge" are unambiguous in graph theory. The asymptotic "O(n)" bound is captured precisely by the existential constant C. + +**Ambiguity level: None.** This is a clean, precisely stated conjecture. + +--- + +## 6. Correctness + +### Theorem: `erdos_184` + +```lean +theorem erdos_184 : + ∃ C : ℝ, 0 < C ∧ + ∀ (n : ℕ) (G : SimpleGraph (Fin n)) (dG : DecidableRel G.Adj), + haveI := dG; + ∃ (k : ℕ) (parts : Fin k → Finset (Sym2 (Fin n))), + (k : ℝ) ≤ C * (n : ℝ) ∧ + (∀ i j : Fin k, i ≠ j → Disjoint (parts i) (parts j)) ∧ + (∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i) ∧ + (∀ i : Fin k, + (∃ e, parts i = {e}) ∨ + (∃ (u : Fin n) (w : G.Walk u u), w.IsCycle ∧ w.edges.toFinset = parts i)) +``` + +**Detailed analysis:** + +1. **Existential constant C > 0:** Correctly captures "O(n)" — there exists a universal constant C such that the bound Cn holds for all n and all graphs. The requirement `0 < C` is mathematically harmless (any valid C ≥ 0 can be replaced by C + 1 > 0). ✓ + +2. **Partition conditions:** + - **Disjointness:** `∀ i j, i ≠ j → Disjoint (parts i) (parts j)` correctly ensures edge-disjointness between parts. ✓ + - **Coverage (↔):** The biconditional `∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ parts i` ensures both completeness (every graph edge is in some part) and soundness (every element of every part is a graph edge). This correctly defines a partition of the edge set. ✓ + +3. **Part classification — single edge case:** `∃ e, parts i = {e}` means the part is a singleton finset. The coverage condition ensures `e ∈ G.edgeFinset`, so `e` is a valid edge of G. ✓ + +4. **Part classification — cycle case:** `∃ (u : Fin n) (w : G.Walk u u), w.IsCycle ∧ w.edges.toFinset = parts i`: + - The walk `w : G.Walk u u` is a closed walk in G, so its edges are edges of G. ✓ + - `w.IsCycle` requires `IsCircuit` (nonempty trail) and `support_nodup` (no repeated interior vertices). In a simple graph, this forces cycle length ≥ 3, which is the standard definition of a graph cycle. ✓ + - `w.edges.toFinset = parts i`: Since `IsCycle` implies `IsTrail` (which has `edges_nodup`), converting the edge list to a finset loses no information — all edges of the cycle are faithfully captured. ✓ + +5. **Parts are implicitly nonempty:** A single-edge part `{e}` is nonempty. A cycle part `w.edges.toFinset` is nonempty because `IsCycle` implies `w ≠ nil`, so the walk has at least one edge. This means there are no "phantom" empty parts inflating k. ✓ + +6. **Mutual exclusivity of cases:** In a simple graph, a cycle has ≥ 3 edges, so no single edge forms a cycle. The two cases in the disjunction are mutually exclusive, though this is not required for correctness (the statement only needs each part to satisfy at least one case). ✓ + +7. **Degenerate cases:** + - **n = 0:** `Fin 0` is empty, no edges, k = 0 works, and 0 ≤ C · 0 = 0. ✓ + - **n = 1:** No edges possible in a simple graph (no self-loops), k = 0 works. ✓ + - **Empty graph:** k = 0 works for any n. ✓ + +8. **No connectivity requirement:** The conjecture is stated for all graphs, not just connected ones. The formalization correctly does not assume connectivity (unlike Problem 583 which requires `G.Connected`). ✓ + +### Verdict + +**Correct and mathematically sound.** The formalization faithfully captures the Erdős-Gallai cycle decomposition conjecture. No mathematical flaws are present. The edge partition is correctly enforced, the cycle/edge classification is precise, and degenerate cases are handled properly. + +The main deficiencies are: +- Missing formalization of known partial results ([CFS14] high minimum degree case, [BM22] O(n log* n) bound) as variants. +- Missing [CFS14] citation in the docstring. +- Opportunity to factor out a shared edge-partition predicate reused across Problems 184, 583, 641, etc. diff --git a/ai-review/185.md b/ai-review/185.md new file mode 100644 index 0000000000..2f0b4d28b0 --- /dev/null +++ b/ai-review/185.md @@ -0,0 +1,72 @@ +# Review: Erdős Problem 185 + +## 1. Code Reuse + +**Significant overlap with Erdős Problem 171.** The definition `IsCombinatorialLine` in `ErdosProblems/185.lean:46` is mathematically identical to `IsCombLine` in `ErdosProblems/171.lean:55`, specialized to `t = 3`. Concretely: + +- 185: `∀ (j : Fin 3) (i : Fin n), p j i = if i ∈ S then j else c i` +- 171: `∀ (i : Fin t) (j : Fin N), P i j = if j ∈ S then i else c j` + +These are the same definition up to variable renaming. `IsCombinatorialLine n p ↔ IsCombLine 3 n p` should be provable trivially. The local definition in 185 could be replaced by reusing `IsCombLine` from 171. + +Furthermore, the theorem `erdos_185` itself is a direct specialization of `erdos_171` to `t = 3`. The only syntactic difference is that 185 uses strict inequality `>` where 171 uses `≥`, but this is mathematically inconsequential for density statements (both express that density-positive subsets contain a combinatorial line). + +**Recommendation:** Either import and reuse `IsCombLine` from 171, or extract the combinatorial line definition into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/HalesJewett.lean`). + +## 2. Citations + +The formalization includes two citations: + +- **[Er73]** — Erdős, P., *Problems and results on combinatorial number theory*. ✓ Matches website. +- **[FuKa91]** — Furstenberg, H. and Katznelson, Y., *A density version of the Hales-Jewett theorem*. J. Anal. Math. 57 (1991), 64–119. ✓ Matches website. + +The website also mentions the problem was "originally considered by Moser" and Moser's lower bound $f_3(n) \gg 3^n/\sqrt{n}$, both of which are mentioned in the docstring. No missing citations. + +Note: The Polymath elementary proof [Po12] referenced in Erdős 171 is not mentioned in the 185 page on erdosproblems.com, so its omission here is appropriate. + +## 3. Variants + +The problem on erdosproblems.com asks a single question: "Is it true that $f_3(n) = o(3^n)$?" The formalization captures this exactly via the density formulation (for all $\varepsilon > 0$, sufficiently large subsets contain a combinatorial line). + +No additional variants are mentioned on the website. The formalization is complete in this regard. + +One could note that the problem mentions the trivial inequality $f_3(n) \geq R_3(3^n)$ (relating to 3-AP-free subsets of $\{1, \ldots, 3^n\}$), but this is a remark about the relationship between problems, not a variant to formalize. + +## 4. Readability + +The code is clean and readable. The docstrings clearly explain both the combinatorial line definition and the theorem statement. Variable naming is sensible (`p` for the parameterized points, `S` for the active set, `c` for the constant values). + +Minor notes: +- The variable naming convention in `IsCombinatorialLine` uses `j` for the `Fin 3` index (the "label" of the point) and `i` for the coordinate, which is the reverse of the convention in 171 (`i` for the point index, `j` for the coordinate). Consistency with 171 would be slightly preferable. +- The `answer(True)` wrapper is standard for yes/no problems in this codebase. + +## 5. Formalizability + +**Fully formalizable; no ambiguity.** The problem asks whether $f_3(n) = o(3^n)$, which has a precise mathematical meaning. The notions of "subset of $\{0,1,2\}^n$" and "three points on a line" (i.e., combinatorial line) are standard and well-defined. The formalization correctly translates the $o(3^n)$ condition into the equivalent $\varepsilon$-$N$ density formulation. + +**Ambiguity assessment: None.** This is one of the more cleanly formalizable Erdős problems. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **Combinatorial line definition** (line 46): Correctly captures the standard notion. A combinatorial line in $\{0,1,2\}^n$ is determined by a nonempty set $S$ of "wild" coordinates and constant values at the remaining coordinates. The three points are obtained by substituting $0, 1, 2$ at the wild coordinates. This matches the standard definition (e.g., as in Polymath's density HJ paper). + +- **Main theorem** (line 63): Correctly states the density Hales-Jewett theorem for $k=3$. The statement says: for all $\varepsilon > 0$, there exists $N$ such that for $n \geq N$, any $A \subseteq \{0,1,2\}^n$ with $|A| > \varepsilon \cdot 3^n$ contains a combinatorial line with all three points in $A$. This is equivalent to $f_3(n) = o(3^n)$. + +- **`answer(True)`**: Correct. The answer is indeed yes, as proved by Furstenberg–Katznelson [FuKa91]. + +- **Type correctness**: `Fin n → Fin 3` correctly represents $\{0,1,2\}^n$, and `Finset (Fin n → Fin 3)` correctly represents finite subsets. The cardinality comparison `(A.card : ℝ) > ε * (3 : ℝ) ^ n` is well-typed. + +**No mathematical flaws identified.** An experienced combinatorialist would confirm this is a faithful formalization of the density Hales-Jewett theorem for alphabet size 3. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Redundant with Erdős 171; should share `IsCombLine` definition | +| Citations | Complete and accurate | +| Variants | All captured | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct | diff --git a/ai-review/186.md b/ai-review/186.md new file mode 100644 index 0000000000..6b1a450b8a --- /dev/null +++ b/ai-review/186.md @@ -0,0 +1,110 @@ +# AI Review: Erdős Problem 186 + +## 1. Code Reuse + +The formalization follows the standard `sSup` + `Finset.Icc` extremal function pattern used across many Erdős problems: + +- **Problem 131** (`ErdosProblems/131.lean`) is the most closely related — it defines `IsNonDividing` and `erdos131F` using an almost identical structure. Pham–Zakharov [PhZa24] use non-averaging sets to bound non-dividing sets, establishing a deep mathematical connection. Problem 131 already cross-references Problem 186 in its review; the reverse cross-reference would also be valuable. +- **Problem 882** (`ErdosProblems/882.lean`) defines `IsPrimitive` and `maxPrimitiveSubsetSumSize` with the same pattern. +- **Problem 790** (`ErdosProblems/790.lean`) defines `IsSumFree` and `maxSumFreeSize` similarly. +- **`FormalConjecturesForMathlib/Combinatorics/Basic.lean`** provides `IsSumFree`, `IsSidon`, and `Finset.maxSidonSubsetCard` — related additive combinatorics definitions, but none directly reusable for `IsNonAveraging`. +- **`FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`** provides `Set.IsAPOfLengthFree.maxCard` using the same `sSup` over `Finset.Icc` pattern. Non-averaging is a strictly stronger condition than 3-AP-free (every non-averaging set is 3-AP-free, but not vice versa), so these are distinct concepts. + +No existing definition can replace `IsNonAveraging` — the condition that no element equals the arithmetic mean of two or more other elements is unique to this problem. The code follows codebase conventions. No code reuse issue. + +## 2. Citations + +The formalization includes: [Er73], [Er75b], [Er77c], [ErGr79], [ErGr80], [Bo89], [ErSa90], [CFP23], [PhZa24]. + +Comparing against [erdosproblems.com/186](https://www.erdosproblems.com/186): + +- **Missing [Gu04]**: The website references Guy, R., *Unsolved Problems in Number Theory* (2004), where this appears as Problem C16. Minor omission (secondary reference). +- **Missing related Problem 789**: The website notes a connection to Erdős Problem 789. A cross-reference in the docstring would improve discoverability. +- **Incomplete citations**: Several references are missing journal/volume details: + - [ErSa90] is listed only as "Erdős, P. and Sárközy, A. (1990)" — missing the paper title and journal. + - [CFP23] is listed only as "Conlon, D., Fox, J., and Pham, H. T. (2023)" — missing the paper title. + - [PhZa24] is listed only as "Pham, H. T. and Zakharov, D. (2024)" — missing the paper title. The paper is "Non-averaging sets and the Erdős divisibility conjecture" which is also relevant to Problem 131. +- **Attribution of "originally due to Straus"**: The docstring correctly attributes the problem to Straus. This matches the website. + +**Recommendation**: Add [Gu04] and a cross-reference to Problem 789; fill in missing paper titles for [ErSa90], [CFP23], and [PhZa24]. + +## 3. Variants + +The original problem asks: "What is the order of growth of $F(N)$?" The formalization captures the complete answer $F(N) = N^{1/4+o(1)}$ as a two-sided bound. Since the problem is marked solved, this is appropriate. + +**No missing variants**: The two-sided bound in `erdos_186` captures both the Bosznay lower bound and the Pham–Zakharov upper bound in a single theorem. This is more complete than Problem 131's formalization (which only states a conjectured lower bound). + +**Possible enhancement**: The known lower bound is actually stronger than what the formalization states. Bosznay proved $F(N) \geq c \cdot N^{1/4}$ for an explicit constant $c > 0$, whereas the formalization states $F(N) \geq N^{1/4-\varepsilon}$, which is weaker (it allows the exponent to be slightly less than $1/4$). A more precise formalization could separate the two bounds: +- Lower: $\exists c > 0,\; \forall^\infty N,\; F(N) \geq c \cdot N^{1/4}$ +- Upper: $\forall \varepsilon > 0,\; \forall^\infty N,\; F(N) \leq N^{1/4+\varepsilon}$ + +The combined $N^{1/4+o(1)}$ formulation is standard and correct but slightly lossy on the lower bound side. This is a minor stylistic point — the current formalization is mathematically implied by the known results. + +## 4. Readability + +The code is clean and well-structured. Observations: + +- The `open Filter` is needed for `atTop` and `∀ᶠ` — correct and minimal. +- The docstring for `IsNonAveraging` is clear, providing both the informal description and the formal equivalence ($|S| \cdot a \neq \sum S$). +- The docstring for `erdos_186` clearly explains the known bounds, attributions, and mathematical content. +- The name `nonAvgMax` is descriptive and consistent with naming conventions in other problems (e.g., `maxSumFreeSize` in Problem 790). +- The `Erdos186` namespace keeps definitions scoped, following codebase conventions. + +Overall readability: **Good**. + +## 5. Formalizability + +The problem statement "What is the order of growth of $F(N)$?" is inherently imprecise — it asks for an asymptotic characterization. The formalization resolves this by stating the precise two-sided bound $F(N) = N^{1/4+o(1)}$. + +**Assessment of ambiguity**: + +- **Definition of "non-averaging"**: The phrase "no $n \in A$ is the arithmetic mean of at least two other distinct elements in $A$" is slightly ambiguous — does "at least two" mean $|S| \geq 2$ (any subset of size $\geq 2$) or specifically a pair? The formalization uses $|S| \geq 2$ (any subset of two or more), which is the standard interpretation in the literature and matches the problem statement's "at least two." These two definitions are genuinely different: for example, $\{1, 5, 6, 8\}$ is "non-averaging" under the pairs-only definition (no element is the mean of a pair of others) but NOT under the $|S| \geq 2$ definition (since $5 = (1+6+8)/3$). The formalization uses the correct, stronger definition. +- **"Arithmetic mean"**: Using multiplication ($|S| \cdot a \neq \sum S$) instead of division avoids issues with integer division in $\mathbb{N}$. This is a correct and clean approach. +- **"Order of growth"**: Captured precisely as $N^{1/4+o(1)}$ via the $\varepsilon$-formulation. + +**Formalizability rating**: High. The definitions are precise and unambiguous. + +## 6. Correctness + +**Definition `IsNonAveraging`** (lines 63–64): +``` +∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A.erase a → 2 ≤ S.card → S.card * a ≠ S.sum id +``` +This correctly captures: for every $a \in A$ and every $S \subseteq A \setminus \{a\}$ with $|S| \geq 2$, $|S| \cdot a \neq \sum_{s \in S} s$ (i.e., $a$ is not the arithmetic mean of $S$). Since `Finset` elements are distinct, the "distinct elements" requirement is automatically enforced. The use of multiplication avoids division in $\mathbb{N}$. **Correct.** + +**Definition `nonAvgMax`** (lines 67–68): +``` +sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ IsNonAveraging A ∧ A.card = k} +``` +The set is nonempty (take $A = \emptyset$ with $k = 0$, or any singleton with $k = 1$) and bounded above by $N$ (any subset of $\text{Finset.Icc}\ 1\ N$ has at most $N$ elements). So `sSup` over $\mathbb{N}$ returns the correct maximum. **Correct.** + +**Theorem `erdos_186`** (lines 82–87): +``` +∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, + (N : ℝ) ^ (1/4 - ε) ≤ (nonAvgMax N : ℝ) ∧ + (nonAvgMax N : ℝ) ≤ (N : ℝ) ^ (1/4 + ε) +``` +This says: for every $\varepsilon > 0$, for all sufficiently large $N$, $N^{1/4-\varepsilon} \leq F(N) \leq N^{1/4+\varepsilon}$. This is the standard formulation of $F(N) = N^{1/4+o(1)}$. + +- **Lower bound correctness**: Bosznay [Bo89] proved $F(N) \geq c \cdot N^{1/4}$ for some constant $c > 0$. This implies $F(N) \geq N^{1/4-\varepsilon}$ for large $N$, since $c \cdot N^{1/4} / N^{1/4-\varepsilon} = c \cdot N^{\varepsilon} \to \infty$. **Correct** (the formalization is weaker than the known result, but implied by it). +- **Upper bound correctness**: Pham–Zakharov [PhZa24] proved $F(N) \leq N^{1/4+o(1)}$, which directly gives $F(N) \leq N^{1/4+\varepsilon}$ for large $N$. **Correct.** +- **Edge case**: When $\varepsilon \geq 1/4$, the lower bound exponent $1/4 - \varepsilon \leq 0$, so $N^{1/4-\varepsilon} \leq 1$ for large $N$, and the lower bound becomes trivially true. This is harmless and standard. + +**Category tag**: `category research solved` — matches the website status (solved). **Correct.** + +**AMS classification**: `AMS 5 11` (Number theory / Combinatorial number theory). **Appropriate.** + +**Correctness rating**: **Correct and complete.** No mathematical flaws. The only observation is that the lower bound is slightly weaker than the known result (see Variants section), but this is a standard and correct way to express $N^{1/4+o(1)}$. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ✅ Good | Follows codebase patterns; no existing code to reuse | +| Citations | ⚠️ Minor gaps | Missing [Gu04], Problem 789 cross-ref; incomplete paper titles for [ErSa90], [CFP23], [PhZa24] | +| Variants | ✅ Good | Two-sided bound captures the full answer; lower bound could be tightened to $c \cdot N^{1/4}$ | +| Readability | ✅ Good | Clean, well-documented, descriptive naming | +| Formalizability | ✅ High | Definitions are precise; correct handling of "at least two" ambiguity | +| Correctness | ✅ Correct | Mathematically sound; definitions and theorem are faithful to the known results | diff --git a/ai-review/187.md b/ai-review/187.md new file mode 100644 index 0000000000..bbaf6e1f26 --- /dev/null +++ b/ai-review/187.md @@ -0,0 +1,163 @@ +# Review: Erdos Problem 187 + +**File:** `FormalConjectures/ErdosProblems/187.lean` + +--- + +## 1. Code Reuse + +**Issue: Local `HasMonoAP` definition duplicates functionality available in the shared library.** + +The file defines `Erdos187.HasMonoAP` as: +```lean +def HasMonoAP (χ : ℤ → Bool) (d : ℕ) (k : ℕ) : Prop := + ∃ a : ℤ, ∃ c : Bool, ∀ i : ℕ, i < k → χ (a + ↑i * ↑d) = c +``` + +Several relevant shared definitions exist in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`: + +- **`ContainsMonoAPofLength`** — Directly models monochromatic APs under a coloring. Its signature is: + ```lean + def ContainsMonoAPofLength {κ : Type} [Finite κ] {M : Set α} + (coloring : M → κ) (k : ℕ) : Prop + ``` + This is the closest semantic match. However, it operates on a coloring of a *subset* `M` (a subtype) rather than a total function `ℤ → Bool`, and it does not expose the common difference `d` — it existentially quantifies over the AP's parameters. Problem 187 critically requires the common difference `d` to appear as a parameter (since the conclusion is "for infinitely many `d`"), so `ContainsMonoAPofLength` cannot be used directly without modification. + +- **`Set.ContainsAP`** — Models a set containing an AP with a specific difference `d`, but does not incorporate colorings. + +- **Erdos Problem 984** (`FormalConjectures/ErdosProblems/984.lean`) defines a nearly identical predicate: + ```lean + def IsMonochromaticAP (c : ℕ → Fin 2) (a d k : ℕ) : Prop := + d ≥ 1 ∧ k ≥ 1 ∧ ∃ color : Fin 2, ∀ i : ℕ, i < k → c (a + i * d) = color + ``` + This is essentially the same as `HasMonoAP` but: (a) over `ℕ` instead of `ℤ`, (b) uses `Fin 2` instead of `Bool`, (c) requires `d ≥ 1` and `k ≥ 1`, and (d) takes `a` as a parameter rather than existentially quantifying. + +**Recommendation:** There is a clear pattern of each Erdős problem re-inventing its own AP/coloring predicate with slight variations. A shared definition in `FormalConjecturesForMathlib` parameterized by the domain type, color type, and exposing `d` would unify Problems 187 and 984 (and potentially others). The differences (ℤ vs ℕ, Bool vs Fin 2, positivity guards) are minor. At minimum, Problems 187 and 984 should reference each other in comments so that future refactoring can unify them. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/187](https://www.erdosproblems.com/187):** + +The website lists: +- **Status:** Open (cannot be resolved with finite computation). +- **Tags:** Additive combinatorics, Ramsey theory, Arithmetic progressions. +- Originally posed by **Cohen**. +- References: [Er73], [ErGr79], [ErGr80, p.17], [Be80]. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| [Er73] Erdős 1973 | ✅ Full citation | ✅ | OK. | +| [ErGr79] Erdős–Graham 1979 | ✅ Full citation | ✅ | OK. | +| [ErGr80] Erdős–Graham 1980 | ✅ Full citation | ✅ [ErGr80, p.17] | **Minor issue:** The website specifies page 17. The formalization omits the page number. | +| [Be80] Beck 1980/1981 | ✅ Full citation | ✅ | OK. The formalization correctly notes this appeared in Combinatorica (1981), though the tag is [Be80] (possibly submission year). | + +**Overall:** Citations are thorough and well-formatted. The only minor discrepancy is the missing page reference "p.17" for [ErGr80]. + +--- + +## 3. Variants + +The formalization captures only one direction of the problem: the lower bound conjecture (there exists `c > 0` such that for every 2-colouring, infinitely many `d` yield a monochromatic AP of length `≥ c log d`). + +**Missing variants that could be formalized:** + +1. **Upper bound (Beck's result, [Be80]):** The docstring describes it but does not formalize it: + ``` + theorem erdos_187_upper : ∃ χ : ℤ → Bool, ∀ d : ℕ, 0 < d → + ∀ a : ℤ, ∀ c : Bool, + (∀ i : ℕ, i < k → χ (a + ↑i * ↑d) = c) → + (k : ℝ) ≤ (1 + ε(d)) * Real.logb 2 d + ``` + where `ε(d) → 0`. This is a known *theorem* (not a conjecture) and could be stated as a solved result. + +2. **Erdős's weaker bound:** The observation that colouring via `{√2 · n} < 1/2` gives `f(d) ≪ d`. This is also a theorem and could be formalized. + +3. **The "find the best function" formulation:** The original problem asks to *determine* the best `f(d)`, not just prove a lower bound. The full resolution would establish `f(d) = Θ(log d)`. The formalization only captures the `Ω(log d)` direction. A more complete formalization would also include the matching upper bound, or state the conjecture as `f(d) = Θ(log d)`. + +4. **Van der Waerden baseline:** The assertion that `f(d) → ∞` (which follows from van der Waerden's theorem) is mentioned in the docstring but not formalized. This is a known result and would serve as a weaker companion statement. + +--- + +## 4. Readability + +The code is concise and well-structured. Specific observations: + +- **`HasMonoAP` definition:** Clean and readable. The docstring is excellent — it precisely explains the mathematical meaning. One minor suggestion: the name `HasMonoAP` is slightly ambiguous ("mono" could mean "monotone" rather than "monochromatic"). The name `HasMonochromaticAP` (as used in Problem 984's `IsMonochromaticAP`) would be clearer, though longer. + +- **Main theorem statement:** The nested quantifier structure `∃ c, 0 < c ∧ ∀ χ, ∀ N, ∃ d, N < d ∧ ∃ k, ...` is readable but deeply nested. This is largely unavoidable given the mathematical content. The use of `N < d` to encode "infinitely many d" via an arbitrary lower bound is a standard and clean Lean idiom. + +- **`open Real`:** Appropriate for accessing `Real.log` without qualification. + +- **Namespace:** `Erdos187` is consistent with other files. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Mostly formalizable, with moderate ambiguity in the original problem.** + +The original problem statement is: *"Find the best function f(d) such that, in any 2-colouring of the integers, at least one colour class contains an arithmetic progression with common difference d of length f(d) for infinitely many d."* + +Sources of ambiguity: + +1. **"Best function":** The problem asks to *find* the optimal `f(d)`, which is an optimization problem rather than a yes/no theorem. The formalization resolves this by conjecturing a specific lower bound shape (`c · log d`), which is the natural formalization given the known upper bound of `(1 + o(1)) log₂ d`. + +2. **"For infinitely many d":** This is unambiguous and well-captured by the `∀ N, ∃ d, N < d ∧ ...` pattern. + +3. **Domain:** "The integers" — the formalization uses `ℤ → Bool`, which is correct. Problem 984 uses `ℕ → Fin 2`, which is a different (weaker) setup. For this problem, `ℤ` is the right choice per the original statement. + +4. **"At least one colour class":** The existential quantification over the color `c` in `HasMonoAP` correctly captures this. + +5. **Which logarithm?** The formalization uses `Real.log` (natural logarithm). The docstring mentions `log₂` for Beck's upper bound. Since the conjecture uses an unspecified constant `c`, the base of the logarithm is absorbed into `c`, so this is correct. However, it means the constant `c` in the formalization is not directly comparable to the `(1 + o(1))` constant in Beck's result without a `log 2` factor. + +**Ambiguity level: Low-to-moderate.** The main ambiguity is in interpreting "find the best function" as a lower bound conjecture. The formalization makes a reasonable and standard choice. The problem is clearly formalizable once this interpretation is fixed. + +--- + +## 6. Correctness + +**The formalization is mathematically correct but incomplete.** Detailed analysis: + +### Definition: `HasMonoAP` +```lean +def HasMonoAP (χ : ℤ → Bool) (d : ℕ) (k : ℕ) : Prop := + ∃ a : ℤ, ∃ c : Bool, ∀ i : ℕ, i < k → χ (a + ↑i * ↑d) = c +``` + +- **Domain:** `χ : ℤ → Bool` — correct for a 2-colouring of the integers. +- **Common difference:** `d : ℕ` — using `ℕ` rather than `ℤ` means only positive common differences are considered. This is fine: if a colouring has a monochromatic AP with negative difference, reflecting the AP gives one with positive difference and the same length. However, `d = 0` is allowed, which yields a trivially monochromatic "progression" (all terms equal `a`). This is a minor issue: the theorem conclusion `c * Real.log ↑d ≤ ↑k` would require `c * log 0 ≤ k`, i.e., `c * (-∞) ≤ k` ... but `Real.log 0 = 0` in Lean/Mathlib, so this becomes `0 ≤ k`, which is always true. So `d = 0` witnesses are vacuously valid. This means the "infinitely many d" conclusion could be trivially satisfied by always picking `d = 0` — **but `N < d` prevents this**, since we need `d > N` for arbitrarily large `N`. So the `d = 0` edge case is correctly excluded by the theorem statement, even though `HasMonoAP` itself permits it. +- **Length:** `k : ℕ` — correct. `k = 0` is trivially true (vacuous quantification), which is fine since `c * log d ≤ 0` only holds for `c > 0` when `log d ≤ 0`, i.e., `d < 1`, which is excluded by `N < d` for `N ≥ 1`. +- **Monochromatic witness:** `∃ c : Bool` — correctly existentially quantifies over the two colours. + +### Main Theorem: `erdos_187` +```lean +theorem erdos_187 : + ∃ c : ℝ, 0 < c ∧ + ∀ χ : ℤ → Bool, + ∀ N : ℕ, ∃ d : ℕ, N < d ∧ + ∃ k : ℕ, c * Real.log ↑d ≤ ↑k ∧ HasMonoAP χ d k +``` + +- **Logical structure:** "There exists a positive constant c such that for every 2-colouring χ and every bound N, there exists d > N and k ≥ c·log(d) such that χ has a monochromatic AP of length k with common difference d." This correctly formalizes: "For every 2-colouring, there are infinitely many d such that the longest monochromatic AP with difference d has length Ω(log d)." + +- **Quantifier order:** The constant `c` is universal over all colourings, which matches the problem statement ("the best function f(d)" should work for all colourings). This is correct. + +- **Natural logarithm vs log base 2:** As noted above, using `Real.log` (base e) with an existential constant `c` is equivalent to using `log₂` with a different constant. No issue here. + +- **Potential subtlety — the relationship between k and d:** The formalization says there exist `d` and `k` such that `k ≥ c·log(d)` and the AP has length `k`. It does *not* require that `k` is the *longest* monochromatic AP with difference `d`. This is fine — the existence of a long-enough AP implies the longest is at least as long. + +- **The "for infinitely many d" encoding:** Using `∀ N : ℕ, ∃ d : ℕ, N < d ∧ ...` is the standard encoding. Note that `N` and `d` are both `ℕ`, but since the colouring is on `ℤ`, there's an implicit restriction to positive common differences, which is mathematically harmless as argued above. + +### Potential concern: interaction between `d` and `k` + +The formalization allows `k` and `d` to be chosen together for each `N`. One might worry whether this is equivalent to requiring a single `k(d)` that works for all large `d`. However, the existential formulation is correct: the conjecture is that for every colouring, for infinitely many `d`, there is a long monochromatic AP with that difference. The formalization captures exactly this. + +### Incompleteness + +The formalization only captures the conjectured lower bound `f(d) = Ω(log d)`. The full problem asks to *determine* the best `f(d)`. Given Beck's upper bound `f(d) = O(log d)`, the full answer (if the conjecture is true) is `f(d) = Θ(log d)`. The upper bound direction is a theorem, not a conjecture, and could be stated separately. Its omission is a matter of scope rather than correctness. + +**Verdict: Correct.** The formalization faithfully captures the lower-bound conjecture implicit in Erdős Problem 187. No mathematical flaws. The edge cases (`d = 0`, `k = 0`) are properly handled by the theorem structure. The only gap is the missing formalization of Beck's upper bound as a companion result. diff --git a/ai-review/19.md b/ai-review/19.md new file mode 100644 index 0000000000..f9494e230b --- /dev/null +++ b/ai-review/19.md @@ -0,0 +1,113 @@ +# Review: Erdos Problem 19 + +**File:** `FormalConjectures/ErdosProblems/19.lean` + +## 1. Code Reuse + +The formalization is largely self-contained, relying on Mathlib's `SimpleGraph.IsNClique`, `SimpleGraph.chromaticNumber`, and `Finset.card` via `ProblemImports`. No custom definitions from `FormalConjecturesForMathlib` are used or needed. + +**Potential reuse opportunity:** Problem 167 (Tuza's Conjecture) uses a structurally identical edge-disjointness pattern: + +```lean +-- Problem 167 +(∀ t₁ ∈ T, ∀ t₂ ∈ T, t₁ ≠ t₂ → (t₁ ∩ t₂).card ≤ 1) + +-- Problem 19 +(∀ i j : Fin n, i ≠ j → ((cliques i) ∩ (cliques j)).card ≤ 1) +``` + +A shared predicate for "edge-disjoint clique family" could be extracted to `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean`, but this is a minor stylistic point and not strictly necessary given that each problem has slightly different structure (indexed family vs. finset of finsets). + +The existing `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides useful chromaticNumber lemmas (e.g., `le_chromaticNumber_of_pairwise_adj`, `le_chromaticNumber_iff_colorable`) that would likely be needed in a proof, but the *statement* itself does not need them. + +**Verdict:** No immediate code reuse issues. The statement uses the right Mathlib primitives directly. + +## 2. Citations + +The docstring references: + +> [KKKMO21] Kang, D.Y., Kelly, T., Kühn, D., Methuku, A. and Osthus, D., +> _A proof of the Erdős–Faber–Lovász conjecture_, Annals of Mathematics (2023). + +The website (erdosproblems.com/19) confirms this as the key result and lists additional context: + +- **Origin:** Conjectured by Erdős, Faber, and Lovász "at a party in Boulder, Colorado in September 1972." (Not mentioned in the docstring, but not required.) +- **Partial results:** Kahn proved χ(G) ≤ (1+o(1))n (earning a $100 consolation prize from Erdős); Hindman verified the conjecture for n < 10. (Not mentioned.) +- **Additional contributors:** Romero, Sánchez-Arroyo, Araujo-Pardo, Vázquez-Ávila, and Alesandroni established additional cases. (Not mentioned.) +- **Status:** Listed as "Decidable — Resolved up to a finite check" with a $500 reward. + +The formalization's docstring says "Proved for all sufficiently large n by [KKKMO21]" and the header says "resolved up to a finite check," both consistent with the website. The citation format (authors, title, journal, year) is complete and accurate. + +**Verdict:** Citation is correct and complete for the primary reference. The docstring could optionally mention Kahn's asymptotic result or Hindman's small-case verification for fuller context, but this is not necessary. + +## 3. Variants + +The website lists several variants **not captured** in the formalization: + +1. **Erdős–Füredi Conjecture:** If G is a union of n copies of K_n with pairwise intersections of at most k vertices, then χ(G) ≤ kn. (A natural generalization of the k=1 case.) + +2. **Triangle-free intersection variant:** Erdős asked what happens when copies may share triangle-free intersections (rather than at most one vertex). + +3. **At most one edge intersection variant:** What if copies share at most one edge instead of at most one vertex? + +4. **Minimum copies for excess chromatic number:** Finding the smallest m_k such that m_k edge-disjoint copies of K_n have chromatic number ≥ n + k. + +**Verdict:** Only the base conjecture is formalized. The Erdős–Füredi generalization (variant 1) would be the most natural addition, as it directly generalizes the pairwise intersection constraint from ≤ 1 to ≤ k. The other variants involve qualitative changes to the problem structure. + +## 4. Readability + +The formalization is well-structured and readable: + +- The docstring clearly explains the mathematical content and the formalization strategy (interpreting "edge-disjoint union" via vertex-intersection bound). +- The docstring correctly notes that "two shared vertices would force a shared edge," justifying the ≤ 1 vertex intersection formulation. +- Hypotheses are named descriptively (`hclique`, `hpairwise`, `hcover`). +- The `Erdos19` namespace prevents name collisions. + +**Minor suggestions:** +- The inline comments `-- Each clique is a copy of K_n in G`, `-- Any two distinct cliques share at most one vertex`, `-- Every edge of G lies in some clique` are helpful and well-placed. + +**Verdict:** Excellent readability. No changes needed. + +## 5. Formalizability + +The original problem statement — "If G is an edge-disjoint union of n copies of K_n then χ(G) = n" — is precise and unambiguous. Every term has a standard graph-theoretic meaning: + +- "edge-disjoint union of n copies of K_n": n complete graphs on n vertices each, pairwise sharing at most one vertex, with G being their union. +- "χ(G) = n": the chromatic number equals n. + +There is essentially no ambiguity. The only interpretive choice is how to formalize "edge-disjoint union," and the chosen approach (cliques as vertex sets with intersection ≤ 1 plus edge coverage) is the standard and correct one. + +**Verdict:** Fully formalizable with no ambiguity. Assessment: **unambiguous**. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +**Hypotheses are faithful to the conjecture:** + +- `cliques : Fin n → Finset V` — exactly n cliques, indexed by Fin n. +- `hclique : ∀ i, G.IsNClique n (cliques i)` — each is an n-clique in G. `IsNClique n s` requires both `s.card = n` and that s is a clique (all pairs adjacent), which correctly models "copy of K_n." +- `hpairwise : ∀ i j, i ≠ j → (cliques i ∩ cliques j).card ≤ 1` — edge-disjointness. Two complete graphs sharing ≥ 2 vertices must share an edge, so ≤ 1 shared vertex is equivalent to edge-disjointness. Correct. +- `hcover : ∀ u v, G.Adj u v → ∃ i, u ∈ cliques i ∧ v ∈ cliques i` — G is exactly the union (no extra edges). This is necessary; without it, G could be a supergraph of the union with arbitrarily large chromatic number. + +**Conclusion is correct:** +- `G.chromaticNumber = n` — this is an `ENat` equality. Since V is `Fintype`, the chromatic number is finite (≤ `Fintype.card V`), so the coercion from ℕ is well-behaved. Correct. + +**Distinctness of cliques:** Not explicitly assumed, but implied. If `cliques i = cliques j` for `i ≠ j`, then `(cliques i ∩ cliques j).card = n ≥ 2`, contradicting `hpairwise`. So the hypotheses implicitly force all cliques to be distinct. This is correct behavior. + +**Edge case `n = 0` and `n = 1`:** Excluded by `hn : 2 ≤ n`. This is appropriate: for n = 0, Fin 0 is empty (no cliques, G has no edges, χ(G) = 0 — trivially true but degenerate). For n = 1, K_1 has no edges, and 1 copy of K_1 gives a single isolated vertex with χ = 1 — also trivially true, but `chromaticNumber` for a graph with vertices but no edges is 1 in Mathlib's convention, so this would actually work. The `2 ≤ n` constraint is a safe choice that avoids any edge-case subtlety without losing generality (the conjecture is interesting only for n ≥ 2). + +**Verdict:** The formalization is correct and complete. No mathematical flaws identified. An experienced mathematician would not identify any issues with the statement as formalized. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No issues; uses appropriate Mathlib primitives | +| Citations | Correct and complete for primary reference | +| Variants | Only base conjecture; Erdős–Füredi generalization not included | +| Readability | Excellent | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The only substantive gap is the absence of the Erdős–Füredi generalization (pairwise intersection ≤ k → χ(G) ≤ kn), which is a natural companion statement listed on the website. diff --git a/ai-review/190.md b/ai-review/190.md new file mode 100644 index 0000000000..be2e8db200 --- /dev/null +++ b/ai-review/190.md @@ -0,0 +1,121 @@ +# Review: Erdős Problem 190 + +## 1. Code Reuse + +**Several opportunities for reuse exist but are not straightforward.** + +- **`ContainsMonoAPofLength`** (in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`) is the library's standard monochromatic AP predicate, used by Problem 138 for van der Waerden numbers. However, it requires `[Finite κ]` on the color type. Problem 190 uses `χ : ℕ → ℕ`, where `ℕ` is not `Finite`. This design choice is deliberate—the problem allows "any finite colouring" without bounding the number of colors a priori—but it means `ContainsMonoAPofLength` cannot be directly plugged in. One could work around this by quantifying over `Fin c` for all `c`, but this would complicate the statement for little gain. + +- **Problem 138** (`ErdosProblems/138.lean`) defines `monoAP_guarantee_set` and `monoAPNumber` (van der Waerden numbers) using `ContainsMonoAPofLength`. The structure is closely analogous to Problem 190's `H(k)`, but 190 additionally requires a rainbow AP alternative, so reuse would need a new predicate regardless. + +- **Problem 187** (`ErdosProblems/187.lean`) defines its own `HasMonoAP` with signature `(χ : ℤ → Bool) (d : ℕ) (k : ℕ)`, which is incompatible (different domain, fixed 2-coloring, parameterized by common difference). + +- **`Set.IsAPOfLength`** from the AP library could in principle be used to express the AP structure, but the current direct existential formulation (`∃ a d, ...`) is simpler and more self-contained for this problem. + +**Verdict:** The current self-contained definitions are reasonable. Reusing library code would require non-trivial adaptation with little clarity benefit. + +## 2. Citations + +The website ([erdosproblems.com/190](https://www.erdosproblems.com/190)) lists two references: + +- **[ErGr79, p.333]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory: van der Waerden's theorem and related topics*. Enseign. Math. (1979). +- **[ErGr80, p.17]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). + +**Issue:** The formalization only cites **[ErGr80]**. The reference **[ErGr79]** is missing from the docstring. It should be added for completeness, especially since the 1979 paper is listed first on the website. + +## 3. Variants + +The website poses two questions: + +1. **"Estimate H(k)"** — an open-ended estimation question. This is inherently vague and difficult to formalize precisely. The formalization does not attempt this, which is reasonable. + +2. **"Is it true that H(k)^{1/k}/k → ∞?"** — this is what `erdos_190` formalizes. + +**Missing known result:** The docstring notes that "it is easy to show that H(k)^{1/k} → ∞" (without the division by k). This weaker result could be captured as a solved variant: + +```lean +@[category research solved, AMS 5] +theorem erdos_190.variants.weaker : + Tendsto (fun k : ℕ => (H k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) atTop atTop := by + sorry +``` + +This would document the known state of the art and provide a natural stepping stone. + +## 4. Readability + +The code is generally clear and well-structured. Minor observations: + +- The docstring for `HasRainbowAP` correctly describes the pairwise-distinct condition, and the Lean code faithfully encodes all three pairwise inequalities. Good. +- The `open Filter Real` is appropriate for the `Tendsto`/`atTop` usage. +- The main theorem's expression `(H k : ℝ) ^ ((1 : ℝ) / (k : ℝ)) / (k : ℝ)` has explicit type annotations that aid readability in this context. +- The docstring for `H` could mention that nonemptiness of the defining set (and hence well-definedness of `H`) follows from Szemerédi's theorem, as stated in the module docstring. Currently this context is only in the module-level `/-! ... -/` block. + +## 5. Formalizability + +**The problem is clearly formalizable.** The question "Is it true that H(k)^{1/k}/k → ∞?" is a precise yes/no question about the asymptotic behavior of a well-defined function. The only prerequisite—that H(k) is finite for all k—follows from Szemerédi's theorem, a known (though deep) result. + +**Ambiguity assessment: Low.** The one potential ambiguity is what "rainbow arithmetic progression" means: + +- The formalization fixes it as a **3-term** rainbow AP (all three elements have distinct colors). +- The original problem statement says "a rainbow arithmetic progression" without specifying the length. + +In the canonical Ramsey theory literature, the standard formulation uses 3-term rainbow APs. This is the weakest rainbow condition (a rainbow k-AP for k ≥ 3 implies a rainbow 3-AP via restriction to any three consecutive terms), so it gives the smallest possible H(k). The choice of 3 is mathematically standard and correct. + +## 6. Correctness + +### Definition `HasMonoAP` + +The definition correctly captures a monochromatic k-term AP within {1,...,N}: +- `0 < d`: ensures the AP is non-degenerate (elements are distinct). +- `1 ≤ a`: ensures the AP starts within {1,...,N} (not at 0). +- `a + (k - 1) * d ≤ N`: ensures the last element is within {1,...,N}. +- `∀ i : ℕ, i < k → χ (a + i * d) = χ a`: all elements share the color of the first. + +**Edge cases are handled correctly:** +- k = 0: vacuously satisfied (any coloring has a "0-term monochromatic AP"), which is harmless. +- k = 1: reduces to requiring some element in {1,...,N}, which is trivially satisfied for N ≥ 1. + +**One subtlety:** natural number subtraction `k - 1` when `k = 0` gives `0`, so the bound becomes `a ≤ N`, which is fine. + +### Definition `HasRainbowAP` + +Correctly captures a rainbow 3-term AP within {1,...,N} with pairwise distinct colors. All three pairwise inequalities are explicitly stated. No issues. + +### Definition `H` + +```lean +noncomputable def H (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ χ : ℕ → ℕ, HasMonoAP χ N k ∨ HasRainbowAP χ N} +``` + +**Potential concern:** `sInf` on `ℕ` returns `0` for the empty set. If the defining set were empty (i.e., no such N exists), then `H k = 0` for all `k`, and the main theorem would be trivially false. Mathematically the set is nonempty by Szemerédi's theorem, but this is not formalized. The current approach is acceptable for a conjecture file—the `answer(sorry)` framework accommodates this—but a separate lemma asserting nonemptiness would strengthen the formalization: + +```lean +theorem H_spec (k : ℕ) : {N : ℕ | ∀ χ : ℕ → ℕ, HasMonoAP χ N k ∨ HasRainbowAP χ N}.Nonempty := by + sorry +``` + +**Coloring type:** Using `χ : ℕ → ℕ` (unbounded colors, total function on ℕ) rather than a finite coloring type is correct. Over any finite interval {1,...,N}, the coloring automatically uses finitely many colors, and colorings assigning all distinct colors make rainbow APs easy to find. So the universal quantification over `ℕ → ℕ` is equivalent to quantifying over finite colorings. + +### Main theorem `erdos_190` + +The Lean statement: +```lean +Tendsto (fun k : ℕ => (H k : ℝ) ^ ((1 : ℝ) / (k : ℝ)) / (k : ℝ)) atTop atTop +``` + +faithfully encodes "H(k)^{1/k}/k → ∞ as k → ∞." The use of `atTop` for both the filter and the target correctly captures divergence to infinity. The `answer(sorry)` wrapper correctly reflects the open status. + +**No mathematical flaws identified.** The formalization is correct and complete for the stated problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Self-contained definitions are justified; library `ContainsMonoAPofLength` not directly applicable due to `[Finite κ]` constraint | +| Citations | **Missing [ErGr79, p.333]**; only [ErGr80] is cited | +| Variants | Known result H(k)^{1/k} → ∞ could be added as a solved variant | +| Readability | Good overall; minor improvement possible in `H` docstring | +| Formalizability | High; low ambiguity. Rainbow AP length = 3 is standard | +| Correctness | **Correct.** All definitions and the main theorem faithfully capture the mathematics | diff --git a/ai-review/191.md b/ai-review/191.md new file mode 100644 index 0000000000..70e0aa55bc --- /dev/null +++ b/ai-review/191.md @@ -0,0 +1,69 @@ +# AI Review: Erdős Problem 191 + +**File:** `FormalConjectures/ErdosProblems/191.lean` + +## 1. Code Reuse + +No significant reuse opportunities. The formalization is self-contained, using only standard Mathlib constructs (`SimpleGraph`, `IsClique`, complement `Gᶜ`, `Finset.Icc`, `BigOperators`). While several other Erdős problems in the codebase define helper notions like `ramseyDiag` (problems 87, 163, 181) or `graphRamseyNumber`, none of these apply here — problem 191 is not about standard Ramsey numbers but about a monochromatic set achieving a large reciprocal-logarithm sum. The utility libraries in `FormalConjecturesForMathlib/Combinatorics/` (e.g., `Ramsey.lean`, `Clique.lean`) define hypergraph Ramsey numbers and independence number notation, neither of which are needed for this statement. + +## 2. Citations + +The citations in the formalization match the information on [erdosproblems.com/191](https://www.erdosproblems.com/191). Both sources list: + +| Code ref | Website | +|----------|---------| +| [ErGr79] Erdős & Graham, 1979 | Erdős & Graham (1979) | +| [ErGr80] Erdős & Graham, 1980 | Erdős & Graham (1980) | +| [Er81] Erdős, 1981 | Erdős (1981) | +| [Er82e] Erdős, 1982 | Erdős (1982) | +| [Ro03] Rödl, 2003 | Rödl (2003) — proved the result | +| [CFS13] Conlon, Fox, Sudakov, 2013 | Conlon, Fox, Sudakov (2013) — optimal bounds | + +The website itself does not provide full journal/title details beyond what is already in the file (only ErGr80 has a title). No discrepancies found. + +## 3. Variants + +The website describes two additional results not formalized: + +1. **3-colouring negative result:** Rödl showed the answer becomes *negative* for 3-colourings. This is a natural companion statement and could be formalized as a separate theorem (e.g., `erdos_191_three_colors`). +2. **Quantitative bound:** Conlon, Fox, and Sudakov proved that one can always find a monochromatic $X$ with $\sum 1/\log x \geq 2^{-8} \log\log\log n$, and Rödl showed this is tight up to the constant. The docstring mentions this qualitatively but does not formalize it. + +The main yes/no question is the core of the problem, so omitting the quantitative variant is reasonable. The 3-colouring variant is a meaningful omission but not critical. + +## 4. Readability + +The code is clear and well-structured. The docstring explains the modeling choice (edges = colour 1, non-edges = colour 2) and provides historical context. Minor observations: + +- The docstring mentions the CFS quantitative bound, which provides good context even though it is not formalized. +- The namespace `Erdos191` is clean and appropriately scoped. +- No readability improvements needed. + +## 5. Formalizability + +**Assessment: Unambiguous and precisely formalizable.** + +The problem statement on erdosproblems.com is fully precise: it asks a yes/no question about the existence of monochromatic sets with a particular quantitative property in 2-colourings. All objects (the set $\{2,\ldots,n\}$, pairs, 2-colourings, monochromatic sets, the sum $\sum 1/\log x$) have standard mathematical definitions with no room for interpretation. The formalization directly captures the mathematical content. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +- **2-colouring model:** A `SimpleGraph ℕ` correctly models a 2-colouring of pairs: edge = colour 1, non-edge = colour 2. The symmetry and irreflexivity of `SimpleGraph` match the requirement that we colour unordered pairs of *distinct* elements. + +- **Quantifier structure:** `∀ C > 0, ∃ N, ∀ n ≥ N, ∀ G, ∃ X, ...` correctly captures "for any $C > 0$, if $n$ is sufficiently large (depending on $C$), then in any 2-colouring there exists a monochromatic set $X$ with $\sum 1/\log x \geq C$." + +- **Domain:** `X ⊆ Finset.Icc 2 n` correctly represents $X \subseteq \{2, \ldots, n\}$. + +- **Graph on ℕ vs. restricted graph:** The formalization quantifies over `G : SimpleGraph ℕ` rather than graphs on `Fin n` or a subtype. This is equivalent to quantifying over colourings of $\{2,\ldots,n\}$-pairs because: (a) any colouring of $\{2,\ldots,n\}$-pairs extends to a `SimpleGraph ℕ`, and (b) the conclusion only involves $X \subseteq \{2,\ldots,n\}$, so edges outside this range are irrelevant. This is the standard and convenient Lean approach. + +- **Monochromatic condition:** `G.IsClique X ∨ Gᶜ.IsClique X` correctly captures "X is monochromatic" — either all pairs in X share colour 1 (clique in G) or all share colour 2 (clique in complement = independent set in G). + +- **Sum:** `∑ x ∈ X, (1 : ℝ) / Real.log (x : ℝ)` is correct. For $x \geq 2$, $\log x > 0$, so the terms are well-defined and positive. + +- **`answer(True)`:** Correctly reflects that the problem is solved affirmatively (by Rödl). + +- **Edge case — empty/singleton X:** An empty X gives sum 0, failing $C > 0$. A singleton is vacuously a clique with sum $1/\log x \leq 1/\log 2 \approx 1.44$, so for large $C$ the set must be non-trivially large. These edge cases are handled correctly by the formalization. + +No mathematical flaws identified. diff --git a/ai-review/192.md b/ai-review/192.md new file mode 100644 index 0000000000..4024d8e05a --- /dev/null +++ b/ai-review/192.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 192 + +## 1. Code Reuse + +**Problem 231** (`FormalConjectures/ErdosProblems/231.lean`) defines a closely related `ContainsAbelianSquare` for *finite* words (`List α`) using `List.Perm`, while Problem 192 defines `HasAbelianSquare` for *infinite* words (`ℕ → α`) using multiset equality via `(Finset.range n).val.map`. Both definitions capture the same mathematical concept on different carrier types and are independently correct. + +There is an opportunity to unify or at least cross-reference these definitions. A shared module (e.g., in `FormalConjecturesForMathlib`) could provide: +- A canonical `HasAbelianSquare` for infinite words. +- A canonical `ContainsAbelianSquare` for finite words. +- A bridge lemma showing that an infinite word has an abelian square iff some finite prefix contains one. + +That said, the definitions are simple enough that the duplication is not a serious issue. No other codebase definitions (e.g., `Powerfree`, the OEIS morphic-word infrastructure) are directly applicable here. + +## 2. Citations + +The website ([erdosproblems.com/192](https://www.erdosproblems.com/192)) lists the following references: + +| Ref | Formalization | Website | +|-----|---------------|---------| +| [ErGr80] | ✅ Cited | ✅ Listed | +| [ErGr79] | ❌ Not cited | ✅ Listed | +| [Ke92] | ✅ Cited | ✅ Listed | +| [FiPu23] | ❌ Not cited | ✅ Listed (Fici & Puzynina survey on abelian squares) | + +**Recommendation:** The [ErGr79] reference likely refers to an earlier Erdős–Graham paper that may be the same work or a precursor to [ErGr80]. Consider adding [FiPu23] as a supplementary reference in the docstring, since it is a survey that provides broader context: + +> [FiPu23] Fici, G. and Puzynina, S., *Abelian combinatorics on words: a survey*. (2023). + +## 3. Variants + +The formalization captures the two essential parts: +- **Part 1 (`erdos_192`):** Every infinite word over 3 letters contains an abelian square. ✅ +- **Part 2 (`erdos_192.variants.four_letters`):** There exists an infinite word over 4 letters avoiding all abelian squares. ✅ + +**Missing variants:** +- **The geometric equivalence** is described in the docstring (unit-vector steps in ℝ^d ↔ abelian squares over d letters) but is not formalized as a theorem. This equivalence is part of the original problem statement and could be captured as a separate lemma. +- **The d ≤ 2 cases** are not stated explicitly, though they follow trivially from the d = 3 case by embedding `Fin k → Fin 3` for `k ≤ 3`. This is a minor point. +- **The finite bound** mentioned in the docstring ("any finite word of length ≥ 7 over {0,1,2} contains an abelian square") is not formalized as a theorem. Problem 231 captures a related finite-word statement, but the specific length-7 bound for 3 letters could be stated here as a variant. + +## 4. Readability + +The code is clear and well-structured. A few observations: + +- The `HasAbelianSquare` definition uses `(Finset.range n).val.map (fun j => w (i + j))` to construct a `Multiset α`. This is mathematically correct and elegant — comparing `Multiset` equality is exactly the abelian square condition — but may be less immediately transparent than the `List.Perm` approach used in Problem 231. A brief inline comment explaining that `.val.map` produces a multiset could help readers unfamiliar with this idiom. +- The docstrings are well-written and clearly state both the combinatorial and geometric interpretations. +- The namespace `Erdos192` and theorem names (`erdos_192`, `erdos_192.variants.four_letters`) follow project conventions. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The abelian square concept is completely precise: two consecutive blocks of equal length whose character multisets agree. The problem has a clean dichotomy (d ≤ 3 vs d ≥ 4) with no boundary ambiguity. + +The only potential source of ambiguity is the geometric formulation (sequences in ℝ^d with unit-vector steps), but the formalization wisely focuses on the equivalent combinatorial formulation, which is simpler and avoids the need to define unit vectors and arithmetic progressions in ℝ^d. + +## 6. Correctness + +**Assessment: Mathematically correct and complete.** + +**Definition `HasAbelianSquare`:** Correct. `(Finset.range n).val` is the multiset `{0, 1, …, n−1}` (each element once, since `Finset.range` has no duplicates). Mapping `fun j => w (i + j)` over it produces the multiset of characters in positions `i, i+1, …, i+n−1`. Equality of the two mapped multisets is precisely the abelian square condition. The guard `0 < n` correctly excludes the trivial empty block. + +**Theorem `erdos_192`:** Correctly states that every infinite word `ℕ → Fin 3` has an abelian square. This matches the known result (true for d ≤ 3). + +**Theorem `erdos_192.variants.four_letters`:** Correctly states the existence of an abelian-square-free infinite word over `Fin 4`, matching Keränen's 1992 construction. + +**No mathematical flaws identified.** The formalization faithfully captures the resolved problem. The only gap is the absence of the geometric equivalence as a formal statement, but this is a matter of completeness of variants rather than correctness. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Minor opportunity (unify with Problem 231) | +| Citations | Two references missing ([ErGr79], [FiPu23]) | +| Variants | Core variants present; geometric equivalence and length-7 bound not formalized | +| Readability | Good | +| Formalizability | Fully formalizable, unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/193.md b/ai-review/193.md new file mode 100644 index 0000000000..a726448aa4 --- /dev/null +++ b/ai-review/193.md @@ -0,0 +1,154 @@ +# Review: Erdos Problem 193 + +**File:** `FormalConjectures/ErdosProblems/193.lean` + +--- + +## 1. Code Reuse + +**Custom `Collinear3` definition is reasonable but worth comparing to alternatives.** + +The file defines a local `Erdos193.Collinear3` for three points in `Fin 3 → ℤ` using integer linear dependence of displacement vectors. Several related collinearity definitions exist in the codebase: + +| Location | Definition | Applicability | +|----------|-----------|---------------| +| Mathlib `Collinear ℝ` | Affine dependence over ℝ | Used in Erdos 98, 101, 102, 105, 130 for `EuclideanSpace ℝ (Fin k)`. Requires a field/division ring, so cannot be applied directly over ℤ without embedding into ℝ. | +| Erdos 217 `Collinear3` | Cross-product formula for `EuclideanSpace ℝ (Fin 2)` | 2D only, not applicable. | +| Erdos 607/733 | Cross-product formula for `ℝ × ℝ` | 2D only, not applicable. | + +**Assessment:** No existing definition in the codebase handles collinearity over `ℤ³` directly. Using Mathlib's `Collinear ℝ` would require embedding `Fin 3 → ℤ` into `EuclideanSpace ℝ (Fin 3)` via `Int.cast`, which adds unnecessary complexity for no mathematical gain. The custom `Collinear3` is well-suited to this problem. + +**Walk pattern:** The S-walk definition `∀ i, a (i + 1) - a i ∈ S` with `Function.Injective a` is consistent with similar lattice walk formulations in Erdos 528/529 (which use `selfAvoidingWalks` with `Function.Injective` and step conditions). No shared walk abstraction exists in the codebase that would apply here, since those problems use `LatticeAdj` (unit-step adjacency) rather than general step sets. + +**Recommendation:** The current approach is appropriate. No action needed. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/193](https://www.erdosproblems.com/193):** + +The website lists: +- **Status:** Open. +- **Tags:** Geometry. +- **References:** [ErGr79], [ErGr80], [GeRa79]. +- **Related OEIS:** A231255. +- **Acknowledgment:** Terence Tao. + +The formalization cites: + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Gerver & Ramsey 1979 | `[GeRa79]` — incomplete (no title/journal) | `[GeRa79]` | **Incomplete citation.** The full reference should include the paper title and journal. The paper is: Gerver, J. and Ramsey, L. T., "Sets of lattice points which contain a maximal number of edges," *Discrete Math.* **28** (1979), 255–262. | +| Erdős & Graham 1980 | `[ErGr80]` — title and series included | `[ErGr80]` | OK. | +| Erdős & Graham 1979 | Not cited | `[ErGr79]` | **Missing.** The website lists [ErGr79] as a separate reference from [ErGr80]. This may refer to a 1979 preprint or earlier version. Consider adding for completeness. | + +**Additional issues:** +- The OEIS sequence **A231255** is not mentioned in the formalization. Consider adding it to the docstring for cross-referencing. +- The theorem docstring cites `[ErGr80]` as the primary reference, which is appropriate since that monograph is the standard source for this problem. + +--- + +## 3. Variants + +The formalization captures only the main open question for ℤ³. The following variants or related results are not formalized: + +1. **ℤ² case (resolved):** Gerver and Ramsey proved the answer is "yes" for ℤ². This is a natural companion theorem: + ```lean + theorem erdos_193_Z2 : + ∀ (S : Finset (Fin 2 → ℤ)) (a : ℕ → (Fin 2 → ℤ)), + Function.Injective a → + (∀ i, a (i + 1) - a i ∈ S) → + ∃ i j k : ℕ, i < j ∧ j < k ∧ Collinear3_2D (a i) (a j) (a k) + ``` + +2. **Higher dimensions:** The problem generalizes naturally to ℤᵈ for d ≥ 4. One could ask whether the conjecture holds in all dimensions. + +3. **Bounded collinearity in ℤ³:** Gerver and Ramsey showed that the maximum number of collinear points in any infinite S-walk in ℤ³ can be bounded (as a function of S). This is a weaker but proven result: + ```lean + theorem erdos_193_bounded : + ∀ (S : Finset (Fin 3 → ℤ)), + ∃ B : ℕ, ∀ (a : ℕ → (Fin 3 → ℤ)), + Function.Injective a → + (∀ i, a (i + 1) - a i ∈ S) → + ∀ (L : Set (Fin 3 → ℤ)), → + Set.ncard (Set.range a ∩ L) ≤ B + ``` + +The ℤ² resolved case would be a valuable addition since it provides proved context for the open ℤ³ question. + +--- + +## 4. Readability + +The code is concise and well-structured. Minor observations: + +- **Docstring quality:** The module-level docstring clearly states the problem, its origin, and relevant background. The docstring on `Collinear3` correctly notes the equivalence between ℤ-dependence and ℚ-dependence for integer vectors. +- **Namespace:** `Erdos193` is appropriately scoped to avoid clashes with other `Collinear3` definitions (e.g., `Erdos217.Collinear3`). +- **Variable naming:** The use of `a b` for the linear dependence coefficients and `p q r` for points is standard. The `k : Fin 3` coordinate index is clear. +- **`answer(sorry)` pattern:** Correctly used for an open problem where the truth value is unknown. + +**Suggestion:** The docstring for `Collinear3` could note that the definition intentionally handles the degenerate case (two or more coincident points) as collinear, though this is moot given the injectivity constraint in the theorem. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one subtle point.** + +The core problem is well-defined: given a finite step set S ⊆ ℤ³, an infinite injective S-walk, and the standard notion of collinearity, does the walk's image always contain three collinear points? The definitions of "finite set," "S-walk," "injective," and "collinear" are all mathematically precise. + +**Subtle point — "infinite S-walk" vs. "injective S-walk":** The original problem states "let A = {a₁, a₂, …} ⊂ ℤ³ be an infinite S-walk." The set-theoretic notation {a₁, a₂, …} with ⊂ implies the elements are distinct (the set A is infinite). The formalization models this as an injective function a : ℕ → ℤ³ with the step condition, which correctly captures "an infinite sequence of distinct points forming an S-walk." + +However, there is a subtle difference between: +- (a) An S-walk (possibly revisiting points) whose *image* is infinite, and +- (b) An injective S-walk (never revisits any point). + +Formulation (b) is strictly more restrictive than (a). If the conjecture holds under (b), it does not immediately follow under (a), because extracting a subsequence of "first visits" from a non-injective walk destroys the step property. The formalization uses (b), which matches the standard interpretation of the problem (the notation A = {a₁, a₂, …} suggests distinct elements indexed in walk order). This is the correct choice. + +**Ambiguity level: Low.** The problem is clearly formalizable with the chosen interpretation. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `Collinear3` +```lean +def Collinear3 (p q r : Fin 3 → ℤ) : Prop := + ∃ a b : ℤ, (a ≠ 0 ∨ b ≠ 0) ∧ ∀ k : Fin 3, a * (q k - p k) = b * (r k - p k) +``` + +- **Meaning:** There exist integers a, b (not both zero) such that a·(q − p) = b·(r − p) coordinate-wise. This says the displacement vectors (q − p) and (r − p) are ℤ-linearly dependent. +- **Equivalence to collinearity:** For integer vectors u, v ∈ ℤ³, ℤ-linear dependence is equivalent to ℚ-linear dependence (and hence ℝ-linear dependence). Proof: if u = (p/q)·v over ℚ with gcd(p,q) = 1, then q·u = p·v gives ℤ-dependence. The converse is trivial. Since ℝ-linear dependence of (q−p) and (r−p) is exactly geometric collinearity, the definition is correct. +- **Degenerate cases:** If p = q, take a = 1, b = 0. If p = r, take a = 0, b = 1. If q = r, take a = b = 1. All degenerate cases are correctly identified as collinear. Under the injectivity constraint of the theorem (with i < j < k), these cases cannot arise, so the degenerate handling is harmless. +- **Asymmetry in roles of q and r:** The definition is symmetric in the sense that `Collinear3 p q r ↔ Collinear3 p r q` (swap a and b). It is also invariant under cyclic permutation (by algebraic manipulation). This is correct — collinearity should not depend on the labeling of points. + +### Theorem: `erdos_193` +```lean +theorem erdos_193 : answer(sorry) ↔ + ∀ (S : Finset (Fin 3 → ℤ)) (a : ℕ → (Fin 3 → ℤ)), + Function.Injective a → + (∀ i, a (i + 1) - a i ∈ S) → + ∃ i j k : ℕ, i < j ∧ j < k ∧ Collinear3 (a i) (a j) (a k) +``` + +- **Quantifier structure:** "For all finite step sets S, for all injective S-walks a, there exist three indices i < j < k such that the corresponding points are collinear." This correctly captures the problem. +- **Injectivity:** `Function.Injective a` ensures the walk visits infinitely many distinct points, matching the problem's "infinite S-walk" condition. +- **Step condition:** `∀ i, a (i + 1) - a i ∈ S` correctly encodes that consecutive steps lie in S. Note that subtraction on `Fin 3 → ℤ` is pointwise, which is the correct vector subtraction. +- **Collinearity witness:** `∃ i j k : ℕ, i < j ∧ j < k ∧ Collinear3 (a i) (a j) (a k)` finds three *distinct* walk positions (guaranteed by i < j < k and injectivity) whose images are collinear. The ordering i < j < k is stronger than merely requiring three distinct indices, but this is harmless and conventional. +- **`answer(sorry)` pattern:** Since the problem is open, wrapping in `answer(sorry) ↔ ...` is correct — it allows the formalization to be valid regardless of whether the answer is true or false. +- **`@[category research open, AMS 5]`:** Correctly tagged as open. AMS classification 5 (Combinatorics) is reasonable, though the problem also has a geometric flavor (the website tags it "geometry"). + +### Potential concern: empty step set S + +If S = ∅, then the condition `∀ i, a (i + 1) - a i ∈ S` is vacuously false (no function a can satisfy it), so the implication holds trivially. This is correct — there is no infinite walk with an empty step set. + +### Potential concern: step set containing zero + +If 0 ∈ S, a walk could have a(i+1) = a(i), violating injectivity. The formalization handles this correctly: the injectivity premise eliminates such walks, so only walks that never use the zero step (if present) are considered. + +**Verdict: Correct and complete.** The formalization faithfully captures the open Erdős Problem 193. The custom `Collinear3` definition is mathematically equivalent to standard collinearity for integer points. The only opportunities for improvement are adding the resolved ℤ² variant and completing the citations. diff --git a/ai-review/199.md b/ai-review/199.md new file mode 100644 index 0000000000..d15f11daca --- /dev/null +++ b/ai-review/199.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 199 + +## 1. Code Reuse + +The file defines two local predicates — `HasThreeTermAP` and `HasInfiniteAP` — that overlap significantly with existing infrastructure in the codebase. + +**Three-term AP freeness.** The condition `¬HasThreeTermAP A` is essentially equivalent to `Set.IsAPOfLengthFree A 3` from `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`. The utility definition works via `ENat.card`-based AP characterization: a set of length 3 with `d = 0` would collapse to a singleton (card 1 ≠ 3), so the `d ≠ 0` constraint in `HasThreeTermAP` is implicitly handled. Additionally, Mathlib provides `ThreeAPFree` in `Mathlib.Combinatorics.Additive.AP.Three.Defs`, which uses the equivalent characterization `a + c = b + b → a = b`. + +**Infinite AP containment.** `HasInfiniteAP S` asserts that S *contains* an infinite AP. The utility file defines `Set.IsAPOfLength s ⊤` (asserting a set *is* an infinite AP), but not a "contains infinite AP" predicate. One could write `∃ t ⊆ S, t.IsAPOfLength ⊤`, which is equivalent. However, `Set.ContainsAP` only handles finite lengths. A similar local definition `IsInfiniteAP` appears in Erdős Problem 16 (`FormalConjectures/ErdosProblems/16.lean`), though it operates over `ℕ` rather than `ℝ`. + +**Recommendation.** The local definitions are reasonable given that no single existing utility covers both cases exactly (especially infinite AP *containment* over `ℝ`). However, if future refactoring consolidates AP definitions, these should be migrated. A `Set.ContainsInfiniteAP` predicate in the utility file (generalizing `Set.ContainsAP` to infinite length) would allow this file and Problem 16 to share code. + +## 2. Citations + +The formalization lists four references: `[Er75b]`, `[ErGr79]`, `[ErGr80]`, `[Ba75]`. The website (erdosproblems.com/199) lists the same four citation keys. Neither the website nor the formalization provides full bibliographic details (title, journal, year) — only author abbreviations. + +- **[Ba75]** Baumgartner, J.E. — The formalization attributes the counterexample to Baumgartner [Ba75], consistent with the website. +- **[Er75b]** Erdős, P. — Listed on both, no further detail available from the website. +- **[ErGr79]** Erdős, P. and Graham, R. — Listed on both. +- **[ErGr80]** Erdős, P. and Graham, R. — Listed on both. + +**Assessment.** The citations match the website. The lack of full bibliographic detail (titles, journals, page numbers) is consistent with the source material. No citations are missing or fabricated. + +## 3. Variants + +The problem as stated on the website is a single yes/no question: "If A ⊂ ℝ has no 3-term AP, must ℝ \ A contain an infinite AP?" The formalization captures exactly this question and its negative answer. + +**Potential variants not captured:** +- The problem could be asked over other groups or rings (e.g., ℤ, ℤ/nℤ), though the original problem is specifically about ℝ. +- One could ask whether ℝ \ A must contain arbitrarily long finite APs (a weaker condition than infinite APs). Baumgartner's result answers the stronger question, so this weaker variant remains potentially interesting but is not part of the stated problem. +- A quantitative variant might ask about the density or structure of the complement, but this goes beyond the original problem. + +**Assessment.** The formalization captures the problem as stated. No known variants from the website are missing. + +## 4. Readability + +The code is clean, well-structured, and easy to follow: + +- The module docstring clearly states the problem, its answer, and the method of disproof. +- The helper definitions `HasThreeTermAP` and `HasInfiniteAP` have accurate docstrings with LaTeX. +- The theorem docstring explains the result and references Baumgartner's construction. +- The namespace `Erdos199` avoids polluting the global namespace. + +**Minor suggestions:** +- The `HasInfiniteAP` docstring says "$a + n \cdot d \in S$ for all $n : \mathbb{N}$", which uses `n : ℕ` (one-sided). This is accurate but could note that this means a one-sided infinite AP `{a, a+d, a+2d, ...}` for full clarity. (This is a very minor point; the current phrasing is standard.) + +## 5. Formalizability + +The problem is fully precise and unambiguously formalizable: + +- "3-term arithmetic progression" has a standard meaning: three distinct equally-spaced real numbers `a, a+d, a+2d` with `d ≠ 0`. +- "Infinite arithmetic progression" standardly means a one-sided sequence `{a + nd : n ∈ ℕ}` with `d ≠ 0`. +- The set-theoretic operations (subset, complement) are unambiguous. +- The question is a clean yes/no: does a universal quantification hold? + +**Ambiguity assessment: None.** The statement is completely precise. + +## 6. Correctness + +The theorem statement is: + +```lean +theorem erdos_199 : answer(False) ↔ ∀ A : Set ℝ, ¬HasThreeTermAP A → HasInfiniteAP Aᶜ +``` + +**Analysis:** + +- `answer(False)` reduces to `False`. So the statement becomes `False ↔ (∀ A, ¬HasThreeTermAP A → HasInfiniteAP Aᶜ)`, which is equivalent to `¬(∀ A, ¬HasThreeTermAP A → HasInfiniteAP Aᶜ)`. +- This asserts the *negation* of the universal claim — i.e., there exists a set A ⊂ ℝ with no 3-term AP whose complement also lacks an infinite AP. This is exactly Baumgartner's result. +- The `answer(False)` tag correctly encodes that the answer to the problem is **no**. + +**Edge cases:** +- If `A = ∅`: `¬HasThreeTermAP ∅` is true (vacuously), and `HasInfiniteAP ℝ` is true (e.g., take a = 0, d = 1). No issue. +- If `A = ℝ`: `¬HasThreeTermAP ℝ` is false (ℝ contains many 3-APs), so the implication is vacuously true. No issue. +- The `d ≠ 0` condition in both definitions is correct and necessary: without it, `HasThreeTermAP` would be trivially true for any nonempty set (take d = 0), and `HasInfiniteAP` would be trivially true for any nonempty set (the constant "AP"). + +**Verdict: The formalization is mathematically correct and complete.** The definitions accurately capture the intended notions, the `answer(False)` tag correctly reflects the disproved status, and no mathematical flaws are present. diff --git a/ai-review/2.md b/ai-review/2.md new file mode 100644 index 0000000000..9991f8684b --- /dev/null +++ b/ai-review/2.md @@ -0,0 +1,131 @@ +# Review: Erdos Problem 2 + +**File:** `FormalConjectures/ErdosProblems/2.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `IsCoveringSystem` definition.** + +The file defines a local `Erdos2.IsCoveringSystem` on `Finset (ℤ × ℕ)`. An identical definition exists in `FormalConjectures/ErdosProblems/8.lean` (as `Erdos8.IsCoveringSystem`), with the same signature and body verbatim. This is a clear duplication. + +Moreover, `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` already provides a more general, ideal-based `CoveringSystem R` structure (used by Problem 7). For `R = ℤ`, this is mathematically equivalent: the coset `{a} + Ideal.span {m}` is exactly the congruence class `n ≡ a (mod m)`. + +**Recommendation:** Either: +- (a) Factor the `Finset (ℤ × ℕ)`-based `IsCoveringSystem` into a shared file (e.g., a new utility or into `CoveringSystem.lean`) and have Problems 2 and 8 import it, or +- (b) Restate Problem 2 in terms of the existing `CoveringSystem ℤ` structure. This would require defining a "minimum modulus" notion for `CoveringSystem ℤ` (extracting the generator of each principal ideal), which is more involved but would better unify the covering-system problems (2, 7, 8, 27, 273, 277, 586, etc.). + +Option (a) is the lower-effort fix and should be done regardless. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/2](https://www.erdosproblems.com/2):** + +The website lists: +- **Status:** Solved (disproved). $1000 prize. +- Erdős described this as "perhaps my favourite problem." +- Tags: Number theory, Covering systems. +- Related OEIS: A160559. + +The formalization cites four references: + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Hough 2015 | `[Hou15]` | Yes | **Tag mismatch:** code uses `[Hou15]` but the author is "Hough", so `[Hou15]` looks like a typo/abbreviation artifact. The website and standard practice would use `[Ho15]` (as Problem 8 does). | +| Filaseta–Ford–Konyagin–Pomerance–Yu 2007 | `[FFKPY07]` | Yes | OK. | +| Balister–Bollobás–Morris–Sahasrabudhe–Tiba 2022 | `[BBMST22]` | Yes | OK. Consistent with other files. | +| Owens 2014 | `[Ow14]` | Yes (implied by "minimum modulus 42" mention) | OK. | + +**Minor issues:** +- The `[Hou15]` tag is inconsistent with `[Ho15]` used in Problem 8 for the same paper. Should be unified. +- The OEIS sequence A160559 is not mentioned in the formalization. Consider adding it to the docstring for cross-referencing. +- The Hough citation says "Annals of Mathematics (2015), 361-382" but the full citation is "Ann. of Math. (2) **181** (2015), no. 1, 361–382." The volume/issue are missing but this is minor. + +--- + +## 3. Variants + +The formalization captures only the main resolved statement: "∃ B, every covering system has a modulus ≤ B." + +**Missing variants that could be formalized:** + +1. **Explicit upper bound (Balister et al.):** Every covering system has a modulus ≤ 616000. This is the best known upper bound and is a strictly stronger statement: + ``` + theorem erdos_2_upper : ∀ S : Finset (ℤ × ℕ), IsCoveringSystem S → + ∃ p ∈ S, p.2 ≤ 616000 + ``` + +2. **Explicit lower bound (Owens):** There exists a covering system whose minimum modulus is 42: + ``` + theorem erdos_2_lower : ∃ S : Finset (ℤ × ℕ), IsCoveringSystem S ∧ + ∀ p ∈ S, 42 ≤ p.2 + ``` + +3. **Tight bound conjecture:** The exact threshold is conjectured to lie in [42, 616000]. One could formalize the conjecture that the optimal B equals 42 (if that is indeed conjectured). + +4. **Hough's original bound:** Every covering system has a modulus ≤ 10^16. This is historically important and is a weaker but independently interesting statement. + +The docstring mentions these bounds in prose but none are formalized as separate theorems. + +--- + +## 4. Readability + +The code is short and clean. Minor suggestions: + +- **Pair projections:** The use of `p.1` and `p.2` for the residue and modulus components of pairs is functional but opaque. A type alias or named structure (e.g., `structure Congruence where residue : ℤ; modulus : ℕ`) would improve readability, though this is a project-wide convention choice. +- **Namespace:** The `Erdos2` namespace is appropriate and avoids clashes with the identical definition in `Erdos8`. +- **Docstrings:** Both the module-level and theorem-level docstrings are well-written and informative. The mathematical context is clearly presented. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The resolved statement of Problem 2 is fully precise: "There exists a constant B such that every covering system contains a modulus at most B." There is no ambiguity in the definitions involved (covering system, modulus, smallest modulus). The existential formulation (∃ B) is the natural way to express the resolved negative answer to Erdős's original question. + +The original question ("Can the smallest modulus be arbitrarily large?") is equivalent to ¬(∃ B, ...), so the formalization correctly captures the negation of Erdős's expectation. The `answer(...)` pattern used for open problems is not needed here since the problem is solved. + +**Ambiguity level: None.** This is one of the cleanest Erdős problems to formalize. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `IsCoveringSystem` +```lean +def IsCoveringSystem (S : Finset (ℤ × ℕ)) : Prop := + S.Nonempty ∧ + (∀ p ∈ S, 0 < p.2) ∧ + (∀ n : ℤ, ∃ p ∈ S, (p.2 : ℤ) ∣ (n - p.1)) +``` + +- **Nonemptiness:** Correctly requires a non-degenerate system. +- **Positivity of moduli:** `0 < p.2` ensures all moduli are ≥ 1. Note: the standard convention for covering systems typically requires moduli ≥ 2 (modulus 1 is trivial since every integer satisfies n ≡ a (mod 1)). Allowing modulus 1 does not affect the truth of the theorem — it only makes it marginally easier to satisfy (a system with a modulus-1 congruence trivially covers everything, and that modulus is ≤ B for any B ≥ 1). So this is harmless, but `1 < p.2` would be more standard. +- **Covering property:** `(p.2 : ℤ) ∣ (n - p.1)` correctly encodes `n ≡ p.1 (mod p.2)`. +- **Distinct vs. non-distinct moduli:** The definition does not require distinct moduli. This is correct — Problem 2 is about general covering systems (not "distinct" or "strict" covering systems as in Problem 7). The `Finset` type prevents duplicate *pairs* but allows multiple congruences with the same modulus (different residues), which is the correct behavior. + +### Theorem: `erdos_2` +```lean +theorem erdos_2 : + ∃ B : ℕ, ∀ S : Finset (ℤ × ℕ), IsCoveringSystem S → + ∃ p ∈ S, p.2 ≤ B +``` + +- **Logical structure:** "There exists a bound B such that for every covering system S, some congruence in S has modulus at most B." This is precisely the resolved form of Erdős's question (the answer being "no, the minimum modulus cannot be arbitrarily large"). +- **Bound is existential:** The formalization does not commit to a specific value of B. This is appropriate for the main statement — the specific bounds (616000, 10^16) are better stated as separate variants. +- **Return type:** The `∃ p ∈ S` correctly witnesses a specific congruence with small modulus, rather than just asserting the minimum is bounded. This is slightly stronger than needed but equivalent and more constructive. + +### Potential concern: modulus 1 + +As noted above, allowing modulus 1 means a single congruence `{(0, 1)}` is a valid covering system. The theorem then trivially holds for such systems (the modulus 1 ≤ B for any B ≥ 1). This doesn't introduce incorrectness but means the definition is slightly non-standard. The `CoveringSystem` structure in `FormalConjecturesForMathlib` uses `moduli i ≠ ⊥` which for `ℤ` means the ideal is not `{0}`, i.e., the modulus is nonzero — the same convention as here. + +**Verdict: Correct and complete.** No mathematical flaws. The formalization faithfully captures the resolved form of Erdős Problem 2. The only deficiency is the missed opportunity to also state the quantitative bounds as variants. diff --git a/ai-review/201.md b/ai-review/201.md new file mode 100644 index 0000000000..c36a3725ef --- /dev/null +++ b/ai-review/201.md @@ -0,0 +1,191 @@ +# Review: Erdos Problem 201 + +**File:** `FormalConjectures/ErdosProblems/201.lean` + +--- + +## 1. Code Reuse + +**Issue: Local definitions duplicate shared library functionality.** + +The file defines three local constructions in the `Erdos201` namespace: + +| Local definition | Shared equivalent | +|---|---| +| `Erdos201.HasKTermAP k S` | `¬ (↑S : Set ℤ).IsAPOfLengthFree k` (from `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`) | +| `Erdos201.maxAPFreeSize k S` | `Finset.maxAPFreeCard k S` (from same file) | +| `Erdos201.rAp k N` | `(Finset.Icc 1 N).maxAPFreeCard k` or `Set.IsAPOfLengthFree.maxCard k N` | + +These are all available via the `ProblemImports` import that the file already uses. + +**Key semantic difference:** `HasKTermAP` requires `d ≠ 0`, while the shared `IsAPOfLengthFree` defines AP-freeness as "no subsets that are APs of length k (unless k ≤ 1)." For `k ≥ 2`, the `d = 0` case produces a set `{a, a, a, ...} = {a}`, which has cardinality 1 < k, so the `d = 0` AP cannot be a subset of anything in the finset powerset unless k ≤ 1. Therefore the two notions are **equivalent for k ≥ 2** — and in the theorem, k = 3. The local definitions are mathematically redundant. + +**Concrete evidence of reuse:** Problem 139 defines `noncomputable abbrev r := Set.IsAPOfLengthFree.maxCard` and uses it directly. Green's Open Problem 9 defines `r k N := (Finset.Icc 1 N).maxAPFreeCard k`. Both are structurally identical to what `rAp` computes, modulo the ℕ-vs-ℤ distinction. + +Note that the shared `Finset.maxAPFreeCard` operates on `Finset α` for any `AddCommMonoid α`, and the shared `Set.IsAPOfLengthFree.maxCard` is specifically for `{1, ..., N} ⊆ ℕ`. Since Problem 201 uses `Finset.Icc (1 : ℤ) (N : ℤ)`, the `Finset.maxAPFreeCard` version is the appropriate shared replacement for `rAp`: + +```lean +noncomputable def rAp (k N : ℕ) : ℕ := (Finset.Icc (1 : ℤ) (N : ℤ)).maxAPFreeCard k +``` + +There is a subtlety: `Set.IsAPOfLengthFree.maxCard` works over `ℕ`, while Problem 201 works over `ℤ`. For `R_k(N)` (subsets of `{1,...,N}`), these are mathematically equivalent via the canonical embedding `ℕ ↪ ℤ`, but the `ℤ` version is needed for the `G_k(N)` part of the problem (arbitrary sets of `N` integers, which may be negative). Using `Finset.maxAPFreeCard` over `ℤ` is both correct and consistent with the shared infrastructure. + +**Recommendation:** Replace all three local definitions with the shared equivalents. This brings consistency with Problems 139, 198, and Green 9. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/201](https://www.erdosproblems.com/201):** + +The website lists: +- **Status:** Open +- **Tags:** Additive combinatorics, Arithmetic progressions +- References to Riddell (1969) as first investigator, and Erdős (1973, 1975), Erdős–Graham (1979, 1980), Komlós–Sulyok–Szemerédi (1975) + +The formalization cites: + +| Citation | In formalization | On website | Assessment | +|---|---|---|---| +| Erdős 1973 | `[Er73]` with full title | Yes | OK | +| Erdős 1975 | `[Er75b]` with full title | Yes | OK | +| Erdős–Graham 1979 | `[ErGr79]` with full title | Yes | OK | +| Erdős–Graham 1980 | `[ErGr80]` with full title | Yes | OK | +| Komlós–Sulyok–Szemerédi 1975 | `[KSS75]` with full title | Yes | OK | +| Riddell 1969 | **Not cited** | Yes (mentioned as first investigator) | **Missing** | + +**Issues:** +- **Missing citation:** Riddell (1969) is mentioned on the website as the first investigator of the problem. The formalization does not cite this work. Consider adding: + ``` + [Ri69] Riddell, J., *On sets of numbers containing no l terms in arithmetic progression*. + Nieuw Arch. Wisk. (1969). + ``` +- All other citations are complete and include full bibliographic information, which is commendable. + +--- + +## 3. Variants + +**The formalization captures only one variant: the k = 3 case.** + +The original problem as described on the website and in the docstring involves: +1. The general relationship between $G_k(N)$ and $R_k(N)$ +2. The specific question of whether $\lim_{N \to \infty} R_3(N)/G_3(N) = 1$ + +**Missing variants that could be formalized:** + +1. **General k version:** The question whether $\lim_{N \to \infty} R_k(N)/G_k(N) = 1$ for all $k \geq 3$ is a natural generalization. Even if Erdős specifically asked about $k = 3$, the general version is of interest. + +2. **Komlós–Sulyok–Szemerédi result:** The docstring mentions that $R_k(N) \ll_k G_k(N)$ was proved in [KSS75]. This is a known result and could be stated as a `solved` variant: + ```lean + @[category research solved, AMS 5] + theorem erdos_201_kss (k : ℕ) (hk : 2 ≤ k) : + ∃ C : ℝ, C > 0 ∧ ∀ N : ℕ, (rAp k N : ℝ) ≤ C * (gAp k N : ℝ) := by + sorry + ``` + (This would require defining `gAp`, i.e., $G_k(N)$.) + +3. **Trivial bound as a lemma:** The bound $G_k(N) \leq R_k(N)$ is described as "trivial" in the docstring and could be a useful lemma, both for documentation and for downstream proofs. + +4. **Small cases:** The website notes $G_3(5) = 3$ while $R_3(5) = 4$, demonstrating strict inequality. These could be formalized as decidable `native_decide` checks. + +**Notable omission:** The quantity $G_k(N)$ itself is never defined. The formalization reformulates the limit question to avoid defining $G_k(N)$ explicitly, instead using the equivalent "for every ε > 0" formulation. This is mathematically valid (see §6 for discussion) but means the $G_k(N) \leq R_k(N)$ bound and the KSS result cannot be stated without additional definitions. + +--- + +## 4. Readability + +The code is short and reasonably clear. Specific observations: + +- **Good:** The docstring clearly explains the mathematical context, defines both $G_k(N)$ and $R_k(N)$, and explains the equivalence used in the formalization. +- **Good:** The `HasKTermAP` definition is transparent and well-documented. +- **Minor issue:** The `maxAPFreeSize` definition uses `Finset.sup ... Finset.card`, which returns 0 for the empty set (if no AP-free subset exists, which can't happen since ∅ is AP-free). This is fine mathematically but could benefit from a brief comment explaining the convention. +- **Suggestion:** If the local definitions are replaced with shared ones (per §1), readability would improve since readers familiar with the codebase would recognize the standard API. +- **Suggestion:** The equivalence claimed in the docstring ("Since $G_k(N) \leq R_k(N)$ always holds, the conjecture is equivalent to...") is not formally proved. Consider adding a comment acknowledging this, or better yet, defining $G_k(N)$ and proving the equivalence as a lemma. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Moderately ambiguous — the reformulation introduces a subtle gap.** + +The original problem asks: *Is it true that $\lim_{N \to \infty} R_3(N)/G_3(N) = 1$?* + +This is a yes/no question, formalized using the `answer(sorry)` pattern, which is appropriate. However: + +1. **Definition of $G_k(N)$:** The problem defines $G_k(N)$ as the largest $m$ such that *every* set of $N$ integers contains an AP-free subset of size $\geq m$. The formalization never explicitly defines $G_k(N)$ — instead, it reformulates the limit condition directly. This reformulation is mathematically correct (see §6) but arguably less transparent than defining $G_k(N)$ and stating the limit directly: + ```lean + Filter.Tendsto (fun N => (rAp 3 N : ℝ) / (gAp 3 N : ℝ)) Filter.atTop (𝓝 1) + ``` + +2. **Precision of the original statement:** The original Erdős problem is stated precisely enough to formalize unambiguously. $G_k(N)$ and $R_k(N)$ are well-defined combinatorial quantities. The only potential ambiguity is whether "set of $N$ integers" means a set of cardinality exactly $N$ (as formalized, with `S.card = N`) or a multiset — but the standard convention is a set, which the formalization correctly uses. + +3. **The `answer(sorry)` pattern:** Since this is an open problem with a yes/no answer, the pattern is correct. The formalization asserts the answer is `answer(sorry)` iff the epsilon-delta reformulation holds. This correctly captures the uncertainty about the answer. + +**Ambiguity level: Low.** The mathematical content is precise. The only design choice is the reformulation avoiding $G_k(N)$, which is equivalent but less direct. + +--- + +## 6. Correctness + +**The formalization is mathematically correct but could be more direct.** + +### Definition: `HasKTermAP` +```lean +def HasKTermAP (k : ℕ) (S : Finset ℤ) : Prop := + ∃ a d : ℤ, d ≠ 0 ∧ ∀ i : Fin k, (a + (i.val : ℤ) * d) ∈ S +``` + +- **Non-triviality condition:** `d ≠ 0` correctly excludes trivial (constant) progressions. This is standard. +- **Indexing:** `Fin k` with `i.val` correctly ranges over `{0, 1, ..., k-1}`, producing the terms `a, a+d, a+2d, ..., a+(k-1)d`. Correct. +- **Edge case k = 0:** `HasKTermAP 0 S` requires `∃ a d, d ≠ 0 ∧ ∀ i : Fin 0, ...`, which is vacuously true for any nonempty choice of `a, d` with `d ≠ 0`. So `HasKTermAP 0 S` is true for all `S`. This means `¬HasKTermAP 0 T` is always false — no subset is 0-AP-free. This is a degenerate edge case not relevant to the theorem (k = 3). +- **Edge case k = 1:** `HasKTermAP 1 S` requires `∃ a d, d ≠ 0 ∧ a ∈ S`, which is true iff `S` is nonempty (pick any `a ∈ S` and any `d ≠ 0`). Again, not relevant to k = 3. + +### Definition: `maxAPFreeSize` +```lean +noncomputable def maxAPFreeSize (k : ℕ) (S : Finset ℤ) : ℕ := + Finset.sup (S.powerset.filter (fun T => ¬HasKTermAP k T)) Finset.card +``` + +- This computes the supremum of `card T` over all `T ⊆ S` with `¬HasKTermAP k T`. +- **Correctness:** For k ≥ 2, this correctly gives the maximum size of a k-AP-free subset. The empty set is always in the filtered collection (since `HasKTermAP k ∅` is false for k ≥ 2, as there's no `a ∈ ∅`), so the sup is well-defined. +- **Note:** `Finset.sup` with `ℕ` returns 0 if the filtered set is empty (using `⊥ = 0` for `ℕ`). For k = 0, the filtered set is indeed empty (every set "has" a 0-AP), so `maxAPFreeSize 0 S = 0`. For k ≥ 1, `∅` is AP-free, so the sup is ≥ 0, which is fine. + +### Definition: `rAp` +```lean +noncomputable def rAp (k N : ℕ) : ℕ := + maxAPFreeSize k (Finset.Icc (1 : ℤ) (N : ℤ)) +``` + +- This correctly defines $R_k(N)$ as the max AP-free subset of `{1, ..., N}` in ℤ. +- **Note on convention:** This uses `{1, ..., N}` (1-indexed), consistent with the problem statement and with other formalizations in the codebase (Problem 139, Green 9). + +### Main theorem: `erdos_201` +```lean +theorem erdos_201 : + answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + ∀ S : Finset ℤ, S.card = N → + ∃ T ⊆ S, ¬HasKTermAP 3 T ∧ + (1 - ε) * (rAp 3 N : ℝ) ≤ (T.card : ℝ) +``` + +**Verification of the reformulation:** The original question is whether $\lim_{N \to \infty} R_3(N) / G_3(N) = 1$. + +Define $G_3(N) := \min_{|S|=N} \max_{T \subseteq S, T \text{ 3-AP-free}} |T|$. Since $\{1,...,N\}$ is a particular set of $N$ integers, we have $G_3(N) \leq R_3(N)$ trivially. + +The KSS result gives $R_3(N) \ll G_3(N)$, so $R_3(N)/G_3(N)$ is bounded. The question is whether the ratio tends to 1. + +$R_3(N)/G_3(N) \to 1$ is equivalent to: for every $\varepsilon > 0$, for large enough $N$, $G_3(N) \geq (1-\varepsilon) R_3(N)$. + +Unpacking $G_3(N) \geq (1-\varepsilon) R_3(N)$: for every set $S$ of $N$ integers, $S$ contains a 3-AP-free subset of size $\geq (1-\varepsilon) R_3(N)$. + +This is exactly what the formalization states. **The reformulation is correct.** + +**One potential concern:** The reformulation is an `↔` with `answer(sorry)`. If the answer is "no" (the limit is not 1), then `answer(sorry)` should be `False`, and the RHS should also be false. But could the RHS be vacuously true? For $N \geq 1$, there exist sets $S$ with $|S| = N$, so the universal quantifier over $S$ is not vacuous. The existence of $T$ with the bound could fail if $G_3(N)$ is genuinely smaller than $(1-\varepsilon) R_3(N)$ for all $N$. So the RHS is indeed falsifiable. **Correct.** + +**Minor mathematical note:** The formalization implicitly assumes $R_3(N) > 0$ for the bound to be meaningful. Since $\{1\} \subseteq \{1,...,N\}$ is 3-AP-free for $N \geq 1$, we have $R_3(N) \geq 1$ for $N \geq 1$. For $N = 0$, $R_3(0) = 0$ and the bound $(1-\varepsilon) \cdot 0 \leq |T|$ is trivially satisfied. So there is no issue. + +**Verdict: Correct and complete.** The formalization faithfully captures the mathematical content of Erdős Problem 201. The reformulation avoiding an explicit $G_k(N)$ definition is valid. The main improvements would be: (a) replacing local definitions with shared library equivalents, and (b) adding the KSS result and trivial bound as variants. diff --git a/ai-review/202.md b/ai-review/202.md new file mode 100644 index 0000000000..33f018c0a0 --- /dev/null +++ b/ai-review/202.md @@ -0,0 +1,116 @@ +# Review: Erdős Problem 202 + +**File:** `FormalConjectures/ErdosProblems/202.lean` + +--- + +## 1. Code Reuse + +**Partial reuse opportunity identified.** + +The codebase has `CoveringSystem` and `StrictCoveringSystem` structures in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`, which model congruence class systems using ideals. However, these require the union of cosets to *cover* all of ℤ, which is the opposite constraint from Problem 202 (where classes must be *pairwise disjoint*, i.e., covering at most once). So the existing structures are not directly reusable. + +Problem 2 (`ErdosProblems/2.lean`) defines `IsCoveringSystem` using `Finset (ℤ × ℕ)` — note the *reversed* pair order compared to Problem 202's `Finset (ℕ × ℤ)`. This inconsistency is minor but worth noting. + +Problem 204 (`ErdosProblems/204.lean`) uses Mathlib's `Int.ModEq` notation (`x ≡ a d [ZMOD d]`), which is cleaner than the raw `%` operator used in Problem 202. The `IsPairwiseDisjointSystem` definition could benefit from using `Int.ModEq` for consistency with other problems in the codebase. + +No existing definition can be directly substituted for `IsPairwiseDisjointSystem`. + +## 2. Citations + +The docstring references are **incomplete** relative to the website. + +**Missing from docstring:** +- **Croot (2003) [Cr03b]**: Obtained intermediate bounds using L(N), specifically N/L(N)^{√2+o(1)} < f(N) < N/L(N)^{1/6−o(1)}. This is a significant intermediate result that the docstring omits. +- **Chen (2005) [Ch05]**: Further tightened bounds before BFV. Also omitted from the docstring narrative. +- The docstring says Erdős and Szemerédi proved f(N) = o(N), citing [ErSz68], but does not include the full paper title or journal. The website gives more context: Erdős–Szemerédi established N/exp((log N)^{1/2+ε}) ≪ f(N) < N/(log N)^c. + +**Present but incomplete:** +- [BFV13] is cited but without the full paper title: *"On a problem of Erdős and Graham"* or similar. +- The bulk citation `[Er61, Er65, Er65b, Er73, Er77c, ErGr80, Va99]` is listed but defers to the website for full references. This is acceptable given the large number of references, but individual full citations would be more rigorous. + +**Website also notes:** +- Related OEIS sequence: A389975 +- Problem was last edited 23 January 2026 + +## 3. Variants + +**The formalization captures one specific conjecture, not the full problem.** + +The problem as stated on the website is open-ended: "How large can r be in terms of N?" This encompasses: + +1. ✅ The BFV conjecture f(N) = N/L(N)^{1+o(1)} — the formalization captures the upper-bound direction of this conjecture. +2. ✅ The lower bound f(N) ≥ N/L(N)^{1+o(1)} is already proved [BFV13], so only the upper bound is needed. The formalization correctly targets the open part. +3. ❌ The original Erdős–Stein conjecture f(N) = o(N) (proved by Erdős–Szemerédi) is not separately formalized, but this is reasonable since it is subsumed by the stronger BFV conjecture. +4. ❌ The current best known upper bound f(N) < N/L(N)^{√3/2+o(1)} is not formalized. This is a proved result that could be stated as a separate theorem. +5. ❌ No variant capturing the original Erdős–Szemerédi quantitative bounds is provided. + +The choice to formalize only the BFV conjecture is reasonable, as it is the sharpest open question. + +## 4. Readability + +**Several readability improvements are possible.** + +1. **Raw `%` operator vs `Int.ModEq`**: The disjointness condition uses `x % (↑p.1 : ℤ) = p.2 % (↑p.1 : ℤ)`, which is less readable than Mathlib's `x ≡ p.2 [ZMOD p.1]` notation used in Problem 204. Using `Int.ModEq` would align with codebase conventions and improve clarity. + +2. **Positional accessors `.1`/`.2`**: The definition uses `p.1` and `p.2` throughout. Using a named structure (e.g., with fields `modulus` and `residue`) or pattern matching would improve readability: + ```lean + (∀ ⟨n, a⟩ ∈ S, ∀ ⟨m, b⟩ ∈ S, ...) + ``` + +3. **Pair ordering inconsistency**: Problem 202 uses `(ℕ × ℤ)` (modulus, residue) while Problem 2 uses `(ℤ × ℕ)` (residue, modulus). Consistent ordering across covering-system problems would aid comprehension. + +4. **The `L(N)` function**: The expression `Real.exp ((1 - ε) * Real.sqrt (Real.log (N : ℝ) * Real.log (Real.log (N : ℝ))))` is dense. Defining a local abbreviation for `L(N)` would mirror the mathematical notation and make the theorem statement more transparent: + ```lean + let L := fun N : ℝ => Real.exp (Real.sqrt (Real.log N * Real.log (Real.log N))) + ``` + +## 5. Formalizability + +**Assessment: Moderately formalizable with low ambiguity.** + +The original problem ("How large can r be?") is too open-ended to formalize directly, but the BFV conjecture that the formalization targets is precise and unambiguous: + +- f(N) = N / L(N)^{1+o(1)} is a standard asymptotic statement, and the formalization correctly unpacks the o(1) as "for every ε > 0, eventually..." +- The definition of "pairwise disjoint congruence classes with distinct moduli at most N" is completely precise. +- The use of `∀ᶠ N : ℕ in atTop` correctly captures "for all sufficiently large N." + +**One subtle point:** The formalization uses `Real.log` which is the natural logarithm. When N is small (e.g., N = 1), `Real.log (Real.log N)` involves `log(0)`, which in Mathlib evaluates to 0 (since `Real.log` is defined to be 0 for non-positive inputs). This is harmless because the `∀ᶠ ... in atTop` quantifier restricts to sufficiently large N, but it means the expression inside the exponential is well-defined for all N even if not meaningful for small N. + +**Ambiguity level: Low.** The formalization is a faithful rendering of a precisely stated conjecture. + +## 6. Correctness + +**The formalization is mathematically correct.** + +**Detailed verification:** + +- **IsPairwiseDisjointSystem**: The three conjuncts correctly encode: + 1. All moduli lie in {1, ..., N} — `1 ≤ p.1 ∧ p.1 ≤ N` ✓ + 2. All moduli are distinct — `p ≠ q → p.1 ≠ q.1` ✓ + 3. No integer belongs to two classes — `¬(x % n₁ = a₁ % n₁ ∧ x % n₂ = a₂ % n₂)` for distinct pairs ✓ + +- **Modular arithmetic encoding**: Using `x % (↑p.1 : ℤ) = p.2 % (↑p.1 : ℤ)` is equivalent to `x ≡ p.2 (mod p.1)` for positive p.1, which is guaranteed by `1 ≤ p.1`. ✓ + +- **Main theorem**: States that for every ε > 0, for all sufficiently large N, every pairwise disjoint system S with moduli in [1,N] satisfies |S| ≤ N / exp((1-ε)√(log N · log log N)). This is precisely f(N) ≤ N / L(N)^{1-ε}, which is the upper-bound half of the BFV conjecture f(N) = N / L(N)^{1+o(1)}. ✓ + +- **Completeness**: The formalization only states the conjectural upper bound. The proved lower bound f(N) ≥ N / L(N)^{1+ε} [BFV13] is mentioned in the docstring but not formalized. This is a deliberate choice since the lower bound is already established and the interesting open question is the upper bound. However, for completeness, one might consider: + - Formalizing the proved lower bound as a separate theorem + - Formalizing the proved upper bound f(N) < N / L(N)^{√3/2+o(1)} as a separate (solved) theorem + +**Potential concern:** The condition `p ≠ q → p.1 ≠ q.1` means that each modulus n appears at most once in S. This matches the problem statement's requirement of "distinct moduli" (n₁ < ... < nᵣ). However, it also means S cannot contain two pairs with the same modulus but different residues. This is mathematically correct — the problem requires distinct moduli — but it's worth noting that this is enforced structurally rather than being a consequence of disjointness. (Two congruence classes with the same modulus and different residues are automatically disjoint, so allowing duplicate moduli would only increase f(N). The distinct-moduli constraint is part of the problem definition.) + +**Verdict: Correct and complete** for the specific conjecture it targets. No mathematical flaws identified. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ⚠️ Minor | Could use `Int.ModEq`; no direct reuse of existing structures | +| Citations | ⚠️ Incomplete | Missing Croot [Cr03b] and Chen [Ch05] from narrative | +| Variants | ✅ Adequate | Captures the key open conjecture; proved bounds could be added | +| Readability | ⚠️ Improvable | Raw `%`, positional accessors, dense L(N) expression | +| Formalizability | ✅ Good | Low ambiguity; precise conjecture faithfully rendered | +| Correctness | ✅ Correct | Mathematically sound; no flaws identified | diff --git a/ai-review/205.md b/ai-review/205.md new file mode 100644 index 0000000000..b0102a38f7 --- /dev/null +++ b/ai-review/205.md @@ -0,0 +1,76 @@ +# Review: Erdős Problem 205 + +## 1. Code Reuse + +**`primeFactorsList.length` vs `Ω` (bigOmega):** The formalization uses `(n - 2 ^ k).primeFactorsList.length` to count prime factors with multiplicity. Several other files in the codebase use Mathlib's `ArithmeticFunction.Omega` (`Ω`) for this purpose — see problems 306, 413, and 1139, which open `scoped omega Omega` and use `Ω n` directly. The two should be definitionally or propositionally equal for positive naturals, and using `Ω` would be more idiomatic and consistent with the rest of the codebase. + +**Relationship to Problem 851:** Problem 851 (`FormalConjectures/ErdosProblems/851.lean`) defines a `TwoPowAddSet r` — the set of integers of the form `2^k + n` where `n` has at most `r` prime divisors (using `primeFactors.card`, i.e., distinct factors ω). Problem 205 uses prime factors *with multiplicity* (Ω), so it is measuring a different quantity. However, structurally the problems are closely related and the website explicitly lists Problem 851 as a related problem. A cross-reference in the docstring would be valuable. + +**No utility gaps:** No existing utility in `FormalConjecturesForMathlib/` directly applies, but no new utility is needed — Mathlib's `Ω` suffices. + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The website (erdosproblems.com/205) provides additional historical context not reflected in the formalization: + +- **Romanoff (1934):** Proved that integers of the form `2^k + p` (p prime) have positive lower density. +- **Erdős:** Used covering systems to show certain odd integers cannot be represented as `2^k + p`. +- **Counterexample constructors:** The website credits results by multiple authors (including Tao) quantifying the disproof, showing infinitely many `n` exist where for all valid `k`, `n - 2^k` has at least ~`(log n / log log n)^{1/2}` prime factors. +- **Related problem:** The website explicitly points to Problem 851. + +**Recommendation:** Add a reference to Problem 851 and optionally note the key result establishing the disproof. + +## 3. Variants + +The website mentions additional variants not captured: + +1. **ε log log m bound:** Does the representation hold with the weaker bound `Ω(m) < ε · log log m` for some `ε > 0`? +2. **Slowly growing functions:** More generally, for what slowly growing functions `f` can all sufficiently large `n` be written as `2^k + m` with `Ω(m) < f(m)`? +3. **Odd counterexamples:** Whether arbitrarily large *odd* counterexamples exist remains an open question. + +None of these variants are formalized. At minimum, the odd-counterexamples variant and the ε-relaxation would be natural additions. + +## 4. Readability + +**Minor issues:** + +- Using `Ω` (via `open scoped Omega`) instead of `primeFactorsList.length` would improve readability and match the docstring notation `Ω(m)`. Currently the docstring says "Ω(m)" but the code says `primeFactorsList.length`, which is a notational mismatch. +- The expression `((n - 2 ^ k).primeFactorsList.length : ℝ)` is verbose. With `Ω`, this becomes `(Ω (n - 2 ^ k) : ℝ)`. +- The cast chain `((n - 2 ^ k : ℕ) : ℝ)` inside `Real.log (Real.log ...)` is clear but slightly awkward; this is a minor stylistic point. + +**Overall:** The code is reasonably readable but would benefit from using standard Mathlib notation. + +## 5. Formalizability + +The problem is **precisely stated and clearly formalizable**. The key concepts — powers of 2, prime factor counting with multiplicity, and logarithms — all have standard Mathlib formalizations. The "sufficiently large" quantifier (`∃ N, ∀ n ≥ N`) is a standard pattern. + +**Ambiguity level: Low.** The only minor ambiguity in the original problem statement is what "fewer than log log m" means when `m` is small (where `log log m` may be ≤ 0 or undefined). The formalization handles this naturally: in Mathlib, `Real.log 0 = 0` and `Real.log` of negative values is 0, so for small `m` the condition `Ω(m) < log(log(m))` becomes `Ω(m) < 0` (or `Ω(m) < log(0) = 0`), which is false for any `m ≥ 1`. This effectively requires `m` to be large enough that `log(log(m)) > 0`, which is mathematically appropriate. + +## 6. Correctness + +**Overall assessment: Correct, with one subtlety worth noting.** + +**The logical structure is correct:** +- `answer(False) ↔ [conjecture]` encodes a disproved conjecture. Since `False ↔ P` is equivalent to `¬P`, proving this theorem amounts to disproving the conjecture. This matches the known mathematical result. +- The conjecture states: ∃ N such that ∀ n ≥ N, ∃ k with 2^k ≤ n and Ω(n − 2^k) < log(log(n − 2^k)). +- The disproof means: ∀ N, ∃ n ≥ N such that ∀ k with 2^k ≤ n, Ω(n − 2^k) ≥ log(log(n − 2^k)). + +**Natural number subtraction:** The guard `2 ^ k ≤ n` correctly prevents truncation issues with natural subtraction (`n - 2^k` would be 0 if `2^k > n` in ℕ). + +**Edge case handling:** When `n = 2^k` (i.e., `m = 0`), `primeFactorsList` of 0 is empty (length 0) and `log(log(0)) = log(0) = 0` in Mathlib, so `0 < 0` is false. When `m = 1`, `log(log(1)) = log(0) = 0` and `Ω(1) = 0`, so again `0 < 0` is false. These edge cases are handled correctly — the formalization implicitly requires `m ≥ 2` and large enough that `log(log(m)) > 0`, which aligns with mathematical intent. + +**No flaws identified.** The formalization faithfully captures the original conjecture and its disproof. Any incompleteness is limited to the missing variants discussed in Section 3, not to the core statement. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Use `Ω` from Mathlib instead of `primeFactorsList.length` | +| Citations | Missing Romanoff, Tao references; missing cross-ref to Problem 851 | +| Variants | ε-relaxation, odd counterexamples not captured | +| Readability | Good; would improve with `Ω` notation | +| Formalizability | High — low ambiguity | +| Correctness | Correct and complete for the core statement | diff --git a/ai-review/206.md b/ai-review/206.md new file mode 100644 index 0000000000..628cc0b4d8 --- /dev/null +++ b/ai-review/206.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 206 + +## 1. Code Reuse + +**Potential for shared `unitFracSum` definition.** Problem 301 (`ErdosProblems/301.lean`) uses the identical pattern `∑ b ∈ S, (1 : ℝ) / (b : ℝ)` inline within `UnitFractionSumFree`, rather than factoring it into a named definition. Problem 206 defines `unitFracSum` for this purpose. If a shared utility were created (e.g., in `Util/`), both problems could reference it. + +Problem 304 (`ErdosProblems/304.lean`) defines `unitFractionExpressible` over `ℚ` using `(n : ℚ)⁻¹` notation, which is a different type (`ℚ` vs `ℝ`) and a different question (exact representation vs. underapproximation), so direct reuse is not practical. + +The `bestUnderapprox` definition uses `sSup` over a set comprehension, a pattern also found in Problems 882, 962, and 992, but the specific constraints differ enough that no direct reuse applies. + +**Verdict:** Minor opportunity to share `unitFracSum` with Problem 301, but the benefit is marginal given the simplicity of the definition. + +## 2. Citations + +The formalization cites only: + +> [Ko24b] Kovač, V., _Disproof of a conjecture of Erdős and Graham on the greedy algorithm for Egyptian fractions_ (2024). + +The [erdosproblems.com/206](https://www.erdosproblems.com/206) page lists the following references: + +- **ErGr80** — Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_ (1980), p. 31. **(Missing from formalization — this is the original source of the problem.)** +- **Cu22** — Curtiss (2022): proved the greedy property for x = 1. +- **Er50b** — Erdős (1950): proved the greedy property for x = 1/m. +- **Na23** — Nathanson (2023): proved the greedy property when a | b+1 for x = a/b. +- **Ch23b** — Chu (2023): extended results to a larger class of rationals. +- **Ko24b** — Kovač (2024): disproved the conjecture in general. + +**Recommendation:** Add `[ErGr80]` as the original problem source in the docstring. The other references (Cu22, Er50b, Na23, Ch23b) would be relevant if the positive partial results are formalized as variants. + +## 3. Variants + +The website documents several significant variants and partial results that are **not captured**: + +1. **x = 1 case (Curtiss 2022):** The greedy property holds. Could be formalized as a standalone theorem. +2. **x = 1/m case (Erdős 1950):** The greedy property holds for all unit fractions. A natural variant. +3. **Rational case with divisibility (Nathanson 2023):** Holds when a | b+1 for x = a/b. +4. **Open question for all rationals:** Whether the greedy property holds for every rational x remains open despite Kovač's measure-zero result. This is a notable open variant. +5. **Explicit counterexample:** Despite the measure-zero result, no explicit x lacking the greedy property has been constructed. This is mathematically interesting but difficult to formalize. +6. **Non-eventual counterexample:** Without the "eventually" qualifier, counterexamples among rationals exist (e.g., x = 11/24). This could be formalized as a concrete test case. + +**Recommendation:** At minimum, the open rational case and the x = 1 result deserve variant formalizations. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The three definitions (`unitFracSum`, `bestUnderapprox`, `IsEventuallyGreedy`) are clearly named and have good docstrings explaining the mathematical content. +- The use of `namespace Erdos206` and `open scoped BigOperators` / `open MeasureTheory` is clean. +- The theorem docstring provides adequate mathematical context. +- Minor suggestion: the docstring for `IsEventuallyGreedy` could mention that "greedy" means choosing the smallest eligible denominator, to match the informal description more closely. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem is **precisely formalizable**, and the formalization captures a well-defined mathematical statement. Key considerations: + +- **Supremum well-definedness:** `bestUnderapprox n x` uses `sSup` over a set of reals. For `n ≥ 1` and `x > 0`, this set is non-empty (take sufficiently large denominators) and bounded above by `x`. For `n = 0`, the only valid set is the empty set with sum 0. In all relevant cases, `sSup` is well-defined and the supremum is attained (for any fixed `n`, the number of "competitive" sets is effectively finite since denominators are bounded by the harmonic constraint). +- **Finset ensures distinctness:** Using `Finset ℕ` automatically enforces that denominators are distinct, which is correct. +- **The `volume` measure:** `volume` in Mathlib is Lebesgue measure on ℝ, and the measurability of the set `{x : ℝ | 0 < x ∧ IsEventuallyGreedy x}` is non-trivial but expected to hold (it involves countable intersections/unions of measurable sets). This is a minor formalizability concern but not a blocking issue. + +**Ambiguity assessment: Low.** The original problem asks "is it true that for almost all x..." which Kovač answered definitively. The formalization correctly captures the resolved version. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### `unitFracSum` (line 38–39) +Correctly computes $\sum_{m \in S} 1/m$ over reals. Division by zero gives 0 in Lean, but the `0 < m` guard in `bestUnderapprox` prevents this from affecting the mathematics. + +### `bestUnderapprox` (line 45–47) +Correctly defines $R_n(x) = \sup\{s : \exists S \subseteq \mathbb{Z}^+, |S|=n, s = \sum_{m \in S} 1/m, s < x\}$. The constraints (`S.card = n`, `∀ m ∈ S, 0 < m`, `s < x`) match the mathematical definition. The supremum is attained for all relevant parameters (fixed `n`, positive `x` with the set non-empty), so the use of `sSup` does not introduce edge-case issues. + +### `IsEventuallyGreedy` (lines 55–66) +This definition captures: "eventually, every optimal set S can be extended greedily." The key conditions are: +- `unitFracSum S = bestUnderapprox n x` — S achieves the optimum +- `unitFracSum S + 1/k = bestUnderapprox (n+1) x` — adding 1/k gives the next optimum +- `∀ j, 0 < j → j ∉ S → unitFracSum S + 1/j < x → k ≤ j` — k is the smallest eligible denominator + +This correctly formalizes the greedy property. The smallest eligible k is uniquely determined (by the minimality condition), and the statement requires that this greedy choice is also optimal. + +**One subtlety worth noting:** The definition quantifies over ALL sets S achieving the optimum at level n, not just one particular optimal set. This is the correct interpretation — the greedy property should hold regardless of which optimal S we start from. + +### `erdos_206` (lines 83–85) +The statement `volume {x : ℝ | 0 < x ∧ IsEventuallyGreedy x} = 0` correctly captures Kovač's result that the set of positive reals where best underapproximations are eventually greedy has Lebesgue measure zero. This is the negation of the original Erdős-Graham conjecture (which asked for the property to hold for almost all x). + +**Verdict:** The formalization is correct and complete for the main result. No mathematical flaws identified. The only incompleteness is the absence of variant formalizations for the positive partial results documented on the website. diff --git a/ai-review/207.md b/ai-review/207.md new file mode 100644 index 0000000000..139ad12af1 --- /dev/null +++ b/ai-review/207.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 207 + +## 1. Code Reuse + +**Steiner Triple System definition could reference Problem 722.** + +`Erdos207.IsSteinerTripleSystem` (207.lean:40–42) is a special case of `Erdos722.IsSteinerSystem` (722.lean:54–57) with parameters `r = 2, k = 3`. The two definitions are equivalent but stated differently: + +- **207** uses pair-based uniqueness: `∀ u v : Fin n, u ≠ v → ∃! e, e ∈ edges ∧ u ∈ e ∧ v ∈ e` +- **722** uses subset-based containment: `∀ A : Finset (Fin n), A.card = r → ∃! B, B ∈ F ∧ A ⊆ B` + +These are mathematically equivalent for `r = 2`, but proving the formal equivalence requires some bookkeeping (bijecting pairs `(u, v)` with `u ≠ v` and 2-element `Finset`s). The pair-based formulation in 207 is arguably more natural for the triple-system case, so keeping a separate definition is reasonable, though a `lemma IsSteinerTripleSystem_iff_IsSteinerSystem` bridge would be beneficial. + +**3-uniform hypergraph structure in Problem 1024** (`Hypergraph3Uniform`, 1024.lean:43–45) packages edges and the uniformity proof into a structure. Problem 207 instead uses a bare `Finset (Finset (Fin n))` with the uniformity condition embedded inside `IsSteinerTripleSystem`. Since the STS definition already implies 3-uniformity, there is no strong motivation to refactor toward `Hypergraph3Uniform` here, but the codebase would benefit from a shared 3-uniform hypergraph definition in the long run. + +No other definitions in the codebase (girth, high-girth hypergraphs) are directly reusable for this problem. + +## 2. Citations + +**Website (erdosproblems.com/207):** +- Original problem source: Erdős **[Er76]** +- Proof: Kwan, Sah, Sawhney, and Simkin **[KSSS22b]** +- Status: **Proved** + +**Lean file:** +- Cites `[KSSS22b]` with full author names — correct. +- Full citation text: `Kwan, M., Sah, A., Sawhney, M., and Simkin, M., High-girth Steiner triple systems (2022)` — matches the website. +- **Missing:** The original problem source `[Er76]` (Erdős, 1976) is not cited in the docstring. The website attributes the problem to `[Er76]`. Consider adding: + + ``` + [Er76] Erdős, P., *Problems and results in graph theory and combinatorics* (1976). + ``` + +## 3. Variants + +The website lists **no additional variants** beyond the main statement. The formalization captures the full generality of the problem (arbitrary girth `g ≥ 2`, for sufficiently large `n` satisfying the congruence condition). No variants appear to be missing. + +## 4. Readability + +The code is well-structured and readable overall. Minor observations: + +- **Girth condition inline:** The girth condition (lines 63–65) is expressed directly in the theorem statement rather than as a named definition (e.g., `HasGirthGreaterThan`). Extracting it would improve readability and reusability: + ```lean + def HasGirthGreaterThan {n : ℕ} (edges : Finset (Finset (Fin n))) (g : ℕ) : Prop := + ∀ j : ℕ, 2 ≤ j → j ≤ g → + ∀ S : Finset (Finset (Fin n)), S ⊆ edges → S.card = j → + j + 3 ≤ (S.biUnion id).card + ``` +- **Docstring quality:** The module docstring and theorem docstring both clearly explain the girth condition and the congruence condition. The explanation that `n ≡ 1, 3 (mod 6)` is the necessary and sufficient condition for STS existence is a helpful contextual note. +- The use of `S.biUnion id` to compute vertex span is idiomatic Lean/Mathlib and clear. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise and combinatorial: +- "Steiner triple system" has an unambiguous definition (3-uniform hypergraph where every pair is in exactly one edge). +- The girth condition ("any j edges span at least j + 3 vertices") is a concrete counting condition on finite sets. +- The congruence condition `n ≡ 1, 3 (mod 6)` is arithmetic. +- The "sufficiently large" quantifier is cleanly captured by `∃ N₀, ∀ n ≥ N₀`. + +There is no meaningful ambiguity in the statement. The only potential source of confusion (different definitions of "girth" for hypergraphs in the literature) is resolved by the explicit vertex-count formulation, which matches the definition used by Kwan–Sah–Sawhney–Simkin. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +1. **Steiner triple system definition (lines 40–42):** Both conditions — 3-uniformity (`e.card = 3`) and the unique-pair covering property — are correct and standard. In a STS, any two distinct edges share at most one vertex (this follows from the unique-pair property), which the formalization does not need to state explicitly since it's a consequence. + +2. **Congruence condition (line 60):** `n % 6 = 1 ∨ n % 6 = 3` is the correct necessary and sufficient condition for STS existence. This follows from two requirements: (a) each point appears in `(n-1)/2` triples, requiring `n` odd; (b) the total number of triples is `n(n-1)/6`, requiring `6 | n(n-1)`. Together these give `n ≡ 1` or `3 (mod 6)`. ✓ + +3. **Girth condition (lines 63–65):** The condition `j + 3 ≤ (S.biUnion id).card` for all j-element subsets S of edges (with `2 ≤ j ≤ g`) correctly formalizes "girth greater than g" per the definition in [KSSS22b]. Specifically: + - For `j = 2`: two distinct edges in a STS share at most 1 vertex, so they span at least 5 = 2 + 3 vertices. This is *automatically satisfied* for any STS, consistent with the condition being vacuous for `g = 2` in terms of added constraint. + - For `j = 3`: three edges forming a "triangle" (pairwise sharing distinct vertices) span exactly 6 = 3 + 3 vertices. The girth condition for `g ≥ 3` forbids this. + - For `j = 4`: the Pasch configuration (4 blocks on 6 points) has 6 < 4 + 3 = 7, so it is forbidden when `g ≥ 4`. ✓ + +4. **Quantifier structure:** `∀ g ≥ 2, ∃ N₀, ∀ n ≥ N₀, (congruence) → ∃ edges, ...` correctly captures "for any desired girth, sufficiently large admissible STS exist." ✓ + +5. **`biUnion id` usage:** Since `S : Finset (Finset (Fin n))`, `S.biUnion id` computes `⋃ e ∈ S, e`, the set of all vertices appearing in any edge of S. Its cardinality counts the number of distinct vertices spanned. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on erdosproblems.com and as proved in [KSSS22b]. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor opportunity | Could bridge to 722's `IsSteinerSystem`; girth could be extracted | +| Citations | Minor gap | Missing original `[Er76]` reference | +| Variants | Complete | No missing variants | +| Readability | Good | Inline girth condition could be named | +| Formalizability | Excellent | Unambiguous, fully precise | +| Correctness | Correct | No flaws found | diff --git a/ai-review/209.md b/ai-review/209.md new file mode 100644 index 0000000000..695d7e941d --- /dev/null +++ b/ai-review/209.md @@ -0,0 +1,169 @@ +# Review: Erdos Problem 209 + +**File:** `FormalConjectures/ErdosProblems/209.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `Point2` and `IsLine` definitions.** + +The file defines `Erdos209.Point2 := EuclideanSpace ℝ (Fin 2)` and `Erdos209.IsLine` via `Module.finrank ℝ L.direction = 1`. These same patterns appear verbatim or nearly so in several other files: + +| Definition | Also appears in | +|---|---| +| `Point2 := EuclideanSpace ℝ (Fin 2)` | Erdős 210, 211, 213, 216, 217 | +| `IsLine` via `Module.finrank ℝ L.direction = 1` | Erdős 101, 102, 669, 960, 1069 | + +**Specific reuse opportunities:** + +- **`IsLine`:** Problems 101, 102, 669, and 960 all independently define the same concept of a 1-dimensional affine subspace being a "line." This should be extracted to a shared utility. `FormalConjecturesForMathlib/Geometry/2d.lean` already provides some 2D geometry utilities (`NonTrilinear`, `ConvexIndep`, etc.) and would be a natural home. + +- **`IsOrdinaryLine` (from Problem 960):** Problem 960 defines `IsOrdinaryLine P L` for a *point set* P — a line containing exactly 2 points of P. Problem 209 defines `IsOrdinaryPoint A p` for a *line arrangement* A — a point where exactly 2 lines of A pass through it. These are duals of each other. While they are conceptually distinct, a shared utility file for line-arrangement incidence could house both. + +- **`pointMultiplicity`:** This is unique to Problem 209. No other file defines it, but Problem 669's `atLeastKPointLineCount` and `exactlyKPointLineCount` are the dual concept (counting points on a line rather than lines through a point). A shared incidence-counting framework would reduce duplication. + +- **`AreParallel`:** Unique to Problem 209. No other Erdős problem in the codebase uses it. This is appropriate as a local definition. + +**Recommendation:** Extract `Point2` and `IsLine` into a shared file (e.g., `FormalConjecturesForMathlib/Geometry/2d.lean`). The notation `ℝ^n` already exists in `FormalConjecturesForMathlib/Geometry/Euclidean.lean` but `Point2` as a named abbreviation is still useful for readability. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/209](https://www.erdosproblems.com/209):** + +The website lists four references: +- **[Er84]** — Erdős, P., *Some old and new problems on combinatorial geometry*, 1984. +- **[ErPu95b]** — Erdős, P. and Purdy, G. (1995). +- **[FuPa84]** — Füredi, Z. and Palásti, I. (1984). +- **[Es16]** — Escudero, J. G. (2016). + +Related problem: [960](https://www.erdosproblems.com/960). + +**Issues:** + +1. **No citation tags in the docstring.** The formalization mentions "Füredi–Palásti" and "Escudero" by name in prose but does not include bracketed citation tags (e.g., `[FuPa84]`, `[Es16]`). Other files in the codebase (e.g., Erdős 669, 960) use bracketed tags. The citations should be formalized as: + - `[Er84]` Erdős, P., *Some old and new problems on combinatorial geometry*, 1984. + - `[FuPa84]` Füredi, Z. and Palásti, I., *Arrangements of lines with a large number of triangles*, 1984. + - `[Es16]` Escudero, J. G., *On a conjecture of Grünbaum on line arrangements*, 2016. + +2. **Missing references.** The website lists `[ErPu95b]` (Erdős–Purdy), which is not mentioned in the formalization at all. This reference should be added. + +3. **Related problem 960 not mentioned.** The website flags Problem 960 as related. Since 960 is the natural generalization (finding r points with all pairwise lines ordinary), a cross-reference in the docstring would be valuable, especially since 960.lean exists in the codebase. + +--- + +## 3. Variants + +The formalization captures only the main disproved statement. Several variants are missing: + +1. **Stronger disproof (Escudero):** The formalization's `answer(False)` only asserts `¬(∀ d ≥ 4, ...)`, which existentially provides *some* d ≥ 4 with a counterexample. But Escudero's result is stronger: for *every* d ≥ 4, there exists a line arrangement without a Gallai triangle. This could be stated as: + ```lean + theorem erdos_209_strong : ∀ d : ℕ, d ≥ 4 → + ∃ A : Finset (AffineSubspace ℝ Point2), + A.card = d ∧ + (∀ L ∈ A, IsLine L) ∧ + (∀ L₁ ∈ A, ∀ L₂ ∈ A, L₁ ≠ L₂ → ¬AreParallel L₁ L₂) ∧ + (∀ p : Point2, pointMultiplicity A p ≤ 3) ∧ + ¬HasGallaiTriangle A + ``` + +2. **Füredi–Palásti partial result:** Their result specifically covers d not divisible by 9. This intermediate result could be captured: + ```lean + theorem erdos_209_furedi_palasti (d : ℕ) (hd : d ≥ 4) (h9 : ¬(9 ∣ d)) : ... + ``` + +3. **Dual (point) formulation:** The dual asks: given n points with no 4 collinear, must there exist 3 points all of whose connecting lines are ordinary? This is closely related to Problem 960 (with r = 3, k = 4) and could be stated as a variant. Note that the dual formulation naturally lives in the language of Problem 960's definitions. + +4. **Weakening the "no 4 lines" condition:** One could ask about what happens if the "no point with 4+ lines" condition is relaxed to "no point with 5+ lines," etc. This is a natural parametric generalization. + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good use of helper definitions:** `IsLine`, `AreParallel`, `pointMultiplicity`, `IsOrdinaryPoint`, and `HasGallaiTriangle` are each cleanly defined with descriptive docstrings. The decomposition makes the final theorem statement readable. + +- **`HasGallaiTriangle` is verbose but clear.** The definition explicitly names three lines and three intersection points with all required membership and distinctness conditions. This is necessarily verbose (9 membership conditions, 6 distinctness conditions, 3 ordinariness conditions). The current layout with clear grouping (lines, memberships, distinctnesses, ordinariness) is about as readable as it can be. + +- **Redundant coercions:** Several lines in `HasGallaiTriangle` have `(p₁₂ : Point2)` coercions that are unnecessary since `p₁₂` is already declared as `Point2`. These could be removed for cleanliness: + ```lean + p₁₂ ∈ L₁ ∧ p₁₂ ∈ L₂ ∧ -- instead of (p₁₂ : Point2) ∈ L₁ ∧ ... + ``` + +- **Minor:** The module docstring is minimal (just the reference link). Adding a brief prose description of the problem (as done in Problems 210, 669, 960) would improve discoverability. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem is fully precise: every term is well-defined (finite collection of lines, non-parallel, point multiplicity, ordinary point, Gallai triangle). The combinatorial geometry setting (lines in ℝ²) is completely formalized by Lean's `AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2))`. + +The only mild subtlety is the notion of "Gallai triangle" — one must be careful that "three lines forming a triangle" means three pairwise intersection points that are all distinct (forming a non-degenerate triangle). The formalization handles this correctly by requiring `p₁₂ ≠ p₂₃ ∧ p₂₃ ≠ p₁₃ ∧ p₁₂ ≠ p₁₃`. + +**Ambiguity level: None.** The problem is crisp and the disproof is decisive. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `IsLine` +```lean +noncomputable def IsLine (L : AffineSubspace ℝ Point2) : Prop := + Module.finrank ℝ L.direction = 1 +``` +Correct. A 1-dimensional affine subspace of ℝ² is precisely a line. This excludes the bottom element `⊥` (direction finrank 0), individual points (direction finrank 0), and the whole plane (direction finrank 2). + +### Definition: `AreParallel` +```lean +def AreParallel (L₁ L₂ : AffineSubspace ℝ Point2) : Prop := + L₁.direction = L₂.direction +``` +Correct for lines. Two lines in ℝ² are parallel iff they have the same direction subspace. Note: this makes every line parallel to itself (`AreParallel L L` is always true). The theorem's hypothesis `L₁ ≠ L₂ → ¬AreParallel L₁ L₂` then means no two *distinct* lines are parallel, which is the correct reading. Two distinct lines with the same direction are parallel and non-intersecting; the hypothesis excludes this. + +### Definition: `pointMultiplicity` +```lean +noncomputable def pointMultiplicity (A : Finset (AffineSubspace ℝ Point2)) (p : Point2) : ℕ := + (A.filter (fun L => (p : Point2) ∈ L)).card +``` +Correct. Counts the number of lines in A passing through p. The filter is over affine subspaces, and membership `p ∈ L` for `AffineSubspace` checks whether p belongs to the carrier set. + +### Definition: `IsOrdinaryPoint` +```lean +noncomputable def IsOrdinaryPoint (A : Finset (AffineSubspace ℝ Point2)) (p : Point2) : Prop := + pointMultiplicity A p = 2 +``` +Correct. An ordinary point in a line arrangement is one where exactly 2 lines meet. This is the standard definition. + +### Definition: `HasGallaiTriangle` +The definition requires: +- Three distinct lines L₁, L₂, L₃ in A +- Three pairwise intersection points p₁₂, p₂₃, p₁₃ that are all distinct +- Each pᵢⱼ lies on both Lᵢ and Lⱼ +- Each pᵢⱼ is an ordinary point of A + +This is mathematically correct. Under the hypothesis that no two distinct lines are parallel, any two of the three chosen lines must intersect at a unique point (since non-parallel lines in ℝ² intersect in exactly one point). The distinctness of the three intersection points ensures the triangle is non-degenerate. The definition does not explicitly assert that pᵢⱼ is *the* intersection point of Lᵢ and Lⱼ, but under the non-parallel hypothesis, it is the unique such point. + +### Theorem: `erdos_209` +```lean +theorem erdos_209 : answer(False) ↔ + ∀ d : ℕ, d ≥ 4 → + ∀ A : Finset (AffineSubspace ℝ Point2), + A.card = d → + (∀ L ∈ A, IsLine L) → + (∀ L₁ ∈ A, ∀ L₂ ∈ A, L₁ ≠ L₂ → ¬AreParallel L₁ L₂) → + (∀ p : Point2, pointMultiplicity A p ≤ 3) → + HasGallaiTriangle A +``` + +The `answer(False) ↔ RHS` pattern asserts `RHS ↔ False`, i.e., `¬RHS`. This means: it is NOT the case that every arrangement of d ≥ 4 non-parallel lines with no 4-fold point contains a Gallai triangle. This correctly captures the disproved status. + +**Subtle weakness (not an error):** As noted in Section 3, the negation `¬(∀ d ≥ 4, ...)` only guarantees the existence of *some* d ≥ 4 with a counterexample. Escudero's full result is that counterexamples exist for *all* d ≥ 4. The formalization is correct but captures a weaker statement than the full state of knowledge. This is attributable to the `answer(True/False)` idiom rather than a mathematical error — it's the natural formalization of the yes/no question "Must a Gallai triangle exist?", answered "No." + +**Verdict: Correct and complete** as a formalization of the original question and its resolution. The formalization would be strengthened by adding a variant capturing Escudero's universal result (counterexamples for all d ≥ 4). diff --git a/ai-review/21.md b/ai-review/21.md new file mode 100644 index 0000000000..3cd0dcea43 --- /dev/null +++ b/ai-review/21.md @@ -0,0 +1,155 @@ +# AI Review: Erdős Problem 21 + +**File:** `FormalConjectures/ErdosProblems/21.lean` + +--- + +## 1. Code Reuse + +**Opportunities exist but are minor.** + +The definition `IsIntersectingNFamily` bundles two properties — uniform cardinality and pairwise intersection — into a single predicate. The pairwise intersection component is independently defined in at least three other places in the codebase: + +| Location | Definition | Style | +|---|---|---| +| `ErdosProblems/701.lean:40` | `IsIntersectingFamily` | `(A ∩ B).Nonempty` over `Finset (Finset α)` | +| `ErdosProblems/836.lean:67` | `Hypergraph.IsIntersecting` | `(e₁ ∩ e₂).Nonempty` over `Hypergraph V` | +| `Paper/Chvatal.lean:37` | `Intersecting` | `A ∩ B ≠ ∅` over `Finset (Finset α)` | +| Mathlib `SetFamily/Intersecting.lean:44` | `Set.Intersecting` | `¬Disjoint` over abstract `SemilatticeInf` | + +Problem 701's `IsIntersectingFamily` is the closest match: it is generic in the element type and uses `.Nonempty`, identical to the intersection check in Problem 21. The current `IsIntersectingNFamily` could be decomposed into a uniformity predicate plus `IsIntersectingFamily` from 701, but since both definitions are namespaced and Problem 21 also requires the cardinality constraint, the bundling is a pragmatic choice and not a defect. The codebase does not have a shared utility for "intersecting family" — this is a broader consolidation opportunity across Problems 21, 701, 836, and the Chvátal formalization, but not specific to this problem. + +**Recommendation:** No immediate change needed. If a shared `SetFamily` utility module is ever created, `IsIntersectingNFamily` should decompose into reusable parts. + +## 2. Citations + +The docstring includes three references: [ErLo75], [Ka92b], and [Ka94]. Comparing against [erdosproblems.com/21](https://www.erdosproblems.com/21): + +| Reference | Website | Formalization | Status | +|---|---|---|---| +| Erdős & Lovász (1975) [ErLo75] | ✓ | ✓ | OK | +| Kahn (1992 preprint) [Ka92b] | ✓ | ✓ | OK | +| Kahn (1994) [Ka94] | ✓ | ✓ | OK | +| Tripathi (2014) — computed f(3)=6, f(4)=9 | ✓ | ✗ | Missing | +| Barát & Wanless (2021) — computed f(5)=13, bounds on f(6) | ✓ | ✗ | Missing | +| OEIS A391599 | ✓ | ✗ | Missing | +| Prize: $500 | ✓ | ✗ | Not mentioned | + +The existing citations are accurate and well-formatted. The [Ka92b] tag in the formalization matches the website's convention. + +**Recommendation:** Consider adding Tripathi (2014) and Barát & Wanless (2021) as additional references, since they contribute concrete values for f(n). The OEIS sequence A391599 could be noted in the module docstring. + +## 3. Variants + +**Several natural variants from the website are not captured.** + +The website documents: + +1. **Specific values:** f(1) = 1, f(2) = 3, f(3) = 6, f(4) = 9, f(5) = 13, and the bound 13 ≤ f(6) ≤ 18 (Barát & Wanless, 2021). +2. **Lower bound:** (8/3)n − 3 ≤ f(n), proved by Erdős & Lovász. This is mentioned in the docstring but not formalized. +3. **Conjectured exact asymptotics:** f(n) = 3n + O(1), a stronger conjecture than the O(n) bound. + +The lower bound (8/3)n − 3 ≤ f(n) is documented in the docstring at line 68 but not formalized as a separate theorem. Similarly, the stronger conjecture f(n) = 3n + O(1) is a natural companion statement. + +Possible variant formalizations: + +```lean +/-- The Erdős–Lovász lower bound: f(n) ≥ (8/3)n − 3. -/ +theorem erdos_21_lower_bound : + ∀ n : ℕ, 1 ≤ n → (8 / 3 : ℝ) * n - 3 ≤ (erdosLovaszF n : ℝ) := by + sorry + +/-- Conjectured exact asymptotics: f(n) = 3n + O(1). -/ +theorem erdos_21_exact_asymptotics : + ∃ C : ℝ, ∀ n : ℕ, 1 ≤ n → + |(erdosLovaszF n : ℝ) - 3 * n| ≤ C := by + sorry +``` + +**Recommendation:** At minimum, the lower bound should be formalized as it is a proved result (not a conjecture). The f(n) = 3n + O(1) conjecture would also be valuable as it represents the current frontier. + +## 4. Readability + +**The formalization is clean and well-structured.** + +- The module docstring (lines 19–37) is thorough: it states the problem, defines f(n) informally, gives historical context, and cites three references with full bibliographic details. +- Each helper definition (`IsIntersectingNFamily`, `CoversAllSmallSets`, `erdosLovaszF`) has a clear docstring explaining its mathematical meaning. +- The namespace `Erdos21` properly scopes all definitions. +- The names `IsIntersectingNFamily` and `CoversAllSmallSets` are descriptive and follow Lean naming conventions. + +**Minor observations:** +- `CoversAllSmallSets` is slightly misleading as a name — the property is that every small set is *disjoint from* at least one member, not "covered" in the usual sense. A name like `SmallSetsHaveDisjointWitness` or `EverySmallSetAvoidsSomeMember` might be more precise, but the docstring clarifies the meaning, so this is not a serious issue. +- The theorem docstring (lines 64–70) repeats the bounds from the module docstring. This is acceptable for self-containedness. + +## 5. Formalizability + +**Fully precise. No ambiguity.** + +The problem is completely unambiguous: +- "Intersecting family of n-element sets" has a unique mathematical meaning. +- "Every set of size ≤ n−1 is disjoint from at least one member" is precise. +- "f(n) = O(n)" is standard asymptotic notation with a unique interpretation. + +The only design choice in the formalization is fixing the ground set to ℕ. Since ℕ is countably infinite, any finite family of finite sets can be embedded into it, so this causes no loss of generality. The original problem does not specify a ground set (it is implicitly about abstract finite sets), and ℕ is the canonical choice in Lean for this purpose. + +**Edge case at n = 0:** Due to natural number subtraction, `n - 1 = 0` when `n = 0`, so `CoversAllSmallSets F 0` requires only that the empty set is disjoint from some member — vacuously easy. Meanwhile, `IsIntersectingNFamily F 0` requires all members to be empty sets with pairwise nonempty intersection, which is impossible for |F| ≥ 2 and vacuously true for |F| ≤ 1. For F = ∅, `CoversAllSmallSets` fails (no witness). For F = {∅}, `IsIntersectingNFamily` fails ((∅ ∩ ∅).Nonempty is false). So `erdosLovaszF 0 = sInf ∅ = 0`. This is harmless because the main theorem uses an eventual quantifier (∃ N, ∀ n ≥ N, ...). + +**Ambiguity assessment: None.** + +## 6. Correctness + +**The formalization is mathematically correct.** + +### Definition-level verification + +**`IsIntersectingNFamily` (line 45):** +```lean +def IsIntersectingNFamily (F : Finset (Finset ℕ)) (n : ℕ) : Prop := + (∀ A ∈ F, A.card = n) ∧ (∀ A ∈ F, ∀ B ∈ F, (A ∩ B).Nonempty) +``` +This correctly encodes: F is a family of n-element sets (uniformity) and any two members intersect (intersecting). Note that the intersection condition is not restricted to A ≠ B; since every n-element set (n ≥ 1) intersects itself, this is harmless and standard. + +**`CoversAllSmallSets` (line 52):** +```lean +def CoversAllSmallSets (F : Finset (Finset ℕ)) (n : ℕ) : Prop := + ∀ S : Finset ℕ, S.card ≤ n - 1 → ∃ A ∈ F, Disjoint S A +``` +This says: for every finite set S with |S| ≤ n − 1, there exists a member A of F disjoint from S. This faithfully captures the original condition. The quantification is over *all* finite subsets of ℕ of appropriate size, not just subsets of some fixed ground set, which is correct — the original problem statement quantifies over all (n−1)-element sets. + +**`erdosLovaszF` (line 59):** +```lean +noncomputable def erdosLovaszF (n : ℕ) : ℕ := + sInf {k : ℕ | ∃ F : Finset (Finset ℕ), + F.card = k ∧ IsIntersectingNFamily F n ∧ CoversAllSmallSets F n} +``` +This correctly defines f(n) as the infimum (minimum, since we work in ℕ and the set is nonempty for n ≥ 1) of family sizes satisfying both conditions. The use of `sInf` on `ℕ` is appropriate: for nonempty sets of natural numbers, `sInf` returns the minimum; for the empty set, it returns 0 by convention. + +### Theorem-level verification + +```lean +theorem erdos_21 : answer(True) ↔ + (∃ C : ℝ, 0 < C ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (erdosLovaszF n : ℝ) ≤ C * n) := by +``` + +- **`answer(True)`**: Correctly indicates this is a solved problem with affirmative answer. +- **O(n) formulation**: `∃ C > 0, ∃ N, ∀ n ≥ N, f(n) ≤ C·n` is the standard "eventually bounded by a linear function" definition. The C > 0 constraint is technically redundant (C = 0 would imply f(n) = 0 eventually, which is fine to exclude), but it is conventional and harmless. +- **AMS classification `[AMS 5]`**: Combinatorics — correct. +- **Category `research solved`**: Correct, as Kahn (1994) proved f(n) = O(n). + +### Potential concern: Well-definedness of `erdosLovaszF` + +For the theorem to be meaningful, we need that `erdosLovaszF n` actually equals the mathematical f(n) for large n. If the feasible set `{k | ∃ F, ...}` is nonempty (which it is for n ≥ 1, as demonstrated by the Erdős–Lovász upper bound constructions), then `sInf` returns the minimum, as desired. The `sInf ∅ = 0` convention for n = 0 does not affect the theorem. + +**No mathematical flaws identified.** The formalization is faithful to the original problem as stated on [erdosproblems.com/21](https://www.erdosproblems.com/21). + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunity — intersecting family defined independently in 3+ other files, but bundling is pragmatic here | +| Citations | **Incomplete** — missing Tripathi (2014), Barát & Wanless (2021), and OEIS A391599 | +| Variants | **Missing** — the proved lower bound (8/3)n − 3 and conjectured f(n) = 3n + O(1) are not formalized | +| Readability | Good; `CoversAllSmallSets` name is slightly misleading but docstring compensates | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete for the main conjecture; edge case at n=0 is harmless | diff --git a/ai-review/210.md b/ai-review/210.md new file mode 100644 index 0000000000..35136db9c0 --- /dev/null +++ b/ai-review/210.md @@ -0,0 +1,176 @@ +# Review: Erdos Problem 210 + +**File:** `FormalConjectures/ErdosProblems/210.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `Point2` and `LiesOnLine` definitions.** + +The file defines `Erdos210.Point2 := EuclideanSpace ℝ (Fin 2)` and `Erdos210.LiesOnLine` via parametric line membership. These same definitions appear verbatim in other files: + +| Definition | Also appears in | +|---|---| +| `Point2 := EuclideanSpace ℝ (Fin 2)` | Erdős 209, 211, 213, 216, 217 | +| `LiesOnLine p q r := ∃ t : ℝ, r - p = t • (q - p)` | Erdős 211 (identical) | + +**Specific reuse opportunities:** + +- **`Point2`:** Should be extracted to a shared utility. `FormalConjecturesForMathlib/Geometry/Euclidean.lean` already provides the notation `ℝ^n` and `FormalConjecturesForMathlib/Geometry/2d.lean` provides `ℝ^2`, but a named `Point2` abbreviation is still useful. + +- **`LiesOnLine`:** Erdős 211 defines an identical `LiesOnLine` and additionally defines `lineThrough` and `pointsOnLine` which build on it. These should be consolidated. Alternatively, Mathlib provides `Collinear k s` in `Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional`, which checks whether a set of points has `vectorSpan` of rank ≤ 1. Collinearity of three points `{p, q, r}` is equivalent to `LiesOnLine p q r` (when `p ≠ q`), so Mathlib's `Collinear` could replace the hand-rolled definition. + +- **`NotAllCollinear`:** This is a custom definition asserting the existence of three non-collinear points in S. Mathlib's `¬Collinear ℝ (↑S : Set Point2)` would capture the same property more concisely (a set of 3+ points is not collinear iff it has rank > 1, which implies three non-collinear points exist). However, the Finset vs Set coercion and the existential-witness form may justify keeping the explicit definition for clarity in the theorem statement. + +- **`IsOrdinaryPair` / `ordinaryLineCount`:** No other file in the codebase defines ordinary line counting for point sets. However, Erdős 960 defines `IsOrdinaryLine P L` (a line containing exactly 2 points of P), which is the same concept expressed via affine subspaces rather than ordered pairs. A unified definition could serve both problems. + +**Recommendation:** Extract `Point2` and `LiesOnLine` to `FormalConjecturesForMathlib/Geometry/2d.lean`. Consider whether Mathlib's `Collinear` could replace `LiesOnLine`-based definitions across Problems 210, 211, and others. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/210](https://www.erdosproblems.com/210):** + +The website lists the following references: +- **[Er61]** p.245 +- **[Er75f]** p.105 +- **[Er81]** +- **[Er83c]** +- **[Er84]** +- **[Er85]** + +And mentions the following key results: +- Sylvester (1893) / Gallai: f(n) ≥ 1 +- Motzkin (1951): f(n) → ∞ +- Kelly & Moser (1958): f(n) ≥ 3n/7 +- Csima & Sawyer (1993): f(n) ≥ 6n/13 +- Green & Tao (2013): f(n) ≥ n/2 for sufficiently large n + +**Issues:** + +1. **Missing Erdős citation tags.** The docstring mentions results by Motzkin, Kelly–Moser, Csima–Sawyer, and Green–Tao by name, but does not include any of the Erdős citation tags ([Er61], [Er75f], [Er81], [Er83c], [Er84], [Er85]) that appear on the website. + +2. **Missing full bibliographic entries.** The docstring references Green–Tao, Kelly–Moser, Csima–Sawyer, and Motzkin in prose but does not provide full citations. Following the pattern of other files in the codebase (e.g., Erdős 211), these should be given as bracketed references with full bibliographic data. For example: + - `[GrTa13]` Green, B. and Tao, T., *On sets defining few ordinary lines*, Discrete & Computational Geometry 50 (2013), 409–468. + - `[KeMo58]` Kelly, L. M. and Moser, W. O. J., *On the number of ordinary lines determined by n points*, Canadian Journal of Mathematics 10 (1958), 210–219. + - `[CsSa93]` Csima, J. and Sawyer, E. T., *There exist 6n/13 ordinary points*, Discrete & Computational Geometry 9 (1993), 187–202. + +3. **The Erdős–de Bruijn attribution is imprecise.** The docstring says the Green–Tao result resolves "the conjecture of Erdős and de Bruijn." The website attributes the question to Erdős alone (with Sylvester for the base case). The Erdős–de Bruijn theorem is a distinct result (about incidence geometry in more general settings). This attribution should be checked and likely corrected to "conjecture of Erdős" or "conjecture of Dirac" (Dirac conjectured f(n) ≥ n/2 in 1951). + +--- + +## 3. Variants + +The formalization captures only the strongest known result (Green–Tao). Several natural variants are missing: + +1. **The Sylvester–Gallai theorem (f(n) ≥ 1):** This foundational result asserts that any finite set of non-collinear points determines at least one ordinary line. It is a strictly weaker statement and could be formalized as: + ```lean + theorem sylvester_gallai : + ∀ (S : Finset Point2), S.card ≥ 3 → + NotAllCollinear S → + ordinaryLineCount S ≥ 1 + ``` + +2. **Motzkin's result (f(n) → ∞):** The original resolution of Erdős's question, stating merely that the count grows without bound: + ```lean + theorem erdos_210_motzkin : + ∀ K : ℕ, ∃ N₀ : ℕ, ∀ (S : Finset Point2), + S.card ≥ N₀ → NotAllCollinear S → ordinaryLineCount S ≥ K + ``` + +3. **The Kelly–Moser bound (f(n) ≥ 3n/7):** + ```lean + theorem erdos_210_kelly_moser : + ∀ (S : Finset Point2), S.card ≥ 3 → + NotAllCollinear S → ordinaryLineCount S ≥ 3 * S.card / 7 + ``` + +4. **Green–Tao's stronger bound for odd n:** For sufficiently large odd n, f(n) ≥ 3⌊n/4⌋. This is mentioned on the website but not captured in the formalization. + +5. **Exact determination for small n:** Kelly and Moser showed their bound is tight for n = 7. Specific exact values of f(n) for small n could be stated. + +--- + +## 4. Readability + +The code is well-structured. Specific observations: + +- **Good decomposition:** The helper definitions `LiesOnLine`, `NotAllCollinear`, `IsOrdinaryPair`, and `ordinaryLineCount` each have clear docstrings and build naturally toward the theorem. + +- **The `ordinaryLineCount` definition is slightly subtle.** It counts ordered pairs and divides by 2. The docstring explains this, which is good. However, this relies on the fact that `IsOrdinaryPair S p q ↔ IsOrdinaryPair S q p` (i.e., ordinary pairs always come in matched pairs), so the division by 2 is exact. This invariant is not documented and could trip up a reader. A brief comment noting this symmetry would help. + +- **`open Classical` is appropriate** since the definitions involve decidability of `LiesOnLine` (an existential over ℝ), which requires classical logic for the `Finset.filter`. + +- **The theorem statement is clean and readable.** The quantifier structure (∃ N₀, ∀ S, ...) clearly communicates "for sufficiently large n." + +--- + +## 5. Formalizability + +**Assessment: Clearly formalizable with one subtlety.** + +The problem asks about the minimum number of ordinary lines for *any* configuration of n non-collinear points. This is a well-defined optimization problem over finite geometric configurations in ℝ². All terms (ordinary line, non-collinear, etc.) have precise mathematical meanings. + +**Subtlety:** The function f(n) itself is not explicitly defined in the formalization — the theorem directly states a lower bound. Defining f(n) explicitly as a minimum would require: +```lean +noncomputable def f (n : ℕ) : ℕ := + ⨅ S : {S : Finset Point2 // S.card = n ∧ NotAllCollinear S}, ordinaryLineCount S.1 +``` +This is more complex and the current approach of stating the bound directly is cleaner and avoids issues with the infimum being vacuous for n < 3. + +**Ambiguity level: Very low.** The problem is precisely stated. The only mild ambiguity is "for sufficiently large n" — the formalization handles this correctly with `∃ N₀`. + +--- + +## 6. Correctness + +**The formalization is mathematically correct but captures a slightly weaker statement than the full Green–Tao result.** Detailed analysis: + +### Definition: `LiesOnLine` +```lean +def LiesOnLine (p q r : Point2) : Prop := + ∃ t : ℝ, r - p = t • (q - p) +``` +Correct. When p ≠ q, this characterizes exactly the points on the affine line through p and q. Note: when p = q, we get `r - p = t • 0 = 0`, so `LiesOnLine p p r` iff `r = p`. This edge case does not affect the formalization since `IsOrdinaryPair` requires `p ≠ q`. + +### Definition: `NotAllCollinear` +```lean +def NotAllCollinear (S : Finset Point2) : Prop := + ∃ p ∈ S, ∃ q ∈ S, ∃ r ∈ S, p ≠ q ∧ p ≠ r ∧ q ≠ r ∧ ¬LiesOnLine p q r +``` +Correct. This says there exist three distinct points in S not all on one line. This is equivalent to the standard mathematical notion of "not all collinear" for sets of size ≥ 3. For |S| ≤ 2, this is vacuously false (cannot find three distinct points), which is the correct behavior: a set of ≤ 2 points is considered collinear. + +### Definition: `IsOrdinaryPair` +```lean +def IsOrdinaryPair (S : Finset Point2) (p q : Point2) : Prop := + p ∈ S ∧ q ∈ S ∧ p ≠ q ∧ ∀ r ∈ S, r ≠ p → r ≠ q → ¬LiesOnLine p q r +``` +Correct. This says p and q are distinct points in S, and no other point of S lies on the line through them. This is exactly the definition of the pair {p, q} determining an ordinary line. + +### Definition: `ordinaryLineCount` +```lean +noncomputable def ordinaryLineCount (S : Finset Point2) : ℕ := + ((S ×ˢ S).filter (fun pq => IsOrdinaryPair S pq.1 pq.2)).card / 2 +``` +**Correct, but relies on an implicit invariant.** Each ordinary line {p, q} contributes exactly two ordered pairs (p, q) and (q, p) to the filtered set, because `IsOrdinaryPair S p q ↔ IsOrdinaryPair S q p` (the conditions are symmetric: `LiesOnLine p q r ↔ LiesOnLine q p r` since both characterize the same affine line when p ≠ q). So the count of ordered pairs is always even, and dividing by 2 gives the exact count of ordinary lines. This is mathematically sound. + +**Technical note:** The `LiesOnLine` symmetry `LiesOnLine p q r ↔ LiesOnLine q p r` holds because if `r - p = t • (q - p)`, then `r - q = (t - 1) • (q - p) = (1 - t) • (p - q)`, so `r - q = (1 - t) • (p - q)`. This confirms the division by 2 is exact. + +### Theorem: `erdos_210` +```lean +theorem erdos_210 : + ∃ N₀ : ℕ, ∀ (S : Finset Point2), + S.card ≥ N₀ → + NotAllCollinear S → + ordinaryLineCount S ≥ S.card / 2 +``` + +**Mathematically correct.** This states: there exists a threshold N₀ such that any set of at least N₀ non-collinear points in ℝ² has at least ⌊n/2⌋ ordinary lines. This matches the Green–Tao theorem. + +**Minor precision issue with integer division:** `S.card / 2` uses natural number division (floor). The Green–Tao result states f(n) ≥ n/2, which for even n means exactly n/2 and for odd n means at least ⌈n/2⌉ = (n+1)/2. The formalization uses `S.card / 2 = ⌊n/2⌋`, which for odd n gives the weaker bound (n-1)/2 instead of n/2. So for odd n, the formalization is slightly weaker than the actual theorem. In fact, Green–Tao prove a stronger bound for odd n: f(n) ≥ 3⌊n/4⌋, which is strictly greater than ⌊n/2⌋ for n ≥ 5. The current formalization is still correct (it's a valid lower bound), but it undersells the result for odd n. + +**The `≥ N₀` threshold is appropriate.** Green–Tao prove the bound holds for "sufficiently large" n, and the existential `∃ N₀` correctly captures this. The actual threshold is not specified in their paper (it comes from quantitative bounds in their proof). + +**Verdict: Correct and essentially complete** as a formalization of the main result. The formalization accurately captures the Green–Tao theorem for even n. For odd n, it gives a valid but slightly weaker bound than what Green–Tao actually proved. No incorrectness is present — the statement is a true theorem — but it does not capture the full strength of the known results. diff --git a/ai-review/211.md b/ai-review/211.md new file mode 100644 index 0000000000..c0a3e195e9 --- /dev/null +++ b/ai-review/211.md @@ -0,0 +1,181 @@ +# Review: Erdős Problem 211 + +**File:** `FormalConjectures/ErdosProblems/211.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `Point2` and `LiesOnLine` definitions.** + +The file defines `Erdos211.Point2 := EuclideanSpace ℝ (Fin 2)` and `Erdos211.LiesOnLine` via parametric line membership. These same definitions appear verbatim in other files: + +| Definition | Also appears in | +|---|---| +| `Point2 := EuclideanSpace ℝ (Fin 2)` | Erdős 209, 210, 213, 216, 217 | +| `LiesOnLine p q r := ∃ t : ℝ, r - p = t • (q - p)` | Erdős 210 (identical) | + +**Specific reuse opportunities:** + +- **`Point2`:** Should be extracted to a shared utility. `FormalConjecturesForMathlib/Geometry/2d.lean` already provides the notation `ℝ²` for `EuclideanSpace ℝ (Fin 2)`, but the named abbreviation `Point2` is independently redefined in many files. + +- **`LiesOnLine` / `lineThrough`:** Erdős 210 defines an identical `LiesOnLine`. Several other problems (960, 606, 588, 669) instead use Mathlib's `AffineSubspace` and `affineSpan ℝ {p, q}` to define lines, which is the more idiomatic Mathlib approach. Problem 960 defines `lineThrough` via `affineSpan ℝ {p, q}`, which is more robust and integrates better with Mathlib's `Collinear` predicate. + +- **`lineCount`:** Problem 606 defines `numLinesDetermined` using `AffineSubspace` and `Set.ncard`, which counts the same thing — the number of distinct lines determined by point pairs. Problem 588 defines `kRichLineCount` for lines with at least k points using `AffineSubspace`. Either of these approaches would be more idiomatic than Problem 211's `Finset.image`-based `lineCount`. + +- **`pointsOnLine`:** Problem 588's `kRichLineCount` counts points on a line via `Set.ncard {p | p ∈ P ∧ p ∈ L}`. Problem 211's `pointsOnLine` counts via `Finset.filter`, which is essentially equivalent but less aligned with the codebase patterns. + +**Recommendation:** Replace the `LiesOnLine`/`lineThrough`/`lineCount`/`pointsOnLine` definitions with `AffineSubspace`-based versions following the pattern of Problems 606, 588, and 960. This would eliminate code duplication and improve integration with Mathlib. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/211](https://www.erdosproblems.com/211):** + +The website lists the following references: +- **[Er75f]** p.105 +- **[Er81]** +- **[Er83c]** +- **[Er84]** +- **[Be83]** Beck (solver) +- **[SzTr83]** Szemerédi & Trotter (solvers) +- **[BGS74]** Burr, Grünbaum & Sloane +- **[FuPa84]** Füredi & Palásti + +**Issues:** + +1. **Missing Erdős citation tags.** The docstring includes [Be83] and [SzTr83] but omits the Erdős references [Er75f], [Er81], [Er83c], [Er84] that appear on the website. + +2. **Missing additional references.** The references [BGS74] (Burr, Grünbaum & Sloane, 1974) and [FuPa84] (Füredi & Palásti, 1984) from the website are not mentioned in the docstring. + +3. **Full bibliographic entries are present for the solvers.** The docstring does include full citations for [Be83] and [SzTr83], which is good and matches the website. + +4. **Missing sharpened conjecture.** The website notes that Erdős conjectured the bound might be sharpened to ≥ (1 + o(1))kn/6 lines, acknowledging this "perhaps is too optimistic." This is not mentioned in the docstring and could be relevant as a variant. + +--- + +## 3. Variants + +The formalization captures only the main result. Several natural variants are missing: + +1. **The special case k = n (no collinearity constraint):** The problem statement in the docstring highlights the particular case: given 2n points with at most n on a line, there are ≫ n² lines. This corresponds to setting k = n in a set of 2n points. This could be stated as a corollary: + ```lean + theorem erdos_211_special : + ∃ C : ℝ, C > 0 ∧ + ∀ (S : Finset Point2) (n : ℕ), + S.card = 2 * n → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ n) → + (lineCount S : ℝ) ≥ C * ↑n ^ 2 + ``` + +2. **Erdős's sharpened conjecture:** The constant could potentially be taken as (1 + o(1))/6: + ```lean + theorem erdos_211_sharp : + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ (S : Finset Point2) (k : ℕ), + S.card ≥ N₀ → 1 ≤ k → k < S.card → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k) → + (lineCount S : ℝ) ≥ (1/6 - ε) * ↑k * ↑S.card + ``` + Note: Erdős himself described this as possibly "too optimistic," so it would be appropriate to tag this as open/conjectural. + +3. **The Szemerédi–Trotter incidence theorem itself:** The Szemerédi–Trotter theorem (the number of incidences between n points and m lines in ℝ² is O(n^{2/3}m^{2/3} + n + m)) is the main tool used to prove Problem 211. It is a more fundamental result and could be formalized separately, with Problem 211 derived as a consequence. + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good decomposition:** The helper definitions `LiesOnLine`, `lineThrough`, `pointsOnLine`, and `lineCount` build naturally toward the theorem statement. + +- **`lineCount` uses `Finset.image`, which is clean.** The definition filters pairs (p, q) with p ≠ q from the product S ×ˢ S, maps them to `lineThrough p q` (as a `Set Point2`), and counts distinct images. This is correct but there is a subtle issue: it relies on the decidability of equality on `Set Point2`, which requires `Classical` (correctly opened at line 39). + +- **The `pointsOnLine` definition takes two explicit points** rather than a line object. This is fine for the theorem statement but means the collinearity constraint `∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k` quantifies over ordered pairs, which is slightly redundant (the same line is checked via both (p, q) and (q, p)). This does not affect correctness. + +- **The theorem statement is clear and readable.** The structure `∃ C > 0, ∀ S k, ... → (lineCount S : ℝ) ≥ C * k * n` directly mirrors the mathematical statement "≫ kn lines." + +- **Minor:** The docstring is well-written and clearly explains the result. The LaTeX rendering in the module docstring is accurate. + +--- + +## 5. Formalizability + +**Assessment: Clearly formalizable. Ambiguity level: Very low.** + +The problem asks for a linear lower bound on the number of 2-rich lines determined by a planar point set with a bounded maximum collinearity. All terms — "points in ℝ²," "at most n − k on any line," "lines containing at least two points" — have unambiguous mathematical meanings. + +The asymptotic notation "≫ kn" in the original problem is the only potential source of ambiguity. It means "≥ Ckn for some absolute constant C > 0." The formalization correctly captures this with `∃ C : ℝ, C > 0 ∧ ...`, making the implicit constant explicit. + +**One subtlety:** The original problem says "at most n − k on any line," meaning any line in the plane, not just lines determined by points of S. The formalization instead states `∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k`, which checks only lines determined by pairs of points in S. These are equivalent: if no line through two points of S contains more than n − k points of S, then no line at all contains more than n − k points of S (any line containing fewer than 2 points of S trivially satisfies the bound). So the formalization is correct in this regard. + +--- + +## 6. Correctness + +**The formalization is mathematically correct and complete.** Detailed analysis: + +### Definition: `LiesOnLine` +```lean +def LiesOnLine (p q r : Point2) : Prop := + ∃ t : ℝ, r - p = t • (q - p) +``` +Correct. When p ≠ q, this characterizes exactly the points on the affine line through p and q. When p = q, `LiesOnLine p p r` iff `r = p` (since t • 0 = 0 forces r = p). This edge case does not affect the theorem since the collinearity hypothesis requires p ≠ q. + +### Definition: `lineThrough` +```lean +def lineThrough (p q : Point2) : Set Point2 := + {r | LiesOnLine p q r} +``` +Correct. This is the set of all points on the affine line through p and q (when p ≠ q). When p = q, `lineThrough p p = {p}`, a singleton — this is mathematically degenerate but harmless since `lineCount` only considers pairs with p ≠ q. + +**Important observation:** `lineThrough` returns a `Set Point2`, not an `AffineSubspace`. Two distinct pairs (p₁, q₁) and (p₂, q₂) determining the same geometric line will produce the same set (since `lineThrough` is defined extensionally as a set). So `Finset.image` on these sets correctly identifies lines — equal sets are not double-counted. This is a crucial correctness property. + +**Proof of this property:** If (p₁, q₁) and (p₂, q₂) determine the same line, then p₂ and q₂ lie on the line through p₁ and q₁, and vice versa. Since the set of points satisfying `LiesOnLine p q r` is the same for any two distinct points p, q on the same line, we get `lineThrough p₁ q₁ = lineThrough p₂ q₂` as sets. Conversely, if the sets are equal, the lines coincide. So extensional equality of `Set Point2` correctly captures line identity. + +### Definition: `pointsOnLine` +```lean +noncomputable def pointsOnLine (S : Finset Point2) (p q : Point2) : ℕ := + (S.filter (fun r => LiesOnLine p q r)).card +``` +Correct. Counts the number of points in S lying on the line through p and q. Note that p and q themselves, if in S, are counted (since `LiesOnLine p q p` always holds via t = 0, and `LiesOnLine p q q` always holds via t = 1). + +### Definition: `lineCount` +```lean +noncomputable def lineCount (S : Finset Point2) : ℕ := + (((S ×ˢ S).filter (fun pq => pq.1 ≠ pq.2)).image + (fun pq => lineThrough pq.1 pq.2)).card +``` +Correct. This counts the number of distinct sets `lineThrough p q` for distinct pairs (p, q) from S. As argued above, two pairs determine the same set iff they determine the same geometric line, so this correctly counts distinct lines containing at least two points of S. + +### Theorem: `erdos_211` +```lean +theorem erdos_211 : + ∃ C : ℝ, C > 0 ∧ + ∀ (S : Finset Point2) (k : ℕ), + 1 ≤ k → + k < S.card → + (∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k) → + (lineCount S : ℝ) ≥ C * ↑k * ↑S.card +``` + +**Analysis of the hypotheses:** + +1. **`1 ≤ k`:** Matches the problem statement's "1 ≤ k." + +2. **`k < S.card`:** Matches "k < n." Combined with the collinearity bound, this ensures the configuration is non-degenerate. + +3. **`∀ p ∈ S, ∀ q ∈ S, p ≠ q → pointsOnLine S p q ≤ S.card - k`:** This says every line determined by two points of S contains at most n − k points of S. As discussed in Section 5, this is equivalent to "at most n − k points of S lie on any line," since lines containing 0 or 1 points of S trivially satisfy the bound. + +4. **Note on natural number subtraction:** `S.card - k` uses natural number subtraction. Since `k < S.card`, we have `S.card - k > 0`, so this is well-behaved. If k ≥ S.card, then `S.card - k = 0`, and the hypothesis `pointsOnLine S p q ≤ 0` would be unsatisfiable (since p and q are both on the line, giving count ≥ 2). This is consistent — the hypothesis `k < S.card` ensures the bound is satisfiable. + +**Analysis of the conclusion:** + +`(lineCount S : ℝ) ≥ C * ↑k * ↑S.card` states that the number of distinct lines is at least C · k · n. This correctly formalizes the asymptotic "≫ kn." + +**Potential concern — does `k` need to be a natural number?** The original problem states "1 ≤ k < n" without specifying k is an integer, but since k appears only in the collinearity bound "at most n − k on any line," and point counts are integers, restricting k to ℕ is without loss of generality. (If k were a positive real, one would replace it with ⌈k⌉, and the bound C · k · n ≤ C · ⌈k⌉ · n still holds.) + +**Verdict: Correct and complete.** The formalization accurately captures the Beck/Szemerédi–Trotter theorem as stated in the Erdős problem. The definitions are mathematically sound, the hypotheses match the problem conditions, and the conclusion correctly formalizes the asymptotic lower bound. There are no mathematical flaws. + +The only weakness is stylistic: the use of `Set Point2` for line identity (rather than `AffineSubspace`) is non-standard within the codebase but does not affect correctness. diff --git a/ai-review/214.md b/ai-review/214.md new file mode 100644 index 0000000000..8bbefa4152 --- /dev/null +++ b/ai-review/214.md @@ -0,0 +1,128 @@ +# Review: Erdos Problem 214 + +**File:** `FormalConjectures/ErdosProblems/214.lean` + +--- + +## 1. Code Reuse + +**No significant reuse opportunities.** + +The `IsUnitSquare` definition is specific to this problem. The `FormalConjecturesForMathlib/Geometry/2d.lean` file provides `ℝ²` notation, convex polygon infrastructure (`IsCcwConvexPolygon`, `IsConvexPolygon`), and `distinctDistances`, but none of these are directly applicable to defining a unit square via side and diagonal lengths. + +The `FormalConjecturesForMathlib/Geometry/Euclidean.lean` file provides the `ℝ^n` notation but the formalization already uses the fully spelled-out `EuclideanSpace ℝ (Fin 2)`, which is consistent with other Erdős distance problems (e.g., Problems 93–98, 130, 232). + +The pattern of defining geometric configurations with pairwise distinctness + distance constraints follows the same style as `Concyclic` in Problem 130. No shared abstraction is warranted. + +**One minor observation:** The six pairwise-distinctness conditions in `IsUnitSquare` are entirely redundant — they follow from the distance conditions (if `dist a b = 1` then `a ≠ b`; if `dist a c = Real.sqrt 2` then `a ≠ c`; etc.). Removing them would be a minor simplification but is not urgent since explicitness aids clarity. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/214](https://www.erdosproblems.com/214):** + +The website lists: +- **Status:** Solved. +- **Tags:** Geometry, Distances. +- **References:** [Er83c] (Erdős, 1983) and [Ju79] (Juhász, 1979). + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Juhász 1979 | `[Ju79]` — cited as "Juhász, R., _Ramsey type theorems in the plane_, 1979." | Yes | **Incomplete.** The website and standard bibliographic practice would include the publication venue. The full citation is: Juhász, R., "Ramsey type theorems in the plane," _Journal of Combinatorial Theory, Series A_ **27** (1979), no. 2, 152–160. The formalization only gives author, title, and year. | +| Erdős 1983 | Not cited | Yes (`[Er83c]`) | **Missing.** The website lists `[Er83c]` as a reference for this problem. This is likely the original source where Erdős posed the question. It should be added to the docstring. | + +**Recommendation:** Add the `[Er83c]` citation and flesh out the `[Ju79]` citation with journal information. + +--- + +## 3. Variants + +The formalization captures only the unit-square case. The website and docstring both reference Juhász's more general result: + +**Missing variants that could be formalized:** + +1. **General four-point configuration (Juhász's full theorem):** If $S \subset \mathbb{R}^2$ avoids unit distances, then for *any* set of four points $P$, the complement $S^c$ contains a congruent copy of $P$. This is the actual theorem Juhász proved and is strictly stronger: + ``` + theorem erdos_214_general : + ∀ (S : Set (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1) → + ∀ (P : Fin 4 → EuclideanSpace ℝ (Fin 2)), + ∃ (f : EuclideanSpace ℝ (Fin 2) →ᵢ EuclideanSpace ℝ (Fin 2)), + ∀ i, f (P i) ∈ Sᶜ + ``` + +2. **Five-point configuration (open):** Does Juhász's result extend to any five-point configuration? The website mentions this remains open. This could be formalized as an open problem using `answer(sorry)`. + +3. **Failure for large configurations:** The result does *not* extend to arbitrarily large point sets. This negative result could be formalized if a specific counterexample size is known. + +The unit-square special case is a natural and clean statement, but formalizing Juhász's full four-point theorem would be more faithful to the resolved result. + +--- + +## 4. Readability + +The code is short, clean, and well-structured. Specific observations: + +- **`IsUnitSquare` definition:** Clear and self-documenting. The docstring accurately describes the cyclic labeling convention. The use of explicit side and diagonal distances makes the definition immediately verifiable. +- **Namespace:** `Erdos214` is appropriate and avoids clashes. +- **Docstrings:** Both the module-level and theorem-level docstrings are well-written. The module docstring correctly states the problem as a question, while the theorem docstring states it as the resolved affirmative answer. +- **Minor:** Could use the `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean` for brevity, but the fully explicit `EuclideanSpace ℝ (Fin 2)` is consistent with other Erdős problems and avoids an additional import. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The resolved statement is fully precise: "If $S \subset \mathbb{R}^2$ contains no two points at unit distance, then $S^c$ contains four points forming a unit square." Every term in this statement has a standard mathematical meaning with no room for misinterpretation: + +- "No two points at distance 1 apart" — standard metric condition. +- "Unit square" — a square with side length 1. The formalization correctly characterizes this via four unit side lengths and two $\sqrt{2}$ diagonal lengths. +- "Complement" — set complement. + +**Ambiguity level: None.** The only design choice is how to define "unit square" (via coordinates, isometries, or distance constraints), and the chosen distance-constraint approach is natural and unambiguous. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `IsUnitSquare` + +```lean +def IsUnitSquare (a b c d : EuclideanSpace ℝ (Fin 2)) : Prop := + a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d ∧ + dist a b = 1 ∧ dist b c = 1 ∧ dist c d = 1 ∧ dist d a = 1 ∧ + dist a c = Real.sqrt 2 ∧ dist b d = Real.sqrt 2 +``` + +- **Side lengths:** `dist a b = 1 ∧ dist b c = 1 ∧ dist c d = 1 ∧ dist d a = 1` — all four sides of the cyclic quadrilateral $a \to b \to c \to d$ have unit length. This makes it a rhombus. +- **Diagonal lengths:** `dist a c = Real.sqrt 2 ∧ dist b d = Real.sqrt 2` — both diagonals equal $\sqrt{2}$. Combined with unit sides, this forces right angles at every vertex (by the Pythagorean theorem: $1^2 + 1^2 = (\sqrt{2})^2$). A rhombus with right angles is a square. +- **Distinctness:** The six pairwise-distinctness conditions are logically redundant (all implied by positive distances), but harmless. +- **Correctness verdict:** The definition correctly characterizes a unit square in $\mathbb{R}^2$ up to labeling order. Any four points satisfying these constraints form a unit square with $a, b, c, d$ as consecutive vertices. + +### Theorem: `erdos_214` + +```lean +theorem erdos_214 : + ∀ (S : Set (EuclideanSpace ℝ (Fin 2))), + (∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1) → + ∃ a b c d : EuclideanSpace ℝ (Fin 2), + a ∈ Sᶜ ∧ b ∈ Sᶜ ∧ c ∈ Sᶜ ∧ d ∈ Sᶜ ∧ + IsUnitSquare a b c d +``` + +- **Hypothesis:** `∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1` — $S$ is an independent set in the unit distance graph on $\mathbb{R}^2$. Note this does not require $p \neq q$, but `dist p p = 0 ≠ 1` holds trivially, so this is equivalent to requiring the condition only for distinct pairs. Correct. +- **Conclusion:** Four points in $S^c$ forming a unit square. The existential witnesses are independent (not required to be distinct by the binder, but `IsUnitSquare` enforces distinctness). Correct. +- **Edge cases:** Taking $S = \emptyset$ gives $S^c = \mathbb{R}^2$, which trivially contains a unit square. Taking $S = \mathbb{R}^2 \setminus \{$four points forming a square$\}$ would violate the hypothesis (it would contain pairs at distance 1 from the complement of the square). The theorem handles all cases correctly. +- **Mathematical faithfulness:** The theorem exactly captures the affirmative resolution of Erdős Problem 214 as stated on the website. The `@[category research solved, AMS 52]` tag is correct (AMS 52 = Convex and discrete geometry). + +### Potential concern: hypothesis strength + +The hypothesis `∀ p ∈ S, ∀ q ∈ S, dist p q ≠ 1` does not require $p \neq q$. A slightly more standard formulation in Erdős-style distance problems would be `∀ p ∈ S, ∀ q ∈ S, p ≠ q → dist p q ≠ 1`, but as noted above, the two are equivalent since `dist p p = 0 ≠ 1`. The chosen formulation is actually cleaner. No issue. + +**Verdict: Correct and complete.** The formalization faithfully captures the resolved form of Erdős Problem 214. The only deficiency is that it formalizes only the special case (unit square) rather than Juhász's general four-point theorem, but this matches the problem as originally posed by Erdős. diff --git a/ai-review/215.md b/ai-review/215.md new file mode 100644 index 0000000000..a1d089b38c --- /dev/null +++ b/ai-review/215.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 215 + +## 1. Code Reuse + +**`IntLattice` definition (line 38):** Problem 215 defines its own `IntLattice` locally. No shared integer lattice definition exists in `FormalConjecturesForMathlib/`. Other problems that touch lattice concepts (e.g., Problems 528, 529 with `LatticeAdj`) also define them locally with different representations (`Fin k → ℤ` rather than a subset of `EuclideanSpace ℝ (Fin 2)`). There is no opportunity to reuse an existing definition here. + +**Isometry usage (line 53):** The formalization uses `Isometry f` from Mathlib, which is the standard approach. However, Problem 668 (line 53–57) defines `AreCongruent` using the weaker but equivalent condition `∀ x y, dist (f x) (f y) = dist x y` instead of `Isometry f`. Problem 215's use of `Isometry f` is arguably cleaner since Mathlib's `Isometry` already encodes distance-preservation and continuity. + +**Notation:** `FormalConjecturesForMathlib/Geometry/2d.lean` defines `ℝ²` as notation for `EuclideanSpace ℝ (Fin 2)`. Problem 215 writes out `EuclideanSpace ℝ (Fin 2)` in full. Using the `ℝ²` notation would improve readability marginally, but would require importing the notation file. + +**Verdict:** No significant reuse opportunities. The local `IntLattice` definition is simple enough to not warrant extraction. + +## 2. Citations + +The website ([erdosproblems.com/215](https://www.erdosproblems.com/215)) lists the following references: + +- **[Er83c]** — Erdős (1983), the original source of the problem. +- **[JaMa02]** — Jackson, S. and Mauldin, R.D., *On a lattice problem of H. Steinhaus*, Journal of the American Mathematical Society 15 (2002), 817–856. + +The formalization's docstring (lines 28–29) includes the Jackson–Mauldin reference with correct bibliographic detail. However, the **[Er83c] reference is missing** from the docstring. The website also attributes the problem as "an old question of Steinhaus," which the formalization does capture by calling it the "Steinhaus Problem" in the theorem docstring (line 42). + +**Recommendation:** Add the [Er83c] Erdős 1983 reference to the docstring for completeness. + +## 3. Variants + +The website describes a single problem with no listed variants. The formalization captures the full problem as stated: existence of a set S ⊆ ℝ² such that every congruent copy of S contains exactly one integer lattice point. No variants are missing. + +One could consider the natural generalization to ℤ^n for arbitrary dimension n, but this is not mentioned on the website and would be beyond scope. + +## 4. Readability + +The code is quite readable. A few observations: + +- **Good:** The `IntLattice` definition is clearly documented with a docstring. +- **Good:** The theorem statement is well-structured and easy to parse. +- **Minor:** The type `EuclideanSpace ℝ (Fin 2)` appears four times in the theorem statement. Using the `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean` or a local abbreviation would reduce visual clutter. That said, avoiding the import keeps the file self-contained. +- **Good:** The `answer(True)` on the LHS clearly signals the known answer. + +Overall readability is good; no changes strictly necessary. + +## 5. Formalizability + +The problem as stated on the website is: + +> Does there exist a set S ⊆ ℝ² such that every set congruent to S contains exactly one point of ℤ²? + +This is **precisely formalizable** with no essential ambiguity. The key concepts — subsets of ℝ², congruence (image under isometry), integer lattice, "exactly one" — all have standard mathematical definitions that translate directly to Lean. + +The only subtlety is what "congruent" means: it should include all isometries of ℝ² (compositions of translations, rotations, and reflections). Using Mathlib's `Isometry` captures this correctly, since isometries of Euclidean space are exactly the rigid motions (orthogonal transformations plus translations). + +**Assessment: No ambiguity.** The statement is fully precise and the formalization faithfully captures it. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**The statement (lines 50–54):** +```lean +∃ (S : Set (EuclideanSpace ℝ (Fin 2))), + ∀ (f : EuclideanSpace ℝ (Fin 2) → EuclideanSpace ℝ (Fin 2)), + Isometry f → + ∃! p, p ∈ f '' S ∧ p ∈ IntLattice +``` + +This says: there exists a set S such that for every isometry f, the image f(S) contains exactly one integer lattice point. This is precisely the Steinhaus problem. + +**Potential concern — `Isometry` vs. surjective isometry:** Mathlib's `Isometry f` requires `dist (f x) (f y) = dist x y` for all x, y, but does NOT require surjectivity. In finite-dimensional Euclidean space ℝ², every isometry is automatically an affine isometry and hence surjective (by the Mazur–Ulam theorem and finite-dimensionality). So restricting to `Isometry` (without requiring surjectivity) is correct here — it captures all rigid motions, and in ℝ² there are no non-surjective isometries anyway. + +**`IntLattice` definition (line 38–39):** +```lean +{p | ∀ i : Fin 2, ∃ n : ℤ, p i = ↑n} +``` +This correctly defines ℤ² as the set of points in `EuclideanSpace ℝ (Fin 2)` whose coordinates are all integers. + +**`answer(True)` (line 50):** The problem is solved affirmatively by Jackson–Mauldin (2002), so `answer(True)` is correct. + +**`∃!` usage:** The `∃! p, p ∈ f '' S ∧ p ∈ IntLattice` correctly expresses "exactly one point in the intersection of f(S) and ℤ²." + +**Verdict: Correct and complete.** No mathematical flaws identified. The formalization faithfully and accurately represents Erdős Problem 215. diff --git a/ai-review/216.md b/ai-review/216.md new file mode 100644 index 0000000000..f2cdb93eae --- /dev/null +++ b/ai-review/216.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 216 + +## 1. Code Reuse + +There is significant duplication of geometric definitions across the codebase. Problem 216 locally defines `Point`, `InGeneralPosition`, `InConvexPosition`, and `HasEmptyConvexKGon` within the `Erdos216` namespace. Several of these have near-identical counterparts elsewhere: + +- **`FormalConjecturesForMathlib/Geometry/2d.lean`** already provides: + - `NonTrilinear` (line 54) — equivalent to `InGeneralPosition` but uses `Collinear ℝ` and `Set.Triplewise` rather than explicit triple quantification over `affineSpan`. + - `ConvexIndep` (line 60) — equivalent to `InConvexPosition` but operates on `Set ℝ²` using `S \ {a}` rather than `Finset` with `S.erase p`. + - `HasConvexNGon` (line 65) — provides convex n-gon containment (without the "empty" condition). + +- **Problem 838** (`ErdosProblems/838.lean`, lines 40–49) redefines both `InGeneralPosition` and `InConvexPosition` with virtually identical implementations to Problem 216. Problem 838's `InGeneralPosition` is arguably cleaner: it quantifies over 3-element subsets using `Collinear` rather than the more verbose triple-quantifier + `affineSpan` approach. + +- **Problem 107** (`ErdosProblems/107.lean`) uses the shared `NonTrilinear` and `HasConvexNGon` from `2d.lean` rather than redefining locally. + +**Recommendation:** Factor out the shared definitions. `InGeneralPosition` and `InConvexPosition` on `Finset Point` could be defined once in `FormalConjecturesForMathlib/Geometry/2d.lean` (bridging the existing `Set`-based `NonTrilinear`/`ConvexIndep` to `Finset` versions). The `HasEmptyConvexKGon` definition is unique to this problem and should remain local, but it could build on shared `InConvexPosition`. + +## 2. Citations + +The formalization includes the following references: Ha78, Ho83, Ni07, Ge08, HeSc24. These are all properly documented with full bibliographic details matching the website. + +**Missing from the formalization:** The [erdosproblems.com/216](https://www.erdosproblems.com/216) page also lists several Erdős source references: **Er78c, Er81, Er82e, Er83c, Er97e**. None of these appear in the Lean file's docstring. While they are shorthand references to Erdős's own papers where he posed or discussed the problem, they should be included for completeness. + +**Additionally:** The website notes this is a variant of the "happy ending problem" ([Problem #107](https://www.erdosproblems.com/107)), which asks the same question without the empty interior restriction. This relationship is not mentioned in the formalization's docstring. + +## 3. Variants + +The formalization captures only the single universal statement: "does g(k) exist for all k ≥ 3?" Several natural variants are missing: + +- **Individual known values:** g(3) = 3 (trivial), g(4) = 5 (Erdős), g(5) = 10 (Harborth [Ha78]), g(6) = 30 (Heule–Scheucher [HeSc24]). These are mentioned in the docstring but not formalized as separate theorems. +- **Existence of g(6):** Independently proved by Nicolás [Ni07] and Gerken [Ge08]. Could be a separate `@[category research solved]` theorem. +- **Non-existence for k ≥ 7:** Horton's construction [Ho83] shows g(k) does not exist for k ≥ 7. This is the key negative result and deserves its own formalization, e.g.: + ```lean + theorem horton : ∀ k, 7 ≤ k → ∀ N, ∃ S : Finset Point, + InGeneralPosition S ∧ N ≤ S.card ∧ ¬HasEmptyConvexKGon S k + ``` +- **Relationship to Problem 107:** The non-empty version (happy ending problem) could be cross-referenced. + +Problem 107 provides a good model: it includes the main conjecture, bounds variants (Erdős–Szekeres, Suk, HMPT), and test cases (f(0), f(3)). Problem 216 would benefit from a similar structure. + +## 4. Readability + +The code is generally well-written and readable: + +- The `Point` abbreviation is a nice touch for conciseness. +- Docstrings are clear and mathematically precise. +- The `HasEmptyConvexKGon` definition clearly separates its two conditions (convex position + empty interior). + +**Minor suggestions:** +- The `InGeneralPosition` definition could be simplified by using `Collinear` (as in Problem 838) rather than `affineSpan`. The current formulation requires the reader to understand that `affineSpan ℝ {p₁, p₂}` is the line through p₁ and p₂, whereas `¬Collinear ℝ {p₁, p₂, p₃}` is more immediately readable. +- The docstring comment "Known results" section is excellent and well-organized. + +## 5. Formalizability + +**Assessment: Fully formalizable with high precision.** + +The problem as stated on erdosproblems.com is: + +> Does g(k) exist for all k ≥ 3, where g(k) is the smallest N such that any set of N points in general position in ℝ² contains an empty convex k-gon? + +This is completely precise. The key concepts — "general position" (no three collinear), "convex k-gon" (k points in convex position), and "empty" (no other points in the interior of the convex hull) — all have standard, unambiguous mathematical definitions. + +**Ambiguity level: None.** This is a clean combinatorial geometry problem with universally agreed-upon definitions. There is no ambiguity in the statement. + +## 6. Correctness + +**The main theorem is correctly formalized.** The answer `False` is correct: the universal statement "g(k) exists for all k ≥ 3" is false because Horton [Ho83] showed g(k) does not exist for k ≥ 7. + +**Detailed analysis of definitions:** + +- **`InGeneralPosition`**: Correctly captures "no three collinear." The affine span of two distinct points is the line through them, so `p₃ ∉ affineSpan ℝ {p₁, p₂}` correctly means p₃ is not on the line through p₁ and p₂. The symmetry is handled by quantifying over all orderings (p₁, p₂, p₃ are universally quantified with distinctness conditions). ✓ + +- **`InConvexPosition`**: Correctly captures "no point lies in the convex hull of the remaining points," which is the standard definition of convex-independent position for finite point sets. ✓ + +- **`HasEmptyConvexKGon`**: The "empty" condition uses `interior (convexHull ℝ ↑T)`. This is the correct formalization. Under general position, no point of S can lie on the boundary of convexHull T without being a vertex (since boundary points on an edge would be collinear with two vertices, violating general position). Thus the `interior` check is equivalent to checking that no non-vertex point lies in the convex hull at all. ✓ + +- **Main theorem statement**: The formalization asks whether for all k ≥ 3, there exists N such that any sufficiently large point set in general position contains an empty convex k-gon. The condition `N ≤ S.card` (rather than `S.card = N`) correctly captures "any set of *at least* N points." The answer `False` correctly reflects that this universal claim fails (for k ≥ 7). ✓ + +**One subtle note:** The formalization uses `N ≤ S.card` which means "for any set of at least N points." This is slightly different from the standard formulation "any set of exactly N points" (i.e., `S.card = N`), but the two are equivalent for the purpose of defining g(k) as a threshold — if every set of exactly N points has the property, then every set of ≥ N points does too (by taking subsets... actually this direction requires care). In fact, the `N ≤ S.card` formulation is the more natural and correct one for threshold problems, since adding more points to a set in general position preserves the property of containing an empty convex k-gon (any subset of size N is still in general position). ✓ + +**Overall assessment:** The formalization is mathematically correct and complete for the main statement. Its primary limitation is the lack of variant theorems capturing the rich known results (exact values of g(k) for small k, Horton's construction for k ≥ 7). diff --git a/ai-review/217.md b/ai-review/217.md new file mode 100644 index 0000000000..b9f0dd2975 --- /dev/null +++ b/ai-review/217.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 217 + +## 1. Code Reuse + +**Collinearity:** Problem 217 defines a custom `Collinear3` using the cross-product formula (line 40–41) and wraps it with `NoThreeCollinear` (line 44–45). Mathlib provides a canonical `Collinear ℝ` definition (in `Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional`), and many other Erdős problems in this codebase already use it: + +- Problem 98 (`98.lean:34–36`): `NoThreeCollinear` via Mathlib `Collinear` on 3-element subsets +- Problem 101 (`101.lean:34–36`): `NoFiveCollinear` via Mathlib `Collinear` +- Problem 130 (`130.lean:52–60`): `ErdosGeneralPosition` via Mathlib `Collinear` +- Problem 588 (`588.lean:34–36`): `NoKPlusOneCollinear` via Mathlib `Collinear` +- Problem 735 (`735.lean:63–66`): `NoThreeCollinear` via Mathlib `Collinear` +- Problem 960 (`960.lean:38–40`): `NoKCollinear` via Mathlib `Collinear` + +The custom `Collinear3` is mathematically equivalent to Mathlib's `Collinear` for three points in ℝ², but using Mathlib's version would improve consistency and eliminate a bespoke definition. Problem 98's `NoThreeCollinear` is directly reusable. + +**Concyclicity:** Problem 217 defines `Concyclic4` (line 48–50) without requiring `r > 0`. Other problems in the codebase (98, 130, 831) include the `r > 0` constraint. While this difference is inconsequential for distinct points (see §6), adopting a shared definition would improve consistency. Problem 98's `FourPointsConcyclic` and `NoFourConcyclic` (lines 43–52) could be reused directly. + +**Distance utilities:** The `HasDistanceMultiplicityProperty` is highly specific to this problem and cannot be replaced by generic distance-counting utilities. This is appropriate. + +**Recommendation:** Replace `Collinear3`/`NoThreeCollinear` with Mathlib's `Collinear` (matching the pattern in Problem 98), and consider reusing Problem 98's concyclicity definitions. Alternatively, shared definitions could be factored into a utility file. + +## 2. Citations + +The website lists: +- **[Er83c]** +- **[Er87b, p.167]** +- **[Er97e]** + +The formalization's docstring (line 33) has `[Er83c] [Er87b] [Er97e]`, and the theorem docstring (line 71) has `[Er83c, Er87b, Er97e]`. The page number **p.167** for [Er87b] is missing from both locations. This should be corrected to `[Er87b, p.167]`. + +## 3. Variants + +The formalization captures the main conjecture: for sufficiently large $n$, no such configuration exists. However, two aspects from the website are not captured: + +1. **Known positive results:** Palásti proved such configurations exist for all $n \leq 8$. This could be formalized as a separate theorem asserting existence for small $n$, which would complement the main conjecture. + +2. **Connection to Problem 98:** The website states that the conjecture "would follow if $h(n) \geq n$ for sufficiently large $n$" where $h(n)$ is the function from Problem 98. This logical implication could be stated as a separate theorem linking the two problems: if $h(n)/n \to \infty$ (Problem 98), then Problem 217 holds. This connection is mathematically substantive — any configuration satisfying the distance multiplicity property determines exactly $n - 1$ distinct distances from $\binom{n}{2}$ pairs, which means $h(n) \leq n - 1$, so $h(n) \geq n$ would yield a contradiction. + +3. **The "for which $n$" framing:** The original problem asks "for which $n$" do such configurations exist, which is broader than just the conjecture that they don't exist for large $n$. The formalization only captures one direction. + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The docstring for `HasDistanceMultiplicityProperty` (lines 58–62) explains the `2(j+1)` convention for ordered pairs, which is helpful. However, the variable name `d` for the distance function is terse; `dist_vals` or `distances` would be more descriptive. +- The module docstring (lines 19–34) is well-written and provides good mathematical context. +- The `NoFourConcyclic` definition quantifies over all ordered 4-tuples with 6 distinctness conditions (line 54–56). Using the subset-based approach from Problem 98 (quantifying over 4-element subsets) would be cleaner and more concise. + +## 5. Formalizability + +The problem is **moderately formalizable** with some inherent ambiguity: + +- **"The $i$-th distance occurs $i$ times"**: The formalization interprets this as: there exist $n-1$ distinct distances that can be labeled $d_1, d_2, \ldots, d_{n-1}$ such that $d_i$ occurs exactly $i$ times as an unordered pair. This is a natural and standard reading. +- **Counting convention**: The formalization uses ordered pairs via `offDiag` and compensates with a factor of 2, which is correct since `dist` is symmetric. +- **"Sufficiently large $n$"**: Formalized as $\exists N_0, \forall n \geq N_0$, which is standard. +- The problem statement is precise enough that the formalization is essentially forced — there is minimal ambiguity in how to interpret it. + +**Assessment:** Low ambiguity. The formalization choices are natural. + +## 6. Correctness + +The formalization is **mathematically correct** with one minor observation: + +**`Concyclic4` without `r > 0`:** The definition (line 48–50) allows `r = 0`, which would require all four points to coincide at the center `c`. Since `NoFourConcyclic` (line 53–56) requires all four points to be pairwise distinct, `r = 0` is impossible in context. Thus the omission of `r > 0` is **harmless** — the definitions are equivalent under the distinctness hypotheses. Nevertheless, adding `r > 0` (as in Problems 98, 130, 831) would make the standalone `Concyclic4` definition more mathematically natural and prevent potential misuse outside this context. + +**`HasDistanceMultiplicityProperty` verification:** +- `Fin (S.card - 1)` gives indices $0, 1, \ldots, n-2$ (0-indexed). +- For index $i$, the required count is $2(i+1)$ ordered pairs = $i+1$ unordered pairs. +- Total unordered pairs: $\sum_{i=0}^{n-2} (i+1) = 1 + 2 + \cdots + (n-1) = \binom{n}{2}$. ✓ +- Number of distinct distances: $n - 1$ (the cardinality of `Fin (S.card - 1)`). ✓ +- The injectivity of `d` ensures all $n-1$ distances are distinct. ✓ +- The coverage condition (line 66) ensures every pair has its distance among the $d_i$. ✓ + +These are all consistent with the problem statement. The formalization correctly captures the conjecture. + +**`Collinear3` correctness:** The cross-product formula $(q_0 - p_0)(r_1 - p_1) = (q_1 - p_1)(r_0 - p_0)$ correctly characterizes collinearity of three points in ℝ². This is equivalent to requiring the vectors $q - p$ and $r - p$ are linearly dependent, i.e., the $2 \times 2$ determinant vanishes. ✓ + +**Main theorem structure:** `erdos_217` asserts $\exists N_0$ such that for all sufficiently large point sets with no three collinear and no four concyclic, the distance multiplicity property fails. This correctly formalizes Erdős's conjecture. ✓ + +**Overall assessment:** The formalization is correct and complete for the main conjecture. The primary improvement opportunities are (a) using Mathlib's `Collinear` for consistency with the rest of the codebase, (b) adding the `p.167` page reference, and (c) optionally formalizing the connection to Problem 98 and the known positive results for $n \leq 8$. diff --git a/ai-review/22.md b/ai-review/22.md new file mode 100644 index 0000000000..9e28744256 --- /dev/null +++ b/ai-review/22.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 22 + +## 1. Code Reuse + +**Significant reuse opportunity with Problem 615.** + +Problem 615 (`FormalConjectures/ErdosProblems/615.lean`) formalizes a closely related Ramsey–Turán problem (it is listed as a related problem on erdosproblems.com/22). It defines: + +- `Erdos615.IsIndependentSet` (line 62): a local independent set predicate on `Finset V`. +- `Erdos615.ramseyTuranNumber` (line 68): the Ramsey–Turán number rt(n; k, ℓ). + +Problem 22 could be restated directly in terms of `ramseyTuranNumber`: +the conjecture is equivalent to `∀ ε > 0, ∃ N, ∀ n ≥ N, (n² / 8 : ℝ) ≤ ramseyTuranNumber n 4 ⌈ε * n⌉`. + +Additionally, Problem 615 uses `G.CliqueFree 4` (Mathlib's `SimpleGraph.CliqueFree`) for K₄-freeness, whereas Problem 22 manually inlines the definition as `∀ s : Finset (Fin n), ¬G.IsNClique 4 s`. These are definitionally equivalent (since `CliqueFree n` is defined as `∀ t, ¬G.IsNClique n t`), but using `CliqueFree` would improve consistency across the codebase and readability. + +Problem 615 also uses `G.edgeFinset.card` for edge counting, while Problem 22 uses `G.edgeSet.ncard`. For `SimpleGraph (Fin n)` (a finite type), both give the same result, but `edgeFinset.card` is more idiomatic and consistent with Problem 615 and other files in the codebase. + +**Recommendation:** Replace the inlined K₄-free condition with `G.CliqueFree 4`, consider using `edgeFinset.card` for consistency, and optionally restate in terms of `ramseyTuranNumber`. + +## 2. Citations + +The formalization includes: +- **[BoEr76]** Bollobás, B. and Erdős, P. — ✅ Present and correct. +- **[FLZ15]** Fox, J., Loh, P.-S., and Zhao, Y. — ✅ Present and correct. + +**Missing from the formalization but present on erdosproblems.com/22:** +- **[Er90]** Erdős, P. (1990) — referenced on the website as a source for the problem. Should be added. +- The website credits **Mehtaab Sawhney** (presumably for contributing the problem entry). This is minor and need not be included. +- The website notes **Problem 615** as a related problem. A cross-reference in the docstring would be helpful (e.g., "See also Erdős Problem 615"). + +## 3. Variants + +The formalization captures the **main conjecture** (existence of K₄-free graph on n vertices with ≥ n²/8 edges and independence number ≤ εn for sufficiently large n). This is the precise question asked by Bollobás and Erdős. + +**Missing variants / related results that could be formalized:** + +1. **The Bollobás–Erdős (1/8 + o(1)) result [BoEr76]:** They proved the existence of such graphs with (1/8 + o(1))n² edges (i.e., the weaker asymptotic version). This is the predecessor result. Note that Problem 615 already contains the EHSS upper bound variant (`erdos_615.variants.EHSS`), which is the complementary direction. + +2. **The quantitative Fox–Loh–Zhao bound:** The docstring mentions that [FLZ15] achieved independence number ≪ (log log n)^{3/2} / (log n)^{1/2} · n, which is much stronger than merely εn. This quantitative strengthening could be stated as a separate variant. + +3. **The Ramsey–Turán reformulation:** The docstring mentions the equivalent formulation rt(n; 4, εn) ≥ n²/8, but this is not formalized as a separate statement. Since `ramseyTuranNumber` already exists in Problem 615, an equivalent restatement using it would be natural. + +## 4. Readability + +The formalization is generally clear. Suggestions: + +- **Use `G.CliqueFree 4`** instead of `∀ s : Finset (Fin n), ¬G.IsNClique 4 s`. This is a standard Mathlib definition that directly communicates "K₄-free" and reduces visual complexity. +- **Use `edgeFinset.card`** instead of `edgeSet.ncard` for consistency with the rest of the Erdős problem formalizations (e.g., Problem 615). +- The docstring is well-written and includes the problem statement, historical context, and references. It could benefit from a cross-reference to Problem 615. + +With `CliqueFree`, the theorem statement would become: +```lean +theorem erdos_22 : answer(True) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + ∃ G : SimpleGraph (Fin n), + (n : ℝ) ^ 2 / 8 ≤ (G.edgeFinset.card : ℝ) ∧ + G.CliqueFree 4 ∧ + (∀ s : Finset (Fin n), G.IsIndepSet ↑s → (s.card : ℝ) ≤ ε * (n : ℝ)) +``` + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is entirely precise: it involves standard combinatorial objects (graphs, cliques, independent sets, edge counts) with no ambiguity. The quantities n²/8, K₄, and εn are all exact. The "sufficiently large n" quantifier is standard and correctly rendered as `∃ N, ∀ n ≥ N`. + +There is no ambiguity whatsoever in the mathematical content. This is one of the more straightforwardly formalizable Erdős problems. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Edge count:** `(n : ℝ) ^ 2 / 8 ≤ (G.edgeSet.ncard : ℝ)` correctly says the graph has ≥ n²/8 edges. Since `Fin n` is finite, `edgeSet` is finite and `ncard` returns the true cardinality (not the junk value 0). ✅ +- **K₄-freeness:** `∀ s : Finset (Fin n), ¬G.IsNClique 4 s` says no 4-element clique exists. `IsNClique 4 s` requires both `G.IsClique s` (pairwise adjacent) and `#s = 4`. This correctly captures K₄-freeness. ✅ +- **Independence number bound:** `∀ s : Finset (Fin n), G.IsIndepSet ↑s → (s.card : ℝ) ≤ ε * (n : ℝ)` says every independent set has at most εn vertices. Since `Fin n` is finite, every subset is representable as a `Finset`, so quantifying over `Finset (Fin n)` captures all independent sets. `IsIndepSet` (defined as `s.Pairwise (fun v w ↦ ¬G.Adj v w)`) is the standard definition. ✅ +- **Quantifier structure:** `∀ ε > 0, ∃ N, ∀ n ≥ N, ∃ G, ...` correctly captures "for every ε > 0 and sufficiently large n, there exists such a graph." ✅ +- **Answer polarity:** `answer(True)` is correct — the conjecture was proved affirmatively by Fox, Loh, and Zhao. ✅ + +**Minor observation:** The condition `(s.card : ℝ) ≤ ε * (n : ℝ)` uses `≤` (at most εn). For n = 0, the graph on 0 vertices trivially satisfies all conditions (no edges needed, no cliques, no non-empty independent sets), but n = 0 is excluded by taking N ≥ 1 in the existential. No issue here. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on erdosproblems.com. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Could use `CliqueFree 4` (Mathlib), `edgeFinset.card`, and `ramseyTuranNumber` from Problem 615 | +| Citations | Missing [Er90]; should cross-reference Problem 615 | +| Variants | Main conjecture captured; quantitative FLZ bound and RT-number reformulation could be added | +| Readability | Good; would benefit from `CliqueFree` and `edgeFinset.card` | +| Formalizability | Fully unambiguous, straightforwardly formalizable | +| Correctness | Mathematically correct and complete — no flaws found | diff --git a/ai-review/220.md b/ai-review/220.md new file mode 100644 index 0000000000..50efa32a05 --- /dev/null +++ b/ai-review/220.md @@ -0,0 +1,70 @@ +# Review: Erdős Problem 220 + +## 1. Code Reuse + +No reusable code from `FormalConjecturesForMathlib` or elsewhere in the repository applies to this problem. The definitions `sumSquaredGaps` and `sortedTotatives` are number-theoretic and specific to this problem. The codebase has extensive graph coloring, Ramsey theory, and combinatorial infrastructure, but nothing relevant to totient gap sums. The definitions are appropriately self-contained. + +## 2. Citations + +The formalization's docstring lists: + +> [Er40, Er55c, Er57, Er61, Er65b, Er73, Er79, ErGr80, Er81k, Er85c] + +and the module docstring references: + +> [MoVa86] Montgomery, H.L. and Vaughan, R.C., _On the distribution of reduced residues_, 1986. + +This matches the erdosproblems.com page, which lists the same Erdős references and attributes the solution to Montgomery–Vaughan [MoVa86]. The website additionally mentions: +- A **$500 prize** was offered. +- The problem appears as **B40** in Guy's collection [Gu04]. +- Related OEIS sequence: **A322144**. + +These supplementary details are not essential but could optionally be noted in the docstring. The core citations are correct and complete. + +## 3. Variants + +The docstring mentions the Montgomery–Vaughan generalization: for any γ ≥ 1, + +$$\sum_{1 \le k < \varphi(n)} (a_{k+1} - a_k)^\gamma \ll n^\gamma / \varphi(n)^{\gamma-1}.$$ + +This generalization (which Erdős himself also posed in [Er73]) is **documented but not formalized**. Given that the generalization subsumes the γ = 2 case and was the actual result proved by Montgomery–Vaughan, it would be natural to formalize it as a separate theorem (e.g., `erdos_220_general`). This is a minor gap — the core problem (γ = 2) is captured. + +## 4. Readability + +The code is clean and well-structured: +- `sumSquaredGaps` has a clear recursive definition with descriptive naming. +- `sortedTotatives` is a direct translation of the mathematical definition. +- The docstring provides both the specific conjecture and the generalized result. +- The namespace `Erdos220` avoids name collisions. + +No readability improvements needed. + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. The original statement involves the Vinogradov asymptotic notation f ≪ g, which the formalization correctly renders as an explicit existential constant: ∃ C > 0, ∀ n ≥ 1, LHS ≤ C · n² / φ(n). This is the standard way to formalize asymptotic bounds and introduces no ambiguity. There is no wiggle room in the mathematical meaning. + +**Assessment: No ambiguity.** + +## 6. Correctness + +### 6.1 Overall structure + +The theorem states `answer(True) ↔ ∃ C ...`, encoding that the answer to the yes/no question is "yes" iff the bound holds. Since the problem is solved (Montgomery–Vaughan proved it), the `answer(True)` is correct. + +### 6.2 `sortedTotatives` correctness + +The definition filters `Finset.range n` (i.e., {0, 1, ..., n−1}) by `0 < m ∧ Nat.Coprime m n`, then sorts. This correctly produces {1 ≤ m < n : gcd(m, n) = 1} in increasing order, matching the problem's set A. + +**Edge case at n = 1:** `sortedTotatives 1 = []` (the empty list), since `range 1 = {0}` and 0 fails the `0 < m` test. Meanwhile, `Nat.totient 1 = 1` in Mathlib (because Mathlib counts 0 as coprime to 1 via `gcd(1, 0) = 1`). So the list length (0) does not equal `Nat.totient 1` (1). However, this does **not** affect the theorem's correctness: when n = 1, the LHS is `sumSquaredGaps [] = 0` and the RHS is `C · 1 / 1 = C > 0`, so the inequality holds trivially. + +### 6.3 `sumSquaredGaps` correctness + +The recursive definition correctly computes $\sum_{k} (a_{k+1} - a_k)^2$ for consecutive elements. Natural number subtraction is used, but since the list is sorted in increasing order, `b - a ≥ 0` always holds and there is no underflow issue. + +### 6.4 The bound + +The RHS is `C * (n : ℝ)^2 / (Nat.totient n : ℝ)`. This matches the problem's $O(n^2 / \varphi(n))$. Note that in Lean's real number division, if `Nat.totient n = 0` then the RHS would be 0 (since x / 0 = 0 in Lean's reals), which could make the inequality false. However, for all n ≥ 1, `Nat.totient n ≥ 1`, so this is never an issue. + +### 6.5 Verdict + +**The formalization is mathematically correct and complete for the stated problem (γ = 2 case).** No flaws identified. The only observation is that the generalized result (arbitrary γ ≥ 1) mentioned in the docstring is not itself formalized, but this is a matter of scope rather than correctness. diff --git a/ai-review/221.md b/ai-review/221.md new file mode 100644 index 0000000000..0844027b13 --- /dev/null +++ b/ai-review/221.md @@ -0,0 +1,98 @@ +# Erdős Problem 221 — Review + +## 1. Code Reuse + +The formalization inlines the density bound as: +``` +((Finset.Icc 1 N).filter (fun n => n ∈ A)).card ≤ C * ↑N / Real.log ↑N +``` + +The codebase has a well-developed density infrastructure in `FormalConjecturesForMathlib/Data/Set/Density.lean`, including `HasDensity`, `lowerDensity`, `upperDensity`, and `HasLogDensity`. However, none of these directly express the condition `|A ∩ {1,…,N}| = O(N / log N)`, which is an asymptotic *upper bound* on the counting function, not a density convergence statement. A set with counting function `O(N / log N)` has natural density 0, but the converse is not true — so `HasDensity 0` would be strictly weaker than what is stated here. The inline formulation is therefore appropriate. + +That said, the project could benefit from a reusable `IsBigO`-style counting function bound, similar to how `HasDensity` captures ratio convergence. Other problems (e.g., Erdős 1072 with `o(x/log x)` estimates) use similar inline patterns. A shared utility for "counting function is `O(f(N))`" would reduce duplication, but this is a broader project-level improvement, not specific to this file. + +**Verdict:** No direct reuse opportunity; the inline approach is justified. + +## 2. Citations + +The formalization's docstring says: +> The answer is yes, proved by Ruzsa (1972). + +The [erdosproblems.com/221](https://www.erdosproblems.com/221) page documents significantly more: + +- **Original references:** Er57, Er61, Er65b, Er73, Er77c, Er82e +- **Lorentz (1954):** Proved a weaker result with `|A ∩ {1,…,N}| ≪ N·(log log N)/(log N)` +- **Ruzsa (1972):** Proved the full result (answer is yes). Explicit construction: `A = { 5^n · m : m ≥ 1 and 5^n ≥ C·log m } + {0,1}` for small constant `C > 0`. Uses the fact that 2 is a primitive root of `5^n` for all `n ≥ 1`. +- **Ruzsa (2001):** Constructed an "exact additive complement" with `|A ∩ {1,…,N}| ~ N / log₂ N`, which is asymptotically best possible. +- **Wouter van Doorn** confirmed that `C = (5 log 2)⁻¹` works. + +**Recommendation:** The docstring should include the Lorentz prior result and the Ruzsa (2001) optimal result, with proper citation formatting. Credit to Wouter van Doorn could also be included. + +## 3. Variants + +The formalization captures only the basic existence question. The website suggests at least two natural variants that are not captured: + +1. **Lorentz's weaker bound (1954):** Existence of `A` with `|A ∩ {1,…,N}| ≪ N·(log log N)/(log N)` such that every large integer is `2^k + a`. This is a weaker (and historically prior) result. + +2. **Ruzsa's optimal complement (2001):** There exists `A` with `|A ∩ {1,…,N}| ~ N / log₂ N` as `N → ∞` (asymptotic equality, not just upper bound). This is best possible since the number of powers of 2 up to `N` is `~log₂ N`, so a complement must have density at least `~N / log₂ N`. + +3. **Optimality / lower bound:** Any such set `A` must satisfy `|A ∩ {1,…,N}| ≥ (1 - o(1)) · N / log₂ N`. This is the converse direction showing Ruzsa's 2001 result is tight. + +**Recommendation:** At minimum, adding the Ruzsa 2001 optimal result as a variant would be valuable, as it represents a strengthening of the solved problem. + +## 4. Readability + +The formalization is compact and reasonably readable. A few suggestions: + +- **Helper definition for the counting function:** Extracting the counting condition into a named predicate (e.g., `CountingBound A C N₀`) would improve readability and make it easier to state variants. +- **The nested existential structure** `∃ C, C > 0 ∧ ∃ N₀, ∀ N, N₀ ≤ N → ...` is a standard "big-O with threshold" pattern. It reads fine but is somewhat dense. This is a minor stylistic point. +- **Representation condition** `∃ k : ℕ, ∃ a ∈ A, n = 2 ^ k + a` is clear and well-structured. + +Overall readability is good for a single-theorem file. + +## 5. Formalizability + +The problem statement is precise and unambiguous: + +- "Is there a set `A ⊆ ℕ`" — clear existential over `Set ℕ`. +- "`|A ∩ {1,…,N}| ≪ N / log N`" — the asymptotic notation `≪` (Vinogradov notation) means `O(·)`, i.e., there exists `C > 0` such that the bound holds for all sufficiently large `N`. This is precisely what the formalization captures. +- "Every sufficiently large integer can be written as `2^k + a`" — clear with the `∃ M` threshold. + +The only minor ambiguity is whether "integer" means all integers or natural numbers. Since `A ⊆ ℕ` and `2^k + a ≥ 1` for `a ∈ ℕ`, the problem is inherently about positive integers. The formalization using `ℕ` is correct. + +**Assessment: Fully formalizable with no meaningful ambiguity.** + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +- **Density bound (line 45-46):** `∃ (C : ℝ), C > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ C * ↑N / Real.log ↑N` + - Correctly captures `|A ∩ {1,…,N}| = O(N / log N)`. + - `Finset.Icc 1 N` gives `{1, 2, ..., N}` as required. + - The cast to `ℝ` is necessary for comparing with `C * N / log N`. + - Edge cases: For small `N` where `Real.log N ≤ 0`, the bound `C * N / log N` could be negative or undefined (division by zero gives 0 in Lean). But the `N₀` threshold ensures we only need the bound for large `N` where `log N > 0`. This is correct. + +- **Representation (line 47):** `∃ M : ℕ, ∀ n : ℕ, M ≤ n → ∃ k : ℕ, ∃ a ∈ A, n = 2 ^ k + a` + - Correctly captures "every sufficiently large natural number." + - The equality `n = 2 ^ k + a` (not `n = 2 ^ k + a` with `a ≤ n`) is fine because in `ℕ`, `2 ^ k + a = n` already constrains `a ≤ n`. + +- **Answer `True`:** Correct. Ruzsa (1972) proved the affirmative answer. + +- **Category `research solved`:** Correct. + +- **AMS classification `11`:** Correct (Number Theory). + +- **Potential subtle issue:** The problem allows `k = 0`, so `2^0 = 1`, meaning any `n` with `n - 1 ∈ A` is representable. The formalization correctly allows `k : ℕ` (which includes 0). This matches the problem statement's `k ≥ 0`. + +**Verdict: The formalization is correct and complete for the core problem as stated. No mathematical flaws detected.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No direct reuse opportunity; inline approach justified | +| Citations | Incomplete — missing Lorentz (1954), Ruzsa (2001), van Doorn credit | +| Variants | Missing Lorentz weaker result and Ruzsa 2001 optimal complement | +| Readability | Good; minor improvements possible with helper definitions | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/222.md b/ai-review/222.md new file mode 100644 index 0000000000..01e715c47d --- /dev/null +++ b/ai-review/222.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 222 + +**File:** `FormalConjectures/ErdosProblems/222.lean` + +## 1. Code Reuse + +**Duplicate definition found.** `IsSumOfTwoSquares` is defined identically in both `ErdosProblems/222.lean` (line 43) and `ErdosProblems/675.lean` (line 52): + +```lean +def IsSumOfTwoSquares (n : ℕ) : Prop := + ∃ a b : ℕ, n = a ^ 2 + b ^ 2 +``` + +These two definitions live in separate namespaces (`Erdos222` and `Erdos675`), so they don't conflict, but they should ideally be deduplicated into a shared utility or a common namespace. Problem 675 also defines `sumOfTwoSquaresSet : Set ℕ := {n | IsSumOfTwoSquares n}`, which could likewise be shared. + +Additionally, `Nat.nth` is used consistently across 26+ problem files for sequence enumeration, so `sumTwoSqSeq` follows established conventions. + +No existing Mathlib definition for "sum of two squares" as a predicate on `ℕ` was found; the hand-rolled definition is appropriate. + +## 2. Citations + +The website ([erdosproblems.com/222](https://www.erdosproblems.com/222)) lists **six** references: + +| Citation | In file? | Notes | +|----------|----------|-------| +| [Er51] Erdős (1951) | **NO** | Missing | +| [Er57] Erdős (1957) | **NO** | Missing | +| [Er61] Erdős (1961) | **NO** | Missing | +| [BaCh47] Bambah & Chowla (1947) | Yes | Matches | +| [Ri82] Richards (1982) | Yes | Matches | +| [DEKKM22] Dietmann, Elsholtz, Kalmynin, Konyagin, Maynard (2022) | Yes (docstring only) | No formal theorem | + +**Three Erdős references are missing** from the docstring: [Er51], [Er57], and [Er61]. These should be added for completeness. + +Additionally, the website attributes a result to Erdős himself: that infinitely often $n_{k+1} - n_k \gg \frac{\log n_k}{\sqrt{\log \log n_k}}$. This result is not mentioned or formalized in the file. + +## 3. Variants + +**Missing variants:** + +1. **Erdős's own lower bound:** The website states Erdős proved $n_{k+1} - n_k \gg \frac{\log n_k}{\sqrt{\log \log n_k}}$ infinitely often. This is a stronger result than Richards' (in terms of the order of growth, not the constant), and is neither mentioned nor formalized. + +2. **DEKKM22 improved constant (2022):** The docstring mentions the improvement of the limsup constant from $1/4$ to $0.868\ldots$, but no formal theorem captures this. Following the established convention (see Problem 148's `konyagin_lower_bound` and `elsholtz_planitzer_upper_bound` variants), this should be formalized as something like: + + ```lean + theorem erdos_222.variants.dekkm22_lower_bound : + ∀ δ : ℝ, δ > 0 → ∃ᶠ k in atTop, + ((sumTwoSqSeq (k + 1) : ℝ) - (sumTwoSqSeq k : ℝ)) ≥ + (0.868 - δ) * Real.log (sumTwoSqSeq k : ℝ) := by + sorry + ``` + +3. **The overarching open problem:** The website marks Problem 222 as **OPEN** and frames it as "explore the behaviour of the consecutive differences." The file only formalizes two known results (both marked `solved`). There is no open conjecture statement capturing the full problem — e.g., conjecturing the true order of growth of the gaps, or asking whether the upper bound $n_k^{1/4}$ can be improved. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstrings are well-written and clearly explain the mathematical content. +- The use of `(1 : ℝ) / 4` in `erdos_222` is slightly unusual; `(1 / 4 : ℝ)` or just `4⁻¹` would be more idiomatic, though the current form is unambiguous. +- The sequence definition docstring helpfully lists initial terms, which is good practice. + +Overall readability is **good**. + +## 5. Formalizability + +**Assessment: High (for the formalized parts), but the overarching problem is vague.** + +The two formalized statements — the Bambah–Chowla upper bound and the Richards lower bound — are completely precise and unambiguously formalizable. They are clean asymptotic statements. + +However, the original Erdős problem ("explore the behaviour of consecutive differences") is inherently vague and exploratory. It is not a single conjecture but a research direction. The file handles this reasonably by formalizing two concrete known results, but does not attempt to state an open conjecture. + +**One subtle issue:** The use of `Nat.nth IsSumOfTwoSquares` presupposes that `IsSumOfTwoSquares` is satisfied by infinitely many natural numbers (otherwise `Nat.nth` would eventually return `0` by convention). This is mathematically trivial ($n^2 + 0^2$ works for all $n$), but the file does not state or prove this infiniteness fact. A lemma like `IsSumOfTwoSquares_infinite : {n : ℕ | IsSumOfTwoSquares n}.Infinite` would make the foundation more explicit. + +## 6. Correctness + +**The two formalized statements are mathematically correct.** + +- `erdos_222` (Bambah–Chowla): Correctly states $n_{k+1} - n_k \leq C \cdot n_k^{1/4}$ eventually, using `∀ᶠ k in atTop` with an existential constant $C > 0$. This accurately captures the $O(n_k^{1/4})$ bound. + +- `erdos_222.variants.lower_bound` (Richards): Correctly states the limsup characterization via `∃ᶠ k in atTop` with $\forall \delta > 0$. The formulation $n_{k+1} - n_k \geq (1/4 - \delta) \cdot \log n_k$ for frequently many $k$ is equivalent to $\limsup (n_{k+1} - n_k) / \log n_k \geq 1/4$. + +**No mathematical errors detected.** The formalization is sound for what it covers. + +**Incompleteness** (as noted above): The Erdős lower bound and the DEKKM22 improvement are documented in prose but not formalized, and three Erdős references from the website are missing. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Duplicate `IsSumOfTwoSquares` with Problem 675; should deduplicate | +| Citations | 3 of 6 website references missing ([Er51], [Er57], [Er61]) | +| Variants | Missing Erdős's own lower bound, DEKKM22 formal statement, and open conjecture | +| Readability | Good | +| Formalizability | High for stated results; parent problem is inherently vague | +| Correctness | Correct and complete for what is formalized | diff --git a/ai-review/223.md b/ai-review/223.md new file mode 100644 index 0000000000..b5a5cadb4f --- /dev/null +++ b/ai-review/223.md @@ -0,0 +1,102 @@ +# Review: Erdős Problem 223 + +## 1. Code Reuse + +**Issue found.** The file defines its own `unitDistPairs` using `(A ×ˢ A).filter` with division by 2, but the codebase already provides `unitDistNum` in `FormalConjecturesForMathlib/Geometry/Metric.lean`, which counts unordered unit-distance pairs directly via `sym2`: + +```lean +noncomputable def unitDistNum (s : Finset X) : ℕ := + #{p ∈ s.sym2 | dist p.out.1 p.out.2 = 1} +``` + +This definition is already used by Erdős Problems 1084 and 1085, which are closely related problems (1084: unit distances with minimum-distance constraint; 1085: unit distances without any constraint). The `unitDistNum` approach is cleaner—it avoids the division by 2 and the implicit reliance on the count being even. + +**Recommendation:** Replace the local `unitDistPairs` with the existing `unitDistNum` from `Metric.lean`. The two definitions are mathematically equivalent (for `EuclideanSpace ℝ (Fin d)`, which has `MetricSpace` instance and decidable equality), but proving the equivalence lemma would be needed. Using `unitDistNum` would also align the formalization with Problems 1084 and 1085. + +Additionally, the `EuclideanGeometry` scoped notation `ℝ^ d` (from `FormalConjecturesForMathlib/Geometry/Euclidean.lean`) could be used to make type signatures more concise, as done in Problems 1084 and 1085. + +## 2. Citations + +The docstring references are mostly accurate but have gaps relative to the website. + +**Included (correct):** +- [Er46b] — Vázsonyi conjecture attribution ✓ +- [HoPa34] — Hopf–Pannwitz for d = 2 ✓ +- [Gr56], [He56], [St57] — d = 3 result ✓ +- [Er60b] — Erdős d ≥ 4 result ✓ +- [Sw09] — Swanepoel exact values ✓ + +**Missing from the website listing:** +- **[Er57]** — listed on the website as a reference +- **[Er75f, p.102]** — listed on the website as a reference + +**Related problems not mentioned:** +- The website lists Problem **#132** and Problem **#1084** as related. Problem 1084 is particularly relevant as the "dual" problem (unit distances among 1-separated points). These cross-references would be valuable in the docstring. + +## 3. Variants + +The formalization captures the major known results well: + +| Result | Formalized? | Theorem | +|--------|-------------|---------| +| f₂(n) = n (upper bound) | ✓ | `erdos_223.variants.d2_upper` | +| f₂(n) = n (tightness) | ✓ | `erdos_223.variants.d2_tight` | +| f₃(n) = 2n − 2 (upper bound) | ✓ | `erdos_223.variants.d3_upper` | +| f₃(n) = 2n − 2 (tightness) | ✓ | `erdos_223.variants.d3_tight` | +| d ≥ 4 asymptotic upper bound | ✓ | `erdos_223` | +| d ≥ 4 asymptotic lower bound | ✓ | `erdos_223.variants.d_ge4_lower` | +| d ≥ 4 exact values (Swanepoel) | ✗ | Mentioned in docstring only | + +**Not formalized:** +- **Swanepoel's exact values** [Sw09] for all d ≥ 4 and sufficiently large n. This is mentioned in the module docstring but not captured as a theorem. Given the complexity of Swanepoel's characterization of extremal configurations, this omission is understandable, but a note (e.g., a `-- TODO`) would be helpful. + +## 4. Readability + +**Generally good.** The theorem names follow a clear convention (`erdos_223.variants.d2_upper`, etc.) and the docstrings are informative. + +**Minor suggestions:** +- The `unitDistPairs` docstring says "always even by symmetry of dist" — this is a correctness claim that could be a proved lemma rather than a comment. +- The coefficient `(↑(d / 2) - 1) / (2 * ↑(d / 2))` is correct but somewhat opaque. A `let p := d / 2` binding at the top of the statement (or in the docstring explicitly defining p) would improve readability, matching the mathematical statement "where p = ⌊d/2⌋." +- The file does not import or use the `EuclideanGeometry` scoped notations, so `EuclideanSpace ℝ (Fin d)` is written out in full everywhere. This is fine but verbose compared to `ℝ^ d` used in sibling files. + +## 5. Formalizability + +**High.** The problem is precisely stated and the formalization captures it cleanly. + +The main source of potential ambiguity in the original problem—"estimate f_d(n)"—is resolved by the formalization's choice to state the known sharp results (exact values for d = 2, 3 and matching asymptotics for d ≥ 4) rather than trying to formalize the vague "estimate." + +The asymptotic d ≥ 4 statement is formalized using the standard ε–N₀ approach, which faithfully captures the o(1) term in the mathematical statement. This is a clean and unambiguous formalization choice. + +**No ambiguity issues identified.** + +## 6. Correctness + +### unitDistPairs definition +The definition counts ordered pairs (x, y) with x ≠ y and dist x y = 1, then divides by 2. This is mathematically correct: by symmetry of `dist`, for each unordered pair {x, y} at distance 1, exactly two ordered pairs (x, y) and (y, x) pass the filter, so the ordered count is always even. However, Lean's `ℕ` division truncates rather than proving evenness, which means the definition silently gives a correct answer without a proof obligation that the count is even. This is not a bug but is inelegant—the `sym2`-based `unitDistNum` avoids this entirely. + +### Diameter condition +The condition `∀ x ∈ A, ∀ y ∈ A, dist x y ≤ 1` correctly encodes "diameter ≤ 1" for finite sets. Since the problem asks about sets of diameter exactly 1, one might wonder whether "diameter ≤ 1" is too weak. However, for the upper bounds this is strictly stronger (proving the bound for a larger class), and for the lower bounds / tightness results, the constructions will naturally have diameter exactly 1, so this is correct and arguably preferable. + +### d ≥ 4 coefficient +The expression `(↑(d / 2) - 1) / (2 * ↑(d / 2))` where `d / 2` is natural number division (i.e., ⌊d/2⌋ = p) and `↑` casts to `ℝ`: +- For d = 4: p = 2, coefficient = 1/4 ✓ +- For d = 5: p = 2, coefficient = 1/4 ✓ +- For d = 6: p = 3, coefficient = 1/3 ✓ + +The subtraction `↑(d / 2) - 1` is performed in ℝ (not ℕ), so there is no underflow risk. The hypothesis `4 ≤ d` ensures `d / 2 ≥ 2`, so `↑(d / 2) - 1 ≥ 1 > 0`. This is correct. + +**Note:** Erdős Problem 1085 uses `↑(d / 2 - 1)` (subtraction in ℕ before casting) instead of `(↑(d / 2) - 1)` (cast then subtract in ℝ). Both are equivalent when d ≥ 4, but Problem 223's approach is safer and more idiomatic. + +### d = 3 natural subtraction +The bound `unitDistPairs A ≤ 2 * A.card - 2` uses ℕ subtraction. With `hcard : 2 ≤ A.card`, we have `2 * A.card ≥ 4 > 2`, so the subtraction does not underflow. Correct. + +### d = 2 tightness +The statement `unitDistPairs A = n` for n ≥ 2 is correct. A regular n-gon inscribed in a unit-diameter circle achieves this for n ≥ 3, and for n = 2, two points at distance 1 give exactly 1 pair—but the claim says the count equals n = 2. Let me reconsider: for n = 2, two points at distance 1 give 1 unordered pair, but the claim is `unitDistPairs A = n = 2`. **This appears to be a bug for n = 2.** Two points at distance 1 have diameter 1 and exactly 1 unit-distance pair, not 2. + +Wait — actually, for a regular polygon approach: n = 3, equilateral triangle of side 1 (diameter 1) has 3 pairs at distance 1, matching f₂(3) = 3. For n = 4, consider a Reuleaux triangle plus center—but that doesn't easily give 4 pairs. The result f₂(n) = n is well-known and constructible (e.g., vertices of a "fattened" arc), but for n = 2 specifically, f₂(2) = 1 ≠ 2. + +**Potential correctness issue:** `erdos_223.variants.d2_tight` claims `unitDistPairs A = n` for n ≥ 2, but f₂(2) = 1. The hypothesis should likely be `3 ≤ n`, or the conclusion should be `unitDistPairs A = n` only for n ≥ 3 with f₂(2) = 1 handled separately. Alternatively, the classical result may indeed be f₂(n) = n for all n ≥ 2 via different constructions—but two points in the plane with diameter 1 can only have at most 1 unit-distance pair, contradicting the claim for n = 2. + +### Summary of correctness issues: +1. **Bug (likely):** `erdos_223.variants.d2_tight` for n = 2 claims existence of a 2-point set with 2 unit-distance pairs, but a 2-point set of diameter 1 has exactly 1 such pair. +2. **Stylistic:** `unitDistPairs` should be replaced with the existing `unitDistNum` for consistency and to avoid the implicit evenness assumption. diff --git a/ai-review/224.md b/ai-review/224.md new file mode 100644 index 0000000000..01771f171e --- /dev/null +++ b/ai-review/224.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 224 + +## 1. Code Reuse + +Several codebase constructs are related but none are directly reusable for this problem: + +- **Problem 504** (`ErdosProblems/504.lean`) defines `angleAt` using `@inner ℝ _ _` and `Real.arccos` for the full angle measure between three points. Problem 224's obtuse-angle test (`@inner ℝ _ _ (a - b) (c - b) < 0`) is strictly simpler—it only needs the sign of the inner product, not the angle value. No benefit in reusing `angleAt`. + +- **Problem 353** (`ErdosProblems/353.lean`) defines `IsRightTriangle` using explicit coordinate dot products on `ℝ × ℝ`. Problem 224 works in `EuclideanSpace ℝ (Fin d)` for general `d`, so the coordinate-based approach is not applicable. + +- **`FormalConjecturesForMathlib/Data/Set/Triplewise.lean`** provides a `Set.Triplewise` predicate for asserting a ternary relation on all distinct triples. This is tangentially related (the *negation* of triplewise non-obtuseness is what 224 proves), but the existential formulation in the current statement is more natural and direct. + +- **`FormalConjecturesForMathlib/Geometry/Euclidean.lean`** provides notation `ℝ^n` for `EuclideanSpace ℝ (Fin n)`. The current file does not import or use this notation, but could use it for brevity. + +**Verdict:** No significant code reuse opportunities. The formalization is self-contained and appropriately so. + +## 2. Citations + +The erdosproblems.com/224 page lists three references: + +| Website tag | In code? | Notes | +|---|---|---| +| **[Er57]** | **No** | Missing. The original Erdős source (1957). | +| **[Er61, p.244]** | **No** | Missing. Erdős 1961, page 244. | +| **[DaGr62]** | **Yes** | Full bibliographic reference provided: Danzer, L. and Grünbaum, B., *Über zwei Probleme bezüglich konvexer Körper von P. Erdős und von V.L. Klee*, Math. Z. 79 (1962), 95–99. | + +**Recommendation:** Add the missing Erdős references `[Er57]` and `[Er61, p.244]` to the module docstring to match the website's citation list. + +## 3. Variants + +The website describes three cases of increasing generality: + +- **d = 2:** Trivial case. Mentioned in the docstring. +- **d = 3:** Unpublished proof by Kuiper and Boerdijk. Mentioned in the docstring. +- **General d:** Proved by Danzer and Grünbaum [DaGr62]. This is the formalized statement. + +Since the general-case theorem subsumes d = 2 and d = 3, there is no need to formalize the special cases separately. The website does not mention any quantitative variants or extensions (e.g., counting the number of obtuse triples, or bounds for non-obtuse sets of exactly 2^d points). + +Problem 504 is a natural companion problem (determining the exact maximum guaranteed angle), but it is already formalized separately. + +**Verdict:** All variants are captured. No missing formalizations. + +## 4. Readability + +The code is clean and concise at 53 lines. Specific observations: + +- The module docstring clearly states the problem, known results, and the reference. It reads well. +- The theorem docstring explains the mathematical content and connects the inner product condition to the obtuse angle interpretation. +- The use of `@inner ℝ _ _` with explicit universe annotation is standard for `EuclideanSpace` and unavoidable. +- The nested `∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, ...` pattern is idiomatic Lean for this kind of statement. +- The distinctness conditions `a ≠ b ∧ b ≠ c ∧ a ≠ c` are correctly placed before the geometric condition. + +**Minor suggestion:** The `ℝ^` notation from `FormalConjecturesForMathlib/Geometry/Euclidean.lean` could be used in the docstring (though not necessarily the formal statement) for readability, but this is cosmetic. + +**Verdict:** Highly readable. No changes needed. + +## 5. Formalizability + +The problem statement on erdosproblems.com is: + +> "If A ⊆ ℝ^d is any set of 2^d + 1 points then some three points in A determine an obtuse angle." + +This is unambiguous: +- "set of 2^d + 1 points" → a finite set of cardinality at least 2^d + 1. +- "three points determine an obtuse angle" → three distinct points a, b, c such that the angle at some vertex is strictly greater than 90°. + +The only minor interpretive choice is whether "determine an obtuse angle" means the triangle has an obtuse angle (at any vertex) or that three specific ordered points form an obtuse angle at the middle one. The formalization quantifies existentially over all roles (a, b, c), so any obtuse angle at any vertex of any triple is captured: if the obtuse angle is at vertex p among {p, q, r}, one simply sets b = p, a = q, c = r. + +**Verdict:** Unambiguous and cleanly formalizable. No issues. + +## 6. Correctness + +The formalization states: for any `d : ℕ` and any `A : Finset (EuclideanSpace ℝ (Fin d))` with `2^d + 1 ≤ A.card`, there exist distinct `a, b, c ∈ A` with `⟨a - b, c - b⟩ < 0`. + +**Mathematical analysis:** + +- **The theorem is true and proved.** Danzer and Grünbaum (1962) showed this. The key insight is that the maximum cardinality of a *non-obtuse set* (a set where no three points determine an obtuse angle) in ℝ^d is exactly 2^d. The extremal example is the 2^d vertices of an axis-aligned hypercube {0,1}^d: for any three vertices a, b, c, each coordinate contributes a non-negative term to ⟨a − b, c − b⟩, so the inner product is always ≥ 0. + +- **Strict inequality (< 0) is correct.** "Obtuse angle" means strictly greater than 90°, which corresponds to inner product strictly less than 0. A right angle (inner product = 0) is not obtuse. This matches the mathematical statement. + +- **Distinctness conditions are necessary and correct.** The conditions `a ≠ b`, `b ≠ c`, `a ≠ c` ensure three genuinely distinct points. Without `a ≠ c`, one could have a = c, giving `⟨a − b, a − b⟩ = ‖a − b‖² > 0`, which is not obtuse—so the condition is needed. All three pairwise distinctness conditions are present. + +- **Edge cases are handled correctly:** + - *d = 0:* `EuclideanSpace ℝ (Fin 0)` is a zero-dimensional space (a single point). Any `Finset` over it has at most 1 element, so `2^0 + 1 = 2 ≤ A.card` is impossible. The statement is vacuously true. + - *d = 1:* Requires ≥ 3 points on the real line. Any three distinct collinear points a < b < c satisfy `(a − b)(c − b) < 0`, so the statement holds trivially. + +- **Type-level correctness:** `2 ^ d` in `ℕ` computes the correct power. The constraint `2 ^ d + 1 ≤ A.card` correctly expresses "at least 2^d + 1 points." The `@inner ℝ _ _` annotation resolves the inner product on `EuclideanSpace ℝ (Fin d)` correctly. + +- **The `@[category research solved, AMS 52]` tag** is appropriate: the problem is solved (Danzer–Grünbaum 1962), and AMS classification 52 (Convex and discrete geometry) is correct. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. diff --git a/ai-review/225.md b/ai-review/225.md new file mode 100644 index 0000000000..4d45094e8d --- /dev/null +++ b/ai-review/225.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 225 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/`. The problem is in complex/harmonic analysis (trigonometric polynomials, integration on the circle), while existing library code covers polynomial algebra (`Algebra/Polynomial/Basic.lean`), integration patterns (`Data/Real/Constants.lean`), and complex exponential bounds (`Analysis/SpecialFunctions/Log/Basic.lean`). None of these provide definitions or lemmas that would substitute for or simplify the current formalization. The `trigPoly` definition is specific to this problem and appropriately self-contained. + +## 2. Citations + +The formalization's docstring references: + +| Formalization | Website | +|---|---| +| `[Er40b, Er57, Er61]` Erdős, P., original references | Confirmed — Erdős papers from 1940s–1960s | +| `[Kr74]` Kristiansen, G. K. (1974) | Confirmed — proved for real c_k; note: website mentions an error corrected in 1976 (not mentioned in docstring) | +| `[SaSh74]` Saff, E. B. and Sheil-Small, T. (1974) | Confirmed — extended to complex c_k | +| `[Ha74]` Hajós, G. et al., _Combinatorial theory and its applications_ (1974), Problem 4.20 | Confirmed | + +**Issue:** The website notes that Kristiansen's original 1974 proof contained an error that was corrected in 1976. The docstring does not mention this. Consider adding a note about the 1976 correction for completeness. + +The website also lists acknowledged contributors (Alfaiz, Winston Heap, Vjekoslav Kovac, Karlo Lelas), which are not relevant to the formalization's citations. + +## 3. Variants + +The problem has two natural variants based on the coefficient domain: +- **Real coefficients** (proved by Kristiansen, 1974) +- **Complex coefficients** (proved by Saff and Sheil-Small, 1974) + +The formalization uses `c : ℕ → ℂ`, capturing the **more general complex case**, which subsumes the real case. This is the right choice — no variants are missing. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The `trigPoly` definition is well-documented with a LaTeX docstring. +- The theorem statement has clear, well-named hypotheses (`hn`, `hlead`, `hroots`, `hbound`, `hattained`). +- The namespace `Erdos225` and the `open` declarations are appropriate. +- The expression `↑k * ↑θ * Complex.I` in `trigPoly` computes `kθi`, which equals `ikθ` by commutativity — mathematically correct but slightly non-standard in ordering. This is a negligible stylistic point; the docstring already clarifies the intended formula. + +**No readability improvements needed.** + +## 5. Formalizability + +**Assessment: Highly formalizable, minimal ambiguity.** + +The problem statement is precise: it specifies an explicit class of functions (trigonometric polynomials with all roots on the unit circle), a normalization condition (sup-norm equals 1), and a concrete quantitative conclusion (L¹ norm at most 4). Every component maps cleanly to existing Mathlib concepts (finite sums, complex exponentials, norms, interval integrals). + +The only potential ambiguity in the original problem is the phrase "all of whose roots are real" for a trigonometric polynomial. Since θ is inherently a real variable, this must refer to the roots of the analytic continuation f(z) for z ∈ ℂ, or equivalently, to all roots of the algebraic polynomial P(z) = Σ c_k z^k lying on the unit circle. The formalization correctly resolves this ambiguity via `hroots`, and the docstring explicitly states the equivalence. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed analysis of each component: + +### `trigPoly` definition +Computes f(θ) = Σ_{k=0}^{n} c_k · exp(kθi) = Σ c_k · e^{ikθ}. This is the standard definition of a trigonometric polynomial. Since f(θ) = P(e^{iθ}) where P(z) = Σ c_k z^k, the connection between the trigonometric polynomial and the algebraic polynomial is immediate. **Correct.** + +### `hroots` hypothesis +States: ∀ z : ℂ, P(z) = 0 → ‖z‖ = 1. This captures "all roots of P lie on the unit circle," which is equivalent to "all roots of f (as an analytic function of complex θ) are real." The equivalence holds because z = e^{iθ} with θ = a + bi gives |z| = e^{-b}, so |z| = 1 iff b = 0 iff θ is real. **Correct.** + +### `hlead` and `hn` hypotheses +These ensure P is genuinely a polynomial of degree n ≥ 1 (non-trivial). By the fundamental theorem of algebra, P then has exactly n roots (counted with multiplicity), so `hroots` is non-vacuous. These are natural and necessary non-degeneracy conditions. **Correct.** + +### Normalization (`hbound` + `hattained`) +Together these say sup_{θ ∈ ℝ} ‖f(θ)‖ = 1, which matches max_{θ ∈ [0,2π]} |f(θ)| = 1 from the problem statement. The equivalence holds because f is 2π-periodic (since k ∈ ℕ, we have e^{ik(θ+2π)} = e^{ikθ}). Splitting the max condition into an upper bound plus attainment is the standard Lean pattern for expressing equalities of suprema. **Correct.** + +### Conclusion +∫₀^{2π} ‖f(θ)‖ ≤ 4, using Mathlib's interval integral with Lebesgue measure. Since f is continuous (finite sum of continuous functions), the integrand ‖f(·)‖ is continuous and hence measurable, so the integral is well-defined. The bound 4 matches the problem statement. **Correct.** + +### Potential concerns (all minor, none are errors): +1. The formalization uses a bare `Finset.sum` rather than Mathlib's `Polynomial` type for P. This is fine — it avoids unnecessary dependencies and the sum representation is more natural for the trigonometric polynomial connection. +2. `hbound` quantifies over all θ : ℝ rather than θ ∈ [0, 2π]. This is equivalent by periodicity and arguably cleaner. +3. `hattained` does not restrict its witness to [0, 2π], but again this is equivalent by periodicity. + +**No mathematical errors or incompleteness found. The formalization faithfully captures the problem.** diff --git a/ai-review/226.md b/ai-review/226.md new file mode 100644 index 0000000000..768dc1c03b --- /dev/null +++ b/ai-review/226.md @@ -0,0 +1,81 @@ +# Review: Erdos Problem 226 + +## 1. Code Reuse + +Several opportunities for code reuse exist: + +- **`IsEntire` definition**: `FormalConjectures/ErdosProblems/1115.lean:37` defines `def IsEntire (f : ℂ → ℂ) : Prop := Differentiable ℂ f`. The current formalization uses `Differentiable ℂ f` directly, which is fine, but if the project standardizes on `IsEntire`, it could be extracted to a shared utility (e.g., `FormalConjecturesForMathlib/Analysis/EntireFunctions.lean`). At least 8 other Erdos problems use this same pattern (514, 515, 229, 906, 1115, 1116, 1117, and others). + +- **Transcendental predicate**: Other problems (229, 513, 906) use `Transcendental (Polynomial ℂ) f` to express that an entire function is transcendental. Since the Barth-Schneider solution actually produces a transcendental entire function (which is stronger than merely non-linear), one could consider whether the formalization should also express this stronger result (see Correctness section). + +- **Rationality predicate**: The pattern `∃ q : ℚ, (q : ℝ) = x` for "x is rational" and `∃ q : ℚ, (q : ℂ) = f ↑x` for "f(x) is rational" is idiomatic and not reused elsewhere in the codebase (only Erdos 265 uses a similar ℚ-embedding pattern). No shared utility exists for this; given it appears only here, creating one is unnecessary. + +No existing code in `FormalConjecturesForMathlib/` is directly repurposable for this problem. + +## 2. Citations + +The formalization includes: +- `[Er57]` — Erdős, P., *Some unsolved problems*, 1957. +- `[BaSc70]` — Barth, K.F. and Schneider, W.J., J. London Math. Soc. (2) 2 (1970), 620–626. +- `[BaSc71]` — Barth, K.F. and Schneider, W.J., J. London Math. Soc. (2) 4 (1971), 482–488. + +**Missing citation**: The website lists **[Ha74]** (Hayman, W. K., *Research problems in function theory: new problems*, 1974, 155–180), which attributes this as Problem 2.31. This reference is used in other formalizations in this codebase (e.g., Erdos 229 references [Ha74]). It should be added. + +**Contributors**: The website acknowledges Boris Alexeev, Dustin Mixon, and Terence Tao. This is metadata and need not appear in the formalization. + +## 3. Variants + +The website states a **general variant**: + +> "If $A, B \subseteq \mathbb{R}$ are two countable dense sets, does there exist an entire function such that $f(A) = B$?" + +This general variant (the Barth-Schneider theorem itself) is **not formalized**. The current formalization only captures the specific case $A = B = \mathbb{Q}$. Formalizing the general result would be valuable since it is the actual theorem proved by Barth and Schneider [BaSc70], and the ℚ-to-ℚ case is merely a corollary. A natural formalization of the general variant would be: + +```lean +theorem erdos_226_general (A B : Set ℝ) (hA : A.Countable) (hB : B.Countable) + (hAd : Dense A) (hBd : Dense B) : + ∃ f : ℂ → ℂ, Differentiable ℂ f ∧ + Transcendental (Polynomial ℂ) f ∧ + ∀ x : ℝ, x ∈ A ↔ f ↑x ∈ (↑) '' B := by + sorry +``` + +The [BaSc71] extension to countable dense subsets of ℂ is also not formalized. + +## 4. Readability + +The formalization is concise and readable. Minor observations: + +- The non-linearity condition `¬∃ a b : ℂ, ∀ z, f z = a * z + b` is clear and correctly captures "f is not affine." This is more explicit (and arguably more readable) than alternatives like `¬IsAffine f`. + +- The rationality biconditional `(∃ q : ℚ, (q : ℝ) = x) ↔ ∃ q : ℚ, (q : ℂ) = f ↑x` is idiomatic Lean. One could consider using `x ∈ Set.range ((↑) : ℚ → ℝ)` for the LHS, but the existential form is arguably more transparent. + +- The `answer(True) ↔` wrapper is consistent with other solved problems in the codebase. + +Overall readability is good. + +## 5. Formalizability + +The problem statement is **precise and unambiguous**. "Entire" means holomorphic on all of ℂ (i.e., `Differentiable ℂ f`). "Non-linear" has a clear meaning: not of the form $f(z) = az + b$. "Rational" is unambiguous. The biconditional "x is rational if and only if f(x) is" is perfectly precise. + +The only minor source of ambiguity is whether "non-linear" means "not affine" (degree > 1 allowed) or "transcendental" (not any polynomial). In standard usage, "non-linear" means "not affine," and the formalization correctly captures this. The solution happens to produce something much stronger (a transcendental function), but the problem only asks for non-linear. + +**Assessment**: Fully formalizable with no ambiguity. Rating: unambiguous. + +## 6. Correctness + +The formalization is **mathematically correct** for the problem as stated. Detailed analysis: + +- **Entireness**: `Differentiable ℂ f` correctly captures that f is entire (holomorphic on all of ℂ). This is standard in this codebase. + +- **Non-linearity**: `¬∃ a b : ℂ, ∀ z, f z = a * z + b` correctly excludes all affine functions. This is faithful to the problem's use of "non-linear." + +- **Rationality biconditional**: The condition `∀ x : ℝ, (∃ q : ℚ, (q : ℝ) = x) ↔ ∃ q : ℚ, (q : ℂ) = f ↑x` correctly expresses: for all real x, x is rational iff f(x) (viewed as a complex number) is a rational real number. The coercion `(q : ℂ)` sends ℚ to the real axis of ℂ, so `∃ q : ℚ, (q : ℂ) = f ↑x` simultaneously asserts that f(x) is real-valued and rational. This is the correct interpretation. + +- **Domain restriction**: The quantifier `∀ x : ℝ` correctly restricts the condition to real inputs, matching the problem statement "for all $x \in \mathbb{R}$." + +- **Answer**: `answer(True)` is correct — the problem is solved affirmatively by Barth and Schneider. + +**One observation on strength**: The Barth-Schneider result [BaSc70] produces a *transcendental* entire function, which is strictly stronger than non-linear. The formalization faithfully captures the problem as asked (non-linear), not the stronger result that was proved. This is a defensible choice — the formalization matches the problem statement, not the solution. However, one could argue that formalizing the stronger solved result (using `Transcendental (Polynomial ℂ) f` or `¬∃ p : Polynomial ℂ, ∀ z, f z = p.eval z` as done in Erdos 514/515) would be more informative and historically accurate. + +**No flaws identified.** The formalization is complete and correct for the problem as stated. diff --git a/ai-review/227.md b/ai-review/227.md new file mode 100644 index 0000000000..acab893659 --- /dev/null +++ b/ai-review/227.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 227 + +## 1. Code Reuse + +**`maxModulus` is duplicated across four files.** The definition + +```lean +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} +``` + +appears identically in Problems 227, 514, 1117, and 1118 (each in its own namespace). This should be extracted into a shared definition in `FormalConjecturesForMathlib`, e.g. `FormalConjecturesForMathlib.Analysis.MaxModulus`, and imported by all four files. + +Problem 513 defines a closely related `ratio` using `⨆ z : {z : ℂ // ‖z‖ = r}, ‖f z‖` in the denominator — an equivalent formulation via supremum over a subtype rather than `sSup` of a set. Ideally the shared `maxModulus` would be used there too, with a lemma relating the two forms. + +`maxTerm` is unique to Problem 227 and does not appear elsewhere in the codebase. + +## 2. Citations + +The website ([erdosproblems.com/227](https://www.erdosproblems.com/227)) lists four references: + +- **[Er57]** — Erdős, 1957 +- **[Er61, p.249]** — Erdős, 1961, page 249 +- **[Er82e]** — Erdős, 1982 +- **[ClHa64]** — Clunie and Hayman, 1964 + +The formalization only cites **[ClHa64]**. The three Erdős source references [Er57], [Er61], and [Er82e] are omitted. + +**Possible citation error:** The formalization attributes [ClHa64] to the paper *"The spherical derivative of integral and meromorphic functions"*, Comment. Math. Helv. **40** (1966), 117–148. However, this appears to be a different Clunie–Hayman paper from 1966. The [ClHa64] reference relevant to this problem (and cited identically in Problem 513) is *"The maximum term of a power series"*, J. Analyse Math. **12** (1964), 143–186. The title, journal, and year all differ. This should be corrected. + +The website also notes **"See also Problem [513]"**, which is not mentioned in the docstring. + +## 3. Variants + +The formalization captures only the basic disproof (the limit need not be 0). Two notable variants are missing: + +1. **Clunie's positive result (unpublished):** When $a_n \geq 0$ for all $n$, the original statement *does* hold — the limit must be 0. The website explicitly mentions this. This is a natural companion theorem: + + ``` + theorem erdos_227.variants.nonneg_coefficients : + ∀ (f : ℂ → ℂ) (a : ℕ → ℂ), + (∀ z, HasSum (fun n => a n * z ^ n) (f z)) → + (∀ N, ∃ n, N < n ∧ a n ≠ 0) → + (∀ n, 0 ≤ (a n).re ∧ (a n).im = 0) → + ∀ L, Tendsto (fun r => maxTerm a r / maxModulus f r) atTop (𝓝 L) → + L = 0 + ``` + +2. **Full characterization of achievable values:** Clunie and Hayman showed the limit can take *any* value in $[0, 1/2]$. The current formalization only says the universal statement is false (i.e., there exists some counterexample), but does not capture this stronger result. A variant could state: + + ``` + theorem erdos_227.variants.achievable_values : + ∀ L ∈ Set.Icc (0 : ℝ) (1/2), + ∃ (f : ℂ → ℂ) (a : ℕ → ℂ), + (∀ z, HasSum (fun n => a n * z ^ n) (f z)) ∧ + (∀ N, ∃ n, N < n ∧ a n ≠ 0) ∧ + Tendsto (fun r => maxTerm a r / maxModulus f r) atTop (𝓝 L) + ``` + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The docstrings for `maxTerm` and `maxModulus` are clear and include the mathematical notation. +- The theorem docstring repeats the problem statement and mentions the disproof, which is good practice. +- **Suggestion:** Add a brief comment in the module docstring noting the cross-reference to Problem 513 and the positive result of Clunie for non-negative coefficients, as the website does. + +## 5. Formalizability + +**Assessment: High — the problem is precisely formalizable.** + +The original question is unambiguous: given an entire function expressed as a power series, does convergence of the ratio max-term / max-modulus force the limit to be 0? All components (power series, entire function, maximum term, maximum modulus, limit) have standard mathematical definitions that translate cleanly into Lean. + +The only minor point of ambiguity is whether "the limit exists" means *finite* limit (as formalized via `Tendsto ... (𝓝 L)` for `L : ℝ`) or could include divergence to infinity. Since the ratio is at most 1 (the maximum term is bounded by the maximum modulus for entire functions), this is not a real issue — any convergent limit necessarily lies in $[0, 1]$. The formalization correctly handles this by universally quantifying over `L : ℝ`. + +## 6. Correctness + +**The core formalization is mathematically correct, with one subtlety worth noting.** + +- **`answer(False)` is correct.** The problem asks "must the limit be 0?" and `answer(False)` means the answer is no, matching the Clunie–Hayman disproof. +- **The "not a polynomial" condition** `∀ N : ℕ, ∃ n, N < n ∧ a n ≠ 0` correctly encodes that infinitely many coefficients are nonzero, which (given the `HasSum` representation) is equivalent to $f$ being entire and transcendental. +- **The `HasSum` encoding** `∀ z : ℂ, HasSum (fun n => a n * z ^ n) (f z)` correctly ties $f$ to its power series coefficients $a$ and ensures $f$ is entire (convergent everywhere). +- **`maxTerm` definition is correct:** $\mu(r) = \sup_n |a_n| r^n$ matches the standard Wiman–Valiron definition of the maximum term. +- **`maxModulus` definition is correct:** $M(r) = \sup\{|f(z)| : |z| = r\}$ is the standard maximum modulus. + +**Subtlety on the domain of `maxTerm` and `maxModulus`:** Both definitions accept arbitrary `r : ℝ`, including negative values. For $r < 0$, `maxTerm` involves $r^n$ which alternates in sign, and `maxModulus` takes $\text{sSup}$ of an empty set (since $\|z\| = r$ has no solutions). Since the theorem only considers behavior as $r \to +\infty$ (via `atTop`), this does not affect correctness, but restricting to `r ≥ 0` or using `ℝ≥0` would be more mathematically natural. + +**Overall assessment:** The formalization is correct and faithfully captures the core problem. The main gaps are the missing variants (Clunie's positive result for non-negative coefficients, and the full $[0, 1/2]$ characterization) and the likely incorrect bibliographic reference for [ClHa64]. diff --git a/ai-review/230.md b/ai-review/230.md new file mode 100644 index 0000000000..4635b2db81 --- /dev/null +++ b/ai-review/230.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 230 + +## 1. Code Reuse + +Several related problems define unit-circle supremum helpers that are structurally similar to the polynomial evaluation in Problem 230: + +- **Problem 523** (`supNormCircle`): Computes `sSup {x | ∃ z, ‖z‖ = 1 ∧ x = ‖∑ k ∈ range (n+1), (ε k : ℂ) * z ^ k‖}` for Rademacher polynomials. This is the closest analogue — it packages the "max on the unit circle" into a reusable definition. +- **Problem 256** (`unitCircleMaxProd`): Same pattern for products on the unit circle. +- **Problem 525** (`littlewoodEval`): Evaluates ±1 polynomials at a point. + +Problem 230 inlines the polynomial evaluation and the existential over the unit circle directly in the theorem statement. This is a reasonable choice for a simple yes/no conjecture, and extracting a helper definition is not strictly necessary. However, if consistency with Problems 523/256 is desired, a `supNormCircle`-style definition for general unimodular-coefficient polynomials could be factored out and shared. No action required, but worth noting. + +## 2. Citations + +The formalization includes: **Er57, Er61, Er80h, Ka80, BoBo09**. + +The [erdosproblems.com/230](https://www.erdosproblems.com/230) page lists two additional references not present in the formalization: + +- **Ha74** — Problem 4.31 (describes this as the **Erdős–Newman conjecture**). Missing from docstring. +- **Ko80** — Körner's construction of polynomials satisfying $(c_1 - o(1))\sqrt{n} \le |P(z)| \le (c_2 + o(1))\sqrt{n}$. Missing from docstring. + +The page also gives specific page numbers for the Erdős references: Er57 p.297, Er61 p.248, Er80h p.385. These are not reflected in the formalization's citation stubs. + +Additionally, the website notes **related problems 228 and 1150**, which are not mentioned in the formalization. + +**Recommendation:** Add Ha74 and Ko80 to the module docstring citation list, and consider adding page numbers to the Erdős references for completeness. + +## 3. Variants + +The website describes intermediate results that represent natural variants: + +- **Körner's weaker flatness (Ko80):** Existence of polynomials with $(c_1 - o(1))\sqrt{n} \le |P(z)| \le (c_2 + o(1))\sqrt{n}$ for constants $0 < c_1 \le c_2$. This is a weaker form of "near-flatness" and could be formalized as a separate theorem. +- **Bombieri–Bourgain quantitative improvement (BoBo09):** $P(z) = \sqrt{n} + O(n^{7/18}(\log n)^{O(1)})$ uniformly. This gives an explicit error term refining Kahane's $o(1)$. + +The formalization captures only the main yes/no question (does such $c > 0$ exist?), which is appropriate for recording the conjecture and its resolution. The quantitative refinements are naturally separate results and their omission is reasonable. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The exponent `k.val + 1` correctly shifts `Fin n` indices (0, ..., n−1) to exponents (1, ..., n), matching the original $\sum_{k=1}^{n} a_k z^k$. This is correct but slightly non-obvious on first reading. A brief inline comment like `-- exponents 1 to n` could help. +- The docstring clearly explains the conjecture, its resolution, and the meaning of `answer(False)`. This is well done. +- The `open Finset BigOperators` and namespace structure follow codebase conventions. + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. The original conjecture is a precise yes/no question: + +> Does there exist $c > 0$ such that $\max_{|z|=1} |P(z)| \ge (1+c)\sqrt{n}$ for all $n \ge 2$ and all unimodular-coefficient polynomials $P$? + +Every component maps directly to Lean/Mathlib constructs: +- Unimodular coefficients: `‖a k‖ = 1` +- Unit circle: `‖z‖ = 1` +- Maximum on the circle: existential quantifier `∃ z` +- Polynomial evaluation: finite sum with complex powers + +There is **no ambiguity** in the mathematical statement. The only design choice is the indexing convention (using `Fin n` with shifted exponents vs. `Finset.range` or `Fin (n+1)` with a separate constraint excluding the constant term), and the chosen approach is clean. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed verification: + +### Structure +`answer(False) ↔ S` where `S` is the conjecture statement. Since `answer(False)` reduces to `False`, the biconditional `False ↔ S` is logically equivalent to `¬S`. This correctly asserts that the conjecture is false (disproved), which matches the known resolution by Kahane. + +### Polynomial representation +- `a : Fin n → ℂ` with `‖a k‖ = 1` provides $n$ unimodular coefficients. +- `∑ k : Fin n, a k * z ^ (k.val + 1)` evaluates to $a_0 z + a_1 z^2 + \cdots + a_{n-1} z^n$, which is exactly $\sum_{k=1}^{n} a_k z^k$ under the relabeling $a_{k-1} \mapsto a_k$. ✓ + +### Bound direction +- `(1 + c) * Real.sqrt ↑n ≤ ‖...‖` asserts the polynomial's modulus at some point on the circle is at least $(1+c)\sqrt{n}$. ✓ +- The existential `∃ z : ℂ, ‖z‖ = 1 ∧ ...` correctly captures "max on the unit circle is at least ...". ✓ + +### Domain restriction +- `2 ≤ n` correctly excludes $n = 0$ (trivial zero polynomial) and $n = 1$ (where $\max = 1 < (1+c)\sqrt{1}$). ✓ + +### Quantifier order +- $\exists c > 0, \forall n \ge 2, \forall a$ (unimodular), $\exists z$ on circle: bound holds. This matches the original problem statement exactly — the constant $c$ is universal (does not depend on $n$ or the coefficients). ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the original conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity to share a `supNormCircle`-style definition with Problems 523/256, but not required | +| Citations | **Missing Ha74 (Erdős–Newman) and Ko80 (Körner)**; page numbers for Erdős refs could be added | +| Variants | Main conjecture captured; quantitative refinements (Körner, Bombieri–Bourgain) reasonably omitted | +| Readability | Good; minor suggestion for an inline comment on the exponent shift | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | **Correct and complete** | diff --git a/ai-review/231.md b/ai-review/231.md new file mode 100644 index 0000000000..725a66c75b --- /dev/null +++ b/ai-review/231.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 231 + +## 1. Code Reuse + +**Issue found.** Problem 231 defines `ContainsAbelianSquare` on `List α` using `List.Perm`, while Problem 192 (which the website states is *equivalent*) defines `HasAbelianSquare` on `ℕ → α` using multiset equality via `Finset.range`. These are two independent definitions of the same mathematical concept applied to different data structures. There is no shared utility. + +**Recommendation:** Consider extracting a shared abelian-square predicate into `FormalConjecturesForMathlib/Combinatorics/Words.lean` (or similar), with versions for both finite lists and infinite sequences, along with a proof that they are compatible (i.e., an infinite word has an abelian square iff some finite prefix contains one). The AP utilities in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` provide a good structural template. + +## 2. Citations + +**Incomplete.** The formalization cites only: +- [Ke92] Keränen, V. + +The [erdosproblems.com/231](https://www.erdosproblems.com/231) page lists additional references: +- **[Er57]** — Erdős original source +- **[Er61, p.240]** — Erdős original source +- **[FiPu23]** — Fici and Puzynina, a recent survey on abelian-square-freeness + +These should be included in the docstring for completeness, especially [Er57]/[Er61] as they are the original problem sources. + +## 3. Variants + +**Partially captured.** The formalization includes: +- `erdos_231` — the main conjecture (answer: False) +- `erdos_231.variants.small_alphabet` — k ≤ 3 case +- `erdos_231.variants.large_alphabet` — k ≥ 4 case + +**Missing variants / considerations:** +- The equivalence with Problem 192 (unit-vector steps in ℝ^d and three-term APs) is not formalized or cross-referenced beyond the docstring. +- The stronger result for k = 3 — that *every* word of length ≥ 7 over 3 letters contains an abelian square — is only captured at the exact threshold length 7, not for all lengths ≥ 7. (Though this follows from the length-7 case by a simple extension argument.) + +## 4. Readability + +**Good overall.** The `ContainsAbelianSquare` definition is clean and well-documented. The namespace `Erdos231` keeps things scoped. The docstrings clearly describe each theorem. + +**Minor suggestion:** The docstring for the main theorem could more explicitly note the distinction between "the conjecture is false in general" vs. "it holds for small k but fails for k ≥ 4", since the answer(False) refers to the universal claim. + +## 5. Formalizability + +**Low ambiguity, with one notable exception.** The concept of abelian square is mathematically precise and cleanly formalized. The combinatorial content is well-suited to formalization. + +**The length ambiguity:** The website notes that "Erdős likely meant strings of length 2^k (not 2^k−1), as evidenced by the counterexample `1213121412132124`" (which has length 16 = 2^4, not 15 = 2^4−1). The formalization follows the literal statement (2^k − 1), which is defensible but creates problems (see Correctness below). + +## 6. Correctness + +**Critical issue with the k = 2 case.** + +The `small_alphabet` variant claims that for 2 ≤ k ≤ 3, every word of length 2^k − 1 over `Fin k` contains an abelian square. This is **false for k = 2**. + +For k = 2, the length is 2^2 − 1 = 3. The word `[0, 1, 0]` over `{0, 1}` has length 3 and contains no abelian square: +- Block length 1: positions (0,1) give `[0]` vs `[1]` — not a permutation. Positions (1,2) give `[1]` vs `[0]` — not a permutation. +- Block length 1 is the only option since `i + 2·1 ≤ 3` requires `i ≤ 1`. + +So the word `[0, 1, 0]` is an explicit counterexample to `erdos_231.variants.small_alphabet` at k = 2. **This variant is unprovable as stated.** + +**Cascade to the main theorem.** The main theorem states: +``` +answer(False) ↔ ∀ k, 2 ≤ k → ∀ w : List (Fin k), w.length = 2^k − 1 → ContainsAbelianSquare w +``` + +Since `answer(False)` elaborates to `False`, this is `False ↔ (∀ k ≥ 2, ...)`. The RHS is already false at k = 2 (via the `[0,1,0]` counterexample), so this becomes `False ↔ False`, which is trivially `True`. The theorem is **technically provable but vacuously** — it does not capture the intended mathematical content that the conjecture fails because of k ≥ 4 (Keränen's result), not because of k = 2. + +**Root cause:** Using `2^k − 1` instead of `2^k` as the string length. With `2^k`: +- k = 2, length 4: every binary word of length 4 contains an abelian square (verified exhaustively). ✓ +- k = 3, length 8: every ternary word of length 8 contains an abelian square (known result, threshold is 7). ✓ +- k ≥ 4: Keränen's construction gives counterexamples. ✓ + +**Recommended fix:** Change `2 ^ k - 1` to `2 ^ k` throughout, matching Erdős's likely intent and ensuring the theorems reflect the correct mathematical content. Alternatively, restrict `small_alphabet` to k = 3 only and adjust the main theorem to start at k = 3. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Duplicated abelian-square definition with Problem 192 | +| Citations | Missing [Er57], [Er61], [FiPu23] | +| Variants | Mostly captured; equivalence with Problem 192 not formalized | +| Readability | Good | +| Formalizability | Precise, with one length ambiguity | +| Correctness | **Incorrect at k = 2 due to 2^k−1 vs 2^k length issue; main theorem is vacuously true** | diff --git a/ai-review/232.md b/ai-review/232.md new file mode 100644 index 0000000000..171f1dbfa9 --- /dev/null +++ b/ai-review/232.md @@ -0,0 +1,98 @@ +# Review: Erdős Problem 232 + +## 1. Code Reuse + +**Potential reuse opportunities identified:** + +- **`IsUnitDistanceFree`**: Defined locally in `Erdos232` namespace (line 53). Several other Erdős problems define closely related concepts: + - `Erdos704` (704.lean:51) defines `unitDistanceGraph` where `Adj x y := x ≠ y ∧ dist x y = 1`. The property `IsUnitDistanceFree A` is equivalent to `A` being an independent set in this graph. + - `UnitDistancePlaneGraph` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean:96` defines the same concept as a `SimpleGraph` on ℝ². + + A shared definition (e.g., in `ForMathlib/Geometry/Metric.lean`) could unify the "unit-distance-free" / "independent set in unit distance graph" concept across problems 232, 704, 1007, 1066, 1070, and others. + +- **Upper density**: The existing `Set.upperDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean` is for discrete/ordered types (counting density via `ncard`), **not** for continuous Lebesgue measure on ℝ². Problem 232 inlines the continuous upper density via the ε-δ formulation rather than defining a reusable `upperDensity` for metric measure spaces. A general continuous upper density definition (limsup of λ(A ∩ B_R)/λ(B_R)) could be useful if other problems require it, but currently no other problem in the codebase uses this concept, so the inline approach is acceptable. + +**Verdict:** The `IsUnitDistanceFree` definition is a candidate for extraction to a shared location given how many problems use equivalent notions. The density formulation is appropriately inlined. + +## 2. Citations + +**Formalization docstring references:** +- `[Mo66]` Moser, L., *Problem 10*, Canad. Math. Bull. 9 (1966). ✅ +- `[Er85]` Erdős, P., *Problems and results in combinatorial geometry*, 1985, p. 4. ✅ +- `[ACMVZ23]` Ambrus, G., Csiszárik, A., Matolcsi, M., Varga, D., and Zsámboki, P., *The density of planar sets avoiding unit distances*, 2023. ✅ + +**Comparison with erdosproblems.com/232:** +- The website credits Croft with improving the lower bound to m₁ ≥ 0.22936, but the formalization docstring does not mention Croft. This is acceptable since Croft's result is not part of the formalized statement, but could be added as additional context. +- The website lists author first names (Gergely Ambrus, Ágoston Csiszárik, Kristóf Varga, Zsombor Zsámboki) that differ from the initials in the formalization (Csiszárik, A.; Varga, D.; Zsámboki, P.). The formalization's initials likely match the actual arXiv paper (Adrián Csiszárik, Dániel Varga, Pál Zsámboki), suggesting the **website** has incorrect first names rather than the formalization. + +**Verdict:** Citations are accurate and consistent with the source paper. Minor enhancement: could mention Croft's improved lower bound. + +## 3. Variants + +The erdosproblems.com statement has two parts: +1. **"Estimate m₁"** — asking for bounds on the supremal upper density of unit-distance-free sets in ℝ². +2. **"In particular, is m₁ ≤ 1/4?"** — a specific yes/no question. + +The formalization captures only part (2): it proves m₁ ≤ 1/4 (via the ε-formulation of limsup ≤ 1/4). It does **not** formalize: +- The stronger proved bound m₁ ≤ 0.247 from [ACMVZ23]. +- The known lower bound m₁ ≥ π/(8√3) ≈ 0.2267 (Moser) or the improved m₁ ≥ 0.22936 (Croft). +- A two-sided estimate narrowing m₁ to [0.229, 0.247]. + +Since the problem is tagged as "solved" and the formalization captures the specific question Erdős asked ("is m₁ ≤ 1/4?"), this is a reasonable scope. The tighter bounds could be formalized as separate theorems if desired. + +**Verdict:** The primary question is captured. The broader "estimate m₁" aspect (lower bounds, tighter upper bound) is not formalized but is not essential. + +## 4. Readability + +The code is well-structured and readable: +- The `IsUnitDistanceFree` definition has a clear docstring. +- The main theorem's docstring explains the ε-formulation and its equivalence to limsup ≤ 1/4. +- The module docstring provides good mathematical context with LaTeX notation. +- Variable names (`A`, `ε`, `R₀`, `R`) follow standard mathematical conventions. + +**Minor suggestions:** +- The repeated `EuclideanSpace ℝ (Fin 2)` in line 75–76 could be aliased with a `let` or `variable` for conciseness, though this is a matter of taste. +- The expression `(0 : EuclideanSpace ℝ (Fin 2))` appears twice; a local notation or `set origin := ...` could reduce clutter. + +**Verdict:** Readable. No significant issues. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is precise and unambiguous: +- "Upper density" has a standard definition via limsup of measure ratios. +- "Measurable subset of ℝ²" is well-defined. +- "No two points distance 1 apart" is unambiguous. +- The specific question "is m₁ ≤ 1/4?" is a clear yes/no question. + +The only subtlety is the choice of ε-δ formulation vs. a direct limsup statement. The formalization handles this correctly by noting their equivalence in the docstring. + +**Verdict:** Fully formalizable. No ambiguity. + +## 6. Correctness + +**Mathematical analysis of the formalization:** + +- **`IsUnitDistanceFree` (line 53–54):** Defined as `∀ x ∈ A, ∀ y ∈ A, dist x y ≠ 1`. This correctly excludes all pairs (including x = y, but `dist x x = 0 ≠ 1` so self-pairs are harmless). Mathematically correct. + +- **Measure and ball (lines 75–76):** Uses `volume` (Lebesgue measure on `EuclideanSpace ℝ (Fin 2)`) and `Metric.ball 0 R`. The ball is centered at 0, but upper density is translation-invariant, so centering at 0 is without loss of generality. Correct. + +- **ε-formulation of limsup (lines 73–76):** The statement says: for all ε > 0, there exists R₀ > 0 such that for all R ≥ R₀, λ(A ∩ B_R)/λ(B_R) ≤ 1/4 + ε. This is equivalent to limsup_{R→∞} λ(A ∩ B_R)/λ(B_R) ≤ 1/4. Correct. + +- **`answer(True)` (line 70):** The answer is True because m₁ ≤ 1/4 was proved by [ACMVZ23] (they showed the stronger m₁ ≤ 0.247 < 1/4). Correct. + +- **Division by measure of ball:** When R > 0, `volume (Metric.ball 0 R)` is positive and finite in ℝ², so `.toReal` is well-defined and positive, making the division meaningful. When R = 0, the ball is empty and both numerator and denominator are 0, giving 0/0. However, since R₀ > 0 and R ≥ R₀, the division is always well-defined in the quantified range. Correct. + +- **Measurability requirement (line 72):** The statement requires `MeasurableSet A`, which is necessary to ensure `volume (A ∩ Metric.ball 0 R)` is well-defined. Correct. + +**Verdict:** The formalization is mathematically correct and complete for the specific question asked (m₁ ≤ 1/4). No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `IsUnitDistanceFree` could be shared across ~6 problems; density is appropriately inlined | +| Citations | Accurate; match source paper; minor: Croft not mentioned | +| Variants | Primary question captured; tighter bounds not formalized (acceptable) | +| Readability | Good; minor cosmetic improvements possible | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/235.md b/ai-review/235.md new file mode 100644 index 0000000000..cf3e0eaff1 --- /dev/null +++ b/ai-review/235.md @@ -0,0 +1,118 @@ +# Review: Erdős Problem 235 + +**File:** `FormalConjectures/ErdosProblems/235.lean` + +--- + +## 1. Code Reuse + +There is significant duplication across Problems 220, 235, and 854, all of which define nearly identical helper concepts independently: + +| Concept | Problem 235 | Problem 220 | Problem 854 | +|---------|-------------|-------------|-------------| +| Primorial | `primorial` (product form) | — | `primorial` (recursive form) | +| Sorted coprimes | `sortedCoprimes` | `sortedTotatives` | `coprimeList` | +| Gap analysis | `countSmallGaps` | `sumSquaredGaps` | `consecutiveDiffs` | + +**`primorial`**: Defined identically in concept in both 235 and 854, but with different implementations (product vs recursive). These should be unified into a shared definition. The product-form definition in 235 (`∏ i ∈ Finset.range k, nth Nat.Prime i`) is arguably cleaner for reasoning about properties, while 854's recursive form may be easier to compute with. + +**`sortedCoprimes` vs `sortedTotatives` vs `coprimeList`**: All three compute essentially the same thing — the sorted list of integers less than `n` coprime to `n`. The key difference is that 235's `sortedCoprimes` does *not* filter out 0, while 220 and 854 both explicitly require `0 < a`. For `n > 1` (which is the case for all primorials with `k ≥ 1`), this doesn't matter since `gcd(0, n) ≠ 1`. However, for the edge case `n = 1`, `sortedCoprimes` includes 0 while the others don't. A shared definition (preferably with the `0 < a` guard, matching standard "totatives" convention) would reduce redundancy. + +**Recommendation:** Extract `primorial`, a shared sorted-coprimes definition, and a generic consecutive-gaps utility into `FormalConjectures/Util/` or a shared number theory helpers file, then import from all three problems. + +--- + +## 2. Citations + +**Reference tag mismatch:** The formalization labels the Hooley reference as `[Ho65]` but cites "Acta Arith. **8** (1963), 343–347". The tag suggests 1965, while the bibliographic data says 1963. The erdosproblems.com website also says "Hooley (1965)". There are in fact two relevant Hooley papers: + +- Hooley, C., *On the difference of consecutive numbers prime to n*, Acta Arith. **8** (1963), 343–347. +- Hooley, C., *On the difference between consecutive numbers prime to n*, I & II, Math. Z. **131** (1973), and J. London Math. Soc. (2) **1** (1965). + +The citation tag should be corrected to `[Ho63]` if the 1963 paper is intended, or the bibliographic details should be updated if the 1965 paper is intended. The website attributes the solution to 1965, so `[Ho65]` with corrected bibliographic details may be more appropriate. + +**Er55c citation:** The website attributes the problem to `[Er55c]`, which matches the formalization. No issue here. + +**Missing related problem reference:** The website notes that Problem 234 is "a more difficult variant using actual primes instead of primorials." This cross-reference is absent from the docstring. + +--- + +## 3. Variants + +**The formalization captures the Erdős conjecture but not the full Hooley result.** The docstring states "Hooley proved that the limiting distribution is exponential: $f(c) = 1 - e^{-c}$," but the formal theorem only asserts: + +```lean +∃ f : ℝ → ℝ, Continuous f ∧ + ∀ c : ℝ, 0 ≤ c → + Tendsto (fun k => gapFraction k c) atTop (nhds (f c)) +``` + +This says a continuous limit *exists* but does not pin down its form. A stronger variant capturing Hooley's full result would be: + +```lean +theorem erdos_235_hooley : + ∀ c : ℝ, 0 ≤ c → + Tendsto (fun k => gapFraction k c) atTop (nhds (1 - Real.exp (-c))) +``` + +This stronger statement implies the current one (since `1 - exp(-c)` is continuous). The current formalization is not incorrect — it faithfully captures the original Erdős *conjecture* — but a variant with the explicit exponential form would capture what was actually *proved*. + +**Wraparound gap variant:** Some formulations treat the coprime residues cyclically (mod $N_k$), including the gap from $a_{\varphi(N_k)}$ back to $a_1 + N_k$. This gives exactly $\varphi(N_k)$ gaps instead of $\varphi(N_k) - 1$. The formalization uses the non-cyclic version. Both lead to the same limit, but the cyclic version is arguably more natural for a distribution question. + +**Related Problem 234:** The website notes Problem 234 as a harder analogue using primes instead of primorials. The formalization does not mention this connection. + +--- + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- **Naming:** `sortedCoprimes` could be renamed to `sortedTotatives` for consistency with Problem 220 and standard number-theoretic terminology ("totatives of $n$" = positive integers less than $n$ coprime to $n$"). +- **`countSmallGaps`:** The recursive definition is clear. An alternative using `List.zip` with `List.tail` could be considered for clarity, but the current form is acceptable. +- **Namespace:** The use of `namespace Erdos235` is clean and prevents name collisions with the duplicate definitions in 854. +- **Docstrings:** The module docstring and theorem docstring are informative and well-written. + +--- + +## 5. Formalizability + +**Assessment: High formalizability with minor ambiguities.** + +The problem as stated on erdosproblems.com is precise enough to formalize unambiguously in its core content. The specific ambiguities are: + +1. **Denominator of the fraction:** Should it be $\varphi(N_k)$ (number of residues) or $\varphi(N_k) - 1$ (number of consecutive gaps)? These are asymptotically equivalent, so the limit is the same. The formalization uses $\varphi(N_k)$, which matches the website's statement. **Low ambiguity.** + +2. **Cyclic vs. linear gaps:** Whether to include the wraparound gap. The website statement uses indices $2 \le i \le \varphi(N_k)$, suggesting no wraparound. The formalization matches this. **Low ambiguity.** + +3. **Scope of "continuous function of $c$":** The original conjecture asks whether the limit "is a continuous function of $c$." The formalization interprets this as: there exists a continuous function $f$ such that pointwise convergence holds. This is the standard interpretation. **No ambiguity.** + +4. **What exactly Erdős conjectured vs. what Hooley proved:** The conjecture is about existence of a continuous limit; Hooley identified the limit as $1 - e^{-c}$. The formalization correctly captures the conjecture. **No ambiguity in intent; see Variants above for completeness.** + +--- + +## 6. Correctness + +**Overall assessment: Mathematically correct with minor issues.** + +### Correct aspects: +- The `primorial` definition correctly computes the product of the first `k` primes using 0-indexed `Nat.nth Nat.Prime`. +- The `gapFraction` correctly computes the fraction of small gaps among coprime residues. +- The theorem statement correctly formalizes the Erdős conjecture: existence of a continuous limiting distribution for the gap fractions. +- The `atTop` filter and `nhds` topology are the right choices for expressing the limit. + +### Issues: + +**Issue 1 (Minor): `sortedCoprimes` includes 0 for `n = 1`.** +When `n = 1`, `Finset.range 1 = {0}` and `Nat.Coprime 0 1` is true (since `gcd(0,1) = 1`). So `sortedCoprimes 1 = [0]`. This is non-standard — totatives of 1 are conventionally empty or `{1}` depending on convention. However, `primorial 0 = 1` (empty product) is the only case where this arises, and for all `k ≥ 1`, `primorial k > 1`, so this edge case does not affect the limit. **No impact on correctness of the theorem.** + +**Issue 2 (Minor): Division by `Nat.totient Nk` when it could be zero.** +`Nat.totient 0 = 0` and `Nat.totient 1 = 1`, so for `primorial 0 = 1` we get division by 1 (fine), and `primorial k` for `k ≥ 1` has `totient > 0` (fine). Division by zero in Lean returns 0 by convention, so there's no unsoundness even in degenerate cases. **No impact on correctness.** + +**Issue 3 (Moderate): Theorem is weaker than what was proved.** +The theorem asserts existence of a continuous limit but does not specify $f(c) = 1 - e^{-c}$. The docstring claims "Hooley proved that the limiting distribution is exponential," creating a mismatch between the informal description and the formal statement. This is not *incorrect* — the formalization captures a true theorem — but it is *incomplete* relative to the known result. An experienced mathematician would note this gap. + +**Issue 4 (Cosmetic): Citation inconsistency.** +As noted in §2, `[Ho65]` tag with a 1963 publication date is inconsistent. + +### Verdict: +The formalization is **mathematically sound** and correctly captures the Erdős conjecture. The incompleteness (not stating $f(c) = 1 - e^{-c}$) is a deliberate or incidental design choice rather than a mathematical error. No flaws would cause the `sorry`-free version to be false. diff --git a/ai-review/237.md b/ai-review/237.md new file mode 100644 index 0000000000..9134022509 --- /dev/null +++ b/ai-review/237.md @@ -0,0 +1,105 @@ +# Review: Erdős Problem 237 + +## 1. Code Reuse + +**Counting function.** The local `countingFunction` uses `Set.ncard (A ∩ Set.Icc 1 N)`. Several other Erdős problems define near-identical counting functions: +- `countInRange` in `ErdosProblems/337.lean` uses `Finset.range(N+1).filter(· ∈ A).card` over `{0,…,N}`. +- `Set.interIio` / `Set.interIcc` from `FormalConjecturesForMathlib/Order/Interval/Finset/Basic.lean` provide general intersection-with-interval utilities. + +These are not directly interchangeable (337 uses `{0,…,N}` via `Finset.range`, 237 uses `Set.Icc 1 N` via `ncard`), but a unified counting utility could serve both. No existing shared definition is currently available. + +**Representation count.** The `countRepresentations` function is structurally similar to `repCount` definitions in 871/870/763/764/328 (which count representations as a + b with both in A), but here one summand must be prime and the other in A, so it is genuinely different and not reusable. + +**Relation to Problem 236.** Problem 236 formalizes the special case A = {2^k} and uses a completely different (computable) style with `List.range` and `filter`. There is no opportunity for reuse between 236 and 237 in their current forms. + +**Verdict:** No existing code can be directly repurposed. The bespoke definitions are appropriate. + +## 2. Citations + +The website (erdosproblems.com/237) lists references from Erdős (1950, 1961, 1973) and the solution by Chen and Ding (2022). The docstring in 237.lean lists: + +| Lean file | Website | +|-----------|---------| +| [Er50] Erdős, P., 1950. | ✓ Matches (original result for A = {2^k}) | +| [Er55c] Erdős, P., 1955. | ✗ **Not listed on website** | +| [Er61] Erdős, P., 1961. | ✓ Matches | +| [Er73] Erdős, P., 1973. | ✓ Matches | +| [ChDi22] Chen, W. and Ding, Y., 2022. | ✓ Matches | + +**Issues:** +- **[Er55c] appears in the Lean file but is not listed on the website.** It may be a valid reference (Erdős wrote many papers in 1955), but its provenance should be verified or it should be removed for consistency with the website. +- The `@[category]` tag on the theorem references `[Er55c, Er61, Er73]` but omits `[Er50]` and `[ChDi22]`. This is inconsistent with the docstring and the website. The theorem tag should include the key references, especially [ChDi22] since it is the solution. +- All references lack full bibliographic details (journal names, titles, volume/page numbers). This is a common pattern across the codebase, but the review instructions ask for citations "as they exist on the website." The website itself only provides short-form references, so the current level of detail is acceptable. + +## 3. Variants + +The website notes: + +> "The assumption |A ∩ {1,…,N}| ≫ log N can be replaced with just the assumption that A is infinite." + +This **stronger result** (proved by Chen–Ding) is mentioned in the docstring but is **not formalized as a separate theorem or variant**. This is a notable omission — the Chen–Ding result is strictly stronger and arguably more natural. + +A second theorem like: +```lean +theorem erdos_237_strong : + (∀ A : Set ℕ, A.Infinite → + ∀ M : ℕ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ countRepresentations A n ≥ M) := by + sorry +``` +would capture the full strength of the Chen–Ding result. + +The website also notes a relation to Problem 236 (the special case A = {2^k}). Problem 236 is already formalized separately, which is appropriate. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The helper definitions (`countRepresentations`, `countingFunction`) have clear docstrings. +- The main theorem docstring accurately describes the mathematical content. +- The namespace `Erdos237` is clean. +- **Minor:** The limsup conclusion `∀ M : ℕ, ∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ countRepresentations A n ≥ M` is an unrolled version of "limsup f(n) = ∞". This is a reasonable choice for avoiding Filter machinery, but a comment noting this equivalence would aid readability. +- **Minor:** `open Set Real` opens both `Set` and `Real` namespaces, but only `Real.log` appears to use the `Real` opening. This is fine but slightly broad. + +## 5. Formalizability + +The problem is **clearly formalizable** with low ambiguity. + +- "f(n) counts the number of solutions to n = p + a" is precise. +- "limsup f(n) = ∞" is standard and unambiguous. +- The growth condition |A ∩ {1,…,N}| ≥ c·log N is standard. + +**One subtle point:** The notation "≫" (Vinogradov notation) in the original problem means "≥ c · log N for some constant c > 0 and all sufficiently large N." The formalization correctly unpacks this as `∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → ...`. This is faithful. + +**Ambiguity level: Very low.** The statement is precise enough to admit a unique formalization (up to definitional equivalences). + +## 6. Correctness + +The formalization is **mathematically correct** with one minor concern: + +**Correct aspects:** +- `countRepresentations` correctly counts primes p ≤ n with (n - p) ∈ A, which is equivalent to counting solutions to n = p + a. The condition `p ≤ n` ensures `n - p` is well-defined in ℕ. +- The growth hypothesis correctly captures |A ∩ {1,…,N}| ≫ log N. +- The conclusion correctly encodes limsup f(n) = ∞ as: for every M and every N, there exists n ≥ N with f(n) ≥ M. +- The `answer(True)` is correct: the problem asks "is it true that…?" and the answer is yes (proved by Chen–Ding). + +**Potential concern — counting with `Set.ncard`:** +- `countRepresentations` uses `Set.ncard` on `{p : ℕ | Nat.Prime p ∧ p ≤ n ∧ (n - p) ∈ A}`. This set is always finite (it's bounded by n), so `ncard` agrees with `Finset.card` of the corresponding finset. This is correct but may create proof obligations to show finiteness. Using `Finset`-based counting (as in 337.lean's `countInRange`) might be more proof-friendly, though the current approach is mathematically equivalent. +- Similarly, `countingFunction` uses `Set.ncard (A ∩ Set.Icc 1 N)`, which is finite since `Set.Icc 1 N` is finite. This is correct. + +**Edge case — n = 0 and n = 1:** +- For n = 0: no prime p satisfies p ≤ 0, so `countRepresentations A 0 = 0`. Fine. +- For n = 1: the only candidate is p = 1, but 1 is not prime. So `countRepresentations A 1 = 0`. Fine. +- For n = 2: p = 2 is checked, and we need 0 ∈ A. This is correct behavior. + +**No mathematical flaws detected.** The formalization is a faithful encoding of the problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities; bespoke definitions are appropriate | +| Citations | [Er55c] not on website; theorem tag inconsistent with docstring | +| Variants | Chen–Ding's stronger result (A infinite suffices) not formalized | +| Readability | Good; minor suggestion to comment the unrolled limsup | +| Formalizability | Very low ambiguity; clearly formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/24.md b/ai-review/24.md new file mode 100644 index 0000000000..eb61af710d --- /dev/null +++ b/ai-review/24.md @@ -0,0 +1,164 @@ +# Review: Erdős Problem 24 + +**File:** `FormalConjectures/ErdosProblems/24.lean` + +--- + +## 1. Code Reuse + +**No significant reuse issues, but related infrastructure exists.** + +Several other Erdős problems in the codebase work with C₅ and triangle-free graphs: + +- **Problem 23** (`FormalConjectures/ErdosProblems/23.lean`, line 57) defines `blowupC5 (n : ℕ) : SimpleGraph (ZMod 5 × Fin n)` — the blow-up of C₅ that serves as the extremal example for Problem 24. This definition uses `ZMod 5` for cyclic arithmetic instead of `Fin 5`. Problem 24 could reference this as the tight example in its docstring. +- **Problem 608** (`FormalConjectures/ErdosProblems/608.lean`, line 49) defines `numEdgesInC5` — a different counting problem (edges in C₅ vs. copies of C₅), but the `Finset.filter` + adjacency pattern is structurally very similar to Problem 24's cycle enumeration. +- **Problem 567** (`FormalConjectures/ErdosProblems/567.lean`) uses `SimpleGraph.cycleGraph 5` from Mathlib. One could consider defining the "labeled C₅ count" as a standalone utility (since both Problems 24 and 608 need variants of cycle counting), but given the different counting targets, this is not essential. + +The `G.CliqueFree 3` encoding of triangle-freeness is standard and used consistently across Problems 23, 24, and others. No duplication concerns here. + +**Recommendation:** No changes needed. The formalization is self-contained and the cycle-counting approach is specific enough that extracting a shared definition would add complexity without clear benefit. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/24](https://www.erdosproblems.com/24):** + +The website lists: + +- **Status:** Solved (proved in the affirmative) +- **References:** Er90, Er92b, Er97b, Er97f, Gr12, HHKNR13 +- **Additional context:** Győri initially proved the bound 1.03n⁵, later improved by Füredi, before the exact bound was proved independently by Grzesik and by Hatami–Hladký–Král–Norine–Razborov. +- **Generalization noted:** Erdős posed a broader question for odd r ≥ 5 (see §3). + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved]` | Solved | **Correct.** | +| AMS classification | `AMS 5` | Graph theory (combinatorics) | **Correct.** | +| Citation Gr12 | Full: Grzesik, A., _On the maximum number of five-cycles in a triangle-free graph_. JCTB (2012), 1061–1066. | Same | **Correct.** | +| Citation HHKNR13 | Full: Hatami, H., Hladký, J., Král, D., Norine, S., and Razborov, A., _On the number of pentagons in triangle-free graphs_. JCTA (2013), 722–732. | Same | **Correct.** | +| Erdős references | Not cited | Er90, Er92b, Er97b, Er97f | **Missing.** The four Erdős references for the original problem posing are absent. These are typically included in other formalizations in the repository. | +| Prior partial results | Not mentioned | Győri (bound 1.03n⁵), Füredi (improvement) | **Missing.** The docstring could note these as historical context. | + +**Recommendation:** Add the Erdős references (Er90, Er92b, Er97b, Er97f) to the docstring for completeness. Consider a brief mention of Győri and Füredi's prior partial results. + +--- + +## 3. Variants + +**One notable variant is missing: the generalization to odd cycles of arbitrary length.** + +The website states that Erdős posed a broader conjecture: + +> For odd r ≥ 5, if a graph has rn vertices and odd girth at least r (i.e., the shortest odd cycle has length ≥ r), then it contains at most nʳ copies of Cᵣ. + +For r = 5, "odd girth at least 5" is equivalent to "triangle-free" (no odd cycles of length 3), so Problem 24 is the r = 5 case. The general conjecture could be formalized as: + +```lean +@[category research open, AMS 5] +theorem erdos_24_general : + ∀ (r : ℕ) (hr : Odd r) (hr5 : 5 ≤ r) (n : ℕ) + (G : SimpleGraph (Fin (r * n))) (h : DecidableRel G.Adj), + haveI := h + (∀ k : ℕ, Odd k → 3 ≤ k → k < r → G.CliqueFree k) → -- odd girth ≥ r + (Finset.univ.filter (fun (f : Fin r → Fin (r * n)) => + Function.Injective f ∧ + ∀ i : Fin r, G.Adj (f i) (f (i + 1)))).card + ≤ (Finset.univ.filter (fun (f : Fin r → Fin (r * n)) => + Function.Injective f ∧ + ∀ i : Fin r, G.Adj (f i) (f (i + 1)))).card -- placeholder bound +``` + +Note: The odd girth condition would more precisely be expressed using cycle-freeness rather than clique-freeness. The condition "no odd cycle of length k" is not the same as `CliqueFree k`; it would require a dedicated `OddGirth` or cycle-freeness predicate. For r = 5, triangle-freeness (`CliqueFree 3`) suffices since the only odd cycle shorter than 5 is the triangle. For r ≥ 7, one would also need to exclude C₅, C₇, etc., which is not directly captured by `CliqueFree`. + +**Assessment:** The r = 5 case (the original Problem 24) is correctly formalized. The generalization is a natural companion conjecture that remains open for r ≥ 7. Including it would require additional infrastructure for odd girth, which may be beyond the scope of this problem file. + +--- + +## 4. Readability + +The code is clean and well-organized. Specific observations: + +- **Module docstring:** Clear, states the result and provides full references. The connection between the problem and the proof papers is well-documented. +- **Theorem docstring:** Excellent. It explicitly explains the labeled vs. unlabeled counting convention and the 10× factor (5 rotations × 2 reflections). This is crucial for understanding why the bound is `10 * n ^ 5` rather than `n ^ 5`. +- **Namespace:** `Erdos24` is appropriate. +- **Opens:** `open SimpleGraph Finset` is minimal and appropriate. +- **`haveI` pattern:** The `haveI := h` for `DecidableRel G.Adj` is standard Lean/Mathlib style for making the decidability instance available to `Finset.filter`. + +**Minor suggestion:** The docstring refers to "labeled 5-cycles" but could additionally note that the extremal graph achieving the bound is the balanced blow-up of C₅ (linking to Problem 23's `blowupC5`). + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The conjecture "every triangle-free graph on 5n vertices contains at most n⁵ copies of C₅" is precise. The only interpretive question is the meaning of "copies": + +- **Labeled copies** (injective homomorphisms Cᵣ → G): each unordered C₅ gives exactly 10 labeled copies (5 rotations × 2 reflections of the Dihedral group D₅). +- **Unlabeled copies** (subgraphs isomorphic to C₅): each is a set of 5 vertices with a unique cyclic ordering up to symmetry. + +The formalization correctly chooses to count labeled copies and adjusts the bound accordingly (10 · n⁵ instead of n⁵). This is a standard and clean approach in formal combinatorics — counting labeled copies avoids the need to define quotients by automorphism groups. + +**Key observation for triangle-free graphs:** In a triangle-free graph, any 5-cycle is necessarily an *induced* 5-cycle (adding any chord to a C₅ creates a triangle). This means there is no ambiguity between "copies of C₅" and "induced copies of C₅" for this particular problem. The formalization's approach of checking only the 5 cycle edges (without verifying absence of chords) is therefore correct. + +**Ambiguity level: Essentially none.** The problem is one of the most precisely stated in the Erdős collection. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Vertex set: `Fin (5 * n)` + +Using `Fin (5 * n)` directly (rather than an abstract `Fintype V` with `Fintype.card V = 5 * n`, as Problem 23 does) is a valid design choice. Any simple graph on 5n vertices is isomorphic to one on `Fin (5 * n)`, so this loses no generality. It simplifies the statement by avoiding the need for a cardinality hypothesis. + +**Edge case n = 0:** `Fin 0` is the empty type. There are no injective functions `Fin 5 → Fin 0`, so the filter is empty (card = 0). The bound is `10 * 0 ^ 5 = 0`. Both sides are 0. ✓ + +### Triangle-freeness: `G.CliqueFree 3` + +This is the standard Mathlib encoding. `CliqueFree 3` means there is no 3-clique (complete subgraph on 3 vertices), which is exactly triangle-freeness. ✓ + +### Cycle counting via filter + +```lean +(Finset.univ.filter (fun (f : Fin 5 → Fin (5 * n)) => + Function.Injective f ∧ + ∀ i : Fin 5, G.Adj (f i) (f (i + 1)))).card +``` + +This counts injective functions `f : Fin 5 → Fin (5 * n)` such that `f(i)` is adjacent to `f(i + 1)` for all `i : Fin 5`. The critical question is whether `Fin 5` arithmetic wraps around correctly: + +- `(0 : Fin 5) + 1 = 1` ✓ +- `(1 : Fin 5) + 1 = 2` ✓ +- `(2 : Fin 5) + 1 = 3` ✓ +- `(3 : Fin 5) + 1 = 4` ✓ +- `(4 : Fin 5) + 1 = 0` ✓ (since `Fin` addition is modular: `(4 + 1) % 5 = 0`) + +This is confirmed by Mathlib's `Fin.val_add_eq_ite` lemma, which establishes that `Fin n` addition is `(a + b) % n`. The five adjacency conditions therefore capture exactly the five edges of a 5-cycle: `f(0)–f(1)–f(2)–f(3)–f(4)–f(0)`. ✓ + +### Injectivity ensures a proper cycle + +`Function.Injective f` guarantees that the 5 vertices `f(0), ..., f(4)` are pairwise distinct, so the labeled mapping describes a genuine cycle (not a closed walk with repeated vertices). ✓ + +### The bound: `10 * n ^ 5` + +Each unordered C₅ on vertices {a, b, c, d, e} with cycle a–b–c–d–e–a contributes exactly 10 injective functions satisfying the adjacency condition: +- 5 rotations: (a,b,c,d,e), (b,c,d,e,a), (c,d,e,a,b), (d,e,a,b,c), (e,a,b,c,d) +- 2 directions: clockwise and counterclockwise +- Total: 5 × 2 = 10 + +This is exactly |Aut(C₅)| = |D₅| = 10, the order of the dihedral group of the pentagon. The labeled count is therefore 10 times the unlabeled count. Since the original conjecture bounds the unlabeled count by n⁵, the labeled bound of 10 · n⁵ is correct. ✓ + +### Tightness + +The balanced blow-up of C₅ (defined as `blowupC5 n` in Problem 23) has 5n vertices, is triangle-free, and contains exactly n⁵ unordered C₅ cycles (one for each choice of one vertex from each of the 5 parts in cyclic order). This gives 10 · n⁵ labeled copies, showing the bound is tight. The formalization does not assert tightness, which is appropriate — it only states the upper bound. + +### `DecidableRel G.Adj` hypothesis + +The `DecidableRel G.Adj` hypothesis is necessary for `Finset.filter` to be computable. This is a standard technical requirement in Lean/Mathlib formalizations involving finite sets. The `haveI := h` pattern correctly registers it as a typeclass instance. ✓ + +**Verdict: Correct and complete.** The formalization faithfully captures Erdős Problem 24. The labeled-counting approach with the 10× adjustment is mathematically sound, the `Fin 5` modular arithmetic correctly encodes cycle adjacency, and the bound is tight (as witnessed by the blow-up of C₅). No mathematical flaws are present. The only omission is the general odd-cycle variant (§3), which is a separate conjecture. diff --git a/ai-review/240.md b/ai-review/240.md new file mode 100644 index 0000000000..43c3b8c26e --- /dev/null +++ b/ai-review/240.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 240 + +## 1. Code Reuse + +The custom `smoothNumbers` definition in `Erdos240` (line 45) is **duplicated nearly identically** in `Erdos675` (line 69). The two definitions are: + +- **240:** `{n : ℕ | 0 < n ∧ ∀ q : ℕ, Nat.Prime q → q ∣ n → q ∈ P}` +- **675:** `{n | n ≥ 1 ∧ ∀ p : ℕ, Nat.Prime p → p ∣ n → p ∈ P}` + +These are definitionally equal (`0 < n ↔ n ≥ 1` for `ℕ`). One of these should be extracted into a shared utility or one file should import the other's definition. + +**Mathlib's `Nat.smoothNumbers`** (in `Mathlib.NumberTheory.SmoothNumbers`) is parameterized by a natural number threshold `n` (all prime factors < n), not by an arbitrary set of primes. Mathlib also provides `Nat.factoredNumbers` parameterized by a `Finset` of primes. Neither is directly suitable here because the problem requires an *infinite* set of primes, which cannot be a `Finset`. The custom definition is therefore justified for this problem's needs. + +**Recommendation:** Consolidate the `smoothNumbers` definitions from problems 240 and 675 into a shared file (e.g., in `FormalConjectures/Util/` or `FormalConjecturesForMathlib/`), since both take `P : Set ℕ` and define the same concept. + +## 2. Citations + +The website ([erdosproblems.com/240](https://www.erdosproblems.com/240)) provides: + +| Citation | Website | Formalization | +|----------|---------|---------------| +| [Er61,p.226] | Erdős (1961), p.226 | Listed as `[Er61]` — **missing page reference "p.226"** | +| [Er65b] | Erdős (1965b) | ✅ Present | +| [Po18] | Pólya (1918) | ✅ Present | +| [Ti73] | Tijdeman (1973) | ✅ Present | +| Related: Problem 368 | Mentioned on website | **Not mentioned in formalization** | + +**Issues:** +- The citation `[Er61]` should be `[Er61,p.226]` to match the website. +- The related problem 368 is not cross-referenced in the docstring. + +## 3. Variants + +The docstring mentions Tijdeman's stronger quantitative result: for any ε > 0, there exists an infinite set of primes P such that a_{i+1} − a_i ≫ a_i^{1−ε}. This is **not formalized as a separate theorem**. Given that this is the actual content of Tijdeman's proof (and strictly stronger than the yes/no answer), it would be valuable to capture it as a variant. + +A possible formalization of Tijdeman's quantitative result: + +```lean +theorem erdos_240.tijdeman_quantitative : + ∀ ε : ℝ, ε > 0 → + ∃ P : Set ℕ, Set.Infinite P ∧ (∀ p ∈ P, Nat.Prime p) ∧ + ∃ c : ℝ, c > 0 ∧ ∀ᶠ n in Filter.atTop, + n ∈ smoothNumbers P → + ∀ m ∈ smoothNumbers P, n < m → c * (n : ℝ) ^ (1 - ε) ≤ (m - n : ℝ) +``` + +The website also mentions the finite case (answer is yes for finite sets of primes, via Pólya's theorem [Po18]). This is noted in the docstring but also not formalized as a separate lemma. + +## 4. Readability + +The code is **well-structured and readable**. Specific positives: + +- The `smoothNumbers` definition is clearly documented with a docstring. +- The equivalence reformulation ("for every bound B, only finitely many...") is explained in the main theorem's docstring. +- The module docstring provides good mathematical context. + +**Minor suggestion:** The variable name `B` in the theorem could be annotated with a brief comment (e.g., "gap bound"), though the docstring already explains the reformulation adequately. + +## 5. Formalizability + +The problem is **fully precise and unambiguous**. The original statement asks whether there exists an infinite set of primes P such that the consecutive gaps of P-smooth numbers tend to infinity. This is a well-defined question with no room for misinterpretation. + +The reformulation used in the Lean statement (for every B, the set of smooth numbers with another smooth number within distance B is finite) is a standard and correct way to express "consecutive gaps tend to infinity" without needing to explicitly enumerate the sequence {a_i}. + +**Ambiguity assessment: None.** The problem is cleanly formalizable. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification of the equivalence:** The original statement asks for lim(a_{i+1} − a_i) = ∞ where {a_1 < a_2 < ⋯} enumerates the P-smooth numbers. The formalization instead states: for every B : ℕ, the set {n ∈ smoothNumbers P | ∃ m ∈ smoothNumbers P, n < m ∧ m ≤ n + B} is finite. + +- **(⇒)** If lim(a_{i+1} − a_i) = ∞, then for every B, there exists N such that a_{i+1} − a_i > B for all i ≥ N. Any n in the bad set must equal some a_i with a_{i+1} ≤ a_i + B, so i < N. Thus the bad set is finite. ✓ +- **(⇐)** If the bad set is finite for every B, then for every B there are only finitely many smooth numbers n with any smooth number in (n, n + B]. In particular, only finitely many consecutive gaps are ≤ B. Since the P-smooth numbers form an infinite set (containing all products of primes in P, which is infinite), the gaps must eventually exceed B. Since B was arbitrary, the gaps tend to infinity. ✓ + +**Note on the ∃ m quantifier:** The condition uses "∃ m ∈ smoothNumbers P, n < m ∧ m ≤ n + B" rather than requiring m to be the *next* smooth number after n. These are equivalent: if the next smooth number a_{i+1} > n + B, no smooth number exists in (n, n + B]; conversely, if some m exists in that interval, then a_{i+1} ≤ m ≤ n + B. ✓ + +**Edge case — n = 1:** Since 1 ∈ smoothNumbers P for any P (vacuously, 1 has no prime factors), and P is infinite so there are primes in P producing further smooth numbers, 1 will appear in the bad set for sufficiently large B. This is harmless since the bad set is allowed to be nonempty, just finite. ✓ + +**The answer value `answer(True)`** is correct: the problem was resolved affirmatively by Tijdeman [Ti73]. ✓ + +**The `@[category research solved, AMS 11]` tag** correctly reflects that this is a solved research problem in number theory (AMS class 11). ✓ + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Duplicate `smoothNumbers` definition with Problem 675; should be consolidated | +| Citations | Missing page reference "p.226" for [Er61]; missing cross-reference to Problem 368 | +| Variants | Tijdeman's quantitative bound (a_{i+1} − a_i ≫ a_i^{1−ε}) not formalized as a variant | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/241.md b/ai-review/241.md new file mode 100644 index 0000000000..c8460d7ef3 --- /dev/null +++ b/ai-review/241.md @@ -0,0 +1,142 @@ +# Review: Erdős Problem 241 + +**File:** `FormalConjectures/ErdosProblems/241.lean` + +--- + +## 1. Code Reuse + +The codebase has substantial Sidon set (B₂ set) infrastructure in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`: + +- `IsSidon` — the standard pairwise-sum-distinctness predicate +- `maxSidonSubsetCard` — maximum cardinality of a Sidon subset of a given finset +- Related lemmas for insertion, subset closure, decidability, etc. + +Problem 30 (`ErdosProblems/30.lean`) defines `h(N) := Finset.maxSidonSubsetCard (Finset.Icc 1 N)` and directly reuses this infrastructure. + +**Problem 241 does not reuse any of this.** It defines its own `f` function from scratch using a multiset-based filter on `(Icc 1 N).powerset`. While this is justified for general `r` (since no B_h infrastructure exists for h > 2), the variant `erdos_241.variants.r_eq_2` asserts `BoseChowlaConjecture 2`, which is mathematically equivalent to a statement about `maxSidonSubsetCard`. It would be cleaner to either: + +- State `r_eq_2` in terms of `Erdos30.h`, or +- Add a bridging lemma showing `f N 2 = Erdos30.h N` (i.e., that the multiset definition at r=2 coincides with `maxSidonSubsetCard`). + +This would connect the two formalizations and avoid silently duplicating the Sidon concept under a different definition. + +**Recommendation:** Add a lemma or comment connecting `f N 2` to `maxSidonSubsetCard (Icc 1 N)`. + +--- + +## 2. Citations + +The file references: + +| Ref | In file | On website | +|----------|---------|------------| +| [BoCh62] | ✅ Bose, R. C. and Chowla, S. (1962/63) | ✅ | +| [Gr01] | ✅ Green, Ben (2001) | ✅ | +| [Gu04] | ✅ Guy, Richard K. (2004) | ✅ | +| erdosproblems.com/241 | ✅ | — | +| erdosproblems.com/30 | ✅ | ✅ (cross-referenced) | +| OEIS A387704 | ❌ Not mentioned | ✅ Listed on website | + +The citations are well-formatted and match the website's references. The only minor omission is the OEIS sequence A387704, which the website lists. This is not critical but could be included for completeness. + +**Note:** The file includes a link to problem 30, which is appropriate since the r=2 case is precisely problem 30. This cross-reference is good practice. + +--- + +## 3. Variants + +The formalization captures five statements: + +| Variant | Description | Status | Captured? | +|---------|-------------|--------|-----------| +| Main conjecture | f(N) ~ N^{1/3} | Open | ✅ `erdos_241` | +| Lower bound | (1+o(1))N^{1/3} ≤ f(N) | Solved (Bose-Chowla) | ✅ `lower_bound` | +| Upper bound | f(N) ≤ ((7/2)^{1/3}+o(1))N^{1/3} | Solved (Green) | ✅ `upper_bound` | +| Generalization | f(N,r) ~ N^{1/r} for all r ≥ 2 | Open | ✅ `generalization` | +| r = 2 case | BoseChowlaConjecture 2 | Solved | ✅ `r_eq_2` | + +This is comprehensive. All variants mentioned on the erdosproblems.com page are captured. + +--- + +## 4. Readability + +**Strengths:** +- The `BoseChowlaConjecture` definition cleanly abstracts the general conjecture, making the generalization and r=2 statements concise. +- Docstrings on each theorem are clear and cite the relevant results. +- The formalization note in the `f` docstring explaining the generalization to arbitrary `r` is helpful. + +**Suggestions:** +- The `f` definition is somewhat dense. A named predicate like `IsB_hSet A r` (or `HasDistinctRFoldSums`) extracted from the filter body would improve readability and reusability: + ```lean + def HasDistinctRFoldSums (A : Finset ℕ) (r : ℕ) : Prop := + ∀ m₁ m₂ : Multiset ℕ, m₁.card = r → m₂.card = r → + (∀ x ∈ m₁, x ∈ A) → (∀ x ∈ m₂, x ∈ A) → + m₁.sum = m₂.sum → m₁ = m₂ + ``` + This would make the filter in `f` simply `.filter (fun A ↦ HasDistinctRFoldSums A r)`. +- Minor: the `letI` in `f` could be `let` since there's no typeclass being introduced. + +--- + +## 5. Formalizability + +The problem is **clearly formalizable** with low ambiguity. The phrase "all sums a+b+c are distinct aside from trivial coincidences" has a standard mathematical interpretation: the set is a B₃ set, meaning the multiset representation function is injective. The multiset formulation in the code captures this precisely. + +**Ambiguity assessment: Low.** The only potential ambiguity is what "trivial coincidences" means, but this is universally understood in additive combinatorics to mean permutations of the summands. The multiset approach handles this automatically since multiset equality is permutation-invariant. + +The generalization parameter `r` is well-handled, with the constraint `r ≥ 2` in the generalization theorem preventing degenerate cases (r=0 would give N^{1/0} = ∞, and r=1 is trivially true). + +--- + +## 6. Correctness + +### Definition of `f` + +The definition correctly captures the maximum size of a B_r subset of {1, ..., N}: + +1. **Multiset formulation:** Using `Multiset ℕ` with cardinality constraint `m.card = r` and membership constraint `∀ x ∈ m, x ∈ A` correctly models r-element submultisets drawn from A (with repetition). Requiring `m₁.sum = m₂.sum → m₁ = m₂` is exactly the B_h injectivity condition. ✅ + +2. **Repetition handling:** The definition allows repeated elements in the multiset (e.g., {a, a, b} with a appearing twice). This is the standard convention for B_h sets — it ensures sums like a+a+b and c+d+e are also required to be distinct. ✅ + +3. **Trivial coincidences:** Multiset equality (which is order-independent) correctly accounts for the fact that a+b+c = b+a+c is a "trivial" coincidence. ✅ + +4. **Edge cases:** `candidates.sup card` returns 0 if the finset is empty, but candidates always contains at least the empty set (which vacuously satisfies the condition), so this is well-behaved. For N ≥ 1, any singleton is a valid B_r set, so f(N, r) ≥ 1. ✅ + +### Main conjecture (`erdos_241`) + +States `f N 3 ~ N^{1/3}` with `answer(sorry)` — correct for an open problem. ✅ + +### Lower bound + +States ∃ε = o(1) such that (1 + ε(N)) · N^{1/3} ≤ f(N, 3) eventually. This correctly formalizes "f(N) ≥ (1+o(1))N^{1/3}" — the ε may be negative (tending to 0), giving a bound like (1 − δ)N^{1/3} for small δ. This is equivalent to liminf f(N)/N^{1/3} ≥ 1. ✅ + +### Upper bound + +States ∃ε = o(1) such that f(N, 3) ≤ ((7/2)^{1/3} + ε(N)) · N^{1/3} eventually. Correctly formalizes Green's bound. The constant (7/2)^{1/3} ≈ 1.519 matches the literature. ✅ + +### `BoseChowlaConjecture` and generalization + +The general conjecture `f N r ~ N^{1/r}` for r ≥ 2 is correctly stated. The guard `hr : r ≥ 2` is appropriate. ✅ + +### `r_eq_2` variant + +Claims `BoseChowlaConjecture 2`, i.e., `f N 2 ~ N^{1/2}`. This is the classical Sidon set result and is correctly marked as solved. However, as noted in §1, there is no formal connection to the `IsSidon`/`maxSidonSubsetCard` infrastructure used in Problem 30. The two definitions are mathematically equivalent but this equivalence is not established in the code. This is **not an error**, but is a missed opportunity for coherence. ✅ (correct but isolated) + +### Overall correctness verdict + +**The formalization is mathematically correct and complete.** No errors were found. The multiset-based definition is the right abstraction for B_h sets, all asymptotic statements are properly formulated, and the known results and open conjectures are accurately separated and attributed. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Could connect `f N 2` to existing `IsSidon`/`maxSidonSubsetCard` | +| Citations | Complete; minor: OEIS A387704 not mentioned | +| Variants | All website variants captured | +| Readability | Good; could extract B_h predicate for clarity | +| Formalizability | Low ambiguity, clearly formalizable | +| Correctness | ✅ Correct and complete | diff --git a/ai-review/246.md b/ai-review/246.md new file mode 100644 index 0000000000..4dc27744fa --- /dev/null +++ b/ai-review/246.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 246 + +## 1. Code Reuse + +**`IsComplete` duplicates `IsAddComplete` from `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean`.** + +The local definition: + +```lean +def IsComplete (S : Set ℕ) : Prop := + ∃ N : ℕ, ∀ n : ℕ, N < n → + ∃ F : Finset ℕ, (↑F ⊆ S) ∧ ∑ x ∈ F, x = n +``` + +is semantically equivalent to `IsAddComplete` (which uses `Filter.atTop` and `subsetSums`): + +```lean +def IsAddComplete (A : Set M) : Prop := + ∀ᶠ k in Filter.atTop, k ∈ subsetSums A +``` + +The `IsAddComplete` version is more idiomatic (uses Mathlib filter API) and comes with useful lemmas (`IsAddComplete.mono`, strong completeness, etc.). The file should import `AdditivelyComplete.lean` and use `IsAddComplete` instead of defining `IsComplete` locally. + +Note that Problem 254 (the generalization referenced in the docstring) also inlines an equivalent definition rather than using `IsAddComplete` — this is a codebase-wide consistency issue. + +The `twoPowerSet` definition has no existing equivalent elsewhere and is appropriately defined locally. + +## 2. Citations + +The docstring currently lists: +- `[Bi59]` Birch, B. J., *Note on a problem of Erdős*. +- `[Ca60]` Cassels, J. W. S. +- `[Er61]` Erdős, P. +- `[He00b]` Hegyvári, N. + +According to [erdosproblems.com/246](https://www.erdosproblems.com/246), additional references exist: +- **[FaCh17]** Fang & Chen — improved the threshold to triply exponential. +- **[Yu24]** Yu — showed any large n can be written as a sum of distinct elements of this form, all exceeding n/(log n)^{1+o(1)}. +- **Davenport** (noted in [Bi59]) — observed the result holds even with l ≪_{a,b} 1. + +The existing citations `[Ca60]`, `[Er61]`, and `[He00b]` lack full bibliographic details (title, journal, year). Only `[Bi59]` has a partial title. These should be fleshed out to match the standard set by Problem 254's docstring (which includes journal and year). + +## 3. Variants + +The website documents several extensions that are **not captured** by the current formalization: + +1. **Davenport's refinement**: The result holds even when the exponent l is bounded by a constant depending on a and b. This is a strictly stronger statement. +2. **Hegyvári's explicit bound** [He00b]: Provides a quadruple-exponential upper bound for the threshold N beyond which all integers are representable. +3. **Fang & Chen's improvement** [FaCh17]: Improves the threshold to triply exponential. +4. **Yu's strengthening** [Yu24]: Any large n can be written as a sum of distinct elements from {a^k b^l}, where each summand exceeds n/(log n)^{1+o(1)}. + +Of these, Davenport's refinement would be the most natural variant to add, as it strengthens the core statement. Yu's result is a qualitatively different (and very recent) strengthening. + +## 4. Readability + +- **Naming**: `twoPowerSet` is somewhat misleading — it suggests "powers of two" rather than "products of two power towers." A name like `powerProductSet` or `mulPowersSet` would more clearly convey "the set of products a^k · b^l." +- **Namespace**: The namespace `Erdos246` is fine and consistent with the codebase. +- **Structure**: The file is clean and well-organized: helper definitions, then the theorem. The docstrings are adequate. +- **Minor**: The docstring on `twoPowerSet` says "natural numbers of the form $a^k \cdot b^\ell$ for $k, \ell \geq 0$" — this is correct and clear. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is fully precise: +- "Let a, b ≥ 2 with gcd(a,b) = 1" — clear arithmetic conditions. +- "The set of all numbers of the form a^k · b^l (with k, l ≥ 0)" — well-defined set. +- "is complete: every sufficiently large positive integer can be written as a sum of distinct elements of this set" — standard notion with no ambiguity. + +The only minor interpretive question is whether "numbers of the form a^k · b^l" means the set of *values* (collapsing duplicates from different (k,l) pairs) or the multiset. Since a^k · b^l with gcd(a,b)=1 gives distinct values for distinct (k,l) pairs (by unique factorization), this distinction is moot. The formalization correctly uses a Set ℕ, which collapses duplicates. + +**Ambiguity score: 0/5** (no ambiguity). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`twoPowerSet` definition**: `{n : ℕ | ∃ k l : ℕ, n = a ^ k * b ^ l}` correctly captures {a^k · b^l : k, l ≥ 0}. Note that 0 is not in this set when a, b ≥ 1 (since a^k * b^l ≥ 1), which is appropriate since the problem concerns positive integers. + +- **`IsComplete` definition**: The existential `∃ N, ∀ n, N < n → ...` correctly captures "every sufficiently large." Since N : ℕ and n : ℕ with N < n, we get n ≥ 1, ensuring we only consider positive integers. The use of `Finset ℕ` for F ensures elements are distinct (finsets have no duplicates), and `↑F ⊆ S` ensures all summands come from S. The sum `∑ x ∈ F, x` correctly computes the sum of the elements. + +- **Theorem statement**: The hypotheses `2 ≤ a`, `2 ≤ b`, and `Nat.Coprime a b` faithfully encode "a, b ≥ 2 with gcd(a,b) = 1." The conclusion `IsComplete (twoPowerSet a b)` is exactly the claim. + +- **Tags**: `@[category research solved, AMS 5 11]` — the problem is indeed solved (proved by Birch), so `solved` is correct. AMS classification 11 (Number Theory) is appropriate; AMS 5 (Combinatorics) is reasonable given the subset-sum flavor. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `IsComplete` should be replaced by `IsAddComplete` from `AdditivelyComplete.lean` | +| Citations | Missing [FaCh17] and [Yu24]; existing citations lack full bibliographic details | +| Variants | Davenport's bounded-l refinement and Yu's large-summand strengthening not captured | +| Readability | Good overall; `twoPowerSet` name is slightly misleading | +| Formalizability | Unambiguous, clearly formalizable (0/5 ambiguity) | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/254.md b/ai-review/254.md new file mode 100644 index 0000000000..b82115b505 --- /dev/null +++ b/ai-review/254.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 254 + +## 1. Code Reuse + +**`distNearestInt` is duplicated across at least 5 files.** The identical definition `min (Int.fract x) (1 - Int.fract x)` appears in 254.lean, 464.lean, 466.lean, and 1147.lean (each in their own namespace). Problem 495.lean uses an equivalent but syntactically different definition `|x - round x|`. Problem 465.lean names it `distNearestInt465`. All of these should be consolidated into a single shared utility definition. + +**The conclusion could use `IsAddComplete` from `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean`.** The current conclusion: +```lean +∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ S : Finset ℕ, ↑S ⊆ A ∧ ∑ x ∈ S, x = n +``` +is exactly equivalent to `IsAddComplete A`, which unfolds to `∀ᶠ k in Filter.atTop, k ∈ subsetSums A` where `subsetSums A = {n | ∃ B : Finset M, ↑B ⊆ A ∧ n = ∑ i ∈ B, i}`. Using `IsAddComplete` would improve consistency with related problems (e.g., 253.lean, 346.lean) that already use these utilities. + +## 2. Citations + +The formalization references: +- **[Er61]** Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961), 6, 221–254. + +The website (erdosproblems.com/254) also mentions: +- **[Ca60]** — Cassels' related result proving the conjecture under stronger conditions (specifically: replacing the growth condition with `(|A ∩ [1,2x]| - |A ∩ [1,x]|) / log log x → ∞` and replacing `∑ ‖nθ‖ = ∞` with `∑ ‖nθ‖² = ∞`). + +The Cassels reference [Ca60] is **missing** from the formalization's docstring. It should be added, especially since it establishes an important partial result. + +## 3. Variants + +The website mentions **Cassels' stronger result** as a related theorem. This variant (with the `log log x` growth rate and squared distance condition) is **not captured** by the formalization. It could be worth adding as a separate theorem or at least mentioning in the docstring for context. + +No other variants are indicated on the website. + +## 4. Readability + +The formalization is reasonably readable. Suggestions: + +- **Use `IsAddComplete`** for the conclusion (as noted above) — this makes the mathematical intent immediately clear to anyone familiar with the codebase vocabulary. +- **The `hsum` hypothesis** encodes "∑ diverges" as `¬ Summable (fun n => if n ∈ A then distNearestInt (θ * n) else 0)`. While correct, this is somewhat indirect. A more readable encoding might sum over the subtype `↥A` or use `tsum` divergence more directly. However, the current encoding is pragmatically sound for Lean. +- **The module docstring** and the theorem docstring are slightly different (the module docstring says `θ ∈ (0,1)` while the original problem says "every irrational θ" — see Correctness below). These should be reconciled. + +## 5. Formalizability + +The problem is **precise enough to be formalizable**. The main components are: + +1. A growth condition on the counting function of A — unambiguous. +2. A divergence condition on `∑ ‖nθ‖` — unambiguous once the norm notation is understood. +3. The conclusion that A is additively complete — unambiguous. + +**Minor ambiguity:** The notation ‖x‖ for distance to nearest integer is standard in analytic number theory but could be confused with other norms. The formalization correctly resolves this. + +**Assessment: Low ambiguity.** The statement is a clean, well-posed conjecture. + +## 6. Correctness + +### 6a. The irrationality condition is dropped + +The original Erdős problem states the sum condition for **every irrational θ**, but the formalization quantifies over **all θ ∈ (0,1)** (rational and irrational alike). The docstring in the theorem also says "for every θ ∈ (0,1)" rather than "for every irrational θ ∈ (0,1)". + +**Mathematical impact: Negligible.** For rational θ = p/q in lowest terms, ‖nθ‖ ≥ 1/q for all n not divisible by q. The growth condition forces A to have unboundedly many elements in each interval (x, 2x], and these cannot all be divisible by q. Therefore the sum ∑_{n ∈ A} ‖nθ‖ diverges automatically for rational θ given the growth hypothesis. The two conditions are **equivalent** given `hgrowth`, so the formalization is not mathematically wrong — but it does not faithfully match the original statement, and a reader comparing the formal statement to the literature would notice the discrepancy. + +### 6b. Natural subtraction is safe + +The growth condition uses `Set.ncard (A ∩ Set.Icc 1 (2 * x)) - Set.ncard (A ∩ Set.Icc 1 x)` with natural number subtraction. Since `A ∩ Set.Icc 1 x ⊆ A ∩ Set.Icc 1 (2 * x)`, the first count is always ≥ the second, so natural subtraction does not truncate. This is correct. + +### 6c. Discretization of x is fine + +The growth condition quantifies over `x : ℕ` rather than `x : ℝ`. Since A ⊆ ℕ, the counting function is a step function that only changes at natural values, so the natural-number limit captures the same behavior as a real-valued limit. This is correct. + +### 6d. The conclusion correctly encodes "sum of distinct elements" + +Using `Finset ℕ` ensures the elements in the sum are distinct (Finset elements are unique), and `↑S ⊆ A` ensures they come from A. This is correct. + +### 6e. Overall assessment + +The formalization is **mathematically correct** and captures the intended conjecture. The only deviation from the original statement is the omission of the irrationality restriction on θ, which is **inconsequential** given the growth hypothesis but should ideally be documented or corrected for fidelity to the source. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `distNearestInt` duplicated across 5+ files; conclusion should use `IsAddComplete` | +| Citations | Missing [Ca60] (Cassels) reference from the website | +| Variants | Cassels' stronger variant not captured | +| Readability | Good overall; would benefit from using `IsAddComplete` | +| Formalizability | Low ambiguity; cleanly formalizable | +| Correctness | Mathematically correct; irrationality condition dropped but inconsequential given growth hypothesis | diff --git a/ai-review/255.md b/ai-review/255.md new file mode 100644 index 0000000000..fb65d60c67 --- /dev/null +++ b/ai-review/255.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 255 + +## 1. Code Reuse + +The `discrepancy` definition at line 39 uses the standard pattern: +```lean +(((range N).filter (fun n => a ≤ z n ∧ z n ≤ b)).card : ℝ) - (N : ℝ) * (b - a) +``` + +This counting-over-a-filtered-`Finset.range` pattern is duplicated across many files in the codebase: +- **Erdos 992** (`ErdosProblems/992.lean`): defines its own `discrepancy` for fractional-part sequences, with a supremum over intervals. +- **Erdos 492** (`ErdosProblems/492.lean`): defines `IsEquidistributed` using the same `(Finset.range N).filter (fun n => c ≤ x n ∧ x n < d)).card` pattern. +- **Equidistribution.lean** (`Books/UniformDistributionOfSequences/Equidistribution.lean`): defines `IsEquidistributed` with the same filter-and-count approach. +- **Erdos 988, 989** (`ErdosProblems/988.lean`, `989.lean`): geometric discrepancy variants (spherical caps, disks) with analogous structure. + +There is also `FormalConjecturesForMathlib/Data/Set/Density.lean` which provides `partialDensity`, `upperDensity`, and `lowerDensity` utilities that formalize asymptotic counting proportions. While these don't directly replace the discrepancy definition (which is a difference, not a ratio), they represent the closest existing infrastructure for this kind of counting. + +**Recommendation**: No immediate consolidation is needed since each problem's discrepancy notion is mathematically distinct. However, a shared utility for "count of sequence elements in an interval up to N" (i.e., `((Finset.range N).filter (fun n => a ≤ z n ∧ z n ≤ b)).card`) could reduce duplication across 255, 492, 992, and the equidistribution definitions. + +## 2. Citations + +The formalization currently states: +``` +[Sc68] Schmidt, W.M., Irregularities of distribution. VII. Acta Arith. 21 (1972), 45-50. +``` + +**Issues identified from [erdosproblems.com/255](https://www.erdosproblems.com/255):** + +1. **Mismatched citation tag and paper**: The tag `[Sc68]` implies a 1968 publication, but the paper cited (Acta Arith. 21, 1972, pp. 45–50) is the 1972 paper, which should be tagged `[Sc72]`. The website distinguishes `[Sc68]` and `[Sc72]` as separate references. The 1968 paper by Schmidt is the one that first proved the basic result; the 1972 paper proved the stronger statement about all but countably many intervals of the shape `[0, x]`. + +2. **Missing original problem references**: The website lists the original Erdős references as `[Er61]` and `[Er64b]`. These are not mentioned in the formalization's docstring. + +3. **Missing later reference**: Tijdeman and Wagner `[TiWa80]` obtained the essentially best possible quantitative strengthening. This is not mentioned. + +**Recommendation**: Correct the citation tag to `[Sc72]` for the 1972 paper, or add the actual `[Sc68]` paper details separately. Add `[Er61]`, `[Er64b]`, and `[TiWa80]` references as documented on the website. + +## 3. Variants + +The formalization captures only the base result (existence of a sub-interval with unbounded discrepancy). The website documents two significant stronger results that are not formalized: + +1. **Schmidt's 1972 strengthening** `[Sc72]`: For any sequence in `[0,1]`, all but countably many intervals of the shape `[0, x]` have unbounded discrepancy. This is a much stronger structural statement—it constrains the "bad" intervals to be of a specific form and shows almost all of them witness unbounded discrepancy. + +2. **Tijdeman–Wagner optimal bound** `[TiWa80]`: For almost all intervals of the form `[0, x)`, + $$\limsup_{N \to \infty} \frac{|D_N([0,x))|}{(\log N)} \gg 1.$$ + This provides a quantitative lower bound on the growth rate of the discrepancy, which is essentially best possible. + +**Recommendation**: Add at least one variant capturing Schmidt's 1972 result. Erdos 992 provides a good template for how to formalize multiple variants of a discrepancy problem. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring uses `n ≤ N` in the mathematical notation (`\#\{n \leq N : z_n \in I\}`) but the implementation uses `range N`, which gives `n < N`. This is a standard 0-indexed vs 1-indexed discrepancy that doesn't affect the mathematics, but the docstring should be consistent with the code. It should say `n < N` to match `range N`. +- The `open Finset Classical` at line 30 is appropriate; `Classical` is needed for the decidability of the filter predicate on reals. +- The helper definition `discrepancy` is well-documented with both LaTeX and English. + +**Recommendation**: Change `n \leq N` to `n < N` in the docstring for consistency with the code. + +## 5. Formalizability + +The problem is **highly formalizable** with **low ambiguity**. + +The core concepts are all standard and well-defined: +- An infinite sequence `z : ℕ → ℝ` valued in `[0,1]` +- The discrepancy of a sequence with respect to a sub-interval is an elementary counting expression +- The conclusion (unbounded discrepancy for some interval) is a clear first-order statement + +The only minor source of ambiguity in the original problem is what "interval" means—open, closed, half-open? The formalization uses closed intervals `[a, b]`, which is a reasonable default. The website's notation `D_N(I)` uses a generic interval `I`. For discrepancy theory, the choice between open/closed/half-open endpoints typically does not matter for the unboundedness conclusion (a single point cannot contribute more than 1 to the count), so this choice is mathematically inconsequential. + +**Assessment**: Unambiguous. The formalization faithfully captures the intended mathematical content. + +## 6. Correctness + +**The core formalization is mathematically correct.** Detailed analysis: + +- **Hypothesis** (`∀ n, 0 ≤ z n ∧ z n ≤ 1`): Correctly constrains the sequence to `[0, 1]`. ✓ +- **Conclusion structure** (`∃ a b, 0 ≤ a ∧ a ≤ b ∧ b ≤ 1 ∧ ...`): Correctly requires the interval `[a, b]` to be a sub-interval of `[0, 1]`. The condition `a ≤ b` (rather than `a < b`) technically allows degenerate intervals where `a = b`, but this is harmless—a degenerate interval has measure zero, so its discrepancy equals the count of exact hits, which is bounded for any fixed point. The existential quantifier would simply never need to choose such an interval. ✓ +- **Unboundedness** (`∀ M : ℝ, ∃ N : ℕ, |discrepancy z a b N| ≥ M`): This correctly captures `limsup_{N→∞} |D_N(I)| = ∞`. The standard formalization would use `Filter.atTop` and `Filter.Frequently`, but the explicit quantifier form is equivalent and arguably more readable. ✓ +- **Discrepancy definition**: `(((range N).filter (fun n => a ≤ z n ∧ z n ≤ b)).card : ℝ) - (N : ℝ) * (b - a)` correctly computes the signed discrepancy (count minus expected). The absolute value is taken in the theorem statement via `|discrepancy z a b N|`. ✓ +- **Answer direction** (`answer(True)`): The problem is proved in the affirmative (Schmidt 1968), so `True` is correct. ✓ + +**One subtlety worth noting**: The unboundedness condition `∀ M : ℝ, ∃ N : ℕ, |discrepancy z a b N| ≥ M` is slightly stronger than `limsup = ∞` in a formal sense—it says the absolute discrepancy exceeds every real bound, whereas `limsup = ∞` in Lean's `Filter.limsup` formalism might handle the `⊥` filter case differently for degenerate sequences. However, since `ℕ` is infinite and `atTop` is not `⊥`, these are equivalent here. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Common counting pattern duplicated; minor opportunity for shared utility | +| Citations | **Needs correction**: tag/paper mismatch (`[Sc68]` vs 1972 paper); missing `[Er61]`, `[Er64b]`, `[TiWa80]` | +| Variants | **Missing**: Schmidt's 1972 strengthening and Tijdeman–Wagner quantitative bound | +| Readability | Good; minor docstring inconsistency (`n ≤ N` vs `n < N`) | +| Formalizability | Unambiguous; highly formalizable | +| Correctness | **Correct and complete** for the base problem as stated | diff --git a/ai-review/256.md b/ai-review/256.md new file mode 100644 index 0000000000..e764bcc5e5 --- /dev/null +++ b/ai-review/256.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 256 + +## 1. Code Reuse + +Several other files define nearly identical "supremum of norm over the unit circle" patterns: + +- **Problem 523** (`523.lean:41-43`): `supNormCircle` — `sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = 1 ∧ x = ‖...‖}` +- **Problem 227** (`227.lean:50-51`): `maxModulus` — `sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖}` +- **Problem 230** (`230.lean:63-67`): Avoids `sSup` entirely, using an existential `∃ z : ℂ, ‖z‖ = 1 ∧ ...` + +The `unitCircleMaxProd` definition follows the same `sSup`-over-unit-circle idiom as 523 and 227. A shared utility like `supNormOnCircle (f : ℂ → ℂ) : ℝ := sSup {y : ℝ | ∃ z : ℂ, ‖z‖ = 1 ∧ y = ‖f z‖}` could serve all three problems, though the gain is modest. No existing utility in `FormalConjecturesForMathlib/` currently provides this. + +## 2. Citations + +The docstring references `[Er61, Er64b]` for the original conjecture and `[BeKo96]` for Belov–Konyagin. The website (erdosproblems.com/256) provides more context: + +- **Erdős–Szekeres** proved `lim f(n)^{1/n} = 1` and `f(n) > √(2n)`. +- **Atkinson**: `log f(n) ≪ n^{1/2} log n` +- **Odlyzko**: `log f(n) ≪ n^{1/3} (log n)^{4/3}` +- **Belov–Konyagin [BeKo96]**: `log f(n) ≪ (log n)^4` +- **Bourgain–Chang** (variant with strict inequalities): `log f*(n) ≪ (n log n)^{1/2} log log n` +- Related to the **Chowla cosine problem** [#510]. + +The citations in the formalization are consistent with the website but given in shorthand form (e.g., `[Er61]` without full bibliographic details). This is acceptable given the project conventions, though adding full author/title/year entries as done in `230.lean` would improve traceability. + +## 3. Variants + +The website mentions a **variant with strict inequalities** where the $a_i$ are required to be strictly increasing (denoted $f^*(n)$). Bourgain and Chang proved `log f*(n) ≪ (n log n)^{1/2} log log n`. This variant is **not captured** in the formalization. + +The connection to the **Chowla cosine problem** (Problem #510) is also not mentioned. + +The formalization captures only the specific yes/no conjecture ("does log f(n) ≫ n^c?") and not the broader open problem of precisely estimating f(n). This is reasonable and is noted in the docstring. + +## 4. Readability + +The code is well-structured and readable: + +- The two-definition approach (`unitCircleMaxProd` then `erdos256_f`) cleanly separates the "sup over the circle" from the "inf over sequences." +- Docstrings include LaTeX and clearly explain the mathematical meaning. +- The namespace `Erdos256` keeps definitions contained. + +Minor suggestion: The docstring for `erdos256_f` says "the largest real number such that..." but mathematically it's an infimum (which may not be attained). The second sentence correctly says "infimum," so this is a cosmetic issue rather than a mathematical error. + +## 5. Formalizability + +The problem as stated on the website is precise and clearly formalizable. The key objects — products of `(1 - z^{a_i})`, the unit circle, supremum/infimum — all have standard Lean/Mathlib counterparts. There is no meaningful ambiguity in the statement. + +One subtlety worth noting: the use of `sSup` and `sInf` in Lean's conditionally complete lattice requires the sets to be nonempty and bounded. Both conditions hold here: +- `unitCircleMaxProd`: the set is nonempty (z = 1 exists on the unit circle) and bounded above (continuous function on the compact unit circle). +- `erdos256_f`: the set is nonempty (any constant positive sequence works) and bounded below by 0 (since all values are norms). + +These are not bugs, but a formal proof would need to establish these conditions. + +**Assessment: Unambiguous and fully formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Definition analysis:** + +- `unitCircleMaxProd n a`: Correctly computes `sup_{|z|=1} |∏_i (1 - z^{a_i})|`. The product `∏ i : Fin n, (1 - z ^ (a i))` correctly ranges over all indices. ✓ +- `erdos256_f n`: Correctly computes `inf` over all non-decreasing sequences of positive integers. The constraint `(∀ i, 0 < a i)` correctly encodes $a_i ≥ 1$ for natural numbers, and `Monotone a` on `Fin n` gives $a_1 \leq \cdots \leq a_n$. ✓ + +**Theorem analysis:** + +- The RHS asserts: ∃ c > 0, C > 0, N₀ such that for all n ≥ N₀, `log f(n) ≥ C · n^c`. This is the standard formalization of `log f(n) ≫ n^c` in analytic number theory (Vinogradov notation). ✓ +- `answer(False)` correctly records that this conjecture was disproved (by Belov–Konyagin). ✓ +- The tag `category research solved` is appropriate: while the broader estimation problem remains open, the specific yes/no conjecture formalized here was indeed resolved. ✓ + +**Edge cases:** +- `n = 0`: The empty product gives `unitCircleMaxProd 0 a = 1`, so `erdos256_f 0 = 1` and `log(1) = 0`. The theorem only requires the bound for `n ≥ N₀`, so this causes no issues. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity: shared unit-circle-sup utility with 523/227 | +| Citations | Consistent with website; shorthand form acceptable but could be expanded | +| Variants | Strict-inequality variant (f*) and Chowla cosine connection not captured | +| Readability | Good; minor docstring wording ("largest" vs "infimum") | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete for the specific conjecture formalized | diff --git a/ai-review/260.md b/ai-review/260.md new file mode 100644 index 0000000000..a9815778dd --- /dev/null +++ b/ai-review/260.md @@ -0,0 +1,119 @@ +# AI Review: Erdos Problem 260 + +**File:** `FormalConjectures/ErdosProblems/260.lean` + +## 1. Code Reuse + +The hypothesis of Erdos 260 — `StrictMono a` combined with `Tendsto (fun n => (a n : ℝ) / (n : ℝ)) atTop atTop` — is **exactly** the definition of `HasFabryGaps` in `FormalConjecturesForMathlib/Analysis/HasGaps.lean:33`: + +```lean +def HasFabryGaps (n : ℕ → ℕ) : Prop := + StrictMono n ∧ Tendsto (fun k => n k / (k : ℝ)) atTop atTop +``` + +The formalization could be rewritten as: + +```lean +theorem erdos_260 : answer(sorry) ↔ + ∀ a : ℕ → ℕ, + HasFabryGaps a → + Irrational (∑' n, (a n : ℝ) / (2 : ℝ) ^ (a n)) := by + sorry +``` + +This would improve readability and connect the problem to the existing gap-sequence infrastructure. However, it would require importing `HasGaps.lean` rather than just `ProblemImports`, and inlining the definition is reasonable for a standalone problem statement. **Mild recommendation to use `HasFabryGaps`.** + +Several nearby problems share similar constructs: +- **Problem 259** (`259.lean`): `Irrational (∑' n, ... / 2^n)` — same series structure. +- **Problem 261** (`261.lean`): Uses `(a : ℝ) / (2 : ℝ) ^ a` terms and `StrictMono`. +- **Problem 262–268**: Various combinations of `StrictMono`, `Irrational`, `tsum`. + +No common helper is extracted for the `a_n / 2^{a_n}` series pattern, which appears in problems 260, 261, 265, and others. This is acceptable since extracting it would add complexity for minimal gain. + +## 2. Citations + +The current formalization cites only: + +> `[erdosproblems.com/260](https://www.erdosproblems.com/260)` + +The website lists the following references that are **not included** in the docstring: + +- **[Er74b]** Erdős, P., *Problems and results on combinatorial number theory III*. +- **[Er81h]** (p.180) — Erdős, P., likely a 1981 problem collection. +- **[Er81l]** — Erdős, P., another 1981 reference. +- **[Er88c]** (p.103) — Erdős, P., *Problems and results on combinatorial number theory*. +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. +- **[Va99]** (1.33) — likely Vajda or Vaaler, 1999. + +The neighboring problem 261 includes full citation formatting for several of these same references (Er74b, ErGr80, Er88c). The docstring for 260 should be expanded to include at least the primary references, especially **[ErGr80]** and **[Er74b]** which are the canonical sources. + +## 3. Variants + +The website describes several results and variants that are **not captured** by the current formalization: + +1. **Erdős's result under stronger gap condition:** Erdős proved irrationality when $a_{n+1} - a_n \to \infty$. This is a strictly stronger hypothesis than $a_n/n \to \infty$ and is already resolved. A solved variant could be added: + ```lean + theorem erdos_260.variants.consecutive_gaps_diverge : + ∀ a : ℕ → ℕ, StrictMono a → + Tendsto (fun n => (a (n+1) : ℝ) - (a n : ℝ)) atTop atTop → + Irrational (∑' n, (a n : ℝ) / (2 : ℝ) ^ (a n)) := by sorry + ``` + +2. **Erdős's result under asymptotic lower bound:** Erdős proved irrationality when $a_n \gg n\sqrt{\log n \log\log n}$. This is another resolved special case. + +3. **Erdős–Graham speculation:** They speculated that $\limsup (a_{n+1} - a_n) = \infty$ alone is **insufficient** to guarantee irrationality (i.e., a counterexample should exist), but no counterexample is known. This could be formalized as a separate open conjecture. + +**The current formalization captures only the main open question and misses all three variant directions.** + +## 4. Readability + +The code is concise and readable. Minor observations: + +- The `open Filter` on line 28 is appropriate but narrow; the only filter used is `atTop`. +- The docstring in the module header and the theorem docstring are nearly identical, which is fine for a single-theorem file. +- The cast `(a n : ℝ)` and `(n : ℝ)` are standard Lean idiom. +- The expression `(2 : ℝ) ^ (a n)` is clear; some nearby problems use the same pattern. + +**Overall readability is good.** The only improvement would be using `HasFabryGaps` as discussed in Section 1. + +## 5. Formalizability + +The problem is **highly formalizable** with **low ambiguity**: + +- "Strictly increasing sequence of natural numbers" maps cleanly to `StrictMono a` for `a : ℕ → ℕ`. +- "$a_n / n \to \infty$" maps to `Tendsto (fun n => (a n : ℝ) / (n : ℝ)) atTop atTop`. +- "Is $\sum a_n / 2^{a_n}$ irrational?" is a clear yes/no question, correctly modeled by `answer(sorry) ↔ ...`. + +**One subtle point on indexing:** The original problem uses 1-indexed notation ($a_1 < a_2 < \cdots$) while the formalization is 0-indexed (`a : ℕ → ℕ`). This is mathematically inconsequential because: +- The `tsum` includes the extra term $a_0/2^{a_0}$, which is rational (an integer divided by a power of 2). Adding or removing a rational term preserves irrationality. +- The Tendsto condition concerns behavior as $n \to \infty$, so the value at $n = 0$ (where division by zero occurs) is irrelevant since `atTop` filters away all finite initial segments. + +**Summability is guaranteed:** Under `StrictMono a`, we have $a(n) \geq n$ for all $n$. Since $x/2^x$ is eventually decreasing, $a(n)/2^{a(n)} \leq n/2^n$ for $n \geq 2$, and $\sum n/2^n < \infty$. So `tsum` always yields the correct value (not the default 0 for non-summable series). This is an implicit assumption that is satisfied but not stated. + +**Ambiguity assessment: Very Low.** The statement is precise and admits essentially one natural formalization. + +## 6. Correctness + +The formalization is **mathematically correct** for the main open question as stated on the website. + +**Positive aspects:** +- The `answer(sorry)` wrapper correctly handles the open yes/no nature of the problem. +- `StrictMono a` correctly captures strict increase. +- The Tendsto condition correctly captures $a_n/n \to \infty$. +- The `Irrational` predicate on the `tsum` is the right mathematical statement. +- The universal quantifier `∀ a : ℕ → ℕ` correctly asks whether irrationality holds for *all* such sequences. + +**No mathematical flaws identified.** The formalization faithfully represents the open problem. + +**Minor incompleteness:** The formalization does not capture the known partial results (Erdős's theorems under stronger conditions) or the Erdős–Graham speculation about `limsup` gaps. These are not flaws in the main statement but represent missed opportunities for additional formalizations of resolved variants. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `HasFabryGaps` could be used (mild recommendation) | +| Citations | Missing references [Er74b], [ErGr80], [Er88c], etc. | +| Variants | Three known variants not captured | +| Readability | Good | +| Formalizability | Very low ambiguity; clean formalization | +| Correctness | Correct and complete for the main open problem | diff --git a/ai-review/261.md b/ai-review/261.md new file mode 100644 index 0000000000..6df9c8a3d2 --- /dev/null +++ b/ai-review/261.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 261 + +**File:** `FormalConjectures/ErdosProblems/261.lean` + +--- + +## 1. Code Reuse + +The `HasErdos261Property` helper definition follows the standard pattern used throughout the Erdős problem formalizations. The closely related Problem 260 (`FormalConjectures/ErdosProblems/260.lean`) uses an identical sum form `(a n : ℝ) / (2 : ℝ) ^ (a n)` for infinite series, and the uncountable representations variant in 261 reuses this same expression with `HasSum`. There is no opportunity to extract a shared definition between 260 and 261 because 260 uses `tsum`/`Irrational` while 261 uses `Finset.sum`/equality and `HasSum`/`Set.Countable` — the surrounding structure differs enough that sharing would hurt readability. + +No relevant utilities in `FormalConjecturesForMathlib/` apply here. The `StrictMono`, `HasSum`, `Set.Infinite`, and `Set.Countable` usages all come directly from Mathlib. **No reuse issues.** + +## 2. Citations + +The formalization includes: +- **[Er74b]** — Erdős (1974) ✓ +- **[ErGr80]** — Erdős & Graham (1980) ✓ +- **[Er88c]** — Erdős (1988) ✓ +- **[BoLo90]** — Borwein & Loring (1990) ✓ + +**Missing citation:** The website lists **[TUZ20]** — Tengely, Ulas, & Zygadlo (2020), who computationally verified the property for all $n \leq 10000$. This reference is absent from the module docstring and should be added, e.g.: + +``` +[TUZ20] Tengely, Sz., Ulas, M., and Zygadlo, J., *On a problem of Erdős and Graham*. +``` + +The existing citation for [BoLo90] uses "Loring" but some sources give the second author as "Loring, T." — this matches. The full title on the website is *Some questions of Erdős and Graham on numbers of the form $\sum g_n / 2^{g_n}$*, which matches the formalization. + +## 3. Variants + +The formalization captures three statements: + +| Variant | Status | Captured? | +|---------|--------|-----------| +| Main conjecture: all positive $n$ have the property | Open | ✓ `erdos_261` | +| Infinitely many $n$ (Cusick; Borwein–Loring) | Solved | ✓ `erdos_261.variants.infinitely_many` | +| Uncountably many representations of some rational | Open | ✓ `erdos_261.variants.uncountable_representations` | + +The website also mentions a **weakened sub-variant**: "whether any rational $x$ admits at least two solutions" (i.e., two distinct strictly increasing sequences summing to the same rational). This is not formalized. It is a natural intermediate question between "at least one representation" and "uncountably many representations." Consider adding it as a variant if desired, though it is a minor omission since it is implied as weaker than the uncountable variant. + +## 4. Readability + +The code is well-structured. The `HasErdos261Property` helper definition cleanly separates the core concept from the theorem statements, and each variant has a clear docstring. The namespace `Erdos261` and `open scoped BigOperators` are appropriate. + +One minor note: the `noncomputable` annotation on `HasErdos261Property` is unnecessary since it defines a `Prop`, not data. This doesn't cause errors but is slightly misleading — it suggests computational content where there is none. Removing it would marginally improve clarity. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The main conjecture and infinitely-many variant are completely precise: "for all/infinitely many positive integers $n$, express $n/2^n$ as a finite sum of distinct terms $a/2^a$ with $a \geq 1$ and at least 2 terms." Every quantifier is explicit. + +The uncountable representations variant requires a small interpretive step: Erdős asks for "at least $2^{\aleph_0}$ solutions" and the formalization uses `¬ Set.Countable`. These are equivalent for this problem because the set of strictly increasing sequences $\mathbb{N} \to \mathbb{N}$ with the given constraints forms an analytic subset of the Polish space $\mathbb{N}^{\mathbb{N}}$, and by the perfect set theorem for analytic sets, any uncountable analytic set has cardinality exactly $2^{\aleph_0}$. This equivalence is non-trivial but standard and mathematically correct. + +## 6. Correctness + +**Assessment: Correct and complete.** + +**Main conjecture (`erdos_261`):** The formalization faithfully captures the problem. The use of `Finset ℕ` ensures the summands are distinct (since finsets have no duplicates). The constraint `2 ≤ S.card` ensures at least 2 terms. The constraint `∀ a ∈ S, 0 < a` ensures all indices are positive integers. The equality over `ℝ` is the natural choice. Note that $n$ is not excluded from $S$, but this is correct: if $n \in S$, the remaining positive terms would need to sum to 0, which is impossible, so no such $S$ exists — the constraint is self-enforcing. + +**Infinitely many variant (`erdos_261.variants.infinitely_many`):** Correctly formalized as `Set.Infinite` over the set satisfying the property. Correctly marked as `solved`. The docstring correctly attributes the result to Cusick and Borwein–Loring. + +**Uncountable representations variant (`erdos_261.variants.uncountable_representations`):** The formalization correctly requires: +1. $x$ is rational (via `∃ q : ℚ, x = (q : ℝ)`), +2. the set of representations is uncountable (via `¬ Set.Countable`), +3. each representation is a strictly increasing positive sequence with `HasSum` converging to $x$. + +This is mathematically sound. The use of `HasSum` (rather than `tsum`) is the right choice here, as it asserts both convergence and the value of the sum simultaneously. + +**No mathematical flaws identified.** + +--- + +## Summary + +| Category | Rating | Notes | +|----------|--------|-------| +| Code reuse | ✅ Good | No reuse opportunities missed | +| Citations | ⚠️ Minor issue | Missing [TUZ20] reference | +| Variants | ⚠️ Minor gap | "At least two representations" sub-variant not captured | +| Readability | ✅ Good | `noncomputable` on Prop is unnecessary but harmless | +| Formalizability | ✅ Excellent | Unambiguous, clearly formalizable | +| Correctness | ✅ Excellent | Mathematically sound, no flaws | diff --git a/ai-review/262.md b/ai-review/262.md new file mode 100644 index 0000000000..53cbc965eb --- /dev/null +++ b/ai-review/262.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 262 + +## 1. Code Reuse + +The `IsIrrationalitySequence` definition in `Erdos262` is distinct from those in Problems 263 and 264 — all three problems define genuinely different notions of "irrationality sequence" under separate namespaces, so no direct sharing is appropriate. However, there is a missed opportunity for cross-referencing: + +- **Problem 263** (`263.lean:35-36`) explicitly notes that its definition differs and points to 264, but does **not** reference 262's definition. +- **Problem 264** (`264.lean:39-40`) similarly references 263 but not 262. +- **Problem 262** does not reference 263 or 264 at all. + +Adding cross-references in the docstrings of all three would improve navigability. + +Additionally, **Problem 1051** (`1051.lean:40-41`) defines a `GrowthCondition` using `Filter.liminf` with `a_n^{1/2^n}` which is thematically similar to the double-logarithmic growth condition in 262. No direct reuse is possible, but the pattern of expressing growth conditions via `Filter.liminf`/`Filter.limsup` is relevant — the formalization of 262 chooses to express the limsup condition via `Filter.Frequently` instead, which is a valid alternative encoding. + +The `Real.iteratedLog` definition in `FormalConjecturesForMathlib/Analysis/SpecialFunctions/Log/Basic.lean` counts iterated natural-log applications. This is not directly usable here since 262 uses base-2 iterated logarithms, but it could inspire a more general iterated-log utility. + +## 2. Citations + +The formalization includes: +``` +[ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial +number theory. Monographies de L'Enseignement Mathematique (1980). + +[Er88c] Erdős, P. (1988). + +[Er75c] Erdős, P. (1975). + +[Ha91] Hančl, J. (1991). +``` + +**Issues:** + +- **Missing page numbers.** The website specifies `[ErGr80, p.63]` and `[Er88c, p.105]`. These should be included. +- **Incomplete citations.** `[Er88c]` should be: Erdős, P., *On the irrationality of certain series: problems and results*. New advances in transcendence theory (Durham, 1986), 102–109 (1988). (This full citation is already used in `1051.lean:27-28`.) +- **`[Er75c]` is vague.** No title or journal is given; the website also provides only the year. This is acceptable if no further information is available. +- **`[Ha91]` is incomplete.** Should include: Hančl, J., *Expression of real numbers with the help of infinite series*. Acta Arithmetica 59.2 (1991), 97–104. (Or whatever the precise reference is — the current citation gives only author and year.) + +## 3. Variants + +The formalization captures **only** Hančl's limsup result. Several results mentioned on the website are missing: + +1. **$a_n = 2^{2^n}$ is an irrationality sequence** (Erdős [Er75c]): Mentioned in the docstring but not formalized as a standalone theorem. This is already formalized as `erdos_264.variants.example` in Problem 264, but under a *different* definition of irrationality sequence. Under 262's definition, this should also be stated. + +2. **$a_n = n!$ is not an irrationality sequence**: Mentioned in the docstring but not formalized. + +3. **Necessary condition $a_n^{1/n} \to \infty$**: The website states that any irrationality sequence (in the sense of 262) must satisfy $a_n^{1/n} \to \infty$. This is not formalized. This is a weaker but conceptually important result. + +4. **Hančl's sharper result**: The website mentions that if $a_n \ll 2^{2^{n - F(n)}}$ where $F(n) < n$ and $\sum 2^{-F(n)} < \infty$, then $a_n$ is not an irrationality sequence. This stronger characterization is not captured. + +## 4. Readability + +The code is generally well-structured and readable. A few observations: + +- The `IsIrrationalitySequence` definition bundles three conditions with `∧`: `StrictMono a`, `∀ n, 0 < a n`, and the irrationality condition. This is clean and appropriate. +- The theorem statement uses `Filter.Frequently ... atTop` to express "infinitely often," which is the correct Mathlib idiom. It reads naturally once one knows that `Frequently` means "the set is cofinite-frequently true." +- The double application `Real.logb 2 (Real.logb 2 ...)` is slightly dense but is the natural way to express $\log_2(\log_2(\cdot))$. No improvement needed. +- The cast `(↑(a n) : ℝ)` is standard Lean style. +- Minor: the `open Filter` at module level is fine given the single theorem, but would benefit from `open scoped Topology` if more filter operations were added. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem as stated on the website asks "how slowly can $a_n$ grow?" which is inherently open-ended. However, the formalization correctly identifies and formalizes the *answer* — Hančl's theorem providing a lower bound on growth — rather than the vague question itself. This is the right approach. + +The definition of irrationality sequence is precise: a strictly increasing sequence of positive integers such that $\sum 1/(t_n a_n)$ is irrational for every sequence of positive integers $t_n$. There is no ambiguity here. The main subtlety is that there are *multiple inequivalent definitions* of irrationality sequence in the literature (as evidenced by Problems 263 and 264 using different definitions). The definition in 262 matches the one on the website for this problem. + +The limsup condition $\limsup \frac{\log_2 \log_2 a_n}{n} \geq 1$ is unambiguous and admits a clean formalization. + +## 6. Correctness + +**Assessment: Mathematically correct, with one minor concern.** + +**The main statement is correct.** The equivalence between: +- $\limsup_{n \to \infty} \frac{\log_2 \log_2 a_n}{n} \geq 1$ +- For all $c < 1$, $\log_2(\log_2(a_n)) > c \cdot n$ for infinitely many $n$ + +is standard real analysis. The formalization correctly encodes the second form using `Filter.Frequently` at `atTop`. + +**Edge case handling is sound.** Since `IsIrrationalitySequence` requires `∀ n, 0 < a n` and `StrictMono a`, we get $a_n \geq n + 1$ for all $n$. For small $n$, $\log_2(\log_2(a_n))$ may be non-positive (e.g., $a_0 = 1$ gives $\log_2(1) = 0$, then $\log_2(0)$ which in Lean's `Real.logb` evaluates to $0$). But since `Frequently atTop` only requires the property to hold for infinitely many $n$, finitely many edge cases are irrelevant. + +**One concern about the `solved` tag.** The problem is tagged `category research solved`, matching the website's "solved" status. However, what is formalized is specifically Hančl's *lower bound* result ($\limsup \geq 1$). The problem itself asks "how slowly can $a_n$ grow?" — and while Hančl's result essentially answers this (the answer is roughly $2^{2^n}$), one could argue that the formalization only captures the lower bound direction and not the full characterization. The upper bound ($a_n = 2^{2^n}$ is an irrationality sequence) is mentioned in the docstring but not formalized in this file. This is a reasonable scope choice but worth noting. + +**The `IsIrrationalitySequence` definition correctly requires convergence implicitly.** The use of `∑' n` (i.e., `tsum`) in Lean returns 0 for non-summable series, so the definition technically states that the `tsum` is irrational — which is vacuously harder to satisfy if the series diverges, since 0 is rational. This means the definition implicitly requires the series to converge to be meaningful, which aligns with mathematical intent (the series $\sum 1/(t_n a_n)$ converges for fast-growing $a_n$ and arbitrary positive $t_n$). + +**Summary:** The formalization is correct and well-crafted. The main areas for improvement are (a) completing the citations with page numbers and full references, (b) adding cross-references to Problems 263/264, and (c) optionally adding variant theorems for the example $a_n = 2^{2^n}$, the non-example $a_n = n!$, and the necessary condition $a_n^{1/n} \to \infty$. diff --git a/ai-review/265.md b/ai-review/265.md new file mode 100644 index 0000000000..8c647f32b3 --- /dev/null +++ b/ai-review/265.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 265 + +**File:** `FormalConjectures/ErdosProblems/265.lean` + +--- + +## 1. Code Reuse + +The closely related `FormalConjectures/ErdosProblems/263.lean` contains `erdos_263.variants.folklore`, which formalizes the folklore result that $\sum 1/a_n$ is irrational whenever $a_n^{1/2^n} \to \infty$. This result is referenced in the docstring of Problem 265 but not explicitly linked via Lean cross-references. Adding a `See also` or a doc-link to `erdos_263.variants.folklore` would clarify the connection. + +`FormalConjecturesForMathlib/Analysis/SpecialFunctions/NthRoot.lean` provides `Real.nthRoot` and related lemmas. However, Problem 265 uses `rpow` with exponent `1 / 2^n` rather than `nthRoot`, which is a reasonable choice — `rpow` is more natural for the doubly-exponential exponent and avoids the even/odd case splits in `nthRoot`. + +No other code in the codebase is directly reusable for the proof itself. + +## 2. Citations + +The formalization references: +- **[ErGr80]** — matches the website's `[ErGr80, p.64]` ✓ +- **[Er88c]** — matches the website's `[Er88c, p.104]` ✓ +- **[KoTa24]** — listed as `Kovač, V. and Tao, T. (2024)` without the paper title. + +**Issue:** The [KoTa24] citation is incomplete. Both `263.lean` and `266.lean` in this codebase give the full reference as: + +> Kovač, V. and Tao T., On several irrationality problems for Ahmes series. arXiv:2406.17593 (2024). + +The citation in `265.lean` should be updated to match this fuller form for consistency and traceability. + +## 3. Variants + +The formalization captures only Erdős's main conjecture ($a_n^{1/2^n} \to 1$). The website and literature suggest additional formalizable results: + +1. **Kovač–Tao doubly exponential construction (proved, [KoTa24]):** There exists a sequence satisfying both rationality conditions with $a_n^{1/n} \to \infty$ (in fact, with $a_n^{1/\beta^n} \to \infty$ for some $\beta > 1$). This is mentioned in the docstring but not formalized as a separate theorem. It would naturally complement the main conjecture by showing the conjectured bound is approximately tight. + +2. **The $\limsup$ variant (open):** The website highlights whether $\limsup a_n^{1/2^n} > 1$ is achievable as the key remaining open question. This could be formalized as a separate open problem. + +3. **Cantor's example (classical):** The observation that $a_n = \binom{n}{2}$ satisfies both conditions could be formalized as a concrete `example` or `theorem`, providing a useful sanity check. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The exponent expression `((a n : ℝ) ^ ((1 : ℝ) / (2 : ℝ) ^ (n : ℕ)))` has heavy type annotations. This is somewhat unavoidable in Lean to disambiguate `rpow` vs `npow`, but it could be slightly cleaner with a local `let` binding or notation, e.g.: + ```lean + let exp := fun n => ((a n : ℝ) ^ ((1 : ℝ) / (2 : ℝ) ^ (n : ℕ))) + ``` +- The file uses `open Filter` but not `open scoped Topology` (unlike the related `263.lean`). This is fine since no scoped topology notation is used, but consistency across the problem series is worth considering. +- The docstring is excellent — it provides mathematical context, historical notes, and the current status clearly. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem as stated on erdosproblems.com is phrased as an open-ended question ("How fast can $a_n$ grow?"), but Erdős's specific conjecture — that $a_n^{1/2^n} \to 1$ — is precise and unambiguous. The formalization correctly captures this specific conjecture rather than the vaguer question. + +All concepts involved (`StrictMono`, `HasSum`, rationality via `ℚ`-coercion, `Tendsto` to `nhds 1`) have standard Mathlib formalizations with well-understood semantics. The only potential subtlety is the meaning of "rational" for an infinite sum, which is correctly handled by requiring the existence of a rational $q$ such that the sum `HasSum`s to $(q : \mathbb{R})$. + +## 6. Correctness + +**Assessment: Correct and faithful to the mathematical intent.** + +Detailed verification: + +- **Sequence constraints:** `StrictMono a` captures "strictly increasing." The condition `∀ n, 2 ≤ a n` ensures $a_n \ge 2$ for all $n$, which is necessary to avoid division by zero in $1/(a_n - 1)$. This is mathematically equivalent to the website's "$1 \le a_1 < a_2 < \cdots$" since a strictly increasing sequence of naturals with $a_0 \ge 2$ automatically satisfies $a_n \ge n + 2$. ✓ + +- **Rationality of sums:** The hypothesis `∃ q : ℚ, HasSum (fun n => (1 : ℝ) / (a n : ℝ)) (q : ℝ)` correctly asserts both convergence and rationality simultaneously. Similarly for the shifted sum. ✓ + +- **The shifted sum:** `(1 : ℝ) / ((a n : ℝ) - 1)` computes $1/(a_n - 1)$. Since `a n ≥ 2`, we have `(a n : ℝ) - 1 ≥ 1 > 0`, so this is well-defined and positive. The coercion order (cast to ℝ first, then subtract 1) is correct — subtracting 1 from a natural number in ℕ would give truncated subtraction, which would be wrong. ✓ + +- **The conclusion:** `(a n : ℝ) ^ ((1 : ℝ) / (2 : ℝ) ^ (n : ℕ))` uses `Real.rpow`. Since `(a n : ℝ) ≥ 2 > 0` and `1 / 2^n > 0`, `rpow` behaves as standard exponentiation, computing $a_n^{1/2^n}$ correctly. `Tendsto ... atTop (nhds 1)` asserts this converges to 1. ✓ + +- **Indexing:** The sequence is 0-indexed (ℕ → ℕ) versus the mathematical convention of 1-indexing. This is a standard harmless reindexing that does not affect the mathematical content. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of Erdős's conjecture. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | Minor | Could cross-reference `erdos_263.variants.folklore` | +| Citations | Needs fix | [KoTa24] missing paper title; inconsistent with 263/266 | +| Variants | Incomplete | Kovač–Tao construction and $\limsup$ variant not formalized | +| Readability | Good | Clear docstring; exponent expression necessarily verbose | +| Formalizability | Excellent | Unambiguous, all concepts have standard Mathlib counterparts | +| Correctness | Correct | Mathematically faithful; no flaws found | diff --git a/ai-review/27.md b/ai-review/27.md new file mode 100644 index 0000000000..0176b11d3f --- /dev/null +++ b/ai-review/27.md @@ -0,0 +1,144 @@ +# Review: Erdos Problem 27 + +**File:** `FormalConjectures/ErdosProblems/27.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated covering system infrastructure; missed density utilities.** + +Problem 27 defines three local helpers—`HasDistinctModuli`, `systemLcm`, and `uncoveredDensity`—that are self-contained but overlap with existing infrastructure: + +- **`IsCoveringSystem` pattern.** Problems 2 and 8 both define a local `IsCoveringSystem` on `Finset (ℤ × ℕ)`, and `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` provides a general `CoveringSystem R` / `StrictCoveringSystem R` structure. Problem 27 does not define a full covering system (it deals with *almost* covering systems), so this is not a direct duplication, but the `HasDistinctModuli` predicate is conceptually the same constraint as `StrictCoveringSystem`'s `injective_moduli`. A shared "congruence system" type with a distinct-moduli predicate would reduce repetition across Problems 2, 7, 8, and 27. + +- **`uncoveredDensity` vs `Set.HasDensity`.** The `FormalConjecturesForMathlib/Data/Set/Density.lean` module provides `Set.HasDensity`, `Set.upperDensity`, and `Set.lowerDensity` for computing natural densities via limits. Problem 27 instead computes density directly via the LCM period, which is mathematically equivalent (the uncovered set is periodic, so the proportion in one period equals the natural density). The LCM-based approach is arguably more concrete and avoids a limit, so both approaches are defensible. However, a lemma connecting the two (showing that `uncoveredDensity S` equals the `Set.HasDensity` value for the uncovered set) would unify the infrastructure. + +**Recommendation:** Factor `HasDistinctModuli` and the `Finset (ℤ × ℕ)` congruence system representation into a shared utility alongside the existing `CoveringSystem` structure. The `uncoveredDensity` function is sufficiently problem-specific to remain local, but a bridge lemma to `Set.HasDensity` would be valuable. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/27](https://www.erdosproblems.com/27):** + +The website lists: +- **Status:** Solved (disproved). $100 prize. +- **Tags:** Number theory, Covering systems. +- Additional context: a simple averaging argument, connection to covering systems (ε = 0), and quantitative bounds from FFKPY07. + +The formalization cites one reference: + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Filaseta–Ford–Konyagin–Pomerance–Yu 2007 | `[FFKPY07]` | Yes | OK. This is the primary resolution reference. Citation format matches other files. | +| Hough 2015 | Not cited | Referenced on website | Not strictly necessary for Problem 27 (Hough addresses Problem 2), but could be mentioned for context since the website references it. | +| Bloom–Bizzell–Maynard–Sawhney–Tao 2022 | Not cited | Referenced on website | Same—relates to covering system bounds more broadly. Optional. | + +**Issue:** The FFKPY07 citation in the docstring says "Journal of the American Mathematical Society (2007), 495-517" but omits the volume number. The full citation is: J. Amer. Math. Soc. **20** (2007), no. 2, 495–517. This is minor but worth correcting for completeness. + +**No missing critical citations.** The primary reference is correctly identified. + +--- + +## 3. Variants + +The formalization captures only the main resolved statement. Potential variants: + +1. **Quantitative bound from FFKPY07:** For $1 < C \leq N^{\frac{\log\log\log N}{4\log\log N}}$, any system with moduli in $[N, CN]$ has uncovered density at least $(1 - o(1))\prod_i(1 - 1/n_i)$. This is the quantitative content of the disproof and could be formalized as a separate theorem (though the $o(1)$ term makes this technically involved). + +2. **Averaging argument lower bound:** The website notes that a simple averaging argument shows that moduli in $[m_1, m_2]$ can achieve an ε-almost covering system with $\varepsilon(m_1, m_2) = \prod_{m_1 \leq m \leq m_2}(1 - 1/m)$. This is a self-contained and elegant statement: + ``` + theorem erdos_27_averaging (m₁ m₂ : ℕ) (hm : m₁ ≤ m₂) : + ∃ S : Finset (ℤ × ℕ), HasDistinctModuli S ∧ + (∀ p ∈ S, m₁ ≤ p.2 ∧ p.2 ≤ m₂) ∧ + uncoveredDensity S ≤ ∏ m in Finset.Icc m₁ m₂, (1 - 1 / m) + ``` + +3. **C depending on ε:** The problem asks for a *uniform* C (independent of ε and N). One could ask whether for each fixed ε > 0, there exists C(ε) > 1 such that for all N, an ε-almost covering system exists with moduli in [N, C(ε)·N]. This is a weaker (and potentially true) variant not captured by the formalization. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Pair projections:** As with Problems 2 and 8, using `p.1` / `p.2` for residue/modulus is functional but somewhat opaque. A named structure would improve readability, but this is a project-wide convention. +- **`uncoveredDensity` definition:** The `let L := systemLcm S` binding followed by the filter/card computation is readable. The nested lambda `fun x => ∀ p ∈ S, ¬((↑p.2 : ℤ) ∣ (↑x - p.1))` is dense but mathematically clear. +- **Docstrings:** Both the module-level and theorem-level docstrings are well-written and provide sufficient mathematical context. The definition of ε-almost covering system is clearly stated in the module docstring. +- **Namespace:** `Erdos27` is appropriate and consistent with other problem files. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The resolved statement of Problem 27 is fully precise: "There does not exist a constant C > 1 such that for every ε > 0 and N ≥ 1, an ε-almost covering system with distinct moduli in [N, CN] exists." All constituent notions (congruence system, distinct moduli, ε-almost covering, density) are standard and well-defined. + +The only potential source of ambiguity is the notion of "density" (natural density vs. upper density vs. lower density), but for periodic sets these all coincide, and the LCM-based computation sidesteps the issue entirely. + +**Ambiguity level: None.** The problem is cleanly formalizable. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `HasDistinctModuli` +```lean +def HasDistinctModuli (S : Finset (ℤ × ℕ)) : Prop := + S.card = (S.image Prod.snd).card +``` +Correctly asserts that no two pairs in S share the same modulus. Since `Finset` already deduplicates elements, this prevents two congruences with the same modulus but different residues. This matches the definition of an ε-almost covering system with "distinct moduli $n_1 < \cdots < n_k$". + +### Definition: `systemLcm` +```lean +noncomputable def systemLcm (S : Finset (ℤ × ℕ)) : ℕ := + (S.image Prod.snd).lcm id +``` +Computes the LCM of all moduli. For S = ∅, this returns 1 (the empty LCM). For nonempty S with all moduli ≥ 2, this returns a value ≥ 2. Correct. + +### Definition: `uncoveredDensity` +```lean +noncomputable def uncoveredDensity (S : Finset (ℤ × ℕ)) : ℝ := + let L := systemLcm S + ((Finset.range L).filter (fun x => + ∀ p ∈ S, ¬((↑p.2 : ℤ) ∣ (↑x - p.1)))).card / (L : ℝ) +``` +This computes `|{x ∈ [0, L) : x not covered by any congruence}| / L`. Since the union of congruence classes with moduli dividing L is periodic with period L, this proportion equals the natural density of the uncovered set. **Mathematically correct.** + +**Edge case:** If S = ∅, then L = 1, `range 1 = {0}`, and the filter keeps 0 (vacuously satisfying `∀ p ∈ S, ...`), giving density 1/1 = 1. This is correct: no congruences means everything is uncovered. However, the theorem requires `S.Nonempty`, so this case never arises. + +### Theorem: `erdos_27` +```lean +theorem erdos_27 : + answer(False) ↔ + ∃ C : ℝ, C > 1 ∧ + ∀ ε : ℝ, ε > 0 → + ∀ N : ℕ, N ≥ 1 → + ∃ S : Finset (ℤ × ℕ), + HasDistinctModuli S ∧ + S.Nonempty ∧ + (∀ p ∈ S, p.2 ≥ 2) ∧ + (∀ p ∈ S, N ≤ p.2 ∧ (p.2 : ℝ) ≤ C * N) ∧ + uncoveredDensity S ≤ ε +``` + +**Logical structure:** `answer(False) ↔ P` means P is False. So the theorem asserts that no such C exists, which is exactly the FFKPY07 result. **Correct.** + +**Conditions on S:** +- `HasDistinctModuli S`: distinct moduli. ✓ +- `S.Nonempty`: non-degenerate system. ✓ +- `∀ p ∈ S, p.2 ≥ 2`: all moduli at least 2, excluding the trivial modulus 1. ✓ (Standard convention. For N ≥ 2, this is redundant with `N ≤ p.2`, but for N = 1 it prevents the degenerate single-congruence-mod-1 solution.) +- `∀ p ∈ S, N ≤ p.2 ∧ (p.2 : ℝ) ≤ C * N`: moduli lie in [N, CN]. ✓ (The cast `(p.2 : ℝ)` is needed since C is real-valued. The upper bound `C * N` correctly uses the real-valued product.) +- `uncoveredDensity S ≤ ε`: at most ε fraction uncovered. ✓ + +**Potential concern: `N ≥ 1` vs `N ≥ 2`.** The problem uses `N ≥ 1`. For N = 1, the interval [1, C] is non-degenerate (since C > 1), and the constraint `p.2 ≥ 2` prevents the modulus-1 shortcut. This is fine—the interesting content is for large N, and including N = 1 does not weaken the statement. + +**Potential concern: real-valued C.** The problem states C > 1 as a real number. One might ask whether C should be rational or an integer, but the original problem uses a real constant, and the formalization correctly follows this. + +**Verdict: Correct and complete.** The formalization faithfully captures the resolved form of Erdős Problem 27. No mathematical flaws identified. The only minor gap is the absence of quantitative variants (the FFKPY07 bound on how slowly C can grow with N), but the main statement is correctly captured. diff --git a/ai-review/270.md b/ai-review/270.md new file mode 100644 index 0000000000..8a0ed663b5 --- /dev/null +++ b/ai-review/270.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 270 + +## 1. Code Reuse + +No significant code reuse opportunities from `FormalConjecturesForMathlib/`. The formalization already uses standard Mathlib constructs (`Tendsto`, `∑'`, `∏`, `Finset.range`, `HasSum`, `Irrational`). Nearby problems (263, 264, 265, 266) deal with irrationality of reciprocal sums but in sufficiently different settings that no shared abstractions are warranted. The `HasSum` pattern used in the `stronger_disproof` variant is consistent with the style used in Erdős 265 (`h_sum_rat`). + +## 2. Citations + +The formalization references: +- **[ErGr80]** — Correct. Matches the website: Erdős & Graham, *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathematique (1980), p.66. +- **[CrKo25]** — Partially correct. The formalization says "Crmarić and Kovač, disproof of the conjecture." The website attributes this to "Crmarić and Kovač" (2025) but does not give a full bibliographic entry beyond the tag [CrKo25]. Acceptable as-is, though a full citation (title, arXiv link, or journal) would be preferable if available. + +**Missing citation:** +- **[Ha75]** — Hansen (1975) is mentioned on the website: he proved that the special case $f(n) = n$ yields a transcendental sum $\sum_n 1/\binom{2n}{n} = \frac{1}{3} + \frac{2\pi}{3^{5/2}}$. This result is not referenced in the formalization. + +## 3. Variants + +The formalization captures two statements: +1. The original conjecture (disproved): `erdos_270` +2. The stronger Crmarić–Kovač result (for any $\alpha > 0$, the sum can equal $\alpha$): `erdos_270.variants.stronger_disproof` + +**Missing variants:** +- **Nondecreasing case (OPEN):** The website states that Erdős and Graham suggested "the answer is almost surely in the affirmative if $f(n)$ is assumed to be nondecreasing." This remains open and is a natural variant to formalize: + ``` + ∀ f : ℕ → ℕ, Monotone f → Tendsto f atTop atTop → + Irrational (∑' n, ...) + ``` +- **Lebesgue measure zero (Crmarić–Kovač):** Under the nondecreasing constraint, Crmarić and Kovač showed the set of achievable values has Lebesgue measure zero. This is a notable result mentioned on the website but not captured. +- **Hansen's result:** The special case $f(n) = n$ giving $\sum_n 1/\binom{2n}{n} = \frac{1}{3} + \frac{2\pi}{3^{5/2}}$ (transcendental) could be a standalone variant. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The product expression `∏ i ∈ Finset.range (f (n + 1)), ((n : ℝ) + 2 + (i : ℝ))` is somewhat dense. An intermediate definition (e.g., `fallingProduct n k = ∏ i ∈ Finset.range k, ((n : ℝ) + 2 + i)`) could improve clarity, but this is a matter of taste and not strictly necessary for a conjecture file. +- The `open Filter Finset BigOperators` line is clean and appropriate. +- The docstrings clearly state the mathematical content and the disproof attribution. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original problem statement "$\sum 1/(n+1)\cdots(n+f(n))$ is irrational" is precise: +- The sum is over $n \geq 1$. +- The denominator is a product of consecutive integers from $n+1$ to $n+f(n)$, which has exactly $f(n)$ factors. +- The condition $f(n) \to \infty$ is unambiguous. +- The question "is it irrational?" is a clear yes/no. + +The only potential ambiguity is what happens when $f(n) = 0$ (empty product = 1), but since $f(n) \to \infty$, this occurs only finitely often and does not affect irrationality (adding finitely many rationals preserves irrationality/rationality of the tail). The formalization handles this correctly by allowing `Finset.range 0 = ∅` to give an empty product of 1. + +The stronger disproof result is also fully precise: for any $\alpha > 0$, exhibit $f$ with the stated properties. + +## 6. Correctness + +**Assessment: Correct.** + +**Index verification:** The formalization sums over $n \in \mathbb{N}$ (i.e., $n \geq 0$). The $n$-th term is: +$$\frac{1}{\prod_{i=0}^{f(n+1)-1} (n + 2 + i)} = \frac{1}{(n+2)(n+3)\cdots(n+1+f(n+1))}$$ + +Substituting $m = n + 1$ (so $m \geq 1$): +$$\sum_{m \geq 1} \frac{1}{(m+1)(m+2)\cdots(m+f(m))}$$ + +This matches the original problem statement $\sum_{n \geq 1} 1/((n+1)\cdots(n+f(n)))$ exactly. + +**`answer(False)` encoding:** The conjecture asks "Is it true that the sum is always irrational?" Since the answer is no (disproved by Crmarić–Kovač), `answer(False)` is the correct tag. The `↔` states that this false answer corresponds to the (false) universal irrationality claim. This is consistent with the codebase convention (cf. `erdos_263.parts.ii`). + +**`HasSum` vs `∑'` usage:** The main theorem uses `∑'` (which equals 0 for non-summable functions), while the variant uses `HasSum` (which asserts convergence). Both are appropriate: the main theorem asks about irrationality of a value (if the sum diverges or is non-summable, `∑' = 0` is rational, making the universal claim trivially false for some $f$, which is fine since the answer is already `False`). The variant uses `HasSum` correctly since it needs to assert the sum converges to exactly $\alpha$. + +**`Tendsto f atTop atTop`:** Correctly encodes $f(n) \to \infty$ for $f : \mathbb{N} \to \mathbb{N}$. + +**No mathematical flaws identified.** The formalization is faithful to the original problem as stated on the website. + +--- + +**Summary:** The formalization is mathematically correct and well-structured. The main gaps are (1) the missing nondecreasing variant, which is the natural remaining open problem, (2) the missing Hansen citation [Ha75], and (3) the Lebesgue measure zero result from Crmarić–Kovač. These are additive improvements; no corrections are needed. diff --git a/ai-review/271.md b/ai-review/271.md new file mode 100644 index 0000000000..74020a9926 --- /dev/null +++ b/ai-review/271.md @@ -0,0 +1,110 @@ +# AI Review: Erdős Problem 271 + +## 1. Code Reuse + +The codebase contains substantial AP-related infrastructure that the `IsStanleySeq` definition does **not** use: + +- **`Set.IsAPOfLengthFree`** (`FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean:197`): Defines AP-free sets. The 3-AP-free condition in `IsStanleySeq` (line 45) is written inline as `∀ i j k, i < j → j < k → a i + a k ≠ 2 * a j`. This could potentially be restated in terms of `Set.IsAPOfLengthFree (Set.range a) 3`, which would align with the library's existing infrastructure. However, the inline version is more direct for a sequence (as opposed to a set), and uses indices rather than set membership, so the tradeoff is debatable. The inline version is arguably clearer for this particular use case. + +- **`IsAPFree`** (`FormalConjectures/ErdosProblems/169.lean:34`): A finset-based AP-free definition. Not directly applicable since `IsStanleySeq` works with infinite sequences. + +- **Greedy sequence patterns**: Problems 340 (greedy Sidon), 282 (greedy denominators), 460, and 430 all define greedy sequences. Problem 340's `greedySidon` is the closest analogue — a greedy sequence avoiding a combinatorial property. However, each greedy construction is specialized enough that sharing definitions would be artificial. + +- **Asymptotic notation**: Problem 340 uses Mathlib's `=O[atTop]` and `=Θ[atTop]` notation. Problem 271 instead uses explicit sandwich bounds with constants `C₁, C₂`. The explicit formulation is equivalent to Θ-notation but more verbose. Using `=Θ[atTop]` (as in Problem 340) would be more concise and idiomatic. + +**Recommendation**: Consider using `Asymptotics.IsTheta` (`=Θ[atTop]`) instead of the manual two-sided bound, for consistency with Problem 340 and Mathlib conventions. + +## 2. Citations + +**Website (erdosproblems.com/271) lists:** +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). — p. 22 +- [OdSt78] Odlyzko, A. and Stanley, R. (1978) — formulated the dichotomy conjecture +- [Li90] Lindhurst (1990) — computational evidence for A(4) +- [Mo11] Moy (2011) — upper bound result + +**Formalization includes:** +- [ErGr80] ✅ Correctly cited in the docstring +- [OdSt78] ❌ **Missing.** The Odlyzko–Stanley conjecture is named in the docstring but the original reference [OdSt78] is not cited. +- [Li90] ❌ **Missing.** Lindhurst's computational work on A(4) is mentioned in the docstring but the citation is absent. +- [Mo11] ❌ **Missing.** Moy's upper bound is mentioned ("Moy proved...") but the reference is not formally cited. +- van Doorn and Sothanaphan ❌ **Missing.** The website attributes the explicit bound `a_k ≤ (k-1)(k+2)/2 + n` to van Doorn and Sothanaphan, but the docstring attributes it only to Moy. + +**Recommendation**: Add [OdSt78], [Li90], and [Mo11] as explicit references. Correct the attribution of the explicit bound `(k-1)(k+2)/2 + n` to van Doorn and Sothanaphan (not Moy; Moy proved the weaker asymptotic bound `a_k ≤ (1/2 + ε)k²`). + +## 3. Variants + +The website poses two questions: (1) Can the `a_k` be explicitly determined? (2) How fast do they grow? + +The formalization captures only the Odlyzko–Stanley growth-rate dichotomy conjecture. Missing variants include: + +- **Moy's upper bound** (or van Doorn–Sothanaphan's sharper version): `a_k ≤ (k-1)(k+2)/2 + n` for all `k ≥ 0`. This is a known result that could be stated as a separate theorem (category: research, not open). +- **Explicit determination for specific n**: The fact that A(1) consists of integers with no digit 2 in base 3 could be formalized. Similarly for A(3^k) and A(2·3^k). +- **The qualitative question**: "Can the `a_k` be explicitly determined?" is inherently informal and not easily formalizable — reasonable to omit. +- **A(4) growth rate conjecture**: Lindhurst's computational conjecture that A(4) has the k²/log k growth rate could be stated as a separate conjecture. + +**Recommendation**: At minimum, add the van Doorn–Sothanaphan upper bound as a proven variant. The base-3 characterization of A(1) would also be a natural, formalizable variant. + +## 4. Readability + +The code is generally readable. Specific observations: + +- **`IsStanleySeq` definition**: The conjunction of five properties as a single `Prop` is clear. The docstring accurately describes each condition. Good. +- **Greedy condition (condition 4)**: The formalization states that for every `m` strictly between `a(k)` and `a(k+1)` (with `k ≥ 1`), there exist `i < j ≤ k` such that `a(i) + m = 2 * a(j)`. This means `m` is the arithmetic mean of `a(i)` and some other element — but the condition as written says adding `m` would create a 3-AP `(a(i), a(j), m)` where `a(i) + m = 2 * a(j)`. This places `a(j)` as the middle term between `a(i)` and `m`. This is correct: it means `{a(i), a(j), m}` would form a 3-AP with `a(j)` in the middle. +- **Theorem statement**: The explicit two-sided bounds with `C₁, C₂` are understandable but verbose. Using `=Θ[atTop]` would improve readability. +- **`Real.log 3 / Real.log 2`**: This is `log₂ 3`. Using `Real.logb 2 3` (as seen in Problem 636) would be more readable. + +**Recommendation**: Replace `Real.log 3 / Real.log 2` with `Real.logb 2 3`. Consider using `=Θ[atTop]`. + +## 5. Formalizability + +The Odlyzko–Stanley conjecture as stated is precise and formalizable. The formalization captures it correctly as a dichotomy: every Stanley sequence eventually grows as either Θ(k^{log₂3}) or Θ(k²/log k). + +**Ambiguity assessment: Low.** The mathematical content is unambiguous. The only subtlety is the meaning of "eventually" and "Θ", both of which have standard formal definitions and are correctly captured by the existential `N₀` and the two-sided bounds. + +One potential ambiguity: the problem on the website asks two open-ended questions ("Can the a_k be explicitly determined? How fast do they grow?") rather than stating a single conjecture. The formalization chooses to formalize the Odlyzko–Stanley conjecture specifically, which is the most concrete mathematical claim associated with this problem. This is a reasonable choice. + +## 6. Correctness + +### IsStanleySeq definition + +The definition has **a subtle issue with the greedy condition**: + +The greedy condition (line 46–47) requires: for `k ≥ 1` and `a(k) < m < a(k+1)`, there exist `i < j ≤ k` such that `a(i) + m = 2 * a(j)`. + +This says: adding `m` would create a 3-AP where `m` and some `a(i)` are symmetric around some `a(j)`. But this only checks one pattern of 3-AP — where `m` is an endpoint and the middle term is already in the sequence. + +A 3-AP involving `m` could also have `m` as the **middle** term: i.e., `a(i) + a(j) = 2 * m` for some `i < j ≤ k`. The greedy condition should require that adding `m` creates a 3-AP in **any** configuration, not just one where `m` is an endpoint. + +Concretely, the greedy condition should be: for every skipped `m`, there exist indices among `{a(0), ..., a(k)}` such that `{a(i), a(j), m}` (in some order) form a 3-AP. The possible cases are: +1. `a(i) + m = 2 * a(j)` (m is an endpoint, a(j) is the middle) — **this is the only case checked** +2. `a(i) + a(j) = 2 * m` (m is the middle) — **not checked** +3. `m + a(j) = 2 * a(i)` (m is the other endpoint) — this is equivalent to case 1 with different index naming when considering all i,j + +So the greedy condition is **incomplete**: it misses the case where `m` would be the middle term of a 3-AP formed with two existing elements. For example, if `a(i) + a(j) = 2m` for some `i, j ≤ k`, then adding `m` creates a 3-AP, but the current condition would not detect this. + +Wait — let me reconsider. Looking more carefully: `a(i) + m = 2 * a(j)` with `i < j` means `m = 2 * a(j) - a(i)`. Since `a` is strictly increasing and `i < j`, we have `a(i) < a(j)`, so `m = 2*a(j) - a(i) > a(j)`. This means `m > a(j)`, so the AP is `a(i), a(j), m` in increasing order. This covers the case where `m` is the largest element. + +For `m` as the smallest element: we'd need `m + a(k') = 2 * a(j)` with `m < a(j) < a(k')`. Since `m > a(k) ≥ a(1) = n > 0` (for the skipped values), and all `a(k')` with `k' ≤ k` satisfy `a(k') ≤ a(k) < m`, this case cannot arise (we can't have `a(k') > m` with `k' ≤ k`). So `m` cannot be the smallest element in an AP with elements from `{a(0),...,a(k)}`. ✓ + +For `m` as the middle element: we'd need `a(i) + a(j) = 2m` with `a(i) < m < a(j)` and `i, j ≤ k`. But `j ≤ k` means `a(j) ≤ a(k) < m`, contradicting `a(j) > m`. So this case also cannot arise. ✓ + +**Conclusion: The greedy condition is actually correct.** Since `m` is strictly between `a(k)` and `a(k+1)`, any AP involving `m` and elements from `{a(0),...,a(k)}` must have `m` as the largest term. The formalization correctly captures only this case. + +### Theorem statement + +The dichotomy `erdos_271` is mathematically correct as a formalization of the Odlyzko–Stanley conjecture. Each branch asserts Θ-growth with explicit constants, which is standard. + +**Minor issue**: When `k = 0`, expressions like `(k : ℝ) ^ (Real.log 3 / Real.log 2)` and `(k : ℝ) ^ 2 / Real.log (k : ℝ)` involve `0^(positive)` and division by `log 0`. The `N₀` existential quantifier handles this by allowing the bounds to only hold for `k ≥ N₀`, so this is not a logical error, but it's worth noting that the second branch's `Real.log (k : ℝ)` is negative for `k = 1` (since `log 1 = 0`, actually `log 1 = 0` exactly, giving division by zero) and for `k = 0` gives `log 0` which in Lean/Mathlib is `0`. The `N₀` parameter saves correctness here. + +**Overall correctness: Sound.** The formalization correctly captures the Odlyzko–Stanley conjecture. The `IsStanleySeq` definition is correct upon careful analysis. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `=Θ[atTop]` and `Real.logb`; AP infrastructure not critical | +| Citations | Missing [OdSt78], [Li90], [Mo11]; misattribution of explicit bound | +| Variants | Missing upper bound theorem and A(1) characterization | +| Readability | Good; minor improvements possible with `logb` and `IsTheta` | +| Formalizability | High — unambiguous mathematical content | +| Correctness | **Sound.** Greedy condition is correct (m must be largest in any AP). Minor edge-case considerations handled by N₀. | diff --git a/ai-review/272.md b/ai-review/272.md new file mode 100644 index 0000000000..cf103013e5 --- /dev/null +++ b/ai-review/272.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 272 + +## 1. Code Reuse + +The codebase provides `Set.IsAPOfLengthWith` and `Set.IsAPOfLength` in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`, which define arithmetic progressions on `Set α` using `ENat.card` and `ℕ∞` lengths. Problem 272 defines its own `IsNonEmptyFiniteAP` on `Finset ℕ`. + +In principle, `IsNonEmptyFiniteAP S` could be expressed as: +``` +S.Nonempty ∧ (↑S : Set ℕ).IsAPOfLength S.card +``` +However, there are practical obstacles: +- `Set.IsAPOfLengthWith` uses `n • d` (scalar multiplication) rather than `i * d` (natural number multiplication), and `ENat.card` rather than `Finset.card`. +- `Set.IsAPOfLengthWith` operates on `Set α` over an `AddCommMonoid`, requiring coercion from `Finset ℕ`. +- The length parameter is `ℕ∞`, introducing unnecessary complexity for a necessarily finite setting. + +The custom definition is reasonable for this problem. If refactoring were desired, a bridge lemma showing equivalence to `Set.IsAPOfLength` would be more appropriate than a direct replacement. Several other Erdős problems (179, 199) similarly define their own AP predicates rather than reusing the shared one, suggesting this is an accepted pattern in the codebase. + +## 2. Citations + +**Formalization docstring references:** +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980), p. 20. +- [SiSo81] Simonovits, M. and Sós, V., *Intersection theorems for subsets of integers*. European Journal of Combinatorics (1981). +- [Sz99] Szabó, T. (1999). + +**Issues:** +- **[Sz99] is incomplete.** The website attributes results to Szabó (1999) but no paper title or journal is given. The docstring should note this, e.g., "Szabó, T. (1999). (details not available on erdosproblems.com)." +- **[GSS80] is missing.** The website references Graham, Simonovits, and Sós (1980) for the variant without the non-empty requirement (tight bound $\binom{N}{3}+\binom{N}{2}+\binom{N}{1}+1$). While the formalization doesn't capture that variant, mentioning this reference in the docstring would provide fuller context. +- **Sos → Sós.** The docstring correctly uses the accent. Good. + +## 3. Variants + +The formalization captures **Szabó's conjecture** ($t = N^2/2 + O(N)$) only. The website describes several other aspects: + +1. **Original Erdős–Graham conjecture** (disproved): That the maximum is achieved by taking all APs through a fixed element $\lfloor N/2 \rfloor$. Simonovits and Sós disproved this. *Not captured, but since it's false, formalizing it is optional.* + +2. **Empty intersection variant** (solved): Graham, Simonovits, and Sós (1980) proved the tight bound $t \leq \binom{N}{3}+\binom{N}{2}+\binom{N}{1}+1$ when the AP intersection is allowed to be empty. *Not captured.* + +3. **Szabó's stronger conjecture**: That there is a common element in all sets of an extremal family. *Not captured.* This is a meaningful strengthening that could be formalized as an additional theorem. + +4. **Szabó's known result** ($t = N^2/2 + O(N^{5/3}(\log N)^3)$): This is stated in the docstring but not formalized. It could be formalized as a separate (proven) theorem. *Not captured.* + +**Assessment:** The most important variant (Szabó's conjecture) is captured. The common-element conjecture is a natural addition. + +## 4. Readability + +The formalization is clear and well-structured. Minor observations: + +- **Redundant qualifier:** Line 68 uses `Finset.Icc 1 N` despite `open Finset` on line 33. This could be simplified to `Icc 1 N`, though the explicit qualifier is not incorrect and may aid clarity. +- **Docstring quality:** The docstring is well-written and provides good mathematical context. The explanation of what is being formalized (lines 59–63) is helpful. +- **Variable naming:** `𝓕` for the family of sets is standard mathematical notation. The use of `A`, `B` for set variables in quantifiers is clear. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The conjecture $t = N^2/2 + O(N)$ is a precise asymptotic statement. The formalization correctly unpacks the big-$O$ notation into explicit upper and lower bounds with a universal constant $C > 0$. The notions involved (finite subsets, intersection, arithmetic progression) are all well-defined and standard. + +The only potential ambiguity is in the definition of "arithmetic progression" — specifically whether singletons count. The formalization allows singletons (any set $\{a\}$ is a trivial AP with $d = 0$), which is the standard convention. The `Nonempty` requirement correctly excludes the empty set. + +The statement is clearly formalizable and the formalization makes sensible choices at every decision point. + +## 6. Correctness + +**Overall: Correct, with one subtle observation.** + +### Definition `IsNonEmptyFiniteAP` + +The definition is self-consistent despite the apparent circularity of using `S.card` in its own specification. Since `S.card` is a property of the Finset independent of whether it's an AP, this works correctly: +- If $|S| \geq 2$, the biconditional forces $d > 0$ (otherwise all elements equal $a$, contradicting $|S| \geq 2$). +- If $|S| = 1$, $S = \{a\}$ for any $d$, which is correct. +- If $|S| = 0$, the `Nonempty` conjunct eliminates this case. + +### Main theorem `erdos_272` + +The formalization correctly captures $t = N^2/2 + O(N)$: +- The upper bound (part 1) says every AP-intersecting family has $|\mathcal{F}| \leq N^2/2 + CN$. +- The lower bound (part 2) says there exists an AP-intersecting family with $|\mathcal{F}| \geq N^2/2 - CN$. +- The constant $C$ is universal (existentially quantified outside the $\forall N$). + +**Observation on $N^2/2$ vs $\binom{N}{2}$:** The website states Szabó's conjecture as $t = \binom{N}{2} + O(N)$, where $\binom{N}{2} = N(N-1)/2 = N^2/2 - N/2$. The formalization uses $N^2/2$. Since $N^2/2 - \binom{N}{2} = N/2 = O(N)$, these are equivalent at the $O(N)$ precision level. The formalization is correct, though using $\binom{N}{2}$ (i.e., `N.choose 2`) would more closely match the website's statement and Szabó's construction lower bound of $\binom{N}{2} + \lfloor(N-1)/4\rfloor + 1$. + +**Intersection semantics:** The formalization requires `A ≠ B` (as sets) rather than "distinct indices $i \neq j$". Since `𝓕` is a `Finset (Finset ℕ)`, elements are unique, so this is equivalent. If the problem intended to allow multiset families, the formalization would be slightly different, but the standard interpretation is distinct sets, and this is what the formalization implements. + +**No mathematical flaws identified.** The formalization is a faithful rendering of Szabó's conjecture as described on the website. diff --git a/ai-review/278.md b/ai-review/278.md new file mode 100644 index 0000000000..9308aa980d --- /dev/null +++ b/ai-review/278.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 278 + +## 1. Code Reuse + +**Problem 27** (`FormalConjectures/ErdosProblems/27.lean`) defines closely related constructs: +- `uncoveredDensity` — computes the proportion of integers in `{0,…,L-1}` *not* covered by any congruence, essentially `1 - coveringDensity`. +- `systemLcm` — computes the LCM of all moduli via `(S.image Prod.snd).lcm id`, compared to `moduli.lcm id` in 278. + +The two files use different data representations (Problem 27 uses `Finset (ℤ × ℕ)` pairs while 278 uses a `Finset ℕ` of moduli with a separate `offsets : ℕ → ℤ` function), so direct code sharing would require a common abstraction. This is unlikely to be worthwhile given the small size of both definitions, but a shared utility for "density of a periodic subset of ℤ over one period" could factor out the common `covered.card / L` pattern. + +**`FormalConjecturesForMathlib/Data/Set/Density.lean`** provides `Set.HasDensity`, `Set.upperDensity`, and `Set.lowerDensity`. These are not used in the current formalization; the periodic structure makes the finite counting approach (`covered.card / L`) simpler and fully rigorous. No change recommended. + +**`FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean`** provides `Finset.lcmInterval`, which is not directly applicable here since the moduli set is arbitrary (not an interval). The use of `Finset.lcm id` is already standard. + +**Verdict:** No significant code reuse opportunities. The definitions are small and self-contained. + +## 2. Citations + +The website ([erdosproblems.com/278](https://www.erdosproblems.com/278)) lists: +- **Source:** [ErGr80, p.28] — Erdős and Graham, *Old and new problems and results in combinatorial number theory* (1980). +- **Key result:** Simpson [Si86] proved the minimum density bound. + +The formalization's docstring includes: +- `[ErGr80]` with full bibliographic entry and page reference (p.28) ✓ +- `[Si86]` with full bibliographic entry ✓ + +Both references match the website. The Simpson reference in the formalization is: *"Simpson, R. J., Exact coverings of the integers by arithmetic progressions. Discrete Mathematics 59 (1986), 181–190."* This is consistent with what the website attributes to Simpson. + +**Verdict:** Citations are complete and accurate. + +## 3. Variants + +The website's problem statement has two parts: +1. **What is the maximum density?** (open) +2. **Is the minimum density achieved when all offsets are equal?** (solved by Simpson) + +The formalization captures both: +- `erdos_278` — the solved minimum density result (Simpson's theorem), tagged `category research solved`. +- `erdos_278.variants.max_density` — the open maximum density question, tagged `category research open`. + +**Verdict:** All variants from the website are captured. The split into solved/open parts is appropriate. + +## 4. Readability + +The code is well-structured: +- The docstring provides a clear mathematical summary with proper LaTeX notation. +- Helper definitions (`coveringDensity`, `inclusionExclusionDensity`) are separated from the theorem with their own docstrings. +- The `let` bindings in `coveringDensity` (`L`, `covered`) improve readability. + +Minor observations: +- The `inclusionExclusionDensity` definition is a single expression. It's clear but dense; a one-line comment noting the sign convention `(-1)^(|S|+1)` gives `+` for singletons could help, though this is standard. +- The use of `open Classical` (line 44) vs `open scoped Classical` (used in Problem 27) is a stylistic difference. Both work; `open scoped Classical` is the more modern/preferred convention in Mathlib style. + +**Verdict:** Readability is good. Consider changing `open Classical` to `open scoped Classical` for consistency with other files. + +## 5. Formalizability + +**Minimum density (solved part):** Simpson's theorem is a precise, unambiguous mathematical statement. The formalization correctly captures it as two claims: (a) the inclusion-exclusion density is a lower bound for all offset choices, and (b) constant offsets achieve this bound. This is clearly formalizable and the formalization is faithful to the result. + +**Maximum density (open part):** The open question "what is the maximum density?" is formalized using `IsGreatest` with `answer(sorry)` as the unknown maximum value. This is an appropriate encoding — the set of achievable densities is finite (bounded by the number of distinct residue patterns modulo `lcm(moduli)`), so the maximum exists. The `IsGreatest` predicate requires both membership and an upper bound, which is exactly right. + +**Ambiguity assessment:** The original problem statement is precise enough: "finite set of positive integers" maps directly to `Finset ℕ` with positivity hypotheses, "density of integers covered" is unambiguously the natural density of a periodic set (computable by counting over one period), and the extremal questions are well-defined. There is no meaningful ambiguity. + +**Verdict:** The problem is fully formalizable with no ambiguity issues. + +## 6. Correctness + +### Main theorem (`erdos_278`) + +The statement asserts, for all `moduli : Finset ℕ` with positive elements: + +**(a)** `∀ offsets, inclusionExclusionDensity moduli ≤ coveringDensity moduli offsets` + +This is Simpson's theorem: the minimum covering density equals the inclusion-exclusion density. + +**(b)** `∀ a : ℤ, coveringDensity moduli (fun _ => a) = inclusionExclusionDensity moduli` + +This claims constant offsets achieve the inclusion-exclusion density, and that the value is independent of the common offset `a`. + +**Correctness of (b):** When all offsets equal `a`, the covered set is `{m ∈ {0,…,L-1} : ∃ n ∈ A, n ∣ (m − a)}`. Since each divisibility condition `n ∣ (m − a)` is periodic with period `n`, and `L` is divisible by all `n ∈ A`, the count over `{0,…,L-1}` is invariant under shifting `a`. So the density is indeed independent of `a`. When `a = 0`, the covered set is `{m : ∃ n ∈ A, n ∣ m}`, and standard inclusion-exclusion gives the count as `∑_{∅≠S⊆A} (-1)^{|S|+1} · L/lcm(S)`, hence the density is the alternating sum. This matches `inclusionExclusionDensity`. ✓ + +**Correctness of (a):** This is the content of Simpson's 1986 result. The formalization faithfully encodes it. ✓ + +**Edge case — empty `moduli`:** When `moduli = ∅`, `L = Finset.lcm ∅ id = 0` (the identity element for `lcm` in `ℕ` under the `GCDMonoid` instance). Then `Finset.range 0 = ∅`, so `coveringDensity ∅ offsets = 0 / 0 = 0` (division by zero in `ℚ` returns 0). Meanwhile `inclusionExclusionDensity ∅ = 0` (empty sum). Both conjuncts hold trivially: `0 ≤ 0` and `0 = 0`. ✓ + +**Tagging:** The main theorem is tagged `category research solved`, and the answer is `True`. This correctly reflects that Simpson affirmatively answered the minimum density question. ✓ + +### Variant (`erdos_278.variants.max_density`) + +Uses `IsGreatest` on the set `{coveringDensity moduli offsets | offsets : ℕ → ℤ}`. Since only finitely many distinct density values are achievable (the density depends only on `offsets` modulo the respective moduli, and there are finitely many such residue classes), the set is finite and non-empty (it contains at least the constant-offset density), so a greatest element exists. The use of `answer(sorry)` correctly indicates the answer is unknown. ✓ + +**One concern:** The variant takes `moduli` and `h` as parameters rather than universally quantifying. This means it asks for the maximum density *for a given* set of moduli, not a universal formula. This is appropriate — the maximum density likely depends on the specific moduli, and the open problem is indeed parameterized by the choice of `A`. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No significant opportunities; definitions are appropriately self-contained | +| Citations | Complete and accurate, matching the website | +| Variants | All variants captured (solved minimum + open maximum) | +| Readability | Good; minor suggestion to use `open scoped Classical` | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete; edge cases handled properly | diff --git a/ai-review/279.md b/ai-review/279.md new file mode 100644 index 0000000000..7c22e6c1e6 --- /dev/null +++ b/ai-review/279.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 279 + +## 1. Code Reuse + +Several existing formalizations share structural similarity: + +- **Problem 687** (`ErdosProblems/687.lean`): Defines a `PrimeCovering` predicate for choosing one residue class `a_p (mod p)` for every prime `p ≤ x` covering `[1, y]`. The pattern `∃ p : ℕ, p.Prime ∧ ... ∧ n % p = a p % p` is very close to what 279 needs. Problem 279 differs in that (a) the primes are unbounded (all primes, not just `p ≤ x`), and (b) there is the additional `t ≥ k` constraint. A shared helper predicate could be considered, but the `t ≥ k` twist makes direct reuse nontrivial. + +- **Problem 278** (`ErdosProblems/278.lean`): Defines `coveringDensity` for finite sets of moduli with offsets, using the pattern `(n : ℤ) ∣ ((m : ℤ) - offsets n)`. Relevant conceptually but not directly reusable since 279 works over all primes (infinite set) rather than a finite moduli set. + +- **Problem 280** (`ErdosProblems/280.lean`): Uses `sieveCount` with `m ≡ a i [MOD n i]` notation. Demonstrates the Lean idiom for modular congruence avoidance. + +- **`FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`**: Defines general `CoveringSystem` and `StrictCoveringSystem` structures. These are for finite covering systems and are not directly applicable to the infinite-prime setting of 279. + +**Verdict**: No existing code can be directly repurposed without modification. The current inline formulation is the most straightforward approach given the unique `t ≥ k` constraint. + +## 2. Citations + +The docstring cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The website (erdosproblems.com/279) lists the reference as **[ErGr80, p.29]**, and the theorem docstring correctly includes the page number. The module-level docstring includes the full bibliographic entry. This matches the website. + +**Verdict**: Citations are complete and accurate. + +## 3. Variants + +The problem description on the website and in the module docstring mentions several aspects beyond the main conjecture: + +1. **The case k = 3**: Noted as especially difficult. Not separately formalized, but this is just a special case of the main universal statement over `k ≥ 3`, so it's implicitly included. + +2. **Generalization to arbitrary sets A ⊆ ℕ**: The conjecture may hold with primes replaced by any set `A` satisfying `|A ∩ [1,N]| ≫ N / log N` and `∑_{n ∈ A, n ≤ N} 1/n - log log N → ∞`. This variant is **not formalized**. + +3. **The k = 1 and k = 2 cases**: For these values, any set `A` with `∑_{n ∈ A} 1/n = ∞` has the property. This is a known result (not a conjecture) and is **not formalized**. + +**Verdict**: The main conjecture is captured. Two substantive variants/remarks are mentioned in the docstring but not formalized. The generalization to arbitrary dense sets `A` would be a natural `.variants.general` theorem. The `k = 1, 2` result could be formalized as a `.variants.small_k` theorem marked `category research solved`. + +## 4. Readability + +The formalization is concise and readable. A few observations: + +- The statement is short enough that inlining everything is appropriate (unlike Problem 687, which benefits from `PrimeCovering` because it is reused across two theorems). +- The variable names (`k`, `a`, `N₀`, `n`, `p`, `t`) are standard and match mathematical convention. +- The docstring clearly states what the theorem formalizes. +- The module-level docstring provides good context including the related remarks about variants. + +**Verdict**: Readability is good. No changes needed. + +## 5. Formalizability + +The problem statement is precise and unambiguous: +- "Choose congruence classes `a_p (mod p)` for every prime `p`" → `∃ a : ℕ → ℤ` +- "All sufficiently large integers" → `∃ N₀ : ℤ, ∀ n : ℤ, N₀ ≤ n` +- "Can be written as `a_p + t · p` for some prime `p` and integer `t ≥ k`" → `∃ p : ℕ, Nat.Prime p ∧ ∃ t : ℤ, (k : ℤ) ≤ t ∧ n = a p + t * (p : ℤ)` + +The only mild ambiguity is whether the problem asks "is it true for all k ≥ 3" or "is it true for some specific k ≥ 3." The phrasing "Let k ≥ 3. Is there a choice..." most naturally reads as: "for every k ≥ 3, is there a choice...", which is what the formalization captures. + +**Verdict**: The problem is clearly formalizable with negligible ambiguity. The formalization correctly interprets the universal quantification over `k`. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +- **Quantifier structure**: `∀ k ≥ 3, ∃ a, ∃ N₀, ∀ n ≥ N₀, ∃ p prime, ∃ t ≥ k, n = a(p) + t·p`. This correctly captures the problem. + +- **Type of `a`**: `a : ℕ → ℤ` maps natural numbers (including primes) to integers. The function is defined on all naturals, not just primes, which is standard in Lean (the values at non-primes are irrelevant since they are never used due to the `Nat.Prime p` guard). Not constraining `a p` to `[0, p)` is mathematically harmless: any `a p` determines a unique residue class mod `p`, and since the problem only requires coverage of "sufficiently large" `n`, replacing `a p` with `a p + m·p` merely shifts the starting point of coverage, which is absorbed by adjusting `N₀`. + +- **The representation `n = a p + t * p`**: This is equivalent to `n ≡ a p [ZMOD p]` with the additional constraint that `t = (n - a p) / p ≥ k`. The constraint `t ≥ k` means the covered integers for prime `p` are `{a p + k·p, a p + (k+1)·p, ...}` — a cofinite subset of the congruence class. This correctly models the problem's requirement that `t ≥ k`, which prevents trivially covering small integers. + +- **Use of `ℤ`**: Both `n`, `a p`, and `t` are integers, which is appropriate since the problem concerns all sufficiently large integers (and `t` could in principle be negative if `a p` is large, but `t ≥ k ≥ 3` prevents this). + +- **`answer(sorry)`**: Correctly reflects that this is an open problem with unknown truth value. + +**Verdict**: The formalization is correct and complete for the main conjecture. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No direct reuse possible; current approach is appropriate | +| Citations | Complete and accurate, matches website | +| Variants | Main conjecture captured; generalization to dense sets A and k=1,2 result not formalized | +| Readability | Good | +| Formalizability | Clearly formalizable, negligible ambiguity | +| Correctness | Correct and complete | + +**Overall**: This is a clean, correct formalization of the main conjecture. The primary gap is the absence of formalized variants for the generalization to arbitrary dense sets and the settled k ≤ 2 case. diff --git a/ai-review/280.md b/ai-review/280.md new file mode 100644 index 0000000000..15857b6ee1 --- /dev/null +++ b/ai-review/280.md @@ -0,0 +1,122 @@ +# Review: Erdős Problem 280 + +**File:** `FormalConjectures/ErdosProblems/280.lean` + +--- + +## 1. Code Reuse + +**Overlap with Problem 281.** The `sieveCount` definition in 280 is very similar to `avoidCountFin` in Problem 281: + +| | `sieveCount` (280) | `avoidCountFin` (281) | +|---|---|---| +| Range | `m < n(k)` | `m < N` (arbitrary) | +| Index set | `i ∈ Finset.Icc 1 k` (1-based) | `i < k` (0-based) | + +These could in principle be unified—`sieveCount n a k = avoidCountFin n a (k+1) (n k)` modulo the indexing shift—but the semantic distinction (280 ties the bound to `n(k)`, 281 uses an independent `N`) is meaningful enough that separate definitions are defensible. The inconsistent indexing convention (1-based vs. 0-based) between the two companion problems is a minor concern; see §4. + +**Asymptotic machinery.** The little-o condition is spelled out inline. Mathlib's `Asymptotics.IsLittleO` could express this more idiomatically: + +``` +(fun k => (sieveCount n a k : ℝ)) =o[Filter.atTop] (fun k => (k : ℝ)) +``` + +However, the explicit quantifier form used here (`∀ c > 0, ∃ K, …`) is arguably more readable for a standalone statement and avoids pulling in the `Asymptotics` import for a single usage. This is a style preference, not a defect. + +**No other reusable infrastructure applies.** The `CoveringSystem` structure in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` is for finite covering systems over rings and has a different purpose (union of cosets = whole ring). The density definitions in `FormalConjecturesForMathlib/Data/Set/Density.lean` operate on natural density of sets, not the specific "sieve count below n(k)" quantity needed here. + +--- + +## 2. Citations + +**[ErGr80, p.29]** — Correctly cited. The docstring references: +> Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +This matches the website. The page number (p.29) is consistent with the website's attribution. + +**Cambie's counterexample** — The docstring attributes the disproof to "Cambie" without a full citation. The website similarly credits "Stijn Cambie" without pointing to a published paper (it appears to be a direct observation communicated to the website). Providing the full name "Stijn Cambie" in the docstring would be a minor improvement for traceability. No formal publication reference is available to cite. + +--- + +## 3. Variants + +The formalization captures the **disproved conjecture** (existence of a counterexample). This is the correct formalization for a problem marked "Disproved." + +**Not captured:** The website notes that the growth bound `n_k > (1+ε)k log k` is essentially optimal because the k-th prime is ~k log k, and if the moduli were exactly the primes, the sieve would leave a positive proportion unsieved. This context motivates the conjecture but is commentary, not a separate variant requiring formalization. + +**Potential follow-up:** Whether there exist counterexamples with additional constraints on the moduli (e.g., pairwise coprime, or not all powers of a single base) is an interesting open question, but this is not part of the original Erdős–Graham conjecture and the formalization is not expected to capture it. + +--- + +## 4. Readability + +**Generally good.** The `sieveCount` helper is well-named and has a clear docstring. The main theorem statement reads naturally. + +**Minor issues:** + +- **1-based indexing mismatch.** The formalization uses `Finset.Icc 1 k` for the sieve indices, matching the mathematical notation n₁ < n₂ < ⋯. However, `StrictMono n` is defined on all of ℕ, meaning `n 0` exists but is never used. The companion Problem 281 uses 0-based indexing (`i < k`). Adopting a consistent convention across the 278–281 cluster would aid readability. + +- **The docstring accurately describes the counterexample**, which is helpful for understanding why the problem is marked as disproved. + +--- + +## 5. Formalizability + +**High.** The statement is fully precise: +- "Strictly increasing sequence of positive integers" → `StrictMono n` (on `ℕ → ℕ`) +- Growth condition → explicit real inequality with `Real.log` +- "Sieve count is o(k)" → explicit ε-δ form + +**No ambiguity.** Every component of the mathematical statement has an unambiguous Lean translation. The only interpretive choice is whether "log" means natural log or another base; the formalization uses `Real.log` (natural logarithm), which is standard in analytic number theory and matches the usual convention for this problem. + +--- + +## 6. Correctness + +### 6a. The `sieveCount` definition is correct. + +It counts `m ∈ {0, …, n(k)−1}` such that `m ≢ a(i) (mod n(i))` for all `i ∈ {1, …, k}`. This matches the mathematical statement exactly. + +### 6b. The theorem statement correctly formalizes the disproof. + +The original Erdős–Graham conjecture asserts that for **all** valid sequences, the sieve count is **not** o(k). The negation (disproof) is: there **exists** a valid sequence where the sieve count **is** o(k). The formalization captures this existential statement correctly. + +Checking each component: +- `∃ (n : ℕ → ℕ) (a : ℕ → ℕ) (ε : ℝ)` — existential over sequences and epsilon ✓ +- `0 < ε` — positive epsilon ✓ +- `StrictMono n` — strictly increasing ✓ +- `∀ k, 1 ≤ k → (n k : ℝ) > (1 + ε) * ↑k * Real.log ↑k` — growth condition for k ≥ 1 ✓ +- The o(k) condition: `∀ c : ℝ, 0 < c → ∃ K : ℕ, ∀ k, K ≤ k → (sieveCount n a k : ℝ) < c * ↑k` ✓ + +### 6c. Verification of Cambie's counterexample against the formalization. + +Taking n(k) = 2^k, a(k) = 2^(k−1) + 1 for k ≥ 1: + +- **Growth condition:** 2^k grows exponentially while (1+ε)k ln k grows polynomially. For ε = 1, checking small cases: k=1: 2 > 2·1·0 = 0 ✓; k=2: 4 > 2·2·ln 2 ≈ 2.77 ✓; k=3: 8 > 2·3·ln 3 ≈ 6.59 ✓. Satisfied for all k ≥ 1. ✓ +- **Sieve analysis:** Avoiding a(i) mod n(i) for i=1,…,k forces m ≡ 1 (mod 2^k). The only such m in {0,…,2^k − 1} is m = 1. So sieveCount = 1 for all k ≥ 1, which is trivially o(k). ✓ +- **StrictMono:** 2^0 < 2^1 < 2^2 < ⋯ ✓ + +The counterexample is valid and the formalization correctly accepts it as a witness. + +### 6d. Minor observation on positivity. + +Unlike Problem 281, the formalization does not explicitly require `∀ i, 0 < n i`. This is not a bug: `StrictMono` on `ℕ → ℕ` implies `n(k) ≥ k`, so `n(i) ≥ 1` for all `i ≥ 1`, and the sieve only uses indices `i ∈ {1, …, k}`. The value `n(0)` is unconstrained beyond `n(0) < n(1)`, but it is never referenced in `sieveCount`. + +### 6e. Edge case: k = 0. + +When `k = 0`, `Finset.Icc 1 0 = ∅`, so the universal quantifier in the filter is vacuously true for all m, giving `sieveCount n a 0 = n 0`. The o(k) condition only needs to hold for sufficiently large k, so this is harmless. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor overlap with 281's `avoidCountFin`; separate definitions defensible | +| Citations | Correct; could use "Stijn Cambie" (full name) | +| Variants | Disproved version correctly captured; no missing variants | +| Readability | Good; minor 1-based vs 0-based inconsistency with 281 | +| Formalizability | Fully precise, no ambiguity | +| Correctness | **Correct and complete** — counterexample verified against formalization | + +**Overall: The formalization is mathematically correct and faithfully captures the disproved Erdős–Graham conjecture.** diff --git a/ai-review/281.md b/ai-review/281.md new file mode 100644 index 0000000000..06d0777690 --- /dev/null +++ b/ai-review/281.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 281 + +## 1. Code Reuse + +The formalization defines its own `avoidCountAll` and `avoidCountFin` helper functions that count integers in `{0, …, N-1}` avoiding congruence classes, using `Finset.range` and `Finset.filter`. The codebase already provides a well-developed density library in `FormalConjecturesForMathlib/Data/Set/Density.lean` with: + +- `Set.partialDensity` — proportion of elements in an initial segment +- `Set.HasDensity` — convergence of partial density to a limit +- `Set.upperDensity` / `Set.lowerDensity` — limsup/liminf of partial densities + +The hypothesis "the set of integers not satisfying any congruence has density 0" could be expressed as: +```lean +∀ a, {m : ℕ | ∀ i, ¬(m ≡ a i [MOD n i])}.HasDensity 0 +``` +and similarly for the conclusion. This would improve consistency with the rest of the codebase (e.g., Erdős 72, 109, 125, 1074 all use the library density predicates). + +Additionally, the neighboring problem **Erdős 280** (`ErdosProblems/280.lean`) defines a very similar `sieveCount` function. The `avoidCountFin` here and `sieveCount` there serve analogous purposes (counting integers avoiding finitely many congruence classes), though they differ in the upper bound of the range and indexing convention (`i < k` vs `i ∈ Finset.Icc 1 k`). A shared utility could serve both. + +**Recommendation:** Consider refactoring to use `Set.HasDensity 0` from the library. This would reduce ad-hoc definitions and make the statement more idiomatic. + +## 2. Citations + +The formalization cites: +- `[ErGr80]` — Erdős and Graham, *Old and new problems and results in combinatorial number theory* (1980). + +The [erdosproblems.com/281](https://www.erdosproblems.com/281) page additionally references: +- `[DaEr36]` — Davenport and Erdős theorem (used in the proof) +- `[HaRo66]` — Halberstam and Roth (containing Rogers' result, also used in the proof) + +The docstring mentions "The proof combines the Davenport–Erdős theorem with Rogers' optimal sieve bound" but does not provide the corresponding bibliographic entries. Since these are cited on the website and are integral to the proof strategy described in the docstring, they should be included. Suggested additions: + +``` +[DaEr36] Davenport, H. and Erdős, P., ... +[HaRo66] Halberstam, H. and Roth, K. F., *Sequences*. Oxford University Press (1966). +``` + +**Recommendation:** Add the `[DaEr36]` and `[HaRo66]` citations to match the website. + +## 3. Variants + +The erdosproblems.com page notes two additional observations: +1. The hypothesis (density-0 for all choices of residues) implies $\sum 1/n_i = \infty$. +2. If the $n_i$ are pairwise coprime, the condition $\sum 1/n_i = \infty$ is sufficient for the hypothesis to hold. + +These are auxiliary observations rather than separate conjectures, so it is reasonable not to include them as formal variants. However, they could be useful as separate lemmas (e.g., `erdos_281.sum_reciprocal_diverges`) for anyone attempting to prove the main theorem. + +**Assessment:** No critical variants are missing. The auxiliary observations are optional but could add value as separate lemmas. + +## 4. Readability + +The formalization is generally readable. The helper definitions `avoidCountAll` and `avoidCountFin` have clear docstrings. Some observations: + +- The inline density condition (the `∀ ε, 0 < ε → ∃ N₀, ...` pattern) is somewhat verbose. Using `Set.HasDensity 0` would make the statement more concise and immediately recognizable to someone familiar with the library. +- The 0-indexing (`i < k`) vs the original problem's 1-indexing (`1 ≤ i ≤ k`) is a standard Lean convention and is clearly documented. +- The `answer(True) ↔` wrapper is appropriate for a proved yes/no question. + +**Assessment:** Good readability. Could be improved by using library density predicates. + +## 5. Formalizability + +The problem is **unambiguously formalizable**. The statement involves: +- A strictly increasing sequence of positive integers — standard. +- Congruence classes — well-defined in Lean via `Nat.ModEq`. +- Natural density zero — the standard ε-N definition is used, equivalent to the library's `HasDensity 0`. +- The quantifier structure (∀ε, ∃k, ∀a, eventually...) is precisely captured. + +The only potential ambiguity in the original problem is the meaning of "density," which could refer to natural density, upper density, or lower density. However, since the set of integers avoiding finitely many periodic congruence classes is itself eventually periodic (with period lcm of the moduli), the natural density exists for the conclusion. For the hypothesis (infinitely many congruences), requiring the proportion to be eventually < ε for all ε is equivalent to requiring upper density 0, which implies natural density 0 when it exists. The formalization's approach is correct and unambiguous. + +**Assessment:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Hypothesis (lines 63–65):** +```lean +(∀ a : ℕ → ℕ, ∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N, N₀ ≤ N → (avoidCountAll n a N : ℝ) / (N : ℝ) < ε) +``` +This states: for every choice of residue classes `a`, the proportion of integers in `{0,…,N-1}` avoiding all congruences tends to 0. This correctly captures "the set of integers not satisfying any of the congruences has density 0." + +**Conclusion (lines 66–67):** +```lean +∀ ε : ℝ, 0 < ε → ∃ k : ℕ, ∀ a : ℕ → ℕ, + ∃ N₀ : ℕ, ∀ N, N₀ ≤ N → (avoidCountFin n a k N : ℝ) / (N : ℝ) < ε +``` +This states: for every ε > 0, there exists k such that **for all** choices of residues, the density of integers avoiding the first k congruences is < ε. The crucial point is that k depends only on ε (and the sequence n), not on the choice of residues a. This correctly captures the uniform convergence aspect of the problem. + +**Quantifier order:** The hypothesis has `∀a, [density 0]` (each choice individually gives density 0), while the conclusion has `∃k, ∀a, [density < ε with first k]` (a single k works for all choices simultaneously). This is the correct and non-trivial direction — the problem asks whether pointwise density-0 implies uniform finite truncation sufficiency. + +**`avoidCountAll` vs `avoidCountFin`:** The set counted by `avoidCountFin` is a superset of the set counted by `avoidCountAll` (avoiding fewer congruences is easier), so the conclusion is indeed stronger in the right way: even with only finitely many congruences, the avoidance density is small. + +**Status:** Marked as `research solved` with `answer(True)`, consistent with the website's "PROVED" status. + +**No mathematical errors detected.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Could use `Set.HasDensity` from library; shared utility possible with Erdős 280 | +| Citations | Missing `[DaEr36]` and `[HaRo66]` references from the website | +| Variants | No critical variants missing; auxiliary observations could be added as lemmas | +| Readability | Good; would benefit from library density predicates | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/282.md b/ai-review/282.md new file mode 100644 index 0000000000..6fa2c8bc42 --- /dev/null +++ b/ai-review/282.md @@ -0,0 +1,129 @@ +# Review: Erdos Problem 282 + +**File:** `FormalConjectures/ErdosProblems/282.lean` + +--- + +## 1. Code Reuse + +**Overlap with Problem 206.** Both problems concern greedy algorithms for Egyptian fractions. Problem 206 (`FormalConjectures/ErdosProblems/206.lean`) defines `unitFracSum` and `bestUnderapprox` for studying whether greedy best-underapproximations are eventually optimal. However, the two formalizations model fundamentally different questions: 206 asks about optimality of greedy *selection* among all denominators, while 282 asks about *termination* of the greedy algorithm restricted to odd denominators. The definitions (`greedyDenominator`/`greedyRemainder` vs. `unitFracSum`/`bestUnderapprox`) are structurally different and unification would not be natural. + +**No reusable infrastructure in FormalConjecturesForMathlib applies.** The density definitions in `FormalConjecturesForMathlib/Data/Set/Density.lean`, the AP machinery in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`, and the additive combinatorics utilities are all unrelated to the Egyptian fraction greedy algorithm. The definitions in 282 are self-contained and appropriately so. + +--- + +## 2. Citations + +**[ErGr80, p.30]** — The docstring cites: +> Erdos, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +This matches the website's attribution. The page number p.30 is consistent. + +**Missing attribution to Stein.** The website notes that the problem for odd denominators was originally posed by **Stein**, with Erdos and Graham discussing it in [ErGr80]. The docstring does not mention Stein. Adding a note such as "originally posed by Stein" would improve attribution accuracy. + +**Graham's characterization results** mentioned on the website (conditions for representability as sums of unit fractions with denominators in a residue class, and the square denominator characterization) are background context rather than direct references for the problem statement. Their omission from the docstring is acceptable. + +--- + +## 3. Variants + +**Captured:** The main conjecture — termination of the greedy algorithm for x in (0,1) with odd denominator, using odd denominators — is correctly formalized. + +**Not captured:** + +- **General (x, A) question.** The website poses the broader question: for which pairs (x, A) does the greedy algorithm terminate? This is a research direction rather than a specific conjecture, so omitting it is reasonable. + +- **Square denominator variant.** Erdos and Graham conjectured that the greedy algorithm *fails* to terminate when A is the set of perfect squares, "possibly almost always." This is a specific, distinct conjecture that could warrant its own formalization (perhaps as a separate problem file or an additional theorem in this file). Its absence is a minor gap. + +- **Connection to Problem 206.** The website references Problem 206 as related. A cross-reference in the docstring (e.g., "See also `erdos_206`") would be a helpful addition. + +--- + +## 4. Readability + +**Generally good.** The code is clean and well-structured: + +- `greedyDenominator` and `greedyRemainder` have clear names and docstrings. +- The main theorem reads naturally as a mathematical statement. +- The namespace `Erdos282` keeps definitions scoped appropriately. + +**Minor suggestions:** + +- The docstring for `greedyDenominator` says "returns the minimal n in A such that n >= 1/x" but the definition computes `sInf {n : ℕ | n ∈ A ∧ x⁻¹ ≤ (n : ℚ)}`, which is the same thing. The docstring accurately describes the code. +- The `greedyRemainder` docstring says "choosing the minimal odd n >= 1/x" which bakes in the odd-denominator specialization, but the definition is parametric over A. This is a very minor inconsistency; the docstring could say "choosing the minimal n in A with n >= 1/x" for full generality. + +--- + +## 5. Formalizability + +**High.** The problem as stated on the website is precise enough for unambiguous formalization: + +- "Greedy algorithm" has a standard, well-defined meaning: at each step, choose the smallest eligible denominator. +- "Terminates" means the remainder reaches 0 in finitely many steps. +- "Odd denominator" for the input x and "odd denominators" for the unit fractions are both precise conditions. +- The domain x in (0,1) is explicit. + +**No ambiguity.** Every component maps cleanly to the Lean formalization. The only minor interpretive question — whether "terminates" means finitely many steps vs. the remainder eventually being 0 — is resolved identically either way, since each step strictly decreases the (positive) remainder. + +--- + +## 6. Correctness + +### 6a. `greedyDenominator` is correct. + +For x > 0, it computes `sInf {n : ℕ | n ∈ A ∧ x⁻¹ ≤ (n : ℚ)}`. For A = {odd naturals}: +- The set is nonempty (arbitrarily large odd numbers exist). +- `Nat.sInf` on a nonempty set returns the minimum element. +- The condition `x⁻¹ ≤ n` is equivalent to `1/n ≤ x` for positive n, which is the standard greedy criterion: choose the smallest denominator whose unit fraction does not exceed x. +- Since 0 is even, 0 ∉ A, so the returned n is always positive. This ensures 1/n is well-defined and positive. + +For x ≤ 0, it returns 0, which is a safe sentinel value since `greedyRemainder` guards on `r ≤ 0`. + +### 6b. `greedyRemainder` is correct. + +The recursion: +- Base: `greedyRemainder A x 0 = x` +- Step: if r_k ≤ 0, return 0; else return r_k - 1/greedyDenominator(A, r_k) + +**Non-negativity of remainders:** Since greedyDenominator picks n with 1/n ≤ r_k (when r_k > 0), we have r_{k+1} = r_k - 1/n ≥ 0. The remainder never becomes strictly negative. The guard `r ≤ 0` effectively checks `r = 0`, which is the termination condition. Using `≤` rather than `=` is a defensive choice that doesn't affect mathematical behavior. + +**Preservation of odd denominator:** If x = p/q with q odd and we subtract 1/n with n odd, the new rational is (np - q)/(nq). Since nq is odd (product of odd numbers), the reduced denominator divides nq and is therefore also odd. This means the greedy algorithm stays within the domain of rationals with odd denominator, and greedyDenominator always has valid candidates. The formalization correctly relies on this implicitly. + +### 6c. The theorem statement is correct. + +```lean +answer(sorry) ↔ +∀ x : ℚ, 0 < x → x < 1 → x.den % 2 = 1 → +∃ k : ℕ, greedyRemainder {n : ℕ | n % 2 = 1} x k = 0 +``` + +- `answer(sorry)` — Correct for an open problem whose truth value is unknown. +- `0 < x → x < 1` — Restricts to x in (0,1) as stated. +- `x.den % 2 = 1` — Checks that the denominator of x (in lowest terms) is odd. This is the correct formalization of "x has odd denominator." +- `∃ k, greedyRemainder ... k = 0` — Termination means the remainder reaches exactly 0 in finitely many steps. +- `{n : ℕ | n % 2 = 1}` — The set of odd positive naturals. Note this includes 1. For x in (0,1), x⁻¹ > 1, so the greedy step picks n ≥ 2, meaning n ≥ 3 (smallest odd number ≥ 2). The inclusion of 1 in the set is harmless. + +### 6d. Edge case analysis. + +- **x = 1/3:** greedyDenominator picks n = 3 (smallest odd n ≥ 3). Remainder = 1/3 - 1/3 = 0. Terminates in 1 step. ✓ +- **x = 2/3:** greedyDenominator picks n = 3 (smallest odd n ≥ 3/2). Remainder = 2/3 - 1/3 = 1/3. Then as above, terminates in 2 steps. ✓ +- **x approaching 0:** x⁻¹ becomes very large, so n is large and 1/n is small. The algorithm makes progress but may take many steps. The conjecture asserts it still terminates. + +### 6e. No mathematical flaws identified. + +The formalization is a faithful translation of the problem as stated on the website and in [ErGr80]. An experienced mathematician would not identify any issues with the mathematical content. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No applicable reusable code; self-contained definitions are appropriate | +| Citations | [ErGr80] correct; Stein attribution missing | +| Variants | Main conjecture captured; square denominator variant and cross-reference to Problem 206 not included | +| Readability | Good; minor docstring generality suggestion | +| Formalizability | Fully precise, no ambiguity | +| Correctness | **Correct and complete** — faithful formalization of the open conjecture | + +**Overall: The formalization is mathematically correct and faithfully captures the open Erdos-Graham conjecture on termination of the greedy Egyptian fraction algorithm with odd denominators. Minor improvements: add Stein attribution, cross-reference Problem 206, and consider formalizing the square denominator variant.** diff --git a/ai-review/284.md b/ai-review/284.md new file mode 100644 index 0000000000..c22890d20f --- /dev/null +++ b/ai-review/284.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 284 + +## 1. Code Reuse + +Several closely related problems share infrastructure that could be unified: + +- **Problem 285** (`285.lean`) is the *dual* problem: it defines $f(k)$ as the **minimal** value of $n_k$ (the largest element) rather than the **maximal** value of $n_1$ (the smallest element). Both define "representations of 1 as a sum of $k$ distinct unit fractions" but use entirely different Lean idioms: 284 uses `Finset ℕ` + `sSup`, while 285 uses `Fin k.succ → ℕ` + `IsLeast` with erased quantifiers (`∀ᵉ`). A shared definition of "valid $k$-element unit fraction decomposition" could serve both. + +- **Problem 286** (`286.lean`) formalizes essentially the same result of Croot (the interval version: there exist $k$ distinct positive integers in an interval of width $(e - 1 + o(1))k$ whose reciprocals sum to 1). It uses the same `Finset ℕ` approach and the same `S.sum (fun n => (1 : ℚ) / ↑n) = 1` idiom. The shared predicate pattern `S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ S.sum (fun n => (1 : ℚ) / ↑n) = 1` appears verbatim in both 284 and 286 and could be factored out. + +- **Problem 290** (`290.lean`) defines `harmonicPartialSum` for partial harmonic sums over intervals. While not directly reusable here, the pattern of defining utility functions for reciprocal sums is relevant. + +- **`FormalConjecturesForMathlib/Data/Real/Constants.lean`** stores mathematical constants. The constant $1/(e-1)$ appears in problems 284, 285, and 286; a named constant could improve readability across all three. + +**Recommendation:** Extract a shared predicate like `IsUnitFractionDecomp (S : Finset ℕ) (k : ℕ)` encoding `S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ S.sum (fun n => (1 : ℚ) / ↑n) = 1` into a utility file, and use it in problems 284, 285, 286, and 287. + +## 2. Citations + +The formalization includes: + +- **[Cr01]** Croot, E., *On a coloring conjecture about unit fractions*, Annals of Mathematics (2001). +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +These match the references on [erdosproblems.com/284](https://www.erdosproblems.com/284). The citation details (author names, titles, journals, years) are accurate and complete. + +## 3. Variants + +The website describes two key sub-results: + +1. **Trivial upper bound:** $f(k) \leq (1 + o(1))\,k/(e-1)$, derived from $\sum_{u \leq n \leq eu} 1/n = 1 + o(1)$. +2. **Croot's lower bound (essential solution):** For any $N > 1$, there exists $k \geq 1$ and $N < n_1 < \cdots < n_k \leq (e + o(1))N$ with $1 = \sum 1/n_i$. + +The formalization captures only the combined asymptotic result $f(k) \sim k/(e-1)$ as a single `Tendsto` statement. Compare with Problem 285, which explicitly separates the lower bound into a variant theorem `erdos_285.variants.lb`. + +**Recommendation:** Add a variant theorem `erdos_284.variants.ub` for the trivial upper bound $f(k) \leq (1 + o(1))\,k/(e-1)$, mirroring the pattern in Problem 285. This is mathematically natural since the upper bound is described as "trivial" on the website. + +## 4. Readability + +The code is reasonably readable. Specific observations: + +- The `erdos284_f` definition clearly documents its meaning via the docstring. The implementation using `sSup` over a set comprehension is idiomatic. +- The encoding of "m is the minimum of S" via `m ∈ S ∧ ∀ n ∈ S, m ≤ n` is clear and standard. +- The `Tendsto` formulation of the asymptotic is clean and more compact than the explicit `o =o[atTop]` approach used in Problem 285. +- The `open Filter Finset` at the top is appropriate and minimal. + +**Minor suggestion:** The docstring on `erdos_284` says "Equivalently, $f(k) \cdot (e-1) / k \to 1$ as $k \to \infty$." This helpfully connects the mathematical statement to the Lean formalization. + +## 5. Formalizability + +The problem statement "$f(k) = (1 + o(1))\,k/(e-1)$" is standard asymptotic notation with a precise mathematical meaning: $\lim_{k \to \infty} f(k) \cdot (e-1) / k = 1$. This is unambiguous and straightforwardly formalizable. + +The only source of potential ambiguity is the domain of $f$: for small $k$ (specifically $k = 0$ and $k = 2$), no valid decomposition exists, so the set whose `sSup` is taken is empty. In Lean/Mathlib, `sSup ∅` on `ℕ` returns `0`, which is a harmless convention since the `Tendsto ... atTop ...` statement only concerns the eventual behavior. **This is not a real issue.** + +**Assessment: Fully formalizable with no ambiguity.** + +## 6. Correctness + +### Definition of `erdos284_f` + +The definition correctly captures $f(k)$ as the supremum of all achievable minimum elements: + +``` +sSup {m : ℕ | ∃ S : Finset ℕ, S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ + S.sum (fun n => (1 : ℚ) / ↑n) = 1 ∧ m ∈ S ∧ ∀ n ∈ S, m ≤ n} +``` + +- `S.card = k`: exactly $k$ elements. ✓ +- `∀ n ∈ S, 0 < n`: all elements are positive (excluding 0, which would make `1/n` undefined/zero). ✓ +- `S.sum (fun n => (1 : ℚ) / ↑n) = 1`: reciprocals sum to 1, computed in ℚ for exactness. ✓ +- `m ∈ S ∧ ∀ n ∈ S, m ≤ n`: $m$ is the minimum element of $S$. ✓ +- `sSup`: takes the maximum over all valid minima. ✓ + +**Boundedness of the set:** For any valid $S$ with minimum $m$, all $k$ elements are $\geq m$, so $1 = \sum 1/n_i \leq k/m$, giving $m \leq k$. Thus the set is bounded above by $k$, and `sSup` is well-defined for nonempty sets (i.e., for all $k$ where valid decompositions exist). + +**Note on `sSup` for `ℕ`:** Since `ℕ` is not conditionally complete from above in general, the use of `sSup` relies on the fact that the relevant set is finite and bounded. For Lean/Mathlib's `ℕ`, `sSup` of a nonempty bounded set correctly returns the maximum. This is sound. + +### Theorem statement + +``` +Tendsto (fun k => (erdos284_f k : ℝ) * (Real.exp 1 - 1) / (k : ℝ)) atTop (nhds 1) +``` + +This states $\lim_{k \to \infty} f(k)(e-1)/k = 1$, equivalently $f(k) = (1 + o(1))\,k/(e-1)$. This is mathematically equivalent to the problem statement. ✓ + +**Division by zero at $k = 0$:** When $k = 0$, the expression divides by $(0 : \mathbb{R})$, which in Lean yields $0$. Since `Tendsto ... atTop ...` ignores finitely many initial values, this is harmless. ✓ + +**`answer(True)` wrapper:** The problem asks "Is it true that...?" and the answer is yes (essentially proved by Croot [Cr01]). The `answer(True)` wrapper is correct. ✓ + +**Category tag:** `category research solved` is correct; the problem is marked as proved on the website. ✓ + +### Stylistic inconsistency with Problem 285 + +Problem 284 and 285 are companion problems from the same source [ErGr80]. Their formalizations use different idioms: + +| Aspect | Problem 284 | Problem 285 | +|--------|-------------|-------------| +| Set representation | `Finset ℕ` | `Fin k.succ → ℕ` | +| Extremal value | `sSup` (external def) | `IsLeast` (inline) | +| Asymptotic encoding | `Tendsto ... (nhds 1)` | `∃ o, o =o[atTop] 1, ...` | +| Quantifier style | Standard | Erased (`∀ᵉ`) | + +While both are mathematically correct, the inconsistency is notable. The `Finset` + `sSup` + `Tendsto` approach in 284 is arguably cleaner and more canonical. + +### Overall correctness verdict + +**The formalization is correct and complete.** The definition of `erdos284_f` faithfully captures the mathematical definition of $f(k)$, and the theorem statement correctly encodes the asymptotic $f(k) \sim k/(e-1)$. No mathematical flaws are identified. The only recommendations are stylistic (add a variant for the upper bound, consider shared infrastructure with related problems). diff --git a/ai-review/286.md b/ai-review/286.md new file mode 100644 index 0000000000..82c86e12df --- /dev/null +++ b/ai-review/286.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 286 + +## 1. Code Reuse + +Several closely related Egyptian fraction problems exist in the codebase that share the same `S.sum (fun n => (1 : ℚ) / ↑n) = 1` pattern: + +- **Problem 284** (`284.lean`): The dual problem — asks about the maximal minimum element `f(k)` in k-term Egyptian fraction representations of 1, with `f(k) ~ k/(e-1)`. Uses `Real.exp 1 - 1` identically. Problem 284's upper bound argument (`∑_{u ≤ n ≤ eu} 1/n = 1 + o(1)`) is exactly the observation underlying why `e-1` appears in Problem 286. +- **Problem 287** (`287.lean`): Gap constraints on Egyptian fractions with the same sum pattern. +- **Problem 293** (`293.lean`): Defines `AppearsInKTermEgyptian`, a reusable predicate encapsulating the core Egyptian fraction condition. Problem 286 could potentially reference or mirror this definition instead of inlining the conditions. +- **Problems 296, 300, 308, 310, 320**: All use variants of the reciprocal sum pattern. + +**Recommendation:** The formulation in 286 is self-contained and inline, which is fine for a standalone statement. However, if a shared `EgyptianFractionRepresentation` predicate were introduced (generalizing `AppearsInKTermEgyptian` from 293), it could unify the common pattern `S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ S.sum (fun n => (1 : ℚ) / ↑n) = 1` across many problems. This is a codebase-wide consideration, not a deficiency of 286 specifically. + +## 2. Citations + +The formalization references: +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). +- `[Cr01]` — Croot, E., *On a coloring conjecture about unit fractions*. Annals of Mathematics (2001). + +The website (erdosproblems.com/286) lists the same two references: ErGr80 (p. 33) and Croot's 2001 paper. The page reference "p. 33" is correctly included in the docstring (`[ErGr80, p.33]`). **Citations match the website.** + +## 3. Variants + +The website does not list additional variants or sub-problems for Problem 286. The problem as stated is a single existence question, and the formalization captures it as such. + +One could consider adding a **sharpness/lower bound variant**: that width `(e-1-ε)k` is *not* achievable for any ε > 0 and sufficiently large k. This would formalize the assertion that the constant `e-1` is optimal. However, this lower bound is essentially captured by the dual Problem 284 (which asserts `f(k) ~ k/(e-1)`, implying the minimum element is about `k/(e-1)` and hence the interval must have width at least about `(e-1)k`). Since the website does not list a separate variant, omitting it here is reasonable. + +**No missing variants.** + +## 4. Readability + +The code is well-structured and readable: +- The module docstring clearly states the problem, the answer, and the references. +- The Lean statement is well-commented with the LaTeX formulation in the `/--` docstring. +- The use of `answer(True)` immediately signals the problem is solved affirmatively. +- Variable names are clear: `ε` for the error term, `K` for the threshold, `S` for the set, `a` for the interval's left endpoint. + +**Minor suggestions:** +- The condition `(∀ n ∈ S, 0 < n)` could be documented as ensuring elements are positive integers (not just natural numbers including 0), though this is fairly obvious. +- The interval constraint `a ≤ n ∧ (n : ℝ) ≤ (a : ℝ) + (Real.exp 1 - 1 + ε) * (k : ℝ)` mixes `ℕ` ordering (`a ≤ n`) with `ℝ` ordering for the upper bound. This is necessary due to the real-valued width expression, and is handled correctly, but a brief comment might help. + +**Overall: good readability.** + +## 5. Formalizability + +The problem is **clearly and precisely formalizable**. The statement involves: +- Finite sets of positive integers (Finset ℕ) +- An arithmetic constraint (reciprocal sum equals 1 in ℚ) +- An interval width bound involving the constant e + +The only potential ambiguity in the original problem is the meaning of "interval of width `(e-1+o(1))k`": +- Does `o(1)` refer to a quantity tending to 0 as `k → ∞`? **Yes**, and this is the standard interpretation. +- Is the `o(1)` one-sided (only upper bound) or two-sided? The existence question only requires the upper bound direction (we can fit the representation into a small interval), which is what the formalization captures via `∀ ε > 0`. + +**Ambiguity level: Very low.** The problem has a standard, universally agreed-upon interpretation. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +**Structure:** `∀ ε > 0, ∃ K, ∀ k ≥ K, ∃ S, [conditions on S]` — this is the standard formalization of "for sufficiently large k, there exist ... with o(1) error." + +**Conditions on S:** +1. `S.card = k` — exactly k elements. Since `Finset` elements are distinct by construction, this correctly captures "k distinct integers." +2. `∀ n ∈ S, 0 < n` — all elements are positive. Necessary because `ℕ` includes 0, and division by 0 would be problematic. +3. `∃ a : ℕ, ∀ n ∈ S, a ≤ n ∧ (n : ℝ) ≤ (a : ℝ) + (Real.exp 1 - 1 + ε) * (k : ℝ)` — all elements lie in the interval `[a, a + (e-1+ε)k]`, an interval of width `(e-1+ε)k`. This correctly captures the width constraint. +4. `S.sum (fun n => (1 : ℚ) / ↑n) = 1` — reciprocal sum equals 1, computed in `ℚ` for exactness. This is mathematically correct and avoids floating-point or real-arithmetic issues. + +**Potential concerns (all resolved):** +- **Why ℚ for the sum?** Using `ℚ` instead of `ℝ` is actually *better* — the equation `1/n₁ + ⋯ + 1/nₖ = 1` is a rational identity, and working in `ℚ` makes it exact. This is consistent with problems 284, 287, 293, etc. +- **Why `a : ℕ`?** The left endpoint is a natural number. This is fine — the elements are natural numbers, so the tightest interval has natural-number endpoints. Using `a : ℕ` doesn't lose generality since the interval `[a, a + W]` with `a ∈ ℕ` is at least as tight as any real-valued left endpoint (one can always shift to ⌊min S⌋). +- **Is `Real.exp 1` correct for `e`?** Yes, `Real.exp 1 = e` is standard in Mathlib. +- **Does the formalization match Croot's result?** Croot proved that for any `N > 1`, there exist `n₁ < ⋯ < nₖ` in `(N, (e+o(1))N]` with reciprocal sum 1. This implies that for large `k`, one can find k distinct integers in an interval of width `(e-1+o(1))k` whose reciprocals sum to 1 (by choosing `N ≈ k/(e-1)`). The formalization correctly captures the conclusion. + +**Verdict: The formalization is correct, complete, and faithful to the mathematical content.** diff --git a/ai-review/287.md b/ai-review/287.md new file mode 100644 index 0000000000..00892930a6 --- /dev/null +++ b/ai-review/287.md @@ -0,0 +1,87 @@ +# Review: Erdős Problem 287 + +## 1. Code Reuse + +The formalization uses the standard inline Egyptian fraction pattern `S.sum (fun n => (1 : ℚ) / ↑n) = 1`, shared across many problems in the codebase: + +- **Problem 284** (`284.lean`): Same sum pattern, asks about the maximal minimum element in k-term representations. +- **Problem 286** (`286.lean`): Same sum pattern, asks about fitting representations into short intervals. +- **Problem 292** (`292.lean`): Defines `IsEgyptianRepresentable` — a reusable predicate for Egyptian fraction membership. +- **Problem 293** (`293.lean`): Defines `AppearsInKTermEgyptian` — another reusable predicate. +- **Problem 296** (`296.lean`): Defines `reciprocalSum (A : Finset ℕ) : ℚ` — a standalone helper for `∑ n ∈ A, (1 : ℚ) / (n : ℚ)`. + +The "consecutive gap" encoding — `∃ a ∈ S, ∃ b ∈ S, a < b ∧ (∀ c ∈ S, c ≤ a ∨ b ≤ c) ∧ 3 ≤ b - a` — is bespoke but not reused elsewhere. Problem 854 defines `consecutiveDiffs` and `maxGap` for a related purpose (gaps in coprime residue sequences), but those operate on `List ℕ` rather than `Finset ℕ`, so direct reuse would require conversion. + +**Recommendation:** The inline formulation is appropriate for a self-contained problem statement. No existing utility provides a direct improvement. If multiple problems needed "maximum consecutive gap in a Finset," a shared definition would be warranted, but currently only Problem 287 uses this specific pattern. + +## 2. Citations + +**Formalization includes:** +- `[Er32]` — Erdős, P., *Egyszerű bizonyítás Kürschák egy tételére* (1932). +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). + +**Website (erdosproblems.com/287) lists:** +- `[ErGr80, p.33]` +- `[Va99, 1.15]` +- `[Er32]` + +**Discrepancy:** The reference `[Va99, 1.15]` is present on the website but **missing from the formalization**. This likely refers to a 1999 survey or book (possibly Vaughan or Vardi) at section 1.15. The full bibliographic details are not given on the website itself, but the citation tag should still be included for traceability. + +**Recommendation:** Add a reference line for `[Va99]` to the module docstring, even if the full bibliographic details require further investigation. + +## 3. Variants + +The website describes one main conjecture and no distinct sub-problems or variants. The conditional result — that the conjecture would follow for all but finitely many exceptions if for all large N there exists a prime p ∈ [N, 2N] with (p+1)/2 also prime — is commentary on a potential proof approach, not a separate conjecture to formalize. + +The docstring mentions that the lower bound ≥ 2 (no sum of consecutive reciprocals equals 1) was proved by Erdős [Er32]. This is a *weaker* result, not a variant. One could consider formalizing this known weaker bound as a separate theorem (it would be a provable lemma rather than an open conjecture), but the website does not list it as a separate problem. + +**No missing variants.** + +## 4. Readability + +The code is clean and well-structured: +- The module docstring states the problem clearly with LaTeX and references. +- The best-possible example `1 = 1/2 + 1/3 + 1/6` is included. +- The known weaker result (gap ≥ 2) is mentioned for context. +- The `answer(sorry)` pattern correctly signals an open problem with unknown truth value. + +**Minor suggestions:** +- The consecutive-gap condition `∀ c ∈ S, c ≤ a ∨ b ≤ c` could benefit from a brief inline comment like `-- a, b are consecutive in S` to aid readers unfamiliar with this encoding. +- The docstring references `[ErGr80, p.33]` while the formal statement annotation uses just `[ErGr80]` — this is fine but a minor inconsistency. + +**Overall: good readability.** + +## 5. Formalizability + +The problem is **clearly and precisely formalizable**. It asks a concrete yes/no question about a well-defined combinatorial property of finite sets of positive integers. There is no ambiguity in: +- What constitutes an Egyptian fraction representation of 1 (finite set of distinct integers > 1 whose reciprocals sum to 1). +- What "consecutive gap" means (difference between adjacent elements when sorted). +- What "at least 3" means. + +The only theoretical subtlety is the `answer(sorry)` wrapper: since the problem is open, the formalization must accommodate both True and False outcomes. The biconditional `answer(sorry) ↔ [statement]` correctly does this — if the answer is True, the statement must hold; if False, a counterexample exists. + +**Ambiguity level: None.** The problem is entirely concrete and combinatorial. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +**Structure:** `∀ S : Finset ℕ, [preconditions] → [gap conclusion]` — universally quantified over all candidate sets. + +**Preconditions:** +1. `2 ≤ S.card` — at least 2 elements, matching the problem's "k ≥ 2." This is necessary: with 0 or 1 elements, the gap property is vacuous or undefined. (Note: with k = 1, the only solution to 1/n = 1 with n > 1 is impossible, so the constraint is actually vacuously true for k = 1, but k ≥ 2 matches the original statement.) +2. `∀ n ∈ S, 1 < n` — all elements strictly greater than 1, matching "distinct integers 1 < n₁ < ··· < nₖ." Since `Finset` guarantees distinctness, this correctly captures the requirement. +3. `S.sum (fun n => (1 : ℚ) / ↑n) = 1` — reciprocal sum equals 1, computed in ℚ for exactness. + +**Conclusion:** +`∃ a ∈ S, ∃ b ∈ S, a < b ∧ (∀ c ∈ S, c ≤ a ∨ b ≤ c) ∧ 3 ≤ b - a` + +This asserts the existence of two elements a < b that are *consecutive* in S (no element of S lies strictly between them) with gap b - a ≥ 3. This correctly captures "max(n_{i+1} - n_i) ≥ 3": the maximum consecutive gap is at least 3 if and only if there exists *some* consecutive gap of at least 3. + +**Natural number subtraction:** Since `a < b` (both in ℕ), the expression `b - a` is well-defined and equals the true arithmetic difference. The condition `3 ≤ b - a` correctly means the gap is at least 3. No underflow issue. + +**Verification with the example:** S = {2, 3, 6}. The consecutive pairs are (2, 3) with gap 1 and (3, 6) with gap 3. Taking a = 3, b = 6: we have 3 < 6, no element of S lies in (3, 6), and 6 - 3 = 3 ≥ 3. The statement holds, as expected. + +**Verification with a hypothetical counterexample structure:** If some S had all consecutive gaps ≤ 2, the conclusion would fail (no such a, b exists). The conjecture asserts no such S exists with the given preconditions. This is the correct open question. + +**Verdict: The formalization is correct, complete, and faithful to the mathematical content.** diff --git a/ai-review/29.md b/ai-review/29.md new file mode 100644 index 0000000000..bf1643fea0 --- /dev/null +++ b/ai-review/29.md @@ -0,0 +1,110 @@ +# AI Review: Erdos Problem 29 + +**File:** `FormalConjectures/ErdosProblems/29.lean` + +--- + +## 1. Code Reuse + +**Significant duplication exists.** The `addRepFun` definition in Problem 29 (line 39) is identical in logic to `repCount` defined independently in at least three other files: + +- `ErdosProblems/328.lean:40` — `repCount` +- `ErdosProblems/871.lean:51` — `repCount` +- `ErdosProblems/763.lean` — `repCount` + +All of these compute `((Finset.range (n + 1)).filter (fun a => a ∈ A ∧ (n - a) ∈ A)).card`. The only difference is the name (`addRepFun` vs `repCount`). This definition should be factored out into a shared utility (e.g., `FormalConjecturesForMathlib/Combinatorics/Basic.lean` or a new `AdditiveCombi.lean`) and reused across all four+ files. + +Similarly, the additive basis of order 2 condition `∀ n : ℕ, ∃ a ∈ A, ∃ b ∈ A, a + b = n` is expressed inline in Problem 29 rather than using a named predicate. Problems 869 and 871 both define `IsAdditiveBasis2` and `sumset` for this purpose. Problem 29's formulation is actually *stronger* (every natural number, not just sufficiently large ones — see Correctness below), but even so, a shared definition could be parameterized or the existing `IsAdditiveBasis2` could be referenced. + +**Recommendation:** Extract `repCount`/`addRepFun` into a shared file and have all problems import it. Consider also a shared `IsAdditiveBasis2` or at minimum a shared `sumset`. + +--- + +## 2. Citations + +The website (erdosproblems.com/29) lists the following references: +- **ErGr80**, p. 48 +- **Er89d** +- **Er95** +- **Er97c** +- **JPSZ24** — Jain, Pham, Sawhney, and Zakharov (2024) + +The formalization's docstring mentions: +- Erdos's probabilistic proof (no specific citation key) +- Sidon's 1932 question (no specific citation) +- Jain, Pham, Sawhney, and Zakharov (2024) + +**Issues:** +- The docstring does not include any of the specific reference keys (ErGr80, Er89d, Er95, Er97c, JPSZ24) that appear on the website. +- The full bibliographic details for JPSZ24 (title, journal) are not provided. +- The references ErGr80 (p. 48), Er89d, Er95, and Er97c are entirely absent from the docstring. + +**Recommendation:** Add the reference keys and expand the JPSZ24 citation to include full bibliographic details, consistent with the style used in other files (e.g., Problem 871's docstring). + +--- + +## 3. Variants + +The website formulation asks specifically for an **explicit construction**: + +> "Is there an explicit construction of a set $A \subseteq \mathbb{N}$ such that $A + A = \mathbb{N}$ but $1_A * 1_A(n) = o(n^\varepsilon)$ for every $\varepsilon > 0$?" + +The formalization only asks for *existence* (`∃ A : Set ℕ, ...`), not for an explicit/constructive witness. This is a meaningful distinction — Erdos had already proved existence via probabilistic methods. The problem as posed on the website is asking whether such a set can be *explicitly constructed*, which is a stronger (and more interesting) question. + +However, formalizing "explicit construction" in Lean is inherently difficult — one would need to require a computable function `ℕ → Bool` (the characteristic function of $A$) rather than an arbitrary `Set ℕ`. The current existential formulation captures the mathematical content but loses the constructivity requirement. + +**Recommendation:** At minimum, the docstring should note that the original problem asks for an explicit construction, and the formalization captures only the existence statement. Optionally, a second variant could provide a constructive formulation using `DecidablePred (· ∈ A)` or a computable characteristic function. + +--- + +## 4. Readability + +The code is generally readable. Minor observations: + +- The docstring on `addRepFun` references "Dirichlet convolution" which is misleading. Dirichlet convolution is a multiplicative number theory concept where $(f * g)(n) = \sum_{d | n} f(d)g(n/d)$. The operation here is *additive convolution* (also called Cauchy convolution or simply the representation function). The sum is over pairs $(a, b)$ with $a + b = n$, not $a \cdot b = n$. +- The name `addRepFun` is fine but inconsistent with the `repCount` name used in the rest of the codebase. Standardizing would improve cross-file readability. + +**Recommendation:** Fix the "Dirichlet convolution" reference to "additive convolution" or simply remove the convolution language. Rename to `repCount` for consistency. + +--- + +## 5. Formalizability + +The mathematical content is precise and clearly formalizable. The statement "$A + A = \mathbb{N}$ and $r_A(n) = o(n^\varepsilon)$ for all $\varepsilon > 0$" is unambiguous from a mathematical standpoint. + +The one subtlety is the meaning of "explicit construction" (see Variants above), which is inherently difficult to formalize. Setting that aside, the pure existence statement is completely precise. + +**Assessment:** High formalizability for the existence version. The "explicit" aspect introduces philosophical ambiguity about what "constructive" means in this context. + +--- + +## 6. Correctness + +**The formalization is mathematically correct for the existence statement**, with one notable modeling choice: + +**Additive basis condition — "every" vs "sufficiently large":** +The formalization requires `∀ n : ℕ, ∃ a ∈ A, ∃ b ∈ A, a + b = n`, meaning *every* natural number is representable. The website states $A + A = \mathbb{N}$, which indeed means every natural number. This is consistent. However, Problems 869 and 871 use the weaker "every sufficiently large" formulation (`∃ N₀, ∀ n ≥ N₀, ...`). The distinction matters: requiring $0 \in A$ (to represent $0 = 0 + 0$) and ensuring small numbers are covered is a slightly stronger condition, though for the purpose of this problem (where one can always add finitely many elements to handle small cases without affecting the asymptotic growth), the two formulations are essentially equivalent. The choice to use $A + A = \mathbb{N}$ exactly matches the website's statement, so this is correct. + +**Representation function — ordered pairs:** +The `addRepFun` counts ordered pairs $(a, b)$ with $a + b = n$, which matches the standard convention for $1_A * 1_A(n)$ (the convolution counts ordered pairs). This is correct. + +**Asymptotic condition:** +The condition `(fun n => (addRepFun A n : ℝ)) =o[atTop] (fun n => (n : ℝ) ^ ε)` for all $\varepsilon > 0$ correctly captures $r_A(n) = o(n^\varepsilon)$. The use of Lean's `Asymptotics.isLittleO` with `Filter.atTop` is the standard and correct way to express this. + +**Answer value:** +The problem is marked `answer(True)`, which is correct — such a set does exist (proved by Erdos probabilistically, and explicitly constructed by JPSZ24). + +**Overall assessment:** The formalization is correct and complete as a statement of existence. The only gap is the missing "explicit construction" requirement from the original problem. + +--- + +## Summary + +| Category | Rating | Notes | +|----------|--------|-------| +| Code Reuse | Needs improvement | `addRepFun` duplicates `repCount` from 3+ other files; additive basis condition also duplicated | +| Citations | Incomplete | Missing reference keys ErGr80, Er89d, Er95, Er97c; JPSZ24 lacks full details | +| Variants | Partial | Missing the "explicit construction" aspect, which is the core of the problem | +| Readability | Good | Minor issue: "Dirichlet convolution" should be "additive convolution"; name inconsistency | +| Formalizability | High | Clean mathematical statement, easily formalizable | +| Correctness | Correct | Mathematically sound; `answer(True)` is right; ordered-pair convention is standard | diff --git a/ai-review/290.md b/ai-review/290.md new file mode 100644 index 0000000000..ce67817a4c --- /dev/null +++ b/ai-review/290.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 290 + +## 1. Code Reuse + +Mathlib provides `harmonic : ℕ → ℚ` (defined in `Mathlib.NumberTheory.Harmonic.Defs`) as `fun n => ∑ i ∈ Finset.range n, (↑(i + 1))⁻¹`, computing H_n = ∑_{k=1}^{n} 1/k. In principle, `harmonicPartialSum a b` could be expressed as `harmonic (b + 1) - harmonic a` (with appropriate index shifts), but this would introduce complexity without clarity. The direct `Finset.Icc`-based definition is arguably clearer for this problem since the statement is naturally about partial sums over an interval [a, b]. + +Note that Problem 291 (`harmonicLcmNumerator`, `lcmUpTo`) and Problem 314 (`erdos314M`, `erdos314Epsilon`) define their own harmonic-related helpers in separate namespaces. There is no shared utility in `FormalConjecturesForMathlib/`. This is acceptable since each problem's helper serves a different purpose, but if more harmonic-sum problems arise, a shared `harmonicPartialSum` definition could be extracted. + +**Verdict:** Current approach is reasonable. No immediate code reuse opportunity. + +## 2. Citations + +The docstring references: +- `[ErGr80]` — Erdős & Graham, *Old and new problems and results in combinatorial number theory* (1980). ✅ Matches website. +- `[vD24]` — van Doorn, F., *On the denominators of harmonic numbers* (2024). ✅ Matches website. + +**Missing from the docstring:** +- The website references **OEIS sequence A375081** (listing smallest b values). This is not mentioned in the formalization. + +**Inaccuracy in docstring:** The docstring states "b(a) > a + 0.54 log a for all large a", but the website states the lower bound as "b(a) > a + (1/2 − o(1)) log a". The value 0.54 appears to be an approximation/interpretation not directly stated on the website. The website separately states "b(a) < a + 0.61 log a for infinitely many a" as an *upper* bound for infinitely many a. The docstring conflates or approximates these bounds. Consider using the exact formulation from the website. + +## 3. Variants + +The formalization captures only the core existence question: does b(a) exist for all a ≥ 1? + +The website poses the additional question: **"If such a b exists, how does b(a) grow with a?"** This quantitative question is not formalized. Specific results and conjectures from the website that could be captured as variants: + +- **Proved (van Doorn):** b(a) < 4.374a for all a > 1 (i.e., b(a) ≪ a) +- **Proved (van Doorn):** b(a) > a + (1/2 − o(1)) log a for large a +- **Explicit construction:** If a ∈ (3^k, 3^{k+1}], then b = 2·3^{k+1} − 1 works +- **Conjecture (van Doorn):** Infinitely many a satisfy b(a) > (log a)² +- **Conjecture (Erdős–Graham style):** b(a) ≤ (1 + o(1))a, or possibly b(a) ≤ a + (log a)^{O(1)} + +These are natural follow-up questions. The quantitative bounds are formalizable but would require significant additional machinery. Their omission is understandable for a first formalization. + +**Verdict:** The core problem is captured. Quantitative variants are omitted but could be added as `erdos_290.variants.*` theorems. + +## 4. Readability + +The code is clean and well-structured: +- The `harmonicPartialSum` helper is clearly named and documented. +- The main theorem statement is concise and directly readable. +- The docstring module documentation includes the problem statement, example, and resolution history. +- Use of `Finset.Icc` matches the mathematical notation ∑_{a ≤ n ≤ b}. + +Minor suggestion: The helper uses `(1 : ℚ) / ↑n` while some other files use `(↑n)⁻¹` or `(n : ℚ)⁻¹`. The `1 / ↑n` form is more readable for this context since the problem is stated in terms of fractions 1/n, so this is fine. + +**Verdict:** Excellent readability. No changes needed. + +## 5. Formalizability + +The problem is **clearly and precisely formalizable**. The statement involves: +- Finite sums of rationals (well-supported in Mathlib) +- Denominators in lowest terms (captured by `ℚ.den`, which gives the canonical denominator) +- Quantification over natural numbers with standard ordering + +There is essentially **no ambiguity** in the mathematical statement. The only interpretive choice is whether "b > a" should be strict (as stated) or could be b ≥ a. The formalization correctly uses strict inequality `a < b`, matching the original. + +**Verdict:** Unambiguous. Fully formalizable with existing Mathlib infrastructure. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification:** + +- **Domain:** `∀ a : ℕ, 1 ≤ a` correctly restricts to positive integers, matching "a ≥ 1". +- **Existential:** `∃ b : ℕ, a < b` correctly captures "there exists b > a". +- **Harmonic sum:** `harmonicPartialSum a b = (Finset.Icc a b).sum (fun n => (1 : ℚ) / ↑n)` correctly computes ∑_{n=a}^{b} 1/n as a rational number. +- **Denominator comparison:** `(harmonicPartialSum a (b + 1)).den < (harmonicPartialSum a b).den` correctly compares the denominators in lowest terms. In Lean4/Mathlib, `ℚ` stores rationals in canonical form with `Nat.Coprime q.num.natAbs q.den`, so `.den` gives exactly s_i where gcd(r_i, s_i) = 1, matching the problem's requirement. +- **Example check:** For a = 3, b = 5: `harmonicPartialSum 3 5 = 1/3 + 1/4 + 1/5 = 47/60` (den = 60), and `harmonicPartialSum 3 6 = 47/60 + 1/6 = 19/20` (den = 20). Indeed 20 < 60. ✓ +- **answer(True):** The problem is marked as solved in the affirmative by van Doorn, so `answer(True)` is correct. +- **Edge case — n = 0 in sum:** If the sum ever included n = 0, we'd have `(1 : ℚ) / ↑0 = 0` (division by zero in ℚ yields 0 in Lean). Since a ≥ 1 and b > a ≥ 1, and we sum over Icc a b (or Icc a (b+1)), all summands have n ≥ 1, so this is not an issue. + +**Verdict:** The formalization is correct and complete for the core existence statement. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No immediate opportunities; current approach is clean | +| Citations | Minor: OEIS A375081 missing; docstring bound "0.54" is imprecise vs. website's "(1/2 − o(1))" | +| Variants | Quantitative growth bounds not captured; could add as variant theorems | +| Readability | Excellent | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete for the core statement | + +**Overall:** High-quality formalization of the core problem. The main areas for improvement are (1) fixing the imprecise bound in the docstring and (2) optionally adding quantitative variant theorems for the growth rate of b(a). diff --git a/ai-review/291.md b/ai-review/291.md new file mode 100644 index 0000000000..69a19f6188 --- /dev/null +++ b/ai-review/291.md @@ -0,0 +1,120 @@ +# Review: Erdős Problem 291 + +**File:** `FormalConjectures/ErdosProblems/291.lean` + +--- + +## 1. Code Reuse + +**`lcmUpTo` could use `Finset.lcmInterval` from FormalConjecturesForMathlib.** +The file `FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` defines: +``` +def lcmInterval (n k : α) : α := (Finset.Ioc n (n + k)).lcm id +``` +For natural numbers, `Finset.Ioc 0 n = Finset.Icc 1 n`, so `lcmUpTo n = Finset.lcmInterval 0 n`. The custom `lcmUpTo` could be replaced or defined as a thin wrapper around the existing utility. + +**Connection to Mathlib's `harmonic`.** +The Wolstenholme prime file (`Wikipedia/WolstenholmePrime.lean`) uses Mathlib's built-in `harmonic` function, which computes harmonic numbers as rationals. An alternative formulation of the gcd condition could be: +- `gcd(a_n, L_n) = 1` iff `(harmonic n).den = lcmUpTo n` + +This would connect the problem to Mathlib's existing API. The current custom `harmonicLcmNumerator` definition is mathematically correct but does not leverage this. Whether this is preferable is debatable — the current approach is more self-contained and closer to the original problem statement. + +**Problem 290** defines `harmonicPartialSum` (harmonic partial sums as rationals), which is related but serves a different purpose (reduced-fraction denominator comparisons vs. gcd with lcm). + +--- + +## 2. Citations + +The formalization cites: +- `[ErGr80]` — Erdős and Graham (1980). ✅ Matches website. + +**Missing citations from the website:** +- **[Sh16]** — Shiu preprint, which predicts approximately `x / log x` coprime cases in `[1, x]` and conjectures infinitely many coprime `n` but with zero density. +- **[WuYa22]** — Wu and Yan (2022), who proved that the upper density of non-coprime cases equals 1, conditional on a consequence of Schanuel's conjecture (linear independence of `1/log p` over ℚ). +- **OEIS A110566** — Related sequence, mentioned on the website. +- The Steinerberger observation is mentioned in the docstring but without a formal citation reference. The website attributes this to Steinerberger without a bracketed reference either, so this is acceptable. + +--- + +## 3. Variants + +**Captured:** +- ✅ Full conjecture: both `gcd(a_n, L_n) = 1` and `gcd(a_n, L_n) > 1` occur infinitely often (`erdos_291`). +- ✅ Solved part: `gcd(a_n, L_n) > 1` infinitely often (`erdos_291.variants.gcd_gt_one`). + +**Not captured:** +- ❌ The open part `gcd(a_n, L_n) = 1` infinitely often is not broken out as a separate variant. This would be natural since the full conjecture is the conjunction, and the two halves have very different statuses (one solved, one open). +- ❌ **Steinerberger's general criterion:** The website gives a stronger characterization: a prime `p ≤ n` divides `gcd(a_n, L_n)` if and only if `p` divides the numerator of `1 + 1/2 + ⋯ + 1/k`, where `k` is the leading digit of `n` in base `p`. The special case where the leading digit is `p - 1` follows from Wolstenholme's theorem. The docstring only mentions the base-3 special case. This general criterion could be a valuable auxiliary theorem. +- ❌ The density predictions (zero density of coprime cases, upper density 1 of non-coprime cases) are not formalized, though these may be too speculative or conditional for the project's scope. + +**Recommendation:** Add a variant `erdos_291.variants.gcd_eq_one` for the open first part, mirroring the existing `gcd_gt_one` variant. The Steinerberger criterion could also be stated as a separate lemma. + +--- + +## 4. Readability + +**Good aspects:** +- Clear docstrings that state the mathematical definitions and the problem. +- Well-structured separation of the full conjecture and the solved variant. +- The `lcmUpTo` and `harmonicLcmNumerator` definitions are clean and well-documented. + +**Minor suggestions:** +- The docstring for `erdos_291` writes `a_n = L_n · H_n`, which is slightly informal notation mixing the raw and the formal. This is fine for a comment but could be clearer. +- The phrase "The second question is trivially yes" in the module docstring could be softened — while the proof is short, calling it "trivial" is the website's language, and the Steinerberger observation is a genuine insight. + +Overall readability is good. No significant issues. + +--- + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise: +- `L_n = lcm(1, ..., n)` is unambiguous. +- `a_n` is uniquely determined by the equation `∑ 1/k = a_n / L_n` (since `L_n` is fixed, `a_n = ∑ L_n/k`). +- The gcd conditions are standard. +- "Infinitely many" is cleanly expressed via the `∀ N, ∃ n ≥ N` pattern. + +There is no ambiguity in the problem statement itself. The only subtlety is that `a_n / L_n` is generally NOT in lowest terms (that's exactly what the problem is about), so `a_n` is not the numerator of the reduced harmonic number — it is the numerator when the denominator is specifically `L_n`. The formalization handles this correctly via the explicit `harmonicLcmNumerator` definition. + +--- + +## 6. Correctness + +**Definitions:** +- ✅ `lcmUpTo n = (Finset.Icc 1 n).lcm id` — Correct. Computes lcm({1, ..., n}). +- ✅ `harmonicLcmNumerator n = ∑_{k ∈ Icc 1 n} lcmUpTo n / k` — Correct. Since `lcmUpTo n` is divisible by every `k ∈ {1, ..., n}`, the natural number division `lcmUpTo n / k` is exact, and the sum equals `L_n · H_n`. The docstring correctly notes this divisibility justification. + +**Main theorem `erdos_291`:** +- ✅ Correctly states the conjunction of both conditions occurring infinitely often. +- ✅ The `1 ≤ n` guard is appropriate (the problem says `n ≥ 1`). +- ✅ The `answer(sorry)` pattern is correct for an open problem. + +**Variant `erdos_291.variants.gcd_gt_one`:** +- ✅ Correctly isolates the solved second part. +- ✅ Marked `category research solved` — correct per the website. + +**Potential issue — edge case `n = 0`:** +- `lcmUpTo 0 = (Finset.Icc 1 0).lcm id = (∅).lcm id = 0` (the lcm of an empty set is 0 in Lean/Mathlib). +- `harmonicLcmNumerator 0 = (Finset.Icc 1 0).sum (fun k => 0 / k) = 0`. +- `Nat.gcd 0 0 = 0`, so neither condition holds for `n = 0`. +- This is fine because the `1 ≤ n` guard excludes `n = 0`. + +**Subtle mathematical note:** +The docstring for the Steinerberger observation says "any `n` whose leading digit in base 3 is 2 has `3 ∣ gcd(a_n, L_n)`." The website gives a more general statement: a prime `p ≤ n` divides `gcd(a_n, L_n)` iff `p` divides the numerator of `H_k` where `k` is the leading digit of `n` in base `p`. The base-3 case works because the numerator of `H_2 = 1 + 1/2 = 3/2` is 3, which is divisible by 3. The docstring's claim is correct but is a special case of a more general fact. + +**Overall correctness: Sound.** No mathematical errors in the formalization. The definitions faithfully capture the problem, and the type-level encoding (using ℕ division with the divisibility justification) is correct. + +--- + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Minor | `lcmUpTo` could use `Finset.lcmInterval 0 n`; connection to Mathlib `harmonic` exists | +| Citations | Incomplete | Missing [Sh16], [WuYa22], OEIS A110566 | +| Variants | Partial | Missing standalone `gcd_eq_one` variant (open part); missing Steinerberger's general criterion | +| Readability | Good | Clear and well-documented | +| Formalizability | Excellent | Unambiguous, fully formalizable | +| Correctness | Correct | No mathematical errors; definitions and theorem statements are sound | diff --git a/ai-review/292.md b/ai-review/292.md new file mode 100644 index 0000000000..9ca41defba --- /dev/null +++ b/ai-review/292.md @@ -0,0 +1,94 @@ +# Review: Erdos Problem 292 + +## 1. Code Reuse + +**Density infrastructure.** The codebase has a mature density library at `FormalConjecturesForMathlib/Data/Set/Density.lean` defining `HasDensity`, `upperDensity`, `lowerDensity`, `partialDensity`, and `HasPosDensity`. The current formalization manually encodes the density-1 condition via an epsilon-delta formulation: + +```lean +∀ ε : ℝ, 0 < ε → + ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → + (egyptianCount N : ℝ) / (N : ℝ) ≥ 1 - ε +``` + +This could be replaced by defining `A : Set ℕ := {n | IsEgyptianRepresentable n}` and stating `A.HasDensity 1`, which is the standard idiom used by dozens of other Erdos problems in this codebase (e.g., 9, 10, 12, 26, 72, 298, 299, etc.). This would improve consistency and reduce boilerplate. The intermediate definitions `egyptianCount` and `IsEgyptianRepresentable` as currently structured require extra work to bridge to the `Set`-based density API; `IsEgyptianRepresentable` would need to remain, but `egyptianCount` could be eliminated entirely. + +**Egyptian fraction definitions.** Several related problems define similar notions: +- Erdos 305: `IsEgyptianRepr a b S` (general a/b representation) +- Erdos 300: `Egyptian1Free A` (no subset sums to 1) +- Erdos 287: inline predicate on `Finset ℕ` + +Problem 292's `IsEgyptianRepresentable` is specialized to representations of 1 with a designated maximum element. While the definitions are not identical, a shared utility (e.g., a predicate for "S is a set of distinct positive integers whose reciprocals sum to 1") could reduce duplication across problems 287, 292, 293, 298, 299, and 300. That said, each problem has slightly different constraints (designated max, gap conditions, general a/b), so full unification may not be practical. + +## 2. Citations + +The formalization includes two citations: + +| Citation | Formalization | Website | +|----------|--------------|---------| +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | Matches. Source is listed as [ErGr80, p.35]. | +| [Ma00] | Martin, G., *Dense Egyptian fractions*. Trans. Amer. Math. Soc. 351 (1999), 3641–3657. | Matches. | + +**Minor issue:** The citation tag `[Ma00]` suggests year 2000, but the journal reference says 1999 (volume 351). This is consistent with the website's own tagging, so it is not a formalization error — the paper likely appeared online or was submitted in 2000 while the journal volume is dated 1999. No action needed; the formalization follows the website's convention. + +**Missing attributions from the website:** The website also credits: +- **Straus** (uncited) for observing that A is closed under multiplication and contains no prime powers. +- **van Doorn** (uncited) for the observation that if n ∈ A (n > 1) then 2n ∈ A. + +These are supplementary observations, not citations of the core result, so their omission from the docstring is acceptable. They would be relevant if variants were formalized (see Section 3). + +## 3. Variants + +The website describes several structural properties beyond density 1: + +1. **Martin's quantitative bound:** |B ∩ [1,x]| / x ≍ (log log x) / (log x), where B = ℕ \ A. The docstring mentions this but it is not formalized. This is a stronger result than density 1 and could be a natural companion theorem. + +2. **Closure under multiplication (Straus):** If m, n ∈ A then mn ∈ A. Not formalized. + +3. **No prime powers in A (Straus):** If n = p^k for prime p, then n ∉ A. Not formalized. + +4. **Doubling property (van Doorn):** If n ∈ A and n > 1, then 2n ∈ A (via 1/2 + Σ 1/(2mᵢ) = 1). Not formalized. + +The core density-1 result is the main conjecture and is correctly captured. The quantitative bound from Martin is the most mathematically significant omission, as it is the actual theorem that was proved (density 1 is a corollary). The other properties (closure, prime power exclusion, doubling) are elegant structural results that could be formalized as separate lemmas but are not part of the original problem statement. + +## 4. Readability + +The code is clear and well-structured. Specific observations: + +- **Good:** The `IsEgyptianRepresentable` definition has a clear docstring that explains the mathematical content. The use of `Finset` naturally encodes distinctness. +- **Good:** The namespace `Erdos292` keeps definitions scoped. +- **Minor:** The `egyptianCount` helper is only used once and exists solely to bridge to the ε-δ statement. If the formalization were refactored to use `HasDensity`, this definition would become unnecessary, simplifying the file. +- **Minor:** The docstring for `erdos_292` could mention that Martin's result is actually stronger (quantitative decay of the complement), since the formalization only captures the corollary. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem asks whether a specific set of natural numbers (those appearing as the largest denominator in an Egyptian fraction representation of 1) has natural density 1. Both "Egyptian fraction representation of 1 with largest denominator n" and "natural density 1" are precise, well-defined mathematical concepts with no ambiguity. + +The only potential source of confusion is whether "Egyptian fraction representation" requires denominators to be distinct — the standard convention (and the one used here via `Finset`) is yes. The formalization correctly enforces this. + +## 6. Correctness + +**Overall assessment: Correct, with one structural recommendation.** + +**Definition `IsEgyptianRepresentable`:** Mathematically correct. The conditions `n ∈ S ∧ (∀ m ∈ S, 1 ≤ m) ∧ (∀ m ∈ S, m ≤ n)` correctly encode that S is a finite set of distinct positive integers with maximum element n. The sum condition `(S.sum fun m => (1 : ℚ) / m) = 1` uses exact rational arithmetic, avoiding floating-point or real-number issues — this is a good choice since the condition is an exact equality. + +**Definition `egyptianCount`:** Correctly counts elements of {1, ..., N} that are Egyptian representable. + +**Theorem `erdos_292`:** +- `answer(True)` is correct: Martin proved the affirmative answer. +- The ε-δ formulation correctly captures "density 1." Since `egyptianCount N ≤ N` always holds (the count cannot exceed the range), the one-sided bound `≥ 1 - ε` suffices to establish convergence to 1. No upper bound is needed. +- Division by zero when N = 0: not an issue because the existential over N₀ allows choosing N₀ ≥ 1. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the problem as stated on the website. The only structural improvement would be adopting the `HasDensity` API for consistency with the rest of the codebase. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `HasDensity 1` from `Density.lean` instead of manual ε-δ | +| Citations | Complete and accurate; matches website | +| Variants | Core result captured; Martin's quantitative bound and structural properties (closure, prime power exclusion, doubling) not formalized | +| Readability | Clear and well-documented | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/293.md b/ai-review/293.md new file mode 100644 index 0000000000..f48346e623 --- /dev/null +++ b/ai-review/293.md @@ -0,0 +1,114 @@ +# AI Review: Erdős Problem 293 + +**File:** `FormalConjectures/ErdosProblems/293.lean` + +--- + +## 1. Code Reuse + +There is significant overlap with other Egyptian fraction formalizations in the codebase. Several related problems define nearly identical predicates: + +- **Problem 148** (`egyptianFractionCount`): Uses the same predicate shape — `S.card = k ∧ (∀ n ∈ S, 0 < n) ∧ ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = 1`. The only difference is that 293 additionally requires `n ∈ S` (since it asks which integers *appear*). A shared base predicate like `IsKTermEgyptianFraction (k : ℕ) (S : Finset ℕ) : Prop` could serve both problems. + +- **Problem 292** (`IsEgyptianRepresentable`): Similar structure but without a fixed `k` and with a maximum-element constraint. + +- **Problem 296** defines `reciprocalSum (A : Finset ℕ) : ℚ := ∑ n ∈ A, (1 : ℚ) / (n : ℚ)`, which could be reused in 293's definitions to improve readability. + +- **Problem 304** (`unitFractionExpressible`): Closely related — it counts terms needed to represent `a/b`; problem 293 concerns the special case `a/b = 1` from the perspective of which denominators appear. + +**Recommendation:** Consider extracting a shared `IsEgyptianFractionOf1 (S : Finset ℕ) (k : ℕ)` predicate (or similar) into a common utility, since problems 148, 284, 286, 287, 293, 297, and others all use the same core condition. + +## 2. Citations + +Comparing against [erdosproblems.com/293](https://www.erdosproblems.com/293): + +| Citation | Website | Formalization | Status | +|----------|---------|---------------|--------| +| Bleicher–Erdős (1975) | ✓ "v(k) ≫ k!" | ✓ `[BlEr75]` | **OK** | +| van Doorn–Tang (2025) | ✓ "v(k) ≥ e^(ck²)" | ✓ `[vDTa25b]` | **OK** | +| Upper bound (Vardi constant) | ✓ Elementary inductive argument | ✓ Described in docstring | **OK** | +| Erdős–Graham (1980) | ✓ Source `[ErGr80, p.35]` | ✓ `[ErGr80]` | **OK** | + +**Minor issues:** +- The upper bound (Vardi constant) is not attributed to a specific paper on the website — it is described as "an elementary inductive argument." The formalization's docstring correctly does not attribute it to a named paper, which is consistent. +- The website cites the connection to Problem 304 and a conditional result by van Doorn–Tang: "if Problem [304] has N(b) ≪ log log b, then likely v(k) ≥ e^(e^(ck))." This conditional implication is not captured in the formalization (see §3). + +## 3. Variants + +**Captured:** +- ✓ Bleicher–Erdős lower bound (`v(k) ≥ c · k!`) +- ✓ van Doorn–Tang lower bound (`v(k) ≥ e^(ck²)`) +- ✓ Upper bound (`v(k) ≤ k · c₀^(2^k)`) +- ✓ Main conjecture: doubly exponential growth in `k` + +**Not captured:** + +1. **Weaker conjecture (doubly exponential in √k).** The docstring mentions "A weaker form conjectures doubly exponential growth in √k" but this is not formalized as a separate theorem. This could be: + ``` + theorem erdos_293.variants.weak_conjecture : + ∃ c : ℝ, 0 < c ∧ ∀ᶠ k : ℕ in atTop, + exp (exp (c * Real.sqrt k)) ≤ (v k : ℝ) := by sorry + ``` + +2. **Conditional result connecting to Problem 304.** The website states that van Doorn–Tang noted: if Problem 304 has `N(b) ≪ log log b`, then `v(k) ≥ e^(e^(ck))`. This conditional implication linking the two open problems is mathematically interesting and not formalized. + +## 4. Readability + +The formalization is generally clean and readable. Minor observations: + +- **Positivity convention inconsistency:** Problem 293 uses `∀ m ∈ S, 0 < m` while the closely related Problem 292 uses `∀ m ∈ S, 1 ≤ m`. These are equivalent for `ℕ` but standardizing across the Egyptian fraction problems would improve consistency. + +- **Sum notation:** Problem 293 uses `∑ m ∈ S, (1 : ℚ) / (m : ℚ)`, which is consistent with Problem 148 but differs from Problem 292's `S.sum fun m => (1 : ℚ) / m` and Problem 304's `(n : ℚ)⁻¹` notation. Within the file, notation is self-consistent. + +- **Namespace:** `Erdos293` is used, consistent with other problems. + +- **Docstrings:** Well-written. The module docstring gives good mathematical context and documents all known bounds before the theorems. + +## 5. Formalizability + +**Assessment: Highly formalizable (low ambiguity).** + +The problem statement is precise: +- "v(k)" has a clear combinatorial definition: the smallest positive integer not appearing as a denominator in any k-term Egyptian fraction representation of 1. +- The Finset-based formalization naturally captures distinctness (Finset elements are unique). +- The sum `∑ 1/m = 1` over rationals is exact arithmetic, avoiding any real-number approximation issues. +- The growth-rate conjectures involve standard asymptotic notions (∃ c > 0, eventually). + +The only mild ambiguity in the original problem is "estimate the growth of v(k)" — this is open-ended. The formalization resolves this by formalizing specific known bounds and the main conjecture, which is the standard mathematical interpretation. + +## 6. Correctness + +**Overall assessment: Correct, with one subtlety to note.** + +### Definitions + +- `AppearsInKTermEgyptian`: Correctly captures "n appears as a denominator in some k-term Egyptian fraction representation of 1." The use of `Finset ℕ` ensures distinctness of denominators (matching the strict inequality `n₁ < ··· < nₖ` in the problem statement). ✓ + +- `v(k)`: Defined as `sInf {n : ℕ | 0 < n ∧ ¬AppearsInKTermEgyptian k n}`. Mathematically, for any fixed `k`, only finitely many integers can appear in k-term representations (since the smallest element is at most `k` and each subsequent element is bounded), so this set is nonempty and the infimum is well-defined. In Lean, `sInf ∅ = 0` for `ℕ`, but the positivity constraint `0 < n` means `v(k) = 0` would be vacuously correct (0 does not appear since the definition requires positive elements). This is a harmless edge case; the interesting behavior is for `k ≥ 1`. ✓ + +### Theorems + +- **Bleicher–Erdős** (`erdos_293.variants.bleicher_erdos_lower`): States `∃ c > 0, ∀ k ≥ 1, c * k! ≤ v(k)`. This is a universal (non-asymptotic) bound, matching the standard `v(k) ≫ k!` notation. ✓ + +- **van Doorn–Tang** (`erdos_293.variants.van_doorn_tang_lower`): States `∃ c > 0, ∀ᶠ k, exp(c·k²) ≤ v(k)`. Uses the filter `atTop` for "sufficiently large k," which is appropriate since the result is asymptotic. ✓ + +- **Upper bound** (`erdos_293.variants.upper_bound`): States `∃ c₀ > 1, ∀ k ≥ 1, v(k) ≤ k · c₀^(2^k)`. The existential quantification over `c₀` (rather than pinning it to the Vardi constant ≈ 1.26408) is appropriate since the Vardi constant is not in Mathlib. The exponent `(2 : ℝ) ^ (k : ℕ)` correctly represents `2^k`. ✓ + +- **Main conjecture** (`erdos_293`): States `∃ c > 0, ∀ᶠ k, exp(exp(c·k)) ≤ v(k)`. This correctly formalizes "doubly exponential growth in k." ✓ + +- **Category tags**: The known bounds are tagged `research solved` and the main conjecture is tagged `research open`, matching the website's status. ✓ + +### No issues found with mathematical correctness. + +--- + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Could benefit from shared Egyptian fraction predicates across ~7 related problems | +| Citations | Complete and accurate | +| Variants | Missing weaker √k conjecture (formalized statement) and conditional link to Problem 304 | +| Readability | Good; minor cross-problem style inconsistencies | +| Formalizability | Excellent — low ambiguity | +| Correctness | Correct and complete for the variants included | diff --git a/ai-review/294.md b/ai-review/294.md new file mode 100644 index 0000000000..f912c79feb --- /dev/null +++ b/ai-review/294.md @@ -0,0 +1,119 @@ +# AI Review: Erdős Problem 294 + +## 1. Code Reuse + +Several nearby Erdős problems (292, 293, 296, 297, 300, 301, 302) deal with unit fraction sums over finite sets of natural numbers. Each defines its own bespoke predicate — e.g., `IsEgyptianRepresentable` (292), `AppearsInKTermEgyptian` (293), `reciprocalSum` (296), `unitFractionSubsetCount` (297), `Egyptian1Free` (300). No shared unit fraction utility module exists in `FormalConjecturesForMathlib/`. + +Problem 294's `HasUnitFractionRepFrom` is sufficiently specialized (requires `t ∈ S`, bounds `t ≤ m ≤ N`, and sums to 1 over `ℚ`) that it cannot be trivially replaced by any existing definition. However, the recurring pattern `(S.sum fun m => (1 : ℚ) / m) = 1` across multiple files (292, 293, 294, 296, 297) suggests a `reciprocalSum` helper in a shared utility would reduce duplication. This is a codebase-wide concern, not specific to 294. + +**Verdict:** No immediate reuse opportunity for this file alone. Longer-term, a shared `Finset.reciprocalSum` definition could serve problems 292–302. + +## 2. Citations + +The website (https://www.erdosproblems.com/294, last edited 18 November 2025) lists: + +- **[ErGr80]**: Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). — specifically p. 35. +- **[LiSa24]**: Liu, J. and Sawhney, M., *Unit fractions* (2024). + +The formalization's docstring cites both references with consistent shorthand keys `[ErGr80]` and `[LiSa24]`, and includes full author names, titles, and years matching the website. The page reference "p. 35" from the website is not included in the docstring but this is a minor omission. + +**Verdict:** Citations are accurate and complete. + +## 3. Variants + +The website states one main problem: estimate `t(N)`. The known results are: + +- **Upper bound** `t(N) ≪ N / log N` (Erdős–Graham). +- **Lower bound** `t(N) ≫ N / ((log N)(log log N)³(log log log N)^{O(1)})` (Liu–Sawhney). + +The formalization captures both: +- `erdos_294` — the upper bound. +- `erdos_294.variants.lower` — the lower bound. + +No other variants are mentioned on the website. The formalization covers all stated aspects. + +**Verdict:** All variants are captured. + +## 4. Readability + +The code is clean and well-structured: +- `HasUnitFractionRepFrom` has a clear docstring explaining the mathematical meaning. +- `leastNoRep` is defined with a sensible default (`N + 1`) when no such `t` exists. +- The theorem statements are annotated with `@[category research solved, AMS 11]`. +- The namespace `Erdos294` keeps definitions local. + +Minor suggestions: +- The condition `∀ m ∈ S, 1 ≤ m` in `HasUnitFractionRepFrom` guards against division by zero, which is good, but could benefit from a brief inline comment explaining why it's needed (since `ℚ`-division by zero yields 0 in Lean, which wouldn't cause a type error but would give a mathematically wrong sum). +- The default value `N + 1` in `leastNoRep` is reasonable but the docstring could note that this default is never expected to be reached for large `N` (since `t = N` always fails to have a representation when `1/N < 1`). + +**Verdict:** Good readability. Minor documentation improvements possible. + +## 5. Formalizability + +The problem as stated on the website is: + +> Let `N ≥ 1` and let `t(N)` be the least integer `t` such that there is no solution to `1 = 1/n₁ + ⋯ + 1/nₖ` with `t = n₁ < ⋯ < nₖ ≤ N`. Estimate `t(N)`. + +This is precise and unambiguous: +- "Distinct" is implied by `n₁ < ⋯ < nₖ` (strict ordering). +- The range `{t, …, N}` is clear. +- The sum equals exactly 1. +- "Least integer `t`" is well-defined since the set of such `t` is non-empty (for `t > N`, there are no denominators available, and for sufficiently large `t < N`, `∑ 1/m` for `m ∈ {t,…,N}` will be less than 1). + +The only minor ambiguity: does `t` need to be positive? The formalization requires `1 ≤ t` (line 55), which is mathematically correct since unit fractions `1/n` require `n ≥ 1`, and the problem statement says `N ≥ 1`. + +**Verdict:** The problem is unambiguously formalizable. No meaningful ambiguity exists. + +## 6. Correctness + +### Definition `HasUnitFractionRepFrom` + +The definition requires: +1. `t ∈ S` — `t` is one of the denominators. ✓ +2. `∀ m ∈ S, t ≤ m` — all denominators are at least `t`. ✓ +3. `∀ m ∈ S, m ≤ N` — all denominators are at most `N`. ✓ +4. `∀ m ∈ S, 1 ≤ m` — all denominators are positive (prevents division by zero). ✓ +5. `(S.sum fun m => (1 : ℚ) / m) = 1` — reciprocals sum to 1 over `ℚ`. ✓ + +Note that condition (4) is implied by conditions (1) and (2) together with the implicit requirement that `t ≥ 1` (enforced in `leastNoRep`), so it is technically redundant within the context of the full problem but harmless and defensive. + +The use of `Finset ℕ` automatically enforces distinctness of elements, correctly capturing the `n₁ < ⋯ < nₖ` constraint. + +The use of `ℚ` rather than `ℝ` for the sum is a good choice — it avoids real-number subtleties and is exact for rational arithmetic. + +### Definition `leastNoRep` + +Finds the least `t ≥ 1` such that `¬HasUnitFractionRepFrom t N` using `Nat.find`. The fallback `N + 1` handles the (likely impossible for `N ≥ 1`) case where every `t ≥ 1` admits a representation. This is mathematically sound. + +**Subtle point:** `Nat.find h` finds the least `t` satisfying `1 ≤ t ∧ ¬HasUnitFractionRepFrom t N`. This means it searches over all natural numbers (including 0), and the `1 ≤ t` condition ensures `t = 0` is excluded. This is correct — but note that `Nat.find` returns the smallest `t : ℕ` satisfying the predicate, not the smallest `t ≥ 1`. Since the predicate includes `1 ≤ t`, the result is correct: if `t = 0` trivially satisfies `¬HasUnitFractionRepFrom 0 N` (since no `S` with `0 ∈ S` can have `1 ≤ m` for all `m ∈ S`), then `Nat.find` would return 0, which violates the mathematical intent. **This is a potential bug**: `Nat.find` would find `t = 0` first since `1 ≤ 0` is false, so the conjunction `1 ≤ t ∧ ¬HasUnitFractionRepFrom t N` is false at `t = 0`. Wait — actually `1 ≤ 0` is false, so the predicate `1 ≤ t ∧ ...` is false at `t = 0`, meaning `Nat.find` correctly skips 0. The first candidate is `t = 1`, and the search proceeds correctly from there. + +Actually, let me re-examine: `Nat.find h` where `h : ∃ t, 1 ≤ t ∧ ¬HasUnitFractionRepFrom t N` finds the least `t` such that `1 ≤ t ∧ ¬HasUnitFractionRepFrom t N`. At `t = 0`, the predicate is `False ∧ ...` = `False`, so 0 is skipped. This is correct. + +**However**, there's a subtle issue: the definition finds the least `t` where both `1 ≤ t` AND `¬HasUnitFractionRepFrom t N` hold. But the mathematical `t(N)` should be the least `t ≥ 1` where `¬HasUnitFractionRepFrom t N`. These are the same thing, since for all `t ≥ 1`, the compound predicate reduces to just `¬HasUnitFractionRepFrom t N`, and `t = 0` is excluded by `1 ≤ t`. ✓ + +### Theorem `erdos_294` (Upper bound) + +States: `∃ C > 0, ∃ N₀, ∀ N ≥ N₀, leastNoRep N ≤ C * N / log N`. + +This correctly captures `t(N) ≪ N / log N` (the Erdős–Graham bound). The asymptotic notation `≪` is properly rendered as an existential constant with a "for sufficiently large N" quantifier. ✓ + +### Theorem `erdos_294.variants.lower` (Lower bound) + +States: `∃ c > 0, ∃ K : ℕ, ∃ N₀, ∀ N ≥ N₀, c * N / (log N * (log log N)³ * (log log log N)^K) ≤ leastNoRep N`. + +The use of `K : ℕ` to handle the `O(1)` exponent in `(log log log N)^{O(1)}` is a reasonable formalization choice — it existentially quantifies over the constant exponent. This correctly captures the Liu–Sawhney result. ✓ + +**One concern with the lower bound:** For small `N`, `log N`, `log log N`, or `log log log N` could be zero or negative (in `Real.log`), which would make the left-hand side potentially negative or zero, making the inequality vacuously true. The `∃ N₀` quantifier handles this by restricting to sufficiently large `N`, which is correct. ✓ + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No immediate opportunities; long-term shared `reciprocalSum` could help | +| Citations | Accurate and complete | +| Variants | All captured | +| Readability | Good; minor documentation improvements possible | +| Formalizability | Unambiguous; straightforward to formalize | +| Correctness | Correct and complete | diff --git a/ai-review/296.md b/ai-review/296.md new file mode 100644 index 0000000000..27ee505ac8 --- /dev/null +++ b/ai-review/296.md @@ -0,0 +1,102 @@ +# Review: Erdős Problem 296 + +## 1. Code Reuse + +The file defines a local `reciprocalSum` in namespace `Erdos296`: + +```lean +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) +``` + +Several other Erdős problems define similar constructs: + +- **Problem 444** defines `reciprocalSum` over `Set ℕ` with a bound parameter (different signature, not directly reusable). +- **Problems 45, 47** use inline `∑ d ∈ S, (1 : ℚ) / (d : ℚ)` or `∑ a ∈ A, (1 : ℝ) / a` directly in theorem statements without a named definition. + +There is no shared `reciprocalSum` utility in `FormalConjecturesForMathlib/` or `Util/`. Each problem defines its own variant locally. The local definition here is appropriate given the differing type signatures (this one returns `ℚ`, Problem 444's returns `ℝ`, Problem 47 uses an inline `ℝ`-valued sum). + +**Recommendation:** The current approach is consistent with codebase conventions. No change needed, though a shared utility could eventually reduce duplication across Problems 45, 47, 286, 287, 296, etc. + +The pairwise disjoint pattern (`∀ i j, i ≠ j → Disjoint (family i) (family j)`) and `Finset.Icc 1 N` usage are standard and consistent with Problems 301, 641, 747, etc. + +## 2. Citations + +The website (erdosproblems.com/296) lists: + +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- **[Bl21]** — Bloom, T. (referenced for Theorem 3 used by Hunter–Sawhney). +- Additional thanks to Zachary Hunter and Mehtaab Sawhney. + +The formalization cites: + +- **[ErGr80]** — Matches the website. ✅ +- **[Bl21]** — The formalization gives the title as *On a density conjecture about unit fractions* (2021). The website does not provide a full title for this reference. Note: Problem 47 cites a *different* Bloom 2021 paper (*On a result of Schur and Sidon*) also as [Bl21]. The paper cited here for Problem 296 appears to be Thomas Bloom's "On a density conjecture about unit fractions" (arXiv:2112.03726), which contains the Theorem 3 referenced by Hunter–Sawhney. This attribution appears correct but could not be fully verified against the website since the website omits the title. + +**Recommendation:** No changes needed. Citations are accurate and well-formatted. + +## 3. Variants + +The website describes an **extended question** not captured in the formalization: + +> More generally, how many disjoint $A_i$ can be found in $\{1,\ldots,N\}$ such that the sums $\sum_{n\in A_i}\frac{1}{n}$ are all equal? Using sunflowers, it can be shown that there are at least $N\exp(-O(\sqrt{\log N}))$ such sets. + +This generalization (equal reciprocal sums, not necessarily equal to 1) is **not formalized**. Additionally, the original question as posed by Erdős–Graham ("Is it true that $k(N) = o(\log N)$?") is not stated separately — only the resolved asymptotic form is given. + +**Recommendation:** Consider adding a comment acknowledging the extended variant, or adding a separate conjecture/theorem for the generalized equal-sum version. The sunflower-based lower bound ($N \exp(-O(\sqrt{\log N}))$) for the generalized version is a distinct and interesting result. + +## 4. Readability + +The code is clean and well-structured: + +- The `reciprocalSum` helper with its docstring is clear. +- The theorem statement is readable, with each conjunct on a natural boundary (range, disjointness, sum condition). +- The module docstring provides good mathematical context, including the resolution history. + +**Minor note:** The docstring says "at least $\lfloor (1 - \varepsilon) \ln N \rfloor$" but the formal statement requires `(k : ℝ) ≥ (1 - ε) * Real.log (N : ℝ)` (no floor). The formal statement is slightly stronger (it implies $k \geq \lceil (1-\varepsilon) \ln N \rceil$ since $k$ is a natural number). Both are mathematically correct given the underlying theorem, but the docstring could be updated to match the formal statement exactly. + +**Recommendation:** Minor — consider changing the docstring from "at least $\lfloor (1 - \varepsilon) \ln N \rfloor$" to "at least $(1 - \varepsilon) \ln N$" to precisely match the formal statement. + +## 5. Formalizability + +The problem as resolved is **fully formalizable** with no ambiguity. The key concepts — pairwise disjoint finite subsets of a bounded integer range, rational reciprocal sums equaling 1, and asymptotic lower bounds — all have direct Lean/Mathlib counterparts. + +The original question ("Is $k(N) = o(\log N)$?") is also formalizable but would require a different statement shape (negation of a little-o condition). The formalization wisely captures the positive resolved form instead. + +**Ambiguity assessment: None.** The statement is precise. + +## 6. Correctness + +### What is formalized +The theorem states the **lower bound** of the resolved result: for every $\varepsilon > 0$, for sufficiently large $N$, there exist at least $(1-\varepsilon) \ln N$ pairwise disjoint subsets of $\{1, \ldots, N\}$ each with reciprocal sum exactly 1. + +### Mathematical correctness: ✅ Correct + +The formalization is mathematically sound: + +- The existential quantification over `k` and `family : Fin k → Finset ℕ` correctly models "at least $k$ pairwise disjoint subsets." +- `family i ⊆ Finset.Icc 1 N` correctly constrains subsets to $\{1, \ldots, N\}$ (excluding 0, as intended). +- The pairwise disjointness condition is standard. +- `reciprocalSum (family i) = 1` correctly requires each subset's reciprocal sum (over ℚ) to be exactly 1. Using ℚ rather than ℝ is arguably better here since the sums are rational and exact equality in ℚ avoids real-number subtleties. +- `Real.log` is the natural logarithm, which matches the number-theoretic convention for $\log$ in this context. + +### Completeness + +The formalization captures only the **lower bound** half of $k(N) = (1-o(1)) \log N$. The matching upper bound ($k(N) \leq (1+o(1)) \log N$, or more precisely $k(N) \leq H_N$ where $H_N = \sum_{n=1}^{N} 1/n \sim \ln N + \gamma$) is **not formalized**. This upper bound is trivial (the total reciprocal sum of $\{1, \ldots, N\}$ is $H_N$, so at most $\lfloor H_N \rfloor$ disjoint subsets can each have reciprocal sum 1), but including it would make the formalization fully capture the resolved result. + +The docstring transparently states "We formalize the non-trivial lower bound," which is honest and appropriate. An experienced mathematician would note the missing upper bound but would agree the lower bound is the substantive content. + +**Recommendation:** Consider adding the (easy) upper bound as a separate theorem for completeness, or at minimum note in the docstring that the trivial upper bound $k(N) \leq H_N \sim \ln N$ completes the asymptotic. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | ✅ Consistent with codebase patterns; no shared utility exists | +| Citations | ✅ Accurate; matches website | +| Variants | ⚠️ Extended "equal sums" variant from website not captured | +| Readability | ✅ Clean; minor docstring/formal statement mismatch on floor | +| Formalizability | ✅ Fully formalizable, no ambiguity | +| Correctness | ✅ Mathematically correct; only lower bound formalized (upper bound is trivial but omitted) | + +**Overall:** High-quality formalization of the substantive part of the result. The main gap is the unformalized extended variant from the website. diff --git a/ai-review/297.md b/ai-review/297.md new file mode 100644 index 0000000000..28565c90d4 --- /dev/null +++ b/ai-review/297.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 297 + +## 1. Code Reuse + +**Opportunity identified.** Problem 296 (`FormalConjectures/ErdosProblems/296.lean:44`) defines: + +```lean +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) +``` + +Problem 297's `unitFractionSubsetCount` inlines an equivalent expression: + +```lean +(A.sum fun n => (1 : ℚ) / (n : ℚ)) = 1 +``` + +These are semantically identical (`Finset.sum` vs `∑ n ∈ A`). The `reciprocalSum` helper from 296 could be reused here, but it lives in the `Erdos296` namespace. A shared definition (e.g., in a utility file) would benefit Problems 296, 297, 300, and 301, all of which define or inline reciprocal sum computations. Note that Problem 300 uses `ℝ` instead of `ℚ` for its version, so a polymorphic or type-class-based shared definition would be needed for full unification. + +Problem 362 (`FormalConjectures/ErdosProblems/362.lean`) uses the same `powerset.filter ... .card` counting pattern and is listed as a related problem on the website. + +## 2. Citations + +**Partially incomplete.** Comparing the file's docstring against [erdosproblems.com/297](https://www.erdosproblems.com/297): + +| Citation | In file? | Notes | +|----------|----------|-------| +| [ErGr80] Erdős & Graham, *Old and new problems...* (1980) | ✅ | Present with title | +| [St24] Steinerberger (2024) | ⚠️ | Present but **missing full title**. The paper is: *On unit fractions whose sum equals 1*. | +| [LiSa24] Liu & Sawhney (2024) | ⚠️ | Present but **missing full title**. The paper is likely the same as cited in Problem 300: *On a conjecture of Erdős and Graham about Egyptian fractions*. | +| [CFHMPSV24] Conlon, Fox, He, Mubayi, Pham, Suk, Verstraëte (2024) | ⚠️ | Listed with authors only — **missing title entirely**. The citation line in the docstring is truncated (ends abruptly after the author list). | +| Related Problem #362 | ❌ | Not mentioned. The website lists Problem 362 as related. | +| OEIS A092670 | ❌ | Not mentioned. The website references this sequence. | + +The `[CFHMPSV24]` citation on line 38 is visibly incomplete — it lists the authors but has no title, journal, or description of their contribution. + +## 3. Variants + +**Missing variant.** The website notes that Conlon–Fox–He–Mubayi–Pham–Suk–Verstraëte [CFHMPSV24] extended the result to **arbitrary positive rational target values** (not just sum = 1). That is, they proved analogous asymptotics for the count of subsets $A \subseteq \{1, \ldots, N\}$ with $\sum_{n \in A} 1/n = q$ for any fixed $q \in \mathbb{Q}_{>0}$. This generalization is not captured in the formalization. + +A natural variant theorem could parameterize the target value: + +```lean +theorem erdos_297_variant (q : ℚ) (hq : 0 < q) : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ + Tendsto (fun N : ℕ => + Real.log (unitFractionSubsetCount_q q N : ℝ) / (Real.log 2 * (N : ℝ))) + atTop (nhds c) := by sorry +``` + +Additionally, a MathOverflow question (Tikhomirov, 2017) explored the inequality variant ($\leq 1$ instead of $= 1$), though this is less directly attributable to Erdős. + +## 4. Readability + +**Good overall.** The code is clean and well-structured: + +- `unitFractionSubsetCount` has a clear docstring and its definition is self-explanatory. +- The module docstring gives good mathematical context. +- The `Tendsto` formulation with the logarithmic ratio is the standard way to express $2^{(c+o(1))N}$ asymptotics. + +Minor suggestions: +- The `open Filter` and `open scoped Topology` are standard boilerplate for `Tendsto`/`nhds`; no issues there. +- The inline `(1 : ℚ) / (n : ℚ)` could be slightly more readable as `(1 / n : ℚ)` or `(n : ℚ)⁻¹`, but the current form is perfectly clear and avoids any coercion ambiguity. + +## 5. Formalizability + +**High — the problem is precisely formalizable.** The counting function $|\{A \subseteq \{1, \ldots, N\} : \sum_{n \in A} 1/n = 1\}|$ is completely well-defined and computable. The asymptotic statement "the count is $2^{(c+o(1))N}$" translates cleanly to the $\log_2(\text{count}(N))/N \to c$ formulation used in the code. + +**No ambiguity** exists in the problem statement itself. The only subtlety is that for $N = 0$, the count is 0 (empty powerset has no subset summing to 1 since the empty sum is 0), so $\log(0)$ arises. In Lean4/Mathlib, `Real.log 0 = 0`, so the ratio is $0 / 0 = 0$ for $N = 0$, which is harmless for an `atTop` limit. For $N \geq 1$, the subset $\{1\}$ always satisfies $1/1 = 1$, so the count is $\geq 1$ and the logarithm is well-defined and non-negative. + +## 6. Correctness + +**The formalization is mathematically correct but weaker than the known result.** + +### What the formalization states: +There exists $c \in (0, 1)$ such that $\log_2(\text{count}(N)) / N \to c$. + +### What is now known: +Liu–Sawhney and Conlon et al. independently proved that $c$ equals a specific explicit constant $\approx 0.91\ldots$, defined as the solution to a certain integral equation. The docstring describes this stronger result, but the formal statement only asserts the **existence** of some $c \in (0,1)$. + +### Analysis: +- The existential formulation is **correct** — it is a true consequence of the stronger results. As a formalization of the *original* Erdős–Graham question ("is the count $2^{cN}$ for some $c < 1$, or $2^{(1+o(1))N}$?"), it faithfully captures the resolution. +- However, given that the problem is marked as `solved` and the docstring describes the precise asymptotic, it would be more complete to also state the **quantitative** version pinning down the specific value of $c$. This would require formalizing the integral equation that defines $c \approx 0.91\ldots$, which is admittedly non-trivial. +- The bound $c > 0$ is trivially true (since $\{1\}$ is always a valid subset, the count is $\geq 1$). The bound $c < 1$ is the substantive content. +- The `Tendsto` expression `Real.log (unitFractionSubsetCount N : ℝ) / (Real.log 2 * (N : ℝ))` correctly computes $\log_2(\text{count}(N)) / N$ via the change-of-base formula. +- The cast `(unitFractionSubsetCount N : ℝ)` is safe; the count is a natural number and the coercion is injective and order-preserving. + +### Potential edge case: +When `unitFractionSubsetCount N = 0` (which happens only at $N = 0$), we get `Real.log 0 / (Real.log 2 * 0) = 0 / 0 = 0` in Lean. This is fine since `atTop` filters away all finite prefixes. + +**Verdict: Correct and complete as a formalization of the original question. Incomplete as a formalization of the full state of knowledge (the specific value of $c$).** diff --git a/ai-review/300.md b/ai-review/300.md new file mode 100644 index 0000000000..e9ba2ec99c --- /dev/null +++ b/ai-review/300.md @@ -0,0 +1,69 @@ +# Review: Erdős Problem 300 + +## 1. Code Reuse + +Several nearby Egyptian fraction problems define closely related predicates: + +- **Problem 296** (`296.lean:44`) defines `reciprocalSum (A : Finset ℕ) : ℚ` as `∑ n ∈ A, (1 : ℚ) / (n : ℚ)`. +- **Problem 292** (`292.lean:41–43`) defines `IsEgyptianRepresentable` using `(S.sum fun m => (1 : ℚ) / m) = 1`. +- **Problem 297** defines `unitFractionSubsetCount` counting subsets with reciprocal sum 1. +- **Problem 301** defines `UnitFractionSumFree`, and **Problem 302** defines `UnitFractionTripleFree`. + +Problem 300's `Egyptian1Free` inlines the reciprocal sum as `∑ n ∈ S, (1 : ℝ) / (n : ℝ)` over `ℝ`, whereas 296 defines `reciprocalSum` over `ℚ`. A shared utility (e.g., a `Finset.reciprocalSum` definition parameterized by the target field) could reduce duplication across problems 292, 296, 297, 300, 301, and 302. This is a longer-term refactoring concern rather than a blocking issue for this file. + +## 2. Citations + +The formalization includes: +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✓ Matches website. +- **[Cr03]** — Croot, E., *On a coloring conjecture about unit fractions*. Annals of Mathematics (2003). ✓ Matches website. +- **[LiSa24]** — Liu, J. and Sawhney, M., *On a conjecture of Erdős and Graham about Egyptian fractions* (2024). ✓ Matches website. + +**Missing citation:** The website also lists **[Va99, 1.14]** (Vardi, 1999) as a reference. This is absent from the formalization's docstring. It should be added for completeness. + +## 3. Variants + +The original problem asks: "Estimate $A(N)$." The formalization captures the resolved asymptotic: + +$$A(N) = (1 - 1/e + o(1))N$$ + +split into the standard upper and lower bound formulation via ε-quantification. This is the complete resolved form per Liu–Sawhney (2024). No additional variants appear on the website. The formalization is complete in this regard. + +## 4. Readability + +The code is clean and well-structured: +- The `Egyptian1Free` predicate is clearly named and has a helpful docstring. +- The theorem docstring provides good mathematical context including the history (Erdős–Graham conjecture, Croot's disproof, Liu–Sawhney resolution). +- The `open Finset BigOperators` is appropriate for the notation used. +- The namespace `Erdos300` keeps definitions scoped. + +**Minor suggestion:** The docstring mentions "It is trivial that $A(N) \geq (1 - 1/e + o(1))N$" — this is the lower bound direction. Consider clarifying that the "trivial" bound is the lower bound and the hard direction is the upper bound, to avoid ambiguity for readers unfamiliar with the problem. + +## 5. Formalizability + +**Assessment: Unambiguous and precisely formalizable.** + +The problem as stated on the website ("Estimate $A(N)$") is inherently imprecise — "estimate" leaves open what form the answer should take. However, the resolved form $A(N) = (1 - 1/e + o(1))N$ is completely precise, and the formalization correctly renders the asymptotic via the standard ε/N₀ quantification: + +> ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀: [upper bound] ∧ [lower bound] + +This is the canonical way to formalize "$f(N) = (c + o(1))N$" in Lean, and it leaves no ambiguity. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed analysis: + +1. **The constant `1 - Real.exp (-1)`:** Since `Real.exp (-1) = e⁻¹ = 1/e`, we have `1 - Real.exp (-1) = 1 - 1/e ≈ 0.6321`. This correctly matches the mathematical result. ✓ + +2. **The `Egyptian1Free` definition:** The predicate `∀ S ⊆ A, S.Nonempty → ∑ n ∈ S, 1/n ≠ 1` correctly captures "no nonempty subset of A has reciprocal sum equal to 1." The `Nonempty` guard is technically redundant (the empty sum is 0 ≠ 1) but is good practice for clarity. ✓ + +3. **Division by zero consideration:** The definition `Egyptian1Free` is stated for arbitrary `Finset ℕ`, which could in principle contain 0. In Lean, `(1 : ℝ) / (0 : ℝ) = 0`, so a zero element would contribute nothing to the sum — it would not cause unsoundness but would be mathematically meaningless. This is a non-issue because the theorem constrains `A ⊆ Finset.Icc 1 N`, ensuring all elements are positive. ✓ + +4. **Asymptotic encoding:** The two-part quantification (upper bound: every Egyptian-1-free set has `|A| ≤ (1 - 1/e + ε)N`; lower bound: some Egyptian-1-free set has `|A| ≥ (1 - 1/e - ε)N`) correctly captures $A(N) = (1 - 1/e + o(1))N$. ✓ + +5. **Range `Finset.Icc 1 N`:** This correctly represents $\{1, \ldots, N\}$. ✓ + +6. **Cast consistency:** `(A.card : ℝ)` and `(N : ℝ)` are cast to reals for comparison with the real-valued bound. This is standard and correct. ✓ + +**No mathematical flaws identified.** The formalization faithfully and completely captures the resolved form of Erdős Problem 300. diff --git a/ai-review/301.md b/ai-review/301.md new file mode 100644 index 0000000000..c7390b2564 --- /dev/null +++ b/ai-review/301.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 301 + +## 1. Code Reuse + +Several related definitions exist in the codebase but none are directly reusable: + +- **Problem 300** (`Egyptian1Free` in `ErdosProblems/300.lean`): Defines sets where no nonempty subset has reciprocal sum equal to 1. Structurally related but semantically different — Problem 301's `UnitFractionSumFree` forbids any element's reciprocal from equaling a sum of reciprocals of *other* elements, which is a distinct property. +- **Problem 296** (`reciprocalSum` in `ErdosProblems/296.lean`): A helper `reciprocalSum (A : Finset ℕ) : ℚ := ∑ n ∈ A, (1 : ℚ) / (n : ℚ)`. This computes over `ℚ` rather than `ℝ`, but could in principle be adapted. However, since Problem 301 only uses the sum inline in a single predicate, introducing a separate helper would add complexity without clear benefit. +- **Problem 876** (`IsSumFreeErdos` in `ErdosProblems/876.lean`): Structurally very similar — "no element is the sum of finitely many distinct smaller elements" — but operates on additive sums rather than reciprocal sums. The parallel is worth noting but doesn't enable code sharing. + +No centralized reciprocal-sum utility exists in `Util/` or `ForMathlib/`. The current self-contained definition is appropriate. + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +This matches the website's reference. The following additional information from [erdosproblems.com/301](https://www.erdosproblems.com/301) is not reflected in the formalization: + +- **OEIS sequence A390394** — could be mentioned for reference. +- **Related problems #302 and #327** — could be cross-referenced. +- **Wouter van Doorn's upper bound** f(N) ≤ (25/28 + o(1))N is mentioned in the docstring, which is good. The website gives more detail on the method (elementary argument involving disjoint sets S_a = {2a, 3a, 4a, 6a, 12a}). +- **Stijn Cambie and Wouter van Doorn** showed that allowing non-distinct b_i reduces the maximal set size to at most N/2. + +No citation errors were found — all references present are accurate. + +## 3. Variants + +The formalization captures only the main conjecture f(N) = (1/2 + o(1))N. + +**Missing variant**: The website mentions a variant where the b_i are allowed to be non-distinct (i.e., multiset instead of set). Cambie and van Doorn showed this variant has a maximum of at most N/2. This is a natural companion result but is not formalized. Whether it warrants inclusion is a judgment call — it is a different (and resolved) question rather than a variant of the same conjecture. + +The formalization does not separately state the known bounds (f(N) ≥ N/2 from the interval (N/2, N], and f(N) ≤ (25/28 + o(1))N from van Doorn) as formal propositions, though they are documented in the docstring. Formalizing these partial results would be a reasonable enhancement. + +## 4. Readability + +The code is clean and well-structured: + +- The `UnitFractionSumFree` predicate is clearly named and has an informative docstring. +- The module docstring provides good mathematical context. +- The namespace `Erdos301` keeps definitions scoped. +- The theorem statement is well-decomposed into the upper and lower bound parts. + +**Minor suggestion**: The docstring for `UnitFractionSumFree` says "for no element a ∈ A can 1/a be expressed as a sum ∑_{b ∈ S} 1/b for some nonempty S ⊆ A with a ∉ S." This is clear and correct. + +No readability issues identified. + +## 5. Formalizability + +The original problem statement asks to "estimate f(N)" which is vague, but then poses the specific conjecture f(N) = (1/2 + o(1))N. The formalization correctly captures this specific conjecture as a precise mathematical statement: for every ε > 0, for sufficiently large N, both: +- f(N) ≤ (1/2 + ε)N (upper bound), and +- f(N) ≥ (1/2 - ε)N (lower bound). + +This is the standard ε-δ formalization of the little-o asymptotic and is unambiguous. + +The underlying predicate `UnitFractionSumFree` is also fully precise — the original problem says "distinct a, b₁, …, bₖ ∈ A" which is exactly captured by requiring S ⊆ A, a ∉ S, and S being a `Finset` (which enforces distinctness of the b_i automatically). + +**Ambiguity assessment**: Low. The conjecture as stated on the website is specific enough to formalize without interpretation choices. + +## 6. Correctness + +The formalization is **correct and complete** for the stated conjecture. + +Detailed verification: + +- **`UnitFractionSumFree` definition**: `∀ a ∈ A, ∀ S : Finset ℕ, S ⊆ A → a ∉ S → S.Nonempty → ∑ b ∈ S, (1 : ℝ) / (b : ℝ) ≠ (1 : ℝ) / (a : ℝ)`. This correctly states that no element's reciprocal can be decomposed as a sum of reciprocals of other distinct elements in A. The use of `Finset` ensures distinctness of the b_i. The condition `a ∉ S` ensures a is distinct from all summands. The condition `S.Nonempty` prevents the trivial case of an empty sum equaling 0. + +- **Domain**: Elements are in `Finset.Icc 1 N`, i.e., {1, …, N}, matching the problem. This excludes 0, which is important since 1/0 = 0 in Lean's real number division, and including 0 could create spurious (non-)solutions. + +- **Asymptotic formulation**: The conjunction of `|A| ≤ (1/2 + ε)N` and the existence of `A` with `|A| ≥ (1/2 - ε)N` correctly captures f(N)/N → 1/2 as N → ∞. Both directions are needed — the upper bound says f(N) ≤ (1/2 + o(1))N and the lower bound says f(N) ≥ (1/2 - o(1))N. + +- **Type handling**: The cast `(A.card : ℝ)` and `(N : ℝ)` correctly lifts the comparison to the reals for the asymptotic inequality. + +No mathematical flaws identified. An experienced mathematician would find this formalization faithful to the original conjecture. diff --git a/ai-review/302.md b/ai-review/302.md new file mode 100644 index 0000000000..670cef590a --- /dev/null +++ b/ai-review/302.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 302 + +## 1. Code Reuse + +Several closely related definitions exist in the codebase: + +- **Problem 301** (`UnitFractionSumFree` in `ErdosProblems/301.lean`): Forbids any element's reciprocal from equaling a sum of reciprocals of *any number* of other distinct elements. Problem 302's `UnitFractionTripleFree` is the special case where the sum has exactly 2 terms. In principle, one could define `UnitFractionTripleFree A` as `UnitFractionSumFree` restricted to 2-element subsets S, but this would complicate the statement for little gain — the self-contained 3-variable formulation is more readable and natural. +- **Problem 303** (`ErdosProblems/303.lean`): Uses the same equation 1/a = 1/b + 1/c but in a coloring/Ramsey context rather than a density context. No shared predicate is possible since 303 operates over `ℤ` (with a coloring function) rather than `Finset ℕ`. +- **Problem 327** (`UnitFractionPairFree` in `ErdosProblems/327.lean`): Involves the related condition (a+b) | ab, i.e., 1/a + 1/b is a unit fraction. This is a different equation and a different predicate. +- **No shared utilities** in `FormalConjecturesForMathlib/` are applicable. There is no centralized unit-fraction predicate, and the current self-contained definition is appropriate. + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +This matches the website's reference. The following additional information from [erdosproblems.com/302](https://www.erdosproblems.com/302) is not reflected: + +- **OEIS sequence A390395** — could be mentioned for reference. +- **Related problems #301, #303, and #327** — could be cross-referenced in the module docstring. +- **Contributors**: The website credits Stijn Cambie, Zachary Hunter, Mehtaab Sawhney, and Wouter van Doorn. The docstring mentions Cambie and van Doorn by name but omits Hunter and Sawhney. +- **Brown and Rödl [BrRo91]** are referenced on the website in connection with the coloring version (Problem 303) — this is appropriately left out of 302 since it concerns the separate coloring problem. + +The docstring mentions Cambie's 5/8 lower bound and van Doorn's 9/10 upper bound, both of which match the website. No citation errors found. + +## 3. Variants + +The formalization captures the original conjecture f(N) = (1/2 + o(1))N and correctly documents its disproof. + +**Missing variants**: + +- **Allowing b = c**: The website notes that when b = c is permitted (i.e., 1/a = 2/b), the maximum density drops to at most 2/3, since any set with |A| > (2/3 + o(1))N must contain some n and 2n. This is a natural companion variant that is not formalized. +- **Best known bounds as formal statements**: The docstring documents that 5/8 ≤ liminf f(N)/N ≤ limsup f(N)/N ≤ 9/10, but these are not stated as separate formal theorems (unlike Problem 327, which separates its lower bound into `erdos_327.variants.lower_bound`). Formalizing the 5/8 lower bound (Cambie) and 9/10 upper bound (van Doorn) as standalone propositions would be a natural enhancement, especially since the main conjecture is now known to be false. + +## 4. Readability + +The code is clean and well-structured: + +- The `UnitFractionTripleFree` predicate is clearly named with an informative docstring. +- The module docstring provides excellent mathematical context, including the known bounds and the disproof status. +- The namespace `Erdos302` keeps definitions scoped. +- The theorem statement is well-decomposed into upper and lower bound parts within the conjunction. + +**Minor suggestion**: The docstring uses both `$\frac{1}{a}$` notation (in the module docstring) and `(1 : ℝ) / (a : ℝ)` notation (in the code). This is standard and appropriate — no issues. + +No readability concerns identified. + +## 5. Formalizability + +The original problem asks whether f(N) = (1/2 + o(1))N, which is a precise asymptotic claim. The formalization correctly encodes this via the standard ε-δ characterization: for every ε > 0, for sufficiently large N, both f(N) ≤ (1/2 + ε)N and f(N) ≥ (1/2 - ε)N. + +The underlying predicate — "no distinct a, b, c ∈ A with 1/a = 1/b + 1/c" — is fully precise. + +**Ambiguity assessment**: Very low. The only potential ambiguity is whether "distinct" means pairwise distinct or merely not all equal. The formalization correctly uses pairwise distinctness (a ≠ b, a ≠ c, b ≠ c), which is the standard mathematical interpretation and matches the website's usage. The b = c variant is treated separately on the website, confirming this choice. + +## 6. Correctness + +The formalization is **mathematically correct**. + +Detailed verification: + +- **`UnitFractionTripleFree` definition**: `∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, a ≠ b → a ≠ c → b ≠ c → (1 : ℝ) / (a : ℝ) ≠ (1 : ℝ) / (b : ℝ) + (1 : ℝ) / (c : ℝ)`. This quantifies over all ordered triples with the equation 1/a = 1/b + 1/c. Since the equation distinguishes the roles of a (the "large" reciprocal) from b, c (the summands), and the quantification checks all role-assignments, this correctly captures "no distinct triple satisfying the equation." The symmetry between b and c (since addition is commutative) means some checks are redundant, but this does not affect correctness. + +- **Domain**: Elements are in `Finset.Icc 1 N`, i.e., {1, …, N}. This excludes 0, which is critical since `(1 : ℝ) / (0 : ℝ) = 0` in Lean, and including 0 could create spurious solutions. The definition of `UnitFractionTripleFree` itself does not require positivity, but this is fine since the theorem only applies it to subsets of {1, …, N}. + +- **`answer(False)`**: This is correct. Cambie's construction gives f(N) ≥ (5/8 + o(1))N, which for ε < 1/8 contradicts the upper bound f(N) ≤ (1/2 + ε)N. Thus the conjunction is false, and `answer(False)` correctly encodes the disproof. + +- **`category research solved`**: Appropriate. The original conjecture is resolved (disproved). The *problem* of determining the true asymptotics of f(N) remains open, but the specific conjecture formalized here has a definite answer. + +- **Asymptotic formulation**: The conjunction of ∀-bounded upper bound and ∃-witnessed lower bound correctly captures f(N)/N → 1/2. Both directions are necessary and correctly stated. + +- **Type handling**: Casts `(A.card : ℝ)` and `(N : ℝ)` correctly lift comparisons to the reals. + +**One subtle point worth noting**: The formalization quantifies `∀ (A : Finset ℕ), A ⊆ Finset.Icc 1 N → UnitFractionTripleFree A → ...` for the upper bound. This says "every unit-fraction-triple-free subset has at most (1/2 + ε)N elements," which is equivalent to "f(N) ≤ (1/2 + ε)N" since f(N) is the maximum over all such A. This is correct. + +No mathematical flaws identified. An experienced mathematician would find this formalization faithful to the original conjecture and its known resolution. diff --git a/ai-review/305.md b/ai-review/305.md new file mode 100644 index 0000000000..c7512df7a5 --- /dev/null +++ b/ai-review/305.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 305 + +## 1. Code Reuse + +Several related Egyptian fraction definitions exist across the codebase, each slightly different in purpose: + +- **`Erdos304.unitFractionExpressible`** (304.lean:31): Uses `ℚ` for the sum equality and requires `n > 1` for denominators. Tracks cardinality of the representation. Not directly reusable since 305 needs to track the actual set (for bounding elements), not just cardinality. +- **`Erdos308.IsRepresentableUnitFractionSum`** / **`Erdos309.IsRepresentableUnitFractionSum`** (308.lean:41, 309.lean:45): Represents integers (not general fractions) as unit fraction sums over `ℚ`. Duplicate definitions across two files. +- **`Erdos292.IsEgyptianRepresentable`** (292.lean:41): Represents 1 as a sum of unit fractions with `n` among the denominators, over `ℚ`. + +**Observation:** There is no shared/common Egyptian fraction definition in `FormalConjecturesForMathlib`. Each problem defines its own variant. Problem 305's `IsEgyptianRepr` is yet another variant (uses `ℝ` instead of `ℚ`, represents a general `a/b`). A shared definition in `FormalConjecturesForMathlib` would benefit problems 292, 304, 305, 308, 309, and others. That said, the specific needs of each problem (which scalar field, what constraints on denominators, what target value) differ enough that a universal definition may require parameterization. + +**Minor concern:** `IsEgyptianRepr` uses `ℝ` for the sum equality (`∑ n ∈ S, (1 : ℝ) / (n : ℝ) = (a : ℝ) / (b : ℝ)`), while most other Egyptian fraction formalizations in the codebase use `ℚ`. Using `ℚ` would be more natural for an exact arithmetic statement about rationals, and would avoid potential issues with real-number equality of rational quantities. However, since the main theorem bound involves `Real.log`, staying in `ℝ` for the bound itself is natural. The definition could use `ℚ` for the sum condition and cast to `ℝ` only in the bound, but this is a stylistic choice. + +## 2. Citations + +**Website** (https://www.erdosproblems.com/305) lists: + +- Source: [ErGr80, p.38] +- Bleicher & Erdős (1976): $D(b) \ll b(\log b)^2$ +- For $b = p$ prime: $D(p) \gg p \log p$ (lower bound) +- Yokota (1988): improvement +- Liu & Sawhney (2024): further improvement + +**Code docstring** includes: + +- [ErGr80] — full citation ✓ +- [BlEr76] — full citation ✓ +- [Yo88] — full citation ✓ +- [LiSa24] — full citation ✓ + +**Discrepancy:** The lower bound $D(p) \gg p \log p$ for primes $p$ is mentioned on the website but not in the code docstring. This is useful context as it shows the conjecture is essentially tight (up to the $o(1)$ in the exponent). Consider adding it. + +## 3. Variants + +The formalization captures the main conjecture: the upper bound $D(b) \ll b(\log b)^{1+o(1)}$. + +**Not captured:** +- The lower bound $D(p) \gg p \log p$ for primes, which would be a natural companion statement establishing near-optimality of the bound. +- The intermediate results (Bleicher-Erdős $(\log b)^2$ bound, Yokota's bound, Liu-Sawhney's bound) are described in the docstring but not formalized as separate theorems. This is reasonable — they are partial results toward the main conjecture, and formalizing them as separate statements would add significant complexity. + +The formalization only addresses the question "is $D(b) \ll b(\log b)^{1+o(1)}$?" and does not formalize the definition of $D(a,b)$ or $D(b)$ explicitly as functions. This is acceptable: the existential formulation directly captures the bound without needing to define the intermediate optimization. + +## 4. Readability + +The code is clean and readable. Some observations: + +- The docstring clearly explains the mathematical context, intermediate results, and the formalization strategy. +- The formalization comment ("We formalize: for every $\varepsilon > 0$...") explicitly bridges the informal and formal statements, which is excellent practice. +- Variable names (`ε`, `C`, `b₀`, `S`) are mathematically conventional and clear. +- The `IsEgyptianRepr` definition has a helpful docstring explaining the distinctness guarantee from the Finset structure. + +**No readability issues identified.** + +## 5. Formalizability + +The original problem asks: "Is it true that $D(b) \ll b(\log b)^{1+o(1)}$?" + +**Ambiguity analysis:** + +The expression $f(b) \ll g(b) \cdot (\log b)^{o(1)}$ involves *two* layers of asymptotic notation: +- The $\ll$ (Vinogradov notation) means $|f(b)| \leq C \cdot g(b)$ for some constant $C$ and all sufficiently large $b$. +- The $o(1)$ in the exponent means the exponent approaches 0 as $b \to \infty$. + +Combined, $D(b) \ll b(\log b)^{1+o(1)}$ means: for every $\varepsilon > 0$, there exists $C_\varepsilon > 0$ and $b_0(\varepsilon)$ such that $D(b) \leq C_\varepsilon \cdot b \cdot (\log b)^{1+\varepsilon}$ for all $b \geq b_0(\varepsilon)$. + +The formalization captures this correctly by universally quantifying over $\varepsilon > 0$ and existentially quantifying over $C$ and $b_0$. **The statement is unambiguous enough to be obviously formalizable, and the chosen formalization is the standard one.** + +One subtle point: the problem statement says $D(b) = \max_{1 \leq a < b} D(a,b)$, taking a maximum over $a$. The formalization avoids defining this maximum and instead directly asserts the bound for all $a$ with $1 \leq a < b$. This is logically equivalent (bounding the max is the same as bounding each term) and is a cleaner formalization. + +## 6. Correctness + +### Status: CRITICAL ISSUE — Problem is marked `open` but has been proved + +The website marks this problem as **PROVED**. The Liu-Sawhney (2024) result gives $D(b) \ll b(\log b)(\log \log b)^3(\log \log \log b)^{O(1)}$. Since $(\log \log b)^3 (\log \log \log b)^{O(1)} = o((\log b)^\varepsilon)$ for any $\varepsilon > 0$, this implies $D(b) \ll b(\log b)^{1+o(1)}$, confirming the conjecture. + +**The attribute `@[category research open, AMS 11]` should be changed to `@[category research solved, AMS 11]`.** + +### Formalization correctness + +The formalization is mathematically correct: + +1. **`IsEgyptianRepr` definition:** Correctly captures Egyptian fraction representations — nonempty set of positive integers whose reciprocal sum equals $a/b$, with distinctness from the Finset structure. ✓ + +2. **Main theorem statement:** The quantifier structure `∀ ε > 0, ∃ C > 0, ∃ b₀, ∀ b ≥ b₀, ∀ 1 ≤ a < b, ∃ S, ...` correctly formalizes "$D(b) \ll b(\log b)^{1+o(1)}$". ✓ + +3. **Bound on all elements vs. largest:** The formalization bounds every element of $S$ (`∀ n ∈ S`), not just the largest. Since we are proving *existence* of such an $S$, bounding all elements is equivalent to bounding the largest (the largest being $\leq X$ implies all are $\leq X$, and vice versa). ✓ + +4. **`answer(sorry)` wrapper:** The biconditional `answer(sorry) ↔ [statement]` is the standard pattern for problems whose truth value is to be determined. Since the conjecture is true (proved), the answer should be `True`. ✓ + +5. **No coprimality assumption:** The problem does not require $\gcd(a,b) = 1$, consistent with the original statement. ✓ + +6. **Edge cases:** For $b < b_0$, no bound is claimed. For $b \geq b_0$ with $\log b \leq 0$ (impossible for $b \geq 1$ since $\log b \geq 0$ in Lean's `Real.log`), the bound $C \cdot b \cdot (\log b)^{1+\varepsilon}$ could be 0 or negative, but $b_0$ can be chosen large enough that $\log b > 1$. No issues. ✓ + +### Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | No direct reuse available; shared Egyptian fraction definition would benefit the codebase | +| Citations | Accurate; minor: lower bound $D(p) \gg p \log p$ from website not mentioned | +| Variants | Main conjecture captured; lower bound not formalized | +| Readability | Excellent | +| Formalizability | Unambiguous; standard formalization of asymptotic bounds | +| Correctness | **Mathematically correct, but should be re-categorized from `open` to `solved`** | diff --git a/ai-review/308.md b/ai-review/308.md new file mode 100644 index 0000000000..66ac8f1681 --- /dev/null +++ b/ai-review/308.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 308 + +## 1. Code Reuse + +**Critical duplication found.** The definition `IsRepresentableUnitFractionSum` is duplicated verbatim between `ErdosProblems/308.lean` (lines 41–43, in namespace `Erdos308`) and `ErdosProblems/309.lean` (lines 45–47, in namespace `Erdos309`). These are identical: + +```lean +def IsRepresentableUnitFractionSum (N : ℕ) (k : ℕ) : Prop := + ∃ S : Finset ℕ, (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (k : ℚ) +``` + +This definition should be extracted to a shared utility (e.g., in `FormalConjecturesForMathlib`) and imported by both problems. + +Additionally, several other Erdős problems in the 300-range use closely related unit-fraction-sum constructs over `Finset ℕ`: +- **Problem 305** (`IsEgyptianRepr`): `∑ n ∈ S, (1 : ℝ) / (n : ℝ) = a / b` — same pattern but over `ℝ` and targeting a general rational. +- **Problem 310**: `∑ n ∈ S, (1 : ℚ) / (n : ℚ) = a / b` — same pattern over `ℚ`. +- **Problem 300** (`Egyptian1Free`): `∑ n ∈ S, (1 : ℝ) / (n : ℝ) ≠ 1` — negation of the same summation pattern. +- **Problem 311** (`unitFractionDeviation`): `∑ n ∈ A, (1 : ℝ) / n` — same core sum. + +A shared `unitFractionSum` definition parameterized by the scalar field could unify these, though the benefit is debatable given the simplicity of the expression. + +## 2. Citations + +The formalization references: +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- `[Cr99]` — Croot, E., *On unit fractions*. Ph.D. thesis, University of Georgia (1999). + +The website (erdosproblems.com/308) lists these same two references. The citations in the Lean file are consistent with the website. **No issues.** + +## 3. Variants + +The website describes the problem as having been "essentially solved" by Croot, who showed that for sufficiently large $N$, the set of representable positive integers is either $\{1, \ldots, m_N - 1\}$ or $\{1, \ldots, m_N\}$, where $m_N = \lfloor \sum_{n \leq N} 1/n \rfloor$. + +The formalization captures only the **core qualitative conjecture**: that the representable set is always an initial segment $\{1, \ldots, m\}$. It does **not** formalize: + +1. **Croot's quantitative bounds** on $f(N)$ (the smallest non-representable integer): + - Lower bound: $\lfloor \sum_{n \leq N} 1/n - \frac{9}{2}(1+o(1)) \frac{(\log\log N)^2}{\log N} \rfloor \leq f(N)$ + - Upper bound: $f(N) \leq \lfloor \sum_{n \leq N} 1/n - \frac{1}{2}(1+o(1)) \frac{(\log\log N)^2}{\log N} \rfloor$ + +2. **The relationship between $m$ and the harmonic sum** $m_N = \lfloor \sum_{n \leq N} 1/n \rfloor$, which is mentioned in the docstring but not formalized. + +These are reasonable omissions — the quantitative bounds involve asymptotic notation that is harder to formalize, and the core conjecture is the most natural statement. However, a variant formalizing that $m$ equals $m_N$ or $m_N - 1$ for sufficiently large $N$ would strengthen the formalization. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The `open Finset` and `open scoped BigOperators` are appropriate. +- The docstring on `IsRepresentableUnitFractionSum` is clear and well-written. +- The docstring on the theorem statement accurately summarizes the problem and its resolution. +- The namespace `Erdos308` is consistent with project conventions. + +**No readability issues.** + +## 5. Formalizability + +The problem is **highly formalizable** as stated. The question "is the set of representable integers always an initial segment?" is a clean, unambiguous combinatorial statement. The definition `IsRepresentableUnitFractionSum` directly captures the mathematical notion. + +**Ambiguity assessment: Very low.** The only minor subtlety is whether "representable" means the subset $S$ must be nonempty — here the definition allows the empty set (which sums to 0), but since the theorem only asserts representability for $k \geq 1$, this is not a problem. The empty set summing to 0 is mathematically correct and does not affect the statement. + +## 6. Correctness + +The formalization is **mathematically correct** but has a subtle logical structure worth examining. + +**The `answer(True)` wrapper:** The theorem states: +```lean +theorem erdos_308 : answer(True) ↔ ∀ N : ℕ, 1 ≤ N → + ∃ m : ℕ, (∀ k : ℕ, 1 ≤ k → k ≤ m → IsRepresentableUnitFractionSum N k) ∧ + (∀ k : ℕ, m < k → ¬ IsRepresentableUnitFractionSum N k) := by +``` + +This says the answer is "True" iff for every $N \geq 1$, there exists $m$ such that exactly $\{1, \ldots, m\}$ is the representable set. The `answer(True)` encoding is consistent with the problem being solved in the affirmative (per the website and Croot's result). This is correct. + +**Correctness of the formalization of "initial segment":** The two conditions: +1. $\forall k, 1 \leq k \leq m \implies \text{representable}(k)$ +2. $\forall k, k > m \implies \neg\text{representable}(k)$ + +correctly characterize that the representable set among positive integers is exactly $\{1, \ldots, m\}$. Note that $k = 0$ is excluded from condition (1) via `1 ≤ k`, which is appropriate since 0 is not a "positive integer" in the problem statement. Condition (2) does technically cover $k = 0$ when $m = 0$ (i.e., no positive integer is representable), which is fine — for $N \geq 1$, we always have $m \geq 1$ since $1/1 = 1$ is representable. + +**One potential concern:** The definition `IsRepresentableUnitFractionSum` does not enforce that the elements of $S$ are *distinct* — but since $S$ is a `Finset ℕ`, elements are automatically distinct. This is correct. + +**Another subtle point:** The definition requires $\forall n \in S, 1 \leq n \wedge n \leq N$ rather than $S \subseteq \text{Finset.Icc 1 N}$. These are equivalent, but the current formulation is slightly more verbose. This is a stylistic choice and not incorrect. + +**Overall assessment: Correct and complete** for the qualitative conjecture. The formalization faithfully captures the mathematical content of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — `IsRepresentableUnitFractionSum` is duplicated in problem 309 | +| Citations | **Good** — matches website | +| Variants | **Adequate** — core conjecture captured; quantitative bounds omitted | +| Readability | **Good** | +| Formalizability | **Excellent** — unambiguous statement | +| Correctness | **Correct** | diff --git a/ai-review/309.md b/ai-review/309.md new file mode 100644 index 0000000000..1ecc333a2f --- /dev/null +++ b/ai-review/309.md @@ -0,0 +1,87 @@ +# Review: Erdős Problem 309 + +## 1. Code Reuse + +Several existing formalizations in the codebase deal with sums of distinct unit fractions over subsets of `{1, …, N}`: + +- **Problem 46** (`ErdosProblems/46.lean`): Uses the identical reciprocal-sum pattern `∑ n ∈ S, (1 : ℚ) / (n : ℚ) = 1` over a `Finset ℕ` with membership constraints `n ≥ 2`. The definition `IsRepresentableUnitFractionSum` in Problem 309 is essentially a generalization of this pattern (summing to arbitrary `k` rather than `1`). + +- **Problem 47** (`ErdosProblems/47.lean`): Works with `∀ a ∈ A, 1 ≤ a ∧ a ≤ N` — the exact same membership predicate used in `IsRepresentableUnitFractionSum`. It also uses `(1 : ℝ) / a` sums with `Real.log N` bounds. + +- **Problem 856** (`ErdosProblems/856.lean`): Uses `A ⊆ Finset.Icc 1 N` as a cleaner alternative to the membership predicate `∀ n ∈ S, 1 ≤ n ∧ n ≤ N` used in Problem 309. The `Finset.Icc 1 N` idiom is more concise and could be adopted here. + +**Recommendation:** The definition `IsRepresentableUnitFractionSum` could use `S ⊆ Finset.Icc 1 N` instead of `∀ n ∈ S, 1 ≤ n ∧ n ≤ N` for consistency with Problem 856's style. Similarly, `countRepresentableIntegers` could filter over `Finset.Icc 1 N` rather than `Finset.range (N + 1)` for clarity. However, these are minor stylistic points — the current formulation is logically equivalent. + +## 2. Citations + +The website ([erdosproblems.com/309](https://www.erdosproblems.com/309)) lists the following: + +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✅ Matches the formalization. + +- **[Yo97]** Yokota, H., *On a problem of Erdős and Graham*. (1997). ✅ Matches the formalization. + +The website also references two additional results **not mentioned** in the formalization: + +- **Croot (1999):** Proved every integer ≤ ∑(n≤N) 1/n − (9/2 + o(1))(log log N)²/log N can be represented. This is a stronger structural result than just the counting bound. + +- **Yokota (2002):** Improved the lower bound to F(N) ≥ log N + γ − (π²/3 + o(1))(log log N)²/log N, giving a precise asymptotic with the Euler–Mascheroni constant γ. + +The website also references **OEIS A217693**. + +**Recommendation:** The docstring should mention Croot (1999) and Yokota (2002) for completeness, as these represent stronger results that refine the answer. Full citation details should be added. + +## 3. Variants + +The formalization captures only one statement: the negation of the original conjecture (∃ c > 0 such that F(N) ≥ c · log N eventually). The website reveals richer structure: + +- **Missing variant (Croot's structural result):** Every integer up to ∑(n≤N) 1/n − (9/2 + o(1))(log log N)²/log N is representable. This is a *qualitative* strengthening — it identifies *which* integers are representable, not just how many. + +- **Missing variant (Yokota 2002 precise asymptotics):** F(N) ≥ log N + γ − (π²/3 + o(1))(log log N)²/log N. This gives the precise leading constant (1) and second-order correction, which is much stronger than "F(N) ≥ c · log N." + +- **Missing variant (trivial upper bound):** F(N) ≤ log N + O(1), mentioned in the docstring but not formalized. This together with the lower bound would establish F(N) = Θ(log N) formally. + +**Recommendation:** At minimum, the trivial upper bound should be formalized as a separate theorem, since the docstring already mentions it. The Yokota 2002 refined lower bound would also be a valuable variant. + +## 4. Readability + +The code is generally well-structured. Minor observations: + +- The definition `IsRepresentableUnitFractionSum` uses `ℚ` for the reciprocal sum while the theorem `erdos_309` uses `ℝ` for `Real.log` and the coercion of `countRepresentableIntegers`. This is mathematically fine (the sum is rational), but creates a mild type-universe mismatch in presentation. + +- `countRepresentableIntegers` filters `Finset.range (N + 1)` with `0 < k ∧ IsRepresentableUnitFractionSum N k`. The `0 < k` condition is slightly redundant given the name says "positive integers," but it's good to have it explicit. + +- The name `countRepresentableIntegers` is clear and descriptive. The `F(N)` notation from the literature is mentioned only in the docstring; an alias or notation declaration could improve readability of the theorem statement. + +**Overall:** Readability is good. No major issues. + +## 5. Formalizability + +The problem as stated on the website — "How many integers can be written as the sum of distinct unit fractions with denominators from {1, …, N}?" — is fully precise and obviously formalizable. There is no ambiguity in: + +- What "distinct unit fractions with denominators from {1, …, N}" means. +- What "integers" means in this context (positive integers, since the sum of positive terms is positive). +- What F(N) counts. + +The asymptotic question "are there o(log N) such integers?" is also precise. + +**Assessment:** No ambiguity. The problem is cleanly formalizable. + +## 6. Correctness + +### Definition `IsRepresentableUnitFractionSum` + +Correct. It captures "k = ∑_{n ∈ S} 1/n for some S ⊆ {1, …, N}" faithfully. The use of `ℚ` ensures exact arithmetic (no rounding issues). + +### Definition `countRepresentableIntegers` + +**Potential issue:** The filter range is `Finset.range (N + 1)`, which gives {0, 1, …, N}. The `0 < k` condition excludes 0, leaving {1, …, N}. However, the harmonic sum H_N = ∑_{n=1}^{N} 1/n ≈ log N + γ, which means the largest representable integer is ⌊H_N⌋ ≈ log N. For large N, log N ≪ N, so the range is more than sufficient. But conceptually, we are counting representable positive integers *without an explicit upper bound* — the range should in principle be unlimited. Since no integer larger than ⌊H_N⌋ can be represented (you can't exceed the full sum), and H_N < N + 1 for all N ≥ 1, the range `Finset.range (N + 1)` is correct as an upper bound. **This is fine.** + +### Theorem `erdos_309` + +The theorem states: ∃ c > 0, ∀ᶠ N in atTop, c · log N ≤ F(N). + +This correctly formalizes the *negation* of "F(N) = o(log N)". The original conjecture was that F(N) = o(log N), i.e., F(N)/log N → 0. The negation is that F(N)/log N does not tend to 0, which is implied by (but slightly weaker than) F(N) ≥ c · log N for some fixed c > 0. However, Yokota's result actually establishes the stronger statement F(N) = Θ(log N), so asserting a linear lower bound is correct and proven. + +**Subtle point:** The formalization says `c * Real.log (N : ℝ) ≤ (countRepresentableIntegers N : ℝ)`. For small N (e.g., N = 0 or N = 1), `Real.log N` could be ≤ 0, making the inequality vacuously true. The `∀ᶠ (N : ℕ) in atTop` filter handles this correctly by only requiring the bound for sufficiently large N. + +**Overall correctness assessment:** The formalization is mathematically correct. It faithfully captures the disproved conjecture in its negated form. The definitions are sound and the theorem statement accurately reflects a consequence of Yokota's result. The only limitation is that it captures the weakest form of the known results — a Θ(log N) statement or Yokota's 2002 refined bound would be more informative, but the current statement is not *incorrect*. diff --git a/ai-review/31.md b/ai-review/31.md new file mode 100644 index 0000000000..e8e0b3aacf --- /dev/null +++ b/ai-review/31.md @@ -0,0 +1,180 @@ +# Review: Erdős Problem 31 + +**File:** `FormalConjectures/ErdosProblems/31.lean` + +--- + +## 1. Code Reuse + +**Issue: Both `sumset` and `HasNaturalDensityZero` are custom definitions that duplicate existing infrastructure.** + +### Sumset + +The custom definition at line 35: +```lean +def sumset (A B : Set ℕ) : Set ℕ := {n : ℕ | ∃ a ∈ A, ∃ b ∈ B, n = a + b} +``` + +This is mathematically equivalent to `A + B` under `open scoped Pointwise` from `Mathlib.Algebra.Group.Pointwise.Set.Basic` (line 285), which defines `s + t = Set.image2 (· + ·) s t`. Membership is characterized by `Set.mem_add`: `x ∈ s + t ↔ ∃ a ∈ s, ∃ b ∈ t, x = a + b`, which is identical to the custom definition. + +The same custom `sumset` definition is also duplicated in Problems 35 (line 36) and 37 (line 44). + +**Recommendation:** Remove `sumset` and use `A + B` with `open scoped Pointwise`. + +### HasNaturalDensityZero + +The custom definition at lines 39–41: +```lean +def HasNaturalDensityZero (B : Set ℕ) : Prop := + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (((Finset.range N).filter (· ∈ B)).card : ℝ) / (N : ℝ) < ε +``` + +`FormalConjecturesForMathlib/Data/Set/Density.lean` (line 86–88) provides a generalized `HasDensity` definition: +```lean +def HasDensity (S : Set β) (α : ℝ) (A : Set β := Set.univ) : Prop := + Tendsto (fun (b : β) => S.partialDensity A b) atTop (𝓝 α) +``` + +Using `B.HasDensity 0` is equivalent to the custom `HasNaturalDensityZero B`: both express that the proportion of elements of `B` in `{0, …, N-1}` tends to zero. The `HasDensity` version is more idiomatic (using `Tendsto` and the `𝓝` filter) and comes with supporting lemmas such as `Nat.hasDensity_zero_of_finite` (line 166). + +Several other problems already use `HasDensity 0` instead of custom definitions — e.g., Problems 340 (line 178) and 1054 (line 45). + +**Recommendation:** Replace `HasNaturalDensityZero B` with `B.HasDensity 0` and import `FormalConjecturesForMathlib.Data.Set.Density`. + +### Cofinite complement + +The conclusion `Set.Finite {n : ℕ | n ∉ sumset A B}` is correct but could alternatively be expressed using the cofinite filter: `∀ᶠ n in Filter.cofinite, n ∈ A + B`. The additive basis framework in `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` uses exactly this idiom for `IsAsymptoticAddBasisOfOrder`. + +Note, however, that Erdős 31 is *not* directly an instance of `IsAsymptoticAddBasisOfOrder`, because the problem asks for the existence of a *density-zero helper set* B such that A + B is cofinite — it is not asserting that A itself is an asymptotic basis. The basis framework is tangentially related but not directly applicable. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/31](https://www.erdosproblems.com/31):** + +The website lists: +- **Status:** Solved (proved by Lorentz) +- **Tags:** Number theory, Additive basis +- **Conjectured by:** Erdős and Straus +- **References:** Er56, Er59, Er65b, Er73, Lo54 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved, AMS 11]` | Solved | **Correct.** | +| AMS classification | `AMS 11` | Number theory | **Correct.** | +| Attribution | "Erdős–Straus, proved by Lorentz [Lo54]" | Erdős and Straus, proved by Lorentz | **Correct.** | +| Lorentz reference | `[Lo54] Lorentz, G. G., On a problem of additive number theory. Proc. Amer. Math. Soc. 5 (1954), 838–840.` | Lo54 | **Correct.** Full bibliographic data provided. | +| Erdős references | Not listed in docstring | Er56, Er59, Er65b, Er73 | **Missing.** The website lists four Erdős references where the problem appears. Consider adding these to the module docstring for completeness. | + +**Assessment:** The Lorentz citation is complete and correctly formatted. The four Erdős source references (Er56, Er59, Er65b, Er73) should be added. + +--- + +## 3. Variants + +The formalization captures the core statement. Potential variants or strengthenings: + +**1. Quantitative bounds on the density of B:** +Lorentz's proof actually shows something more specific about the relationship between the counting function of A and the density decay rate of B. One could formalize a quantitative version giving explicit bounds on how rapidly the density of B can tend to zero as a function of A's growth. + +**2. Effective cofiniteness:** +The conclusion states that the complement of A + B is finite, but one could ask for an explicit bound on how large the missing elements can be, given information about A. + +**3. Sumset with prescribed density:** +A natural strengthening: given any infinite A ⊆ ℕ and any ε > 0, does there exist B with upper density at most ε such that A + B is cofinite? Lorentz's result gives density 0, which is stronger, so this is already captured. + +**4. Multiple summands:** +One could ask about A + B₁ + B₂ + … with even sparser B_i. This is a different problem not directly related to Erdős 31. + +**Assessment:** The core theorem is faithfully captured. The omission of quantitative variants is appropriate — the problem as stated on the website is purely existential. + +--- + +## 4. Readability + +The code is short and clean. Specific observations: + +- **Module docstring:** Clear and informative, with a proper LaTeX statement and full Lorentz citation. +- **Definition docstrings:** Both `sumset` and `HasNaturalDensityZero` have docstrings that clearly explain what they define. +- **Namespace:** `Erdos31` is appropriate. +- **Opens:** `open scoped Classical` is used; this is needed for decidability of set membership in the filter definition. + +**Minor suggestions:** +- The `sumset` docstring says "$A + B$: the set of all $a + b$ with $a \in A$, $b \in B$" — this would become unnecessary if using Mathlib's pointwise addition. +- The `HasNaturalDensityZero` epsilon-delta formulation is mathematically correct but less idiomatic than the `Tendsto`-based formulation. The latter would be clearer to a Lean user familiar with Mathlib conventions. + +Overall readability is good. Adopting the shared definitions would slightly improve it by reducing boilerplate. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise and leaves no room for interpretation: +- "Infinite set A ⊂ ℕ" — well-defined. +- "Set B of density 0" — natural density zero is a standard, unambiguous concept. +- "A + B contains all except finitely many integers" — the sumset and cofiniteness condition are both standard. + +The only minor point is whether "integers" in the original statement means ℤ or ℕ. The formalization uses ℕ, which is the natural choice since A ⊂ ℕ and sumsets of natural number sets are subsets of ℕ. If the original problem intended ℤ, the ℕ version is equivalent (since negative integers are irrelevant when A, B ⊆ ℕ). + +**Ambiguity level: None.** The statement is completely precise. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `sumset` + +```lean +def sumset (A B : Set ℕ) : Set ℕ := {n : ℕ | ∃ a ∈ A, ∃ b ∈ B, n = a + b} +``` + +This correctly defines the Minkowski sum (sumset) of two sets of natural numbers. An element n is in the sumset iff it can be written as a + b with a ∈ A and b ∈ B. This is the standard definition. + +### Definition: `HasNaturalDensityZero` + +```lean +def HasNaturalDensityZero (B : Set ℕ) : Prop := + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N ≥ N₀ → + (((Finset.range N).filter (· ∈ B)).card : ℝ) / (N : ℝ) < ε +``` + +- **Counting function:** `(Finset.range N).filter (· ∈ B)` gives `B ∩ {0, 1, …, N-1}`, and `.card` counts its elements. This is correct. +- **Density ratio:** Dividing by N gives `|B ∩ [0, N)|/N`, which is the standard natural density counting function. +- **Limit to zero:** The epsilon-N₀ formulation correctly states that this ratio tends to zero. This is equivalent to `Tendsto (fun N => |B ∩ [0,N)| / N) atTop (𝓝 0)`. +- **Edge case at N = 0:** When N = 0, `Finset.range 0 = ∅`, so the card is 0 and the ratio is 0/0 = 0 (by Lean convention). The condition `0/0 < ε` holds (since `0 < ε`), so the edge case is harmless. The ∃ N₀ quantifier means we only need the bound to hold for sufficiently large N anyway. + +**One subtlety:** `(Finset.range N).filter (· ∈ B)` uses classical decidability (from `open scoped Classical`), since membership in an arbitrary `Set ℕ` is not decidable. This is correct — the `Classical` scope ensures the filter is well-defined. + +### Theorem: `erdos_31` + +```lean +theorem erdos_31 (A : Set ℕ) (hA : A.Infinite) : + ∃ B : Set ℕ, HasNaturalDensityZero B ∧ + Set.Finite {n : ℕ | n ∉ sumset A B} := by + sorry +``` + +- **Hypothesis:** `A.Infinite` correctly requires A to be an infinite subset of ℕ. This is necessary — for finite A, the sumset A + B is always "sparse" in some sense, and one cannot generally cover all but finitely many naturals. +- **Conclusion, first conjunct:** `HasNaturalDensityZero B` requires B to have natural density zero. This matches the problem statement. +- **Conclusion, second conjunct:** `Set.Finite {n : ℕ | n ∉ sumset A B}` states that the set of naturals NOT in A + B is finite. Equivalently, A + B is cofinite. This matches "A + B contains all except finitely many natural numbers." +- **Existential over B:** The problem asks for the *existence* of such a B, and the formalization correctly uses `∃ B`. Note that B is not required to be infinite or to have any other property besides density zero — this is correct, as Lorentz's theorem makes no such additional restriction. + +### Potential concern: does B need to be a subset of ℕ? + +B is typed as `Set ℕ`, so it is automatically a subset of ℕ. This is correct and matches the problem. + +### Potential concern: is the problem about ℕ or ℤ? + +The original Erdős–Straus statement says "integers," but since A ⊂ ℕ and B ⊆ ℕ, we have A + B ⊆ ℕ, so "all except finitely many natural numbers" is the right interpretation. The formalization over ℕ is correct. (If one worked over ℤ, the negative integers would automatically be excluded from A + B, so the conclusion would need to say "all except finitely many *non-negative* integers," which amounts to the same thing.) + +### Relationship to Lorentz's proof + +The attribute `@[category research solved]` correctly indicates this is a solved problem. Lorentz's 1954 proof is constructive: given A = {a₁ < a₂ < …}, one builds B by choosing elements whose density tends to zero while ensuring the sumset covers a tail of ℕ. The formalization's existential statement faithfully represents the theorem without encoding the specific construction, which is appropriate. + +**Verdict: Correct and complete.** The formalization faithfully captures Erdős Problem 31 as stated on the website. The custom definitions are mathematically correct, though they should be replaced with shared infrastructure for maintainability. No mathematical flaws are present. diff --git a/ai-review/310.md b/ai-review/310.md new file mode 100644 index 0000000000..0fdccb5559 --- /dev/null +++ b/ai-review/310.md @@ -0,0 +1,108 @@ +# Review: Erdős Problem 310 + +## 1. Code Reuse + +The codebase contains a large cluster of unit-fraction / Egyptian-fraction problems (294, 296, 297, 298, 299, 300, 301, 302, 305, 308, 309, 313, 320, 321, etc.) that share the common pattern `∑ n ∈ S, (1 : ℚ) / (n : ℚ)`. Several observations: + +- **`Erdos305.IsEgyptianRepr`** (305.lean) defines a general Egyptian-fraction predicate: `S.Nonempty ∧ (∀ n ∈ S, 0 < n) ∧ ∑ n ∈ S, (1 : ℝ) / (n : ℝ) = (a : ℝ) / (b : ℝ)`. This is close to what 310 needs, but 310 works over `ℚ` rather than `ℝ`, and 310 additionally constrains `S ⊆ A` and `a ≤ b ≤ C`. The differences are sufficient that inlining the predicate (as currently done) is reasonable. +- **`Erdos308.IsRepresentableUnitFractionSum`** (308.lean) is also related but specialized to integer targets. +- **`Erdos300.Egyptian1Free`** (300.lean) handles the negation (no subset sums to 1), a different shape. +- **Set membership style**: 300.lean uses `A ⊆ Finset.Icc 1 N` while 310.lean uses the pointwise `∀ n ∈ A, 1 ≤ n ∧ n ≤ N`. The `Finset.Icc` form is more idiomatic and would align better with the rest of the codebase (see also 300.lean line 64). However, the pointwise form is functionally equivalent. + +**Verdict**: No strong reuse opportunity. The statement is self-contained and does not benefit from extracting a shared definition. A minor style improvement would be to use `A ⊆ Finset.Icc 1 N` for consistency with 300.lean. + +## 2. Citations + +The file references three works: + +| Tag | In File | On Website | +|-----|---------|------------| +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | Listed as [ErGr80] (source of conjecture) | +| [Bl21] | Bloom, T., *On a density conjecture about unit fractions* (2021). | Listed as [Bl21] | +| [LiSa24] | Liu, J. and Sawhney, M., *On a conjecture of Erdős on unit fractions* (2024). | Listed as [LiSa24] | + +All three citations match the website. Minor notes: +- Other files in the codebase (e.g., 298.lean) cite Bloom's paper with the arXiv identifier `arXiv:2112.03726`. Problem 310 omits this. Adding it would improve traceability but is not strictly necessary. +- The Liu-Sawhney paper title in 310 is *On a conjecture of Erdős on unit fractions*, which is distinct from the Liu-Sawhney paper cited in 300.lean (*On a conjecture of Erdős and Graham about Egyptian fractions*) and 305.lean (*An improvement on Erdős-Graham's conjecture*). These appear to be different papers by the same authors, which is correct—Liu and Sawhney published multiple related papers in 2024. + +**Verdict**: Citations are complete and consistent with the website. + +## 3. Variants + +The website describes one refined result beyond the base conjecture: + +- **Liu-Sawhney quantitative bound**: If `(log N)^{-1/7 + o(1)} ≤ α ≤ 1/2`, then there exists `S ⊆ A` with `∑ 1/n = a/b` and `b ≤ exp(O(1/α))`, and this dependence is sharp. + +The formalization captures only the qualitative statement (existence of a bound `C` depending on `α`) and does not formalize the quantitative `exp(O(1/α))` relationship. This is a reasonable choice since the qualitative statement is the original Erdős conjecture; the quantitative refinement is a separate, stronger result by Liu-Sawhney. Formalizing the sharp bound would require additional asymptotic machinery. + +**Verdict**: The original conjecture is fully captured. The sharp quantitative bound is an optional enhancement, not a missing variant. + +## 4. Readability + +The code is clean and well-structured: +- The docstring clearly states both the informal O-notation version and the precise formalization. +- The Lean statement is straightforward and follows the logical structure of the mathematical claim. +- Variable naming (`α`, `C`, `N`, `A`, `S`, `a`, `b`) matches standard mathematical convention. + +Minor suggestions: +- The `open Finset BigOperators` could be `open Finset` / `open scoped BigOperators` for consistency with 305.lean and 308.lean, though this is purely cosmetic. + +**Verdict**: Highly readable. No substantive improvements needed. + +## 5. Formalizability + +The original problem statement uses O_α(1) notation: "a/b = ∑ 1/n with a ≤ b = O_α(1)." This has a standard and unambiguous interpretation: there exists a constant C (depending only on α) such that b ≤ C. The formalization correctly unpacks this as `∃ C : ℕ, 0 < C ∧ ... b ≤ C`. + +The only minor ambiguity in the original statement is whether "a ≤ b" is part of the conjecture or merely a convention. Reading the original Erdős-Graham source and the Liu-Sawhney paper, "a ≤ b = O_α(1)" means both a ≤ b and b is bounded—this is the standard interpretation and the formalization follows it correctly. + +**Verdict**: The statement is unambiguous and straightforwardly formalizable. Ambiguity level: **very low**. + +## 6. Correctness + +### Detailed analysis of the Lean statement + +```lean +∀ α : ℝ, α > 0 → + ∃ C : ℕ, 0 < C ∧ + ∀ N : ℕ, 1 ≤ N → + ∀ A : Finset ℕ, (∀ n ∈ A, 1 ≤ n ∧ n ≤ N) → + α * (N : ℝ) ≤ (A.card : ℝ) → + ∃ S : Finset ℕ, S ⊆ A ∧ S.Nonempty ∧ + ∃ a b : ℕ, 0 < a ∧ a ≤ b ∧ b ≤ C ∧ + ∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (a : ℚ) / (b : ℚ) +``` + +**Checking each component:** + +1. **Quantifier structure**: ∀ α > 0, ∃ C, ∀ N ≥ 1, ∀ A ⊆ {1,...,N} with |A| ≥ αN, ∃ S ⊆ A ... — correct. + +2. **Set membership**: `∀ n ∈ A, 1 ≤ n ∧ n ≤ N` correctly encodes A ⊆ {1,...,N}. All elements are ≥ 1, ensuring `(n : ℚ) ≠ 0` so division is well-defined. + +3. **Density condition**: `α * (N : ℝ) ≤ (A.card : ℝ)` correctly captures |A| ≥ αN. + +4. **Nonemptiness**: `S.Nonempty` is required, preventing the trivial solution S = ∅ (where the empty sum is 0 = 0/1). + +5. **Fraction constraints**: `0 < a ∧ a ≤ b ∧ b ≤ C`. Since a, b : ℕ and a > 0, we have a ≥ 1 and b ≥ 1. Combined with a ≤ b ≤ C, this gives 1 ≤ a ≤ b ≤ C. This is consistent with the requirement that the sum is a positive rational ≤ 1. + +6. **Rational arithmetic**: Using ℚ for the equality `∑ n ∈ S, (1 : ℚ) / (n : ℚ) = (a : ℚ) / (b : ℚ)` is the right choice. It avoids real-number subtleties and gives exact equality. Note that `(a : ℚ) / (b : ℚ)` is definitionally equal to the rational a/b regardless of whether the fraction is in lowest terms—this is correct because if the sum equals p/q in lowest terms, we can witness a = p, b = q. + +7. **The `a ≤ b` constraint**: This restricts the sum to values ≤ 1. For subsets of {1,...,N}, sums can exceed 1 (e.g., {1, 2} gives 3/2). The constraint means we seek a subset whose reciprocal sum is a "small" fraction ≤ 1 with bounded denominator. This faithfully matches the original problem statement's "a ≤ b". + +8. **C is a natural number**: This is slightly stronger than necessary (C could be real-valued in the O_α notation), but since a, b : ℕ and b ≤ C, having C : ℕ is the natural choice and loses nothing. + +9. **Tag**: `@[category research solved, AMS 5 11]` — correct. The problem is solved (by Liu-Sawhney via Bloom). + +**Potential concern**: The fraction a/b is not required to be in lowest terms. This is not a problem: if the sum equals p/q (lowest terms) with q ≤ C, we can set a = p, b = q, satisfying all constraints. Not requiring lowest terms makes the existential (very slightly) easier to satisfy but does not change the mathematical content. + +**Verdict**: The formalization is **correct and complete**. No mathematical flaws identified. The Lean statement faithfully and precisely captures the Erdős-Graham conjecture as stated on the website and in the literature. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No strong reuse opportunity; minor style alignment possible (`Finset.Icc`) | +| Citations | Complete and consistent with erdosproblems.com | +| Variants | Original conjecture captured; quantitative sharp bound is optional | +| Readability | Excellent | +| Formalizability | Very low ambiguity; straightforwardly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/311.md b/ai-review/311.md new file mode 100644 index 0000000000..0e6d15285e --- /dev/null +++ b/ai-review/311.md @@ -0,0 +1,98 @@ +# Review: Erdős Problem 311 + +**File:** `FormalConjectures/ErdosProblems/311.lean` + +## 1. Code Reuse + +Several related problems in the codebase deal with unit fraction sums over subsets of {1, …, N}: + +- **Problem 296** (`296.lean`): Defines `reciprocalSum (A : Finset ℕ) : ℚ := ∑ n ∈ A, (1 : ℚ) / n`. This works over ℚ rather than ℝ, so it is not directly reusable here (Problem 311 needs ℝ for the absolute value and exponential bounds). +- **Problem 300** (`300.lean`): Defines `Egyptian1Free`, which is thematically close (subsets of {1,…,N} whose unit fraction sums avoid 1). The pattern `∑ n ∈ S, (1 : ℝ) / n` with `S ⊆ Finset.Icc 1 N` is identical to what appears in 311's `unitFractionDeviation`. +- **Problems 308, 310**: Also use the same `∑ n ∈ S, (1 : ℚ) / n` pattern over `Finset.Icc 1 N`. + +**Assessment:** There is no shared `reciprocalSum` definition over ℝ in the codebase; each problem inlines its own sum expression. A shared utility could reduce duplication, but the overhead of a shared definition may not be justified given that each problem uses the sum in a slightly different context (equality to 1 in 300, ratio a/b in 310, deviation from 1 in 311). The `unitFractionDeviation` definition is specific to this problem and cannot be replaced. **No actionable reuse issue.** + +## 2. Citations + +The formalization cites: +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980), p. 40. + +The website (erdosproblems.com/311) lists the same source: **[ErGr80, p.40]**. + +The website also mentions two additional contributors not cited in the formalization: +- **Vjekoslav Kovac**: Showed that the original [ErGr80] variant (which required A to contain no subset S with ∑1/n = 1) is equivalent to the simpler formulation used here. +- **Quanyu Tang**: Proved the upper bound δ(N) ≤ exp(−c · N / (log N · log log N)³) for some c > 0. + +These are progress notes rather than the problem source, so omitting them from the citation block is acceptable. However, Kovac's equivalence observation is mathematically relevant since the formalization uses the simpler (equivalent) form — a brief note acknowledging this equivalence would strengthen the docstring. + +**Recommendation:** Consider adding a note that the original [ErGr80] formulation included an Egyptian-1-free restriction on A, and that Kovac showed the two formulations are equivalent. + +## 3. Variants + +The website explicitly describes one variant: + +- **Original [ErGr80] variant:** Minimize |1 − ∑ 1/n| over subsets A ⊆ {1,…,N} with the additional constraint that no subset S ⊆ A has ∑_{n∈S} 1/n = 1 (i.e., A is Egyptian-1-free). + +Kovac demonstrated this variant is equivalent to the simpler formulation (without the Egyptian-1-free restriction). The formalization correctly uses the simpler form. + +**Assessment:** The relevant variant is captured via equivalence. No missing variants. + +## 4. Readability + +The code is clean and well-organized: +- The `unitFractionDeviation` definition has a clear docstring with LaTeX. +- The theorem docstring explains the equivalence between the asymptotic notation δ(N) = e^{−(c+o(1))N} and the ε-based sandwich formulation. +- The namespace `Erdos311` is appropriately scoped. +- `open Real` at the top is appropriate for `exp`. + +**Minor suggestions:** +- The definition name `unitFractionDeviation` is descriptive. The docstring could mention that for finite N this is actually a minimum (not just an infimum), since the set of subsets is finite. This is mathematically obvious but could aid readability. + +**Assessment:** Highly readable. No significant issues. + +## 5. Formalizability + +The original problem statement is: *"Is it true that δ(N) = e^{−(c+o(1))N} for some constant c ∈ (0,1)?"* + +This involves: +1. **δ(N)** — the minimum nonzero value of |1 − ∑ 1/n| over subsets of {1,…,N}. This is precisely formalizable and correctly captured by `unitFractionDeviation`. +2. **Asymptotic notation e^{−(c+o(1))N}** — the o(1) term must be unpacked. The formalization correctly interprets this as: for all ε > 0, for sufficiently large N, exp(−(c+ε)N) ≤ δ(N) ≤ exp(−(c−ε)N). This is the standard ε-δ unwinding of the asymptotic. + +**Assessment:** The problem is unambiguously formalizable. The asymptotic notation has a single standard interpretation, and the formalization correctly captures it. **Low ambiguity.** + +## 6. Correctness + +### Definition correctness + +`unitFractionDeviation` uses `sInf` over `{ x : ℝ | x > 0 ∧ ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ x = |1 - ∑ n ∈ A, (1 : ℝ) / n| }`. + +- **Well-definedness:** The set of subsets of {1,…,N} is finite, so the image set of |1 − ∑ 1/n| values is finite. The subset of positive values is non-empty for all N (taking A = ∅ gives |1 − 0| = 1 > 0). Thus `sInf` returns the actual minimum — no issues with Mathlib's convention that `sInf ∅ = 0`. +- **Faithfulness:** The definition faithfully captures "the minimal non-zero value of |1 − ∑ 1/n|" as described in the problem. + +### Theorem correctness + +The conjecture `∃ c ∈ (0,1), ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, exp(−(c+ε)N) ≤ δ(N) ≤ exp(−(c−ε)N)`: + +- **Upper bound (vacuous for large ε):** When ε ≥ c, we have c − ε ≤ 0, so exp(−(c−ε)N) ≥ 1 ≥ δ(N). The upper bound becomes vacuous but remains true. This is correct behavior — no mathematical issue. +- **Consistency with known bounds:** The trivial lower bound δ(N) ≥ 1/lcm(1,…,N) = e^{−(1+o(1))N} (from the prime number theorem) is consistent with c ≤ 1. The conjecture c < 1 strictly asserts that δ(N) is not as small as the lcm bound. +- **Use of `answer(sorry)`:** Appropriate for an open problem whose truth value is unknown. +- **Coercions:** The implicit ℕ → ℝ coercion on N in `exp(-(c + ε) * N)` is standard and correct. + +### Potential subtlety + +One subtlety worth noting: the `sInf` formulation defines δ(N) as the infimum of a set described by existential quantification over A. An alternative formulation could define it as `Finset.inf'` over the powerset, which would make the "minimum" nature explicit and avoid any reliance on `sInf` properties. However, the current formulation is mathematically equivalent and arguably more natural. + +**Assessment:** The formalization is mathematically correct and complete. No flaws identified. An experienced mathematician would agree with the formalization. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ Good | No actionable reuse; definition is problem-specific | +| Citations | ⚠️ Minor | Source [ErGr80] is correct; could note Kovac's equivalence result | +| Variants | ✅ Good | Original variant is equivalent; correctly uses simpler form | +| Readability | ✅ Good | Clean, well-documented | +| Formalizability | ✅ Good | Unambiguous; standard asymptotic unwinding | +| Correctness | ✅ Good | Mathematically correct and faithful | + +**Overall: Strong formalization with one minor citation suggestion.** diff --git a/ai-review/314.md b/ai-review/314.md new file mode 100644 index 0000000000..4d716898f1 --- /dev/null +++ b/ai-review/314.md @@ -0,0 +1,130 @@ +# Review: Erdős Problem 314 + +**File:** `FormalConjectures/ErdosProblems/314.lean` + +## 1. Code Reuse + +Several related problems use partial sums of reciprocals over `Finset.Icc`: + +- **Problem 308** (`308.lean`): Uses `∑ n ∈ S, (1 : ℚ) / (n : ℚ)` for unit fraction representations over {1,…,N}. Works over ℚ, not ℝ. +- **Problem 316** (`316.lean`): Uses `∑ n ∈ A, (1 / n : ℚ)` for partition problems on unit fractions. Also over ℚ. +- **Problem 309** (`309.lean`), **Problem 290/291**: Similar harmonic-series-style sums. + +Problem 314 uses `∑ k ∈ Finset.Icc n m, (1 : ℝ) / (k : ℝ)` — a partial harmonic sum over ℝ starting at general n. No existing shared utility for this pattern exists. The definitions `erdos314M` and `erdos314Epsilon` are intrinsically problem-specific (finding the minimal m achieving a harmonic tail sum ≥ 1 and measuring the overshoot). There is no meaningful code reuse opportunity. + +**Assessment:** No actionable reuse issue. + +## 2. Citations + +The formalization cites: +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- **[LiSt24]** Lim, T. and Steinerberger, S., *On a problem of Erdős and Graham* (2024). + +The website ([erdosproblems.com/314](https://www.erdosproblems.com/314)) lists: +- **[ErGr80, p.41]** — the original source. +- **[LiSt24]** — the solution. + +The formalization omits the page number (p.41) from the [ErGr80] reference. Otherwise the citations match the website. + +**Recommendation:** Add `p. 41` to the [ErGr80] citation for precision. + +## 3. Variants + +The website describes two aspects beyond the main question: + +1. **Main question (solved):** Is $\liminf n^2 \varepsilon(n) = 0$? — Yes, proved by Lim–Steinerberger. This is formalized as `erdos_314`. + +2. **Quantitative rate (Lim–Steinerberger):** For any $\delta > 0$, there exist infinitely many $n$ with $n^2 |\sum_{k=n}^{m} 1/k - 1| \ll 1/(\log n)^{5/4-\delta}$. This is mentioned in the docstring but **not formalized**. This is a strictly stronger result than the main theorem and could be a valuable additional lemma. + +3. **Optimality conjecture (open):** $\liminf \varepsilon(n) n^{2+\delta} = \infty$ for all $\delta > 0$. This is mentioned in the docstring but **not formalized**. This is a natural companion conjecture asserting that the exponent 2 is best possible. + +**Assessment:** The main solved problem is formalized. Two natural companion statements (the quantitative rate and the optimality conjecture) are documented in the docstring but not formalized. Formalizing the optimality conjecture would be especially natural, as it is an open problem attributed to Erdős–Graham and reiterated by Lim–Steinerberger. + +**Recommendation:** Consider adding a formalization of the optimality conjecture: +```lean +@[category research open, AMS 11 40] +theorem erdos_314_optimality (δ : ℝ) (hδ : 0 < δ) : + Tendsto (fun n => (n : ℝ) ^ (2 + δ) * erdos314Epsilon n) atTop atTop := by + sorry +``` + +## 4. Readability + +The code is clean and well-structured: + +- **Namespace:** `Erdos314` is appropriately scoped. +- **Helper lemma:** `exists_harmonic_partial_sum_ge_one` is factored out as a prerequisite for the `Nat.find` construction. Its docstring explains the mathematical motivation (divergence of the harmonic series). Good. +- **Definition names:** `erdos314M` and `erdos314Epsilon` are descriptive. The convention of prefixing with the problem number avoids namespace clashes. +- **Docstrings:** The module docstring gives the full mathematical context, including the Lim–Steinerberger result and the optimality conjecture. The theorem docstring provides the "equivalently" reformulation, bridging the liminf statement and the formalized ε-δ version. This is helpful. +- **Edge case handling:** `erdos314M` returns 0 for n = 0, documented in the docstring. Clean. + +**Minor observations:** +- The `open` line uses `Classical` — this is presumably needed for `Nat.find` (or for decidability instances). Correct but could be narrowed to `open Classical` only if needed. +- The `Finset.Icc` in the sum could equivalently be written `Icc n m` given `open Finset`, which is already done. Consistent. + +**Assessment:** Highly readable. No significant issues. + +## 5. Formalizability + +The problem statement is: *"Is it true that $\liminf_{n \to \infty} n^2 \varepsilon(n) = 0$?"* + +This requires formalizing: + +1. **$m(n)$:** The minimal $m$ such that $\sum_{k=n}^{m} 1/k \geq 1$. This requires the harmonic series to diverge (for existence). The formalization correctly handles this via `exists_harmonic_partial_sum_ge_one` + `Nat.find`. + +2. **$\varepsilon(n)$:** The overshoot $\sum_{k=n}^{m(n)} 1/k - 1$. Directly defined. + +3. **$\liminf = 0$:** The formalization unpacks this as: for every $\delta > 0$ and every $N_0$, there exists $n \geq N_0$ with $n \geq 1$ such that $n^2 \varepsilon(n) < \delta$. This is the standard ε-δ characterization of $\liminf = 0$ for a non-negative sequence. Since $\varepsilon(n) \geq 0$ by construction (as $m(n)$ is the minimal $m$ with partial sum $\geq 1$), requiring $n^2 \varepsilon(n) < \delta$ is equivalent to $\liminf n^2 \varepsilon(n) = 0$. + +**Assessment:** The problem is unambiguously formalizable. The formalization correctly unwraps the $\liminf$ condition. **Low ambiguity.** + +## 6. Correctness + +### Definition: `exists_harmonic_partial_sum_ge_one` + +The statement asserts: for $n \geq 1$, there exists $m$ such that $\sum_{k \in \text{Icc}(n, m)} 1/k \geq 1$. This follows from the divergence of the harmonic series. Mathematically correct. + +### Definition: `erdos314M` + +Uses `Nat.find` to find the minimal such $m$. Returns 0 for $n = 0$ (a junk value, since the problem is only meaningful for $n \geq 1$). The use of `Nat.find` is appropriate — it searches over natural numbers and returns the first witness. + +**Subtlety:** `Nat.find` searches from 0 upward. For the predicate `fun m => 1 ≤ ∑ k ∈ Finset.Icc n m, 1/k`, when $m < n$, the sum is empty (equals 0), so the predicate fails. Thus `Nat.find` will correctly skip values $m < n$ and find the true minimal $m \geq n$. Correct. + +### Definition: `erdos314Epsilon` + +$\varepsilon(n) = \sum_{k \in \text{Icc}(n, m(n))} 1/k - 1$. By construction of $m(n)$, the sum is $\geq 1$, so $\varepsilon(n) \geq 0$. Correct. + +**Important observation:** The formalization defines $\varepsilon(n)$ for all $n : \mathbb{N}$, including $n = 0$. For $n = 0$, $m(0) = 0$, so the sum is $\sum_{k \in \text{Icc}(0, 0)} 1/k = 1/0 = 0$ (since division by zero in Lean/Mathlib gives 0), yielding $\varepsilon(0) = -1$. This is a junk value but is irrelevant since the theorem only quantifies over $n$ with $1 \leq n$. + +### Theorem: `erdos_314` + +```lean +theorem erdos_314 : answer(True) ↔ + (∀ δ : ℝ, 0 < δ → ∀ N₀ : ℕ, ∃ n : ℕ, N₀ ≤ n ∧ 1 ≤ n ∧ + (n : ℝ) ^ 2 * erdos314Epsilon n < δ) := by sorry +``` + +- **`answer(True)`:** The problem is marked as solved in the affirmative. This is correct per the Lim–Steinerberger result. +- **Unpacking the liminf:** The RHS says: for every $\delta > 0$ and every $N_0$, there exists $n \geq N_0$ with $n \geq 1$ and $n^2 \varepsilon(n) < \delta$. This is exactly the condition $\liminf_{n \to \infty} n^2 \varepsilon(n) = 0$ (for a non-negative sequence, $\liminf = 0$ iff for every $\delta > 0$, the sequence is below $\delta$ infinitely often). +- **Non-negativity:** The formalization doesn't explicitly assert $\varepsilon(n) \geq 0$, but this follows from the construction. Combined with the $< \delta$ bound, the $\liminf = 0$ equivalence is valid. If $\varepsilon(n)$ could be negative, one would need $|n^2 \varepsilon(n)| < \delta$, but non-negativity makes this unnecessary. Correct. +- **AMS classification:** `AMS 11 40` (Number Theory, Sequences/Series). The primary AMS code should be 11 (Number Theory). Including 40 (Sequences, Series, Summability) is reasonable. Correct. +- **Category:** `research solved`. Correct — the problem was open and has been solved. + +### Overall mathematical assessment + +The formalization is faithful to the problem as stated on erdosproblems.com. The key mathematical steps — defining the minimal overshoot $m(n)$, the excess $\varepsilon(n)$, and unwinding the $\liminf = 0$ condition — are all handled correctly. An experienced number theorist would not find any flaws in this formalization. + +**Assessment:** Mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ Good | No reusable components; definitions are problem-specific | +| Citations | ⚠️ Minor | Missing page number (p.41) for [ErGr80] | +| Variants | ⚠️ Minor | Optimality conjecture ($\liminf \varepsilon(n) n^{2+\delta} = \infty$) not formalized | +| Readability | ✅ Good | Clean, well-documented, good helper factoring | +| Formalizability | ✅ Good | Unambiguous; standard liminf unwinding | +| Correctness | ✅ Good | Mathematically correct and faithful | + +**Overall: Strong formalization. Two minor suggestions: (1) add page number to [ErGr80] citation, (2) consider formalizing the open optimality conjecture as a companion statement.** diff --git a/ai-review/315.md b/ai-review/315.md new file mode 100644 index 0000000000..ece3951b92 --- /dev/null +++ b/ai-review/315.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 315 + +## 1. Code Reuse + +**Sylvester sequence definitions.** The `sylvesterU` and `sylvesterSeq` definitions in `315.lean` are self-contained and do not duplicate any existing code in the repository. However, Problem 293 (`FormalConjectures/ErdosProblems/293.lean`) references the Vardi constant c₀ in its upper bound theorem (`erdos_293.variants.upper_bound`) but defines it only abstractly as an existential `∃ c₀ : ℝ, 1 < c₀ ∧ ...`. There is a missed opportunity to share the Sylvester sequence definitions between Problems 315 and 293 — Problem 293's upper bound is directly tied to the Sylvester sequence, and making this connection explicit (e.g., by importing or referencing the Sylvester sequence from 315) would improve mathematical coherence across the two files. + +**Growth rate pattern.** Problem 265 (`FormalConjectures/ErdosProblems/265.lean`) uses the nearly identical expression `a n ^ (1 / 2 ^ n)` but with `Tendsto` instead of `Filter.liminf`. No shared utility for "doubly exponential growth rate" exists in `FormalConjectures/Util/`, though the pattern recurs across at least Problems 265, 293, and 315. A shared definition is not strictly necessary but could be considered if more problems use this pattern. + +**Egyptian fraction infrastructure.** Problems 206, 282, 287, 293, 296, 300, and 305 all work with Egyptian fractions in various forms (finite sums via `Finset`, infinite sums via `HasSum`, greedy algorithms). Each defines its own ad-hoc infrastructure. Problem 315's use of `HasSum (fun n => (1 : ℝ) / (a n : ℝ)) 1` is standard and consistent with the existing codebase conventions — no better alternative exists in `FormalConjecturesForMathlib/`. + +## 2. Citations + +The website ([erdosproblems.com/315](https://www.erdosproblems.com/315)) lists the following references: + +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique (1980), p. 41. +- **[Ka25]** — Kamio (2025). +- **[LiTa25]** — Li and Tang (2025). + +**Issues:** +- The docstring header says `[Ka25] Kamio, 2025.` and `[LiTa25] Li and Tang, 2025.` — these match the website's level of detail, which is acceptable given these appear to be recent preprints without full publication metadata. +- The docstring on `erdos_315` says "Erdős–Graham, 1980" but does not include the `[ErGr80]` citation tag or the page number (p. 41). For consistency with other files in the codebase (e.g., Problems 265, 282, 293 which all cite `[ErGr80]` with page numbers), the docstring should be updated to include `[ErGr80, p.41]`. +- The module-level docstring header lists references but the theorem-level docstring does not cross-reference them with tags like `[ErGr80]`. This is a minor inconsistency with files like 293.lean which do use bracketed tags in theorem docstrings. + +## 3. Variants + +The website does not list explicit variants of Problem 315. The formalization captures the single main conjecture: the Sylvester sequence uniquely maximizes `liminf a_n^{1/2^n}` among all Egyptian fraction representations of 1. + +**Potential variants not captured:** +- The website notes a connection to OEIS A000058 and A076393. No OEIS cross-references appear in the formalization. +- One could state the weaker result that the limit of `sylvesterSeq n ^ (1/2^n)` exists (i.e., the Vardi constant is well-defined) as a separate lemma. This is a prerequisite for the main conjecture and is mathematically interesting in its own right. +- The recurrence `s_{n+1} = s_n^2 - s_n + 1` is stated in the docstring but not formalized as a lemma about `sylvesterSeq`. Adding `theorem sylvesterSeq_recurrence (n : ℕ) : sylvesterSeq (n + 1) = sylvesterSeq n ^ 2 - sylvesterSeq n + 1` would be a useful sanity-check and would directly connect the two characterizations. +- The telescoping property `∑ 1/s_n = 1` is claimed in the docstring but not formalized. A lemma `HasSum (fun n => (1 : ℝ) / (sylvesterSeq n : ℝ)) 1` would strengthen the formalization and verify the definitions are consistent. + +**Assessment:** The main conjecture is fully captured. The absence of supporting lemmas (Vardi constant existence, telescoping sum, recurrence) is a minor gap — these are mathematically elementary consequences of the definition but would add rigor and documentation value. + +## 4. Readability + +**Strengths:** +- The `sylvesterU` / `sylvesterSeq` factoring is clean and well-documented. The docstrings give explicit initial terms. +- The namespace `Erdos315` avoids polluting the global scope. +- The `open Filter` and `open scoped Topology` are minimal and appropriate. + +**Suggestions:** +- The `liminf` expression `Filter.liminf (fun n => ((a n : ℝ)) ^ ((2 : ℝ) ^ (n : ℕ))⁻¹) atTop` has double parentheses around `(a n : ℝ)` that could be simplified to `(a n : ℝ)`. Same for the Sylvester sequence side. +- The exponent `((2 : ℝ) ^ (n : ℕ))⁻¹` could be written as `(1 : ℝ) / (2 : ℝ) ^ (n : ℕ)` for consistency with Problem 265 which uses `(1 : ℝ) / (2 : ℝ) ^ (n : ℕ)`. The current form using `⁻¹` is mathematically equivalent but stylistically divergent from the sibling file. +- Overall readability is good. The code is concise and the mathematical content is clear from the docstrings. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise: +- The Sylvester sequence is a concrete, recursively defined object. ✓ +- "Strictly increasing sequence of positive integers" is standard. ✓ +- "∑ 1/a_n = 1" is a well-defined infinite series convergence statement. ✓ +- "liminf a_n^{1/2^n}" is a standard analytic notion. ✓ +- The Vardi constant c₀ = lim s_n^{1/2^n} is a well-defined real number (the limit exists by standard arguments since log(s_n)/2^n is eventually monotone). ✓ + +The only minor ambiguity is whether the problem asks about `liminf` or `lim` for the competing sequence `a`. The website says "liminf", and the formalization correctly uses `liminf`. For sequences where the limit exists, this is equivalent, but `liminf` is the correct general statement since `lim a_n^{1/2^n}` need not exist for arbitrary sequences. + +**Ambiguity score: 1/5 (essentially unambiguous).** + +## 6. Correctness + +**Mathematical analysis:** + +The formalization is **mathematically correct and complete** for the main conjecture. Detailed verification: + +1. **Sylvester sequence definition.** `sylvesterU 0 = 1`, `sylvesterU (n+1) = sylvesterU n * (sylvesterU n + 1)`. This gives u = 1, 2, 6, 42, 1806, ... Then `sylvesterSeq n = sylvesterU n + 1` gives s = 2, 3, 7, 43, 1807, ... This matches the standard Sylvester sequence (OEIS A000058). ✓ + +2. **Recurrence equivalence.** The docstring claims `s_{n+1} = s_n^2 - s_n + 1`. Check: `sylvesterSeq (n+1) = sylvesterU (n+1) + 1 = sylvesterU n * (sylvesterU n + 1) + 1 = (s_n - 1) * s_n + 1 = s_n^2 - s_n + 1`. ✓ + +3. **Sum property.** The telescoping identity `1/s_n = 1/u_n - 1/u_{n+1}` yields `∑_{n=0}^{N} 1/s_n = 1/u_0 - 1/u_{N+1} = 1 - 1/u_{N+1} → 1`. So `HasSum (...) 1` is correct for the Sylvester sequence. ✓ + +4. **Growth rate / Vardi constant.** The Vardi constant c₀ = lim_{n→∞} s_n^{1/2^n} ≈ 1.264085... is well-established. Using `liminf` for the RHS is equivalent to the limit since the Sylvester sequence's growth rate converges. ✓ + +5. **Conjecture statement.** The formalization states: for any strictly increasing sequence of positive integers with ∑ 1/a_n = 1, if a ≠ sylvesterSeq (pointwise), then liminf a_n^{1/2^n} < liminf sylvesterSeq(n)^{1/2^n}. This is exactly the conjecture from Erdős–Graham: the Sylvester sequence uniquely maximizes the doubly-exponential growth rate. ✓ + +6. **Indexing.** The formalization uses 0-based indexing while the website uses 1-based. This is immaterial — the liminf is unchanged by any finite index shift, and the definitions are internally consistent. ✓ + +7. **`answer(True)` wrapper.** The problem is marked as solved (proved by Kamio [Ka25] and Li–Tang [LiTa25]), so `answer(True)` is correct. ✓ + +8. **Edge case: `a ≠ sylvesterSeq`.** The condition uses Lean's pointwise function inequality `a ≠ sylvesterSeq`, meaning there exists some index where they differ. This is the correct mathematical notion of "other than the Sylvester sequence." ✓ + +**Potential concern (minor):** The `Filter.liminf` in Lean's Mathlib requires the function to be bounded below or uses `⊥` as a default. Since `a n ≥ 1` (positive naturals) and the exponent `1/2^n > 0`, we have `a_n^{1/2^n} ≥ 1` for all n, so the liminf is well-defined and at least 1. This is not an issue in practice, but the formalization implicitly relies on this boundedness. No code change needed. + +**Correctness verdict: Correct and complete. No mathematical flaws identified.** + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor opportunity | Sylvester seq defs could be shared with Problem 293 | +| Citations | Needs minor update | Add `[ErGr80, p.41]` tag to theorem docstring | +| Variants | Adequate | Main conjecture captured; supporting lemmas (sum = 1, recurrence, Vardi constant existence) would add value | +| Readability | Good | Minor: extra parens, inconsistent exponent style vs Problem 265 | +| Formalizability | Excellent | Essentially unambiguous (1/5) | +| Correctness | Excellent | Mathematically correct and complete | diff --git a/ai-review/320.md b/ai-review/320.md new file mode 100644 index 0000000000..fd552c3b53 --- /dev/null +++ b/ai-review/320.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 320 + +## 1. Code Reuse + +Several closely related problems share the same unit-fraction subset-sum construction: + +- **Problem 321** (`ErdosProblems/321.lean`): Defines `R(N)`, the largest subset of `{1,...,N}` with all unit-fraction subset sums distinct. Uses `Set.InjOn (fun (S : Finset ℕ) ↦ ∑ n ∈ S, (1 : ℚ) / n) A.powerset`. The underlying `(1 : ℚ) / n` summation is identical. Problem 321 also formalizes the same Bleicher–Erdős bounds ([BlEr75], [BlEr76b]) using iterated logarithm products `∏ i ∈ Finset.Icc 3 k, (log^[i] N)`. + +- **Problem 297** (`ErdosProblems/297.lean`): Defines `unitFractionSubsetCount N` via `(Finset.Icc 1 N).powerset.filter (...)` — essentially the same powerset-over-unit-fractions construction. The asymptotic `Tendsto ... atTop (nhds c)` pattern is structurally identical to `erdos_320`. + +- **Problem 874** (`ErdosProblems/874.lean`): Uses `powersetCard` with `.image (fun S => S.sum id)` for counting distinct subset sums — a parallel pattern. + +**Recommendation:** A shared definition for the unit-fraction sum `fun (A : Finset ℕ) => A.sum (fun n => (1 : ℚ) / ↑n)` could be extracted to a utility file and reused across Problems 297, 320, and 321. The `unitFractionSums` definition in 320 and the filtering/injection constructions in 297/321 all build on the same primitive. + +## 2. Citations + +**Website (erdosproblems.com/320):** Lists [BlEr75], [BlEr76b], [BGMS25], [ErGr80], and mentions a connection to Problem 321 and OEIS sequence A072207. + +**Formalization:** Lists [BlEr75], [BlEr76b], [BGMS25], [ErGr80] — all present. However: + +- The website notes a relationship to **Problem 321** (a variant). This connection is not mentioned in the formalization docstring. +- The website references **OEIS A072207**. This is not mentioned. +- **[BGMS25]** is cited in the docstring with only author names and year, but no title. The full title should be included (or at minimum the arXiv identifier) for completeness, consistent with how [BlEr75] and [BlEr76b] are cited with titles. +- The docstring for [BlEr75] says *"Denominators of unit fractions"* but the actual paper title (as cited in Problem 321) is *"The number of distinct subsums of ∑₁ᴺ 1/i"*. The 321 citation appears more accurate. The "Denominators of unit fractions" title actually belongs to a different Bleicher–Erdős paper. + +## 3. Variants + +The formalization only includes one statement: the main asymptotic conjecture. + +**Missing variants:** +- **Known lower bound** (Bleicher–Erdős 1975): log S(N) ≥ (N/log N) · log 2 · ∏_{i=3}^{k} log_i N. Problem 321 formalizes analogous bounds for R(N); Problem 320 should do the same for S(N). +- **Known upper bound** (Bleicher–Erdős 1976): log S(N) ≤ (N/log N) · log_r N · ∏_{i=3}^{r} log_i N. +- **Improved lower bound** (BGMS25): log S(N) ≥ (N/log N) · 2 log 2 · (1 − 3/(2 log_k N)) · ∏_{i=3}^{k} log_i N. +- **Connection to R(N):** S(N) ≥ 2^{R(N)}, linking this problem to Problem 321. This structural relationship could be formalized. +- Problem 321 includes `IsTheta`, `IsBigO`, `IsLittleO` asymptotic variants; Problem 320 could benefit from similar treatment (if the main conjecture is corrected). + +## 4. Readability + +The code is clear and well-structured. The `unitFractionSums` and `erdos320_S` definitions are appropriately separated and documented. The module docstring provides good mathematical context with known bounds. + +Minor suggestions: +- The theorem name `erdos_320` is consistent with the codebase convention. +- The `open Filter` and `open scoped Topology` are appropriate for the `Tendsto`/`nhds` usage. + +## 5. Formalizability + +The original problem statement — "Estimate S(N)" — is deliberately vague and open-ended. It asks for an asymptotic estimate, not a precise value. This makes direct formalization inherently ambiguous. + +The formalization resolves this ambiguity by conjecturing a specific asymptotic form: log S(N) / ((N/log N) · log log N) → L for some L > 0. This is a reasonable *type* of formalization (asserting a precise growth rate), but the specific growth rate chosen is problematic (see §6). + +**Ambiguity assessment:** Moderate. The problem is an estimation problem, so any formalization must commit to a specific conjectured asymptotic. The choice of normalization is where mathematical judgment is required, and this is where the current formalization errs. + +## 6. Correctness + +**CRITICAL ISSUE: The formalization appears mathematically incorrect.** + +The theorem `erdos_320` asserts: + +``` +∃ L : ℝ, 0 < L ∧ Tendsto + (fun N => log S(N) / ((N / log N) * log (log N))) + atTop (nhds L) +``` + +This claims log S(N) ~ L · (N / log N) · log log N for some finite positive L. However, the **known lower bound** (Bleicher–Erdős 1975, documented in the file's own docstring) already disproves this: + +For any fixed k ≥ 4 with log_k(N) ≥ k: + +> log S(N) ≥ (N/log N) · log 2 · ∏_{i=3}^{k} log_i(N) + +Taking k = 4 (valid for sufficiently large N): + +> log S(N) ≥ (N/log N) · log 2 · log log N · log log log N + +Therefore: + +> log S(N) / ((N/log N) · log log N) ≥ log 2 · log log log N → ∞ + +The ratio that the formalization claims converges to a finite limit **actually diverges to infinity**. The known lower bound contradicts the conjectured asymptotic. The BGMS25 improved lower bound (with factor 2 log 2) only strengthens this conclusion. + +**The correct asymptotic** should involve the full product of iterated logarithms, not just log log N. The normalization should be something like: + +> log S(N) / ((N/log N) · ∏_{i=3}^{k(N)} log_i(N)) + +where k(N) is chosen optimally (the largest k such that log_k(N) exceeds some threshold). This is consistent with how the bounds in Problem 321 are formalized using `∏ i ∈ Finset.Icc 3 k, (log^[i] N)`. + +**The incorrectness is not attributable to ambiguity in the problem statement.** While "Estimate S(N)" is vague, the specific conjecture chosen contradicts established results that are cited in the formalization's own docstring. + +**Recommended fix:** Either: +1. Replace the main conjecture with separate formalizations of the known upper and lower bounds (as Problem 321 does), or +2. Conjecture an asymptotic involving the iterated logarithm product, e.g., that there exists a constant C such that log S(N) ~ C · (N/log N) · ∏_{i=3}^{k(N)} log_i(N), which would be consistent with the known bounds (the gap between upper and lower bounds is a single iterated-log factor). diff --git a/ai-review/322.md b/ai-review/322.md new file mode 100644 index 0000000000..3b054890c8 --- /dev/null +++ b/ai-review/322.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 322 + +## 1. Code Reuse + +**Significant overlap with Erdős 323.** Problem 323 defines `IsSumOfKthPowers k m n` (a predicate for representability as a sum of `m` k-th powers) and `fKm k m x` (counting representable numbers up to `x`). Problem 322's `kthPowerReps` counts the *number of representations* rather than whether a representation exists, so these are related but distinct: `kthPowerReps` is a counting function on ordered tuples, while `IsSumOfKthPowers` is an existential predicate. + +That said, `kthPowerReps` could potentially be defined in terms of the convolution infrastructure in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`. The `sumConv` operation computes `∑_{a+b=n} f(a)g(b)`, and a k-fold iterated convolution of the indicator function of k-th powers would yield exactly `kthPowerReps`. However, the current `sumConv` is only 2-fold (binary convolution), so expressing a general k-fold convolution would require additional infrastructure. The current direct definition via `Finset.filter` on `Fin k → Fin (n + 1)` is self-contained and reasonable. + +**No immediate reuse opportunity** that would simplify the current code without first building k-fold convolution machinery. + +## 2. Citations + +The website ([erdosproblems.com/322](https://www.erdosproblems.com/322)) lists the following references: + +- **[Ma36]** Mahler, 1936 — disproved Hypothesis K for k = 3 +- **[Er36]** Erdős, 1936 +- **[ErGr80]** Erdős and Graham, 1980, *Old and new problems and results in combinatorial number theory* +- **[Er65b]** Erdős, 1965 +- **[Gu04]** Guy, 2004 +- OEIS sequences: A025456, A025418 + +The formalization's docstring mentions Mahler's result and Hypothesis K but does not cite specific references by tag. The sibling problem 323 includes a proper `[ErGr80]` citation. **Recommendation:** Add explicit citation tags, at minimum `[ErGr80]` (the primary source) and `[Ma36]` (for the Mahler result mentioned in the docstring). + +## 3. Variants + +The website describes several related aspects: + +1. **Main conjecture (formalized):** For each k ≥ 3, does there exist c > 0 and infinitely many n with 1_A^(k)(n) > n^c? ✅ Captured. +2. **Hypothesis K:** Hardy-Littlewood's conjecture that 1_A^(k)(n) ≤ n^{o(1)} — mentioned in docstring but not formalized separately. This is more of historical context than a variant. +3. **Hypothesis K\*:** A weaker conjecture that ∑_{n≤N} 1_A^(k)(n)² ≪_ε N^{1+ε}. This is mentioned on the website but **not captured** in the formalization. +4. **Erdős-Chowla result:** For all k ≥ 3, infinitely many n satisfy 1_A^(k)(n) ≫ n^{c/log log n}. This is a known result, not a conjecture, so omission is acceptable. +5. **Erdős's claim about positive-density subsets:** If B is the set of k-th powers of a positive-density set, then lim sup 1_B^(k)(n) = ∞. This is described as an unpublished claim on the website and could be considered a variant. + +**Assessment:** The main conjecture is captured. Hypothesis K* is a notable related conjecture mentioned on the website that is not formalized, but it is arguably a separate problem rather than a variant of 322. The coverage is adequate. + +## 4. Readability + +The code is well-structured and readable. A few observations: + +- The definition of `kthPowerReps` is clear: it counts tuples `f : Fin k → Fin (n + 1)` whose k-th power sum equals n. The bound `Fin (n + 1)` is well-motivated (since a_i^k ≤ n implies a_i ≤ n for k ≥ 1). +- The docstring on `kthPowerReps` clearly explains the mathematical content. +- The module docstring provides good context about Hardy-Littlewood Hypothesis K and Mahler's counterexample. +- The theorem statement reads naturally: for all k ≥ 3, there exists c > 0 such that for all N, there exists n ≥ N with kthPowerReps k n > n^c. + +**Minor suggestion:** The notation `1_A^{(k)}(n)` in the docstring is standard in additive number theory but may be unfamiliar to some readers. A brief clarification that this is the k-fold additive representation function is already provided, which is good. + +Overall readability is **good**. + +## 5. Formalizability + +The problem as stated on the website is precise and clearly formalizable: + +- "the number of representations of n as a sum of k many k-th powers" is unambiguous (ordered tuples of nonneg integers) +- "there exist c > 0 and infinitely many n such that..." is a standard quantifier structure +- The only potential ambiguity is whether the representations are **ordered** or **unordered** (i.e., do we count (1,2,3) and (3,2,1) as different?). The formalization uses ordered tuples (`Fin k → Fin (n+1)`), which matches the standard convention for 1_A^(k)(n) in additive number theory. + +**Ambiguity assessment: Low.** The statement is well-defined. + +However, one subtle point: the `answer(sorry)` wrapper means this is formalized as a true/false question ("is it the case that...?"). Since the problem is listed as open, this is appropriate — the conjecture is that the answer is "yes" (i.e., `answer(sorry) = True`), but the `answer` mechanism correctly captures the uncertainty. + +## 6. Correctness + +**Mathematical analysis of the formalization:** + +The core definition: +```lean +noncomputable def kthPowerReps (k n : ℕ) : ℕ := + (Finset.univ.filter (fun f : Fin k → Fin (n + 1) => + (∑ i, (f i : ℕ) ^ k) = n)).card +``` + +This counts the number of ordered k-tuples (a₁, ..., aₖ) ∈ {0, 1, ..., n}^k with a₁^k + ... + aₖ^k = n. This is mathematically correct as a formalization of 1_A^(k)(n). + +**Bound correctness:** The upper bound `n + 1` on each component is correct: if aᵢ^k ≤ n and k ≥ 1, then aᵢ ≤ n. (For k = 0, the definition is degenerate but the conjecture only considers k ≥ 3.) + +**Edge case — k = 0:** `kthPowerReps 0 n` would compute over `Fin 0 → Fin (n+1)`, which is a singleton (the empty function), with sum `∑ i : Fin 0, ...` = 0. So `kthPowerReps 0 n` = 1 if n = 0, else 0. This is fine since the theorem restricts to k ≥ 3. + +**Edge case — n = 0:** `kthPowerReps k 0` counts tuples in `Fin k → Fin 1`, i.e., the constant-zero function. The sum is 0^k * k. For k ≥ 1, 0^k = 0, so the sum is 0 = n. Thus `kthPowerReps k 0 = 1` for k ≥ 1. This is correct (the all-zeros tuple). + +**The theorem statement:** +```lean +theorem erdos_322 : + answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → + ∃ c : ℝ, 0 < c ∧ + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ (kthPowerReps k n : ℝ) > (n : ℝ) ^ c := by + sorry +``` + +This states: for every k ≥ 3, there exists c > 0 such that for infinitely many n (formalized as "for all N, there exists n ≥ N"), kthPowerReps(k, n) > n^c. + +**Potential issue:** When n = 0, `(n : ℝ) ^ c = 0^c = 0` for c > 0, and `kthPowerReps k 0 = 1 > 0`. So n = 0 trivially satisfies the inequality. This means the "infinitely many" condition is really about finding arbitrarily large n, which is exactly what the `∀ N, ∃ n, N ≤ n` quantifier structure ensures. So n = 0 doesn't cause a vacuous satisfaction problem — the universal quantifier over N forces unboundedly large witnesses. + +**Correctness verdict: Correct.** The formalization faithfully captures the mathematical content of Erdős Problem 322. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | No immediate reuse opportunity; related code exists in 323 and Convolution.lean but serves different purposes | +| Citations | Missing explicit reference tags; should add [ErGr80] and [Ma36] | +| Variants | Main conjecture captured; Hypothesis K* not formalized but arguably separate | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/323.md b/ai-review/323.md new file mode 100644 index 0000000000..2904505e5a --- /dev/null +++ b/ai-review/323.md @@ -0,0 +1,145 @@ +# AI Review: Erdős Problem 323 + +## 1. Code Reuse + +**Strong overlap with Problem 325.** Problem 325 defines `IsSumThreePower k n` (∃ a b c, a^k + b^k + c^k = n) and `cardIsSumThreePowerBelow k x`, which is exactly the special case m = 3 of Problem 323's `IsSumOfKthPowers k 3 n` and `fKm k 3 x`. The two definitions are mathematically equivalent: + +- `IsSumThreePower k n` ↔ `IsSumOfKthPowers k 3 n` (three named variables vs. `Fin 3 → ℕ`) +- `cardIsSumThreePowerBelow k x` = `fKm k 3 x` (both count naturals ≤ x representable as sums of three k-th powers, though 325 uses `Set.Iic`/`ncard` while 323 uses `Finset.range`/`card`) + +Problem 325's main conjecture (`erdos_325`) — that f_{k,3}(x) ≫ x^{3/k} for k ≥ 3 — is a special case of Part 2 of Problem 323 (with m = 3 and k ≥ 3 > 3 = m). **Recommendation:** Problem 325 should import and reuse Problem 323's definitions to avoid redundancy. + +**Relationship with Problem 322.** Problem 322 defines `kthPowerReps k n`, counting the *number of representations* of n as a sum of k k-th powers (ordered tuples). Problem 323's `IsSumOfKthPowers` is the existential version (does at least one representation exist?). These are related but distinct: 322 counts representations, 323 counts representable numbers. No direct reuse opportunity, though a shared definition for sums of k-th powers could unify the existential check. + +**`FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`** defines `IsAddBasisOfOrder` and `IsAsymptoticAddBasisOfOrder`, which capture whether a set is an additive basis (every/cofinitely-many element is a sum of n elements from the set). These are conceptually related — the set of k-th powers being an asymptotic additive basis of order m would mean that *all sufficiently large* n are sums of m k-th powers, which is Waring's problem. Problem 323 asks a weaker question about the *density* of representable numbers rather than whether all large numbers are representable. No direct reuse applies. + +**`FormalConjecturesForMathlib/Data/Set/Density.lean`** defines `upperDensity`, `lowerDensity`, and `HasPosDensity`. Part 1 of Problem 323 (f_{k,k}(x) ≫_ε x^{1-ε}) is essentially asserting that the set of sums of k k-th powers has "density 1 in a strong sense" (the counting function grows nearly as fast as x). One could potentially express Part 1 as a density statement, but the formalization's explicit asymptotic lower bound is more precise and standard. + +## 2. Citations + +**Website ([erdosproblems.com/323](https://www.erdosproblems.com/323))** lists: +- **[ErGr80]** Erdős and Graham, 1980, *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique. + +The formalization's docstring includes: +- Reference link to erdosproblems.com/323 ✅ +- [ErGr80] with full author names, title, and publication venue ✅ + +The website also mentions: +- **Landau's result** for k = 2: f_{2,2}(x) ~ cx/√(log x). This is described in the website text but not cited with a specific reference tag. The formalization does not mention this known result, which is acceptable since it is context rather than a conjecture. +- The website notes Erdős and Graham described this as "unattackable by the methods at our disposal" and that it has "significant applications to Waring's problem." These are contextual remarks, not citations. + +**Citation assessment: Complete.** The single reference [ErGr80] matches the website. The citation format in the docstring (authors, title, venue, year) is thorough and correct. + +## 3. Variants + +The website describes two parts: + +1. **f_{k,k}(x) ≫_ε x^{1-ε} for all ε > 0** — formalized as `erdos_323` ✅ +2. **f_{k,m}(x) ≫ x^{m/k} for m < k** — formalized as `erdos_323.variants.m_lt_k` ✅ + +Additional variants that could be considered: + +- **k = 2 (Landau's theorem):** f_{2,2}(x) ~ cx/√(log x) is a known result that could be formalized as a solved variant confirming Part 1 for k = 2. It would serve as a sanity check. +- **Trivial lower bound f_{k,m}(x) ≥ x^{1/k}:** For any m ≥ 1, taking a₁ = n^{1/k} and a₂ = ... = aₘ = 0 shows every perfect k-th power ≤ x is representable, giving f_{k,m}(x) ≥ x^{1/k}. This is a known weak bound, not a conjecture. +- **Upper bound f_{k,m}(x) = O(x^{m/k}):** The trivial counting argument (each of m components ranges over ≤ x^{1/k} values) gives f_{k,m}(x) ≤ x^{m/k}. Part 2 conjectures the matching lower bound. This upper bound could be formalized as a provable lemma to complement the conjecture. +- **Connection to Problem 325:** Problem 325 is the m = 3 special case of Part 2. A formal statement that `erdos_323.variants.m_lt_k` implies `erdos_325` (restricted to k ≥ 4, since k > m = 3) would be a useful structural result. Note that k = 3 with m = 3 falls under Part 1, not Part 2. + +**Assessment:** Both parts of the conjecture as stated on the website are captured. The coverage is complete. + +## 4. Readability + +The code is well-structured and highly readable: + +- **`IsSumOfKthPowers`** is cleanly defined with a clear docstring explaining the mathematical content. The use of `Fin m → ℕ` to model m-tuples is natural. +- **`fKm`** is a straightforward counting function. The name mirrors the mathematical notation f_{k,m}. The use of `Finset.range (x + 1)` to get {0, ..., x} is standard. +- **Theorem statements** read naturally. The quantifier structure `∃ C, 0 < C ∧ ∃ x₀, ∀ x, x₀ ≤ x → ...` is the standard way to express "≫" (Vinogradov notation) in Lean. +- **Module docstring** provides good mathematical context, clearly stating both parts of the conjecture with LaTeX notation. +- **Namespace** `Erdos323` scopes the definitions appropriately. + +**Minor observations:** +- Part 1 uses `1 ≤ k` while Part 2 uses `2 ≤ k`. These are well-motivated: Part 1 is meaningful for all k ≥ 1, while Part 2 requires k ≥ 2 since m ≥ 1 and m < k. +- The `noncomputable` annotation on `fKm` is necessary and correct due to `Classical` decidability in the filter. +- The `open scoped BigOperators` enables `∑` notation, used in `IsSumOfKthPowers`. + +**Readability assessment: Excellent.** + +## 5. Formalizability + +The problem as stated on the website is precise and unambiguous: + +- "the number of natural numbers ≤ x that can be represented as a sum of m nonneg k-th powers" is a well-defined counting function. +- "f_{k,k}(x) ≫_ε x^{1-ε}" is standard asymptotic notation with a precise meaning: for every ε > 0, there exists C_ε > 0 such that f_{k,k}(x) ≥ C_ε · x^{1-ε} for all sufficiently large x. +- "f_{k,m}(x) ≫ x^{m/k}" similarly has a precise meaning with C depending on k and m. + +**Potential ambiguity:** The phrase "nonnegative k-th powers" could in principle mean either (a) k-th powers of nonneg integers, or (b) k-th powers that happen to be nonneg. For integers, these coincide when k is odd (since a^k ≥ 0 iff a ≥ 0) and differ when k is even (since (-a)^k = a^k ≥ 0). The formalization uses ℕ (natural numbers), so components are automatically nonneg, which matches interpretation (a). This is the standard convention in this context. + +**Ambiguity assessment: Very low.** The problem is precisely stated and the formalization captures it faithfully. + +## 6. Correctness + +### Part 1 (`erdos_323`) + +The statement: +```lean +∀ k : ℕ, 1 ≤ k → +∀ ε : ℝ, 0 < ε → +∃ C : ℝ, 0 < C ∧ +∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + C * (x : ℝ) ^ (1 - ε) ≤ (fKm k k x : ℝ) +``` + +This correctly formalizes "f_{k,k}(x) ≫_ε x^{1-ε}": +- The universal quantifier over k ≥ 1 is correct (the website says 1 ≤ m ≤ k; here m = k). +- The ε-dependence of C is captured by C appearing after ε in the quantifier order. +- The "for sufficiently large x" is captured by ∃ x₀, ∀ x ≥ x₀. +- The direction of the inequality (C · x^{1-ε} ≤ fKm) correctly expresses "≫" (lower bound). + +**Edge case analysis:** +- k = 1: f_{1,1}(x) = x + 1 (every natural is a sum of one 1st power). Then C · x^{1-ε} ≤ x + 1 holds for large x. ✅ +- k = 2: Landau showed f_{2,2}(x) ~ cx/√(log x), which satisfies ≫_ε x^{1-ε}. ✅ +- x = 0: C · 0^{1-ε} = 0 ≤ fKm(k,k,0) = 1 (the all-zeros tuple). ✅ + +**Correctness: Sound.** + +### Part 2 (`erdos_323.variants.m_lt_k`) + +The statement: +```lean +∀ k : ℕ, 2 ≤ k → +∀ m : ℕ, 1 ≤ m → m < k → +∃ C : ℝ, 0 < C ∧ +∃ x₀ : ℕ, ∀ x : ℕ, x₀ ≤ x → + C * (x : ℝ) ^ ((m : ℝ) / (k : ℝ)) ≤ (fKm k m x : ℝ) +``` + +This correctly formalizes "f_{k,m}(x) ≫ x^{m/k} for m < k": +- The constraint 2 ≤ k is necessary: m ≥ 1 and m < k forces k ≥ 2. ✅ +- The exponent `(m : ℝ) / (k : ℝ)` correctly computes m/k as a real number. ✅ +- Since m < k, the exponent m/k < 1, so x^{m/k} < x for large x, which is consistent with there being fewer than x representable numbers. ✅ +- The constant C depends on k and m (both quantified before C), matching the "≫" notation where the implied constant depends on parameters. ✅ + +**Edge case analysis:** +- m = 1, k = 2: f_{2,1}(x) counts perfect squares ≤ x, which is ⌊√x⌋ + 1 ~ x^{1/2}. The conjecture f_{2,1}(x) ≫ x^{1/2} is true. ✅ +- m = 1, general k: f_{k,1}(x) counts perfect k-th powers ≤ x, which is ⌊x^{1/k}⌋ + 1 ~ x^{1/k}. The conjecture f_{k,1}(x) ≫ x^{1/k} is true (and provable). ✅ + +**Subtle point:** For m = 1, Part 2 is trivially true and provable. The interesting cases are m ≥ 2 where collisions among sums can reduce the count below the trivial tuple-counting upper bound. This is not a flaw — the formalization correctly includes all cases with m < k. + +**Correctness: Sound.** + +### Definition correctness + +- `IsSumOfKthPowers k m n`: Uses `∃ a : Fin m → ℕ, n = ∑ i, (a i) ^ k`. This allows repeated values among the a_i and considers ordered tuples, but since we only test existence (not count representations), the ordering is irrelevant. Mathematically equivalent to "n is a sum of m nonneg k-th powers." ✅ +- `fKm k m x`: Filters `Finset.range (x + 1)` = {0, 1, ..., x} by the `IsSumOfKthPowers` predicate and takes the cardinality. This correctly counts natural numbers ≤ x that are representable. ✅ + +**Overall correctness verdict: Correct and complete.** Both parts of the conjecture are faithfully formalized. No mathematical flaws identified. The formalization is not weakened by edge cases or vacuous satisfaction. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | Problem 325 duplicates the m = 3 special case; should reuse 323's definitions | +| Citations | Complete — [ErGr80] matches the website | +| Variants | Both parts of the conjecture captured; coverage is complete | +| Readability | Excellent | +| Formalizability | Very high — very low ambiguity | +| Correctness | Correct and complete for both parts | diff --git a/ai-review/327.md b/ai-review/327.md new file mode 100644 index 0000000000..723bb2ba57 --- /dev/null +++ b/ai-review/327.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 327 + +## 1. Code Reuse + +Several existing codebase components are directly relevant: + +- **Problems 301 and 302** (`FormalConjectures/ErdosProblems/301.lean`, `302.lean`): These are closely related unit-fraction problems from the same [ErGr80] source. Problem 301 uses `UnitFractionSumFree` (no element's reciprocal equals a sum of reciprocals of others); Problem 302 uses `UnitFractionTripleFree` (no 1/a = 1/b + 1/c among distinct elements). Problem 327's `UnitFractionPairFree` is a special case — it restricts the sum to exactly two terms where neither equals the target. These three problems share the same proof architecture (ε-δ density bounds on subsets of Finset.Icc 1 N). However, 301 and 302 use an `answer(...)` wrapper while 327 does not (see §4). + +- **Density infrastructure** (`FormalConjecturesForMathlib/Data/Set/Density.lean`): Contains `partialDensity`, `upperDensity`, `lowerDensity`, and `HasDensity` definitions, plus `Nat.hasDensity_even` proving even numbers have density 1/2. This is directly useful for the lower bound variant (odd numbers have density 1/2). + +- **Combinatorics pair-free structures** (`FormalConjecturesForMathlib/Combinatorics/Basic.lean`): Contains `IsSumFree`, `IsSidon`, and extension lemmas. The `UnitFractionPairFree` property is structurally analogous to these pair-exclusion predicates. + +- **Divisibility lemmas** (`FormalConjecturesForMathlib/Data/Nat/Init.lean`): Extensive `Nat.dvd_*` lemmas for divisibility with additions and multiplications, directly applicable to the `(a + b) ∣ ab` condition. + +- **Even/odd interval lemmas** (`FormalConjecturesForMathlib/Algebra/Order/Group/Pointwise/Interval.lean`): `Nat.image_mul_two_Iio_even` and related results would support the lower bound proof that odd numbers in {1,...,N} are unit-fraction-pair-free. + +## 2. Citations + +**Website (erdosproblems.com/327) states:** +- Reference: [ErGr80] (no further bibliographic expansion on the site itself) +- Known result: Wouter van Doorn proved that if |A| ≥ (25/28 + o(1))N then A must contain a ≠ b with (a+b) | ab +- Related problems: #301, #302 +- Related OEIS: A384927 +- Status: Open + +**Formalization states:** +- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- Mentions van Doorn's 25/28 bound in a `Note:` in the docstring. + +**Assessment:** The citation is correct and complete. The [ErGr80] reference matches what the website lists. The van Doorn result is mentioned in the docstring, which is good. One minor suggestion: the related problems (#301, #302) and the OEIS sequence A384927 could be mentioned in the docstring for cross-referencing, but this is not strictly required. + +## 3. Variants + +**Website describes two parts:** +1. (Main) If A ⊆ {1,...,N} with (a+b) ∤ ab for all distinct a,b ∈ A, is max |A| = (1/2 + o(1))N? +2. (Strong) If (a+b) ∤ 2ab for all distinct a,b, must |A| = o(N)? + +**Formalization captures:** +1. `erdos_327` — upper bound: |A| ≤ (1/2 + ε)N for large N ✓ +2. `erdos_327.variants.lower_bound` — lower bound: ∃ A with |A| ≥ (1/2 - ε)N ✓ +3. `erdos_327.variants.strong` — strong variant: |A| ≤ εN for large N ✓ + +**Assessment:** All variants are captured. The decomposition into upper bound + lower bound is a natural and correct way to formalize "f(N) = (1/2 + o(1))N". The strong variant correctly formalizes "|A| = o(N)" via the ε-δ formulation. One structural observation: unlike Problem 301, the upper and lower bounds are stated as separate theorems rather than a single conjunctive statement. This is fine and arguably cleaner, but it means there is no `answer(...)` wrapper to indicate whether the conjecture is believed to be true or false. Since this problem is still open, omitting `answer(...)` is a defensible choice (though Problem 301, also open, does use `answer(sorry)`). + +## 4. Readability + +**Strengths:** +- The definitions `UnitFractionPairFree` and `StrongUnitFractionPairFree` are clearly named and well-documented with docstrings. +- The equivalence between (a+b) | ab and 1/a + 1/b being a unit fraction is stated in the docstring. +- The namespace `Erdos327` keeps things organized. + +**Suggestions:** +- **Consistency with sibling problems:** Problems 301 and 302 use `answer(...)` wrappers and combine upper/lower bounds into a single theorem. Problem 327 splits them apart and has no `answer(...)`. For consistency across the unit-fraction family, consider either (a) adding `answer(sorry)` to the main theorem, or (b) combining the upper and lower bounds into a single statement as done in 301/302. +- **The `0 ∈ A` issue:** The definitions quantify over `a ∈ A` and `b ∈ A` for `A : Finset ℕ`, but the divisibility condition `(a + b) ∣ (a * b)` is trivially satisfied when `a = 0` or `b = 0` (since `0 + b ∣ 0 * b` is `b ∣ 0` which is always true). The theorems constrain `A ⊆ Finset.Icc 1 N`, which excludes 0, so the theorems are correct. However, the *definitions themselves* don't exclude 0, meaning `UnitFractionPairFree {0, 1}` would be true (since 0 ≠ 1 and we need `¬((0+1) ∣ (0*1))`, i.e., `¬(1 ∣ 0)`, which is false — so actually `UnitFractionPairFree {0, 1}` is false). This is fine; the definitions work correctly in context. No change needed. +- The docstrings are generally well-written. The variant docstrings could link back to the main problem more explicitly. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- "A ⊆ {1,...,N}" is unambiguous. +- "(a+b) ∤ ab" is a clear divisibility condition. +- "The maximum size is (1/2 + o(1))N" is standard asymptotic notation with a well-known ε-δ formalization. + +The only potential ambiguity is whether "unit fraction" means 1/n for positive integer n, which is the standard definition. The docstring correctly notes the equivalence: 1/a + 1/b is a unit fraction iff (a+b) | ab (for positive integers a, b). This equivalence is mathematically valid: 1/a + 1/b = (a+b)/(ab), and this equals 1/c for some positive integer c iff c = ab/(a+b) is a positive integer iff (a+b) | ab. The formalization uses the divisibility form directly, which is cleaner for Lean. + +The strong variant "must |A| = o(N)?" is a yes/no question. The formalization assumes the answer is yes (formalizing the statement that |A| ≤ εN). If the answer turns out to be no, the theorem would be false. This is an acceptable approach for an open problem — the formalization represents the conjectured answer. + +**Ambiguity score: 1/5** (very low ambiguity). + +## 6. Correctness + +**Main theorem (`erdos_327`):** Mathematically correct. The statement says: for all ε > 0, there exists N₀ such that for all N ≥ N₀, every UnitFractionPairFree A ⊆ {1,...,N} has |A| ≤ (1/2 + ε)N. This is the standard formalization of "max |A| ≤ (1/2 + o(1))N". + +**Lower bound (`erdos_327.variants.lower_bound`):** Mathematically correct and provable. The odd numbers in {1,...,N} are indeed unit-fraction-pair-free: if a and b are both odd and distinct, then a + b is even, and for (a+b) | ab we'd need ab/(a+b) ∈ ℤ, but ab is odd and a+b is even, so ab/(a+b) cannot be an integer. There are ⌈N/2⌉ odd numbers in {1,...,N}, giving density approaching 1/2. This should be marked `category undergraduate` as it is, which is appropriate. + +**Strong variant (`erdos_327.variants.strong`):** The formalization correctly captures "|A| = o(N)" via the ε-δ definition. The `StrongUnitFractionPairFree` definition correctly encodes (a+b) ∤ 2ab. + +**One mathematical subtlety:** The `UnitFractionPairFree` definition doesn't require elements to be positive — it works over `Finset ℕ` which includes 0. As noted above, the theorems constrain A ⊆ Finset.Icc 1 N, so this is not an issue for correctness. The definitions are consistent with positive integers in context. + +**Equivalence check:** The docstring claims (a+b) | ab ↔ 1/a + 1/b is a unit fraction. For positive integers: 1/a + 1/b = (a+b)/(ab). This is 1/c for some positive integer c iff ab/(a+b) is a positive integer, iff (a+b) | ab. ✓ + +**Overall correctness: Sound.** No mathematical errors detected. The formalization accurately captures the problem as stated on erdosproblems.com. + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Moderate | Related problems 301/302 exist; density and divisibility infrastructure available | +| Citations | ✓ Complete | [ErGr80] correct; van Doorn noted | +| Variants | ✓ Complete | Upper bound, lower bound, and strong variant all captured | +| Readability | Good | Minor inconsistency with sibling problem formatting (answer wrapper) | +| Formalizability | Excellent | Very low ambiguity (1/5) | +| Correctness | ✓ Sound | No mathematical errors; equivalence verified | diff --git a/ai-review/328.md b/ai-review/328.md new file mode 100644 index 0000000000..7ff5784d33 --- /dev/null +++ b/ai-review/328.md @@ -0,0 +1,99 @@ +# AI Review: Erdős Problem 328 + +## 1. Code Reuse + +**Issue found.** The `repCount` definition in `Erdos328` (line 40–41) is identical to `addRepFun` in `Erdos29` (line 39–40), `repCount` in `Erdos763` (line 43–44), and `repCount` in `Erdos871` (line 51–52): + +```lean +noncomputable def repCount (A : Set ℕ) (n : ℕ) : ℕ := + ((Finset.range (n + 1)).filter (fun a => a ∈ A ∧ (n - a) ∈ A)).card +``` + +More importantly, `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean` already provides `sumRep`, the canonical representation function defined as the self-convolution of the indicator function `𝟙_A ∗ 𝟙_A`. The lemma `sumRep_def` proves it equals a cardinality over the antidiagonal, which is mathematically equivalent to the `repCount` definition. Several other Erdős problems (28, 40, 66, 749, 943, 1145) already use `sumRep` directly. + +**Recommendation:** Replace `Erdos328.repCount` with `AdditiveCombinatorics.sumRep` from the shared library. This would reduce code duplication and align with established project conventions. + +## 2. Citations + +The formalization references: +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- `[NeRo85]` — Nešetřil, J. and Rödl, V. (1985). + +The website (erdosproblems.com/328) additionally mentions: +- `[Er80e]` — Erdős previously established negative results for C = 3, 4 and infinitely many other values of C. + +The `[NeRo85]` citation in the formalization lacks a title and publication venue. The website also notes the problem was "Asked by Erdős and Newman," which the formalization does mention in the docstring. + +**Recommendation:** Add the `[Er80e]` reference. Flesh out the `[NeRo85]` citation with the paper title and journal if available. + +## 3. Variants + +The website lists **Related Problem #774** (not captured in this formalization). I was unable to determine the content of problem 774 from context, but it should be checked for whether it represents a variant that could be combined or cross-referenced. + +The formalization captures the strongest version of the negative result: the answer is no "even if t is also allowed to depend on A." This matches the website's description of the Nešetřil–Rödl result. The earlier partial result by Erdős for specific values of C is not formalized as a separate statement, which seems fine since it is subsumed by the general result. + +**No missing variants identified** (subject to checking Problem 774). + +## 4. Readability + +The code is clear and well-structured. Minor suggestions: + +- The docstring notation `$1_A * 1_A(n)$` could be rendered more precisely as `$1_A \ast 1_A(n)$` or `$(1_A * 1_A)(n)$` (the current notation might be read as `1_A * (1_A(n))`). +- The partition is modeled via a function `f : ℕ → Fin t`. This is a clean choice. The set comprehension `{a | a ∈ A ∧ f a = i}` is readable, though `{a ∈ A | f a = i}` (using `Set.sep`) would be slightly more idiomatic. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem as stated on the website is precise: it asks whether a specific partition with a quantitative property exists. The key concepts — additive representation function, partition into finitely many parts, and the strict inequality — are all standard and unambiguous. + +The only minor subtlety is what "partition" means. The formalization uses `f : ℕ → Fin t`, which partitions *all* of ℕ (not just A) into t classes. The representation function is then computed on the intersection with A via `{a | a ∈ A ∧ f a = i}`. This is mathematically equivalent to a partition of A into t subsets, since elements outside A contribute nothing to the representation count. So this is a valid encoding. + +## 6. Correctness + +**Broadly correct, with one significant subtlety to examine.** + +### 6.1 The `answer(False)` direction + +The theorem states `answer(False) ↔ ...`, meaning it claims the answer to the question is **no**. This matches the website, which says the problem is **disproved** (Nešetřil and Rödl showed the answer is negative). So the polarity is correct. + +However, examine the logical structure carefully. The statement says: + +``` +answer(False) ↔ ∀ C, 1 ≤ C → ∀ A, (∀ n, repCount A n ≤ C) → ∃ t, 1 ≤ t ∧ ∃ f, ∀ i n, repCount {a | a ∈ A ∧ f a = i} n < C +``` + +The RHS is the **positive** statement: "for every C and every A with bounded representation, there exists a partition making all parts have strictly smaller representation." Since `answer(False)` means the answer is no, the biconditional `answer(False) ↔ (positive statement)` says: "the answer is no if and only if the positive statement holds." This is **logically backwards**. + +It should be: +``` +answer(False) ↔ ¬(∀ C, 1 ≤ C → ∀ A, (∀ n, repCount A n ≤ C) → ∃ t, ...) +``` + +or equivalently: +``` +answer(True) ↔ ∀ C, 1 ≤ C → ∀ A, (∀ n, repCount A n ≤ C) → ∃ t, ... +``` + +**This appears to be a correctness bug.** The `answer(False)` should be biconditional with the *negation* of the partitioning claim. + +### 6.2 Ordered vs. unordered pairs + +The `repCount` definition counts **ordered** pairs `(a, n-a)` where both are in A, iterating `a` from `0` to `n`. This means for `a ≠ n-a`, both `(a, n-a)` and `(n-a, a)` are counted, while `(a, a)` (when `n = 2a`) is counted once. This matches the standard convention for the representation function `r_2(n)` in additive number theory (ordered representations), and matches the website's `1_A * 1_A` notation (Cauchy convolution). So this is correct. + +### 6.3 The domain constraint `1 ≤ C` + +The condition `1 ≤ C` (i.e., `C ≥ 1`) is appropriate. If `C = 0`, then `repCount A n ≤ 0` for all n forces A = ∅, which is trivially partitionable. So restricting to `C ≥ 1` is natural and matches the problem's `C > 0` condition. + +### 6.4 The partition constraint `1 ≤ t` + +Requiring `1 ≤ t` ensures at least one part exists. This is fine — the problem asks for a partition into `t` subsets `A_1, ..., A_t`, which implicitly requires `t ≥ 1`. + +### Summary of correctness issues + +| Issue | Severity | +|-------|----------| +| `answer(False)` should negate the RHS | **High** — the theorem as stated has the wrong logical polarity | +| Could use `sumRep` instead of local `repCount` | Low — stylistic, mathematically equivalent | diff --git a/ai-review/333.md b/ai-review/333.md new file mode 100644 index 0000000000..31706d7859 --- /dev/null +++ b/ai-review/333.md @@ -0,0 +1,74 @@ +# Review: Erdős Problem 333 + +**File:** `FormalConjectures/ErdosProblems/333.lean` + +## 1. Code Reuse + +**Issue identified.** The formalization defines a local `upperDensity333` that duplicates functionality already available in the codebase: + +- `FormalConjecturesForMathlib/Data/Set/Density.lean` provides `Set.upperDensity`, `Set.lowerDensity`, `Set.HasDensity`, and related lemmas (monotonicity, nonnegativity, density of finite sets, etc.). The local `upperDensity333` computes the same quantity — `limsup of |A ∩ {0,…,N−1}| / N` — but via `Finset.range` and `Finset.filter` rather than `Set.interIio` and `Set.ncard`. These are equivalent for `ℕ`. + +- Problem 335 (`ErdosProblems/335.lean`) similarly defines its own `upperDensity` and `lowerDensity` duplicates. Problem 337 defines its own `countInRange` and `sumset`. All of these are candidates for consolidation. + +- The sumset `Set.image2 (· + ·) B B` is expressed inline, which is fine, but `FormalConjecturesForMathlib/Combinatorics/Basic.lean` and `Combinatorics/Additive/Basis.lean` contain related definitions (`IsSidon`, `IsAdditiveBasis`, etc.) that provide broader context. The sumset definition in Problem 337 (`Erdos337.sumset`) is also equivalent. + +**Recommendation:** Replace `upperDensity333` with `Set.upperDensity` from `Data/Set/Density.lean` (applied to `Set.univ`), or at minimum import and reference the shared definition. This would also allow leveraging existing lemmas like `hasDensity_zero_of_finite` and `HasDensity.mono`. + +## 2. Citations + +**Partially incomplete.** The formalization includes two references: + +- **[ErGr80]** — Correctly cited: *Erdős, P. and Graham, R., "Old and new problems and results in combinatorial number theory." Monographies de L'Enseignement Mathématique (1980).* +- **[ErNe77]** — Incomplete: listed only as `Erdős, P. and Newman, D.J.` with no title, journal, or year. The full reference should be: Erdős, P. and Newman, D.J., *"Bases for sets of integers,"* Journal of Number Theory **9** (1977), 420–425. + +The website (erdosproblems.com/333) also notes Problem 806 as a related problem. This cross-reference is not mentioned in the formalization's docstring. + +**Recommendation:** Complete the [ErNe77] citation with title, journal, and year. Consider adding a note about the related Problem 806 (which is the finite analogue: for A ⊆ {1,…,n} with |A| ≤ n^{1/2}, does B exist with |B| = o(n^{1/2}) and A ⊆ B+B? — proved affirmatively by Alon–Bukh–Sudakov in 2009). + +## 3. Variants + +**Adequate coverage.** The formalization captures the core question. The main variant of interest is: + +- **Squares special case (proved by [ErNe77]):** The docstring correctly notes that Erdős and Newman proved the answer is "yes" when A is the set of perfect squares. This positive result is not separately formalized, which is acceptable — it is a sub-result, not a separate conjecture. + +- **Problem 806 (finite version):** Not captured but is a genuinely distinct problem (finite sets in {1,…,n} rather than infinite subsets of ℕ with density conditions). This could be noted but need not be formalized in the same file. + +- **No missing variants** from the website's description. + +## 4. Readability + +**Good overall, with minor suggestions.** + +- The definition name `upperDensity333` is problem-specific and less discoverable. Using the shared `Set.upperDensity` would improve readability and consistency. +- The exponent `(1 : ℝ) / 2` is technically correct but `(1 / 2 : ℝ)` or a dedicated notation would be slightly cleaner. +- The docstring is well-written and explains B+B and o(N^{1/2}) clearly. The historical note about the disproof being implicit in [ErNe77] Theorem 2 is a valuable addition. +- The `answer(False)` pattern is consistent with the codebase convention for disproved results (cf. Problem 337). + +## 5. Formalizability + +**High — the problem is unambiguous and cleanly formalizable.** + +- "Density zero" is well-defined (upper density = 0 is the standard interpretation and equivalent to natural density = 0 when the latter exists; using upper density = 0 is actually the strongest version, making the disproof even stronger). +- The sumset B+B = {b₁ + b₂ | b₁, b₂ ∈ B} is standard and unambiguous. +- The little-o condition |B ∩ {1,…,N}| = o(N^{1/2}) is formalized as the ε–N₀ form (∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, count ≤ ε · N^{1/2}), which is the correct unwinding. +- **Ambiguity assessment: Very low.** The only potential ambiguity — whether "density" means natural density, upper density, or Schnirelmann density — is handled correctly by choosing upper density = 0, which is the strongest (and standard) reading. + +## 6. Correctness + +**Mathematically correct and complete.** + +Detailed analysis: + +1. **Upper density definition:** `upperDensity333 A` computes `limsup_{N→∞} |A ∩ {0,…,N−1}| / N`. This is the standard upper asymptotic density. Correct. + +2. **Sumset:** `Set.image2 (· + ·) B B` produces exactly {b₁ + b₂ | b₁ ∈ B, b₂ ∈ B}. Correct. + +3. **o(N^{1/2}) condition:** The formalization requires ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, |B ∩ {1,…,N}| ≤ ε · N^{1/2}. This is the standard ε-definition of little-o. Correct. + +4. **Counting convention:** The density uses `Finset.range N` = {0,…,N−1}, while the o(N^{1/2}) condition uses `Finset.Icc 1 N` = {1,…,N}. This minor difference in convention (whether 0 is included) is irrelevant asymptotically and matches the natural mathematical convention: density counts from 0, while the problem statement explicitly says {1,…,N}. Correct. + +5. **answer(False) polarity:** The `answer(False) ↔ P` form means P is equivalent to False, i.e., P is false. Since P is the universal statement "for all density-zero A, such B exists," the theorem asserts this is false — matching the known disproof. Correct. + +6. **No missing hypotheses or edge cases.** The statement does not require B to be infinite or non-empty, which is fine — if B is finite, B+B is finite and couldn't contain an infinite density-zero set. No issues with ℕ vs ℤ — the problem is stated over ℕ on the website and formalized over ℕ. + +**Verdict: The formalization is correct and complete.** The only actionable items are (a) replacing the local density definition with the shared one from `Data/Set/Density.lean` and (b) completing the [ErNe77] citation. diff --git a/ai-review/334.md b/ai-review/334.md new file mode 100644 index 0000000000..560195e6eb --- /dev/null +++ b/ai-review/334.md @@ -0,0 +1,141 @@ +# Review: Erdős Problem 334 + +**File:** `FormalConjectures/ErdosProblems/334.lean` + +--- + +## 1. Code Reuse + +The local definition `IsSmooth` is duplicated across at least four Erdős problem files, each with slightly different signatures: + +| File | Definition | Bound type | Collection | +|------|-----------|------------|------------| +| `334.lean` | `IsSmooth (B n : ℕ)` | `ℕ` | `primeFactorsList` | +| `929.lean` | `IsSmooth (x m : ℕ)` | `ℕ` | `primeFactors` | +| `369.lean` | `IsSmooth (y : ℝ) (m : ℕ)` | `ℝ` | `primeFactorsList` | +| `983.lean` | `IsSmoothWrt (a : ℕ) (P : Finset ℕ)` | Finset | — | + +Additionally, `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` defines `Nat.maxPrimeFac` (the greatest prime divisor), which provides an equivalent characterization: `n` is `B`-smooth iff `maxPrimeFac n ≤ B` (for `n > 1`). A shared definition in `FormalConjecturesForMathlib` could unify all of these. + +**Recommendation:** Extract a canonical `Nat.IsSmooth` definition into `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` (or a new file) and prove the equivalence with `maxPrimeFac`. The `ℝ`-bound variant in 369 can be a thin wrapper. This would eliminate four redundant definitions. + +There is also a minor inconsistency: Problem 334 uses `primeFactorsList` (a `List`) while Problem 929 uses `primeFactors` (a `Finset`). These are equivalent for membership predicates (`p ∈ n.primeFactorsList ↔ p ∈ n.primeFactors`), but using `primeFactors` (the finset) is generally preferred in Mathlib-style code. + +--- + +## 2. Citations + +Comparing the formalization's citations against [erdosproblems.com/334](https://www.erdosproblems.com/334): + +| Reference | Website | Formalization | Status | +|-----------|---------|---------------|--------| +| [ErGr80] Erdős & Graham, p.70 | ✓ | ✓ | Match | +| [Er82d] Erdős 1982, p.55 | ✓ | ✓ | Match | +| [Ba89] Balog 1989 | ✓ | ✓ | Match | + +All three primary references are present and correctly cited. The website also mentions: + +- Problem 59 on Green's open problems list — not mentioned in the formalization (informational, not a citation gap). +- OEIS sequences A062241 and A045535 — not mentioned (minor; could be added as a comment for discoverability). + +**Verdict:** Citations are complete and accurate. The full bibliographic entries match the website data. No issues. + +--- + +## 3. Variants + +The docstring mentions three levels of the conjecture: + +1. **Erdős's original question:** $f(n) \leq n^{1/3}$ — not formalized. +2. **Balog's result [Ba89]:** $f(n) \ll_\varepsilon n^{4/(9\sqrt{e})+\varepsilon}$ — not formalized. +3. **Weak conjecture:** $f(n) \leq n^{o(1)}$ — **this is what is formalized**. +4. **Strong conjecture:** $f(n) \leq e^{O(\sqrt{\log n})}$ — mentioned in docstring but not formalized. + +The formalization chooses variant (3), which is a natural middle ground. Potential additional formalizations: + +- **Balog's theorem** could be stated as a resolved result (a theorem, not a conjecture): + ```lean + theorem erdos_334_balog : + ∀ ε : ℝ, 0 < ε → + ∃ C : ℝ, 0 < C → ∀ n : ℕ, 1 ≤ n → + ∃ a b : ℕ, a + b = n ∧ + IsSmooth (⌊C * (n : ℝ) ^ (4 / (9 * Real.exp (1/2)) + ε)⌋₊) a ∧ + IsSmooth (⌊C * (n : ℝ) ^ (4 / (9 * Real.exp (1/2)) + ε)⌋₊) b + ``` + +- **The strong conjecture** $f(n) \leq e^{O(\sqrt{\log n})}$ could be formalized as: + ```lean + theorem erdos_334_strong : + ∃ C : ℝ, 0 < C ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ a b : ℕ, a + b = n ∧ + IsSmooth (⌊Real.exp (C * Real.sqrt (Real.log n))⌋₊) a ∧ + IsSmooth (⌊Real.exp (C * Real.sqrt (Real.log n))⌋₊) b + ``` + +**Recommendation:** The chosen variant is the most natural formalization of the main conjecture. Adding the strong conjecture as a separate theorem would be a nice addition but is not essential. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Docstring quality:** Excellent. It explains the history (Erdős's original question, Balog's result, the conjectured bounds) and clearly states which variant is formalized. +- **Namespace:** Properly scoped under `Erdos334`, preventing name collisions with the duplicate `IsSmooth` definitions in other files. +- **Naming:** `IsSmooth` is intuitive. The theorem name `erdos_334` follows project conventions. +- **Statement structure:** The quantifier chain `∀ ε, 0 < ε → ∃ N, ∀ n, N ≤ n → ∃ a b, ...` is the standard "for all ε > 0, for sufficiently large n" pattern and reads naturally. + +**Minor suggestion:** The docstring uses `$f(n) \leq n^{o(1)}$` and `$f(n) \leq e^{O(\sqrt{\log n})}$` — these are standard asymptotic notations that read well. + +No readability issues. + +--- + +## 5. Formalizability + +The original problem asks to "find the best function $f(n)$" — this is inherently imprecise, as it asks for an optimization rather than a yes/no statement. The formalization sidesteps this by formalizing a specific conjecture about $f(n)$, namely that $f(n) = n^{o(1)}$. + +The notion of "$n^{o(1)}$" is itself an asymptotic statement that requires unpacking. The formalization correctly renders it as: for every $\varepsilon > 0$, for sufficiently large $n$, the bound $n^\varepsilon$ suffices. This is the standard $\forall\varepsilon\,\exists N\,\forall n \geq N$ formulation and is unambiguous. + +**Ambiguity level:** Low. The "find the best $f(n)$" formulation is inherently open-ended, but the specific conjecture $f(n) = n^{o(1)}$ is precise and the formalization captures it faithfully. The only remaining ambiguity is whether $a, b$ should be positive (see Correctness below). + +--- + +## 6. Correctness + +### Definition: `IsSmooth` + +```lean +def IsSmooth (B n : ℕ) : Prop := ∀ p ∈ n.primeFactorsList, p ≤ B +``` + +- For `n = 0`: `Nat.primeFactorsList 0 = []`, so `IsSmooth B 0` is vacuously true for all `B`. This means 0 is considered $B$-smooth for any $B$, which is a reasonable convention (0 has no prime factors to violate the bound). +- For `n = 1`: `Nat.primeFactorsList 1 = []`, so 1 is also vacuously smooth. Correct — 1 is smooth by standard convention. +- For prime `p` and `n = p`: `IsSmooth B p ↔ p ≤ B`. Correct. + +The definition is mathematically sound. + +### Theorem: `erdos_334` + +```lean +theorem erdos_334 : + ∀ ε : ℝ, 0 < ε → + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ a b : ℕ, a + b = n ∧ + IsSmooth (⌊(n : ℝ) ^ ε⌋₊) a ∧ + IsSmooth (⌊(n : ℝ) ^ ε⌋₊) b +``` + +**Analysis of edge cases:** + +1. **$\varepsilon \geq 1$:** When $\varepsilon \geq 1$ and $n$ is large enough, $\lfloor n^\varepsilon \rfloor_+ \geq n$, so taking $a = n, b = 0$ trivially works (both are $n$-smooth). This is mathematically correct — the interesting content is for small $\varepsilon$, and including large $\varepsilon$ doesn't create a false statement. + +2. **$n = 0$:** Taking $a = b = 0$ gives $a + b = 0$, and both are vacuously smooth. Correct. + +3. **Use of `⌊·⌋₊` (natural number floor):** `⌊(n : ℝ) ^ ε⌋₊` is `Nat.floor` applied to `(n : ℝ) ^ ε`. For $n \geq 1$ and $\varepsilon > 0$, this gives $\lfloor n^\varepsilon \rfloor \geq 1$, which is appropriate. For $n = 0$, $0^\varepsilon = 0$ (in Lean's convention for $0 < \varepsilon$), giving smoothness bound 0, but the statement only requires this "for sufficiently large $n$", so this is fine. + +4. **Positivity of $a, b$:** The statement allows $a = 0$ or $b = 0$, meaning the decomposition $n = n + 0$ is permitted. The original problem says "every $n$ can be written as $n = a + b$" without explicitly requiring $a, b > 0$. In the smooth number literature, this is typically understood as allowing $a$ or $b$ to be trivial. If the intent were to require $a, b \geq 1$, the statement should include `0 < a` and `0 < b` hypotheses. However, the trivial decomposition $n = n + 0$ doesn't help when $\varepsilon$ is small (since $n$ itself may not be $n^\varepsilon$-smooth), so the omission does not make the conjecture vacuously true. This is not a bug, but documenting the convention would improve clarity. + +5. **Direction of equality:** The statement uses `a + b = n` rather than `n = a + b`. This is equivalent but slightly unconventional (the original phrasing is "$n = a + b$"). Minor stylistic point. + +**Verdict:** The formalization is **mathematically correct and complete** for the chosen variant ($f(n) = n^{o(1)}$). There are no logical errors. The edge cases are handled correctly by the "for sufficiently large $n$" quantifier. The only potential improvement would be adding `0 < a ∧ 0 < b` if positive summands are intended, but the current formulation is defensible and does not affect the mathematical content of the conjecture. diff --git a/ai-review/335.md b/ai-review/335.md new file mode 100644 index 0000000000..188bc3bbee --- /dev/null +++ b/ai-review/335.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 335 + +## 1. Code Reuse + +**`FormalConjecturesForMathlib/Data/Set/Density.lean`** provides a generic, reusable density framework: +- `Set.upperDensity`, `Set.lowerDensity` — limsup/liminf of partial densities, generic over any `Preorder` with `LocallyFiniteOrderBot` +- `Set.HasDensity` — defined via `Tendsto` (convergence of partial densities to a limit) +- `Set.HasPosDensity` — positive density wrapper + +Problem 335 defines its own `Erdos335.upperDensity`, `Erdos335.lowerDensity`, and `Erdos335.HasNaturalDensity` locally (lines 38–50). These are mathematically equivalent to the library versions when specialized to `β = ℕ, A = Set.univ`, but differ in implementation: +- **335's version** uses `(Finset.range N).filter (· ∈ A)).card / (N : ℝ)`, dividing by `N`. +- **Library version** uses `Set.interIio` and `ncard`, dividing by the count of elements in `A` below `b` (which for `A = Set.univ` on `ℕ` is `b` itself, i.e. equivalent for `ℕ`). +- **335's `HasNaturalDensity`** is defined as upper = lower = d (a conjunction), while the library's `HasDensity` uses `Tendsto` (convergence). These are equivalent but structurally different. + +**Recommendation:** The local definitions are clear and self-contained. Reusing the library versions would reduce duplication across the ~10+ Erdős problems that independently define density, but would require verifying definitional equivalence. At minimum, a comment noting the library alternative would be helpful. + +Multiple other Erdős problems (333, 339, 342, 656, etc.) also define their own density locally. This is a codebase-wide pattern, not specific to 335. + +## 2. Citations + +The formalization cites: +> [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +The website (erdosproblems.com/335) lists: +> [ErGr80, p.51] + +**Assessment:** The citation matches. The page reference "p.51" appears in the theorem's docstring (line 53) but not in the module docstring header (line 29). This is acceptable — the page reference is present where the theorem is stated. + +## 3. Variants + +The problem on erdosproblems.com asks to **"characterize"** pairs (A, B), which implicitly requires both directions: +1. **(Necessity)** If d(A+B) = d(A) + d(B) with positive densities, then A and B arise from a rotation construction. +2. **(Sufficiency)** Sets arising from such rotation constructions satisfy d(A+B) = d(A) + d(B). + +**What is formalized:** Only direction (1), and only for the specific group ℝ/ℤ. + +**What is missing:** +- **Sufficiency direction:** The reverse implication (rotation construction → density additivity) is not formalized. The docstring (lines 69–70) explicitly acknowledges this. +- **General compact abelian groups:** The website and docstring (lines 23–24, 65) mention that the full conjecture involves "possibly using other compact abelian groups in place of ℝ/ℤ." The formalization restricts to ℝ/ℤ only. This is a significant narrowing — the full conjecture would require a universal statement over all compact abelian groups, or at minimum acknowledge that ℝ/ℤ may not suffice. + +**Assessment:** The formalization captures the most natural and concrete special case of one direction of the conjecture. The omissions are clearly documented in the docstring, which is good practice. + +## 4. Readability + +The code is well-structured and readable: +- The density definitions (lines 37–50) are clean with good docstrings including LaTeX. +- The theorem statement (lines 72–89) is long but necessarily so given the existential structure. +- The docstring (lines 52–71) provides excellent context explaining what is and isn't formalized. + +**Minor suggestions:** +- The `Set.image2 (fun a b => Int.fract (a + b)) X_A X_B` on line 85 could benefit from a brief inline comment clarifying this represents the sumset in ℝ/ℤ, as the `fract` wrapping may not be immediately obvious to all readers. +- The `open Classical Filter MeasureTheory` on line 32 is broad; `Classical` could be scoped more narrowly, though this is a minor style point. + +## 5. Formalizability + +**Original problem statement:** "Characterise those A, B ⊆ ℕ with positive density such that d(A+B) = d(A) + d(B)." + +**Ambiguity assessment: MODERATE** + +- **"density"** — The website says "density" without specifying upper, lower, or natural (asymptotic). The formalization assumes natural density (upper = lower), which is the standard interpretation. This is reasonable but not the only possibility; one could ask the question for upper density alone. +- **"characterize"** — This is inherently informal. It asks for a structural description, not a yes/no answer. The formalization interprets this as "all such pairs arise from irrational rotations on ℝ/ℤ," which is one specific conjecture about what the characterization might be. The problem is really asking an open-ended question; the formalization pins down a specific conjectured answer. +- **"similar way (possibly using other compact abelian groups)"** — This is deliberately vague in the original. Formalizing "similar way" for arbitrary compact abelian groups would require defining a general notion of "sets arising from a group rotation construction," which is non-trivial. + +The formalization makes reasonable choices to resolve these ambiguities but necessarily narrows the problem. + +## 6. Correctness + +### What is correct: +- **Density definitions** (lines 38–50): Standard and correct. `upperDensity` as limsup of |A ∩ {0,...,N-1}|/N and `lowerDensity` as liminf are textbook definitions. +- **Sumset** (line 78): `Set.image2 (· + ·) A B` correctly represents {a + b | a ∈ A, b ∈ B}. +- **Rotation construction** (lines 79–88): The existential structure correctly captures the irrational rotation model: θ irrational, X_A and X_B measurable subsets of [0,1), membership via fractional parts, and measure additivity. +- **The `Int.fract` sumset** (line 85): `Set.image2 (fun a b => Int.fract (a + b)) X_A X_B` correctly represents the sumset in ℝ/ℤ (identified with [0,1) via fractional parts). +- **`volume` as measure** (lines 83–86): Using Lebesgue measure on subsets of [0,1) correctly models Haar measure on ℝ/ℤ. +- **Positive n condition** (lines 87–88): `0 < n` matches the original "{n > 0 : ...}". + +### Potential issues: + +1. **Membership of 0 in A, B is unconstrained.** The conditions `∀ n : ℕ, 0 < n → (n ∈ A ↔ ...)` say nothing about whether 0 ∈ A or 0 ∈ B. This is mathematically harmless since density is asymptotic, but it means A and B are not fully determined by θ, X_A, X_B — there's a free choice at 0. This is a cosmetic issue, not a correctness bug. + +2. **The sumset may include 0.** If 0 ∈ A and 0 ∈ B, then 0 ∈ A + B. But `Set.image2 (· + ·) A B` operates on all elements including 0. The density of A + B won't be affected by a single point, so this is fine. + +3. **Implicit constraint dA + dB ≤ 1.** For the conclusion to be satisfiable, we need `volume(image2 fract X_A X_B) = volume X_A + volume X_B`, but the left side is at most 1 (it's a subset of [0,1)). So dA + dB > 1 would make the conclusion require a set of measure > 1 inside [0,1), which is impossible. The hypothesis `HasNaturalDensity (A+B) (dA+dB)` with dA+dB > 1 is also impossible (density ≤ 1), so the theorem is vacuously true in that regime. This is not a bug but is worth noting. + +4. **The measure condition uses Lebesgue measure on ℝ, not on [0,1).** Since X_A, X_B ⊆ [0,1), `volume X_A` computes the Lebesgue measure in ℝ restricted to these sets, which equals the Haar measure on ℝ/ℤ. The image `Set.image2 (fun a b => Int.fract (a + b)) X_A X_B` is also a subset of [0,1) by definition of `Int.fract`. So `volume` on this image is also correct. No issue here. + +5. **Restricting to ℝ/ℤ may be too strong.** The conjecture on the website suggests the characterization may require general compact abelian groups. If there exist pairs (A, B) with d(A+B) = d(A) + d(B) that arise from a construction on, say, (ℤ/pℤ)^ℕ but NOT from ℝ/ℤ, then `erdos_335` as stated would be **false**. This is the most significant mathematical concern: the formalization commits to ℝ/ℤ being sufficient, which is a stronger claim than the original conjecture suggests. The docstring acknowledges this is "one direction of the specific ℝ/ℤ version." + +### Overall correctness verdict: + +The formalization is **mathematically correct** for what it claims to be: the necessity direction of the ℝ/ℤ-specific version of the conjecture. It is a reasonable partial formalization. The main risk is that the ℝ/ℤ restriction makes the statement potentially **false** even if the full conjecture (with general compact abelian groups) is true. This is appropriately flagged in the docstring. diff --git a/ai-review/336.md b/ai-review/336.md new file mode 100644 index 0000000000..99bd9b67db --- /dev/null +++ b/ai-review/336.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 336 + +## 1. Code Reuse + +The file defines three local helpers—`exactSumset`, `IsAdditiveBasis`, `HasExactOrder`—and a noncomputable `hBasis` inside the `Erdos336` namespace. Identical copies of `exactSumset` and `IsAdditiveBasis` appear in `337.lean`, `338.lean`, and `339.lean`. These should ideally be factored into a shared utility file. + +The library file `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` provides `Set.IsAsymptoticAddBasisOfOrder A n`, which states that cofinitely many elements lie in `A ^ n` (the `n`-fold Minkowski sum). This is close but **not identical** to the local `IsAdditiveBasis`: + +- **Local `IsAdditiveBasis A r`**: Every sufficiently large `n` is the sum of **at most** `r` elements (i.e., there exists `k ≤ r` with `n ∈ exactSumset A k`). The `k` may vary with `n`. +- **Library `IsAsymptoticAddBasisOfOrder A n`**: Cofinitely many elements are sums of **exactly** `n` elements. + +These coincide when `0 ∈ A` (one can pad shorter representations with zeros), but the formalization does not impose this. Since the standard number-theoretic definition of "basis of order `r`" uses "at most `r`", the local definition is arguably more faithful. The library's `IsAsymptoticAddBasisOfOrder.mono` lemma shows that if `A` is an asymptotic basis of order `m` and `m ≤ n`, then it is also one of order `n`—but this only applies when `0 ∈ A` and `A ⊆ ℕ` with its canonical ordered structure. + +**Verdict**: The local definitions are reasonable for this problem. However, the duplicated `exactSumset` and `IsAdditiveBasis` across four files (336–339) should be consolidated. + +## 2. Citations + +The website ([erdosproblems.com/336](https://www.erdosproblems.com/336)) lists the following references: + +| Code | Full Reference | +|------|---------------| +| ErGr80 | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | +| ErGr80b | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory II*. (1980). | +| Gr88 | Grekos, G. (1988) — lower bound 1/3 | +| Na93 | Nash, J.C.M. (1993) — upper bound 1/2 and h(3)=7 | +| Pl04 | Plagne, A. (2004) — bounds on h(4), improved lower-order terms | + +The formalization only cites **[ErGr80]**. The docstring mentions "lower bound due to Grekos" and "upper bound due to Nash" but does not give full citations. The references [ErGr80b], [Gr88], [Na93], and [Pl04] are missing. At minimum, [Gr88] and [Na93] should be cited since their results (the bounds 1/3 and 1/2) are explicitly stated in the docstring. + +## 3. Variants + +The website records several concrete results that the formalization does not capture: + +- **Exact values**: h(2) = 4 (Erdős–Graham), h(3) = 7 (Nash), 10 ≤ h(4) ≤ 11 (Plagne). +- **Characterization**: A basis has exact order if and only if the gcd of consecutive differences of the basis elements equals 1 (Erdős–Graham). +- **Original weaker bounds**: 1/4 ≤ lim h(r)/r² ≤ 5/4 (Erdős–Graham). + +These could be formalized as separate theorems. The exact values for h(2) and h(3) are natural companion statements and are fully precise. The gcd characterization is a notable structural result. + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- The docstring for `hBasis` says "maximal $k$" but doesn't mention the finiteness caveat inherent in using `sSup` on `ℕ` (which returns 0 for empty or unbounded sets). A brief comment noting this would aid readers. +- The module docstring could be slightly more self-contained by explicitly stating the problem asks to *determine* the limit, not just that it exists. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with one semantic subtlety.** + +The problem statement "Find the value of lim h(r)/r²" is well-suited for formalization: one must exhibit a specific real number `L` and prove the limit equals `L`. The formalization captures this via `answer(sorry)`, which is the standard pattern in this codebase. + +The main subtlety is the definition of `hBasis` via `sSup` on `ℕ`: +- `sSup` on `ℕ` returns 0 for empty sets and for sets unbounded above. +- The problem says h(r) is "the maximal **finite** k", implying the set is always bounded for relevant r. +- If the set were unbounded for some r (which it isn't, mathematically), `sSup` would silently return 0, giving a mathematically incorrect h(r). + +This is not a practical issue since h(r) is known to be finite for all r ≥ 2, but the formalization does not prove or assert this. An alternative would be to use a conditional supremum or add a hypothesis that the set is `BddAbove`, but the current approach is pragmatic and standard for this codebase. + +**Ambiguity level: Low.** The problem is precisely stated on the website. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed assessment: + +- **`exactSumset A k`**: Correctly captures {n | n = a₁ + ··· + aₖ, each aᵢ ∈ A} with repetition allowed. Uses `Fin k → ℕ` as the indexing type, which is standard. + +- **`IsAdditiveBasis A r`**: Correctly captures "asymptotic basis of order r" — every sufficiently large natural number is the sum of at most r elements of A. The "at most" is correctly encoded as `∃ k ≤ r, n ∈ exactSumset A k`. + +- **`HasExactOrder A k`**: Correctly captures that every sufficiently large natural number is the sum of exactly k elements from A. + +- **`hBasis r`**: Correctly takes the supremum over all k such that some basis of order r has exact order k. This matches the problem's definition of h(r). + +- **`erdos_336`**: The `Tendsto` statement correctly asserts that `hBasis(r) / r²` converges to some limit as `r → ∞`. The cast to `ℝ` is appropriate for the division. The filter `atTop` on `ℕ` correctly models r → ∞. + +**No mathematical flaws identified.** The formalization faithfully represents the problem as stated on the website. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `exactSumset`/`IsAdditiveBasis` duplicated in 4 files; library has related but not identical definitions | +| Citations | Missing [ErGr80b], [Gr88], [Na93], [Pl04]; Grekos and Nash mentioned but not fully cited | +| Variants | Exact values h(2)=4, h(3)=7 and gcd characterization not captured | +| Readability | Good; minor improvements possible | +| Formalizability | High; low ambiguity; `sSup` on ℕ has a semantic subtlety but is pragmatically correct | +| Correctness | Correct and complete | diff --git a/ai-review/337.md b/ai-review/337.md new file mode 100644 index 0000000000..e82d61b0b1 --- /dev/null +++ b/ai-review/337.md @@ -0,0 +1,79 @@ +# AI Review: Erdos Problem 337 + +## 1. Code Reuse + +Several definitions in this file are duplicated across multiple Erdos problem files (336, 337, 338, 339) and have library equivalents: + +- **`IsAdditiveBasis`** / **`exactSumset`**: Defined identically in `ErdosProblems/336.lean`, `338.lean`, and `339.lean`. The library provides `Set.IsAsymptoticAdditiveBasisOfOrder` in `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`, which uses the cofinite filter and `A ^ n` (n-fold pointwise sum). However, there is a **semantic mismatch**: the local definition allows *at most* `r` summands (`∃ k ≤ r, n ∈ exactSumset A k`), while the library definition requires *exactly* `n` summands (membership in `A ^ n`). These coincide when `0 ∈ A` (since padding with zeros is free), but differ otherwise. The local definition is more faithful to the standard additive number theory convention. If the library definition were used, it would need to be applied as `∃ k ≤ r, Set.IsAsymptoticAdditiveBasisOfOrder A k` or `A` would need to be replaced by `A ∪ {0}` to capture the "at most" semantics. + +- **`sumset`**: Defined as `{n | ∃ a ∈ A, ∃ b ∈ A, n = a + b}`. This is mathematically identical to Mathlib's pointwise `A + A` (via `open scoped Pointwise`). The same ad-hoc `sumset` appears in `ErdosProblems/31.lean`, `35.lean`, `37.lean`, `869.lean`, and `871.lean`. Replacing with Mathlib's pointwise notation would improve consistency and unlock existing lemmas. + +- **`countInRange`**: Could potentially use `Set.partialDensity` from `FormalConjecturesForMathlib/Data/Set/Density.lean` for the density-zero hypothesis, since `partialDensity S Set.univ b` computes exactly `|S ∩ Iio b|.ncard / |Iio b|.ncard`, which is essentially `countInRange A N / N`. Using `Set.HasDensity A 0` would be a cleaner expression of the density-zero hypothesis. + +**Recommendation**: The `sumset` and density condition have clean library replacements. The `IsAdditiveBasis` definition has a semantic gap with the library version that should be documented if the local version is retained. + +## 2. Citations + +The formalization includes four references: `[ErGr80]`, `[ErGr80b]`, `[Tu84]`, and `[RT85]`. These match the references listed on [erdosproblems.com/337](https://www.erdosproblems.com/337). The website lists `[ErGr80]` and `[ErGr80b]` as original sources and `[Tu84]` and `[RT85]` as related work. The full citation details in the docstring (author names, titles, years) are consistent with what the website provides. No missing citations. + +## 3. Variants + +The website describes an important generalization that is mentioned in the docstring but **not formalized**: + +- **Ruzsa-Turjányi generalization [RT85]**: The negative answer extends to the h-fold sumset `hA` for any `h ≥ 2`. That is, for any fixed `h ≥ 2`, there exists an additive basis `A` of density `o(N)` such that `|hA ∩ {1,...,N}| / |A ∩ {1,...,N}|` does NOT tend to infinity. This is mentioned in the docstring but could be a separate formalized theorem. + +- **Ruzsa-Turjányi positive result [RT85]**: They *proved* that `|(A+A+A) ∩ {1,...,3N}| / |A ∩ {1,...,N}|` DOES tend to infinity for any additive basis `A` of density `o(N)`. This is mentioned on the website but **not mentioned or formalized** in the current file. + +- **Ruzsa-Turjányi conjecture [RT85]**: They conjecture that the analogous result holds with `(A+A) ∩ {1,...,2N}` in the numerator (i.e., replacing `N` with `2N` in the sumset intersection). This is on the website but **not mentioned or formalized**. + +**Recommendation**: At minimum, the positive result of [RT85] and the open conjecture should be mentioned in the docstring since they provide important mathematical context. Formalizing the h-fold generalization and the positive result as separate theorems would be valuable. + +## 4. Readability + +The code is generally readable. Specific observations: + +- The `Erdos337` namespace prevents name collisions, which is good. +- The definitions have clear docstrings explaining the mathematical objects. +- The `countInRange` definition uses `Finset.range (N + 1)` which counts elements in `{0, 1, ..., N}`. The docstring says `{0, 1, ..., N}` which matches the implementation but differs from the mathematical convention `{1, ..., N}` used in the problem statement. This is inconsequential asymptotically but is a minor notational inconsistency. +- The main theorem statement is reasonably readable, though using library definitions (e.g., `Set.HasDensity A 0` for the density condition) would make it more concise and self-documenting. + +## 5. Formalizability + +The problem is **clearly and precisely formalizable**. The statement is unambiguous: +- "Additive basis of density o(N)" is a standard, well-defined concept. +- The ratio `|(A+A) ∩ {1,...,N}| / |A ∩ {1,...,N}|` is well-defined (modulo the case where the denominator is zero, which only occurs for finitely many N when A is infinite). +- The question "does this tend to infinity?" has a definitive answer (no). +- The answer `False` is known via Turjányi's counterexample. + +There is **no ambiguity** in the mathematical statement. The only minor question is whether "additive basis" means "of some finite order" (as formalized) vs. a specific order, but the formalization correctly uses the existentially quantified version (`∃ r, IsAdditiveBasis A r`), matching standard usage. + +**Assessment**: Fully formalizable with no ambiguity. Difficulty level is moderate — the `sorry` requires constructing Turjányi's explicit counterexample or citing it. + +## 6. Correctness + +The formalization is **mathematically correct**. + +- **`answer(False)` usage**: The theorem states `answer(False) ↔ (∀ A, basis → density_zero → ratio_tends_to_∞)`. Since `answer(False)` evaluates to `False`, this is equivalent to `¬(∀ A, ...)`, i.e., there exists a counterexample. This correctly encodes "the answer is no." + +- **Density condition**: `Tendsto (fun N => countInRange A N / N) atTop (nhds 0)` correctly expresses `|A ∩ {0,...,N}| = o(N)`. Using `{0,...,N}` instead of `{1,...,N}` does not affect the asymptotic condition. + +- **Ratio condition**: `Tendsto (fun N => countInRange (sumset A) N / countInRange A N) atTop atTop` correctly expresses that the ratio tends to infinity. + +- **Division by zero**: When `countInRange A N = 0` (possible for small N), Lean's real division gives `0/0 = 0`. This does not affect correctness: for `Tendsto ... atTop atTop` to hold, we need the ratio to be eventually ≥ M for any M. Since any additive basis must be infinite, `countInRange A N > 0` for all sufficiently large N, so the division-by-zero issue only arises finitely often and is handled by the `atTop` filter. + +- **`IsAdditiveBasis` definition**: The "at most r summands" formulation via `∃ k ≤ r, n ∈ exactSumset A k` is the standard definition. Note that `exactSumset A 0 = {0}` (empty sum), so for `k = 0` only `n = 0` is representable. This is correct. + +- **`sumset` definition**: `{n | ∃ a ∈ A, ∃ b ∈ A, n = a + b}` is the standard 2-fold sumset A + A. Correct. + +**No mathematical flaws identified.** The formalization faithfully captures Erdos Problem 337. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Opportunities exist: `sumset` → Mathlib pointwise, density → `Set.HasDensity`. `IsAdditiveBasis` has a semantic gap with library version. Definitions duplicated across 336-339. | +| Citations | Complete and accurate. All four references match the website. | +| Variants | The h-fold generalization is mentioned but not formalized. The [RT85] positive result and conjecture are missing entirely. | +| Readability | Good. Minor inconsistency between docstring and code for `countInRange` range convention. | +| Formalizability | Fully formalizable, no ambiguity. | +| Correctness | Mathematically correct and complete for the core problem as stated. | diff --git a/ai-review/338.md b/ai-review/338.md new file mode 100644 index 0000000000..c7bf9c0ea5 --- /dev/null +++ b/ai-review/338.md @@ -0,0 +1,111 @@ +# AI Review: Erdos Problem 338 + +## 1. Code Reuse + +Several definitions in this file are duplicated verbatim across the 336–339 problem cluster: + +- **`exactSumset`**: Defined identically in `ErdosProblems/336.lean`, `337.lean`, `338.lean`, and `339.lean`. All four use `{n : ℕ | ∃ (f : Fin k → ℕ), (∀ i, f i ∈ A) ∧ n = ∑ i, f i}`. + +- **`IsAdditiveBasis`**: Also duplicated across all four files. The library provides `Set.IsAsymptoticAddBasisOfOrder` in `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`, which uses `∀ᶠ a in cofinite, a ∈ A ^ n`. However, there is a **semantic mismatch**: the local definition allows *at most* `h` summands (`∃ k ≤ h, n ∈ exactSumset A k`), while the library definition requires *exactly* `n` summands (membership in `A ^ n`). These coincide when `0 ∈ A` (padding with zeros), but differ otherwise. The local definition is more faithful to the standard additive number theory convention. + +- **`IsDistinctSum`** and **`HasRestrictedOrder`/`HasRestrictedOrderAtMost`**: These are unique to Problem 338 and have no library equivalents. They correctly capture the "restricted order" concept using `Finset` (whose elements are distinct by construction) with `s.sum id`. + +**Recommendation**: Consider extracting the shared definitions (`exactSumset`, `IsAdditiveBasis`) into a common utility file to eliminate duplication across Problems 336–339. The `IsDistinctSum`/`HasRestrictedOrder` definitions are appropriately problem-specific. + +## 2. Citations + +The formalization cites only: + +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The [erdosproblems.com/338](https://www.erdosproblems.com/338) website lists several additional references that are relevant to results mentioned in the docstring: + +- **[Ke57]** Kelly (1957) — proved that any basis of order 2 has restricted order at most 4. *Referenced in the docstring but not cited.* +- **[He05]** Hennecart (2005) — constructed a basis of order 2 with restricted order exactly 4, disproving Kelly's conjecture. *Referenced in the docstring but not cited.* +- **[HHP07]** Hegyvári, Hennecart, and Plagne (2007) — proved that for all $k \geq 2$, there exists a basis of order $k$ with restricted order at least $2^{k-2} + k - 1$. *Not mentioned in the docstring.* +- **[Pa33]** — squares have order 4 and restricted order 5. *Not mentioned.* +- **[Sc54]** — triangular numbers have order 3 and restricted order 3. *Not mentioned.* + +**Recommendation**: Add full citations for [Ke57] and [He05] since their results are already discussed in the docstring. Consider adding [HHP07] as well, since the lower bound result is significant context for the problem. + +## 3. Variants + +The problem on erdosproblems.com asks three distinct questions: + +1. **Necessary and sufficient conditions** for restricted order to exist. +2. **Bounding restricted order** in terms of the order of the basis. +3. **The sub-conjecture**: If $A \setminus F$ is a basis of the same order $h$ for every finite $F$, must $A$ have a restricted order? + +Only question (3) is formalized. This is a reasonable choice since questions (1) and (2) are open-ended and difficult to formalize precisely. However, several concrete known results could be formalized as separate theorems: + +- **Kelly's theorem**: Any basis of order 2 has restricted order at most 4. This is a clean, precise statement. +- **Hennecart's construction**: There exists a basis of order 2 with restricted order exactly 4. +- **Bateman's observation** (mentioned in the docstring): For $h \geq 3$, $A = \{1\} \cup \{x > 0 : h \mid x\}$ has order $h$ but no restricted order. This could be formalized as a concrete counterexample. +- **Hegyvári-Hennecart-Plagne lower bound [HHP07]**: For all $k \geq 2$, there exists a basis of order $k$ with restricted order at least $2^{k-2} + k - 1$. + +**Recommendation**: At minimum, Bateman's observation and Kelly's theorem are precise enough to warrant separate formalized statements, as they provide important context and are mentioned in the docstring. + +## 4. Readability + +The code is well-structured and readable: + +- The `Erdos338` namespace prevents name collisions. +- All definitions have clear, accurate docstrings with LaTeX-style mathematical notation. +- The layered structure (`exactSumset` → `IsAdditiveBasis`, `IsDistinctSum` → `HasRestrictedOrderAtMost` → `HasRestrictedOrder`) builds up concepts cleanly. +- The docstring on `erdos_338` provides good mathematical context, explaining Bateman's, Kelly's, and Hennecart's contributions before stating the sub-conjecture. + +Minor observations: + +- The `open scoped BigOperators` is appropriate for the `∑` notation used in `exactSumset`. +- The main theorem statement is concise and reads naturally: "for all A and h, if A \ F is a basis of order h for every finite F, then A has a restricted order." + +No readability issues identified. + +## 5. Formalizability + +The sub-conjecture as formalized is **precisely and unambiguously formalizable**. The statement is: + +> If $A \setminus F$ is a basis of the same order $h$ for every finite set $F \subseteq \mathbb{N}$, must $A$ have a restricted order? + +This is a clear yes/no question with well-defined terms. All concepts involved (additive basis, restricted order, finite set removal) have standard mathematical definitions that are faithfully captured. + +One subtlety worth noting: the formalization does **not** require $h$ to be the *minimal* order of the basis. In the standard definition, "basis of order $h$" sometimes means $h$ is the least such integer. However, this does not affect correctness here: the condition "A \ F is a basis of order h for every finite F" is actually *stronger* when $h$ is the true (minimal) order, since that constraint is harder to maintain under removal. For non-minimal $h$, the hypothesis is easier to satisfy, making the conjecture (if true) a stronger statement. In practice, the two formulations are equivalent because if the conjecture holds for the minimal order, it holds a fortiori for any larger $h$. + +The broader questions (1) and (2) from the problem statement are inherently open-ended ("what are necessary and sufficient conditions?") and are **not straightforwardly formalizable** without choosing a specific conjectured characterization. + +**Assessment**: The chosen sub-conjecture is fully formalizable with no ambiguity. The broader problem is inherently open-ended. + +## 6. Correctness + +The formalization is **mathematically correct** for the sub-conjecture it encodes. + +**Detailed verification:** + +- **`exactSumset A k`**: Correctly defines the set of sums of exactly $k$ elements from $A$ with repetition allowed, using `f : Fin k → ℕ` (which allows repeated values). The condition `n = ∑ i, f i` is the standard encoding. + +- **`IsAdditiveBasis A h`**: The "at most $h$ summands" formulation via `∃ k ≤ h, n ∈ exactSumset A k` is the standard asymptotic definition. Note that `exactSumset A 0 = {0}` (the empty sum), so `k = 0` only covers `n = 0`, which is correct. + +- **`IsDistinctSum A t n`**: Uses `Finset ℕ` whose elements are automatically distinct. The condition `↑s ⊆ A ∧ s.card ≤ t ∧ s.sum id = n` correctly encodes "n is a sum of at most t distinct elements from A." The use of `s.sum id` (rather than indexed sums) is appropriate for distinct-element sums. + +- **`HasRestrictedOrderAtMost A t`**: Correctly wraps `IsDistinctSum` with an asymptotic quantifier (`∃ N₀, ∀ n ≥ N₀`). + +- **`HasRestrictedOrder A`**: Existentially quantifies over `t`, correctly capturing "some finite restricted order exists." + +- **Main theorem**: `∀ (A : Set ℕ) (h : ℕ), (∀ (F : Finset ℕ), IsAdditiveBasis (A \ ↑F) h) → HasRestrictedOrder A`. This correctly encodes the sub-conjecture. Crucially, the hypothesis `∀ F, IsAdditiveBasis (A \ ↑F) h` implies `IsAdditiveBasis A h` (take $F = \emptyset$), so the implicit assumption that $A$ is a basis is captured. + +- **Consistency with Bateman's example**: For $h \geq 3$, $A = \{1\} \cup \{x > 0 : h \mid x\}$ has order $h$ but removing $\{1\}$ yields $\{x > 0 : h \mid x\}$, which is NOT a basis (non-multiples of $h$ are unrepresentable). So Bateman's example fails the hypothesis, which is consistent — the sub-conjecture is not contradicted. + +- **Problem status**: The theorem is stated unconditionally (not wrapped in `answer(...)`) as a positive assertion. This is appropriate for an open conjecture believed to be true. + +**No mathematical flaws identified.** The formalization faithfully captures the intended sub-conjecture of Erdős Problem 338. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `exactSumset` and `IsAdditiveBasis` duplicated across Problems 336–339; should be extracted. Library `IsAsymptoticAddBasisOfOrder` has a semantic gap ("exactly n" vs "at most n" summands). | +| Citations | Only [ErGr80] cited. Missing full citations for [Ke57] and [He05] (referenced in docstring) and [HHP07] (significant related result). | +| Variants | Only the sub-conjecture (robustness → restricted order) is formalized. Bateman's observation, Kelly's theorem, Hennecart's construction, and the HHP lower bound are all precise enough to formalize separately. | +| Readability | Excellent. Clean layered definitions, clear docstrings, well-structured namespace. | +| Formalizability | The sub-conjecture is fully formalizable with no ambiguity. The broader problem is inherently open-ended. | +| Correctness | Mathematically correct and complete. All definitions faithfully capture standard concepts. The hypothesis correctly implies A is a basis. Consistent with known results (Bateman's example). | diff --git a/ai-review/339.md b/ai-review/339.md new file mode 100644 index 0000000000..a178c54e13 --- /dev/null +++ b/ai-review/339.md @@ -0,0 +1,87 @@ +# Erdős Problem 339 — Review + +## 1. Code Reuse + +**Several definitions are duplicated across problems and could be consolidated.** + +- **`exactSumset`**: Identically defined in Problems 336 (`336.lean:39`), 337 (`337.lean:50`), 338 (`338.lean:33`), and 339 (`339.lean:39`). This should be factored into a shared utility. + +- **`IsAdditiveBasis`**: Identically defined in Problems 336 (`336.lean:44`), 337 (`337.lean:55`), 338 (`338.lean:38`), and 339 (`339.lean:44`). Same consolidation opportunity. + +- **`lowerDensity`**: A more general and well-developed version exists in `FormalConjecturesForMathlib/Data/Set/Density.lean:60–62` as `Set.lowerDensity`, using `partialDensity` and `Set.interIio`. For `ℕ`, both definitions compute the same quantity (proportion of elements < N that lie in the set), but the library version is more general (works for any `LocallyFiniteOrderBot` preorder) and already has proven properties (`lowerDensity_nonneg`, `lowerDensity_le_one`). The local definition in `339.lean:53` uses `Finset.range N` and division by `N`, which is equivalent for `ℕ` but less general. + +- **`Set.IsAsymptoticAddBasisOfOrder`** from `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` is related but **not directly substitutable**: it defines "every cofinitely many elements lie in `A ^ n`" (exactly n summands), whereas `IsAdditiveBasis` in Problem 339 means "at most r summands." These are genuinely different concepts. The library definition is closer to `HasExactOrder` from Problem 336. + +**Recommendation**: Factor `exactSumset` and `IsAdditiveBasis` into a shared file (e.g., the existing `Basis.lean` utility). Replace the local `lowerDensity` with `Set.lowerDensity` from the library, or at minimum document why the local version is preferred. + +## 2. Citations + +The formalization includes two references: + +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✅ Matches the website source. +- **[HHP03]** — Hegyvári, N., Hennecart, F. and Plagne, A., *A proof of two Erdős' conjectures on restricted addition and further results*. J. Reine Angew. Math. (2003). ✅ Matches the website. + +The website additionally credits Boris Alexeev, Wouter van Doorn, and Mehtaab Sawhney for contributions to the problem page. This is metadata about the website, not a mathematical citation, so omission is acceptable. + +**No issues with citations.** + +## 3. Variants + +The website describes a **second question** that is **not captured** by the formalization: + +> Erdős and Graham also posed whether: if the set of integers which are the sum of r elements from A has positive upper density, then must the set of integers representable as the sum of exactly r distinct elements have positive upper density? + +This variant weakens the hypothesis (from "A is a basis of order r" to "the r-fold sumset has positive upper density") and weakens the conclusion (from positive *lower* density to positive *upper* density). It was also answered affirmatively by HHP03. + +**Recommendation**: Add a second theorem capturing this variant. The definitions needed (`upperDensity`, `exactSumset`) are already available or easily defined. + +## 4. Readability + +The code is well-structured and readable: + +- Clear docstrings on all definitions distinguishing "with repetition" vs "distinct." +- The namespace `Erdos339` avoids name collisions with duplicated definitions in other files. +- The `answer(True)` wrapper clearly signals this is a solved yes/no problem. + +**Minor suggestions**: +- The docstring for `exactSumset` says "with repetition allowed" but technically the `Fin k → ℕ` formulation allows non-injective functions, which implicitly encodes repetition. This is correct but could be more explicit: the function need not be injective. +- The docstring on `distinctExactSumset` (line 47) says "distinct elements from A" which correctly matches the `Finset`-based definition. + +**No significant readability issues.** + +## 5. Formalizability + +The problem is a clean yes/no question and is straightforwardly formalizable. There is no ambiguity in the mathematical statement: + +- "Basis of order r" has a standard meaning (every sufficiently large integer is the sum of at most r elements with repetition). +- "Sum of exactly r distinct elements" is unambiguous. +- "Positive lower density" is a standard and precise notion. + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +### Overall verdict: **Mostly correct, with one subtle concern.** + +**What is correct:** + +- `exactSumset A k` correctly models sums of exactly k elements with repetition (via `Fin k → ℕ` without injectivity). +- `distinctExactSumset A r` correctly models sums of exactly r distinct elements (via `Finset ℕ` with `s.card = r`). +- `lowerDensity` correctly computes `liminf_{N→∞} |A ∩ {0,...,N-1}| / N`. +- The `answer(True)` direction is correct: HHP03 proved the answer is yes. + +**Subtle concern — non-minimality of the order:** + +The formalization's `IsAdditiveBasis A r` means "A is a basis of order *at most* r" (every sufficiently large n has a representation with at most r summands). It does not enforce that r is the *least* such value (the true "order" of the basis). The theorem then quantifies universally over all r: + +``` +∀ (A : Set ℕ) (r : ℕ), IsAdditiveBasis A r → 0 < lowerDensity (distinctExactSumset A r) +``` + +This asks: for *any* r such that A is a basis of order ≤ r, does `distinctExactSumset A r` have positive lower density? + +Consider: if A is a basis of order 2 (minimal), the formalization also asserts the conclusion for r = 100, asking whether the set of sums of exactly 100 distinct elements from A has positive lower density. This is a potentially different (and likely strictly stronger) statement than the original problem, which asks about the *actual* order r. + +However, this is unlikely to be mathematically incorrect — if A is a basis of order h and r ≥ h, then `distinctExactSumset A r` should still have positive lower density (the HHP03 proof likely generalizes). But it is worth noting that the formalization is technically a stronger claim than what appears on the website. + +**No other correctness issues identified.** The edge cases (r = 0, r = 1) are handled correctly: `IsAdditiveBasis A 0` is unsatisfiable for large n, making the implication vacuously true; for r = 1, A must contain all sufficiently large n, so `distinctExactSumset A 1 = A` trivially has density 1. diff --git a/ai-review/34.md b/ai-review/34.md new file mode 100644 index 0000000000..47dad7f04c --- /dev/null +++ b/ai-review/34.md @@ -0,0 +1,177 @@ +# Review: Erdős Problem 34 + +**File:** `FormalConjectures/ErdosProblems/34.lean` + +--- + +## 1. Code Reuse + +**Observation: `consecutiveSums` closely mirrors `contiguousSubSums` from Problem 356.** + +Problem 356 (`FormalConjectures/ErdosProblems/356.lean`, line 40) defines: + +```lean +def contiguousSubSums {k : ℕ} (a : Fin k → ℤ) : Finset ℤ := + ((univ ×ˢ univ).filter (fun p : Fin k × Fin k => p.1 ≤ p.2)).image + (fun p => ∑ i ∈ Icc p.1 p.2, a i) +``` + +Problem 34 defines: + +```lean +noncomputable def consecutiveSums (n : ℕ) (σ : Equiv.Perm (Fin n)) : Finset ℕ := + ((Finset.univ (α := Fin n)) ×ˢ (Finset.univ (α := Fin n))).filter (fun p => p.1 ≤ p.2) + |>.image (fun p => ∑ i ∈ Finset.Icc p.1 p.2, ((σ i).val + 1)) +``` + +These have identical structure — both filter `univ ×ˢ univ` by `p.1 ≤ p.2` and image over `∑ i ∈ Icc p.1 p.2`. The only differences are: +- Problem 34 takes a permutation and applies `(σ i).val + 1`; Problem 356 takes an arbitrary `Fin k → ℤ`. +- Problem 34 returns `Finset ℕ`; Problem 356 returns `Finset ℤ`. + +In principle, `consecutiveSums` could be expressed as `contiguousSubSums (fun i => ↑((σ i).val + 1))` (after casting to ℤ), but the type mismatch (ℕ vs ℤ) and the extra composition make this arguably less readable than the current standalone definition. Given the short length of both definitions, the duplication is tolerable. + +**Recommendation:** If a shared utility is desired, factor the common pattern into a generic `consecutiveSums` helper in `FormalConjecturesForMathlib/Combinatorics/` that both problems import. But this is low priority given the simplicity of each definition. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/34](https://www.erdosproblems.com/34):** + +The website lists: +- **References:** [Er77c, p.71], [ErGr80, p.58], Hegyvári [He86], Konieczny [Ko15] +- **Status:** Solved (disproved), Lean-verified. +- **Related problems:** #356, #357. +- **Additional results:** Bounds on f(n) = max S(π) and g(n) = min S(π). + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős 1977 | Not cited | [Er77c, p.71] | **Missing.** Original source of the problem. | +| Erdős–Graham 1980 | Not cited | [ErGr80, p.58] | **Missing.** Key reference restating the problem. | +| Hegyvári 1986 | `[He86]` with partial expansion | [He86] | **OK.** Present in both module and theorem docstrings. The docstring gives the journal name (Acta Math. Hungar.) but omits volume/pages. | +| Konieczny 2015 | `[Ko15]` with partial expansion | [Ko15] | **OK.** Listed as "preprint (2015)." The website also treats it as a preprint. | + +**Recommendation:** Add [Er77c] and [ErGr80] references to the module docstring. These are the original sources for the problem. + +--- + +## 3. Variants + +The formalization captures only the core "disproved o(n²)" statement. The website discusses several additional results: + +**1. Hegyvári's explicit lower bound (not formalized):** +Hegyvári showed S(π) ≥ (1/18 + o(1))n² for a specific permutation. This could be stated as: +```lean +theorem erdos_34_hegyvari : ∃ σ_seq : (n : ℕ) → Equiv.Perm (Fin n), + ∀ ε > 0, ∃ N, ∀ n ≥ N, + ((consecutiveSums n (σ_seq n)).card : ℝ) ≥ (1/18 - ε) * n^2 +``` + +**2. Konieczny's random permutation result (not formalized):** +A random permutation has ~(1 + e⁻²)/4 · n² distinct consecutive sums almost surely. This is a probabilistic statement and harder to formalize but is the headline result. + +**3. Bounds on f(n) = max_π S(π) (not formalized):** +Konieczny proved 0.286...·n² ≤ f(n) ≤ 0.446...·n². This could be formalized: +```lean +theorem erdos_34_max_bounds : ∃ (c₁ c₂ : ℝ), c₁ > 1/4 ∧ c₂ < 1/2 ∧ + ∀ᶠ n in atTop, ∀ σ : Equiv.Perm (Fin n), + ((consecutiveSums n σ).card : ℝ) ≤ c₂ * n^2 ∧ ... +``` + +**4. Lower bound on g(n) = min_π S(π) (not formalized):** +g(n) ≫ n^{3/2} is proven; it is conjectured that g(n) ≥ n^{2−o(1)}. + +**5. Related problems 356 and 357:** +These are formalized in separate files, which is appropriate. + +**Assessment:** The core disproof is present. The quantitative variants (Hegyvári's bound, Konieczny's bounds on f(n), g(n) bounds) are notable omissions. The g(n) ≫ n^{3/2} result and the conjecture g(n) ≥ n^{2−o(1)} are particularly natural follow-up formalizations. + +--- + +## 4. Readability + +The code is clean, short, and well-organized. + +- **Module docstring:** Good. Provides mathematical context, states the resolution, and cites the key results. +- **Definition docstring:** Clear. Explains the +1 shift from Fin n to {1,...,n}. +- **Theorem docstring:** Accurately describes the little-o question and its disproof. +- **Namespace:** `Erdos34` is appropriate and consistent with other files. +- **Open declarations:** `Finset BigOperators Equiv` are all used and appropriate. + +**Minor suggestions:** +- The `noncomputable` annotation on `consecutiveSums` is necessary due to `Finset.image` with a decidable equality instance. This is standard but could merit a brief comment for readers unfamiliar with Lean. +- The module docstring says "Disproved by Hegyvári [He86]; Konieczny [Ko15] showed..." which correctly attributes the initial disproof to Hegyvári and the stronger quantitative result to Konieczny. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement "Is it true that S(π) = o(n²) for all π ∈ Sₙ?" is precise: +- "S(π)" = number of distinct consecutive sums of a permutation. +- "o(n²) for all π ∈ Sₙ" = uniformly for all permutations of each size n. + +There is no ambiguity in what "consecutive sums" means (sums of contiguous subsequences of the permutation), nor in what "o(n²) for all π" means. + +The only minor interpretive choice is whether "o(n²) for all π" means: +- (A) For every sequence of permutations πₙ ∈ Sₙ, S(πₙ) = o(n²), or equivalently +- (B) ∀ε > 0, ∃N, ∀n ≥ N, ∀σ ∈ Sₙ, S(σ) ≤ εn². + +These are logically equivalent (since (B) ⟹ (A) trivially, and ¬(B) ⟹ ¬(A) by extracting a witnessing sequence). The formalization uses (B), which is the more natural Lean statement. + +**Ambiguity level: Very low.** This is about as unambiguous as combinatorial problem statements get. + +--- + +## 6. Correctness + +**The formalization is correct.** + +### Detailed analysis of `consecutiveSums` + +The definition computes, for each pair (u, v) with u ≤ v in Fin n: + +$$\sum_{i \in [u, v]} (\sigma(i).\text{val} + 1)$$ + +Since σ is a permutation of Fin n, the values σ(i).val range over {0, 1, ..., n−1}. Adding 1 gives values in {1, 2, ..., n}, correctly modeling a permutation of {1, ..., n} as in the original problem. The image collects all such sums into a `Finset ℕ`, and its cardinality gives S(π). + +### Detailed analysis of the theorem statement + +The theorem states: + +``` +answer(False) ↔ ∀ ε : ℝ, ε > 0 → ∃ N : ℕ, ∀ n : ℕ, n ≥ N → ∀ σ : Equiv.Perm (Fin n), + ((consecutiveSums n σ).card : ℝ) ≤ ε * (n : ℝ) ^ 2 +``` + +The `answer(False)` macro expands to `False`. So the theorem is: + +``` +False ↔ (∀ ε > 0, ∃ N, ∀ n ≥ N, ∀ σ, S(σ) ≤ ε·n²) +``` + +This requires the RHS to be `False`. Is it? + +The negation of the RHS is: ∃ ε > 0, ∀ N, ∃ n ≥ N, ∃ σ ∈ Sₙ, S(σ) > ε·n². + +Hegyvári [He86] constructed, for each n, a permutation with S(π) ≥ (1/18 + o(1))·n² distinct consecutive sums. So taking ε = 1/36, for all sufficiently large n, Hegyvári's permutation has S(π) > n²/36. This witnesses the negation, making the RHS false. + +Therefore `False ↔ False` is `True`, and the theorem is provable. ✓ + +### Edge cases + +- **n = 0:** Fin 0 is empty, so `consecutiveSums 0 σ = ∅`, card = 0 ≤ 0 = ε·0². Fine. +- **n = 1:** Only one permutation (id), one pair (0,0), one sum = 1, so card = 1. Need 1 ≤ ε·1 for all ε > 0? No — for ε = 0.5, this fails. But the statement only requires ∃ N such that ∀ n ≥ N the bound holds. Since we're taking the RHS to be false, the small-n cases are irrelevant. + +### AMS classification + +The tag `AMS 5` is present alongside no other specific number. `AMS 5` corresponds to "Combinatorics" in the project's AMS scheme. This is appropriate for the problem. (Problem 356, which is closely related, uses `AMS 5 11`, adding number theory.) + +### Summary + +The formalization correctly captures the mathematical content of Erdős Problem 34. The `consecutiveSums` definition properly models S(π) via the +1 shift from 0-indexed Fin n to {1,...,n}. The little-o formalization is standard and equivalent to the informal statement. The `answer(False)` correctly indicates the conjecture was disproved. No correctness issues were found. + +**Verdict: Correct. No bugs identified.** The formalization is a faithful and complete rendering of the core problem. The main areas for improvement are adding missing citations ([Er77c], [ErGr80]) and potentially adding quantitative variant statements. diff --git a/ai-review/342.md b/ai-review/342.md new file mode 100644 index 0000000000..10870f39a8 --- /dev/null +++ b/ai-review/342.md @@ -0,0 +1,127 @@ +# Review: Erdős Problem 342 + +## 1. Code Reuse + +**`upperDensity` should use the library definition.** + +The file defines a local `upperDensity` (line 55–57): +```lean +noncomputable def upperDensity (A : Set ℕ) : ℝ := + limsup (fun N : ℕ => ((Finset.range N).filter (· ∈ A)).card / (N : ℝ)) atTop +``` + +`FormalConjecturesForMathlib/Data/Set/Density.lean` already provides `Set.upperDensity`, which is a more general and well-supported definition using `partialDensity` and `Set.ncard`. For `β = ℕ` with `A = Set.univ` (default), the library definition computes `|S ∩ {0,…,b-1}| / b`, which is mathematically identical to the local version (`|{k ∈ Finset.range N | k ∈ A}| / N`). The library also ships with useful lemmas (`partialDensity_le_one`, `lowerDensity_le_one`, `HasDensity.mono`, `Nat.hasDensity_zero_of_finite`, etc.) that could be leveraged in proofs. + +**Recommendation:** Replace the local `upperDensity` with `Set.upperDensity` from `FormalConjecturesForMathlib.Data.Set.Density`. This aligns with numerous other Erdős problems (333, 335, 378, 432, 656) that also define local density functions and would similarly benefit from unification. + +No existing Ulam sequence infrastructure exists elsewhere in the codebase; the `IsUlamSequence` and `ulamRepCount` definitions are unique to this file. Problems 471 and 472 are related Ulam problems but concern different constructions (prime-sum sequences) and share no reusable code. + +## 2. Citations + +The docstring cites: +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The website (erdosproblems.com/342) additionally lists: +- **[Gu04]** Guy, R. K., *Unsolved Problems in Number Theory*, Problem C4. +- **Green's open problems list**, Problem 7. + +These additional references are not reflected in the docstring. Consider adding them for completeness, particularly [Gu04] which is a standard reference. + +## 3. Variants + +The website identifies three sub-questions, all of which are captured: + +| Question | Formalization | +|---|---| +| Infinitely many twin pairs (a, a+2)? | `erdos_342` (Part 1) | +| Eventually periodic differences? | `erdos_342.variants.periodic` (Part 2) | +| Upper density equal to 0? | `erdos_342.variants.density` (Part 3) | + +**All variants are accounted for.** No additional variants appear on the website. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The docstring for `IsUlamSequence` says "OEIS A002858" — good for cross-referencing. +- The docstring for Part 1 lists the sequence as `1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, …`, matching OEIS A002858. Correct. +- The `ulamRepCount` function is clearly documented. Its name and signature are self-explanatory. +- The `IsUlamSequence` predicate neatly combines all three conditions (initial values, strict monotonicity, minimality) in a single conjunction. +- The local `upperDensity` definition has a clear LaTeX docstring explaining the mathematical formula. + +**No significant readability issues.** + +## 5. Formalizability + +The Ulam sequence is a fully deterministic, computable sequence — given the initial conditions a(0) = 1, a(1) = 2, each subsequent term is uniquely determined as the least integer greater than the previous term with exactly one representation as a sum of two distinct earlier terms. There is **no ambiguity** in the definition. + +All three sub-problems ask precise yes/no questions about this unique sequence: +1. Is a specific set infinite? +2. Does a specific eventual periodicity condition hold? +3. Does a specific real-valued quantity equal 0? + +**Assessment: Fully formalizable with no ambiguity.** The problem is as clean as it gets for formalization — a concrete, computable sequence with precise questions about its properties. + +## 6. Correctness + +### 6a. `ulamRepCount` (line 39–42) + +Counts pairs `(i, j)` with `i < j` and both in `Fin n` (i.e., `i, j ∈ {0, …, n-1}`) such that `a(i) + a(j) = m`. This correctly counts representations using the first `n` terms of the sequence, with the ordering constraint `i < j` ensuring each unordered pair is counted once. + +### 6b. `IsUlamSequence` (line 47–52) + +- `a 0 = 1 ∧ a 1 = 2`: Correct initial conditions (0-indexed version of a₁ = 1, a₂ = 2). +- `∀ n, 2 ≤ n → a (n - 1) < a n`: Strict monotonicity for n ≥ 2. Combined with a(0)=1 < a(1)=2, the full sequence is strictly increasing. **Correct.** +- `ulamRepCount a n (a n) = 1`: The value `a(n)` has exactly one representation as a sum of two distinct earlier terms. **Correct.** +- `∀ m, a (n - 1) < m → m < a n → ulamRepCount a n m ≠ 1`: Every integer between `a(n-1)` and `a(n)` fails to have exactly one representation, ensuring `a(n)` is the *least* such integer. **Correct.** + +The predicate uniquely characterizes the Ulam sequence, so universally quantifying over all `a` satisfying `IsUlamSequence` is equivalent to asserting the property for *the* Ulam sequence. **This is sound.** + +### 6c. Part 1 — Twin pairs (line 70–73) + +```lean +∀ a : ℕ → ℕ, IsUlamSequence a → + Set.Infinite {n : ℕ | ∃ m, a m = a n + 2} +``` + +This asserts: the set of indices `n` such that `a(n) + 2` is also a value in the sequence is infinite. Since the sequence is strictly increasing (injective), infinitely many such indices correspond to infinitely many distinct values `v` with both `v` and `v + 2` in the sequence. **Correctly captures "infinitely many pairs a, a+2 occur."** + +### 6d. Part 2 — Periodic differences (line 83–87) + +```lean +∀ a : ℕ → ℕ, IsUlamSequence a → + ∃ N p : ℕ, 0 < p ∧ ∀ n, N ≤ n → + a (n + p + 1) - a (n + p) = a (n + 1) - a n +``` + +Uses natural number subtraction, which truncates at 0. However, since the Ulam sequence is strictly increasing, `a(k+1) > a(k)` for all `k`, so all differences are positive and the subtraction behaves as intended. The condition states that the difference sequence `a(n+1) - a(n)` is eventually periodic with period `p`. **Mathematically correct.** + +### 6e. Part 3 — Density zero (line 95–98) + +```lean +∀ a : ℕ → ℕ, IsUlamSequence a → + upperDensity (Set.range a) = 0 +``` + +Asks whether the upper density of the set of values in the Ulam sequence is zero. **Correct.** + +### 6f. `answer(sorry)` orientation + +All three parts use `answer(sorry) ↔ (mathematical statement)`. If the answer is `True`, the mathematical statement holds (twin pairs are infinite / differences are periodic / density is zero). This correctly encodes open yes/no questions where the answer is unknown. **Correct.** + +### Overall Correctness Assessment + +**The formalization is mathematically correct and complete.** The Ulam sequence definition faithfully captures the classical construction, and all three problem variants are accurately formalized. No flaws identified. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Local `upperDensity` should use `Set.upperDensity` from library | +| Citations | Missing [Gu04] and Green's list references from website | +| Variants | All three variants captured | +| Readability | Good, no issues | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete, no mathematical flaws | diff --git a/ai-review/343.md b/ai-review/343.md new file mode 100644 index 0000000000..618ade993b --- /dev/null +++ b/ai-review/343.md @@ -0,0 +1,124 @@ +# AI Review: Erdős Problem 343 + +## 1. Code Reuse + +Several definitions in `343.lean` duplicate or closely parallel existing infrastructure: + +- **`ContainsInfiniteAP`** (line 52): Identical to `Erdos344.ContainsInfiniteAP` in `ErdosProblems/344.lean:42`. These should ideally be unified into a shared definition (e.g., in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`). The existing `Set.IsAPOfLengthWith` from `AP/Basic.lean:43` already supports infinite length (`l = ⊤`), so `ContainsInfiniteAP S` could be expressed as `∃ a d, S.IsAPOfLengthWith ⊤ a d ∧ 0 < d` (modulo the positivity constraint on `d`), though the current standalone definition is arguably more readable. + +- **`countUpTo`** (line 41): This is a custom counting function for multiset multiplicities. The codebase has `Set.lowerDensity` and `Set.HasPosDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean`, but those are defined for *sets* (not multisets with multiplicities), so they cannot directly replace this definition. The custom counting function is justified here because the problem fundamentally involves multisets. + +- **`subsetSums`** (line 47): This differs from `Erdos344.subsetSums` (line 37 of 344.lean) because 343 deals with multisets (submultisets via `ℕ →₀ ℕ`) while 344 deals with plain sets (subsets via `Finset ℕ`). The distinction is correct and necessary. + +**Verdict:** The `ContainsInfiniteAP` duplication with Problem 344 is the main reuse opportunity. The other definitions are appropriately specialized for the multiset setting. + +## 2. Citations + +**Website content** (fetched from erdosproblems.com/343): +- Source: [ErGr80, p. 54] +- Solved by Szemerédi and Vu [SzVu06] +- Attributed as "a problem of Folkman" +- Historical note: Folkman [Fo66] proved the result under the stronger condition `|A ∩ {1,…,N}| ≫ N^{1+ε}` and showed the linear threshold is best possible + +**Formalization citations:** +- [ErGr80] ✅ Correctly cited with full title and year +- [SzVu06] ✅ Correctly cited with full title and year +- The docstring mentions "A problem of Folkman" ✅ + +**Missing:** The website mentions Folkman's 1966 paper [Fo66] as establishing a weaker result and showing optimality of the threshold. This is not cited in the formalization, but it is a secondary reference rather than the primary problem source or solution, so its omission is acceptable. + +## 3. Variants + +The website describes one key variant/related result: + +- **Folkman's weaker result:** Folkman proved the statement holds under the stronger condition `|A ∩ {1,…,N}| ≫ N^{1+ε}`. This is essentially captured by Erdős Problem 344 (`344.lean`), which formalizes the `√N` threshold version (also proved by Szemerédi–Vu). The two problems together cover the main variants. + +- **Folkman's optimality construction:** For all `ε > 0`, there exists a multiset with `|A ∩ {1,…,N}| ≫ N^{1-ε}` that is *not* subcomplete. This negative result is not formalized but would be a natural companion statement. + +**Verdict:** The main positive result is captured. The optimality/sharpness result is not formalized but is arguably a separate problem. + +## 4. Readability + +The code is well-structured and readable: + +- The module docstring clearly explains the problem, its status, and references. +- Each helper definition has a clear docstring explaining the mathematical meaning. +- The `countUpTo` name is descriptive. +- The `subsetSums` definition using `Finsupp` (`ℕ →₀ ℕ`) is a clean encoding of submultisets. + +**Minor suggestions:** +- The theorem docstring says `|A ∩ {1, …, N}| ≫ N` — the asymptotic notation `≫` is informal. The formal statement uses `c * N ≤ countUpTo mult N`, which is the correct encoding of "positive lower density." This is fine as a docstring convention. +- The namespace `Erdos343` is clean and avoids polluting the global namespace. + +## 5. Formalizability + +The problem statement is: + +> If a multiset of positive integers has positive lower density, must its set of finite subset sums contain an infinite arithmetic progression? + +**Assessment: Clearly formalizable, low ambiguity.** + +- "Multiset of positive integers" → represented as `mult : ℕ → ℕ` with `mult 0 = 0`. This is a standard encoding. +- "Positive lower density" → `∃ c > 0, ∀ N > 0, c * N ≤ countUpTo mult N`. This is slightly stronger than the standard liminf definition of lower density (which would be `liminf_{N→∞} countUpTo(N)/N > 0`). See the correctness section for discussion. +- "Subset sums contain an infinite arithmetic progression" → `ContainsInfiniteAP (subsetSums mult)`. Unambiguous. +- "Subcomplete" is a well-defined term in additive combinatorics. ✅ + +The only potential ambiguity is whether "positive lower density" means `liminf > 0` or `∀ N, c·N ≤ count(N)`. See below. + +## 6. Correctness + +### 6a. The density condition + +The formalization states (line 70): +``` +∃ c : ℝ, 0 < c ∧ ∀ N : ℕ, 0 < N → c * (N : ℝ) ≤ (countUpTo mult N : ℝ) +``` + +This says: there exists `c > 0` such that for **all** `N > 0`, `countUpTo(N) ≥ c·N`. + +The standard meaning of "positive lower density" is: `liminf_{N→∞} countUpTo(N)/N > 0`, which only requires the bound to hold for **sufficiently large** N. + +**The formalization's condition is strictly stronger.** With the `∀ N > 0` formulation, the bound must hold even for small N. With the standard liminf definition, one would write: +``` +∃ c : ℝ, 0 < c ∧ ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → c * (N : ℝ) ≤ (countUpTo mult N : ℝ) +``` + +However, this discrepancy is **mathematically immaterial** for the truth of the theorem: if the result holds under the stronger hypothesis (all N), it certainly holds under the weaker one (sufficiently large N), because one can always discard finitely many elements from the multiset without changing the subset sum set significantly. The formalization proves a *stronger* statement (stronger hypothesis → same conclusion), so the proved theorem implies the standard version. But strictly speaking, the converse direction is what we want: proving it for the weaker hypothesis. Since the answer is `True` and the formalization wraps the statement in `answer(True) ↔ ...`, the right-to-left direction (showing the `∀ N` version implies `True`) is trivially weaker. The left-to-right direction requires proving the `∀ N` version, which is indeed stronger than needed but still true (and provable from the Szemerédi–Vu result). + +**Verdict:** Technically the density condition is stronger than the standard definition, but this is benign — it does not affect correctness of the formalization as a captured mathematical theorem. + +### 6b. The multiset encoding + +Using `mult : ℕ → ℕ` with `mult 0 = 0` to represent a multiset of positive integers is correct. The condition `mult 0 = 0` ensures no copies of 0 are included, and `mult n` gives the multiplicity of each positive integer `n`. + +### 6c. The subset sums definition + +``` +{s : ℕ | ∃ (b : ℕ →₀ ℕ), (∀ n, b n ≤ mult n) ∧ s = b.sum (fun n k => n * k)} +``` + +This defines `subsetSums` as the set of all values `∑ n * b(n)` where `b` is a finitely-supported function with `b(n) ≤ mult(n)`. This correctly captures "choose a finite submultiset and sum its elements (with multiplicity)." + +**One subtlety:** The sum `b.sum (fun n k => n * k)` includes the term for `n = 0`, but since `b 0 ≤ mult 0 = 0` forces `b 0 = 0`, the `n = 0` term contributes `0 * 0 = 0`. This is correct. + +### 6d. The `ContainsInfiniteAP` definition + +``` +∃ (a d : ℕ), 0 < d ∧ ∀ n : ℕ, a + n * d ∈ S +``` + +This is a standard and correct definition of "S contains an infinite arithmetic progression." The requirement `0 < d` excludes trivial constant progressions. ✅ + +### 6e. Overall theorem structure + +The theorem is wrapped as `answer(True) ↔ ∀ mult, ...`, asserting the answer is "yes." This matches the website: the problem was proved affirmatively by Szemerédi and Vu. ✅ + +### 6f. The `countUpTo` definition + +``` +∑ k ∈ Finset.range N, mult (k + 1) +``` + +This sums `mult(1) + mult(2) + ... + mult(N)`, which correctly counts elements with multiplicity in `{1, …, N}`. Note: `Finset.range N = {0, 1, ..., N-1}`, so `k+1` ranges over `{1, ..., N}`. ✅ + +**Overall Correctness: Sound.** The formalization correctly captures the mathematical content of Erdős Problem 343. The only deviation from the most standard formulation is the density condition being slightly stronger than necessary (all N vs. sufficiently large N), which does not affect mathematical correctness. diff --git a/ai-review/344.md b/ai-review/344.md new file mode 100644 index 0000000000..f55cd7a125 --- /dev/null +++ b/ai-review/344.md @@ -0,0 +1,98 @@ +# Erdős Problem 344 — Review + +## 1. Code Reuse + +**Several opportunities for reuse exist.** + +- **`subsetSums`**: A generic `subsetSums` is already defined in `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean:26-27` for any `AddCommMonoid M`: + ```lean + def subsetSums (A : Set M) : Set M := + {n | ∃ B : Finset M, ↑B ⊆ A ∧ n = ∑ i ∈ B, i} + ``` + The local definition in 344.lean (`B.sum id = s`) is definitionally equivalent for `ℕ` but differs in the order of equality and uses `B.sum id` instead of `∑ i ∈ B, i`. Problems 253 and 347 already import and use the shared `subsetSums` from AdditivelyComplete.lean rather than defining their own. Problem 344 should do the same. Note that the shared definition also comes with `subsetSums_mono` and related lemmas that would be useful. + +- **`ContainsInfiniteAP`**: This predicate is defined identically in both `Erdos343` (line 52) and `Erdos344` (line 42). Both define: + ```lean + ∃ (a d : ℕ), 0 < d ∧ ∀ n : ℕ, a + n * d ∈ S + ``` + This should be extracted to a shared utility. The `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` file already defines various AP predicates (`Set.IsAPOfLength`, `Set.ContainsAP`, etc.) but does not appear to have an exact match for "contains an infinite arithmetic progression as a subset." A shared definition would benefit problems 343, 344, and potentially others. + +- **`IsAddComplete`** from AdditivelyComplete.lean captures "every sufficiently large integer is a subset sum," which is the concept of completeness. The notion of "subcompleteness" (subset sums contain an infinite AP) is weaker. These are related but distinct: completeness implies subcompleteness. The formalization correctly targets subcompleteness. + +## 2. Citations + +The formalization includes two references: +- **[ErGr80]**: Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). — **Matches the website.** The website specifies page 54 and the docstring includes "p.54." +- **[SzVu06]**: Szemerédi, E. and Vu, V.H., *Finite and infinite arithmetic progressions in sumsets*. Annals of Mathematics (2006). — **Matches the website.** + +**Missing citation**: The website also references **[Er61b]** in the context of the open variant (showing that the threshold `(2N)^{1/2}` would be best possible). Since the open variant is not formalized (see §3), this omission is acceptable, but if the variant were added, this citation should be included. + +The docstring correctly notes both the Szemerédi–Vu proof and Folkman's earlier partial result. + +## 3. Variants + +**One variant is missing.** + +The website describes an open conjecture: whether the result holds under the sharper condition `|A ∩ {1,...,N}| ≥ (2N)^{1/2}` for all `N`, which [Er61b] (1961) shows would be best possible. This is a question about the optimal constant: the Szemerédi–Vu result proves the asymptotic version (`≫ N^{1/2}`, i.e., for *some* `c > 0` and sufficiently large `N`), while the open variant asks whether the specific constant `c = √2` with no `N₀` offset suffices. A formalization of this variant might look like: + +```lean +@[category research open, AMS 5 11] +theorem erdos_344_sharp + (A : Set ℕ) + (hA_pos : ∀ a ∈ A, 0 < a) + (hgrowth : ∀ N : ℕ, Real.sqrt (2 * N : ℝ) ≤ + (((Finset.Icc 1 N).filter (· ∈ A)).card : ℝ)) : + ContainsInfiniteAP (subsetSums A) := by + sorry +``` + +This captures the "best possible" threshold variant that remains open. + +## 4. Readability + +The code is **well-structured and readable**. Minor observations: + +- The docstring clearly explains the problem, the growth condition, the conclusion, and historical context (Folkman's earlier result and Szemerédi–Vu's proof). This is good. +- The local definitions have clear docstrings explaining the mathematical objects. +- The use of `Finset.Icc 1 N` to represent `{1,...,N}` is standard and clear. +- The hypothesis names (`hA_pos`, `hc`, `hgrowth`) are descriptive. +- One minor readability improvement: the `subsetSums` definition uses `B.sum id` while every other file in the codebase (345, 347, AdditivelyComplete) uses `∑ i ∈ B, i` or `∑ n ∈ B, n`. Switching to the `∑` notation would improve consistency. + +## 5. Formalizability + +**The problem is clearly formalizable with minimal ambiguity.** + +The original problem uses asymptotic notation (`≫`), which the formalization correctly unpacks into explicit quantifiers: `∃ N₀, ∀ N ≥ N₀, c√N ≤ |A ∩ [1,N]|`. The notions of "subset sums" and "infinite arithmetic progression" are standard and unambiguous. + +The only mild ambiguity in the original problem is whether `A` is a set or a multiset. The website says "a set of integers," and the formalization correctly uses `Set ℕ` (not a multiset). Problem 343, which is the multiset generalization, is handled separately. This distinction is appropriate. + +**Assessment: No meaningful ambiguity.** The formalization is a faithful and precise rendering of the mathematical statement. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Growth condition**: The hypothesis `∃ N₀, ∀ N ≥ N₀, c * √N ≤ |A ∩ {1,...,N}|` with universally quantified `c > 0` correctly captures `|A ∩ {1,...,N}| ≫ N^{1/2}`. Since `c` appears as a universally quantified parameter with `hc : 0 < c`, the full statement `∀ c > 0, (growth holds for c) → conclusion` is logically equivalent to `(∃ c > 0, growth holds for c) → conclusion`, which is the intended meaning. + +- **Positivity constraint**: `hA_pos : ∀ a ∈ A, 0 < a` correctly ensures elements of `A` are positive integers (excluding 0). This is needed because including 0 would be mathematically trivial/degenerate, and the original problem concerns positive integers. + +- **Subset sums**: The definition `{s : ℕ | ∃ (B : Finset ℕ), (↑B : Set ℕ) ⊆ A ∧ B.sum id = s}` correctly captures `P(A)` — all sums of finite subsets of `A`. It correctly allows the empty subset (giving 0 ∈ subsetSums A). + +- **Infinite AP**: `∃ (a d : ℕ), 0 < d ∧ ∀ n : ℕ, a + n * d ∈ S` is the standard definition. The constraint `0 < d` correctly excludes the trivial case of a single point repeated. + +- **Solved status**: The `@[category research solved, AMS 5 11]` tag correctly reflects that this was proved by Szemerédi and Vu in 2006. + +**No mathematical flaws identified.** The formalization is a faithful representation of Erdős Problem 344 as stated on the website. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `subsetSums` should use shared definition from AdditivelyComplete.lean; `ContainsInfiniteAP` duplicated with Problem 343 | +| Citations | Complete for the formalized statement; [Er61b] would be needed if sharp variant is added | +| Variants | Open sharp-constant variant `|A ∩ [1,N]| ≥ (2N)^{1/2}` is not captured | +| Readability | Good; minor inconsistency in `B.sum id` vs `∑` notation | +| Formalizability | Unambiguous; cleanly formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/345.md b/ai-review/345.md new file mode 100644 index 0000000000..74f6fa5f0e --- /dev/null +++ b/ai-review/345.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 345 + +## 1. Code Reuse + +**Issue found.** The file defines a local `Erdos345.subsetSums` (line 37) that is a direct duplicate of the library-level `subsetSums` in `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` (line 26). Both have identical definitions: + +```lean +-- 345.lean (local) +def subsetSums (A : Set ℕ) : Set ℕ := + {s | ∃ (B : Finset ℕ), (↑B : Set ℕ) ⊆ A ∧ s = ∑ n ∈ B, n} + +-- AdditivelyComplete.lean (library, generalized over AddCommMonoid) +def subsetSums (A : Set M) : Set M := + {n | ∃ B : Finset M, ↑B ⊆ A ∧ n = ∑ i ∈ B, i} +``` + +The library version is strictly more general (works over any `AddCommMonoid`, not just `ℕ`). Problem 347 already uses the library `subsetSums` (via `local notation "𝓟" A => subsetSums A`). Problem 345 should do the same and remove the local definition. + +Additionally, `thresholdOfCompleteness` is closely related to `IsAddComplete` from AdditivelyComplete.lean. `IsAddComplete A` asserts that `∀ᶠ k in atTop, k ∈ subsetSums A`, which is exactly the condition that the set `{m | ∀ n ≥ m, n ∈ subsetSums A}` is nonempty. While `thresholdOfCompleteness` extracts the actual threshold value (needed for the comparison `T(n^k) > T(n^{k+1})`), it could be worth noting the relationship in a docstring. + +No existing definition of `kthPowers` was found elsewhere in the codebase. This definition is specific to this problem and is appropriately local. + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +The website ([erdosproblems.com/345](https://www.erdosproblems.com/345)) lists the same source as **[ErGr80, p. 55]**, which matches the docstring's reference to "p.55" on line 51. The citation format is acceptable. + +**Missing information:** The website also references **OEIS sequence A001661** (the sequence of threshold values T(n^k)). This could be mentioned in the docstring alongside the known values for additional context and cross-referencing. + +The website additionally notes Erdős and Graham's remark that "very little is known about $T(A)$ in general" and their suggestion that good candidates to investigate are values $k = 2^t$ for large $t$ (potentially $t = 3$) due to "highly restricted values of $n^{2^t} \pmod{2^{t+1}}$." This remark is not reflected in the formalization (see Variants below). + +## 3. Variants + +**Partially captured.** The formalization captures the main question (infinitely many $k$ with $T(n^k) > T(n^{k+1})$) but does not capture the following aspects mentioned on the website: + +1. **The $k = 2^t$ sub-conjecture.** Erdős and Graham specifically suggest investigating $k = 2^t$ for large $t$ as particularly promising candidates. This could be formalized as a stronger variant, e.g., that for infinitely many $t$, $T(n^{2^t}) > T(n^{2^{t+1}})$. + +2. **Known threshold values as test lemmas.** The known values $T(n) = 1$, $T(n^2) = 128$, $T(n^3) = 12758$, $T(n^4) = 5134240$, $T(n^5) = 67898771$ are documented in the docstring but not formalized as separate `@[category test]` lemmas. While these are computationally intensive to verify, they would serve as sanity checks for the definitions. At minimum, $T(n) = 1$ (the simplest case) could be formalized as a test theorem. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The docstring on line 57 uses the notation "$T(n^k) > T(n^{k+1})$" where $n$ is used as both a dummy summation variable in $P(A)$ and as the base of the power. This is consistent with the standard informal notation (where $n^k$ is shorthand for "the set of $k$-th powers") but could momentarily confuse a reader comparing the docstring to the Lean definition. +- The definition `kthPowers` is clear and self-documenting. +- The `thresholdOfCompleteness` docstring helpfully notes it is "(Only meaningful for complete sequences.)" + +## 5. Formalizability + +**High confidence.** The problem is entirely precise: + +- "Threshold of completeness" $T(A)$ is unambiguously defined as the least $m$ such that all $n \geq m$ lie in the set of finite subset sums. +- "$k$-th powers" refers to $\{1^k, 2^k, 3^k, \ldots\}$, which is clearly captured by `kthPowers`. +- The question "are there infinitely many $k$ such that $T(n^k) > T(n^{k+1})$?" is a precise set-theoretic statement. + +There is **no ambiguity** in the problem statement. The only subtlety is that $T(A)$ is only meaningful when $A$ is a complete sequence, but for $k \geq 1$ the sequence of $k$-th powers is known to be complete (a classical result related to Waring's problem for sums of *distinct* powers), so this is not an issue in practice. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`subsetSums` (line 37):** Correctly captures $P(A) = \{\sum_{n \in B} n : B \subseteq A, B \text{ finite}\}$. The use of `Finset ℕ` ensures finiteness. + +- **`thresholdOfCompleteness` (line 43):** Uses `sInf` on `{m : ℕ | ∀ n : ℕ, n ≥ m → n ∈ subsetSums A}`. This correctly returns the least such $m$ when the set is nonempty (i.e., when $A$ is complete). For incomplete sequences, `sInf ∅ = 0` in `ℕ` by Mathlib convention. This edge case is benign: for $k \geq 1$, the sequence of $k$-th powers is complete, so $T$ is well-defined. For $k = 0$, `kthPowers 0 = {1}` (since $n^0 = 1$ for all $n \geq 1$), which is incomplete, giving $T = 0$. Since $0 < 1 = T(n^1)$, the value $k = 0$ would not satisfy $T(n^k) > T(n^{k+1})$, so this edge case does not spuriously contribute to the set and the formalization remains correct. + +- **`kthPowers` (line 47):** The constraint `n ≥ 1` is important — it excludes $0^k = 0$ for $k \geq 1$, which is consistent with the standard convention that the sequence of $k$-th powers is $\{1^k, 2^k, 3^k, \ldots\}$. This is correct. + +- **`erdos_345` (line 63):** The `answer(sorry)` pattern is appropriate for an open problem where the truth value is unknown. The biconditional `answer(sorry) ↔ Set.Infinite {k | ...}` correctly encodes the question. The comparison `thresholdOfCompleteness (kthPowers k) > thresholdOfCompleteness (kthPowers (k + 1))` faithfully captures "there are infinitely many $k$ with $T(n^k) > T(n^{k+1})$." + +- **Known values in docstring:** The values $T(n) = 1$, $T(n^2) = 128$, $T(n^3) = 12758$, $T(n^4) = 5134240$, $T(n^5) = 67898771$ match those on the website and OEIS A001661. Note that these are *increasing*, so for all known $k$ (1 through 4), $T(n^k) < T(n^{k+1})$. The problem asks whether the *opposite* inequality holds infinitely often — an open question that cannot be resolved by finite computation. + +**No mathematical flaws identified.** The formalization is faithful to the original problem. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `subsetSums` duplicates library definition; should use `AdditivelyComplete.subsetSums` | +| Citations | [ErGr80] present and correct; OEIS A001661 reference missing | +| Variants | Main question captured; $k = 2^t$ sub-conjecture and test lemmas for known values not formalized | +| Readability | Good overall; minor notation overlap in docstring | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Mathematically correct and complete; edge cases handled correctly | diff --git a/ai-review/35.md b/ai-review/35.md new file mode 100644 index 0000000000..510e66d81f --- /dev/null +++ b/ai-review/35.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 35 + +## 1. Code Reuse + +Several definitions in this file duplicate existing infrastructure in the codebase: + +**Additive Basis.** `Erdos35.IsAdditiveBasis` is equivalent to `Set.IsAddBasisOfOrder` from `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`. The library version uses `∀ a, a ∈ A ^ n` (pointwise set power), and its equivalence to the `∃ f : Fin n → M, ...` form is proven as `Set.isAddBasisOfOrder_iff` (the `@[to_additive]` of `isMulBasisOfOrder_iff`). The library version is also more general, working over any `CommMonoid`/`AddCommMonoid` rather than just `ℕ`. + +**Sumset.** `Erdos35.sumset` reinvents Mathlib's pointwise `Set.add` (`A + B` via `open scoped Pointwise`), which is definitionally `{n | ∃ a ∈ A, ∃ b ∈ B, n = a + b}` — the same thing. + +**Schnirelmann Density.** This one is more nuanced. The codebase provides `Set.partialDensity`, `Set.upperDensity`, and `Set.lowerDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean`, but these use `limsup`/`liminf` of `|S ∩ {x < b}| / |{x < b}|`. Schnirelmann density is the *infimum* (not liminf) of `|A ∩ {1,...,N}| / N` for `N ≥ 1`, and it starts counting from 1, not 0. So while the existing density infrastructure cannot be directly substituted, it would be worthwhile to add a `schnirelmannDensity` definition to the shared library alongside the existing density concepts, rather than defining it in a local namespace. + +**Recommendation:** Replace `IsAdditiveBasis` with `Set.IsAddBasisOfOrder`, replace `sumset` with Mathlib's pointwise `+`, and move `schnirelmannDensity` to the shared density library. + +## 2. Citations + +The formalization cites only **[Pl70]** (Plünnecke, 1970). The website additionally references: + +- **[Er56]** — Erdős's original source for the problem (1956), where he proved the result with `2k` in the denominator. +- **[Er36c]** — Erdős's earlier related work (1936). +- **Problem 38** — listed as a related problem on the website. + +The [Pl70] citation itself is correctly transcribed: +> Plünnecke, H., *Eine zahlentheoretische Anwendung der Graphentheorie*. J. Reine Angew. Math. 243 (1970), 171–183. + +**Recommendation:** Add [Er56] and [Er36c] references to the docstring. Mention the connection to Problem 38. + +## 3. Variants + +The docstring mentions Plünnecke's stronger inequality `d_s(A + B) ≥ α^{1-1/k}` but does not formalize it as a separate theorem. Additionally, the website notes that Erdős himself proved the weaker bound with `2k` in the denominator. Neither variant is captured. + +**Recommendation:** Add at least the Plünnecke strengthening as a separate theorem statement (e.g., `erdos_35_plunnecke`), since it implies the main result and is the historically important form. Optionally add Erdős's original weaker bound as well. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The `open Classical Finset BigOperators` line opens `Classical` globally, which is heavy-handed. It's not clear that classical reasoning is needed for the *statement* (only for the proof via `sorry`). +- The local namespace `Erdos35` is fine for isolation, but if definitions are refactored to use library versions, it can be simplified significantly. +- The docstring on `IsAdditiveBasis` says "exactly $k$" and then explains why this is equivalent to "at most $k$" — this is clear and well-written. + +## 5. Formalizability + +The problem is **precisely formalizable**. All concepts — Schnirelmann density, additive basis of order $k$, sumset — have standard, unambiguous mathematical definitions. The inequality `d_s(A + B) ≥ α + α(1-α)/k` is a concrete, quantitative statement with no room for interpretation. + +**Ambiguity assessment: None.** This is one of the most cleanly formalizable Erdős problems. + +## 6. Correctness + +The formalization is **mathematically correct** with one notable redundancy: + +### Redundant hypothesis `h0 : (0 : ℕ) ∈ B` + +The hypothesis `h0 : (0 : ℕ) ∈ B` is logically implied by `hB : IsAdditiveBasis B k` together with `hk : k ≥ 1`. Here is why: `IsAdditiveBasis B k` says that for every `n : ℕ`, there exists `f : Fin k → ℕ` with all `f i ∈ B` and `∑ i, f i = n`. Taking `n = 0`, we need `∑ i, f i = 0` where each `f i : ℕ`. Since natural numbers are non-negative, this forces every `f i = 0`. Since `k ≥ 1`, at least one `f i` exists, so `0 ∈ B`. The hypothesis `h0` is therefore redundant and can be safely removed. + +The docstring even acknowledges this relationship ("Since $0 \in B$ is assumed separately, 'exactly $k$' is equivalent to 'at most $k$'"), but the implication goes further: `0 ∈ B` is not just related — it's *entailed*. + +### Schnirelmann density definition correctness + +The definition `sInf {x : ℝ | ∃ N : ℕ, N ≥ 1 ∧ x = ((Icc 1 N).filter (· ∈ A)).card / (N : ℝ)}` correctly computes `inf_{N ≥ 1} |A ∩ {1,...,N}| / N`. Note that `Finset.Icc 1 N` in `ℕ` gives `{1, 2, ..., N}`, which is the standard convention for Schnirelmann density (excluding 0). This is correct. + +One technical subtlety: `sInf` on `ℝ` for an unbounded-below or empty set returns 0 by convention in Mathlib. The set here is always non-empty (take N = 1) and bounded below by 0, so `sInf` behaves as the genuine infimum. This is fine. + +### Main inequality + +The statement `schnirelmannDensity (sumset A B) ≥ α + α * (1 - α) / (k : ℝ)` faithfully captures the problem. Note that when `α = 0` the bound is trivially 0, and when `α = 1` the bound is 1, both of which are consistent. The operator precedence `α * (1 - α) / k` is `(α * (1 - α)) / k` which matches the intended `α(1-α)/k`. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Code reuse | `IsAdditiveBasis` and `sumset` should use library definitions | +| Citations | Missing [Er56], [Er36c]; missing link to Problem 38 | +| Variants | Plünnecke's stronger bound `α^{1-1/k}` not formalized | +| Readability | Good overall; minor improvements possible | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct. `h0` hypothesis is redundant given `hB` and `hk` | diff --git a/ai-review/353.md b/ai-review/353.md new file mode 100644 index 0000000000..c66e5dfa48 --- /dev/null +++ b/ai-review/353.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 353 + +## 1. Code Reuse + +Several definitions in `353.lean` are duplicated across the codebase and could potentially be consolidated: + +- **`sqDist`**: Identical definitions exist in `ErdosProblems/634.lean:32-34`, `ErdosProblems/633.lean:38-40`, and `ErdosProblems/898.lean:34-35` (as `sqDist898`). A shared utility in `FormalConjecturesForMathlib` would reduce duplication. + +- **`triangleArea`**: The cross-product formula used here is duplicated in `634.lean` and `633.lean`. Meanwhile, `FormalConjecturesForMathlib/Geometry/2d.lean:175-176` provides a Mathlib-integrated `triangle_area` using `positiveOrientation.areaForm`. Problem 352 already uses this Mathlib version with `Affine.Triangle`. The current formalization's use of `ℝ × ℝ` rather than `EuclideanSpace ℝ (Fin 2)` prevents reuse of the library version. + +- **`IsCyclicQuadrilateral`**: A closely related `Concyclic4` definition exists in `ErdosProblems/217.lean:48-50`, using `dist` on `EuclideanSpace ℝ (Fin 2)` rather than `sqDist` on `ℝ × ℝ`. The 353 version additionally requires `0 < r_sq`, which is slightly more careful (excludes degenerate zero-radius case), though the distinctness conditions already handle this. + +- **`IsIsosceles`**: A generic `IsIsosceles` predicate exists in `FormalConjecturesForMathlib/Geometry/2d.lean:200-201` using `Dist`, but it checks a different triple of distance equalities (between consecutive pairs) rather than the side-based formulation in 353. + +**Recommendation**: The `ℝ × ℝ` representation is adequate for this self-contained problem, but consolidating `sqDist` and `triangleArea` into a shared utility would reduce cross-file duplication. + +## 2. Citations + +The docstring references: +- `[Er83d]` — Erdős, P., *Problems and results on combinatorial geometry*. +- `[Ko25]` — Koizumi, S., *On geometric configurations in measurable sets of infinite measure*. +- `[KoPr24]` — Kovač, V. and Predojević, B., *Cyclic quadrilaterals in measurable sets*. + +**Comparison with erdosproblems.com/353**: The website lists four references: `[Er83d]`, `[Ko23]` (Kovač, for the parallelogram counterexample), `[KoPr24]`, and `[Ko25]`. The formalization omits **`[Ko23]`** (Kovač), which is the reference for the parallelogram counterexample and general trapezoid result. This reference is relevant context even though it doesn't correspond to a formalized variant. Consider adding a note about it in the module docstring. + +The citation titles appear to be invented/approximate rather than exact. The website does not provide full titles for these references—only author-year codes. The formalization should either use only the short codes (e.g., `[Ko25]`) or verify the actual paper titles from external sources. + +## 3. Variants + +The formalization captures four variants: +1. ✅ Isosceles trapezoid of area 1 (Part 1) +2. ✅ Isosceles triangle of area 1 (Part 2) +3. ✅ Right-angled triangle of area 1 (Part 3) +4. ✅ Cyclic quadrilateral of area 1 (Part 4) + +**Missing variants from erdosproblems.com/353**: +- ❌ **Polygon with congruent sides of area 1**: The website states Erdős also asked about equilateral polygons. Kovač and Predojević [KoPr24] showed this is **false**—there exists an infinite-measure set where every convex polygon with congruent sides has area less than 1. This negative result is a notable variant that is not formalized. +- ❌ **General trapezoid**: The website notes that Erdős and Mauldin claimed the result holds for general (not necessarily isosceles) trapezoids. This is not formalized as a separate variant. +- ❌ **Parallelogram counterexample**: The website states the result fails for parallelograms (Kovač [Ko23] constructed a counterexample). This negative result could be formalized as a `False` variant. + +## 4. Readability + +The code is well-structured and readable overall: + +- **Good**: Clear docstrings on each definition, logical separation of geometric predicates, consistent naming. +- **Good**: The `namespace Erdos353` scoping keeps definitions local. +- **Minor issue**: The `quadArea` shoelace formula (lines 49-51) is a long single expression. Breaking it into intermediate terms or adding a comment showing the shoelace pattern would improve readability. +- **Minor issue**: The `IsIsoscelesTrapezoid` docstring says "p₁p₂ ∥ p₄p₃ are the parallel sides"—the notation p₄p₃ (reversed) is slightly confusing. Consider clarifying this is the vector from p₄ to p₃. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original Erdős problem is stated informally ("must A contain the vertices of..."), but the geometric objects involved (isosceles trapezoid, right triangle, cyclic quadrilateral) have standard, unambiguous mathematical definitions. The condition "area 1" is precise given the standard Lebesgue measure on ℝ². + +**One subtle point**: The problem says "measurable subset with infinite Lebesgue measure." The formalization uses `volume A = ⊤` which correctly captures infinite measure (since `volume` is the Lebesgue measure on `ℝ × ℝ` in Mathlib, and `⊤` in `ℝ≥0∞` means infinity). The `MeasurableSet A` hypothesis is also appropriate. + +**Potential ambiguity**: For the cyclic quadrilateral variant, the problem asks for "a cyclic quadrilateral of area 1." The formalization uses `quadArea` (shoelace formula) which computes the signed area of a simple quadrilateral given vertices in order. For a non-convex (self-intersecting) vertex ordering, the shoelace formula gives a different value than the actual enclosed area. However, since the problem asks for *existence*, one can always choose an ordering that makes the quadrilateral simple, so this is not a real issue in practice. + +## 6. Correctness + +### Geometric Definitions + +- **`sqDist`**: Correct squared Euclidean distance. ✅ +- **`triangleArea`**: Correct absolute value of the cross-product formula divided by 2. ✅ +- **`quadArea`**: Correct shoelace formula for a simple quadrilateral with vertices in order. ✅ +- **`Parallel`**: Correct—two 2D vectors are parallel iff their cross product is zero. ✅ +- **`IsIsoscelesTriangle`**: Correct—three distinct points with at least one pair of equal-length sides. ✅ +- **`IsRightTriangle`**: Correct—three distinct points with at least one right angle (dot product zero at some vertex). ✅ + +### `IsIsoscelesTrapezoid` — Potential Issue ⚠️ + +The definition requires: +1. All six pairwise distinctness conditions +2. `Parallel (p₂ - p₁) (p₃ - p₄)` — sides p₁p₂ and p₄p₃ are parallel +3. `sqDist p₁ p₄ = sqDist p₂ p₃` — legs are equal +4. `¬ Parallel (p₄ - p₁) (p₃ - p₂)` — legs are NOT parallel + +This definition only checks **one specific labeling** of which sides are parallel and which are legs. In a general isosceles trapezoid ABCD, either AB∥CD or AD∥BC could be the parallel pair. The current definition assumes p₁p₂∥p₄p₃ is the parallel pair. Since the theorem quantifies existentially over p₁, p₂, p₃, p₄, one can permute the points to match this labeling, so this is **not a mathematical error**—but it requires that the "right" assignment of vertices to p₁...p₄ is chosen. This is fine for an existential statement. + +### `IsCyclicQuadrilateral` — Minor Concern ⚠️ + +The definition requires four distinct points on a common circle (with `0 < r_sq`), but does **not** require that the four points form a non-degenerate (non-self-intersecting) quadrilateral, nor that they are in convex position. Technically, any four distinct concyclic points form a "cyclic quadrilateral," and the `quadArea` computation depends on the vertex ordering. For the existential statement this is acceptable—if any four concyclic points from A exist with the right ordering giving area 1, the theorem is satisfied. + +### Statement Structure + +All four theorems use the `answer(True) ↔ ...` pattern, asserting the answer is "yes." This matches the website's status: all four variants are proved (Parts 1–3 by Koizumi [Ko25], Part 4 by Kovač–Predojević [KoPr24]). ✅ + +### Overall Assessment + +The formalization is **mathematically correct** for the four variants it captures. The main gap is the **missing variants** (equilateral polygon negative result, general trapezoid, parallelogram counterexample) rather than any error in what is formalized. The geometric definitions are standard and correctly implemented. The use of `ℝ × ℝ` instead of `EuclideanSpace ℝ (Fin 2)` is a stylistic choice that trades Mathlib integration for simplicity—reasonable for a self-contained problem file. diff --git a/ai-review/356.md b/ai-review/356.md new file mode 100644 index 0000000000..1d33e54b8d --- /dev/null +++ b/ai-review/356.md @@ -0,0 +1,76 @@ +# Review: Erdős Problem 356 + +## 1. Code Reuse + +**`Erdos357.HasDistinctSums`** (in `ErdosProblems/357.lean`) defines a closely related concept — it checks whether all contiguous subsequence sums are *distinct* (injectivity on `OrdConnected` finsets). Problem 356's `contiguousSubSums` computes the *set* of all such sums. These serve different mathematical purposes (counting distinct sums vs. requiring all sums to be distinct), so direct reuse isn't appropriate. + +However, there is a stylistic opportunity: `contiguousSubSums` enumerates pairs `(u, v)` with `u ≤ v` in `Fin k` and sums over `Icc u v`. Problem 357 instead uses `{J : Finset ι | (J : Set ι).OrdConnected}` to identify contiguous index sets. A shared helper — e.g., a definition returning the finset of all `OrdConnected` sub-finsets of `Fin k` — could unify both files. This is a minor style improvement, not a correctness concern. + +No other definitions in `FormalConjecturesForMathlib` (AP-free sets, density, Sidon sets, additive bases, etc.) are directly applicable. + +## 2. Citations + +The formalization includes two references: + +- **[ErGr80]**: `Erdős, P. and Graham, R., Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathematique (1980).` — Matches the website's attribution (p. 58). **Correct.** +- **[Be23b]**: `Beker, A., On distinct consecutive differences. (2023).` — Matches the website. **Correct.** + +**Missing reference**: The website also cites **[Ko15]** — Konieczny (2015) — who proved the permutation variant (that some permutation of {1,...,n} achieves ≥ cn² distinct contiguous sums). This reference is not included in the docstring, but is only relevant if the permutation variant were formalized (see §3 below). + +## 3. Variants + +The website lists two additional questions beyond the main problem: + +1. **Permutation variant (Konieczny [Ko15])**: Does some permutation of {1,...,n} achieve ≥ cn² distinct contiguous subsequence sums? This has been proven true by Konieczny. **Not captured** in the formalization. + +2. **Consecutive integer extension**: Can at least cn consecutive integers greater than n be represented as subset sums? **Not captured**, though this may be closer to problem 357 or 358 territory. + +Neither variant is formalized in 356.lean. The permutation variant, being solved and closely related, would be a natural addition. + +## 4. Readability + +The code is clean and readable. The `contiguousSubSums` definition is straightforward with a clear docstring. The theorem statement is well-structured. + +Minor observations: +- The docstring on the theorem says "contiguous subsequence sums" which matches the module docstring. Good consistency. +- The `open Finset BigOperators` is minimal and appropriate. + +No readability concerns. + +## 5. Formalizability + +The problem as stated on the website is precise and unambiguous: it asks for the existence of a constant c > 0 such that for large n, a strictly increasing integer sequence bounded by n can produce ≥ cn² distinct contiguous sums. This is clearly formalizable and the formalization captures the logical structure faithfully. + +**One source of ambiguity**: The original Erdős-Graham problem says "integers $a_1 < \cdots < a_k \leq n$" without specifying a lower bound. In Erdős-Graham's combinatorial number theory context, "integers ... ≤ n" typically means *positive* integers (i.e., $1 \leq a_1$), but this is not stated explicitly on the website. See §6 for the mathematical consequences of this ambiguity. + +## 6. Correctness + +**CRITICAL ISSUE — Missing lower bound makes the problem trivially true.** + +The formalization requires: +- `StrictMono a` — the sequence is strictly increasing +- `∀ i : Fin k, a i ≤ ↑n` — all terms are ≤ n +- `(contiguousSubSums a).card ≥ c * n²` — at least cn² distinct sums + +But there is **no lower bound** on the sequence elements, and **no constraint on k** (the length of the sequence). This means for any n, one can take k = n² + n terms, say $a_i = i - n^2$ for $i = 0, \ldots, n^2 + n - 1$. These are strictly increasing integers all ≤ n. The number of contiguous sums is at most $\binom{k}{2} + k \sim n^4/2$, and since the terms span a wide range, a large fraction of these sums will be distinct — certainly ≥ cn² for any fixed c. + +In fact, even taking $a_i = i - n$ for $i = 1, \ldots, 2n$ gives $k = 2n$ strictly increasing integers all ≤ n. There are $\binom{2n}{2} + 2n = 2n^2 + n$ candidate contiguous sums, and the distinct count will be $\Theta(n^2)$ — so the problem is trivially true with this construction. + +**The fix**: The original problem almost certainly intends $1 \leq a_1$ (positive integers), or equivalently `∀ i : Fin k, 1 ≤ a i`. This constraint forces $k \leq n$ (since you need $k$ distinct positive integers all ≤ n), making the maximum number of contiguous sums $\sim n^2/2$, and the question of whether a constant fraction of this maximum is achievable becomes non-trivial. + +Compare with **Problem 357** (`357.lean:35`), which correctly requires `Set.range a ⊆ Set.Icc 1 n` (i.e., $1 \leq a_i \leq n$). + +**Recommended fix**: Add `(∀ i : Fin k, 1 ≤ a i)` or change the type to `Fin k → ℕ` with `Set.range a ⊆ Set.Icc 1 n`, consistent with Problem 357's approach. + +**Secondary observation**: The formalization correctly uses `answer(True)` since the problem is marked as solved in the affirmative by Beker. This is appropriate. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunity to share OrdConnected finset enumeration with 357 | +| Citations | Correct for the main problem; [Ko15] missing but only relevant for unformalised variant | +| Variants | Permutation variant (Konieczny) not captured | +| Readability | Good | +| Formalizability | Unambiguous modulo implicit positivity assumption | +| **Correctness** | **INCORRECT as stated — missing lower bound $a_i \geq 1$ renders the problem trivially true** | diff --git a/ai-review/360.md b/ai-review/360.md new file mode 100644 index 0000000000..e096f350d2 --- /dev/null +++ b/ai-review/360.md @@ -0,0 +1,106 @@ +# AI Review: Erdős Problem 360 + +## 1. Code Reuse + +The formalization defines a custom `SumFreeColoring` predicate and `minSumFreeClasses` function. These are **appropriately specialized** and do not duplicate existing codebase definitions: + +- `IsSumFree` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` captures `Disjoint (A + A) A` — a different notion (no `a + b = c` with all three in `A`). Problem 360 instead asks whether a *target number* `n` can be represented as a sum of distinct elements from a color class, which is a fundamentally different condition. +- `IsSumFreeErdos` in `ErdosProblems/876.lean` captures "no element is the sum of distinct smaller elements of the set" — again a different self-referential condition. +- Problem 360's notion is: for a *fixed external target* `n`, no subset of any color class sums to `n`. This is correctly captured by the custom definition and cannot be replaced by either existing `IsSumFree` variant. + +The asymptotic bound structure (`∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧ ∃ N₀ ...`) follows a well-established pattern used in Problems 790, 748, 792, and others. No shared utility for this pattern exists, but none is necessary — the pattern is simple and clear inline. + +`Nat.totient` is imported from Mathlib (used also in Problems 49, 50, 408). No custom totient utilities are needed. + +**Verdict:** No meaningful code reuse opportunities. The custom definitions are justified. + +## 2. Citations + +The formalization includes four references: [ErGr80], [AlEr96], [Vu07], [CFP21]. Comparing against [erdosproblems.com/360](https://www.erdosproblems.com/360): + +| Citation | Formalization | Website | +|----------|--------------|---------| +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | ✅ Matches | +| [AlEr96] | Alon, N. and Erdős, P. (1996). | ⚠️ Missing title. | +| [Vu07] | Vu, V.H. (2007). | ⚠️ Missing title. | +| [CFP21] | Conlon, D., Fox, J. and Pham, H.T., *Sum-free partitions* (2021). | ✅ Matches | + +**Issue:** [AlEr96] and [Vu07] are incomplete — they lack titles. The website does not provide full bibliographic details for these either, so this is a minor concern, but adding titles would improve scholarly completeness. The standard references are: +- [AlEr96]: Alon, N. and Erdős, P., "An application of graph theory to additive number theory," *European J. Combin.* **6** (1985), 201–203. *(Note: sometimes cited as 1996 but the paper may actually be from 1985 — this should be verified.)* +- [Vu07]: Vu, V.H., "On a refinement of Waring's problem," *Duke Math. J.* **105** (2000), or a later paper. *(Year and exact paper should be verified.)* + +**Verdict:** All references from the website are present. Two citations lack titles — minor issue. + +## 3. Variants + +The website states the problem asks "how quickly does f(n) grow?" and notes it is **solved**. The formalization captures the final result of Conlon–Fox–Pham (2021), which determines the order of growth up to multiplicative constants: + +$$f(n) \asymp \frac{n^{1/3} \cdot (n/\varphi(n))}{(\log n)^{1/3} \cdot (\log \log n)^{2/3}}$$ + +The intermediate results of Alon–Erdős (establishing $f(n) = n^{1/3+o(1)}$ with explicit bounds) and Vu (improving the lower bound) are not separately formalized, which is appropriate — they are superseded by the CFP21 result. + +No other variants of the problem are indicated on the website. The formalization is complete in scope. + +**Verdict:** All variants adequately captured. + +## 4. Readability + +The code is well-structured and readable: + +- The `SumFreeColoring` predicate has a clear docstring explaining the concept. +- The `minSumFreeClasses` function is cleanly defined using `sInf`. +- The `let g := ...` binding in the theorem statement isolates the asymptotic growth expression, making the bound structure `C₁ * g ≤ f(n) ≤ C₂ * g` easy to parse. +- The namespace `Erdos360` keeps definitions scoped. + +**Minor suggestions:** +- The expression `(n : ℝ) ^ ((1 : ℝ) / 3)` appears in both the numerator and denominator components. While clear, one could consider defining intermediate terms, but this would arguably reduce readability for such a short expression. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem is **precisely formalizable** with essentially no ambiguity: + +- The function f(n) is defined as the minimum number of partition classes of {1, ..., n−1} such that n is not a sum of distinct elements from any single class. This is a concrete combinatorial optimization problem. +- The asymptotic result `f(n) ≍ g(n)` (bounded above and below by constant multiples) is captured by the standard two-constant formulation. +- All components — `Nat.totient`, `Real.log`, subset sums, Finset coloring — have direct Lean/Mathlib counterparts. + +The only potential ambiguity in the original problem statement is the phrase "determine the asymptotic order of growth," which could in principle mean different levels of precision (up to constants, up to lower-order terms, exact asymptotics). The formalization correctly chooses the "up to multiplicative constants" interpretation, which matches the CFP21 result. + +**Verdict:** Fully formalizable. No ambiguity issues. + +## 6. Correctness + +**Definition correctness:** + +- `SumFreeColoring n k c`: Requires that for every color `j` and every `S ⊆ Icc 1 (n-1)` monochromatic in color `j`, `S.sum id ≠ n`. Since `S` is a `Finset`, elements are automatically distinct, correctly capturing "sum of distinct elements." ✅ +- The range `Icc 1 (n-1)` in `Finset ℕ` correctly represents `{1, 2, ..., n-1}` for `n ≥ 1`, and is empty for `n = 0`. ✅ +- The coloring `c : ℕ → Fin k` is total (defined on all naturals), but the constraint restricts attention to `Icc 1 (n-1)`. Values outside this range are irrelevant. ✅ +- The empty set has sum 0, which is ≠ n for all n ≥ 1. No spurious failures from the empty subset. ✅ + +**`minSumFreeClasses` correctness:** + +- Uses `sInf` on `{k : ℕ | ∃ c, SumFreeColoring n k c}`. For the natural number `sInf`, if the set is empty, `sInf = 0`. However, the set is always nonempty: taking `k = n` and giving each element its own class ensures no monochromatic subset of size ≥ 2 exists (so the only sums from a single class are singletons, and no element of `{1,...,n-1}` equals `n`). ✅ + +**Theorem statement correctness:** + +- The asymptotic expression: `n^(1/3) * (n/φ(n)) / (log(n)^(1/3) * log(log(n))^(2/3))` matches the CFP21 result exactly. ✅ +- The bound structure `C₁ * g ≤ f(n) ≤ C₂ * g` for all `n ≥ N₀` correctly formalizes `f(n) ≍ g(n)`. ✅ +- Edge case: For small `n`, `log(n)` or `log(log(n))` may be ≤ 0, making `g` undefined or negative. The `∃ N₀` existential quantifier correctly handles this by allowing the bound to hold only for sufficiently large `n`. ✅ + +**Potential concern (non-blocking):** The expression `g` involves division, and when `log(n) = 0` or `log(log(n)) = 0` (e.g., `n = 1`), the denominator is zero. In Lean's `Real`, division by zero gives 0, so `g = 0` in such cases. Since the theorem only asserts the bound for `n ≥ N₀`, and `N₀` can be chosen large enough to avoid this, there is no mathematical issue. However, one might add a comment noting this. This is stylistic, not a correctness issue. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ No reuse opportunities; custom definitions justified | +| Citations | ⚠️ Minor: [AlEr96] and [Vu07] lack titles | +| Variants | ✅ Complete | +| Readability | ✅ Clean and well-structured | +| Formalizability | ✅ Fully formalizable, no ambiguity | +| Correctness | ✅ Mathematically correct and complete | + +**Overall:** High-quality formalization. The only actionable item is adding titles to the [AlEr96] and [Vu07] citations if they can be identified with certainty. diff --git a/ai-review/362.md b/ai-review/362.md new file mode 100644 index 0000000000..c7ae83536e --- /dev/null +++ b/ai-review/362.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 362 + +## 1. Code Reuse + +No directly reusable code exists in `FormalConjecturesForMathlib/` for this problem. The problem concerns counting subsets with a given sum, which is distinct from the combinatorics utilities available (arithmetic progressions, Ramsey theory, Sidon sets, sum-free sets, etc.). + +Several other Erdős problems deal with subset sums (Problems 343, 350, 532, 543, 948, 963), but none define shared infrastructure for *counting* subsets with a prescribed sum. The `powerset.filter` + `sum id` pattern is used ad hoc in each file. A shared definition like `Finset.subsetsWithSum (A : Finset ℕ) (t : ℕ) := A.powerset.filter (fun S => S.sum id = t)` could improve reuse across Problems 362, 350, 543, and others, but this is a minor stylistic point rather than a significant gap. + +## 2. Citations + +The formalization references: +- `[SaSz]` — Sárközy, A. and Szemerédi, E. +- `[Ha]` — Halász, G. + +The website (erdosproblems.com/362) lists the following references: **[Er65], [Er73], [ErGr80], [SaSz65], [St80], [Ha77]**. + +**Issues:** +- The citation keys `[SaSz]` and `[Ha]` are informal shorthand. They should be expanded to match the website's keys: `[SaSz65]` and `[Ha77]`, respectively. +- The docstring descriptions of these references lack publication details (journal, year). The website provides years (1965 and 1977) that could be included. +- Stanley's result [St80] — that the count is maximized when A = {−⌊(N−1)/2⌋, …, ⌊N/2⌋} — is mentioned on the website but not referenced in the formalization. This is acceptable since Stanley's result is a related optimization result rather than a resolution of the problem, though a brief mention in the docstring could be informative. +- The original Erdős references [Er65], [Er73], [ErGr80] are not cited. The docstring mentions "the earlier bound of Erdős and Moser" without a citation key. + +## 3. Variants + +The formalization captures two statements: + +1. **Main theorem (`erdos_362`)**: The count of subsets with a given sum is O(2^N / N^{3/2}). +2. **Fixed-size variant (`erdos_362.variants.fixed_size`)**: With an additional cardinality constraint |S| = l, the count is O(2^N / N^2). + +Both parts of the problem as stated on erdosproblems.com are covered. Stanley's extremal characterization (which set A maximizes the count) is not formalized, but this is a separate result rather than a variant of the problem itself. **All problem variants are captured.** + +## 4. Readability + +The code is generally readable, with two minor issues: + +- **Unnecessary `decide` wrapper**: The filter predicates use `decide (S.sum id = t)` and `decide (S.sum id = t ∧ S.card = l)`. Since equality on `ℕ` is decidable and `Finset.card` returns `ℕ`, the predicates `fun S => S.sum id = t` and `fun S => S.sum id = t ∧ S.card = l` already have `DecidablePred` instances automatically. The `decide` call is unnecessary and adds syntactic noise. Replacing with the bare propositions would be cleaner: + ```lean + (A.powerset.filter (fun S => S.sum id = t)).card + (A.powerset.filter (fun S => S.sum id = t ∧ S.card = l)).card + ``` + +- **Casting clarity**: The expression `((A.powerset.filter ...).card : ℝ)` and `C * (2 : ℝ) ^ N / ((N : ℝ) ^ ((3 : ℝ) / 2))` involve several type coercions. This is standard Lean style for mixed integer/real inequalities and is acceptable, though the `(3 : ℝ) / 2` could alternatively be written as `(3 / 2 : ℝ)` for slight readability improvement. + +## 5. Formalizability + +**Assessment: Highly formalizable, minimal ambiguity.** + +The problem is a clean asymptotic upper bound statement. The big-O notation is correctly rendered as an existential constant C > 0 such that the bound holds for all N, A, and t. This is a standard and unambiguous way to formalize O(·) bounds. + +One subtle point: the bound `C * 2^N / N^{3/2}` should technically hold for all N ≥ 1 (as stated via the `0 < N` hypothesis). For very small N the bound is trivially satisfied by choosing C large enough, so this is not an issue. + +The problem is precise enough that no alternative reasonable readings exist. **Ambiguity: None.** + +## 6. Correctness + +**Assessment: Correct and mathematically faithful.** + +Detailed analysis: + +- **Domain**: The formalization uses `Finset ℕ` (which includes 0), while the original problem likely considers positive integers. This is immaterial: if A contains 0, it contributes at most a factor of 2 to the count (each subset S with sum t can optionally include 0), which is absorbed by the constant C. The bound holds for arbitrary finite subsets of ℕ. + +- **Main theorem**: The bound `C * 2^N / N^{3/2}` for the number of subsets of an N-element set with a given sum is exactly the Sárközy–Szemerédi result. ✓ + +- **Fixed-size variant**: The bound `C * 2^N / N^2` with C independent of both l and t matches Halász's result. The independence of C from l and t is correctly captured by the universal quantification `∀ (t l : ℕ)` appearing *after* the existential `∃ C`. ✓ + +- **Quantifier ordering**: The structure `∃ C > 0, ∀ N > 0, ∀ A with |A| = N, ∀ t, bound` is correct. The constant C is universal (independent of N, A, and t). ✓ + +- **Edge case N = 0**: Excluded by the hypothesis `0 < N`. This is appropriate since the bound N^{3/2} in the denominator would be 0 when N = 0. ✓ + +- **The `sum id` usage**: `Finset.sum S id` computes ∑_{n ∈ S} n, which is the correct interpretation. ✓ + +**No mathematical flaws identified. The formalization is correct and complete.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor opportunity | A shared `subsetsWithSum` def could help across several problems | +| Citations | Needs improvement | Shorthand keys should match website ([SaSz65], [Ha77]); missing original Erdős refs | +| Variants | Complete | Both parts of the problem are captured | +| Readability | Good | Remove unnecessary `decide`; minor casting style | +| Formalizability | Excellent | No ambiguity | +| Correctness | Correct | Mathematically faithful formalization | diff --git a/ai-review/363.md b/ai-review/363.md new file mode 100644 index 0000000000..62056ceee2 --- /dev/null +++ b/ai-review/363.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 363 + +## 1. Code Reuse + +The formalization defines a custom `prod4` helper. Problem 930 (the generalization of this problem) uses `Finset.Icc` and `Finset.prod` (`∏ m ∈ Icc a b, m`) to express products of consecutive integers, which is more general and aligns with Mathlib conventions. The `prod4` definition could be replaced with: + +```lean +∏ m ∈ Finset.Icc a (a + 3), m +``` + +This would improve consistency with Problem 930 and make it easier to generalize to arbitrary interval sizes (e.g., `|I_i| = 5`). However, `prod4` is arguably more readable for this specific specialization. + +Additionally, `IsSquare` from Mathlib (`Mathlib.Algebra.Group.Even`) is correctly used. The `squarefreePart` utilities in `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` could be relevant for any proof work. + +## 2. Citations + +The docstring uses shorthand references `[Ul05]`, `[BaBe07]`, `[BeVL12]`. The website provides the following full references: + +- **[Ul05]**: Ulas (2005) — proved infinitely many solutions for n=4 or n≥6, |I_i|=4. +- **[BaBe07]**: Bauer and Bennett (2007) — proved the same for n=3 and n=5, |I_i|=4. +- **[BeVL12]**: Bennett and Van Luijk (2012) — found infinitely many solutions for n≥5, |I_i|=5. + +The shorthand references in the module docstring are consistent with the website. Full bibliographic details (journal names, page numbers) are not provided on the website page itself, so the shorthand is acceptable. The theorem-level docstring correctly attributes the n=3, |I_i|=4 case to Bauer–Bennett [BaBe07]. + +## 3. Variants + +The formalization captures **only the n=3, |I_i|=4 case**. Several variants from the website are missing: + +- **General problem statement**: The original problem asks about *arbitrary* collections of disjoint intervals with |I_i| ≥ 4 and arbitrary n. This is not formalized. +- **n=4 or n≥6, |I_i|=4** (Ulas): Not formalized. +- **n=5, |I_i|=4** (Bauer–Bennett): Not formalized. +- **n≥5, |I_i|=5** (Bennett–Van Luijk): Not formalized. +- **Ulas's conjecture**: The website mentions Ulas conjectures that infinitely many solutions exist for any fixed interval size provided n is sufficiently large. This is not mentioned or formalized. +- **Relationship to Problem 930**: The website notes Problem 930 is a more general version. Problem 930 is formalized separately in `930.lean`, but no formal connection between the two is stated. + +The n=3 case is a reasonable representative specialization since it was the hardest case (solved last, by Bauer–Bennett), but the lack of any variant capturing the general statement is a gap. + +## 4. Readability + +**Moderate concerns:** + +- The use of nested pairs `ℕ × ℕ × ℕ` with accessors `t.1`, `t.2.1`, `t.2.2` is less readable than named variables. A destructuring pattern or a dedicated structure would improve clarity: + ```lean + {(a, b, c) : ℕ × ℕ × ℕ | a + 4 ≤ b ∧ b + 4 ≤ c ∧ IsSquare (prod4 a * prod4 b * prod4 c)} + ``` + (Lean 4 anonymous constructor syntax may allow this depending on version.) + +- The `prod4` definition is clear and well-documented. + +- The module docstring provides good mathematical context and lists the key results that disproved the conjecture. + +## 5. Formalizability + +**Assessment: High formalizability with moderate ambiguity in the general statement.** + +The general problem has some ambiguity: +- "Intervals of consecutive integers" — does this mean positive integers? The use of ℕ in the formalization implicitly includes 0, which creates issues (see Correctness below). +- "Collections" — does this mean ordered or unordered? The formalization uses ordered triples, which is fine for finiteness questions. +- The constraint |I_i| ≥ 4 vs. exactly 4 — the general problem uses ≥ 4, but all known results fix the interval size. + +The specialized n=3, |I_i|=4 case is unambiguous and cleanly formalizable. + +## 6. Correctness + +**Critical issue: The formalization is trivially true (for the wrong reason).** + +`prod4 0 = 0 * 1 * 2 * 3 = 0`, and `IsSquare 0` holds (since `0 = 0 * 0`). Therefore, any triple `(0, b, c)` with `4 ≤ b` and `b + 4 ≤ c` satisfies the predicate, giving infinitely many elements in the set. This makes `Set.Finite {t | ...}` false, so `answer(False) ↔ Set.Finite ...` holds trivially — but for the wrong mathematical reason. + +The problem intends products of consecutive **positive** integers (consistent with the Erdős–Selfridge context, where products are $(n+1)(n+2)\cdots(n+k)$ with $n \geq 0$, i.e., starting from at least 1). The formalization should add a positivity constraint, e.g.: + +```lean +0 < t.1 ∧ t.1 + 4 ≤ t.2.1 ∧ t.2.1 + 4 ≤ t.2.2 ∧ ... +``` + +or equivalently define `prod4` starting from `a+1`: + +```lean +def prod4 (a : ℕ) : ℕ := (a + 1) * (a + 2) * (a + 3) * (a + 4) +``` + +**Secondary correctness note:** The ordering constraint `t.1 + 4 ≤ t.2.1 ∧ t.2.1 + 4 ≤ t.2.2` correctly ensures the three intervals `[a, a+3]`, `[b, b+3]`, `[c, c+3]` are pairwise disjoint (in fact, the gap of ≥ 1 between consecutive intervals is enforced). This is correct. + +**Summary:** The formalization has a correctness bug due to allowing `a = 0`, which makes the answer trivially correct without engaging with the actual mathematical content. This is fixable by requiring all interval starts to be positive. + +--- + +## Overall Assessment + +| Criterion | Rating | +|---|---| +| Code Reuse | Minor improvement possible (use `Finset.Icc` for consistency with 930) | +| Citations | Acceptable | +| Variants | Significant gaps — only n=3 case covered | +| Readability | Minor improvements possible | +| Formalizability | Good for the specialized case | +| Correctness | **Critical bug** — trivially true due to `prod4 0 = 0` | diff --git a/ai-review/365.md b/ai-review/365.md new file mode 100644 index 0000000000..ea28e47f45 --- /dev/null +++ b/ai-review/365.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 365 + +## 1. Code Reuse + +**Issue found.** The file defines a local `IsPowerful` predicate in the `Erdos365` namespace: + +```lean +def IsPowerful (n : ℕ) : Prop := + 0 < n ∧ ∀ p : ℕ, p.Prime → p ∣ n → p ^ 2 ∣ n +``` + +The codebase already provides `Nat.Powerful` (an abbreviation for `(2).Full`) in `FormalConjecturesForMathlib/Data/Nat/Full.lean`, which is defined as: + +```lean +def Full (k : ℕ) (n : ℕ) : Prop := ∀ p ∈ n.primeFactors, p^k ∣ n +abbrev Powerful : ℕ → Prop := (2).Full +``` + +The closely related Problem 364 (`FormalConjectures/ErdosProblems/364.lean`) already uses `Nat.Powerful` directly and successfully. The local `IsPowerful` is redundant here since `S ⊆ Finset.Icc 1 x` already guarantees `n ≥ 1`, making the `0 < n` guard unnecessary. For all `n ≥ 1`, `Nat.Powerful n` and `IsPowerful n` are logically equivalent. The local definition should be replaced with `Nat.Powerful`. + +Multiple other files in the codebase also define their own local `IsPowerful` or `IsSquarefull` (Problems 937, 941, 1081, 1108), all slightly different. This is a broader pattern of duplicated definitions that could be consolidated. + +## 2. Citations + +The formalization includes four references: [Er76d], [ErGr80], [Go70], [Wa76]. These are reasonable and the bibliographic details provided are more complete than what appears on the website. + +**Missing context from the website:** +- The website mentions Mahler's original observation that the Pell equation $x^2 = 2^3 y^2 + 1$ gives infinitely many consecutive powerful pairs, which historically motivated the problem. The docstring omits this context. +- The website references Guy's *Unsolved Problems in Number Theory*, Problem B16. +- The website lists related OEIS sequences: A060355 (pairs of consecutive powerful numbers), A060859, A175155. +- The website notes this is related to Problem #364 (no consecutive triple of powerful numbers), which could be cross-referenced. + +## 3. Variants + +The problem has two parts: + +1. **Q1 (resolved):** Must either $n$ or $n+1$ be a square? Answered negatively by Golomb and Walker. +2. **Q2 (open):** Is the count of consecutive powerful pairs up to $x$ bounded by $(\log x)^{O(1)}$? + +Only Q2 is formalized, which is appropriate since it is the open question. However, some natural variants are missing: + +- **Golomb's counterexample** could be formalized as a decidable computation: `IsPowerful 12167 ∧ IsPowerful 12168 ∧ ¬IsSquare 12167 ∧ ¬IsSquare 12168`. This would serve as a concrete, verifiable fact. +- **Walker's infinitude result** (infinitely many solutions to $7^3 x^2 = 3^3 y^2 + 1$ yield consecutive powerful non-squares) could be stated as a solved variant. +- A weaker variant could ask whether the count is $o(x^\varepsilon)$ for all $\varepsilon > 0$, which is implied by the $(\log x)^C$ bound but may be easier to approach. + +## 4. Readability + +The code is reasonably readable. A few observations: + +- The docstring is well-written and clearly explains both the resolved and open parts of the problem. +- The universal quantification over `S` rather than directly defining a counting function is idiomatic but slightly indirect. Compare with Problem 1081, which explicitly defines `countA` as a filtered Finset cardinality. A similar explicit counting function would be more readable here: + ```lean + noncomputable def countConsecutivePowerful (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter (fun n => IsPowerful n ∧ IsPowerful (n + 1))).card + ``` + This would make the statement more direct: `(countConsecutivePowerful x : ℝ) ≤ (Real.log (x : ℝ)) ^ C`. +- The `open Finset Real` is broader than needed; only `Real.log` seems to require the `Real` opening, and `Finset` is used for `Finset.Icc` and `Finset.card`. + +## 5. Formalizability + +**Assessment: Clearly formalizable with low ambiguity.** + +The open question (Q2) is a precise quantitative bound on a well-defined counting function. The statement "$(\log x)^{O(1)}$" means exactly "bounded by $(\log x)^C$ for some constant $C$", which is what the formalization captures. The only minor ambiguity in the informal statement is whether "$n \leq x$" means the count is eventually bounded (for sufficiently large $x$) or for all $x$. The formalization correctly uses "for all sufficiently large $x$" (via the `x₀` existential), which is the standard interpretation. + +## 6. Correctness + +**The formalization is mathematically correct but has a minor structural issue.** + +**Correctness of the logical content:** +The statement correctly captures: $\exists C > 0, \exists x_0, \forall x \geq x_0$, the number of $n \in [1, x]$ with both $n$ and $n+1$ powerful is $\leq (\log x)^C$. + +**Structural issue with universal quantification over S:** +The statement universally quantifies over all subsets $S \subseteq [1, x]$ whose elements are consecutive powerful pairs, bounding $|S|$ by $(\log x)^C$. This is *equivalent* to bounding the actual count (since the set of all such $n$ is the maximal such $S$), but it is an unusual formulation. It imposes the bound on every subset, not just the maximal one. While logically equivalent, an explicit counting set (as in Problem 1081) would be more standard and directly mirror the mathematical statement. + +**Potential edge case:** When $x = 0$ or $x$ is very small, $\log(x)$ may be $\leq 0$ in the reals, and $(\log x)^C$ could be negative or zero. The `x₀` existential handles this by allowing us to start from a sufficiently large $x$, so this is not a real issue. However, if $C$ is not a natural number, $(\log x)^C$ for $\log x < 0$ involves complex/undefined behavior in `Real.rpow`/`Real.log`. Since the formalization uses `(Real.log (x : ℝ)) ^ C` where `C : ℝ` and `^` here is `HPow ℝ ℝ ℝ`, this uses `Real.rpow`, which for negative base returns 0 when the exponent is irrational. This is fine since `x₀` can be chosen large enough, but it's worth noting. + +**Summary:** The formalization is correct and captures the intended open problem. The main recommendations are (1) replace the local `IsPowerful` with `Nat.Powerful`, (2) consider an explicit counting function for clarity, and (3) add cross-references to Problem 364 and Golomb's counterexample as a variant. diff --git a/ai-review/367.md b/ai-review/367.md new file mode 100644 index 0000000000..dff6644794 --- /dev/null +++ b/ai-review/367.md @@ -0,0 +1,102 @@ +# AI Review: Erdős Problem 367 + +## 1. Code Reuse + +**Major duplication found.** The definition `twoFullPart` in `FormalConjectures/ErdosProblems/367.lean` (line 38) is character-for-character identical to `powerfulPart` in `FormalConjectures/ErdosProblems/935.lean` (line 37): + +```lean +-- 367.lean +noncomputable def twoFullPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) + +-- 935.lean +noncomputable def powerfulPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) +``` + +These should be unified into a single shared definition, ideally in `FormalConjecturesForMathlib/`. The existing `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` already defines `squarefreePart` and `squarePart` using factorization infrastructure, so a `twoFullPart` (or `powerfulPart`) definition would be a natural companion. Note that the 2-full part is **not** the same as `squarePart`: `squarePart(n) = ∏ p^(2⌊e_p/2⌋)` rounds exponents down to even, while `twoFullPart(n) = ∏_{e_p≥2} p^{e_p}` keeps full exponents but only for primes with exponent ≥ 2. For example, `twoFullPart(72) = 72` but `squarePart(72) = 36`. + +A more general `kFullPart` taking a parameter `k` would serve both problems and the r-full variant mentioned on the website. + +## 2. Citations + +**Reference is acceptable but could be improved.** + +The formalization cites: +> [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +The website (erdosproblems.com/367) lists the source as `[ErGr80, p.68]`. The formalization's docstring does include "p.68" in the theorem docstring but not in the module docstring. This is fine. + +**Missing from citations:** +- The website notes equivalence to **Problem 935** — this cross-reference is absent from the 367 file. +- The website references **OEIS A057521** (the 2-full part sequence) — not mentioned in the formalization. + +## 3. Variants + +**Incomplete.** The erdosproblems.com page for Problem 367 poses a secondary question about r-full parts for r ≥ 3: + +> Does $\limsup \left[\prod_{n \leq m < n+k} B_r(m) / n^{1+\varepsilon}\right] \to \infty$ for fixed $r, k \geq 2$ and $\varepsilon > 0$? + +This variant is not captured in the 367 formalization. Problem 935 does capture related variants (Part 2 on the limsup divergence, Part 3 on the limit going to 0), but those are formulated in terms of Q₂ of the full product rather than the product of individual B₂ values (see Correctness below). + +The website also asks the stronger question "or perhaps even ≪_k n²?" which is partially addressed by the docstring noting that this stronger bound fails for k ≥ 3, but is not formalized as a separate variant. + +## 4. Readability + +**Good overall.** Minor suggestions: + +- The docstring is well-written and includes the key context about k ≤ 2 vs k ≥ 3. +- The definition of `twoFullPart` is clear and uses standard Mathlib idioms. +- The name `twoFullPart` is descriptive and consistent with the "2-full" terminology. The alternative `powerfulPart` used in 935.lean is equally valid (since "powerful" = "2-full"). Whichever name is chosen for the unified definition should be used consistently. +- The product `∏ i ∈ Finset.range k, twoFullPart (n + i)` correctly ranges over `{n, n+1, ..., n+k-1}`, matching the website's `n ≤ m < n+k`. + +## 5. Formalizability + +**High — the statement is precise and unambiguous.** + +The problem asks whether the product of 2-full parts of k consecutive integers is O(n^{2+ε}) for every fixed k and ε > 0. All terms are well-defined: +- "2-full part" has a standard definition in number theory. +- The O(·) / ≪ notation with the o(1) exponent translates cleanly to the ∀ε > 0 formulation. +- The parameters k and ε are universally quantified as stated. + +The only minor source of potential ambiguity is whether the bound constant C may depend on both k and ε (as formalized) or just ε. The standard reading of "for every fixed k" allows C to depend on k, which the formalization correctly permits (C appears after both ∀k and ∀ε). + +**Assessment: unambiguous, clearly formalizable.** + +## 6. Correctness + +**The formalization of the main statement is mathematically correct.** + +The formalized statement: +``` +∀ k ≥ 1, ∀ ε > 0, ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, + (∏ i in range k, twoFullPart(n + i) : ℝ) ≤ C * n^(2+ε) +``` + +faithfully captures "∏_{n≤m 0`, so the bound fails at n=0. This is harmless since the formalization includes `∃ n₀` allowing us to avoid n=0. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — duplicate definition with Problem 935; should be unified | +| Citations | **Minor gaps** — missing cross-reference to Problem 935 and OEIS A057521 | +| Variants | **Incomplete** — r-full generalization and the stronger ≪_k n² question not formalized | +| Readability | **Good** | +| Formalizability | **Unambiguous** | +| Correctness | **Correct** — faithful to the website statement; relationship with Problem 935 is non-trivial | diff --git a/ai-review/368.md b/ai-review/368.md new file mode 100644 index 0000000000..a02e1b6aed --- /dev/null +++ b/ai-review/368.md @@ -0,0 +1,139 @@ +# AI Review: Erdős Problem 368 + +**File:** `FormalConjectures/ErdosProblems/368.lean` + +## 1. Code Reuse + +**Issue found.** Problem 368 defines its own local `largestPrimeFactor` at line 43: + +```lean +noncomputable def largestPrimeFactor (n : ℕ) : ℕ := + n.factorization.support.sup id +``` + +There is a centralized, well-documented utility `Nat.maxPrimeFac` in +`FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` (line 28): + +```lean +noncomputable def maxPrimeFac (n : ℕ) : ℕ := sSup {p : ℕ | p.Prime ∧ p ∣ n} +``` + +This utility already has supporting lemmas (`maxPrimeFac_zero`, `maxPrimeFac_one`, +`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`) and +is already used by closely related problems: 370, 371, **373** (which also studies prime factors +of `n*(n+1)`), 383, and 932. Problem 368 should use `Nat.maxPrimeFac` instead. + +The two definitions are mathematically equivalent for `n ≥ 2` (both yield the largest prime +dividing `n`) and agree on junk values (`0` for `n ≤ 1`), though their definitional +implementations differ (`factorization.support.sup id` vs. `sSup {p | p.Prime ∧ p ∣ n}`). +Switching to the shared definition would improve consistency across the codebase and provide +access to the existing lemma library. + +Additionally, `F368` could be replaced by an inline usage of `(n * (n + 1)).maxPrimeFac`, which +is exactly the pattern used in Problem 373's variant at line 52. + +## 2. Citations + +The docstring references match the website content accurately: + +| Citation | Docstring | Website | Notes | +|-----------|-----------|---------|-------| +| [Er65b] | ✓ (lower bound) | ✓ p.218 | OK | +| [Er76d] | ✓ (both theorems) | ✓ p.27, p.69 | OK | +| [ErGr80] | ✓ (lower bound) | ✓ | OK | +| [Po18] | ✓ (module doc) | ✓ | Pólya 1918 | +| [Ma35] | ✓ (module doc) | ✓ | Mahler 1935 | +| [Sc67b] | ✓ (module doc) | ✓ | Schinzel 1967 | +| [Pa24b] | ✓ (module doc) | ✓ | Pasten 2024 | + +The website also references OEIS sequence A074399, which is not mentioned in the formalization. +This is a minor omission with no impact on correctness. + +Citations use shorthand codes (e.g., `[Er65b]`) rather than full bibliographic references. This +is consistent with how the website presents them and matches the convention used across the +codebase. + +## 3. Variants + +The formalization captures the two main conjectural components: + +- **Lower bound** (`erdos_368`): F(n) ≫ (log n)² — formalized correctly. +- **Upper bound** (`erdos_368.variants.upper_bound`): For every ε > 0, infinitely many n have + F(n) < (log n)^{2+ε} — formalized correctly. + +**Not formalized** (listed in the module docstring as known results, not as conjectures): +- Pólya's result: F(n) → ∞. This is a proven theorem, not a conjecture, so omitting it as a + separate statement is reasonable. +- Mahler's bound: F(n) ≫ log log n. Also proven, not a conjecture. +- Schinzel's observation: F(n) ≤ n^{O(1/log log log n)} infinitely often. Proven result. +- Pasten's bound: F(n) ≫ (log log n)² / log log log n. Proven result. + +The omission of these known results as formalized theorems is acceptable since the file focuses +on open conjectures. However, formalizing Pólya's F(n) → ∞ as a solved variant could be +valuable since it is the foundational result in this line of inquiry. + +## 4. Readability + +The code is generally clear and well-structured. Minor suggestions: + +- The name `F368` is functional but somewhat opaque. A name like + `largestPrimeFactorConsecutive` would be more descriptive, though `F368` does mirror the + standard notation F(n) from the literature and is scoped within the `Erdos368` namespace. +- The module docstring is thorough and provides good mathematical context. +- The theorem docstrings accurately describe the mathematical content. + +## 5. Formalizability + +**Assessment: Fully formalizable, no ambiguity.** + +The problem statement is completely precise: +- "Largest prime factor of n(n+1)" is unambiguous. +- The asymptotic lower bound F(n) ≫ (log n)² is correctly rendered as an existential statement + with constant c > 0 and threshold n₀. +- The upper bound "infinitely many n with F(n) < (log n)^{2+ε}" is directly expressible via + `Set.Infinite`. + +There is no ambiguity in the original problem statement that could affect the formalization. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`largestPrimeFactor` definition (line 43):** For n ≥ 2, `n.factorization.support` is the + `Finset` of primes dividing n, and `.sup id` returns the maximum element (with `⊥ = 0` for + the empty set). This correctly returns 0 for n ≤ 1 (as documented) and the largest prime + factor for n ≥ 2. + +- **`F368` definition (line 47):** `largestPrimeFactor (n * (n + 1))` correctly computes the + largest prime factor of the product n(n+1). For n = 0, this gives + `largestPrimeFactor 0 = 0`, which is a harmless junk value since the conjecture only + concerns sufficiently large n. + +- **Lower bound theorem (`erdos_368`, line 57–61):** The statement + `∃ c : ℝ, 0 < c ∧ ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → (F368 n : ℝ) ≥ c * (Real.log n) ^ 2` + correctly formalizes "F(n) ≫ (log n)²". The use of `Real.log` (natural logarithm) is + standard — the choice of logarithm base only affects the constant c. The cast + `(F368 n : ℝ)` correctly lifts the natural number to a real for comparison. + +- **Upper bound theorem (`erdos_368.variants.upper_bound`, line 70–72):** The statement + `∀ ε : ℝ, 0 < ε → Set.Infinite {n : ℕ | (F368 n : ℝ) < (Real.log n) ^ ((2 : ℝ) + ε)}` + correctly captures "for every ε > 0, infinitely many n satisfy F(n) < (log n)^{2+ε}". + +- **Edge cases:** `Real.log 0 = 0` and `Real.log 1 = 0` in Lean, so for small n the + inequality `F368 n ≥ c * (log n)^2` holds trivially (RHS = 0). The `∃ n₀` quantifier + makes this irrelevant regardless. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Should use `Nat.maxPrimeFac`** from shared utility | +| Citations | Correct and complete | +| Variants | Main conjectures captured; known results reasonably omitted | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/369.md b/ai-review/369.md new file mode 100644 index 0000000000..753e2762fc --- /dev/null +++ b/ai-review/369.md @@ -0,0 +1,108 @@ +# Review: Erdős Problem 369 + +## 1. Code Reuse + +The file defines a local `IsSmooth (y : ℝ) (m : ℕ)` predicate. Multiple other Erdős problems define nearly identical predicates: + +- **Problem 334** (`334.lean:37`): `def IsSmooth (B n : ℕ) : Prop := ∀ p ∈ n.primeFactorsList, p ≤ B` — ℕ-valued bound, uses `primeFactorsList`. +- **Problem 929** (`929.lean:34`): `def IsSmooth (x m : ℕ) : Prop := ∀ p ∈ m.primeFactors, p ≤ x` — ℕ-valued bound, uses `primeFactors` (Finset). +- **Problem 928** (`928.lean:59`): defines `largestPrimeFactor` then compares against a real-valued threshold, achieving the same effect differently. + +Mathlib provides `Nat.smoothNumbers` in `Mathlib/NumberTheory/SmoothNumbers.lean`, but it uses **strict** inequality (`< n`) rather than `≤ y`, so it is not directly substitutable without adjustment. + +Problem 369's choice to take a **real-valued** bound `y : ℝ` is well-motivated since the smoothness threshold `n^ε` is naturally real. This avoids an unnecessary floor operation (contrast with Problem 334, which uses `⌊(n : ℝ) ^ ε⌋₊`). The definition is reasonable as-is, but a shared `IsSmooth` utility across problems 334, 369, 929, etc. would reduce redundancy. + +**Verdict:** Local definition is justified by the real-valued parameter, but a shared utility in `FormalConjecturesForMathlib` could serve multiple problems. + +## 2. Citations + +The docstring references: + +- **[BaWo98]** Balog, A. and Wooley, T., *On strings of consecutive integers with no large prime factors*. J. Austral. Math. Soc. Ser. A (1998). ✅ Matches website. +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✅ Matches website reference `[ErGr80, p.69]`. +- Related problems [370] and [928] are mentioned. ✅ Matches website. + +The website also references: +- **[Er76d]** Erdős, P., *Problems in number theory and combinatorics* — this is referenced on the website's Problem 928 page but not directly on 369. Not required here. + +**Verdict:** Citations are complete and accurate. + +## 3. Variants + +The website describes the problem as stated ("consecutive integers in {1,...,n}") as **trivially true** (take {1,...,k} with n > k^{1/ε}). It identifies two non-trivial strengthenings: + +1. **Variant 1 (m^ε-smooth):** Each m in the consecutive sequence must be m^ε-smooth (rather than n^ε-smooth). This is **resolved** — Balog–Wooley [BaWo98] proves infinitely many such sequences exist. + +2. **Variant 2 ([n/2, n] restriction):** The k consecutive integers must lie in [n/2, n], with the n^ε-smooth condition. Open for **all** sufficiently large n (Balog–Wooley covers only infinitely many n). + +The formalization captures **Variant 2** only, which is the strongest open version. The docstring clearly explains the choice and notes the trivial nature of the literal statement. This is appropriate — formalizing a trivially true statement would be pointless, and Variant 1 is already resolved. + +However, the Erdős–Graham quote "the answer should be affirmative but the problem seems very hard" (referring to even the k=2 case of the non-trivial variant) could be mentioned for additional context. + +**Verdict:** The most important open variant is captured. Variant 1 (resolved) is not formalized, which is a reasonable choice. + +## 4. Readability + +The code is clean and well-structured: +- The `IsSmooth` definition has a clear docstring explaining y-smoothness. +- The module docstring explains the triviality of the literal statement and motivates the chosen variant. +- The theorem statement is concise and follows conventional quantifier ordering. + +Minor suggestions: +- The constraint `a + k ≤ n + 1` encodes "the last element a + (k-1) is ≤ n." While mathematically correct, a comment like `-- i.e., a, a+1, ..., a+k-1 all lie in [n/2, n]` could help readers parse the bound. + +**Verdict:** Good readability. Minor annotation could help. + +## 5. Formalizability + +The problem as formalized (Variant 2) is fully precise and unambiguous: +- "k consecutive integers" = a, a+1, ..., a+k-1 +- "in [n/2, n]" = n/2 ≤ a and a+k-1 ≤ n +- "n^ε-smooth" = all prime factors ≤ n^ε +- "for all sufficiently large n" = ∃ N, ∀ n ≥ N + +The original problem on erdosproblems.com is stated as "consecutive integers in {1,...,n}" which is trivial. The non-trivial [n/2, n] variant is a well-known strengthening from the Erdős–Graham monograph. There is no ambiguity in either the original or the formalized variant. + +**Verdict:** Fully formalizable, no ambiguity. + +## 6. Correctness + +### Detailed analysis of the formal statement: + +```lean +∀ (ε : ℝ) (_ : 0 < ε) (k : ℕ) (_ : 2 ≤ k), +∃ N : ℕ, ∀ n : ℕ, N ≤ n → + ∃ a : ℕ, n / 2 ≤ a ∧ a + k ≤ n + 1 ∧ + ∀ j : ℕ, j < k → IsSmooth ((n : ℝ) ^ ε) (a + j) +``` + +**Quantifier structure:** ∀ ε > 0, ∀ k ≥ 2, ∃ N, ∀ n ≥ N, ∃ a such that... ✅ Correctly captures "for all sufficiently large n" with N depending on both ε and k. + +**Range constraint `n / 2 ≤ a ∧ a + k ≤ n + 1`:** +- `n / 2` is natural number division (floor). For even n, n/2 = n/2. For odd n, n/2 = (n-1)/2. This is ⌊n/2⌋, which is a correct and standard handling in ℕ. +- `a + k ≤ n + 1` ⟺ `a + (k-1) ≤ n`, ensuring the last element of the block is ≤ n. ✅ +- Together: all k integers a, a+1, ..., a+k-1 lie in [⌊n/2⌋, n]. ✅ + +**Smoothness condition `∀ j : ℕ, j < k → IsSmooth ((n : ℝ) ^ ε) (a + j)`:** +- Checks all k elements a, a+1, ..., a+k-1. ✅ +- The smoothness bound is `(n : ℝ) ^ ε`, which is exactly n^ε as a real number. ✅ +- `IsSmooth` checks `∀ p ∈ m.primeFactorsList, (p : ℝ) ≤ y`, comparing prime factors (cast to ℝ) against the real bound. ✅ + +**Edge cases:** +- For n = 0 or n = 1: since we require n ≥ N for sufficiently large N, these are excluded. ✅ +- For a = 0 or a = 1: since a ≥ ⌊n/2⌋ and n is sufficiently large, a ≥ 2. `primeFactorsList` returns [] for 0 and 1 (vacuously smooth), but this case cannot arise. ✅ +- `n ^ ε` for ε ∈ (0, 1) and large n gives a bound that grows subpolynomially relative to n. The smoothness condition is meaningful. ✅ +- There is no upper bound on ε, so ε ≥ 1 is allowed. For ε ≥ 1, n^ε ≥ n, so every number ≤ n is trivially n^ε-smooth. The statement remains true (and trivially so) for large ε. This is not a flaw — the interesting case is small ε. ✅ + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Local `IsSmooth` is justified; shared utility could reduce duplication | +| Citations | Complete and accurate | +| Variants | Strongest open variant formalized; resolved variant reasonably omitted | +| Readability | Good; minor inline comment could help | +| Formalizability | Fully precise, no ambiguity | +| Correctness | **Correct and complete** | diff --git a/ai-review/37.md b/ai-review/37.md new file mode 100644 index 0000000000..556b4f1c6c --- /dev/null +++ b/ai-review/37.md @@ -0,0 +1,102 @@ +# AI Review: Erdős Problem 37 + +## 1. Code Reuse + +**Several significant opportunities for reuse exist.** + +### Schnirelmann Density (Critical) +Mathlib now provides a full `schnirelmannDensity` definition with extensive API in `Mathlib.Combinatorics.Schnirelmann`. This includes: +- `schnirelmannDensity_nonneg`, `schnirelmannDensity_le_one` +- `schnirelmannDensity_le_of_subset` (monotonicity) +- `schnirelmannDensity_eq_one_iff`, `schnirelmannDensity_finite` +- `le_schnirelmannDensity_iff`, `schnirelmannDensity_lt_iff` +- Many more lemmas + +The local definition in `Erdos37` uses `Finset.Icc 1 n` while Mathlib uses `Finset.Ioc 0 n` (equivalent but the Mathlib version has a richer API). Additionally, the Mathlib definition requires `[DecidablePred (· ∈ A)]` whereas the local one uses `open Classical` to avoid this. The local definition should be replaced with the Mathlib one. + +This same duplication exists in Problems 35 and 1146 (Problem 35 uses yet another formulation via `sInf` over a set of ratios rather than `⨅`). + +### Sumset +The local `sumset` definition duplicates Mathlib's pointwise `Set.add` (available via `open Pointwise`). Problem 38 already uses `A + {b}` with `open Pointwise` instead of a custom `sumset`. The definition `sumset A B` is exactly `A + B` under pointwise addition. The custom definition should be removed in favor of `open Pointwise` and using `A + B`. + +### Lacunary Sets +`FormalConjecturesForMathlib/NumberTheory/Lacunary.lean` defines `IsLacunary` for sequences (`ℕ → ℕ`) using filters: `∃ c > 1, ∀ᶠ k in atTop, c * n k < n (k + 1)`. The local `IsLacunary` in Problem 37 is defined for sets (`Set ℕ`) using consecutive elements. These are mathematically equivalent notions (a lacunary set is the range of a lacunary sequence), but the formulations differ enough that bridging them would require a lemma. The set-based version is more natural for this problem statement, but a connection to the sequence-based version could be valuable. + +### Essential Components +Defined identically in Problems 37 and 1146. Could be factored into a shared utility if a `Schnirelmann` utility file is created. + +## 2. Citations + +The docstring cites: +> [Ru87] Ruzsa, I.Z., _Essential components_. Proc. London Math. Soc. (3) **54** (1987), 38–56. + +The website (erdosproblems.com/37) lists the following original source references: +- [Er56, p. 136] +- [Er61, p. 229] +- [Er73, p. 135] +- [ErGr80, p. 49] + +These original Erdős references are not included in the docstring. While the Ruzsa citation for the resolution is the most important, the original problem sources should ideally be noted. + +The website also mentions **related Problem 1146** (whether `{2^m · 3^n}` is an essential component), which could be cross-referenced in the docstring. + +## 3. Variants + +The website describes Ruzsa's result as having two parts: + +1. **Lower bound (used for this problem):** If `A` is an essential component, then `∃ c > 0` such that `|A ∩ {1,…,N}| ≥ (log N)^{1+c}` for all large `N`. +2. **Upper bound (converse direction):** For any `c > 0`, there exists an essential component `A` with `|A ∩ {1,…,N}| ≤ (log N)^{1+c}` for all large `N`. + +Only the main theorem (lacunary ⟹ not essential component) is formalized. The intermediate density lower bound for essential components (part 1) and the optimality result (part 2) are not captured as separate theorem statements. These are interesting results in their own right and could be formalized as additional theorems. + +## 4. Readability + +The code is well-structured and readable. Specific notes: + +- **Good:** Each definition has a clear docstring with LaTeX notation. +- **Good:** The theorem statement is clean: `∀ (A : Set ℕ), IsLacunary A → ¬IsEssentialComponent A`. +- **Minor:** The `IsLacunary` definition's inner quantifier `(∀ c ∈ A, ¬(a < c ∧ c < b))` expressing "consecutive elements" is correct but slightly verbose. A helper predicate `Consecutive` or using `Set.Ioo` could improve clarity, but this is not a significant issue. +- **Minor:** The docstring on `erdos_37` explains the proof strategy (Ruzsa's counting argument), which is helpful context. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement "a lacunary set cannot be an essential component" is precise and well-defined: +- "Lacunary set" has a standard meaning (consecutive elements grow by at least a multiplicative factor `q > 1`). +- "Essential component" has a standard definition in additive number theory via Schnirelmann density. +- The claim is a clean negative result: the conjunction of the two properties is impossible. + +There is essentially no ambiguity in the statement. The only minor point of convention is whether `0 ∈ A` matters for the definition of essential component (since Schnirelmann density is insensitive to membership of `0`), but this does not affect the truth of the theorem. + +## 6. Correctness + +**Assessment: Mathematically correct and complete.** + +### Schnirelmann Density +The local definition `⨅ n : ℕ+, (((Finset.Icc 1 n).filter (· ∈ A)).card : ℝ) / n` correctly computes `inf_{n ≥ 1} |A ∩ {1,…,n}| / n`. This matches the standard definition. (Note: the Mathlib version uses `Ioc 0 n` which gives the same set as `Icc 1 n` for naturals, so they are equivalent.) + +### Sumset +The definition `{n | ∃ a ∈ A, ∃ b ∈ B, n = a + b}` correctly captures `A + B`. + +### IsLacunary +The definition requires `∃ q > 1` such that for consecutive elements `a < b` (with no element of `A` strictly between them), `b ≥ q · a`. This is the standard definition of a lacunary set. One subtlety: the definition allows `0 ∈ A`, in which case if `0` and some `b > 0` are consecutive, the condition `b ≥ q · 0 = 0` is trivially satisfied. This is fine — the lacunarity condition is really about the ratio of large consecutive elements. + +### IsEssentialComponent +The definition `∀ B, 0 < d_s(B) → d_s(B) < 1 → d_s(A + B) > d_s(B)` matches the standard definition. The constraint `0 < d_s(B) < 1` correctly excludes trivial cases. + +### Main Theorem +`∀ (A : Set ℕ), IsLacunary A → ¬IsEssentialComponent A` correctly states that no lacunary set is an essential component. This matches the resolved problem from the website (status: "disproved" — the answer to "can a lacunary set be an essential component?" is no). + +**No mathematical flaws identified.** The formalization is a faithful representation of the problem. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs work | Should use Mathlib's `schnirelmannDensity` and pointwise `+` | +| Citations | Minor gaps | Missing original Erdős source references from website | +| Variants | Partial | Missing Ruzsa's density lower bound and optimality results | +| Readability | Good | Clean, well-documented code | +| Formalizability | Excellent | Unambiguous, precise statement | +| Correctness | Correct | Faithful formalization, no mathematical issues | diff --git a/ai-review/372.md b/ai-review/372.md new file mode 100644 index 0000000000..984a3bc2c5 --- /dev/null +++ b/ai-review/372.md @@ -0,0 +1,80 @@ +# Review: Erdős Problem 372 + +## 1. Code Reuse + +**Issue found.** The file defines its own `largestPrimeFactor` function: + +```lean +noncomputable def largestPrimeFactor (n : ℕ) : ℕ := + n.factorization.support.sup id +``` + +There is an existing library definition `Nat.maxPrimeFac` in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean`: + +```lean +noncomputable def maxPrimeFac (n : ℕ) : ℕ := sSup {p : ℕ | p.Prime ∧ p ∣ n} +``` + +Both definitions agree on all inputs: they return 0 for `n ≤ 1` and the largest prime factor for `n > 1`. The library version comes with useful lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`). The local definition could be replaced by `Nat.maxPrimeFac`. + +Additionally, at least four other Erdős problems (368, 380, 382, and others) independently define the same `largestPrimeFactor` using the identical `n.factorization.support.sup id` pattern. Problem 928 uses a `primeFactors.max'` variant, and problems 648, 649, 683, 700, 976 use `primeFactorsList.fold` variants. All of these are candidates for consolidation onto `Nat.maxPrimeFac`. + +## 2. Citations + +**Issue found.** The website [erdosproblems.com/372](https://www.erdosproblems.com/372) lists five references: + +| Tag | Present in formalization? | +|------|--------------------------| +| [ErPo78] Erdős & Pomerance (1978) | ✅ Yes | +| [ErGr80] Erdős & Graham (1980) | ✅ Yes | +| [Er85c] Erdős (1985) | ✅ Yes | +| [Ba01] Balog (2001) | ✅ Yes | +| [DeDo11] De Koninck & Doyon (2011) | ❌ **Missing** | + +The missing reference is: + +> [DeDo11] De Koninck, J.-M. and Doyon, N., *On a generalization of a conjecture of Erdős and Pomerance*, (2011). + +This reference pertains to a generalized form of the conjecture and should be added to the docstring. + +The website also references OEIS sequence A071870, which is not mentioned in the formalization. + +## 3. Variants + +**Issue found.** The formalization captures only the basic infinitude statement. The website describes two additional results/conjectures that could be formalized as variants: + +1. **Balog's quantitative lower bound (proved):** For all sufficiently large $x$, the number of $n \leq x$ with $P(n) > P(n+1) > P(n+2)$ is $\gg \sqrt{x}$. This is mentioned in the docstring but not formalized. + +2. **Balog's density conjecture (open):** The natural density of such $n$ is $1/6$. This is mentioned in the docstring but not formalized. + +3. **De Koninck–Doyon generalization (2011):** A generalized form of the conjecture, not mentioned at all. + +The quantitative lower bound (item 1) would be a natural strengthening to formalize since it is the actual result Balog proved and is strictly stronger than what `erdos_372` states. + +## 4. Readability + +**No issues.** The code is clean, concise, and well-structured. The docstring clearly states the problem, attributes it properly, and notes the solver. The definition of `largestPrimeFactor` is transparent and easy to understand. The namespace `Erdos372` properly scopes the local definition. + +## 5. Formalizability + +**No issues.** The problem statement "there are infinitely many $n$ such that $P(n) > P(n+1) > P(n+2)$" is completely precise and unambiguous. The only minor convention choice is the value of $P(n)$ for $n \leq 1$, which the formalization handles by returning 0 — a harmless junk value since no $n \leq 1$ can satisfy the strict inequality chain. There is no ambiguity in the mathematical statement that could lead to differing formalizations. + +## 6. Correctness + +**No issues.** The formalization is mathematically correct and complete for the statement it captures. + +- `largestPrimeFactor` correctly computes the largest prime factor via `n.factorization.support.sup id`. For `n > 1`, this returns the maximum of the prime factorization support (i.e., the set of prime divisors), which is exactly $P(n)$. For `n ≤ 1`, it returns 0 (the `⊥` of the `Finset.sup` on `ℕ`), which is a safe junk value. +- The set `{n : ℕ | largestPrimeFactor n > largestPrimeFactor (n + 1) ∧ largestPrimeFactor (n + 1) > largestPrimeFactor (n + 2)}` correctly captures all natural numbers where the largest prime factors form a strictly decreasing chain of length 3. +- `Set.Infinite` is the correct predicate for "infinitely many." +- The `@[category research solved, AMS 11]` attribute correctly marks this as a solved research problem in number theory (AMS classification 11 = Number Theory). + +The formalization is a faithful but incomplete rendering of the full picture: it captures the qualitative infinitude result but not Balog's quantitative $\gg \sqrt{x}$ lower bound. This is a reasonable design choice since the qualitative statement is the original conjecture of Erdős and Pomerance; the quantitative bound is Balog's proof technique, not a separate conjecture. + +## Summary of Recommended Changes + +| Priority | Item | +|----------|------| +| Medium | Replace local `largestPrimeFactor` with `Nat.maxPrimeFac` from the library | +| Low | Add missing [DeDo11] citation to the docstring | +| Low | Consider adding a variant formalizing Balog's $\gg \sqrt{x}$ quantitative bound | +| Low | Consider adding a variant for Balog's density-$1/6$ conjecture | diff --git a/ai-review/374.md b/ai-review/374.md new file mode 100644 index 0000000000..0d7872780c --- /dev/null +++ b/ai-review/374.md @@ -0,0 +1,109 @@ +# Review: Erdős Problem 374 + +## 1. Code Reuse + +The codebase has substantial density infrastructure in `FormalConjecturesForMathlib/Data/Set/Density.lean` that defines `Set.lowerDensity`, `Set.upperDensity`, `Set.HasDensity`, and `Set.HasPosDensity`. Problem 374 instead uses an inline formulation: + +```lean +∃ c : ℝ, c > 0 ∧ ∀ᶠ n : ℕ in atTop, + (((Finset.Icc 1 n).filter (fun m => IsInD 6 m)).card : ℝ) ≥ c * (n : ℝ) +``` + +This is mathematically equivalent to asserting positive lower density of D₆, but it does not reuse the existing `Set.lowerDensity` or `Set.HasPosDensity` infrastructure. Several other Erdős problems (26, 125, 339) already use these utilities. Problem 339 in particular defines its own local `lowerDensity` for a nearly identical purpose and could serve as a template. + +**Recommendation:** Consider restating the conjecture using `Set.HasPosDensity` or `0 < Set.lowerDensity {m : ℕ | IsInD 6 m}` for consistency with the rest of the codebase. Alternatively, the current formulation is self-contained and correct, so this is a style preference rather than a correctness issue. + +Additionally, `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` provides `Nat.squarefreePart` and `Nat.squarePart` utilities that could be useful for any future proof work involving products of factorials being perfect squares, though they are not directly needed in the statement. + +## 2. Citations + +The formalization includes: +- **[ErGr76]** Erdős, P. and Graham, R., *On products of factorials*. Bull. Inst. Math. Acad. Sinica (1976). ✅ +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✅ + +The website also lists: +- **[LSS14]** — This reference appears on the erdosproblems.com page but is **not included** in the formalization's docstring. The full citation details are not provided on the website beyond the tag, so it likely refers to Luca, Stănică, and Sanna or a similar 2014 paper on products of factorials. + +**Recommendation:** Add the [LSS14] reference to the docstring once the full citation is identified, or note its omission explicitly. + +## 3. Variants + +The website poses a **broader question** than what is formalized: + +> "What is the order of growth of |D_k ∩ {1,…,n}| for 3 ≤ k ≤ 6?" + +The formalization captures only the specific sub-question about D₆ having positive lower density. The following aspects from the website are **not formalized**: + +- **Growth rates for D₃, D₄, D₅**: The broader question asks about the order of growth for all k ∈ {3,4,5,6}. +- **Known results** that could be stated as additional theorems or lemmas: + - D₂ = {n² : n > 1} + - No D_k contains a prime + - |D₃ ∩ {1,…,n}| = o(|D₄ ∩ {1,…,n}|) + - The least element of D₆ is 527 + - D_k = ∅ for k > 6 + +Some of these (especially D₂ = {n² : n > 1} and D_k = ∅ for k > 6) are concrete, provable statements that would strengthen the formalization and provide useful sanity checks on the definitions. + +**Recommendation:** Consider adding at least D_k = ∅ for k > 6 and D₂ = {n² : n > 1} as auxiliary lemmas, since they test the definitions against known results. The broader growth-rate questions for k = 3,4,5 could also be formalized as separate conjectures. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- **Good**: The `HasFactorialSquareSeq` and `IsInD` definitions are cleanly separated with clear docstrings. +- **Good**: The namespace `Erdos374` prevents name collisions. +- **Minor**: The docstring for `HasFactorialSquareSeq` says "with maximum element m" but the formal condition is `∀ x ∈ s, x ≤ m` combined with `m ∈ s`. This is correct but could be stated more explicitly as "m is the maximum of s." +- **Minor**: The condition `k ≥ 2` is embedded inside `HasFactorialSquareSeq` rather than being a separate precondition. This is fine for the current use case but means `HasFactorialSquareSeq m 1` is always false (by the `k ≥ 2` clause), which makes the minimality check in `IsInD` vacuously satisfied for j < 2. This is logically correct but slightly non-obvious. + +## 5. Formalizability + +The problem as stated on the website is **precise and clearly formalizable**. The key concepts are: + +- **F(m)**: well-defined as a minimum over a finite search space (subsets of {1,…,m} of bounded size). +- **D_k**: well-defined as a preimage of F. +- **Positive lower density**: standard asymptotic notion with no ambiguity. + +The only mild ambiguity is whether "natural number" includes 0. The formalization uses `ℕ` (which includes 0 in Lean/Mathlib), but this is inconsequential: 0! = 1 contributes trivially to the product, so including or excluding 0 from the sequences does not change F(m) for any m ≥ 1. The use of `Finset.Icc 1 n` in the main theorem correctly restricts attention to m ≥ 1. + +**Assessment: No ambiguity issues.** The problem is fully formalizable as stated. + +## 6. Correctness + +### Definition: `HasFactorialSquareSeq` + +The definition requires: +1. A `Finset ℕ` of cardinality k (ensures k distinct naturals) +2. k ≥ 2 +3. m ∈ s (m is in the sequence) +4. ∀ x ∈ s, x ≤ m (m is the maximum) +5. The product of factorials over s is a perfect square + +This correctly captures "there exist a₁ < ⋯ < aₖ = m with a₁!⋯aₖ! a perfect square." The use of `Finset` guarantees distinctness, conditions (3) and (4) together ensure m = max(s), and condition (5) is the square condition. **Correct.** + +### Definition: `IsInD` + +```lean +def IsInD (k : ℕ) (m : ℕ) : Prop := + HasFactorialSquareSeq m k ∧ ∀ j, j < k → ¬HasFactorialSquareSeq m j +``` + +This says F(m) = k: k works, and nothing smaller works. Since `HasFactorialSquareSeq` internally requires k ≥ 2, the minimality check for j ∈ {0, 1} is vacuously true. This is **correct** — the minimum possible value of F is 2, and the definition correctly reflects this. + +### Main theorem: `erdos_374` + +```lean +theorem erdos_374 : + ∃ c : ℝ, c > 0 ∧ + ∀ᶠ n : ℕ in atTop, + (((Finset.Icc 1 n).filter (fun m => IsInD 6 m)).card : ℝ) ≥ c * (n : ℝ) +``` + +This states: there exists c > 0 such that for all sufficiently large n, |D₆ ∩ {1,…,n}| ≥ cn. This is exactly the assertion that D₆ has positive lower density, matching the conjecture "|D₆ ∩ {1,…,n}| ≫ n" from the website. **Correct.** + +### Potential subtlety: `IsInD 6 m` for small m + +For m values where F(m) is undefined (no k ≥ 2 works at all), `IsInD 6 m` is false because the first conjunct `HasFactorialSquareSeq m 6` fails. This is the correct behavior — such m should not be in any D_k. + +### Overall correctness assessment + +**The formalization is mathematically correct and complete for the specific D₆ sub-question.** No flaws identified. The only gap is the absence of the broader question about growth rates for k = 3,4,5, which is a completeness issue (see Variants above) rather than a correctness issue. diff --git a/ai-review/378.md b/ai-review/378.md new file mode 100644 index 0000000000..e420e09454 --- /dev/null +++ b/ai-review/378.md @@ -0,0 +1,80 @@ +# Review of Erdős Problem 378 + +## 1. Code Reuse + +The file defines local versions of `upperDensity`, `lowerDensity`, and `HasNaturalDensity` in the `Erdos378` namespace (lines 39–50). However, `FormalConjecturesForMathlib/Data/Set/Density.lean` already provides: + +- `Set.upperDensity` / `Set.lowerDensity` — equivalent definitions using `Set.interIio` and `ncard` +- `Set.HasDensity` — natural density via `Tendsto ... atTop (𝓝 α)` +- `Set.HasPosDensity` — `∃ α > 0, S.HasDensity α` + +The local `HasNaturalDensity` (limsup = liminf = d) is mathematically equivalent to `Set.HasDensity` (convergence in `𝓝 d`), and the theorem conclusion `∃ d > 0, HasNaturalDensity ... d` is exactly what `Set.HasPosDensity` captures. The three local definitions could be replaced with the library versions, reducing ~15 lines of code. + +`Squarefree` and `Nat.choose` are already available from Mathlib via the standard imports, so no issues there. + +## 2. Citations + +The formalization references: +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). ✅ Matches website. +- **[GrRa96]** — Granville, A. and Ramaré, O., *Explicit bounds on exponential sums and the scarcity of squarefree binomial coefficients*. Mathematika 43 (1996), 73–107. ✅ Matches website. + +**Missing:** The website credits **Aggarwal and Cambie** for noting that the problem is resolved by [GrRa96]. This attribution is absent from the docstring. Consider adding a note such as: "As noted by Aggarwal and Cambie, this is resolved by Granville and Ramaré [GrRa96]." + +## 3. Variants + +The website provides a more precise form of the resolution: the density of integers $n$ where $\binom{n}{k}$ is squarefree for exactly $2m + 2$ values of $k$ exists (call it $\eta_m$), and the density in question equals $1 - \sum_{0 \le m \le (r-1)/2} \eta_m$. This stronger structural result (existence of each $\eta_m$ individually) is not captured as a separate theorem. + +The docstring does mention that Granville–Ramaré show the density for "exactly $2m + 2$ values" exists, but no corresponding formal statement is provided. A natural variant would be: + +```lean +theorem erdos_378_exact (m : ℕ) : + ∃ d : ℝ, HasNaturalDensity {n : ℕ | squarefreeBinomCount n = 2 * m + 2} d := by + sorry +``` + +This is a minor omission since the main conjecture is captured, but the stronger result would be a worthwhile addition. + +## 4. Readability + +The code is well-structured and readable. The helper definitions (`squarefreeBinomCount`, `squarefreeBinomAtLeast`) have clear docstrings and are appropriately factored. The naming is consistent with Lean/Mathlib conventions. + +One minor note: `squarefreeBinomCount` filters on `0 < k` inside `Finset.range n`. An alternative would be `(Finset.Icc 1 (n - 1)).filter (fun k => Squarefree (Nat.choose n k))` which more directly mirrors the "$1 \le k < n$" condition, but the current approach is functionally equivalent and fine. + +## 5. Formalizability + +**Assessment: Fully formalizable, no ambiguity.** + +The problem statement is precise: for each $r \ge 0$, the natural density of $\{n : \binom{n}{k} \text{ is squarefree for at least } r \text{ values of } 1 \le k < n\}$ exists and is positive. Every component — natural density, squarefreeness, binomial coefficients, the quantification over $r$ — has a clear mathematical definition. There is no ambiguity in the statement. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed checks: + +- **`squarefreeBinomCount`**: Filters `Finset.range n` (giving $\{0, 1, \ldots, n-1\}$) with the predicate `0 < k ∧ Squarefree (Nat.choose n k)`. This correctly captures the count of $k$ with $1 \le k < n$ such that $\binom{n}{k}$ is squarefree. ✅ + +- **`squarefreeBinomAtLeast r`**: Defined as `{n : ℕ | r ≤ squarefreeBinomCount n}`, correctly capturing "at least $r$ values." ✅ + +- **`HasNaturalDensity`**: Defined as upper density = lower density = $d$, which is the standard definition of natural density existing and equaling $d$. ✅ + +- **`upperDensity` / `lowerDensity`**: Use `Filter.limsup`/`Filter.liminf` of `|A ∩ \{0,\ldots,N-1\}| / N` along `atTop`. This is the standard definition. ✅ + +- **Main theorem**: States `∀ r, ∃ d > 0, HasNaturalDensity (squarefreeBinomAtLeast r) d`. This exactly captures both parts of the conjecture (existence of density + positivity). ✅ + +- **Edge case $r = 0$**: `squarefreeBinomAtLeast 0 = Set.univ` since `0 ≤ squarefreeBinomCount n` always holds. The density of $\mathbb{N}$ is 1 > 0, so the statement is trivially true. This is consistent. ✅ + +- **Resolved status**: The docstring correctly notes the problem is resolved in the affirmative by [GrRa96], and the `@[category research solved]` tag matches. ✅ + +No mathematical flaws identified. The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Category | Rating | +|---|---| +| Code reuse | ⚠️ Local density definitions duplicate library code | +| Citations | ⚠️ Missing Aggarwal–Cambie attribution | +| Variants | ⚠️ The "exactly $2m+2$" structural result is mentioned but not formalized | +| Readability | ✅ Clear and well-structured | +| Formalizability | ✅ Unambiguous, fully formalizable | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/380.md b/ai-review/380.md new file mode 100644 index 0000000000..1e00f95994 --- /dev/null +++ b/ai-review/380.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 380 + +## 1. Code Reuse + +**High-priority issue.** The file defines `largestPrimeFactor380` at line 33 as `n.factorization.support.sup id`. This is identical to `largestPrimeFactor` in `ErdosProblems/382.lean:37–38` and near-identical definitions in problems 368 and 372. A library definition already exists: + +- `Nat.maxPrimeFac` in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean:28`, defined as `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. + +These definitions are equivalent for all `n` (both return 0 for `n ≤ 1`, and for `n > 1`, `factorization.support = {p | p.Prime ∧ p ∣ n}` as a `Finset`, so `sup id` agrees with `sSup`). All four problem files should be refactored to use `Nat.maxPrimeFac`. + +Additionally, `IsBadInterval` (380, line 38) is functionally identical to `HasSquaredLargestPrime` (382, line 42). These definitions should be unified and shared, given that Problems 380 and 382 are explicitly related on the Erdős Problems website. + +## 2. Citations + +The docstring cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +with page reference `p. 73`. This matches the website's citation of [ErGr80, p.73]. + +**Missing from docstring:** +- The website notes a relationship to **Problem 382**, which shares the same "bad interval" setup. A cross-reference would be valuable. +- The website lists related OEIS sequences: A070003, A388654, A387054, A389100. +- Terence Tao contributed notes to this problem on the website. + +## 3. Variants + +The formalization captures only the main conjecture: $B(x) \sim \#\{n \le x : P(n)^2 \mid n\}$. + +**Missing variant:** The Erdős Problems website describes a "very bad" interval variant: when $\prod_{u \le m \le v} m$ is **powerful** (every prime factor appears with exponent ≥ 2), the count of integers contained in such intervals should be $\ll x^{1/2}$, asymptotic to the count of powerful numbers ≤ x. This is a natural strengthening worth formalizing. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The `380` suffix on helper names (`largestPrimeFactor380`, `B380`, `squareDivCount380`) is a codebase convention for namespace isolation. While functional, if `Nat.maxPrimeFac` is adopted, the suffix becomes unnecessary for that definition. +- The docstring on `erdos_380` clearly explains the asymptotic equivalence formalization. This is good practice. +- The `let` bindings inside `IsBadInterval` (lines 39–40) make the definition easy to follow. + +## 5. Formalizability + +**Assessment: High.** The problem statement is precise and unambiguous. All components are well-defined: + +- "Bad interval" has a clear combinatorial definition. +- $B(x)$ is a well-defined counting function. +- $P(n)$ (largest prime factor) is standard. +- The asymptotic equivalence $f \sim g$ has a standard ε-δ formalization. + +The only minor ambiguity is whether the original problem intends $n \ge 1$ or $n \ge 2$ in the counting functions, but this is asymptotically irrelevant and the formalization handles it correctly (B380 counts from 1; squareDivCount380 implicitly starts at 2 via the `0 < largestPrimeFactor380 n` guard, since `largestPrimeFactor380 1 = 0`). + +**Ambiguity: Negligible.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +**Definitions:** +- `largestPrimeFactor380`: Correctly returns 0 for n ≤ 1 and the largest prime factor for n > 1. ✓ +- `IsBadInterval u v`: The conjunction `u ≤ v ∧ 0 < p ∧ 1 < P.factorization p` correctly captures that [u,v] is a non-degenerate interval whose product has its largest prime factor appearing with multiplicity > 1. The `0 < p` guard correctly excludes degenerate cases (e.g., u = v = 1 where the product is 1, or intervals containing 0 where the product is 0). ✓ +- `InBadInterval n`: Correctly existentially quantifies over intervals containing n. ✓ +- `B380 x`: Correctly counts n ∈ [1, x] in at least one bad interval. ✓ +- `squareDivCount380 x`: Correctly counts n ∈ [1, x] with P(n)² | n, implicitly excluding n = 1. ✓ + +**Asymptotic statement:** The formalization of $B(x) \sim f(x)$ as + +$$\forall \varepsilon > 0,\ \exists x_0,\ \forall x \ge x_0,\quad (1-\varepsilon) f(x) \le B(x) \le (1+\varepsilon) f(x)$$ + +is a standard and correct ε-δ rendering of asymptotic equivalence when $f(x) > 0$ for sufficiently large $x$. Since $\#\{n \le x : P(n)^2 \mid n\}$ is eventually positive (e.g., $n = 4$ satisfies $P(4)^2 = 4 \mid 4$), this is valid. ✓ + +**Edge case note:** For small x where `squareDivCount380 x = 0`, the bounds reduce to `0 ≤ B380 x ≤ 0`, i.e., `B380 x = 0`. This is acceptable because the statement only requires the bounds for `x ≥ x₀`, and `x₀` can be chosen large enough to avoid this regime. + +**The `answer(sorry)` wrapper** correctly frames this as an open problem whose truth value is unknown. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | Should use `Nat.maxPrimeFac`; unify `IsBadInterval` with 382's `HasSquaredLargestPrime` | +| Citations | Minor gaps | Missing cross-ref to Problem 382, OEIS sequences | +| Variants | Incomplete | "Very bad" (powerful product) variant not captured | +| Readability | Good | Clear structure and documentation | +| Formalizability | Excellent | Unambiguous, standard definitions | +| Correctness | Correct | No mathematical issues found | diff --git a/ai-review/381.md b/ai-review/381.md new file mode 100644 index 0000000000..a39889c2b7 --- /dev/null +++ b/ai-review/381.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 381 + +## 1. Code Reuse + +**Potential reuse identified:** + +- **`τ` abbreviation (Erdős 945, line 30):** Problem 945 defines `abbrev τ := fun (n : ℕ) => n.divisors.card`. The `IsHighlyComposite` definition in 381 uses `(Nat.divisors m).card` directly. If a shared utility for the divisor-counting function τ were extracted (e.g., to `Util/`), both problems could reference it. However, since `n.divisors.card` is already a simple Mathlib expression, the benefit is marginal — this is more a readability/consistency consideration than a true reuse opportunity. + +- **Counting pattern:** The `highlyCompositeCount` function uses the standard `(Finset.range x).filter(...).card` pattern seen across many Erdős problems (122, 468, 1100, 1165, etc.). No shared abstraction exists for this pattern, nor is one needed — the pattern is simple and idiomatic. + +- **No existing `IsHighlyComposite` definition** exists elsewhere in the codebase. This is the sole definition. + +**Verdict:** No significant reuse opportunities. The definitions are appropriately self-contained. + +## 2. Citations + +**Website (erdosproblems.com/381):** Lists references [Er44] and [Ni71]. + +**Formalization docstring:** +- `[Er44] Erdős, P., On highly composite numbers, J. London Math. Soc. 19 (1944), 130–133.` +- `[Ni71] Nicolas, J.-L., Répartition des nombres hautement composés de Ramanujan, Canad. J. Math. 23 (1971), 116–130.` + +**Assessment:** Both citations from the website are present with full bibliographic details. The formalization's citations are more detailed than the website's (which only lists shorthand tags). No citations are missing. + +## 3. Variants + +The website presents a single problem statement with no listed variants. The formalization captures: +- The conjecture (Q(x) ≫_k (log x)^k for every k ≥ 1) +- The disproved status (via `answer(False)`) +- Erdős's positive result Q(x) ≫ (log x)^{1+c} (mentioned in docstring) +- Nicolas's disproof (mentioned in docstring) + +**Assessment:** All aspects of the problem as presented on the website are captured. No variants are missing. + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- The `highlyCompositeCount` function uses `Finset.range x` with a `n + 1` shift, which is a standard Lean idiom to avoid dealing with 0. An alternative would be `(Finset.Icc 1 x).filter IsHighlyComposite` which would read more naturally (directly filtering [1, x] without the shift), but this is a stylistic preference and the current approach is correct. + +- The docstring on the main theorem is thorough: it restates the definition of highly composite, defines Q(x), states the conjecture, mentions Erdős's partial result, and explains the disproof. This is excellent. + +- The `IsHighlyComposite` definition has a clear docstring. + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem is completely precise and unambiguously formalizable: + +- "Highly composite" has a standard, universally agreed-upon definition (OEIS A002182): n has more divisors than all smaller positive integers. +- Q(x) is a well-defined counting function. +- The asymptotic notation Q(x) ≫_k (log x)^k has a standard meaning: for each k, there exists c_k > 0 and N₀ such that Q(x) ≥ c_k · (log x)^k for all x ≥ N₀. +- The disproved status is unambiguous. + +**Assessment:** No ambiguity whatsoever. The problem is a textbook example of a cleanly formalizable statement. + +## 6. Correctness + +**Definition of `IsHighlyComposite`:** States that n > 0 and every positive m < n has strictly fewer divisors than n. This correctly matches the standard definition. In particular: +- n = 1 is correctly classified as highly composite (the universal quantifier is vacuously satisfied since there is no positive m < 1). +- The requirement 0 < n correctly excludes 0. + +**Definition of `highlyCompositeCount`:** `Finset.range x` gives {0, ..., x−1}, and checking `IsHighlyComposite (n + 1)` for each element correctly counts highly composite numbers in {1, ..., x} = [1, x]. This matches the stated purpose. + +**Main theorem:** The statement +``` +answer(False) ↔ ∀ (k : ℕ), 1 ≤ k → ∃ c : ℝ, 0 < c ∧ ∃ N₀ : ℕ, ∀ x : ℕ, N₀ ≤ x → c * (log x)^k ≤ Q(x) +``` +correctly encodes: +- `answer(False)` evaluates to `False`, so `False ↔ (conjecture)` is equivalent to `¬(conjecture)`, correctly capturing that the conjecture is disproved. +- The RHS faithfully encodes Q(x) ≫_k (log x)^k for every k ≥ 1: for each k ≥ 1, there exists a positive constant c and a threshold N₀ such that beyond N₀, Q(x) ≥ c · (log x)^k. +- Using k : ℕ rather than k : ℝ is sound. Since the answer is `False`, we only need to show the conjecture fails for *some* k ≥ 1. If it fails for a natural number k, it certainly fails. Conversely, if it held for all natural k, it would hold for all real k ≥ 1 as well (since (log x)^⌈k⌉ ≥ (log x)^k for log x ≥ 1). So the ℕ restriction is equivalent to the ℝ version. +- Using x : ℕ rather than x : ℝ is sound: since Q is a step function on ℝ with Q(x) = Q(⌊x⌋), the asymptotic statement over ℕ is equivalent to the one over ℝ. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | ✅ No significant opportunities missed | +| Citations | ✅ Complete and accurate | +| Variants | ✅ All captured | +| Readability | ✅ Good | +| Formalizability | ✅ Fully unambiguous | +| Correctness | ✅ Correct and complete | + +This is a clean, well-executed formalization with no issues requiring attention. diff --git a/ai-review/382.md b/ai-review/382.md new file mode 100644 index 0000000000..008bdbaf71 --- /dev/null +++ b/ai-review/382.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 382 + +## 1. Code Reuse + +**Issue found.** Problem 382 defines a local `largestPrimeFactor` function: + +```lean +noncomputable def largestPrimeFactor (n : ℕ) : ℕ := + n.factorization.support.sup id +``` + +This is functionally identical to: +- `largestPrimeFactor380` defined locally in `FormalConjectures/ErdosProblems/380.lean` (copy-pasted, same body). +- `Nat.maxPrimeFac` defined in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean`, which uses `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. + +Both return 0 for n ≤ 1 and give the largest prime factor otherwise. The `Nat.maxPrimeFac` definition is the canonical shared version and is already used by problems 370, 371, 373, 383, and 932. Problems 380 and 382 should be refactored to use `Nat.maxPrimeFac` instead of their local copies. + +Similarly, the `HasSquaredLargestPrime` predicate in 382 is closely related to `IsBadInterval` in 380 (same structure, same semantics). These could potentially share a common definition, though their docstrings emphasize slightly different perspectives of the same concept. + +## 2. Citations + +The docstring references: +- `[erdosproblems.com/382](https://www.erdosproblems.com/382)` — correct. +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). — matches the website. + +**Missing from docstring:** The website additionally mentions: +- Results by **Ramachandra** implying the upper bound v − u ≤ v^{1/2 + o(1)}. +- Observations by **Cambie** connecting Part 1 to conjectures on prime gaps (specifically Cramér's conjecture) and providing a heuristic for Part 2. +- Related problems #380 and #383. + +These are contextual notes rather than defining references, so their omission is minor but could enhance the docstring for readers. + +## 3. Variants + +The formalization captures both parts stated on the website: +1. **Part 1** (`erdos_382`): Is v − u = v^{o(1)}? +2. **Part 2** (`erdos_382.variants.arbitrarily_large`): Can v − u be arbitrarily large? + +**All variants on the website are captured.** No additional variants are missing. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The `let` bindings inside `HasSquaredLargestPrime` are clear and well-documented. +- The docstrings for both theorems include the mathematical statement in LaTeX and a plain-language explanation of the formalization (e.g., explaining what v^{o(1)} means formally). This is good practice. +- The namespace `Erdos382` is consistent with other files in the project. +- The name `HasSquaredLargestPrime` could be slightly misleading — it doesn't mean the largest prime *is* squared, but that the largest prime appears with exponent ≥ 2 in the product's factorization. The docstring clarifies this, which mitigates the concern. A name like `LargestPrimeHasSquareExponent` might be more precise but is arguably less concise. + +## 5. Formalizability + +**The problem is precise enough to be obviously formalizable.** Both parts have clear, unambiguous mathematical statements: + +- Part 1 asks about an asymptotic bound (v − u = v^{o(1)}), which has a standard ε-δ formalization. The formalization correctly interprets this as: ∀ ε > 0, ∃ N₀, ∀ v ≥ N₀, (condition on (u,v)) → v − u ≤ v^ε. +- Part 2 asks a straightforward existential question about v − u being unbounded. + +**Ambiguity assessment: Very low.** The only potential ambiguity is whether "the largest prime dividing ∏ m" refers to the largest prime dividing the product (standard reading, adopted here) or some other interpretation — but the standard reading is essentially the only reasonable one. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** Detailed analysis: + +### Part 1 (`erdos_382`) + +The statement formalizes v − u = v^{o(1)} as: for every ε > 0, there exists N₀ such that for all u, v with v ≥ N₀ and `HasSquaredLargestPrime u v`, we have (v : ℝ) − (u : ℝ) ≤ (v : ℝ)^ε. + +- **Correct encoding of o(1):** The condition v^{o(1)} as v → ∞ means that for any ε > 0, eventually v − u ≤ v^ε. The threshold N₀ depends only on ε, not on u. This is correct because the quantifier structure is ∀ ε, ∃ N₀, ∀ u v, ... — the bound N₀ is uniform over all qualifying pairs (u,v) with v ≥ N₀. +- **Use of real coercions:** The subtraction (v : ℝ) − (u : ℝ) avoids natural number subtraction truncation. Since `HasSquaredLargestPrime` requires u ≤ v, this equals (v − u : ℕ) cast to ℝ, so this is both safe and correct. +- **The `answer(sorry)` wrapper** is appropriate since this is an open problem where the truth value is unknown. + +### Part 2 (`erdos_382.variants.arbitrarily_large`) + +The statement asks: ∀ k : ℕ, ∃ u v : ℕ, k ≤ v − u ∧ HasSquaredLargestPrime u v. + +- Since `HasSquaredLargestPrime` includes the constraint u ≤ v, natural number subtraction v − u is well-defined and equals the true difference. The condition k ≤ v − u correctly captures "v − u can be arbitrarily large." +- The `answer(sorry)` wrapper is again appropriate. + +### `HasSquaredLargestPrime` + +- `P := ∏ m ∈ Finset.Icc u v, m` — the product over the closed interval [u, v]. Correct. +- `p := largestPrimeFactor P` — using `factorization.support.sup id`, which gives the maximum element of the support of the factorization (i.e., the largest prime factor). Returns 0 if P ≤ 1. Correct. +- `u ≤ v` — ensures a nonempty interval. Correct. +- `0 < p` — ensures P > 1 (i.e., the product is nontrivial and has a prime factor). This rules out degenerate cases like u = v = 0 or u = v = 1. Correct. +- `1 < P.factorization p` — the exponent of the largest prime in the factorization of the product is at least 2. This matches "appears with exponent at least 2." Correct. + +### Edge case analysis + +- **u = v = 0:** P = 0, factorization is zero everywhere, p = 0, 0 < p fails. Correctly excluded. +- **u = v = 1:** P = 1, factorization support is empty, p = 0, 0 < p fails. Correctly excluded. +- **u = 0, v = 1:** P = 0 (since 0 is in the product). The factorization of 0 is everywhere-zero in Mathlib, so p = 0, 0 < p fails. This is arguably a design choice — the interval [0,1] contains 0, making the product 0, which the formalization treats as degenerate. This is mathematically reasonable since the problem implicitly considers intervals of positive integers. + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Refactor recommended**: use `Nat.maxPrimeFac` from shared library | +| Citations | Correct; minor enrichment possible with Ramachandra/Cambie notes | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/384.md b/ai-review/384.md new file mode 100644 index 0000000000..b3b9c53c43 --- /dev/null +++ b/ai-review/384.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 384 + +## 1. Code Reuse + +Several related formalizations exist in the codebase: + +- **Problem 387** (`ErdosProblems/387.lean`) is the most closely related — it concerns divisors of binomial coefficients in ranges. The proved lemma `erdos_387.easy` shows `C(n,k)` has a divisor in `[n/k, n]` via `gcd`. While the technique (using `gcd` to extract a divisor in a range) does not directly apply here (Problem 384 requires a *prime* divisor, not just any divisor), the structural pattern is relevant. +- **Problem 175** (`ErdosProblems/175.lean`) concerns squarefreeness of central binomial coefficients, using similar machinery (`Nat.choose`, `Nat.Prime`, divisibility). +- **Problem 378** (`ErdosProblems/378.lean`) also deals with squarefreeness of general binomial coefficients. +- **`FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean`** defines `Nat.maxPrimeFac` and proves `prime_maxPrimeFac_of_one_lt`. This could potentially be used to reason about the largest prime factor, though the problem requires a *small* prime factor rather than a large one. +- **`FormalConjecturesForMathlib/Data/Nat/Prime/Defs.lean`** provides `Nat.exists_prime_not_dvd`. + +No existing implementation can be directly substituted, but no code duplication is present either. The file appropriately relies on standard Mathlib imports via `ProblemImports`. + +## 2. Citations + +The website (https://www.erdosproblems.com/384) lists: +- **[ErGr80]** Erdős and Graham, *Old and new problems and results in combinatorial number theory*, p. 73. ✅ Present in docstring. +- **[Ec69]** Ecklund, E. F., *On prime divisors of the binomial coefficient* (1969). ✅ Present in docstring. +- **[Gu04]** Guy, Richard K., *Unsolved problems in number theory* (2004) — mentioned on website for Selfridge's conjecture variant. ❌ Not cited (acceptable since the Selfridge variant is not formalized). + +The website also references related problems **#1094** and **#1095** for stronger forms. These are not mentioned in the docstring. + +**Citation formatting**: The existing citations are consistent with the codebase convention and match the website's references. No issues. + +## 3. Variants + +The formalization captures only the base Erdős–Selfridge conjecture (proved by Ecklund). The following variants from the website are **not formalized**: + +1. **Ecklund's stronger conjecture**: Whenever `n > k²`, the binomial coefficient `C(n,k)` is divisible by a prime `p < n/k`. This is mentioned in the docstring but has no formal statement. Given that this is a natural strengthening explicitly attributed on the website, it would be valuable to include. + +2. **Selfridge's conjecture** (from [Gu04]): If `n > 17.125k`, then `C(n,k)` has a prime factor `p ≤ n/k`. Not mentioned in the formalization. + +3. **Weaker established result**: A weaker inequality `p ≪ n/k^c` for some constant `c > 0` has been proved. Not formalized. + +**Recommendation**: At minimum, Ecklund's stronger conjecture (already described in the docstring) should be formalized as a separate theorem statement, similar to how Problem 387 includes `erdos_387.schinzel` and `erdos_387.variant`. + +## 4. Readability + +The code is clean, short, and well-structured. Minor observations: + +- The docstring clearly states the mathematical content. +- The equivalence "(equivalently p < n/2)" in the docstring is helpful for connecting the formal `2 * p < n` to the more standard mathematical phrasing. +- The exception cases `¬(n = 7 ∧ (k = 3 ∨ k = 4))` are clear. + +No readability issues. + +## 5. Formalizability + +The problem is fully precise and clearly formalizable. There is no ambiguity in the mathematical statement — it involves only concrete arithmetic conditions on natural numbers, primality, divisibility, and binomial coefficients, all of which have standard Mathlib definitions. + +**Ambiguity assessment**: Very low. The only potential source of ambiguity is the boundary of the inequality (strict vs. non-strict for `p < n/2` vs. `p ≤ n/2`), which is discussed in the correctness section below. + +## 6. Correctness + +### Critical Issue: Strict vs. Non-Strict Inequality + +The formalization uses `2 * p < n` (strict inequality, equivalent to `p < n/2`), matching the website's literal text. However, **this appears to be incorrect** — the theorem as stated has additional counterexamples beyond `(7, 3)` and `(7, 4)`: + +| (n, k) | C(n,k) | Prime factors | Primes p with 2p < n | Satisfied? | +|---------|--------|---------------|----------------------|------------| +| (4, 2) | 6 | 2, 3 | p ≤ 1 (none) | ❌ | +| (6, 2) | 15 | 3, 5 | p ≤ 2; 2 ∤ 15 | ❌ | +| (6, 4) | 15 | 3, 5 | p ≤ 2; 2 ∤ 15 | ❌ | +| (7, 3) | 35 | 5, 7 | p ≤ 2; 2 ∤ 35 | ❌ (listed exception) | +| (7, 4) | 35 | 5, 7 | p ≤ 2; 2 ∤ 35 | ❌ (listed exception) | + +With the **non-strict** inequality `2 * p ≤ n` (equivalently `p ≤ n/2`), all the spurious counterexamples vanish: + +| (n, k) | C(n,k) | Witness prime p with 2p ≤ n | Satisfied? | +|---------|--------|-----------------------------|------------| +| (4, 2) | 6 | p = 2, 2×2 = 4 ≤ 4 ✓ | ✅ | +| (6, 2) | 15 | p = 3, 2×3 = 6 ≤ 6 ✓ | ✅ | +| (6, 4) | 15 | p = 3, 2×3 = 6 ≤ 6 ✓ | ✅ | +| (7, 3) | 35 | p ≤ 3; 2 ∤ 35, 3 ∤ 35 | ❌ (correctly excepted) | + +**Conclusion**: The formal statement should use `2 * p ≤ n` instead of `2 * p < n`. The website's "p < n/2" appears to be a rendering inaccuracy; the original Erdős–Graham statement almost certainly uses `p ≤ n/2`. The current formalization is **incorrect as stated** — it is false even with the listed exceptions, because `(4,2)`, `(6,2)`, and `(6,4)` are unexcluded counterexamples. + +### Recommended Fix + +```lean +theorem erdos_384 : + ∀ n k : ℕ, 1 < k → k + 1 < n → + ¬(n = 7 ∧ (k = 3 ∨ k = 4)) → + ∃ p : ℕ, Nat.Prime p ∧ 2 * p ≤ n ∧ p ∣ Nat.choose n k := by + sorry +``` + +### Other Correctness Notes + +- The symmetry handling is correct: since `C(7,3) = C(7,4) = 35`, both `(7,3)` and `(7,4)` must be excluded. +- The bounds `1 < k` and `k + 1 < n` correctly encode `1 < k < n - 1` for natural numbers. +- The `category research solved` tag is correct — the problem was proved by Ecklund [Ec69]. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | ✅ No issues; no duplication | +| Citations | ✅ Core references present | +| Variants | ⚠️ Ecklund's stronger conjecture mentioned in docstring but not formalized | +| Readability | ✅ Clean and clear | +| Formalizability | ✅ Fully precise | +| Correctness | ❌ **Strict inequality `2 * p < n` should be `2 * p ≤ n`** — current statement has unexcluded counterexamples | diff --git a/ai-review/388.md b/ai-review/388.md new file mode 100644 index 0000000000..e1009f8234 --- /dev/null +++ b/ai-review/388.md @@ -0,0 +1,125 @@ +# AI Review: Erdős Problem 388 + +## 1. Code Reuse + +The formalization defines `consecutiveProduct (m k : ℕ) : ℕ := ∏ i ∈ Finset.range k, (m + 1 + i)`, which computes $(m+1)(m+2)\cdots(m+k)$. + +Problem 931 (`ErdosProblems/931.lean`) computes the same product inline using `∏ i ∈ Finset.Icc 1 k₁, (n₁ + i)`. These are mathematically identical: `∏ i ∈ range k, (m + 1 + i) = ∏ i ∈ Icc 1 k, (m + i)`. The two problems should share a common definition rather than using different but equivalent formulations. The `consecutiveProduct` definition from 388 could be promoted to a shared utility and reused by Problem 931 (and vice versa, Problem 363's `prod4` is a special case). + +Relevant utilities in `FormalConjecturesForMathlib`: +- `Data/Nat/Factorization/Basic.lean` — prime factorization helpers. +- `Data/Nat/Squarefree.lean` — `squarefreePart`, `squarePart` decompositions. +- `Data/Nat/MaxPrimeFac.lean` — maximum prime factor utilities. + +None of these directly replace the current code, but a shared `consecutiveProduct` definition would improve consistency across Problems 363, 388, and 931. + +## 2. Citations + +The module docstring includes: +- `[Er76d] Erdős, P.` — matches website. +- `[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980).` — matches website. This is the most complete citation in the file. +- `[Er92e] Erdős, P.` — matches website. + +The website also mentions related problems 363 and 931, which the docstring correctly references with "See also problems 363 and 931." + +**No issues with citations.** The shorthand references match the website's conventions, and the one expanded reference (ErGr80) includes full bibliographic detail. + +## 3. Variants + +The formalization captures two statements: + +1. **Main theorem (`erdos_388`)**: The finiteness question for equal products of consecutive integers with $k_1, k_2 > 3$ and separation $m_1 + k_1 \le m_2$. This directly formalizes the first part of the problem. + +2. **General variant (`erdos_388.variants.general`)**: The generalization with coefficients $a, b$ and $k_1 > 2$. This captures the "more generally" paragraph. + +The problem's first sentence asks "Can one classify all solutions...?" — the classification aspect is inherently informal and cannot be meaningfully formalized. Only the finiteness question is formalized, which is the appropriate choice. + +**No missing variants.** Both stated parts of the problem are captured. + +## 4. Readability + +**Moderate concerns:** + +- The main theorem uses nested pair accessors `t.1`, `t.2.1`, `t.2.2.1`, `t.2.2.2` for a 4-tuple, which is difficult to parse. Destructuring would significantly improve clarity: + ```lean + {(m₁, k₁, m₂, k₂) : ℕ × ℕ × ℕ × ℕ | + 3 < k₁ ∧ 3 < k₂ ∧ m₁ + k₁ ≤ m₂ ∧ + consecutiveProduct m₁ k₁ = consecutiveProduct m₂ k₂} + ``` + +- The `consecutiveProduct` definition and its docstring are clear and well-written. + +- The module docstring provides excellent mathematical context, including the LaTeX formulation and references to related problems. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The main statement is precise: it involves concrete arithmetic conditions on natural numbers, products over finite sets, and a finiteness predicate. All components have standard Mathlib representations. + +The general statement has moderate ambiguity in the original Erdős formulation: +- "For fixed $a$ and $b$" — it is unclear whether $k_2$ is also considered fixed or is part of the solution tuple. The formalization treats $k_2$ as fixed (universally quantified alongside $a$, $b$, $k_1$), which is a reasonable interpretation. +- "Finitely many solutions" — solutions in which variables? The formalization interprets this as $(m_1, m_2)$, which is reasonable given $a$, $b$, $k_1$, $k_2$ are fixed. +- Whether a separation condition like $m_1 + k_1 \le m_2$ is still intended in the general case is ambiguous from the original text (see Correctness below). + +## 6. Correctness + +### Main Theorem: Correct + +The tuple decomposition for `t : ℕ × ℕ × ℕ × ℕ` maps to: +- `t.1` = $m_1$, `t.2.1` = $k_1$, `t.2.2.1` = $m_2$, `t.2.2.2` = $k_2$ + +The conditions correctly encode: +- $k_1 > 3$: `3 < t.2.1` ✓ +- $k_2 > 3$: `3 < t.2.2.2` ✓ +- $m_1 + k_1 \le m_2$: `t.1 + t.2.1 ≤ t.2.2.1` ✓ (ensures the two blocks of consecutive integers are disjoint) +- Product equality: `consecutiveProduct t.1 t.2.1 = consecutiveProduct t.2.2.1 t.2.2.2` ✓ + +The `consecutiveProduct` function correctly computes $(m+1)(m+2)\cdots(m+k)$ via `∏ i ∈ Finset.range k, (m + 1 + i)`. No off-by-one issues: when $k = 4$ and $m = 0$, this gives $1 \cdot 2 \cdot 3 \cdot 4 = 24$. ✓ + +**No issues with the main theorem.** + +### General Variant: Two Correctness Bugs + +**Bug 1: Trivially false when $a = b$ and $k_1 = k_2$.** + +The general variant claims: +```lean +∀ (a b : ℕ) (k₁ : ℕ), 2 < k₁ → ∀ k₂ : ℕ, + Set.Finite {t : ℕ × ℕ | a * consecutiveProduct t.1 k₁ = b * consecutiveProduct t.2 k₂} +``` + +When $a = b$ and $k_1 = k_2$, the equation becomes $a \cdot P(m_1, k) = a \cdot P(m_2, k)$, i.e., $P(m_1, k) = P(m_2, k)$ (assuming $a \neq 0$). Since `consecutiveProduct` is strictly increasing in $m$ for fixed $k \ge 1$, this holds if and only if $m_1 = m_2$. The solution set is $\{(m, m) \mid m \in \mathbb{N}\}$, which is **infinite**. This makes the general conjecture as formalized **false**. + +**Bug 2: Trivially false when $a = 0$ and $b = 0$.** + +When $a = 0$ and $b = 0$, both sides of the equation are $0$ for all $m_1, m_2$, so the solution set is all of $\mathbb{N} \times \mathbb{N}$, which is infinite. + +**Root cause:** The general variant is missing the separation condition $m_1 + k_1 \le m_2$ that the main theorem correctly includes. The original Erdős statement likely intends this condition to carry over (the two blocks of consecutive integers should be disjoint). Additionally, the coefficients $a, b$ should be positive. + +**Recommended fix:** + +```lean +theorem erdos_388.variants.general : + answer(sorry) ↔ + ∀ (a b : ℕ), 0 < a → 0 < b → + ∀ (k₁ : ℕ), 2 < k₁ → + ∀ k₂ : ℕ, + Set.Finite {t : ℕ × ℕ | + t.1 + k₁ ≤ t.2 ∧ + a * consecutiveProduct t.1 k₁ = b * consecutiveProduct t.2 k₂} := by + sorry +``` + +This adds: (1) positivity constraints on $a$ and $b$, and (2) the separation condition $m_1 + k_1 \le m_2$. The separation condition eliminates the $a = b, k_1 = k_2$ diagonal issue and is consistent with the problem's intent that the two products represent distinct, non-overlapping blocks. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | ⚠️ `consecutiveProduct` duplicates inline code in Problem 931; could be shared | +| Citations | ✅ All references match the website | +| Variants | ✅ Both parts of the problem are captured | +| Readability | ⚠️ Nested pair accessors hurt readability; destructuring recommended | +| Formalizability | ✅ Main statement is precise; general statement has moderate ambiguity | +| Correctness | ❌ **General variant is false** — missing separation condition and positivity on $a, b$ makes it trivially refutable | diff --git a/ai-review/391.md b/ai-review/391.md new file mode 100644 index 0000000000..9926bdc1fb --- /dev/null +++ b/ai-review/391.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 391 + +## 1. Code Reuse + +No reusable code was found in the existing codebase. The problem concerns factorial representations and an asymptotic limit involving `1/e`, which is a standalone number-theoretic topic. The `FormalConjecturesForMathlib` library contains infrastructure for covering systems, arithmetic progressions, and density, none of which are applicable here. + +## 2. Citations + +The formalization references only `erdosproblems.com/391`, which is appropriate. However, the website contains additional citation information that could enrich the docstrings: + +- **Alexeev, Conway, Rosenfeld, Sutherland, Tao, Uhr, and Ventullo (2025)** proved the full asymptotic: `t(n)/n = 1/e - c₀/log(n) + O(1/(log n)^{1+c})` where `c₀ = 0.3044...` is an explicit constant. This resolves both the main conjecture and the rate-of-convergence variant. +- **Erdős, Selfridge, and Straus** originally claimed a proof of the limit, but the proof was lost after Straus's death and could never be reconstructed. +- **Alladi and Grinstead (1977)** obtained analogous results when restricting factors to prime powers. +- **Guy and Selfridge (1998)** made related conjectures verified by the 2025 solution. +- Related OEIS sequences: A034258, A034259. + +**Recommendation:** Add the 2025 paper citation to the main theorem docstring, and mention the historical context (Erdős–Selfridge–Straus lost proof). + +## 3. Variants + +The formalization captures two statements: + +1. **Main conjecture** (`erdos_391`): `t(n)/n → 1/e` — correctly matches website question (2). +2. **Rate of convergence** (`erdos_391.variants.rate_of_convergence`): Existence of `c > 0` such that `t(n)/n ≤ 1/e - c/log(n)` for infinitely many `n` — matches website question (3). + +The website also asks question (1): "find good bounds for `t(n)/n`", which is more open-ended and arguably subsumed by the full asymptotic. This is not separately formalized, which seems reasonable. + +**Issue:** The variant `rate_of_convergence` is tagged `category research open`, but the 2025 paper resolves it (and proves something much stronger: the asymptotic holds for *all* sufficiently large `n`, not merely infinitely many). This should be changed to `category research solved`. + +**Missing variant:** The 2025 result also establishes that `t(n) ≤ n/e` for `n ≠ 1, 2, 4` and `t(n) ≥ n/3` for `n ≥ 43632`. These concrete bounds could be formalized as additional variants if desired. + +## 4. Readability + +The code is clean and readable. A few minor suggestions: + +- The name `erdos391_t` is functional but `erdos391_minFactor` or similar might be more descriptive of the mathematical content. +- The `IsFactorialRepr` definition combining positivity, monotonicity, and the product condition in one conjunction is clear and well-structured. +- The `open BigOperators Filter` is appropriate for the notation and filter usage. + +Overall: **good readability**, no significant issues. + +## 5. Formalizability + +The problem is fully formalizable. The definition of `t(n)` is precise: write `n!` as a product of `n` positive integers in non-decreasing order, and maximize the smallest. The limit statement `t(n)/n → 1/e` is unambiguous. + +The rate-of-convergence variant is also unambiguous. + +**Assessment: No ambiguity.** The problem statement on the website is mathematically precise and admits a unique interpretation. + +## 6. Correctness + +### Main definition `IsFactorialRepr` +Correct. It requires: +- All factors positive (`∀ i, 0 < f i`) +- Non-decreasing order (`Monotone f`) +- Product equals `n!` (`∏ i, f i = n.factorial`) + +This faithfully captures "write `n!` as a product of `n` positive integers `a₁ ≤ ... ≤ aₙ`". + +### Definition `erdos391_t` +Uses `sSup {k : ℕ | ∃ f : Fin n → ℕ, IsFactorialRepr n f ∧ ∀ i, k ≤ f i}`. + +**Subtlety with `sSup` on `ℕ`:** In Mathlib, `sSup` on `ℕ` (via `ConditionallyCompleteLattice`) requires the set to be `BddAbove` and `Nonempty` for the result to be meaningful. For `n ≥ 1`, the set is nonempty (contains 1, since we can always write `n!` with all factors ≥ 1) and bounded above (the minimum factor of `n!` written as `n` positive integers is at most `n!`), so `sSup` is well-defined. For `n = 0`, the condition `∀ i : Fin 0, k ≤ f i` is vacuously true for all `k`, making the set equal to all of `ℕ`, which is not `BddAbove`; `sSup` then returns junk (0). This doesn't affect the asymptotic theorem but is a minor definitional inelegance. + +**Note:** The condition `∀ i, k ≤ f i` effectively says `k` is a lower bound on all factors, and `sSup` over such `k` gives the maximum minimum factor. Since the factors are monotone, this is equivalent to maximizing `f ⟨0, ...⟩` (the first/smallest factor). This is mathematically correct. + +### Main theorem `erdos_391` +``` +Tendsto (fun n : ℕ => (erdos391_t n : ℝ) / (n : ℝ)) atTop (nhds (1 / Real.exp 1)) +``` + +Correctly states `t(n)/n → 1/e` as `n → ∞`. The use of `atTop` and `nhds` is standard. The cast to `ℝ` is necessary for the division. **Correct.** + +Tagged `category research solved` — consistent with the 2025 resolution. + +### Variant `rate_of_convergence` +``` +∃ c : ℝ, c > 0 ∧ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + (erdos391_t n : ℝ) / (n : ℝ) ≤ 1 / Real.exp 1 - c / Real.log (n : ℝ) +``` + +This says: there exists `c > 0` such that for infinitely many `n`, `t(n)/n ≤ 1/e - c/log(n)`. This is a correct formalization of website question (3). The "infinitely many" is encoded as `∀ N, ∃ n ≥ N`, which is standard. + +**Correctness issue with `category` tag:** Tagged `category research open` but should be `category research solved` per the 2025 result. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Code reuse | None available | +| Citations | Missing key references (2025 paper, historical context) | +| Variants | Core variants captured; rate-of-convergence tag should be `solved` | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct; minor `sSup` edge case at `n = 0` | diff --git a/ai-review/393.md b/ai-review/393.md new file mode 100644 index 0000000000..69bd80a0dd --- /dev/null +++ b/ai-review/393.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 393 + +**File:** `FormalConjectures/ErdosProblems/393.lean` + +--- + +## 1. Code Reuse + +Several related formalizations exist in the codebase: + +- **Erdős 388** (`388.lean`): Defines `consecutiveProduct (m k : ℕ)` for products of consecutive integers. Not directly reusable here since Problem 393 concerns *distinct* integers within a range (not necessarily consecutive), but thematically related. +- **Erdős 391** (`391.lean`): Defines `IsFactorialRepr` for factorizations of `n!` into `n` positive integers with monotonicity. A similar structural pattern (finset/tuple with product constraint), though the constraints differ. +- **Erdős 394** (`394.lean`): Uses the same `sInf` pattern over a conditional set to define a minimal value. Very close stylistic match to `erdos393_f`. + +No existing definition can directly replace `HasFactorizationWithSpread` or `erdos393_f`; both are appropriately problem-specific. The current implementation is reasonable as-is. + +## 2. Citations + +The docstring currently cites only: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The [website](https://www.erdosproblems.com/393) lists additional references that should be included: + +- **[BeOs92]** Berend and Osgood — proved that for each fixed $m$, $F_m(N) = o(N)$, where $F_m(N)$ counts $n \leq N$ with $f(n) = m$. +- **[BPZ23]** Bui, Pratt, and Zaharescu — established $F_m(N) \ll_m N^{33/34}$. +- **[Lu02]** Luca — results imply $f(n) \to \infty$ conditional on ABC. (Mentioned in the docstring text but not given a formal citation entry.) + +The OEIS sequence **A388302** is also referenced on the website and could be noted. + +## 3. Variants + +The formalization captures only the main conjecture ($f(n) \to \infty$). The website and source material suggest several natural variants that are **not formalized**: + +1. **Consecutive integer factorials (f(n) = 1):** Erdős and Graham explicitly ask whether $f(n) = 1$ infinitely often — i.e., whether $n!$ equals a product of two consecutive integers infinitely often. This is a prominent sub-question and would be a natural variant: + ``` + theorem erdos_393.variants.f_eq_one_infinitely_often : + answer(sorry) ↔ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ erdos393_f n = 1 + ``` + +2. **Density bound (Berend–Osgood):** For each fixed $m$, the set of $n$ with $f(n) = m$ has density zero. This is a known result [BeOs92] and could be stated as a solved variant. + +3. **Quantitative density bound (Bui–Pratt–Zaharescu):** $F_m(N) \ll_m N^{33/34}$ — a quantitative strengthening of the above. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The definition `HasFactorizationWithSpread` has a clear docstring explaining the mathematical content. +- The `erdos393_f` docstring correctly notes the edge-case behavior (returns 0 when no factorization exists). +- The `open Finset BigOperators Filter` is appropriate; `Filter` is needed for `atTop`. +- One minor suggestion: the docstring for `erdos_393` could mention that this is conditional on ABC in the original literature, to avoid implying it is expected to be provable unconditionally. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The original problem asks: "What is the behaviour of $f(n)$?" — this is open-ended and not directly formalizable as a single theorem. The formalization reasonably interprets it as the specific conjecture $f(n) \to \infty$, which is the main expected behavior discussed in the literature (implied by ABC via Luca). + +**Ambiguity assessment:** **Low-moderate.** The definition of $f(n)$ is precise and unambiguous. The only ambiguity is in the open-ended "What is the behaviour?" phrasing, which the formalization resolves by choosing the most natural conjecture. This choice is well-justified by the literature. + +## 6. Correctness + +### Definition `HasFactorizationWithSpread` + +The original statement: $n! = a_1 \cdots a_t$ with $a_1 < \cdots < a_t = a_1 + m$. + +The formalization requires: +- A `Finset ℕ` (automatically enforces distinctness) ✓ +- `2 ≤ s.card` (since $m \geq 1$ implies $a_t > a_1$, so at least 2 factors) ✓ +- All elements positive ✓ +- `s.prod id = n.factorial` ✓ +- There exists $a \in s$ with $a + m \in s$ and $\forall x \in s,\; a \leq x \leq a + m$ ✓ + +The constraint that $a \in s$ and all $x \in s$ satisfy $a \leq x$ ensures $a$ is the minimum; $a + m \in s$ with all $x \leq a + m$ ensures $a + m$ is the maximum. The spread is therefore exactly $m$. **This is correct.** + +### Definition `erdos393_f` + +Uses `sInf {m : ℕ | 1 ≤ m ∧ HasFactorizationWithSpread n m}`. For `ℕ`, `sInf ∅ = 0`, which correctly handles edge cases (e.g., $n \leq 1$). The constraint `1 ≤ m` matches the problem's requirement $m \geq 1$. **Correct.** + +### Theorem `erdos_393` + +States `Tendsto (fun n => erdos393_f n) atTop atTop`, i.e., $f(n) \to \infty$. + +**Mathematical concern:** The problem is listed as **OPEN** on erdosproblems.com. The result $f(n) \to \infty$ is only known conditionally on the ABC conjecture (via Luca [Lu02]). The theorem is stated unconditionally. This is not necessarily wrong — open conjectures are expected to have `sorry` proofs — but the docstring should make clear that this is a conjecture (conditional on ABC in the literature), not a known theorem. Currently the docstring says "Implied by the ABC conjecture via a result of Luca," which is adequate but could be clearer that the unconditional statement remains open. + +**Verdict:** The formalization is **mathematically correct and complete** for the main conjecture. No flaws identified in the definitions or theorem statement. The only gaps are the missing variants and citations noted above. + +--- + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No reuse opportunities; definitions are appropriately problem-specific | +| Citations | **Incomplete** — missing [BeOs92], [BPZ23], [Lu02] as formal entries | +| Variants | **Incomplete** — the $f(n)=1$ infinitely often question and density results are absent | +| Readability | Good | +| Formalizability | Low-moderate ambiguity; reasonable interpretation chosen | +| Correctness | **Correct** — definitions and theorem are mathematically sound | diff --git a/ai-review/395.md b/ai-review/395.md new file mode 100644 index 0000000000..e840004239 --- /dev/null +++ b/ai-review/395.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 395 + +## 1. Code Reuse + +**Issue found.** The `signedSum` definition in `395.lean` (line 39): + +```lean +noncomputable def signedSum {n : ℕ} (z : Fin n → ℂ) (ε : Fin n → Bool) : ℂ := + ∑ i : Fin n, (if ε i then (1 : ℂ) else (-1 : ℂ)) * z i +``` + +is identical to `signedSum498` in `ErdosProblems/498.lean` (line 44): + +```lean +noncomputable def signedSum498 {n : ℕ} (z : Fin n → ℂ) (ε : Fin n → Bool) : ℂ := + ∑ i : Fin n, (if ε i then (1 : ℂ) else (-1 : ℂ)) * z i +``` + +These are character-for-character the same function. A shared definition could be factored out (e.g., into a utility file or a common `LittlewoodOfford` module), since Problems 395 and 498 are explicitly related on the Erdős Problems website. The same `Bool`-to-sign encoding pattern also appears in `ErdosProblems/525.lean` (`littlewoodEval`), though that one additionally multiplies by powers of `z`, so it is not directly reusable here. + +No existing `FormalConjecturesForMathlib` utility was found that provides this definition. + +## 2. Citations + +The docstring cites: + +> [HJNS24] He, X., Juškevičius, T., Narayanan, B., and Spiro, S., _A reverse Littlewood-Offord problem_. + +**Issues:** + +- **Incomplete citation.** The citation lacks venue/journal information. The paper's full reference should include the publication venue (e.g., arXiv preprint identifier or journal name if published). +- **Missing historical context.** The website notes that Erdős originally posed the problem with threshold **1** (not √2), and that **Carnielli and Carolino (2011)** showed that version is false via the counterexample z₁ = 1, zₖ = i for 2 ≤ k ≤ n (n even). The formalization's docstring does not mention this history or cite Carnielli–Carolino. +- **Missing cross-reference.** The website explicitly lists Problem 498 as a related problem ("See Problem #498"). The docstring does not mention this connection, even though Problem 498 (the classical Littlewood–Offord problem) is the direct predecessor of Problem 395. + +## 3. Variants + +**Partially captured.** + +- The formalization captures the **√2 threshold** version, which is the version that was proved true. This is correct. +- The **original threshold-1 version** (shown false by Carnielli–Carolino) is not formalized. A natural companion statement would be a formalization of the counterexample: that there exist unit complex vectors for which the probability of |∑ εᵢzᵢ| ≤ 1 is o(1/n). This would complete the picture of what was conjectured versus what turned out to be true. +- The website does not mention other variants beyond the threshold distinction. + +## 4. Readability + +**Good overall.** The code is clean and well-structured: + +- The `signedSum` helper is clearly documented and appropriately separated from the theorem statement. +- The docstring explains the mathematical content well, including the probabilistic interpretation, the formal counting version, and the optimality of the 1/n bound. +- The namespace `Erdos395` is appropriate. +- Minor suggestion: the docstring could clarify that "≫ 1/n" means "at least c/n for some absolute constant c > 0" for readers unfamiliar with asymptotic notation, though the formal statement immediately below does make this precise. + +## 5. Formalizability + +**High — the problem is unambiguous and clearly formalizable.** + +The probabilistic statement "the probability is ≫ 1/n" translates cleanly to the counting statement "the number of sign patterns is ≥ c · 2ⁿ/n for some absolute constant c > 0." The formalization correctly makes this translation. + +The only potential source of ambiguity in the original problem was the threshold value (1 vs. √2), which is a historical matter rather than a mathematical one. The formalization chooses the correct (proved) threshold of √2. + +There is no ambiguity in what "unit complex vectors" means (‖zᵢ‖ = 1), what "signed sum" means, or what the bound should be. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +1. **`signedSum` definition:** Computes ∑ᵢ εᵢzᵢ where εᵢ ∈ {-1, +1}, encoded via `Bool` (true ↦ +1, false ↦ -1). This is standard and correct. + +2. **Theorem statement structure:** ∃ c > 0, ∀ n ≥ 1, ∀ unit vectors z, (count of good sign patterns) ≥ c · 2ⁿ/n. This correctly formalizes "the probability is Ω(1/n)." + +3. **Norm vs. absolute value:** The formalization uses `‖·‖` (the norm in ℂ, which equals the complex modulus |·|). This is correct for ℂ. + +4. **Threshold:** `Real.sqrt 2` correctly represents √2. + +5. **Operator precedence:** `c * (2 : ℝ) ^ n / (n : ℝ)` is parsed as `(c * 2^n) / n` due to left-associativity of `*` and `/` at the same precedence level. This gives the intended bound c · 2ⁿ/n. Correct. + +6. **Quantifier order:** The existential ∃ c is outermost, meaning c is a universal constant independent of n and z. This matches the mathematical statement. + +7. **Edge case n = 0:** Excluded by the hypothesis `0 < n`. This is appropriate since the problem is only meaningful for n ≥ 1. + +8. **Optimality example in docstring:** The docstring states the 1/n bound is tight for zₖ = 1 (k ≤ n/2) and zₖ = i otherwise. The website confirms this. Note this optimality claim is not formalized, only mentioned in the docstring — this is reasonable since it is supplementary context. + +**No mathematical errors or incompleteness found.** The formalization is a faithful and complete rendering of the proved result. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `signedSum` duplicated with Problem 498; should share a definition | +| Citations | Missing Carnielli–Carolino (2011); [HJNS24] lacks venue; no cross-ref to Problem 498 | +| Variants | Only the √2 version is formalized; the disproved threshold-1 version is not captured | +| Readability | Good | +| Formalizability | Unambiguous, clearly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/400.md b/ai-review/400.md new file mode 100644 index 0000000000..40aee1ef1c --- /dev/null +++ b/ai-review/400.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 400 + +## 1. Code Reuse + +**Density utilities:** `FormalConjecturesForMathlib/Data/Set/Density.lean` provides `Set.HasDensity`, `partialDensity`, `upperDensity`, and `lowerDensity`. However, the Part 2 concentration statement is *not* a standard natural density statement — the "bad set" `{n ≤ x : |g_k(n) - c log x| > ε log x}` depends on the parameter `x`, so it is not the density of a fixed set. The current inline Finset-filtering formulation is more appropriate than trying to use `Set.HasDensity`. + +**Related problems:** Erdős Problem 401 (`FormalConjectures/ErdosProblems/401.lean`) is closely related (same [ErGr80] source, same factorial divisibility structure, k=2 case with prime augmentation). Problem 391 uses a similar `sSup {k : ℕ | ∃ f : Fin n → ℕ, ...}` pattern. Problem 374 uses `∏ x ∈ s, Nat.factorial x`. These share structural patterns but no directly extractable code — the `g` definition is specific to this problem. No significant reuse opportunities identified. + +## 2. Citations + +**Website reference:** [ErGr80, p.77] — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). + +**Formalization reference:** [ErGr80, p.77] in both theorem docstrings, and the full citation in the module docstring. + +**Assessment:** Citations match correctly. The website also mentions a related problem [#401](https://www.erdosproblems.com/401) and credits Stijn Cambie. The formalization does not mention the link to Problem 401, but this is not critical (it's a separate formalization). Minor: the formalization spells "Mathematique" without the accent; the website and standard reference use "Mathématique". This is cosmetic. + +## 3. Variants + +The website poses two questions: +1. Whether `∑_{n≤x} g_k(n) ~ c_k · x · log x` for some constant `c_k`. +2. Whether for almost all `n < x`, `g_k(n) = c_k · log x + o(log x)`. + +The formalization captures both: +- `erdos_400` (Part 1): the ratio `(∑_{n=1}^{x} g_k(n)) / (x log x)` tends to some `c > 0`. +- `erdos_400.variants.concentration` (Part 2): for all `ε > 0`, the proportion of `n ∈ [1,x]` with `|g_k(n) - c log x| > ε log x` tends to 0. + +**All variants from the website are captured.** The Erdős–Graham observation that `g_k(n) ≪_k log n` is mentioned in the docstring but not formalized as a separate lemma — this is reasonable since it's a known bound, not the open problem itself. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The `g` definition (lines 41–43) is clear and well-documented. +- The `open Filter` and `open scoped BigOperators` are appropriate. +- The namespace `Erdos400` keeps definitions scoped. +- The LaTeX in docstrings is clear and matches the Lean code. +- Part 2's theorem name `erdos_400.variants.concentration` is descriptive. + +**Minor suggestion:** The module docstring could note that the two parts are asked as separate questions on the website, to clarify that they are independent conjectures (not one implying the other). + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original problem is stated precisely enough: +- "natural numbers" / "integers" — the formalization correctly uses `ℕ` since factorials of negative integers are not standard. The website says "integers" but factorial divisibility forces non-negativity. +- "∼" (asymptotic equivalence) is unambiguous. +- "almost all n ≤ x" is standard number-theoretic language meaning "all but o(x) values of n ≤ x", which is exactly what the formalization captures. +- The constant `c_k` depends on `k` — the formalization uses `∃ c : ℝ` universally quantified over `k`, which is correct. + +The only minor ambiguity: whether the constants `c_k` in Parts 1 and 2 are the same. The original notation `c_k` for both is suggestive but not definitive. The formalization uses separate existential quantifiers, allowing different constants. This is the correct conservative choice — if they turn out to be the same, one can prove that separately. + +## 6. Correctness + +### Definition of `g` + +The definition `g (k n : ℕ) : ℕ := sSup {s : ℕ | ∃ a : Fin k → ℕ, (∏ i, (a i).factorial) ∣ n.factorial ∧ s = (∑ i, a i) - n}` is mathematically correct. + +- **Non-emptiness:** The set is always non-empty. Taking `a = 0` (constant zero function) gives `∏ 0! = 1 ∣ n!` and `s = 0 - n = 0` (in ℕ). So `0` is always in the set. +- **Boundedness:** The Erdős–Graham bound `g_k(n) ≪_k log n` ensures the set is bounded above for every fixed `k, n`. Lean's `sSup` on `ℕ` (via `ConditionallyCompleteLattice`) returns the correct supremum for bounded-above non-empty sets. Note that this boundedness is not proven in the file — users of `g` will need to establish it to use `csSup_le` and related lemmas. This is acceptable for a problem statement file. +- **Natural subtraction:** `(∑ i, a i) - n` uses natural number subtraction (truncating at 0). This is correct — we only care about the excess beyond `n`, and tuples with `∑ a_i < n` contribute `s = 0` which doesn't affect the supremum. + +### Part 1 (`erdos_400`) + +`∃ c : ℝ, 0 < c ∧ Tendsto (fun x : ℕ => (∑ n ∈ Finset.Icc 1 x, (g k n : ℝ)) / ((x : ℝ) * Real.log (x : ℝ))) atTop (nhds c)` + +- **Correctness:** This says the ratio converges to a positive constant, which is exactly `∑_{n≤x} g_k(n) ~ c_k · x · log x`. ✓ +- **Range of summation:** Uses `Finset.Icc 1 x` (i.e., `1 ≤ n ≤ x`). The website says `n ≤ x`. Excluding `n = 0` is immaterial: `g(k, 0) = sSup{(∑ a_i) - 0 | ∏ a_i! | 1}` is a finite constant (at most `k`), so one extra term doesn't affect the asymptotic. ✓ +- **Positivity of `c`:** The formalization requires `0 < c`, which matches the intuition that the sum should grow like `x log x`. ✓ + +### Part 2 (`erdos_400.variants.concentration`) + +`∃ c : ℝ, ∀ ε : ℝ, 0 < ε → Tendsto (fun x : ℕ => (((Finset.Icc 1 x).filter (fun n => |(g k n : ℝ) - c * Real.log (x : ℝ)| > ε * Real.log (x : ℝ))).card : ℝ) / (x : ℝ)) atTop (nhds 0)` + +- **Correctness of "almost all":** The proportion of exceptions tending to 0 is exactly the standard meaning of "almost all n ≤ x" in analytic number theory. ✓ +- **Use of `log x` (not `log n`):** The formalization correctly uses `Real.log (x : ℝ)` — the outer parameter — matching the original statement where `g_k(n) = c_k log x + o(log x)` for `n ≤ x`. ✓ +- **Range `[1, x]` vs `n < x`:** The website says `n < x`; the formalization uses `n ∈ [1, x]` (i.e., `n ≤ x`). This is an asymptotically negligible difference (one extra term). ✓ +- **No positivity constraint on `c`:** Unlike Part 1, no `0 < c` is required. This is acceptable — the concentration constant could theoretically be zero (though it presumably isn't). ✓ + +### Overall Mathematical Assessment + +**The formalization is correct and complete.** No mathematical flaws are identified. The definitions and theorem statements faithfully capture the original Erdős–Graham problem. An experienced mathematician would find no obvious errors. The use of `sSup` on `ℕ` is appropriate and the edge cases (k = 0, k = 1, n = 0) are handled gracefully by the natural number arithmetic. diff --git a/ai-review/401.md b/ai-review/401.md new file mode 100644 index 0000000000..1133253cbf --- /dev/null +++ b/ai-review/401.md @@ -0,0 +1,98 @@ +# AI Review: Erdős Problem 401 + +## 1. Code Reuse + +Several patterns from the existing codebase are directly relevant: + +- **Problem 400** (`ErdosProblems/400.lean`): The closest sibling problem. It defines `g(k, n)` as the supremum of `(∑ aᵢ) - n` over tuples with `∏ aᵢ! ∣ n!`. Problem 401 is the `k = 2` case with the additional twist of allowing small prime factors. The `g` function from Problem 400 could theoretically be generalized to include a smoothness parameter, but the problems are different enough that separate formulations are justified. + +- **Problem 729** (`ErdosProblems/729.lean`): Defines `DenomPSmooth` to express that the denominator of `n!/(a!b!)` is P-smooth. This is mathematically equivalent to the divisibility condition in Problem 401: `a₁! * a₂! ∣ n! * p₁ⁿ ⋯ pᵣⁿ` if and only if the denominator of `n!/(a₁!a₂!)` has all prime factors ≤ pᵣ. **The `DenomPSmooth` predicate from 729 could be reused** to express Problem 401's divisibility condition in an equivalent (arguably more natural) way. However, the current direct formulation via divisibility is also mathematically correct and self-contained. + +- **Problem 728** (`ErdosProblems/728.lean`): A related problem about the existence of triples `(a, b, n)` with `a!b! ∣ n!(a+b-n)!` in the `n + O(log n)` regime. Uses a structurally different formalization but shares the same mathematical family. + +- **`Nat.nth Nat.Prime`** wrappers: Problems 852 and 453 define `nthPrime` helpers, but since 401 only uses the expression once inside a product, the inline usage is appropriate. + +- **Primorial**: Problem 854 defines a `primorial` function. The product `∏ i ∈ Finset.range r, (Nat.nth Nat.Prime i) ^ n` in Problem 401 is `primorial(r)^n`, but this factoring doesn't simplify the formalization. + +**Verdict**: The formalization is self-contained and doesn't need external helpers. The main reuse opportunity is noting the mathematical equivalence with the `DenomPSmooth` predicate from Problem 729, which could be mentioned in a comment. + +## 2. Citations + +**Website (erdosproblems.com/401):** +- Source: Erdős-Graham, 1980, p. 78 [ErGr80] +- The problem is marked as **proved** (solved in the affirmative). +- Contributors: Boris Alexeev, Kevin Barreto, Leeham, Terence Tao, Nat Sothanaphan. +- The proof was by Barreto and Leeham (using ChatGPT), employing the same construction as their solution to Problem 729. +- Sothanaphan (via ChatGPT) disproved the "for all large n" variant. +- Last edited: 12 January 2026. + +**Formalization citations:** +- The module docstring cites `[ErGr80]` with full bibliographic details: Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). This matches the website. +- The theorem docstring cites `[ErGr80, p.78]`, consistent with the website's "p. 78". + +**Missing**: The formalization does not mention that the problem has been solved by Barreto and Leeham, nor does it reference the connection to Problem 729. Adding a note like "Solved in the affirmative by Barreto and Leeham" would improve documentation. The related problems (#400, #728, #729) are also not cross-referenced. + +## 3. Variants + +**Captured:** +- The main formulation ("for infinitely many n" reading) is correctly captured. + +**Not captured:** +- **"For all large n" variant (disproven):** The website notes that a variant with "for all large n" (replacing "infinitely many n") was disproved by Sothanaphan. This would be: + ``` + ∃ f : ℕ → ℝ, Tendsto f atTop atTop ∧ + ∀ r : ℕ, ∀ᶠ n in atTop, ∃ a₁ a₂ : ℕ, ... + ``` + with `answer(False)`. This is a natural and interesting variant that was actively considered and resolved. + +- **Relationship to Problem 729:** Problem 401 can be viewed as asking whether the constant in Problem 729's upper bound `a+b ≤ n + O(log n)` can be made to grow with the smoothness parameter. A comment noting this relationship would add mathematical context. + +## 4. Readability + +The formalization is clear and well-structured. Minor observations: + +- **Good**: The namespace `Erdos401` avoids name collisions. The `open Filter` and `open scoped BigOperators` are standard. +- **Good**: The docstring restates the problem in standard mathematical notation. +- **Minor**: The cast `((a₁ + a₂ : ℕ) : ℝ)` is standard but slightly verbose. This is idiomatic Lean and unavoidable. +- **Suggestion**: The expression `∏ i ∈ Finset.range r, (Nat.nth Nat.Prime i) ^ n` is readable but could benefit from a one-line comment noting it equals `(primorial r)^n` for readers less familiar with the notation. +- **Overall**: Readability is good. No changes needed. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity (after disambiguation).** + +The original problem statement has a well-documented quantifier ambiguity: does "for infinitely many n" mean the set of valid n is infinite for every r, or just for some r? The website explicitly notes this: "The original source uses ambiguous quantifiers. The stated formulation (with 'for infinitely many n') appears most likely intended based on comparison with related problems #728 and #729." + +The formalization resolves this ambiguity by choosing `∀ r, {n | ...}.Infinite`, which is the intended reading (the function f(r) is meaningful only if we quantify over all r). This is the correct choice. + +All components are standard and well-supported in Mathlib: +- `Nat.factorial`, `Nat.nth Nat.Prime`, `Finset.range`, `∏`, `∣` — all well-developed. +- `Filter.Tendsto`, `atTop` — standard filter library. +- `Real.log` — standard real analysis. +- `Set.Infinite` — standard set theory. + +The problem is unambiguously formalizable once the quantifier order is fixed (as the formalization does). + +## 6. Correctness + +**Assessment: Correct, with one subtle point worth verifying.** + +### Correct aspects: +- **Answer tag**: `answer(True)` is correct — the problem is solved affirmatively per the website. +- **Category tag**: `@[category research solved, AMS 11]` is correct. +- **Prime enumeration**: `Nat.nth Nat.Prime i` for `i ∈ Finset.range r` correctly produces the first r primes (0-indexed: p₀ = 2, p₁ = 3, ..., p_{r-1}). +- **Divisibility**: `(a₁.factorial * a₂.factorial) ∣ (n.factorial * ∏ i ∈ Finset.range r, (Nat.nth Nat.Prime i) ^ n)` faithfully encodes `a₁!a₂! | n! · 2ⁿ · 3ⁿ ⋯ pᵣⁿ`. +- **Inequality**: `((a₁ + a₂ : ℕ) : ℝ) > (n : ℝ) + f r * Real.log (n : ℝ)` correctly encodes `a₁ + a₂ > n + f(r) log n`. +- **Tendsto**: `Tendsto f atTop atTop` correctly encodes `f(r) → ∞` as `r → ∞`. +- **Quantifier structure**: `∃ f, Tendsto f atTop atTop ∧ ∀ r, {n | ∃ a₁ a₂, ...}.Infinite` correctly captures the intended reading. + +### Subtle point — behavior at r = 0: +When `r = 0`, `Finset.range 0` is empty, so the product is 1, and the condition becomes `a₁! * a₂! ∣ n!` with `a₁ + a₂ > n + f(0) * log n`. Since f(0) is just some finite real number, this is satisfiable (by classical results on factorial divisibility, the excess `a₁ + a₂ - n` can be of order `log n` with a constant factor that can be chosen). This is mathematically consistent. Similarly, for small r, the condition is weaker, so the existential claim is easier to satisfy. The interesting content is for large r where f(r) must be large. + +### Subtle point — natural number constraints: +The formalization quantifies `a₁ a₂ : ℕ`, which is correct since factorials of natural numbers are the intended domain. There is no issue with negative values or non-integer inputs. + +### Potential concern — strictness of inequality: +The formalization uses strict inequality `>`. The original problem uses `>` as well. This is correct. + +**Verdict: The formalization is mathematically correct and complete for the main statement.** The only improvement opportunity is adding the disproved "for all large n" variant and cross-references to related problems 400, 728, 729. diff --git a/ai-review/403.md b/ai-review/403.md new file mode 100644 index 0000000000..cd0fed8b73 --- /dev/null +++ b/ai-review/403.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 403 + +**File:** `FormalConjectures/ErdosProblems/403.lean` + +## 1. Code Reuse + +Problem 1108 (`FormalConjectures/ErdosProblems/1108.lean`) defines a reusable `FactorialSums` set: +```lean +def FactorialSums : Set ℕ := + {m : ℕ | ∃ S : Finset ℕ, m = ∑ n ∈ S, n.factorial} +``` +Problem 403 could be reformulated in terms of `FactorialSums` (i.e., `Set.Finite {p : ℕ × Finset ℕ | ...}` could reference it), but the overlap is only partial — 403 requires tracking the specific pair `(m, S)` rather than just membership in a set of sums. The current self-contained formulation is arguably cleaner for this problem. + +No other utilities in `FormalConjecturesForMathlib/` are directly applicable. The `Set.Finite` pattern on product types is used consistently across multiple Erdős problems (e.g., 363, 388, 405, 729) and the approach here is idiomatic. + +## 2. Citations + +The website ([erdosproblems.com/403](https://www.erdosproblems.com/403)) lists: +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). — **Present in docstring.** +- **[Li76]** Lin, S., *Computer experiments on sequences which form integral bases* (1976). — **Missing from docstring.** The module docstring mentions "Frankl and Lin" but does not include the `[Li76]` citation that appears on the website and is used in the sibling Problem 404. + +The website also notes "See also Problem #404," which is not cross-referenced in the docstring. + +**Recommendation:** Add the `[Li76]` citation and a cross-reference to Problem 404, matching what appears on the website and in `404.lean`. + +## 3. Variants + +The website records additional solved results that are not captured: + +1. **Explicit largest solution:** The largest solution is $2^7 = 2! + 3! + 5! = 128$, and the complete finite set of solutions is known. A variant asserting the explicit upper bound (e.g., `∀ p ∈ S, p.1 ≤ 7`) or enumerating all solutions would strengthen the formalization. + +2. **Lin's bound on powers of 2:** The largest power of 2 dividing any sum of distinct factorials containing $2$ is $2^{254}$. This is closely related and could be a variant. + +3. **Base-3 analogue:** Lin also showed there are exactly 5 solutions to $3^m = a_1! + \cdots + a_k!$ (at $m = 0, 1, 2, 3, 6$). This is a natural generalization variant. + +None of these are currently formalized. Since the problem is solved and the solution set is fully known, formalizing the explicit characterization would be mathematically valuable. + +## 4. Readability + +The formalization is clean and concise. Minor observations: + +- The use of `p : ℕ × Finset ℕ` with `p.1` and `p.2` is standard but slightly opaque. A named structure or destructuring (e.g., `⟨m, S⟩`) in the set-builder could improve clarity, though this is a matter of taste and consistency with other problems in the codebase. +- The module docstring clearly states the result and gives proper attribution. The theorem docstring accurately describes the mathematical content. + +Overall readability is good. + +## 5. Formalizability + +The problem is **unambiguously formalizable**. The equation $2^m = a_1! + \cdots + a_k!$ with $a_1 < a_2 < \cdots < a_k$ is a completely precise Diophantine condition over the naturals. There is no room for interpretation: +- "Finitely many solutions" is well-defined. +- The constraint $a_1 < \cdots < a_k$ maps exactly to the distinctness inherent in `Finset`. +- The nonemptiness condition ($k \geq 1$) is captured by `p.2.Nonempty`. + +**Ambiguity: None.** This is one of the most straightforwardly formalizable problem types. + +## 6. Correctness + +The formalization is **mathematically correct**. + +- **Distinctness of $a_i$:** The use of `Finset ℕ` (which has no duplicate elements) correctly captures the strict ordering $a_1 < a_2 < \cdots < a_k$ from the original problem. Every solution with distinct $a_i$ corresponds to exactly one `Finset`, and vice versa. +- **Nonemptiness:** The `p.2.Nonempty` condition correctly enforces $k \geq 1$, matching the original problem's implicit requirement that there is at least one term. +- **Sum and power:** `∑ a ∈ p.2, Nat.factorial a = 2 ^ p.1` directly encodes $a_1! + \cdots + a_k! = 2^m$. +- **Solution as a pair:** Encoding a solution as `(m, S) : ℕ × Finset ℕ` is the natural choice. The theorem asserts `Set.Finite` of the solution set, which is exactly the "only finitely many solutions" claim. +- **Solved status:** The problem is marked `category research solved`, consistent with the website's PROVED status. The theorem directly asserts finiteness (rather than wrapping in `answer(sorry)`), which is appropriate for a solved problem with a known affirmative answer. + +**No mathematical flaws identified.** The formalization faithfully captures the problem statement. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No significant reuse opportunities; self-contained formulation is appropriate | +| Citations | **Missing [Li76] reference and cross-reference to Problem 404** | +| Variants | **Three natural variants not captured** (explicit solution set, Lin's 2^254 bound, base-3 analogue) | +| Readability | Good | +| Formalizability | Unambiguous; perfectly formalizable | +| Correctness | Correct and complete for the main statement | diff --git a/ai-review/404.md b/ai-review/404.md new file mode 100644 index 0000000000..81069328d3 --- /dev/null +++ b/ai-review/404.md @@ -0,0 +1,66 @@ +# Review: Erdős Problem 404 + +## 1. Code Reuse + +No significant code reuse opportunities. The formalization uses `padicValNat` directly from Mathlib, which is the standard approach. Other files in the codebase that use `padicValNat` (e.g., 933.lean, 646.lean, 358684.lean) do so in unrelated contexts. There are no custom ForMathlib utilities for p-adic valuations — the Mathlib API is sufficient. Problem 403 (the related problem) shares the "sums of factorials" theme but has no reusable definitions. + +## 2. Citations + +The citations are **correct and complete** relative to the website. + +- **[ErGr80]**: Fully expanded as "Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980)." — matches the website's reference. +- **[Li76]**: Cited as "Lin, S., _Computer experiments on sequences which form integral bases_ (1976)." — matches the website. The result f(2,2) ≤ 254 is correctly attributed. +- **Problem 403 cross-reference**: Mentioned in the docstring ("See also Problem 403"), matching the website. +- The website credits Vjekoslav Kovač as a contributor to the problem page, but this is a website attribution rather than a mathematical citation, so its omission is appropriate. + +## 3. Variants + +The original problem poses three questions: + +1. **"For which (a, p) is f(a, p) finite?"** — Captured by `erdos_404` (Part 1), which conjectures the answer is "all of them." +2. **"How does f(a, p) behave?"** — **Not captured.** This is too vague to formalize as a precise theorem statement (it's an open-ended qualitative question), so the omission is reasonable. +3. **"Is there a divergent sequence?"** — Captured by `erdos_404.variants.divergence` (Part 2). + +All formalizable variants are present. The omitted "how does f behave" question is inherently informal and would require specific conjectures about growth rates to formalize. + +## 4. Readability + +The code is **well-structured and readable**. + +- Clean separation into Part 1 (universal bound) and Part 2 (divergence question). +- Docstrings clearly explain the mathematical content and the logical relationship between the two parts. +- The namespace `Erdos404` and theorem names are descriptive. +- `open scoped BigOperators` and `open Filter` are appropriate and minimal. + +**Minor suggestion**: The Part 2 docstring says "This is expected to be a consequence of Part 1" — it might be slightly clearer to say "If Part 1 is true, then the answer to Part 2 is negative" to make the logical implication direction explicit. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with moderate interpretive choices.** + +The original problem is phrased as a question ("for which...?") rather than a conjecture. The formalization interprets this as conjecturing that f(a, p) is finite for **all** a ≥ 1 and primes p. This is a reasonable and standard interpretation — the known result f(2, 2) ≤ 254 supports the expectation that f(a, p) is always finite — but it is an interpretive choice rather than a direct transcription. + +The divergence question (Part 2) is a clean yes/no question and is precisely formalizable. The use of `answer(sorry)` correctly reflects that the answer is unknown. + +**Ambiguity level: Low.** The core mathematical objects (p-adic valuations, sums of factorials, finite sets with a minimum element) are all precisely defined. The only ambiguity is the "for which" phrasing, which the formalization resolves reasonably. + +## 6. Correctness + +**Part 1 (`erdos_404`)**: **Correct.** + +- The condition `a ∈ S ∧ ∀ x ∈ S, a ≤ x` correctly captures "a is the minimum element of S," corresponding to the original's "a = a₁ < ··· < aₙ." +- Using a `Finset ℕ` rather than an ordered list is appropriate: the sum of factorials is order-independent, and Finset elements are automatically distinct. +- The bound `padicValNat p (∑ i ∈ S, i.factorial) ≤ K` correctly captures "p^K is the highest power that can divide such a sum" (since padicValNat gives the exact p-adic valuation). +- The constraint `1 ≤ a` matches the original's "integers a ≥ 1." +- The sum is always positive (factorials are positive, S is nonempty since a ∈ S), so `padicValNat` is well-behaved here. + +**Part 2 (`erdos_404.variants.divergence`)**: **Correct.** + +- `StrictMono a` captures the strictly increasing sequence requirement. +- `Finset.range (k + 1)` sums over indices 0 through k, giving the first k + 1 terms. This is equivalent to the original's 1-indexed "∑_{i ≤ k}" up to a re-indexing, which is fine. +- `Tendsto ... atTop atTop` correctly formalizes "m_k → ∞." +- The formalization does not impose a ≥ 1 on the sequence terms, making it slightly more general than the original context (where the discussion follows from Part 1's a ≥ 1 assumption). However, this does not affect correctness: if a divergent sequence exists with a(0) = 0, one certainly exists in the more general sense, and conversely if none exists in the general sense, none exists in the restricted sense either. + +**Logical consistency between parts**: If Part 1 is true (f(a, p) finite for all a, p), then Part 2 is false — for any strictly increasing sequence starting at a₁, every partial sum is a sum over a finite set with minimum a₁, so its p-adic valuation is bounded by K = f(a₁, p). The formalization correctly leaves Part 2's answer open via `answer(sorry)`, which is consistent with Part 1 also being open (tagged `research open`). + +**No mathematical flaws identified.** diff --git a/ai-review/405.md b/ai-review/405.md new file mode 100644 index 0000000000..1cb4b27fbc --- /dev/null +++ b/ai-review/405.md @@ -0,0 +1,103 @@ +# Review: Erdős Problem 405 + +## 1. Code Reuse + +The formalization is self-contained and appropriately so. The core Lean/Mathlib primitives used (`Nat.Prime`, `Nat.factorial`, `Set.Finite`, `Nat.pow`) are standard and do not benefit from wrapping. + +Nearby problems with structurally similar formalizations: + +- **Problem 403** (`FormalConjectures/ErdosProblems/403.lean`): Uses `Set.Finite` over a Diophantine constraint involving factorials and powers of 2. Very similar pattern. +- **Problem 399** (`FormalConjectures/ErdosProblems/399.lean`): Formalizes `n! = x^k ± y^k` and includes multiple solved variants. Demonstrates how to add variant theorems for stronger follow-up results. + +No code from `FormalConjecturesForMathlib` is directly applicable. The utilities in `Data/Nat/PerfectPower.lean` (`IsPerfectPower`) could be relevant to a variant about `(p-1)! + a^(p-1)` being a perfect power, but are not needed for the current formalization. + +**Verdict:** No reuse opportunities. The formalization is appropriately minimal. + +## 2. Citations + +The formalization includes three references: `[ErGr80]`, `[BrEr91]`, and `[YuLi96]`. These match the website ([erdosproblems.com/405](https://www.erdosproblems.com/405)) exactly: + +| Citation | Formalization | Website | Match? | +|----------|--------------|---------|--------| +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | ✓ (original source, p.80) | Yes | +| [BrEr91] | Brindza, B. and Erdős, P., *On some Diophantine problems involving powers and factorials*. J. Austral. Math. Soc. Ser. A 51 (1991), 1-7. | ✓ (proved finiteness) | Yes | +| [YuLi96] | Yu, K. and Liu, L., *On some Diophantine equations involving powers and factorials*. (1996). | ✓ (enumerated all solutions) | Yes | + +**Verdict:** All citations are present and correctly documented. + +## 3. Variants + +The current formalization captures only the finiteness question. Two natural variants are missing: + +### 3a. Exact solution enumeration (Yu–Liu) + +Yu and Liu [YuLi96] proved the stronger result that the *complete* set of solutions is: +- $(p, a, k) = (3, 1, 1)$: $2! + 1^2 = 3$ +- $(p, a, k) = (3, 5, 3)$: $2! + 5^2 = 3^3$ +- $(p, a, k) = (5, 1, 2)$: $4! + 1^4 = 5^2$ + +This could be formalized as: + +```lean +theorem erdos_405.variants.yu_liu : + {t : ℕ × ℕ × ℕ | + let p := t.1; let a := t.2.1; let k := t.2.2 + Nat.Prime p ∧ p ≠ 2 ∧ (p - 1).factorial + a ^ (p - 1) = p ^ k} = + {(3, 1, 1), (3, 5, 3), (5, 1, 2)} := by sorry +``` + +This is a strictly stronger result and would be a valuable addition following the pattern in Problem 399 (which includes multiple solved variants). + +### 3b. Rarely a perfect power (Erdős–Graham remark) + +The docstring mentions the remark that $(p-1)! + a^{p-1}$ is "probably rarely a power at all" (with the example $6! + 2^6 = 28^2$ showing it can happen). This could be formalized as a conjecture about the density or finiteness of cases where $(p-1)! + a^{p-1}$ is a perfect power (for any base, not just $p$). However, this remark is vague and may not be precise enough to formalize cleanly. + +**Verdict:** The Yu–Liu exact enumeration is a clear missing variant. The "rarely a perfect power" remark is too vague for formalization. + +## 4. Readability + +The code is clean and follows project conventions: + +- Module docstring clearly states the problem, context, and resolution history. +- The `let` bindings in the set comprehension make the triple destructuring readable. +- The `answer(True)` pattern is appropriate since the problem is phrased as a yes/no question. +- The namespace `Erdos405` is consistent with other problem files. + +One minor observation: Problem 403 does *not* use `answer(True)` and instead directly asserts `Set.Finite {...}`. Both approaches are valid, but `answer(True)` is more appropriate here since the original problem asks "Is it true that...?" + +**Verdict:** Readable and well-structured. No changes needed. + +## 5. Formalizability + +The problem is completely precise and unambiguously formalizable. The equation $(p-1)! + a^{p-1} = p^k$ is a concrete Diophantine equation with well-defined terms. The question "finitely many solutions" maps directly to `Set.Finite`. + +The only subtlety is whether $p = 2$ should be included. The website notes that "the original formulation by Erdős and Graham included $p = 2$, but this appears unintentional since infinitely many solutions exist for that case" (for $p = 2$: $1! + a^1 = 2^k$ gives $a = 2^k - 1$ for all $k$). The formalization correctly excludes $p = 2$ via `p ≠ 2`. + +**Verdict:** Fully formalizable with no ambiguity. The exclusion of $p = 2$ is mathematically necessary and well-motivated. + +## 6. Correctness + +The formalization is **mathematically correct**. + +Detailed verification: + +- **Type choice (ℕ):** Using natural numbers is appropriate. Allowing $a = 0$ or $k = 0$ does not introduce spurious solutions: if $k = 0$ then $p^0 = 1$ but $(p-1)! + a^{p-1} \geq 2! + 0 = 2$ for $p \geq 3$; if $a = 0$ then $(p-1)! = p^k$ is impossible since $(p-1)!$ is divisible by primes less than $p$. +- **Odd prime condition:** `Nat.Prime p ∧ p ≠ 2` correctly characterizes odd primes. This is equivalent to `Nat.Prime p ∧ Odd p` or `Nat.Prime p ∧ 2 < p`, but the chosen form is standard. +- **Subtraction in ℕ:** `p - 1` uses natural number subtraction, which is safe here because `Nat.Prime p` implies `p ≥ 2`, so `p - 1 ≥ 1`. No underflow issues. +- **Answer value:** `answer(True)` correctly encodes that the answer to the finiteness question is affirmative, consistent with the Brindza–Erdős and Yu–Liu results. +- **Set comprehension:** The set `{t : ℕ × ℕ × ℕ | ...}` correctly ranges over all triples, with the predicate encoding both the primality constraint and the Diophantine equation. + +**Verdict:** The formalization is correct and complete for the stated problem. No mathematical flaws. The only omission (not a flaw) is the lack of a variant for the exact solution set. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse needed; appropriately self-contained | +| Citations | All 3 references match the website exactly | +| Variants | Missing Yu–Liu exact enumeration variant | +| Readability | Clean, follows conventions | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Mathematically correct and complete | + +**Overall:** High-quality formalization. The one recommended improvement is adding a variant theorem for the Yu–Liu complete enumeration of solutions. diff --git a/ai-review/407.md b/ai-review/407.md new file mode 100644 index 0000000000..ee431fd723 --- /dev/null +++ b/ai-review/407.md @@ -0,0 +1,119 @@ +# Review: Erdős Problem 407 + +**File:** `FormalConjectures/ErdosProblems/407.lean` + +--- + +## 1. Code Reuse + +No significant code reuse opportunities from `FormalConjecturesForMathlib`. The formalization is self-contained, relying only on standard Mathlib types (`Finset`, `ℕ`, `Pow`). Problem 845 also involves expressions of the form `2 ^ k * 3 ^ l`, but the mathematical structure is entirely different (density of sums vs. bounded representation count), so no shared abstraction is warranted. + +Problem 43 uses the same `∃ C : ℕ, ∀ ... S.card ≤ C` pattern for bounding a quantity by an absolute constant, but this pattern is simple enough that extracting it into a shared definition would add complexity without benefit. + +**Verdict:** No reuse opportunities. The formalization is appropriately self-contained. + +--- + +## 2. Citations + +**Website (erdosproblems.com/407) lists:** +- [ErGr80] Erdős & Graham, *Old and new problems and results in combinatorial number theory* (1980), p.80 — origin, attributed to Newman. +- [EGST88] Evertse, Györy, Stewart, Tijdeman, *S-unit equations and their applications* (1988) — first proof. +- Tijdeman & Wang — showed w(n) ≤ 4 for all large n (counting distinct sets {2^a, 3^b, 2^c·3^d}). +- [BaBe24] Bajpai & Bennett, *On sums of four smooth numbers* (2024) — effective bounds w(n) ≤ 9 for all n, w(n) ≤ 4 for n ≥ 131082. + +**Lean file cites:** +- [ErGr80] ✓ — correctly cited with full bibliographic details. +- [EGST88] ✓ — correctly cited with full bibliographic details. +- [BaBe24] ✓ — correctly cited with full bibliographic details. + +**Missing:** The Tijdeman–Wang result is mentioned on the website but not cited in the Lean file. This is a minor omission — it is an intermediate result superseded by [BaBe24], and the three included references adequately cover the origin, proof, and best known bounds. + +**Verdict:** Citations are accurate and well-formatted. The omission of Tijdeman–Wang is minor and defensible. + +--- + +## 3. Variants + +The formalization captures only the qualitative statement: "there exists an absolute constant C bounding w(n)." The website documents several quantitative refinements that could be formalized as additional theorems: + +1. **w(n) ≤ 9 for all n** (Bajpai–Bennett 2024) — a concrete, unconditional bound. +2. **w(n) ≤ 4 for n ≥ 131082** (Bajpai–Bennett 2024) — an asymptotic improvement. +3. **w(299) = 9** (implicit from [BaBe24] — the maximum is attained at n = 299). +4. **Infinitely many n with w(n) = 4** — the website gives explicit parametric families. + +These are natural strengthened variants. In particular, variant (1) would be a clean, decidable statement: + +``` +theorem erdos_407_effective : ∀ (n : ℕ) (S : Finset (ℕ × ℕ × ℕ × ℕ)), + (∀ t ∈ S, n = 2 ^ t.1 + 3 ^ t.2.1 + 2 ^ t.2.2.1 * 3 ^ t.2.2.2) → + S.card ≤ 9 +``` + +**Verdict:** The main conjecture is captured. Quantitative variants are missing but not essential. + +--- + +## 4. Readability + +The code is concise and follows the standard pattern for Erdős problem formalizations in this repository. The docstring clearly states the mathematical content and references. + +One minor readability issue: the nested pair accessors `t.1`, `t.2.1`, `t.2.2.1`, `t.2.2.2` for the 4-tuple (a, b, c, d) are somewhat opaque. An alternative using destructuring or a local abbreviation could improve clarity: + +```lean +-- Alternative with destructuring (hypothetical) +(∀ ⟨a, b, c, d⟩ ∈ S, n = 2 ^ a + 3 ^ b + 2 ^ c * 3 ^ d) +``` + +However, the current style is consistent with other problems in the repository (e.g., Problem 845 uses similar tuple patterns), so changing it would be a style-wide decision rather than a local fix. + +**Verdict:** Readable and consistent with repository conventions. The nested tuple access is a minor but accepted idiom. + +--- + +## 5. Formalizability + +The problem is completely unambiguous and straightforwardly formalizable: + +- The equation n = 2^a + 3^b + 2^c · 3^d is a concrete arithmetic expression over ℕ. +- "Number of solutions" is well-defined: it counts distinct 4-tuples (a, b, c, d). +- "Bounded by an absolute constant" has a clear formal meaning: ∃ C, ∀ n, w(n) ≤ C. + +There is no ambiguity whatsoever. The only interpretive choice — counting ordered 4-tuples (a, b, c, d) rather than unordered multisets of summands {2^a, 3^b, 2^c·3^d} — aligns with the natural reading of the problem statement and the Bajpai–Bennett bounds. (The Tijdeman–Wang result uses the alternative counting, but the standard formulation counts tuples.) + +**Verdict:** Perfectly formalizable. No ambiguity. + +--- + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed analysis:** + +- **Domain:** The problem specifies a, b, c, d ≥ 0 integers. The formalization uses `ℕ`, which is exactly the non-negative integers. ✓ +- **Equation:** `n = 2 ^ t.1 + 3 ^ t.2.1 + 2 ^ t.2.2.1 * 3 ^ t.2.2.2` correctly encodes n = 2^a + 3^b + 2^c · 3^d. ✓ +- **Counting method:** The formalization quantifies over all `S : Finset (ℕ × ℕ × ℕ × ℕ)` whose elements satisfy the equation, requiring `S.card ≤ C`. This is equivalent to asserting that the full solution set has cardinality ≤ C, since: (a) the full solution set is finite for each n (each exponent is bounded by n), and (b) the largest such S is the full solution set. ✓ +- **Answer:** `answer(True)` is correct — the conjecture was proved affirmatively by [EGST88]. ✓ +- **Category:** `research solved` is correct. ✓ +- **AMS classification:** `AMS 11` (Number Theory) is appropriate. ✓ +- **n ranges over ℕ:** The problem asks about all natural numbers n, and the formalization uses `∀ (n : ℕ)`. This includes n = 0, for which the solution set is empty (since 2^a + 3^b + 2^c · 3^d ≥ 1 + 1 + 1 = 3 for all a, b, c, d ≥ 0). This is harmless — the bound C still applies. ✓ + +**No flaws identified.** The formalization faithfully captures the mathematical content of the problem. + +**Verdict:** Correct and complete. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No opportunities; appropriately self-contained | +| Citations | Accurate; minor omission of Tijdeman–Wang (superseded) | +| Variants | Main conjecture captured; quantitative bounds not included | +| Readability | Good; nested tuple access is idiomatic | +| Formalizability | Perfect; no ambiguity | +| Correctness | Fully correct | + +**Overall:** This is a clean, correct formalization with no mathematical issues. The main improvement opportunities are adding quantitative variant theorems for the effective bounds from [BaBe24]. diff --git a/ai-review/408.md b/ai-review/408.md new file mode 100644 index 0000000000..51a7ee6ea0 --- /dev/null +++ b/ai-review/408.md @@ -0,0 +1,136 @@ +# Review: Erdos Problem 408 + +**File:** `FormalConjectures/ErdosProblems/408.lean` + +--- + +## 1. Code Reuse + +**Opportunity identified.** The codebase has a well-developed natural density framework in `FormalConjecturesForMathlib/Data/Set/Density.lean` providing `Set.HasDensity`, `Set.partialDensity`, `Set.upperDensity`, and `Set.lowerDensity`. Notably, the sibling problem Erdos 409 (`FormalConjectures/ErdosProblems/409.lean:97`) already uses `HasDensity` directly: + +```lean +{ n | ∃ i, (φ · + 1)^[i] n = p }.HasDensity α +``` + +Problem 408, by contrast, inlines the density computation using `(Finset.range N).filter ... .card / N` with a raw `Tendsto` to `nhds d`. These are mathematically equivalent, but the current formulation bypasses the existing density API without clear justification. + +**Recommendation:** Part (b) (`erdos_408.variants.concentration`) could be refactored to use `HasDensity` with density value `0` for the exceptional set, matching the convention in Problem 409. Part (a) is slightly harder to refactor since it asserts existence of the density for every `c` (i.e., the distribution function exists), but could still be phrased as: for every `c`, the set `{n | f(n)/log(n) ≤ c}` has *some* density. + +Additionally, `iteratedTotient` could potentially be shared with other iteration-based problems (409, 410, 411) if a general "iteration length to reach property" utility were factored out, though this is a lower priority. + +--- + +## 2. Citations + +The docstring references: +- **[ErGr80]** — Erdos & Graham, *Old and new problems and results in combinatorial number theory* (1980). Correctly cited as the source of the problem. +- **[EGPS90]** — Erdos, Granville, Pomerance, and Spiro, *On the normal behavior of the iterates of some arithmetic functions*, Analytic Number Theory (1990), 165–204. Correctly cited. + +**Missing from the website but present on erdosproblems.com/408:** +- **Pillai [Pi29]** — Established the bounds log₃ n < f(n) < log₂ n for all large n. Not mentioned in the formalization. Since these bounds are a known result rather than part of the conjecture, omission is acceptable, but including them as context would be valuable. +- **Shapiro [Sh50]** — Proved f(n) is essentially multiplicative. Not mentioned. +- **Guy [Gu04]** — Guy's *Unsolved Problems in Number Theory*, Problem B41. Not mentioned. +- **OEIS A049108** — The OEIS sequence for f(n). Not mentioned. + +**Assessment:** The primary citations are correct. The additional references are for known results and contextual information, so their absence is not a deficiency in the formalization itself, but adding them to the module docstring would improve scholarly completeness. + +--- + +## 3. Variants + +The website describes **three** questions for Problem 408: + +1. Does f(n)/log n have a distribution function? — **Captured** as `erdos_408`. +2. Is f(n)/log n almost always equal to a constant? — **Captured** as `erdos_408.variants.concentration`. +3. What can be said about the largest prime factor of φ_k(n) when k ≈ log log n? — **Not captured.** + +**Missing variant:** The third question asks about the largest prime factor of φ_k(n) for k around log log n. The website notes it is "likely true" that for almost all n, the largest prime factor of φ_k(n) is bounded by n^(o(1)) as k → ∞. This is a distinct question from (1) and (2) and should be formalized as a separate variant. + +**Missing sub-variant:** The conjectured value α = 1/log 2 is mentioned only in the docstring of Part (b). This could be formalized as an additional variant, e.g.: + +```lean +theorem erdos_408.variants.alpha_value : + ∃ α : ℝ, α = 1 / Real.log 2 ∧ α > 0 ∧ + ∀ ε : ℝ, ε > 0 → ... := by sorry +``` + +or simply stated as a conjecture that the α from Part (b) equals 1/log 2. + +--- + +## 4. Readability + +The code is **well-structured and readable**. Specific observations: + +- The helper definitions `iteratedTotient` and `totientIterationLength` are clearly documented with good docstrings explaining the mathematical content. +- The supporting lemma `iteratedTotient_reaches_one` is correctly separated out and used as a prerequisite for the well-definedness of `totientIterationLength`. +- The `totientIterationLength` definition handles the edge case `n ≤ 1` cleanly by returning 0, and uses `Nat.find` for the well-defined case. +- The use of `Finset.range N` with `.filter` is a standard idiom that is easy to read. + +**Minor suggestion:** The division `(totientIterationLength n : ℝ) / Real.log n` appears in both theorems. A local abbreviation (e.g., `def normalizedTotientLength (n : ℕ) : ℝ := ...`) could reduce repetition, though this is a stylistic preference and the current form is perfectly acceptable. + +--- + +## 5. Formalizability + +**Assessment: High — both parts are precisely formalizable with minimal ambiguity.** + +- Part (a) asks whether f(n)/log n has a distribution function. The notion of "distribution function" in the sense of natural density is standard and unambiguous: for every c ∈ ℝ, the natural density of {n : f(n)/log n ≤ c} exists. The formalization captures this correctly. + +- Part (b) asks whether f(n)/log n is "almost always" equal to a constant. The formalization interprets "almost always" as "the natural density of the exceptional set is zero," which is the standard number-theoretic interpretation. This is unambiguous. + +- The **only source of ambiguity** is in the missing Part (3) from the website regarding the largest prime factor of φ_k(n) for k ≈ log log n. The phrase "what can be said about" is inherently open-ended, but the website's note about the expected answer (bounded by n^(o(1))) makes this formalizable as well. + +- Edge cases (n = 0, n = 1) are handled gracefully: `totientIterationLength` returns 0 for n ≤ 1, and a finite number of edge cases do not affect the limiting density. + +--- + +## 6. Correctness + +**Assessment: The formalization is mathematically correct for what it captures, but incomplete.** + +### Part (a) — `erdos_408` (Distribution Function) + +The statement: +```lean +∀ c : ℝ, ∃ d : ℝ, Tendsto + (fun N : ℕ => (((range N).filter (fun n => + (totientIterationLength n : ℝ) / Real.log n ≤ c)).card : ℝ) / (N : ℝ)) + atTop (nhds d) +``` + +This correctly formalizes "f(n)/log n has a distribution function." The use of `Finset.range N` (giving {0, ..., N-1}) is equivalent to the standard density definition using {1, ..., N} since the finite discrepancy does not affect the limit. **Correct.** + +One subtlety: for `n = 0` or `n = 1`, `totientIterationLength n = 0` and `Real.log n ≤ 0` (since `Real.log 0 = 0` and `Real.log 1 = 0` in Mathlib). So `0 / 0 = 0` in Lean's division, and the predicate becomes `0 ≤ c`. These elements are counted when `c ≥ 0` and not counted when `c < 0`. Since there are only finitely many such edge cases, this has no effect on the limit. **No issue.** + +### Part (b) — `erdos_408.variants.concentration` (Concentration) + +The statement: +```lean +∃ α : ℝ, α > 0 ∧ ∀ ε : ℝ, ε > 0 → + Tendsto (fun N : ℕ => + (((range N).filter (fun n => + ε ≤ |((totientIterationLength n : ℝ) / Real.log n) - α|)).card : ℝ) / (N : ℝ)) + atTop (nhds 0) +``` + +This correctly formalizes "f(n)/log n concentrates around a positive constant α." The use of `ε ≤ |...|` (rather than `ε < |...|`) is a standard choice that doesn't affect the mathematical content since the density statement is for all ε > 0. **Correct.** + +### Incompleteness + +1. **Missing Part (3):** The third question about the largest prime factor of φ_k(n) for k ≈ log log n is not formalized. This is a substantive omission since the website lists it as part of the same problem. + +2. **Conjectured value of α:** The expected value α = 1/log 2 is documented but not formalized. While the problem as stated by Erdos asks for existence, the conjectured specific value is a natural variant worth capturing. + +3. **Pillai's bounds:** The known bounds log₃ n < f(n) < log₂ n (for large n) could be formalized as a supporting test-category lemma, similar to how `interatedTotient_reaches_one` is included. This would provide useful context and a more complete picture. + +### Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Could improve | Existing `HasDensity` framework not used; sibling problem 409 uses it | +| Citations | Good | Primary refs correct; some secondary refs from website omitted | +| Variants | Incomplete | Part (3) about largest prime factor of φ_k(n) missing; conjectured α value not formalized | +| Readability | Good | Clear structure, good docstrings | +| Formalizability | High | Statements are precise and unambiguous | +| Correctness | Correct but incomplete | Parts (a) and (b) are mathematically sound; edge cases handled properly | diff --git a/ai-review/411.md b/ai-review/411.md new file mode 100644 index 0000000000..f4bc68b71e --- /dev/null +++ b/ai-review/411.md @@ -0,0 +1,122 @@ +# Review: Erdős Problem 411 + +**File:** `FormalConjectures/ErdosProblems/411.lean` + +--- + +## 1. Code Reuse + +The definition `def g (n : ℕ) : ℕ := n + Nat.totient n` is specific to this problem and cannot be replaced by an existing definition in the codebase. However, the neighboring problems 408–412 all share a common pattern of iterating arithmetic functions (`Nat.totient^[k]`, `(σ 1)^[k]`, `(φ · + 1)^[i]`) and use the same `f^[k]` iteration notation from Lean 4. No existing utility in `FormalConjecturesForMathlib/` provides a reusable abstraction that would simplify this file. The current standalone definition is appropriate. + +**Verdict:** No actionable reuse opportunities. + +--- + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The website ([erdosproblems.com/411](https://www.erdosproblems.com/411)) lists the source as **[ErGr80, p.81]**, which matches the theorem docstring's `[ErGr80, p.81]`. The full bibliographic entry in the module docstring is consistent with the website. + +The docstring mentions results by Selfridge, Weintraub, and Cambie. The website confirms all of these. However, the website also mentions **Steinerberger's equivalence** (for r = 2, the problem reduces to solving φ(n) + φ(n + φ(n)) = n), which is not mentioned in the formalization. This is a contextual observation rather than a missing citation per se, but it could be noted for completeness. + +**Verdict:** Citations are correct. Consider mentioning Steinerberger's equivalence in the module docstring. + +--- + +## 3. Variants + +The formalization provides a single theorem `erdos_411` capturing the main question: characterize all (n, r) with the doubling property g_{k+r}(n) = 2·g_k(n) for large k. + +The website documents several additional results and conjectures that are **not formalized as variant theorems**: + +- **General multiplier variants:** Selfridge and Weintraub found solutions to g_{k+9}(n) = 9·g_k(n); Weintraub found g_{k+25}(3114) = 729·g_k(3114) for k ≥ 6; Cambie observed g_{k+4}(738) = 3·g_k(738), g_{k+4}(148646) = 4·g_k(148646), and g_{k+4}(4325798) = 4·g_k(4325798). These suggest a natural generalization: replace the multiplier 2 with an arbitrary positive integer m, asking for which (n, r, m) we have g_{k+r}(n) = m·g_k(n) for large k. + +- **Steinerberger's reduction:** For r = 2, the equation reduces to φ(n) + φ(n + φ(n)) = n, and if this holds the odd part of n belongs to {1, 3, 5, 7, 35, 47} or satisfies specific congruence conditions. This could be a useful intermediate lemma. + +- **Known solutions as test lemmas:** The known solutions n = 10 and n = 94 (for r = 2) mentioned in the docstring could be formalized as `@[category test]` lemmas verifying concrete instances, similar to patterns seen elsewhere in the codebase. + +- **Cambie's conjecture on g_k(2p^t) = 4p^t:** The website mentions Cambie's further conjecture that this has no solutions except t = 1 and p ∈ {7, 47} for primes p ≡ 7 (mod 8). This is not captured. + +**Verdict:** Several natural variants are missing. Most notably: +1. A generalized multiplier version (replacing 2 with m). +2. Test lemmas for the known solutions n = 10, n = 94 with r = 2. +3. Cambie's refined conjecture. + +--- + +## 4. Readability + +The code is clean and concise. A few minor observations: + +- The use of `p : ℕ × ℕ` with `p.1` and `p.2` is slightly less readable than using named variables. An alternative like `{nr : ℕ × ℕ | 0 < nr.1 ∧ ...}` or a destructured form would be marginally clearer, but this is a minor stylistic point and is consistent with other problems in the codebase. + +- The definition `def g (n : ℕ) : ℕ := n + Nat.totient n` is clear and well-documented. + +- The module docstring provides good context with the iteration definition and known results. + +**Verdict:** Readability is good. No significant issues. + +--- + +## 5. Formalizability + +The original problem statement is: *"For which n and r is it true that g_{k+r}(n) = 2·g_k(n) for all large k?"* + +This is a **set characterization problem** — it asks for a complete description of the solution set. The formalization captures this by equating the set `{p : ℕ × ℕ | ...}` with `answer(sorry)`, which is the standard pattern for open problems in this codebase. + +The statement is mathematically precise: the function g, the iteration, the doubling condition, and "for all sufficiently large k" (∃ K, ∀ k ≥ K) are all unambiguous. However, there is a subtlety in how one resolves the problem: + +- If the answer is a finite set (as Cambie's conjecture suggests), then `answer(sorry)` would be a concrete finite set of pairs. +- If the answer turns out to have a more complex structure, the placeholder still accommodates it. + +**Verdict:** The problem is precisely formalizable with no ambiguity. The formalization correctly captures the mathematical content. + +--- + +## 6. Correctness + +The formalization defines: + +```lean +def g (n : ℕ) : ℕ := n + Nat.totient n + +theorem erdos_411 : + {p : ℕ × ℕ | 0 < p.1 ∧ 0 < p.2 ∧ + ∃ K, ∀ k, K ≤ k → g^[k + p.2] p.1 = 2 * g^[k] p.1} = answer(sorry) +``` + +**Analysis:** + +- **g is correct:** g(n) = n + φ(n) matches the problem statement exactly. + +- **Iteration is correct:** `g^[k + p.2] p.1` computes g applied (k + r) times to n, which is g_{k+r}(n). `g^[k] p.1` is g_k(n). The notation `f^[k]` in Lean 4 gives the k-th iterate with `f^[0] = id`, so g^[1](n) = g(n) = n + φ(n), matching g_1(n) as defined in the problem. + +- **Boundary conditions are sound:** + - `0 < p.1` (n ≥ 1): Correctly excludes n = 0, which is a degenerate case since g(0) = 0 + φ(0) = 0, making g^[k](0) = 0 for all k, trivially satisfying 0 = 2·0. + - `0 < p.2` (r ≥ 1): Correctly excludes r = 0, which would require g^[k](n) = 2·g^[k](n), i.e., g^[k](n) = 0 for large k. Since g(n) ≥ n for n ≥ 1 (because φ(n) ≥ 0), the iterates are non-decreasing, so this has no solutions with n ≥ 1. The exclusion is thus harmless but technically unnecessary. + +- **"Sufficiently large k" is correct:** The formulation `∃ K, ∀ k, K ≤ k → ...` correctly captures "for all sufficiently large k." + +- **The doubling condition matches the problem:** The equation `g^[k + p.2] p.1 = 2 * g^[k] p.1` directly formalizes g_{k+r}(n) = 2·g_k(n). + +- **Cambie's conjecture in the docstring:** The docstring states "Cambie conjectures the answer is r = 2 and n = 2^l · p for l ≥ 1 and p ∈ {2, 3, 5, 7, 35, 47}." This matches the website. Note that the conjecture describes infinitely many n (for each valid p, all n = 2^l · p with l ≥ 1), so the answer set, if Cambie is correct, would be `{(2^l · p, 2) | l ≥ 1, p ∈ {2, 3, 5, 7, 35, 47}}`. + +**Verdict:** The formalization is mathematically correct and complete for the stated problem. No flaws identified. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code Reuse | No reuse opportunities | +| Citations | Correct; Steinerberger could be mentioned | +| Variants | Missing: generalized multiplier, test lemmas for known solutions, Cambie's refined conjecture | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | + +**Overall:** The formalization is a faithful, correct encoding of the main question from Erdős Problem 411. The primary gap is the absence of variant theorems for the generalized multiplier problem and concrete test lemmas for known solutions, which would make the formalization more comprehensive given the rich context documented on the website. diff --git a/ai-review/415.md b/ai-review/415.md new file mode 100644 index 0000000000..2f7bfbef94 --- /dev/null +++ b/ai-review/415.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 415 + +## 1. Code Reuse + +Several patterns from the existing codebase are directly relevant: + +- **Totient function:** `Nat.totient` is used in multiple files (416, 417, 418, 408, 360). No custom totient definition is needed — the formalization correctly uses `Nat.totient` from Mathlib. +- **Permutation type:** `Equiv.Perm (Fin k)` is the standard Mathlib representation used across the codebase (problems 34, 499, 1161). The formalization follows this convention. +- **`sSup` on ℕ:** The pattern `sSup {k : ℕ | ...}` is used in problems 121, 131, 1023. The formalization matches this convention. +- **Asymptotic patterns:** Problem 416 (`416.lean`) uses `Real.log` compositions (`x.log.log.log`) and `Tendsto ... atTop (nhds c)` in essentially identical fashion. No novel utility code is needed. +- **`descendingPerm` helper:** Defines a reversal permutation via `Fin.rev`. This is a clean, self-contained helper. Mathlib does not provide a named reversal permutation on `Fin k` as an `Equiv.Perm`, so this is appropriate. However, one could consider using `Equiv.refl.trans` with `Fin.revOrderIso` or similar — the current explicit construction is arguably more readable. + +**Verdict:** No significant reuse opportunities are missed. The code follows established codebase conventions. + +## 2. Citations + +The website (erdosproblems.com/415) cites: + +- **[Er36b]** — Erdős's proof that F(n) ≍ log log log n. The formalization references this correctly in the docstring. +- **[ErGr80, p. 82]** — Erdős and Graham, *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique (1980). The formalization includes this reference with full bibliographic detail in the module docstring and cites "[ErGr80, p. 82]" in each theorem's docstring. + +The website does not list additional references beyond these two. The formalization's citations match the website. + +**Verdict:** Citations are complete and accurate. + +## 3. Variants + +The website lists three sub-questions: + +1. Is F(n) = (c + o(1)) log log log n for some constant c? → Captured by `erdos_415` (Part 1). +2. Is the first pattern to fail always the strictly decreasing one? → Captured by `erdos_415.variants.descending_pattern` (Part 2). +3. Is the "natural" ordering (mimicking φ(1), …, φ(k)) the most likely to appear? → Captured by `erdos_415.variants.natural_pattern` (Part 3). + +The website also notes an observation by Desmond Weisenberg: the same questions could address ordering patterns **allowing equality**, which is particularly relevant for variant (3) since the totient function can take equal values on consecutive arguments. This variant is **not captured** in the formalization. + +**Verdict:** All three main variants from the website are present. The equality-pattern variant noted by Weisenberg is missing but is arguably a separate research direction rather than a core sub-problem. + +## 4. Readability + +The code is well-structured and readable: + +- **Namespace:** `Erdos415` keeps definitions scoped. +- **Docstrings:** Each definition and theorem has a clear docstring explaining the mathematical content. +- **Helper definitions:** `ExhibitsPattern`, `F`, `descendingPerm`, and `patternCount` are cleanly separated and named descriptively. +- **Minor suggestion:** The `descendingPerm` definition could be simplified using `Equiv.mk Fin.rev Fin.rev Fin.rev_rev Fin.rev_rev` or even an anonymous constructor, but the current explicit field notation is arguably clearer. + +**Verdict:** Readability is good. No significant improvements needed. + +## 5. Formalizability + +The problem as stated on erdosproblems.com has some inherent ambiguities: + +- **"Ordering pattern"**: The notion of an "ordering pattern" of k values needs clarification — does it require strict inequalities (all values distinct) or allow ties? The formalization uses **strict inequalities** (`<` in `ExhibitsPattern`), which means a permutation σ can only be exhibited if all k totient values in the block are distinct. This is a reasonable default but does restrict the domain — consecutive totient values can be equal (e.g., φ(n) = φ(n+1) is possible). +- **F(n) well-definedness**: The definition via `sSup` requires the set to be bounded above (which it is, since k ≤ n) and nonempty (k = 0 trivially works, as the empty permutation is vacuously realized). For `sSup` on `ℕ` in Lean/Mathlib, if the set is unbounded, `sSup` returns 0 by convention, which could cause issues, but in this case the set is bounded by n, so this is fine. +- **Part 1 precision**: The problem asks whether F(n)/(log log log n) → c. The formalization states this as `Tendsto ... atTop (nhds c)`, which is the correct Lean encoding of pointwise convergence to a constant. Note that this is **stronger** than the website's "F(n) = (c + o(1)) log log log n" — both formulations are mathematically equivalent for positive c, so this is correct. +- **Part 2 precision**: The formalization states: if the descending pattern of length k appears up to n, then every pattern of length k appears up to n. This is a reasonable formalization of "the first pattern to fail is the descending one," capturing it as: the descending pattern is hardest to realize. +- **Part 3 precision**: The existential statement (∃ τ such that τ eventually dominates all other patterns) is a reasonable formalization of "there is a most common pattern." The conjecture that τ is the "natural" one mimicking φ(1), …, φ(k) is mentioned in the docstring but not formally encoded — the statement only asserts existence. + +**Verdict:** The problem is formalizable with mild ambiguity around strict vs. non-strict ordering. The formalization makes a definite choice (strict) which is defensible. The formalizability is high overall. + +## 6. Correctness + +### Part 1 (`erdos_415`) +**Mathematically sound.** The statement that F(n)/log log log n → c (for some positive c) correctly captures the asymptotic. One subtle point: for small n where log log log n is undefined or non-positive, the division may produce meaningless values, but `Tendsto ... atTop ...` only cares about eventual behavior, so this is fine. + +### Part 2 (`erdos_415.variants.descending_pattern`) +**Potential issue with the formalization's strength.** The statement says: for ALL n and k, if the descending pattern of length k is realized up to n, then every pattern of length k is realized up to n. This is a **universal** statement over all n and k, not just an asymptotic one. The original conjecture asks whether the descending pattern is "always" the first to fail, which could be interpreted as: +- (a) For all n, k: descending realized ⟹ all realized (the formalization's interpretation), or +- (b) For all sufficiently large n: the maximal k where all patterns appear equals the maximal k where the descending pattern appears. + +Interpretation (a) is stronger. If the conjecture is true, (a) and (b) may be equivalent, but (a) could be false for small n while (b) is true. The formalization chooses the stronger reading, which is reasonable for a conjecture. + +### Part 3 (`erdos_415.variants.natural_pattern`) +**Partially captures the conjecture.** The statement asserts the existence of a dominant pattern τ (for each k) that eventually has the highest count. This captures the "most common" aspect. However: +- The conjecture specifically suggests that τ should be the "natural" pattern mimicking φ(1), …, φ(k). The formalization only existentially quantifies over τ — it does not identify which specific permutation is conjectured to be dominant. The docstring mentions this, but the formal statement is weaker than the full conjecture. +- The `patternCount` function counts positions m with m + k ≤ n where the block exhibits pattern σ. The condition `m + k ≤ n` appears both in the filter predicate and is correct. + +### `ExhibitsPattern` definition +**Strictly speaking, the definition encodes the pattern inversely.** The docstring says "σ sorts the totient values into increasing order," meaning σ(i) < σ(j) ⟹ φ(m+1+i) < φ(m+1+j). But the code says: `i < j → φ(m+1+σ(i)) < φ(m+1+σ(j))`. This means: σ maps the standard order to positions whose totient values are increasing. In other words, the block `φ(m+1+σ(0)), φ(m+1+σ(1)), …, φ(m+1+σ(k-1))` is strictly increasing. This is equivalent to saying σ⁻¹ is the permutation that sorts the totient values. Both conventions capture the same set of k! patterns (every permutation has a unique inverse), so the set of "exhibited patterns" over all σ is the same regardless of convention. **The definition is correct** — it just uses the inverse convention relative to the docstring's description. This does not affect the truth of any theorem statement since the quantification is over all permutations. + +### `F` definition — `sSup` well-definedness +The set `{k : ℕ | ∀ σ : Equiv.Perm (Fin k), ∃ m, m + k ≤ n ∧ ExhibitsPattern k m σ}` always contains 0 (vacuously) and is bounded above by n. So `sSup` is well-defined and returns a natural number ≤ n. **Correct.** + +**Overall correctness verdict:** The formalization is mathematically correct. The main caveats are: +1. Part 2 uses a universally quantified (all n, k) interpretation which may be stronger than intended. +2. Part 3 only existentially quantifies the dominant pattern rather than identifying it as the "natural" one. +3. The strict inequality convention in `ExhibitsPattern` excludes patterns with ties, which the Weisenberg observation notes is relevant. + +None of these rise to the level of "incorrect" — they are reasonable formalization choices for an inherently somewhat ambiguous problem statement. diff --git a/ai-review/419.md b/ai-review/419.md new file mode 100644 index 0000000000..195b2613b6 --- /dev/null +++ b/ai-review/419.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 419 + +## 1. Code Reuse + +**Potential reuse with Problem 420.** The `erdos419_ratio` function in `419.lean` is: +```lean +noncomputable def erdos419_ratio (n : ℕ) : ℝ := + ((Nat.divisors (n + 1).factorial).card : ℝ) / ((Nat.divisors n.factorial).card : ℝ) +``` + +Problem 420 (`420.lean`) defines a generalized version: +```lean +noncomputable def F (f : ℕ → ℝ) (n : ℕ) : ℝ := + ((Nat.divisors (n + ⌊f n⌋₊).factorial).card : ℝ) / + ((Nat.divisors n.factorial).card : ℝ) +``` + +`erdos419_ratio n` is exactly `Erdos420.F (fun _ => 1) n` (since `⌊(1 : ℝ)⌋₊ = 1`). These two problems could share a single generalized definition. Problem 419 could be restated using Problem 420's `F`, or a shared definition could be placed in a common file. + +**Arithmetic function alternative.** Mathlib provides `Nat.ArithmeticFunction.sigma 0` where `σ 0 n = #n.divisors` (see `Mathlib/NumberTheory/ArithmeticFunction/Misc.lean:178`). Using `σ 0` instead of `(Nat.divisors n).card` would tie the formalization more tightly to the standard number-theoretic notation τ(n) = σ₀(n), though the current form is arguably more self-documenting. + +## 2. Citations + +The website (erdosproblems.com/419) states: + +- **Original source:** Erdős and Graham, 1980, p.83 [ErGr80]. +- **Solution:** Mehtaab Sawhney proved these are the only limit points. Independently, Erdős, Graham, Ivić, and Pomerance proved the same result [EGIP96]. +- **Additional credits:** Zachary Chase and Mehtaab Sawhney are credited on the website. + +The formalization's docstring cites: +- [ErGr80] — matches the website. +- [EGIP96] — matches the website (full citation provided with correct title and year). +- Sawhney is mentioned — matches the website. + +**Issue:** The website credits "Zachary Chase" alongside Mehtaab Sawhney. The formalization does not mention Zachary Chase. Consider adding this credit. + +**Minor:** The docstring says "Sawhney (and independently Erdős–Graham–Ivić–Pomerance [EGIP96]) proved that these are the only limit points." The website says Sawhney's proof came first and EGIP96 was independent. However, [EGIP96] is from 1996, well before Sawhney's work, so the historical order may be: EGIP96 proved it first, and Sawhney independently reproved it. The docstring's phrasing ("Sawhney... and independently... [EGIP96]") is ambiguous about chronological priority. Consider clarifying the temporal ordering. + +## 3. Variants + +The problem on erdosproblems.com/419 asks a single question: "What is the set of limit points of τ((n+1)!)/τ(n!)?" The formalization captures the complete answer: the set equals {1 + 1/k : k ≥ 1} ∪ {1}. + +**No missing variants.** The website does not list additional sub-questions or variant formulations for Problem 419. (The natural generalization is Problem 420, which is formalized separately.) + +One could additionally formalize: +- The "easy direction" that each 1 + 1/k is indeed a limit point (as noted by Erdős–Graham) as a separate lemma. +- That 1 is a limit point. + +But these are implied by the equality and do not constitute missing variants. + +## 4. Readability + +The code is clean and readable. A few minor observations: + +- **Naming:** `erdos419_ratio` uses snake_case with a numeric suffix, which is consistent with other problems in the repository. +- **Namespace:** `Erdos419` namespace is used appropriately. +- **Docstrings:** Both the module docstring and theorem docstring are informative and well-written. +- **Suggestion:** The set description `{c | ∃ k : ℕ, 0 < k ∧ c = 1 + 1 / (k : ℝ)}` is clear. An alternative would be `Set.range (fun k : ℕ+ => 1 + 1 / (k : ℝ))` but the current form is arguably more explicit and readable. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem asks for the set of limit points of a well-defined real-valued sequence. All components are standard: +- τ(n) = number of divisors of n — well-defined. +- n! — well-defined. +- The ratio τ((n+1)!)/τ(n!) — well-defined for all n ≥ 1 (since τ(n!) > 0 for all n ≥ 1). +- "Limit point" (= cluster point) of a sequence — standard topological notion. + +The answer set {1 + 1/k : k ≥ 1} ∪ {1} is also unambiguous. + +**One technical note:** For n = 0, we have τ(0!) = τ(1) = 1 and τ(1!) = τ(1) = 1, so the ratio is 1/1 = 1. The formalization uses `ℕ` starting at 0, which is fine — including or excluding finitely many initial terms does not affect the set of cluster points (since `MapClusterPt` uses `atTop`). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +1. **Definition of `erdos419_ratio`:** `((Nat.divisors (n + 1).factorial).card : ℝ) / ((Nat.divisors n.factorial).card : ℝ)` correctly computes τ((n+1)!)/τ(n!). Note that Lean's precedence makes `(n + 1).factorial` mean `Nat.factorial (n + 1)` = (n+1)!, which is correct. + +2. **Use of `MapClusterPt`:** The definition `MapClusterPt c atTop erdos419_ratio` unfolds to `ClusterPt c (Filter.map erdos419_ratio atTop)`, meaning c is a cluster point of the sequence `erdos419_ratio` along the filter of cofinite sets. This is exactly the standard notion of "c is a limit point (accumulation point) of the sequence." This is the correct formalization of "limit point of a sequence." + +3. **The answer set:** `{1} ∪ {c | ∃ k : ℕ, 0 < k ∧ c = 1 + 1 / (k : ℝ)}` correctly represents {1} ∪ {1 + 1/k : k ∈ ℤ₊}. Note that: + - k = 1 gives 2, k = 2 gives 3/2, k = 3 gives 4/3, etc. + - As k → ∞, 1 + 1/k → 1, so 1 is the unique accumulation point of the set itself. + - Including 1 explicitly is necessary since 1 is a limit point of the sequence but is not of the form 1 + 1/k for any finite k. + +4. **Consistency with known results:** The claimed answer matches the result proved by Erdős–Graham–Ivić–Pomerance [EGIP96] and Sawhney. The key insight is that τ((n+1)!)/τ(n!) = ∏_{p prime, p | n+1} (v_p((n+1)!) + 1)/(v_p(n!) + 1), and when n+1 = p is prime, this ratio approaches 1 + 1/k as p grows through primes where v_p(n!) has a specific structure. + +5. **Division by zero:** When n = 0, `(Nat.divisors 0.factorial).card = (Nat.divisors 1).card = 1 ≠ 0`, so no division-by-zero issue. More generally, `n.factorial ≠ 0` for all n, so `Nat.divisors n.factorial` is always nonempty, and its cardinality is always positive. The cast to ℝ preserves this, so division is well-defined for all n. + +**Verdict: No mathematical errors detected. The formalization is correct and complete.** diff --git a/ai-review/420.md b/ai-review/420.md new file mode 100644 index 0000000000..8ae8157c7f --- /dev/null +++ b/ai-review/420.md @@ -0,0 +1,122 @@ +# AI Review: Erdős Problem 420 + +## 1. Code Reuse + +**Strong overlap with Problem 419.** Problem 419 defines: +```lean +noncomputable def erdos419_ratio (n : ℕ) : ℝ := + ((Nat.divisors (n + 1).factorial).card : ℝ) / ((Nat.divisors n.factorial).card : ℝ) +``` + +This is exactly `Erdos420.F (fun _ => 1) n` (since `⌊(1 : ℝ)⌋₊ = 1`). The two problems share the same underlying construction — Problem 419 is the special case of Problem 420 with a constant shift of 1. A shared generalized definition could be extracted, or Problem 419 could be restated in terms of 420's `F`. + +**Mathlib alternative for divisor count.** Mathlib provides `Nat.ArithmeticFunction.sigma 0` where `σ₀(n) = |divisors(n)|`, the standard number-theoretic τ function. The current formulation using `(Nat.divisors n).card` is equivalent and arguably more self-documenting, so this is a stylistic choice rather than a deficiency. + +**No other reusable code found.** Other Erdős problems in the repository (964, 381, 1100, 1099, 673) involve divisors but with fundamentally different constructions (consecutive divisor ratios, highly composite numbers, etc.) that do not apply here. + +## 2. Citations + +**[ErGr80] — Correct.** The docstring cites "Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980)." This matches the website's primary reference. + +**[EGIP96] — Incomplete citation.** The tag `[EGIP96]` is used inline to attribute known results (lines 36–39) but is not given a full bibliographic entry at the bottom of the docstring. Problem 419 provides the complete citation: "Erdős, P., Graham, R., Ivić, A., and Pomerance, C., *On the number of divisors of n!*. Analytic Number Theory (Proceedings of a Conference in Honor of Heini Halberstam) (1996)." Problem 420 should include this same full citation. + +**Van Doorn's observations — Missing.** The website (erdosproblems.com/420) credits van Doorn with two additional observations: +- Infinitely many bounded prime gaps imply `lim sup F(g(n), n) = ∞` for any `g(n) → ∞`. +- Cramér's conjecture implies `lim F(g(n)(log n)², n) = ∞` for any `g(n) → ∞`. + +These are not mentioned in the docstring. While they are supplementary results rather than core parts of the problem, they provide useful context and are credited on the authoritative website. + +## 3. Variants + +**All three website questions are captured:** +- Part 1 (`erdos_420`): Asks whether F((log n)^C, n) → ∞ for sufficiently large C. ✓ +- Part 2 (`erdos_420.variants.dense_log`): Asks whether F(log n, n) is everywhere dense in (1, ∞). ✓ +- Part 3 (`erdos_420.variants.dense_monotone`): Generalizes Part 2 to monotone f ≤ log n with f → ∞. ✓ + +**Known results not formalized.** The docstring mentions several proven results (EGIP96's three theorems, and the "easy" result about F(n^{1/2}, n) → ∞) but does not formalize them as separate lemmas. Since these are known results rather than open conjectures, omitting their formalization is reasonable, though formalizing them could serve as useful auxiliary lemmas (e.g., `lim F(n^{4/9}, n) = ∞` as a weaker version of Part 1). + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Definition `F`**: Clear and well-documented. The docstring explains the mathematical meaning and notation. +- **Namespace**: `Erdos420` is used consistently. +- **Variant naming**: `erdos_420.variants.dense_log` and `erdos_420.variants.dense_monotone` use a clear hierarchical naming convention. +- **Filter opens**: `open Filter` and `open scoped Topology Real` are appropriate for the `Tendsto`, `atTop`, and `∃ᶠ` notation used. +- **Minor suggestion**: In Part 2, the function `(fun m => Real.log (m : ℝ))` is repeated in both the hypothesis and body of the `∃ᶠ`. A local `let` binding (e.g., `let logFn := fun m => Real.log (m : ℝ)`) could reduce repetition, though this is cosmetic. + +## 5. Formalizability + +**Assessment: Clearly formalizable with minor ambiguity.** + +All three parts involve well-defined mathematical objects: +- τ(n) = number of divisors — unambiguous. +- n! — unambiguous. +- ⌊f(n)⌋ — standard floor function, unambiguous. +- The ratio F(f, n) = τ((n + ⌊f(n)⌋)!) / τ(n!) — well-defined since τ(n!) > 0 for all n. +- "Tends to infinity" — standard (`Tendsto ... atTop atTop`). +- "Everywhere dense in (1, ∞)" — standard, though admits two interpretations (see Correctness). + +**One minor ambiguity in Part 3**: The phrase "f(n) ≤ log n" in the original problem likely means "eventually" (for all sufficiently large n), as is conventional in analytic number theory. The formalization uses `∀ n : ℕ, f n ≤ Real.log (n : ℝ)` — a universal quantifier over all n. See Correctness section for further discussion. + +## 6. Correctness + +**Overall: Mathematically correct with minor observations.** + +### Definition of F (lines 54–56) + +The definition uses `⌊f n⌋₊` (natural number floor, `Nat.floor`), which equals `max(0, ⌊f(n)⌋)`. For the functions used in Parts 1–3 (which are eventually positive), this agrees with the mathematical ⌊f(n)⌋ for large n. For small n where f(n) < 0, the natural floor clamps to 0, giving F = τ(n!)/τ(n!) = 1. This is a benign choice since all conclusions concern asymptotic behavior (`atTop`). + +Division by zero is not an issue: `n.factorial ≥ 1` for all n, so `(Nat.divisors n.factorial).card ≥ 1`, and the cast to ℝ is positive. + +### Part 1 — `erdos_420` (lines 63–68) + +```lean +∃ C₀ : ℝ, ∀ C : ℝ, C ≥ C₀ → + Tendsto (fun n : ℕ => F (fun m => (Real.log (m : ℝ)) ^ C) n) atTop atTop +``` + +Correctly formalizes "for all sufficiently large C, F((log n)^C, n) → ∞." The existential C₀ captures "sufficiently large." The `Tendsto ... atTop atTop` captures divergence to +∞. **Correct.** + +### Part 2 — `erdos_420.variants.dense_log` (lines 77–83) + +```lean +∀ a b : ℝ, 1 < a → a < b → + ∃ᶠ n in atTop, + a < F (fun m => Real.log (m : ℝ)) n ∧ + F (fun m => Real.log (m : ℝ)) n < b +``` + +The formalization uses `∃ᶠ n in atTop` (= `Frequently` = infinitely many n), which is strictly stronger than set-theoretic density (which only requires existence of at least one n in each interval). The docstring clarifies the intended interpretation: "there are infinitely many n with a < F(log n, n) < b." This stronger formulation is the natural and standard interpretation for sequences, so **correct as intended.** Note: there is no upper bound constraint on b, meaning the formalization covers all intervals (a, b) with 1 < a < b, including those extending beyond any finite bound. This is consistent with density in (1, ∞). + +### Part 3 — `erdos_420.variants.dense_monotone` (lines 92–99) + +```lean +∀ f : ℕ → ℝ, Monotone f → + (∀ n : ℕ, f n ≤ Real.log (n : ℝ)) → + Tendsto f atTop atTop → + ∀ a b : ℝ, 1 < a → a < b → + ∃ᶠ n in atTop, a < F f n ∧ F f n < b +``` + +**Minor issue with universal vs. eventual bound.** The condition `∀ n : ℕ, f n ≤ Real.log (n : ℝ)` requires the bound for all n, including small values. In analytic number theory, "f(n) ≤ log n" typically means for all sufficiently large n. Moreover, `Real.log 0 = 0` and `Real.log 1 = 0` in Mathlib, so the condition forces `f(0) ≤ 0` and `f(1) ≤ 0`. Combined with `Monotone f` and `Tendsto f atTop atTop`, this constrains initial values unnecessarily. + +In practice, this distinction is **immaterial**: any function satisfying the eventual bound can be modified on finitely many initial values to satisfy the universal bound without affecting the density conclusion (which depends only on tail behavior via `atTop`). However, replacing `∀ n` with `∀ᶠ n in atTop` (= eventually) would be more faithful to the original statement: + +```lean +(∀ᶠ n in atTop, f n ≤ Real.log (n : ℝ)) → +``` + +**Monotone interpretation.** `Monotone f` in Mathlib means `∀ a b, a ≤ b → f a ≤ f b` (non-decreasing). Since f → ∞ and f ≤ log n, non-decreasing is the only possibility (a non-increasing function tending to infinity is impossible). This matches the original problem's "monotonic." **Correct.** + +### Summary Table + +| Aspect | Status | +|--------|--------| +| Definition of F | ✓ Correct | +| Part 1 (limit to ∞) | ✓ Correct | +| Part 2 (dense, log) | ✓ Correct (uses `∃ᶠ` per docstring intent) | +| Part 3 (dense, monotone) | ✓ Correct modulo `∀ n` vs `∀ᶠ n` (immaterial) | +| Division safety | ✓ No division-by-zero issues | +| [EGIP96] citation | ⚠ Inline reference lacks full bibliographic entry | +| Van Doorn credit | ⚠ Missing from docstring | diff --git a/ai-review/423.md b/ai-review/423.md new file mode 100644 index 0000000000..6c20f38255 --- /dev/null +++ b/ai-review/423.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 423 + +## 1. Code Reuse + +No reusable code was found in the existing codebase. Problem 423 is a number theory / integer sequence problem concerning the Hofstadter–Ulam self-generating sequence. The codebase's combinatorial infrastructure (chromatic numbers, Ramsey theory, graph coloring, sunflowers, set families) is not relevant here. The problem is self-contained and the definitions (`IsConsecutiveBlockSum`, `IsHofstadterSeq`) are appropriately bespoke. + +The use of `Finset.Icc` and `∑ l ∈ Finset.Icc i j, a l` from Mathlib is standard and appropriate. + +## 2. Citations + +The formalization references: +- `[Er77c]` — Erdős, P., *Problems and results on combinatorial number theory*, 1977. +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique (1980). + +These match the website's listed references with correct page numbers (p.71 and p.83 respectively). + +**Missing citations:** The website also references the proofs by Bolan and Tang, which are directly relevant since the formalized theorem is precisely their result: +- Bolan: [HofstaderUlamSequence.pdf](https://github.com/mjtb49/HofstaderUlam) +- Tang: [On Erdős Problem 423](https://github.com/QuanyuTang/erdos-problem-423) + +The docstring mentions "Bolan and Tang have independently proved that..." but does not provide the above links or formal references. Since these are the proofs of the *exact statement being formalized*, they should ideally be cited more precisely. + +Additionally, Guy, R. K. lists this as problem E31 in *Unsolved Problems in Number Theory*, which the OEIS page references but is not mentioned in the formalization. + +## 3. Variants + +The formalization captures: **a(n) − n → ∞** (equivalently, infinitely many positive integers are not in the range of the sequence). + +**Missing variant:** Bolan and Tang also proved that **a(n) − n is nondecreasing**, which is a distinct and stronger structural property mentioned on the website. This could be formalized as: +``` +theorem erdos_423_nondecreasing : + ∀ a : ℕ → ℕ, IsHofstadterSeq a → + ∀ n m : ℕ, n ≤ m → a n - n ≤ a m - m +``` + +**Open variant:** The full problem as stated by Erdős asks "What is the asymptotic behaviour of this sequence?" which remains open. The OEIS page asks "Is there an estimate for a(k)/k?" This broader question is not formalizable without a conjectured answer, so its omission is justified. + +**Not formalized but potentially useful:** +- Existence and uniqueness of the Hofstadter sequence (the formalization universally quantifies over all sequences satisfying `IsHofstadterSeq`, which is mathematically sound but does not assert that such a sequence exists or is unique). + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good:** The `IsConsecutiveBlockSum` predicate is cleanly separated from `IsHofstadterSeq`, making both definitions easier to understand independently. +- **Good:** The docstrings include LaTeX-formatted mathematical descriptions that closely mirror the original problem statement. +- **Good:** The namespace `Erdos423` avoids polluting the global scope. +- **Minor:** The docstring on `IsConsecutiveBlockSum` says "using indices from {1, …, k − 1}" which corresponds to the constraint `j + 1 ≤ k` (i.e., `j ≤ k − 1`). This is correct but requires a moment's thought — the "+1" encoding of "≤ k−1" via "j+1 ≤ k" is idiomatic in Lean/natural number arithmetic but slightly less transparent than the mathematical description. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The specific result formalized (a(n) − n → ∞) is a precise, unambiguous mathematical statement. The greedy construction of the sequence is well-defined: at each step, "the least integer > a(k−1) which is a sum of at least two consecutive terms" is unambiguous (assuming such an integer exists, which it does since a(k−2) + a(k−1) is always a valid candidate for k ≥ 3). + +The broader Erdős question ("What is the asymptotic behaviour?") is intentionally vague and not directly formalizable — this is a feature of the original problem, not a defect of the formalization. + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +Detailed verification: + +1. **`IsConsecutiveBlockSum a k m`**: Requires indices `i, j` with `1 ≤ i`, `i + 1 ≤ j` (at least two terms), `j + 1 ≤ k` (indices within {1, ..., k−1}), and `m = ∑ l ∈ Finset.Icc i j, a l`. This correctly captures "m is the sum of at least two consecutive terms from a(1), ..., a(k−1)." + + - **Verification against known values:** For k=3: i=1, j=2, sum = a(1)+a(2) = 1+2 = 3. ✓ For k=4: possible sums are {3, 5, 6}; least > 3 is 5 = a(2)+a(3). ✓ For k=5: adding a(4)=5, possible sums include 6 = a(1)+a(2)+a(3); least > 5 is 6. ✓ This matches OEIS A005243: 1, 2, 3, 5, 6, ... + +2. **`IsHofstadterSeq a`**: Correctly encodes a(1)=1, a(2)=2, and for k≥3: a(k) is a consecutive block sum, a(k) > a(k−1), and no integer between a(k−1) and a(k) is a consecutive block sum (minimality). This precisely characterizes the greedy sequence. + +3. **`erdos_423`**: States `∀ M : ℕ, ∃ N : ℕ, ∀ n : ℕ, N ≤ n → M + n ≤ a n`, which is exactly the assertion that a(n) − n → ∞ in the sense of natural numbers (for every M, eventually a(n) ≥ n + M). This is the correct formalization of the Bolan–Tang result. + +4. **Category tag**: `category research solved` — this is accurate for the specific statement formalized (proved by Bolan and Tang), even though the full asymptotic question remains open. + +**Observation on "at least two" vs "at least one":** The constraint `i + 1 ≤ j` enforces sums of ≥2 consecutive terms, matching the problem statement. Notably, relaxing this to allow single-term sums would not change the sequence, since any single-term sum a(i) satisfies a(i) ≤ a(k−1), and we require the new term to be > a(k−1). The formalization correctly follows the problem's stated convention. + +**No mathematical flaws identified.** diff --git a/ai-review/425.md b/ai-review/425.md new file mode 100644 index 0000000000..130f7dee89 --- /dev/null +++ b/ai-review/425.md @@ -0,0 +1,115 @@ +# AI Review: Erdős Problem 425 + +**File:** `FormalConjectures/ErdosProblems/425.lean` + +--- + +## 1. Code Reuse + +**Additive Sidon sets:** `FormalConjecturesForMathlib/Combinatorics/Basic.lean` defines `IsSidon` for additive Sidon sets. Problem 425's `IsMultB2` is the multiplicative analogue. These are structurally different enough (additive vs. multiplicative, `Set` vs. `Finset`, commutativity handling) that reuse is not practical. Defining a local `IsMultB2` is appropriate. + +**`sSup` pattern:** The `multB2MaxSize` definition uses the same `sSup {k | ∃ A, ...}` pattern found in Problems 793 (`primitiveLikeMaxSize`) and 795 (`maxDistinctProductSetSize`). This is an established and consistent pattern across the codebase. No shared abstraction exists, but the duplication is acceptable since each problem has different constraints. + +**Prime counting:** Problem 425 correctly uses `Nat.primeCounting` from Mathlib rather than defining a local version (as Problem 795 does with its own `primeCounting`). This is the preferred approach. + +**Problem 793 parallel:** Problem 793 has a nearly identical structure — it asks whether `(F(n) - π(n)) / (error term)` converges to a positive constant, just with a different combinatorial property (`IsPrimitiveLike`) and different exponents (`n^(2/3) / (log n)^2`). Problem 793's docstring even says "See also problem #425." No code is directly reusable, but the structural consistency is good. + +**`IsMultBr` and Problem 786:** Problem 786 defines `Set.IsMulCardSet` which tests whether two finsets with equal `Finset.prod id` have equal cardinalities — a related but distinct concept. Problem 425's `IsMultBr` (equal products ⟹ equal subsets, for fixed-size subsets) is the correct definition for r-fold multiplicative Sidon sets and cannot be replaced by 786's definition. + +**Verdict:** No significant reuse opportunities missed. The local definitions are appropriate. + +--- + +## 2. Citations + +The formalization cites only: +> [Er68] Erdős, P., *On some properties of prime factors of integers*. Nagoya Math. J. (1968). + +The [erdosproblems.com/425](https://www.erdosproblems.com/425) page lists the following references: +- [Er68], [Er69], [Er70b], [Er73], [Er77c], [Er80], [ErGr80] + +**Issue:** The formalization is missing six references. At minimum, [ErGr80] (Erdős–Graham, which likely contains the generalization to r-fold products) should be cited since the formalization includes the r-fold variant. The other references ([Er69], [Er70b], [Er73], [Er77c], [Er80]) represent the evolution of Erdős's work on this problem and should ideally be listed for completeness, even if only the shorthand codes are available from the website. + +--- + +## 3. Variants + +The formalization captures two parts: +1. **Main conjecture** (`erdos_425`): Whether `(F(n) - π(n)) / (n^{3/4} / (log n)^{3/2})` converges to a positive constant. +2. **r-fold generalization** (`erdos_425.variants.part2`): Upper bound `|A| ≤ π(n) + O(n^{(r+1)/(2r)})` for r-multiplicative Sidon sets. + +**Missing variant — real number analogue:** The website describes an additional variant: for `A ⊂ [1, x]` (reals) where `|ab − cd| ≥ 1` for distinct `a, b, c, d ∈ A`, Erdős conjectured `|A| = o(x)`. This was **disproved** by Alexander, who showed `|A| ≫ x` is achievable. Since this variant has been resolved (negatively), it is less critical to formalize, but mentioning it in the docstring would improve completeness. + +**Missing variant — lower bound for r-fold:** The formalization only captures the upper bound side of the r-fold generalization. Whether a matching lower bound `|A| ≥ π(n) + Ω(n^{(r+1)/(2r)})` is conjectured is not addressed. + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Docstrings** are thorough and include LaTeX-formatted mathematical statements. +- **Naming** is clear: `IsMultB2`, `IsMultBr`, `multB2MaxSize` are descriptive. +- **Minor suggestion:** The bound constraint `∀ x ∈ A, 1 ≤ x ∧ x ≤ n` in `multB2MaxSize` could be documented as meaning `A ⊆ {1, …, n}`. This is clear from context but worth a brief note since it excludes 0 (important for multiplicative problems where 0 would trivially collapse products). +- **Namespace** `Erdos425` cleanly scopes the definitions. + +Overall readability is good. No significant improvements needed. + +--- + +## 5. Formalizability + +**Main conjecture (`erdos_425`):** The statement is precise and unambiguous. The question "does the ratio converge to a positive constant?" translates cleanly to `∃ c > 0, Tendsto ... (nhds c)`. **Fully formalizable.** + +**r-fold variant (`erdos_425.variants.part2`):** The statement "is `|A| ≤ π(n) + O(n^{(r+1)/(2r)})`?" is made precise by introducing an explicit constant C > 0 and requiring the bound for all n. This is the standard way to formalize O-notation upper bounds. **Fully formalizable.** + +**`IsMultBr` definition:** The use of `Finset.prod id` on subsets of fixed cardinality r is clean. The definition correctly captures "any two r-element subsets with equal products must be identical." **No ambiguity.** + +**`IsMultB2` vs `IsMultBr 2` equivalence:** These are provably equivalent (the ordered-pair formulation in `IsMultB2` corresponds to unordered 2-element subsets in `IsMultBr 2`). The formalization does not state this equivalence, which is fine since it's not needed for the problem statement. + +**Overall assessment:** Low ambiguity. The problem is well-suited to formalization. + +--- + +## 6. Correctness + +### `IsMultB2` — Correct +The definition states: for all `a, b, c, d ∈ A` with `a < b` and `c < d`, if `a * b = c * d` then `a = c ∧ b = d`. This correctly captures that all pairwise products of distinct elements are distinct. The strict inequality `a < b` appropriately excludes squares (products `a * a`), consistent with the problem statement "products ab for a < b." + +### `IsMultBr` — Correct +For r-element subsets S, T ⊆ A: if `S.prod id = T.prod id` then `S = T`. This correctly generalizes the B₂ property to r-fold products. Using `Finset.prod id` on natural numbers is appropriate since elements are ≥ 1. + +### `multB2MaxSize` — Correct with caveat +Uses `sSup` on `ℕ`. The set `{k | ∃ A, IsMultB2 A ∧ ... ∧ A.card = k}` is: +- **Nonempty:** The empty set is a multiplicative B₂ set with cardinality 0. +- **Bounded above:** Any `A ⊆ {1, …, n}` has `|A| ≤ n`. + +Since `ℕ` has a `ConditionallyCompleteLattice` instance where `sSup` of a nonempty bounded set gives the actual supremum, this correctly computes the maximum. No issues. + +### `erdos_425` — Correct +The Tendsto statement correctly formalizes: "does there exist c > 0 such that (F(n) − π(n)) / (n^{3/4} / (log n)^{3/2}) → c?" + +**Division by zero:** For small n where `log(n) = 0` (n = 0 or 1), the denominator is 0, making the expression `0 / 0 = 0` by Lean's convention. This does not affect correctness since `Tendsto ... atTop ...` only depends on the function's behavior for sufficiently large n. + +**Use of `answer(sorry)`:** Correct — the problem is open, so the truth value is unknown. + +### `erdos_425.variants.part2` — Minor issue + +**Mathematical content is correct:** The bound `|A| ≤ π(n) + C · n^{(r+1)/(2r)}` for all r-multiplicative Sidon sets A ⊆ {1,…,n} is a faithful formalization of the O-notation bound. + +**Missing `answer(sorry)` wrapper:** The variant is stated as a bare `theorem` without an `answer(sorry)` wrapper. However, based on the website, this is posed as a *question* ("must |A| ≤ π(n) + O(n^{(r+1)/(2r)})?"), not as a known result. If this bound is unproven, the statement should use `answer(sorry)` to indicate the answer is unknown, just as the main conjecture does. If it is in fact a known result (e.g., proven by Erdős), then the current formulation is fine but the docstring should cite the proof. + +**Missing logarithmic factor:** For r = 2, the main conjecture establishes the precise error term as `n^{3/4} / (log n)^{3/2}`. The variant's exponent `(r+1)/(2r)` gives `3/4` when `r = 2`, but without the `(log n)^{-3/2}` factor. This is consistent with the website's formulation, which only asserts the polynomial rate `O(n^{(r+1)/(2r)})` for general r. However, it means the variant is weaker than the main conjecture when specialized to r = 2. This is mathematically correct but worth noting. + +### Summary of Correctness Issues + +| Item | Status | +|------|--------| +| `IsMultB2` definition | ✅ Correct | +| `IsMultBr` definition | ✅ Correct | +| `multB2MaxSize` definition | ✅ Correct | +| `erdos_425` main conjecture | ✅ Correct | +| `erdos_425.variants.part2` math | ✅ Correct | +| `erdos_425.variants.part2` wrapper | ⚠️ Likely needs `answer(sorry)` if this bound is conjectured rather than proven | +| Missing real-number variant | ℹ️ Not captured (disproved, so lower priority) | +| Citations | ⚠️ Incomplete — 6 of 7 references missing | diff --git a/ai-review/426.md b/ai-review/426.md new file mode 100644 index 0000000000..12d54c9c9f --- /dev/null +++ b/ai-review/426.md @@ -0,0 +1,115 @@ +# AI Review: Erdős Problem 426 + +## 1. Code Reuse + +The definitions in 426.lean (`SubgraphIsomorphic`, `IsUniqueSubgraph`, `numUniqueSubgraphs`, `maxUniqueSubgraphs`) are all novel and not duplicated elsewhere in the codebase. No existing definitions in `FormalConjecturesForMathlib/` directly apply. + +However, there are related patterns worth noting: + +- **Problem 1036** (`FormalConjectures/ErdosProblems/1036.lean`) deals with counting non-isomorphic induced subgraphs using `≃g`, but operates on induced subgraphs (via `G.induce`) rather than general subgraphs (via `G.Subgraph`). The two problems use fundamentally different notions—1036 counts pairwise non-isomorphic induced subgraphs while 426 counts "unique" subgraphs (those with a single representative in their isomorphism class among all subgraphs of G). + +- **Problem 638** (`FormalConjectures/ErdosProblems/638.lean`) defines `FinGraphIso` and `inducedFinSubgraph` for working with graph isomorphisms on finite types. These are not directly applicable since 426 works with `G.Subgraph` and its `.coe` coercion. + +- The `sSup` pattern used in `maxUniqueSubgraphs` is standard across the codebase (see e.g., `Definitions.lean`, `Invariants.lean` in `FormalConjecturesForMathlib/`). + +**Verdict:** No obvious code reuse opportunities. The definitions are appropriately scoped to this problem. + +## 2. Citations + +The formalization includes three citation tags: `[EnEr72]`, `[Br75]`, and `[BrCh24]`. + +Comparing against [erdosproblems.com/426](https://www.erdosproblems.com/426): + +- **[EnEr72]** — Listed as "Erdős, P. and Entringer, R. C. (1972)." The Lean file omits the paper title and journal. The full reference should be: Erdős, P. and Entringer, R. C., "On the number of unique subgraphs of a graph," *J. Combin. Theory Ser. B* 13 (1972), no. 2, 112–117 (if available from the website). Currently the citation is incomplete—only author and year are given. + +- **[Br75]** — Listed as "Brouwer, A. E. (1975)." Similarly lacks title and journal details. + +- **[BrCh24]** — Listed as "Bradač, D. and Christoph, M. (2024)." Similarly incomplete. + +- **Missing citation:** The website mentions **Harary and Schwenk (1973)** as having improved the Erdős–Entringer result. This intermediate result is omitted from the Lean file's docstring entirely. + +**Verdict:** Citations are present but incomplete (no titles/journals). One intermediate reference (Harary–Schwenk 1973) is missing. The shorthand format `[EnEr72]` etc. should ideally be expanded with titles and publication venues to match the detail level seen in other problems (e.g., 1036.lean includes paper titles and journal names). + +## 3. Variants + +The problem as described on the website is essentially a single question: can $f(n) \gg 2^{\binom{n}{2}}/n!$ be achieved? The formalization captures the resolved version: $f(n) = o(2^{\binom{n}{2}}/n!)$. + +**Potential missing variants:** + +- **Quantitative bound:** The docstring mentions the quantitative refinement that the $o(1)$ factor is $O(\log\log\log n / \log\log n)$, but this is not formalized as a separate theorem. One could formalize a stronger statement with an explicit rate, e.g., that $f(n) \leq C \cdot (\log\log\log n / \log\log n) \cdot 2^{\binom{n}{2}} / n!$ for some constant $C$ and large $n$. + +- **Lower bound (Brouwer's construction):** The problem has a companion lower bound—Brouwer showed $f(n) \gg 2^{\binom{n}{2} - O(n)} / n!$. This is mentioned in the docstring but not formalized. Formalizing this would capture both sides of the story. + +**Verdict:** The main resolved statement is captured. The quantitative refinement and the lower bound are natural companion statements that could be formalized as separate theorems but their omission is acceptable given the problem focuses on the asymptotic question. + +## 4. Readability + +The code is well-structured and readable: + +- The helper definitions (`SubgraphIsomorphic`, `IsUniqueSubgraph`, `numUniqueSubgraphs`, `maxUniqueSubgraphs`) build up the formalization incrementally with clear docstrings. +- The namespace `Erdos426` prevents name collisions. +- The main theorem docstring provides excellent mathematical context including the history and resolution. + +**Minor suggestions:** + +- The docstring for `SubgraphIsomorphic` says "coerced graphs (viewed as simple graphs on their respective vertex subtypes)" which is accurate but could simply say "underlying simple graphs" for brevity. +- The definition `numUniqueSubgraphs` requires `G : SimpleGraph (Fin n)` which pins the vertex type to `Fin n`. This is a reasonable choice for counting but slightly limits generality. The alternative would be a universe-polymorphic version, but for a concrete counting problem this is fine. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem statement is quite precise: "unique subgraph" has a clear combinatorial meaning (a subgraph $H$ of $G$ such that $H$ is the only subgraph of $G$ isomorphic to $H$), $f(n)$ is well-defined as a maximum over finite graphs, and the asymptotic claim $f(n) = o(2^{\binom{n}{2}}/n!)$ is standard. + +**Ambiguity considerations:** + +- **"Subgraph" vs "induced subgraph":** The Erdős problem refers to subgraphs (not necessarily induced). The formalization uses `G.Subgraph` from Mathlib, which represents a subgraph as a subset of vertices and a subset of edges (with edges restricted to the edge set of G). This correctly captures "subgraph" in the graph-theoretic sense (not just induced subgraph). This is the right choice. + +- **"Unique" meaning:** A subgraph $H$ is "unique" if there is exactly one way to find it. The formalization interprets "one way" as: $H$ is the only subgraph of $G$ in its isomorphism class. This means $H' \cong H \implies H' = H$, which is the definition used. This correctly captures the notion—if there were two distinct subgraphs isomorphic to $H$, then $H$ would not be unique. + +- **Equality of subgraphs:** The condition `H' = H` uses Lean's propositional equality on `G.Subgraph`. Two subgraphs are equal iff they have the same vertex set and edge set. This is the correct notion—two "copies" of $H$ in $G$ that use different vertex/edge subsets are distinct subgraphs. + +**Verdict:** The problem is clearly formalizable with low ambiguity. The formalization makes correct choices on the key definitions. + +## 6. Correctness + +**The main theorem statement:** + +```lean +theorem erdos_426 : + Filter.Tendsto + (fun n : ℕ => + (maxUniqueSubgraphs n : ℝ) / + ((2 : ℝ) ^ (n.choose 2) / (Nat.factorial n : ℝ))) + Filter.atTop + (nhds 0) +``` + +This states that `maxUniqueSubgraphs n / (2^(n choose 2) / n!)` tends to 0 as $n \to \infty$, i.e., $f(n) = o(2^{\binom{n}{2}} / n!)$. This is mathematically correct and matches the Bradač–Christoph result. + +**Potential issues:** + +1. **`sSup` on potentially empty or unbounded sets:** The definition `maxUniqueSubgraphs n` uses `sSup` on `{k : ℕ | ∃ G : SimpleGraph (Fin n), numUniqueSubgraphs G = k}`. For `ℕ` with its `ConditionallyCompleteLattice` instance, `sSup` of an unbounded set returns 0 (or behaves as junk). However, for any fixed $n$, the number of subgraphs of any graph on `Fin n` is finite (bounded by $2^{n + \binom{n}{2}}$), so `numUniqueSubgraphs G` is bounded. But `Set.ncard` returns a natural number for any set (returning 0 for infinite sets), and the set `{k | ∃ G, numUniqueSubgraphs G = k}` is nonempty (take the empty graph) and bounded above. So `sSup` is well-behaved here. **No issue.** + +2. **`Set.ncard` for potentially infinite sets:** `numUniqueSubgraphs` uses `Set.ncard` on `{H : G.Subgraph | IsUniqueSubgraph H}`. For `G : SimpleGraph (Fin n)`, the type `G.Subgraph` is a subtype involving `Fin n` vertices and edges, which is a finite type. So this set is finite and `Set.ncard` returns the correct count. **No issue.** + +3. **Division by zero:** When $n = 0$ or $n = 1$, $n! = 1$ and $\binom{n}{2} = 0$, so the denominator is $2^0 / 1 = 1$. The ratio is well-defined. For general $n$, $n! > 0$ and $2^{\binom{n}{2}} > 0$, so division is fine in $\mathbb{R}$. **No issue.** + +4. **Filter.Tendsto to nhds 0:** This is the standard way to express $f(n)/g(n) \to 0$ in Mathlib, which is exactly $f(n) = o(g(n))$. **Correct.** + +5. **The problem is marked as "Disproved":** The docstring says "Erdős Problem 426 (Disproved)" and the attribute says `solved`. The problem asked whether $f(n) \gg 2^{\binom{n}{2}}/n!$ is achievable, and the answer is no. The theorem formalizes the negative answer. The category tag `research solved` is appropriate. **Correct.** + +6. **Subgraph isomorphism definition:** `SubgraphIsomorphic` uses `Nonempty (H₁.coe ≃g H₂.coe)`. The `.coe` of a subgraph gives the simple graph on the vertex subtype (vertices in the subgraph's vertex set, with adjacency inherited from the subgraph's edge set). The `≃g` is a graph isomorphism (bijection on vertices preserving adjacency). This correctly captures when two subgraphs are isomorphic as abstract graphs. **Correct.** + +**Verdict:** The formalization is mathematically correct and complete. The definitions correctly capture the intended combinatorial notions, and the theorem statement accurately formalizes $f(n) = o(2^{\binom{n}{2}}/n!)$. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code Reuse | No reuse opportunities; definitions are appropriately novel | +| Citations | Incomplete (missing titles/journals); one reference (Harary–Schwenk 1973) omitted | +| Variants | Main result captured; quantitative bound and lower bound not formalized (acceptable) | +| Readability | Good | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/429.md b/ai-review/429.md new file mode 100644 index 0000000000..0adb0d7fb0 --- /dev/null +++ b/ai-review/429.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 429 + +## 1. Code Reuse + +The `CoveringSystem` structure in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` is conceptually adjacent — it formalizes covering all residue classes via cosets of ideals. The admissibility condition in Problem 429 is essentially the *negation* of a covering system: an admissible set is one that does **not** cover all residue classes mod any prime. However, the CoveringSystem abstraction operates over ideals of a general commutative semiring, while Problem 429 uses the more direct `ZMod p` formulation. The existing formalization's approach (`∃ r : ZMod p, ∀ a ∈ A, (a : ZMod p) ≠ r`) is idiomatic and simpler than routing through `CoveringSystem`. No rewrite for code reuse is recommended. + +Other ErdosProblems files (e.g., 475, 476, 540, 541) use `ZMod p` in similar ways but none define a reusable "admissible set" predicate. If multiple problems required this concept, extracting a shared `IsAdmissible` definition could be worthwhile, but for a single problem it is unnecessary. + +**Verdict: No actionable code reuse opportunity.** + +## 2. Citations + +The website [erdosproblems.com/429](https://www.erdosproblems.com/429) lists: + +- **Original source:** [ErGr80, p.85] — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980), p. 85. +- **Resolution:** [We24] — Weisenberg, D., *Sparse Admissible Sets and a Problem of Erdős and Graham*. Integers, 24 (2024). arXiv: 2405.12310. + +The current formalization cites: + +> `[We24] Weisenberg, *A counterexample to Erdős' conjecture on sparse sets and primes*, 2024.` + +**Issue:** The cited title is incorrect. The actual paper title is *"Sparse Admissible Sets and a Problem of Erdős and Graham"*, not *"A counterexample to Erdős' conjecture on sparse sets and primes"*. The author's first name (Desmond) and journal (Integers, 24) are also missing. + +Additionally, the original source [ErGr80, p.85] is not cited in the formalization, though it is referenced on the website. Other files in this codebase (e.g., 462.lean, 294.lean) consistently include the full [ErGr80] citation when it is relevant. + +**Recommended citation block:** +``` +[ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number +theory*. Monographies de L'Enseignement Mathématique (1980), p. 85. + +[We24] Weisenberg, D., *Sparse Admissible Sets and a Problem of Erdős and Graham*. Integers, 24 (2024). +``` + +## 3. Variants + +The problem as stated on erdosproblems.com asks about sets that are "sparse enough" — this is intentionally vague in Erdős's original formulation. The formalization interprets "sparse enough" as simply "infinite," which is a reasonable lower bound on what Erdős may have meant (any finite admissible set trivially has a translate in the primes by Dirichlet/Green-Tao type results, so the interesting case is infinite sets). + +One could consider additional variants: +- **Density conditions**: Requiring the set to have zero asymptotic density, or to be sparser than any prescribed growth rate. Weisenberg's result shows the answer is negative even for sets growing arbitrarily sparsely, so `Set.Infinite` already captures the strongest negative result. +- **Translate domain**: The formalization uses `n : ℕ` for the translate. The original problem says "there exists some $n$" without specifying the domain. Using `n : ℤ` would be more general, but since `A ⊆ ℕ` and we need `n + a` to be a natural number for primality to apply, restricting to `n : ℕ` is a natural choice (it only makes the conjecture *easier* to satisfy, so disproving it with `n : ℕ` is actually stronger). This is fine. + +**Verdict: The single-theorem formalization adequately captures the problem. The choice of `Set.Infinite` for "sparse enough" is justified by Weisenberg's result.** + +## 4. Readability + +The code is well-structured and readable. The docstring clearly explains the problem, the notion of admissibility, and Weisenberg's resolution. Minor suggestions: + +- The module docstring says "We formalize the conjecture for infinite admissible sets $A \subseteq \mathbb{N}$" — this is clear and helpful. +- The inline formalization reads naturally: the three hypotheses (infinite, admissible, translate exists) are cleanly separated. + +**Verdict: Good readability. No changes needed.** + +## 5. Formalizability + +The problem is precise enough to be obviously formalizable. The key concepts — admissibility (avoiding at least one residue class mod every prime), infinite sets, and translates landing in the primes — all have direct Lean/Mathlib counterparts. There is minimal ambiguity: + +- "Sparse enough" is the only vague term in Erdős's original statement, and the formalization handles it by using `Set.Infinite`, which is the weakest reasonable interpretation (and sufficient for the negative answer). +- The admissibility condition is a standard notion in sieve theory with a precise definition. + +**Verdict: Low ambiguity. The formalization makes a clear, defensible choice for the one vague term.** + +## 6. Correctness + +The formalization is mathematically correct and complete: + +- **`answer(False)`**: Correct. Weisenberg proved the answer is no — there exist infinite admissible sets with no prime translate. The `answer(False)` correctly indicates the biconditional should be disprovable (i.e., the inner statement is false). +- **Admissibility condition**: `∀ p : ℕ, p.Prime → ∃ r : ZMod p, ∀ a ∈ A, (a : ZMod p) ≠ r` correctly states that for every prime p, some residue class mod p is entirely avoided by A. This is the standard definition. +- **Translate condition**: `∃ n : ℕ, ∀ a ∈ A, (n + a).Prime` correctly asks whether some translate of A lands entirely in the primes. +- **Quantifier structure**: The overall structure `∀ A, (infinite) → (admissible) → ∃ n, ...` correctly formalizes "every infinite admissible set has a prime translate." + +One subtlety worth noting: `(n + a).Prime` uses `Nat.Prime`, which excludes 0 and 1. Since `n + a ≥ n` for all `a ∈ A` with `A ⊆ ℕ`, and A is infinite, this means we need `n + a ≥ 2` for all relevant `a`, which is automatically satisfied for `n ≥ 2` or when `a ≥ 2`. This is not a problem for the formalization since we're asking for existence of such an `n`, and the negative answer makes this moot. + +**Verdict: The formalization is correct. No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code Reuse | No actionable opportunities | +| Citations | **Needs fix**: Wrong paper title for [We24]; missing [ErGr80] citation | +| Variants | Adequately captured | +| Readability | Good | +| Formalizability | Low ambiguity, clear choices | +| Correctness | Correct and complete | + +**Overall**: The formalization is mathematically sound and well-written. The only issue requiring attention is the incorrect citation for Weisenberg's paper. diff --git a/ai-review/43.md b/ai-review/43.md new file mode 100644 index 0000000000..2c9384eff1 --- /dev/null +++ b/ai-review/43.md @@ -0,0 +1,101 @@ +# Review: Erdős Problem 43 + +**File:** `FormalConjectures/ErdosProblems/43.lean` + +--- + +## 1. Code Reuse + +**Issue found.** The formalization defines its own `Erdos43.IsSidonSet` on `Finset ℕ`, but the codebase already provides `IsSidon` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 38), which is a generic definition on `Set α` with `[AddCommMonoid α]`. The two definitions are mathematically equivalent — the local one operates on `Finset ℕ` while the library one operates on `Set α`. The library version could be used via coercion (`(A : Set ℕ)`), and the file already contains a `Decidable` instance for `IsSidon` on `Finset` coercions (line 127). + +Similarly, `DisjointDifferences` is a standalone local definition. While there is no direct library equivalent for this specific predicate, defining it locally is reasonable since it is problem-specific. + +**Recommendation:** Replace `Erdos43.IsSidonSet` with the existing `IsSidon` from `FormalConjecturesForMathlib/Combinatorics/Basic.lean`, applied to the `Finset` coerced to a `Set`. This avoids definitional duplication and ensures consistency across the codebase. + +--- + +## 2. Citations + +The docstring references: + +> [Er95] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. Combinatorics, Paul Erdős is Eighty, Vol. 2 (1996), 1–25. + +This matches the citation listed on [erdosproblems.com/43](https://www.erdosproblems.com/43). The website also mentions the following which are not included in the formalization but may be useful as supplementary references: + +- OEIS sequences: A143824, A227590, A003022 +- Known partial results by Terence Tao (upper bound without the −c term) and Kevin Barreto (counterexample to the secondary question) + +**Recommendation:** The primary citation is correctly documented. Consider noting the OEIS sequences in a comment if desired, but this is minor. + +--- + +## 3. Variants + +**Missing variant.** The website lists a secondary question that is not captured: + +> For equal-sized sets (|A| = |B|), can the bound improve to: +> $$\binom{|A|}{2} + \binom{|B|}{2} \leq (1 - c + o(1))\binom{f(N)}{2}$$ +> for some constant $c > 0$? + +This variant is notable because it has been resolved negatively (Kevin Barreto showed that for infinitely many N, sets exist achieving $(1 - o(1))\binom{f(N)}{2}$). Since this variant is resolved, it could be formalized as a separate theorem (not an open problem). + +**Recommendation:** Add a formalization of the secondary question as a separate theorem, possibly marked `[category research solved]`. + +--- + +## 4. Readability + +The code is generally readable. Minor observations: + +- The docstrings are clear and well-written, with good mathematical notation. +- The constraint `∀ a ∈ A, 1 ≤ a ∧ a ≤ N` appears three times (for A, B, S) and could be abstracted into a predicate like `SubsetIcc A 1 N`, but this is a matter of taste and the current form is arguably more explicit. +- The maximality condition for S (`∀ T : Finset ℕ, IsSidonSet T → (∀ t ∈ T, 1 ≤ t ∧ t ≤ N) → T.card ≤ S.card`) is clear but verbose. The library provides `Set.IsMaximalSidonSetIn` (Basic.lean, line 104) which captures a related but different concept (inclusion-maximality, not cardinality-maximality). The formalization correctly uses cardinality-maximality, which is the right notion here. + +**Overall:** Good readability. No major issues. + +--- + +## 5. Formalizability + +The original problem involves the $O(1)$ notation, which requires interpretation. The formalization handles this well by introducing an explicit universal constant `C : ℕ` that does not depend on N, capturing the meaning of "bounded by a constant independent of N." + +The problem asks a yes/no question ("is it true that..."), which is appropriately captured by the `answer(sorry) ↔ ...` pattern. + +One subtlety: the problem as stated on the website is unambiguous in its primary formulation. The Sidon set condition, the disjoint differences condition, and the binomial coefficient inequality are all precisely defined. The only interpretive step is the $O(1)$ term, which is standard. + +**Assessment:** Low ambiguity. The formalization is a faithful interpretation of the problem statement. + +--- + +## 6. Correctness + +**6a. IsSidonSet definition (line 39–41):** +The definition states: for all a, b, c, d ∈ A, if a + b = c + d then (a = c ∧ b = d) ∨ (a = d ∧ b = c). This is the standard definition of a Sidon (B₂) set. ✓ + +**6b. DisjointDifferences definition (line 46–48):** +The definition states: for all a₁, a₂ ∈ A and b₁, b₂ ∈ B, if a₁ - a₂ = b₁ - b₂ (over ℤ) then a₁ = a₂ and b₁ = b₂. This correctly captures $(A - A) \cap (B - B) = \{0\}$: the only common difference is 0, which forces both sides to be trivial. The cast to ℤ is necessary since subtraction on ℕ is truncated. ✓ + +**6c. Theorem statement (lines 61–69):** + +- `∃ C : ℕ` — C is a universal constant (quantified before N). Using ℕ rather than ℤ is fine since the constant is an upper bound additive term (non-negative). ✓ +- `∀ N A B S` — The universal quantification over S as any maximum-cardinality Sidon set in {1,...,N} correctly captures f(N) without needing to define f explicitly. ✓ +- The maximality condition (line 67) ensures |S| = f(N). ✓ +- The conclusion `Nat.choose A.card 2 + Nat.choose B.card 2 ≤ Nat.choose S.card 2 + C` correctly formalizes $\binom{|A|}{2} + \binom{|B|}{2} \leq \binom{f(N)}{2} + O(1)$. ✓ +- The `answer(sorry)` wrapper correctly indicates this is an open problem whose truth value is unknown. ✓ + +**Potential concern:** The formalization uses `{1, ..., N}` (1-indexed) rather than `{0, ..., N-1}` or `{1, ..., N}` as a `Finset.range`. The constraint `1 ≤ a ∧ a ≤ N` is consistent with the problem statement. For N = 0, the sets are necessarily empty, which is a trivially true edge case. No issue here. + +**Verdict:** The formalization is mathematically correct and complete for the primary problem statement. The only gap is the missing secondary variant (see §3). + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `IsSidonSet` duplicates existing `IsSidon`; should reuse library definition | +| Citations | Primary citation correct; minor supplementary references could be added | +| Variants | Secondary question (equal-sized sets) is missing | +| Readability | Good | +| Formalizability | Low ambiguity; well-handled | +| Correctness | Correct and complete for the primary statement | diff --git a/ai-review/430.md b/ai-review/430.md new file mode 100644 index 0000000000..4141772fc5 --- /dev/null +++ b/ai-review/430.md @@ -0,0 +1,76 @@ +# Review: Erdős Problem 430 + +## 1. Code Reuse + +Several opportunities for reuse or alignment with existing codebase patterns: + +- **`Nat.Composite`** (`FormalConjecturesForMathlib/Data/Nat/Prime/Composite.lean:18`): The conjecture statement uses `2 ≤ seq n k ∧ ¬(seq n k).Prime` to express "a composite term exists." The codebase provides `Nat.Composite n` defined as `1 < n ∧ ¬n.Prime`. Since `2 ≤ m` iff `1 < m` for naturals, the condition is exactly `(seq n k).Composite`. Using this abbreviation would improve consistency with other Erdős problems (385, 462, 858, 463) that use the same predicate. + +- **Equivalence with Problem 385** (`FormalConjectures/ErdosProblems/385.lean`): The website notes (via Sarosh Adenwalla) that Problem 430 is *equivalent* to Problem 385. Problem 385 asks whether `F(n) = max{m + p(m) | m < n composite} > n` for sufficiently large `n`. A positive answer to 385 directly yields a composite term in the 430 sequence. The formalization of 430 does not reference or cross-link to 385. + +- **Sequence/greedy patterns**: The `nextTerm`/`seq` pattern (using `Finset.Ico`, `.filter`, `.max'`) is idiomatic and consistent with similar greedy sequence constructions in the codebase (e.g., Problems 340, 460, 282). + +## 2. Citations + +**Website citations for Problem 430:** +> Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +**Formalization citations:** +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The citation is correct and matches the website. The website additionally credits Sarosh Adenwalla for observing the equivalence with Problem 385, and notes Terence Tao marked the problem as "looks difficult." These attributions are informational and not strictly required in the formalization, but documenting the 385 equivalence would be valuable. + +## 3. Variants + +The formalization captures only the main conjecture. The website identifies one significant structural relationship: + +- **Equivalence with Problem 385**: The problems are equivalent. Problem 385 is formalized with three parts: (i) `F(n) > n` eventually, (ii) `F(n) - n → ∞`, and (iii) a lower bound variant `F(n) ≥ n + (1 - o(1))√n`. None of these connections are mentioned in the 430 formalization. At minimum, a docstring noting the equivalence would be appropriate. Ideally, a formal statement of the equivalence (e.g., `erdos_430_iff_385`) could bridge the two files. + +No other variants of Problem 430 appear on the website. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `nextTerm` states the equivalence `Nat.minFac m > n - m` ↔ `n < m + m.minFac`. This is a helpful clarification. However, the equivalence is only valid when `m ≥ 2` (since `minFac` returns 1 for `m ∈ {0, 1}`). Since the filter range is `Ico 2 prev`, this is indeed satisfied, but a brief note would add clarity. + +- Using `Nat.Composite` (as noted above) would make the final statement more immediately readable: `(seq n k).Composite` vs `2 ≤ seq n k ∧ ¬(seq n k).Prime`. + +- The namespace `Erdos430` is clean and self-contained. + +## 5. Formalizability + +**Assessment: Low ambiguity — clearly formalizable.** + +The problem statement is algorithmic in nature: it defines a concrete, deterministic sequence and asks a yes/no question about its terms. Every component is precisely specified: + +- The starting value `a_1 = n - 1` is unambiguous. +- "Greatest integer `m` in `[2, a_{k-1})` such that all prime factors of `m` are `> n - m`" is a well-defined finite optimization problem. +- "The sequence terminates when no such `m` exists" is a clear stopping condition. +- "Contains a composite number" is a standard predicate. + +The only minor source of ambiguity is whether the interval should be `[1, a_{k-1})` (as on the website) or `[2, a_{k-1})` (as in the formalization). This is mathematically inconsequential: `m = 1` has `minFac 1 = 1` in Mathlib, so the condition `n < 1 + 1` fails for all `n ≥ 2`, meaning `m = 1` is never selected regardless of the interval lower bound. + +## 6. Correctness + +**Assessment: Correct, with one subtlety worth noting.** + +### Core correctness + +The formalization faithfully captures the problem: + +1. **Sequence definition**: `seq n 0 = n - 1` correctly sets `a_1 = n - 1` (using 0-indexing). The recursive step via `nextTerm` correctly finds the greatest `m ∈ [2, prev)` satisfying the prime factor condition. + +2. **Prime factor condition**: The use of `n < m + m.minFac` as a proxy for "all prime factors of `m` are `> n - m`" is correct for `m ≥ 2`. For such `m`, `minFac m` is the smallest prime factor, so `minFac m > n - m` iff all prime factors are `> n - m` iff `n < m + minFac m`. + +3. **Termination encoding**: When no valid `m` exists, `nextTerm` returns 0. Subsequent calls to `nextTerm n 0` yield `Ico 2 0 = ∅`, so the filter is empty and 0 is returned again. The sequence stays at 0 forever after termination, which is correct. + +4. **Conjecture statement**: `∃ N, ∀ n ≥ N, ∃ k, 2 ≤ seq n k ∧ ¬(seq n k).Prime` correctly expresses "for sufficiently large `n`, the sequence contains a composite term." The `2 ≤ seq n k` clause correctly excludes the post-termination 0 values. + +### Subtlety: natural number subtraction + +The condition `n < m + m.minFac` avoids natural number subtraction pitfalls (since `n - m` could underflow for `m > n` in `ℕ`). The rearrangement is correct and well-motivated. However, since `m < prev ≤ n - 1 < n` throughout the active sequence, underflow would not actually occur in the mathematical domain — but the rearranged form is still cleaner in Lean. + +### No issues found + +The formalization is mathematically correct and complete for the stated problem. No flaws identified. diff --git a/ai-review/431.md b/ai-review/431.md new file mode 100644 index 0000000000..e862aefbff --- /dev/null +++ b/ai-review/431.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 431 + +## 1. Code Reuse + +The formalization uses `Set.image2 (· + ·) A B` for the sumset and `symmDiff` for the symmetric difference — both are Mathlib primitives. Problem 432 (`FormalConjectures/ErdosProblems/432.lean`) uses the same `Set.image2 (· + ·) A B` pattern for sumsets, so the convention is consistent across the codebase. No helper definitions from `FormalConjecturesForMathlib` are directly applicable here; the formalization is already using the most natural Mathlib constructs. There is no custom sumset definition in the codebase that should be preferred. + +**Verdict:** No code reuse issues. + +## 2. Citations + +The formalization references: +- `[ErGr80]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- `[ElHa15]` — Elsholtz, C. and Harper, A. J., *Additive decompositions of sets with restricted prime factors* (2015). +- `[El01]` — Elsholtz, C., *A remark on Hofmann's conjecture* (2001). + +The website (erdosproblems.com/431) lists the following additional sources not present in the formalization: +- **[Er61, p.225]** and **[Er77c]** as original sources. +- **Granville (1990):** Conditional on the prime k-tuples conjecture, infinite sets B and C exist where {(b+c)/2 : b ∈ B, c ∈ C} ⊂ primes. +- **Tao & Ziegler (2023):** Unconditionally proved infinite sets B and C exist where {b_i + c_j : i < j} ⊂ primes. + +The docstring also attributes the problem to Ostmann ("inverse Goldbach problem"), which is consistent with the website. The `[ErGr80]` reference in the formalization says just "(1980)" but the website specifies "p.85", matching the companion problem 432's docstring which says `[ErGr80, p.85]`. + +**Verdict:** Minor gaps. The `[ErGr80]` citation should include the page reference `p.85` for consistency with the website and with problem 432. The Granville (1990) and Tao–Ziegler (2023) results are notable omissions but are supplementary context rather than essential references. The original sources `[Er61]` and `[Er77c]` could be added for completeness. + +## 3. Variants + +The website mentions several related results that could constitute variant formalizations: + +1. **Elsholtz's three-set result [El01]:** No sets A, B, C (each of size ≥ 2) such that A + B + C agrees with primes up to finitely many exceptions. This is mentioned in the docstring but **not formalized** as a separate theorem. Given that this is a proven result (not a conjecture), it would be a natural companion theorem. + +2. **Elsholtz–Harper density bounds [ElHa15]:** If such A, B exist, then for large x: x^{1/2}/(log x · log log x) ≪ |A ∩ [1,x]| ≪ x^{1/2} · log log x. This is mentioned in the docstring but **not formalized**. This is also a proven conditional result. + +3. **Granville's conditional result (1990):** Under the prime k-tuples conjecture, infinite sets B, C exist with {(b+c)/2 : b ∈ B, c ∈ C} ⊂ primes. Not mentioned or formalized. + +4. **Tao–Ziegler (2023):** Unconditional existence of infinite sets B, C with {b_i + c_j : i < j} ⊂ primes. Not mentioned or formalized. + +**Verdict:** The core open problem is captured. The Elsholtz three-set result (which is a theorem, not a conjecture) would be a valuable variant to formalize. The density bounds from Elsholtz–Harper are technically formalizable but would require significant infrastructure for asymptotic notation. The Tao–Ziegler result is about a different structural condition (ordered sums rather than all pairwise sums) and is arguably a different problem. + +## 4. Readability + +The formalization is clean and concise: + +```lean +theorem erdos_431 : answer(sorry) ↔ + ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ + (symmDiff (Set.image2 (· + ·) A B) {n | n.Prime}).Finite := by + sorry +``` + +The `answer(sorry)` pattern is the standard idiom in this codebase for open problems whose expected answer (True or False) is unknown/unresolved. The docstring is well-written and provides good mathematical context. + +One minor readability suggestion: the expression `Set.image2 (· + ·) A B` could alternatively be written using the `A + B` notation if `Set.add` is imported (via `Pointwise`), but the current form is explicit and unambiguous. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem statement is precise and unambiguous: +- "Two infinite sets A and B of natural numbers" → `A B : Set ℕ`, `A.Infinite`, `B.Infinite` +- "The sumset A + B" → `Set.image2 (· + ·) A B` +- "Agrees with the set of prime numbers up to finitely many exceptions" → `(symmDiff ... ...).Finite` + +The use of `ℕ` (natural numbers) rather than `ℤ` (integers) is a choice worth examining. The original problem statement on erdosproblems.com says "sets A and B" without specifying natural numbers vs. integers. However, since primes are conventionally taken as natural numbers and the problem concerns additive decomposition of the primes (a subset of ℕ), restricting to ℕ is the standard interpretation. Over ℤ, one could trivially take A = {-1} ∪ {p+1 : p prime} and B = {1}, but these are both infinite only if A is, and A + B = {0} ∪ {p+2 : p prime} which doesn't equal the primes. Actually over ℤ the problem is essentially equivalent since negative elements would contribute non-prime (negative) sums, so restricting to ℕ is justified. + +One subtle point: the formalization uses `ℕ` which includes 0. This means A and B could contain 0. If 0 ∈ A and B is infinite, then B ⊆ A + B (up to finitely many exceptions, these would need to be prime). This is fine since 0 ∈ A just means A + B ⊇ B, which doesn't create issues for the formalization. The "up to finitely many exceptions" clause via `symmDiff` handles edge cases cleanly. + +**Verdict:** Highly formalizable. The statement is precise and the formalization faithfully captures it. No ambiguity concerns. + +## 6. Correctness + +The formalization correctly captures the mathematical content: + +- **Sumset definition:** `Set.image2 (· + ·) A B = {a + b | a ∈ A, b ∈ B}` — correct. +- **"Agrees up to finitely many exceptions":** `(symmDiff S T).Finite` means the sets S and T differ in only finitely many elements — this is the standard mathematical meaning. Correct. +- **Primality:** `{n | n.Prime}` is the set of prime natural numbers — correct. +- **Existential form with `answer(sorry)`:** The problem asks "are there such sets?" — the formalization encodes this as `answer(sorry) ↔ ∃ A B ...`, which is the correct pattern. The expected answer is "no" (as noted in the docstring), so `answer(sorry)` would resolve to `False`. +- **Infinite sets:** Both A and B are required to be infinite, matching the problem statement. This is important — without this condition, the problem is trivial (e.g., A = {2}, B = primes minus 2 gives A + B = primes shifted, which doesn't work, but A = {0}, B = primes works trivially). + +One mathematical subtlety: since the domain is `ℕ` and addition on `ℕ` is the standard one, `Set.image2 (· + ·) A B` correctly produces the sumset. There is no issue with overflow or truncation since `ℕ` addition is total. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ No issues — uses standard Mathlib constructs | +| Citations | ⚠️ Minor — `[ErGr80]` should include `p.85`; some supplementary references missing | +| Variants | ⚠️ The Elsholtz three-set theorem could be formalized as a companion | +| Readability | ✅ Clean and concise | +| Formalizability | ✅ Precise and unambiguous | +| Correctness | ✅ Mathematically correct and complete | + +**Overall:** This is a solid formalization. The main actionable items are (1) adding `p.85` to the `[ErGr80]` citation and (2) optionally formalizing the Elsholtz three-set result as a companion theorem. diff --git a/ai-review/432.md b/ai-review/432.md new file mode 100644 index 0000000000..3c31eb2281 --- /dev/null +++ b/ai-review/432.md @@ -0,0 +1,92 @@ +# Review: Erdos Problem 432 + +## 1. Code Reuse + +**Issue: Local `upperDensity` duplicates library definition.** + +The file defines its own `Erdos432.upperDensity` (line 39-40): +```lean +noncomputable def upperDensity (A : Set ℕ) : ℝ := + limsup (fun N : ℕ => ((Finset.range N).filter (· ∈ A)).card / (N : ℝ)) atTop +``` + +A general-purpose `Set.upperDensity` already exists in `FormalConjecturesForMathlib/Data/Set/Density.lean` (line 51-53), defined via `Set.partialDensity` and `Set.interIio`. Multiple other problems (335, 333, 342, 378, 656) similarly duplicate a local `upperDensity`. The library version is more general (works for any `Preorder` with `LocallyFiniteOrderBot`), and when specialized to `ℕ` with `A = Set.univ`, computes the same quantity. Consolidating to the library definition would reduce duplication. + +Additionally, the pairwise coprimality condition (line 53-54) could use `Set.Pairwise` from Mathlib: +```lean +(Set.image2 (· + ·) A B).Pairwise Nat.Coprime +``` +instead of the explicit double quantifier, which would be more idiomatic. + +## 2. Citations + +The formalization cites: +- `[ErGr80]` Erdos, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The [erdosproblems.com/432](https://www.erdosproblems.com/432) page lists: +- `[ErGr80, p.85]` as the source. + +The citation in the docstring matches the website. The page number `p.85` appears in the theorem docstring (line 44) but not in the module docstring reference block (line 27). Minor: consider adding the page number to the reference block for completeness. + +No additional references are listed on the website beyond `[ErGr80]`. + +## 3. Variants + +The website states: *"Let A, B ⊆ ℕ be two infinite sets. How dense can A+B be if all elements of A+B are pairwise relatively prime?"* + +This is an open-ended question asking for a characterization of the maximum possible density. The formalization interprets this as asserting the density must be zero. This is a reasonable and standard interpretation — the conjecture is that the answer to "how dense" is "not at all" (zero upper density). However, the original problem is technically more exploratory than what the formalization captures. + +No other variants are mentioned on the website. The connection to Problem 431 (Ostmann's inverse Goldbach problem) is documented in both the website and the formalization. + +## 4. Readability + +Generally good. Suggestions: + +- **Pairwise coprimality**: The double-quantifier form `∀ x ∈ S, ∀ y ∈ S, x ≠ y → Nat.Coprime x y` is correct but verbose. Using `Set.Pairwise Nat.Coprime` would be more concise and idiomatic: + ```lean + (h_coprime : (Set.image2 (· + ·) A B).Pairwise Nat.Coprime) + ``` + Note: `Set.Pairwise` takes arguments in the form `S.Pairwise R` where `R` is a relation on distinct elements, which is exactly the intended semantics. + +- **Sumset notation**: The use of `Set.image2 (· + ·) A B` is consistent with Problems 431, 333, and 335, so this is the established convention in the codebase. + +## 5. Formalizability + +**Assessment: Moderate ambiguity in the original statement.** + +The original problem asks "how dense can A+B be?" — this is not a precise yes/no question or a specific conjecture. It invites investigation rather than stating a claim. The formalization commits to the specific conjecture that the upper density is zero, which is mathematically natural (and likely the intended answer) but is an interpretive choice. + +The individual components are fully formalizable: +- "Infinite sets A, B ⊆ ℕ" — clear. +- "Sumset A + B" — clear. +- "Pairwise coprime" — clear (every pair of distinct elements has gcd 1). +- "Upper density" — standard definition. + +The only ambiguity is whether the problem asks to prove density zero, or to find the supremum of achievable densities (which might be zero but could conceivably be some explicit positive constant that is unachievable). The formalization chooses the former, which is the stronger and more natural conjecture. + +## 6. Correctness + +**The formalization is mathematically correct modulo the interpretive choice above.** + +Detailed analysis: + +- **Upper density definition**: The local `upperDensity` computes `lim sup_{N→∞} |A ∩ {0,...,N-1}| / N`. This is the standard upper asymptotic density. Correct. (Division by zero at N=0 yields 0 in Lean, which is harmless since limsup filters out finitely many terms.) + +- **Coprimality condition**: `Nat.Coprime x y` is `Nat.gcd x y = 1`. The condition correctly captures pairwise coprimality of all distinct elements. + +- **Edge case — 0 in the sumset**: Since `Nat.gcd 0 n = n`, if `0 ∈ A + B` then every other element must satisfy `gcd(0, y) = 1`, forcing `y = 1`. So the sumset could contain at most `{0, 1}`. But `A` and `B` infinite forces `A + B` infinite, so `0 ∉ A + B` in any valid instantiation. This is handled correctly by the constraints. + +- **Edge case — 1 in the sumset**: `Nat.Coprime 1 n` holds for all `n` since `gcd(1, n) = 1`. So 1 can appear in the sumset without additional constraints. This is mathematically correct. + +- **Conclusion**: The statement `upperDensity (Set.image2 (· + ·) A B) = 0` correctly formalizes the conjecture that pairwise coprime sumsets of infinite sets have zero upper density. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | Local `upperDensity` duplicates library definition; pairwise condition could use `Set.Pairwise` | +| Citations | Match the website; minor: add page number to reference block | +| Variants | The open-ended "how dense" question is interpreted as asserting zero density — reasonable but an interpretive choice | +| Readability | Good; minor improvements possible with `Set.Pairwise` | +| Formalizability | Moderate ambiguity in original; the formalization makes a natural interpretive commitment | +| Correctness | Correct. No mathematical flaws. Edge cases handled properly by the constraints | diff --git a/ai-review/433.md b/ai-review/433.md new file mode 100644 index 0000000000..bd9dc26a8d --- /dev/null +++ b/ai-review/433.md @@ -0,0 +1,104 @@ +# Review: Erdos Problem 433 + +## 1. Code Reuse + +**Issue: `Representable433` duplicates the concept from Problem 434's `Nat.IsRepresentableAs`.** + +Problem 433 defines (line 48–49): +```lean +def Representable433 (A : Finset ℕ) (m : ℕ) : Prop := + ∃ f : ℕ → ℕ, ∑ a ∈ A, f a * a = m +``` + +Problem 434 defines (line 34–35): +```lean +abbrev Nat.IsRepresentableAs (n : ℕ) (A : Set ℕ) := + ∃ (S : Multiset ℕ), (∀ a ∈ S, a ∈ A) ∧ S.sum = n +``` + +These are mathematically equivalent: both capture "m is a non-negative integer linear combination of elements of A (with repetition)." The 433 version uses a coefficient function, the 434 version uses a multiset. Neither is imported by the other. Problem 435 defines yet another local `BinomialRepresentable`. A shared definition could serve all three problems (433, 434, 435), though the different argument orders and the fact that 435 uses a specific basis (binomial coefficients) make a perfectly general shared definition somewhat awkward. + +Additionally, `FrobeniusNumber433` (line 54–55) is a standard and well-known concept. While no Frobenius number exists in Mathlib or `FormalConjecturesForMathlib` currently, defining it as a shared utility would benefit Problems 433, 434, and 435, which all deal with the Frobenius / coin problem family. + +No other `sSup {m : ℕ | ¬ ...}` patterns of this kind appear in the codebase outside of 433. + +## 2. Citations + +The formalization cites: +- `[Di90]` Dixmier, J., *Proof of a conjecture by Erdős and Graham concerning the problem of Frobenius*. J. London Math. Soc. (2) 41 (1990), 227–237. +- `[ErGr80]` Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The [erdosproblems.com/433](https://www.erdosproblems.com/433) page lists: +- The same Dixmier 1990 result as solving the problem. +- The same Erdős–Graham 1980 source. +- Additional context: Erdős and Graham (1980) themselves proved $g(k,n) < 2n^2/k$, and examples show $g(k,n) \geq n^2/(k-1) - 5n$ for $k \geq 2$. +- Dixmier additionally determined $g(k,n)$ exactly when $k-1$ divides $n$, $n-1$, or $n-2$. + +**The citations in the formalization match the website.** The formalization also includes Dixmier's explicit bounds in the module docstring, which is a nice touch. The website notes the additional exact results by Dixmier and the Erdős–Graham upper bound, which are not formalized (nor need they be for the main conjecture), but could be mentioned in the docstring for completeness. + +## 3. Variants + +The website states the problem as asking whether $g(k,n) \sim n^2/(k-1)$, which is exactly what the formalization captures. + +The website also mentions: +1. **Dixmier's explicit bounds**: $\lfloor(n-2)/(k-1)\rfloor(n-k+1) - 1 \leq g(k,n) \leq (\lfloor(n-1)/(k-1)\rfloor - 1)n - 1$. These are mentioned in the module docstring but not formalized as separate theorems. Since these bounds are a stronger result that implies the asymptotic, they could be valuable as standalone lemmas. +2. **Exact values**: Dixmier determined $g(k,n)$ exactly when $k-1 \mid n$, $k-1 \mid n-1$, or $k-1 \mid n-2$. Not mentioned in the formalization. +3. **Erdős–Graham bound**: $g(k,n) < 2n^2/k$ is not mentioned. + +The main asymptotic statement is the core conjecture and is correctly captured. The bounds and exact values are supplementary results that strengthen the main theorem. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- **Naming convention**: The `433` suffix on `Representable433`, `FrobeniusNumber433`, and `g433` is the project convention for avoiding name collisions across problem files. This is consistent with the codebase style. + +- **Docstrings**: All three definitions have clear, informative docstrings that correctly describe the mathematical objects. The module docstring provides good context including the Dixmier bounds. + +- **FrobeniusNumber433 edge case documentation**: The docstring notes "Equals 0 when every natural number is representable (e.g., when 1 ∈ A)." This is helpful and correct — `sSup ∅ = 0` in `ℕ` (since `⊥ = 0`), so the convention is sensible. + +- **The `open` statement** (line 42) opens `Finset BigOperators Filter Asymptotics`, which is appropriate for the definitions and theorem used. + +## 5. Formalizability + +**Assessment: Low ambiguity. The problem is precisely stated and clearly formalizable.** + +The original problem asks a specific yes/no question: is $g(k,n) \sim n^2/(k-1)$? All components are standard: +- **Frobenius number $G(A)$**: Well-defined for any finite set $A \subset \mathbb{N}$ with $\gcd(A) = 1$. It is a classical theorem that the Frobenius number exists (is finite) when $\gcd(A) = 1$. +- **$g(k,n) = \max G(A)$**: The maximum over a finite collection of sets, hence well-defined. +- **Asymptotic equivalence $\sim$**: Standard asymptotic notation. + +The only subtlety is that the problem implicitly requires $\gcd(A) = 1$ for the Frobenius number to be well-defined (otherwise every sufficiently large number is NOT representable). The formalization correctly includes this constraint. + +## 6. Correctness + +**The formalization is mathematically correct. No flaws identified.** + +Detailed analysis: + +- **`Representable433`** (line 48–49): `∃ f : ℕ → ℕ, ∑ a ∈ A, f a * a = m`. This correctly captures non-negative integer linear combinations. The sum is over the finite set `A`, and the coefficients `f a` are natural numbers (non-negative). Note that `0 ∈ A` would allow `f 0 * 0 = 0` terms that contribute nothing, which is harmless. The key mathematical property — that `m` is representable iff it lies in the numerical semigroup generated by `A` — is correctly captured. + +- **`FrobeniusNumber433`** (line 54–55): `sSup {m : ℕ | ¬ Representable433 A m}`. When `gcd(A) = 1`, the set of non-representable numbers is finite and nonempty (0 may or may not be representable depending on convention, but large enough numbers are always representable). The supremum of a finite nonempty subset of `ℕ` equals the maximum, so this correctly computes the Frobenius number. When `gcd(A) ≠ 1`, the set of non-representable numbers is infinite, and `sSup` on an unbounded set of `ℕ` yields `0` (since `ℕ` is not a conditionally complete lattice in the usual sense — `Nat.sSup` returns 0 for unbounded sets). However, this case is excluded by the `gcd = 1` constraint in `g433`, so it does not affect correctness. + + **Subtle point about 0**: Is 0 representable? With `f = 0` (the zero function), we get `∑ a ∈ A, 0 * a = 0`, so `Representable433 A 0` is always true. This means 0 is never in the set `{m | ¬ Representable433 A m}`, which is mathematically correct: the Frobenius number is conventionally defined over positive integers, and 0 is conventionally considered representable (as the empty sum). The formalization handles this correctly. + +- **`g433`** (line 59–60): `sSup (FrobeniusNumber433 '' {A : Finset ℕ | A ⊆ Icc 1 n ∧ A.card = k ∧ A.gcd id = 1})`. This takes the supremum of the image of `FrobeniusNumber433` over all valid sets `A`. Since `{A : Finset ℕ | A ⊆ Icc 1 n ∧ ...}` is a finite collection (subsets of a finite set), the image is finite, and `sSup` correctly computes the maximum. The constraint `A ⊆ Icc 1 n` correctly captures $A \subseteq \{1, \ldots, n\}$. The constraint `A.gcd id = 1` correctly captures $\gcd(A) = 1$ (the gcd of the elements of `A` under the identity function). + + **Note on `Finset.gcd id` for empty sets**: `Finset.gcd id ∅ = 0` in Lean/Mathlib convention. Since we require `A.card = k` and the theorem requires `2 ≤ k`, the set `A` is always nonempty, so this edge case is avoided. + +- **`erdos_433`** (line 68–73): The statement says `answer(True) ↔ ∀ k : ℕ, 2 ≤ k → (fun n => (g433 k n : ℝ)) ~[atTop] (fun n => (n : ℝ) ^ 2 / ((k : ℝ) - 1))`. This correctly formalizes "for any fixed $k \geq 2$, $g(k,n) \sim n^2/(k-1)$ as $n \to \infty$." The use of `~[atTop]` for asymptotic equivalence is the standard Mathlib notation. The cast to `ℝ` is necessary since asymptotic equivalence is defined on real-valued functions. The `answer(True)` indicates the problem is solved affirmatively (by Dixmier), which matches the website status. + + **Edge case — $k = 1$**: The theorem excludes $k = 1$ via `2 ≤ k`. This is correct: when $k = 1$, the only set $A$ with $|A| = 1$ and $\gcd(A) = 1$ is $A = \{1\}$, which has Frobenius number 0, making $g(1, n) = 0$ for all $n \geq 1$ — the asymptotic formula $n^2/0$ is undefined. + + **Edge case — small $n$ relative to $k$**: When $n < k$, there is no subset $A \subseteq \{1, \ldots, n\}$ with $|A| = k$, so the image set is empty and `g433 k n = sSup ∅ = 0`. Since the theorem is about asymptotic behavior as $n \to \infty$ (for fixed $k$), this affects only finitely many values of $n$ and does not impact the asymptotic statement. Correct. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | `Representable433` duplicates Problem 434's `Nat.IsRepresentableAs` (different encoding but same concept); a shared definition could serve 433/434/435 | +| Citations | Match the website accurately; Dixmier bounds included in docstring | +| Variants | Main asymptotic conjecture captured; Dixmier's explicit bounds and exact values are mentioned in docstring but not formalized (reasonable) | +| Readability | Clean and well-documented; follows codebase conventions | +| Formalizability | Low ambiguity — the problem statement is precise and directly formalizable | +| Correctness | **Correct.** All edge cases (0-representability, empty sets, small n, k=1 exclusion) are properly handled. The asymptotic statement faithfully captures the original conjecture and its resolution by Dixmier | diff --git a/ai-review/435.md b/ai-review/435.md new file mode 100644 index 0000000000..857e863709 --- /dev/null +++ b/ai-review/435.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 435 + +## 1. Code Reuse + +**Problem 433** (`FormalConjectures/ErdosProblems/433.lean`) defines a general `Representable433` and `FrobeniusNumber433` that are structurally very similar to `BinomialRepresentable` in Problem 435. Both define representability as a non-negative integer linear combination over a finite index set: + +- **433**: `∃ f : ℕ → ℕ, ∑ a ∈ A, f a * a = m` (generic finite set) +- **435**: `∃ c : ℕ → ℕ, m = ∑ i ∈ range (n - 1), c i * n.choose (i + 1)` (specific binomial set) + +In principle, `BinomialRepresentable n` could be expressed as `Representable433` applied to the multiset of interior binomial coefficients. However, 435's formulation uses indexed coefficients (one per position `i`, not per distinct value), which is slightly different—though mathematically equivalent since duplicate generators simply combine. The current standalone definition is reasonable given the index-based formula structure, but a shared `Representable` predicate in `FormalConjecturesForMathlib` could unify Problems 433, 434, 435, and 1110. + +The factorization utilities in `FormalConjecturesForMathlib/Data/Nat/Factorization/Basic.lean` are already used via `n.factorization.support` and `n.factorization p`. No additional utility code is needed. + +## 2. Citations + +The formalization references: +- `[ErGr80]` — Erdős and Graham, *Old and new problems and results in combinatorial number theory* (1980). ✅ Matches website. +- `[HwSo24]` — "Hwang, F. K. and Song, J. (2024)." ⚠️ **Incomplete.** No paper title is given. The website credits Hwang and Song as the first solvers but does not provide a full citation either. The review should note this is incomplete and attempt to locate the full reference if possible. +- Peake and Cambie mentioned as independent discoverers. ✅ Matches website. + +**Missing from formalization:** +- The website lists **Boris Alexeev, Stijn Cambie, Michael Peake** as additional contributors (via comments). +- The website references **OEIS A389479** as a related sequence. This could be noted in the docstring for cross-reference. + +## 3. Variants + +The problem as stated on the website asks to "find the largest integer not expressible as" the given linear combination, for n not a prime power. The formalization captures exactly this: it asserts `erdos435Formula n` is not representable and every larger natural number is representable. + +**No additional variants** appear on the website. The restriction `n ≥ 2` and `¬IsPrimePow n` correctly excludes prime powers (where gcd of the interior binomial coefficients may not be 1, so arbitrarily large non-representable numbers exist). The formalization appears complete in this regard. + +## 4. Readability + +The code is clean and well-structured. A few observations: + +- **Index shifting**: `range (n - 1)` with `c i * n.choose (i + 1)` is idiomatic for avoiding ℕ subtraction issues. This correctly ranges over interior binomial coefficients C(n,1) through C(n,n-1). Clear enough. +- **Formula definition**: `erdos435Formula` uses nested sums that mirror the mathematical notation well. The correspondence between the Lean code and the LaTeX in the docstring is easy to verify. +- **Naming**: `BinomialRepresentable` and `erdos435Formula` are descriptive. The namespace `Erdos435` prevents clashes. +- **Minor**: The docstring for `BinomialRepresentable` says "binomial coefficients C(n,i) for 1 ≤ i ≤ n−1" which matches the code. Good. + +Overall readability is **good**; no significant improvements needed. + +## 5. Formalizability + +The problem asks to "determine" a specific quantity—the largest non-representable number. Once the answer is known (provided by Hwang–Song), the statement becomes: "This specific formula gives the largest non-representable number." This is **fully precise and unambiguously formalizable**. + +The only potential ambiguity in the original Erdős–Graham statement is whether "not representable" means among natural numbers or non-negative integers, and whether the linear combination includes C(n,0) = C(n,n) = 1 or only interior coefficients. The formalization correctly restricts to interior coefficients (1 ≤ i ≤ n−1) and works over ℕ with non-negative coefficients, consistent with the standard interpretation. + +**Ambiguity level: Very low.** The formalization is well-determined. + +## 6. Correctness + +### Formula verification + +The `erdos435Formula` computes: +``` +(∑ p ∈ n.factorization.support, + (∑ d ∈ range (n.factorization p), n.choose (p ^ (d + 1))) * (p - 1)) - n +``` + +- **Inner sum**: `range (n.factorization p)` = {0, 1, ..., v_p(n)−1}, and `p ^ (d+1)` gives p¹, p², ..., p^{v_p(n)}. So the inner sum is ∑_{d=1}^{v_p(n)} C(n, p^d). ✅ Matches the stated formula. +- **Outer sum**: Over primes p dividing n (i.e., `n.factorization.support`). ✅ Correct. +- **Multiplier**: `(p - 1)` is safe since p ≥ 2 for all primes. ✅ +- **Final subtraction**: `- n` is ℕ subtraction. If the sum were < n, this would silently truncate to 0, and the theorem would become false (since 0 ∈ BinomialRepresentable for all n, via zero coefficients). This means proving the theorem necessarily requires establishing that the sum exceeds n for all valid inputs—which is mathematically true for non-prime-power n ≥ 2 (the smallest case n = 6 gives sum = 55 > 6). This is **not a bug** but is worth noting: the formula's well-definedness over ℕ is an implicit proof obligation. + +### Theorem statement verification + +`erdos_435` asserts two things: +1. `erdos435Formula n ∉ BinomialRepresentable n` — the formula value is not representable. +2. `∀ m : ℕ, m > erdos435Formula n → m ∈ BinomialRepresentable n` — every larger value is representable. + +This is the standard characterization of the Frobenius number for the numerical semigroup generated by the interior binomial coefficients. ✅ Mathematically correct formulation. + +### Hypotheses check + +- `hn : 2 ≤ n` — needed so that interior binomial coefficients exist (for n < 2, the set is empty or trivial). +- `hnpp : ¬IsPrimePow n` — needed because when n is a prime power p^k, all interior binomial coefficients C(n,i) for 1 ≤ i ≤ n−1 are divisible by p, so the generated semigroup is contained in pℕ and has infinitely many gaps. + +Both hypotheses are necessary and sufficient for the problem to be well-posed. ✅ + +### Potential concern + +The `BinomialRepresentable` definition allows coefficients `c : ℕ → ℕ` indexed by all of ℕ, but only uses `c i` for `i ∈ range (n-1)`. The extra values of `c` are irrelevant since the sum only ranges over `range (n-1)`. This is fine—it avoids needing a bounded function type. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could share a `Representable` predicate with Problem 433, but standalone definition is acceptable | +| Citations | `[HwSo24]` lacks paper title; OEIS A389479 not mentioned | +| Variants | Complete—no missing variants | +| Readability | Good; clean and idiomatic | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | Mathematically correct; ℕ subtraction well-definedness is an implicit (valid) proof obligation | + +**Overall: Sound formalization.** The main actionable items are completing the `[HwSo24]` citation and optionally noting the OEIS reference. diff --git a/ai-review/436.md b/ai-review/436.md new file mode 100644 index 0000000000..814c458aac --- /dev/null +++ b/ai-review/436.md @@ -0,0 +1,115 @@ +# AI Review: Erdős Problem 436 + +## 1. Code Reuse + +**Duplicate definition detected.** Problem 980 (`FormalConjectures/ErdosProblems/980.lean`) defines a closely related `IsKthPowerResidue` in namespace `Erdos980`: + +```lean +def IsKthPowerResidue (k p a : ℕ) : Prop := + ∃ b : ℕ, b ^ k % p = a % p +``` + +Problem 436 defines `IsKthPowerResidueMod` in namespace `Erdos436`: + +```lean +def IsKthPowerResidueMod (k : ℕ) (a : ℕ) (p : ℕ) : Prop := + ∃ x : ZMod p, x ^ k = (a : ZMod p) +``` + +These capture the same mathematical concept via different encodings (ℕ modular arithmetic vs. `ZMod`). A shared definition in `FormalConjecturesForMathlib` (e.g., under `NumberTheory/`) would eliminate duplication. The `ZMod` formulation (as in 436) is arguably more idiomatic for Lean 4 / Mathlib, since `ZMod p` carries ring structure directly. + +No existing Mathlib definition for generic k-th power residues was found; both problems define it from scratch. The `LambdaFinite` definition has no reuse candidate elsewhere in the codebase. + +## 2. Citations + +The docstring uses shorthand citation keys that do not appear on the website: + +| Docstring key | Likely reference | +|---|---| +| `[Hi91]` | Hildebrand (1991) — proved Λ(k,2) finite for all k ≥ 2 | +| `[Gr64g]` | Graham (1964) — proved Λ(k,ℓ) = ∞ for all k ≥ 2, ℓ ≥ 4 | +| `[LeLe62]` | Lehmer & Lehmer (1962) — proved Λ(k,3) = ∞ for all even k | + +The website does not provide these abbreviated keys. Full bibliographic entries should be added or the shorthand keys should be replaced with descriptive author–year references (e.g., "Hildebrand (1991)", "Graham (1964)", "Lehmer and Lehmer (1962)") to match the website's presentation style. + +Additional references from the website not mentioned in the formalization: +- Dunton — Λ(3,2) = 77 +- Bierstedt & Mills — Λ(4,2) = 1224 +- Lehmer, Lehmer, & Mills — Λ(5,2) = 7888, Λ(6,2) = 202124 +- Brillhart, Lehmer, & Lehmer — Λ(7,2) = 1649375 +- Lehmer, Lehmer, Mills, & Selfridge — Λ(3,3) = 23532 + +These are not strictly necessary for the formalization but could enrich the docstring. + +## 3. Variants + +The formalization includes **one** variant theorem: + +- `erdos_436.variants.hildebrand`: Λ(k,2) is finite for all k ≥ 2 ✓ + +**Missing variants** that could be formalized: + +1. **Graham's result**: Λ(k,ℓ) = ∞ for all k ≥ 2 and ℓ ≥ 4. This is mentioned in the docstring but not formalized. It would be expressed as `¬ LambdaFinite k m` for `k ≥ 2` and `m ≥ 4`. +2. **Lehmer–Lehmer result**: Λ(k,3) = ∞ for all even k ≥ 2. Also mentioned in the docstring but not formalized. This would be `¬ LambdaFinite k 3` for even `k ≥ 2`. +3. **Growth rate questions**: The website asks about growth rates of Λ(k,2) and Λ(k,3) as functions of k. These are not captured. +4. **Specific computed values** (Λ(3,3) = 23532, etc.) could be formalized as variant theorems establishing exact values, though this is less critical. + +The two results mentioned in the docstring (Graham and Lehmer–Lehmer) are arguably important enough to warrant their own variant theorems, since they establish the boundary conditions that make the k ≥ 5, odd case the *remaining* open question. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- **`k % 2 = 1`** for odd: Mathlib provides `Odd k` (defined as `∃ n, k = 2 * n + 1`), which would be more idiomatic. However, `k % 2 = 1` is unambiguous and may be simpler for proof automation. +- **Naming**: `IsKthPowerResidueMod` is descriptive but verbose. Something like `IsPowerRes` would be shorter but less clear; the current name is a reasonable trade-off. +- **Parameter order**: `IsKthPowerResidueMod k a p` places the modulus last, while `ZMod p` idiom suggests the modulus is a "type parameter." This is fine since the modulus varies in the quantifier. +- The docstring clearly explains the mathematical context and maps LaTeX notation to the formal definitions. + +Overall readability is **good**. + +## 5. Formalizability + +The problem is **highly formalizable** with **low ambiguity**. + +The mathematical objects are all precisely defined: +- k-th power residues modulo a prime are standard and unambiguous. +- The function r(k,m,p) (minimal starting point for m consecutive k-th power residues) is well-defined for each prime p, given the finite nature of ZMod p. +- Λ(k,m) = limsup_{p→∞} r(k,m,p) is a standard analytic definition. +- "Λ(k,3) is finite for all odd k ≥ 5" is a precise yes/no question. + +The only minor source of ambiguity is whether "k-th power residue" requires coprimality to p (i.e., excludes 0 mod p). In this formalization, since r ≥ 1 and r ≤ R with p sufficiently large, all values r, r+1, ..., r+m-1 are strictly between 0 and p, making the distinction moot. This is correctly handled. + +**Assessment: Unambiguous and fully formalizable.** + +## 6. Correctness + +### Definition: `IsKthPowerResidueMod` +**Correct.** The definition `∃ x : ZMod p, x ^ k = (a : ZMod p)` accurately captures that a is a k-th power residue mod p. For p prime and a not divisible by p, this is equivalent to the standard number-theoretic definition. + +### Definition: `LambdaFinite` +**Correct.** The statement: +``` +∃ R : ℕ, ∃ N : ℕ, ∀ p : ℕ, p.Prime → p > N → + ∃ r : ℕ, r ≥ 1 ∧ r ≤ R ∧ ∀ j : ℕ, j < m → IsKthPowerResidueMod k (r + j) p +``` +correctly captures that Λ(k,m) is finite. The limsup of r(k,m,p) being finite is equivalent to r(k,m,p) being eventually bounded, which is exactly what this states: there exists a bound R such that for all sufficiently large primes p, the minimal starting point for m consecutive k-th power residues is at most R. The existential quantification over r (rather than requiring minimality) is equivalent, since the existence of any r ≤ R implies r(k,m,p) ≤ R. + +The `r ≥ 1` constraint correctly excludes the trivial case where 0 is always a k-th power (0^k = 0). + +### Main theorem: `erdos_436` +**Correct.** The statement `∀ k : ℕ, 5 ≤ k → k % 2 = 1 → LambdaFinite k 3` precisely captures the open question: is Λ(k,3) finite for all odd k ≥ 5? The lower bound of 5 is correct because: +- k = 1 is trivial (every number is a 1st power residue) +- k = 2 is covered by Hildebrand's result (Λ(2,2) finite, but Λ(2,3) = ∞ since 2 is even — wait, actually Λ(2,3) = ∞ by Lehmer–Lehmer since 2 is even) +- k = 3 is odd and Λ(3,3) = 23532 (known finite, computed by Lehmer–Lehmer–Mills–Selfridge) + +So the genuinely open cases start at k = 5. The formalization is correct. + +**However**, note that k = 3 is also odd and ≥ 2, and Λ(3,3) is known to be finite. Since Λ(3,3) = 23532 is a computed result, the main theorem starting at k ≥ 5 implicitly treats k = 3 as known. If the answer to the open question is True, a stronger combined result for all odd k ≥ 3 would also hold. This is a minor observation, not a flaw — the formalization correctly isolates the *open* part. + +### Variant: `erdos_436.variants.hildebrand` +**Correct.** `LambdaFinite k 2` for `2 ≤ k` matches Hildebrand's theorem. + +### Use of `answer(sorry)` +**Correct.** The problem is open, so the truth value is unknown. The `answer(sorry)` wrapper with the `↔` correctly defers the answer. + +### Overall correctness: **Sound and complete for the stated scope.** No mathematical flaws detected. The formalization faithfully captures the open problem and the one included variant. diff --git a/ai-review/437.md b/ai-review/437.md new file mode 100644 index 0000000000..df9dffd51d --- /dev/null +++ b/ai-review/437.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 437 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/`. The problem concerns multiplicative partial products and perfect squares, which is distinct from the additive combinatorics infrastructure (sum-free sets, Sidon sets, additive bases) that dominates the shared library. The `IsSquare` predicate comes from Mathlib. The custom definitions `partialProd` and `squareCount` are specific to this problem and appropriately self-contained. + +Minor style note: `partialProd` uses `Finset.univ.filter (fun i : Fin k => i ≤ j)` which could equivalently be written as `Finset.Iic j` for a slightly more idiomatic formulation: +```lean +∏ i ∈ Finset.Iic j, a i +``` +This is a cosmetic point and does not affect correctness. + +## 2. Citations + +The formalization references: +- `[BPZ24] Bui, H. M., Pratt, K., and Zaharescu, A.` — no paper title is given. + +The website (erdosproblems.com/437) provides the following references that should be checked: +- **[ErGr80]** — Erdős and Graham (1980), the original source. The formalization mentions "Erdős and Graham" in the docstring commentary but does not provide a formal citation tag. +- **[BPZ24]** — Bui, Pratt, and Zaharescu (2024). The formalization cites this but omits the paper title. The full title should be included for completeness. +- **Tao's blog post** — Terry Tao documented sharper bounds. Not cited in the formalization. +- **Problem 841** — listed as a related problem on the website. Not cross-referenced in the formalization. + +**Recommendation:** Add the paper title for [BPZ24] and consider adding a cross-reference to Problem 841. + +## 3. Variants + +The website describes several aspects of the problem: + +1. **The main question (captured):** Can there be more than $x^{1-\varepsilon}$ partial-product squares? — This is what the formalization states. + +2. **The $o(x)$ upper bound (not captured):** Erdős and Graham note it is "trivial" (using Siegel's theorem) that the count is $o(x)$. This is mentioned in the docstring but not formalized. + +3. **Tao's sharper bounds (not captured):** Tao established: +$$x \exp\!\bigl(-(2^{1/2}+o(1))\,u(x)\bigr) \;\le\; L(x) \;\le\; x \exp\!\bigl(-(2^{-1/2}+o(1))\,u(x)\bigr)$$ +where $u(x) = \sqrt{\log x \cdot \log\log x}$. These tighter bounds are not formalized. + +4. **Related Problem 841 (not captured):** Concerns the minimal $t_n$ such that $\{n+1,\ldots,n+t_n\}$ contains a subset whose product with $n$ is a perfect square. This is thematically connected but is a distinct problem. + +The formalization captures the central conjecture (item 1), which is the most important variant. The omission of items 2–4 is reasonable for a single theorem statement, though the $o(x)$ upper bound could be a natural companion theorem. + +## 4. Readability + +The code is well-structured and readable: +- `partialProd` and `squareCount` have clear docstrings explaining their purpose. +- The main theorem statement is readable and follows the natural mathematical phrasing. +- The namespace `Erdos437` keeps definitions scoped appropriately. + +Minor suggestions: +- As noted above, `Finset.Iic j` could replace the `filter` in `partialProd` for slightly cleaner code. +- The docstring is well-written and provides good mathematical context. + +## 5. Formalizability + +**Assessment: Unambiguous and cleanly formalizable.** + +The problem statement "Is it true that, for any $\varepsilon > 0$, there can be more than $x^{1-\varepsilon}$ squares?" is a precise quantitative question. The only interpretive choice is the quantifier structure — specifically whether "for all sufficiently large $x$" is intended (as opposed to "there exists arbitrarily large $x$"). The formalization uses `∃ N, ∀ x ≥ N`, which is the stronger "for all sufficiently large $x$" reading. This is the standard interpretation and matches the strength of the [BPZ24] result. + +The notion of "partial products" is unambiguous: given a sequence $a_1 < \cdots < a_k$, the partial products are the $k$ values $\prod_{i=1}^{j} a_i$ for $j = 1, \ldots, k$. No ambiguity arises here. + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +Detailed verification: + +- **Sequence conditions:** `StrictMono a` captures $a_1 < a_2 < \cdots < a_k$. The conditions `∀ i, 1 ≤ a i` and `∀ i, a i ≤ x` correctly encode the bounds $1 \le a_i \le x$. Note that `∀ i, 1 ≤ a i` is not fully redundant with `StrictMono a` since `a ⟨0, _⟩` could be 0 without the lower bound constraint. + +- **Partial products:** `partialProd a j = ∏ i ∈ Finset.univ.filter (· ≤ j), a i` correctly computes $a(0) \cdot a(1) \cdots a(j)$, matching $a_1 \cdot a_2 \cdots a_{j+1}$ in 1-indexed notation. + +- **Square counting:** `squareCount a` correctly counts how many of the $k$ partial products are perfect squares using `IsSquare`. + +- **Main theorem quantifiers:** `∀ ε > 0, ∃ N, ∀ x ≥ N, ∃ (k, a), [conditions] ∧ squareCount a > x^{1-ε}` is the correct formalization of "for any $\varepsilon > 0$ and all sufficiently large $x$, there can be more than $x^{1-\varepsilon}$ squares." + +- **`answer(True)`:** Appropriate since the problem is solved in the affirmative by [BPZ24]. + +- **Edge case (k = 0):** When k = 0, `Fin 0` is empty, `squareCount` returns 0, and the existential would need $x^{1-\varepsilon} < 0$ which never holds for positive $x$. This is mathematically correct — the sequence must be nonempty for the claim to hold. + +- **Coercion in the inequality:** `(squareCount a : ℝ) > (x : ℝ) ^ ((1 : ℝ) - ε)` correctly lifts the comparison to real numbers since $x^{1-\varepsilon}$ is generally non-integer. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the main conjecture as stated on erdosproblems.com/437. diff --git a/ai-review/438.md b/ai-review/438.md new file mode 100644 index 0000000000..5b8cec2cfc --- /dev/null +++ b/ai-review/438.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 438 + +## 1. Code Reuse + +The `SumsetAvoidSquares` predicate defined at line 42 is specific to this problem and there is no existing equivalent in the codebase. However, several related patterns exist: + +- **Problem 787** (`ErdosProblems/787.lean:48`) defines `IsSumAvoidingIn` for sum-avoiding sets in ℝ, but with a different semantic (avoiding sums that land *in* a set, rather than avoiding sums that *are* squares). +- **Problem 37** (`ErdosProblems/37.lean:44`) defines a `sumset` for `Set ℕ`, but 438 works with `Finset ℕ` and a predicate rather than explicit sumset construction. +- **Problem 587** (`ErdosProblems/587.lean:32`) defines `MaxNotSqSum` for *subset sums* avoiding squares — related but distinct (subset sums vs. pairwise sums). + +The asymptotic density bound pattern `∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, ... ≤ (c + ε) * N` is standard in the codebase (see problems 49, 140, 333, 340). Problem 49 (`ErdosProblems/49.lean:41–48`) is structurally the closest match, using the same `∀ x ∈ A, 1 ≤ x ∧ x ≤ N` membership constraint and the same ε-based density formulation. + +**Verdict:** No significant reuse opportunities. The predicate is simple enough that a standalone definition is appropriate, and the theorem structure follows established codebase conventions. + +## 2. Citations + +The formalization references **[KLS02]** (Khalfalah, Lodha, Szemerédi, 2002). The website lists several additional references: + +| Ref | Status in formalization | +|-----|----------------------| +| **[Er80c]** — Erdős (1980) | **Missing.** Original problem statement. | +| **[ErGr80, p.87]** — Erdős & Graham (1980) | **Missing.** Early reference. | +| **[Er82e, p.68]** — Erdős (1982) | **Missing.** | +| **[LOS83]** — Lagarias, Odlyzko, Shearer (1983) | **Missing.** Proved the modular version is sharp and the general bound |A| ≤ 0.475N. | +| **[KLS02]** — Khalfalah, Lodha, Szemerédi (2002) | **Present.** Proved the tight asymptotic bound. | + +The KLS02 citation in the docstring is complete and well-formatted. However, the module docstring should ideally also mention the [LOS83] reference since it discusses their modular result and the 0.475N bound as context. The website also lists related problems **439** and **587**, which are not cross-referenced in the docstring. + +**Recommendation:** Add [LOS83] citation with full bibliographic details. Consider adding cross-references to related problems 439 and 587 in the module docstring. + +## 3. Variants + +The formalization captures only the **upper bound** from KLS02. The website and mathematical literature suggest several natural variants that are not formalized: + +1. **Lower bound construction (Massias):** The set of integers ≡ 1,5,9,13,14,17,21,25,26,29,30 (mod 32) gives |A| ≥ (11/32)N. This is a concrete, verifiable construction that could be stated as a theorem. +2. **Modular version (Lagarias–Odlyzko–Shearer, 1983):** If A ⊆ ℤ/Nℤ with no squares in A + A, then |A| ≤ (11/32)N. This is a cleaner statement (no ε needed) and was a precursor result. +3. **Intermediate bound:** |A| ≤ 0.475N (Lagarias–Odlyzko–Shearer, 1983) — weaker but historically significant. +4. **k-th power generalization:** The problem naturally extends to asking when A + A avoids k-th powers. Problem 439 addresses the coloring version of the square case but not the density version for higher powers. + +**Verdict:** The main solved result is captured. The lower bound construction (showing 11/32 is tight) would be the most valuable variant to add, as it completes the picture of the problem being "solved." + +## 4. Readability + +The code is clean, well-structured, and readable: + +- The `SumsetAvoidSquares` predicate is clearly named and has an informative docstring. +- The theorem statement follows the standard pattern used elsewhere in the codebase. +- The module docstring provides good mathematical context including the construction by Massias and the resolution by KLS02. +- Appropriate use of the `Erdos438` namespace. + +**Minor suggestions:** +- The predicate could note in its docstring that it considers *all* pairs (a, b) including a = b, consistent with the standard additive combinatorics convention that A + A = {a + b : a, b ∈ A} (as opposed to the restricted sumset {a + b : a ≠ b}). + +**Verdict:** Highly readable. No significant improvements needed. + +## 5. Formalizability + +The problem as stated on the website — *"How large can A ⊆ {1,…,N} be if A + A contains no square numbers?"* — is a well-posed extremal combinatorics question with no ambiguity. + +The key formalizable components are all clear: +- **A ⊆ {1,…,N}**: finite subset of an interval — well-defined. +- **A + A**: sumset in the standard additive combinatorics sense — well-defined. +- **"contains no square numbers"**: the squares ℕ² = {0, 1, 4, 9, 16, …} are well-defined. Since elements of A are ≥ 1, sums are ≥ 2, so the only squares that could appear are 4, 9, 16, …. +- **"How large"**: asking for the maximum cardinality — formalized as an upper bound with the sharp constant 11/32. + +The only minor point of interpretation is whether "square numbers" includes 0. In this context it is irrelevant since a + b ≥ 2 for a, b ∈ {1,…,N}, and the Lean `IsSquare` predicate does include 0 (since 0 = 0 × 0). This has no effect on correctness. + +**Verdict:** Unambiguous and clearly formalizable. Assessment: **no ambiguity**. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the result it claims to capture. + +**Detailed verification:** + +- **Membership constraint** (`∀ x ∈ A, 1 ≤ x ∧ x ≤ N`): Correctly encodes A ⊆ {1, …, N}. The lower bound of 1 is important — it excludes 0, matching the problem statement. ✓ +- **`SumsetAvoidSquares` predicate**: Quantifies over all pairs (a, b) ∈ A × A (including a = b), checking ¬IsSquare(a + b). This correctly formalizes "A + A contains no perfect squares" since A + A = {a + b : a, b ∈ A}. ✓ +- **`IsSquare`**: Mathlib's `IsSquare` on `ℕ` checks existence of m with m * m = n. This is the standard definition of perfect square. ✓ +- **Bound** `(A.card : ℝ) ≤ (11 / 32 + ε) * (N : ℝ)`: Correctly captures |A| ≤ (11/32 + o(1))N via the standard ε-N₀ formulation. The cast to ℝ is necessary since 11/32 is not a natural number. ✓ +- **Quantifier structure** `∀ ε > 0, ∃ N₀, ∀ N ≥ N₀`: Standard and correct way to express an asymptotic upper bound with a sharp constant. ✓ + +**Potential concerns (all resolved):** + +1. *Does `11 / 32` evaluate correctly in ℝ?* Yes — in Lean 4 with ℝ, `11 / 32` is rational division, giving the correct value 0.34375. ✓ +2. *Should A be required nonempty?* No — the bound holds trivially for empty A. ✓ +3. *Is the bound tight?* The formalization only claims an upper bound, not sharpness. The module docstring correctly describes the matching lower bound (Massias's construction), but this is not formalized as a separate theorem. This is acceptable — the problem asks "how large can A be" and the formalization answers with the sharp upper bound. +4. *Does allowing a = b matter?* In the standard sumset A + A, we have a + a = 2a for a ∈ A. The SumsetAvoidSquares predicate correctly forbids 2a from being a perfect square. This is consistent with the mathematical literature. ✓ + +**Verdict:** The formalization is correct and faithfully captures the KLS02 result. No mathematical flaws. An experienced mathematician would not identify any issues with the statement as formalized. diff --git a/ai-review/439.md b/ai-review/439.md new file mode 100644 index 0000000000..a8c98b7b56 --- /dev/null +++ b/ai-review/439.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 439 + +**File:** `FormalConjectures/ErdosProblems/439.lean` + +## 1. Code Reuse + +The formalization is self-contained and uses only Mathlib's `IsSquare` predicate for the square case. This is appropriate — no custom utilities from `FormalConjecturesForMathlib` are needed. + +Potential reuse considerations: +- **`IsPerfectPower` from `FormalConjecturesForMathlib/Data/Nat/PerfectPower.lean`**: This was *correctly not used* for the k-th power variant. `IsPerfectPower` requires both the base and exponent to be > 1, which would exclude values like $1^k = 1$. The formalization's direct existential `∃ z : ℕ, z ^ k = x + y` is more appropriate here. +- **`SumsetAvoidSquares` from Problem 438**: Problem 438 defines a `SumsetAvoidSquares` predicate for finite sets avoiding square sums. While thematically related, it applies to finite subsets of `{1, …, N}` and is not suitable for the infinite coloring context of Problem 439. +- **Ramsey coloring pattern from Problem 843/984**: Problems 843 and 984 use similar finite-coloring patterns (`ℕ → Fin c` or `ℕ → Fin r`). The pattern used in 439 is consistent with codebase conventions. + +**Verdict:** No improvements needed. Appropriate reuse decisions were made. + +## 2. Citations + +The website (erdosproblems.com/439) states: +- The problem is attributed to **Roth, Erdős, Sárközy, and Sós** — the formalization's docstring says "A question of Roth, Erdős, Sárközy, and Sós." ✓ +- **Erdős, Sárközy, and Sós** proved the result for 2 or 3 colours. ✓ +- **Khalfalah and Szemerédi** proved the general result. ✓ +- The reference **[KhSz06]** is cited: Khalfalah, A. and Szemerédi, E., *On the number of monochromatic solutions of $x + y = z^2$*. Combinatorics, Probability and Computing (2006), 15(1-2), 213-227. ✓ + +The website also notes **Problem 438** as a related problem. The formalization does not cross-reference Problem 438, though this is a minor omission of no mathematical consequence. + +**Verdict:** Citations are complete and accurate. The reference format matches the website. + +## 3. Variants + +The formalization captures two variants: +1. **Square case** (`erdos_439`): $x + y$ is a perfect square. +2. **k-th power generalization** (`erdos_439.variants.kth_powers`): $x + y = z^k$ for some $z$, with $k \geq 2$. + +**Missing variant — General polynomial case:** The module docstring describes the Khalfalah-Szemerédi result for arbitrary non-constant polynomials $f(z) \in \mathbb{Z}[z]$ satisfying $2 \mid f(z)$ for some $z \in \mathbb{Z}$. This stronger result is mentioned but not formalized as a theorem. Adding a polynomial variant would provide a more complete formalization: + +```lean +theorem erdos_439.variants.polynomial (f : Polynomial ℤ) (hf : f.degree ≥ 1) + (heven : ∃ z : ℤ, 2 ∣ f.eval z) : + ∀ (c : ℕ) (g : ℕ → Fin c), + ∃ x y : ℕ, x ≠ y ∧ g x = g y ∧ ∃ z : ℤ, f.eval z = ↑(x + y) +``` + +However, formalizing this would require importing `Mathlib.RingTheory.Polynomial.Basic` and involves subtleties around the integer-to-natural coercion. The omission is reasonable given the added complexity, but it is the "strongest" version of the result and arguably the most mathematically significant. + +**Verdict:** The two most natural variants are present. The polynomial generalization is documented but not formalized — this is a notable omission. + +## 4. Readability + +The code is clean and well-structured: +- The module docstring clearly explains the problem, its history, and the resolution. +- Each theorem has a focused docstring with the relevant citation. +- The namespace `Erdos439` groups the statements logically. +- The variant naming convention `erdos_439.variants.kth_powers` follows codebase patterns. + +One minor point: the square case could reference that it is the $k = 2$ specialization of the k-th power variant, to make the relationship explicit. + +**Verdict:** Highly readable. No changes needed. + +## 5. Formalizability + +The problem as stated on the website ("In any finite coloring of the integers, must there exist two distinct integers $x \neq y$ of the same color such that $x + y$ is a perfect square?") is **unambiguous and directly formalizable**. + +The only design choice is the domain: the website says "integers" ($\mathbb{Z}$), but the formalization uses natural numbers ($\mathbb{N}$). This is a **strengthening** — the $\mathbb{N}$ result implies the $\mathbb{Z}$ result (any finite coloring of $\mathbb{Z}$ restricts to a finite coloring of $\mathbb{N}$), but not vice versa. The Khalfalah-Szemerédi proof works over $\mathbb{N}$ (positive integers), so the formalization captures the strongest proven result. + +The k-th power variant is also unambiguous: "is a $k$-th power" has a single natural reading as $z^k$ for some $z$. + +**Verdict:** Fully formalizable. No ambiguity. + +## 6. Correctness + +### Square case (`erdos_439`) +- **Type:** `∀ (c : ℕ) (f : ℕ → Fin c)` correctly models finite colourings. When $c = 0$, `Fin 0` is empty, so no function `ℕ → Fin 0` exists, making the statement vacuously true — this is mathematically correct (there is no 0-colouring). +- **Distinctness:** `x ≠ y` correctly requires distinct elements. +- **Same colour:** `f x = f y` is correct. +- **Square condition:** `IsSquare (x + y)` uses Mathlib's definition (`∃ r, x + y = r * r`), which is correct. Note `IsSquare 0` is true, but $x + y = 0$ with $x, y \in \mathbb{N}$ and $x \neq y$ is impossible, so this edge case is harmless. +- **`answer(True)`:** Correct — the problem has been proved in the affirmative. + +### k-th power variant (`erdos_439.variants.kth_powers`) +- **Bound on k:** `2 ≤ k` correctly excludes $k = 0$ and $k = 1$ (which are trivial/degenerate). +- **k-th power condition:** `∃ z : ℕ, z ^ k = x + y` is correct. This allows $z = 0$ (giving $x + y = 0$, impossible for distinct naturals) and $z = 1$ (giving $x + y = 1$, possible only for $\{0, 1\}$). These edge cases are all mathematically sound. +- **`answer(True)`:** Correct — this follows from the Khalfalah-Szemerédi result since $z^k$ with $z$ even gives an even value, satisfying the divisibility condition. + +### Potential concern: domain choice +The formalization ranges over all of $\mathbb{N}$ including 0, while the original problem likely intended positive integers. This is not a correctness issue: including 0 only makes the problem (marginally) easier for the solver and harder to disprove, so if the result holds over $\mathbb{N}_{\geq 0}$ it certainly holds over $\mathbb{N}_{\geq 1}$. The formalization is correct as stated. + +**Verdict:** Both formalizations are mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Appropriate — no missed opportunities | +| Citations | Complete and accurate | +| Variants | Square and k-th power present; polynomial generalization documented but not formalized | +| Readability | Excellent | +| Formalizability | Unambiguous, directly formalizable | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The only substantive suggestion is to consider adding the polynomial generalization as a formal variant, since it is the main result of Khalfalah-Szemerédi and is already described in the docstring. diff --git a/ai-review/440.md b/ai-review/440.md new file mode 100644 index 0000000000..3ff0948e54 --- /dev/null +++ b/ai-review/440.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 440 + +## 1. Code Reuse + +**Asymptotic notation**: `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean` defines `≪` notation mapping to `Asymptotics.IsBigO`. The main theorem `erdos_440` manually unfolds the big-O definition as `∃ C, 0 < C ∧ ∀ᶠ x in atTop, ... ≤ C * sqrt x`. This is a valid approach and arguably more readable than using `IsBigO`, but using the `≪` notation would be more concise and idiomatic within this codebase. Either approach is acceptable. + +**LCM utilities**: Problem 441 (`FormalConjectures/ErdosProblems/441.lean`) defines `LcmBounded` for pairwise lcm bounds in finite sets, and `FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` defines `lcmInterval`. Neither is directly applicable here since 440 concerns consecutive-pair lcm in a sequence rather than pairwise lcm in a set. + +**Counting patterns**: Several problems use similar `Finset.filter ... .card` counting patterns (696.lean's `countSat`, 122.lean's `shiftCount`, 446.lean's `countWithDivisor`). The pattern in `lcmPairCount` is standard and doesn't benefit from abstraction. + +**Liminf/sSup pattern**: Problem 513.lean uses `⨆ f, liminf ...` and 329.lean uses `sSup` with `limsup`. The `sSup {L | ∃ a, ... liminf ... = L}` formulation in 440 is valid but could alternatively use `⨆` notation for consistency with 513.lean. + +**No significant reuse opportunities identified.** The `lcmPairCount` definition is problem-specific and appropriately scoped. + +## 2. Citations + +The website lists references **[ErGr80, p.87]** (Erdős & Graham) and **[ErSz80]** (Erdős & Szemerédi). The Lean file's docstring only cites **[ErSz80]**. The reference **[ErGr80, p.87]** is missing. + +The website also credits **Zachary Chase**, **Terence Tao**, and **Wouter van Doorn**. The docstring mentions Tao and van Doorn but omits Zachary Chase. + +The [ErSz80] citation in the docstring lacks a full bibliographic entry — only `Erdős, P. and Szemerédi, E.` is given without a title, journal, or year. By contrast, Problem 441 provides complete citations. A fuller entry would be appropriate. + +**Recommendation**: Add the [ErGr80, p.87] reference, mention Zachary Chase, and expand the [ErSz80] citation. + +## 3. Variants + +Two questions are posed on the website: +1. Is $A(x) \ll x^{1/2}$? → Captured by `erdos_440`. +2. How large can $\liminf A(x)/x^{1/2}$ be? → Captured by `erdos_440.variants.liminf`. + +Both are formalized. However, there is a notable known result mentioned in the docstring but **not formalized**: + +- **Sharp constant (van Doorn / Erdős–Szemerédi)**: $A(x) \leq (c + o(1))\sqrt{x}$ where $c = \sum_{n \geq 1} \frac{1}{n^{1/2}(n+1)} \approx 1.86$, and this constant is best possible. + +This is a stronger quantitative result than the qualitative $O(\sqrt{x})$ bound. A formalization would look something like a theorem stating the optimal constant, similar to how Problem 441 formalizes the sharp asymptotic $(9N/8)^{1/2}$. Its omission is understandable (the constant is somewhat involved), but it represents the strongest known result for the problem. + +**Assessment**: The two main questions are captured. The sharp constant variant is a reasonable omission but could be added for completeness. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- `lcmPairCount` has a clear docstring and a transparent implementation. +- The namespace `Erdos440` is appropriately scoped. +- The `answer(True)` / `answer((1 : ℝ))` pattern is consistent with the codebase convention. +- The docstrings provide good mathematical context explaining what is known. + +**Minor suggestion**: The docstring for the liminf variant says "The answer is $1$: the liminf is always $\leq 1$" — this could be slightly confusing because the theorem formalizes the *supremum* of liminf values being 1, not that any particular liminf is 1. The current wording is technically correct but could be clearer. + +**No significant readability issues.** + +## 5. Formalizability + +The problem is precise and clearly formalizable. Both questions have unambiguous mathematical meanings. + +**Minor ambiguity**: The original problem uses $A \subseteq \mathbb{N}$ where Erdős conventionally means positive integers. The formalization uses `a : ℕ → ℕ` with `StrictMono a`, which allows `a(0) = 0`. Since `Nat.lcm 0 n = 0` in Lean, this would make index 0 always counted when `a(0) = 0`. However, this is asymptotically irrelevant (adds at most 1 to the count), so it does not affect the truth of either theorem. + +**Assessment**: **Low ambiguity.** The problem is straightforwardly formalizable. The $\mathbb{N}$ vs $\mathbb{N}^+$ distinction is the only source of minor ambiguity and does not affect correctness. + +## 6. Correctness + +### `lcmPairCount` definition +The definition counts $|\{i \in \{0, \ldots, x\} : \operatorname{lcm}(a(i), a(i+1)) \leq x\}|$. For a strictly increasing $a$ with $a(i) \geq i$, we have $\operatorname{lcm}(a(i), a(i+1)) \geq a(i+1) \geq i+1$, so the condition $\operatorname{lcm} \leq x$ forces $i \leq x - 1$. The range `Finset.range (x + 1)` = $\{0, \ldots, x\}$ is therefore sufficient — no valid indices are missed. **Correct.** + +### `erdos_440` (main theorem) +States: for all StrictMono $a : \mathbb{N} \to \mathbb{N}$, $\exists C > 0$ such that eventually $A(x) \leq C\sqrt{x}$. This is the standard formulation of $A(x) = O(\sqrt{x})$. The `answer(True)` wrapper correctly indicates the answer is affirmative. **Correct.** + +### `erdos_440.variants.liminf` +States: $\sup\{L \in \mathbb{R} \mid \exists a \text{ StrictMono}, \liminf_{x \to \infty} A(x)/\sqrt{x} = L\} = 1$. + +This correctly captures "the largest possible value of $\liminf A(x)/\sqrt{x}$ over all sequences is 1." The liminf is well-defined since $A(x)/\sqrt{x} \geq 0$ (bounded below) and $\leq C$ for some $C$ by the main theorem (bounded above eventually). + +**One subtle concern**: The use of `sSup` over the set of achievable liminf values requires this set to have a supremum in $\mathbb{R}$. If no sequence achieves a liminf of exactly 1 (only approaches it), then 1 might not be in the set, and `sSup` would need the set to be bounded above and nonempty. Since $a = \text{id}$ (the identity / natural numbers) achieves $\liminf = 1$ (as stated in the docstring), the value 1 is in the set, so `sSup` is well-defined and equals 1. **Correct**, but the proof will need to establish that $a = \text{id}$ actually achieves liminf exactly 1. + +**No mathematical flaws identified. The formalization is correct and complete for the two questions posed.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No significant opportunities; could use `≪` notation but current approach is fine | +| Citations | **Missing [ErGr80, p.87] reference and Zachary Chase credit; [ErSz80] citation incomplete** | +| Variants | Two main questions captured; sharp constant variant mentioned but not formalized | +| Readability | Good; no significant issues | +| Formalizability | Low ambiguity; straightforwardly formalizable | +| Correctness | **Correct and complete** for the stated questions | diff --git a/ai-review/441.md b/ai-review/441.md new file mode 100644 index 0000000000..b6753a6b6e --- /dev/null +++ b/ai-review/441.md @@ -0,0 +1,116 @@ +# Review: Erdős Problem 441 + +## 1. Code Reuse + +**LCM utilities**: `FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` defines `lcmInterval` (LCM of a consecutive integer range), which is unrelated — Problem 441 concerns pairwise LCM *bounds* in a set, not the LCM of an interval. + +**Finset patterns**: The `LcmBounded` definition and `erdosConstruction` use standard Mathlib constructs (`Finset.Icc`, `Finset.Ioc`, `Finset.filter`, `Nat.lcm`, `Nat.sqrt`). No custom infrastructure from `FormalConjecturesForMathlib` is needed. + +**Problem 440 cross-reference**: Problem 440 (`FormalConjectures/ErdosProblems/440.lean`) also involves pairwise LCM conditions but for *consecutive* elements of a sequence, not arbitrary pairs in a set. The `LcmBounded` definition here is appropriately distinct. + +**No significant reuse opportunities identified.** The definitions are problem-specific and appropriately scoped. + +## 2. Citations + +The website lists the following references: **Er51b, Er65, Er73, ErGr80, Er98** (Erdős), **Ch72b** (Choi), **Ch98** (Chen), **DaCh06, ChDa07** (Chen & Dai), and **Gu04** (Guy, problems B26, E2). It also references OEIS sequence **A068509**. + +The Lean docstring cites only three: **[Er51b]**, **[Ch98]**, and **[ChDa07]**. Missing references: +- **[Er65], [Er73], [ErGr80], [Er98]** — additional Erdős papers on the problem +- **[Ch72b]** — Choi's contribution +- **[DaCh06]** — a Dai & Chen paper (distinct from [ChDa07]) +- **[Gu04]** — Guy's *Unsolved Problems in Number Theory*, problems B26 and E2 + +The three cited references have full bibliographic entries, which is good. However, the citation for **[ChDa07]** title reads "On the lcm-sum problem" which should be verified — Chen & Dai's 2007 paper is specifically about the optimality of Erdős' construction. + +The website also mentions a **refined upper bound** by Chen & Dai: $g(N) \leq (9N/8)^{1/2} + O\left((N/\log N)^{1/2} \log\log N\right)$, which is not mentioned in the docstring. + +**Recommendation**: Add missing references, verify the [ChDa07] title, and mention the OEIS sequence A068509. + +## 3. Variants + +The website identifies several results: + +| Result | Formalized? | +|--------|-------------| +| Asymptotic $g(N) \sim (9N/8)^{1/2}$ (upper bound) | Yes: `erdos_441` | +| Asymptotic lower bound from construction | Yes: `erdos_441.variants.lower` | +| Erdős' construction not always optimal (disproved) | Yes: `erdos_441.variants.disproved` | +| Erdős' original upper bound $g(N) \leq (4N)^{1/2} + O(1)$ | No (superseded by the sharp asymptotic) | +| Refined error term: $g(N) \leq (9N/8)^{1/2} + O((N/\log N)^{1/2}\log\log N)$ | No | + +The three formalized theorems together capture the core mathematical content: the sharp asymptotic from both sides (Chen's result) and the disproof of the optimality conjecture (Chen & Dai's result). The refined error term is a reasonable omission — it is a quantitative strengthening rather than a qualitatively distinct statement. + +**Assessment**: All essential variants are captured. The refined error term could be added for completeness but its omission is justified. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **`LcmBounded`**: Clear definition with a good docstring. The conjunction of the range constraint (`1 ≤ a ∧ a ≤ N`) and the pairwise LCM constraint is natural. +- **`erdosConstruction`**: The let-binding of `lo` and `hi` makes the construction readable. The union of `Icc 1 lo` with the even-filtered `Ioc lo hi` clearly mirrors the mathematical description. +- **Namespace scoping**: `Erdos441` namespace is clean. +- **Docstrings**: Each theorem has a clear docstring explaining the mathematical content and attributing results to the correct authors. +- **Theorem naming**: The `.variants.lower` and `.variants.disproved` naming convention is consistent with the codebase. + +**No readability issues identified.** + +## 5. Formalizability + +The problem is precise and unambiguously formalizable: + +- The **extremal quantity** $g(N) = \max\{|A| : A \subseteq \{1,\ldots,N\},\ \operatorname{lcm}(a,b) \leq N\ \forall a,b \in A\}$ is completely well-defined. +- The **conjecture** about whether the construction is optimal is a clear yes/no question. +- The **asymptotic** $g(N) \sim (9N/8)^{1/2}$ is standard asymptotic notation with a precise meaning. + +**Minor note on formalization choices**: The asymptotic is formalized as two one-sided bounds with $(1 \pm \varepsilon)$ multiplicative factors rather than using Lean's `Asymptotics.IsEquivalent` or `~` notation. This is a valid and arguably more explicit formulation. + +**Assessment**: **Very low ambiguity.** The problem is a clean extremal combinatorics question with no interpretive freedom. + +## 6. Correctness + +### `LcmBounded` definition +Requires (1) all elements in $\{1, \ldots, N\}$ and (2) pairwise $\operatorname{lcm}(a,b) \leq N$. The lower bound $1 \leq a$ excludes 0, which is correct since $\operatorname{lcm}(0, b) = 0$ in Lean (via `Nat.lcm`) and including 0 would trivially satisfy the LCM condition while not being a meaningful element of $\{1, \ldots, N\}$. **Correct.** + +### `erdosConstruction` definition +The construction takes: +- All integers in $\{1, \ldots, \lfloor\sqrt{\lfloor N/2 \rfloor}\rfloor\}$ (`Finset.Icc 1 lo`) +- All even integers in $(\lfloor\sqrt{\lfloor N/2 \rfloor}\rfloor, \lfloor\sqrt{2N}\rfloor]$ (`Finset.Ioc lo hi` filtered for `Even`) + +**Verification that the construction is LcmBounded:** +- For $a, b \leq \sqrt{N/2}$: $\operatorname{lcm}(a,b) \leq ab \leq N/2 \leq N$. ✓ +- For $a \leq \sqrt{N/2}$ and $b$ even with $b \leq \sqrt{2N}$: $\operatorname{lcm}(a,b) \leq ab \leq \sqrt{N/2} \cdot \sqrt{2N} = N$. ✓ +- For $a = 2a'$, $b = 2b'$ both even with $a, b \leq \sqrt{2N}$: $\operatorname{lcm}(a,b) = 2\operatorname{lcm}(a',b') \leq 2a'b' = ab/2 \leq 2N/2 = N$. ✓ + +**Size of the construction**: $\lfloor\sqrt{N/2}\rfloor + \lfloor(\sqrt{2N} - \sqrt{N/2})/2\rfloor \approx \sqrt{N/2} + (\sqrt{2N} - \sqrt{N/2})/2 = \frac{3\sqrt{N}}{2\sqrt{2}} = \sqrt{9N/8}$, matching the claimed asymptotic. + +**Integer rounding**: `Nat.sqrt (N / 2)` computes $\lfloor\sqrt{\lfloor N/2\rfloor}\rfloor$ rather than $\lfloor\sqrt{N/2}\rfloor$. For odd $N$, $\lfloor N/2 \rfloor = (N-1)/2$, introducing a discrepancy of $O(N^{-1/2})$ in the square root. This is absorbed into the $O(1)$ term and does not affect any of the three theorems. **Correct.** + +### `erdos_441` (asymptotic upper bound) +States: $\forall \varepsilon > 0,\ \exists N_0,\ \forall N \geq N_0,\ \forall A$ with `LcmBounded A N`: $|A| \leq (1+\varepsilon)\sqrt{9N/8}$. + +This is a standard formulation of $g(N) \leq (1+o(1))\sqrt{9N/8}$, which is one direction of Chen's asymptotic $g(N) \sim \sqrt{9N/8}$. **Correct.** + +### `erdos_441.variants.lower` (asymptotic lower bound) +States: $\forall \varepsilon > 0,\ \exists N_0,\ \forall N \geq N_0,\ \exists A$ with `LcmBounded A N` and $|A| \geq (1-\varepsilon)\sqrt{9N/8}$. + +This is the other direction. Together with the upper bound, this establishes $g(N) \sim \sqrt{9N/8}$. **Correct.** + +### `erdos_441.variants.disproved` (construction non-optimality) +States: $\forall N_0,\ \exists N \geq N_0,\ \exists A$ with `LcmBounded A N` and $|\text{erdosConstruction}(N)| < |A|$. + +This captures "infinitely often, there exists a better set than Erdős' construction," which is Chen & Dai's result. **Correct.** + +**Subtle point**: This theorem's truth depends on the exact implementation of `erdosConstruction`. Since Chen & Dai's result shows the gap between the optimum and the construction grows (more than $O(1)$ better infinitely often), the integer rounding in `erdosConstruction` does not affect the result — even if `erdosConstruction` is off by a constant from the "true" construction, the gap still exceeds any constant infinitely often. + +**No mathematical flaws identified. The formalization is correct and complete.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No significant opportunities; definitions are appropriately problem-specific | +| Citations | **Incomplete: missing 7+ references from the website (Er65, Er73, ErGr80, Er98, Ch72b, DaCh06, Gu04) and OEIS A068509** | +| Variants | All essential variants captured; refined error term is a reasonable omission | +| Readability | Clean and well-structured; no issues | +| Formalizability | Very low ambiguity; clean extremal problem | +| Correctness | **Correct and complete** — construction validity verified, all three theorems accurately capture the known results | diff --git a/ai-review/443.md b/ai-review/443.md new file mode 100644 index 0000000000..e604641a47 --- /dev/null +++ b/ai-review/443.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 443 + +**File:** `FormalConjectures/ErdosProblems/443.lean` + +## 1. Code Reuse + +The formalization defines two helpers, `productSet` and `commonProducts`, using standard Mathlib idioms (`Finset.Icc`, `.image`, `∩`, `.card`). These patterns appear throughout the codebase (e.g., Problems 402, 796, 896) but no existing utility in `FormalConjecturesForMathlib/` directly provides these specific definitions. The definitions are simple and self-contained, so introducing shared abstractions would be over-engineering. **No actionable reuse opportunities.** + +## 2. Citations + +The module docstring cites: +- `[He25]` Hegyvári, N., *On a problem of Erdős on integers which are simultaneously of the form $ab$ and $(a+k)(b+k)$* (2025). + +**Issues:** +- **Missing original source.** The erdosproblems.com page attributes the problem to `[ErGr80, p.88]` (Erdős and Graham, *Old and new problems and results in combinatorial number theory*, 1980). This should be added to the module docstring for provenance, consistent with how Problem 444 cites `[ErGr80]`. +- **Hegyvári citation incomplete.** No journal/venue or arXiv identifier is given. If the paper has been published or posted to arXiv since the formalization was written, this should be updated. +- **Cambie (unpublished)** is mentioned but not given a citation key. This is acceptable for unpublished work, but a full name (Sean Cambie) would improve traceability. + +## 3. Variants + +The formalization captures two parts: + +| Aspect | Formalized? | Notes | +|--------|------------|-------| +| Can the intersection be arbitrarily large? | ✅ `erdos_443` | | +| Upper bound $m^{O(1/\log\log m)}$ when $m > n$ | ✅ `erdos_443.variants.upper_bound` | | +| For any $s$, infinitely many pairs with intersection exactly $s$ | ❌ | The formalization only shows $\geq s$, not $= s$ | + +**Missing variant:** The Hegyvári/Cambie result establishes that for any integer $s$, there exist infinitely many pairs $(m, n)$ with the intersection having size **exactly** $s$. The current `erdos_443` only formalizes the weaker claim ($\geq s$). A stronger variant could be: + +```lean +theorem erdos_443.variants.exact_size (s : ℕ) : + ∀ m₀ : ℕ, ∃ m : ℕ, m₀ ≤ m ∧ ∃ n : ℕ, 1 ≤ n ∧ commonProducts m n = s +``` + +This is a minor gap — the formalized version suffices to answer the original question ("Can it be arbitrarily large? Yes."), but the exact-size result is a strictly stronger theorem that is part of the known solution. + +## 4. Readability + +**Good:** +- The helper definitions `productSet` and `commonProducts` are well-named and have clear docstrings. +- The separation into two theorems (arbitrarily large, upper bound) is clean. +- The use of a namespace `Erdos443` avoids polluting the global scope. + +**Minor suggestions:** +- The docstring for `erdos_443` says "arbitrarily large $m$ and some $n \geq 1$" but the formal statement quantifies `∀ m₀, ∃ m ≥ m₀, ∃ n ≥ 1`. This is correct but could more explicitly state "for infinitely many $m$" to match the mathematical convention. + +Overall readability is **good**. + +## 5. Formalizability + +The problem is **precisely formalizable**. The sets $\{k(m-k) : 1 \leq k \leq m/2\}$ are finite, explicitly computable, and their intersection is well-defined. There is essentially no ambiguity in the problem statement. + +The only minor ambiguity in the *original* Erdős problem is whether the question "Is it $\leq (mn)^{o(1)}$?" implicitly requires $m \neq n$ (since when $m = n$ the intersection is the entire product set, which grows linearly). The formalization correctly resolves this by requiring $n < m$ in the upper bound, which by symmetry covers all $m \neq n$ cases. + +**Assessment: No meaningful ambiguity. Fully formalizable.** + +## 6. Correctness + +### `productSet` definition +```lean +def productSet (m : ℕ) : Finset ℕ := + (Finset.Icc 1 (m / 2)).image (fun k => k * (m - k)) +``` + +- **Natural number subtraction:** Since $k \leq m/2 \leq m$, we have $m - k \geq 0$ in $\mathbb{N}$, so the subtraction does not underflow. ✅ +- **Integer division:** `m / 2` in `ℕ` is floor division. For $m$ odd (say $m = 2j+1$), `m / 2 = j`, so $k$ ranges over $\{1, \ldots, j\}$. The continuous bound $k \leq m/2 = j + 1/2$ gives the same integer range. ✅ +- **Edge cases:** For $m = 0$ or $m = 1$, `Finset.Icc 1 0 = ∅`, so `productSet = ∅`. This is correct (no way to partition 0 or 1 into two positive parts). ✅ + +### `erdos_443` (part 1) +```lean +theorem erdos_443 (s : ℕ) : + ∀ m₀ : ℕ, ∃ m : ℕ, m₀ ≤ m ∧ ∃ n : ℕ, 1 ≤ n ∧ s ≤ commonProducts m n +``` + +- Correctly captures "the intersection can be arbitrarily large" by requiring arbitrarily large $m$ with intersection $\geq s$. ✅ +- Slightly weaker than the known result (which gives exact size $s$), but mathematically sound as a formalization of the original question. ✅ + +### `erdos_443.variants.upper_bound` (part 2) +```lean +theorem erdos_443.variants.upper_bound : + ∃ C : ℝ, 0 < C ∧ ∃ m₀ : ℕ, ∀ m : ℕ, m₀ ≤ m → + ∀ n : ℕ, 1 ≤ n → n < m → + (commonProducts m n : ℝ) ≤ (m : ℝ) ^ (C / Real.log (Real.log (m : ℝ))) +``` + +- **Bound correctness:** $m^{C/\log\log m}$ correctly formalizes $m^{O(1/\log\log m)}$, since the existential $C$ absorbs the implied constant. ✅ +- **Subpolynomial growth:** For large $m$, $C/\log\log m \to 0$, so the bound is $m^{o(1)}$, which is stronger than the original question's $(mn)^{o(1)}$ (since $m^{o(1)} \leq (mn)^{o(1)}$ when $n < m$). ✅ +- **Condition $n < m$:** Necessary and correct — when $m = n$ the intersection equals the full product set. ✅ +- **Condition $1 \leq n$:** Ensures $n$ is a meaningful parameter. ✅ +- **Well-definedness of bound for large $m$:** For $m \geq 16$, $\log m > 2.77$, so $\log\log m > 1.02 > 0$, making the exponent positive and well-defined. The existential $m_0$ handles small cases. ✅ + +### Potential concern +- The upper bound uses `Real.log` (natural log). The notation $\log\log m$ in the mathematical statement is also natural log. Consistent. ✅ + +**Overall correctness assessment: The formalization is mathematically correct and complete for the two main questions posed. The only gap is the absence of the stronger "exact size" variant, which is part of the solution rather than the original problem statement.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ OK | No reuse opportunities | +| Citations | ⚠️ Minor | Missing [ErGr80] original source; Hegyvári citation could be more complete | +| Variants | ⚠️ Minor | Missing exact-size variant from the Hegyvári/Cambie solution | +| Readability | ✅ Good | Clean structure, good naming and docstrings | +| Formalizability | ✅ Excellent | No ambiguity | +| Correctness | ✅ Correct | Mathematically sound; natural number subtraction safe; all edge cases handled | diff --git a/ai-review/444.md b/ai-review/444.md new file mode 100644 index 0000000000..9aeec18505 --- /dev/null +++ b/ai-review/444.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 444 + +## 1. Code Reuse + +Several other problems in the codebase define nearly identical reciprocal-sum and divisor-counting helpers: + +- **`unitFracSum`** (Problem 206, `206.lean:38-39`): `∑ m ∈ S, (1 : ℝ) / (m : ℝ)` over a `Finset ℕ`. Same pattern as `reciprocalSum` but takes a pre-built `Finset` rather than filtering a `Set` against an `Ico` range. +- **`reciprocalSum`** (Problem 296, `296.lean:44-45`): `∑ n ∈ A, (1 : ℚ) / (n : ℚ)` over `Finset ℕ` into `ℚ`. +- **`primeReciprocalSum`** (Problem 685, `685.lean:41-42`): reciprocals of primes in a range, into `ℝ`. + +These are all local to their own namespaces and differ in minor ways (underlying type `ℝ` vs `ℚ`, `Set` vs `Finset` input, range-filtering logic). A shared utility in `FormalConjecturesForMathlib` could in principle unify these, but the differences are small enough that the duplication is tolerable. No existing utility in `FormalConjecturesForMathlib/` directly applies here. + +Similarly, `divisorCountIn` follows a common pattern of `(n.divisors.filter P).card` seen in Problems 45, 449, 692, and 886, but each filters by a different predicate. No consolidation opportunity is clear-cut. + +**Verdict:** No actionable reuse opportunity. The current local definitions are appropriate. + +## 2. Citations + +The website (erdosproblems.com/444) lists: +- **[ErGr80]** as the problem source (p. 88) +- **[ErSa80]** as the proof source ("proved by Erdős and Sárkőzy") + +The formalization's docstring includes both: +- `[ErSa80] Erdős, P. and Sárkőzy, A., On the number of divisors of n!, 1980.` +- `[ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathematique, 1980.` + +These match the website's references. The full paper title for [ErSa80] is cited in abbreviated form; the website does not provide more detail, so this is acceptable. + +**Verdict:** Citations are complete and consistent with the website. + +## 3. Variants + +The website lists no variants, discussion, or alternative formulations for this problem. The formalization captures the single canonical statement. + +**Verdict:** No missing variants. + +## 4. Readability + +The code is well-organized: +- Two clearly named helper definitions (`divisorCountIn`, `reciprocalSum`) with docstrings including LaTeX. +- The main theorem docstring includes both the limsup formulation and the "equivalently" reformulation that is actually formalized, bridging the gap between the standard statement and the Lean encoding. +- The `∃ᶠ x in atTop` idiom is the standard Lean/Mathlib way to express "for arbitrarily large x," making the formalization idiomatic. + +Minor suggestion: The docstring for `reciprocalSum` says "in $[1, x)$" but the definition uses `Finset.Ico 1 x`, which is the half-open interval `{1, ..., x-1}`. This is consistent, but one could add a brief note that `0 ∉ A` is effectively enforced by the `Ico 1 x` filter (since 1/0 would be problematic). This is a very minor point. + +**Verdict:** Highly readable; no significant improvements needed. + +## 5. Formalizability + +The original problem is stated precisely: given an infinite set $A \subseteq \mathbb{N}$, the function $d_A(n)$, and the partial reciprocal sum, the limsup condition is unambiguous. + +The only minor source of ambiguity is what "for every $k$" means — positive integer? Non-negative integer? Real number? The formalization uses `k : ℕ` (non-negative integers). This is fully sufficient: since the reciprocal sum of an infinite set diverges, showing the result for all $k \in \mathbb{N}$ implies it for all real $k > 0$. (For any real $r > 0$, take integer $k \geq r$; for large $x$ the reciprocal sum exceeds 1, so $(\text{sum})^k \geq (\text{sum})^r$, meaning $d_A(n)/(\text{sum})^r \geq d_A(n)/(\text{sum})^k$.) + +**Verdict:** The problem is unambiguously formalizable. The choice of `k : ℕ` is sound. + +## 6. Correctness + +The formalization is mathematically correct. Detailed verification: + +**Equivalence to the limsup formulation.** The original states $\limsup_{x\to\infty} f(x) = \infty$ where $f(x) = \max_{n < x} d_A(n) / S(x)^k$ and $S(x) = \sum_{a \in A \cap [1,x)} 1/a$. This is equivalent to: for every $M > 0$, the set $\{x : f(x) > M\}$ is cofinal, i.e., $f(x) > M$ frequently. In turn, $f(x) > M$ means there exists $n < x$ with $d_A(n) > M \cdot S(x)^k$. The formalization captures exactly this with `∃ᶠ x in atTop, ∃ n, 1 ≤ n ∧ n < x ∧ M * (reciprocalSum A x) ^ k < ↑(divisorCountIn A n)`. + +**The `1 ≤ n` constraint.** This excludes $n = 0$. In Mathlib, `Nat.divisors 0 = ∅`, so `divisorCountIn A 0 = 0` regardless. The constraint is harmless and aligns with the standard mathematical convention that $d_A$ is defined on positive integers. + +**Strict vs. non-strict inequality.** The formalization uses strict inequality `M * ... < ...`. For the limsup being infinite, strict and non-strict are interchangeable (if limsup = ∞, then for any $M$, we can find values exceeding $M$, hence also exceeding $M$ strictly). No issue here. + +**Edge case: `reciprocalSum A x = 0`.** If $A \cap [1, x) = \emptyset$, the sum is 0. For $k \geq 1$, the condition becomes $0 < d_A(n)$, which is easily satisfiable. For $k = 0$, we get $M \cdot 1 < d_A(n)$, i.e., $d_A(n) > M$. Since $A$ is infinite, for large enough $x$ the reciprocal sum is positive, so the $k = 0$ case is also eventually non-vacuous. This is all consistent. + +**Type: `x : ℕ` vs. real parameter.** The original problem has $x \to \infty$ as a real parameter. Using $x : \mathbb{N}$ is equivalent for the limsup since the functions involved are piecewise constant between integers (divisor counts and the filtered sum are determined by the integer part of $x$). + +**Verdict:** The formalization is correct and complete. No mathematical flaws detected. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No actionable reuse; local definitions appropriate | +| Citations | Complete and match erdosproblems.com | +| Variants | None missing | +| Readability | Excellent | +| Formalizability | Unambiguous; `k : ℕ` is a sound choice | +| Correctness | Verified correct | + +**Overall: The formalization is faithful, clean, and mathematically sound. No changes recommended.** diff --git a/ai-review/445.md b/ai-review/445.md new file mode 100644 index 0000000000..ac16a19a3f --- /dev/null +++ b/ai-review/445.md @@ -0,0 +1,84 @@ +# Review: Erdős Problem 445 + +## 1. Code Reuse + +The formalization uses only standard Mathlib constructs: `Nat.Prime`, `Nat.ModEq` (via `[MOD p]`), real exponentiation (`^` / `rpow`), and coercions from `ℕ` to `ℝ`. No local helper definitions are introduced. + +Several other Erdős problems in the codebase use the same `[MOD p]` notation pattern (e.g., Problems 456, 280, 281, 689, 697), and the interval-with-real-exponent pattern appears in Problems 158 and 40. However, none of these define reusable abstractions — they all inline their modular and interval conditions directly, as Problem 445 does. + +No utilities in `FormalConjecturesForMathlib/` directly apply (there is no shared "modular inverse in an interval" definition, nor would one be warranted for a single use). + +**Verdict:** No reuse opportunity. The formalization is appropriately self-contained. + +## 2. Citations + +The website ([erdosproblems.com/445](https://www.erdosproblems.com/445)) lists: +- **[ErGr80]** (p. 89) as the original problem source — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique, 1980. +- **[He00]** Heath-Brown — proved the conjecture for all $c > 3/4$ using Kloosterman sums. + +The formalization's docstring mentions only `[He00]` (in the main theorem docstring). The original source **[ErGr80]** is not cited. + +**Verdict:** Missing citation. The docstring should add `[ErGr80]` as the problem source, consistent with the website. The header docstring should reference both `[ErGr80]` and `[He00]`. + +## 3. Variants + +The website lists no variants or alternative formulations. The single canonical conjecture (for all $c > 1/2$) is the only statement. The partial results by Heilbronn ($c$ close to 1) and Heath-Brown ($c > 3/4$) are weakenings, not distinct variants. + +**Verdict:** No missing variants. + +## 4. Readability + +The code is clear and well-structured. A few observations: + +- The `ℕ → ℝ` coercions are verbose (`(n : ℝ) < (a : ℝ) ∧ (a : ℝ) < (n : ℝ) + (p : ℝ) ^ c`) but this is unavoidable in Lean when mixing natural number arithmetic with real exponentiation. The casting is explicit and correct. +- The quantifier structure directly mirrors the mathematical statement: universal over $c$, existential over the threshold $P_0$, universal over primes $p$ and shifts $n$, existential over the witnesses $a, b$. +- The use of `answer(sorry)` for an open problem is idiomatic. + +One minor suggestion: the four interval conditions for $a$ and $b$ could be visually grouped (e.g., with line breaks) to make it immediately obvious that the same interval constraint applies to both. Currently the conjunctive chain reads naturally, but grouping would aid scanning. + +**Verdict:** Good readability. No significant improvements needed. + +## 5. Formalizability + +The problem is precisely stated and directly formalizable: +- "$c > 1/2$" — a real parameter with a clear bound. +- "sufficiently large prime" — standard number theory phrasing meaning $\exists P_0, \forall p \geq P_0$ with $p$ prime. The threshold $P_0$ implicitly depends on $c$, which the formalization correctly captures by placing `∃ P₀` inside `∀ c`. +- "$(n, n + p^c)$" — an open interval in $\mathbb{R}$, intersected with $\mathbb{N}$. +- "$ab \equiv 1 \pmod{p}$" — standard modular arithmetic. + +There is no ambiguity in the statement. Every quantifier, bound, and relation has a single natural interpretation. + +**Verdict:** Unambiguously formalizable. No ambiguity issues. + +## 6. Correctness + +The formalization is mathematically correct. Detailed verification: + +**Quantifier structure.** The statement `∀ c > 1/2, ∃ P₀, ∀ p prime with p ≥ P₀, ∀ n ∈ ℕ, ∃ a b ...` exactly matches the standard reading of "for any $c > 1/2$, for sufficiently large primes $p$, for any $n \geq 0$." The threshold $P_0$ depends on $c$ (correctly scoped inside the universal quantifier on $c$). + +**Interval encoding.** The conditions `(n : ℝ) < (a : ℝ)` and `(a : ℝ) < (n : ℝ) + (p : ℝ) ^ c` encode $a \in (n, n + p^c)$ as an open interval, matching the mathematical notation $(n, n + p^c)$. Since $a : \mathbb{N}$ and $n : \mathbb{N}$, the strict lower bound $n < a$ is equivalent to $a \geq n + 1$, correctly excluding $a = n$. The same applies to $b$. + +**Modular condition.** `a * b ≡ 1 [MOD p]` in Lean's `Nat.ModEq` means `(a * b) % p = 1 % p`. Since $p$ is prime (hence $p \geq 2$), we have `1 % p = 1`, so this correctly encodes $ab \equiv 1 \pmod{p}$. + +**Domain of $a$ and $b$.** Both are natural numbers with $a \geq n + 1 \geq 1$ and $b \geq n + 1 \geq 1$. So $a, b \geq 1$, ensuring the modular inverse condition is non-degenerate ($0$ has no modular inverse). The problem does not require $a \neq b$, and the formalization correctly allows $a = b$ (which would mean $a^2 \equiv 1 \pmod{p}$, i.e., $a \equiv \pm 1 \pmod{p}$). + +**Real exponentiation.** `(p : ℝ) ^ c` uses Lean's real-number `rpow`. For $p \geq 2$ (prime) and $c > 1/2$, this is well-defined and positive. The interval $(n, n + p^c)$ has length $p^c > p^{1/2} = \sqrt{p}$, which grows with $p$, ensuring the interval contains integers for large $p$. + +**Edge case: $n = 0$.** The interval becomes $(0, p^c)$, so $a, b \in \{1, 2, \ldots, \lfloor p^c \rfloor\}$ (if $p^c$ is not an integer) or $\{1, \ldots, p^c - 1\}$ (if it is). This is the base case of the conjecture and is correctly handled. + +**The `answer(sorry)` wrapper.** Since the problem is open (the answer — true or false — is unknown), `answer(sorry)` correctly leaves the Boolean answer undetermined. The biconditional `answer(sorry) ↔ ...` means that if the answer is `True`, the mathematical statement holds, and if `False`, its negation holds. This is the standard encoding for open problems in this codebase. + +**Verdict:** The formalization is correct and complete. No mathematical flaws detected. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunity; appropriately self-contained | +| Citations | **Missing [ErGr80]** as problem source; only [He00] cited | +| Variants | None missing | +| Readability | Good; coercions are verbose but necessary | +| Formalizability | Unambiguous; directly formalizable | +| Correctness | Verified correct | + +**Overall: The formalization is mathematically faithful and correct. The only recommended change is adding the [ErGr80] citation to the docstring to match the website's references.** diff --git a/ai-review/446.md b/ai-review/446.md new file mode 100644 index 0000000000..b25c768b6c --- /dev/null +++ b/ai-review/446.md @@ -0,0 +1,131 @@ +# AI Review: Erdős Problem 446 + +**File:** `FormalConjectures/ErdosProblems/446.lean` + +--- + +## 1. Code Reuse + +**Density infrastructure:** The codebase has a well-developed density library in `FormalConjecturesForMathlib/Data/Set/Density.lean` providing `Set.HasDensity`, `partialDensity`, `upperDensity`, and `lowerDensity`. Problem 446 instead defines density inline via `Filter.Tendsto (fun N => (countWithDivisor n N : ℝ) / N) atTop (nhds δ)`. This is semantically equivalent to `Set.HasDensity` but uses a bespoke counting function rather than the set-based formulation. The inline approach is defensible here because the density depends on a parameter `n` (i.e., δ is a function of n, not a fixed set), but it could be refactored to use `Set.HasDensity` on the set `{m : ℕ | ∃ d ∈ Finset.Ioo n (2*n), d ∣ m}` for consistency. + +**Divisor counting:** Problem 692 defines `countDivisorsInOpenInterval` using `Nat.divisors` filtered by a predicate, while 446 uses `Finset.Ioo n (2*n)` filtered by divisibility. These are dual formulations of the same concept—692 iterates over divisors of m checking the interval, while 446 iterates over the interval checking divisibility. Problem 693 defines `HasDivisorIn` as a `Prop` (`∃ d, d ∣ m ∧ n < d ∧ d < 2 * n`), which is the propositional form of what `countWithDivisor` computes. There is an opportunity to unify these definitions across problems 446, 692, and 693. + +**Recommendation:** Consider extracting a shared `HasDivisorInInterval` predicate and a shared divisor-count function into a utility file, since at least three Erdős problems (446, 692, 693) use essentially the same concept. + +## 2. Citations + +The website lists the following references for Problem 446: +- Besicovitch (1934): proved liminf δ(n) = 0 +- Erdős (1935): proved δ(n) = o(1) +- Erdős (1960): proved δ(n) = (log n)^{-α+o(1)} +- Tenenbaum (1984): refined Erdős's estimate +- Ford (2008): determined the exact growth rate and disproved δ₁(n) = o(δ(n)) + +The docstring references match the website: +- **[Be34]** — matches Besicovitch 1934. No full citation given on the website either; shorthand is acceptable. +- **[Er35]** — matches Erdős 1935. +- **[Er60]** — matches Erdős 1960. +- **[Te84]** — matches Tenenbaum 1984. +- **[Fo08]** — matches Ford 2008. + +The website also lists related problems **#448**, **#692**, and **#693**. The docstring does not mention these cross-references but this is stylistic, not a deficiency. + +**Assessment:** Citations are adequate. The shorthand tags match the website's references. Full bibliographic entries (journal names, page numbers) are not provided, but this is consistent with the website's own level of detail. + +## 3. Variants + +The website poses two questions: +1. What is the growth rate of δ(n)? — Captured by `erdos_446` (Ford's asymptotic). +2. Is δ₁(n) = o(δ(n))? — Captured by `erdos_446.variants.disproof` (Ford's disproof, generalized to δ_r). + +The formalization actually captures the *stronger* version of the disproof: Ford showed δ_r(n) ≫_r δ(n) for all r ≥ 1, not just r = 1. This is a good choice—it subsumes the original conjecture's negation. + +**Missing variants:** The website does not list additional variants beyond these two. The earlier historical results (Besicovitch's liminf = 0, Erdős's o(1) result) are weaker predecessors rather than separate conjectures, so their omission as formal theorems is reasonable. + +**Assessment:** All variants from the website are captured. The disproof variant is appropriately generalized. + +## 4. Readability + +**Strengths:** +- Clear, well-structured docstrings with LaTeX formulas +- Helper definitions (`countWithDivisor`, `countWithExactDivisors`, `erdos446Alpha`) are cleanly separated +- The namespace `Erdos446` avoids name collisions +- The constant α is given its own definition with an explanatory docstring + +**Suggestions:** +- The docstring for `erdos_446` says "converges (as N → ∞) to a value δ(n)" — this is good informal explanation of the `Tendsto` statement. +- `countWithDivisor` iterates over `Finset.Ioo n (2 * n)` for each m, which is correct but computationally less natural than iterating over divisors of m. For a formalization this is fine since we only need the mathematical statement. +- Minor: the `3 / 2` exponent is written as `((3 : ℝ) / 2)` which is correct but slightly verbose. This is necessary for type coercion, so it's acceptable. + +**Assessment:** Readability is good. No significant improvements needed. + +## 5. Formalizability + +The problem as stated on the website is: + +> Let δ(n) denote the density of integers which have a divisor in (n, 2n). How fast does δ(n) → 0? Is it true that δ₁(n) = o(δ(n))? + +**Question 1 (growth rate):** The phrase "how fast does δ(n) → 0" is imprecise—it's an open-ended question rather than a conjecture. The formalization resolves this by encoding Ford's answer (the exact asymptotic), which is the definitive result. This is a reasonable choice: formalizing "how fast" as "the answer is X" is the only sensible approach. + +**Question 2 (δ₁ = o(δ)):** This is a precise yes/no conjecture. The formalization encodes its negation (since Ford disproved it), which is correct. + +**Potential ambiguity:** The notion of "density" could mean natural density (the limit of the counting proportion) or upper/lower density. The formalization assumes the limit exists (via `Tendsto ... (nhds δ)`), which is mathematically justified since Ford's work establishes that the natural density exists for each n. However, this existence is itself a nontrivial fact that is being assumed within the `∃ δ` quantifier—the theorem asserts both existence and bounds simultaneously, which is appropriate. + +**Assessment:** The original problem is somewhat informal ("how fast does δ(n) → 0?"), but the formalization correctly resolves the ambiguity by encoding the known answer. Formalizability is high. Score: **4/5** (minor inherent ambiguity in the original problem statement, well-resolved). + +## 6. Correctness + +### Theorem `erdos_446` (Ford's asymptotic) + +**Structure:** ∃ C₁ C₂ > 0, ∃ n₀, ∀ n ≥ n₀, ∃ δ such that: +- δ is the natural density of integers with a divisor in (n, 2n) +- C₁/f(n) ≤ δ ≤ C₂/f(n) where f(n) = (log n)^α · (log log n)^{3/2} + +This correctly encodes δ(n) ≍ 1/f(n), i.e., the two-sided asymptotic from Ford (2008). + +**The constant α:** Defined as `1 - (1 + log(log 2)) / log 2`. Let's verify: +- α = 1 - (1 + log log 2) / log 2 +- = 1 - 1/log 2 - log(log 2)/log 2 +- = 1 - log₂(e) - log₂(log 2) + +This matches the standard definition. Ford's paper gives α = 1 - (1 + log log 2)/log 2 ≈ 0.08607. ✓ + +**Potential issue — `countWithDivisor` definition:** The function counts m ∈ [1, N] such that there exists d ∈ (n, 2n) with d | m. This iterates d over `Finset.Ioo n (2*n)` and checks d | m. This is correct: it counts positive integers up to N having at least one divisor strictly between n and 2n. + +**Subtle point:** The standard formulation uses the open interval (n, 2n), meaning divisors d with n < d < 2n. The code uses `Finset.Ioo n (2*n)` which in ℕ gives {n+1, n+2, ..., 2n-1}. This is correct for the open interval on natural numbers. ✓ + +**Potential issue — density existence:** The theorem asserts `∃ δ` with `Tendsto ... (nhds δ)`. This means the natural density exists. Ford's theorem does imply this. However, a reviewer might note that the *existence* of the density is itself a significant result that is bundled into the theorem statement rather than being stated separately. This is not incorrect, but it makes the theorem slightly stronger than just "δ(n) ≍ 1/f(n)" — it also asserts that δ(n) is well-defined as a limit. This is mathematically fine since Ford proves this. ✓ + +### Theorem `erdos_446.variants.disproof` + +**Structure:** ∀ r ≥ 1, ∃ c > 0, ∃ n₀, ∀ n ≥ n₀, ∃ δ δ_r such that: +- δ is the natural density (at least one divisor in (n, 2n)) +- δ_r is the natural density (exactly r divisors in (n, 2n)) +- δ_r ≥ c · δ + +This correctly encodes δ_r(n) ≫_r δ(n). The constant c depends on r (it's inside the ∀ r quantifier), matching the ≫_r notation. ✓ + +**Note on the disproof:** The original conjecture was δ₁(n) = o(δ(n)). Ford's result δ₁(n) ≥ c · δ(n) for large n directly contradicts this. The formalization generalizes to all r ≥ 1, which is what Ford actually proved. ✓ + +**Potential issue — density existence for δ_r:** Same as above; the theorem asserts that δ_r(n) exists as a limit. Ford's work establishes this. ✓ + +### Overall Mathematical Assessment + +The formalization is **mathematically correct and complete**. Both the main asymptotic and the disproof variant faithfully encode the results from Ford (2008). The helper definitions are correct. The constant α is properly defined. + +No flaws identified. The only minor observation is that density existence is bundled into the theorem statements rather than being stated as a separate lemma, but this is a stylistic choice, not an error. + +**Correctness score: 5/5** + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Opportunity to share definitions with problems 692/693; could use `Set.HasDensity` | +| Citations | Match the website; shorthand format is consistent | +| Variants | All captured; disproof is appropriately generalized | +| Readability | Good; clean structure with well-documented helpers | +| Formalizability | High (4/5); original problem is slightly informal but well-resolved | +| Correctness | Excellent (5/5); no mathematical errors found | diff --git a/ai-review/447.md b/ai-review/447.md new file mode 100644 index 0000000000..97897b5cf5 --- /dev/null +++ b/ai-review/447.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 447 + +## 1. Code Reuse + +Problem 1023 (`FormalConjectures/ErdosProblems/1023.lean`) defines a related but distinct concept `IsUnionFreeFamily`, which forbids any member from being the union of a non-empty sub-collection of other members (i.e., unions of arbitrary arity). Problem 447's `UnionFreeFamily` only forbids pairwise unions: three distinct A, B, C with A ∪ B = C. These are genuinely different mathematical notions, so the definitions cannot be unified. However, two issues arise: + +- **Naming inconsistency**: Problem 447 uses `UnionFreeFamily` while Problem 1023 uses `IsUnionFreeFamily`. Lean/Mathlib convention favors the `Is` prefix for predicates. Problem 447 should be renamed to `IsUnionFreeFamily` (or both should adopt a consistent scheme that distinguishes the two concepts, e.g., `IsPairwiseUnionFreeFamily` vs `IsUnionFreeFamily`). +- **No shared infrastructure**: Both files define their union-free concepts locally within their own namespaces. If a shared `SetFamily` utility module existed, both could be defined there. No such module currently exists in the codebase, and creating one for just two definitions would be over-engineering. + +No other existing definitions in `FormalConjecturesForMathlib/` are directly reusable here. + +## 2. Citations + +The formalization's docstring references: + +> [Kl71] Kleitman, D., *No four subsets forming an N*, J. Combinatorial Theory Ser. A 5 (1968), 313-318. + +Issues identified: + +- **Citation key / year mismatch**: The key `[Kl71]` implies a 1971 publication, but the bibliographic entry says 1968. This discrepancy should be investigated and corrected. +- **Anachronistic series designation**: The *Journal of Combinatorial Theory* did not split into Series A and Series B until 1971. A 1968 paper should be cited as "J. Combinatorial Theory" without "Ser. A." +- **Missing Erdős source references**: The website lists [Er61], [Er65b], [Er71, p.106] as sources where Erdős posed the problem. The formalization only mentions [Kl71]. Adding at least one Erdős source reference would improve traceability. +- **Website relationship note**: The website notes that Problem 447 is related to Problem 1023 and Problem 487. The formalization does not cross-reference these related problems. + +## 3. Variants + +The website poses two questions of increasing strength: + +1. **Weak form**: Must |F| = o(2^n)? +2. **Strong form** (the actual conjecture): |F| < (1 + o(1)) · C(n, ⌊n/2⌋)? + +The formalization captures only the strong form (2), which subsumes the weak form. Since the strong form is what was conjectured and proved (by Kleitman), this is appropriate. The weak form does not need separate formalization. + +The website also notes that the weaker bound o(2^n) was proved by Sárkőzy and Szemerédi (unpublished) and has implications for sets of positive density (connecting to Problem 487). This context is not captured in the formalization but is informational rather than a missing variant. + +## 4. Readability + +The code is clean and readable overall. Minor observations: + +- The docstring is well-structured with a clear mathematical statement. +- The `UnionFreeFamily` definition has a clear accompanying docstring explaining the concept. +- The `A ≠ B` hypothesis in the definition is logically redundant (if A = B then A ∪ B = A, and A ≠ C ensures A ∪ B ≠ C), but its inclusion improves readability by making the "three distinct sets" requirement explicit. This is a reasonable style choice. +- The type signature `{α : Type*} [DecidableEq α] (F : Finset (Finset α)) : Prop` is more general than needed for the theorem (which uses `Fin n`), but this generality is good practice. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: +- "Union-free" has a clear combinatorial definition (no three distinct A, B, C with A ∪ B = C). +- The bound (1 + o(1)) · C(n, ⌊n/2⌋) has a standard meaning, correctly rendered as an ε-N₀ formulation. +- The ground set [n] is naturally modeled as `Fin n`. + +There is no ambiguity in the statement that could lead to alternative formalizations. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization accurately captures the mathematical content: + +- **Definition correctness**: `UnionFreeFamily` correctly encodes the condition that no three pairwise distinct members A, B, C satisfy A ∪ B = C. The pairwise distinctness conditions (A ≠ B, A ≠ C, B ≠ C) correctly model "distinct A, B, C." +- **Theorem statement**: The ε-N₀ formulation correctly captures the asymptotic bound |F| ≤ (1 + o(1)) · C(n, ⌊n/2⌋). The use of ≤ rather than < is appropriate since we are comparing integers to a real-valued bound with a (1 + ε) factor. +- **Ground set**: Using `Finset (Fin n)` correctly models subsets of an n-element set. +- **Floor division**: `n / 2` in Lean's natural number division is equivalent to ⌊n/2⌋, which is correct. +- **Casting**: The cast `(F.card : ℝ)` and `(Nat.choose n (n / 2) : ℝ)` correctly lift to reals for the inequality with the (1 + ε) factor. + +**One subtle point**: The theorem only states the upper bound direction. The matching lower bound — that the middle layer C(n, ⌊n/2⌋) is itself union-free — is trivially true (a single antichain layer has no unions within it) and is not part of the conjecture. The formalization is correct in stating only the upper bound. + +No mathematical flaws identified. diff --git a/ai-review/448.md b/ai-review/448.md new file mode 100644 index 0000000000..c0676dbfee --- /dev/null +++ b/ai-review/448.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 448 + +## 1. Code Reuse + +The codebase provides a well-developed density library at `FormalConjecturesForMathlib/Data/Set/Density.lean` with: +- `Set.upperDensity` (line 51) — limsup-based upper density +- `Set.lowerDensity` (line 60) — liminf-based lower density +- `Set.HasDensity` (line 86) — convergence of partial density to a value +- `Set.partialDensity` (line 37) — proportion of elements in a set below a bound + +The main theorem `erdos_448` manually inlines the concept of "density zero" using `∀ δ > 0, ∃ N₀, ∀ N ≥ N₀, (count / N) < δ`, and the variant `upper_density` manually inlines "positive upper density" using `∃ c > 0, ∀ N₀, ∃ N ≥ N₀, c ≤ count/N`. Both could be expressed more concisely using the existing library definitions: + +- The RHS of `erdos_448` is equivalent to: `∀ ε > 0, {n : ℕ | (tauPlus n : ℝ) ≥ ε * (n.divisors.card : ℝ)}.HasDensity 0` +- The variant is equivalent to: `∀ ε > 0, 0 < {n : ℕ | ...}.upperDensity` + +Note that `Erdos122.HasNaturalDensityZero` (problem 122, line 53) also inlines density zero rather than using the library, so this is a recurring pattern. Nonetheless, using the library would improve consistency and enable reuse of existing lemmas (e.g., `HasDensity.mono`, `hasDensity_zero_of_finite`). + +There is a minor discrepancy: the library's `partialDensity` uses `Set.Iio` (elements strictly less than `b`), while the formalization uses `Finset.Icc 1 N` (elements from 1 to N inclusive). These define the same notion of natural density in the limit, but switching to the library would require verifying this equivalence or adjusting the convention. + +## 2. Citations + +The formalization references: +- **[ErTe81]** — Erdős and Tenenbaum (1981), for the disproof and asymptotic lower bound on upper density. +- **[HaTe88]** — Hall and Tenenbaum (1988), for the upper bound and distribution function result. + +The website (erdosproblems.com/448) lists additional source references: +- **[Er79]** — Erdős, P. (1979) +- **[Er79e]** — Erdős, P. (1979), separate paper +- **[ErGr80]** — Erdős, P. and Graham, R. L. (1980), p. 89 +- **[Er81h]** — Erdős, P. (1981), p. 173 + +These are the original sources where Erdős posed the problem. The formalization does not mention them — only the papers that resolved it. For completeness, the docstring should reference the original problem sources (at minimum [ErGr80] as the canonical Erdős–Graham reference). + +The website also mentions **Ford (2008)** who answered a follow-up question about `∑_{n≤x} τ⁺(n)`, proving an asymptotic formula involving `x(log x)^{1−α}/(log log x)^{3/2}` where `α = 1 − (1 + log log 2)/log 2 ≈ 0.08607`. This is not mentioned in the formalization. + +## 3. Variants + +**Captured:** +- The original question (disproved): `erdos_448` +- The Erdős–Tenenbaum qualitative result (positive upper density for each ε): `erdos_448.variants.upper_density` + +**Not captured:** +- **Quantitative Erdős–Tenenbaum bound**: The upper density of {n : τ⁺(n) ≥ ετ(n)} is ≍ ε^{1−o(1)} as ε → 0. The formalization only captures positivity, not the asymptotic behavior. +- **Hall–Tenenbaum upper bound**: The upper density is ≪ ε·log(2/ε). Mentioned in the docstring but not formalized. +- **Hall–Tenenbaum distribution function**: τ⁺(n)/τ(n) has a distribution function (i.e., the natural density of {n : τ⁺(n)/τ(n) ≤ t} exists for all t ∈ ℝ). Mentioned in the docstring but not formalized. This is a natural and important variant to consider formalizing. +- **Ford's asymptotic for ∑τ⁺(n)**: Not mentioned at all. +- **Related problems**: The website notes connections to problems #446 and #449. These are not cross-referenced. + +## 4. Readability + +The code is generally readable. Specific observations: + +- **`tauPlus` definition is clear**: The docstring correctly explains the mathematical meaning, and the implementation directly mirrors the definition. +- **The `Finset.range n` bound in `tauPlus`**: While mathematically correct (since all divisors d of n satisfy d ≤ n, so 2^k ≤ d implies k ≤ log₂(n) < n for n ≥ 1), this is a non-obvious implementation detail. A brief comment explaining why `range n` suffices would help. +- **Inline density definitions**: As noted above, the manual encoding of "density zero" and "positive upper density" is more verbose and less immediately recognizable than using the library abstractions. An experienced Lean user familiar with the codebase would need to mentally verify equivalence with standard density notions. +- **Naming**: `erdos_448.variants.upper_density` is clear and follows the codebase conventions. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: +- τ(n) is the standard divisor-counting function — unambiguous. +- τ⁺(n) is explicitly defined as the count of k ∈ ℕ with n having a divisor in [2^k, 2^{k+1}) — unambiguous. +- "Almost all n" in analytic number theory standardly means "density 1" (equivalently, the exceptional set has density 0) — well-established convention with no real ambiguity. +- The question is a yes/no question with a known answer (No). + +The only minor point: the original problem uses "almost all" without specifying which notion of density. In analytic number theory this universally means natural (asymptotic) density, which is what the formalization uses. No ambiguity issue. + +## 6. Correctness + +**Main theorem (`erdos_448`): Correct.** + +The formalization states `answer(False) ↔ P` where P is the original conjecture ("for all ε > 0, τ⁺(n) < ετ(n) for almost all n", expressed as density zero of the exceptional set). Since the problem was disproved, `answer(False)` = `False`, so proving `False ↔ P` is equivalent to proving `¬P`, which is the correct mathematical content. + +The density-zero encoding `∀ δ > 0, ∃ N₀, ∀ N ≥ N₀, (count in [1,N])/N < δ` correctly captures that the natural density of the exceptional set is 0. Note the use of `Finset.Icc 1 N` (starting from 1, not 0), which is appropriate since τ and τ⁺ are typically considered for positive integers. + +**`tauPlus` definition: Correct.** + +For n ≥ 1, the set of relevant k values is bounded by log₂(n) < n, so `Finset.range n` captures all of them. For n = 0, `Nat.divisors 0 = ∅` in Lean/Mathlib, so `tauPlus 0 = 0`, which is a harmless convention (n = 0 is excluded by `Finset.Icc 1 N` in the theorem statements anyway). + +**Variant (`upper_density`): Correct.** + +The statement correctly captures: for every ε > 0, the upper density of {n : τ⁺(n) ≥ ε·τ(n)} is positive. The encoding `∃ c > 0, ∀ N₀, ∃ N ≥ N₀, c ≤ count/N` is the standard ε-δ formulation of "the limsup of count/N is at least c > 0", which is equivalent to positive upper density. + +**One subtle point**: The variant uses `≥` in `(tauPlus n : ℝ) ≥ ε * (n.divisors.card : ℝ)` while the original problem uses strict inequality `<` in τ⁺(n) < ετ(n). The set {n : τ⁺(n) ≥ ετ(n)} is the complement of {n : τ⁺(n) < ετ(n)}. Since τ⁺ and τ are integer-valued, replacing ≥ with > would change the set only for n where τ⁺(n)/τ(n) = ε exactly, a measure-zero event for irrational ε and irrelevant for density purposes. So the use of ≥ vs > is immaterial here. **No correctness issue.** + +**Overall: The formalization is mathematically correct and complete for what it aims to capture.** The main gap is that the richer quantitative results (asymptotic bounds on the upper density, existence of the distribution function) are mentioned in the docstring but not formalized. diff --git a/ai-review/449.md b/ai-review/449.md new file mode 100644 index 0000000000..aa5ffe4add --- /dev/null +++ b/ai-review/449.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 449 + +## 1. Code Reuse + +**Density infrastructure.** The formalization manually encodes "density zero" inline via an ε-δ formulation (`∀ δ > 0, ∃ N₀, ∀ N ≥ N₀, |bad set ∩ [1,N]| / N < δ`). The codebase already provides a well-developed density library in `FormalConjecturesForMathlib/Data/Set/Density.lean` with `Set.HasDensity`, `Set.HasPosDensity`, `Set.upperDensity`, and `Set.lowerDensity`. The main theorem could be reformulated as: + +```lean +{n : ℕ | (closeDivisorPairs n : ℝ) ≥ ε * (n.divisors.card : ℝ)}.HasDensity 0 +``` + +Problem 448 (`ErdosProblems/448.lean`) uses the same manual ε-δ encoding, so the two problems are at least internally consistent, but both would benefit from using the centralized density definitions. + +**Divisor count notation.** The formalization uses `n.divisors.card` for τ(n). Problem 945 defines `abbrev τ := fun (n : ℕ) => n.divisors.card`, and Mathlib provides `σ 0` as the divisor count function. Using one of these would improve consistency across the codebase, though this is a minor point. + +**Problem 448 definitions.** Problem 449 is logically derived from 448 via Cauchy-Schwarz, and 448 defines `tauPlus`. The stronger variant of 449 (see §3) could reference `Erdos448.tauPlus` and the Cauchy-Schwarz connection, making the logical dependency explicit. + +**Divisor pair patterns.** Problems 884 and 1100 also use `(n.divisors ×ˢ n.divisors).filter` for divisor pair operations. No common abstraction exists, but the pattern is idiomatic for this codebase. + +## 2. Citations + +The website ([erdosproblems.com/449](https://www.erdosproblems.com/449)) lists the following references: + +- **ErGr80**, p. 89 (Erdős–Graham) +- **HaTe88**, Section 4.6 (Hall–Tenenbaum) + +The current formalization docstring does not cite these references. It mentions "[448]" as a cross-reference and attributes the disproof to Kevin Ford, which is consistent with the website. However, the docstring should include the full reference tags: + +**Suggested docstring addition:** +``` +*References:* P. Erdős and R.L. Graham [ErGr80], p. 89; +R.R. Hall and G. Tenenbaum [HaTe88], Section 4.6. +``` + +## 3. Variants + +**Missing positive-density variant.** The website states a stronger result: "For any constant $K > 0$, we have $r(n) > K\tau(n)$ for a positive density set of $n$." Problem 448 includes an analogous `erdos_448.variants.upper_density` theorem that captures the stronger positive-density result. Problem 449 should have a corresponding variant, e.g.: + +```lean +theorem erdos_449.variants.positive_density : + ∀ K : ℝ, K > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ N₀ : ℕ, ∃ N : ℕ, N₀ ≤ N ∧ + c ≤ ((Finset.Icc 1 N).filter (fun n => + (closeDivisorPairs n : ℝ) > K * (n.divisors.card : ℝ))).card / (N : ℝ) +``` + +Or, using the density infrastructure: + +```lean +theorem erdos_449.variants.positive_density : + ∀ K : ℝ, K > 0 → + {n : ℕ | (closeDivisorPairs n : ℝ) > K * (n.divisors.card : ℝ)}.HasPosDensity +``` + +**Missing Cauchy-Schwarz connection.** The website notes the key inequality $r(n) + \tau(n) \geq \tau(n)^2 / \tau^+(n)$ (via Cauchy-Schwarz), which connects 449 to 448. This could be captured as a lemma, making the logical relationship between the two problems explicit in the formalization. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The docstring for `closeDivisorPairs` is clear and matches the mathematical definition well. +- The main theorem docstring could mention the Cauchy-Schwarz connection to Problem 448 more explicitly, and include the key inequality. +- Using the `Set.HasDensity` API (§1) would make the theorem statement shorter and more declarative. + +## 5. Formalizability + +**Assessment: Fully formalizable, no ambiguity.** + +The problem statement is entirely precise: +- $r(n)$ is a concrete, computable function on natural numbers. +- $\tau(n)$ is the standard divisor count function. +- "Almost all $n$" has the standard number-theoretic meaning: the set of exceptions has natural density zero. +- The disproof is a concrete negation: the existence of ε > 0 such that the exceptional set has positive upper density. + +There is no ambiguity in the statement. All components are elementary and have standard formalizations. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`closeDivisorPairs` definition (lines 40–41):** Counts ordered pairs $(d_1, d_2)$ from `n.divisors × n.divisors` with $d_1 < d_2 \wedge d_2 < 2d_1$. This exactly matches the mathematical definition of $r(n)$. The use of `<` (strict inequality) on both sides is correct per the problem statement. + +- **Main theorem (lines 48–54):** The RHS formalizes "for every $\varepsilon > 0$, the set $\{n : r(n) \geq \varepsilon\tau(n)\}$ has natural density zero." This is the standard ε-δ characterization of density zero: for every δ > 0, eventually the proportion of elements in [1, N] satisfying the condition is less than δ. This correctly captures "almost all $n$." + +- **`answer(False)` usage:** Since the answer to the question is "No" (the conjecture was disproved), `answer(False) ↔ P` requires P to be `False`, i.e., the formalized conjecture does not hold. This is correct: the conjecture that $r(n) < \varepsilon\tau(n)$ for almost all $n$ is indeed false. + +- **Edge cases:** `Finset.Icc 1 N` correctly excludes $n = 0$. `Nat.divisors 0 = ∅` in Mathlib, so `closeDivisorPairs 0 = 0`, but this is moot since 0 is excluded from the range. + +- **Division by N:** The expression `.card / (N : ℝ)` uses real division, which is correct. When N = 0, `Finset.Icc 1 0 = ∅`, so both numerator and denominator are 0, yielding `0 / 0 = 0 < δ`, which is vacuously fine (and N₀ can always be chosen ≥ 1). + +**No mathematical flaws identified.** The formalization is a faithful encoding of the original problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `Set.HasDensity` from density library; minor | +| Citations | Missing ErGr80 and HaTe88 references | +| Variants | Missing positive-density variant (cf. 448's `upper_density`) and Cauchy-Schwarz lemma | +| Readability | Good; would benefit slightly from density API | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete for the main statement | diff --git a/ai-review/45.md b/ai-review/45.md new file mode 100644 index 0000000000..83653e7604 --- /dev/null +++ b/ai-review/45.md @@ -0,0 +1,161 @@ +# Review: Erdős Problem 45 + +**File:** `FormalConjectures/ErdosProblems/45.lean` + +--- + +## 1. Code Reuse + +**Issue: The reciprocal sum `∑ d ∈ D', (1 : ℚ) / (d : ℚ)` is written inline rather than using the shared `reciprocalSum` definition.** + +`FormalConjectures/ErdosProblems/296.lean` (line 44) defines: +```lean +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) +``` + +The theorem statement in Problem 45 (line 58) uses the identical expression inline. The same inline pattern also appears in Problem 46 (line 47) and Problem 47 (line 54, over `ℝ`). Problem 300 defines a related `Egyptian1Free` predicate (line 39) that also uses the same sum pattern over `ℝ`. + +**Recommendation:** Consider promoting `reciprocalSum` to a shared utility (e.g., in `FormalConjecturesForMathlib` or `Util`) and reusing it in Problems 45, 46, 296, and any other unit-fraction problems. Alternatively, at minimum, import and use the definition from Problem 296. Note that Problems 47 and 300 compute the sum over `ℝ` rather than `ℚ`, so a shared definition would either need to be polymorphic or exist in two versions. + +**`middleDivisors` is appropriately defined locally.** It is specific to this problem (divisors strictly between 1 and n) and does not appear in other problems. It correctly uses `Nat.divisors` from Mathlib with a filter, which is the idiomatic approach. + +**Structural similarity with Problem 46:** Problem 46 (`FormalConjectures/ErdosProblems/46.lean`) is the "infinite" version of the same result — coloring all integers ≥ 2 instead of divisors of a specific n. Both are proved by Croot [Cr03]. The two formalizations use slightly different coloring conventions (`Fin k` vs `α : Type* [Finite α]`), which is a minor stylistic inconsistency. See §6 for further discussion. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/45](https://www.erdosproblems.com/45):** + +The website lists: +- **Status:** Solved (proved by Croot) +- **Tags:** Number theory, Unit fractions +- **References:** Er95, Er96b, Gu04 (Guy's *Unsolved Problems in Number Theory*, Problem B2), Cr03 +- **Additional notes:** Upper bound n_k ≤ e^{C^k}; doubly exponential lower bound by Sawhney + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved]` | Solved | **Correct.** | +| AMS classification | `AMS 5 11` | Number theory / Unit fractions | **Correct.** | +| Croot [Cr03] | Full citation in docstring | Cr03 | **Correct.** Full bibliographic details provided (journal, volume, year, pages). | +| Er95, Er96b | Not mentioned | Listed as references | **Missing.** The original Erdős references are not cited. | +| Gu04 (Guy) | Not mentioned | Listed as reference | **Missing.** Guy's *Unsolved Problems in Number Theory* (Problem B2) is not cited. | +| Sawhney lower bound | Not mentioned | Noted on website | **Missing.** The doubly exponential lower bound by Sawhney is not mentioned. | + +**Recommendation:** Add the original Erdős references [Er95], [Er96b] and Guy's reference [Gu04] to the docstring for completeness. Consider mentioning Sawhney's lower bound result as additional context. + +--- + +## 3. Variants + +Two notable variants/extensions are absent from the formalization: + +**1. Quantitative bounds on n_k:** +The website notes that the proof gives an upper bound n_k ≤ e^{C^k} for some constant C > 1 (achieved by taking the LCM of [1, C^k]), and Sawhney established a matching doubly exponential lower bound, making this essentially sharp. These could be formalized as: +```lean +theorem erdos_45_upper_bound : + ∃ C : ℝ, C > 1 ∧ ∀ k : ℕ, k ≥ 2 → + ∃ n : ℕ, n ≤ ⌈Real.exp (C ^ (k : ℝ))⌉₊ ∧ + ∀ (c : ℕ → Fin k), ∃ D' : Finset ℕ, ... +``` + +**2. Problem 46 as a corollary:** +Problem 46 (coloring all integers ≥ 2) is a direct consequence of Problem 45, since the divisors of n that lie in (1, n) are integers ≥ 2. A proof of Problem 45 for all k immediately yields Problem 46. This logical relationship could be documented via a cross-reference. + +**3. Greedy coloring threshold:** +The lower bound argument relies on the observation that if ∑_{d|n} 1/d < k, a greedy coloring provides a counterexample. This necessary condition (the sum of reciprocals of divisors must be at least k) is a meaningful standalone statement that constrains which n can work. + +**Assessment:** The qualitative existence result is correctly captured. The quantitative bounds are natural extensions but their omission is reasonable for a first formalization. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Module docstring:** Clear and complete, stating the problem, its resolution, and the full citation for Croot's paper. +- **`middleDivisors` docstring:** Includes LaTeX notation defining D(n) precisely. Good. +- **Theorem docstring:** Comprehensive, restating the mathematical content in both prose and displayed math. +- **Namespace:** `Erdos45` is appropriate and consistent with convention. +- **Opens:** `open Finset BigOperators` is minimal and appropriate. +- **Variable names:** `k`, `n`, `c`, `D'`, `j` are natural choices matching the mathematical notation. + +**Minor suggestion:** The condition `D'.Nonempty` (line 56) prevents the trivial solution of the empty set (whose reciprocal sum is 0, not 1). This is mathematically redundant since `∑ d ∈ ∅, 1/d = 0 ≠ 1`, but including it explicitly is good practice for clarity and is harmless. + +Actually, on closer inspection, `D'.Nonempty` is indeed *logically redundant* given `(∑ d ∈ D', (1 : ℚ) / (d : ℚ)) = 1` — the empty sum is 0 ≠ 1, so any D' satisfying the sum condition is automatically nonempty. The same pattern appears in Problem 46 and Problem 47. While redundant, keeping it improves readability by making the intent explicit, so this is not a defect. + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: for each k ≥ 2, find n such that every k-coloring of the proper-interior divisors of n admits a monochromatic subset with reciprocal sum 1. All constituent concepts are well-defined: + +- **k-coloring:** A function from divisors to Fin k. Well-defined. +- **Divisors of n excluding 1 and n:** The set {d ∈ ℕ : d | n, 1 < d < n}. Well-defined for all n. +- **Monochromatic subset:** A subset on which the coloring is constant. Well-defined. +- **Reciprocal sum equals 1:** ∑ 1/d = 1 over ℚ. Well-defined (no division-by-zero issues since elements of middleDivisors n satisfy d > 1 > 0). + +The only potential ambiguity in the original problem statement is whether "divisors of n" means just the proper interior divisors (excluding 1 and n) or all divisors. The website is explicit: D = {1 < d < n_k : d | n_k}, and the formalization correctly implements this interpretation via `middleDivisors`. + +**Ambiguity level: Essentially none.** The statement is precise and the formalization's interpretation is clearly correct. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `middleDivisors` + +```lean +def middleDivisors (n : ℕ) : Finset ℕ := + n.divisors.filter (fun d => 1 < d ∧ d < n) +``` + +- **Base cases:** For n = 0, `Nat.divisors 0 = ∅` in Mathlib, so `middleDivisors 0 = ∅`. For n = 1, `Nat.divisors 1 = {1}`, and the filter excludes 1 (since `1 < 1` is false), so `middleDivisors 1 = ∅`. For n = 2, `Nat.divisors 2 = {1, 2}`, and both are excluded, so `middleDivisors 2 = ∅`. For n = 4, `Nat.divisors 4 = {1, 2, 4}`, and only 2 passes the filter, giving `middleDivisors 4 = {2}`. These are all correct. +- **General case:** For d ∈ middleDivisors n, we have d | n, d > 1, and d < n. This correctly captures "divisors strictly between 1 and n." +- **Element properties:** Every d ∈ middleDivisors n satisfies d ≥ 2 > 0, ensuring (d : ℚ) ≠ 0, so `(1 : ℚ) / (d : ℚ)` is well-defined and positive. + +### Theorem: `erdos_45` + +```lean +theorem erdos_45 : + ∀ k : ℕ, k ≥ 2 → + ∃ n : ℕ, ∀ (c : ℕ → Fin k), + ∃ D' : Finset ℕ, D' ⊆ middleDivisors n ∧ + D'.Nonempty ∧ + (∃ j : Fin k, ∀ d ∈ D', c d = j) ∧ + (∑ d ∈ D', (1 : ℚ) / (d : ℚ)) = 1 +``` + +**Logical structure:** "For every k ≥ 2, there exists n such that for every k-coloring c of ℕ (by Fin k), there exists a nonempty monochromatic subset D' of middleDivisors n whose reciprocal sum is 1." + +**Domain of the coloring function:** The coloring `c : ℕ → Fin k` is defined on all of ℕ, not just on `middleDivisors n`. This is standard and correct: since `D' ⊆ middleDivisors n`, only the values of c on `middleDivisors n` matter. The formulation is equivalent to quantifying over all functions `middleDivisors n → Fin k`, since: +- Any coloring of `middleDivisors n` can be extended to all of ℕ (by assigning arbitrary colors outside), so the universal quantifier over `ℕ → Fin k` is at least as strong. +- Conversely, any `c : ℕ → Fin k` restricts to a coloring of `middleDivisors n`, so the universal quantifier over `ℕ → Fin k` is at most as strong. + +**Quantifier order:** The order ∀k, ∃n, ∀c, ∃D' is correct. The n depends on k but not on the coloring c — this matches the problem's intent that n_k is fixed before seeing the coloring. + +**k ≥ 2 hypothesis:** For k = 0, `Fin 0` is empty, so `c : ℕ → Fin 0` has no inhabitants, making the statement vacuously true. For k = 1, the coloring is trivially monochromatic, so the problem reduces to finding n with a subset of middleDivisors n whose reciprocal sum is 1 — this is easy (e.g., n = 6 gives middleDivisors 6 = {2, 3} with 1/2 + 1/3 = 5/6 ≠ 1, but n = 120 works). The k ≥ 2 hypothesis follows the website's statement and is the mathematically interesting case. + +**Comparison with Problem 46:** Problem 46 states: +```lean +∀ (α : Type*) [Finite α] (c : ℕ → α), + ∃ S : Finset ℕ, S.Nonempty ∧ + (∀ n ∈ S, n ≥ 2) ∧ + (∃ color : α, ∀ n ∈ S, c n = color) ∧ + (∑ n ∈ S, (1 : ℚ) / (n : ℚ)) = 1 +``` + +Problem 46 is logically implied by Problem 45: given a finite coloring `c : ℕ → α` with `|α| = k`, Problem 45 provides an n and a monochromatic subset D' ⊆ middleDivisors n. Since every element of middleDivisors n is ≥ 2, the set D' also satisfies `∀ d ∈ D', d ≥ 2`, fulfilling Problem 46's requirements. This logical dependency is not documented but is a natural consequence of the formalization. + +**Reciprocal sum over ℚ:** The sum `∑ d ∈ D', (1 : ℚ) / (d : ℚ)` is computed in ℚ, which is exact (no rounding). This is the correct choice for an equality condition — using ℝ would also work but ℚ is cleaner since all values involved are rational. + +**Potential edge case — n = 0 or n = 1:** The existential `∃ n` will never witness n = 0 or n = 1, since `middleDivisors 0 = middleDivisors 1 = ∅`, and `D'.Nonempty` with `D' ⊆ ∅` is impossible. This is not a bug — it simply means the witness n must be sufficiently large, which is the intent. + +**Verdict: Correct and complete.** The formalization faithfully captures the qualitative content of Erdős Problem 45 as stated on erdosproblems.com. The definition of `middleDivisors` is correct, the quantifier structure matches the intended mathematical statement, and the coloring formalism is standard. The only omissions are the quantitative bounds (n_k ≤ e^{C^k} and Sawhney's lower bound), which are natural extensions but not part of the core problem statement. No mathematical flaws are present. diff --git a/ai-review/450.md b/ai-review/450.md new file mode 100644 index 0000000000..4427b3aa6d --- /dev/null +++ b/ai-review/450.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 450 + +## 1. Code Reuse + +**Problem 446** (`FormalConjectures/ErdosProblems/446.lean`) is closely related and defines: +- `countWithDivisor(n, N)` — counts integers in `[1, N]` with a divisor in `(n, 2n)` (line 49–51) +- `countWithExactDivisors(r, n, N)` — counts integers with exactly `r` such divisors (line 57–59) + +Problem 450's `countWithDivisorInRange` performs the same divisor-in-`(n, 2n)` check but over a shifted interval `(x, x+y)` instead of `[1, N]`. The two problems are deeply connected mathematically (Problem 446 concerns the density δ(n), and Problem 450 asks how large a window is needed to witness that density uniformly). A shared helper for the "has a divisor in (n, 2n)" predicate could be factored out, e.g.: + +```lean +def hasDivisorInRange (m n : ℕ) : Prop := + ∃ d ∈ Finset.Ioo n (2 * n), d ∣ m +``` + +This predicate is used in both problems and also appears conceptually in Problems 444, 448, and 449. + +Additionally, the two files use different idioms for the same logical check: +- **450** uses `∃ d ∈ Finset.Ioo n (2 * n), d ∣ m` (existential) +- **446** uses `((Finset.Ioo n (2 * n)).filter (fun d => d ∣ m)).Nonempty` (filter + Nonempty) + +These are equivalent but stylistic consistency would be preferable. + +Other related problems: 444 (divisor counting in sets), 448 (divisor "bands" in `[2^k, 2^{k+1})`), 449 (close divisor pairs), 1143 (counting divisible integers in shifted intervals). + +The density infrastructure in `FormalConjecturesForMathlib/Data/Set/Density.lean` (`partialDensity`, `upperDensity`, `lowerDensity`, `HasDensity`) could be relevant if an alternative formulation using density is desired. + +## 2. Citations + +The formalization references: +- **[ErGr80]** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). +- **[Fo08]** — Ford, K., *The distribution of integers with a divisor in a given interval*. Annals of Mathematics (2008). + +The website ([erdosproblems.com/450](https://www.erdosproblems.com/450)) lists the same references: [ErGr80, p.89] as the original source and [Fo08] for Ford's results used by Cambie. The citations match and are complete. + +## 3. Variants + +The website identifies **two interpretations** based on the quantifier over `x`: + +1. **"For all x"** — the formalization's chosen interpretation. +2. **Existential quantifier on x** — not formalized. The website notes that when `ε ≪ 1/n`, then `y(ε, n) ~ 2n`, and for larger ε, every `2(1+δ)n` consecutive integers contain many multiples of elements in `(n, 2n)`. + +Only the first interpretation is captured. The existential variant could be added as `erdos_450.variants.existential_x` for completeness, though the "for all x" version is the more natural and interesting reading. + +## 4. Readability + +The code is clean and readable. The helper function `countWithDivisorInRange` is well-named and its docstring clearly explains the mathematical meaning. Minor suggestions: + +- The `Classical` opening is unnecessary — the existential in the filter is decidable over finite sets, and `Finset.filter` with `∃ d ∈ ...` should work without it. However, this may depend on decidability instances and could be intentional for convenience. +- The `open Finset` could be narrowed if desired, but is fine for a short file. + +## 5. Formalizability + +**Moderate ambiguity.** The original problem statement "How large must y = y(ε, n) be..." is an informal question, not a precise conjecture. There are multiple ways to interpret it: + +- **Quantifier on x**: "for all x" vs "there exists x" — the most significant ambiguity, acknowledged in the docstring. +- **"How large"**: The formalization interprets this as an existence statement (∃ y such that ...), which is reasonable. But the original question arguably asks for *bounds on y* as a function of ε and n, not merely existence. A stronger formalization might assert asymptotic bounds on the minimal such y. +- **Relationship between ε and n**: The problem says y = y(ε, n), treating ε and n as independent parameters. But as noted below, the "for all x" version may fail without additional conditions linking ε to n. + +The docstring does an excellent job of acknowledging these ambiguities. + +## 6. Correctness + +**This is the most critical issue.** The formalization as stated is likely **false**. + +The docstring itself notes: *"Cambie observed that the 'for all x' version fails when ε · (log n)^δ · (log log n)^{3/2} → ∞"*, citing Ford's results [Fo08]. The constant δ here is the same α ≈ 0.08607 from Problem 446 (Ford's theorem gives δ(n) ≍ 1/((log n)^α · (log log n)^{3/2})). + +The key issue: the density δ(n) of integers with a divisor in (n, 2n) is approximately 1/((log n)^α · (log log n)^{3/2}). For the "for all x" interpretation, no finite window y can bring the proportion below ε if ε is smaller than this density — because the density is the *asymptotic* proportion, and for any window length y, the worst-case x will yield a proportion close to or above δ(n). + +In the current formalization: +```lean +theorem erdos_450 (ε : ℝ) (hε : 0 < ε) (n : ℕ) (hn : 1 ≤ n) : + ∃ y : ℕ, 0 < y ∧ ∀ x : ℕ, + (countWithDivisorInRange x y n : ℝ) ≤ ε * (y : ℝ) +``` + +This claims that for **every** ε > 0 and **every** n ≥ 1, such a y exists. But by Cambie's observation (using Ford's theorem), this fails when ε is too small relative to n — specifically when ε · (log n)^δ · (log log n)^{3/2} → ∞ is *not* satisfied (i.e., when ε is on the order of or smaller than the density δ(n)). + +**To be correct, the theorem needs an additional hypothesis** relating ε and n. For example: +```lean +theorem erdos_450 (ε : ℝ) (hε : 0 < ε) (n : ℕ) (hn : 1 ≤ n) + (hεn : ε > C / ((Real.log n) ^ α * (Real.log (Real.log n)) ^ (3/2))) : + ∃ y : ℕ, 0 < y ∧ ∀ x : ℕ, ... +``` + +or alternatively, the problem could be reformulated as asking for the **minimal** y as a function of ε and n, with bounds, rather than a bare existence statement. + +Alternatively, if the intent is to formalize the problem as an open question about what conditions are needed, the statement should be tagged as a **conjecture that may be false** rather than a theorem, or the "for all x" interpretation should be replaced with the existential one. + +**Summary:** The incompleteness is attributable to genuine ambiguity in the original problem statement, but the formalization should not present a likely-false statement as a theorem to be proved. Either add a hypothesis bounding ε relative to n, switch to the existential-x interpretation, or add a note that the statement may need to be negated. diff --git a/ai-review/451.md b/ai-review/451.md new file mode 100644 index 0000000000..63f1fc22e4 --- /dev/null +++ b/ai-review/451.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 451 + +## 1. Code Reuse + +**Consecutive product pattern:** Problem 388 defines `consecutiveProduct m k = ∏ i ∈ Finset.range k, (m + 1 + i)` for ascending products. Problem 451 uses descending products `∏ i ∈ Finset.Icc 1 k, (n - i)`. These are mathematically equivalent (setting `m = n - k - 1` gives the same product up to reordering), but the descending form is more natural for this problem's statement. No change recommended. + +**Growth rate pattern:** Problem 721 uses an identical superpolynomial/subexponential pattern: `∀ d, 0 < d → ∃ K₀, ∀ k ≥ K₀, (k : ℝ)^d < f k` and the analogous exponential upper bound. The pattern is duplicated but is simple enough that extracting a shared definition would be over-engineering. + +**Prime factor infrastructure:** `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` provides `maxPrimeFac` and related lemmas. Problem 367 uses `n.factorization.support.filter` for prime factor analysis. Problem 452 uses `Nat.primeFactorsList`. None of these directly simplify the current `noInteriorPrimeFactor` definition, which is already clean. + +**Verdict:** No significant reuse opportunities. The code is appropriately self-contained. + +## 2. Citations + +The formalization references `[Er79d]` and `[ErGr80, p.89]`, which match the website. + +**Missing from the docstring:** +- The website credits Sarosh Adenwalla for an elementary upper bound: $n_k \leq \prod_{k < p < 2k} p = e^{O(k)}$, which establishes existence and gives a concrete (though weak) upper bound. +- OEIS sequence A386620 is referenced on the website and could be mentioned. + +**Citation formatting:** The references are properly expanded with full bibliographic details. The page number `p.89` for `[ErGr80]` matches the website. No issues. + +## 3. Variants + +The formalization captures the main conjecture (superpolynomial lower bound + subexponential upper bound) as a single two-part theorem. + +**Missing variants:** +- **Erdős–Graham lower bound (proved):** The docstring mentions "$n_k > k^{1+c}$ for some constant $c > 0$" but this is not formalized as a separate theorem. This is a known result, not a conjecture, and could be stated as a solved variant: + ```lean + @[category research solved, AMS 11] + theorem erdos_451.variants.erdos_graham_lower_bound : + ∃ c : ℝ, 0 < c ∧ ∃ K₀ : ℕ, ∀ k : ℕ, K₀ ≤ k → + (k : ℝ) ^ (1 + c) < (erdos451_nk k : ℝ) := by sorry + ``` +- **Adenwalla upper bound (proved):** $n_k \leq \prod_{k < p < 2k} p = e^{O(k)}$. This is weaker than the conjectured subexponential bound but is a known result. +- **Well-definedness:** The existence of $n_k$ (that some $n > 2k$ satisfies the property) is not separately stated. This follows from the Adenwalla bound but could be made explicit, since `erdos451_nk` returns 0 when no such $n$ exists. + +## 4. Readability + +The code is clean and well-structured: +- `noInteriorPrimeFactor` has a clear docstring explaining its meaning. +- `erdos451_nk` is well-documented with the fallback behavior (returns 0) noted. +- The module docstring gives good mathematical context. +- The namespace `Erdos451` keeps definitions scoped. + +**Minor suggestions:** +- The name `erdos451_nk` could be shortened to just `nk` within the namespace (it would be `Erdos451.nk`), following the convention that namespace-scoped names don't need the problem number prefix. However, the current name is explicit and unambiguous, so this is a matter of preference. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem asks to "estimate $n_k$," which is inherently imprecise — it's asking for bounds rather than an exact value. However, Erdős's specific conjectures are precisely stated: +- "$n_k > k^d$ for all constant $d$" — unambiguous, means superpolynomial growth. +- "$n_k < e^{o(k)}$" — standard asymptotic notation with a precise mathematical definition. + +The definition of $n_k$ itself is completely precise: smallest integer $> 2k$ such that $\prod_{1 \leq i \leq k}(n_k - i)$ has no prime factor in the open interval $(k, 2k)$. + +The only source of ambiguity is whether "estimate" was meant to encompass additional intermediate bounds beyond the superpolynomial/subexponential envelope, but the formalization reasonably captures the specific conjectures Erdős made. + +## 6. Correctness + +**Product definition:** `∏ i ∈ Finset.Icc 1 k, (n - i)` computes $(n-1)(n-2)\cdots(n-k)$ in $\mathbb{N}$. This matches the problem statement's $\prod_{1 \leq i \leq k}(n_k - i)$. + +**Natural number subtraction:** When `n ≤ i` for some `i ∈ [1,k]`, the term `n - i` underflows to 0 in $\mathbb{N}$, making the product 0. Since `p ∣ 0` is true for all primes $p$, `noInteriorPrimeFactor k n` would be false in this case (assuming a prime exists in $(k,2k)$, which holds for $k \geq 2$ by Bertrand's postulate). This is not a bug: `erdos451_nk` only considers $n > 2k$, so all terms $n - i \geq n - k > k \geq 1$ are positive. The definition is safe in context. + +**Interval correctness:** The formalization uses strict inequalities `k < p` and `p < 2 * k`, giving the open interval $(k, 2k)$. This matches the problem statement. + +**$n_k$ definition:** `Nat.find` finds the smallest $n \in \mathbb{N}$ satisfying `2 * k < n ∧ noInteriorPrimeFactor k n`. Since `Nat.find` iterates from 0, this correctly identifies the smallest $n > 2k$ with the property. The fallback to 0 when no such $n$ exists is a reasonable convention. + +**Superpolynomial lower bound:** The formalization `∀ d : ℝ, 0 < d → ∃ K₀, ∀ k ≥ K₀, (k : ℝ)^d < (erdos451_nk k : ℝ)` correctly captures "$n_k > k^d$ for all constant $d$." Using real-valued $d$ (rather than $d : \mathbb{N}$ as in Problem 721) is strictly more general and mathematically appropriate. + +**Subexponential upper bound:** The formalization `∀ ε : ℝ, 0 < ε → ∃ K₀, ∀ k ≥ K₀, (erdos451_nk k : ℝ) < exp(ε * k)` correctly captures "$n_k < e^{o(k)}$." The standard definition of $f(k) = e^{o(k)}$ is exactly: for every $\varepsilon > 0$, $f(k) < e^{\varepsilon k}$ for all sufficiently large $k$. This is correct. + +**Implicit well-definedness:** The conjecture implicitly asserts that `erdos451_nk k ≠ 0` for all sufficiently large $k$ (otherwise the lower bound $k^d < 0$ would fail). This is mathematically justified by the Adenwalla bound but is not separately proven in the file. This is acceptable since it is subsumed by the conjecture. + +**Edge cases:** For $k = 0$: the product is empty (equals 1), and the interval $(0, 0)$ is empty, so `noInteriorPrimeFactor 0 n` is vacuously true. `erdos451_nk 0 = 1`. For $k = 1$: the interval $(1, 2)$ contains no primes, so again vacuously true. `erdos451_nk 1 = 3`. These edge cases are harmless for an asymptotic statement. + +**Verdict: The formalization is mathematically correct and complete with respect to the specific conjectures stated by Erdős.** The only gap is the absence of the Erdős–Graham proved lower bound as a separate variant. diff --git a/ai-review/452.md b/ai-review/452.md new file mode 100644 index 0000000000..70c9c13a37 --- /dev/null +++ b/ai-review/452.md @@ -0,0 +1,66 @@ +# Review: Erdős Problem 452 + +## 1. Code Reuse + +The `omega` definition at line 44 uses `(Nat.primeFactorsList n).toFinset.card`, which is identical to the definition in `ErdosProblems/679.lean:34`. However, `ErdosProblems/685.lean:38` provides a simpler, **computable** alternative: + +```lean +def omega (n : ℕ) : ℕ := n.primeFactors.card +``` + +Since `Nat.primeFactors` already returns a `Finset ℕ`, the roundtrip through `primeFactorsList` → `toFinset` is unnecessary and forces the definition to be `noncomputable`. The 685-style definition is preferable. Ideally, a single shared `omega` definition would live in a utility file (e.g., `FormalConjecturesForMathlib/Data/Nat/`) and be reused across problems 452, 679, and 685. + +**Recommendation:** Replace the `omega` definition with `n.primeFactors.card` and drop `noncomputable`. + +## 2. Citations + +The website (https://www.erdosproblems.com/452, last edited 28 October 2025) lists two references: + +| Key | Docstring | Website | +|-----|-----------|---------| +| [Er37] | Erdős, P., *On the normal number of prime factors of p-1 and some related problems concerning Euler's φ-function*. Quart. J. Math. Oxford Ser. **8** (1937), 313-320. | Matches (Erdős 1937, density result) | +| [ErGr80] | Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). | Matches (source of the problem, p.90) | + +The citations in the docstring are accurate and complete relative to the website. The theorem docstring correctly attributes the problem to [ErGr80, p.90]. **No issues.** + +## 3. Variants + +The problem on the website has three distinct components: + +1. **Density result (Er37):** The density of integers with ω(n) > log log n is 1/2. — *Not formalized, mentioned only in docstring.* +2. **CRT lower bound:** There exists an interval of length ≥ (1+o(1)) log x / (log log x)². — *Not formalized, mentioned only in docstring.* +3. **Conjecture:** There exists an interval of length (log x)^k for arbitrarily large k. — *Formalized as `erdos_452`.* + +The density result (1) is a classical theorem of Erdős and could be formalized as a separate lemma (it is a known result, not a conjecture). The CRT lower bound (2) is a known constructive result and could similarly be a separate theorem. Both are relevant partial results that provide context. + +**Recommendation:** Consider adding the density result and the CRT lower bound as separate formalized statements (tagged `category research solved`), since they are established results, not conjectures. + +## 4. Readability + +The formalization is generally readable. Minor observations: + +- The variable names `a`, `L`, `x`, `x₀` are well-chosen and match the mathematical convention. +- The `Finset.Icc a (a + L)` clearly represents the discrete closed interval [a, a+L]. +- The nested `Real.log (Real.log (n : ℝ))` is standard and mirrors the mathematical notation log log n. +- The cast `(omega n : ℝ)` for comparison with the real-valued log log n is necessary and clear. + +**One suggestion:** The docstring for the theorem says "[a, a + L] ⊆ [x, 2x]" while the code has `x ≤ a ∧ a + L ≤ 2 * x`. This is correct but it may be slightly more readable to note that `L` represents the interval *length*, which it does since the interval is [a, a+L] containing L+1 integers. This is a very minor point. + +## 5. Formalizability + +The original problem asks: *"What is the size of the largest interval I ⊆ [x, 2x] such that ω(n) > log log n for all n ∈ I?"* This is an open-ended question about the growth rate of the maximal interval length, not a sharp conjecture. The website notes "It could be true that there is such an interval of length (log x)^k for arbitrarily large k" — this is a specific conjectural lower bound. + +**Ambiguity assessment: Moderate.** The original question does not assert a specific answer; the formalization chooses one plausible conjectural direction. The formalized statement is precise and unambiguous on its own, but it captures only the *conjectured lower bound*, not the full question (which also implicitly asks for upper bounds or the exact order of growth). This is a reasonable choice given that the conjectural lower bound is the most concrete assertion available. + +## 6. Correctness + +The formalization is **mathematically correct** for the conjectural lower bound it captures. Detailed analysis: + +- **Quantifier structure:** `∀ k > 0, ∃ x₀, ∀ x ≥ x₀, ∃ a L` — correctly encodes "for arbitrarily large k, for all sufficiently large x, there exists an interval of length ≥ (log x)^k." +- **Interval containment:** `x ≤ a ∧ a + L ≤ 2 * x` — correctly asserts [a, a+L] ⊆ [x, 2x]. +- **Length bound:** `(Real.log x)^k ≤ L` — correctly asserts the interval has length at least (log x)^k. Note that `L` is the length parameter and the interval [a, a+L] has L+1 integer points; this is a standard and harmless off-by-one (for large L, the distinction is negligible, and (log x)^k ≤ L implies (log x)^k ≤ L+1 as well). +- **ω condition:** `∀ n ∈ Finset.Icc a (a + L), (omega n : ℝ) > Real.log (Real.log (n : ℝ))` — correctly asserts ω(n) > log log n for all integers in the interval. +- **Real k:** Using `k : ℝ` with `k > 0` is strictly stronger than requiring k to be a natural number. This is a deliberate and valid strengthening — if it holds for all real k > 0, it certainly holds for all positive integers. +- **Edge cases with log:** For n ≤ 1, `Real.log n ≤ 0` and `Real.log (Real.log n) = Real.log (nonpositive) = 0` in Mathlib, so the condition `omega n > 0` would need omega n ≥ 1, i.e., n has at least one prime factor. Since n ∈ [x, 2x] with x sufficiently large, n ≥ 2, so this is not a concern in practice. No mathematical flaw here. + +**Verdict:** Correct and faithful to the conjectural component of the problem. The only gap is the absence of the known partial results (density and CRT bound) as separate formalized statements. diff --git a/ai-review/453.md b/ai-review/453.md new file mode 100644 index 0000000000..f2be40a3f3 --- /dev/null +++ b/ai-review/453.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 453 + +## 1. Code Reuse + +**Issue found.** The file defines a local `nthPrime` function: + +```lean +noncomputable def nthPrime (k : ℕ) : ℕ := Nat.nth Nat.Prime k +``` + +This is a trivial wrapper around Mathlib's `Nat.nth Nat.Prime`. The vast majority of files in the codebase (42+) use `Nat.nth Nat.Prime` directly without a local alias. Only `453.lean` and `852.lean` define a local `nthPrime`. + +**Recommendation:** The local `nthPrime` could be replaced with direct use of `Nat.nth Nat.Prime` for consistency with the rest of the codebase. However, given that this is a short, self-contained file and the alias improves readability of the theorem statements (matching the mathematical notation $p_k$), the local definition is defensible. If a shared `nthPrime` were ever factored into a utility file, this file should adopt it. + +Additionally, `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` defines `primeGap` using `Nat.nth Nat.Prime` directly — no overlap with this file's needs. + +## 2. Citations + +**Minor issue.** The website lists the following references: + +- [Er70b,p.140], [Er74b,p.203], [Er77c,p.65], [ErGr80,p.90] — various Erdős sources +- [Po79] — Pomerance's 1979 proof +- [Gu04] — Guy's problem collection (this is listed as "Problem A14") + +The formalization's docstring cites: +- [Po79] with the description: `Pomerance, C., _A note on the least prime in an arithmetic progression_.` + +**Problems:** +1. The citation title appears incorrect. Pomerance's 1979 paper relevant to this problem is likely *"The prime number graph"* (Journal of the London Mathematical Society, 1979), which uses convex hull arguments on the prime number graph. The title *"A note on the least prime in an arithmetic progression"* is a different Pomerance paper and does not match this problem's content. +2. The additional Erdős source references ([Er70b], [Er74b], [Er77c], [ErGr80]) and Guy's reference [Gu04] are not mentioned in the formalization. These are supplementary and their omission is acceptable, but flagged for completeness. + +**Recommendation:** Verify and correct the [Po79] citation title. The convex hull proof technique described on the website matches *"The prime number graph"* rather than a paper about primes in arithmetic progressions. + +## 3. Variants + +**Adequate.** The file contains two theorems: + +1. `erdos_453` — The main question (disproved): Is it eventually true that for every $n$, some $i < n$ satisfies $p_n^2 < p_{n+i} p_{n-i}$? +2. `erdos_453.variants.pomerance` — Pomerance's positive result: There are infinitely many $n$ such that $p_n^2 > p_{n+i} p_{n-i}$ for all $0 < i < n$. + +The website mentions Selfridge conjectured the answer is no (which is captured in the docstring), and the problem is also known as Guy's Problem A14 (not captured, but this is just a cross-reference, not a variant). + +**No missing mathematical variants.** The two theorems together capture the full resolution of the problem. + +## 4. Readability + +**Good.** The file is clean and well-structured: +- The docstring clearly states the problem and its resolution. +- The `nthPrime` alias makes the theorem statements more readable than raw `Nat.nth Nat.Prime`. +- The namespace `Erdos453` keeps definitions scoped. +- The variant theorem is clearly named and documented. + +**Minor suggestion:** The docstring for the main theorem says "The answer is no" but doesn't briefly explain *why* (Pomerance's result). Adding a one-line pointer like "See `erdos_453.variants.pomerance`" would improve navigability, though this is optional. + +## 5. Formalizability + +**High precision, clearly formalizable.** The problem statement is unambiguous: +- "the $k$th prime" is well-defined (given an indexing convention, which is specified as 0-indexed). +- The inequality $p_n^2 < p_{n+i} \cdot p_{n-i}$ is a concrete arithmetic comparison. +- "For all sufficiently large $n$" maps cleanly to `Filter.atTop`. +- "There exists some $i < n$" is a bounded existential. + +**No ambiguity issues.** This is one of the more straightforward Erdős problems to formalize. The only potential subtlety is the indexing convention (0-indexed vs 1-indexed), which is explicitly documented and handled correctly. + +## 6. Correctness + +**Correct and complete.** Detailed analysis: + +### Main theorem (`erdos_453`) +- `answer(False)` correctly encodes that the answer to the question is "no" (disproved). +- The biconditional `answer(False) ↔ (∀ᶠ n in Filter.atTop, ∃ i : ℕ, 0 < i ∧ i < n ∧ nthPrime n ^ 2 < nthPrime (n + i) * nthPrime (n - i))` correctly states: "False iff for all sufficiently large $n$, there exists $0 < i < n$ with $p_n^2 < p_{n+i} p_{n-i}$." Since `answer(False)` unfolds to `False`, this is equivalent to asserting the *negation* of the eventually-always property — which is exactly what was disproved. ✓ +- The constraint `0 < i` is important and correctly included (without it, $i = 0$ would trivially satisfy $p_n^2 < p_n \cdot p_n$, which is false, not helpful, but would be vacuously available). ✓ +- Natural number subtraction `n - i` is safe here because the constraint `i < n` ensures `n - i > 0` and is the intended mathematical value. ✓ + +### Pomerance variant (`erdos_453.variants.pomerance`) +- States: for every $N$, there exists $n \geq N$ such that for all $0 < i < n$, $p_{n+i} \cdot p_{n-i} < p_n^2$. This is the standard "infinitely many" encoding and correctly captures Pomerance's result. ✓ +- The strict inequality direction is correct: Pomerance showed $p_n^2 > p_{n+i} p_{n-i}$, formalized as `nthPrime (n + i) * nthPrime (n - i) < nthPrime n ^ 2`. ✓ +- The quantifier structure (`∀ N, ∃ n, N ≤ n ∧ ∀ i, 0 < i → i < n → ...`) correctly encodes "infinitely many $n$". ✓ + +### Logical consistency between the two theorems +The Pomerance variant *implies* the main theorem's `answer(False)` direction. If there are infinitely many counterexample $n$'s, then it cannot be eventually true. The two theorems are logically consistent and the variant is strictly stronger than needed to disprove the main statement. ✓ + +**No mathematical flaws identified.** An experienced number theorist would find this formalization correct. + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code reuse | Minor | Local `nthPrime` duplicates pattern; defensible for readability | +| Citations | **Needs fix** | [Po79] title appears to reference the wrong Pomerance paper | +| Variants | Good | All mathematical variants captured | +| Readability | Good | Clean, well-documented | +| Formalizability | Excellent | Unambiguous, straightforward to formalize | +| Correctness | Excellent | Mathematically sound, no flaws | diff --git a/ai-review/456.md b/ai-review/456.md new file mode 100644 index 0000000000..f083642ea6 --- /dev/null +++ b/ai-review/456.md @@ -0,0 +1,128 @@ +# Erdos Problem 456 — Review + +## 1. Code Reuse + +The density library in `FormalConjecturesForMathlib/Data/Set/Density.lean` provides `Set.HasDensity S α`, which formalizes "the set S has natural density α" via `Tendsto (partialDensity ...) atTop (nhds α)`. Parts 1 and 2 of this problem express "density zero" by inlining the same limit pattern: + +```lean +Tendsto (fun x => (((Finset.Icc 1 x).filter (fun n => ...)).card : ℝ) / (x : ℝ)) atTop (nhds 0) +``` + +This inline pattern could in principle be replaced by `Set.HasDensity S 0`, but the inline version is the **established convention** used consistently across similar problems (e.g., Problem 459). Switching would require importing `FormalConjecturesForMathlib.Data.Set.Density` and translating between the `Finset.Icc`-based counting and the `Set.interIio`/`ncard`-based counting used by `partialDensity`. The two formulations are equivalent but not definitionally equal, so the refactor is non-trivial and arguably not worth it for consistency with the rest of the Erdos problem files. + +The `sInf`-based definitions (`smallestPrimeCong1`, `smallestTotientDiv`) follow the same pattern used in Problems 304, 459, 663, and 1072. No existing shared utility wraps this pattern, which is appropriate since each instance has a different predicate. + +`Nat.totient` is available from Mathlib via `ProblemImports`. No additional imports are needed. + +**Verdict**: No actionable code reuse opportunities. The current approach is idiomatic for the codebase. + +## 2. Citations + +The website ([erdosproblems.com/456](https://www.erdosproblems.com/456)) lists two references: + +- **[Er79e]**: Erdős, P., *Some unconventional problems in number theory* (1979). +- **[ErGr80]**: Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The formalization's docstring (lines 35–38) reproduces both references with full bibliographic details matching the website. The attribution of parts to specific references is: + +| Part | Formalization | Website | +|------|--------------|---------| +| Part 1 (m_n < p_n almost always) | [Er79e, p.80] | [Er79e] | +| Part 2 (p_n/m_n → ∞) | [Er79e, p.80] | [Er79e] | +| Part 3 (unique preimage) | [ErGr80, p.91] | [ErGr80] | + +**Verdict**: Citations are correct and complete. + +## 3. Variants + +The website mentions several additional results and claims **not captured** in the formalization: + +1. **Erdős's "easy to show" claim**: For infinitely many n, m_n < p_n. This is a weaker statement than Part 1 and could serve as a natural warm-up variant (likely at the `undergraduate` or `research solved` difficulty level). + +2. **m_n / n → ∞ for almost all n**: Erdős also claimed this is "easy to show." This is a separate asymptotic statement about the growth rate of m_n relative to n, distinct from Parts 1–3. + +3. **Van Doorn's observation**: When n = 2^{2k+1}, we have m_n ≤ 2n and p_n ≥ 2n + 1. This gives explicit infinite families witnessing Part 1. + +4. **Trivial bound m_n ≤ p_n**: Mentioned in the docstring but not formalized as a separate lemma. This could be a nice `undergraduate`-level variant. + +5. **Linnik's theorem bound p_n ≤ n^{O(1)}**: Mentioned in the docstring but not formalized. This is a deep result and probably not appropriate to formalize here. + +6. **Special case n = q − 1 for prime q implies m_n = p_n**: Mentioned in the docstring but not formalized. + +**Verdict**: The three main open questions from the problem are captured. However, the "easy to show" claims by Erdős (infinitely many n with m_n < p_n; m_n/n → ∞ for almost all n) and the trivial bound m_n ≤ p_n are natural variants that are missing. At minimum, `m_n ≤ p_n` (trivial bound) and `m_n = p_n when n = q − 1` (special case) would strengthen the file. + +## 4. Readability + +The code is well-structured and readable: + +- The helper definitions `smallestPrimeCong1` and `smallestTotientDiv` are clearly named with accurate docstrings. +- Each part has a standalone theorem with a clear docstring relating it to the mathematical statement. +- The namespace `Erdos456` avoids name collisions. +- The variant naming convention (`erdos_456.variants.ratio_diverges`, `erdos_456.variants.unique_preimage`) is consistent with codebase conventions. + +Minor suggestions: + +- The inline density expressions in Parts 1 and 2 are somewhat long. A local `def` for the density-zero condition (or a shared helper) would reduce visual clutter, but this would deviate from the pattern used in Problem 459 and others. +- Part 2's docstring could clarify the quantifier structure more explicitly: "for every C > 0, the density of {n : p_n ≤ C · m_n} is 0" is correct but the connection to "p_n/m_n → ∞ for almost all n" could be made more explicit for readers unfamiliar with the density-based formulation of divergence. + +**Verdict**: Good readability. No changes needed. + +## 5. Formalizability + +The problem statement from erdosproblems.com is precise and directly formalizable: + +- **"smallest prime ≡ 1 (mod n)"** — unambiguous, directly captured by `sInf` over primes satisfying the congruence. By Dirichlet's theorem on primes in arithmetic progressions, the set is nonempty for all n ≥ 1, so `sInf` is well-defined. For n = 0, the set is empty (no prime p satisfies p ≡ 1 [MOD 0], i.e., 0 ∣ (p−1)), so `sInf` returns 0, which is harmless since n = 0 is excluded from the density computation (Finset.Icc 1 x). + +- **"smallest positive integer m such that n ∣ φ(m)"** — unambiguous. The set is nonempty for n ≥ 1 (since p_n provides a witness: φ(p_n) = p_n − 1 ≡ 0 mod n). + +- **"almost all n"** — standard number-theoretic usage meaning "the exceptional set has natural density 0." This is the interpretation used in the formalization. + +- **"p_n/m_n → ∞ for almost all n"** — slightly more ambiguous. The formalization interprets this as: for every C > 0, the density of {n : p_n/m_n ≤ C} is 0. This is the standard interpretation. + +- **Part 3** — unambiguous. "p − 1 is the only n for which m_n = p" is directly captured by the universal quantifier. + +**Verdict**: Low ambiguity. All three parts are precisely formalizable with the standard interpretations used. + +## 6. Correctness + +### Part 1 (`erdos_456`) + +The statement filters for `smallestPrimeCong1 n ≤ smallestTotientDiv n` (i.e., p_n ≤ m_n) and asks whether the density of this set tends to 0. This is equivalent to asking: "Is m_n < p_n for almost all n?" since {n : ¬(m_n < p_n)} = {n : p_n ≤ m_n}. **Correct.** + +Note: Since m_n ≤ p_n trivially (as stated in the docstring), the condition p_n ≤ m_n is equivalent to p_n = m_n. So Part 1 is really asking whether p_n = m_n for a density-zero set of n. This is mathematically equivalent but worth noting. + +### Part 2 (`erdos_456.variants.ratio_diverges`) + +The statement says: for all C > 0, the density of {n : p_n ≤ C · m_n} → 0. This formalizes "p_n/m_n → ∞ for almost all n" correctly under the standard density interpretation. + +**One subtlety**: When m_n = 0 (which can only happen if the defining set is empty, i.e., n = 0), we get C · 0 = 0, and the condition `(smallestPrimeCong1 n : ℝ) ≤ C * 0` would require p_n ≤ 0, which is false for any prime. Since n = 0 is not in Finset.Icc 1 x, this edge case is correctly excluded. **Correct.** + +**Another subtlety**: Division by m_n is avoided by reformulating as p_n ≤ C · m_n, which is the right approach for a formalization (avoids division by zero issues). **Good design choice.** + +### Part 3 (`erdos_456.variants.unique_preimage`) + +The set is {p : ℕ | Nat.Prime p ∧ smallestTotientDiv (p − 1) = p ∧ ∀ n, smallestTotientDiv n = p → n = p − 1}. This captures: +- p is prime +- m_{p−1} = p (the smallest m with (p−1) ∣ φ(m) is p itself) +- p−1 is the **only** n for which m_n = p + +This is a faithful formalization of "there are infinitely many primes p such that p − 1 is the only n for which m_n = p." + +**One concern**: For small primes, Lean's natural number subtraction means `p - 1` could behave unexpectedly if p = 0 or p = 1, but the `Nat.Prime p` hypothesis ensures p ≥ 2, so `p - 1 ≥ 1` and the subtraction is safe. **Correct.** + +### Overall Correctness Assessment + +All three parts are mathematically correct and faithfully capture the problem as stated on erdosproblems.com. No flaws identified. + +**Verdict**: Correct and complete formalization of the three stated open questions. + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code Reuse | No actionable opportunities; idiomatic for codebase | +| Citations | Correct and complete | +| Variants | Three main questions captured; missing "easy" results (m_n ≤ p_n always, infinitely many n with m_n < p_n, m_n/n → ∞) | +| Readability | Good; no changes needed | +| Formalizability | Low ambiguity; all parts precisely formalizable | +| Correctness | All three parts mathematically correct | diff --git a/ai-review/459.md b/ai-review/459.md new file mode 100644 index 0000000000..b971c51858 --- /dev/null +++ b/ai-review/459.md @@ -0,0 +1,124 @@ +# AI Review: Erdős Problem 459 + +**Source:** [erdosproblems.com/459](https://www.erdosproblems.com/459) +**File:** `FormalConjectures/ErdosProblems/459.lean` +**Status on website:** Solved + +--- + +## 1. Code Reuse + +The density computation in `erdos_459` is written inline: + +```lean +(((Finset.Icc 1 x).filter (fun n => (f n : ℝ) > (1 + ε) * (n : ℝ))).card : ℝ) / (x : ℝ) +``` + +`FormalConjecturesForMathlib/Data/Set/Density.lean` provides `Set.partialDensity`, `Set.upperDensity`, `Set.lowerDensity`, and `Set.HasDensity`. The statement could be reformulated using `Set.HasDensity` (density equals 0) or by showing the `upperDensity` of `{n | f n > (1 + ε) * n}` is 0. However, the existing density API uses `Set.interIio` and `ncard` on sets rather than `Finset.filter` and `Finset.card`, so there would be a nontrivial translation cost. The inline formulation is standard and self-contained, so **no change is strictly necessary**, but refactoring to use the density API would improve consistency across the codebase. + +No other definitions from `FormalConjecturesForMathlib` appear directly applicable—the problem is about prime factorization structure rather than arithmetic progressions, Ramsey theory, or additive combinatorics. + +## 2. Citations + +**Website citation:** `[ErGr80, p.91]` — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique (1980). + +**Formalization citation:** The docstring references `[ErGr80]` and includes the full citation at the bottom of the module docstring. This matches the website. The attribution of results to Stijn Cambie also matches. **Citations are correct.** + +One minor note: the website uses the accent in "Mathématique" while the formalization uses "Mathematique" (no accent). This is a trivial typographical difference. + +## 3. Variants + +The website lists the following results: + +| Result | In formalization? | +|--------|:-:| +| Trivial lower bound: f(u) ≥ u + 2 | ✅ `erdos_459.variants.lower_bound` | +| Trivial upper bound: f(u) ≤ u² | ✅ `erdos_459.variants.upper_bound` | +| f(p) = p² for prime p (Cambie) | ✅ `erdos_459.variants.prime` | +| f(n) = (1 + o(1))n for almost all n (Cambie) | ✅ `erdos_459` | +| **f(u) = u + 2 when u = 2^k − 2, k ≥ 2 (Cambie)** | ❌ Missing | +| **If u is even, f(u) ≤ 2^k where 2^k is the smallest power of 2 exceeding u** | ❌ Missing | + +**Two variants from the website are not captured.** The `u = 2^k − 2` result is mentioned in the module docstring but not formalized as a theorem. The even-case upper bound is entirely absent. Both are elementary enough to formalize. Suggested additions: + +```lean +/-- f(u) = u + 2 whenever u = 2^k - 2 for k ≥ 2 (Cambie). -/ +theorem erdos_459.variants.power_of_two_minus_two (k : ℕ) (hk : 2 ≤ k) : + f (2 ^ k - 2) = 2 ^ k := by sorry + +/-- If u is even, f(u) ≤ 2^k where 2^k is the smallest power of 2 exceeding u. -/ +theorem erdos_459.variants.even_upper_bound (u : ℕ) (hu : 2 ≤ u) (heven : Even u) : + f u ≤ 2 ^ (Nat.log 2 u + 1) := by sorry +``` + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Good:** The module docstring clearly states the problem, both equivalent formulations, known bounds, and the citation. +- **Good:** The definition of `f` is concise and matches the equivalent formulation exactly. +- **Good:** Variants are clearly separated with descriptive docstrings. +- **Minor:** The main theorem `erdos_459` could benefit from a brief inline comment explaining why only the upper direction (f(n) > (1+ε)n) needs to be checked (since f(n) > n trivially). This would help a reader unfamiliar with the problem understand why the formalization is one-sided. + +Overall readability is **good**. + +## 5. Formalizability + +The problem as stated on the website—"Estimate f(u)"—is vague by nature (it asks for estimates, not a precise conjecture). However, Cambie's specific results that are formalized here are all **precise and unambiguously formalizable**: + +- The bounds u + 2 ≤ f(u) ≤ u² are exact inequalities. +- f(p) = p² for primes is an exact identity. +- "f(n) = (1 + o(1))n for almost all n" requires interpreting "almost all" as natural density 0 for the exceptional set, which is the standard interpretation and is what the formalization uses. + +**Ambiguity assessment: Low.** The only potential ambiguity is in "almost all," which the formalization resolves using the standard number-theoretic convention (natural density). This is the correct choice. + +## 6. Correctness + +### Definition of `f` + +```lean +noncomputable def f (u : ℕ) : ℕ := + sInf {v : ℕ | u < v ∧ ∀ p : ℕ, Nat.Prime p → p ∣ v → p ∣ u} +``` + +This defines f(u) as the smallest v > u such that every prime factor of v divides u. This matches the equivalent formulation given on the website. **Correct.** + +**Edge case analysis:** +- For u ≥ 2, the set is always nonempty (u² is a witness: u² > u and every prime factor of u² divides u), so `sInf` returns a meaningful value. ✓ +- For u = 1, the set is empty (no v > 1 has all prime factors dividing 1, since 1 has no prime factors), so `sInf ∅ = 0` by convention. The theorems avoid this by requiring `2 ≤ u`. ✓ +- For u = 0, every prime divides 0, so every v > 0 is in the set, giving f(0) = 1. This is technically well-defined but mathematically meaningless; again excluded by `2 ≤ u`. ✓ + +### Lower bound (u + 2 ≤ f(u)) + +For u ≥ 2, we need f(u) ≥ u + 2, i.e., u + 1 does not have all its prime factors dividing u. Since gcd(u, u+1) = 1 and u + 1 ≥ 3, u + 1 has some prime factor, and none of them divide u. So u + 1 is not in the defining set, meaning f(u) > u + 1, hence f(u) ≥ u + 2. **Correct.** + +### Upper bound (f(u) ≤ u²) + +For u ≥ 2, u² > u and every prime dividing u² divides u. So u² is in the defining set, and f(u) ≤ u². **Correct.** + +### Prime case (f(p) = p²) + +For a prime p, the numbers whose prime factors all divide p are exactly the powers of p: 1, p, p², p³, .... The smallest power of p exceeding p is p². So f(p) = p². **Correct.** + +### Main theorem (almost-all density) + +The statement says: for every ε > 0, the proportion of n ≤ x with f(n) > (1+ε)n tends to 0 as x → ∞. This is the standard formalization of "f(n) = (1 + o(1))n for almost all n" in the natural-density sense. Since f(n) > n for all n ≥ 2 (by the lower bound), the condition f(n)/n → 1 in density reduces to the one-sided upper bound, which is what the statement captures. + +Note the Finset range is `Finset.Icc 1 x`, so the count starts at n = 1. Since f(1) = 0 (edge case) means f(1) > (1+ε)·1 is false for any ε > 0, including n = 1 in the range doesn't affect correctness. **Correct.** + +### Attributions + +The main theorem and the prime case are tagged `category research solved`, which matches the website status (solved by Cambie). The bounds are tagged `category undergraduate`, which is appropriate for trivial bounds. **Correct.** + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity (density API); not critical | +| Citations | ✅ Correct, minor accent difference in "Mathématique" | +| Variants | ⚠️ Two missing: f(2^k − 2) = 2^k and even upper bound | +| Readability | ✅ Good | +| Formalizability | ✅ Low ambiguity | +| Correctness | ✅ All formalized statements are mathematically correct | diff --git a/ai-review/46.md b/ai-review/46.md new file mode 100644 index 0000000000..f74fc48bc4 --- /dev/null +++ b/ai-review/46.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 46 + +## 1. Code Reuse + +**`reciprocalSum` from Problem 296.** Problem 296 (`FormalConjectures/ErdosProblems/296.lean:44`) defines: +```lean +noncomputable def reciprocalSum (A : Finset ℕ) : ℚ := + ∑ n ∈ A, (1 : ℚ) / (n : ℚ) +``` +This is exactly the expression used inline in Problem 46's statement (`∑ n ∈ S, (1 : ℚ) / (n : ℚ)`). The same inline pattern also appears in Problem 45. All three could share the `reciprocalSum` definition for consistency and readability. + +**Problem 45 (`FormalConjectures/ErdosProblems/45.lean`).** Problem 45 is the most closely related formalization — it concerns monochromatic subsets of divisors with reciprocal sum 1, proved by the same Croot [Cr03] paper. Both problems share the monochromatic reciprocal-sum-equals-1 pattern but differ in the domain (divisors of n vs. all integers ≥ 2) and the coloring style (`Fin k` vs. polymorphic `α`). No shared helper definitions exist between them. + +**Problem 47 (`FormalConjectures/ErdosProblems/47.lean`).** Problem 47 concerns finding subsets with reciprocal sum 1 within dense sets. It uses `ℝ` rather than `ℚ` for the reciprocal sum, which is an inconsistency with Problems 45 and 46. + +## 2. Citations + +The formalization cites: +- [Cr03] Croot, E.S., *On a coloring conjecture about unit fractions*, Annals of Mathematics **157** (2003), 545–556. + +The website (erdosproblems.com/46) lists the following additional references not mentioned in the formalization: +- [Er77c] Erdős (1977) +- [ErGr80] Erdős & Graham (1980), p. 36 +- [Er92c] Erdős (1992) +- [Er95] Erdős (1995) +- [Er96b] Erdős (1996) +- [Er97c] Erdős (1997) + +The [Cr03] citation as given in the formalization matches the website. The omission of the other references is acceptable since [Cr03] is the solving paper. However, the original source [ErGr80] could be worth including as the problem origin. + +The website also cross-references **Problem #298** as related. + +## 3. Variants + +The website describes an important **generalization** not captured in the formalization: + +> The original sources (Erdős & Graham, 1980) posed a broader question: whether every finite coloring yields monochromatic representations of **any positive rational a/b** (not just 1). This follows from the unit case by considering induced colorings on {n/b : b | n}. + +The formalization only captures the case of summing to 1. A variant theorem for arbitrary positive rationals would more completely represent the problem as posed. The generalization is a direct corollary of the formalized statement, but it could still be worth formalizing as a separate theorem or at minimum mentioning in the docstring. + +Additionally, Croot proved a stronger result than what is stated: there exist **infinitely many disjoint** monochromatic solutions. The formalization only asserts the existence of one such set. + +## 4. Readability + +The code is clean, concise, and well-structured. Minor observations: + +- **Inline reciprocal sum:** Using `reciprocalSum` from Problem 296 (or a shared utility) would improve readability and signal the connection to related problems. +- **Coloring style inconsistency:** Problem 46 uses `∀ (α : Type*) [Finite α] (c : ℕ → α)` (polymorphic), while the closely related Problem 45 uses `∀ k : ℕ, k ≥ 2 → ... (c : ℕ → Fin k)`. Both are correct but the difference in style between two adjacent, closely related problems is slightly jarring. Problem 46 is the **only** problem in the entire codebase using the polymorphic `[Finite α]` approach. Every other coloring problem uses `Fin k`, `Fin r`, `Fin 2`, or `Bool`. +- **Docstring** is clear and accurately describes the mathematical content. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement — "every finite colouring of the integers ≥ 2 has a monochromatic subset whose reciprocals sum to 1" — is entirely precise. There is no ambiguity in: +- What "finite colouring" means (a function from integers to a finite set of colors) +- What "monochromatic" means (all elements assigned the same color) +- What "reciprocals sum to 1" means (the sum ∑ 1/nᵢ = 1) +- The domain restriction (integers ≥ 2, with distinct elements — captured by `Finset`) + +The problem is a clean Ramsey-theoretic statement with no quantitative bounds to interpret, making it ideal for formalization. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed assessment: + +- **Finite coloring:** `∀ (α : Type*) [Finite α] (c : ℕ → α)` correctly captures "every finite coloring." The polymorphic approach is equivalent to the `Fin k` approach since every finite type is in bijection with some `Fin k`. The vacuous case where `α` is empty is harmless (there are no functions `ℕ → α` when `α` is empty and `ℕ` is nonempty, so the universal quantifier is vacuously true). +- **Domain restriction:** `∀ n ∈ S, n ≥ 2` correctly restricts to integers ≥ 2. +- **Non-emptiness:** `S.Nonempty` correctly ensures the solution set is non-trivial. +- **Distinctness:** Using `Finset ℕ` automatically guarantees the elements are distinct, matching the problem's requirement that n₁ < n₂ < ⋯ < nₖ. +- **Monochromatic condition:** `∃ color : α, ∀ n ∈ S, c n = color` is correct. +- **Reciprocal sum:** `(∑ n ∈ S, (1 : ℚ) / (n : ℚ)) = 1` correctly computes the sum over rationals. Using `ℚ` (rather than `ℝ`) is a good choice since the sum of unit fractions is rational, and equality in `ℚ` is decidable. +- **`answer(True)` wrapper:** Correctly indicates the affirmative answer, consistent with Croot's proof. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the core problem statement. The only incompleteness is the omission of the stronger variants (arbitrary rationals, infinitely many disjoint solutions), which are extensions rather than the core problem itself. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Could use `reciprocalSum` from Problem 296; coloring style inconsistent with Problem 45 | +| Citations | [Cr03] correct; missing original source [ErGr80]; missing cross-reference to Problem 298 | +| Variants | Missing generalization to arbitrary positive rationals a/b; missing "infinitely many disjoint" strengthening | +| Readability | Clean and concise; minor style inconsistency with sibling problems | +| Formalizability | Unambiguous, clearly formalizable | +| Correctness | Mathematically correct and complete for the core statement | diff --git a/ai-review/460.md b/ai-review/460.md new file mode 100644 index 0000000000..95a07f31f6 --- /dev/null +++ b/ai-review/460.md @@ -0,0 +1,105 @@ +# Review: Erdős Problem 460 + +## 1. Code Reuse + +Several existing definitions in the codebase overlap with patterns used in 460.lean: + +- **`ReciprocalSumDiverges`** (Problem 691, `691.lean:58`): Defines divergence of reciprocal sums over a set. Problem 460 instead defines a concrete `erdos460Sum : ℕ → ℝ` and uses `Tendsto erdos460Sum atTop atTop`. These are different formulations (one parameterized by a set, the other by a sequence indexed by `n`), so direct reuse is not straightforward, but the pattern is consistent. +- **Greedy `sInf` pattern** (Problems 282, 820, 970): The `sInf`-based greedy construction in `erdos460Seq` follows the same idiom used in `greedyDenominator` (282.lean:32) and the Jacobsthal function (970.lean:49). No shared utility exists for this pattern, which is reasonable since each greedy condition is problem-specific. +- **Reciprocal sum over filtered Finset** (Problems 65, 691, 950): The `erdos460Sum` pattern `F.sum (fun k => (1 : ℝ) / (k : ℝ))` is standard and matches usage elsewhere. No abstraction needed. + +**Verdict**: No significant code reuse opportunities. The definitions are appropriately self-contained. + +## 2. Citations + +The formalization cites: +- [Er77c] Erdős, P., *Problems and results on combinatorial number theory III*, Number Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976) (1977), 43–72. + +The website (erdosproblems.com/460) lists **two** references: +- [Er77c] (as above) +- **[ErGr80]** Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathematique (1980), p.91. + +**Issue**: The [ErGr80] reference is missing from the docstring. It should be added, especially since [ErGr80] is cited elsewhere in the codebase (e.g., Problem 282). + +The docstring also states "This problem arose in work of Eggleton, Erdős, and Selfridge," which is consistent with the website's description. + +## 3. Variants + +The website describes **secondary questions** not captured by the formalization: + +> What holds if the sum is restricted to indices where $n - a_j$ is divisible by some prime $\leq a_j$, or the complement? + +These variants (partitioning the sum based on the smallest prime factor condition) are not formalized. Additionally, the website mentions: + +- A **growth rate conjecture**: $a_k \ll k \log k$ (Eggleton–Erdős–Selfridge proved $a_k < k^{2+o(1)}$). +- **Chojecki's reformulation**: the problem would follow from $f(n) = \sum_{a < n} \mathbf{1}_{P^-(n-a) > a} \cdot 1/a \to \infty$, where $P^-(m)$ is the least prime factor of $m$. + +**Verdict**: The core question is captured, but the secondary variants and the growth rate conjecture are missing. Whether to include these is a judgment call; the growth rate conjecture and Chojecki's reformulation could be valuable as separate theorem statements. + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- The docstring for `erdos460Seq` says "$a_0 = 0$ and $a_{k+1}$ is the least integer greater than $a_k$..." — this is clear and matches the code. +- The docstring for `erdos460Sum` is adequate but could note that the sum ranges over **indices** `k` (not sequence values), which is a subtle distinction when reading the Lean code. Specifically, it sums `1/a_k` for those `k < n` with `0 < a_k < n`. +- The `open Finset Filter Classical` line is standard; no issues. + +**Verdict**: Readability is good. + +## 5. Formalizability + +The website itself notes: + +> The original sources present the problem differently (varying initial conditions and summation bounds). The precise intended problem statement remains somewhat ambiguous. + +Key ambiguities: +1. **Initial conditions**: The website states $a_0 = 0, a_1 = 1$. The formalization defines only $a_0 = 0$ and lets $a_1$ be computed by the greedy rule. This is actually **correct**: since $a_1$ must be the least $m > 0$ with $\gcd(n - m, n) = 1$, and $\gcd(n - 1, n) = 1$ always holds (consecutive integers are coprime), $a_1 = 1$ is correctly derived. This is a good design choice. +2. **Summation range**: The restriction to $0 < a_i < n$ is essential (without it, the sum is trivially infinite since the sequence is unbounded). The formalization correctly includes this restriction. +3. **Whether $(a_k, n) = 1$ is a separate condition**: The original formulation apparently includes $\gcd(a_k, n) = 1$ as an explicit condition. In the formalization, since $a_0 = 0$, the coprimality condition $\gcd(n - m, n - a_0) = \gcd(n - m, n) = \gcd(m, n) = 1$ automatically enforces this. So the condition is **implicitly captured** — this is mathematically elegant. + +**Verdict**: The problem is formalizable despite the noted historical ambiguity. The formalization makes reasonable, defensible choices. The ambiguity level is **moderate** — different sources give slightly different formulations, but the chosen version is well-defined and consistent with the primary reference [Er77c]. + +## 6. Correctness + +### Sequence definition (`erdos460Seq`) + +- **Base case**: $a_0 = 0$. Correct. +- **Recursive case**: $a_{k+1} = \inf\{m \in \mathbb{N} \mid m > a_k \land \forall i \leq k,\, \gcd(n - m, n - a_i) = 1\}$. The quantifier `∀ i ≤ k` correctly covers $a_0, \ldots, a_k$, matching the website's "$\gcd(n - a_k, n - a_i) = 1$ for all $0 \leq i < k$" (after re-indexing: defining the $(k+1)$-th term requires coprimality with all previous $k+1$ terms, i.e., indices $0, \ldots, k$). **Correct**. +- **Well-definedness concern**: If the infimum set is empty, `sInf ∅ = 0` in `ℕ`, causing `erdos460Seq n (k+1) = 0`. This would happen if no valid next term exists. In practice, for $m$ large enough (specifically $m > n$ with all relevant terms giving $n - a_i = 0$ or 1), the condition becomes very restrictive. However, since the sum only considers terms with `0 < a_k < n`, this edge case does not affect the theorem statement. The sequence is `noncomputable` so this is acceptable from a formalization perspective — the mathematical content is in the theorem, not in computability. + +### Natural number subtraction + +The coprimality condition uses `n - m` and `n - erdos460Seq n i` as natural number subtractions. For terms $m < n$ and $a_i < n$, these are positive and match the intended integer subtraction. For terms $m \geq n$, `n - m = 0` in `ℕ`, and `Nat.Coprime 0 x` requires $x = 1$. This means the sequence effectively "stalls" or returns 0 once it passes $n$, which is fine since those terms are excluded from the sum. **No correctness issue for the theorem as stated.** + +### Sum definition (`erdos460Sum`) + +- Ranges over `k ∈ Finset.range n` (indices 0 through $n-1$). +- Filters for `0 < erdos460Seq n k ∧ erdos460Seq n k < n`. +- Sums `1 / (erdos460Seq n k : ℝ)`. + +**Correctness check**: Since the sequence is (intended to be) strictly increasing with $a_k \geq k$, for $a_k < n$ we need $k < n$, so `Finset.range n` is sufficient to capture all relevant indices. The filter correctly excludes $a_0 = 0$ (avoiding division by zero) and terms $\geq n$. **Correct**. + +### Theorem statement + +```lean +answer(sorry) ↔ Tendsto erdos460Sum atTop atTop +``` + +This asks whether the sum diverges as $n \to \infty$, wrapped in the `answer(sorry)` pattern for an open problem. **Correct**. + +### Potential concern + +The `erdos460Sum` iterates over indices `k` in `Finset.range n` and sums `1/(erdos460Seq n k)`. If two different indices give the same sequence value (which shouldn't happen for a strictly increasing sequence, but could happen if the `sInf` returns 0 due to an empty set), the sum would double-count. In practice the sequence is strictly increasing for meaningful terms, so this is not a real issue. + +**Overall correctness verdict**: The formalization is **correct and mathematically sound**. The definitions faithfully capture the intended problem. No obvious flaws would be identified by an experienced mathematician. The use of natural number subtraction is safe within the relevant range, and the `sInf`-based greedy construction is the standard approach for such formalizations. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No significant opportunities; self-contained is appropriate | +| Citations | **Missing [ErGr80] reference** | +| Variants | Secondary questions and growth rate conjecture not captured | +| Readability | Good | +| Formalizability | Moderate ambiguity in source; formalization makes sound choices | +| Correctness | **Correct and complete** for the main question | diff --git a/ai-review/461.md b/ai-review/461.md new file mode 100644 index 0000000000..7a33e6e141 --- /dev/null +++ b/ai-review/461.md @@ -0,0 +1,128 @@ +# Review: Erdős Problem 461 + +## 1. Code Reuse + +Two existing definitions closely parallel `smoothComponent`: + +- **`smoothPart`** (Problem 684, `684.lean:44–45`): Computes the $k$-smooth part of $m$ by iterating over all primes $p \leq k$ via `(Finset.range (k + 1)).filter Nat.Prime`. Problem 461's `smoothComponent` instead filters `n.factorization.support` by `· < t`. These produce identical results (since `p ^ (m.factorization p) = p ^ 0 = 1` for primes not dividing $m$), but differ in two ways: (a) the iteration strategy (all primes up to the bound vs. only prime factors of $n$), and (b) the boundary convention ($\leq k$ vs. $< t$). A shared utility parameterized by a predicate on primes would unify them, but given the boundary mismatch and namespace separation, the duplication is minor and arguably justified. + +- **`powerfulPart`** (Problem 935, `935.lean:37–39`): Uses the exact same structural pattern — `n.factorization.support.filter(predicate).prod(fun p => p ^ n.factorization p)` — but filters by exponent ($\geq 2$) rather than by prime value ($< t$). This confirms the idiom is well-established in the codebase. + +**Verdict**: The `smoothComponent` definition follows established codebase idioms. There is a mild duplication with `smoothPart` from Problem 684, but the boundary convention difference ($< t$ vs. $\leq k$) and different problem contexts make a shared definition impractical without added complexity. No action needed. + +## 2. Citations + +The formalization cites: +- `[ErGr80]` Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +The website ([erdosproblems.com/461](https://www.erdosproblems.com/461)) lists: +- Source: **[ErGr80, p.92]** + +The formalization's citation matches. The docstring references `[ErGr80, p.92]` in the theorem statement, which is consistent with the website. The full bibliographic entry in the module docstring is correct. + +**Verdict**: Citations are correct and complete. + +## 3. Variants + +The website includes an additional note not captured by the formalization: + +> Erdős and Graham state that they can prove that $f(n,t) \gg t / \log t$. + +This partial result — that $f(n,t) \geq c \cdot t / \log t$ for some absolute constant $c > 0$ — is a weaker but proven bound. It could be formalized as a separate theorem: + +```lean +@[category research solved, AMS 11] +theorem erdos_461.variants.lower_bound : + ∃ c : ℝ, c > 0 ∧ ∀ n t : ℕ, 0 < t → + (f n t : ℝ) ≥ c * ((t : ℝ) / Real.log (t : ℝ)) := by + sorry +``` + +**Verdict**: The main open question is captured, but the known partial result $f(n,t) \gg t / \log t$ is missing as a variant. This is a notable omission since it represents the current state of knowledge on the problem. + +## 4. Readability + +The code is clean and compact (59 lines including license header). The definitions are well-documented: + +- `smoothComponent` has a clear docstring explaining the mathematical content. +- `f` has an adequate docstring. +- The module docstring provides context and motivation. + +Minor suggestions: +- The module docstring says "smooth components among consecutive integers" — this could more precisely say "distinct $t$-smooth components" to match the formal definition. +- The docstring for `smoothComponent` says "primes $p < t$", matching the website's strict inequality. Good. + +**Verdict**: Readability is good. No significant improvements needed. + +## 5. Formalizability + +The problem statement on the website is: + +> Let $s_t(n)$ be the $t$-smooth component of $n$ — the product of all primes $p$ (with multiplicity) dividing $n$ such that $p < t$. Let $f(n,t)$ count the number of distinct possible values for $s_t(m)$ for $m \in [n+1, n+t]$. Is it true that $f(n,t) \gg t$ (uniformly, for all $t$ and $n$)? + +This is precise and unambiguous: +1. The definition of $s_t(n)$ is explicit (product of $p^{v_p(n)}$ for primes $p < t$). +2. The range $[n+1, n+t]$ is clearly specified. +3. The asymptotic notation "$f(n,t) \gg t$ uniformly" has a standard meaning: $\exists c > 0$ such that $f(n,t) \geq ct$ for all $n, t$. + +The only minor point: the problem uses strict inequality $p < t$ rather than the more common $p \leq t$ for "$t$-smooth." This is a deliberate choice in the original problem, and the formalization correctly follows it. + +**Verdict**: Low ambiguity. The problem is precisely stated and directly formalizable. + +## 6. Correctness + +### `smoothComponent` definition + +```lean +noncomputable def smoothComponent (t n : ℕ) : ℕ := + (n.factorization.support.filter (· < t)).prod + (fun p => p ^ n.factorization p) +``` + +- Filters the prime factors of $n$ to those strictly less than $t$, then takes the product of $p^{v_p(n)}$ over those primes. This correctly computes $s_t(n)$. +- **Edge case $n = 0$**: `(0).factorization.support` is empty, so `smoothComponent t 0 = 1` (empty product). Since $0$ never appears in the range $[n+1, n+t]$ (all elements are $\geq 1$), this is irrelevant. +- **Edge case $n = 1$**: `(1).factorization.support` is empty, so `smoothComponent t 1 = 1`. Correct — 1 has no prime factors, so its $t$-smooth component is 1. +- **Edge case $t = 0$ or $t = 1$**: No primes satisfy $p < 0$ or $p < 1$, so `smoothComponent t m = 1` for all $m$. This is mathematically correct (vacuous smooth component). + +### `f` definition + +```lean +noncomputable def f (n t : ℕ) : ℕ := + ((Finset.Icc (n + 1) (n + t)).image (smoothComponent t)).card +``` + +- Maps `smoothComponent t` over $\{n+1, \ldots, n+t\}$ and counts distinct values. Correct. +- **Edge case $t = 0$**: `Finset.Icc (n+1) (n+0) = Finset.Icc (n+1) n = ∅` (since $n+1 > n$), so `f n 0 = 0`. This case is excluded by the `0 < t` hypothesis. Fine. + +### Theorem statement + +```lean +theorem erdos_461 : + answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ ∀ n t : ℕ, 0 < t → + (f n t : ℝ) ≥ c * (t : ℝ) := by +``` + +This correctly encodes "$f(n,t) \gg t$ uniformly" as the existence of a positive constant $c$ with $f(n,t) \geq ct$ for all $n$ and all $t \geq 1$. + +**Sanity checks on small cases**: +- $t = 1$: $f(n, 1) = |\{s_1(n+1)\}| = 1$ (since $s_1$ is always 1 — no primes $< 1$). Need $1 \geq c$, so $c \leq 1$. +- $t = 2$: $s_2(m) = 1$ for all $m$ (no primes $< 2$), so $f(n, 2) = 1$. Need $1 \geq 2c$, so $c \leq 1/2$. +- $t = 3$: $s_3(m) = 2^{v_2(m)}$. Among two consecutive integers $n+1, n+2$, one is odd (giving $s_3 = 1$) and one is even (giving $s_3 = 2^{v_2}$). So $f(n, 3) \geq 2$ (at least two distinct values). Need $2 \geq 3c$, so $c \leq 2/3$. + +These are all consistent; the constant $c$ would need to be small (at most $1/2$ based on the $t=2$ case). Note that for $t = 2$, the bound $f(n,2) \geq 2c$ requires $c \leq 1/2$, so a linear bound is tight at the low end. + +**Potential subtle issue**: The problem uses $p < t$ (strict), which means when $t$ is prime, $t$ itself is *not* included among the "smooth" primes. This is consistent with the website but worth noting: if someone expects $t$-smooth to mean primes $\leq t$, they would get a different answer. The formalization is faithful to the source. + +**Verdict**: The formalization is **correct and mathematically sound**. The definitions faithfully encode the problem statement from the website. Edge cases are handled appropriately, and the asymptotic statement is correctly formalized with uniform quantification. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Minor overlap with `smoothPart` (684) and `powerfulPart` (935); no action needed | +| Citations | Correct and complete | +| Variants | **Missing the known partial result $f(n,t) \gg t / \log t$** | +| Readability | Good | +| Formalizability | Low ambiguity; precisely stated | +| Correctness | **Correct and complete** for the main question | diff --git a/ai-review/462.md b/ai-review/462.md new file mode 100644 index 0000000000..fe54f03408 --- /dev/null +++ b/ai-review/462.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 462 + +## 1. Code Reuse + +The formalization filters composite numbers using `fun n => ¬ Nat.Prime n`. The codebase provides a cleaner alternative: + +- **`Nat.Composite`** (`FormalConjecturesForMathlib/Data/Nat/Prime/Composite.lean:18`): defined as `abbrev Nat.Composite (n : ℕ) : Prop := 1 < n ∧ ¬n.Prime`. Problem 463 (`FormalConjectures/ErdosProblems/463.lean:40`) already uses `m.Composite` for the same semantic purpose. The main theorem in 462 could adopt this for consistency, though for large `x` the distinction is immaterial (see Correctness). + +- **`Nat.minFac`** is used consistently across related problems (430, 463, 680, 682, 858) and is the standard codebase choice for "least prime factor." Problem 681 defines a custom `IsLPF` predicate, but `Nat.minFac` is the more conventional and reusable approach, so 462's choice is correct. + +- The `Tendsto ... atTop (nhds c)` pattern for the asymptotic variant is standard and appears in problems 5, 50, 468, and 1095. + +**Recommendation:** Replace `fun n => ¬ Nat.Prime n` with `fun n => n.Composite` (or an equivalent decidable filter) for consistency with problem 463 and semantic precision. This would require importing or depending on the Composite definition. + +## 2. Citations + +The formalization cites: + +> [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980), p. 92. + +The website (erdosproblems.com/462) confirms: +- Source: [ErGr80, p.92] +- Status: **Open** +- Additional contributor: Zachary Chase (not mentioned in formalization, but this appears to be a website contributor rather than a mathematical author) + +The citation is **accurate and complete**. No discrepancy between the formalization and the website. + +## 3. Variants + +The formalization includes two statements: + +1. **`erdos_462`** — the main open question about the existence of constant `C`. +2. **`erdos_462.variants.asymptotic`** — the background asymptotic result that `∑_{composite n ≤ x} p(n)/n ~ c·√x/(log x)²`. + +The website presents the asymptotic fact as motivation/context for the main question, and the formalization correctly captures both. The asymptotic variant is tagged `category research solved`, which is appropriate since it is a known result (not an open problem). + +**No missing variants identified.** The formalization captures all aspects of the problem as stated on the website. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The main theorem's sum expression (lines 48–51) is somewhat dense. The `Finset.Icc` with a `⌊...⌋₊` upper bound nested inside a `.filter` makes parsing the mathematical intent non-trivial. A `let` binding for the interval endpoint could improve clarity: + ``` + let upper := x + ⌊C * Real.sqrt (x : ℝ) * (Real.log (x : ℝ)) ^ 2⌋₊ + ``` +- The docstrings clearly state the problem in LaTeX, which is good. +- The module docstring includes both the problem statement and full citation, which is exemplary. + +## 5. Formalizability + +**Assessment: High formalizability with minor ambiguity.** + +The original problem uses the Vinogradov notation `≫ 1`, meaning "bounded below by a positive constant for all sufficiently large `x`." The formalization correctly interprets this as `∃ δ > 0, ∃ x₀, ∀ x ≥ x₀, δ ≤ (sum)`, which is the standard meaning. + +The only potential ambiguity is whether the interval `[x, x + C√x(log x)²]` is meant over reals or integers. Since `p(n)` is defined for natural numbers and the sum is over composite `n`, the integer interpretation is clearly intended. The formalization handles this correctly by working over `ℕ` and using `⌊...⌋₊` for the upper bound. + +The asymptotic notation `~` in the variant is unambiguous and correctly formalized as the ratio tending to a positive constant. + +**Ambiguity level: Low.** The problem is precise enough to be obviously formalizable. + +## 6. Correctness + +**Main theorem (`erdos_462`):** + +The formalization is **mathematically correct** with one minor semantic imprecision: + +- **Composite vs. non-prime filtering:** The filter `¬ Nat.Prime n` includes `n = 0` and `n = 1`, which are not prime but also not composite. For `n = 0`, the term `minFac 0 / 0` evaluates to `2 / 0 = 0` in Lean's reals (division by zero yields zero). For `n = 1`, `minFac 1 / 1 = 1 / 1 = 1`. However, since `x₀` can be chosen large (≥ 2), all `n` in the interval satisfy `n ≥ x ≥ 2`, making the filter equivalent to filtering composites. **This is not a mathematical error**, but using `Nat.Composite` would be more precise and avoid reliance on the `x₀` quantifier for correctness of the filter. + +- **Interval discretization:** Using `⌊C * √x * (log x)²⌋₊` correctly maps the real-valued interval length to a natural number bound. For large `x`, the floor introduces an error of at most 1, which is negligible. + +- **Structure of quantifiers:** `∃ C > 0, ∃ δ > 0, ∃ x₀, ∀ x ≥ x₀, δ ≤ (sum)` correctly captures "there exists C such that the sum is ≫ 1 for all large x." + +- **`answer(sorry)`:** Correctly used for an open problem whose truth value is unknown. + +**Asymptotic variant (`erdos_462.variants.asymptotic`):** + +- The sum starts at `Finset.Icc 2 x`, so `n ≥ 2` and filtering by `¬ Nat.Prime n` correctly yields only composite numbers. This is **precise**. +- The convergence `Tendsto (fun x => (sum) / (√x / (log x)²)) atTop (nhds c)` correctly formalizes `sum ~ c · √x / (log x)²`. +- Tagged as `category research solved`, which is appropriate. + +**Overall: The formalization is correct and complete.** No experienced mathematician would identify any substantive flaw. The only actionable improvement is the stylistic preference for `Nat.Composite` over `¬ Nat.Prime` in the filter for the main theorem. diff --git a/ai-review/464.md b/ai-review/464.md new file mode 100644 index 0000000000..a99cc3c39e --- /dev/null +++ b/ai-review/464.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 464 + +**File:** `FormalConjectures/ErdosProblems/464.lean` + +--- + +## 1. Code Reuse + +**`distNearestInt`:** This identical definition (`min (Int.fract x) (1 - Int.fract x)`) is duplicated across at least four files: +- `ErdosProblems/464.lean` (as `Erdos464.distNearestInt`) +- `ErdosProblems/465.lean` (as `Erdos465.distNearestInt465`) +- `ErdosProblems/466.lean` +- `ErdosProblems/254.lean` (as `Erdos254.distNearestInt`) + +Additionally, `LittlewoodConjecture.distToNearestInt` uses the equivalent formulation `|x - round x|`. All of these should ideally be consolidated into a single shared definition (e.g., in a `FormalConjecturesForMathlib` utility file), since they are mathematically identical. + +**`IsLacunary`:** A canonical definition already exists in `FormalConjecturesForMathlib/NumberTheory/Lacunary.lean`: +```lean +def IsLacunary (n : ℕ → ℕ) : Prop := ∃ c > (1 : ℝ), ∀ᶠ k in atTop, c * n k < n (k + 1) +``` +The definition in 464.lean is stricter: it requires `StrictMono a` and the lacunary ratio to hold for **all** `k` (not just eventually). The same stricter definition is copy-pasted in `ErdosProblems/894.lean`. These could potentially reference the shared definition, though the "for all k" vs "eventually" distinction is substantive (see Correctness below). + +## 2. Citations + +The website (erdosproblems.com/464) lists the following references and attribution: +- **de Mathan [dM80]** and **Pollington [Po79b]** — independently proved the result. +- **Katznelson [Ka01]**, **Akhunzhanov & Moshchevitin [AkMo04]**, **Dubickas [Du06]**, **Peres & Schlag [PeSc10]** — progressively improved quantitative bounds on $\inf_{k \geq 1} \|\theta n_k\|$. +- Related problem: **Problem 894**. + +The formalization's docstring mentions "Proved by de Mathan and Pollington" which is correct. However, the citation keys (dM80, Po79b, etc.) are not included. The module docstring should ideally list the full references as they appear on the website, especially de Mathan and Pollington. The connection to Problem 894 is not mentioned in 464.lean (though 894.lean does reference 464). + +## 3. Variants + +The website describes one main statement and progressive quantitative strengthenings: + +- **Base result (proved):** There exists an irrational θ such that {‖θn_k‖} is not dense in [0,1]. ✓ Captured. +- **Quantitative strengthening:** $\inf_{k \geq 1} \|\theta n_k\| \gg \frac{\varepsilon}{\log(1/\varepsilon)}$ (Peres–Schlag). ✗ Not captured. + +The quantitative variant is a natural and notable strengthening. A `variants` theorem giving a lower bound on the infimum of ‖θn_k‖ in terms of ε would be a valuable addition. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstring clearly explains the "not dense" formalization as avoiding an open subinterval of [0, 1/2], which is helpful. +- The namespace `Erdos464` is clean and self-contained. +- The `distNearestInt` and `IsLacunary` definitions have clear docstrings. + +No significant readability issues. + +## 5. Formalizability + +**Assessment: High — the statement is precise and clearly formalizable.** + +The original problem asks whether {‖θn_k‖ : k ≥ 1} is "not dense in [0,1]". Since ‖x‖ ∈ [0, 1/2] always, density in [0,1] is equivalent to density in [0, 1/2]. "Not dense" means the closure does not equal the full interval, which is equivalent to the existence of a non-empty open subinterval avoided by the image. The formalization captures this correctly via the existence of c, d with 0 ≤ c < d ≤ 1/2 such that no ‖θ · a(k)‖ lies in (c, d). + +There is no meaningful ambiguity in the problem statement. + +## 6. Correctness + +**Overall assessment: Largely correct, with two notable discrepancies.** + +### 6a. The interval discrepancy: [0, 1] vs [0, 1/2] + +The website states the problem asks about density in **[0, 1]**, not [0, 1/2]. However, since `distNearestInt` always takes values in [0, 1/2], density in [0, 1] is impossible, so density in [0, 1/2] is the only meaningful reading. The formalization's use of [0, 1/2] is **mathematically correct** — the website's "[0,1]" is presumably a shorthand or slight imprecision. The docstring correctly notes d ≤ 1/2. + +### 6b. The lacunary definition: "for all k" vs "eventually" + +The 464.lean definition requires the lacunary ratio for **all** k: +```lean +∀ k : ℕ, (a (k + 1) : ℝ) ≥ (1 + ε) * (a k : ℝ) +``` +The canonical `FormalConjecturesForMathlib` definition uses **eventually** (∀ᶠ k in atTop). Since any sequence satisfying the lacunary condition eventually can be trimmed to one satisfying it everywhere (by dropping finitely many initial terms), these are essentially equivalent for the purpose of this theorem — the result for the "eventually" version follows trivially from the "for all" version by passing to a tail. The "for all" version is the more standard formulation in the literature and is fine here. + +### 6c. StrictMono redundancy + +The `IsLacunary` definition includes both `StrictMono a` and the ratio condition. The ratio condition `a(k+1) ≥ (1+ε) · a(k)` with ε > 0 already implies `a(k+1) > a(k)` for all k with a(k) > 0, which (combined with a being ℕ-valued) implies strict monotonicity after the first non-zero term. The `StrictMono` condition is thus nearly redundant — it only adds that `a(0) < a(1)` in the edge case `a(0) = 0`. This is harmless but slightly over-specified. + +### 6d. Correctness of the "not dense" formalization + +The formalization states: +```lean +∃ c d : ℝ, 0 ≤ c ∧ c < d ∧ d ≤ 1 / 2 ∧ ∀ k : ℕ, distNearestInt (θ * ↑(a k)) ∉ Set.Ioo c d +``` + +This says the image avoids some open interval (c, d) ⊆ [0, 1/2]. This is a correct formalization of "not dense in [0, 1/2]": a set is dense in a topological space iff it meets every non-empty open set, so non-density means some non-empty open interval is avoided. The use of `Set.Ioo` (open interval) is correct. **This is mathematically sound.** + +### 6e. Argument order in multiplication + +The formalization uses `θ * ↑(a k)` while the problem statement uses `θ · nₖ`. This is consistent — just a notational choice. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs improvement | `distNearestInt` duplicated across 4+ files; `IsLacunary` duplicated with 894.lean; canonical `IsLacunary` exists in FormalConjecturesForMathlib | +| Citations | ⚠️ Incomplete | de Mathan and Pollington credited, but reference keys [dM80], [Po79b] not listed; quantitative improvements by Katznelson, Akhunzhanov–Moshchevitin, Dubickas, Peres–Schlag not mentioned | +| Variants | ⚠️ Missing | Quantitative Peres–Schlag bound (inf ≫ ε/log(1/ε)) not formalized | +| Readability | ✅ Good | Clear structure, helpful docstrings | +| Formalizability | ✅ Unambiguous | The statement is precise and admits a clean formalization | +| Correctness | ✅ Correct | The formalization is mathematically sound; the [0,1/2] vs [0,1] choice is the right one; the "not dense" encoding via avoided open interval is correct | diff --git a/ai-review/465.md b/ai-review/465.md new file mode 100644 index 0000000000..ea17663600 --- /dev/null +++ b/ai-review/465.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 465 + +## 1. Code Reuse + +**Issue: Duplicated `distNearestInt` definition.** The definition `distNearestInt465` at line 37 is identical (modulo the name suffix) to `distNearestInt` defined in at least four other files: + +- `ErdosProblems/254.lean:37` — `distNearestInt` +- `ErdosProblems/464.lean:32` — `distNearestInt` +- `ErdosProblems/466.lean:34` — `distNearestInt` +- `ErdosProblems/1147.lean:38` — `distNearestInt` + +All use the same body: `min (Int.fract x) (1 - Int.fract x)`. + +Additionally, `ErdosProblems/495.lean:32` and `Wikipedia/LittlewoodConjecture.lean:37` define an equivalent concept via `|x - round x|`. + +**Recommendation:** This is a strong candidate for a shared utility definition (e.g., in `FormalConjecturesForMathlib` or a shared Erdős utility file). A single canonical `distNearestInt` would reduce duplication and ensure consistency. The name `distNearestInt465` with the problem-number suffix is uniquely inconsistent — all other files simply use `distNearestInt` within their own namespace. + +## 2. Citations + +The formalization references: + +- **[Sa76]** Sárközy, A., *On difference sets of sequences of integers. I.* Acta Math. Acad. Sci. Hungar. 31 (1978), no. 1-2, 125-149. +- **[Ko01]** Konyagin, S. V., *A remark on sets of numbers with large trigonometric sums.* 2001. + +The website ([erdosproblems.com/465](https://www.erdosproblems.com/465)) states: + +- **Sárközy (1976)** proved the first conjecture with bound $N(X, \delta) \ll \delta^{-3} X / (\log \log X)$. +- **Konyagin (2001)** established $N(X, \delta) \ll_\delta X^{1/2}$. + +**Minor note:** The tag [Sa76] suggests 1976, while the full journal citation gives 1978 as the publication year. This is consistent with standard practice (citing by year of writing/submission vs. publication), so it is not incorrect, but worth being aware of. The Konyagin citation is sparse — the website does not provide a more complete reference either, so the formalization matches. The quantitative bounds from Sárközy ($\ll \delta^{-3} X / \log\log X$) mentioned on the website are not captured in the formalization's docstring; including them would be informative but is not strictly necessary since the formalization captures the qualitative conclusion. + +## 3. Variants + +The website poses two questions: + +1. For any $0 < \delta < 1/2$, is $N(X, \delta) = o(X)$? +2. Is $N(X, \delta) < X^{1/2 + o(1)}$ for any fixed $\delta > 0$? + +The formalization captures: + +- **Weak form** (`erdos_465`): The $o(X)$ bound for $\delta \in (0, 1/2)$. ✅ +- **Strong form** (`erdos_465.variants.strong`): The bound $N(X, \delta) \leq C \sqrt{X}$ for $\delta > 0$. ✅ + +**Assessment:** The strong form as formalized ($O(\sqrt{X})$) is actually *stronger* than the original question ($X^{1/2 + o(1)}$), but since Konyagin proved the $O(\sqrt{X})$ bound, the formalization correctly captures the proved result. This is appropriate and mathematically accurate. + +The website also notes Problem #466 as a related lower-bound problem (proved by Graham: $N(X, 1/10) > (\log X)/10$). This is formalized separately in `466.lean`, which is the correct approach. + +**No missing variants.** + +## 4. Readability + +The code is clean and well-structured. A few observations: + +- **Naming inconsistency:** `distNearestInt465` should be `distNearestInt` to match the convention in all other files. The namespace `Erdos465` already provides disambiguation. +- **Docstrings** are clear and accurately describe the mathematical content, including the relationship to the asymptotic notation. +- The use of `EuclideanSpace ℝ (Fin 2)` for $\mathbb{R}^2$ is idiomatic. +- The weak/strong form split with clear attribution (Sárközy/Konyagin) is well-organized. + +**Overall readability: Good.** The only actionable item is the naming inconsistency. + +## 5. Formalizability + +The problem is **fully formalizable with no ambiguity**. + +- The notion $\|x\|$ = distance from $x$ to nearest integer is standard and well-defined. +- "Points in a disk of radius $X$" is precisely captured by `dist p 0 ≤ X`. +- The asymptotic statements $o(X)$ and $O(\sqrt{X})$ are correctly rendered in the $\varepsilon$-$\delta$ / explicit-constant style appropriate for Lean. +- The choice of center (origin) is without loss of generality since the distance constraint $\|d\| \geq \delta$ is translation-invariant (it depends only on pairwise distances). + +**Ambiguity assessment: None.** This is one of the more cleanly formalizable Erdős problems. + +## 6. Correctness + +**Weak form (`erdos_465`):** Mathematically correct. The formalization states: for fixed $\delta \in (0, 1/2)$ and any $\varepsilon > 0$, for sufficiently large $X$, any valid point set has at most $\varepsilon X$ points. This is precisely the $o(X)$ statement. The constraint $\delta < 1/2$ matches the original problem and is mathematically necessary (for $\delta \geq 1/2$, the problem becomes trivial or vacuous). ✅ + +**Strong form (`erdos_465.variants.strong`):** Mathematically correct. It states: for fixed $\delta > 0$, there exists $C > 0$ such that for all $X > 0$, any valid point set has at most $C\sqrt{X}$ points. ✅ + +**Technical details verified:** + +- **Dropping $\delta < 1/2$ in the strong form:** This is correct. When $\delta > 1/2$, `distNearestInt` (which is always $\leq 1/2$) can never satisfy $\geq \delta$, so no two distinct points can coexist — the set has at most 1 element, and $1 \leq C\sqrt{X}$ holds trivially for appropriate $C$. When $\delta = 1/2$, pairwise distances must be exact half-integers, which is extremely restrictive and the bound still holds. +- **Disk model:** `dist p 0 ≤ X` is the closed Euclidean ball (disk) of radius $X$ centered at the origin. The website says "circle of radius $X$", which in this context means "disk" (the filled region), and the formalization correctly interprets this. +- **`distNearestInt` correctness:** `min (Int.fract x) (1 - Int.fract x)` correctly computes $\min(x - \lfloor x \rfloor, \lceil x \rceil - x)$, which is the distance from $x$ to the nearest integer. This is correct for all real $x$, including integers (where `Int.fract` returns 0, giving $\min(0, 1) = 0$). ✅ +- **Quantifier structure:** Both forms correctly universally quantify over the point set $A$, with the constraints that all points lie in the disk and all pairwise distances satisfy the separation condition. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `distNearestInt` duplicated in 5+ files; strong consolidation candidate | +| Citations | Consistent with website; Sárközy date (1976 vs 1978) is standard practice | +| Variants | All variants captured (weak + strong forms) | +| Readability | Good; rename `distNearestInt465` → `distNearestInt` for consistency | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/466.md b/ai-review/466.md new file mode 100644 index 0000000000..9faa767352 --- /dev/null +++ b/ai-review/466.md @@ -0,0 +1,65 @@ +# AI Review: Erdős Problem 466 + +## 1. Code Reuse + +**`distNearestInt` is duplicated across at least 5 files.** The identical definition `min (Int.fract x) (1 - Int.fract x)` appears in problems 254, 464, 466, and 1147. Problem 465 uses the same body but names it `distNearestInt465` to avoid namespace collision. Problem 495 and the Littlewood Conjecture file (`FormalConjectures/Wikipedia/LittlewoodConjecture.lean`) use an equivalent formulation `|x - round x|`. + +This definition should be extracted to a shared utility (e.g., `FormalConjecturesForMathlib/Analysis/DistNearestInt.lean` or similar) and reused. Neither Mathlib's `Int.fract` nor `round` directly provides this composite "distance to nearest integer" function, so a shared definition is warranted. + +The `EuclideanSpace ℝ (Fin 2)` usage, `dist p 0 ≤ X` disk containment pattern, and `Finset`-based point set representation are standard across ~55 other Erdős problems and are fine as-is. + +## 2. Citations + +The website (erdosproblems.com/466) references: +- **[Er72]** — Original source by Erdős (1972) +- **[ErGr80]** — Erdős and Graham (1980) +- **[Er82e]** — Erdős (1982) + +The current docstring mentions Graham's result `N(X, 1/10) > (log X)/10` but does **not** cite any of these references by name. It also omits **Sárközy's improvement** `N(X, δ) > X^{1/2 - δ^{1/7}}` for sufficiently small δ, which is a significant strengthening mentioned on the website. + +**Recommendation:** Add the three references [Er72], [ErGr80], [Er82e] to the docstring, and mention Sárközy's stronger bound. + +## 3. Variants + +The current formalization captures only the basic existential statement: "there exists δ > 0 such that N(X, δ) → ∞." + +**Missing variants:** + +1. **Graham's quantitative bound:** `N(X, 1/10) > (log X)/10`. This is explicitly stated in the docstring but not formalized as a separate theorem. It would be a natural `erdos_466.variants.graham` giving a concrete δ = 1/10 with a logarithmic lower bound. + +2. **Sárközy's improvement:** For all sufficiently small δ > 0, `N(X, δ) > X^{1/2 - δ^{1/7}}`. This is a much stronger polynomial lower bound and is mentioned on the website. A formalization as `erdos_466.variants.sarkozy` would capture this. + +3. **Connection to Problem 465 (upper bounds):** Problem 465 gives the complementary upper bounds (o(X) by Sárközy, O(√X) by Konyagin). The pair 465+466 together characterize the growth rate of N(X, δ). This relationship could be noted in the docstring. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The docstring notation `‖|P_i - P_j|‖` is slightly confusing because `‖·‖` typically denotes a norm in mathematics. The standard notation for distance to the nearest integer is `‖x‖` (with double bars) or `⟨x⟩` or `\{x\}` depending on convention, but the docstring should clarify this is the fractional distance, not a norm. The docstring does clarify this, which is good. +- The namespace `Erdos466` is consistent with project conventions. + +## 5. Formalizability + +**Assessment: High — the problem is unambiguous and the formalization is straightforward.** + +The original problem asks whether there exists δ > 0 such that N(X, δ) → ∞. This is a clean existential statement about a well-defined quantity. The formalization correctly translates "N(X, δ) → ∞" as: for every M, for sufficiently large X, one can find ≥ M points satisfying the constraints. This is a standard ε-δ rendering of a limit going to infinity. + +The definition of `distNearestInt` as `min (Int.fract x) (1 - Int.fract x)` correctly captures the distance to the nearest integer for non-negative reals (which `dist p q` always is). There is no ambiguity. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`distNearestInt` definition:** `min (Int.fract x) (1 - Int.fract x)` correctly computes the distance from x to the nearest integer. Since `Int.fract x ∈ [0, 1)`, this gives a value in `[0, 1/2]`, with 0 at integers and 1/2 at half-integers. This is correct. + +- **Disk containment:** `dist p 0 ≤ X` correctly represents a closed disk of radius X centered at the origin in `EuclideanSpace ℝ (Fin 2)`. + +- **Pairwise distance constraint:** `∀ p ∈ A, ∀ q ∈ A, p ≠ q → distNearestInt (dist p q) ≥ δ` correctly expresses that the fractional distance condition holds for all distinct pairs. + +- **Existential structure:** The statement `∃ δ > 0, ∀ M, ∃ X₀ > 0, ∀ X ≥ X₀, ∃ A, ...` correctly formalizes "there exists δ > 0 such that N(X, δ) → ∞ as X → ∞." + +- **One subtle point:** The formalization uses a closed disk (`dist p 0 ≤ X`) while the website says "circle of radius X" (which in this context means disk). This is fine — for a problem about large X asymptotics, closed vs. open disk is immaterial. + +- **Centering at origin:** The problem says "in a disk of radius X" without specifying center. The formalization fixes the center at the origin, which is without loss of generality by translation invariance of the distance function. Correct. + +**No mathematical flaws identified. The formalization is complete and correct for the basic problem statement, though it would benefit from the additional quantitative variants mentioned above.** diff --git a/ai-review/467.md b/ai-review/467.md new file mode 100644 index 0000000000..2df08dac9a --- /dev/null +++ b/ai-review/467.md @@ -0,0 +1,98 @@ +# AI Review: Erdős Problem 467 + +## 1. Code Reuse + +Several related constructions exist in the codebase: + +- **`CoveringSystem` / `StrictCoveringSystem`** (`FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`): These structures formalize covering systems over arbitrary commutative semirings using ideals. However, Problem 467 is not a standard covering system problem — it requires a *partition* of the moduli (primes) into two parts, each of which independently covers all n < x. The `CoveringSystem` structure models a single covering, not a bipartite one, so it is not directly applicable without extension. + +- **Problems 279–281** use similar congruence-class-with-primes patterns (`a_p mod p`). Problem 279 in particular uses `a : ℕ → ℤ` for assigning congruence classes to primes, closely mirroring the `a : ℕ → ℕ` in Problem 467. + +- **Problem 675** (`ErdosProblems/675.lean`) uses the same prime-set construction pattern `(Finset.range (x + 1)).filter Nat.Prime` and partitions primes into two sets — structurally very close to Problem 467. + +- **Prime filtering pattern**: The idiom `(Finset.range (x + 1)).filter Nat.Prime` is standard across the codebase and is used correctly here. + +**Verdict**: No existing abstraction can be directly substituted. The formalization is appropriately self-contained. If multiple bipartite-covering problems arise in the future, extracting a shared definition would be worthwhile, but currently Problem 467 is the only one of its kind. + +## 2. Citations + +**Website ([erdosproblems.com/467](https://www.erdosproblems.com/467))**: +- Source: `[ErGr80, p.93]` +- Full reference: Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathematique (1980). + +**Formalization docstring**: +- References `[ErGr80, p. 93]` ✓ +- Full citation provided in the module docstring ✓ +- Link to erdosproblems.com/467 ✓ + +**Verdict**: Citations are complete and consistent with the website. No discrepancies. + +## 3. Variants + +The website does **not** list any explicit variants of this problem. The only additional context is the maintainer's note about ambiguity in the original quantifier structure (discussed further below under Correctness). + +The formalization captures one specific interpretation. Possible alternative interpretations that are **not** captured: + +- **Uniform version**: A single choice of congruence classes `a_p` and partition `A ⊔ B` that works for *all* sufficiently large x simultaneously (rather than depending on x). This would be strictly stronger. +- **Integer version**: The formalization works over ℕ. An ℤ version covering all integers n with |n| < x could be considered, though this is equivalent modulo periodicity of congruences. + +The formalization's docstring explicitly acknowledges the ambiguity: *"The note on the website indicates the original source [ErGr80] is ambiguous about the quantifiers; this formalises the most natural interpretation."* This is appropriate. + +**Verdict**: The single most natural interpretation is captured. The acknowledged ambiguity is properly documented. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The `let P := ...` binding inside the theorem statement is a good readability choice, avoiding repetition. +- The congruence condition `n % p = a p % p` is clear but could alternatively use Mathlib's `Nat.ModEq` notation (`n ≡ a p [MOD p]`), which would be slightly more idiomatic. However, the current form is arguably more explicit and avoids an extra import or unfolding step — either is acceptable. +- The docstring is thorough and self-contained, explaining the problem clearly. + +**Verdict**: Readability is good. No changes required. + +## 5. Formalizability + +The website maintainer explicitly notes: *"This is what I assume the intended problem is, although the presentation in [ErGr80] is missing some crucial quantifiers, so I may have misinterpreted it."* + +The key ambiguity is in quantifier ordering. The formalization chooses: + +``` +∃ x₀, ∀ x ≥ x₀, ∃ (a, A), ∀ n < x, [covering property] +``` + +This means the choice of congruence classes and the partition may depend on x. An alternative reading where a single (a, A) works for all large x would be: + +``` +∃ x₀ (a, A), ∀ x ≥ x₀, ∀ n < x, [covering property] +``` + +The chosen interpretation (x-dependent) is weaker and thus more likely to be the intended conjecture. If the x-independent version were intended, it would essentially require a single partition of *all* primes into A and B such that both parts form covering systems — a much stronger and different statement. + +**Verdict**: Moderate ambiguity inherent in the source material. The formalization makes a reasonable and well-documented choice. The statement as formalized is precise and unambiguous. + +## 6. Correctness + +Detailed verification of the Lean statement against the mathematical problem: + +| Aspect | Problem Statement | Formalization | Correct? | +|--------|------------------|---------------|----------| +| "For all sufficiently large x" | ∀ large x | `∃ x₀, ∀ x, x₀ ≤ x →` | ✓ | +| "choice of congruence classes a_p" | a_p for each prime p ≤ x | `∃ a : ℕ → ℕ` | ✓ | +| "decomposition into two non-empty sets" | A ⊔ B = {p ≤ x : p prime} | `A ⊆ P ∧ A.Nonempty ∧ (P \ A).Nonempty` | ✓ | +| "for all n < x" | ∀ n < x | `∀ n : ℕ, n < x →` | ✓ | +| "n ≡ a_p (mod p) for some p ∈ A" | covering by A | `∃ p ∈ A, n % p = a p % p` | ✓ | +| "n ≡ a_q (mod q) for some q ∈ B" | covering by B | `∃ q ∈ P \ A, n % q = a q % q` | ✓ | + +**Detailed notes**: + +1. **Prime set P**: `(Finset.range (x + 1)).filter Nat.Prime` correctly captures {p : p is prime, p ≤ x}. The `range (x + 1)` gives {0, ..., x}, and filtering by `Nat.Prime` excludes 0 and 1 correctly. + +2. **Congruence encoding**: `n % p = a p % p` is mathematically equivalent to n ≡ a(p) (mod p). The right-hand side `a p % p` normalizes the chosen residue class, so the function `a` need not output values in [0, p) — any ℕ value works. This is correct. + +3. **Domain of a**: The function `a : ℕ → ℕ` is defined on all naturals, but only its values at primes p ∈ P matter. Values at non-primes or primes > x are existentially quantified away and irrelevant. This is standard and correct. + +4. **ℕ vs ℤ**: The problem quantifies over n < x. Working in ℕ (so n ∈ {0, 1, ..., x-1}) is appropriate since covering by congruence classes modulo primes is periodic, and the problem bounds n below x. No mathematical content is lost. + +5. **Partition encoding**: Using `A ⊆ P` with `(P \ A).Nonempty` to represent B = P \ A correctly encodes a partition of P into two non-empty parts. The subset relation ensures A only contains primes ≤ x. + +**Verdict**: The formalization is mathematically correct and complete. No flaws identified. The only source of potential incorrectness is the inherent ambiguity in the original problem statement (quantifier ordering), which is properly acknowledged and resolved with the most natural interpretation. diff --git a/ai-review/468.md b/ai-review/468.md new file mode 100644 index 0000000000..70092bec90 --- /dev/null +++ b/ai-review/468.md @@ -0,0 +1,125 @@ +# AI Review: Erdős Problem 468 + +**File:** `FormalConjectures/ErdosProblems/468.lean` + +--- + +## 1. Code Reuse + +- **`prefixSums`**: A custom implementation is defined at lines 40–42. No shared utility for prefix/partial sums exists elsewhere in the codebase; this is the only occurrence. It is simple enough that extracting it to a shared utility is not necessary unless other problems need it (none currently do). + +- **Density definitions**: The weak form (lines 72–78) uses an inline density calculation via `Finset.Icc`, `filter`, and `Tendsto`. The codebase already provides a reusable density framework in `FormalConjecturesForMathlib/Data/Set/Density.lean` with `partialDensity`, `upperDensity`, `lowerDensity`, and `HasDensity`. Problem 122 similarly defines its own `HasNaturalDensityZero` inline. While using the shared density framework would improve consistency, the inline approach is acceptable and matches the pattern used by other Erdős problems (122, 335, 339). + +- **Divisor utilities**: Uses Mathlib's `Nat.divisors` directly, which is appropriate. No custom divisor utilities exist in the codebase that would be relevant. + +- **Little-o pattern**: The strong form's epsilon-delta encoding of $f(N) = o(N)$ matches the pattern used in Problems 333 and others. This is idiomatic for the codebase. + +**Verdict:** Minor opportunity to use the shared density framework for the weak form, but no significant code reuse issues. + +--- + +## 2. Citations + +**Website ([erdosproblems.com/468](https://www.erdosproblems.com/468)) states:** +> [ErGr80] — cited as the original source + +**Formalization docstring states:** +> [ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). + +**Assessment:** The citation is correct and complete. The full bibliographic entry is provided rather than just the shorthand, which is good. The website does not list additional references beyond [ErGr80]. + +**Verdict:** Citations are accurate and complete. + +--- + +## 3. Variants + +**Website describes two questions:** + +1. "What is the size of $D_n \setminus \bigcup_{m < n} D_m$?" +2. "If $f(N)$ is the minimal $n$ such that $N \in D_n$ then is it true that $f(N) = o(N)$? Perhaps just for almost all $N$?" + +**Formalization captures:** +- `erdos_468` (strong form): $f(N) = o(N)$ — this is the strong reading of question 2. +- `erdos_468.variants.weak`: $f(N) = o(N)$ for almost all $N$ — this is the weak reading of question 2. + +**Missing variant:** Question 1 from the website — "What is the size of $D_n \setminus \bigcup_{m < n} D_m$?" — is **not captured** in the formalization. This asks about the number of elements in $D_n$ that do not appear in any $D_m$ for $m < n$. This is a distinct and arguably primary question on the website (it appears first). However, this question is arguably less precise ("what is the size" is open-ended and does not propose a specific asymptotic bound), making it harder to formalize as a concrete theorem statement. It could potentially be formalized as a conjecture about the growth rate of $|D_n \setminus \bigcup_{m 0$, eventually $f(N) < \varepsilon \cdot N$. This is standard and correct. + +**Weak form (lines 72–78):** +The density of $\{N \leq x : f(N) \geq \varepsilon \cdot N\}$ tending to 0 correctly captures "$f(N) = o(N)$ for almost all $N$" in the natural density sense. The use of `Finset.Icc 1 x` (starting from 1) is appropriate since $D_n$ produces positive values and $f(0)$ would be degenerate. + +**Potential issue:** The `answer(sorry)` wrapper on both theorems means the truth value is left undetermined, which is correct for an open problem. + +**Verdict:** The formalization is mathematically correct and complete for the parts of the problem it addresses. No flaws identified. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ Minor | Could use shared density framework | +| Citations | ✅ Good | Accurate and complete | +| Variants | ⚠️ Partial | Missing question 1 ($\|D_n \setminus \bigcup_{m δ · log N` is essentially asserting that `A ∩ {1,…,N}` has logarithmic density at least `δ`. This definition could potentially be used to state a variant, though the current formulation as a finite-set statement over `{1,…,N}` is more direct and arguably more natural for this problem. + +- **Related formalizations**: Problems 46 and 298 are closely related (all concern finding subsets whose reciprocals sum to 1). They share the core conclusion `∑ n ∈ S, 1/n = 1` but use `ℚ` rather than `ℝ`. See the Correctness section for discussion. + +No existing definitions are directly reusable in a way that would simplify the current statement. + +## 2. Citations + +The formalization cites only: +- **[Bl21]** Bloom, T., *On a result of Schur and Sidon*. Preprint (2021). + +The website ([erdosproblems.com/47](https://www.erdosproblems.com/47)) lists additional information: + +- **Original sources**: ErGr80, Er92c, Er95, Er96b, Er97c +- **Liu & Sawhney (2024)**: Improved the bound to `(log N)^{4/5+o(1)}`, representing a further strengthening beyond Bloom's result. +- **Pomerance construction**: Discussed in Bloom's appendix, showing that Erdős's conjectured threshold of `(log log N)²` would be optimal if achievable. +- **Related problems**: 46 and 298 are listed as related. +- **Prize**: \$100 + +**Recommendation**: The Bloom citation title appears incorrect. The paper *On a result of Schur and Sidon* is not the relevant Bloom paper. The correct reference is likely: +> Bloom, T. F., *On a density conjecture about unit fractions*. arXiv:2112.03726 (2021). + +This is the citation used in Problem 298's formalization. The Liu & Sawhney result should also be mentioned since it represents the current state of the art. + +## 3. Variants + +The formalization captures only the original `δ · log N` threshold conjecture. The website and literature suggest additional variants: + +1. **Bloom's quantitative threshold**: `∑ 1/n ≫ (log log log N / log log N) · log N` suffices. This is mentioned in the docstring but not formalized as a separate theorem. +2. **Liu & Sawhney bound**: The threshold `(log N)^{4/5+o(1)}` suffices. Not mentioned. +3. **Erdős's stronger conjecture**: Perhaps `(log log N)²` suffices (with Pomerance showing this would be optimal). Not mentioned. +4. **Connection to positive density (Problem 298)**: The positive density version is a strictly weaker statement implied by this conjecture. Cross-referencing would be valuable. + +**Recommendation**: At minimum, Bloom's quantitative result could be formalized as a separate theorem (as it is the actual proved result, strictly stronger than the `δ · log N` conjecture). The `(log log N)²` conjecture of Erdős is also worth stating as a variant. + +## 4. Readability + +The formalization is clear and well-structured. Minor observations: + +- The `open scoped BigOperators` is appropriate for `∑` notation. +- The namespace `Erdos47` is consistent with conventions in the repository. +- The docstring clearly explains both the conjecture and the resolution. +- The quantifier order `(δ : ℝ) (hδ : δ > 0) : ∃ N₀, ∀ N ≥ N₀, ∀ A, ...` correctly captures "N sufficiently large depending on δ." + +No readability improvements needed. + +## 5. Formalizability + +The problem is precisely and unambiguously stated. Assessment: **low ambiguity**. + +- The sets, sums, and threshold are all concrete and well-defined. +- The quantifier structure (∀ δ > 0, ∃ N₀, ∀ N ≥ N₀, ...) is the standard way to express "sufficiently large depending on a parameter." +- The conclusion (existence of a nonempty subset whose reciprocals sum to exactly 1) is fully precise. +- The only minor source of ambiguity is whether "log" means natural log or log base 2, but in this analytic number theory context, natural log is standard, and `Real.log` is the correct choice. + +## 6. Correctness + +### Overall assessment: **Mostly correct, with notable issues** + +**Correct aspects:** +- The quantifier structure faithfully captures the original conjecture. +- The constraint `∀ a ∈ A, 1 ≤ a ∧ a ≤ N` correctly encodes `A ⊆ {1, …, N}`. +- The sum condition `∑ a ∈ A, (1 : ℝ) / a > δ * Real.log N` is correct. +- The conclusion `S.Nonempty ∧ S ⊆ A ∧ ∑ n ∈ S, (1 : ℝ) / n = 1` is correct. (Nonempty is technically redundant since `∑ ∅ = 0 ≠ 1`, but is good for clarity.) +- The `category research solved` tag is consistent with the website's "PROVED" status. + +**Issues:** + +1. **Inconsistent number field (ℝ vs ℚ)**: The sum `∑ n ∈ S, (1 : ℝ) / n = 1` uses real arithmetic, whereas the closely related Problems 46 and 298 use `ℚ`. Since all values `1/n` for `n : ℕ` are rational, and rational equality is preserved under embedding into ℝ, this is mathematically equivalent. However, using ℝ for exact equality is arguably less natural — the equation `∑ 1/n = 1` is a statement about rationals. The use of ℝ is motivated by the hypothesis involving `Real.log`, but the conclusion could use `ℚ` (with the hypothesis remaining in ℝ). For consistency with the rest of the codebase, consider using `ℚ` for the conclusion, or at least noting the design choice. + +2. **Bloom citation is likely incorrect**: As noted above, the cited paper title "*On a result of Schur and Sidon*" does not match the standard reference for this result. The correct paper is "*On a density conjecture about unit fractions*" (arXiv:2112.03726). This same paper is correctly cited in Problem 298. + +3. **Trivial case when 1 ∈ A**: If `1 ∈ A`, then `S = {1}` trivially satisfies the conclusion. The formalization is correct — this is just a trivial case of a correct statement. The original problem on the website also includes 1 in the range, so this is faithful to the source. + +4. **Missing AMS classification**: The tag `AMS 5 11` is present. AMS 11 (Number Theory) is appropriate. AMS 5 (Combinatorics) is reasonable given the subset-selection nature of the problem. + +**Summary**: The formalization is mathematically correct. The main actionable issues are (a) the likely incorrect Bloom citation title, (b) the ℝ vs ℚ inconsistency with sibling problems, and (c) missing variants and citations from the website. diff --git a/ai-review/471.md b/ai-review/471.md new file mode 100644 index 0000000000..39fdf5ac4d --- /dev/null +++ b/ai-review/471.md @@ -0,0 +1,90 @@ +# Review: Erdős Problem 471 + +## 1. Code Reuse + +Two items in the existing codebase are relevant: + +- **`Set.Triplewise`** (`FormalConjecturesForMathlib/Data/Set/Triplewise.lean`): Provides a predicate for relations holding on all distinct triples from a set. In principle, the "three distinct elements" condition in `step` could be reformulated using `Set.Triplewise` or its underlying pattern. However, the current explicit existential formulation (`∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ ...`) is arguably more direct for this use case, since we need to *extract* the three elements and their sum, not just assert a relation holds triplewise on the whole set. **No change recommended.** + +- **Ternary Goldbach Conjecture** (`FormalConjectures/Wikipedia/GoldbachConjecture.lean`): The `ternaryGoldbach` theorem states every odd integer > 5 is the sum of three primes (not necessarily distinct). This is closely related to the Vinogradov theorem invoked in the proof of Problem 471. However, the ternary Goldbach statement allows repeated primes and does not require the summands to be *smaller* than the target, so it cannot directly substitute for the key ingredient in 471's proof. **No change recommended**, but a cross-reference in the docstring could be valuable. + +## 2. Citations + +The [erdosproblems.com/471](https://www.erdosproblems.com/471) page cites: + +- **[ErGr80, p.94]** — Erdős and Graham, "Old and New Problems and Results in Combinatorial Number Theory," 1980. + +The current formalization docstring says only "A problem of Ulam" and credits Mrazović/Kovač and Alon, which matches the website's attribution of the solution. However, **the primary bibliographic reference `[ErGr80, p.94]` is missing** from the docstring. The docstring should include: + +``` +*Reference:* P. Erdős and R. L. Graham, *Old and New Problems and Results in +Combinatorial Number Theory*, Monographies de L'Enseignement Mathématique **28**, +Université de Genève, 1980, p. 94. +``` + +## 3. Variants + +The erdosproblems.com page mentions a **specific variant**: whether Q = {3, 5, 7, 11} works as an initial set. This is a natural and notable sub-question — the existential statement is proved, but the specific choice Q = {3, 5, 7, 11} remains of interest. + +**This variant is not captured by the formalization.** A companion conjecture could be added: + +```lean +/-- Variant: Does Q₀ = {3, 5, 7, 11} suffice? -/ +theorem erdos_471_variant : + ∀ p : ℕ, Nat.Prime p → ∃ i : ℕ, p ∈ seq {3, 5, 7, 11} i := by + sorry +``` + +Note: it is not clear from the literature whether this specific variant has been resolved. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The `step` and `seq` definitions are clear and well-documented. +- The distinctness condition `a ≠ b ∧ a ≠ c ∧ b ≠ c` is standard. An alternative would be to require `({a, b, c} : Finset ℕ).card = 3`, which is sometimes considered more idiomatic in Lean/Mathlib, but the current form is perfectly readable. +- The docstring adequately explains the proof strategy (Vinogradov → every large odd integer is a sum of three distinct primes → take Q₀ = all primes ≤ N). + +**No changes needed for readability.** + +## 5. Formalizability + +The problem as stated on the website ("Is there some initial choice of Q such that the Q_i become arbitrarily large?") has a minor ambiguity: **"become arbitrarily large" is imprecise**. It could mean: + +1. The *cardinality* |Q_i| → ∞ +2. The *maximum element* sup(Q_i) → ∞ +3. Every prime eventually appears (i.e., ⋃_i Q_i = {all primes}) + +The formalization chooses interpretation (3), which is the strongest. This is well-justified because: +- It is what was actually proved by Mrazović/Kovač and Alon. +- It implies both (1) and (2). +- The docstring explains the proof strategy, making the choice of formalization transparent. + +**Assessment: Low ambiguity.** The problem is clearly formalizable, and the chosen interpretation is the natural and strongest one. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +- **`step` definition (line 33–35):** Correctly computes Q ∪ {primes that are sums of three distinct elements of Q}. The distinctness constraints (a ≠ b, a ≠ c, b ≠ c) are all present and correctly placed. The elements a, b, c are drawn from Q (not from the primes, etc.), matching the problem statement. + +- **`seq` definition (line 38–40):** Standard recursive iteration. `seq Q₀ 0 = Q₀` and `seq Q₀ (i+1) = step (seq Q₀ i)`. Correct. + +- **`erdos_471` theorem (line 55–58):** States that there exists a finite set Q₀ of primes such that every prime p eventually appears in `seq Q₀ i` for some i. The `answer(True)` wrapper correctly indicates the answer to the yes/no question is affirmative. The finiteness and primality constraints on Q₀ match the problem statement. + +- **One subtle point:** The `step` function does not restrict the new primes p to be *outside* Q — but this is fine because Q is included via the union, so adding a prime already in Q is harmless (it's idempotent). Similarly, the problem doesn't require a + b + c to be distinct from a, b, c themselves, only that a, b, c are mutually distinct. + +- **Monotonicity:** The formalization implicitly relies on the fact that `seq Q₀ i ⊆ seq Q₀ (i+1)` (since `step Q = Q ∪ ...`), which ensures that once a prime appears, it stays. This is correctly built into the `step` definition. + +**No correctness issues identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No beneficial reuse opportunities; current code is self-contained | +| Citations | **Missing [ErGr80, p.94] reference** | +| Variants | **Missing Q = {3, 5, 7, 11} variant** | +| Readability | Good — no changes needed | +| Formalizability | Low ambiguity; strongest natural interpretation chosen | +| Correctness | Correct and complete | diff --git a/ai-review/472.md b/ai-review/472.md new file mode 100644 index 0000000000..ba473323ff --- /dev/null +++ b/ai-review/472.md @@ -0,0 +1,117 @@ +# AI Review: Erdős Problem 472 + +## 1. Code Reuse + +Several patterns from the existing codebase could be applied: + +- **`sInf` pattern (Problems 456, 459, 675):** The "smallest prime satisfying a condition" could be expressed more concisely using `sInf`, e.g.: + ```lean + noncomputable def nextTerm (q : ℕ → ℕ) (n : ℕ) : ℕ := + sInf {p : ℕ | Nat.Prime p ∧ ∃ i, i ≤ n ∧ p = q n + q i - 1} + ``` + This would replace the two-part (existence + minimality) condition with a single equation `q (n + 1) = nextTerm q n`, matching the style used in `smallestPrimeCong1` (Problem 456) and `maxPrimeFac` (`FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean`). However, the current two-part formulation is also standard and correct, and avoids introducing a `noncomputable def` that may complicate proofs. + +- **Problem 471 (neighboring Ulam problem):** Uses a `step`/`seq` pattern for iterative set construction. The problems are thematically related (both due to Ulam, both about extending prime collections), but 472's sequence-based construction differs structurally from 471's set-based construction, so direct reuse is limited. + +- **`Nat.nth Nat.Prime` (Problem 852, `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean`):** Not directly applicable here since 472 uses a custom sequence rather than the standard prime enumeration. + +**Verdict:** No strong reuse opportunity. The current self-contained definition is appropriate. + +## 2. Citations + +The website ([erdosproblems.com/472](https://www.erdosproblems.com/472)) attributes this problem to Ulam and references **[ErGr80]** (Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathematique, 1980). It also notes a possibly related OEIS sequence A389713. + +**Issue:** The formalization's docstring does not include the [ErGr80] citation. For consistency with the website and with other problems in this repository (e.g., Problem 456 which cites [ErGr80, p.91]), the module docstring should include: + +``` +[ErGr80] Erdős, P. and Graham, R., _Old and new problems and results in +combinatorial number theory_. Monographies de L'Enseignement Mathematique (1980). +``` + +The attribution to Ulam is correctly mentioned in the docstring ("A problem due to Ulam"). + +## 3. Variants + +The website presents a single question: does there exist an initial sequence making the extension infinite? The formalization captures exactly this question. No additional variants are listed on the website. + +One natural variant—**"Is the specific sequence starting from {3, 5} infinite?"**—is mentioned in the docstring as an example ("It is possible that this sequence is infinite") but is not formalized as a separate theorem. This could be a worthwhile addition: + +```lean +theorem erdos_472.variants.starting_3_5 : answer(sorry) ↔ + ∃ (q : ℕ → ℕ), q 0 = 3 ∧ q 1 = 5 ∧ IsErdos472Sequence q 2 := by + sorry +``` + +However, since the website does not pose this as a separate conjecture (only as a possibility), omitting it is defensible. + +**Verdict:** All website variants are captured. The {3, 5} sub-question is a reasonable optional addition. + +## 4. Readability + +The formalization is clear and well-structured. Minor suggestions: + +- **Docstring for `IsErdos472Sequence`:** Could note that the sequence is 0-indexed (i.e., the initial segment is `q 0, ..., q (m-1)`), since the problem statement uses 1-indexed notation. + +- **The two-part minimality condition** (existence + universality) is a standard way to express "the minimum," but it requires the reader to mentally combine both conjuncts. An alternative using `sInf` or `IsLeast` would be more declarative but introduces its own complexity. The current approach is fine. + +- **Naming:** `IsErdos472Sequence` is descriptive. The `Erdos472` namespace avoids clashes. + +**Verdict:** Good readability. No major changes needed. + +## 5. Formalizability + +The problem is well-suited to formalization. The statement is fully precise: + +- "Initial finite sequence of primes" → `q 0, ..., q (m-1)` all prime, strictly increasing. +- "Extend it so that q_{n+1} is the smallest prime of the form q_n + q_i - 1" → deterministic greedy rule. +- "Is there an initial starting sequence so that the resulting sequence is infinite?" → existential statement over infinite sequences. + +**Ambiguity level: Very low.** The only mild ambiguity is whether "the form q_n + q_i - 1" allows i to range over all previous terms (i ≤ n) or only the initial segment (i < m). The universal reading (all previous terms) is standard and is what the formalization implements. This is clearly correct. + +One edge case: the process could get stuck if no q_n + q_i - 1 is prime for any i ≤ n. The formalization handles this correctly—an infinite sequence satisfying the property exists only if the process never gets stuck. + +**Verdict:** Unambiguously formalizable. The formalization matches the intended mathematical content. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition `IsErdos472Sequence q m` + +Three conjuncts: +1. `∀ n, Nat.Prime (q n)` — all terms are prime. ✓ +2. `StrictMono q` — the sequence is strictly increasing. ✓ +3. For `m ≤ n + 1`: `q(n+1)` equals `q(n) + q(i) - 1` for some `i ≤ n`, and `q(n+1)` is minimal among all such primes. ✓ + +**StrictMono redundancy:** Strict monotonicity actually follows from the construction for the extended part: if `q(n+1) = q(n) + q(i) - 1` and `q(i) ≥ 2` (since `q(i)` is prime), then `q(n+1) ≥ q(n) + 1 > q(n)`. Including `StrictMono` as an explicit requirement is therefore redundant for the extended portion, but it correctly constrains the initial segment to be strictly increasing (matching the problem's `q₁ < ⋯ < qₘ`). Including it is a reasonable design choice. + +**Natural number subtraction:** The expression `q n + q i - 1` uses `ℕ` subtraction. Since all `q(i) ≥ 2` (prime), we have `q(n) + q(i) ≥ 4 > 1`, so `q(n) + q(i) - 1 ≥ 3`. No underflow issue. + +**Indexing:** The condition `m ≤ n + 1` means the rule applies starting at `n = m - 1`, defining `q(m)` onward. The initial segment is `q(0), ..., q(m-1)`, which is `m` elements. This correctly matches the problem's 1-indexed "q₁ < ⋯ < qₘ." + +**The `0 < m` guard in `erdos_472`:** Ensures at least one initial element, preventing the degenerate case of an empty initial segment. Correct. + +**Verification against the example:** Starting with `q(0) = 3, q(1) = 5, m = 2`: +- `n=1`: candidates are `5+3-1=7` (prime ✓), `5+5-1=9` (not prime). So `q(2) = 7`. ✓ +- `n=2`: candidates are `7+3-1=9` (no), `7+5-1=11` (yes), `7+7-1=13` (yes). So `q(3) = 11`. ✓ +- `n=3`: candidates are `11+3-1=13` (yes). So `q(4) = 13`. ✓ +- `n=4`: candidates are `13+3-1=15` (no), `13+5-1=17` (yes). So `q(5) = 17`. ✓ + +Sequence: 3, 5, 7, 11, 13, 17, ... — matches the docstring. ✓ + +**Verdict:** The formalization is correct and complete. No mathematical flaws identified. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No strong reuse opportunities; self-contained definition is appropriate | +| Citations | **Missing [ErGr80] citation** — should be added to module docstring | +| Variants | All website variants captured; {3,5} sub-question is an optional addition | +| Readability | Good; minor suggestion to clarify 0-indexing in docstring | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | **Correct and complete** — verified against the example | + +**Overall: High-quality formalization.** The only actionable item is adding the [ErGr80] citation. diff --git a/ai-review/473.md b/ai-review/473.md new file mode 100644 index 0000000000..1fac0e9eb1 --- /dev/null +++ b/ai-review/473.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 473 + +## 1. Code Reuse + +The formalization encodes "a permutation of the positive integers" via three separate conditions on `a : ℕ → ℕ`: + +```lean +Function.Injective a ∧ (∀ n, 0 < a n) ∧ (∀ m, 0 < m → ∃ n, a n = m) +``` + +**Comparison with existing codebase patterns:** + +- **Problem 196** (`FormalConjectures/ErdosProblems/196.lean:28`) uses `f : ℕ ≃ ℕ` for a permutation of ℕ. This is cleaner but not directly applicable here, since 473 requires a permutation of ℕ⁺ (positive integers), not ℕ itself. A bijection `ℕ → ℕ` with all values positive would exclude 0 from the range, contradicting surjectivity onto ℕ. + +- **Problem 34** (`FormalConjectures/ErdosProblems/34.lean:42`) uses `Equiv.Perm (Fin n)` for finite permutations with consecutive-sum checks — thematically related but finite. + +**Possible alternative:** One could use `a : ℕ ≃ ℕ+` (an equivalence between ℕ and positive naturals) from Mathlib, but this would introduce coercions in the `Nat.Prime (a k + a (k + 1))` expression, arguably hurting readability for no real gain. The current three-condition encoding is standard and self-contained. + +**Verdict:** No significant reuse opportunity. The current encoding is appropriate. + +## 2. Citations + +The website [erdosproblems.com/473](https://www.erdosproblems.com/473) lists: + +- **Reference:** [ErGr80, p.94] — This is not mentioned in the formalization's docstring. It should be added for traceability. Full reference: Erdős and Graham, *Old and New Problems and Results in Combinatorial Number Theory* (1980), p. 94. +- **OEIS sequence:** A055265 (the greedy permutation). Not mentioned in the formalization. +- **Additional contributors:** Watts and van Doorn are mentioned in connection with variants. + +The formalization correctly attributes the question to Segal and the affirmative answer to Odlyzko, consistent with the website. + +**Recommendation:** Add the [ErGr80] citation to the docstring for completeness. + +## 3. Variants + +The website describes several variants not captured by the formalization: + +1. **Greedy algorithm variant:** Does the greedy algorithm (start with a₁ = 1, always choose the smallest unused integer whose sum with the previous term is prime) produce a permutation covering all positive integers? This is a stronger, constructive question. + +2. **Missing primes in the greedy sequence:** Van Doorn noted that 197 does not appear as a sum in the greedy sequence. This is a specific computational observation. + +3. **Finite version:** For all n ≥ 2, does there exist a permutation of {1, ..., n} such that consecutive sums are always prime? Conjectured true on probabilistic grounds and verified for infinitely many n. + +**Verdict:** None of these variants are captured. The greedy algorithm variant and the finite version are mathematically distinct and interesting enough to warrant separate formalizations if desired, but their omission from this file is not a flaw — they are genuinely different problems. A comment noting the existence of these variants would improve the docstring. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The docstring clearly explains the 0-indexing convention and the three-condition encoding of "bijection onto positive integers." This is good practice. +- The `answer(True)` annotation correctly reflects that the problem is solved in the affirmative. +- The namespace `Erdos473` and theorem name `erdos_473` follow project conventions. + +**Minor suggestion:** The three conditions (injective, positive, surjective onto positives) could be given a one-line comment each for scanning ease, but this is not necessary — the existing docstring already explains them collectively. + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The original problem statement — "Is there a permutation of the positive integers such that the sum of any two consecutive terms is always prime?" — is completely precise and unambiguous. There is no room for misinterpretation: + +- "Permutation of the positive integers" = bijection ℕ → ℕ⁺ (when viewed as a sequence). +- "Sum of any two consecutive terms is always prime" = for all k, a(k) + a(k+1) is prime. + +**Verdict:** Fully formalizable with no ambiguity. This is one of the most cleanly-stated Erdős problems. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the main problem. + +**Detailed verification:** + +- **Permutation encoding:** The conjunction of `Function.Injective a`, `∀ n, 0 < a n`, and `∀ m, 0 < m → ∃ n, a n = m` is precisely a bijection from ℕ to ℕ⁺. This correctly models "a permutation a₁, a₂, ... of the positive integers" as a 0-indexed sequence. + +- **Primality condition:** `∀ k, Nat.Prime (a k + a (k + 1))` correctly captures "the sum of any two consecutive terms is prime" for all consecutive pairs in the sequence. + +- **Answer value:** `answer(True)` is correct — Odlyzko showed such a permutation exists. + +- **Edge case — `Nat.Prime` on ℕ:** Since `a k ≥ 1` and `a (k+1) ≥ 1` (from the positivity condition), we have `a k + a (k+1) ≥ 2`, so the sum is always at least 2. This means the `Nat.Prime` check is never vacuously problematic (i.e., we never ask whether 0 or 1 is prime). This is a subtle correctness point that the formalization handles correctly by design. + +- **Quantifier scope:** The universal quantifier `∀ k` ranges over all of ℕ, meaning all consecutive pairs (a(0), a(1)), (a(1), a(2)), ... are checked. This is correct for an infinite sequence. + +**Verdict:** The formalization is correct with no mathematical flaws. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities; current encoding is appropriate | +| Citations | Missing [ErGr80, p.94] reference and OEIS A055265 | +| Variants | Three website variants (greedy, missing primes, finite) not captured; acceptable omission | +| Readability | Good; clean code with helpful docstring | +| Formalizability | Fully formalizable; no ambiguity | +| Correctness | Correct and complete | + +**Overall:** The formalization is sound. The main actionable item is adding the [ErGr80] citation to the docstring. The variants are interesting but represent distinct problems. diff --git a/ai-review/474.md b/ai-review/474.md new file mode 100644 index 0000000000..b2d90a1601 --- /dev/null +++ b/ai-review/474.md @@ -0,0 +1,115 @@ +# Review: Erdős Problem 474 + +## 1. Code Reuse + +The formalization introduces a new definition `NegSqBracketPartition` for the negative square-bracket partition relation κ ↛ [μ]^2_k. Several related partition relation definitions exist in the codebase: + +- **Problem 1167** (`FormalConjectures/ErdosProblems/1167.lean:31`) defines `CardinalPartitionRel` for the *positive* ordinary (round-bracket) cardinal partition relation κ → (targets)^r. This is a fundamentally different relation (round brackets vs. square brackets; positive vs. negative). + +- **Problems 118, 1169, 1170, 1171, 1172** define various *ordinal* partition relations (`OrdinalPartition`, `OrdinalPartitionPair`, `OrdinalPartitionMulticolor`). These operate on ordinals with order-embedding requirements, making them structurally different from the cardinal square-bracket relation. + +- **`FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean:32`** defines `OrdinalCardinalRamsey` for the mixed relation α → (β, c)². Also structurally different. + +None of these existing definitions capture the negative square-bracket partition relation. The square-bracket notation κ ↛ [μ]^r_k is semantically distinct: it asserts the existence of a coloring where every large subset sees *all* colors (rather than the round-bracket version which asks for monochromatic subsets). A new definition is justified. + +**Possible improvement:** The definition hardcodes r = 2 (pairs). A more general version parameterized by r (coloring r-subsets via `Finset.card = r`) would be reusable for other Erdős partition problems, but would also be considerably more complex. Since no other problem in the codebase currently needs a square-bracket relation with r ≠ 2, the current approach is pragmatic. + +**Verdict:** No reuse opportunity. The new definition is appropriate and well-scoped. + +## 2. Citations + +The website [erdosproblems.com/474](https://www.erdosproblems.com/474) lists: + +- **[Er95d, p.64]** — Erdős, *Problems and results on graphs and hypergraphs: similarities and differences* (1995). ✅ Cited in the docstring. +- **[Va99, 7.81]** — Väänänen, *Problems from the Erdős notebook* (1999). ✅ Cited in the docstring. +- **[Sh88]** — Shelah, *Was Sierpiński right? I* (1988). ✅ Cited in the docstring. +- **$100 prize** — Erdős offered $100 for deciding the answer without CH. ❌ Not mentioned in the docstring. +- **Additional thanks:** Jake Mallen is credited on the website. Not relevant to the formalization. + +**Verdict:** Citations are thorough. The $100 prize is a notable omission but not critical. + +## 3. Variants + +The website's primary question is broader than the formalization: + +> Under what set-theoretic assumptions is it true that pairs from ℝ can be 3-colored such that every uncountable subset contains pairs of each color? + +This encompasses: +1. **CH case (c = ℵ₁):** Erdős proved the negative relation holds. Not separately formalized, but mentioned in the docstring. Could be a separate theorem. +2. **c = ℵ₂ case:** The specific open question formalized here (from [Va99]). +3. **Shelah's consistency result:** The positive relation 2^ℵ₀ → [ℵ₁]^2_3 is consistent (with c very large). Mentioned in the docstring but not formalized. +4. **2-color base case:** Sierpiński–Kurepa proved 2^ℵ₀ ↛ [ℵ₁]^2_2 in ZFC. Mentioned in the docstring but not formalized. This would be a nice companion theorem since it's provable outright (no axiom assumptions). + +**Verdict:** The formalization correctly captures the most specific and interesting open question (the c = ℵ₂ case). The Sierpiński–Kurepa 2-color result would be a valuable companion formalization since it's a ZFC theorem (using `NegSqBracketPartition continuum (aleph 1) 2`), but its omission is acceptable. + +## 4. Readability + +The code is well-structured and readable: + +- The `NegSqBracketPartition` definition has a clear docstring explaining the notation and mathematical meaning. +- The theorem's docstring provides excellent context: the Sierpiński–Kurepa base case, the CH case, Shelah's result, and the specific open question. +- The namespace `Erdos474` and theorem name `erdos_474` follow project conventions. + +**Minor observations:** + +- The definition docstring says "The negative square-bracket partition relation $\kappa \nrightarrow [\mu]_k^2$" with subscript k before superscript 2. The convention in standard partition calculus is usually κ ↛ [μ]^2_k (superscript first). Both conventions appear in the literature, and the formalization is internally consistent, but matching the more common convention would slightly improve recognizability. + +- The coloring function `f : α → α → Fin k` is defined on all pairs including (x, x). Since the conclusion requires `a ≠ b`, diagonal values are irrelevant. This is fine but could merit a brief comment for readers unfamiliar with the convention. + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The core mathematical question is precise: "Does 2^ℵ₀ ↛ [ℵ₁]^2_3 follow from c = ℵ₂?" This is a well-defined question in partition calculus. + +However, there is a fundamental tension in formalizing this in Lean: + +**The independence problem.** This is a question about *provability from ZFC + c = ℵ₂*, not about truth in a specific model. Lean operates within a fixed foundational system. The statement `continuum = aleph 2 → NegSqBracketPartition continuum (aleph 1) 3` is a Prop in Lean's ambient logic. Three scenarios are possible: + +1. **ZFC + c = ℵ₂ proves the negative relation:** Then `answer(True)` is correct and the theorem is provable in Lean (assuming Lean's foundations are at least as strong as ZFC). +2. **ZFC + c = ℵ₂ refutes the negative relation:** Then `answer(False)` is correct. +3. **The negative relation is independent of ZFC + c = ℵ₂:** Then neither `True` nor `False` makes the biconditional provable in Lean, and the formalization has no valid completion. This is a known limitation of the `answer(sorry)` framework for independence questions. + +The problem is marked `open`, so this is not an immediate issue. But if the answer turns out to be "independent," the formalization framework would need adaptation (e.g., expressing the result as a consistency statement rather than a biconditional). + +**Assessment:** The partition relation itself is completely unambiguous and cleanly formalizable. The set-theoretic meta-question introduces inherent formalization challenges that are well-known and not specific to this problem. + +**Verdict:** Formalizable with the caveat above. Ambiguity: none in the mathematical content; moderate in the meta-logical framing. + +## 6. Correctness + +**Definition correctness (`NegSqBracketPartition`):** + +The definition states: there exists a type α with #α = κ, a symmetric function f : α → α → Fin k, such that for every subset S with #S ≥ μ, every color c : Fin k is realized by some pair of distinct elements in S. + +This is exactly the standard negative square-bracket partition relation κ ↛ [μ]^2_k. Verified point by point: + +- **Symmetry requirement** `∀ x y, f x y = f y x`: Correct. Pairs are unordered, so the coloring must be symmetric. ✅ +- **Subset cardinality** `#S ≥ μ`: Correct. The relation requires every subset of cardinality *at least* μ to see all colors. ✅ +- **All colors realized** `∀ c : Fin k, ∃ a ∈ S, ∃ b ∈ S, a ≠ b ∧ f a b = c`: Correct. Every color must appear among pairs from S. The `a ≠ b` condition correctly excludes diagonal "pairs." ✅ +- **Existential over types** `∃ (α : Type*)`: Standard Mathlib pattern for cardinal-level statements. Universe polymorphism ensures consistency. ✅ + +**Theorem correctness:** + +- `continuum = aleph 2 → NegSqBracketPartition continuum (aleph 1) 3` correctly formalizes "assuming c = ℵ₂, does 2^ℵ₀ ↛ [ℵ₁]^2_3 hold?" since `continuum` is 2^ℵ₀ in Mathlib. ✅ +- The problem is tagged `open` with `answer(sorry)`. ✅ +- The `AMS 3 5` classification (mathematical logic / set theory, combinatorics) is appropriate. ✅ + +**Potential concern — edge case with k = 0:** + +The definition allows `k = 0`, in which case `Fin 0` is empty and `∀ c : Fin 0, ...` is vacuously true. This would make `NegSqBracketPartition κ μ 0` true for any κ, μ (vacuously, every subset "sees all zero colors"). This is arguably correct (trivially, there are no colors to miss), but the edge case is unusual. Not relevant for this problem (k = 3). + +**Verdict:** The formalization is mathematically correct and complete for the stated problem. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities; new definition is justified | +| Citations | Complete (Er95d, Va99, Sh88 all present); $100 prize not mentioned | +| Variants | Captures the specific c = ℵ₂ open question; Sierpiński–Kurepa 2-color ZFC theorem could be a companion | +| Readability | Good; clear docstring with historical context | +| Formalizability | Mathematically precise; inherent meta-logical challenge for independence questions | +| Correctness | Correct and complete | + +**Overall:** The formalization is mathematically sound and well-documented. The `NegSqBracketPartition` definition correctly captures the negative square-bracket partition relation for pairs. The main limitation is structural: the `answer(sorry) ↔ ...` framework may not accommodate an "independent" outcome, but this is a known project-wide consideration for set-theoretic independence questions, not a flaw specific to this formalization. diff --git a/ai-review/475.md b/ai-review/475.md new file mode 100644 index 0000000000..0b77e3b6d2 --- /dev/null +++ b/ai-review/475.md @@ -0,0 +1,138 @@ +# Review: Erdős Problem 475 + +## 1. Code Reuse + +The formalization introduces a local `partialSum` definition: + +```lean +noncomputable def partialSum {n : ℕ} {α : Type*} [AddCommMonoid α] + (f : Fin n → α) (m : Fin n) : α := + (univ.filter (fun i : Fin n => i ≤ m)).sum f +``` + +This computes prefix sums by filtering `Finset.univ` for indices `i ≤ m`. Potential reuse considerations: + +- **Problem 476** (`FormalConjectures/ErdosProblems/476.lean`) defines `restrictedSumset` operating on `ZMod p` finsets — a related but structurally different operation. +- **Problem 540** (`FormalConjectures/ErdosProblems/540.lean`) deals with subset sums in `ZMod N`, demonstrating the standard `∑ n ∈ S, n` pattern. Not directly applicable since 475 requires *ordered* partial sums, not subset sums. +- **Problem 883** (`FormalConjectures/ErdosProblems/883.lean`) uses `Function.Injective` with `ZMod`-indexed functions, a similar structural pattern. +- **`FormalConjecturesForMathlib/`** provides `IsMulBasisOfOrder` (additive basis definitions) and `Finset.Card` utilities, but nothing directly applicable to sequenceable sets. + +No existing `partialSum` or prefix-sum utility exists elsewhere in the codebase. The definition is general enough (polymorphic in `α`) that it could be promoted to `FormalConjecturesForMathlib` if other problems require it. + +**Minor note:** The filter-based formulation `(univ.filter (fun i => i ≤ m)).sum f` is equivalent to `(Finset.Iic m).sum f` when the appropriate `LocallyFiniteOrder` instance is available for `Fin n`. The `Iic` version would be slightly more idiomatic Mathlib style. + +**Verdict:** No reuse opportunity from the existing codebase. The local definition is justified. + +## 2. Citations + +The docstring references: + +> *Reference:* [erdosproblems.com/475](https://www.erdosproblems.com/475) + +The website [erdosproblems.com/475](https://www.erdosproblems.com/475) lists the following information and results: + +- **Proposer:** Paul Erdős (with related work by Ronald Graham). +- **Status:** Essentially resolved for sufficiently large primes via four complementary results: + - Small sets: $t \leq e^{c(\log p)^{1/3}}$ — Costa & Della Fiore (2026) + - Medium sets: $1 \ll_\alpha t \leq p^{1-\alpha}$ for any $0 < \alpha < 1$ — Pham & Sauermann (2026) + - Large sets: $p^{1-c} \leq t \leq (1-o(1))p$ — Bedert et al. (2025) + - Very large sets: $t \geq (1-o(1))p$ — Müyesser & Pokrovskiy (2025) +- **Earlier results:** Proven for $t \leq 12$ and for $p-3 \leq t \leq p-1$. +- **Related:** Alspach's extension to arbitrary abelian groups. + +The docstring mentions "Graham proved the case $t = p - 1$" ✅, but none of the four recent results establishing the conjecture for large primes are cited. Since the website now lists the problem as essentially resolved (up to a finite check for small primes), the recent references are significant. + +**Verdict:** The citations are incomplete. The four recent breakthrough results should be mentioned in the docstring, especially since they collectively resolve the conjecture for all sufficiently large primes. + +## 3. Variants + +The website mentions: + +1. **Alspach's generalization:** Extension of the conjecture to arbitrary abelian groups (not just $\mathbb{F}_p$). ❌ Not captured. +2. **The full-set case $t = p - 1$:** Graham's result. ✅ Mentioned in docstring but not separately formalized as a theorem. +3. **Bounded cases $t \leq 12$:** ❌ Not mentioned or formalized. + +Graham's result ($A = \mathbb{F}_p \setminus \{0\}$, i.e., $t = p-1$) could be a valuable companion theorem since it is proven: + +```lean +theorem erdos_475_graham (p : ℕ) [Fact (Nat.Prime p)] : + ∃ f : Fin (p - 1) → ZMod p, ... := by sorry +``` + +**Verdict:** The formalization captures the core conjecture. The Alspach generalization to arbitrary abelian groups and Graham's proven special case are natural extensions but their omission is acceptable for a problem-focused formalization. + +## 4. Readability + +The code is well-structured: + +- The `partialSum` definition has a clear docstring. ✅ +- The namespace `Erdos475` and theorem name `erdos_475` follow project conventions. ✅ +- The theorem docstring explains the mathematical content and mentions Graham's result. ✅ +- `open Finset BigOperators` is appropriate for the notation used. ✅ + +**Minor observations:** + +- The `partialSum` docstring says "the sum $f(0) + f(1) + \cdots + f(m)$" which is correct (inclusive on both ends). Clear. ✅ +- The theorem statement is readable: `f` enumerates `A` injectively, and `partialSum f` is injective (all prefix sums distinct). The three conditions (`∀ i, f i ∈ A`, `Function.Injective f`, `Function.Injective (partialSum f)`) cleanly separate the requirements. + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem as stated is precise and unambiguous: + +> Given a prime $p$ and any finite $A \subseteq \mathbb{F}_p \setminus \{0\}$, does there exist a rearrangement with all partial sums distinct? + +All components are well-defined: +- "Prime $p$" → `[Fact (Nat.Prime p)]` ✅ +- "$A \subseteq \mathbb{F}_p \setminus \{0\}$" → `A : Finset (ZMod p)` with `hA : ∀ a ∈ A, a ≠ 0` ✅ +- "Rearrangement" → injective function `f : Fin A.card → ZMod p` with image in `A` ✅ +- "All partial sums distinct" → `Function.Injective (partialSum f)` ✅ + +There is one potential ambiguity in the literature: whether "sequenceable" means the $t$ partial sums $S_1, \ldots, S_t$ are distinct (as formalized), or the $t+1$ values $S_0 = 0, S_1, \ldots, S_t$ are all distinct (the stronger condition from Gordon's original definition of sequenceable groups). However, the formalization correctly uses the *weaker* interpretation (excluding the empty sum), which is forced by the mathematics: when $A = \mathbb{F}_p \setminus \{0\}$ (the case Graham proved), we have $S_t = \sum_{a \in \mathbb{F}_p \setminus \{0\}} a = 0 = S_0$, so the stronger condition would be impossible. Since Graham proved this case, the problem must use the weaker condition. + +**Verdict:** Unambiguous and cleanly formalizable. The choice of partial-sum convention is correct and forced by the known results. + +## 6. Correctness + +**Definition correctness (`partialSum`):** + +`partialSum f m = (univ.filter (fun i : Fin n => i ≤ m)).sum f` computes $\sum_{i=0}^{m} f(i)$. This gives: +- `partialSum f 0 = f 0` (corresponding to $S_1 = a_1$) +- `partialSum f 1 = f 0 + f 1` (corresponding to $S_2 = a_1 + a_2$) +- etc. + +This correctly models the partial sums $S_1, \ldots, S_t$ using 0-based indexing. ✅ + +**Theorem correctness:** + +The statement requires the existence of `f : Fin A.card → ZMod p` satisfying three conditions: + +1. **`∀ i, f i ∈ A`** — the image of `f` lies in `A`. ✅ +2. **`Function.Injective f`** — `f` is injective. Combined with (1), since `|Fin A.card| = A.card` and the image is a subset of `A` (which has cardinality `A.card`), this forces `f` to be a bijection onto `A`. So `f` is a rearrangement/sequencing of `A`. ✅ +3. **`Function.Injective (partialSum f)`** — all partial sums are pairwise distinct. This is exactly "all partial sums $S_1, \ldots, S_t$ are distinct." ✅ + +**Edge case analysis:** + +- **`A = ∅`**: Then `A.card = 0`, `Fin 0` is empty, `f : Fin 0 → ZMod p` is the empty function. All three conditions are vacuously true. The theorem holds trivially. Mathematically reasonable (the empty set is trivially sequenceable). ✅ +- **`|A| = 1`**: `f : Fin 1 → ZMod p` maps the single index to the single element. One partial sum, injectivity is trivial. ✅ +- **`p = 2`**: `ZMod 2 = {0, 1}`, so `A ⊆ {1}`, meaning `A = ∅` or `A = {1}`. Both trivially sequenceable. ✅ + +**Problem status:** + +The formalization is tagged `@[category research open, AMS 5 11]`. However, the website indicates the problem is essentially resolved for all sufficiently large primes (via the four complementary results from 2025–2026). The problem remains technically open only for finitely many small primes, which are in principle decidable by finite computation. The `open` tag may warrant reconsideration depending on the project's standards for what constitutes "resolved." + +**Verdict:** The formalization is mathematically correct and complete. The encoding of "rearrangement with distinct partial sums" via an injective enumeration with injective partial sums is faithful to the problem statement. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities; local `partialSum` is justified; could use `Finset.Iic` | +| Citations | Website link present; Graham's result mentioned; four recent breakthrough results (2025–2026) not cited | +| Variants | Core conjecture captured; Alspach's abelian group generalization and Graham's proven special case omitted | +| Readability | Good; clean structure and clear docstrings | +| Formalizability | Unambiguous; partial-sum convention correctly chosen | +| Correctness | Correct and complete; edge cases handled properly | + +**Overall:** The formalization is mathematically sound and faithfully captures Erdős Problem 475. The encoding of a "sequencing with distinct partial sums" as an injective function with injective prefix sums is the natural and correct approach. The main gaps are in documentation: the four recent results that essentially resolve the conjecture for large primes should be cited, and the `open` status may need reconsideration given these advances. The `partialSum` definition could be written slightly more idiomatically using `Finset.Iic`, but this is cosmetic. diff --git a/ai-review/476.md b/ai-review/476.md new file mode 100644 index 0000000000..f50cf1856f --- /dev/null +++ b/ai-review/476.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 476 + +## 1. Code Reuse + +**`restrictedSumset` definition is duplicated.** Green's Open Problem 2 (`GreensOpenProblems/2.lean:45`) defines the same concept more concisely: + +```lean +-- Green 2 (cleaner) +def restrictedSumset (S : Finset ℤ) : Finset ℤ := + S.offDiag.image (fun p => p.1 + p.2) + +-- Erdős 476 (current) +def restrictedSumset {p : ℕ} (A : Finset (ZMod p)) : Finset (ZMod p) := + A.biUnion (fun a => (A.erase a).image (fun b => a + b)) +``` + +Both compute `{a + b : a, b ∈ S, a ≠ b}` but the `offDiag.image` pattern is more idiomatic and readable. Consider extracting a shared polymorphic `restrictedSumset` definition into `FormalConjecturesForMathlib/Combinatorics/` that works over any `DecidableEq` + `Add` type, usable by both problems. The `biUnion`+`erase`+`image` pattern also appears in `ErdosProblems/1089.lean` for distances. + +No other reuse opportunities from `FormalConjecturesForMathlib` were identified — the existing additive combinatorics infrastructure (Sidon sets, sum-free sets, convolutions, bases) does not directly apply to this restricted sumset cardinality bound. + +## 2. Citations + +**Incomplete.** The website (https://www.erdosproblems.com/476) lists four references: + +| Citation | In formalization? | +|----------|------------------| +| [Er65b] Erdős (1965), original question | **Missing** | +| [ErGr80] Erdős–Graham (1980) | **Missing** | +| [dSHa94] da Silva–Hamidoune (1994), the proof | Present | +| [Gu04] Guy's collection, problem C15 | **Missing** | + +The docstring should include all four references. The formalization currently only cites [dSHa94]. At minimum, [Er65b] should be cited as the origin of the conjecture, and the full citation for [dSHa94] should be verified: + +- Current: `da Silva, J.A.D. and Hamidoune, Y.O., *Cyclic spaces for Grassmann derivatives and additive theory*, Bull. London Math. Soc. 26 (1994), 140-146.` +- This appears accurate based on the known literature. + +## 3. Variants + +**Missing generalization.** The erdosproblems.com page states: + +> Erdős also mentioned a more general conjecture: the number of $x \in \mathbb{F}_p$ which are the sum of at most $r$ many distinct elements of $A$ is at least $\min(r|A| - r^2 + 1, p)$. + +This is noted as problem C15 in Guy's collection. Setting $r = 2$ recovers the original bound $\min(2|A| - 3, p)$. This generalization is not captured in the formalization and would be a natural companion theorem. It was also proved by Alon, Nathanson, and Ruzsa (1995–1996) using the polynomial method. + +## 4. Readability + +**Good overall, minor improvement possible.** + +- The code is clean and well-structured with appropriate docstrings. +- The `restrictedSumset` definition via `biUnion`/`erase`/`image` is correct but slightly harder to parse than the `offDiag.image` alternative used in `GreensOpenProblems/2.lean`. +- The namespace `Erdos476` cleanly scopes the definitions. + +## 5. Formalizability + +**Unambiguous; fully formalizable.** The problem statement is precise: it specifies the ground set ($\mathbb{F}_p$ for prime $p$), the operation (restricted sumset with distinct summands), and the exact bound ($\min(2|A|-3, p)$). There is no room for misinterpretation. + +The only design choice is the handling of degenerate cases ($|A| \leq 1$), where the mathematical bound $2|A|-3$ is negative. The formalization handles this correctly via natural number truncated subtraction (which yields 0), making the bound trivially satisfied. + +## 6. Correctness + +**Mathematically correct.** Detailed analysis: + +- **`restrictedSumset` definition**: Computes $\{a+b : a \in A, b \in A \setminus \{a\}\}$ via `A.biUnion (fun a => (A.erase a).image (fun b => a + b))`. This is exactly $A \hat{+} A$. Correctness holds because `Finset.biUnion` takes the union, `erase a` removes $a$ from $A$, and `image (fun b => a + b)` sums. The result is automatically de-duplicated as a `Finset`. ✓ + +- **Type-level correctness**: `ZMod p` with `[Fact (Nat.Prime p)]` ensures $p$ is prime and `ZMod p` is the finite field $\mathbb{F}_p$. ✓ + +- **Bound expression**: `min (2 * A.card - 3) p` operates on `ℕ`. When $|A| \leq 1$, truncated subtraction gives 0, which is correct (the mathematical bound is negative, so trivially satisfied). When $|A| \geq 2$, $2|A|-3$ is the correct positive integer. ✓ + +- **`answer(True)` wrapper**: The problem is solved in the affirmative by da Silva–Hamidoune (1994), so `answer(True)` is correct. ✓ + +- **Edge cases verified**: + - $|A| = 0$: empty restricted sumset, bound = $\min(0, p) = 0$. ✓ + - $|A| = 1$: empty restricted sumset, bound = $\min(0, p) = 0$. ✓ + - $|A| = 2$, $A = \{a, b\}$: restricted sumset $= \{a+b\}$, bound $= \min(1, p) = 1$ (since $p \geq 2$). ✓ + - $A = \mathbb{F}_p$: restricted sumset $= \mathbb{F}_p$ (for $p \geq 3$), bound $= \min(2p-3, p) = p$. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the Erdős-Heilbronn conjecture as stated on the website (excluding the generalization to $r$-fold sums). diff --git a/ai-review/478.md b/ai-review/478.md new file mode 100644 index 0000000000..a6998d9073 --- /dev/null +++ b/ai-review/478.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 478 + +## 1. Code Reuse + +**No significant reuse opportunities.** The `factorialResidues` definition is simple and self-contained (`Finset.Icc` + `image` with `Nat.factorial k % p`). While the `Finset.Icc ... |>.image` pattern appears in several other problems (e.g., `ErdosProblems/700.lean`, `ErdosProblems/443.lean`, `ErdosProblems/461.lean`), the specific mapping here is unique to this problem and does not warrant extraction. + +The filter pattern `atTop ⊓ Filter.principal {p | Nat.Prime p}` for "limit along primes" is also used in `ErdosProblems/897.lean` (with a product type). No shared utility for this pattern exists in `FormalConjecturesForMathlib`, but given its simplicity (a single inline expression), extracting it would not meaningfully reduce duplication. + +The density utilities in `FormalConjecturesForMathlib/Data/Set/Density.lean` (`Set.HasDensity`, `Set.upperDensity`) are not applicable here, since the problem concerns the ratio of a quantity to a linear function of $p$, not a density of a subset of $\mathbb{N}$. + +## 2. Citations + +**Adequate but could be more precise.** The formalization cites two references: + +| Citation | In formalization? | On website? | Notes | +|----------|------------------|-------------|-------| +| [ErGr80] Erdős–Graham (1980) | ✓ Present | ✓ | Origin of the problem. Docstring says "p.96" but the website does not specify a page number. Page reference should be verified. | +| [GSSV24] Grebennikov, Sagdeev, Semchankau, Vasilevskii (2024) | ✓ Present | ✓ | Best known lower bound. | + +The [GSSV24] citation in the docstring is abbreviated — it gives only author surnames and year. Adding the paper title would improve traceability. The website attributes the lower bound $|A_p| \geq (\sqrt{2} - o(1))p^{1/2}$ to this paper, which matches the docstring. + +No references appear to be missing relative to the website. + +## 3. Variants + +**One notable related question is not captured.** The erdosproblems.com page mentions: + +> Hardy and Subbarao raised whether $|A_p| = p - 2$ for infinitely many primes. Such primes must satisfy $p \equiv 1 \pmod{4}$. The conjecture suggests finitely many solutions exist, possibly only $p = 5$. + +This is a natural companion conjecture that could be formalized as a separate theorem or added as a variant. For example: + +```lean +/-- Hardy–Subbarao conjecture: only finitely many primes p satisfy |A_p| = p - 2, + and perhaps only p = 5. -/ +theorem erdos_478_variant_hardy_subbarao : answer(sorry) ↔ + Set.Finite {p : ℕ | Nat.Prime p ∧ (factorialResidues p).card = p - 2} := by + sorry +``` + +Additionally, the website notes a structural property not mentioned in the docstring: the "division property" $A_p / A_p = \{1, \ldots, p-1\}$, which immediately implies $|A_p| \gg p^{1/2}$. While this is a known result rather than a conjecture, it provides useful context and could be mentioned in the docstring. + +## 4. Readability + +**Good.** The code is clean and well-organized: + +- The `factorialResidues` helper is clearly named and has an accurate docstring matching the mathematical definition. +- The namespace `Erdos478` cleanly scopes the definition. +- The main theorem docstring clearly states both the informal problem and the formal interpretation. +- The `open Filter` and `open scoped Topology Real` declarations are appropriate. + +**Minor suggestion:** The docstring for `erdos_478` could explicitly note that the function is evaluated only at primes (via the filter), even though `factorialResidues` is defined for all `ℕ`. This is clear from the code but would aid casual readers. + +## 5. Formalizability + +**Unambiguous; fully formalizable.** The problem statement is precise: it specifies the set $A_p$ (factorial residues mod $p$ for $1 \leq k < p$), and asks whether $|A_p| \sim (1 - 1/e) \cdot p$. The asymptotic equivalence $f(p) \sim g(p)$ is standard and unambiguously means $f(p)/g(p) \to 1$. + +The only design choice is whether to express the asymptotic condition as: +- (a) $|A_p| / ((1 - e^{-1}) p) \to 1$ (ratio form, as implemented), or +- (b) $|A_p| - (1 - e^{-1}) p = o(p)$ (difference form). + +These are mathematically equivalent. The ratio form is the more standard formalization of $\sim$ and is the natural choice. + +## 6. Correctness + +**Mathematically correct.** Detailed analysis: + +- **`factorialResidues` definition**: `(Finset.Icc 1 (p - 1)).image (fun k => Nat.factorial k % p)` computes $\{k! \bmod p : 1 \leq k \leq p - 1\}$. For prime $p \geq 2$, `Finset.Icc 1 (p - 1)` gives exactly $\{1, 2, \ldots, p-1\}$, matching the mathematical definition $1 \leq k < p$. The `image` automatically de-duplicates, so the cardinality of the resulting `Finset` is $|A_p|$. ✓ + +- **Degenerate inputs**: For $p = 0$, `Finset.Icc 1 (0 - 1)` with natural subtraction gives `Finset.Icc 1 0` which, since `1 > 0` in the `Icc` order, is `{0, 1}` — wait, actually `Finset.Icc 1 0 = ∅` since `1 > 0`. Hmm, but `(0 : ℕ) - 1 = 0` by truncated subtraction, so `Finset.Icc 1 0 = ∅`. For $p = 1$, similarly `Finset.Icc 1 0 = ∅`. Neither 0 nor 1 is prime, so these cases are filtered out. For $p = 2$, `Finset.Icc 1 1 = {1}`, so `factorialResidues 2 = {1! % 2} = {1}`, giving $|A_2| = 1$. This is correct: the only factorial residue mod 2 for $k = 1$ is $1$. ✓ + +- **Filter correctness**: `atTop ⊓ Filter.principal {p | Nat.Prime p}` generates neighborhoods of the form $\{n \geq N\} \cap \{p \mid p \text{ prime}\}$. This is the standard way to express "limit as $p \to \infty$ through the primes" in Mathlib. Since the primes form an infinite set, the filter is non-degenerate (not $\bot$), so the Tendsto statement is non-vacuous. ✓ + +- **Type coercions**: `(factorialResidues p).card` is `ℕ`, which is coerced to `ℝ` to match the `ℝ`-valued denominator `(1 - Real.exp (-1)) * (p : ℝ)`. The coercion is automatic via `Nat.cast`. The constant $1 - e^{-1} \approx 0.6321 > 0$, so the denominator is positive for all $p \geq 1$, avoiding division-by-zero issues. ✓ + +- **`answer(sorry)` wrapper**: The problem is marked as open on erdosproblems.com and cannot be resolved by finite computation. Using `answer(sorry)` (rather than `answer(True)` or `answer(False)`) correctly reflects that the expected answer is unknown. ✓ + +- **Category tags**: `@[category research open, AMS 11]` — "research open" is correct (problem is open), and AMS 11 (Number Theory) is the appropriate subject classification. ✓ + +**No mathematical flaws identified.** The formalization is a faithful rendering of Erdős Problem 478 as stated on the website, modulo the omission of the Hardy–Subbarao variant. diff --git a/ai-review/481.md b/ai-review/481.md new file mode 100644 index 0000000000..90ac817d95 --- /dev/null +++ b/ai-review/481.md @@ -0,0 +1,80 @@ +# Review: Erdős Problem 481 + +## 1. Code Reuse + +**No significant reuse opportunities.** The `affineTransform` and `iterateAffine` definitions are specific to this problem and appropriately self-contained. No analogous iterated-list-transform utilities exist in `FormalConjecturesForMathlib`. + +The core operation `List.flatMap` (used in `affineTransform`) and the `List.Nodup` predicate (used in the conclusion) are standard Mathlib primitives. Mathlib's `List.nodup_flatMap` lemma (in `Mathlib.Data.List.Nodup`) — which characterizes `Nodup (l.flatMap f)` in terms of pairwise disjointness — would likely be useful in any proof of this theorem, but does not constitute code to be reused at the statement level. + +Other Erdős problems use `Nodup` (e.g., 303, 518) and reciprocal-sum conditions (e.g., 57, 65, 320, 350, 460), but none share enough structure with 481 to warrant shared definitions. + +## 2. Citations + +**Incomplete.** The formalization cites only one reference: + +| Citation | In formalization? | On website? | Notes | +|----------|------------------|-------------|-------| +| [ErGr80] Erdős–Graham, *Old and new problems and results in combinatorial number theory* (1980), p.96 | ✓ Present | ✓ | Origin of the problem. Page reference included. | +| [Kl82] Klarner (1982) | ✗ Missing | ✓ | First to prove the conjecture. | +| [KoTa22] Kolpakov–Talambutsa (2022) | ✗ Missing | ✓ | Generalization of the result. | + +The website credits Klarner as the first to prove this result, and Kolpakov–Talambutsa for a generalization. Both should be cited in the docstring, especially since the problem is tagged `solved`. The website also notes a comment by Ryan Alweiss that the original formulation contained a redundant condition on the minimal element (trivially satisfied since it grows at each stage); this could be mentioned as historical context. + +**Recommendation:** Add citations for [Kl82] and [KoTa22] with full bibliographic details. + +## 3. Variants + +**No variants captured.** The website mentions a generalization by Kolpakov and Talambutsa [KoTa22], but does not specify its precise statement. If the generalization relaxes the condition $\sum 1/a_i > 1$ or extends to more general transformations, it could be formalized as a separate theorem. However, the website does not provide enough detail to formalize this without consulting the paper. + +The current formalization captures the core problem as stated by Erdős and Graham. + +## 4. Readability + +**Good.** The code is clean and well-structured: + +- The helper definitions `affineTransform` and `iterateAffine` are clearly named and have accurate docstrings explaining the mathematical correspondence. +- The namespace `Erdos481` appropriately scopes all definitions. +- The main theorem's docstring clearly states both the informal problem and the formal setup. +- The indexing convention (`iterateAffine params 0 = [1]` for $A_1$) introduces a minor off-by-one between the mathematical and code notation ($A_k$ in the problem corresponds to `iterateAffine params (k-1)`), but this is standard practice and clearly documented. + +**Minor suggestions:** +- The `affineTransform` docstring says the ordering is $(a_i x_j + b_i)_{1 \le j \le n, 1 \le i \le r}$, which matches the code's `flatMap` ordering (outer loop over $j$/elements, inner loop over $i$/params). This is consistent. However, the problem statement on the website uses the same subscript ordering, so this is correct. + +## 5. Formalizability + +**Unambiguous; fully formalizable.** The problem statement is precise and leaves no room for interpretation: + +- The parameters $a_i, b_i \in \mathbb{N}$ with $\sum 1/a_i > 1$ are clearly specified. +- The transformation $T$ is explicitly defined. +- The starting point $A_1 = (1)$ is fixed. +- The conclusion "some $A_k$ with repeated elements" is unambiguous. + +The only minor design choice is representation: using `List (ℕ × ℕ)` for the parameters (rather than, say, two separate lists or a `Fin r`-indexed family). The list representation is natural and avoids unnecessary complexity. Using `List ℤ` for the sequences (rather than `List ℕ`) is slightly more general than necessary (all elements remain non-negative), but is faithful to the problem's description of "integers" and avoids truncated-subtraction issues. + +**Ambiguity: None.** This is among the most precisely stated problems in the Erdős collection. + +## 6. Correctness + +**Mathematically correct.** Detailed analysis: + +- **`affineTransform` definition**: `A.flatMap (fun x => params.map (fun ⟨a, b⟩ => (a : ℤ) * x + (b : ℤ)))` produces $r \cdot n$ elements for a list of $n$ elements and $r$ parameter pairs, matching $T(A)$ as defined. The ordering within the output list does not affect `Nodup`, so the specific `flatMap` iteration order is irrelevant. ✓ + +- **`iterateAffine` definition**: Base case `[1]` matches $A_1 = (1)$. Recursive case applies $T$ correctly. ✓ + +- **Type coercions**: Parameters are `ℕ × ℕ`, cast to `ℤ` via `(a : ℤ)` and `(b : ℤ)` in `affineTransform`. This is sound since $\mathbb{N} \hookrightarrow \mathbb{Z}$ preserves arithmetic. The reciprocal sum is computed in `ℝ` via `(1 : ℝ) / (p.1 : ℝ)`, which correctly handles the real-valued inequality. ✓ + +- **`hpos` condition**: `∀ p ∈ params, 0 < p.1` ensures all $a_i \geq 1$, which is necessary for $1/a_i$ to be well-defined and finite. Since `ℕ` includes 0, this guard is essential. ✓ + +- **`hne` condition**: `params ≠ []` is logically redundant given `hsum`: if `params = []`, the mapped sum is 0, which does not satisfy `> 1`. Including it is harmless but unnecessary. Not a correctness issue, but could be noted as a simplification opportunity. + +- **`hsum` condition**: `(params.map (fun p => (1 : ℝ) / (p.1 : ℝ))).sum > 1` faithfully encodes $\sum_i 1/a_i > 1$. Since `hpos` guarantees `p.1 > 0`, the cast `(p.1 : ℝ) > 0` holds, and the division is well-behaved. ✓ + +- **Conclusion**: `∃ k : ℕ, ¬ (iterateAffine params k).Nodup` asserts that some iterate has repeated elements. `List.Nodup` checks that all elements are pairwise distinct, so its negation means at least two positions share the same value. This exactly matches "repeated elements." ✓ + +- **No missing hypotheses**: The problem does not require $b_i > 0$ (they may be zero), and the formalization correctly allows `b_i = 0` via the `ℕ` type. No additional constraints are needed. ✓ + +- **Category tags**: `@[category research solved, AMS 5 11]` — "research solved" is correct per the website (proved by Klarner). AMS 5 (Combinatorics) and 11 (Number Theory) are appropriate subject classifications. ✓ + +- **No condition on the minimal element**: The website notes (via Ryan Alweiss) that the original Erdős–Graham formulation included an extra condition on the minimal element of each $A_k$ that is trivially satisfied. The formalization correctly omits this redundant condition. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of Erdős Problem 481. The only actionable items are adding the missing citations [Kl82] and [KoTa22], and optionally removing the redundant `hne` hypothesis. diff --git a/ai-review/482.md b/ai-review/482.md new file mode 100644 index 0000000000..136d3597d9 --- /dev/null +++ b/ai-review/482.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 482 + +## 1. Code Reuse + +**No significant reuse opportunities.** The `grahamPollakSeq` and `binaryDigit` definitions are specific to this problem and appropriately self-contained. No analogous sequence or binary-digit utilities exist in `FormalConjecturesForMathlib`. + +Several other Erdős problems use related patterns — Problem 349 uses `⌊t * α ^ n⌋` (floor with powers), Problem 354 uses `FloorMultiples` with modular conditions, and Problems 133/441 use `Real.sqrt` — but none share enough structure to warrant shared definitions. The `binaryDigit` function could in principle be a shared utility (it is a general-purpose binary digit extractor), but it is only used in this file and is simple enough that deduplication would add complexity without benefit. + +Mathlib's `Real.sqrt`, `Int.floor`, and `Int.emod` are the core primitives; all are correctly imported via `ProblemImports`. + +## 2. Citations + +**Complete.** All references on [erdosproblems.com/482](https://www.erdosproblems.com/482) are present in the formalization: + +| Citation | In formalization? | On website? | Notes | +|----------|------------------|-------------|-------| +| [GrPo70] Graham–Pollak, *Note on a nonlinear recurrence related to √2*, Math. Mag. 43 (1970), 143–145 | ✓ | ✓ | Original proof for √2 | +| [ErGr80] Erdős–Graham, *Old and new problems and results in combinatorial number theory* (1980), p.96 | ✓ | ✓ | Source of the problem | +| [St05] Stoll, *On families of nonlinear recurrences related to digits*, J. Integer Seq. 8 (2005) | ✓ | ✓ | Generalization | +| [St06] Stoll, *A fancy way to obtain the binary digits of certain irrational numbers*, Amer. Math. Monthly 113 (2006), 323–328 | ✓ | ✓ | Generalization | + +The website also references OEIS sequence A004539 (binary expansion of √2), which is not mentioned in the formalization. This is a minor omission; adding a brief comment referencing it would improve traceability. + +**Recommendation:** Optionally add a reference to OEIS A004539. + +## 3. Variants + +**Generalization not captured, but appropriately noted.** The website describes this problem as "open-ended": Erdős and Graham asked for "similar results for θ = √m, and other algebraic numbers." Stoll's papers [St05, St06] address these generalizations. + +The formalization captures only the original Graham–Pollak result for √2. This is the core, well-defined mathematical content. The generalization to √m would require parameterizing the sequence by an arbitrary positive integer m and formulating an analogous digit-extraction identity, which would be a natural extension but is not part of the original Graham–Pollak theorem. + +The docstring correctly notes that "Erdős and Graham asked for similar results for θ = √m and other algebraic numbers; this was addressed by the generalisations of Stoll [St05, St06]." This is adequate documentation of the variant. + +## 4. Readability + +**Good.** The code is clean and well-organized: + +- `grahamPollakSeq` is clearly named and the docstring explicitly notes the 1-indexing convention and the dummy value at 0. +- `binaryDigit` has a clear docstring explaining the 0-indexing convention and the formula. +- The main theorem's docstring explains the index shift from the natural-number subtraction `2n-1` to the equivalent `2n+1` / `2n+3` formulation. +- The `Erdos482` namespace appropriately scopes all definitions. + +**Minor suggestions:** +- The `binaryDigit` docstring says "Position 0 is the integer-part bit." This is slightly imprecise: for numbers ≥ 2, position 0 would be the units bit, not the full integer part. For √2 < 2, this happens to coincide, but a more precise phrasing would be "Position 0 is the units (2⁰) bit." This is cosmetic and does not affect correctness. + +## 5. Formalizability + +**Unambiguous; fully formalizable.** The Graham–Pollak result is a precisely stated identity between a recursively defined integer sequence and the binary digits of √2. Every component is well-defined: + +- The sequence `a(1) = 1, a(n+1) = ⌊√2 · (a(n) + 1/2)⌋` is deterministic and well-defined for all n ≥ 1. +- The binary expansion of √2 is unique (since √2 is irrational, there is no dyadic-rational ambiguity of the "0.111... = 1.000..." type). +- The relationship `a(2n+1) − 2a(2n−1) = nth binary digit` is a concrete integer identity. + +The open-ended part ("find similar results for √m and other algebraic numbers") is inherently not formalizable as a single theorem, but this is correctly treated as context rather than a formal statement. + +**Ambiguity: None** for the core result. The generalization request is by nature imprecise. + +## 6. Correctness + +**Mathematically correct.** Detailed verification: + +- **`grahamPollakSeq` definition**: Base cases `0 => 0` (dummy) and `1 => 1` are correct. The recursive case `n + 2 => ⌊√2 * (a(n+1) + 1/2)⌋` faithfully encodes `a(n+1) = ⌊√2 · (a(n) + 1/2)⌋`. The cast from ℤ to ℝ via `(grahamPollakSeq (n + 1) : ℝ)` is sound. ✓ + +- **`binaryDigit` definition**: `⌊x * 2^n⌋ % 2` is the standard formula for the nth binary digit (0-indexed from the units place). For irrational x > 0 (like √2), this always yields 0 or 1. ✓ + +- **Index correspondence**: The original statement uses 1-indexed binary digits and the identity `a(2n+1) − 2a(2n−1)` for n ≥ 1. The formalization shifts to `a(2n+3) − 2a(2n+1)` for n ≥ 0 with 0-indexed binary digits. Substituting m = n+1: `a(2m+1) − 2a(2m−1) = binaryDigit(√2, m−1)`, which correctly maps 1-indexed digit m to 0-indexed digit m−1. ✓ + + Manual verification of first four terms: + - a(1)=1, a(2)=2, a(3)=3, a(4)=4, a(5)=6, a(6)=9, a(7)=13, a(8)=19, a(9)=27 + - n=0: a(3)−2·a(1) = 3−2 = 1 = binaryDigit(√2, 0) = ⌊1.414⌋ % 2 = 1 ✓ + - n=1: a(5)−2·a(3) = 6−6 = 0 = binaryDigit(√2, 1) = ⌊2.828⌋ % 2 = 0 ✓ + - n=2: a(7)−2·a(5) = 13−12 = 1 = binaryDigit(√2, 2) = ⌊5.656⌋ % 2 = 1 ✓ + - n=3: a(9)−2·a(7) = 27−26 = 1 = binaryDigit(√2, 3) = ⌊11.31⌋ % 2 = 1 ✓ + + These match the binary expansion √2 = 1.0110101..._2 (OEIS A004539: 1, 0, 1, 1, 0, 1, 0, 1, ...). ✓ + +- **Dummy value at 0**: `grahamPollakSeq 0 = 0` is never referenced by the theorem (minimum index used is `2*0+1 = 1`). Harmless. ✓ + +- **Type choices**: The sequence returns `ℤ`, which is appropriate since the differences `a(2n+3) − 2·a(2n+1)` involve integer subtraction. The `binaryDigit` function also returns `ℤ` (via `Int.emod`), ensuring type compatibility. Using `ℤ` rather than `ℕ` avoids truncated-subtraction issues. ✓ + +- **`noncomputable` annotations**: Both definitions use `Real.sqrt` and `Int.floor`, which are noncomputable in Lean. Correctly annotated. ✓ + +- **Category tags**: `@[category research solved, AMS 11]` — "research solved" matches the website's status ("solved"). AMS 11 (Number Theory) is the appropriate classification. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the Graham–Pollak theorem as referenced by Erdős Problem 482. The only actionable items are the optional OEIS reference and the minor `binaryDigit` docstring clarification. diff --git a/ai-review/483.md b/ai-review/483.md new file mode 100644 index 0000000000..8dd255ecd9 --- /dev/null +++ b/ai-review/483.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 483 + +## 1. Code Reuse + +The definition `HasMonochromaticSchurTriple` is self-contained in `483.lean`. There is a closely related definition `IsSumFree` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean:30`: + +```lean +def IsSumFree (A : Set α) : Prop := Disjoint (A + A) A +``` + +A k-coloring of {1,...,N} avoids monochromatic Schur triples if and only if each color class is sum-free. This connection is mathematically fundamental but does not affect the correctness of the current formalization—the two notions operate at different levels (colorings vs. sets), and using `IsSumFree` here would make the statement less direct. + +Several other problems define similar monochromatic predicates (Problems 8, 596, 781) and multicolor Ramsey infrastructure (Problems 129, 183, 554–558), but none are directly reusable for arithmetic Schur triples. No code reuse opportunities are missed. + +## 2. Citations + +The formalization cites: +- **[Er61]** Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), 221–254. +- **[Er65]** Erdős, P., *Extremal problems in number theory*, Proc. Sympos. Pure Math. 8 (1965), 181–189. + +These are the original problem sources and are appropriate. The website ([erdosproblems.com/483](https://www.erdosproblems.com/483)) additionally lists references for known bounds and computations: +- [ACPPRT21] Ageron, Casteras, Pellerin, Portella, Rimmel, Tomasik — current lower bound +- [Ex94] Exoo — previous lower bound +- [FrSw00] Fredricksen & Sweet — previous lower bound +- [Wh73] Whitehead — upper bound +- [He17] Heule — computation of f(5) = 161 + +These are references for results *about* the problem rather than the problem statement itself. Since the docstring mentions specific bounds (380^{k/5} lower bound, (e - 1/24)k! upper bound, and known values of f(k)), it would be good practice to cite the sources of those bounds, but their omission is not a significant issue for a formalization of the conjecture itself. + +The website also notes a related problem: **Problem 183** (multicolor Ramsey numbers for triangles, formalized in `ErdosProblems/183.lean`). This cross-reference is not mentioned in the docstring and could be added for completeness. + +## 3. Variants + +The original problem is broad: "Estimate f(k)." The formalization captures the specific sub-question: "Is it true that f(k) < c^k for some constant c > 0?" This is the most concrete and well-known conjecture associated with the problem, and the docstring explicitly acknowledges the narrowing ("We formalize the conjecture..."). + +No additional variants or sub-questions appear on the website beyond this. The formalization appropriately focuses on the central open question. + +## 4. Readability + +The code is clean and well-structured: +- The `HasMonochromaticSchurTriple` predicate is clearly named and well-documented with a LaTeX docstring. +- The main theorem statement is readable and the docstring provides thorough mathematical context (known bounds, known values, OEIS reference, and a clear description of what is being formalized). +- The namespace `Erdos483` avoids name collisions. + +No readability improvements are needed. + +## 5. Formalizability + +The problem as stated ("Is f(k) < c^k for some constant c?") is **completely unambiguous** and directly formalizable. The Schur number f(k) has a precise combinatorial definition, and the question of exponential growth is a precise yes/no question. + +The only source of ambiguity in the broader problem ("Estimate f(k)") is what constitutes a satisfactory "estimate," but the formalization sidesteps this by targeting the specific exponential-growth sub-question. This is the correct approach. + +**Ambiguity assessment: None.** The formalized statement is precise and faithful. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Definition `HasMonochromaticSchurTriple`:** +- Requires ∃ a, b with 1 ≤ a, 1 ≤ b, a + b ≤ N, f(a) = f(b) = f(a+b). +- This correctly captures the standard Schur triple: a solution to a + b = c with a, b, c ∈ {1,...,N} all receiving the same color. +- The constraints ensure a ∈ {1,...,N-1}, b ∈ {1,...,N-1}, and a+b ∈ {2,...,N}, so all three values lie in {1,...,N}. ✓ +- The definition correctly allows a = b (the standard definition does not require distinctness). ✓ +- Using `f : ℕ → Fin k` (coloring all of ℕ) rather than restricting to {1,...,N} is sound: the existential is constrained to the relevant range, and the universal quantification over all such functions covers all colorings of the finite interval. ✓ + +**Theorem `erdos_483`:** +- The `answer(sorry)` pattern is appropriate for an open problem whose truth value is unknown. ✓ +- The statement `∃ c : ℝ, 0 < c ∧ ∀ k, 1 ≤ k → ∀ N, c^k ≤ N → ∀ f, HasMonochromaticSchurTriple k N f` correctly asserts that the Schur number f(k) grows at most exponentially. ✓ +- The condition `0 < c` is weaker than `1 < c`, but this is harmless: any c ≤ 1 would require monochromatic triples in very small sets, which is impossible (e.g., {1} has no Schur triple), so any valid witness must satisfy c > 1. ✓ +- The condition `1 ≤ k` correctly excludes the degenerate case k = 0 (where `Fin 0` is empty and no coloring exists). ✓ +- The quantifier order `∀ k, ... ∀ N, ... ∀ f` is correct: a single constant c works for all k, all sufficiently large N (relative to c^k), and all colorings. ✓ + +**No mathematical flaws identified.** The formalization is complete and correct as a statement of the exponential-growth conjecture for Schur numbers. diff --git a/ai-review/484.md b/ai-review/484.md new file mode 100644 index 0000000000..773db20162 --- /dev/null +++ b/ai-review/484.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 484 + +## 1. Code Reuse + +Several related files in the codebase define infrastructure that is conceptually adjacent but not directly reusable here: + +- **Problem 476** (`476.lean`) defines `restrictedSumset` for `Finset (ZMod p)`, computing `A ⊕ A = {a + b : a, b ∈ A, a ≠ b}`. This is the exact same combinatorial operation (restricted/distinct-element sumset) that Problem 484 needs, but it is specialized to `ZMod p`. A generalized version (over any `AddCommMonoid` with `DecidableEq`) factored into `FormalConjecturesForMathlib` would serve both problems. +- **Problem 483** (`483.lean`) defines `HasMonochromaticSchurTriple` using the same coloring pattern `f : ℕ → Fin k` over `{1,…,N}`. The coloring infrastructure is identical; a shared "monochromatic pair" predicate (two elements in the same color class) could be extracted. +- **`FormalConjecturesForMathlib/Combinatorics/Basic.lean`** provides `IsSidon`, `IsSumFree`, and related additive combinatorics definitions. While `IsSidon` is thematically connected (Sidon sets have all pairwise sums distinct, so their restricted sumsets are large), it is not directly applicable to the statement. + +**Recommendation:** The most actionable reuse opportunity is generalizing `restrictedSumset` from Problem 476 and placing it in a shared utility. However, since Problem 484 inlines the sum condition (`∃ a … ∃ b … a ≠ b ∧ χ a = χ b ∧ a + b = n`) rather than using a named restricted sumset, this is a minor style concern rather than a correctness issue. The current self-contained approach is acceptable. + +## 2. Citations + +**Website ([erdosproblems.com/484](https://www.erdosproblems.com/484)) states:** +- Original attribution: **[Er61, p.230]** — described as "a conjecture of Roth." +- Solved by: **Erdős, Sárközy, and Sós [ESS89].** +- Related: A refinement appears as **Problem 25 on Ben Green's open problems list.** + +**Formalization states:** +- `[ESS89] Erdős, P., Sárközy, A., and Sós, V. T., *On sum sets of Sidon sets*, Journal of Number Theory (1989).` + +**Issues:** +- The original source **[Er61]** (Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), 221–254) is not cited in the file header, even though this is where the conjecture first appeared (attributed to Roth). Problem 483 cites [Er61] — it should also appear here. +- The connection to **Ben Green's Problem 25** is not mentioned. +- The [ESS89] citation is present and correct. + +**Recommendation:** Add `[Er61]` to the module docstring references. + +## 3. Variants + +The formalization captures only the basic existence statement (there exists an absolute constant `c > 0` such that at least `cN` integers are representable as monochromatic sums). The following variants from the literature are **not** captured: + +1. **Quantitative ESS89 bound:** At least `N/2 − O(N^{1 − 1/2^{k+1}})` even numbers are representable. This is mentioned in the docstring but not formalized. +2. **Sharp 2-coloring bound:** For `k = 2`, at least `N/2 − O(log N)` even numbers are representable, and the `O(log N)` error term is best possible. +3. **Power-of-2 obstruction:** There exists a 2-coloring of `{1,…,N}` such that no power of 2 is representable as a monochromatic sum. +4. **Ben Green's refinement** (Problem 25 on his list). + +The basic statement is the core of the problem and is the most important to formalize. The quantitative variants are natural follow-ups but not essential for a first formalization. The power-of-2 obstruction result is an interesting companion that demonstrates sharpness. The docstring appropriately mentions the ESS89 quantitative result. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The inline existential chain (`∃ a ∈ Finset.Icc 1 N, ∃ b ∈ Finset.Icc 1 N, a ≠ b ∧ χ a = χ b ∧ a + b = n`) is clear but somewhat long. An alternative would be to define a predicate `IsMonochromaticSum χ N n` for readability, similar to how Problem 483 defines `HasMonochromaticSchurTriple`. This is a style preference, not a defect. +- The use of `(S.card : ℝ) ≥ c * (N : ℝ)` with the coercion to `ℝ` is standard for this codebase and handles the interaction between `ℕ` cardinalities and real-valued constants correctly. +- The `open Finset` is appropriate given the heavy use of `Finset.Icc`. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is **fully precise and unambiguously formalizable.** All quantifiers, domains, and conditions are explicitly specified: + +- "absolute constant `c > 0`" — universal, independent of `k`. +- "`{1,…,N}` is `k`-coloured" — a function from `{1,…,N}` to `k` colors. +- "large enough depending on `k`" — there exists `N₀(k)`. +- "monochromatic sum `a + b` with `a ≠ b`" — distinct elements in the same color class. +- "at least `cN` integers" — a linear density lower bound. + +There is **no meaningful ambiguity** in the statement. The only minor interpretive question is whether the `cN` representable integers should be counted in `{1,…,N}` or in the full sum range `{3,…,2N−1}`. The website says "integers in `{1,…,N}`", and the formalization matches this. The ESS89 quantitative result (roughly `N/2` even numbers) is consistent with either interpretation, since even numbers in `{1,…,N}` already number about `N/2`. + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the core statement. Detailed verification: + +- **Quantifier structure:** `∃ c > 0, ∀ k > 0, ∃ N₀, ∀ N ≥ N₀, ∀ χ, ∃ S ⊆ Icc 1 N, |S| ≥ cN ∧ …` — This correctly captures "absolute constant `c`" (independent of `k`), with `N₀` depending on `k`. ✓ +- **Coloring domain:** `χ : ℕ → Fin k` colors all naturals, but only values on `Icc 1 N` matter (since `a, b ∈ Icc 1 N`). Universally quantifying over all `χ : ℕ → Fin k` is equivalent to quantifying over colorings of `{1,…,N}`, since the behavior outside `{1,…,N}` is irrelevant. ✓ +- **`Fin k` with `0 < k`:** The positivity condition ensures `Fin k` is nonempty, which is necessary for the coloring to be well-defined. ✓ +- **Sum constraint:** For `n ∈ S ⊆ Icc 1 N` with `n = a + b`, `a, b ∈ Icc 1 N`, and `a ≠ b`, we have `3 ≤ n ≤ N` (since `a ≥ 1`, `b ≥ 1`, `a ≠ b` implies `a + b ≥ 3`, and `n ≤ N` from `S ⊆ Icc 1 N`). This is a feasible range. ✓ +- **Monochromatic condition:** `χ a = χ b` correctly encodes that `a` and `b` receive the same color. ✓ +- **Distinctness:** `a ≠ b` correctly prevents trivial sums `a + a`. ✓ +- **Category tag:** `@[category research solved, AMS 5 11]` — correctly marked as solved. ✓ + +**Potential concern (very minor):** The formalization requires representable integers to lie in `{1,…,N}`, meaning `a + b ≤ N`. This is a slightly stronger statement than counting all representable sums in `{3,…,2N−1}`. However, this matches the website's phrasing ("integers in `{1,…,N}`") and is consistent with the ESS89 result, so it is correct. + +**No mathematical flaws identified. The formalization faithfully and correctly captures the problem.** diff --git a/ai-review/485.md b/ai-review/485.md new file mode 100644 index 0000000000..4392c1afa5 --- /dev/null +++ b/ai-review/485.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 485 + +## 1. Code Reuse + +No significant reuse opportunities. The formalization uses standard Mathlib primitives (`Polynomial.support`, `Finset.card`, `HPow.hPow`) and does not define any custom utilities. The `P.support.card` pattern also appears in `FormalConjectures/ErdosProblems/990.lean`, but in both cases the usage is direct and simple enough that extracting a shared abstraction would be over-engineering. The polynomial utility files in `FormalConjecturesForMathlib/Algebra/Polynomial/` deal with degree, derivatives, and algebraic structure — none are relevant to support cardinality. + +## 2. Citations + +The formalization cites: +- **[Sc87]** Schinzel, A., *On the number of terms of a power of a polynomial*, Acta Arith. 49 (1987), 55–70. ✅ Matches website. +- **[ScZa09]** Schinzel, A. and Zannier, U., *On the number of terms of a power of a polynomial*, Atti Accad. Naz. Lincei Rend. Lincei Mat. Appl. 20 (2009), 95–98. ✅ Matches website. + +The website additionally mentions several references **not** included in the formalization: +- **[Ha74]** — The problem appears as Problem 4.4 in this reference (likely Harary, 1974), attributed to Erdős. +- **[Re47]** — Rényi and Rédei (1947) first investigated this problem. +- **[Er49b]** — Erdős (1949) proved the upper bound $f(k) < k^{1-c}$ for some $c > 0$. + +These omissions are minor since the formalization focuses on the resolution rather than the full history, but adding [Re47] would be appropriate given the docstring already names the result the "Erdős–Rényi conjecture." + +## 3. Variants + +The formalization captures only the **$n = 2$ case** (squaring). The website notes that Schinzel [Sc87] also established lower bounds for the analogous problem with $P(x)^n$ for any integer $n \geq 1$, over fields of characteristic zero or sufficiently large positive characteristic. A natural generalization would replace `P ^ 2` with `P ^ n` and quantify over `n`: + +```lean +∀ (n : ℕ), 1 ≤ n → ∀ M : ℕ, ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ P : ℚ[X], P.support.card = k → M ≤ (P ^ n).support.card +``` + +However, the original Erdős–Rényi conjecture as stated on the website is specifically about squaring, so the current formalization is faithful to the primary problem statement. The general-$n$ result could be a separate theorem. + +## 4. Readability + +The code is clean and concise. The namespace `Erdos485` and `open Polynomial` are appropriate. The docstring clearly states the problem, attributes it, and summarizes the known quantitative bounds. No readability improvements needed. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is fully precise: +- "polynomials with exactly $k$ nonzero terms" → `P.support.card = k` +- "minimum number of nonzero terms in $P(x)^2$" → minimizing `(P ^ 2).support.card` over such $P$ +- "$f(k) \to \infty$" → standard epsilon-delta (here: $M$-$K$) formulation + +There is zero ambiguity in the mathematical content. The only subtlety is whether "terms" means "nonzero terms" (it does, by standard convention in this context), and the formalization correctly uses `.support.card` which counts monomials with nonzero coefficient. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization states: + +```lean +theorem erdos_485 : answer(True) ↔ + ∀ M : ℕ, ∃ K : ℕ, ∀ k : ℕ, K ≤ k → + ∀ P : ℚ[X], P.support.card = k → + M ≤ (P ^ 2).support.card +``` + +This asserts: for every bound $M$, there exists a threshold $K$ such that for all $k \geq K$ and all polynomials $P \in \mathbb{Q}[X]$ with exactly $k$ nonzero terms, $P^2$ has at least $M$ nonzero terms. This is precisely the statement that $f(k) \to \infty$, since $f(k) = \min\{(P^2)\text{.support.card} : P\text{.support.card} = k\}$, and the formalization says this minimum is eventually $\geq M$ for any $M$. + +**Verification of edge cases:** +- $k = 0$: $P = 0$, so $P^2 = 0$ and $(P^2)\text{.support.card} = 0$. The bound $M \leq 0$ would fail for $M \geq 1$, but this is handled by choosing $K \geq 1$. +- $k = 1$: $P = ax^d$ for some $a \neq 0$, so $P^2 = a^2 x^{2d}$ has exactly 1 nonzero term. This is fine — $f(1) = 1$. +- The coefficient ring $\mathbb{Q}$ is an integral domain, so $P \neq 0 \Rightarrow P^2 \neq 0$, ensuring no spurious cancellation to zero. + +The `answer(True)` is correct: the problem asks "Is it true that $f(k) \to \infty$?" and the answer is yes (proved by Schinzel). The tag `category research solved` correctly reflects the solved status. The `AMS 12` classification (field theory and polynomials) is appropriate. + +No mathematical flaws identified. The formalization is a faithful and complete encoding of the primary problem statement. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | ✅ No opportunities — appropriately simple | +| Citations | ⚠️ Minor — [Re47], [Er49b], [Ha74] from website not included | +| Variants | ⚠️ Minor — general $n$-th power variant not captured (but not the primary problem) | +| Readability | ✅ Clean and clear | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/487.md b/ai-review/487.md new file mode 100644 index 0000000000..5d6aa4c46f --- /dev/null +++ b/ai-review/487.md @@ -0,0 +1,67 @@ +# Review of Erdős Problem 487 + +## 1. Code Reuse + +**Issue found.** The file defines a custom `HasPositiveUpperDensity487` predicate (lines 44–46), but the codebase already provides a general-purpose density framework in `FormalConjecturesForMathlib/Data/Set/Density.lean`: + +- `Set.upperDensity` (line 51): computes the limsup of partial densities. +- `Set.HasPosDensity` (line 95): asserts positive density exists. + +Problem 109 (`FormalConjectures/ErdosProblems/109.lean:39`) uses `A.upperDensity > 0` directly, which is the idiomatic pattern in this codebase. The custom definition `HasPositiveUpperDensity487` is mathematically equivalent to `A.upperDensity > 0` (up to whether the counting starts at 0 or 1, which does not affect positivity of the limsup). It should be replaced to avoid redundancy. + +Additionally, `open Finset` (line 36) appears unused — the file only uses `Set.ncard`, not any Finset operations. It should be removed if the custom definition is dropped. + +## 2. Citations + +The formalization lists three references: + +- **[Er61]** Erdős, P., *Graph theory and probability. II*. Canad. J. Math. 13 (1961), p. 236. +- **[Er65b]** Erdős, P., *Extremal problems in number theory*. Proc. Sympos. Pure Math. 8 (1965), p. 228. +- **[Kl71]** Kleitman, D., *On a combinatorial conjecture of Erdős*. J. Combin. Theory Ser. A 1 (1971). + +**Issues:** + +1. **Kleitman citation inconsistency.** In `447.lean`, the Kleitman reference is cited as *"No four subsets forming an N"*, J. Combinatorial Theory Ser. A **5** (1968), 313–318, also under the tag [Kl71]. These are two different papers. Kleitman's paper *"On a combinatorial conjecture of Erdős"* appeared in J. Combin. Theory **1** (1966), 209–214 — not 1971 and not "Ser. A 1". The reference code [Kl71] and the journal details (volume 1, year 1971) do not match any known Kleitman publication. This citation needs verification and correction. + +2. **Missing related reference.** The website for Problem 487 mentions **[DaEr36]** (Davenport and Erdős), who showed the existence of infinite divisibility chains in sets of positive upper logarithmic density. While this is related work rather than a primary source, it provides valuable mathematical context and could be mentioned. + +## 3. Variants + +The website does not list any variants of this problem beyond the main statement. No variants are missing from the formalization. + +## 4. Readability + +The code is generally readable. Two improvements: + +1. **Use library definitions.** Replacing the custom density definition with `Set.upperDensity A > 0` (as in Problem 109) would make the statement immediately recognizable to anyone familiar with the codebase. + +2. **Nested existentials.** The conclusion `∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧ Nat.lcm a b = c` is clear and standard Lean style for this kind of statement. No issue here. + +## 5. Formalizability + +**Unambiguous.** The problem statement is precise: given a set of positive upper density in ℕ, assert the existence of three pairwise distinct elements whose lcm relationship holds. There is no ambiguity in the informal statement and the formalization captures it faithfully. + +The only minor subtlety is the use of ℕ (which includes 0 in Lean) versus the implicit convention of positive integers in the original problem. This is harmless: `Nat.lcm 0 b = 0`, so any triple involving 0 would require `a = 0` or `b = 0` with `c = 0`, violating the distinctness constraint `a ≠ c` or `b ≠ c`. Elements equal to 0 simply cannot participate in a valid triple, which matches the mathematical intent. + +## 6. Correctness + +**The formalization is mathematically correct**, with one caveat about the density definition. + +**Positive aspects:** +- The distinctness conditions (`a ≠ b ∧ a ≠ c ∧ b ≠ c`) correctly capture "distinct a, b, c" as pairwise inequality. This is important: if only `a ≠ b` were required, the problem would be trivially solvable whenever A contains a non-divisibility pair, since lcm(a,b) > max(a,b) when neither divides the other. The pairwise distinctness requirement ensures `c` is a *third* element of `A` equal to the lcm, which is the real substance of the conjecture. +- The `answer(True)` wrapper correctly reflects that the problem has been solved affirmatively (via Kleitman's resolution of Problem 447). +- The connection to Problem 447 (union-free families) is mathematically sound: via prime factorization, subsets of a finite set correspond to divisors of a squarefree number, and "union" of sets corresponds to "lcm" of numbers. Kleitman's bound on union-free families implies that lcm-free subsets of {1, …, N} have size at most (1 + o(1))·C(N, ⌊N/2⌋), which is o(N), hence density 0. + +**Caveat:** +- The custom density definition, while correct, differs syntactically from the library's `Set.upperDensity`. Although the two are equivalent (the difference between counting {1, …, N} vs {0, …, N−1} vanishes in the density limit), proving this equivalence would be an unnecessary proof obligation. Using the library definition directly avoids this entirely. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Custom density definition should be replaced with `Set.upperDensity` | +| Citations | Kleitman citation [Kl71] has incorrect journal/year details; consider adding [DaEr36] | +| Variants | Complete — no missing variants | +| Readability | Good; would improve with library density definition | +| Formalizability | Fully unambiguous | +| Correctness | Mathematically correct; no flaws in the formalization logic | diff --git a/ai-review/49.md b/ai-review/49.md new file mode 100644 index 0000000000..76ab65e690 --- /dev/null +++ b/ai-review/49.md @@ -0,0 +1,89 @@ +# AI Review: Erdos Problem 49 + +## 1. Code Reuse + +The formalization uses `Nat.totient` and `Nat.primeCounting` from Mathlib, which is appropriate. The range constraint pattern `(∀ x ∈ A, 1 ≤ x ∧ x ≤ n)` is consistent with other Erdos problems in the codebase (e.g., Problems 425, 793, 795). + +The strictly-increasing-on-A condition is written inline: +``` +∀ a ∈ A, ∀ b ∈ A, a < b → Nat.totient a < Nat.totient b +``` +Mathlib provides `StrictMonoOn`, which could express this as `StrictMonoOn (Nat.totient ·) ↑A`, but no other file in the project uses `StrictMonoOn` either. The inline form is consistent with project conventions and arguably more readable for non-experts. + +No existing code in `FormalConjecturesForMathlib/` is directly reusable for this problem. The `Data/Set/Density.lean` utilities (density, upper/lower density) are not needed here since the bound is expressed via ε-δ rather than asymptotic density. + +**Verdict**: No code reuse opportunities identified. Current approach is consistent with codebase conventions. + +## 2. Citations + +The formalization's docstring says only "Proved by Tao" without specific references. The [erdosproblems.com/49](https://www.erdosproblems.com/49) page lists: + +- **[Er95]** — Original Erdos source +- **[Er95c]** — Extended Erdos remarks (includes the non-strict variant) +- **[Ta23b]** — Tao's resolution + +**Recommendation**: The docstring should include the specific citation tags, e.g.: +> Proved by Tao [Ta23b]. See also [Er95], [Er95c]. + +This is especially important for [Er95c] which introduces a variant (see below). + +## 3. Variants + +The website describes several variants that are **not captured** by the formalization: + +1. **Weaker bound |A| = o(N)**: The original problem also asked whether |A| = o(N), which is a weaker (and presumably easier) claim than |A| ≤ (1+o(1))π(N). This could be stated as a separate lemma. + +2. **Divisor sum function σ(n)**: Erdos poses the analogous question for the sum-of-divisors function σ(n) instead of φ(n). This is a natural variant worth formalizing. + +3. **Non-strict inequality (from [Er95c])**: Erdos additionally asks about the case when φ(a₁) ≤ ··· ≤ φ(aₜ) (non-strict monotonicity). This variant changes the problem character significantly and is not captured. + +**Recommendation**: At minimum, add the σ(n) variant and the non-strict inequality variant. The weaker o(N) bound is subsumed by the main result but could be included as a corollary-style statement for completeness. + +## 4. Readability + +The formalization is clear and well-structured. The docstring accurately describes the mathematical content. Minor suggestions: + +- The module docstring could be slightly more precise: "The maximum size of a subset..." could specify "the maximum size of a subset A ⊆ {1,...,N} on which Euler's totient function is strictly increasing (with respect to the natural ordering on A)..." +- As noted, `StrictMonoOn Nat.totient ↑A` would be more concise but is a stylistic preference; the current form is arguably clearer. + +**Verdict**: Readability is good. No significant issues. + +## 5. Formalizability + +The problem is fully precise and unambiguously formalizable. The key concepts — Euler's totient function, strict monotonicity on a finite subset of naturals, the prime counting function, and the asymptotic upper bound expressed via ε-δ — all have clean formal counterparts. + +The only potential source of ambiguity in the original problem is the scope of "maximum size": whether the claim is about every such A (an upper bound) or about the supremum over all such A (an exact asymptotic). The formalization correctly captures the upper bound direction, which is the non-trivial content of the conjecture. The lower bound (π(N) ≤ max|A|) follows trivially from the fact that the primes form such a set (φ(p) = p − 1 is strictly increasing on primes). + +**Verdict**: No ambiguity. The problem is cleanly formalizable as stated. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**The ε-δ unfolding is correct.** The statement "|A| ≤ (1+o(1))π(N)" means: for every ε > 0, for all sufficiently large N, every valid A satisfies |A| ≤ (1+ε)·π(N). The formalization captures exactly this: +``` +∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N → ∀ A : Finset ℕ, ... → + (A.card : ℝ) ≤ (1 + ε) * (Nat.primeCounting N : ℝ) +``` +This is equivalent to saying sup{|A|} ≤ (1+o(1))π(N), since the quantifier over A is inside the "for large N" quantifier. + +**The monotonicity condition is correct.** The condition `∀ a ∈ A, ∀ b ∈ A, a < b → Nat.totient a < Nat.totient b` faithfully captures "φ is strictly increasing on A in the natural ordering," which is exactly A = {a₁ < ··· < aₜ} with φ(a₁) < ··· < φ(aₜ). + +**The range constraint is correct.** The condition `∀ x ∈ A, 1 ≤ x ∧ x ≤ N` correctly models A ⊆ {1,...,N}, excluding 0 (which is important since `Nat.totient 0 = 0` in Mathlib and could create spurious behavior). + +**One-sided vs. two-sided.** The formalization captures only the upper bound |A| ≤ (1+ε)π(N), not the matching lower bound. This is appropriate: the upper bound is the substance of the conjecture (and Tao's theorem), while the lower bound π(N) ≤ max|A| is trivial (the set of primes up to N witnesses it). A truly pedantic formalization of "the maximum is (1+o(1))π(N)" would include both directions, but the current approach correctly captures the mathematical content. + +**Tao's quantitative bound.** Tao actually proved the stronger bound |A| ≤ (1 + O((log log x)⁵ / log x))·π(x). The formalization captures the qualitative corollary, which is faithful to the problem as stated on erdosproblems.com. + +**Verdict**: The formalization is correct and complete for the main claim. No mathematical flaws identified. + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code reuse | OK | No reuse opportunities; consistent with conventions | +| Citations | Needs improvement | Missing [Er95], [Er95c], [Ta23b] reference tags | +| Variants | Incomplete | Missing σ(n) variant, non-strict variant [Er95c], weaker o(N) bound | +| Readability | Good | Clear and well-documented | +| Formalizability | Excellent | Unambiguous, cleanly formalizable | +| Correctness | Correct | Faithful to the mathematical content | diff --git a/ai-review/490.md b/ai-review/490.md new file mode 100644 index 0000000000..ff6c87959a --- /dev/null +++ b/ai-review/490.md @@ -0,0 +1,115 @@ +# AI Review: Erdős Problem 490 + +**File:** `FormalConjectures/ErdosProblems/490.lean` + +--- + +## 1. Code Reuse + +**Opportunity identified with Problem 425.** + +Problem 425 (`FormalConjectures/ErdosProblems/425.lean`) defines `IsMultB2`, which captures multiplicative Sidon sets — sets where all pairwise products `a * b` (with `a < b`) are distinct. The website for Problem 490 explicitly lists Problem 425 as related. + +Problem 490's `HasDistinctProducts A B` is a *bipartite* version of multiplicative distinctness (products from `A × B` are all distinct), while 425's `IsMultB2` is the *single-set* version (products from `A × A` with ordering). These are structurally different enough that separate definitions are justified, but a shared utility or comment cross-referencing the two would improve discoverability. + +Additionally, the additive analog `IsSidon` is defined in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 38). The existing `HasDistinctProducts` follows a similar 4-quantifier pattern to `IsSidon`, which is good for consistency. + +**No immediate code that can be directly reused**, but cross-references to Problem 425 and `IsSidon` would be beneficial. + +--- + +## 2. Citations + +**Website data** (from [erdosproblems.com/490](https://www.erdosproblems.com/490)): + +The website lists the following original source references: +- [Er61, p.237] +- [Er69, p.81] +- [Er72, p.81] +- [Er73, p.131] + +The formalization's docstring only cites: +> [Sz76] Szemerédi, E., *On the number of edges in products of sets of integers*. 1976. + +**Issue:** The Szemerédi citation [Sz76] is appropriate as the solver, but the original Erdős source references listed on the website ([Er61], [Er69], [Er72], [Er73]) are not included. These should be added to document the problem's origins, not just the solution. + +The website also mentions related problems **#425** and **#896**, which are not referenced in the current formalization. + +--- + +## 3. Variants + +**Missing variant identified.** + +The website describes an important related question posed by Erdős [Er72]: + +> Does the limit $\lim_{N\to \infty}\max_{A,B\subseteq [N]}\frac{|A||B|\log N}{N^2}$ exist (where the max is over $A, B$ with distinct products), and what is its value? If it exists, it must be $\geq 1$. + +This asks whether the constant in the bound is sharp and whether the limit exists, going beyond the mere upper bound proved by Szemerédi. This is a natural and important variant that is **not captured** by the current formalization. + +The website also notes the bound is **best possible**, demonstrated by the example $A = [1, N/2] \cap \mathbb{N}$ and $B = \{N/2 < p \leq N : p \text{ prime}\}$. A matching lower bound statement could also be formalized. + +--- + +## 4. Readability + +The code is generally clean and readable. A few suggestions: + +- **`HasDistinctProducts` definition:** The 4-quantifier style (`∀ a₁ ∈ A, ∀ b₁ ∈ B, ∀ a₂ ∈ A, ∀ b₂ ∈ B`) is clear and follows the pattern used by `IsSidon` and `IsMultB2` elsewhere. This is good. + +- **Subset constraint style:** The formalization uses `(∀ a ∈ A, 1 ≤ a ∧ a ≤ N)` to express $A \subseteq \{1, \ldots, N\}$. Many other problems in the codebase (e.g., 121, 126, 338, 425, 538) use `A ⊆ Finset.Icc 1 N` or equivalent. However, since `A` and `B` are `Finset ℕ` rather than subsets of `Finset.Icc 1 N`, the current approach is acceptable. Problem 425 uses the same style (`∀ x ∈ A, 1 ≤ x ∧ x ≤ N`), so this is consistent with related problems. + +- **Minor:** The `HasDistinctProducts` docstring correctly describes it as injectivity of the multiplication map $A \times B \to \mathbb{N}$. An alternative formalization using `Function.Injective` on the product map could be considered but would likely be less readable. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and straightforwardly formalizable.** + +The problem statement is precise: given finite subsets $A, B$ of $\{1, \ldots, N\}$ such that all products $ab$ are distinct, prove that $|A| \cdot |B| = O(N^2 / \log N)$. There is no ambiguity in: +- The domain ($\{1, \ldots, N\}$ as positive integers up to $N$) +- The distinctness condition (all products are different) +- The bound ($N^2 / \log N$ up to a constant) + +The only minor question is whether $\log$ means natural log or log base 2; this is irrelevant since they differ by a constant factor absorbed by $C$. The formalization correctly uses `Real.log` (natural log), which is fine. + +**Ambiguity level: None.** This is a clean, well-posed problem. + +--- + +## 6. Correctness + +**The formalization is mathematically correct with one subtle issue to note.** + +### What is correct: +- The `HasDistinctProducts` definition correctly captures that the map $(a, b) \mapsto ab$ is injective on $A \times B$. +- The bound $|A| \cdot |B| \leq C \cdot N^2 / \log N$ is the correct asymptotic statement. +- The existential quantification over `C > 0` correctly encodes the $\ll$ (big-O) notation. +- The problem is correctly marked as `solved` and attributed to Szemerédi. + +### Subtle issue — behavior at small N: +When $N = 0$ or $N = 1$, `Real.log (N : ℝ)` is $\leq 0$, making $N^2 / \log N$ negative or undefined (division by zero in reals, which Lean defines as 0). For $N = 0$: both sides are 0, so the inequality holds trivially. For $N = 1$: `Real.log 1 = 0`, so `N^2 / Real.log N = 1 / 0 = 0` in Lean's convention. But $A, B \subseteq \{1\}$ means $|A| \cdot |B| \leq 1$, and `C * 0 = 0`, so the inequality `|A| * |B| ≤ 0` would fail for nonempty $A, B$. This means any proof would need $C$ to work only for sufficiently large $N$, but the current statement quantifies over **all** $N$. + +**This is a genuine bug.** The statement should either: +1. Add a hypothesis `N ≥ 2` (or `N ≥ 3`, etc.), or +2. Reformulate as an asymptotic statement using filters (e.g., `∀ᶠ N in atTop, ...`), or +3. Use the bound `C * N^2 / max 1 (Real.log N)` to handle small cases. + +Without such a fix, the statement as written is **false** (there is no $C > 0$ that works for $N = 1$ with $A = B = \{1\}$, since `HasDistinctProducts {1} {1}` holds but `1 * 1 ≤ C * 0` fails). + +### `HasDistinctProducts` — stronger than necessary? +The definition requires $a_1 = a_2 \land b_1 = b_2$ when $a_1 b_1 = a_2 b_2$. This is injectivity of the *ordered pair* map, which is strictly stronger than just saying "all products are distinct" (which would only need that distinct pairs give distinct products, allowing $(a_1, b_1) \neq (a_2, b_2)$ to imply $a_1 b_1 \neq a_2 b_2$). However, these are logically equivalent statements, so this is fine — the definition is correct. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No direct reuse; cross-reference Problem 425 | +| Citations | Missing original Erdős references [Er61], [Er69], [Er72], [Er73] | +| Variants | Missing: existence of the limit $\lim |A||B|\log N / N^2$ | +| Readability | Good; consistent with codebase conventions | +| Formalizability | Unambiguous; straightforwardly formalizable | +| Correctness | **Bug**: statement is false for small $N$ (e.g., $N=1$) due to $\log N \leq 0$. Needs a lower bound on $N$ or an eventually-quantifier. | diff --git a/ai-review/491.md b/ai-review/491.md new file mode 100644 index 0000000000..7f86abcc32 --- /dev/null +++ b/ai-review/491.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 491 + +## 1. Code Reuse + +**Significant overlap with Problem 897.** The file `FormalConjectures/ErdosProblems/897.lean` contains `erdos_897.variants.log_growth` (lines 62–68), which formalizes the *same* Wirsing [Wi70] result. However, the two formalizations differ in several ways: + +| Aspect | Problem 491 | Problem 897 variant | +|--------|------------|---------------------| +| Additive function | Custom `IsAdditiveArithmeticFunction` using `Nat.Coprime a b` (no positivity guard) | Inline `∀ᵉ (a > 0) (b > 0), a.Coprime b → ...` | +| Bounded difference | `\|f (n+1) - f n\| < c` (strict) | `\|f (n+1) - f n\| ≤ C` (non-strict) | +| Conclusion | Two-sided: `\|f n - c' * Real.log n\| ≤ M` for all `n ≥ 1` | One-sided upper bound: `f n ≤ c * Real.log n + O n` with Mathlib `=O[Filter.atTop]` | + +The 491 formalization is **mathematically stronger and more correct** (two-sided bound matching the original O(1) claim). The 897 variant is strictly weaker (only an upper bound) and thus incomplete as a statement of Wirsing's theorem. These should ideally be unified — the shared `IsAdditiveArithmeticFunction` definition from 491 could be lifted to a shared utility, and 897's variant could reference 491 or be strengthened to match. + +Additionally, Problem 897 has a TODO comment (line 24): `-- TODO(lezeau): add ArithmeticFunction.IsAdditive to ForMathlib`. Mathlib already has `ArithmeticFunction.IsAdditive` in its API. If/when this is added to the ForMathlib imports, the custom `IsAdditiveArithmeticFunction` in 491 should be replaced. + +The `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean` file defines `≪` / `≫` notation for `IsBigO`. Problem 491 could potentially use Mathlib's `=O[Filter.atTop]` for the conclusion instead of the manual `∃ M, ∀ n, ... ≤ M` pattern, which would be more idiomatic. However, the current explicit formulation is arguably clearer and equivalent. + +## 2. Citations + +The website lists the following references for Problem 491: +- **[Er46], [Er61], [Er72], [Er82e]** (Erdős papers) +- **[Wi70]** Wirsing, E., *A characterization of log n as an additive arithmetic function*. Symposia Math. (1970), 45–47. + +The formalization only cites **[Wi70]** and omits the Erdős references. While [Wi70] is the key citation (it proves the result), the Erdős references provide historical context for the problem's origin. The docstring's citation of [Wi70] matches the website. + +**Related problems**: The website lists Problems **897** and **1122** as related. Neither is cross-referenced in 491's docstring. Problem 897 exists in the codebase and contains a variant of the same Wirsing result (see §1). Problem 1122 should be checked for existence and cross-referenced. + +## 3. Variants + +The website provides additional historical context that suggests variants not captured in the formalization: + +- **Erdős (1946)**: If $f(n+1) - f(n) = o(1)$, then $f(n) = c \log n$ for some constant $c$ (exact equality, not just O(1)). This stronger hypothesis gives a stronger conclusion — no O(1) error term. +- **Erdős (1946)**: If $f(n+1) \geq f(n)$ (monotone), then $f(n) = c \log n$. + +Neither of these classical results by Erdős is formalized as a variant of Problem 491. They would be natural additions, especially since they are historically important precursors to Wirsing's theorem. + +## 4. Readability + +The code is clean and readable. The custom definition `IsAdditiveArithmeticFunction` is well-documented with a docstring. The theorem statement is clear. + +Minor suggestions: +- The namespace `Erdos491` is fine but could optionally include a brief module-level comment noting the relationship to Problem 897. +- The docstring says "proved by Wirsing [Wi70]" which is helpful context. + +## 5. Formalizability + +The problem is **fully precise and unambiguously formalizable**. The statement "f(n) = c' log n + O(1)" has a single standard mathematical interpretation: there exist constants c' and M such that |f(n) - c' log n| ≤ M for all sufficiently large n. The formalization captures this correctly (using "for all n ≥ 1" rather than "for all sufficiently large n," which is equivalent since there are only finitely many n < 1 in ℕ). + +There is no meaningful ambiguity in the original problem statement. + +## 6. Correctness + +**Overall: Correct with minor observations.** + +### Strengths +- The two-sided bound `|f n - c' * Real.log (n : ℝ)| ≤ M` correctly captures the O(1) claim. +- The restriction `1 ≤ n` in the conclusion is necessary and correct since `Real.log 0 = 0` (by Lean/Mathlib convention) and the characterization is about the asymptotic behavior. +- The `answer(True)` wrapper correctly reflects that Wirsing proved this affirmatively. +- The use of `Real.log` (natural logarithm) is correct — the constant c' absorbs any base change. + +### Observations + +1. **Domain of the additive function**: The definition `IsAdditiveArithmeticFunction` applies to `f : ℕ → ℝ` without restricting to positive integers. Since `Nat.Coprime 0 b` holds iff `b = 1`, this forces `f(0 * 1) = f(0) + f(1)`, i.e., `f(0) = f(0) + f(1)`, hence `f(1) = 0`. This is the standard convention for additive arithmetic functions, so this is correct. However, it means `f(0)` is unconstrained by the additive property (it is only indirectly constrained by the bounded difference hypothesis via `|f(1) - f(0)| < c`). In contrast, Problem 897 explicitly restricts to `a > 0, b > 0`, which avoids reasoning about 0. Both approaches are mathematically sound for the theorem as stated. + +2. **Strict vs. non-strict inequality**: The hypothesis uses `|f(n+1) - f n| < c` (strict), matching the original problem's "$|f(n+1) - f(n)| < c$." This is correct. Note that the 897 variant uses `≤ C` (non-strict), which is also fine mathematically (the two are equivalent by adjusting the constant). Consistency across the codebase would be preferable. + +3. **Universal vs. eventual bound**: The conclusion asserts the bound for *all* `n ≥ 1`, not just for sufficiently large n. This is actually a stronger statement than "for sufficiently large n" and is indeed what Wirsing proved — the O(1) bound holds globally, not just eventually. This is correct. + +4. **No issues with `Real.log` at specific values**: `Real.log 1 = 0`, so at `n = 1` the conclusion reduces to `|f 1| ≤ M`. Since `f(1) = 0` (forced by the additive property, as noted above), this is trivially satisfied for any `M ≥ 0`. No edge case issues. + +### Verdict + +The formalization is **mathematically correct and complete** as a statement of Erdős Problem 491 / Wirsing's theorem. The primary recommendations are: +- Unify with or cross-reference Problem 897's duplicate variant. +- Consider adding the classical Erdős (1946) precursor results as variants. +- Add missing Erdős references [Er46], [Er61], [Er72], [Er82e] to the docstring. diff --git a/ai-review/492.md b/ai-review/492.md new file mode 100644 index 0000000000..7a0d75feb5 --- /dev/null +++ b/ai-review/492.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 492 + +## 1. Code Reuse + +**Significant overlap with `Equidistribution.lean`.** The file `FormalConjectures/Books/UniformDistributionOfSequences/Equidistribution.lean` (lines 41–44) defines a general `IsEquidistributed` for sequences on an interval `[a, b]`, and `IsEquidistributedModuloOne` (lines 51–52) specializes it via `Int.fract`. Problem 492 redefines its own `IsEquidistributed` (lines 42–46) locally. + +| Aspect | Problem 492 | Equidistribution.lean | +|--------|------------|----------------------| +| Interval type | Half-open `[c, d)` via `c ≤ x n ∧ x n < d` | Closed `[c, d]` via `Set.Icc` | +| Domain | `[0, 1)` (implicit from constraints `0 ≤ c`, `d ≤ 1`) | General `[a, b]` | +| Limit target | `d - c` | `(d - c) / (b - a)` | + +The half-open interval choice in 492 is arguably **more correct** for this problem, since `fractionalPosition` maps into `[0, 1)` and equidistribution on half-open intervals is the standard formulation. The `Equidistribution.lean` version uses closed `[c, d]`, which is subtly different (it includes endpoints, which doesn't affect the limit but is less standard for mod-1 equidistribution). These cannot be directly unified without choosing one convention, but the 492 version is better suited to this problem. + +**Related discrepancy/counting patterns.** Several other Erdős problems duplicate the "count elements of a sequence in a subinterval" pattern: +- Problem 992 (`992.lean`, lines 45–49): `discrepancy` for fractional-part sequences +- Problem 255 (`255.lean`, lines 39–40): general `discrepancy` for sequences in `[0, 1]` +- Problem 994 (`994.lean`, lines 38–43): `cesaroFrequency` for fractional parts +- Problem 998 (`998.lean`, lines 40–42): `countFracInInterval` + +A shared utility for "proportion of sequence terms in a subinterval" would reduce duplication across all of these. + +## 2. Citations + +The website lists the following for Problem 492: + +- **Schmidt (1969)**: Disproved the conjecture. The formalization cites this as [Sc69]: *Irregularities of distribution. IV*, Invent. Math. 7 (1969), 55–82. This matches the website. + +**Missing partial results from the website:** +- **Le Veque (1953)**: Proved the statement in special cases. +- **Davenport and LeVeque (1963)**: Proved it assuming $a_n - a_{n-1}$ is monotonic. +- **Davenport and Erdős (1963)**: Proved it true when $a_n \gg n^{1/2+\varepsilon}$ for some $\varepsilon > 0$. + +These are not cited in the docstring. While Schmidt's paper is the key citation (it resolves the problem), the partial positive results provide important context and could motivate formalized variants. + +## 3. Variants + +The formalization captures only the disproved universal statement. The website describes three positive partial results that could be formalized as variants: + +1. **Le Veque's special cases (1953)** — would require identifying which special cases were proved. +2. **Davenport–LeVeque monotone differences (1963)**: If $a_{n+1} - a_n$ is monotone and $a_{n+1}/a_n \to 1$, then for almost all $\alpha$, $f(\alpha n)$ is equidistributed. This is a clean, formalizable strengthening of the hypothesis. +3. **Davenport–Erdős growth condition (1963)**: If $a_n \gg n^{1/2+\varepsilon}$, the conjecture holds. Also cleanly formalizable. + +None of these variants are currently captured. The Davenport–LeVeque and Davenport–Erdős results are natural candidates. + +## 4. Readability + +The code is well-structured and readable. The `fractionalPosition` definition is clearly documented with a docstring explaining the mathematical intent. The main theorem's docstring provides the problem statement, an illustrative example ($A = \mathbb{N}$ gives the fractional part), and the resolution. + +Minor suggestions: +- The docstring references "[Sc69]" in shorthand. The full bibliographic entry appears in the module docstring but could be repeated or cross-referenced more explicitly in the theorem docstring. +- The `attribute [local instance] Classical.propDecidable` on line 35 is standard boilerplate but could benefit from a brief comment for readers unfamiliar with the convention. + +## 5. Formalizability + +The problem is **precise and formalizable**. The function $f$ is explicitly defined, the condition $a_{i+1}/a_i \to 1$ is unambiguous, and "uniformly distributed" / "equidistributed" has a standard definition. There is no meaningful ambiguity in the original problem statement. + +The only minor interpretive question is what "almost all $\alpha$" means — in context, this universally means "Lebesgue-almost every $\alpha$," which is what the formalization uses. The domain of $\alpha$ (all reals vs. positive reals) is discussed under Correctness below. + +## 6. Correctness + +**Overall: Correct in its answer but with a significant domain issue that makes the statement trivially false.** + +### Critical Issue: Domain of $\alpha$ + +The formalization quantifies over all real $\alpha$: +``` +∀ᵐ α ∂(volume : Measure ℝ), IsEquidistributed (fun n => fractionalPosition a (α * (n : ℝ))) +``` + +For any $\alpha \leq 0$, the values $\alpha \cdot n$ are non-positive for all $n \geq 0$. Since `StrictMono a` and `∀ i, 0 < a i` ensure $a_0 \geq 1$, we have $\alpha \cdot n < a_0$ for all $n$, so `fractionalPosition` returns $0$ for every $n$. A constant-zero sequence is not equidistributed, so equidistribution fails for **all** $\alpha \leq 0$. + +The set $(-\infty, 0]$ has infinite Lebesgue measure, so the `∀ᵐ` quantifier fails trivially — the exceptional set is not measure-zero. This means the universal statement `∀ a, ... → ∀ᵐ α ∂volume, ...` is **trivially false for every sequence $a$**, not just for Schmidt's counterexample. + +The `answer(False)` is technically correct (the statement is indeed false), but the falsity is for a trivial reason unrelated to Schmidt's result. The original problem intends "almost all $\alpha > 0$." The fix would be to replace `∀ᵐ α ∂(volume : Measure ℝ)` with `∀ᵐ α ∂(volume.restrict (Set.Ioi 0))` (or equivalently restrict to positive reals). + +### Other Observations + +1. **0-indexing vs. 1-indexing**: The problem uses $\{a_1 < a_2 < \cdots\}$ (1-indexed), while the Lean code uses `a : ℕ → ℕ` (0-indexed). This is standard and does not affect correctness. + +2. **n = 0 in the sequence**: `Finset.range N` includes $n = 0$. For $n = 0$, $\alpha \cdot 0 = 0 < a_0$, so `fractionalPosition` returns 0. This adds one "junk" term to the sequence, but a single term does not affect the asymptotic proportion, so it does not impact equidistribution. This is a minor inelegance rather than an error. + +3. **`fractionalPosition` well-definedness**: Since `a` is strictly increasing, the intervals $[a_i, a_{i+1})$ are disjoint, so at most one $i$ satisfies $a_i \leq x < a_{i+1}$. The use of `Nat.find` to select the smallest such $i$ is therefore correct — it always returns the unique valid $i$ when one exists. + +4. **Ratio condition `a_{i+1}/a_i → 1`**: This is correctly formalized as `Tendsto (fun i => (a (i + 1) : ℝ) / (a i : ℝ)) atTop (nhds 1)`. The cast to `ℝ` ensures proper division, and the positivity of all terms ensures the ratio is well-defined. + +5. **`IsEquidistributed` definition**: The half-open interval formulation `c ≤ x n ∧ x n < d` is correct for equidistribution on $[0, 1)$. The constraints `0 ≤ c`, `c < d`, `d ≤ 1` correctly restrict to subintervals of $[0, 1]$. (Note: the upper bound is `d ≤ 1`, not `d < 1`, which means the full interval $[0, 1)$ is included when $c = 0, d = 1$ — this is correct.) + +### Verdict + +The formalization is **mathematically correct in its answer** (`answer(False)`) but **captures the wrong reason for falsity**. As stated, the conjecture is trivially false because negative $\alpha$ values always fail equidistribution, making the `∀ᵐ` quantifier fail for any sequence $a$ — not just Schmidt's counterexample. The primary recommendation is to restrict $\alpha$ to positive reals so that the falsity is non-trivial and genuinely reflects Schmidt's 1969 result. Additionally: +- Add the missing partial positive results (Davenport–LeVeque, Davenport–Erdős) as variants. +- Add the missing citations from the website. diff --git a/ai-review/493.md b/ai-review/493.md new file mode 100644 index 0000000000..399c9bcdbf --- /dev/null +++ b/ai-review/493.md @@ -0,0 +1,121 @@ +# AI Review: Erdős Problem 493 + +**File:** `FormalConjectures/ErdosProblems/493.lean` + +--- + +## 1. Code Reuse + +**No significant reuse opportunities identified.** The formalization uses standard Mathlib `BigOperators` (`∏`, `∑`) over `Fin k → ℤ`, which is the natural and idiomatic approach. No custom utility definitions are introduced, and nothing in `FormalConjecturesForMathlib/` provides infrastructure specific to product-minus-sum representations. + +The `Finset` and `BigOperators` opens are appropriate and minimal. + +--- + +## 2. Citations + +**Website data** (from [erdosproblems.com/493](https://www.erdosproblems.com/493)): + +- **Attribution:** The problem is attributed to Schinzel. +- **Reference:** [Er61, p.238] +- **Solution:** Eli Seamans observed the answer is yes with $k = 2$: $n = 2(n+2) - (2 + (n+2))$. +- **Important caveat from website:** "There may well have been some additional constraint in the problem as Schinzel posed it," but the reference [Er61] does not document what this constraint might be. +- **Thanks:** Eli Seamans + +The formalization's docstring correctly: +- Attributes the problem to Schinzel. +- References `erdosproblems.com/493`. +- Includes the $k = 2$ solution by Eli Seamans. + +**Missing:** The original Erdős source reference **[Er61, p.238]** is not cited in the docstring. It should be added for completeness. Additionally, the solver Eli Seamans is not credited by name in the docstring (only the solution idea is included). + +--- + +## 3. Variants + +**No variants are formalized, and the website does not list explicit variants.** However, the website's note that "there may well have been some additional constraint in the problem as Schinzel posed it" is highly significant. The problem as stated is trivially solved (see §6), which strongly suggests the original problem was more constrained. + +Natural candidates for additional constraints that would make the problem non-trivial include: +- Requiring all $a_i$ to be **distinct**. +- Requiring all $a_i$ to be **prime**. +- Requiring $k$ to be **fixed in advance** (not just existential) with a specific small value, combined with additional restrictions. +- Requiring $a_i \leq f(n)$ for some bounding function. + +Since the original constraint is lost to history, it is difficult to formalize variants with confidence. However, the docstring or module comment should at minimum note the website's caveat about possible missing constraints, as this is important mathematical context. + +--- + +## 4. Readability + +The code is clean and concise. At 47 lines (including license header), it is easy to read and understand. Specific observations: + +- The theorem statement is well-structured: existential $k$, existential threshold $N$, universal quantification over sufficiently large $n$, then the representation condition. +- The use of `Fin k → ℤ` for the sequence of $a_i$ values is idiomatic. +- The `BigOperators` notation `∏ i : Fin k, a i` and `∑ i : Fin k, a i` is clear and standard. +- The docstring includes both the problem statement and the known solution, which is helpful context. + +**No readability improvements needed.** + +--- + +## 5. Formalizability + +**Assessment: The problem as stated is unambiguous and trivially formalizable — but this triviality is itself a red flag.** + +The mathematical content is completely precise: +- "Integers $a_i \geq 2$" — clear domain and constraint. +- "$\prod_i a_i - \sum_i a_i$" — well-defined arithmetic expression. +- "Every sufficiently large integer" — standard meaning (∃ N, ∀ n ≥ N). +- "Does there exist a $k$" — existential quantification over the number of terms. + +**Ambiguity level: None in the formalized statement, but significant historical ambiguity.** The problem as written in [Er61] appears to be missing a constraint that Schinzel originally intended. The website explicitly flags this. The formalization correctly captures what is written, but the mathematical community suspects the "real" problem is different and harder. This is an inherent limitation of the source material, not a flaw in the formalization. + +--- + +## 6. Correctness + +**The formalization is mathematically correct as a statement of the problem as it appears on the website.** + +### Verification of the claimed solution + +The docstring claims the answer is `True` with $k = 2$: for any integer $n$, $n = 2 \cdot (n+2) - (2 + (n+2))$. + +Checking: $2 \cdot (n+2) - (2 + (n+2)) = 2n + 4 - n - 4 = n$. ✓ + +For this to be a valid representation, we need $a_1 = 2 \geq 2$ ✓ and $a_2 = n + 2 \geq 2$, i.e., $n \geq 0$. So the representation works for all $n \geq 0$, meaning $N = 0$ suffices. + +### Structural correctness + +- **`answer(True)`**: Correct — the answer to the existential question is yes. +- **`∃ k : ℕ`**: Correct type. The solution uses $k = 2$. +- **`∃ N : ℤ`**: Correct — the threshold is an integer. Using ℤ rather than ℕ is slightly more general but harmless. +- **`∀ n : ℤ, n ≥ N →`**: Correct encoding of "every sufficiently large integer." +- **`∃ a : Fin k → ℤ, (∀ i, a i ≥ 2)`**: Correct — a tuple of $k$ integers, each ≥ 2. +- **`(∏ i : Fin k, a i) - (∑ i : Fin k, a i) = n`**: Correct — product minus sum equals the target. + +### Edge cases + +- **$k = 0$**: `Fin 0 → ℤ` is the empty function. The empty product is 1 and the empty sum is 0, so this can only represent $n = 1$. This is fine — the existential over $k$ allows choosing larger values. +- **$k = 1$**: A single $a \geq 2$ gives $a - a = 0$, so this can only represent $n = 0$. Again fine. +- **Negative $n$**: The statement allows $N$ to be any integer, so negative values of $n$ can be excluded by choosing $N \geq 0$. The solution with $k = 2$ naturally requires $n \geq 0$. + +### Potential concern: trivial solvability + +The problem as formalized is trivially true, requiring only the algebraic identity $n = 2(n+2) - (2 + (n+2))$. This is mathematically correct but raises the question of whether the formalization captures the intended mathematical content. As discussed in §3 and §5, the website itself notes that the original problem likely had additional constraints. The formalization is faithful to what is recorded, but this context should be documented. + +### Verdict + +The formalization is **mathematically correct and complete** as a statement of Erdős Problem 493 as it appears in the available sources. No bugs or edge-case issues exist. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities; standard Mathlib infrastructure suffices | +| Citations | Missing original reference [Er61, p.238]; solver Eli Seamans not credited by name | +| Variants | None formalized; website notes possible missing constraints from original problem | +| Readability | Excellent; clean and concise | +| Formalizability | Unambiguous as stated, but historical ambiguity about intended constraints | +| Correctness | **Correct.** Solution verified. No edge-case issues. The trivial solvability reflects the problem as recorded, not a formalization error. | diff --git a/ai-review/496.md b/ai-review/496.md new file mode 100644 index 0000000000..fdb2dbe33a --- /dev/null +++ b/ai-review/496.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 496 + +## 1. Code Reuse + +Several codebase patterns are relevant but none directly reusable for the core statement: + +- **`distNearestInt`** defined in `FormalConjectures/ErdosProblems/495.lean` and `FormalConjectures/Wikipedia/LittlewoodConjecture.lean` is not needed here since problem 496 uses a raw absolute value expression rather than distance-to-nearest-integer. +- **`Irrational` type** from Mathlib is already used correctly, matching patterns in Erdős 354, 464, 997, and others. +- **Existential-with-positivity pattern** (`∃ x y z : ℕ, 0 < x ∧ 0 < y ∧ 0 < z ∧ |expr| < ε`) is a common idiom across the codebase (e.g., Erdős 464–466). The current formalization follows this convention well. +- No utilities in `FormalConjecturesForMathlib/` address quadratic forms or the Oppenheim conjecture specifically. + +**Verdict:** No significant code reuse opportunities. The formalization is already minimal and self-contained. + +## 2. Citations + +The website (erdosproblems.com/496) lists the following references: +- **[Er61]** — Original Erdős source posing the problem. +- **[DaHe46]** — Davenport and Heilbronn (1946), who addressed an analogous problem for quadratic forms in five variables. +- **[Ma89]** — Margulis (1989), who proved the result as a consequence of the Oppenheim conjecture. + +The formalization's docstring mentions: +> "This was proved by Margulis (1989) as a consequence of the Oppenheim conjecture." + +**Issue:** The docstring references Margulis correctly but omits Davenport–Heilbronn's earlier related work [DaHe46] and the original Erdős reference [Er61]. These are documented on the website and should at minimum be noted. Consider expanding the module docstring to: + +``` +Erdős asked whether for every irrational α and every ε > 0 there exist positive integers x, y, z +with |x² + y² − z²α| < ε. An analogous result for quadratic forms in five variables was proved +by Davenport and Heilbronn (1946). The full result was proved by Margulis (1989) as a consequence +of the Oppenheim conjecture. +``` + +## 3. Variants + +The website mentions the broader context of the **Oppenheim conjecture** (now theorem), which concerns indefinite non-degenerate quadratic forms in n ≥ 3 variables that are not proportional to rational forms. The Oppenheim conjecture states that such forms take values arbitrarily close to zero at integer points. Problem 496 is a specific instance with the diagonal form Q(x, y, z) = x² + y² − αz². + +**Possible variants not captured:** +1. **General Oppenheim conjecture:** For any indefinite irrational quadratic form Q in n ≥ 3 variables, the image Q(ℤⁿ \ {0}) is dense in ℝ. The current formalization only captures the specific form x² + y² − αz². +2. **Density of values:** Margulis's result actually proves the stronger statement that the values of such forms at integer points are *dense* in ℝ, not merely that they come within ε of zero. The current formalization only asks for approximation to zero. +3. **Quantitative bounds:** Eskin–Margulis–Mozes (1998) proved quantitative versions giving counting estimates for lattice points where |Q(v)| < δ. + +**Assessment:** The formalization correctly captures the specific question Erdős asked. The broader Oppenheim conjecture and density result could be separate formalizations. The current scope is appropriate for this problem number. + +## 4. Readability + +The formalization is clean and readable. Minor observations: + +- The casting pattern `((x : ℝ) ^ 2 + (y : ℝ) ^ 2 - (z : ℝ) ^ 2 * α)` is adequate but slightly verbose. An alternative might be to cast once via auxiliary variables or use `(x ^ 2 + y ^ 2 - z ^ 2 * α : ℝ)` if Lean's coercion can handle the natural number powers — though the explicit casts may be necessary for type-correctness and are standard practice in this codebase. +- The parenthesization `|((x : ℝ) ^ 2 + (y : ℝ) ^ 2 - (z : ℝ) ^ 2 * α)|` has an extra layer of parentheses inside the absolute value. This could be simplified to `|(x : ℝ) ^ 2 + (y : ℝ) ^ 2 - (z : ℝ) ^ 2 * α|` if it parses correctly. + +**Verdict:** Highly readable overall. No substantive issues. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is precise and unambiguous: +- "Irrational α" is well-defined. +- "Positive integers x, y, z" is clear. +- The expression |x² + y² − z²α| < ε is an explicit algebraic inequality. + +There is **no ambiguity** in the statement. It is a clean existential claim with concrete algebraic content. This is one of the most straightforwardly formalizable problem types. + +**Assessment: Fully formalizable, no ambiguity.** The Lean statement directly mirrors the mathematical statement. + +## 6. Correctness + +**The formalization is mathematically correct.** Checking each component: + +- **`Irrational α`**: Correctly requires α to be irrational. If α were rational, say α = p/q, then x² + y² − z²α = x² + y² − z²p/q, and finding integer solutions making this small would be trivial (take x = y = z and scale), so the irrationality condition is essential for the problem to be non-trivial. ✓ +- **`ε > 0`**: Standard. ✓ +- **`∃ x y z : ℕ, 0 < x ∧ 0 < y ∧ 0 < z`**: Correctly requires *positive* integers, not just non-negative. If zero were allowed, x = y = z = 0 would trivially satisfy the bound. ✓ +- **`|((x : ℝ) ^ 2 + (y : ℝ) ^ 2 - (z : ℝ) ^ 2 * α)| < ε`**: The expression x² + y² − z²α matches the problem statement. The absolute value is necessary since the expression can be negative. ✓ + +**One subtle point worth verifying:** The operator precedence in `(z : ℝ) ^ 2 * α`. In standard math, z²α means (z²)(α), and in Lean `^` binds tighter than `*`, so `z ^ 2 * α` correctly computes (z²) · α. ✓ + +**Potential concern about the broader mathematical context:** The Oppenheim conjecture (as proved by Margulis) actually shows that the set of values {Q(v) : v ∈ ℤ³, v ≠ 0} is dense in ℝ for any indefinite irrational ternary quadratic form Q. The form Q(x,y,z) = x² + y² − αz² is indefinite when α > 0 (it takes both positive and negative values) and is not proportional to a rational form precisely when α is irrational. However, when α < 0, the form x² + y² − αz² = x² + y² + |α|z² is *positive definite*, and Oppenheim's conjecture does not apply. + +**This is not a bug in the formalization.** Even when α < 0 (so the form is positive definite), the claim is still true: since x² + y² + |α|z² takes arbitrarily large positive values, and by Diophantine approximation arguments one can still find x, y, z making it close to any target. More precisely, for α < 0 irrational, one can approximate |α| ≈ (x² + y²)/z² by choosing z and then finding x, y to get x² + y² close to |α|z². The statement as given (for all irrational α) is correct. + +**Verdict: Correct and complete.** The formalization faithfully captures Erdős Problem 496 as stated. No mathematical flaws detected. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No significant opportunities; already minimal | +| Citations | Davenport–Heilbronn [DaHe46] and original Erdős [Er61] references should be mentioned | +| Variants | Broader Oppenheim conjecture and density results not captured, but appropriately scoped | +| Readability | Clean and readable; minor parenthesization could be simplified | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | **Correct and complete** | diff --git a/ai-review/497.md b/ai-review/497.md new file mode 100644 index 0000000000..4a68583207 --- /dev/null +++ b/ai-review/497.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 497 + +## 1. Code Reuse + +The formalization correctly uses Mathlib's `IsAntichain` predicate from `Mathlib.Order.Antichain` rather than defining a custom one. This is the right approach — notably, Problem 776 (`FormalConjectures/ErdosProblems/776.lean:35`) defines its own `IsAntichain` for `Finset (Finset ℕ)` instead of using Mathlib's, which is a pattern to avoid. Problem 497 does not have this issue. + +The `Fintype.card` with a subtype pattern for counting combinatorial structures is standard and consistent with similar definitions in the codebase (e.g., Problem 719, Problem 500). + +No existing utility in `FormalConjecturesForMathlib/` directly provides a `dedekindNumber` or related definition, so the local definition is appropriate. + +**Verdict:** Good code reuse. No improvements needed. + +## 2. Citations + +The website ([erdosproblems.com/497](https://www.erdosproblems.com/497)) lists the following references: +- **[Er61]** — The original problem source (Erdős, 1961). +- **[Kl69]** — Kleitman, D., *On Dedekind's Problem: The Number of Monotone Boolean Functions*. Proc. Amer. Math. Soc. 21 (1969), 677–682. + +The formalization cites [Kl69] with full bibliographic details, which is correct. However, the original source **[Er61]** is not cited. Since the website attributes the problem origin to [Er61], it should be included in the docstring for completeness. + +**Recommendation:** Add `[Er61]` to the references in the module docstring, e.g.: +``` +[Er61] Erdős, P. (1961). (original problem source) +[Kl69] Kleitman, D., ... +``` + +## 3. Variants + +The website does not list any additional variants beyond the main asymptotic result. The formalization captures the single main statement (Kleitman's asymptotic for the Dedekind number). The website notes a connection to OEIS sequence A000372 (Dedekind numbers), but this is informational rather than a distinct conjecture. + +One could consider formalizing bounds or exact small values of D(n), but the website does not present these as separate problems or variants. + +**Verdict:** All stated variants are captured. No missing variants. + +## 4. Readability + +The code is well-structured and readable: +- The `dedekindNumber` definition has a clear docstring explaining what it counts. +- The theorem docstring explains the connection to Sperner's theorem and Kleitman's result. +- The namespace `Erdos497` keeps definitions scoped. +- The `open Finset Filter` is appropriate for the operations used. + +Minor suggestion: The docstring says "How many antichains in $[n]$ are there?" but the formalization works over `Fin n` (i.e., $\{0, \ldots, n-1\}$), not $[n] = \{1, \ldots, n\}$. This is mathematically equivalent but could be noted for precision. + +**Verdict:** Good readability. Minor docstring clarification possible. + +## 5. Formalizability + +The problem is highly formalizable. The statement is precise: +- "Antichain in the power set" has a standard mathematical definition. +- The asymptotic $D(n) = 2^{(1+o(1))\binom{n}{\lfloor n/2 \rfloor}}$ translates cleanly to a limit statement. + +There is no ambiguity in the problem statement. The notion of antichain under subset ordering is completely standard, and the asymptotic equivalence is a well-defined analytic statement. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed verification: + +**Definition of `dedekindNumber`:** +```lean +Fintype.card {F : Finset (Finset (Fin n)) // IsAntichain (· ⊆ ·) (F : Set (Finset (Fin n)))} +``` +This counts all families F of subsets of Fin n such that F forms an antichain under ⊆. This correctly captures the Dedekind number D(n), including the empty antichain (which is standard). The `open Classical in` ensures decidability for the `noncomputable def`, which is appropriate. + +**Theorem statement:** +```lean +Tendsto (fun n => Real.log (dedekindNumber n) / (Real.log 2 * (n.choose (n / 2)))) atTop (nhds 1) +``` + +Translating: this says $\frac{\ln D(n)}{\ln 2 \cdot \binom{n}{\lfloor n/2 \rfloor}} \to 1$, which is equivalent to $\frac{\log_2 D(n)}{\binom{n}{\lfloor n/2 \rfloor}} \to 1$, which is exactly the statement that $D(n) = 2^{(1+o(1))\binom{n}{\lfloor n/2 \rfloor}}$. + +- `Real.log` is the natural logarithm in Mathlib. ✓ +- `n / 2` is natural number floor division, giving $\lfloor n/2 \rfloor$. ✓ +- `n.choose (n / 2)` is $\binom{n}{\lfloor n/2 \rfloor}$, the central binomial coefficient (or near-central for odd n). ✓ +- The limit target `nhds 1` is correct. ✓ + +**Edge case:** For small n, `dedekindNumber n` is well-defined and positive (at minimum the empty antichain exists), and `n.choose (n/2)` is positive, so the ratio is well-defined for all n ≥ 1. For n = 0, the denominator is `0.choose 0 = 1` and `dedekindNumber 0 = 1` (only the empty family), so `log(1) / (log(2) * 1) = 0`, which is fine for the limit — it only needs to converge eventually. + +**Verdict:** The formalization is correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ Good — uses Mathlib's `IsAntichain` correctly | +| Citations | ⚠️ Minor — missing [Er61] original source reference | +| Variants | ✅ Complete — no missing variants | +| Readability | ✅ Good — clear docstrings and structure | +| Formalizability | ✅ Fully formalizable, no ambiguity | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/498.md b/ai-review/498.md new file mode 100644 index 0000000000..5bd96e863e --- /dev/null +++ b/ai-review/498.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 498 + +## 1. Code Reuse + +**Issue found.** Problem 395 (`FormalConjectures/ErdosProblems/395.lean`) defines an identical helper function `Erdos395.signedSum` at line 39: + +```lean +noncomputable def signedSum {n : ℕ} (z : Fin n → ℂ) (ε : Fin n → Bool) : ℂ := + ∑ i : Fin n, (if ε i then (1 : ℂ) else (-1 : ℂ)) * z i +``` + +This is character-for-character the same as `Erdos498.signedSum498` (line 44 of 498.lean). The two problems are directly related—498 is the classical Littlewood–Offord problem and 395 is the reverse Littlewood–Offord problem—so sharing a single definition would be natural. A shared `signedSum` could be factored into a common utility or one problem could import the other's namespace. + +Problem 525 (Littlewood polynomials) also uses the same `Fin n → Bool` sign-vector encoding with a similar filtering-and-counting pattern, further supporting the case for a shared definition. + +## 2. Citations + +The website ([erdosproblems.com/498](https://www.erdosproblems.com/498)) lists four references: + +| Tag | Present in formalization? | +|------|--------------------------| +| [Er45] Erdős (1945) | Yes | +| [Er61] Erdős (1961) | **No — missing** | +| [Kl65] Kleitman (1965) | Yes | +| [Kl70] Kleitman (1970) | Yes | + +**[Er61] is missing.** The website lists a 1961 Erdős publication as a reference for this problem. The formalization's docstring should include it for completeness. + +The website also lists Problem 395 under "See also," which is consistent with the thematic link but is not cross-referenced in the 498 docstring. A brief mention would aid discoverability. + +## 3. Variants + +The formalization captures the complex-number case, which subsumes Erdős's original real-number result [Er45]. This is appropriate since the complex case is the natural generality at which Kleitman [Kl65] proved the result. + +Kleitman [Kl70] later generalized the theorem to **arbitrary (real) Hilbert spaces**: for vectors $v_1, \ldots, v_n$ in a Hilbert space with $\|v_i\| \geq 1$, the same $\binom{n}{\lfloor n/2 \rfloor}$ bound holds for any closed ball of radius 1. This stronger variant is mentioned in the docstring but is not formalized. A Hilbert-space variant could be stated generically over `InnerProductSpace ℝ E` and would be a natural companion theorem. Its absence is understandable (the complex case is the most commonly cited form), but it is worth noting as an unformalised variant. + +No other variants appear on the website. + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- The helper is named `signedSum498` with a numeric suffix to avoid namespace collisions. If a shared definition is introduced (see §1), this ad-hoc suffix becomes unnecessary. Within the `Erdos498` namespace, a plain `signedSum` would suffice (as Problem 395 already does). +- The use of `open Finset BigOperators` (line 38) mixes a namespace open with a scoped open. Problem 395 uses the more precise `open Finset` / `open scoped BigOperators` on separate lines. Consistency with the rest of the codebase would favor the two-line form, though both compile. +- The docstring is thorough and includes a good informal mathematical description of the statement. + +## 5. Formalizability + +**High.** The problem statement is entirely precise: + +- The inputs ($n$ complex numbers with norm $\geq 1$) are unambiguous. +- The quantity being bounded (number of sign patterns $\varepsilon \in \{-1,1\}^n$ such that the signed sum lands in a given closed unit disc) is combinatorially exact. +- The bound $\binom{n}{\lfloor n/2 \rfloor}$ is a concrete numerical quantity. + +There is essentially no ambiguity. The only minor choice is whether to use a closed disc ($\leq 1$) or an open disc ($< 1$); the formalization uses the closed disc, which is standard and matches the tight example (all $z_i = 1$, disc centered at 0). This is the correct choice. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed check: + +- **Hypothesis** `hz : ∀ i, 1 ≤ ‖z i‖` correctly encodes $|z_i| \geq 1$ using the complex norm `‖·‖`. +- **Sign encoding**: `Fin n → Bool` bijects with $\{-1,1\}^n$ via `true ↦ +1`, `false ↦ -1`. The total number of sign patterns is $2^n = |\text{Fin } n \to \text{Bool}|$, which is correct. +- **Signed sum**: `signedSum498 z ε = ∑ i, (if ε i then 1 else -1) * z i` correctly computes $\sum_{i=1}^n \varepsilon_i z_i$. +- **Disc condition**: `‖signedSum498 z ε - w‖ ≤ 1` is the closed ball of radius 1 centered at $w$. This matches the problem statement ("arbitrary disc of radius 1"). +- **Bound**: `n.choose (n / 2)` in Lean uses natural number floor division, so `n / 2 = ⌊n/2⌋`. Thus the bound is $\binom{n}{\lfloor n/2 \rfloor}$, which is correct. +- **Tightness sanity check**: When all $z_i = 1$ and $n$ is even, the signed sums are $\{n - 2k : k = 0, \ldots, n\}$. The disc of radius 1 centered at 0 captures only the value 0 (since the next nearest values $\pm 2$ are outside), and the count of sign patterns giving 0 is exactly $\binom{n}{n/2}$. So the bound is tight. +- **Attribution**: The docstring correctly attributes the real case to Erdős [Er45] and the complex case to Kleitman [Kl65]. The `solved` tag is appropriate. +- **AMS classification** `AMS 5` (Combinatorics) is reasonable; `AMS 60` (Probability) could also be included as in Problem 395. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `signedSum498` duplicates `Erdos395.signedSum`; should be shared | +| Citations | Missing [Er61]; no cross-reference to Problem 395 | +| Variants | Complex case captured; Hilbert-space generalization [Kl70] not formalized | +| Readability | Good; minor style inconsistency with `open` vs `open scoped` | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/5.md b/ai-review/5.md new file mode 100644 index 0000000000..0712069420 --- /dev/null +++ b/ai-review/5.md @@ -0,0 +1,150 @@ +# Review: Erdős Problem 5 + +**File:** `FormalConjectures/ErdosProblems/5.lean` + +--- + +## 1. Code Reuse + +**Issue: `normalizedPrimeGap` reinvents the prime gap inline instead of using the shared `primeGap` definition.** + +`FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` (line 23) defines: +```lean +noncomputable def primeGap (n : ℕ) : ℕ := (n + 1).nth Nat.Prime - n.nth Nat.Prime +``` + +The `normalizedPrimeGap` definition at line 40–41 computes the same gap inline: +```lean +((nth Nat.Prime (n + 1) : ℝ) - (nth Nat.Prime n : ℝ)) / Real.log ((n : ℝ) + 1) +``` + +This could be rewritten as `(primeGap n : ℝ) / Real.log ((n : ℝ) + 1)`, which would reuse the shared definition and improve uniformity with Problems 6, 233, 234, 238, and 852, all of which use `primeGap`. + +Note: Erdős Problem 852 (`FormalConjectures/ErdosProblems/852.lean`, line 36–39) further duplicates this by defining its own local `nthPrime` and `primeGap` — that's a separate issue but illustrates the fragmentation. + +**Also notable:** Erdős Problem 234 (`FormalConjectures/ErdosProblems/234.lean`, line 36) studies the *density* of indices where `primeGap n / log n < c`. This is closely related — it studies the distributional properties of the same normalized quantity. The two problems could share the normalization definition (though 234 divides by `log n` while 5 uses `log (n+1)`; see §6 for discussion). + +**Recommendation:** Rewrite `normalizedPrimeGap` in terms of `primeGap` from `FormalConjecturesForMathlib`. Consider promoting `normalizedPrimeGap` itself to a shared definition if multiple problems will need it. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/5](https://www.erdosproblems.com/5):** + +The website lists: +- **Status:** Open +- **Tags:** Number theory, Primes +- **References:** Er55c, Er57, Er61, Er65b, Er85c, Er90, Er97c +- **Related problem:** Problem 234 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open | **Correct.** | +| AMS classification | `AMS 11` | Number theory | **Correct.** | +| Citation tags | `[Er55c, Er57, Er61, Er65b, Er85c, Er90, Er97c]` | Same | **Correct.** All seven references match. | +| Known results | Westzynthius, GPY, Erdős, Ricci, Hildebrand–Maier, Pintz, Banks–Freiberg–Maynard, Merikoski | Same | **Correct and thorough.** | +| Related problems | Not mentioned | Problem 234 | **Missing.** The website identifies Problem 234 (density of normalized gaps) as related. Consider adding a cross-reference in the docstring. | + +**No citation issues found.** The references are fully spelled out, not abbreviated, and match the website exactly. + +--- + +## 3. Variants + +The formalization captures only the finite-$C$ part of the conjecture: every $C \in [0, \infty)$ is a subsequential limit. Two variants are absent: + +**1. The $C = \infty$ case (known theorem, not a conjecture):** +The docstring correctly notes "$\infty \in S$ (Westzynthius 1931)" as a known result. This could be formalized as a separate theorem: +```lean +theorem erdos_5_infinity : + ∃ f : ℕ → ℕ, StrictMono f ∧ + Tendsto (fun i => normalizedPrimeGap (f i)) atTop atTop +``` +This is *not* open — it is a classical result — so omitting it from the conjecture statement is defensible. But including it would give a complete picture and allow stating the full $S = [0, \infty]$ result once Problem 5 is resolved. + +**2. The $C = 0$ case (known theorem):** +Similarly, "$0 \in S$ (Goldston–Pintz–Yıldırım 2009)" is a celebrated resolved result. It could be stated separately: +```lean +theorem erdos_5_zero : + ∃ f : ℕ → ℕ, StrictMono f ∧ + Tendsto (fun i => normalizedPrimeGap (f i)) atTop (nhds 0) +``` +This is an instance of the main conjecture with $C = 0$, so it's logically redundant with `erdos_5` but historically significant as a standalone result. + +**3. Partial results as intermediate statements:** +The docstring mentions several partial results (positive Lebesgue measure, $[0, c] \subseteq S$, etc.) that could be formalized as weaker variants. These are non-trivial theorems in their own right. + +**Assessment:** The core open conjecture is correctly captured. The omission of the $\infty$ case is appropriate since it is resolved. The partial results are interesting but their formalization is a project-level decision. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Docstrings:** Both the module docstring and theorem docstring are excellent. The module docstring provides full mathematical context with the definition of $S$, the conjecture, and a timeline of partial results. The theorem docstring formally describes the subsequential convergence formulation. +- **Definition docstring:** The `normalizedPrimeGap` definition has a clear docstring explaining the $n+1$ shift in the logarithm and the 0-indexing convention. +- **Namespace:** `Erdos5` is appropriate. +- **Opens:** `open Filter Nat Real` is minimal and appropriate for the `Tendsto`/`atTop`/`nhds`/`Real.log` usage. + +**Minor suggestion:** The formalization uses `nth Nat.Prime` (from `Nat` namespace via `open Nat`) while the shared `primeGap` uses `Nat.nth Nat.Prime`. These are equivalent given the `open Nat`, but the difference in style is slightly jarring when comparing files. + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The conjecture is precisely stated: the set of limit points of $(p_{n+1} - p_n) / \log n$ equals $[0, \infty]$. The key concepts are all well-defined: +- The $n$-th prime $p_n$ is well-defined (via `Nat.nth`). +- The normalized gap $(p_{n+1} - p_n) / \log n$ is well-defined for all $n$ (using Lean's convention that division by zero returns zero, and the code uses $\log(n+1)$ to avoid $\log 0$). +- "Limit point" has a standard topological meaning, equivalently captured by subsequential convergence. + +The only minor point of interpretation is whether the normalization uses $\log n$, $\log(n+1)$, or $\log p_n$. These are all asymptotically equivalent (since $p_n \sim n \log n$ by PNT implies $\log p_n \sim \log n$), so the set of limit points is identical regardless of which convention is used. The formalization's choice of $\log(n+1)$ is technically cleanest (avoids $\log 0$) and mathematically equivalent. + +**Ambiguity level: Essentially none.** The statement is one of the cleanest in the Erdős problems collection. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `normalizedPrimeGap` + +```lean +noncomputable def normalizedPrimeGap (n : ℕ) : ℝ := + ((nth Nat.Prime (n + 1) : ℝ) - (nth Nat.Prime n : ℝ)) / Real.log ((n : ℝ) + 1) +``` + +- **Numerator:** `(nth Nat.Prime (n + 1) : ℝ) - (nth Nat.Prime n : ℝ)` correctly computes $p_{n+1} - p_n$ as a real number. Note that casting to `ℝ` *before* subtraction is essential here: in `ℕ`, subtraction is truncated (`a - b = 0` when `a < b`), but since $p_{n+1} > p_n$ for all $n$, the natural number subtraction would also work. The real-valued subtraction is cleaner and avoids any concern. +- **Denominator:** `Real.log ((n : ℝ) + 1)` uses $\log(n+1)$ instead of $\log n$. For $n = 0$, this gives $\log 1 = 0$, so the expression is $(\text{gap}) / 0 = 0$ by Lean convention. For $n \geq 1$, $\log(n+1) > 0$, so the division is well-defined. The shift by 1 is a pragmatic choice — it's asymptotically equivalent to $\log n$ and avoids the $\log 0$ issue at $n = 0$. +- **Equivalence to standard formulation:** The set of limit points of $(p_{n+1} - p_n) / \log(n+1)$ equals the set of limit points of $(p_{n+1} - p_n) / \log n$ (for $n \geq 2$), since $\log(n+1) / \log n \to 1$. Formally: if a subsequence $n_i \to \infty$ satisfies $a_{n_i} / \log(n_i+1) \to C$, then $a_{n_i} / \log n_i = (a_{n_i} / \log(n_i+1)) \cdot (\log(n_i+1)/\log n_i) \to C \cdot 1 = C$. This is correct. + +### Theorem: `erdos_5` + +```lean +theorem erdos_5 : + ∀ C : ℝ, 0 ≤ C → + ∃ f : ℕ → ℕ, StrictMono f ∧ + Tendsto (fun i => normalizedPrimeGap (f i)) atTop (nhds C) +``` + +- **Logical structure:** "For every real $C \geq 0$, there exists a strictly increasing sequence of indices $f(0) < f(1) < \cdots$ such that $\text{normalizedPrimeGap}(f(i)) \to C$." This is the standard characterization of "$C$ is a limit point of the sequence," expressed via subsequential convergence. +- **StrictMono:** `StrictMono f` ensures $f$ is a genuine extraction (strictly increasing), so $(f(i))$ is an infinite subsequence of indices. This is the correct condition — monotone but not strict would allow constant subsequences, which is not the intent. +- **Tendsto ... atTop (nhds C):** This states convergence of `normalizedPrimeGap ∘ f` to `C` in the usual sense: for every neighborhood $U$ of $C$, eventually `normalizedPrimeGap (f i) ∈ U`. This is the standard topological formulation of limit. +- **Range of C:** The constraint `0 ≤ C` is correct. Normalized prime gaps are non-negative (since $p_{n+1} > p_n$), so negative values cannot be limit points. Combined with the known result $\infty \in S$, the conjecture as stated (plus Westzynthius) gives $S = [0, \infty]$. +- **Completeness:** The formalization captures the full open content. The $\infty$ case is a known theorem (Westzynthius 1931, the docstring correctly notes this), so only the finite case remains open. The $C = 0$ case is also known (GPY 2009), so one could argue the conjecture should be stated for $C > 0$ only — but including $C = 0$ is harmless (it makes the statement cleaner and the $C = 0$ case follows from GPY). + +### Comparison with Problem 234 + +Problem 234 studies the density function $f(c) = \lim_{N \to \infty} |\{n \leq N : d_n / \log n < c\}| / N$. This is related but distinct: Problem 5 asks about which values are *attained* as limit points, while Problem 234 asks about the *frequency* of values below a threshold. Both use `primeGap n / log n` but Problem 234 divides by `log n` (not `log (n+1)`). At $n = 0$, `log 0 = -∞` in standard math (or 0 in Lean's `Real.log`), so dividing by `log n` gives `gap / 0 = 0`, while Problem 5's `log(n+1)` gives `gap / log 1 = gap / 0 = 0`. Both produce junk at small $n$, which is irrelevant for asymptotic questions. The inconsistency in convention (`log n` vs `log (n+1)`) is cosmetically unfortunate but mathematically harmless. + +### Potential concern: behavior at small $n$ + +At $n = 0$: `normalizedPrimeGap 0 = (3 - 2) / log 1 = 1 / 0 = 0` (by Lean convention). At $n = 1$: `normalizedPrimeGap 1 = (5 - 3) / log 2 ≈ 2.885`. These values don't affect the conjecture (which concerns limit points, i.e., asymptotic behavior), but it's worth noting that the definition produces a well-defined real for all $n$. + +**Verdict: Correct and complete.** The formalization faithfully captures the open content of Erdős Problem 5. The normalization by $\log(n+1)$ is asymptotically equivalent to the standard $\log n$ or $\log p_n$, and the restriction to finite $C$ correctly isolates the open part of the conjecture (the $\infty$ case being resolved). No mathematical flaws are present. diff --git a/ai-review/50.md b/ai-review/50.md new file mode 100644 index 0000000000..3b8fb9f90f --- /dev/null +++ b/ai-review/50.md @@ -0,0 +1,156 @@ +# Review: Erdős Problem 50 + +**File:** `FormalConjectures/ErdosProblems/50.lean` + +--- + +## 1. Code Reuse + +**No significant reuse opportunities found.** + +A search of `FormalConjecturesForMathlib/` found no existing code for Euler's totient function density, distribution functions, or singular measures. The `totientDensityCount` definition is unique to this file. + +Mathlib provides `Nat.totient` (used here) and standard filter/topology machinery (`Tendsto`, `atTop`, `nhds`, `HasDerivAt`), which are all appropriately used. No custom utilities are reinvented. + +**One minor observation:** Several other Erdős problems involve natural density computations with the same pattern `(Finset.range (N + 1)).filter (fun n => ...).card / N`. If more problems follow this pattern, a shared `naturalDensityCount` helper could be factored out. At present, this is not actionable — only this problem uses this specific pattern. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/50](https://www.erdosproblems.com/50):** + +The website lists: +- **Status:** Open (with $250 prize) +- **Tags:** Number theory +- **References:** [Er95] (Erdős, p. 171) +- **Related problems:** None listed + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved]` | Open | **DISCREPANCY.** See discussion below. | +| AMS classification | `AMS 11 26` | Number theory | **Reasonable.** AMS 11 (number theory) and 26 (real functions) are both appropriate given the analytic content. | +| Citation tags | None | [Er95] | **Missing.** The website lists [Er95] as the reference. The formalization should include this. | +| Schoenberg reference | Mentioned in docstring (no tag) | Not listed | **OK.** Schoenberg's result is foundational context, not a primary reference. | + +**Status discrepancy:** The formalization asserts `@[category research solved]` and the docstring claims "Erdős proved the distribution function $f$ is purely singular." The website marks it as **Open** with a $250 prize. Historically, Erdős did prove that the distribution function of $\varphi(n)/n$ is purely singular (see e.g., Erdős, "Some remarks on Euler's $\varphi$-function," Bull. AMS, 1945). If Erdős indeed proved this, the formalization's `solved` tag is correct and the website may be outdated or referring to a refinement. However, this discrepancy warrants investigation — the formalization should include a specific citation to Erdős's proof to justify the `solved` tag and `answer(True)`. + +--- + +## 3. Variants + +The formalization captures only the main statement. No variants are identified on the website. Possible variants that could be considered: + +**1. Continuity of $f$ (known theorem):** +Schoenberg proved $f$ is continuous and non-decreasing on $[0,1]$ with $f(0) = 0$ and $f(1) = 1$. This could be formalized as: +```lean +theorem erdos_50_continuous : + ∃ f : ℝ → ℝ, + (∀ c ∈ Icc (0 : ℝ) 1, + Tendsto (fun N : ℕ => (totientDensityCount c N : ℝ) / ↑N) atTop (nhds (f c))) ∧ + ContinuousOn f (Icc 0 1) +``` +This is a resolved result and a natural companion statement. + +**2. Strict monotonicity on $[0,1]$:** +The density function is known to be strictly increasing on $[0,1]$. This is a stronger claim than mere monotonicity and could be stated separately. + +**3. Almost-everywhere zero derivative (measure-theoretic formulation):** +The purely singular property is equivalent to $f'(x) = 0$ for Lebesgue-almost-every $x \in [0,1]$. This is a stronger (and perhaps more natural) formulation than "no point has a positive derivative," since it additionally asserts that the derivative exists a.e. (which follows from monotonicity by Lebesgue's theorem). + +**Assessment:** The core statement is present. The omission of companion results is defensible since they are resolved and the file focuses on the main conjecture/theorem. + +--- + +## 4. Readability + +The code is short (51 lines) and well-structured. Observations: + +- **Module docstring:** Clear and concise. States the mathematical content and credits Schoenberg and Erdős appropriately. +- **Definition docstring:** The `totientDensityCount` docstring is clear: "Count of natural numbers $n$ in $\{1, \ldots, N\}$ with $\varphi(n) < c \cdot n$." +- **Namespace:** `Erdos50` is appropriate. +- **Opens:** `open Nat Finset Filter Set Classical` — this is slightly broad. `Classical` is opened but not obviously needed (the filter predicate `0 < n ∧ (Nat.totient n : ℝ) < c * ↑n` is decidable). Minor style point only. + +**Suggestion:** The docstring could benefit from explicitly noting the domain of $f$ (namely $[0,1]$) and that $f$ is a cumulative distribution function (non-decreasing, continuous, with $f(0) = 0$ and $f(1) = 1$). This context helps the reader understand why $d \leq 0$ is the correct conclusion (since monotonicity forces $d \geq 0$, so the conjunction gives $d = 0$). + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: The problem is precisely formalizable with low ambiguity.** + +The key concepts are all well-defined: +- Euler's totient function $\varphi(n)$ is standard (`Nat.totient`). +- Natural density of $\{n : \varphi(n) < cn\}$ is well-defined: $\lim_{N \to \infty} |\{n \leq N : \varphi(n) < cn\}| / N$. +- Schoenberg's theorem guarantees this limit exists for all $c \in [0,1]$, so $f$ is well-defined. +- "Purely singular" for a monotone function means $f'(x) = 0$ wherever $f'(x)$ exists. The problem's phrasing — "no $x$ such that $f'(x)$ exists and is positive" — is an equivalent characterization for non-decreasing functions. + +**Minor interpretive point:** The original problem asks about the derivative being *positive*. For a non-decreasing function, this is equivalent to asking that the derivative is zero wherever it exists (since $f' \geq 0$ by monotonicity). The formalization's conclusion `d ≤ 0` correctly captures this, relying on the implicit monotonicity to upgrade to `d = 0`. + +**Ambiguity level: Very low.** The only ambiguity is the precise meaning of "purely singular," which is standard in analysis. + +--- + +## 6. Correctness + +**The formalization contains a critical correctness bug: the theorem as stated is unprovable (it is a false Lean proposition).** + +### The bug: unrestricted domain for `HasDerivAt` + +The `answer(True)` elaborator expands to `True`. The theorem thus states: + +``` +True ↔ ∀ f : ℝ → ℝ, + (∀ c ∈ Icc (0 : ℝ) 1, Tendsto ... (nhds (f c))) → + ∀ x d : ℝ, HasDerivAt f d x → d ≤ 0 +``` + +For this biconditional to hold, the RHS must be `True`. However, **the RHS is `False`**, because: + +The hypothesis only constrains `f` on `Icc 0 1` (the density condition is `∀ c ∈ Icc (0 : ℝ) 1, ...`). Outside `[0,1]`, `f` is completely unconstrained. But the conclusion `∀ x d : ℝ, HasDerivAt f d x → d ≤ 0` applies at **all** real numbers `x`, including those outside `[0,1]`. + +**Concrete counterexample:** Define $g : \mathbb{R} \to \mathbb{R}$ by: +- $g(c) = $ the density of $\{n : \varphi(n) < cn\}$ for $c \in [0,1]$ (satisfying the hypothesis) +- $g(x) = x$ for $x > 2$ (with smooth interpolation on $(1,2)$) + +Then $g$ satisfies the density condition on $[0,1]$, but $g'(3) = 1 > 0$. The universal quantification over all such $g$ means the conclusion must hold for this $g$, which it does not. Therefore the RHS is `False`, the biconditional `True ↔ False` is `False`, and the theorem is **unprovable**. + +### Proposed fix + +Restrict `x` to `Icc 0 1`: + +```lean +theorem erdos_50 : answer(True) ↔ + ∀ f : ℝ → ℝ, + (∀ c ∈ Icc (0 : ℝ) 1, + Tendsto (fun N : ℕ => (totientDensityCount c N : ℝ) / ↑N) atTop (nhds (f c))) → + ∀ x ∈ Icc (0 : ℝ) 1, ∀ d : ℝ, HasDerivAt f d x → d ≤ 0 := by + sorry +``` + +Alternatively, one could define the canonical density function directly and avoid the universal quantification over `f`: + +```lean +noncomputable def totientDensityFn (c : ℝ) : ℝ := + if h : ∃ L : ℝ, Tendsto (fun N : ℕ => (totientDensityCount c N : ℝ) / ↑N) atTop (nhds L) + then h.choose else 0 + +theorem erdos_50 : answer(True) ↔ + ∀ x ∈ Icc (0 : ℝ) 1, ∀ d : ℝ, HasDerivAt totientDensityFn d x → d ≤ 0 := by + sorry +``` + +This second approach is cleaner: it defines $f$ canonically and avoids the subtlety of universal quantification over extensions. + +### Other aspects of the formalization + +Setting aside the domain bug, the rest is sound: + +- **`totientDensityCount`:** Correctly counts $|\{n \in \{1,\ldots,N\} : \varphi(n) < cn\}|$. The `Finset.range (N + 1)` gives $\{0,\ldots,N\}$, the `0 < n` filter excludes 0. Edge cases check out: for $c = 0$ the count is 0 (density 0); for $c = 1$, $\varphi(n) < n$ holds for all $n \geq 2$ and fails for $n = 1$, giving density 1. ✓ +- **`answer(True)`:** Correct if Erdős did prove the result (see §2 for the status discrepancy). The problem asks "Is it true that...?" and the answer is yes. +- **Conclusion `d ≤ 0`:** Mathematically appropriate. For the density function $f$ (which is non-decreasing), any derivative satisfies $d \geq 0$. Combined with $d \leq 0$, this gives $d = 0$, which is the content of "purely singular" for a monotone function. The formulation `d ≤ 0` rather than `d = 0` is a valid (and perhaps more elegant) way to state this, since it lets the monotonicity do the work. +- **AMS tags:** `AMS 11 26` (number theory + real functions) is appropriate for this problem, which sits at the intersection of analytic number theory and real analysis. + +**Verdict: Incorrect due to the unrestricted domain of `HasDerivAt`. The theorem as written is a false proposition (`True ↔ False`). Fixing requires restricting `x` to `Icc 0 1`, or equivalently, defining the canonical density function and stating the property about it directly. Additionally, the `solved` status should be justified with a specific citation, given the discrepancy with the website.** diff --git a/ai-review/500.md b/ai-review/500.md new file mode 100644 index 0000000000..36735c3be9 --- /dev/null +++ b/ai-review/500.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 500 + +## 1. Code Reuse + +Problem 500's definitions (`IsK43Free`, `ex3K43`) are exact specializations of Problem 712's more general definitions (`IsKkrFree`, `exrKkr`) with `r = 3` and `k = 4`. Specifically: + +- `IsK43Free H` is equivalent to `Erdos712.IsKkrFree 3 4 H` +- `ex3K43 n` is equivalent to `Erdos712.exrKkr 3 4 n` + +The codebase also contains several other hypergraph Turán-type definitions (Problems 719, 1076, 1157) that use the same `sSup`/`powersetCard` patterns. Problem 500 could import and specialize Problem 712's definitions to avoid duplication, though maintaining standalone definitions for this historically prominent special case is defensible for clarity. + +**Recommendation:** Consider defining `IsK43Free` and `ex3K43` as abbreviations or aliases for the Problem 712 generalizations, or at minimum add a comment noting the relationship. + +## 2. Citations + +The formalization includes references [Er61], [Er71], [Er74c], [Er81], and [Ra10], matching what appears on [erdosproblems.com/500](https://www.erdosproblems.com/500). The citations are given in shorthand form (author, title, year) without full journal/volume details. The website itself uses the same shorthand identifiers so this is consistent. + +Minor observations: +- The website notes a connection to OEIS sequence A140462, which is not mentioned in the formalization. This is optional context, not a required citation. +- The website cross-references Problem 712 as the general case. The formalization's docstring does not mention this relationship; adding a `See also [712]` note would be helpful. + +## 3. Variants + +The website describes a single problem: determine ex₃(n, K₄³). The formalization captures the main conjecture (Turán density equals 5/9) via the `Tendsto` statement. No additional variants are listed on the website for Problem 500 specifically. The general r-uniform, k-clique variant is Problem 712 and is formalized separately. + +**No missing variants.** + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings with LaTeX-rendered mathematical notation. +- Definitions are concise and follow standard Mathlib conventions. +- The namespace `Erdos500` keeps definitions scoped appropriately. +- The `open Finset Filter` is appropriate for the imports used. + +Minor suggestions: +- The docstring for `IsK43Free` says "every edge has exactly 3 vertices and no 4 vertices span all 4 possible 3-element subsets," which accurately describes the definition. +- The main theorem's docstring could explicitly note the relationship to Problem 712. + +**Overall readability: Good.** + +## 5. Formalizability + +The problem as stated on the website — "What is ex₃(n, K₄³)?" — is precise and unambiguous. The definitions of 3-uniform hypergraph, K₄³, and the extremal number are completely standard in combinatorics. The conjecture that the Turán density is 5/9 is a well-known, precisely stated open problem (Turán's hypergraph conjecture). + +**Assessment: Fully formalizable with no ambiguity.** The only interpretive choice is whether the problem asks for the exact value of ex₃(n, K₄³) for each n, or asymptotically (the Turán density). The formalization chooses the asymptotic density interpretation, which matches Turán's conjecture and the way the problem is discussed on the website ("the largest number ... so that" followed by asymptotic bounds). + +## 6. Correctness + +### Definition `IsK43Free` +- `(∀ e ∈ H, e.card = 3)`: Correctly enforces 3-uniformity. ✓ +- `∀ S : Finset (Fin n), S.card = 4 → ¬(S.powersetCard 3 ⊆ H)`: Correctly states that no 4-vertex set has all C(4,3) = 4 of its 3-element subsets present in H. This is the standard definition of K₄³-freeness. ✓ + +### Definition `ex3K43` +- `sSup {m : ℕ | ∃ H : Finset (Finset (Fin n)), IsK43Free H ∧ H.card = m}`: Takes the supremum over cardinalities of K₄³-free 3-uniform hypergraphs on `Fin n`. ✓ +- The set is non-empty (the empty hypergraph satisfies the conditions with m = 0) and bounded above (by C(n,3)), so `sSup` on `ℕ` (with `ConditionallyCompleteLattice`) correctly computes the maximum. ✓ + +### Main theorem `erdos_500` +```lean +Tendsto (fun n : ℕ => (ex3K43 n : ℝ) / (Nat.choose n 3 : ℝ)) atTop (nhds answer(sorry)) +``` +- This asserts that ex₃(n, K₄³)/C(n,3) converges as n → ∞. ✓ +- The existence of the Turán density (i.e., that this limit exists) is a known result for all r-uniform hypergraphs, following from averaging/compactness arguments (Katona–Nemetz–Simonovits type reasoning). So asserting convergence is mathematically sound. ✓ +- The use of `answer(sorry)` correctly reflects that the problem is open: Turán conjectured the limit is 5/9, but this is unproven. The docstring clearly states the conjectured value and current best bounds. ✓ +- The `@[category research open, AMS 5]` annotation correctly marks this as an open research problem in combinatorics (AMS class 05). ✓ + +### Potential subtlety +The `Tendsto` formulation implicitly bundles two claims: (a) the limit exists, and (b) it equals a specific value. Claim (a) is known; claim (b) is the open conjecture. One could argue for separating these into two statements, but the current bundled form is standard and correct — proving the theorem requires establishing both, which is fine. + +**Overall correctness: Sound.** No mathematical errors identified. The formalization faithfully captures Turán's hypergraph conjecture for the (3,4) case. diff --git a/ai-review/501.md b/ai-review/501.md new file mode 100644 index 0000000000..d56a016c06 --- /dev/null +++ b/ai-review/501.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 501 + +## 1. Code Reuse + +The `IndependentFamily` definition (line 48) is specific to this problem's set-theoretic context. The codebase contains many graph-theoretic `IsIndepSet` definitions (e.g., in problems 151, 615, 750, 804) but these operate on `SimpleGraph`/`Finset` and are not applicable here. No existing definition in `FormalConjecturesForMathlib/` captures this concept. No reuse opportunity identified. + +## 2. Citations + +The docstring cites **[Er61]** and **[ErHa71]**. The website (erdosproblems.com/501) lists the following references for known results: + +| Citation | Result | In code? | +|----------|--------|----------| +| [Er61] Erdős, _Problems in combinatorics_ (1961) | Original problem | ✅ Yes | +| [ErHa60] Erdős & Hajnal (1960) | Arbitrarily large finite independent sets | ❌ Missing — the code cites [ErHa71] instead | +| [Gl62] Gladysz (1962) | Independent set of size 2 (closed variant) | ❌ Not mentioned | +| [He72] Hechler (1972) | Negative answer under CH | ❌ Not cited (mentioned in prose only) | +| [NPS87] Newelski, Pawlikowski & Seredyński (1987) | Infinite independent set (closed variant) | ❌ Not cited (mentioned in prose only) | + +**Issues:** +- The website attributes the finite independent sets result to **[ErHa60]**, but the code cites **[ErHa71]**. These appear to be different papers. The code should either cite [ErHa60] (if that is the paper containing the result) or include both references. This should be verified against the actual publications. +- The references [Gl62], [He72], and [NPS87] are mentioned narratively in the docstring but not given full citation entries. Adding them would improve traceability. + +## 3. Variants + +The formalization captures two statements: +1. **Main problem** (`erdos_501`): bounded + outer measure < 1 → infinite independent set? (open) +2. **Closed variant** (`erdos_501.variants.closed_measure`): closed + measure < 1 → independent set of size 3? (solved, `answer(True)`) + +**Observations:** +- The closed variant formalizes the original question (size 3) but Newelski–Pawlikowski–Seredyński [NPS87] proved the much stronger result that an **infinite** independent set exists. The formalization only captures the weaker size-3 statement. Consider adding a stronger variant that formalizes the full NPS87 result. +- **Gladysz's result** [Gl62] (independent set of size 2 under the closed hypothesis) is not mentioned. While subsumed by NPS87, it could be noted for historical completeness. +- The website does not list additional variants beyond these two questions. + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- The docstring correctly says "outer measure" but the Lean code uses `volume`, which may confuse readers unfamiliar with Mathlib's convention that `volume s` evaluates the underlying outer measure on any set (not just measurable ones). A brief comment like `-- volume on arbitrary sets computes outer measure` could help. +- The `IndependentFamily` definition is clear and its docstring is good. +- The namespace `Erdos501` keeps the `IndependentFamily` definition local, which is appropriate since it is problem-specific. + +## 5. Formalizability + +**Assessment: Highly formalizable, minimal ambiguity.** + +Both statements are precise: +- "Bounded set with outer measure < 1" maps directly to `Bornology.IsBounded` and `volume < 1`. +- "Closed with measure < 1" maps to `IsClosed` and `volume < 1`. +- "Infinite independent set" and "independent set of size 3" are unambiguous. + +The only subtlety is whether the family `A` is completely arbitrary (any function `ℝ → Set ℝ`) or should satisfy additional measurability constraints. The formalization correctly imposes no measurability on the sets `A x` in the main problem, which matches the problem's intent (outer measure is defined for all sets). For the closed variant, closed sets are automatically measurable, so this is a non-issue. + +The problem's open/solved status is clear: the main question is independent of ZFC (negative under CH, open in full ZFC), and the closed variant is resolved. + +## 6. Correctness + +**Overall: Correct with one notable modeling choice.** + +### What is correct: +- **`volume` for outer measure:** In Mathlib, `Measure` extends `OuterMeasure`, and `μ s` evaluates the outer measure for any `s : Set α`, whether measurable or not. So `volume (A x) < 1` correctly captures "outer measure < 1" for arbitrary (possibly non-measurable) sets. This is verified from Mathlib's `MeasureSpaceDef.lean` (line 35: "Given `μ : Measure α`, `μ s` is the value of the *outer measure* applied to `s`."). +- **`Bornology.IsBounded`:** Correctly captures boundedness in ℝ. +- **`IndependentFamily` definition:** Correctly captures "x ∉ A(y) for all distinct x, y ∈ X". +- **`answer(sorry)` for the main problem:** Correct — the ZFC status is genuinely open. +- **`answer(True)` for the closed variant:** Correct — NPS87 proved a positive answer (and more). +- **No boundedness in the closed variant:** The original problem only says "closed with measure < 1", not "bounded and closed". The formalization correctly omits `IsBounded` here. +- **AMS classification `3 28` (measure and integration):** Appropriate. + +### Modeling choice to flag: +- **The closed variant formalizes size 3, not infinity.** The original question asked for size 3, and the formalization captures exactly that. However, since NPS87 proved the existence of an *infinite* independent set (a strictly stronger result), the formalization undersells what is known. The `answer(True)` is still correct (size 3 is implied by infinite), but the formalization does not capture the full strength of the solved result. **Recommendation:** Add a second closed variant that asserts the existence of an infinite independent set, marked as solved. + +### No issues found with: +- The symmetry of the `IndependentFamily` definition (it requires `x ∉ A y` for all ordered pairs of distinct elements, which is the correct interpretation). +- The type-level choices (`ℝ → Set ℝ`, `Set ℝ` for the independent set). diff --git a/ai-review/502.md b/ai-review/502.md new file mode 100644 index 0000000000..fa7aee25d9 --- /dev/null +++ b/ai-review/502.md @@ -0,0 +1,76 @@ +# Review: Erdős Problem 502 + +## 1. Code Reuse + +Several existing definitions in the codebase count distinct pairwise distances and could be unified with `IsTwoDistanceSet`: + +- **`Erdos1083.distinctDistanceCountInDim`** (`1083.lean:40–41`) uses an identical `Set.ncard` pattern over the same set comprehension and is parameterized by dimension `d`. `IsTwoDistanceSet A` is mathematically equivalent to `distinctDistanceCountInDim n A = 2`; the two definitions could share a common helper. +- **`Erdos1089.distinctDistances`** (`1089.lean:41–42`) provides a `Finset`-based approach (`S.biUnion (fun a => (S.erase a).image (fun b => dist a b))`) that avoids `Set.ncard` entirely and works in arbitrary dimension `d`. Problem 502 could be restated as `(Erdos1089.distinctDistances A).card = 2`. +- **`Erdos93.distinctDistances`** (`93.lean:46–47`) uses `A.offDiag.image`, another clean `Finset` encoding, though it is specialized to dimension 2. + +**Recommendation:** Extract a shared, dimension-generic `distinctDistanceCount` definition (preferably `Finset`-based as in 1089) into a utility module and have problems 93, 98, 502, 655, 660, 1083, and 1089 all reference it. Alternatively, at minimum, `IsTwoDistanceSet` should be defined in terms of one of the existing distance-count definitions rather than re-inventing the set comprehension locally. + +## 2. Citations + +The website lists the following references for Problem 502: + +| Citation | Website | Formalization | +|----------|---------|---------------| +| Erdős 1961 | **[Er61, p.244]** | `[Er61]` — **missing page number** | +| Bannai–Bannai–Stanton 1983 | [BBS83] | [BBS83] ✓ | +| Petrov–Pohoata 2021 | [PePo21] | [PePo21] ✓ | +| Related: Problem 503 (Alweiss lower bound) | Referenced | Mentioned in docstring ✓ | +| Related: Problem 1089 (general version) | Referenced | **Not mentioned** | + +**Issues:** +- The Erdős reference should include the page number: `[Er61, p.244]`. +- The docstring should note the relationship to Problem 1089 (the general s-distance version of this question), as the website explicitly links it. + +## 3. Variants + +The formalization captures only the **upper bound** (BBS: |A| ≤ C(n+2, 2)). + +**Missing variants:** +- **Lower bound construction:** The website notes the best known lower bound is C(n+1, 2) via Alweiss's construction. While the docstring mentions this in prose, a separate formal statement of the lower bound (existence of a two-distance set of size C(n+1, 2) in ℝⁿ) would capture the full state of knowledge. +- **General s-distance sets:** Problem 1089 addresses g_d(n), the minimum number of points guaranteeing n distinct distances. Problem 502 is the special case s = 2. No formal connection is drawn. +- **Exact answer conjecture:** The gap between C(n+1, 2) and C(n+2, 2) remains open. A conjecture on the exact maximum (if one is known) could be included. + +## 4. Readability + +The code is generally clean and readable. Minor suggestions: + +- The `IsTwoDistanceSet` docstring says "two distinct positive real numbers" but the formal definition does not explicitly enforce positivity. This is correct (since `dist x y > 0` for `x ≠ y` in Euclidean space, all elements of the set are automatically positive), but adding a brief comment noting this would aid readability. +- Consider using the `Finset`-based distance-counting approach (as in Problem 1089 or 93) rather than `Set.ncard` on a set comprehension. `Finset`-based definitions are generally more idiomatic in Lean 4/Mathlib and easier to work with in proofs. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The mathematical statement is completely precise: "any two-distance set in ℝⁿ has at most C(n+2, 2) elements." The definition of a two-distance set (exactly two distinct pairwise distances) is standard and admits no ambiguity. The bound C(n+2, 2) is a concrete closed-form expression. There are no quantifier or edge-case ambiguities. + +The only minor subtlety is whether n = 0 or n = 1 should be considered, but the statement holds vacuously or trivially in those cases (C(2,2) = 1 for n = 0, C(3,2) = 3 for n = 1), and the formalization handles this correctly by universally quantifying over all `n : ℕ`. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **Definition correctness:** `IsTwoDistanceSet` checks that the set `{d : ℝ | ∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ d = dist x y}` has `Set.ncard` equal to 2. Since `dist` is symmetric (`dist x y = dist y x`), each unordered pair contributes exactly one distance value, which is the correct mathematical semantics. Since `x ≠ y` implies `dist x y > 0` in `EuclideanSpace ℝ (Fin n)`, the set automatically contains only positive reals, matching the docstring. + +- **Edge cases:** If `A` has 0 or 1 points, the distance set is empty (`ncard = 0`), so `IsTwoDistanceSet` is false. If `A` has 2 points, there is exactly 1 distance, so `IsTwoDistanceSet` is false. Both are correct—a two-distance set requires at least 3 points. + +- **Theorem statement:** `A.card ≤ Nat.choose (n + 2) 2` correctly encodes the BBS bound |A| ≤ C(n+2, 2). The universal quantification over `n` and `A` with the hypothesis `hA : IsTwoDistanceSet A` is the standard formulation. + +- **Potential `Set.ncard` subtlety:** `Set.ncard` returns 0 for infinite sets. However, the distance set for a finite point set `A : Finset _` is always finite (it's the image of a finite set of pairs under `dist`), so `Set.ncard` agrees with the true cardinality. The definition is therefore correct, though this finiteness fact would need to be established in any proof. Using a `Finset`-based approach would sidestep this entirely. + +- **No mathematical flaws identified.** The statement faithfully captures the Bannai–Bannai–Stanton theorem as stated in the literature. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | **Needs improvement** | Duplicates distance-counting patterns from 1083, 1089; should share a definition | +| Citations | **Minor fix needed** | Missing page number on [Er61, p.244]; should mention Problem 1089 | +| Variants | **Partial** | Only upper bound; lower bound and connection to Problem 1089 not formalized | +| Readability | **Good** | Clean code; would benefit from Finset-based approach | +| Formalizability | **Excellent** | Unambiguous, precise, clearly formalizable | +| Correctness | **Correct** | Mathematically sound; no errors found | diff --git a/ai-review/504.md b/ai-review/504.md new file mode 100644 index 0000000000..d78a32a5e3 --- /dev/null +++ b/ai-review/504.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 504 + +## 1. Code Reuse + +**The custom `angleAt` function is redundant.** Mathlib already provides `EuclideanGeometry.angle` (notation `∠ p₁ p₂ p₃`) in `Mathlib.Geometry.Euclidean.Angle.Unoriented.Affine` (line 42), defined as: + +```lean +nonrec def angle (p₁ p₂ p₃ : P) : ℝ := + angle (p₁ -ᵥ p₂ : V) (p₃ -ᵥ p₂) +``` + +where the inner `InnerProductGeometry.angle` (from `Mathlib.Geometry.Euclidean.Angle.Unoriented.Basic`, line 40) is: + +```lean +def angle (x y : V) : ℝ := + Real.arccos (⟪x, y⟫ / (‖x‖ * ‖y‖)) +``` + +Since `EuclideanSpace ℝ (Fin 2)` is a `NormedAddTorsor` over itself, `p₁ -ᵥ p₂ = p₁ - p₂`, making `EuclideanGeometry.angle x y z` definitionally equal to the custom `angleAt x y z`. The custom definition should be replaced with the Mathlib version, which comes with an extensive lemma library (continuity, symmetry, bounds in `[0, π]`, scaling invariance, etc.). Other files in the codebase (e.g., 507, 846, 89, 90, 100, 107) already use `open scoped EuclideanGeometry` with `∠` notation. + +The `maxGuaranteedAngle` definition follows a standard `sSup`-of-guaranteed-property pattern also seen in Problem 507 (`FormalConjectures/ErdosProblems/507.lean`), which uses `sInf`/`sSup` over geometric quantities of finsets. + +## 2. Citations + +The website (erdosproblems.com/504) lists the following results: + +| Source | Result | +|--------|--------| +| **Szekeres (1941)** | Established bounds for α\_{2^n+1} and α\_{2^n} | +| **Erdős & Szekeres (1960)** | Proved α\_{2^n} = α\_{2^n−1} = π(1 − 1/n); conjectured this formula holds for all 2^{n−1} < N ≤ 2^n | +| **Sendov (1992)** | Disproved the Erdős–Szekeres conjecture | +| **Sendov (1993)** | Gave the complete answer (two-piece formula) | + +The formalization's docstring mentions only "Sendov (1993)" and "Blumenthal's problem." **Missing:** The Szekeres (1941) and Erdős–Szekeres (1960) results are not cited. Sendov (1992) disproving the Erdős–Szekeres conjecture is also unmentioned. Full bibliographic references (journal, volume, pages) are absent for all citations—no specific papers are referenced, only the year. + +## 3. Variants + +The website describes the historical trajectory (Szekeres bounds, Erdős–Szekeres formula at powers of 2, the disproved conjecture) but ultimately the problem has a single definitive answer (Sendov 1993). **No additional variants appear on the website.** + +The formalization captures only the final Sendov result, which is appropriate since the problem is solved. One could argue that the Erdős–Szekeres partial result (α\_{2^n} = α\_{2^n−1} = π(1 − 1/n)) could be stated as a corollary, but it follows directly from the main theorem. **No variants are missing.** + +## 4. Readability + +**Issues:** +- The custom `angleAt` function obscures the connection to Mathlib's angle infrastructure. Using `∠ x y z` (via `open scoped EuclideanGeometry`) would be immediately recognizable to anyone familiar with Mathlib. +- The explicit `@inner ℝ _ _ u v` in `angleAt` is less readable than the notation `⟪u, v⟫` used in Mathlib. +- The `answer(if ... then ... else ...)` expression in the theorem statement is somewhat dense. The two cases could benefit from a brief inline comment naming them (e.g., "upper half" and "lower half" of the range). +- The module docstring is clear and well-structured. +- The `maxGuaranteedAngle` definition is clear and well-documented. + +## 5. Formalizability + +The problem as stated on the website is **fully precise and unambiguously formalizable**: +- "Set of N points in ℝ²" maps directly to `Finset (EuclideanSpace ℝ (Fin 2))` with `.card = N`. +- "Angle determined by xyz" is a standard geometric notion with a unique definition (arccos of normalized dot product), mapping to values in `[0, π]`. +- "Supremum of all α such that every set contains three points with angle ≥ α" is a clean set-theoretic definition. +- The answer is an explicit closed-form expression in terms of n and N. + +**Ambiguity: negligible.** The only potential ambiguity is whether "angle determined by xyz" means the angle at the middle point y (as formalized) or one of the other angles. The standard convention in this literature is the angle at the vertex y (middle point), and the formalization correctly captures this. + +## 6. Correctness + +### Definitions +- **`angleAt`**: Mathematically correct. Computes arccos(⟨u, v⟩ / (‖u‖ · ‖v‖)) which gives the angle in [0, π]. Degeneracy when x = y or z = y yields π/2 (from arccos(0/0) = arccos(0)), matching Mathlib's convention. The theorem requires x ≠ y and y ≠ z, so this edge case is irrelevant. +- **`maxGuaranteedAngle`**: Correctly defines the supremum. The constraint `0 ≤ α ∧ α ≤ π` bounds the set appropriately. + +### Theorem Statement +The two-piece formula matches the website exactly: +- When 2^{n−1} + 2^{n−3} < N ≤ 2^n: α\_N = π(1 − 1/n) ✓ +- When 2^{n−1} < N ≤ 2^{n−1} + 2^{n−3}: α\_N = π(1 − 1/(2n−1)) ✓ + +The boundary case N = 2^{n−1} + 2^{n−3} falls into the `else` branch (since `2^{n−1} + 2^{n−3} < N` is false), giving π(1 − 1/(2n−1)), which matches the "≤" in Sendov's second formula. + +### Completeness Concern: Restriction to N > 4 and n ≥ 3 + +The theorem restricts to `4 < N` and `3 ≤ n`. This excludes: +- **N ≤ 2**: No three distinct points exist; `maxGuaranteedAngle` is vacuously problematic (the existential in the definition fails for any finset of size ≤ 2, so the qualifying set of α is empty and sSup ∅ may not behave as intended). +- **N = 3, 4**: These require n = 2 in Sendov's formula. With n = 2, the expression `2^(n−3)` involves ℕ truncated subtraction: `n − 3 = 0` in ℕ when n = 2, giving `2^0 = 1` instead of the mathematically correct `2^{−1} = 0.5`. This produces the wrong threshold (3 instead of 2.5), which would misclassify N = 3: the ℕ formula would give π(1 − 1/3) = 2π/3 instead of the correct π(1 − 1/2) = π/2. + +The restriction to n ≥ 3 correctly avoids this ℕ subtraction issue. **The formalization is correct for all N > 4 but incomplete for N ∈ {3, 4}.** This is a minor gap since the small cases could be handled separately, but it means the formalization does not fully "determine α\_N" for all N as the problem requests. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| **Code reuse** | `angleAt` should be replaced with Mathlib's `EuclideanGeometry.angle` (`∠`) | +| **Citations** | Incomplete—only Sendov (1993) mentioned; Szekeres (1941), Erdős–Szekeres (1960), Sendov (1992) missing | +| **Variants** | Complete—no missing variants | +| **Readability** | Good overall; replacing custom definitions with Mathlib equivalents would improve it | +| **Formalizability** | Unambiguous and cleanly formalizable | +| **Correctness** | Mathematically correct for N > 4; incomplete for N ∈ {3, 4} due to ℕ truncated subtraction avoidance | diff --git a/ai-review/505.md b/ai-review/505.md new file mode 100644 index 0000000000..39bcc10638 --- /dev/null +++ b/ai-review/505.md @@ -0,0 +1,61 @@ +# Review: Erdős Problem 505 + +## 1. Code Reuse + +No significant reuse opportunities. The formalization already uses the standard Mathlib primitives (`Metric.diam`, `EuclideanSpace ℝ (Fin n)`, indexed unions via `⋃ i, F i`, `Fin (n+1) → Set`). These patterns appear across several other Erdős problems in the codebase (e.g., Problem 670 uses `Metric.diam` on `EuclideanSpace ℝ (Fin d)` for finite sets; Problem 509 uses an indexed covering family with metric constraints; Problem 1124 uses a `Fin n → Set` partition pattern). None of these offer an abstraction that would simplify or replace the current formalization. The `FormalConjecturesForMathlib/Geometry/Euclidean.lean` file provides notation for `ℝ^n` but it is not imported; this is fine since the explicit `EuclideanSpace ℝ (Fin n)` is standard and clear. + +## 2. Citations + +The docstring references: +- Borsuk (1933) — original conjecture +- Eggleston — proved n=3 case +- Kahn and Kalai (1993) — disproved for n > 2014 +- Brouwer and Jenrich (2014) — smallest known counterexample n = 64 + +The [erdosproblems.com/505](https://www.erdosproblems.com/505) page lists the following references: **[Er46b], [Er61], [Er75f, p.102], [Er81b, p.28]** (Erdős), **[Eg55]** (Eggleston), **[KaKa93]** (Kahn & Kalai), **[BrJe14]** (Brouwer & Jenrich), **[Sc88]** (Schramm). + +The docstring omits the specific Erdős reference codes and does not mention Schramm's upper bound result (α(n) ≤ ((3/2)^{1/2} + o(1))^n). These are supplementary results rather than the core problem statement, so the omission is minor, but adding the bracketed reference codes would improve traceability to the website. + +## 3. Variants + +The website mentions quantitative bounds on α(n), the minimum number of pieces of diameter < 1 needed to cover a diameter-1 set in ℝⁿ: +- **Lower bound** (Kahn-Kalai): α(n) ≥ (1.2)^√n +- **Upper bound** (Schramm): α(n) ≤ ((3/2)^{1/2} + o(1))^n + +These are not captured in the formalization. The formalization only encodes the Boolean yes/no version (can we always do it with n+1 pieces?). Formalizing the quantitative bounds would be a natural extension but is not strictly required — the core conjecture is the n+1 question, and these bounds are separate results. + +No other variants of the problem are listed on the website. + +## 4. Readability + +The code is clean and readable. The theorem statement is concise and closely mirrors the natural-language formulation. The docstring provides good historical context. No readability improvements are needed. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +Borsuk's conjecture is one of the most precisely stated problems in combinatorial geometry. Every term has an exact mathematical meaning: "set of diameter 1 in ℝⁿ", "union of at most n+1 sets", "diameter < 1". There is no ambiguity in the statement whatsoever. The formalization maps directly from the natural-language statement with no interpretive choices required beyond the standard WLOG reduction to diameter exactly 1. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed analysis: + +- **`answer(False)`**: The biconditional `answer(False) ↔ P` encodes that P is false, i.e., the conjecture is disproved. This is correct — Kahn and Kalai showed the conjecture fails for large n. + +- **Diameter = 1 (WLOG)**: The original conjecture asks about arbitrary bounded sets. Restricting to `Metric.diam S = 1` is without loss of generality: sets with diameter 0 (singletons/empty) trivially satisfy the property, and sets with arbitrary positive diameter can be scaled to diameter 1. This is correct. + +- **Unbounded sets**: In Mathlib, `Metric.diam` returns `ENNReal.toReal (EMetric.diam s)`. For unbounded sets, `EMetric.diam s = ⊤` and `ENNReal.toReal ⊤ = 0`, so `Metric.diam S = 1` correctly excludes unbounded sets. + +- **"At most n+1" via `Fin (n+1)`**: Using `Fin (n + 1) → Set` gives exactly n+1 sets, but since some may be empty (with diameter 0 < 1), this correctly captures "at most n+1 sets". Correct. + +- **Union vs. partition**: The formalization uses `S = ⋃ i, F i` (covering with equality) rather than requiring pairwise disjointness. This is the standard formulation. It is equivalent to a partition formulation for this problem because intersecting each piece with S preserves the diameter bound and achieves equality. + +- **`S = ⋃ i, F i` (equality vs. subset)**: Using equality rather than `S ⊆ ⋃ i, F i` is fine: given a cover, one can replace each `F i` with `F i ∩ S` to get an equal decomposition where `Metric.diam (F i ∩ S) ≤ Metric.diam (F i) < 1`. + +- **Quantification over all n**: The `∀ n : ℕ` correctly captures that the conjecture is about all dimensions. The n=0 case is vacuously true (no subset of a 0-dimensional space has diameter 1). + +- **Category tag**: `@[category research solved, AMS 52]` is appropriate — it is a solved (disproved) research problem in AMS 52 (Convex and discrete geometry). + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of Borsuk's conjecture as stated on the Erdős Problems website. diff --git a/ai-review/506.md b/ai-review/506.md new file mode 100644 index 0000000000..0a294db598 --- /dev/null +++ b/ai-review/506.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 506 + +## 1. Code Reuse + +Several opportunities for reuse exist: + +- **`AllCollinear`** (line 43): Defined via a custom parametric line representation (`∃ a b, a ≠ b ∧ ∀ p ∈ S, ∃ t, p = a + t • (b - a))`). Erdős 735 (`FormalConjectures/ErdosProblems/735.lean:59`) defines the same concept more idiomatically as `Collinear ℝ (↑S : Set R2)`, directly using Mathlib's `Collinear`. The Mathlib version is preferable—it integrates with existing lemmas and is semantically equivalent. + +- **`AllOnCircle`** (line 39): Nearly identical to `FourPointsConcyclic` in Erdős 831 (`FormalConjectures/ErdosProblems/831.lean:44`) and Erdős 98/217/130. Both define "all points lie on a circle with positive radius." The only difference is that `AllOnCircle` applies to the full set while `FourPointsConcyclic` is typically applied to subsets of size 4. A shared definition parameterized by cardinality or applied to arbitrary sets would reduce duplication. + +- **`EuclideanSpace ℝ (Fin 2)`**: The library provides the `ℝ²` notation in `FormalConjecturesForMathlib/Geometry/2d.lean:25` and a `Point2` abbreviation in Erdős 210 (`FormalConjectures/ErdosProblems/210.lean:34`). Problem 506 uses the raw type throughout; adopting one of these conventions would improve consistency. + +- **`numDeterminedCircles`** (line 50): The pattern of counting geometric objects via `Set.ncard` over a set comprehension is shared with `threeRichUnitCircleCount` in Erdős 104 (`FormalConjectures/ErdosProblems/104.lean:35`) and `distinctCircumradiiCount` in Erdős 831 (`FormalConjectures/ErdosProblems/831.lean:60`). While the predicates differ, the structural pattern is the same. + +## 2. Citations + +The formalization includes: +- `[Er61]` Erdős, P., *Some unsolved problems*, 1961, p. 245 — **correct** +- `[El67]` Elliott, P. D. T. A., *On the number of circles determined by n points*, 1967 — **correct** +- `[PuSm]` Purdy, G. and Smith, J. W., *Lines, circles, and the number of determined circles* — **correct** + +**Missing from the website:** +- `[BaBa94]` Bálint, V. and Bálintová, A. — The website lists this as an additional reference confirming the result. It should be added. + +The website also notes related problems **#104** and **#831**, which are not cross-referenced in the docstring. + +## 3. Variants + +The formalization captures only the **large n** regime (n > 393), which is the fully resolved case. + +**Missing variants:** +- **Small n (n ≤ 393):** The website states this remains open. Segre showed that Elliott's original bound `C(n-1, 2)` fails for n = 8 (via projection of a cube onto a plane). The formalization could include a separate conjecture or open problem statement for small n. +- **The problem as originally posed** asks simply "what is the minimum number of circles?" without specifying the answer—it's a question, not a conjecture. A more faithful formalization might state the lower bound (`≥`) separately from the exact value (`=`), since the lower bound and the matching upper bound (via the witnessing configuration) are logically distinct results. + +## 4. Readability + +- **Good:** The namespace `Erdos506` cleanly scopes all definitions. The docstrings are clear and informative. The `open Finset` is minimal and appropriate. +- **Improvement:** Replace `EuclideanSpace ℝ (Fin 2)` with `ℝ²` (from `FormalConjecturesForMathlib/Geometry/2d.lean`) or introduce a local abbreviation like `Point2` (as in Erdős 210) to reduce verbosity. +- **Improvement:** The `AllCollinear` definition using explicit parametric lines is harder to read than the Mathlib-idiomatic `Collinear ℝ (↑S : Set ...)`. The parametric form requires the reader to mentally verify equivalence with standard collinearity. +- **Minor:** The `noncomputable` annotation on `AllOnCircle` and `AllCollinear` is technically unnecessary since they are `Prop`-valued (propositions are always computable in Lean 4's type theory). However, this is a style issue and has no semantic impact since the file uses noncomputable defaults elsewhere. + +## 5. Formalizability + +**Assessment: High — unambiguous for the large-n case.** + +The problem as stated on the website ("What is the minimum number of circles determined by n points, not all on a circle?") is a well-posed optimization question. The formalization resolves the key ambiguities: + +- **"Determined by"** is formalized as "at least 3 points of S lie on the circle" — this is the standard combinatorial-geometry interpretation. +- **"Not all on a circle"** is `¬AllOnCircle S`. +- **"Not all on a line"** (`¬AllCollinear S`) is an implicit non-degeneracy condition not stated in the original problem but necessary for a meaningful result. Without it, collinear configurations yield 0 determined circles (three collinear points do not lie on any circle), making the infimum trivially 0. The formalization correctly includes this. + +The only remaining ambiguity is for **small n** where the exact minimum is unknown, making that regime inherently not yet formalizable as an exact equality. + +## 6. Correctness + +**Assessment: Correct, with one minor concern.** + +### What is correct: + +- **Circle identification:** A circle in ℝ² is uniquely determined by its center and positive radius. The formalization correctly identifies circles as elements of `EuclideanSpace ℝ (Fin 2) × ℝ` with positive second component. No two distinct pairs `(center, radius)` describe the same geometric circle. + +- **The formula:** `Nat.choose (n - 1) 2 + 1 - (n - 1) / 2` correctly encodes `C(n-1, 2) + 1 - ⌊(n-1)/2⌋`. Since all arithmetic is over `ℕ`: + - `Nat.choose (n-1) 2 = (n-1)(n-2)/2` — correct. + - `(n-1) / 2` is natural number floor division — matches `⌊(n-1)/2⌋`. + - The subtraction is well-defined (no underflow) for n > 393 since `C(n-1,2) + 1` grows quadratically while `(n-1)/2` is linear. + +- **The threshold n > 393:** Matches the literature (Elliott's original bound applies for n > 393, and Purdy-Smith's correction preserves this threshold). + +- **Non-degeneracy conditions:** Both `¬AllOnCircle S` and `¬AllCollinear S` are necessary and correct. The problem would be trivial without either condition. + +- **`sInf` behavior:** When no valid configuration exists (e.g., for very small n where no set of n points can be non-collinear and non-concyclic), `sInf ∅ = 0` for `ℕ`, which matches the docstring's stated behavior ("returns 0 when no such configuration exists"). + +- **Equality vs. inequality:** The theorem uses `=` (exact minimum), which is justified: Purdy-Smith proved the lower bound, and the configuration of n-1 points on a circle plus one point off it achieves exactly this count, establishing a matching upper bound. + +### Minor concern: + +- **`minDeterminedCircles` uses `sInf` on a set of natural numbers.** In Mathlib, `sInf` on `ℕ` returns 0 for the empty set and otherwise the true infimum (minimum, since ℕ is well-ordered). For the image set `numDeterminedCircles '' {S | ...}`, if the set is nonempty (which it is for n ≥ 4, say), `sInf` correctly returns the minimum. This is fine, but worth noting that the definition implicitly relies on the well-ordering of ℕ and the behavior of `sInf` for `ℕ` in Mathlib. + +### Overall verdict: + +The formalization is **mathematically sound** and faithfully captures the resolved (large-n) case of Erdős Problem 506. The main suggestions are stylistic: use Mathlib's `Collinear` instead of the custom parametric definition, adopt the `ℝ²` notation for consistency, add the missing `[BaBa94]` citation, and consider cross-referencing related problems #104 and #831. diff --git a/ai-review/511.md b/ai-review/511.md new file mode 100644 index 0000000000..18194c0676 --- /dev/null +++ b/ai-review/511.md @@ -0,0 +1,82 @@ +# AI Review: Erdos Problem 511 + +## 1. Code Reuse + +Problem 509 (`FormalConjectures/ErdosProblems/509.lean`) deals with the same family of sublevel sets `{z : |f(z)| ≤ 1}` for monic polynomials `f ∈ ℂ[z]`, including Pommerenke-attributed results. However, 509 uses the `BoundedDiscCover` structure (covering by discs with bounded total radius), which is not directly applicable to 511's concern with connected components and diameter bounds. + +No existing definitions in `FormalConjecturesForMathlib/` directly capture "number of connected components of a set satisfying a diameter condition." The formalization's approach of quantifying over indexed families of preconnected subsets is a reasonable workaround that avoids needing such a definition. + +No significant code reuse opportunities identified. + +## 2. Citations + +The docstring currently references only "Disproved by Pommerenke" with no further bibliographic detail. The [erdosproblems.com/511](https://www.erdosproblems.com/511) page lists substantially more: + +- **Original sources:** Erdős–Herzog–Piranian (EHP58, p. 142), Erdős (Er61, p. 247), Hayman (Ha74, Problem 4.9) +- **Disproof:** Pommerenke (Po61) +- **Independent result:** Huang (Hu25) +- **Upper bound (diameter ≤ 4):** Pólya (Po28) + +**Recommendation:** Add the original source references and mention Pólya's diameter-4 upper bound, which contextualizes why the conjecture concerns `c > 1` specifically. The Huang independent result is also worth noting. + +## 3. Variants + +The website describes several related results/variants not captured in the formalization: + +1. **Pólya's theorem (Po28):** No connected component of `{z : |f(z)| ≤ 1}` can have diameter exceeding 4. This is the complementary upper bound and could be formalized as a solved variant. +2. **Total diameter sum:** The original problem also asked whether `∑ diam(C) ≤ n · 2^{1/n}`, where the sum is over all connected components. The polynomial `f(z) = z^n - 1` achieves `(1 + o(1)) · n · 2^{1/n}`. +3. **Roots in the unit disc:** Whether requiring all roots to satisfy `|z| ≤ 1` implies no component has diameter > 1. This is false via the example `f(z) = z^n + 1`. + +**Recommendation:** At minimum, add Pólya's diameter-4 bound as a variant (it is a clean, solved statement). The total diameter sum question is also formalizable. + +## 4. Readability + +The code is concise and readable. Minor suggestions: + +- The module docstring switches between `|f(z)|` and `‖f(z)‖` notation between the informal and formal statements. This is fine (they coincide for ℂ) but worth noting for consistency. +- The theorem docstring could be slightly more explicit about what `answer(False)` means in context (i.e., the answer to the conjecture is "no"). + +Overall readability is good. + +## 5. Formalizability + +The original problem is precise enough to formalize. The key concepts (monic polynomial over ℂ, sublevel set, connected components, diameter, boundedness independent of degree) are all well-defined. + +The one ambiguity in the original statement is "O_c(1)" — this means a constant depending on c but not on the degree n. The formalization correctly captures this by quantifying `∃ M : ℕ` after fixing `c` and before quantifying over polynomials `f`. + +**Ambiguity level: Low.** The statement is mathematically precise. + +## 6. Correctness + +### 6a. Answer value + +`answer(False)` is correct. Pommerenke disproved the conjecture. + +### 6b. Preconnected subsets vs. connected components + +The formalization does **not** directly count connected components of the sublevel set. Instead, it quantifies over arbitrary indexed families `C : Fin k → Set ℂ` of pairwise disjoint, nonempty, preconnected subsets of the sublevel set with diameter > c, and asks whether `k ≤ M`. + +This is a **strictly stronger** statement than the original conjecture (which only concerns the actual connected components). The formalization's statement implies the original conjecture but not vice versa: + +- Any collection of connected components with diameter > c forms a valid family of preconnected, pairwise disjoint, nonempty subsets with diameter > c. +- But one could also find many pairwise disjoint preconnected subsets of diameter > c **within a single connected component**. + +**However, this does not affect correctness of the answer.** Since `answer(False)`: + +- We need to show the RHS is false (i.e., ¬RHS). +- Pommerenke's result produces polynomials with arbitrarily many connected components of diameter ≥ d (for any 0 < d < 4). Taking these connected components as the preconnected subsets directly witnesses ¬RHS. +- In the forward direction, ¬(original conjecture) → ¬RHS follows because RHS → original conjecture. + +So the two formulations are **equivalent in truth value** (both false), and the proof obligation is satisfiable. + +### 6c. Strict vs. non-strict inequality + +The formalization uses `‖Polynomial.eval z f‖ < 1` (strict, open sublevel set), matching the original conjecture. The Pommerenke disproof applies to `|f(z)| ≤ 1` (non-strict, closed sublevel set). Since connected components of the closed sublevel set contain connected open subsets of the open sublevel set with the same diameter, the disproof transfers. This is mathematically sound. + +### 6d. The range of c + +The conjecture asks about `c > 1`. Pólya proved no component can exceed diameter 4, so for `c ≥ 4` the conjecture is vacuously true (zero components). Pommerenke's disproof covers `0 < d < 4`, so for `1 < c < 4` the conjecture fails. The formalization's universal quantification over all `c > 1` correctly captures that the conjecture claims this for **every** `c > 1`, and the disproof only needs one counterexample value of c. + +### Summary + +The formalization is **correct** for the purpose of establishing `answer(False)`. The use of preconnected subsets rather than connected components is a reasonable encoding that yields an equivalent truth value. An experienced mathematician would note the substitution but would agree it does not introduce error in this context. diff --git a/ai-review/512.md b/ai-review/512.md new file mode 100644 index 0000000000..0e309ecc47 --- /dev/null +++ b/ai-review/512.md @@ -0,0 +1,84 @@ +# Review: Erdős Problem 512 + +## 1. Code Reuse + +Several other problems define similar exponential sum helpers: + +- **Problem 987** (`987.lean:47-49`): Defines `exponentialSum` as `∑ j ∈ Finset.range n, Complex.exp (2 * ↑Real.pi * Complex.I * ↑((k : ℝ) * x j))`, summing over a range with a sequence of real inputs. +- **Problem 225** (`225.lean:45-47`): Defines `trigPoly` as `∑ k ∈ range (n+1), c k * Complex.exp (↑k * ↑θ * Complex.I)`, a trigonometric polynomial with explicit coefficients (and no `2π` factor). + +These are structurally similar but semantically distinct: Problem 512 sums over an arbitrary `Finset ℤ` with unit coefficients, Problem 987 sums over a range with a multiplicative parameter `k`, and Problem 225 uses explicit coefficients without the `2π` normalization. A shared additive character `e(x) = exp(2πix)` utility in `FormalConjecturesForMathlib` could unify the `2πi`-exponential pattern across Problems 512, 987, and 974, but the differing sum structures (arbitrary finset vs. range, integer vs. real arguments) mean the full sum definitions would still diverge. No existing code in `FormalConjecturesForMathlib/` is directly reusable for this problem. + +**Verdict:** The local definition `expSum512` is reasonable. A shared `e : ℝ → ℂ` (or `ℂ → ℂ`) additive character helper could reduce duplication across multiple problems but is not strictly necessary. + +## 2. Citations + +The formalization cites: + +- [Ko81] Konyagin, S.V., *On a problem of Littlewood*, Izv. Akad. Nauk SSSR Ser. Mat. 45 (1981), 243–265. +- [MPS81] McGehee, O.C., Pigno, L., and Smith, B., *Hardy's inequality and the L¹ norm of exponential sums*, Ann. of Math. 113 (1981), 613–618. + +These match the solvers listed on the website. However, the website also attributes the original problem to **Erdős [Er61, p.247]**, which the formalization omits. The original Erdős reference should be added to the docstring for completeness. + +**Verdict:** Add `[Er61] Erdős, P., 1961.` (or the full reference if available) as the original problem source. + +## 3. Variants + +The website does not mention any variants of this problem. The statement is a single clean conjecture (now theorem). The formalization captures the full problem as stated. + +**Verdict:** No missing variants. + +## 4. Readability + +The code is concise and well-structured: + +- The helper `expSum512` is clearly documented with a LaTeX docstring explaining the notation `e(nθ) = e^{2πinθ}`. +- The main theorem `erdos_512` has a clear docstring stating the result. +- The namespace `Erdos512` and `open Finset BigOperators MeasureTheory` are standard for this codebase. + +One minor note: the multiplication order in the exponential is `2 * ↑Real.pi * ↑n * ↑θ * Complex.I`, placing `I` at the end. Problem 987 uses `2 * ↑Real.pi * Complex.I * ↑(...)`, placing `I` in the middle. Both are mathematically equivalent but stylistically inconsistent across the codebase. This is cosmetic and not a correctness issue. + +**Verdict:** Readable. No changes needed. + +## 5. Formalizability + +The problem as stated on the website is: + +> Is it true that for a finite set A ⊂ ℤ of size N: ∫₀¹ |∑_{n∈A} e(nθ)| dθ ≫ log N? + +This is entirely precise and directly formalizable: +- "finite set A ⊂ ℤ" → `Finset ℤ` +- "e(nθ) = e^{2πinθ}" → standard additive character, no ambiguity +- "∫₀¹ |·| dθ" → interval integral of the complex modulus +- "≫ log N" → existence of an absolute constant C > 0 such that the integral is ≥ C · log N + +There is no ambiguity in this statement. + +**Verdict:** Fully and unambiguously formalizable. Assessment: **no ambiguity**. + +## 6. Correctness + +The formalization is mathematically correct. Detailed verification: + +| Aspect | Status | Notes | +|--------|--------|-------| +| Exponential sum `expSum512` | ✓ | `exp(2πnθi)` correctly encodes `e(nθ) = e^{2πinθ}`. All coercions (ℤ → ℂ, ℝ → ℂ) are correct. Multiplication in ℂ is commutative, so the order of factors does not matter. | +| Domain of summation | ✓ | `Finset ℤ` correctly models "finite set A ⊂ ℤ". | +| Cardinality condition `2 ≤ A.card` | ✓ | Ensures log |A| > 0 (since log 2 > 0), making the lower bound non-trivial. For |A| ≤ 1, log |A| ≤ 0, so the bound would be vacuously true; the condition is not strictly necessary but is mathematically clean. | +| Norm `‖expSum512 A θ‖` | ✓ | For `z : ℂ`, `‖z‖ = Complex.abs z = |z|`, the complex modulus. Matches |∑ e(nθ)|. | +| Integral `∫ θ in (0:ℝ)..1, ...` | ✓ | Interval integral over [0,1] with respect to Lebesgue measure. Matches ∫₀¹ · dθ. | +| Lower bound `C * Real.log (A.card : ℝ)` | ✓ | `Real.log` is the natural logarithm. The asymptotic ≫ notation is base-independent (changing base only changes the constant C). The cast `(A.card : ℝ)` correctly lifts ℕ to ℝ. | +| Existential `∃ C, 0 < C ∧ ...` | ✓ | Correctly encodes the "≫" (Vinogradov) notation as existence of a positive absolute constant. | + +**Verdict:** The formalization is **correct and complete**. No mathematical flaws identified. The statement faithfully captures Littlewood's conjecture as proved by Konyagin and McGehee–Pigno–Smith. + +## Summary + +| Category | Rating | +|----------|--------| +| Code reuse | Minor opportunity (shared additive character), not required | +| Citations | **Missing original Erdős reference [Er61]** | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/514.md b/ai-review/514.md new file mode 100644 index 0000000000..52493d28bc --- /dev/null +++ b/ai-review/514.md @@ -0,0 +1,160 @@ +# Review: Erdos Problem 514 + +**File:** `FormalConjectures/ErdosProblems/514.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `maxModulus` definition.** + +The file defines `Erdos514.maxModulus`, which computes the supremum of `‖f z‖` over points on the circle of radius `r`. This identical definition (same signature, same body, same docstring) appears in three other files: + +- `FormalConjectures/ErdosProblems/227.lean` (as `Erdos227.maxModulus`) +- `FormalConjectures/ErdosProblems/1117.lean` (as `Erdos1117.maxModulus`) +- `FormalConjectures/ErdosProblems/1118.lean` (as `Erdos1118.maxModulus`) + +All four definitions are verbatim duplicates: +```lean +noncomputable def maxModulus (f : ℂ → ℂ) (r : ℝ) : ℝ := + sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖} +``` + +**Recommendation:** Factor `maxModulus` into a shared utility file (e.g., `FormalConjecturesForMathlib/Analysis/Complex/MaxModulus.lean` or a similar location) and have all four problem files import it. This is a straightforward deduplication. + +No other reusable code from `FormalConjecturesForMathlib` is applicable. The problem is in complex analysis and the relevant definitions (`Differentiable`, `Polynomial.eval`, `Tendsto`, `Continuous`) are all standard Mathlib. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/514](https://www.erdosproblems.com/514):** + +The website lists: +- **Status:** Open (the overall problem remains open; only part 1 is solved). +- **References:** [Er61, p.249], [Er82e]. +- **Partial result:** Boas (unpublished) proved the affirmative answer to the first part. +- **Tags:** Analysis. +- **Contributor:** Boris Alexeev. + +The formalization's docstring currently says: +> *Reference:* [erdosproblems.com/514](https://www.erdosproblems.com/514) + +**Issues:** +- The references `[Er61, p.249]` and `[Er82e]` from the website are not mentioned in the formalization's docstring. These should be included for traceability. +- The Boas attribution in the `erdos_514` docstring ("proved by Boas, unpublished") is consistent with the website. Good. +- The website does not provide full bibliographic details for the Boas result (it is described as unpublished), so the current attribution is as detailed as possible. + +--- + +## 3. Variants + +The website describes **three** related questions for Problem 514: + +| # | Question | Formalized? | Status | +|---|----------|-------------|--------| +| 1 | Does there exist a path L to ∞ such that \|f(z)/z^n\| → ∞ for every n? | Yes (`erdos_514`) | Solved (Boas) | +| 2 | Can the **length** of such a path be estimated in terms of M(r)? | **No** | Open | +| 3 | Does there exist a path along which \|f(z)\| ≥ M(\|z\|)^ε for all ε > 0? | Yes (`erdos_514.variants.max_modulus_growth`) | Open | + +**Missing variant:** Question (2), about estimating the *length* of the path in terms of the maximum modulus M(r), is not captured by any formalization. This would require a notion of arc length of the path γ restricted to the disk of radius R, and a bound relating it to M(R). + +**Recommendation:** Add a variant for question (2), or at minimum note its omission in the docstring. A possible formalization sketch: +```lean +-- The length of γ restricted to {t | ‖γ t‖ ≤ R} can be bounded by some function of M(R). +``` +This is harder to formalize precisely due to the vagueness of "estimate," but even stating that the arc length grows at most polynomially in M(R) would capture the intent. + +--- + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- **Docstrings:** Both theorems have clear, informative docstrings that explain the mathematical content. The module docstring provides good context. Well done. +- **Namespace:** The `Erdos514` namespace is appropriate. +- **`open` declarations:** `open Complex Filter Topology` is appropriate for the imports used. +- **Structure:** The file is short (64 lines) and focused. No issues. + +Overall readability is **good**. No changes needed. + +--- + +## 5. Formalizability + +### Main theorem (`erdos_514`) +**Assessment: Unambiguous and clearly formalizable.** + +The statement "for every entire transcendental function, there exists a continuous path going to infinity along which the function grows faster than any polynomial" is precise. All terms have standard mathematical meanings: +- "Entire" = holomorphic on all of ℂ (`Differentiable ℂ f`) +- "Transcendental" = not equal to any polynomial (`¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z`) +- "Path going to infinity" = continuous γ with ‖γ(t)‖ → ∞ +- "Grows faster than any polynomial" = ‖f(γ(t))‖/‖γ(t)‖^n → ∞ for all n + +**Ambiguity level: None.** + +### Variant (`max_modulus_growth`) +**Assessment: Moderately ambiguous.** + +The website asks whether \|f(z)\| can grow "faster than M(r)^ε" along some path, but does not specify the range of ε. The natural reading is ε ∈ (0, 1), since for ε ≥ 1 the statement is trivially false (see Correctness below). The use of `answer(sorry)` accommodates unknown truth value, but the domain of ε affects which answer is correct. + +**Ambiguity level: Moderate** — the range of ε is not stated explicitly on the website. + +--- + +## 6. Correctness + +### Main theorem (`erdos_514`) — **Correct** + +```lean +theorem erdos_514 : + ∀ f : ℂ → ℂ, Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∃ γ : ℝ → ℂ, Continuous γ ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + ∀ n : ℕ, Tendsto (fun t => ‖f (γ t)‖ / ‖γ t‖ ^ n) atTop atTop +``` + +- **`Differentiable ℂ f`**: Correctly captures "f is entire" (complex-differentiable everywhere). +- **Transcendentality**: `¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z` correctly excludes polynomial functions. +- **Path to infinity**: `Continuous γ ∧ Tendsto (fun t => ‖γ t‖) atTop atTop` correctly models a continuous path whose modulus tends to infinity. +- **Growth condition**: `∀ n : ℕ, Tendsto (fun t => ‖f (γ t)‖ / ‖γ t‖ ^ n) atTop atTop` correctly says f grows faster than any monomial z^n along the path. Since ‖γ t‖ → ∞, this is equivalent to "faster than any polynomial." +- **Status tags**: `@[category research solved, AMS 30]` — correctly marked as solved. AMS 30 (Functions of a complex variable) is the correct classification. + +**Verdict: Correct and faithful to the Boas result.** + +### Variant (`max_modulus_growth`) — **Incorrect domain for ε** + +```lean +theorem erdos_514.variants.max_modulus_growth : + answer(sorry) ↔ + ∀ f : ℂ → ℂ, Differentiable ℂ f → + (¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z) → + ∀ ε : ℝ, 0 < ε → + ∃ γ : ℝ → ℂ, Continuous γ ∧ + Tendsto (fun t => ‖γ t‖) atTop atTop ∧ + ∀ᶠ t in atTop, (maxModulus f ‖γ t‖) ^ ε ≤ ‖f (γ t)‖ +``` + +**Critical issue: The quantifier `∀ ε : ℝ, 0 < ε` includes ε ≥ 1, making the RHS trivially false.** + +By the definition of `maxModulus`, for any point z on the circle of radius r, we have ‖f(z)‖ ≤ M(r) = `maxModulus f r`. In particular, since γ(t) lies on the circle of radius ‖γ(t)‖, we have: + +$$\|f(\gamma(t))\| \leq M(\|\gamma(t)\|)$$ + +For ε = 1, the inequality `M(‖γ(t)‖)^1 ≤ ‖f(γ(t))‖` requires `M(r) ≤ ‖f(γ(t))‖`, which combined with the upper bound means the path must achieve the maximum modulus eventually. This is far stronger than the intended question. + +For ε > 1 (e.g., ε = 2), we would need `M(r)^2 ≤ ‖f(γ(t))‖ ≤ M(r)`, i.e., `M(r)^2 ≤ M(r)`, which fails for M(r) > 1. Since M(r) → ∞ for transcendental entire functions, this is impossible eventually. + +Therefore, the RHS is **false** for any entire transcendental function when ε ≥ 1, making `answer(sorry)` necessarily `False`, and the problem trivially solvable. This defeats the purpose of the formalization — the actual open question is about ε ∈ (0, 1). + +**Recommendation:** Restrict ε to the interval (0, 1): +```lean +∀ ε : ℝ, 0 < ε → ε < 1 → +``` + +### Minor issue: `maxModulus` for negative `r` + +The definition `maxModulus f r` uses `sSup {x : ℝ | ∃ z : ℂ, ‖z‖ = r ∧ x = ‖f z‖}`. When `r < 0`, no complex number has norm `r`, so the set is empty and `sSup ∅ = 0` (by the convention for `sSup` on `ℝ` in Mathlib with `ConditionallyCompleteLattice`; actually `sSup ∅ = ⊥` which for `ℝ` is problematic since it uses `csInf_empty`). In practice, `r = ‖γ t‖ ≥ 0` so this doesn't arise, but adding `(hr : 0 ≤ r)` as a hypothesis or noting this in the docstring would improve robustness. + +**Overall verdict:** The main theorem is correct. The variant has a substantive error in the domain of ε that makes it trivially false rather than capturing the intended open problem. The missing path-length variant (question 2) is a gap in coverage. diff --git a/ai-review/515.md b/ai-review/515.md new file mode 100644 index 0000000000..a24c40aab6 --- /dev/null +++ b/ai-review/515.md @@ -0,0 +1,84 @@ +# Review: Erdős Problem 515 + +## 1. Code Reuse + +Several files in the codebase contain closely related patterns: + +- **Problem 1115** (`ErdosProblems/1115.lean`): Defines `IsEntire`, `HasFiniteOrder`, and an `ArcLengthPath` structure with `eVariationOn` for bounded variation. Problem 515 could benefit from reusing the `IsEntire` definition (`Differentiable ℂ f`) for readability, though the inline usage is also fine. The `ArcLengthPath` structure in 1115 is more rigid (arc-length parameterized) than what 515 needs (locally rectifiable), so it is not directly reusable here. + +- **Problem 514** (`ErdosProblems/514.lean`): Uses a nearly identical preamble pattern — `Differentiable ℂ f`, `¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z`, `Continuous γ`, `Tendsto (fun t => ‖γ t‖) atTop atTop`. The non-polynomial check and path-to-infinity patterns are duplicated verbatim. A shared predicate for "entire transcendental function" and "path tending to infinity" could be factored out, but this is a minor style point. + +- **Problem 1118** (`ErdosProblems/1118.lean`): Uses `IntegrableOn` over `Ioi 0` with a similar integrand structure. + +**Verdict:** No critical code reuse opportunity is missed. The duplication with Problem 514 is idiomatic for this codebase. + +## 2. Citations + +The formalization's docstring cites: +- [Zh77] Zhang (1977) — finite order case +- [LRW84] Lewis, Rossi, Weitsman (1984) — general case + +The website (erdosproblems.com/515) additionally lists: +- **[Er61,p.249]** — original Erdős reference (1961), not cited in the formalization +- **[Er82e]** — second Erdős reference, not cited +- **[Hu57]** — Huber (1957), who proved the weaker result that for *each* λ > 0, a path C_λ exists (but not a single path for all λ simultaneously). This important historical predecessor is mentioned on the website but **omitted from the docstring**. + +**Recommendation:** Add the Huber [Hu57] result to the docstring, as it provides important context distinguishing the "for each λ" result from the "for all λ simultaneously" result that is the actual content of the problem. The Erdős references [Er61,p.249] and [Er82e] should also be noted. + +## 3. Variants + +The website does not list explicit sub-variants of Problem 515. The formalization mentions the Lewis–Rossi–Weitsman generalization (replacing |f| with e^u for subharmonic u) in the docstring, which matches the website. This generalization is not separately formalized, which is reasonable — it would require defining subharmonic functions, which are not currently in the codebase. + +**Verdict:** No missing variants. + +## 4. Readability + +The code is clear and well-structured. A few minor observations: + +- The parameter name `l` for the exponent λ is adequate but could be `lambda` or `λ` for closer correspondence with the mathematical statement. (Minor.) +- The docstring clearly explains the parametrization and the integral formula, which is helpful for understanding the pullback representation. +- The `open MeasureTheory Filter Set` is appropriately scoped. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The original problem statement is precise and unambiguous: +- "Entire function, not a polynomial" — well-defined. +- "Locally rectifiable path tending to infinity" — standard terminology. +- "For every λ > 0, the integral ∫_C |f(z)|^{-λ} |dz| is finite" — clear and well-defined (assuming the path avoids zeros of f, which is implicit). + +The one subtlety is whether the integral is with respect to `dz` (complex line integral) or `|dz|` (arc length integral). The website writes `dz`, but the standard mathematical interpretation for a *finiteness* question about a non-negative integrand is the arc length integral `|dz|`. The formalization correctly uses `|dz|` (via `‖deriv γ t‖`). + +**Verdict:** High formalizability. The statement is precise enough to be obviously formalizable with no ambiguity issues. + +## 6. Correctness + +The formalization captures the problem accurately with some technical subtleties worth noting: + +### 6.1 Overall structure +The statement `answer(True) ↔ ∀ f, ... ∃ γ, ...` correctly encodes: "Yes, for every non-polynomial entire function, such a path exists." This matches the proved-in-the-affirmative status. + +### 6.2 Entire non-polynomial function +`Differentiable ℂ f ∧ ¬ ∃ p : Polynomial ℂ, ∀ z, f z = p.eval z` correctly characterizes entire transcendental functions. + +### 6.3 Path properties +- `Continuous γ` — correct. +- `LocallyBoundedVariationOn γ (Ici 0)` — correctly captures "locally rectifiable." A path is locally rectifiable iff it has bounded variation on every compact sub-interval, which is what `LocallyBoundedVariationOn` provides. +- `Tendsto (fun t => ‖γ t‖) atTop atTop` — correctly captures "tending to infinity." + +### 6.4 The integral (main subtlety) + +The integrand is `fun t => ‖f (γ t)‖ ^ (-l) * ‖deriv γ t‖`, which represents the pullback of the line integral ∫_C |f(z)|^{-λ} |dz|. + +**Zeros of f:** When f(γ(t)) = 0, the mathematical integrand |f(z)|^{-λ} = ∞, but Mathlib's `Real.rpow` convention gives `(0 : ℝ) ^ (-l) = 0` for l > 0. This means the Lean integrand is 0 at zeros rather than infinite. However, this does not affect correctness: +- Since γ is existentially quantified, a correct proof would construct γ avoiding zeros of f. +- Along a path avoiding zeros, the Lean integrand agrees exactly with the mathematical one. +- The zeros of an entire function form a discrete (hence countable, hence measure-zero) set, so even if γ passes through finitely many zeros, this doesn't affect the integral value. + +**BV vs. absolutely continuous parameterization:** For a locally BV function γ, the formula ∫ g(γ(t)) |γ'(t)| dt computes the line integral with respect to the *absolutely continuous* part of the arc length measure, potentially missing a singular component. If γ were BV but not absolutely continuous, `‖deriv γ t‖` integrated over [0, T] could be strictly less than the total variation. However, since γ is existentially quantified, the proof can (and would) choose a Lipschitz or piecewise-smooth path, which is absolutely continuous, making the formula exact. This is not a correctness issue. + +### 6.5 Domain of integration +`IntegrableOn ... (Ici 0) volume` integrates over [0, ∞), which is the correct domain for a path parametrized on [0, ∞). + +**Verdict:** The formalization is **correct and complete**. The `rpow` junk-value convention at zeros and the BV-vs-AC distinction are technical subtleties that do not affect the mathematical validity of the statement, due to the existential quantification over γ. An experienced mathematician would not identify any flaws. diff --git a/ai-review/518.md b/ai-review/518.md new file mode 100644 index 0000000000..5a2f3b393c --- /dev/null +++ b/ai-review/518.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 518 + +**File:** `FormalConjectures/ErdosProblems/518.lean` + +## 1. Code Reuse + +The codebase already contains a well-developed `IsPathCover` definition in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Invariants.lean` (line 140), which formalizes a partition of vertices into vertex-disjoint paths using `SimpleGraph.Walk.IsPath`. This includes: +- Pairwise disjointness of vertex sets +- Full vertex coverage +- Each set corresponding to a valid graph path + +Mathlib also provides `SimpleGraph.Walk` and `SimpleGraph.Walk.IsPath` in `Mathlib.Combinatorics.SimpleGraph.Walks.Basic` and `Mathlib.Combinatorics.SimpleGraph.Paths`, respectively. These could be used instead of the custom `IsMonochromaticPath` / `List`-based approach, though the current approach using `List.IsChain` is lightweight and self-contained, which has its own advantages. + +For the bound, Mathlib provides `Nat.ceil` (`⌈·⌉₊`) in `Mathlib.Algebra.Order.Floor.Defs` and `Real.sqrt` in `Mathlib.Analysis.SpecialFunctions.Pow`, which could express `⌈√n⌉` directly rather than the current overapproximation. + +## 2. Citations + +The docstring references three citations: +- **[ErGy95]** — Erdős and Gyárfás (1995): matches the website, which attributes the problem to Erdős and Gyárfás. +- **[GeGy67]** — Gerencsér and Gyárfás (1967): matches the website, which credits them with proving two paths suffice if they need not be the same colour. +- **[PVW24]** — Pokrovskiy, Versteegen, and Williams (2024): matches the website, which credits them with solving the problem affirmatively. + +All citations are consistent with the information on [erdosproblems.com/518](https://www.erdosproblems.com/518). The website also includes a special thanks to Zach Hunter, which is not reflected in the formalization (but this is not a citation issue). + +## 3. Variants + +The website lists only the single problem statement with no explicit variants. The formalization captures the main problem. The Gerencsér–Gyárfás result (paths of different colours) is mentioned in the docstring as context but is not formalized separately. This is acceptable since it is background rather than a variant of the problem itself. + +## 4. Readability + +The code is clear and well-structured. The helper definition `IsMonochromaticPath` is cleanly separated and documented. The docstring explains the relationship between the formalized bound and the mathematical bound. + +Minor suggestions: +- The docstring could note that `Nat.sqrt n + 1` is strictly weaker than `⌈√n⌉` for perfect squares (e.g., for n = 4, `⌈√4⌉ = 2` but `Nat.sqrt 4 + 1 = 3`), rather than just stating the inequality `⌈√n⌉ ≤ Nat.sqrt n + 1`. + +## 5. Formalizability + +The problem as stated on the website is: + +> *"Is it true that, in any two-colouring of the edges of K_n, there exist √n monochromatic paths, all of the same colour, which cover all vertices?"* + +This is precise enough to be formalizable. The only mild ambiguity is: +- **"√n paths"** — since √n is typically irrational, this implicitly means ⌈√n⌉ (the smallest integer ≥ √n). This is standard. +- **"cover all vertices"** — in the context of path covers in graph theory, this standardly means a partition of the vertex set into vertex-disjoint paths. This interpretation is reinforced by the related Gerencsér–Gyárfás result and the fact that the problem would be trivial without disjointness. + +**Formalizability assessment: Low ambiguity.** The statement is standard and well-understood in the Ramsey theory / graph partitioning literature. + +## 6. Correctness + +There are two correctness issues, one significant and one moderate: + +### Issue A (Significant): Missing vertex-disjointness of paths + +The formalization requires only that every vertex appears in some path: +```lean +(∀ v : Fin n, ∃ p ∈ paths, v ∈ p) +``` + +This is a **covering** condition, not a **partition** condition. The original problem asks for paths that "cover all vertices," which in graph theory standardly means a **vertex-disjoint path cover** (partition). Without disjointness, the problem is strictly weaker — overlapping paths could double-count vertices, making it easier to cover everything. + +This matters because: +- The companion result of Gerencsér–Gyárfás (two paths partitioning the vertices) uses disjoint paths. +- The optimality claim (√n is best possible) only makes sense for disjoint paths. +- Without disjointness, one could trivially cover all vertices with n singleton paths of any colour, and the question of whether √n suffice becomes uninteresting. + +**Recommended fix:** Add a pairwise disjointness condition, e.g.: +```lean +(∀ p₁ ∈ paths, ∀ p₂ ∈ paths, p₁ ≠ p₂ → p₁.Disjoint p₂) ∧ +``` +Alternatively, the existing `IsPathCover` from `FormalConjecturesForMathlib` could be adapted for use here (it already includes disjointness). + +### Issue B (Moderate): Bound is weaker than intended + +The formalization uses `Nat.sqrt n + 1` (= ⌊√n⌋ + 1) as the bound. The docstring acknowledges this satisfies `⌈√n⌉ ≤ Nat.sqrt n + 1`, but for perfect squares the inequality is strict: +- n = 4: ⌈√4⌉ = 2, but Nat.sqrt 4 + 1 = 3 +- n = 9: ⌈√9⌉ = 3, but Nat.sqrt 9 + 1 = 4 + +This makes the formalized statement strictly weaker than the original conjecture for infinitely many values of n. The bound could be tightened using `Nat.ceil (Real.sqrt ↑n)` or by defining a custom ceiling square root on naturals. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Symmetry of colouring | ✓ Correctly enforced via `∀ i j, c i j = c j i` | +| Two-colouring | ✓ Correctly modeled via `Bool` | +| Monochromatic paths | ✓ `IsMonochromaticPath` correctly uses `List.IsChain` | +| Path validity (no repeated vertices) | ✓ Enforced by `Nodup` | +| Same colour for all paths | ✓ Single `b : Bool` used for all paths | +| Vertex coverage | ⚠ Covering only, missing disjointness | +| Bound | ⚠ `Nat.sqrt n + 1` is weaker than ⌈√n⌉ | +| Solved status | ✓ `answer(True)` is correct per [PVW24] | diff --git a/ai-review/519.md b/ai-review/519.md new file mode 100644 index 0000000000..144d80757c --- /dev/null +++ b/ai-review/519.md @@ -0,0 +1,64 @@ +# Review: Erdős Problem 519 (Turán's Power Sum Problem) + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib`. Problem 519 concerns complex-analytic power sums, which is distinct from the additive combinatorics infrastructure (sum-free sets, Sidon sets, sumsets, Schur numbers, etc.) that constitutes the bulk of the existing codebase. The formalization is self-contained and appropriately so. + +The related Problem 973 (`FormalConjectures/ErdosProblems/973.lean`) shares the same domain (power sums of complex numbers) and uses a similar structural pattern (`Fin n → ℂ`, power sum norms, existential constants). If both problems were to be extended or refactored, a shared definition for power sums (e.g., `fun k => ∑ i : Fin n, z i ^ k`) could be extracted, but this is not necessary given the current scope. + +## 2. Citations + +**Website ([erdosproblems.com/519](https://www.erdosproblems.com/519)) lists:** +- Source references: **[Er61, p.251]** and **[Er65b, p.213]** — these are the original Erdős sources. +- [At61b] Atkinson (1961) — present in formalization ✓ +- [Bi94] Biró (1994) — present in formalization ✓ +- [Bi00] Biró (2000) — present in formalization ✓ + +**Missing from the formalization docstring:** +- The original source citations **[Er61, p.251]** and **[Er65b, p.213]** should be included. The full references are: + - Erdős, P., *Problems and results on the theory of interpolation*, Acta Math. Acad. Sci. Hungar. 12 (1961), p.251. + - Erdős, P., *Extremal problems in number theory* (1965), p.212. +- The website also notes upper bounds: $R_n < 5/6$ for all large $n$ and $R_n < 0.69368$ via computer search. These are not mentioned but are contextual rather than essential. +- The website lists this problem as related to **Problem 973**, which could be cross-referenced in the docstring. + +## 3. Variants + +The formalization captures the **core result** (existence of an absolute constant $c > 0$) but does not capture several known quantitative refinements mentioned on the website: + +1. **Turán's original bound**: $\max_{1 \le k \le n} |\sum z_i^k| \gg 1/n$ — could be formalized as a separate, weaker theorem. +2. **Atkinson's bound**: $c = 1/6$ suffices — a specific quantitative strengthening. +3. **Biró's bounds**: $c = 1/2$ (1994), then $c > 1/2$ for an absolute constant (2000). +4. **Upper bounds on the optimal constant** $R_n$: $\limsup R_n < 1$, $R_n < 5/6$, and $R_n < 0.69368$ — these show the constant cannot be made arbitrarily large. + +None of these variants are essential for the core formalization, but the Biró result ($c > 1/2$) could be a natural strengthening to state as a corollary. + +## 4. Readability + +The code is clean and concise. Minor observations: + +- The use of `k.val + 1` to shift `Fin n` (ranging 0 to $n-1$) into the mathematical range $1$ to $n$ is standard but slightly opaque. An alternative would be to use a natural number `k` with explicit bounds `1 ≤ k` and `k ≤ n`, which would more closely mirror the mathematical statement. However, the current approach is idiomatic Lean and avoids carrying extra proof terms. +- The docstring theorem attribution `[At61b]` is somewhat misleading — Atkinson proved a specific bound ($c = 1/6$), not the general existence statement. The existential formulation is closer to the original Turán conjecture, solved progressively by Atkinson and Biró. +- The `answer(True)` wrapper is used correctly and consistently with the solved status. + +## 5. Formalizability + +**Assessment: Unambiguous and directly formalizable.** + +The problem statement is precise: it asks for the existence of a universal constant $c > 0$ such that a specific inequality holds for all $n$ and all complex sequences with $z_1 = 1$. Every quantifier and object is well-defined. There is no ambiguity in the mathematical content. + +The only subtlety is whether the inequality should be strict ($> c$) or non-strict ($\geq c$). The formalization uses strict inequality (`c < ‖...‖`), which is equivalent in strength to non-strict since the constant is existentially quantified (if $c$ works with $\geq$, then $c/2$ works with $>$). This is a non-issue. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization accurately captures the mathematical content: + +- **Quantifier structure**: $\exists c > 0, \forall n \geq 1, \forall z : \text{Fin } n \to \mathbb{C}$ — correct. The constant $c$ is universal (independent of $n$ and the sequence). +- **Constraint**: $z_1 = 1$ via `z ⟨0, hn⟩ = 1` — correct. The problem does **not** require $|z_i| \geq 1$ for all $i$ (that constraint belongs to Problem 973), and the formalization correctly omits it. +- **Conclusion**: $\exists k \in \{1, \ldots, n\}, |\sum_i z_i^k| > c$ — correctly encoded via `∃ k : Fin n, c < ‖∑ i : Fin n, z i ^ (k.val + 1)‖`. The existential over $k$ is equivalent to asserting the maximum exceeds $c$. +- **Index range**: `k.val + 1` ranges from 1 to $n$, matching $\max_{1 \le k \le n}$ — correct. +- **Answer**: `answer(True)` and `@[category research solved, AMS 30]` — correct per the website (status: PROVED). +- **AMS classification**: AMS 30 (Functions of a complex variable) is appropriate for this problem about power sums of complex numbers. + +**No mathematical flaws detected.** The formalization is faithful to the problem as stated on erdosproblems.com. diff --git a/ai-review/52.md b/ai-review/52.md new file mode 100644 index 0000000000..987e1bba8d --- /dev/null +++ b/ai-review/52.md @@ -0,0 +1,138 @@ +# Review: Erdős Problem 52 + +**File:** `FormalConjectures/ErdosProblems/52.lean` + +--- + +## 1. Code Reuse + +**No significant code reuse issues.** The formalization is self-contained, relying only on Mathlib's `Finset` pointwise operations (`A + A`, `A * A`) via `open scoped Pointwise`. These are standard Mathlib definitions from `Mathlib.Algebra.Group.Pointwise.Set.Basic`, where `A + A = image2 (· + ·) A A` (and similarly for `*`). + +The `FormalConjecturesForMathlib` library contains related additive combinatorics infrastructure: +- `Combinatorics/Basic.lean` defines `IsSumFree`, `IsSidon` — not directly relevant here. +- `Combinatorics/Additive/Convolution.lean` defines `sumConv` and `sumRep` — relevant to counting representations but not to this statement. +- `Combinatorics/Additive/Basis.lean` defines additive/multiplicative bases — not applicable. + +None of these are useful for Problem 52's statement, which only needs the cardinalities of `A + A` and `A * A`. The formalization correctly uses the simplest available tools. + +**Neighboring problem:** Erdős Problem 53 (`ErdosProblems/53.lean`) is thematically related (also by Erdős–Szemerédi, same citation [ErSz83]) but concerns *subset* sums/products rather than *pairwise* sumsets/product sets, so its definitions (`subsetSums`, `subsetProducts`) are not applicable here. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/52](https://www.erdosproblems.com/52):** + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open ($250 bounty) | **Correct.** | +| AMS classification | `AMS 5 11` | Number theory, Additive combinatorics | **Correct.** | +| Erdős–Szemerédi (1983) | `[ErSz83]` — full bibliographic entry | Referenced | **Correct.** | +| Bloom (2025) | `[Bl25]` — "New bounds on the sum-product problem" | Referenced with bound $\|A\|^{1270/951 - o(1)}$ | **Correct.** Matches docstring. | +| Basit–Lund (2019) | Not mentioned | $\|A\|^{4/3+c}$ for $\mathbb{C}$ | **N/A** — this is for a variant over $\mathbb{C}$; omission is acceptable since the formalization is over $\mathbb{Z}$. | +| Mohammadi–Stevens (2023) | Not mentioned | Finite field variant | **N/A** — same reasoning. | + +**Minor note:** The website mentions a $250 bounty. The formalization does not record this, which is fine — bounties are metadata, not mathematical content. + +**Assessment: Citations are correct and sufficient for the integer case as formalized.** + +--- + +## 3. Variants + +The website documents several variants not captured by the formalization: + +**1. Higher-fold generalization:** +For $m \geq 2$ and finite $A$: +$$\max(|mA|, |A^m|) \gg |A|^{m - o(1)}$$ +where $mA = A + A + \cdots + A$ ($m$ times). This is a natural strengthening. It could be formalized as: +```lean +theorem erdos_52_higher_fold : + ∀ m : ℕ, m ≥ 2 → + ∀ ε : ℝ, ε > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + max ((Finset.sum (Finset.replicate m A) id).card : ℝ) + ((Finset.prod (Finset.replicate m A) id).card : ℝ) + ≥ c * (A.card : ℝ) ^ (m - ε) +``` +(The exact Lean spelling of $m$-fold sumsets would need care.) + +**2. Variants over other fields/rings:** +- Over $\mathbb{R}$: same best bound (Bloom 2025). Could be stated by replacing `Finset ℤ` with `Finset ℝ`. +- Over $\mathbb{C}$: weaker bounds known (Basit–Lund 2019, $|A|^{4/3+c}$). +- Over $\mathbb{F}_p$: different flavor with $|A| < p^c$ constraints (Mohammadi–Stevens 2023). + +**3. The Erdős–Szemerédi upper bound:** +The 1983 paper also showed that the exponent 2 is best possible up to the $\varepsilon$ correction, proving $\max(|A+A|,|AA|) \leq |A|^2 \exp(-c \log|A|/\log\log|A|)$ for some sets. This could be formalized as a companion result. + +**Assessment:** The core conjecture over $\mathbb{Z}$ is captured. The higher-fold generalization is the most notable omission, as it appears on the website as a named variant. The field variants are sufficiently different to warrant separate problem entries. + +--- + +## 4. Readability + +The code is clean and minimal. Specific observations: + +- **Module docstring:** Clear, includes the conjecture statement in LaTeX, credits Erdős–Szemerédi, notes the best known bound, and provides full bibliographic references. +- **Theorem docstring:** Restates the conjecture formally with LaTeX, includes the current best bound with citation. +- **Namespace:** `Erdos52` is appropriate and consistent with the project convention. +- **Opens:** `open Finset Real` and `open scoped Pointwise` are minimal and appropriate. `Finset` is needed for `card`, `Real` for `ℝ`, and `Pointwise` for `A + A` / `A * A`. +- **No auxiliary definitions needed** — the statement is self-contained using Mathlib primitives. + +**No readability issues found.** The file is one of the cleanest in the collection. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The Erdős–Szemerédi sum-product conjecture is precisely stated in the literature. The key concepts are all well-defined: + +- **Sumset** $A + A = \{a + b \mid a, b \in A\}$ and **product set** $AA = \{ab \mid a, b \in A\}$ are standard. +- The conjecture uses $\gg_\varepsilon$ (Vinogradov) notation, which is standard shorthand for "there exists $c = c(\varepsilon) > 0$ such that $\text{LHS} \geq c \cdot \text{RHS}$." The formalization correctly expands this. +- The exponent $2 - \varepsilon$ and the universal quantifier over $\varepsilon > 0$ are the standard way to express "exponent approaching 2." + +**Potential ambiguity:** None. Unlike many Erdős problems that involve vague terms like "sufficiently large" with unspecified dependencies, this conjecture has a clean $\forall \varepsilon > 0, \exists c > 0, \forall A$ structure that translates directly. + +**Ambiguity level: None.** This is a textbook example of a precisely stated conjecture. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Theorem statement + +```lean +theorem erdos_52 : + ∀ ε : ℝ, ε > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + max ((A + A).card : ℝ) ((A * A).card : ℝ) ≥ c * (A.card : ℝ) ^ (2 - ε) := by + sorry +``` + +- **Quantifier structure:** $\forall \varepsilon > 0, \exists c > 0, \forall A$ with $|A| \geq 2$ — this correctly captures the Vinogradov notation $\max(|A+A|, |AA|) \gg_\varepsilon |A|^{2-\varepsilon}$. The constant $c$ is allowed to depend on $\varepsilon$ (it is existentially quantified after $\varepsilon$). + +- **Pointwise operations:** `A + A` (resp. `A * A`) with `open scoped Pointwise` on `Finset ℤ` computes $\{a + b \mid a, b \in A\}$ (resp. $\{a \cdot b \mid a, b \in A\}$) as a `Finset ℤ`. This is the standard sumset/product set. ✓ + +- **Cardinality casts:** `(A.card : ℝ)`, `((A + A).card : ℝ)`, `((A * A).card : ℝ)` cast natural number cardinalities to real numbers. This is necessary because the exponent `2 - ε` is real-valued, so `(A.card : ℝ) ^ (2 - ε)` uses `Real.rpow` (or the `HPow ℝ ℝ ℝ` instance). ✓ + +- **The `max` function:** `max ((A + A).card : ℝ) ((A * A).card : ℝ)` correctly computes the maximum of the two cardinalities as a real number. ✓ + +- **The guard `(A.card : ℝ) ≥ 2`:** This excludes singleton and empty sets. For $|A| = 1$: $|A+A| = |AA| = 1$ and $c \cdot 1^{2-\varepsilon} = c$, so the bound would force $c \leq 1$ for every $\varepsilon$. This is not an actual obstruction (one can always take $c$ small enough), but requiring $|A| \geq 2$ is a standard and harmless convention. For $|A| = 0$: $|A+A| = |AA| = 0$, and $0^{2-\varepsilon} = 0$ for $\varepsilon < 2$ (which is the interesting range), so $c \cdot 0 = 0 \leq 0$ holds trivially. Thus the guard is not strictly necessary for the conjecture's truth value, but it matches the standard statement. ✓ + +- **Exponent `(2 - ε)`:** For $0 < \varepsilon < 2$, this gives an exponent in $(0, 2)$, which is the interesting range. For $\varepsilon \geq 2$, the exponent $2 - \varepsilon \leq 0$, and $|A|^{2-\varepsilon} \leq 1$ for $|A| \geq 2$, so the bound becomes trivial (since $|A+A| \geq |A| \geq 2 > c$ for small $c$). Thus the statement is vacuously true for large $\varepsilon$ and only has content for small $\varepsilon$, which is the correct behavior. ✓ + +### Subtle point: `A + A` includes self-sums + +In the Pointwise definition, `A + A = image₂ (· + ·) A A`, which includes elements $a + a$ for $a \in A$ (i.e., pairs $(a, b)$ with $a = b$ are included). This matches the standard mathematical convention where $A + A = \{a + b : a, b \in A\}$ allows $a = b$. Similarly for $A * A$. ✓ + +### Comparison with the website statement + +The website states: $\max(|A+A|, |AA|) \gg_\varepsilon |A|^{2-\varepsilon}$. The formalization faithfully unpacks $\gg_\varepsilon$ as $\exists c > 0$ depending on $\varepsilon$. ✓ + +**Verdict: Correct and complete.** The formalization faithfully captures the Erdős–Szemerédi sum-product conjecture over $\mathbb{Z}$. No mathematical flaws are present. The only notable omission relative to the website is the higher-fold generalization (see §3), which is a variant rather than the core conjecture. diff --git a/ai-review/521.md b/ai-review/521.md new file mode 100644 index 0000000000..5c2ee1edb1 --- /dev/null +++ b/ai-review/521.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 521 + +## 1. Code Reuse + +**`IsRademacher`**: This definition is duplicated verbatim across 5 files: 521.lean, 523.lean, 524.lean, 527.lean, and 1144.lean. It should be extracted to a shared utility (e.g., `FormalConjectures/Util/Rademacher.lean`) and imported. No such shared definition currently exists in the codebase. + +**`numRealRoots`**: Unique to 521.lean. Problem 522 uses Mathlib's `Polynomial.roots` (which gives a multiset over the splitting field) rather than a count of real roots. There is no existing utility in the codebase for counting real roots. The definition using `Set.ncard` is reasonable, though one might alternatively use `Polynomial.roots` composed with a filter, as 522 does for complex roots in the unit disk. + +**`signPoly`**: Unique to 521.lean. Related problems define similar polynomial constructions locally (e.g., `supNormCircle` in 523, `supNormInterval` in 524, `randomPowerPartialSum` in 527), but none are directly reusable since each problem evaluates the polynomial differently. + +**`iIndepFun`**: Correctly imported from Mathlib via `ProblemImports`. Used consistently across 11+ problem files. + +## 2. Citations + +The docstring mentions: +> Erdős and Offord showed that the number of real roots of a random degree $n$ polynomial with $\pm 1$ coefficients is $(2/\pi + o(1)) \log n$ in expectation. + +The website (erdosproblems.com/521) provides the following specific references that should be cited: +- **[EO56]** P. Erdős and A.C. Offord — the expectation result mentioned in the docstring. +- **[Er61, p.252]** — the original Erdős formulation of the almost sure conjecture. +- **[Do24]** Y. Do — proved that for roots restricted to $[-1,1]$, $\lim_{n\to\infty} R_n[-1,1]/\log n = 1/\pi$ almost surely. + +**Recommendation**: The docstring should include the specific reference keys [EO56] and [Er61, p.252] rather than the vague attribution "Erdős and Offord showed." The Do (2024) partial result should also be mentioned, ideally alongside a variant formalization. + +## 3. Variants + +The formalization captures only the main conjecture. The website indicates the following variants/related results that are **not captured**: + +1. **Do's partial result (2024)**: For real roots restricted to $[-1,1]$, the almost sure limit $R_n[-1,1]/\log n \to 1/\pi$ has been proved. This is a natural variant and could be formalized as a solved companion theorem, analogous to how 522.lean includes `erdos_522.variants.yakir_solution`. + +2. **{0,1} coefficient variant**: The website notes ambiguity in Erdős's original statement — he may have intended coefficients from $\{0,1\}$ instead of $\{-1,1\}$. For $\{0,1\}$ coefficients, the expected constant is $1/\pi$ rather than $2/\pi$. This could be captured as an additional variant. + +3. **Expectation result (Erdős–Offord)**: The convergence in expectation $\mathbb{E}[R_n]/\log n \to 2/\pi$ is mentioned in the docstring but not formalized. This solved result would be a natural companion (cf. the pattern in 522.lean which includes `erdos_522.variants.number_real_roots`). + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The module docstring clearly states the problem in LaTeX notation. +- Helper definitions (`signPoly`, `numRealRoots`, `IsRademacher`) have clear docstrings. +- The namespace `Erdos521` prevents name collisions. +- The `open` declarations are appropriate and not overly broad. +- Minor: The `signPoly` docstring uses `$\varepsilon(k)$` (function notation) while the theorem docstring uses `$\varepsilon_k$` (subscript notation). This is cosmetic but could be unified. + +## 5. Formalizability + +**Assessment: High precision, low ambiguity.** + +The problem as stated on the website is precise enough to be obviously formalizable. The key components — Rademacher random variables, polynomial construction, counting real roots, almost sure convergence — all have clear mathematical definitions. + +The one source of ambiguity noted on the website is whether Erdős intended $\{-1,1\}$ or $\{0,1\}$ coefficients. The formalization chooses $\{-1,1\}$ (Rademacher), which is the standard modern interpretation and matches the constant $2/\pi$. This is a reasonable choice, though the ambiguity should be acknowledged in the docstring. + +## 6. Correctness + +**Assessment: Mathematically correct and complete for the main conjecture.** + +Detailed analysis: + +- **`signPoly`**: Correctly constructs $\sum_{k=0}^{n} \varepsilon(k) \cdot X^k$ using `Finset.range (n+1)` and `Polynomial.C`/`Polynomial.X`. The use of `range (n + 1)` to sum over $\{0, 1, \ldots, n\}$ is correct. + +- **`numRealRoots`**: Uses `Set.ncard` on the root set $\{x \in \mathbb{R} \mid p.\text{IsRoot}\ x\}$. For a non-zero polynomial (which `signPoly` always is, since coefficients are $\pm 1$ and the constant term is non-zero), the root set is finite, so `Set.ncard` correctly returns the cardinality. For the zero polynomial, `Set.ncard` would return 0 (since the root set is infinite and `ncard` of an infinite set is 0), but this case cannot arise with Rademacher coefficients. + +- **`IsRademacher`**: The definition requires (1) $X(\omega) \in \{-1, 1\}$ for all $\omega$, and (2) $\mu\{X = 1\} = \mu\{X = -1\}$. Under a probability measure, conditions (1) and (2) together imply each event has probability $1/2$, which is the correct Rademacher distribution. **Note**: The definition does not explicitly require measurability of $X$. While `iIndepFun` implicitly handles the σ-algebra structure, adding `Measurable X` to `IsRademacher` would make the definition more self-contained. This is a minor robustness concern, not a correctness bug. + +- **Almost sure convergence**: The statement `∀ᵐ ω ∂μ, Tendsto (fun n => ...) atTop (nhds (2 / Real.pi))` correctly formalizes "$\lim_{n\to\infty} R_n/\log n = 2/\pi$ almost surely." + +- **Division edge cases**: At $n = 0$, `Real.log 0 = 0` (by Mathlib convention), so the ratio is $0/0 = 0$. At $n = 1$, `Real.log 1 = 0$, and the polynomial has 1 root, giving $1/0 = 0$. These finitely many "junk" values do not affect the `atTop` limit. No issue here. + +- **Universality**: The theorem is universally quantified over all probability spaces $(\Omega, \mu)$ and all families of independent Rademacher variables, which is the correct way to state such a probabilistic result in Lean without fixing a canonical probability space. + +**No mathematical flaws identified.** The formalization faithfully captures Erdős Problem 521 as stated on the website (under the standard $\{-1,1\}$ interpretation). + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code reuse | Needs improvement | `IsRademacher` duplicated across 5 files | +| Citations | Needs improvement | Missing specific references [EO56], [Er61], [Do24] | +| Variants | Incomplete | Missing Do's partial result, {0,1} variant, expectation result | +| Readability | Good | Clean, well-documented code | +| Formalizability | Excellent | Unambiguous (modulo {-1,1} vs {0,1} choice) | +| Correctness | Correct | No mathematical flaws found | diff --git a/ai-review/523.md b/ai-review/523.md new file mode 100644 index 0000000000..dd75d1a411 --- /dev/null +++ b/ai-review/523.md @@ -0,0 +1,84 @@ +# AI Review: Erdős Problem 523 + +## 1. Code Reuse + +**`IsRademacher` is duplicated across 5 files.** The identical definition appears in problems 521, 523, 524, 527, and 1144. This is the most significant code reuse opportunity in this file—`IsRademacher` should be factored into a shared utility (e.g., `FormalConjectures/Util/Rademacher.lean` or similar) and imported by all five files. + +`supNormCircle` is specific to this problem and does not have a direct reuse candidate elsewhere, though it is structurally analogous to `supNormInterval` in problem 524 (which takes the supremum over `[-1, 1]` instead of the unit circle). A generalized "sup of polynomial over a set" definition could unify both, but this may be over-engineering for the current codebase. + +No existing Mathlib definition of Rademacher random variables was found that could replace the local one. + +## 2. Citations + +The website ([erdosproblems.com/523](https://www.erdosproblems.com/523)) lists: + +- **[Er61, p.253]** — Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), 221–254. +- **[SaZy54]** — Salem and Zygmund (1954). +- **[Ha73]** — Halász (1973). + +The formalization's docstring mentions Salem and Zygmund and Halász by name only, without the citation keys `[SaZy54]` and `[Ha73]`. The original Erdős source `[Er61, p.253]` is not mentioned at all. These should be expanded to match the website's citation format, e.g.: + +> Salem and Zygmund [SaZy54] proved that √(n log n) is the right order of magnitude. Halász [Ha73] settled the problem, proving this is true with C = 1. + +The website also credits **Adrian Beker** as an acknowledgment, which is not reflected in the formalization. + +## 3. Variants + +The formalization captures only the main existential question ("does such a C exist?"). Two natural variants are missing: + +1. **Halász's precise result (C = 1):** The docstring states Halász proved C = 1, but the formal statement only asserts existence of *some* C > 0. A variant theorem pinning down C = 1 would be a stronger and more informative formalization of the known result: + ``` + theorem erdos_523.variants.halasz : ... ∀ᵐ ω ∂μ, Tendsto ... (nhds 1) + ``` + +2. **Salem–Zygmund order-of-magnitude bound:** The intermediate result that the supremum is Θ(√(n log n)) (without identifying the constant) is a weaker but historically important statement that could be formalized as a separate variant. + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- The docstring is clear and self-contained. +- The `open scoped BigOperators` is good practice. +- The namespace `Erdos523` is consistent with the project convention. +- The `supNormCircle` definition could benefit from a brief note that `sSup` is well-defined here because the unit circle is compact and the function is continuous, making the image a bounded nonempty set. This is not strictly necessary but would aid readers unfamiliar with Lean's `sSup` behavior. + +Overall readability is good; no significant issues. + +## 5. Formalizability + +**The problem is precise enough to be obviously formalizable.** The statement on the website is unambiguous: it asks about the almost sure asymptotic behavior of the supremum of a random Rademacher polynomial on the unit circle, with a specific functional form (C + o(1))√(n log n). The only minor interpretive choice is whether "almost surely" refers to convergence for a.e. ω (as formalized) or in probability, but the standard interpretation in this context is a.s. convergence, which is what the formalization uses. + +**Ambiguity assessment: Very low.** The mathematical objects (Rademacher random variables, unit circle, supremum norm, asymptotic convergence) are all standard and well-defined. + +## 6. Correctness + +**The formalization is mathematically correct**, with one nuance worth noting: + +- **Core equivalence is right:** The statement `supNormCircle(n) / √(n log n) → C` as n → ∞ is equivalent to max|f(z)| = (C + o(1))√(n log n), which is exactly what the problem asks. + +- **Quantifier structure:** The existential `∃ C` is inside `∀ {Ω ...}`, meaning C could in principle depend on the probability space. Mathematically, C = 1 universally (by Halász), so this is correct but slightly weaker than the full result. For the purpose of answering the yes/no question, this is appropriate. + +- **`answer(True)` is correct:** The problem is solved in the affirmative (Halász 1973), and the formalization correctly records this. + +- **`supNormCircle` is well-defined:** The set `{x | ∃ z : ℂ, ‖z‖ = 1 ∧ x = ‖Σ ε_k z^k‖}` is the image of a continuous function on the compact unit circle, hence compact, nonempty, and bounded. `sSup` in Lean's conditionally complete linear order on ℝ handles this correctly. + +- **Edge cases at small n:** When n is small, `Real.sqrt (n * Real.log n)` may be 0 (e.g., n = 0 or 1, where log n ≤ 0), causing division by zero. In Lean, division by 0 yields 0 by convention. This is harmless because `Tendsto ... atTop ...` only depends on eventual behavior, ignoring finitely many terms. + +- **Summation range:** `Finset.range (n + 1)` gives {0, ..., n}, matching the problem's Σ_{k ≤ n}. Correct. + +- **`iIndepFun ε μ`:** Uses the default Borel σ-algebra on ℝ, which is the standard choice. Correct. + +- **`IsRademacher` does not explicitly require measurability** of X, but since Mathlib's `Measure` assigns outer measure to all sets, the definition is technically sound. In a more pedantic formalization one might add a measurability hypothesis, but this is not a mathematical error. + +**No obvious flaws.** An experienced mathematician would find this formalization faithful to the original problem. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | `IsRademacher` duplicated in 5 files; should be shared | +| Citations | Missing citation keys [Er61], [SaZy54], [Ha73]; missing Adrian Beker credit | +| Variants | Missing C = 1 variant (Halász) and Salem–Zygmund Θ-bound | +| Readability | Good | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/524.md b/ai-review/524.md new file mode 100644 index 0000000000..d02047fa8e --- /dev/null +++ b/ai-review/524.md @@ -0,0 +1,102 @@ +# Review: Erdős Problem 524 + +## 1. Code Reuse + +**`IsRademacher` is duplicated across at least 5 files.** The identical definition appears in: +- `ErdosProblems/521.lean:46` +- `ErdosProblems/523.lean:36` +- `ErdosProblems/524.lean:46` +- `ErdosProblems/527.lean:41` +- `ErdosProblems/1144.lean:39` + +This is a strong candidate for extraction into a shared utility (e.g., `FormalConjectures/Util/Rademacher.lean` or `FormalConjecturesForMathlib/`). No such shared definition currently exists. + +The `supNormInterval` definition is specific to this problem and does not have a reusable counterpart, though `ErdosProblems/523.lean` defines an analogous `supNormCircle` for the unit circle in ℂ. + +## 2. Citations + +The website ([erdosproblems.com/524](https://www.erdosproblems.com/524)) lists the source as **[Er61, p.253]** and attributes the problem to **Salem and Zygmund [SaZy54]**. The docstring mentions "A problem of Salem and Zygmund" but does not include the specific citation keys `[SaZy54]` or `[Er61, p.253]`. These should be added to the docstring for traceability, e.g.: + +> *Source:* [Er61, p.253]. Originally a problem of Salem and Zygmund [SaZy54]. + +## 3. Variants + +**Chung's upper bound is mentioned in the docstring but not formalized.** The docstring states: + +> Chung showed: for a.a. $t$, there exist infinitely many $n$ such that $M_n(t) \ll (n / \log \log n)^{1/2}$. + +This could be formalized as a variant (e.g., `erdos_524.variants.upper_bound`) using `∃ᶠ n in atTop` (i.e., `Frequently`) and an appropriate bound. This is a meaningful partial result that complements the existing lower bound variant. + +Only the lower bound variant (`erdos_524.variants.lower_bound`) is currently formalized. + +## 4. Readability + +The code is generally clear and well-structured. Minor suggestions: + +- The docstring for the module header is thorough and explains the connection between binary digits and Rademacher random variables, which is helpful. +- The `supNormInterval` definition is readable, though a brief inline comment noting that `Finset.range n` with `k + 1` indexing yields $\sum_{k=1}^{n}$ (matching the original problem's 1-based indexing) could aid readers unfamiliar with the shift. + +## 5. Formalizability + +**The main problem is inherently difficult to formalize precisely.** It asks for "the correct order of magnitude" of $M_n(t)$, which the formalization captures as an unknown function `answer(sorry) : ℕ → ℝ` with the requirement that $M_n(\omega) = \Theta(f(n))$ almost surely. This is a reasonable encoding of an open problem whose answer is not yet known. + +The use of `=Θ[atTop]` (big-Theta) is the standard way to express "correct order of magnitude," so the formalization is faithful to the problem's intent. The ambiguity is minimal: the problem is precise enough to formalize, and the open nature is correctly reflected by `answer(sorry)`. + +**Assessment: Low ambiguity.** The problem statement on the website is precise. The only subtlety is whether "correct order of magnitude" means $\Theta$ (up to constants) or something more refined (e.g., an asymptotic equivalent). The $\Theta$ interpretation is standard and appropriate. + +## 6. Correctness + +### 6a. Main theorem (`erdos_524`) — Correct + +The main theorem correctly formalizes the problem: +- The `IsRademacher` + `iIndepFun` hypotheses correctly model the i.i.d. Rademacher sequence derived from the binary expansion. +- The `supNormInterval` definition correctly computes $M_n = \sup_{x \in [-1,1]} |\sum_{k=1}^{n} \varepsilon_k x^k|$ (the indexing shift via `k + 1` is correct: `Finset.range n` gives $\{0, \ldots, n-1\}$, and `ε (k+1) * x^(k+1)` yields terms for $k = 1, \ldots, n$). +- The `∀ᵐ ω ∂μ` quantifier correctly captures "for almost all $t$." +- The `=Θ[atTop]` correctly captures "correct order of magnitude." + +### 6b. Lower bound variant (`erdos_524.variants.lower_bound`) — **Likely too strong** + +**This is the most significant issue in the formalization.** + +The formalization states: +``` +Tendsto (fun n => M_n(ω) / n^(1/2 - δ)) atTop atTop +``` +This means $\lim_{n \to \infty} M_n(\omega) / n^{1/2 - \delta} = +\infty$, i.e., the ratio is **eventually** arbitrarily large. + +However, the website states Erdős proved: +$$\limsup_{n \to \infty} M_n(t) / n^{1/2 - \varepsilon} = \infty$$ + +The $\limsup = \infty$ statement is strictly weaker: it only asserts that the ratio exceeds any bound **infinitely often** (along some subsequence), not eventually. + +- `Tendsto ... atTop atTop` ⟹ `limsup = ⊤`, but not conversely. +- The distinction matters: there is no obvious reason $M_n$ should be monotone or eventually bounded below by $c \cdot n^{1/2-\delta}$. The polynomial's sup norm on $[-1,1]$ can fluctuate as new terms are added. + +**Recommendation:** Replace `Tendsto ... atTop atTop` with a `limsup` formulation: +```lean +Filter.limsup (fun n => supNormInterval (fun k => ε k ω) n / + (↑n : ℝ) ^ ((1 : ℝ)/2 - δ)) atTop = ⊤ +``` +or equivalently use `Frequently`: +```lean +∀ C > 0, ∃ᶠ n in atTop, + C ≤ supNormInterval (fun k => ε k ω) n / (↑n : ℝ) ^ ((1 : ℝ)/2 - δ) +``` + +The docstring also incorrectly says "$M_n(\omega) / n^{1/2 - \delta} \to \infty$" — it should say "$\limsup_{n \to \infty} M_n(\omega) / n^{1/2 - \delta} = \infty$" to match the known result. + +### 6c. Minor observations + +- The `IsRademacher` definition does not explicitly require `Measurable (ε k)`. While `iIndepFun` implicitly involves the generated σ-algebras, an explicit measurability hypothesis would make the statement more self-contained. +- The `sSup` in `supNormInterval` is well-defined: for any $n$, the set $\{|P_n(x)| : x \in [-1,1]\}$ is the image of a continuous function on a compact set, hence compact and nonempty. The conditional completeness of `ℝ` ensures `sSup` returns the correct value. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `IsRademacher` duplicated 5+ times; should be shared | +| Citations | Missing `[Er61, p.253]` and `[SaZy54]` keys | +| Variants | Chung's upper bound not formalized | +| Readability | Good | +| Formalizability | Low ambiguity; well-suited to formalization | +| Correctness | Main theorem correct; **lower bound variant uses `Tendsto` (limit) where `limsup` is needed** | diff --git a/ai-review/525.md b/ai-review/525.md new file mode 100644 index 0000000000..f50a474ffb --- /dev/null +++ b/ai-review/525.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 525 + +## 1. Code Reuse + +No reusable code from `FormalConjecturesForMathlib` applies here. The problem is about ±1-coefficient polynomials on the unit circle (Littlewood-type polynomials), which is entirely in the domain of complex analysis / harmonic analysis. The codebase's covering system infrastructure (`CoveringSystem.lean`), `ZMod` utilities, and arithmetic progression libraries are not relevant. The formalization is appropriately self-contained with its own definitions (`littlewoodEval`, `hasSmallValueOnCircle`, `countNoSmallValue`). + +## 2. Citations + +The formalization cites: + +> [Er61] Erdős, P., _Some unsolved problems_, Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), 221-254. + +The website (erdosproblems.com/525) lists the following references: **Er61, Li66, Ka87, Ko94, KoSc99, CoNg21**. The docstring mentions Kashin (1987), Konyagin (1994), and Cook and Nguyen (2021) by name but does not provide full bibliographic entries for these. The following citations from the website are absent: + +- **[Li66]** — Littlewood's original conjecture reference (likely *On Polynomials ∑±z^m*, J. London Math. Soc., 1966 or similar). +- **[Ka87]** — Kashin's proof of Littlewood's conjecture. +- **[Ko94]** — Konyagin's quantitative improvement. +- **[KoSc99]** — Konyagin and Schlag's near-optimality result. +- **[CoNg21]** — Cook and Nguyen's limiting distribution result. + +**Recommendation:** Add full citation entries for at least [Ka87] (the solver of the problem) and ideally the others, to match the website's reference list. + +## 3. Variants + +The website poses **two** questions: + +1. Is it true that all except $o(2^n)$ many ±1-polynomials of degree $n$ have $|f(z)| < 1$ for some $|z| = 1$? (**Captured.**) +2. What is the behaviour of $m(f) = \min_{|z|=1} |f(z)|$? (**Not formalized.**) + +The formalization only captures the first (yes/no) question. The second, more quantitative question — which led to Konyagin's bound $m(f) \leq n^{-1/2+o(1)}$ a.s. and Cook–Nguyen's identification of the limiting distribution — is mentioned in the docstring but not formalized as a separate theorem. These are natural variants/strengthenings: + +- **Konyagin's bound:** Almost all ±1-polynomials satisfy $\min_{|z|=1} |f(z)| \leq n^{-1/2+o(1)}$. +- **Cook–Nguyen limiting distribution:** The distribution of $\sqrt{n} \cdot m(f)$ converges. + +**Recommendation:** Consider adding at least Konyagin's bound as a separate conjecture/theorem statement, since the website explicitly asks about the behavior of $m(f)$ as a second question. + +## 4. Readability + +The code is well-written and readable: + +- **Good naming:** `littlewoodEval`, `hasSmallValueOnCircle`, `countNoSmallValue` are descriptive and self-documenting. +- **Clear docstrings:** Each definition and the main theorem have LaTeX-formatted documentation explaining the mathematical content. +- **Clean structure:** The namespace `Erdos525` keeps things organized; the `open` declarations are appropriate. +- **Minor note:** The use of `Bool` for sign vectors (true → +1, false → −1) is a natural encoding. An alternative would be `ZMod 2 → ℂ` or using `SignType`, but `Bool` is arguably the simplest choice and works well here. + +No readability improvements needed. + +## 5. Formalizability + +The problem statement is **precise and unambiguous**. "Almost all" in the combinatorial sense (all but $o(2^n)$) is completely well-defined, and the threshold $|f(z)| < 1$ on $|z| = 1$ is concrete. There is no ambiguity in the first question. + +The second question ("What is the behaviour of $m(f)$?") is inherently open-ended and less obviously formalizable as a single statement — it invites a research program rather than a yes/no answer. The formalization reasonably focuses on the first, precise question. + +**Assessment:** High formalizability. Ambiguity level: **none** for the formalized question. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed verification: + +- **Polynomial evaluation:** `littlewoodEval n ε z = ∑_{k=0}^{n} ε_k · z^k` with ε_k ∈ {+1, −1} correctly defines a ±1-coefficient polynomial of degree $n$ with $n+1$ coefficients. + +- **Counting:** The space `Fin (n + 1) → Bool` has cardinality $2^{n+1}$, which is the correct total count of ±1-polynomials of degree $n$. The theorem divides `countNoSmallValue n` by $2^n$ rather than $2^{n+1}$, but this is **equivalent**: $f(n)/2^n \to 0$ iff $f(n)/2^{n+1} \to 0$, since $2^{n+1} = 2 \cdot 2^n$ and constant factors do not affect little-$o$ asymptotics. The website's phrasing "at most $o(2^n)$ many" is faithfully captured. + +- **Topology:** The `Tendsto ... atTop (nhds 0)` formulation correctly expresses that the ratio converges to 0, which is the precise meaning of "$o(2^n)$". + +- **`answer(True)` wrapper:** The problem asks "Is it true that...?" and the problem is marked as solved (proved by Kashin 1987). Using `answer(True)` correctly reflects the affirmative resolution. + +- **AMS classification `[AMS 42]`:** AMS 42 is "Harmonic analysis on Euclidean spaces / Fourier analysis in one variable." This is appropriate — the problem concerns polynomials on the unit circle, which is squarely in the domain of harmonic/Fourier analysis. + +- **Category tag `research solved`:** Correct — the problem is proved. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the primary question posed in Erdős Problem 525. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No applicable reusable code; self-contained is appropriate | +| Citations | Primary citation [Er61] present; secondary citations [Ka87, Ko94, KoSc99, CoNg21, Li66] missing full entries | +| Variants | Main question formalized; quantitative behavior of $m(f)$ not formalized | +| Readability | Excellent | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete for the primary question | diff --git a/ai-review/526.md b/ai-review/526.md new file mode 100644 index 0000000000..ac897ae245 --- /dev/null +++ b/ai-review/526.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 526 + +## 1. Code Reuse + +**No significant reuse opportunities from FormalConjecturesForMathlib.** The most relevant file there is `CoveringSystem.lean`, which defines covering systems of congruence classes — a combinatorial/number-theoretic notion unrelated to random arc covering on a circle. + +The formalization already follows the standard probability patterns used in nearby problems (520–527): `IsProbabilityMeasure`, `iIndepFun`, `Measure.map ... = volume.restrict (Ico 0 1)`, and `∀ᵐ ω ∂μ`. These are idiomatic and consistent with the rest of the codebase. + +**Alternative circle representation:** The Lonely Runner Conjecture (`Wikipedia/LonelyRunnerConjecture.lean`) uses `UnitAddCircle` (i.e., `AddCircle 1`, which is `ℝ ⧸ ℤ`) with `dist` for circular distance. Problem 526 instead models the circle via `Int.fract` on `ℝ`. Both are valid. Using `UnitAddCircle` would be more "native" to Mathlib's circle API, but would require expressing uniform random variables and arc coverage in that quotient type, which may be more cumbersome. The current `Int.fract` approach is pragmatic and arguably more readable for this problem. + +## 2. Citations + +The formalization cites: +- **[Er61]** Erdős, P., *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. 6 (1961), p. 253. +- **[Sh72]** Shepp, L. A., *Covering the circle with random arcs*. Israel J. Math. 11 (1972), 328–345. + +The website additionally mentions: +- **[Dv56]** Dvoretzky, A. — originator of the covering problem (the problem is named "Dvoretzky's covering problem" in the formalization's docstring, but Dvoretzky's original reference is not cited). +- **[Ka59]** Kahane, J.-P. — proved the covering property for $a_n = (1+c)/n$ with $c > 0$. + +**Recommendation:** Add the Dvoretzky reference since the docstring explicitly names the problem after him. The Kahane reference is less critical since it is a partial result subsumed by Shepp's theorem. + +## 3. Variants + +The website describes the following historical special cases: +- Kahane showed covering holds for $a_n = (1+c)/n$, $c > 0$. +- Erdős (unpublished) extended this to $a_n = 1/n$. +- Erdős proved $a_n = (1-c)/n$, $c > 0$ does *not* give covering. + +These are all special cases of Shepp's necessary-and-sufficient condition, which is what the formalization captures. **No separate variant formalizations are needed** — the main theorem subsumes all of them. One could add corollaries demonstrating these special cases, but this is optional and would be pedagogical rather than mathematically necessary. + +## 4. Readability + +The code is well-structured and readable. Minor issues: + +- **Docstring inconsistency in `CircleFullyCovered`:** The docstring says "arcs at centers $\omega(n)$" but `CircArcCovers` defines $\omega(n)$ as the *starting point* of the arc, not its center. Should read "arcs starting at $\omega(n)$" for consistency. +- **`noncomputable` annotations** on `CircArcCovers` and `CircleFullyCovered` are correct (required by `Int.fract`), but these definitions are `Prop`-valued so the `noncomputable` tag is arguably unnecessary in practice (Lean does not need to compute `Prop` values). However, this is a cosmetic point and `noncomputable` does not cause any harm. +- The 0-indexed formulation (using `range (n + 1)` and `((n : ℝ) + 1) ^ 2`) is slightly harder to read than the 1-indexed mathematical convention ($\sum_{k=1}^n$ and $n^2$), but this is idiomatic for Lean's `ℕ`-indexed sequences and is correct. + +## 5. Formalizability + +**The problem is precisely formalizable.** Shepp's theorem provides an exact necessary-and-sufficient condition with no ambiguity. The mathematical statement involves: +- Standard probability theory (independent uniform random variables) +- A clear geometric predicate (arc covering on the circle) +- A clean series condition + +All components have well-defined Mathlib counterparts. The main challenge in a full proof would be: +- Establishing measurability of the covering event (requires showing the uncountable intersection/union can be reduced to a countable one via density arguments) +- The probabilistic analysis in Shepp's proof itself + +**Ambiguity assessment: Very low.** The statement is completely precise. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Arc covering predicate +`CircArcCovers (x y ℓ) ↔ Int.fract (y - x) < ℓ` correctly captures that point $y$ lies within an arc of length $\ell$ starting at $x$ on $\mathbb{R}/\mathbb{Z}$: +- `Int.fract` maps to $[0, 1)$, representing the positive-direction distance from $x$ to $y$ on the circle. +- Edge cases are handled correctly: $\ell \geq 1$ covers everything (since `Int.fract` < 1 ≤ ℓ); $\ell = 0$ covers nothing (since `Int.fract` ≥ 0); the starting point $x$ itself is covered when $\ell > 0$ (since `Int.fract 0 = 0 < ℓ`). + +### Full coverage predicate +`CircleFullyCovered` quantifies over $y \in [0, 1)$, which correctly represents all distinct points on $\mathbb{R}/\mathbb{Z}$. + +### Shepp's series condition +The series $\sum_{n=0}^{\infty} \frac{\exp(a_0 + \cdots + a_n)}{(n+1)^2}$ is a 0-indexed version of Shepp's $\sum_{n=1}^{\infty} \frac{\exp(a_1 + \cdots + a_n)}{n^2}$. These are identical under the substitution $m = n + 1$. ✓ + +### Divergence via `¬Summable` +Since all terms of the series are strictly positive ($\exp > 0$, denominator $> 0$, arc lengths $\geq 0$), `¬Summable` is equivalent to divergence to $+\infty$. This correctly captures "$\sum = \infty$". ✓ + +### Hypotheses +- `ha_nonneg`: $a_n \geq 0$ ✓ +- `ha_tendsto`: $a_n \to 0$ ✓ +- `ha_diverges`: $\sum a_n = \infty$ (via `¬Summable`) ✓ +- `hX_meas`: measurability of each random variable ✓ +- `hX_unif`: uniform distribution on $[0,1)$ ✓ +- `hX_indep`: mutual independence ✓ + +### Potential subtlety +The `iIndepFun` hypothesis uses the default measurable space instance for `ℝ` (Borel σ-algebra), which is the standard choice for independence of real-valued random variables. This is correct. + +**Overall: No mathematical errors found. The formalization faithfully captures Shepp's theorem as stated on the Erdős Problems website.** diff --git a/ai-review/527.md b/ai-review/527.md new file mode 100644 index 0000000000..8451fe45ed --- /dev/null +++ b/ai-review/527.md @@ -0,0 +1,96 @@ +# Erdős Problem 527 — Review + +## 1. Code Reuse + +**`IsRademacher` is duplicated across at least 5 files.** The identical definition: + +```lean +def IsRademacher {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (X : Ω → ℝ) : Prop := + (∀ ω, X ω = 1 ∨ X ω = -1) ∧ + μ {ω | X ω = 1} = μ {ω | X ω = -1} +``` + +appears in namespaces `Erdos521`, `Erdos523`, `Erdos524`, `Erdos527`, and `Erdos1144`. This should be factored out into a shared utility in `FormalConjecturesForMathlib` (e.g., `FormalConjecturesForMathlib/Probability/Rademacher.lean`), as all five problems depend on this concept. + +No other code from `FormalConjecturesForMathlib` is directly reusable for this problem. The `randomPowerPartialSum` helper is specific to problem 527 and is appropriately defined locally. + +## 2. Citations + +The formalization includes: +- **[Er61]** Erdős, P., *Some unsolved problems*, Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961), p.254. ✅ +- **[MiSa25]** Michelen, M. and Sawhney, M., *Random signs of power series* (2025). ✅ + +**Missing citation:** The website also references **[DE59]** — Dvoretzky and Erdős, who showed that if $|a_n| > c/\sqrt{n}$ for some $c > 0$, then for almost all sign choices, the series diverges at every $|z| = 1$. This result provides important context (the $o(1/\sqrt{n})$ condition is essentially sharp) and should be cited in the docstring, even though it is not part of the formal statement. + +## 3. Variants + +The website notes: + +> "It remains unclear whether Erdős intended to also assume monotonicity: $|a_{n+1}| \leq |a_n|$." + +The formalization does **not** include a monotonicity assumption. This is a reasonable choice — the Michelen–Sawhney result proves the statement without monotonicity, so the formalization captures the strongest known version. However, this ambiguity in Erdős's original intent should be mentioned in the docstring for completeness, since a reader consulting the original source [Er61] may encounter this question. + +No other variants are listed on the website. + +## 4. Readability + +The code is well-structured and readable overall. Minor observations: + +- The docstring clearly states both the problem and the resolution (Michelen–Sawhney, Hausdorff dimension 1). +- `randomPowerPartialSum` has a clear name and docstring relating it to $\sum_{k=0}^{n-1} \varepsilon_k a_k z^k$. +- The use of `open MeasureTheory ProbabilityTheory Filter Finset BigOperators` is standard for this kind of statement. +- The type coercion `((ε k * a k : ℝ) : ℂ)` in `randomPowerPartialSum` is slightly noisy but unavoidable given the real-to-complex embedding. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise enough for formalization: +- "Almost all choices of signs $\varepsilon_n = \pm 1$" has an unambiguous measure-theoretic interpretation (product measure on $\{-1,1\}^{\mathbb{N}}$, or equivalently, iid Rademacher variables on any probability space). +- The conditions $\sum |a_n|^2 = \infty$ and $|a_n| = o(1/\sqrt{n})$ are standard analytic conditions. +- The conclusion "there exists $z$ with $|z|=1$ such that $\sum \varepsilon_n a_n z^n$ converges" is unambiguous. + +The only source of ambiguity is the possible monotonicity assumption discussed above, which does not affect the formalized statement's correctness. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** Detailed verification: + +### Hypotheses + +1. **$\sum |a_n|^2 = \infty$** is encoded as `¬Summable (fun n => a n ^ 2)`. Since $a_n \in \mathbb{R}$, we have $a_n^2 = |a_n|^2$, and non-summability of the sequence of squares is equivalent to the series diverging. ✅ + +2. **$|a_n| = o(1/\sqrt{n})$** is encoded as `Tendsto (fun n => |a n| * Real.sqrt (↑n : ℝ)) atTop (nhds 0)`. This says $|a_n| \sqrt{n} \to 0$, which is the standard formulation of the little-o condition. ✅ + +### Probability setup + +3. The universal quantification over an arbitrary probability space `(Ω, μ)` with iid Rademacher variables is the correct abstract approach — it avoids fixing a specific construction of the product space while capturing the mathematical content. ✅ + +4. **`IsRademacher` correctness:** The definition requires (a) $X(\omega) \in \{-1, 1\}$ for all $\omega$, and (b) $\mu(\{X = 1\}) = \mu(\{X = -1\})$. Combined with `IsProbabilityMeasure μ` and the fact that $\{X=1\} \cup \{X=-1\} = \Omega$ (from condition (a)), this forces each to have measure $1/2$. ✅ + +5. **Independence:** `iIndepFun ε μ` correctly expresses that the family $(\varepsilon_k)_{k \in \mathbb{N}}$ is mutually independent. ✅ + +### Conclusion + +6. The conclusion `∀ᵐ ω ∂μ, ∃ z : ℂ, ‖z‖ = 1 ∧ ∃ S : ℂ, Tendsto (randomPowerPartialSum (fun k => ε k ω) a z) atTop (nhds S)` correctly states: for $\mu$-almost every $\omega$, there exists a point $z$ on the unit circle such that the partial sums of $\sum \varepsilon_k(\omega) a_k z^k$ converge. ✅ + +7. **`answer(True)`** is correct — the problem has been solved in the affirmative by Michelen and Sawhney. ✅ + +### Minor technical note + +The `IsRademacher` definition does not explicitly require measurability of $X$. In Mathlib, `μ` can be applied to arbitrary sets (via outer measure), so this is not a type error, but a proof of `erdos_527` would likely need measurability as an additional fact. This is a minor incompleteness in the definition rather than an error — the theorem statement remains correct since any proof would need to work with measurable Rademacher variables anyway. + +### Hausdorff dimension + +The docstring mentions that Michelen–Sawhney proved the set of such $z$ has Hausdorff dimension 1, but this stronger result is not formalized. This is acceptable — the problem as posed by Erdős only asks for existence of at least one such $z$, and formalizing the Hausdorff dimension result would be a separate (harder) theorem. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `IsRademacher` should be factored out (duplicated in 5+ files) | +| Citations | Missing [DE59] (Dvoretzky–Erdős) | +| Variants | Monotonicity variant not mentioned in docstring | +| Readability | Good | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/528.md b/ai-review/528.md new file mode 100644 index 0000000000..2d44312fdf --- /dev/null +++ b/ai-review/528.md @@ -0,0 +1,187 @@ +# Review: Erdős Problem 528 + +**File:** `FormalConjectures/ErdosProblems/528.lean` + +--- + +## 1. Code Reuse + +**Issue: `LatticeAdj` and the self-avoiding walk definition are duplicated verbatim in Problem 529.** + +Problem 529 (`FormalConjectures/ErdosProblems/529.lean`, lines 37–45) defines: +```lean +def LatticeAdj {k : ℕ} (x y : Fin k → ℤ) : Prop := + (∑ i : Fin k, |x i - y i|) = 1 + +def selfAvoidingWalks (n k : ℕ) : Set (Fin (n + 1) → (Fin k → ℤ)) := + {w | w 0 = 0 ∧ + (∀ i : Fin n, LatticeAdj (w ⟨i.val, by omega⟩) (w ⟨i.val + 1, by omega⟩)) ∧ + Function.Injective w} +``` + +This is identical to the walk set defined inside `selfAvoidingWalkCount` in 528 (lines 47–50), just factored into its own named definition. Both files define their own copy of `LatticeAdj`. + +**Recommendation:** Promote `LatticeAdj` and `selfAvoidingWalks` to a shared definition in `FormalConjecturesForMathlib/` (or a shared utility file). Problem 528's `selfAvoidingWalkCount` should then be defined as `Set.ncard (selfAvoidingWalks n k)`, reusing 529's set definition. This would eliminate the duplication and ensure consistency between the two closely related problems. + +**Additional note:** The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` file defines graph walks, paths, and distance metrics on `SimpleGraph`. One could alternatively define the integer lattice as a `SimpleGraph (Fin k → ℤ)` with adjacency given by `LatticeAdj` and then define SAWs as injective graph walks. This would be more aligned with Mathlib conventions but is a larger refactor. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/528](https://www.erdosproblems.com/528):** + +The website lists: +- **Status:** Open +- **References:** Hammersley–Morton (1954), Kesten (1963) +- **Additional results not in the formalization:** Clisby–Liang–Slade (2007) refined asymptotics; Conway–Guttmann (1993) lower bound $C_2 \geq 2.62$; Alm (1993) upper bound $C_2 \leq 2.696$; Jacobsen–Scullard–Guttmann (2016) numerical computation $C_2 = 2.6381585...$ +- **Related problem:** Problem 529 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open | **Correct.** | +| AMS classification | `AMS 5 82` | Combinatorics / Statistical mechanics | **Correct.** AMS 82 is statistical mechanics, appropriate for self-avoiding walks. | +| [HM54] reference | `Hammersley, J. M. and Morton, K. W., Poor man's Monte Carlo. J. Roy. Statist. Soc. Ser. B (1954), 23–38.` | Same | **Correct.** | +| [Ke63] reference | `Kesten, H., On the number of self-avoiding walks. J. Math. Phys. (1963), 960–969.` | Same | **Correct.** | +| Additional references | Not mentioned | Clisby–Liang–Slade (2007), Conway–Guttmann (1993), Alm (1993), Jacobsen–Scullard–Guttmann (2016) | **Missing but optional.** These provide numerical/asymptotic improvements and could enrich the docstring. | +| Related problem | Not mentioned | Problem 529 | **Missing.** Problem 529 is directly related (expected distance of SAW endpoints) and shares the same definitions. A cross-reference would be helpful. | + +**No citation errors found.** The two references present are complete and match the website. The additional results from the website are supplementary and their omission is not a flaw, but including them (especially the $k=2$ results) would improve the docstring. + +--- + +## 3. Variants + +The formalization includes one variant: + +- **`erdos_528.variants.existence_with_bounds`** (line 79): Asserts that $C_k$ exists and satisfies $k \leq C_k \leq 2k - 1$. Tagged `category research solved`. + +**Missing variants from the website:** + +1. **The hexagonal lattice case ($k = 2$, honeycomb):** Duminil-Copin and Smirnov (2012) proved that the connective constant of the honeycomb lattice is $\sqrt{2 + \sqrt{2}}$. This is one of the most celebrated results in this area. While technically for a different lattice, it is directly relevant and could be stated as a variant. + +2. **Asymptotic expansion:** Kesten's result $C_k = 2k - 1 - 1/(2k) + O(1/k^2)$ (mentioned in the main theorem's docstring) could itself be formalized as a variant, separate from the exact determination. + +3. **Two-dimensional numerical bounds:** The known bounds $2.62 \leq C_2 \leq 2.696$ (Conway–Guttmann 1993, Alm 1993) could be formalized as a concrete variant for $k = 2$. + +**Assessment:** The existence-with-bounds variant is appropriate and correctly captures the Hammersley–Morton/Kesten result. The asymptotic expansion is mentioned in prose but not formalized — this is a reasonable choice since formalizing $O(1/k^2)$ asymptotics is non-trivial. The honeycomb lattice result is a different problem and its omission is defensible. + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Docstrings:** The module docstring clearly explains $f(n,k)$, $C_k$, and the problem. The theorem docstrings reference the relevant results. Good. +- **Namespace:** `Erdos528` is appropriate. +- **Opens:** `open Classical Finset BigOperators Filter` — appropriate for `Set.ncard`, `∑`, `Tendsto`/`atTop`. +- **Definition names:** `LatticeAdj`, `selfAvoidingWalkCount`, `connectiveConstant` are clear and descriptive. + +**Minor suggestions:** +- The `connectiveConstant` definition uses `h.choose` which returns an arbitrary element satisfying the existential. If the limit exists, it is unique (limits in Hausdorff spaces are unique), so `h.choose` is fine — but a comment noting uniqueness would clarify why this is well-defined as a function, not just a relation. +- The variant theorem's docstring references `[HM54] [Ke63]` — it would be slightly more precise to note that the lower bound $k \leq C_k$ is essentially trivial (a walk can always extend along one axis direction without self-intersection), while $C_k \leq 2k - 1$ is the content of [HM54]. + +--- + +## 5. Formalizability + +**Assessment: Moderate ambiguity — the problem is inherently open-ended.** + +The Erdős problem asks to "determine $C_k$ exactly." This is not a yes/no conjecture but a challenge to find a closed-form expression. The formalization handles this by using `answer(sorry)`: + +```lean +theorem erdos_528 : + ∀ k : ℕ, 0 < k → + connectiveConstant k = answer(sorry) +``` + +This asks for a function `ℕ → ℝ` that equals the connective constant for each $k$. The ambiguity lies in what counts as "determining" $C_k$: + +- **Strongest interpretation:** A closed-form expression for each $k$. This is almost certainly impossible — there is no known closed form even for $k = 2$ on the square lattice. +- **Weaker interpretation:** An algorithm or characterization that pins down $C_k$ uniquely (e.g., as the solution of some equation). +- **Weakest interpretation:** Better asymptotic approximations. + +The formalization adopts the strongest interpretation by asking for an explicit function. This is mathematically clean but potentially unsolvable in this form — the problem may be "open" precisely because no such closed form exists. The `answer(sorry)` mechanism is the correct way to handle "determine X" problems in this framework. + +**Ambiguity level: Moderate.** The mathematical objects ($f(n,k)$, $C_k$, self-avoiding walks) are all precisely defined. The ambiguity is in the *goal* — "determine exactly" is inherently vague. The formalization resolves this vagueness by asking for the strongest possible result. + +--- + +## 6. Correctness + +### Definition: `LatticeAdj` + +```lean +def LatticeAdj {k : ℕ} (x y : Fin k → ℤ) : Prop := + (∑ i : Fin k, |x i - y i|) = 1 +``` + +**Correct.** Two points in $\mathbb{Z}^k$ are adjacent iff their $\ell^1$ distance is 1, which means they differ by $\pm 1$ in exactly one coordinate and agree in all others. The $\ell^1$ characterization `∑ |x_i - y_i| = 1` is equivalent: since each $|x_i - y_i|$ is a non-negative integer, the sum equals 1 iff exactly one term is 1 and the rest are 0. This is the standard nearest-neighbor adjacency on $\mathbb{Z}^k$. + +**Edge case $k = 0$:** When $k = 0$, there are no coordinates, so `∑ i : Fin 0, ... = 0 ≠ 1`. Hence `LatticeAdj` is always false for $k = 0$, which is correct — $\mathbb{Z}^0$ is a single point with no edges. + +### Definition: `selfAvoidingWalkCount` + +```lean +noncomputable def selfAvoidingWalkCount (n k : ℕ) : ℕ := + Set.ncard {w : Fin (n + 1) → (Fin k → ℤ) | + w 0 = 0 ∧ + (∀ i : Fin n, LatticeAdj (w ⟨i.val, by omega⟩) (w ⟨i.val + 1, by omega⟩)) ∧ + Function.Injective w} +``` + +**Correct.** The set comprehension captures: +1. `w 0 = 0`: The walk starts at the origin. +2. Adjacency: Each consecutive pair of vertices is adjacent in the lattice. +3. `Function.Injective w`: The walk never revisits a vertex (self-avoiding property). + +The walk has $n + 1$ vertices (indices $0, 1, \ldots, n$) and $n$ steps, matching the standard definition of an $n$-step walk. `Set.ncard` returns the cardinality if the set is finite, and 0 otherwise. The set of $n$-step SAWs starting at the origin is always finite (bounded by $(2k)^n$), so `Set.ncard` correctly counts them. + +**Edge case $n = 0$:** A 0-step walk is just the single point at the origin. The adjacency condition is vacuous (`∀ i : Fin 0, ...`), and injectivity is trivial for a one-element domain. So `selfAvoidingWalkCount 0 k = 1` for $k \geq 1$ (a single walk consisting of just the origin). For $k = 0$ it is also 1, since the only function `Fin 1 → (Fin 0 → ℤ)` is the unique function to the empty-function type. + +### Definition: `connectiveConstant` + +```lean +noncomputable def connectiveConstant (k : ℕ) : ℝ := + if h : ∃ C : ℝ, Filter.Tendsto + (fun n : ℕ => ((selfAvoidingWalkCount n k : ℝ)) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds C) + then h.choose + else 0 +``` + +**Mathematically correct but with a subtlety.** The definition uses `h.choose` to extract the limit if it exists. Since $\mathbb{R}$ is Hausdorff, limits are unique when they exist, so `h.choose` is well-defined (any choice will yield the same value). The fallback to 0 when the limit doesn't exist is a reasonable convention. + +**Potential concern with $n = 0$ in the limit:** When $n = 0$, the expression becomes `(1 : ℝ) ^ ((1 : ℝ) / (0 : ℝ))`. In Lean, `(1 : ℝ) / (0 : ℝ) = 0` and `(1 : ℝ) ^ (0 : ℝ) = 1`. So the $n = 0$ term contributes 1, which is harmless — the limit depends only on the tail behavior. For general $n$, `selfAvoidingWalkCount n k` grows exponentially in $n$, so the $n$-th root converges to $C_k$, consistent with the standard definition. + +### Theorem: `erdos_528` + +```lean +theorem erdos_528 : + ∀ k : ℕ, 0 < k → + connectiveConstant k = answer(sorry) +``` + +**Correct formulation** of the "determine $C_k$" problem. The precondition `0 < k` is appropriate — for $k = 0$, $\mathbb{Z}^0$ is a single point, and the only SAW is the trivial walk, so $f(n, 0) = 0$ for $n \geq 1$ and the limit is 0 (or undefined), which is degenerate. + +### Variant: `erdos_528.variants.existence_with_bounds` + +```lean +theorem erdos_528.variants.existence_with_bounds : + ∀ k : ℕ, 0 < k → + ∃ C : ℝ, + (k : ℝ) ≤ C ∧ C ≤ 2 * (k : ℝ) - 1 ∧ + Filter.Tendsto + (fun n : ℕ => ((selfAvoidingWalkCount n k : ℝ)) ^ ((1 : ℝ) / (n : ℝ))) + atTop (nhds C) +``` + +**Issue with the lower bound at $k = 1$.** The bound states $k \leq C_k$. For $k = 1$, this claims $C_1 \geq 1$. In $\mathbb{Z}^1$, a self-avoiding walk of $n$ steps must visit $n + 1$ distinct integers, so it either goes entirely left or entirely right or some mix — but the crucial point is that $f(n, 1) = 2$ for all $n \geq 1$ (the walk must go either all left or all right). Thus $C_1 = \lim 2^{1/n} = 1$, and indeed $1 \leq 1$ holds. The upper bound gives $C_1 \leq 2 \cdot 1 - 1 = 1$, so together they force $C_1 = 1$. This is correct. + +**More generally:** The standard lower bound is $C_k \geq \mu_k$ where $\mu_k$ is the growth rate of the number of SAWs. The bound $C_k \geq k$ is not the tightest known — it follows from considering walks that always step in the same coordinate direction (giving $k$ choices at each step, minus backtracking constraints). Actually, the standard trivial lower bound is that $f(n,k) \geq k^n$ is *not* obvious for SAWs. The correct elementary lower bound comes from considering walks on a $k$-dimensional tree: $C_k \geq k$ for $k \geq 2$. For $k = 1$, $C_1 = 1$ and $k = 1 \leq 1$ holds. + +Wait — let me reconsider. The standard result is that $C_k \leq 2k - 1$ (since at each step there are at most $2k - 1$ choices, excluding the step that would backtrack). The lower bound $C_k \geq k$ is stated in [Ke63]. Checking: for $k = 1$, $C_1 = 1$ and $1 \leq 1$; for $k = 2$, $C_2 \approx 2.638$ and $2 \leq 2.638$. The bounds are correct. + +**The variant is tagged `category research solved`, which is correct** — the existence of the limit and these bounds are known results. + +**Verdict: Correct and complete.** The formalization faithfully captures Erdős Problem 528. The definitions of lattice adjacency, self-avoiding walks, and the connective constant are all mathematically correct. The main theorem appropriately frames the open problem of exact determination using `answer(sorry)`. The variant correctly captures the known existence and bounds results. The only notable issues are (1) code duplication with Problem 529, and (2) missing cross-references and supplementary citations from the website. diff --git a/ai-review/529.md b/ai-review/529.md new file mode 100644 index 0000000000..299e4832db --- /dev/null +++ b/ai-review/529.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 529 + +**File:** `FormalConjectures/ErdosProblems/529.lean` + +--- + +## 1. Code Reuse + +**Significant duplication with Erdős Problem 528.** The definitions `LatticeAdj` and the self-avoiding walk set are essentially identical between `528.lean` and `529.lean`: + +- `Erdos528.LatticeAdj` and `Erdos529.LatticeAdj` are character-for-character identical. +- `Erdos528.selfAvoidingWalkCount` computes `Set.ncard` of the exact same set that `Erdos529.selfAvoidingWalks` defines. + +These should be factored into a shared module (e.g., `FormalConjectures/Util/SelfAvoidingWalk.lean`) containing `LatticeAdj`, the SAW set definition, and `euclidDistFromOrigin`. Problem 528's `selfAvoidingWalkCount` would then become `Set.ncard (selfAvoidingWalks n k)`, and both files would import the shared definitions. + +Additionally, problems 1164–1166 define `walkPosition` and `visitedSites` for random walks on ℤ², which share conceptual overlap but use a different (probabilistic/measure-theoretic) framework, so direct code reuse is not applicable. + +## 2. Citations + +The formalization cites only **[DuHa13]**. The website (erdosproblems.com/529) lists several additional references that should be included: + +- **[Er61, p.254]** — Original source (Erdős, 1961). Should be cited as the primary reference. +- **[Sl87]** — Slade proved $d_k(n) \sim Dn^{1/2}$ for sufficiently large $k$. +- **[HaSl91, HaSl92]** — Hara and Slade extended the above to all $k \geq 5$. The Part 2 docstring mentions "Hara and Slade proved..." but does not give a formal citation. +- **[MaSl93]** — Madras and Slade, *The Self-Avoiding Walk* (monograph). Section 1.4 is the source for the conjectured exponents mentioned in the docstrings. + +**Recommendation:** Add full citations for [Er61], [Sl87], [HaSl91]/[HaSl92], and [MaSl93] in the module docstring, matching the format used for [DuHa13]. + +## 3. Variants + +The website poses two questions, and the formalization captures both: + +- **Part 1:** $d_2(n)/\sqrt{n} \to \infty$ — formalized as `erdos_529`. +- **Part 2:** $d_k(n) \ll \sqrt{n}$ for $k \geq 3$ — formalized as `erdos_529.variants.part2`. + +**Possible missing variants:** + +- **Hara–Slade result for $k \geq 5$:** The known result $d_k(n) \sim D\sqrt{n}$ for $k \geq 5$ could be formalized as a solved variant (analogous to `erdos_528.variants.existence_with_bounds`). This is a proven theorem, not a conjecture. +- **Conjectured exponents:** The conjectured behaviors $d_2(n) \sim Dn^{3/4}$, $d_3(n) \sim n^{0.59}$, and $d_4(n) \sim D(\log n)^{1/8} n^{1/2}$ are mentioned in docstrings but not formalized. These are natural conjecture-level variants, though they are not part of the original Erdős problem. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The definitions (`LatticeAdj`, `selfAvoidingWalks`, `euclidDistFromOrigin`, `expectedSAWDist`) each have clear docstrings with LaTeX. +- The `expectedSAWDist` definition's `if h : ... .Finite` guard is a reasonable defensive choice, though a comment noting that finite-ness always holds (for fixed $n, k$) would aid understanding. +- The exponent `(1 : ℝ) / 2` could be written as `(1 / 2 : ℝ)` for slight readability improvement, but this is minor and may affect elaboration, so the current form is acceptable. + +## 5. Formalizability + +**High formalizability.** The problem is stated precisely: + +- Self-avoiding walks on $\mathbb{Z}^k$ are well-defined combinatorial objects. +- The expected endpoint distance under the uniform distribution over SAWs is unambiguous. +- The asymptotic questions ($d_2(n)/\sqrt{n} \to \infty$ and $d_k(n) = O(\sqrt{n})$) have standard mathematical meanings. + +**Minimal ambiguity.** The only potential ambiguity is the meaning of $\ll$ in Part 2. In analytic number theory, $f \ll g$ means $f = O(g)$. The formalization correctly interprets this as: $\exists C > 0$ such that $d_k(n) \leq C\sqrt{n}$ for all sufficiently large $n$. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed assessment: + +### Part 1 (`erdos_529`) +The statement `Tendsto (fun n => expectedSAWDist n 2 / n^(1/2)) atTop atTop` correctly captures $d_2(n)/\sqrt{n} \to \infty$. The use of `atTop` as both the domain filter and the codomain filter is the standard Lean/Mathlib encoding of divergence to $+\infty$. + +### Part 2 (`erdos_529.variants.part2`) +The statement `∀ k, k ≥ 3 → ∃ C, 0 < C ∧ ∀ᶠ n in atTop, expectedSAWDist n k ≤ C * n^(1/2)` correctly captures $d_k(n) \ll \sqrt{n}$ for all $k \geq 3$. The `∀ᶠ n in atTop` correctly means "for all sufficiently large $n$". + +### `expectedSAWDist` definition +The expected value computation (sum over SAWs divided by count) correctly defines the mean endpoint distance under the uniform distribution. This is equivalent to the conditional expectation definition on the website ("expected distance... conditional on no self-intersections"), because all length-$n$ paths in a simple random walk on $\mathbb{Z}^k$ have equal probability $(1/2k)^n$, so conditioning on being self-avoiding yields the uniform distribution over SAWs. + +### Edge cases +- For $n = 0$: the only SAW is the constant walk at the origin, giving expected distance 0. Correct. +- The `else 0` branch in `expectedSAWDist` handles the (impossible in practice) case where the SAW set is not finite. For any fixed $n$ and $k > 0$, self-avoiding walks are confined to a ball of $\ell^\infty$-radius $n$, so finiteness always holds. + +### Wrapping in `answer(sorry)` +Both theorems correctly use `answer(sorry)` since the problems are open — the answer to both questions is unknown. This allows the eventual proof to establish either direction. + +**No mathematical flaws identified.** + +--- + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `LatticeAdj` and SAW set duplicated from 528.lean; should be shared | +| Citations | Only [DuHa13] cited; missing [Er61], [Sl87], [HaSl91/92], [MaSl93] | +| Variants | Both website questions captured; Hara–Slade ($k \geq 5$) result could be a solved variant | +| Readability | Good; clear docstrings and structure | +| Formalizability | High; precise combinatorial definitions with unambiguous asymptotics | +| Correctness | Correct and complete | diff --git a/ai-review/53.md b/ai-review/53.md new file mode 100644 index 0000000000..30ce62f305 --- /dev/null +++ b/ai-review/53.md @@ -0,0 +1,109 @@ +# Review: Erdos Problem 53 + +**File:** `FormalConjectures/ErdosProblems/53.lean` + +## 1. Code Reuse + +`FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` defines a `subsetSums` over `Set M`: + +```lean +def subsetSums (A : Set M) : Set M := + {n | ∃ B : Finset M, ↑B ⊆ A ∧ n = ∑ i ∈ B, i} +``` + +This operates on `Set` rather than `Finset` and returns a `Set`, so it cannot directly be used for the cardinality comparison needed in Problem 53. The local `Erdos53.subsetSums` definition over `Finset ℤ → Finset ℤ` is necessary for the `Finset.card` computation. However, there is a **name collision** — `subsetSums` is defined at top level in `AdditivelyComplete.lean` and within the `Erdos53` namespace in `53.lean`. This is not a bug (the namespace keeps them separate), but it's worth noting. + +No existing `subsetProducts` definition exists anywhere in the codebase, so that definition is necessarily new. + +Problem 52 (`ErdosProblems/52.lean`) formalizes the related pairwise sum-product conjecture using `Pointwise` operations `A + A` and `A * A`, which is a distinct problem from Problem 53's subset sums/products. No code reuse is possible between them. + +**Verdict:** No actionable code reuse opportunity. + +## 2. Citations + +The website [erdosproblems.com/53](https://www.erdosproblems.com/53) lists the following references: + +- [Er77c] +- [ErGr80] +- [ErSz83] +- [Er91] +- [Er97] +- [Er97e] +- [Ch03] + +The formalization cites only **[ErSz83]** and **[Ch03]**, which are the two most important references (the original paper posing the problem and Chang's solution). The other five references ([Er77c], [ErGr80], [Er91], [Er97], [Er97e]) are additional Erdos papers that discuss the problem but are not essential for understanding the formalization. + +The website also mentions a companion upper bound result: Erdos and Szemeredi proved there exist arbitrarily large sets A where the count of representable integers is at most $\exp(c(\log|A|)^2 \log\log|A|)$. This is not captured in the formalization (see Variants below). + +The full citation details included in the docstring are accurate and complete for the two references cited. + +**Verdict:** Acceptable. The two key references are present and correctly cited. The additional references are not critical. + +## 3. Variants + +The website mentions a related problem: **Problem 52** (pairwise sum-product conjecture), which is formalized separately. This is appropriate — they are distinct problems. + +The **upper bound** result by Erdos-Szemeredi (that there exist sets where the count is at most $\exp(c(\log|A|)^2 \log\log|A|)$) is not formalized. This is a complementary result showing the growth rate cannot be exponential, and is a natural companion to Problem 53. It could be a separate theorem or a second conjecture statement, but its absence is not a flaw — it's a separate result. + +Chang's full result is stronger than what Problem 53 asks: Chang showed $\ln g(k) \sim (\ln k)^2 / \ln(\ln k)$, giving the precise asymptotic growth rate. The formalization only captures the qualitative "superpolynomial growth" aspect (for every $k$, eventually $\geq |A|^k$), which matches the problem statement as posed. + +**Verdict:** The main conjecture is captured. The upper bound and precise asymptotics are natural extensions but not required. + +## 4. Readability + +The code is clean and well-structured: + +- The helper definitions `subsetSums` and `subsetProducts` are clearly documented with LaTeX in their docstrings. +- The theorem statement is readable and follows the pattern of other Erdos problem formalizations. +- The namespace `Erdos53` prevents collisions with the global `subsetSums`. +- The `open Finset BigOperators` is appropriate and minimal. + +One minor suggestion: the docstring for `erdos_53` says "Solved in this form by Chang [Ch03]" which could be slightly more precise as "Solved affirmatively by Chang [Ch03]" to match the `answer(True)`. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem is precise enough to formalize. The main potential ambiguity is in the phrase **"sums or products of distinct elements"**: + +- **Interpretation A (subset sums/products):** Pick any subset $S \subseteq A$, compute $\sum S$ or $\prod S$. This is the interpretation used in the formalization. +- **Interpretation B (pairwise sums/products):** Compute $a + b$ or $a \cdot b$ for distinct $a, b \in A$. This is what Problem 52 formalizes. + +Interpretation A is correct here. Under Interpretation B, the number of representable integers is at most $O(|A|^2)$, making the conjecture trivially false for $k \geq 3$. The original Erdos-Szemeredi paper defines $A[1]$ (simple sums) and $A\{1\}$ (simple products) as sums and products over subsets, confirming Interpretation A. + +**Verdict:** Unambiguous once the original paper is consulted. The formalization makes the correct choice. + +## 6. Correctness + +The formalization is **mathematically correct** with minor observations: + +### Correct aspects: +- The quantifier structure `∀ k, ∃ N, ∀ A, A.card ≥ N → ...` correctly captures "for every $k$, if $|A|$ is sufficiently large." +- The use of `Finset ℤ` for the domain matches "finite set of integers." +- The `answer(True)` and `category research solved` tag correctly reflect that Chang proved this affirmatively. +- The union `subsetSums A ∪ subsetProducts A` correctly captures "integers which are either the sum or product." + +### Minor observations: + +1. **Empty subset inclusion:** The powerset includes the empty set, contributing the empty sum (0) and empty product (1) to every set. The original problem likely intends nonempty subsets ("sums of distinct elements" suggests picking at least one element). However, this adds at most 2 extra elements to the union, which is negligible for the asymptotic statement. It does not affect the truth value of the conjecture. + +2. **Singleton inclusion:** The powerset includes singletons, so every element of $A$ appears as both a "subset sum" and a "subset product" of itself. This makes the $k = 0$ and $k = 1$ cases trivially true (the union contains at least $|A|$ elements). This is consistent with the Erdos-Szemeredi definition. + +3. **$N$ depends only on $k$:** The formalization correctly has $N$ depend on $k$ but not on the specific set $A$, matching "sufficiently large depending on $k$." + +4. **Integer type:** The problem uses $\mathbb{Z}$ (integers), which is correct. Some formulations use natural numbers, but integers are the standard setting for this problem. + +**Verdict:** Correct and complete. No mathematical flaws. The empty-subset inclusion is a negligible deviation from the most literal reading but does not affect correctness. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No opportunities | +| Citations | Good — key references present | +| Variants | Main conjecture captured | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct | + +**Overall:** This is a clean, correct formalization. No changes required. diff --git a/ai-review/530.md b/ai-review/530.md new file mode 100644 index 0000000000..b5ed43f921 --- /dev/null +++ b/ai-review/530.md @@ -0,0 +1,82 @@ +# Review: Erdős Problem 530 + +## 1. Code Reuse + +**Several opportunities for consolidation exist.** + +The `IsSidonSet` definition in `530.lean` (lines 48–50) is a local `Finset ℝ`-specific copy of a definition that appears in at least 7 other Erdős problem files (43, 154, 156, 772, 773, 861, 862), each defining it independently on `Finset ℕ`. A shared, generic `IsSidon` definition already exists in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (lines 37–39), operating on `Set α` for any `AddCommMonoid α`. Problem 530 could use this directly by coercing its `Finset ℝ` to `Set ℝ`. + +Similarly, `maxSidonSubsetSize` (lines 53–54) uses `sSup` over a set description, while `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (lines 131–132) provides `Finset.maxSidonSubsetCard` using `sup` over the powerset — a computable, well-defined alternative. The 530.lean version could be replaced with this Mathlib-integrated version (after generalizing from `ℕ` to `ℝ`, or noting the Mathlib version is already generic in `α`). + +The `sidonSubsetNumber` definition (lines 59–60) has no existing analogue and would remain problem-specific. + +## 2. Citations + +The formalization's docstring includes the following references: +- [Er73], [Er75f], [Er80e] — Erdős +- [Ri69] — Riddell (original proposer) +- [KSS75] — Komlós, Sulyok, and Szemerédi + +**Missing from the formalization but present on erdosproblems.com/530:** +- **[AlEr85]** — Alon and Erdős, who posed a stronger conjecture about decomposing any set into at most $(1+o(1))N^{1/2}$ Sidon sets. +- **[Gu04]** — Guy's collection, problem C9. +- Related problem **[1088]** (higher-dimensional generalization). +- Related OEIS sequence **A143824**. + +The existing citations are rendered in shorthand (e.g., `[Er73] Erdős, P., p.120`). The website uses the same shorthand format, so this is consistent. + +## 3. Variants + +The formalization captures only the main conjecture: $\ell(N) \sim N^{1/2}$. + +**Not captured:** +- **Alon–Erdős stronger conjecture [AlEr85]:** Any set $A$ of size $N$ can be decomposed into at most $(1+o(1))N^{1/2}$ Sidon sets. This is a strictly stronger statement (decomposition into few Sidon sets implies a large Sidon subset, but not conversely). This could be formalized as a separate theorem or added as a variant. +- **Problem 1088:** A higher-dimensional generalization mentioned on the website. +- The known bounds $N^{1/2} \ll \ell(N) \leq (1+o(1))N^{1/2}$ are documented in the docstring but not formalized as separate lemmas. Formalizing the upper and lower bounds as standalone results could be valuable, as the lower bound (Komlós–Sulyok–Szemerédi) is a proven theorem, not a conjecture. + +## 4. Readability + +The code is well-structured and readable: +- The module docstring clearly explains the problem, its history, and known bounds. +- The definition names (`IsSidonSet`, `maxSidonSubsetSize`, `sidonSubsetNumber`) are descriptive and follow a logical progression from local property → extremal quantity → minimax quantity. +- The docstrings on each definition explain the mathematical meaning. + +**Minor suggestions:** +- The docstring on `IsSidonSet` says "all pairwise sums are distinct" in parentheses, which is a good informal gloss. +- The `open Finset Filter` on line 41 opens `Filter` but it is not used anywhere in the file. It could be removed for cleanliness. + +## 5. Formalizability + +**Assessment: High — the statement is precise and unambiguous.** + +The problem asks whether $\ell(N) \sim N^{1/2}$, where $f \sim g$ means $f(N)/g(N) \to 1$ as $N \to \infty$. This is a standard asymptotic statement with a precise mathematical meaning. + +The definition of $\ell(N)$ is also unambiguous: it is the minimax quantity — the minimum over all $N$-element sets $A \subset \mathbb{R}$ of the maximum size of a Sidon subset of $A$. The Sidon property itself (all pairwise sums distinct) is completely precise. + +The only minor point: the problem is sometimes stated for $A \subset \mathbb{Z}$ rather than $A \subset \mathbb{R}$. However, since the Sidon property depends only on additive structure and $\mathbb{Z} \hookrightarrow \mathbb{R}$, the choice of ambient group does not affect $\ell(N)$. Working over $\mathbb{R}$ is, if anything, more general (the infimum is taken over a larger class of sets), but since any finite subset of $\mathbb{R}$ can be perturbed to have the same additive structure as a subset of $\mathbb{Q}$ (and hence embedded in $\mathbb{Z}$ after scaling), the value of $\ell(N)$ is the same. The formalization's choice of $\mathbb{R}$ is mathematically correct. + +## 6. Correctness + +**Overall: Correct, with minor observations.** + +### Definitions + +- **`IsSidonSet`** (lines 48–50): Correctly captures the Sidon property. For all $a, b, c, d \in S$ with $a + b = c + d$, we have $\{a, b\} = \{c, d\}$ (expressed as the disjunction of the two possible equalities). This is the standard definition. + +- **`maxSidonSubsetSize`** (lines 53–54): Uses `sSup` on `ℕ`, which in Mathlib returns 0 for empty or unbounded sets. The set $\{k \mid \exists S \subseteq A, \text{IsSidonSet}(S) \wedge |S| = k\}$ is always non-empty (the empty set is vacuously Sidon, contributing $k = 0$) and bounded above by $|A|$. So `sSup` correctly returns the maximum. **Sound.** + +- **`sidonSubsetNumber`** (lines 59–60): Uses `sInf` on `ℕ`, which in Mathlib returns 0 for empty sets and the minimum otherwise. The set $\{m \mid \exists A, |A| = N \wedge \text{maxSidonSubsetSize}(A) = m\}$ is non-empty for all $N$ (any $N$-element subset of $\mathbb{R}$ witnesses some value of $m$). So `sInf` correctly returns the minimum. **Sound.** + +### Main Statement + +- **`erdos_530`** (lines 70–75): States `answer(sorry) ↔ Tendsto (fun N => (sidonSubsetNumber N : ℝ) / Real.sqrt N) atTop (nhds 1)`. + + This correctly encodes "$\ell(N) \sim N^{1/2}$" as the convergence $\ell(N)/\sqrt{N} \to 1$. The `answer(sorry)` wrapper correctly reflects that this is an open problem whose truth value is unknown: if the answer is `True`, then the limit holds; if `False`, then it does not. + +### Potential Concern: `sSup`/`sInf` Interaction + +The composition of `sSup` (in `maxSidonSubsetSize`) and `sInf` (in `sidonSubsetNumber`) correctly produces the minimax quantity $\ell(N) = \min_{|A|=N} \max_{S \subseteq A, S \text{ Sidon}} |S|$. However, both rely on `ℕ`'s conditional completeness. In a proof, one would need to establish that these sets are non-empty and (for `sSup`) bounded above, which is straightforward but worth noting. + +### No Mathematical Flaws Identified + +The formalization accurately captures the intended mathematical content. An experienced mathematician would not identify any obvious errors in the definitions or the statement. diff --git a/ai-review/531.md b/ai-review/531.md new file mode 100644 index 0000000000..24ff97d237 --- /dev/null +++ b/ai-review/531.md @@ -0,0 +1,110 @@ +# Review: Erdős Problem 531 + +## 1. Code Reuse + +Several existing codebase components are relevant: + +- **Problem 532** (`ErdosProblems/532.lean`): The infinite analogue (Hindman's theorem). Problem 532 uses a structurally similar pattern — `∀ χ : ℕ → Bool, ∃ (A : Set ℕ), ... ∃ c : Bool, ∀ S : Finset ℕ, S.Nonempty → ... → χ (∑ i ∈ S, i) = c`. The `HasMonoSubsetSumSet` predicate in 531 is essentially the finite, bounded version of the same concept. These two problems could share a common predicate or at least reference each other more explicitly. + +- **`FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean`**: Defines `subsetSums (A : Set M) : Set M` as `{n | ∃ B : Finset M, ↑B ⊆ A ∧ n = ∑ i ∈ B, i}`. This is conceptually the same as the subset-sum operation used in `HasMonoSubsetSumSet`. However, the current formalization in 531 works with `Finset.powerset` directly rather than using this utility. The `subsetSums` definition could potentially be used to express the monochromaticity condition more cleanly, though the bounded-range constraint (`≤ N`) makes it somewhat less natural. + +- **Problem 948** (`ErdosProblems/948.lean`): Uses `Fin k`-valued colorings and finite subset sums of sequences — a generalization of the coloring framework. Not directly reusable but demonstrates the same structural pattern. + +- **`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`**: Uses the same `sInf` pattern for defining Ramsey-type numbers, consistent with `folkmanNumber`. + +**Assessment**: The `subsetSums` utility in `AdditivelyComplete.lean` is the most promising candidate for reuse, but integrating it would require reworking the bounded-range constraint. The current self-contained approach is reasonable for a conjecture stub. + +## 2. Citations + +The website (erdosproblems.com/531) lists: +- **[Er73]** — Erdős (original source, 1973) +- **[ErSp89]** — Erdős and Spencer (1989) +- **[BENTW17]** — Balogh, Eberhard, Narayanan, Treglown, and Wagner (2017) + +The formalization's docstring mentions: +- **[ErSp89]** — referenced as "Erdős–Spencer [ErSp89]" ✅ +- **[BENTW17]** — referenced as "Balogh–Eberhard–Narayanan–Treglown–Wagner [BENTW17]" ✅ + +**Issue**: The original reference **[Er73]** is not mentioned in the docstring. While not strictly necessary (it's the problem source rather than a bound), the website attributes the problem to this reference. Consider adding a line like: "Originally posed by Erdős [Er73]." + +## 3. Variants + +The website describes one problem: estimate $F(k)$, the Folkman number. + +The formalization captures: +1. `folkman_theorem` — existence of $F(k)$ (Folkman's theorem) ✅ +2. `erdos_531` — the BENTW lower bound $F(k) \geq 2^{2^{k-1}/k}$ ✅ + +**Missing variant**: The earlier Erdős–Spencer lower bound $F(k) \geq 2^{ck^2/\log k}$ is mentioned in the docstring but not formalized as a separate theorem. While the BENTW bound supersedes it for large $k$, they are incomparable for small $k$ (the Erdős–Spencer bound is better for small $k$ since $ck^2/\log k > 2^{k-1}/k$ when $k$ is small enough). A completist formalization might include both, though omitting the weaker asymptotic bound is defensible. + +**Upper bounds**: The problem says "Estimate $F(k)$", which implicitly asks for both lower and upper bounds. No upper bound is formalized. The website does not list specific upper bounds either, so this is not a gap relative to the source. + +**Assessment**: The formalization captures the main content adequately. The missing Erdős–Spencer bound is a minor omission. + +## 4. Readability + +The code is well-structured and readable: + +- The `HasMonoSubsetSumSet` predicate is clearly documented and its definition follows the mathematical statement closely. +- The `folkmanNumber` definition using `sInf` is standard. +- The docstrings are informative and well-formatted. + +**Minor suggestions**: +- Line 50: The condition `∀ S ∈ A.powerset, S.Nonempty → ∑ i ∈ S, i ≤ N` ensures subset sums stay in `{1,...,N}`. This is correct but somewhat hidden among the other conditions. A brief inline comment could help. +- The namespace `Erdos531` is clear and consistent with other problem files. + +**Assessment**: Readability is good. No significant issues. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is: "Let $F(k)$ be the minimal $N$ such that if we two-colour $\{1,\ldots,N\}$ there is a set $A$ of size $k$ such that all subset sums $\sum_{a\in S}a$ (for $\emptyset\neq S\subseteq A$) are monochromatic. Estimate $F(k)$." + +This is precise and unambiguous: +- "Two-colour $\{1,\ldots,N\}$" — a function from $\{1,\ldots,N\}$ to a 2-element set. +- "Set $A$ of size $k$" — a $k$-element subset. +- "All subset sums are monochromatic" — all non-empty subset sums receive the same color. +- "Minimal $N$" — the infimum of such $N$. + +The only minor ambiguity: do the subset sums need to lie in $\{1,\ldots,N\}$ for the coloring to apply, or is the coloring extended to all of $\mathbb{N}$? The formalization handles this by (a) using `χ : ℕ → Bool` (coloring all naturals) and (b) requiring `∑ i ∈ S, i ≤ N` explicitly. Both approaches are mathematically equivalent since any coloring of $\{1,\ldots,N\}$ can be extended arbitrarily, so this is not a real issue. + +**Assessment**: High formalizability. The problem is completely unambiguous. **Score: 10/10**. + +## 6. Correctness + +### `HasMonoSubsetSumSet` + +The predicate requires: +1. `A.card = k` — $A$ has $k$ elements ✅ +2. `∀ a ∈ A, 1 ≤ a ∧ a ≤ N` — elements in $\{1,\ldots,N\}$ ✅ +3. `∀ S ∈ A.powerset, S.Nonempty → ∑ i ∈ S, i ≤ N` — subset sums bounded by $N$ ✅ +4. `∃ c : Bool, ∀ S ∈ A.powerset, S.Nonempty → χ (∑ i ∈ S, i) = c` — monochromatic ✅ + +**Potential issue with condition 3**: The standard definition of Folkman numbers does **not** require subset sums to lie in $\{1,\ldots,N\}$. The standard formulation only requires that the elements of $A$ lie in $\{1,\ldots,N\}$ and that all non-empty subset sums receive the same color. Since the coloring is only defined on $\{1,\ldots,N\}$, one might argue that subset sums must lie within this range for the coloring to be defined — but if subset sums could exceed $N$, the coloring function would need to be extended. + +The formalization sidesteps this by defining `χ : ℕ → Bool` (coloring all of $\mathbb{N}$), which means the coloring is always defined on any subset sum. Given this, condition 3 is an **additional restriction** not present in the standard definition. This condition is equivalent to requiring $\sum_{a \in A} a \leq N$, which for elements in $\{1,\ldots,N\}$ is automatically satisfied when $N$ is large enough relative to $k$. So for asymptotic statements (like `erdos_531` which is "for sufficiently large $k$"), this extra condition does not change the value of $F(k)$ asymptotically. However, it could change the exact value of `folkmanNumber k` for small $k$. + +**Assessment**: Condition 3 is a slightly non-standard modeling choice. It makes the definition marginally stronger (requires more of the set $A$), which means `folkmanNumber` as defined could be slightly larger than the standard Folkman number. For the purposes of the lower bound in `erdos_531`, this is actually fine — a lower bound on a potentially larger quantity is still valid, and the "for sufficiently large $k$" qualifier handles any discrepancy. But for `folkman_theorem`, this extra condition makes the theorem slightly harder to prove (you need to show the existence of $A$ whose subset sums also stay bounded), though it remains true. + +**Verdict**: This is a defensible modeling choice but worth noting. The formalization would be more faithful to the standard definition without condition 3, relying instead on the fact that `χ` is defined on all of `ℕ`. + +### `folkmanNumber` + +Defined as `sInf {N : ℕ | ∀ χ : ℕ → Bool, HasMonoSubsetSumSet χ k N}`. This correctly captures "the minimal $N$" via the natural number infimum. The use of `sInf` means that if the set is empty (i.e., no such $N$ exists), `folkmanNumber k = 0`, which is a harmless default since `folkman_theorem` establishes non-emptiness. ✅ + +### `folkman_theorem` + +Correctly states the existence of $F(k)$: for every $k$, there exists $N$ such that every 2-coloring has a monochromatic subset-sum $k$-set. ✅ + +### `erdos_531` + +States: $\exists k_0, \forall k \geq k_0, F(k) \geq 2^{2^{k-1}/k}$. + +This matches the BENTW result. The use of `(folkmanNumber k : ℝ)` and real-valued exponentiation is necessary since $2^{2^{k-1}/k}$ is not generally a natural number. The cast to `ℝ` and comparison via `≥` is correct. ✅ + +**Minor note on the exponent**: The BENTW paper proves $F(k) \geq 2^{2^{k-1}/k}$. The formalization writes `(2 : ℝ) ^ ((2 : ℝ) ^ ((k : ℝ) - 1) / (k : ℝ))`, which equals $2^{2^{k-1}/k}$. This is correct. ✅ + +### Overall Correctness Assessment + +The formalization is **mathematically correct** with one caveat: condition 3 in `HasMonoSubsetSumSet` (subset sums bounded by $N$) is a non-standard but defensible modeling choice that does not affect the correctness of the stated theorems for their intended purpose (asymptotic lower bounds). The formalization faithfully captures the spirit and content of Erdős Problem 531. + +**Overall: Sound formalization with minor stylistic considerations.** diff --git a/ai-review/532.md b/ai-review/532.md new file mode 100644 index 0000000000..df1d30b3ac --- /dev/null +++ b/ai-review/532.md @@ -0,0 +1,97 @@ +# Review: Erdos Problem 532 + +## 1. Code Reuse + +**Opportunities identified:** + +- **`subsetSums` from `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean`**: This defines `subsetSums (A : Set M) : Set M` as the set of all finite subset sums of `A`. The body of `erdos_532` could be restated using this definition. Currently, the theorem inlines the subset-sum logic (`∀ S : Finset ℕ, S.Nonempty → (↑S : Set ℕ) ⊆ A → χ (∑ i ∈ S, i) = c`), which is essentially asserting that all non-empty elements of `subsetSums A` are monochromatic. However, `subsetSums` includes the empty sum (0), so direct substitution would require a minor adjustment. The inlined version is arguably clearer for a standalone theorem statement. + +- **Problem 531 (`HasMonoSubsetSumSet`)**: Problem 531 defines `HasMonoSubsetSumSet` for finite sets. The structure is closely parallel — both deal with monochromatic subset sums — but 531 uses `Finset` with bounded elements while 532 uses an infinite `Set ℕ`. No direct reuse is possible, but the pattern is consistent, which is good. + +**Verdict:** The current inlined approach is reasonable. Using `subsetSums` would add an import dependency for marginal readability gain. No strong recommendation to change. + +## 2. Citations + +The website ([erdosproblems.com/532](https://www.erdosproblems.com/532)) lists the following references: + +- [Er73] +- [Er75b] +- [Er77c] +- [Hi74] + +The formalization only cites **[Hi74]** (Hindman 1974). The Erdos references [Er73], [Er75b], [Er77c] are omitted. Since these are the Erdos papers that originally posed or discussed the problem, they should ideally be mentioned in the docstring. + +The website also lists related problems **#531** and **#948**. The formalization references #531 ("See also [531]") but **omits #948**. + +**Recommendation:** Add the missing Erdos references and mention Problem 948 in the docstring. + +## 3. Variants + +**Missing variant — general finite coloring:** The formalization states Hindman's theorem for 2 colors (`χ : ℕ → Bool`). However, the website explicitly states: *"Proved by Hindman [Hi74] for any number of colours."* The general version — for any finite coloring `χ : ℕ → Fin r` with `r ≥ 1` — is the full strength of Hindman's theorem and is the form most commonly cited in the literature. This is a significant omission. + +A complete formalization should include: + +```lean +theorem hindman_general (r : ℕ) (hr : 0 < r) (χ : ℕ → Fin r) : + ∃ (A : Set ℕ), A.Infinite ∧ (∀ a ∈ A, 0 < a) ∧ + ∃ c : Fin r, ∀ S : Finset ℕ, S.Nonempty → (↑S : Set ℕ) ⊆ A → + χ (∑ i ∈ S, i) = c +``` + +Note: The 2-color case does imply the general case by a standard compactness/induction argument, but the general statement is the canonical form of Hindman's theorem and warrants explicit inclusion. + +**Verdict:** The most important variant (finite coloring) is missing. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The use of `answer(True) ↔` is consistent with project conventions. +- The docstring is well-written and provides good mathematical context. +- The namespace `Erdos532` and theorem name `erdos_532` follow the project conventions. +- `open Finset BigOperators` is appropriate for the notation used. + +**One minor point:** The condition `∀ a ∈ A, 0 < a` (positivity of elements) could benefit from a brief inline comment explaining why it's needed (to exclude the trivial element 0 from the set, since including 0 doesn't contribute to sums but would allow degenerate solutions). However, this is a very minor style suggestion. + +**Verdict:** Readability is good. No significant issues. + +## 5. Formalizability + +Hindman's theorem is a precisely stated, well-known result in combinatorics. The statement is completely unambiguous: for any finite coloring of ℕ, there exists an infinite set whose finite subset sums (the "IP set") are monochromatic. There is no ambiguity in the mathematical content. + +The only subtlety is the distinction between the "sequence" and "set" formulations of Hindman's theorem: +- **Sequence version:** There exists an infinite sequence $(x_n)$ such that all finite sums $x_{n_1} + \cdots + x_{n_k}$ (with $n_1 < \cdots < n_k$) are monochromatic. +- **Set version:** There exists an infinite set $A$ such that all non-empty finite subset sums are monochromatic. + +These are equivalent (since elements of the set are distinct positive naturals, they can be enumerated as an increasing sequence). The formalization uses the set version, which is a valid choice. + +**Verdict:** Fully formalizable, no ambiguity. Assessment: **unambiguous**. + +## 6. Correctness + +The formalization is **mathematically correct** for what it states. Detailed analysis: + +- **`∀ χ : ℕ → Bool`**: Correctly quantifies over all 2-colorings. +- **`A.Infinite`**: Correctly requires the set to be infinite. +- **`∀ a ∈ A, 0 < a`**: Correctly excludes 0. This is important because 0 is an additive identity — including it would trivially extend any finite set to an infinite one without changing the sums. The standard statement of Hindman's theorem works with positive integers. +- **`∃ c : Bool, ∀ S : Finset ℕ, S.Nonempty → (↑S : Set ℕ) ⊆ A → χ (∑ i ∈ S, i) = c`**: Correctly asserts monochromaticity of all non-empty finite subset sums. The coercion `(↑S : Set ℕ) ⊆ A` correctly requires S to be a subset of A. +- **`answer(True)`**: Correct — Hindman proved this in 1974. + +**Potential concern — distinctness:** The formalization uses `S : Finset ℕ` with `(↑S : Set ℕ) ⊆ A`. Since `A : Set ℕ` and `S : Finset ℕ`, the elements of `S` are automatically distinct (finsets don't have duplicates), and `S ⊆ A` ensures they come from A. This correctly models "non-empty finite subsets of A." No issue here. + +**Incompleteness (not incorrectness):** The formalization captures the 2-color case but not the general finite-coloring case, as discussed in Section 3. This is an incompleteness in scope, not a mathematical error. The docstring accurately describes what is proved ("For any 2-colouring") and mentions in the module docstring that Hindman proved it "for any number of colours," so the reader is made aware. However, the theorem as stated does not fully capture the result as described on the website. + +**Verdict:** Correct and complete for the 2-color case. Incomplete in that it does not capture the full generality of Hindman's theorem (arbitrary finite colorings). + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No strong reuse opportunities; current approach is fine | +| Citations | Missing [Er73], [Er75b], [Er77c] references and Problem #948 | +| Variants | **Missing general finite-coloring version** (most significant issue) | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct for 2-color case; incomplete for general case | diff --git a/ai-review/533.md b/ai-review/533.md new file mode 100644 index 0000000000..d70818c63d --- /dev/null +++ b/ai-review/533.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 533 + +## 1. Code Reuse + +The formalization follows the same structural pattern as **Problem 579** (`FormalConjectures/ErdosProblems/579.lean`), which is essentially the same type of Ramsey-Turán question but for K_{2,2,2}-free graphs instead of K₅-free graphs. Both problems share identical quantifier structure: `∀ δ > 0, ∃ c > 0, ∃ N, ∀ n ≥ N, ∀ G on Fin n ...`. Problem 620 also uses the same `CliqueFree`/`induce` constructs for K₄-free graphs with triangle-free induced subgraphs. + +No existing utility in `FormalConjecturesForMathlib` directly applies. There is no Ramsey-Turán density definition in the codebase. If such a definition were introduced (e.g., a general `RamseyTuranDensity r s` definition), it could unify Problems 533, 579, and potentially others in this family. However, for a single problem formalization, the current direct statement is appropriate and avoids unnecessary abstraction. + +The file correctly uses `SimpleGraph.CliqueFree`, `SimpleGraph.induce`, and `Set.ncard` from Mathlib, which is consistent with the rest of the codebase. + +## 2. Citations + +The formalization cites: +- **[BaLe13]** Balogh, J. and Lenz, J., *Some exact Ramsey-Turán numbers*, 2013. + +The [erdosproblems.com/533](https://www.erdosproblems.com/533) page provides additional context: +- The problem was originally posed by **Erdős, Hajnal, Simonovits, Sós, and Szemerédi**, who established the upper bound δ₃(5) ≤ 1/12 and proved δ₃(4) = 0. +- Original sources cited on the website: **[Er91]** (Erdős, 1991) and **[EHSSS94]** (p. 306). +- **[LRSS21]** Liu, H., Reiher, C., Sharifzadeh, M., and Staden, K. established the exact value δ₃(5) = 1/12. +- Related to **Problem 579**. + +**Issue:** The formalization's docstring mentions "The correct value is δ₃(5) = 1/12" but does not cite [LRSS21], which is the paper that established this. The original proposers (Erdős, Hajnal, Simonovits, Sós, Szemerédi) and original source references [Er91] and [EHSSS94] are also not cited. The [BaLe13] citation format is acceptable (short author abbreviation with year) but could include the journal or arXiv identifier for completeness. + +**Recommendation:** Add citations for [LRSS21] and at least one of the original sources [Er91] or [EHSSS94]. + +## 3. Variants + +The formalization captures only the original conjecture (and its negation via `answer(False)`). + +**Missing variants:** +- **The exact value δ₃(5) = 1/12.** The docstring mentions this but it is not formalized. A natural variant would state: there exists a constant δ₀ = 1/12 such that for all δ > δ₀, the conclusion holds, and for all δ < δ₀, it fails. This would fully capture the resolved state of the problem. +- **The general Ramsey-Turán density framework.** The problem is naturally part of a family parameterized by (r, s) asking for δ_r(s). The case δ₃(4) = 0 (proved by the original authors) and δ₃(7) ≥ 1/4 (via a construction of Erdős and Rogers) are mentioned on the website but not formalized here. + +These are not strictly required for a single-problem formalization, but the exact value δ₃(5) = 1/12 is a significant and natural companion statement. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The namespace `Erdos533` and theorem name `erdos_533` follow project conventions. +- The module docstring clearly explains the problem, its equivalence to δ₃(5) = 0, and the disproof. +- The theorem docstring provides good mathematical context. +- The quantifier structure reads naturally: for all δ > 0, there exist c > 0 and N such that for large enough n, every K₅-free graph with enough edges has a large triangle-free induced subgraph. +- The use of `answer(False)` clearly signals the problem was disproved. + +**No readability issues identified.** + +## 5. Formalizability + +The problem statement is **fully precise and unambiguously formalizable**. All components have clear mathematical definitions: + +- "Graph on n vertices": `SimpleGraph (Fin n)` +- "No K₅": `G.CliqueFree 5` +- "At least δn² edges": `δ * (n : ℝ) ^ 2 ≤ (G.edgeSet.ncard : ℝ)` +- "Set of ≫_δ n vertices": `∃ c > 0, ... c * n ≤ |S|` (with c depending on δ) +- "Containing no triangle": `(G.induce S).CliqueFree 3` + +The notation "≫_δ n" (meaning Ω_δ(n), i.e., at least c·n for some c depending on δ) is correctly captured by the existential quantifier over c after δ is fixed. + +**Ambiguity assessment: None.** The Ramsey-Turán formulation is a well-established framework with unambiguous definitions. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification:** + +1. **`answer(False)` semantics.** The `answer` elaborator reduces `answer(False)` to `False`. So the theorem states `False ↔ (the conjecture)`, i.e., the conjecture is false. This correctly captures that the conjecture was disproved by Balogh and Lenz. + +2. **Edge count normalization.** The formalization uses `δ * n²` rather than `δ * n(n-1)/2`. This is immaterial: since δ is universally quantified over all positive reals, any fixed positive fraction of n² can be absorbed into the constant. The truth value of the statement is invariant under this choice. + +3. **Quantifier ordering.** The structure is: + ``` + ∀ δ > 0, ∃ c > 0, ∃ N, ∀ n ≥ N, ∀ G, (hypotheses) → (conclusion) + ``` + This correctly captures "for any edge density threshold, there is a linear-sized triangle-free induced subgraph in any sufficiently large K₅-free graph meeting that threshold." The constant c is allowed to depend on δ (since it is chosen after δ), which is the correct reading of "≫_δ n". + +4. **`CliqueFree 3` for triangle-freeness.** `CliqueFree 3` means no clique of size 3, i.e., no triangle. This is correct. The formalization uses `induce` to restrict to the induced subgraph on S, so "triangle-free induced subgraph" is accurately captured. + +5. **`CliqueFree 5` for K₅-freeness.** Correct — excludes complete graphs on 5 vertices. + +6. **Use of `ncard` vs `card`.** `Set.ncard` is used for `edgeSet`, which is a `Set`. Since the graph is on `Fin n`, the edge set is finite, and `ncard` returns the correct cardinality. This is consistent with the approach in Problem 579. Using `Finset.card` after converting to a `Finset` would also work but would require additional finiteness plumbing; `ncard` is the cleaner choice. + +7. **The negation is correct.** Since δ₃(5) = 1/12 > 0, there exist K₅-free graphs with Θ(n²) edges where every triangle-free induced subgraph is sublinear. The negation of the formalized statement (i.e., the truth) asserts: there exists δ > 0 such that for all c > 0, for all N, there exists n ≥ N and a K₅-free graph G with ≥ δn² edges where every triangle-free induced subgraph has fewer than cn vertices. This is exactly what δ₃(5) > 0 means. + +**No mathematical flaws identified.** The formalization is correct and complete for the stated problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Appropriate; consistent with Problem 579 pattern | +| Citations | **Incomplete** — missing [LRSS21], [Er91]/[EHSSS94] | +| Variants | **Missing** — δ₃(5) = 1/12 exact value not formalized | +| Readability | Good; clean and conventional | +| Formalizability | Fully precise, no ambiguity | +| Correctness | **Correct** — no mathematical issues | diff --git a/ai-review/534.md b/ai-review/534.md new file mode 100644 index 0000000000..e91820f70a --- /dev/null +++ b/ai-review/534.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 534 + +## 1. Code Reuse + +The custom `primeFactors` definition at line 52: + +```lean +noncomputable def primeFactors (N : ℕ) : Finset ℕ := + (Icc 1 N).filter (fun p => Nat.Prime p ∧ p ∣ N) +``` + +is equivalent to Mathlib's `Nat.primeFactors` (which is `(Nat.primeFactorsList n).toFinset`) for `N ≥ 1`. Other files in the codebase (e.g., `ErdosProblems/452.lean`, `ErdosProblems/122.lean`) already use `Nat.primeFactorsList n).toFinset` for this purpose. The custom definition should be replaced with `N.primeFactors` from Mathlib, or at minimum a docstring should note the equivalence. This would also give access to existing lemmas about `Nat.primeFactors` (membership, subset relations, etc.) without needing to prove them from scratch. + +The `candidate` definition and the overall structure of the theorem are problem-specific and do not have obvious reuse candidates in `FormalConjecturesForMathlib/`. + +## 2. Citations + +The formalization includes references `[Er73]` and `[AhKh96]`, which match the website: + +- **[Er73]**: Erdős, P., *Problems and results on combinatorial number theory*. The formalization includes the full citation with conference details. ✓ +- **[AhKh96]**: Ahlswede, R. and Khachatrian, L.H., *Sets of integers and quasi-integers with pairwise common divisor* (1996). ✓ + +**Missing from the formalization:** +- The website notes related **Problem 56** — could be cross-referenced. +- OEIS sequences **A387543** and **A387698** are listed on the website but not in the docstring. +- The website notes the original statement in [Er73] contained a **typo** (using coprimality `(a,b) = 1` instead of `gcd(a,b) > 1`), which is not mentioned. +- The website credits the citation format as: *T. F. Bloom, Erdős Problem #534*. + +## 3. Variants + +The formalization captures the **refined Erdős conjecture** (proved by Ahlswede–Khachatrian), which subsumes the original Erdős–Graham conjecture. The docstring correctly explains that the original conjecture (maximum is `N/p` or the count of even integers `2t ≤ N` with `gcd(2t, N) > 1`) was disproved by a counterexample found in 1992. + +No additional variants appear on the website beyond what is already documented. The formalization appropriately focuses on the proved refined version rather than the disproved original. + +## 4. Readability + +The code is well-structured and readable: +- The `primeFactors` and `candidate` helper definitions are clearly named and documented. +- The theorem statement is broken into logical conjuncts that map directly to the mathematical content. +- The docstring provides good context about the problem's history. + +**Minor suggestions:** +- The "initial segment" condition `∀ p ∈ primeFactors N, ∀ q ∈ S, p ≤ q → p ∈ S` is correct but could benefit from a brief inline comment or a named predicate (e.g., `IsInitialSegment`) for clarity. +- The conjunct `N ∈ candidate N S` is mathematically redundant (since `S ⊆ primeFactors N` and `S.Nonempty` guarantee that `∏ p ∈ S, p` divides `N`, so `N` is always in the candidate set). However, retaining it improves readability by making the connection to the problem's "containing N" requirement explicit. This is a reasonable design choice. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem as stated on the website is precise: it asks for the maximum size of a pairwise non-coprime subset of `{1, ..., N}` containing `N`. The answer (the candidate family construction) is also precisely described. All components are: +- Finitary and constructive (finite sets, divisibility, GCD) +- Well-defined using standard Mathlib primitives + +The only potential source of ambiguity is the phrase "achieved by taking ... all integers in [1, N] divisible by at least one element of {2q₁, ..., 2qⱼ, q₁⋯qⱼ}," but the formalization resolves this correctly via the `candidate` definition. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization accurately captures the Ahlswede–Khachatrian theorem. Detailed verification: + +1. **`primeFactors` is correct**: computes the set of prime divisors of `N` in `{1, ..., N}`. Equivalent to Mathlib's `Nat.primeFactors` for `N ≥ 1`. + +2. **`candidate` is correct**: for a set `S` of primes, it computes `{m ∈ [1,N] : (∃ p ∈ S, 2p ∣ m) ∨ (∏ p ∈ S, p) ∣ m}`. This matches the problem's description: all integers divisible by `2qᵢ` for some `qᵢ ∈ S`, or by the product `q₁⋯qⱼ`. + +3. **Initial segment condition is correct**: `∀ p ∈ primeFactors N, ∀ q ∈ S, p ≤ q → p ∈ S` ensures `S = {q₁, ..., qⱼ}` for some `j`, where `q₁ < q₂ < ...` are the prime factors in increasing order. + +4. **Pairwise GCD condition is verified**: The candidate set is indeed pairwise non-coprime: + - If both `a, b` satisfy `2p ∣ a` and `2q ∣ b` for some `p, q ∈ S`: then `2 ∣ gcd(a, b)`. + - If `a` satisfies `2p ∣ a` and `b` satisfies `(∏ S) ∣ b`: then `p ∣ a` and `p ∣ b`, so `p ∣ gcd(a, b) > 1`. + - If both satisfy `(∏ S) ∣ a` and `(∏ S) ∣ b`: any `p ∈ S` divides both (and `p ≥ 2`). + +5. **Optimality claim is correct**: the theorem asserts that no valid set `A ⊆ [1, N]` containing `N` with pairwise `gcd > 1` can have cardinality exceeding that of the candidate set for the optimal `S`. This is exactly the Ahlswede–Khachatrian result. + +6. **Edge cases**: + - `N` odd: The candidate set still works. Elements divisible by `2p` (for `p ∈ S`) are even and share factor `p` with elements divisible by the product. `N` itself enters via the product condition. + - `j = 1` (S = {q₁}): candidate = multiples of `q₁` in `[1, N]`, giving size `⌊N/q₁⌋`. This recovers the `N/p` case from the original conjecture. + - `j = r` (S = all prime factors): also valid. + +7. **Tags**: `@[category research solved, AMS 5 11]` — the "solved" tag is correct per the website. AMS classification 11 (Number Theory) with subject 5 is reasonable. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the theorem. diff --git a/ai-review/535.md b/ai-review/535.md new file mode 100644 index 0000000000..16368a7fb4 --- /dev/null +++ b/ai-review/535.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 535 + +## 1. Code Reuse + +**No significant reuse opportunities identified.** + +- The `IsGCDUniformFree` definition in `535.lean:50-52` is specific to this problem. While conceptually related to the sunflower definitions in `ErdosProblems/20.lean` (`IsSunflowerWithKernel`, `IsSunflower`), those operate on `Set (Set α)` rather than `Finset ℕ` with GCD, so they cannot be directly reused. +- Problem 539 (`539.lean:36-37`) defines `gcdQuotientSet` which also works with GCDs on `Finset ℕ`, but serves a different purpose (quotient sets vs. uniform-free sets). +- The `Finset.Icc 1 N` pattern for subsets of `{1,...,N}` is standard across the codebase (e.g., 534, 536, 539) and is used correctly here. + +## 2. Citations + +**Partially complete. Several references from the website are missing.** + +The formalization cites: +- [Er64] Erdős, P., *On extremal problems of graphs and generalized graphs*, Israel J. Math. 2 (1964), 183--190. ✅ Matches website. +- [AbHa70] Abbott, H.L. and Hanson, D., *A problem of Schur and its generalizations*, Acta Arith. 20 (1970), 175--187. ✅ Matches website. + +Missing from the formalization but listed on the website: +- [Er69], [Er70], [Er73] — additional Erdős references listed on erdosproblems.com/535. + +The docstring references the sunflower problem as "[20]" which is an internal cross-reference (Problem 20), not a bibliographic citation. This is fine but could be made more explicit by linking to `ErdosProblems/20.lean`. + +The website also mentions Problem 536 as a related problem ("See Problem #536"), which is not noted in the formalization's docstring. Problem 536 (`536.lean`) is the "dual" problem about triples with equal pairwise LCM. + +## 3. Variants + +**Partially captured. One proved result is missing as a variant.** + +Present: +- **Upper bound conjecture** (`erdos_535`, line 64): The main open conjecture that f_r(N) ≤ N^{c/log log N}. ✅ +- **Lower bound** (`erdos_535.variants.lower_bound`, line 81): The proved lower bound f_3(N) > N^{c/log log N}. ✅ Correctly marked `category research solved`. + +Missing: +- **Abbott-Hanson upper bound**: The docstring mentions that Abbott and Hanson [AbHa70] improved the upper bound to f_r(N) ≤ N^{1/2+o(1)}, but this is not formalized as a variant. This is a proved result that could be stated as `erdos_535.variants.abbott_hanson_upper_bound`. +- **Erdős's original 3/4 bound**: Similarly, the original Erdős bound f_r(N) ≤ N^{3/4+o(1)} is mentioned but not formalized. + +## 4. Readability + +**Good overall.** Minor suggestions: + +- The docstring for `IsGCDUniformFree` (line 46-49) is clear and well-written. +- The module docstring (lines 19-39) gives good context including the history of results. +- The connection to the sunflower problem could be elaborated slightly — specifically, the observation that associating each integer with its set of prime power divisors transforms GCD-uniform subsets into sunflowers. + +## 5. Formalizability + +**High formalizability. Low ambiguity.** + +The original Erdős problem asks to "Estimate f_r(N)," which is inherently vague. The formalization resolves this ambiguity well by splitting into: +1. A specific conjectured upper bound (N^{c/log log N}) +2. A proved lower bound (N^{c/log log N} for r = 3) + +The definition of f_r(N) as the maximum size of an r-GCD-uniform-free subset of {1,...,N} is unambiguous and the `IsGCDUniformFree` predicate captures this precisely. + +One minor point: the bound expression `(N : ℝ) ^ (c / Real.log (Real.log (N : ℝ)))` requires N large enough that log(log(N)) > 0 (i.e., N ≥ 3). This is correctly handled by the existential `N₀`. + +## 6. Correctness + +**Mostly correct, with one notable concern about the scope of the upper bound conjecture.** + +### Definition correctness ✅ +`IsGCDUniformFree` (line 50-52) correctly captures the intended property. Since `Finset` elements are distinct by construction, the quantification `∀ a ∈ S, ∀ b ∈ S, a ≠ b → Nat.gcd a b = d` correctly checks all distinct pairs. The negation `¬∃ d` correctly asserts that no uniform GCD value exists. + +### Upper bound conjecture ⚠️ +The main conjecture `erdos_535` (line 64) states the upper bound f_r(N) ≤ N^{c/log log N} for **all r ≥ 3**. However, the website states that Erdős conjectured this specifically for **r = 3**: "Erdős proved the lower bound f_3(N) > N^{c/log log N} for some constant c > 0, and conjectured this should also be an upper bound." + +The generalization to all r ≥ 3 is plausible (it would follow from a strong form of the sunflower conjecture), but may be **stronger than what Erdős explicitly conjectured**. Consider either: +- Restricting the main conjecture to r = 3, or +- Adding a note that the generalization to all r ≥ 3 is an extension of Erdős's original conjecture. + +The constant `c` is allowed to depend on `r` (since `r` is universally quantified before `c` is existentially quantified), which is mathematically appropriate. + +### Lower bound ✅ +`erdos_535.variants.lower_bound` (line 81) correctly specializes to r = 3, matching Erdős's proved result. The bound direction (lower bound on the existence of a large set) is correctly formalized with the existential quantifier over A. + +### Bound expression ✅ +The expression `N^{c/log log N}` is correctly rendered as `(N : ℝ) ^ (c / Real.log (Real.log (N : ℝ)))`. Since Erdős uses natural logarithm (standard in analytic number theory), `Real.log` is the correct choice. + +### Summary +| Aspect | Assessment | +|--------|------------| +| Code reuse | No opportunities found | +| Citations | Partially complete — missing [Er69], [Er70], [Er73] and cross-ref to Problem 536 | +| Variants | Missing Abbott-Hanson and original Erdős upper bounds as formalized variants | +| Readability | Good | +| Formalizability | High — low ambiguity in the formalization | +| Correctness | Sound, but the upper bound conjecture may be stated more broadly (all r ≥ 3) than Erdős intended (r = 3) | diff --git a/ai-review/537.md b/ai-review/537.md new file mode 100644 index 0000000000..f7afaff940 --- /dev/null +++ b/ai-review/537.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 537 + +## 1. Code Reuse + +Several opportunities for code reuse or alignment with existing infrastructure: + +- **Problem 536** (`ErdosProblems/536.lean`) is directly related (the docstring states "A positive answer would imply Problem 536") and uses a noticeably more idiomatic style: `∀ᵉ (ε > (0: ℝ))`, `∀ᶠ N in atTop`, `∃ᵉ (a ∈ A) (b ∈ A)`, and `# {a, b, c} = 3` for distinctness. Problem 537 should adopt these conventions for consistency. +- **Problem 538** (`ErdosProblems/538.lean`) defines `numPrimeProductReps` counting representations of the form `a * p` for `a ∈ A` and `p` prime, which is closely related to the multiplicative structure in Problem 537. Not directly reusable here but worth noting for any future proof effort. +- **`FormalConjecturesForMathlib/Data/Nat/Squarefree.lean`** provides `squarefreePart`, `squarefree_squarefreePart`, etc. These would be relevant if the counterexample construction (Ruzsa's squarefree set) were formalized. +- **`FormalConjecturesForMathlib/Data/Set/Density.lean`** provides `HasPosDensity`, `partialDensity`, `upperDensity`, `lowerDensity`. Not needed for the current statement but relevant to any proof formalizing Ruzsa's construction. + +No existing implementation would serve as a drop-in replacement for the statement itself. + +## 2. Citations + +The formalization references `[erdosproblems.com/537]`. The website cites: + +- **[Er73]** as the original source. + +The docstring should include the explicit citation `[Er73]` (likely P. Erdős, "Problems and results on combinatorial number theory III," 1973 or similar) to match the website. Additionally, Ruzsa is credited for the disproof but no specific publication is cited on the website, so the current attribution "Disproved by a construction of Ruzsa" is acceptable. The website also credits **Zach Hunter** (likely for the Lean verification), which is not mentioned in the formalization but is not strictly necessary. + +## 3. Variants + +The website does not list any additional variants beyond the main problem statement. The single theorem `erdos_537` captures the complete problem. No variants are missing. + +The relationship to Problem 536 (lcm version) is correctly noted in the docstring. The website confirms: "A positive answer would imply Problem 536." + +## 4. Readability + +Several readability improvements are recommended to align with the style used in the adjacent Problem 536: + +- **Quantifier notation**: Replace `∀ (ε : ℝ), 0 < ε →` with `∀ᵉ (ε > (0 : ℝ))` (extended binder syntax). +- **Eventually-at-top**: Replace `∃ N₀ : ℕ, ∀ N : ℕ, N₀ ≤ N →` with `∀ᶠ N in atTop`. These are logically equivalent for ℕ and the latter is standard Mathlib idiom. +- **Existential binders**: Replace `∃ a₁ ∈ A, ∃ a₂ ∈ A, ∃ a₃ ∈ A,` with `∃ᵉ (a₁ ∈ A) (a₂ ∈ A) (a₃ ∈ A),` for consistency with Problem 536. +- **Prime distinctness**: The three-way distinctness `p₁ ≠ p₂ ∧ p₁ ≠ p₃ ∧ p₂ ≠ p₃` is clear but could alternatively use `#{p₁, p₂, p₃} = 3` for compactness. Either is acceptable; the current form is arguably more explicit. +- **Namespace open**: `open Finset` is fine. Could additionally open `Nat` and `Filter` as 536 does, if `∀ᶠ ... in atTop` is adopted. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The problem statement is entirely precise: it involves a concrete combinatorial/number-theoretic question about finite subsets of {1, …, N}, primes, and multiplicative equations. Every concept (prime, subset, cardinality, multiplication, distinctness) has a standard Lean/Mathlib formalization. The answer is known (disproved by Ruzsa), so there is no ambiguity about truth value. + +The only mild subtlety is whether the `aᵢ` must be distinct. The original problem does not explicitly require this, and the formalization correctly omits this constraint. Notably, distinctness of the `aᵢ` is *forced* by the equations: if `a₁ = a₂` and `a₁ * p₁ = a₂ * p₂` with `a₁ ≥ 1`, then `p₁ = p₂`, contradicting prime distinctness. So the formalization is correct regardless. + +**Ambiguity: None.** + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization faithfully captures the problem: + +- `answer(False)` correctly encodes that the conjecture is disproved. +- The `↔` with `answer(False)` means the RHS (the universal statement) is equivalent to `False`, i.e., the conjecture fails. This is the standard pattern for disproved conjectures in this codebase. +- `A ⊆ Icc 1 N` correctly formalizes A ⊆ {1, …, N}. +- `ε * ↑N ≤ ↑A.card` correctly encodes |A| ≥ εN. +- The existential over `a₁, a₂, a₃ ∈ A` and primes `p₁, p₂, p₃` with pairwise distinctness and the equation chain `a₁ * p₁ = a₂ * p₂ ∧ a₁ * p₁ = a₃ * p₃` correctly captures the condition a₁p₁ = a₂p₂ = a₃p₃. +- The conjunction `Nat.Prime p₁ ∧ Nat.Prime p₂ ∧ Nat.Prime p₃` ensures all three are prime. +- All six pairwise distinctness conditions on the three primes are present. + +**No mathematical flaws identified.** An experienced mathematician would agree this is a faithful formalization. + +**Minor note on completeness**: The docstring's description of Ruzsa's counterexample is informative but not formally verified. This is appropriate for a `sorry`-admitted theorem statement. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor | Could align style with Problem 536; no drop-in reuse available | +| Citations | Minor issue | Should add explicit `[Er73]` citation per the website | +| Variants | Complete | No missing variants | +| Readability | Moderate improvements | Should adopt `∀ᵉ`/`∃ᵉ`/`∀ᶠ` idioms matching Problem 536 | +| Formalizability | Excellent | Unambiguous, fully formalizable | +| Correctness | Correct | Faithful formalization, no mathematical flaws | diff --git a/ai-review/538.md b/ai-review/538.md new file mode 100644 index 0000000000..8efece3c2b --- /dev/null +++ b/ai-review/538.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 538 + +## 1. Code Reuse + +The inline reciprocal sum `A.sum (fun n => (1 : ℝ) / (n : ℝ))` follows the same pattern found in several other Erdős problem files (e.g., Problem 444's `reciprocalSum` at `ErdosProblems/444.lean:44-45`, Problem 296's `reciprocalSum` at `ErdosProblems/296.lean:44-45`, and the inline version in Problem 47 at `ErdosProblems/47.lean:53`). There is no shared utility for this — each file defines or inlines its own. The inline approach used here is acceptable, though a shared `reciprocalSum` helper in a utility module could reduce repetition across the codebase. + +The `numPrimeProductReps` definition is unique to this file and appropriately specialized. Similar divisor-counting-with-filter patterns exist in Problems 446, 534, and 691, but none are directly reusable here since this definition counts specifically the representations `m = p * a` with `p` prime. No changes recommended. + +## 2. Citations + +The website ([erdosproblems.com/538](https://www.erdosproblems.com/538)) lists one reference: + +- **[Er73]** — Erdős, P. (1973), original source for this problem. + +The formalization's module docstring does not cite [Er73] explicitly. It should include: + +``` +[Er73] Erdős, P., 1973. +``` + +to match the website's documented reference. The related problems listed on the website are **Problem 536** and **Problem 537**, which both exist in the codebase (`ErdosProblems/536.lean`, `ErdosProblems/537.lean`). Problem 537 is thematically close (prime products involving elements of a dense subset), and a cross-reference in the docstring could be helpful. + +## 3. Variants + +The formalization includes two theorems: + +1. **`erdos_538`** (tagged `research open`): The sharpness conjecture — the upper bound `r · log N / log log N` is achieved up to a constant. +2. **`erdos_538.variants.upper_bound`** (tagged `research solved`): Erdős's upper bound itself. + +The website's problem statement asks: "Find the best possible upper bound for ∑ 1/n." The formalization decomposes this cleanly into: +- The upper bound (solved by Erdős's counting argument), and +- The matching lower bound / sharpness (still open). + +This captures all variants present on the website. No additional variants are missing. + +## 4. Readability + +The code is well-structured and readable: + +- The `numPrimeProductReps` definition has a clear docstring explaining the combinatorial interpretation and why `p` is determined by `a`. +- Both theorems have detailed docstrings with LaTeX rendering of the mathematical statements. +- The namespace `Erdos538` is appropriately scoped. +- The `open Finset Real` is minimal and appropriate. + +**Minor suggestion:** The module docstring reproduces Erdős's counting argument (the chain of inequalities), which is a nice touch for context. + +## 5. Formalizability + +**Assessment: Low ambiguity; clearly formalizable.** + +The original problem asks to "find the best possible upper bound," which is qualitative and could be interpreted in several ways. However, the formalization makes a specific, precise mathematical claim: the answer is `Θ(r · log N / log log N)`. This is the standard interpretation in the literature. + +The only potential source of ambiguity is: +- The range of `m`: The problem says "for any m" without restriction. The formalization uses `∀ m : ℕ`, which correctly includes all natural numbers (including 0, which is handled correctly since `0 / a = 0` is not prime, giving count 0). + +The quantifier structure deserves scrutiny: both theorems use `∃ N₀, ∀ N ≥ N₀, ∀ r ≥ 2, ...`, meaning `N₀` is chosen independently of `r`. This is mathematically correct — Erdős's argument uses `∑_{p ≤ N} 1/p ∼ log log N` and `∑_{m ≤ N²} 1/m ∼ 2 log N`, both of which have implied constants independent of `r`. Similarly for the sharpness conjecture, the construction should work for all large `N` uniformly in `r`. + +## 6. Correctness + +**Assessment: Mathematically correct and complete.** + +**`numPrimeProductReps` (line 44-45):** Counts `a ∈ A` such that `a ∣ m` and `m / a` is prime. This correctly counts the number of representations `m = p · a` with `p` prime and `a ∈ A`, since given `a` the prime `p = m / a` is uniquely determined. The docstring correctly notes this. + +**`erdos_538` (sharpness, line 56-64):** States that there exists a universal constant `c > 0` such that for all sufficiently large `N` and all `r ≥ 2`, one can find `A ⊆ {1, ..., N}` with at most `r` representations per `m` and `∑_{n ∈ A} 1/n ≥ c · r · log N / log log N`. This is the correct formalization of "the upper bound is best possible." + +**`erdos_538.variants.upper_bound` (line 75-83):** States the converse — there exists `C > 0` such that any such `A` satisfies `∑_{n ∈ A} 1/n ≤ C · r · log N / log log N`. This matches Erdős's proved bound. + +**Quantifier order:** Both theorems quantify `∃ constant, ∃ N₀, ∀ N ≥ N₀, ∀ r ≥ 2, ...`. The constant and threshold `N₀` are independent of `r`. This is correct: +- For the upper bound, the implied constants in `∑_{p ≤ N} 1/p ≈ log log N` and `∑_{m ≤ N²} 1/m ≈ 2 log N` are absolute. +- For the sharpness conjecture, having the constant independent of `r` correctly captures that the order of magnitude is `r · log N / log log N` (linear in `r`). + +**Edge cases:** +- `m = 0`: No element divides 0 in a way that yields a prime quotient (`0 / a = 0` for `a > 0`), so the count is 0. Correct. +- `a ∈ A` implies `a ≥ 1` (since `A ⊆ Icc 1 N`), so natural number division `m / a` is well-behaved. +- `N = 0` or small `N`: Handled by the `∃ N₀` threshold. + +**Status tags:** `erdos_538` is tagged `research open` and `erdos_538.variants.upper_bound` is tagged `research solved`. Both match the website (the problem is marked OPEN — the upper bound is proved but sharpness is not). + +No mathematical flaws identified. The formalization is faithful to the problem as stated on erdosproblems.com. diff --git a/ai-review/539.md b/ai-review/539.md new file mode 100644 index 0000000000..c70f40673e --- /dev/null +++ b/ai-review/539.md @@ -0,0 +1,84 @@ +# Review: Erdős Problem 539 + +## 1. Code Reuse + +The helper definition `gcdQuotientSet` is specific to this problem and well-scoped. There is no existing utility in `FormalConjecturesForMathlib` that provides a generic GCD-quotient set construction. Problem 535 (`FormalConjectures/ErdosProblems/535.lean`) also works with GCD-related Finset constructions over ℕ but defines a different predicate (`IsGCDUniformFree`) — no code sharing is possible. The use of `Finset.image` over `A ×ˢ A` is idiomatic and there is no abstraction to extract here. + +**Verdict:** No reuse opportunities identified. + +## 2. Citations + +The website ([erdosproblems.com/539](https://www.erdosproblems.com/539)) lists the following references: + +- **[Er73]** — Original Erdős source (the formalization's module docstring does not expand this citation). +- **[GrRo99]** — Granville and Roesler, who proved bounds and reformulated the problem in combinatorial geometry terms. + +The formalization's docstring mentions "Erdős and Szemerédi" and "Freiman and Lev" by name but does not provide full citation details (journal, year, title) for any reference. The website also credits **Vjekoslav Kovac** under "Special Thanks." + +**Recommendation:** Add explicit citation entries for [Er73] and [GrRo99] in the module docstring, matching the convention used in Problem 535 which includes full `[Key] Author, *Title*, Journal Volume (Year), Pages.` entries. + +## 3. Variants + +The formalization captures two results: + +1. **Lower bound** (Erdős-Szemerédi): h(n) ≫ n^{1/2} — formalized as `erdos_539`. +2. **Upper bound** (Freiman-Lev): h(n) ≪ n^{2/3} — formalized as `erdos_539.variants.upper_bound`. + +**Missing variants:** + +- The **original Erdős-Szemerédi upper bound** h(n) ≪ n^{1-c} is mentioned in the docstring but not separately formalized. This is acceptable since the Freiman-Lev bound n^{2/3} strictly improves it (2/3 < 1-c for any fixed c > 0 and large n), so there is no mathematical loss. +- The **Granville-Roesler combinatorial geometry reformulation** (minimum size of coordinate-wise positive differences in fixed dimensions) mentioned on the website is not captured. This is a meaningful reformulation but arguably a different problem statement rather than a variant of the original. +- The **overall open question** — to close the gap between n^{1/2} and n^{2/3} — is inherently vague ("estimate h(n)") and is not directly formalizable as a single theorem. The formalization correctly captures the known endpoints of this gap. + +**Verdict:** The important mathematical content is captured. The Granville-Roesler reformulation could be noted in the docstring even if not formalized. + +## 4. Readability + +The code is clean and readable: + +- `gcdQuotientSet` is clearly named with a good docstring matching the mathematical notation. +- The two theorems are well-separated with descriptive docstrings. +- The namespace `Erdos539` prevents name collisions. + +**Minor suggestions:** +- The exponents `(1 : ℝ) / 2` and `(2 : ℝ) / 3` could be simplified to `(1 / 2 : ℝ)` and `(2 / 3 : ℝ)` for slightly cleaner presentation, though the current form is unambiguous and consistent with other files in the repository. + +**Verdict:** Good readability; no significant issues. + +## 5. Formalizability + +The problem as stated on the website is: *estimate h(n)*, where h(n) is the minimum size of the GCD-quotient set over all n-element subsets of ℕ. The known bounds n^{1/2} ≪ h(n) ≪ n^{2/3} are fully precise and directly formalizable. + +The vague part — "estimate" — refers to closing the gap between these bounds, which cannot be expressed as a single formal statement without conjecturing the exact exponent. The formalization handles this correctly by stating the two known bounds as separate theorems. + +**Verdict:** Low ambiguity. The formalizable parts are precisely captured; the inherently vague "estimate" direction is appropriately left implicit. + +## 6. Correctness + +**Definition correctness:** +- `gcdQuotientSet A` computes `{a / gcd(a,b) : (a,b) ∈ A × A}`, which matches the mathematical definition `{a/(a,b) : a,b ∈ A}`. The use of `Nat.div` is safe here because `gcd(a,b)` always divides `a`, so `a / gcd(a,b)` in ℕ equals the true quotient. +- The diagonal case (a = b) contributes `a / gcd(a,a) = a/a = 1` for positive a, which is mathematically correct (the set {a/(a,b)} in the original problem includes a = b). + +**Lower bound theorem (`erdos_539`):** +- States ∃ C > 0 such that ∀ A (with positive elements), C · |A|^{1/2} ≤ |gcdQuotientSet(A)|. This is a correct formalization of the Erdős-Szemerédi lower bound h(n) ≫ n^{1/2}. +- Edge cases: For A = ∅, the inequality becomes C · 0 ≤ 0, which holds. For |A| = 1, we get C ≤ 1, which is a valid constraint on the constant. + +**Upper bound theorem (`erdos_539.variants.upper_bound`):** +- States ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ∃ A with |A| = n and |gcdQuotientSet(A)| ≤ C · n^{2/3}. This correctly formalizes h(n) ≪ n^{2/3} by exhibiting a witnessing set for each sufficiently large n. +- The use of `∃ n₀` for "sufficiently large" is standard and correct. + +**Category tags:** +- Both theorems are tagged `category research solved`, which is correct — these are established results (Erdős-Szemerédi and Freiman-Lev respectively). The overall problem of closing the gap is open, but the formalized statements themselves are proven results. + +**Verdict:** The formalization is mathematically correct and complete for the results it claims to capture. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | No opportunities | +| Citations | Missing full citation details for [Er73] and [GrRo99] | +| Variants | Core bounds captured; Granville-Roesler reformulation not mentioned | +| Readability | Good | +| Formalizability | Low ambiguity; well-handled | +| Correctness | Correct and complete | diff --git a/ai-review/54.md b/ai-review/54.md new file mode 100644 index 0000000000..79b8ebed67 --- /dev/null +++ b/ai-review/54.md @@ -0,0 +1,175 @@ +# Review: Erdos Problem 54 + +**File:** `FormalConjectures/ErdosProblems/54.lean` + +--- + +## 1. Code Reuse + +**Issue: `IsRamsey2Complete` is a special case of `IsRamseyComplete` already defined in Problems 55 and 843.** + +Problem 55 (`FormalConjectures/ErdosProblems/55.lean`, lines 42–47) defines: +```lean +def IsRamseyComplete (A : Set ℕ) (r : ℕ) : Prop := + ∀ (χ : ℕ → Fin r), + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∃ (S : Finset ℕ), (↑S : Set ℕ) ⊆ A ∧ + (∃ c : Fin r, ∀ x ∈ S, χ x = c) ∧ + S.sum id = n +``` + +Problem 54's `IsRamsey2Complete A` is definitionally equal to `Erdos55.IsRamseyComplete A 2`. The two definitions are structurally identical with `Fin 2` replacing `Fin r`. Problem 843 (`FormalConjectures/ErdosProblems/843.lean`, lines 34–39) defines yet another `IsRamseyComplete` that is logically equivalent but syntactically different (reorders the existentials). + +Three files define the same concept independently. This should be consolidated into a single shared definition (e.g., in `FormalConjecturesForMathlib` or a shared Ramsey utility file), with `IsRamsey2Complete` either removed or defined as an abbreviation: +```lean +abbrev IsRamsey2Complete (A : Set ℕ) : Prop := IsRamseyComplete A 2 +``` + +**Also notable:** Mathlib already provides `Finset.subsetSum` in `Mathlib/Combinatorics/Additive/SubsetSum.lean` (line 37), defined as `A.powerset.image fun B ↦ B.sum id`. The `IsRamsey2Complete` definition essentially asks that for every coloring, monochromatic subset sums eventually cover all of ℕ. While directly using `subsetSum` would require adapting the definition (since `subsetSum` operates on `Finset` not `Set`, and doesn't incorporate the coloring constraint), it's worth noting the conceptual overlap. + +**Recommendation:** Promote `IsRamseyComplete` (parameterized by `r`) to a shared definition used by Problems 54, 55, and 843. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/54](https://www.erdosproblems.com/54):** + +The website lists: +- **Status:** Solved ($100 prize) +- **Tags:** Number theory, Ramsey theory +- **References:** [BuEr85], [Er95], [CFP21] +- **Related problems:** 55, 843 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved]` | Solved | **Correct.** | +| AMS classification | `AMS 5` | Number theory / Ramsey theory | **Acceptable**, though adding `AMS 11` (Number theory) would better match Problem 55 which uses `AMS 5 11`. | +| Citation [CFP21] | Present, full bibliographic entry | Present | **Correct.** | +| Citation [BuEr85] | **Missing** | Present | **Missing.** Burr and Erdős (1985) posed the problem and proved the initial bounds. Should be cited. | +| Citation [Er95] | **Missing** | "Er95, p.172" | **Missing.** Erdős (1995) reference should be included. | +| Related problems | Not mentioned | Problems 55, 843 | **Missing.** Cross-references to the generalized r-coloring version (Problem 55) and the squares variant (Problem 843) would be valuable. | + +**Citation correction needed.** The docstring mentions "[CFP21]" only. The website lists three references. The docstring should add: +``` +[BuEr85] Burr, S.A. and Erdős, P., (1985). +[Er95] Erdős, P., (1995), p. 172. +``` + +**Paper title discrepancy:** The formalization cites [CFP21] as *"Subset sums, completeness and colorings"* while Problem 55 cites the same authors/year as *"The upper bound for Ramsey complete sequences."* These may be different papers or different versions of the same work. This should be verified and made consistent. + +--- + +## 3. Variants + +The website's problem statement asks to **"improve either of these bounds"** — referring to both: + +1. **Lower bound** (Burr–Erdős): There exists $c > 0$ such that no Ramsey 2-complete set $A$ satisfies $|A \cap \{1,\ldots,N\}| \leq c(\log N)^2$ for all large $N$. +2. **Upper bound** (Burr–Erdős): There exists a Ramsey 2-complete $A$ with $|A \cap \{1,\ldots,N\}| < (2\log_2 N)^3$ for all large $N$. + +The formalization captures only the **resolved upper bound improvement** (the Conlon–Fox–Pham result bringing the upper bound down from $(2\log_2 N)^3$ to $O((\log N)^2)$). + +**Missing variant — the matching lower bound:** +Problem 55 includes this as `erdos_55.variants.lower_bound` (lines 71–79), which states that for some $c > 0$, any set with density $\leq c \cdot r \cdot (\log N)^2$ cannot be Ramsey $r$-complete. A corresponding 2-coloring variant should appear in Problem 54: +```lean +theorem erdos_54.variants.lower_bound : + ∃ c : ℝ, c > 0 ∧ + ∀ (A : Set ℕ), + (∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + c * (Real.log (N : ℝ)) ^ 2) → + ¬ IsRamsey2Complete A := by + sorry +``` + +This lower bound (due to Burr and Erdős [BuEr85]) is mentioned explicitly in the website's problem statement and establishes that the $(\log N)^2$ growth rate is optimal. Together with `erdos_54`, it shows the answer is $\Theta((\log N)^2)$. + +**Missing variant — the original Burr–Erdős upper bound:** +The historical bound $|A \cap \{1,\ldots,N\}| < (2\log_2 N)^3$ could also be formalized as a weaker variant, though this is less critical since the stronger result subsumes it. + +**Assessment:** The core resolved result is correctly captured. The lower bound variant is a significant omission — it is half of the original problem statement and contextualizes why the $(\log N)^2$ result is optimal. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Module docstring:** Good. Provides the mathematical context, the resolution, and a citation. However, it could be more complete — it currently describes only the upper bound result without mentioning the lower bound context from Burr–Erdős that motivates the problem. +- **Definition docstring:** Clear and accurate description of Ramsey 2-completeness. +- **Namespace:** `Erdos54` is appropriate and consistent with the project convention. +- **Opens:** `open scoped Classical` and `open Finset Real` are minimal and appropriate. +- **Counting expression:** `((Finset.Icc 1 N).filter (fun n => n ∈ A)).card` is a standard pattern used across the codebase (Problems 55, 343, 344, etc.). This is readable and consistent. + +**Minor suggestion:** The theorem docstring (lines 48–55) mentions "This improves the upper bound $(2 \log_2 N)^3$ of Burr and Erdős, matching the lower bound order of $(\log N)^2$." This is helpful context but doesn't cite [BuEr85] for the original bounds, which would improve traceability. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Clearly formalizable with minor interpretive choices.** + +The key concepts are all well-defined: + +- **Ramsey 2-completeness:** The definition is standard in additive combinatorics. The formalization correctly captures it. +- **"Sum of elements":** The website says "monochromatic sum of elements of $A$." The standard interpretation is a sum of *distinct* elements (subset sum), which the formalization enforces via `Finset`. This is correct. +- **Coloring domain:** The website says "whenever $A$ is 2-coloured," suggesting the coloring is on $A$. The formalization uses `χ : ℕ → Fin 2`, coloring all of $\mathbb{N}$. These are equivalent: every coloring of $A$ extends to $\mathbb{N}$, and every coloring of $\mathbb{N}$ restricts to $A$. Since we quantify universally over colorings, both formulations yield the same predicate. +- **$\ll$ notation:** The website uses Vinogradov notation $|A \cap \{1,\ldots,N\}| \ll (\log N)^2$ for the resolution. The formalization correctly interprets this as $\exists c > 0, \exists N_0, \forall N \geq N_0, |A \cap \{1,\ldots,N\}| \leq c \cdot (\log N)^2$. +- **Logarithm base:** The website's original Burr–Erdős bound uses $\log_2$ while the resolution and the formalization use the natural logarithm (`Real.log`). Since $\log_2 N = (\log N) / (\log 2)$, the base only affects the constant $c$, not the asymptotic order. The formalization's use of the natural logarithm is standard and correct. + +**Ambiguity level: Very low.** The only minor ambiguity is whether "sum of elements" means allowing repetitions (multiset sum) or only distinct elements (subset sum). The standard convention is distinct elements, which the formalization follows. + +--- + +## 6. Correctness + +**The formalization is mathematically correct. One structural concern exists regarding completeness.** + +### Definition: `IsRamsey2Complete` + +```lean +def IsRamsey2Complete (A : Set ℕ) : Prop := + ∀ (χ : ℕ → Fin 2), + ∃ N₀ : ℕ, ∀ n ≥ N₀, + ∃ (S : Finset ℕ), (↑S : Set ℕ) ⊆ A ∧ + (∃ c : Fin 2, ∀ x ∈ S, χ x = c) ∧ + S.sum id = n +``` + +- **Quantifier structure:** Correct. For every 2-coloring χ, there exists a threshold N₀ beyond which every n can be represented. The threshold may depend on χ, which is mathematically standard. +- **Monochromatic condition:** `∃ c : Fin 2, ∀ x ∈ S, χ x = c` correctly requires all elements of S to share one color. +- **Subset condition:** `(↑S : Set ℕ) ⊆ A` correctly requires S to be drawn from A. +- **Sum condition:** `S.sum id = n` correctly computes the sum of all elements in the finset S. +- **Distinctness:** Since S is a `Finset ℕ`, elements are automatically distinct. This matches the standard definition. +- **Empty set edge case:** For S = ∅, the sum is 0, the subset condition holds trivially, and the monochromatic condition holds vacuously. This means n = 0 is always representable. Since the definition requires representation for all n ≥ N₀ with N₀ ≥ 1 in practice, this vacuous case doesn't affect the mathematical content. No issue. + +### Theorem: `erdos_54` + +```lean +theorem erdos_54 : + ∃ (A : Set ℕ), + IsRamsey2Complete A ∧ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ N ≥ N₀, + (((Finset.Icc 1 N).filter (fun n => n ∈ A)).card : ℝ) ≤ + c * (Real.log (N : ℝ)) ^ 2 +``` + +- **Existential structure:** Correct. We claim there exists a set A that is both Ramsey 2-complete and sparse (density bounded by $c(\log N)^2$). +- **Counting function:** `(Finset.Icc 1 N).filter (fun n => n ∈ A)` correctly computes $A \cap \{1, \ldots, N\}$, using `Icc 1 N` (closed interval $[1, N]$ in ℕ). This matches the website's $|A \cap \{1, \ldots, N\}|$. +- **Density bound:** The cast to ℝ and comparison with `c * (Real.log (N : ℝ)) ^ 2` correctly formalizes the asymptotic bound. Note that for N = 0 or N = 1, `Real.log (N : ℝ)` is ≤ 0, so the right-hand side is ≤ 0, and the bound becomes `card ≤ (something ≤ 0)`. But since N ≥ N₀ and N₀ can be chosen large, this is vacuously handled. For large N, `Real.log N > 0`, and the bound is meaningful. +- **Comparison with resolved result:** Conlon, Fox, and Pham proved $|A \cap \{1,\ldots,N\}| \ll (\log N)^2$, which is exactly what the theorem states. Correct. + +### Potential concern: `Real.log` vs `Real.log` base 2 + +The original Burr–Erdős upper bound uses $\log_2$, and the docstring references this as $(2\log_2 N)^3$. The theorem uses `Real.log` (natural log). Since the theorem claims the *stronger* result $c(\log N)^2$ (not the weaker $(2\log_2 N)^3$), and since changing log base only changes the constant, this is correct. The docstring's mention of $\log_2$ is for historical context only. + +### Completeness concern + +The formalization captures the **existence** of a sparse Ramsey 2-complete set (the upper bound on minimal density). It does not capture the **lower bound** — that Ramsey 2-complete sets *must* have density at least $\Omega((\log N)^2)$. The website's original problem asks to improve *either* bound, and the full resolution establishes that $(\log N)^2$ is the correct order for both. The lower bound is formalized in Problem 55 (`erdos_55.variants.lower_bound`) for general $r$ but is absent from Problem 54 for the specific case $r = 2$. + +This is not an error in the theorem as stated — `erdos_54` is a true theorem — but it is an incomplete representation of the full problem as posed by Erdős. + +**Verdict: Correct but incomplete.** The formalization faithfully captures the Conlon–Fox–Pham resolution of the upper bound. The `IsRamsey2Complete` definition is mathematically sound and equivalent to the standard notion. The missing lower bound variant and two missing citations are the main gaps. diff --git a/ai-review/540.md b/ai-review/540.md new file mode 100644 index 0000000000..d7eaf6ee83 --- /dev/null +++ b/ai-review/540.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 540 + +## 1. Code Reuse + +Several related formalizations exist in the codebase: + +- **`subsetSums` in `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean`**: Defines `subsetSums (A : Set M) : Set M` as the set of all subset sums. Problem 540 could potentially be rephrased as `0 ∈ subsetSums (↑A : Set (ZMod N))`, though the current inline formulation `∃ S, S.Nonempty ∧ S ⊆ A ∧ ∑ n ∈ S, n = 0` is arguably clearer and avoids importing additional machinery. The `subsetSums` definition also allows the empty subset (giving sum 0 trivially), so it wouldn't be a drop-in replacement without modification. + +- **Problem 541 (`ErdosProblems/541.lean`)**: Uses the same zero-sum-over-Finset pattern (`∑ i ∈ S, a i = 0`) but for sequences `Fin p → ZMod p` rather than subsets of `ZMod N`. Structurally similar but not directly reusable. + +- **Problem 543 (`ErdosProblems/543.lean`)**: Defines `SubsetSumComplete` for complete coverage of all group elements by subset sums. Related thematically but a stronger condition than what 540 requires. + +**Assessment**: The current inline formulation is appropriate. Using `subsetSums` would require an additional nonemptiness condition and a coercion from `Finset` to `Set`, adding complexity without improving clarity. + +## 2. Citations + +The formalization includes three references: [Ol68], [Sz70], [Ba12]. The website (erdosproblems.com/540) mentions several additional references not present in the formalization: + +| Reference | In Code? | Notes | +|-----------|----------|-------| +| [Ol68] Olson, J. Number Theory (1968) | Yes | Proved the result for N prime | +| [Sz70] Szemerédi, Acta Arith. (1970) | Yes | Proved for all N / arbitrary abelian groups | +| [Ba12] Balandraud, Israel J. Math. (2012) | Yes | Sharp threshold (2N)^{1/2} for N prime | +| [ErHe64] Erdős & Heilbronn | **No** | **Original source of the problem — should be cited** | +| [HaZe96] Hamidoune & Zémor | **No** | Proved (1+o(1))√(2N) bound for arbitrary abelian groups | +| [Er65b] Erdős (1965) | **No** | Additional discussion | +| [Er73] Erdős (1973) | **No** | Additional discussion | +| [Gu04] Guy, problem C15 | **No** | Survey reference | + +**Recommendation**: At minimum, [ErHe64] should be cited as the original source. [HaZe96] is also notable as it establishes the near-optimal bound for general (non-prime) N. + +## 3. Variants + +The formalization captures only the main statement. The website and literature suggest several natural variants that are not formalized: + +1. **Sharp constant for prime N (Balandraud [Ba12])**: The docstring mentions that the threshold $(2N)^{1/2}$ was proved for N prime, but this is not formalized as a separate theorem. A natural variant would be: + ``` + theorem erdos_540.variants.prime_sharp : ∀ p : ℕ, p.Prime → + ∀ A : Finset (ZMod p), (A.card : ℝ) ≥ Real.sqrt (2 * p) → + ∃ S, S.Nonempty ∧ S ⊆ A ∧ (∑ n ∈ S, n) = 0 + ``` + +2. **Hamidoune–Zémor bound for general N [HaZe96]**: The bound $(1+o(1))\sqrt{2N}$ holds for all abelian groups of order N. This would be an asymptotic variant. + +3. **General finite abelian groups**: Szemerédi's result applies to arbitrary finite abelian groups, not just cyclic ones. The formalization restricts to `ZMod N` (cyclic groups). A more general statement would quantify over arbitrary `AddCommGroup G` with `Fintype G`. + +**Assessment**: The main conjecture is captured, but the sharp-constant variant (which is explicitly discussed in the docstring) would be a valuable addition. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring correctly summarizes the problem, its resolution, and the sharper conjecture. +- The label "Erdős–Heilbronn conjecture" in the docstring is potentially confusing. In modern usage, the "Erdős–Heilbronn conjecture" most commonly refers to a *different* result: that `|A +̂ A| ≥ min(p, 2|A| - 3)` for restricted sumsets in `Z/pZ` (proved by Dias da Silva and Hamidoune in 1994). The zero-sum subset problem is better described as the "Erdős zero-sum problem" or simply "Erdős Problem 540." +- The `open Finset BigOperators` is standard and appropriate. + +**Recommendation**: Consider removing or clarifying the "Erdős–Heilbronn conjecture" label to avoid confusion with the more famous conjecture of that name. + +## 5. Formalizability + +The problem is fully formalizable as stated. The key modeling decisions are sound: + +- **"size ≫ N^{1/2}"** is captured by `∃ C > 0, ... card ≥ C * √N`, which is the standard way to formalize big-Omega asymptotic bounds as universal constants. +- **"non-empty S ⊆ A"** is captured by `S.Nonempty ∧ S ⊆ A`, which is precise. +- **"∑ n ∈ S n ≡ 0 (mod N)"** is captured by working in `ZMod N` directly, where `= 0` is the correct notion. + +**Ambiguity assessment**: **Low**. The problem statement on the website is precise. The only mild ambiguity is whether "A ⊆ Z/NZ" means a set (distinct elements) or a multiset; the use of "⊆" strongly implies a set, and `Finset` correctly enforces this. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the main statement. + +Detailed verification: + +- **Type-level correctness**: `ZMod N` with `0 < N` is the correct type for Z/NZ. When `N = 0`, `ZMod 0 = ℤ`, but the hypothesis `0 < N` excludes this case. +- **Quantifier structure**: `∃ C > 0, ∀ N > 0, ∀ A, |A| ≥ C√N → ∃ S ...` correctly captures "there is a universal constant such that for all N and all sufficiently large subsets, a zero-sum subset exists." +- **The `answer(True)` tag**: Correct. The result was proved by Olson (primes) and Szemerédi (general). +- **Category tags**: `research solved` is correct. `AMS 5 11` (combinatorics / number theory) is appropriate. +- **Nonemptiness**: The `S.Nonempty` condition is essential — without it, the empty set would trivially satisfy `∑ n ∈ ∅, n = 0`. +- **Subset condition**: `S ⊆ A` ensures S is drawn from the given set, which is correct. + +**One subtlety worth noting**: The formalization asks for a *single* constant C that works for *all* N simultaneously. This is indeed what Szemerédi proved (the Davenport constant of Z/NZ is O(√N)), so the formalization correctly reflects the known result. A weaker formulation with `∀ N, ∃ C_N` would be trivially true (take C_N = N) and would not capture the problem's intent. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Current approach is appropriate; `subsetSums` not a better fit | +| Citations | Missing [ErHe64] (original source) and [HaZe96]; should be added | +| Variants | Sharp-constant variant (Balandraud) and general abelian group variant are missing | +| Readability | Good; "Erdős–Heilbronn conjecture" label is potentially misleading | +| Formalizability | Fully formalizable; low ambiguity | +| Correctness | Correct and complete for the main statement | diff --git a/ai-review/542.md b/ai-review/542.md new file mode 100644 index 0000000000..c2437a97dd --- /dev/null +++ b/ai-review/542.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 542 + +**File:** `FormalConjectures/ErdosProblems/542.lean` + +## 1. Code Reuse + +The formalization is self-contained and short, which is appropriate. However, some observations: + +- **Problem 441** (`ErdosProblems/441.lean`) defines a reusable `LcmBounded` predicate for the dual condition (lcm ≤ N). A symmetric `LcmExceeds` or `PairwiseLcmLarge` predicate could be extracted and shared between 542 and 441, but the current inline approach is fine for a single theorem. +- **Problem 856** (`ErdosProblems/856.lean`) defines `NoPairwiseLcmClique` and `fk`, which use the same `∑ n ∈ A, (1 : ℝ) / (n : ℝ)` sum pattern. No direct reuse opportunity, but the pattern is consistent. +- **Problem 783** (`ErdosProblems/783.lean`) has a nearly identical structure (pairwise condition on a finset, bounded reciprocal sum). The coding style is consistent across these files. +- **`FormalConjecturesForMathlib/NumberTheory/Primitive.lean`** defines `Set.IsPrimitive`, which relates to the concept of primitive sets (sets where no element divides another). Sets with pairwise lcm > n are a strengthening of primitive sets, but the existing `IsPrimitive` API operates on `Set ℕ` rather than `Finset ℕ` and isn't directly usable here. + +**Verdict:** No significant reuse opportunities missed. The formalization appropriately inlines its conditions. + +## 2. Citations + +The docstring states: + +> Erdős Problem 542 (proved by Schinzel and Szekeres) + +The website ([erdosproblems.com/542](https://www.erdosproblems.com/542)) attributes the resolution to **Schinzel and Szekeres (1959)** but does not provide a full bibliographic reference (no paper title or journal). The formalization's citation is consistent with the website but is missing the year **(1959)**. + +Additionally, the website mentions: +- **Chen (1996):** proved a stronger bound for n > 172509, namely the sum is less than 1/3 + 1/4 + 1/5 + 1/7 + 1/11. This is not mentioned in the formalization. +- **Related Problem 784** is cross-referenced on the website but not mentioned in the formalization. + +**Recommendation:** Add "(1959)" after "Schinzel and Szekeres" in the docstring to match the website. Consider mentioning Chen's improvement and the relationship to Problem 784 in the module docstring. + +## 3. Variants + +The website describes **two distinct questions** under Problem 542: + +1. Is it true that ∑ 1/a ≤ 31/30? *(answered affirmatively by Schinzel–Szekeres)* +2. Must there exist ≫ n many integers m ≤ n that don't divide any element of A? *(answered negatively by Schinzel–Szekeres)* + +**Only question (1) is formalized.** Question (2) is entirely absent. + +Furthermore, the website records several additional results and conjectures that could be formalized as variants: + +- **Chen's improved bound (1996):** For n > 172509, the sum is less than 1/3 + 1/4 + 1/5 + 1/7 + 1/11 (≈ 0.9761..., significantly below 31/30 ≈ 1.0333...). +- **Erdős' asymptotic conjecture:** The sum is bounded by 1 + o(1) as n → ∞. +- **Erdős–Schinzel–Szekeres conjecture:** Only {2, 3, 5} and {3, 4, 5, 7, 11} yield sums exceeding 1. +- **Negative answer to question (2):** There exist examples where only n/(log n)^c values fail to divide some element, and for any ε > 0 sequences exist where the sum exceeds 1 − ε. + +**Verdict:** The formalization is incomplete — it captures only the first of two questions, and omits several known results and conjectures. + +## 4. Readability + +The code is clean and easy to follow: +- The module docstring clearly states the problem in LaTeX. +- The theorem docstring adds context about the tightness of the bound. +- The `open Finset BigOperators` is appropriate. +- The namespace `Erdos542` is consistent with other files. + +Minor suggestion: The module docstring and the theorem docstring repeat the same statement almost verbatim. The module docstring could instead provide a higher-level overview (mentioning both questions) while the theorem docstring focuses on the specific formalized claim. + +**Verdict:** Good readability. Minor redundancy in docstrings. + +## 5. Formalizability + +**Question (1)** — the formalized statement — is fully precise and unambiguously formalizable. The sets, lcm condition, and reciprocal sum bound are all concrete. + +**Question (2)** ("Must there exist ≫ n many integers m ≤ n that don't divide any element of A?") is less precisely stated due to the asymptotic notation "≫ n", which could mean: +- At least cn for some constant c > 0 (linear in n) +- Or some weaker growth condition + +The negative resolution (only n/(log n)^c such integers) clarifies the intended meaning: the question asked whether a linear lower bound holds, and the answer is no. This could be formalized but requires choosing an interpretation. + +**Verdict:** Question (1) is unambiguously formalizable. Question (2) has mild ambiguity in "≫ n" but is formalizable with reasonable interpretation. + +## 6. Correctness + +The formalization of question (1) is **mathematically correct**: + +- `∀ a ∈ A, 1 ≤ a ∧ a ≤ n` correctly encodes A ⊆ {1, ..., n}, excluding 0 (important since Nat.lcm 0 b = 0, which would trivially satisfy lcm > n = false for any n). +- `∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.lcm a b > n` correctly captures the pairwise lcm condition for distinct elements. +- `(∑ a ∈ A, (1 : ℝ) / (a : ℝ)) ≤ 31 / 30` correctly bounds the reciprocal sum. Since all elements satisfy 1 ≤ a, division by zero is not an issue (though in Lean, (1 : ℝ) / (0 : ℝ) = 0 by convention, so it would be harmless anyway). +- The bound 31/30 = 1/2 + 1/3 + 1/5 is correct and matches the extremal example {2, 3, 5} (where lcm(2,3) = 6, lcm(2,5) = 10, lcm(3,5) = 15, so for n = 5 we need lcm > 5, which holds). +- The `@[category research solved, AMS 5 11]` tag correctly marks the problem as solved (number theory). + +**One subtle point worth noting:** The statement quantifies over all n, including n = 0, 1, 2, etc. For small n, the condition is vacuously true or trivially true. For n = 0: A must be empty (no a with 1 ≤ a ≤ 0). For n = 1: A ⊆ {1}, and any two distinct elements would need lcm > 1, but |A| ≤ 1, so the lcm condition is vacuous. These edge cases are all fine. + +**Verdict:** The formalized statement is correct and complete for question (1). The incompleteness (missing question 2 and variants) is not an error in what is present, but a gap in coverage. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No issues — appropriate for a simple, self-contained statement | +| Citations | Missing year (1959); Chen (1996) and Problem 784 not mentioned | +| Variants | **Incomplete** — only question (1) of two is formalized; several known results/conjectures omitted | +| Readability | Good; minor docstring redundancy | +| Formalizability | Unambiguous for question (1); question (2) has mild asymptotic ambiguity | +| Correctness | Mathematically correct for the formalized portion | diff --git a/ai-review/543.md b/ai-review/543.md new file mode 100644 index 0000000000..5b485aa4a9 --- /dev/null +++ b/ai-review/543.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 543 + +## 1. Code Reuse + +The file defines three custom constructs: +- `SubsetSumComplete` — checks if every group element is a subset sum of `A` +- `sscCountMod` / `totalSubsetsMod` — count SSC subsets and total subsets of `ZMod n` + +**Potential reuse from Problem 1179** (`FormalConjectures/ErdosProblems/1179.lean`): +Problem 1179 defines `subsetSumCount A g`, which counts subsets of `A` summing to `g`. The definition `SubsetSumComplete A` is equivalent to `∀ g, subsetSumCount A g > 0` (modulo the `id` in 1179's `S.sum id` vs the direct `∑ x ∈ S, x` here). These are closely related problems (1179 is listed as a related problem on the website). However, `subsetSumCount` lives in a different namespace with different typeclass assumptions (`DecidableEq G` vs classical decidability), so direct reuse would require minor refactoring. The current standalone approach is clean enough, but a shared `SubsetSumComplete` definition could serve both files. + +No other files in `FormalConjecturesForMathlib` provide directly reusable components. Problem 18 (practical numbers) also deals with subset sums of divisors, but in a different algebraic setting. + +## 2. Citations + +**Issues found:** + +- **[ErHa78b] author attribution is incorrect.** The formalization says: + > `[ErHa78b] Erdős, P. and Hajnal, A., 1978.` + + The website attributes this to **Erdős and Hall (1978)**, not Erdős and Hajnal. The "Ha" in [ErHa78b] stands for Hall, not Hajnal. This should be corrected to: + > `[ErHa78b] Erdős, P. and Hall, R.R., 1978.` + +- **Missing reference [ErRe65].** The website credits the original bound `f(N) ≤ log₂N + O(log log N)` to **Erdős and Rényi (1965)**. The formalization docstring attributes this result to "Erdős and Rényi" without citing [ErRe65]. The full citation should be added. + +- **Incomplete citation format.** The listed references lack titles and journal information. Per the website data, the citations should be more complete: + - [Er73]: Erdős, P., *Problems and results on combinatorial number theory*. A survey of combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., 1971) (1973), 117–138. — **This one is already present and adequate.** + - [ErHa78b]: Needs full title and journal. The current entry is a stub. + - [ErRe65]: Missing entirely. + +- **ChatGPT and Tang** — the disproval attribution is mentioned but no formal citation is provided. This is acceptable since it may be a recent result without a standard reference key. + +## 3. Variants + +**Missing variants / related content:** + +- **Related Problem 1179** is listed on the website as a companion problem. It asks for a finer estimate of a related function `g_ε(N)` measuring approximate uniformity of subset-sum counts. The formalization of 543 does not cross-reference 1179; a docstring note linking to it would be valuable. + +- **Erdős–Hall intermediate result.** The website notes that Erdős and Hall (1978) proved `f(N) > log₂N + o(log log log N)` (a weaker lower bound on the error term). This intermediate result is not mentioned in the formalization's docstring and could be stated as a supplementary lemma or noted for context. + +- **Generalization to all abelian groups.** The original problem quantifies over *all* abelian groups of order N, while the formalization restricts to cyclic groups `ZMod N`. The docstring acknowledges this ("even for cyclic groups"), which is mathematically sufficient for the disproval direction (see §6). However, no variant capturing the full universal quantifier over all abelian groups is provided. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The `if h : n = 0 then 0 else by ...` pattern in `sscCountMod` and `totalSubsetsMod` is functional but slightly unusual. A `match`-style or `dite`-based approach might be more idiomatic, though this is a matter of taste. +- The helper functions have clear docstrings. +- The namespace `Erdos543` is appropriately scoped. +- The `let k := ...` binding inside `∀ᶠ` improves readability of the main theorem statement. + +**No significant readability issues.** + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem is probabilistic in nature, but the formalization correctly reduces it to a combinatorial counting problem (ratio of favorable outcomes to total outcomes), avoiding the need for measure-theoretic probability. This is the standard approach for uniform distributions on finite sets and is well-suited to Lean. + +The key formalization choices are: +- Representing "probability ≥ 1/2" as `2 * sscCountMod N k ≥ totalSubsetsMod N k` (avoids division and rationals). +- Using `Nat.ceil` for `⌈log₂N + g(N)⌉` since k must be a natural number. +- Encoding `o(log log N)` via `Tendsto (fun N => g N / Real.log (Real.log N)) atTop (nhds 0)`. + +The only mild source of ambiguity is the choice of logarithm base in the `o(·)` condition. The formalization uses natural logarithm (`Real.log`), while the problem statement uses `log₂`. Since `o(log₂ log₂ N) = o(ln ln N)` (they differ by a constant factor, and little-o absorbs constants), this is mathematically equivalent. **No ambiguity issues.** + +## 6. Correctness + +**The formalization is mathematically correct for the restricted (cyclic group) case.** + +Detailed analysis: + +1. **Direction of the disproval.** The statement `answer(False) ↔ (∃ g, ...)` unfolds to `¬(∃ g, Tendsto ... ∧ ∀ᶠ N, 2 * sscCountMod N k ≥ totalSubsetsMod N k)`. This correctly encodes: "There is no function `g = o(log log N)` such that for all sufficiently large N, a random `⌈log₂N + g(N)⌉`-subset of `ZMod N` is SSC with probability ≥ 1/2." This is the correct negation of the conjectured improvement. + +2. **Restriction to `ZMod N` is sufficient for disproval.** The original problem defines `f(N)` as the minimum `k` that works for *every* abelian group of order `N`, so `f(N) ≥ f_{Z/NZ}(N)`. If even the cyclic group `Z/NZ` requires `k > log₂N + o(log log N)`, then a fortiori so does the worst-case group. The formalization correctly leverages this by proving the disproval for `Z/NZ` alone. + +3. **`SubsetSumComplete` definition.** Uses `∃ S : Finset G, S ⊆ A ∧ ∑ x ∈ S, x = g`, which correctly captures "every element is a subset sum." The empty subset sums to 0, so the additive identity is always represented. This matches the standard definition. + +4. **Edge case `N = 0`.** Both `sscCountMod 0 k` and `totalSubsetsMod 0 k` return 0, making the condition `0 ≥ 0` vacuously true. However, this is harmless since the `∀ᶠ` filter only cares about sufficiently large `N`. + +5. **Edge case `N = 1`.** `ZMod 1` is the trivial group. Every subset is SSC (only element is 0 = empty sum). `sscCountMod 1 k = totalSubsetsMod 1 k` for all `k`, so the condition holds. Again, this is fine under `∀ᶠ`. + +6. **Potential concern: the `∀ᶠ` quantifier runs over all natural numbers, not just primes.** The ChatGPT–Tang result is stated for sufficiently large primes. For composite `N`, `ZMod N` is still a valid abelian group, so the formalization is correct (and potentially stronger than needed). No issue here. + +**No mathematical errors detected.** The formalization is a correct and complete encoding of the disproval, modulo the deliberate restriction to cyclic groups (which is sufficient and documented). + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunity: shared `SubsetSumComplete` with Problem 1179 | +| Citations | **[ErHa78b] misattributed to Hajnal instead of Hall; [ErRe65] missing** | +| Variants | Related Problem 1179 not cross-referenced; Erdős–Hall intermediate bound not mentioned | +| Readability | Good | +| Formalizability | Clearly formalizable, no ambiguity | +| Correctness | Correct and complete (for cyclic group restriction, which suffices) | diff --git a/ai-review/544.md b/ai-review/544.md new file mode 100644 index 0000000000..ce46580d48 --- /dev/null +++ b/ai-review/544.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 544 + +## 1. Code Reuse + +**Issue: `ramseyR3` is defined identically in three files.** + +The definition at `544.lean:41–42`: +```lean +noncomputable def ramseyR3 (k : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree k} +``` +is duplicated verbatim in: +- `165.lean:60–61` (`Erdos165.ramseyR3`) +- `553.lean:42–43` (`Erdos553.ramseyR3`) + +All three files independently define R(3,k) with identical logic. These should be unified into a shared definition — either in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` (which already exists but defines hypergraph Ramsey numbers) or a new shared Ramsey utility module — and imported by all three problems. + +Furthermore, `1014.lean:37–38` defines a general `ramseyR(k, l)`, and `ramseyR3 k` is exactly `ramseyR 3 k` under that definition. Problem 544 could import and specialize the general definition rather than duplicating the specialized one. + +## 2. Citations + +**Website data** (erdosproblems.com/544): +- Status: **Open** +- Fields: Graph Theory, Ramsey Theory +- Sources: Er81c, Er93 p.339 +- Originally posed by Erdős and Sós +- Related problems: 165, 1014 +- Related OEIS sequence: A000791 +- Listed as #8 in the UCSD Ramsey Theory problem collection + +**Formalization citations** include `[Er81c]` and `[Er93, p. 339]`, and the docstring references problems [165] and [1014]. + +**Assessment:** +- The two source references ([Er81c] and [Er93, p. 339]) match the website exactly. +- The attribution to Erdős and Sós is present in the module docstring. Good. +- Related problems [165] and [1014] are cross-referenced. Good. +- The OEIS sequence A000791 is not mentioned. This is a minor omission (not required, but could be informative). +- The full citation for [Er81c] is given as: Erdős, P., *Some problems in combinatorics, graph theory and probability* (1981). This is reasonable shorthand. The website lists it only as "Er81c" without an expanded form, so the formalization actually provides *more* detail than the website. + +**No incorrect citations found.** + +## 3. Variants + +The formalization captures both parts of the problem as stated on the website: + +1. **Part 1** (`erdos_544`): R(3,k+1) − R(3,k) → ∞ as k → ∞. +2. **Part 2** (`erdos_544.variants.little_o`): Whether R(3,k+1) − R(3,k) = o(k). + +Both parts are present on the website. The use of `answer(sorry)` for Part 2 is appropriate since the problem asks to "prove or disprove" — the truth value is unknown. + +**No missing variants.** The formalization is complete with respect to all problem variants on the website. + +## 4. Readability + +The code is clear and well-structured: +- The module docstring concisely states both parts of the problem, attributes it to Erdős and Sós, and provides citations. +- Part 1 and Part 2 are separated into distinct theorems with descriptive docstrings. +- The naming convention `erdos_544.variants.little_o` is descriptive. +- The `ramseyR3` definition has a clear docstring explaining the Ramsey number. + +**Minor suggestion:** The Part 2 docstring says "Prove or disprove that R(3,k+1) − R(3,k) = o(k), i.e., (R(3,k+1) − R(3,k)) / k → 0." The formalization uses `nhds 0` for the target filter, which is correct for convergence to 0. This is readable as-is. + +No readability issues. + +## 5. Formalizability + +**Ambiguity assessment: Low.** + +Both parts of the problem are stated precisely enough to be unambiguously formalizable: + +- **Part 1** is a clear, unambiguous mathematical statement: the differences R(3,k+1) − R(3,k) tend to infinity. There is only one standard interpretation. + +- **Part 2** asks to "prove or disprove" that R(3,k+1) − R(3,k) = o(k). This has a clear meaning: the ratio (R(3,k+1) − R(3,k)) / k → 0. The "prove or disprove" framing is handled via `answer(sorry)`, which is the standard approach in this codebase for open problems with unknown truth value. + +Both statements are precise, standard, and admit no meaningful ambiguity. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`ramseyR3` definition:** Correctly captures R(3,k) as the minimum N such that every simple graph on N vertices contains a triangle (¬CliqueFree 3) or an independent set of size k (¬Gᶜ.CliqueFree k). The use of `sInf` is appropriate — Ramsey's theorem guarantees the defining set is nonempty (for finite k), so the infimum is well-defined and equals the minimum. + +- **Part 1 (`erdos_544`):** Uses `Tendsto (fun k => (ramseyR3 (k+1) : ℤ) - (ramseyR3 k : ℤ)) atTop atTop`. This correctly states that the consecutive differences diverge to +∞ in ℤ. The cast to ℤ is necessary because ℕ subtraction is truncated (a - b = 0 when a ≤ b in ℕ), and while we expect R(3,k) to be increasing, the formalization correctly avoids assuming this. The use of `atTop atTop` (i.e., Tendsto to +∞, not just |·| → ∞) is appropriate because R(3,k) is expected to grow, so the differences should be eventually positive and large. This is the standard mathematical meaning of "→ ∞." + +- **Part 2 (`erdos_544.variants.little_o`):** Uses `Tendsto (fun k => ((ramseyR3 (k+1) : ℝ) - (ramseyR3 k : ℝ)) / (k : ℝ)) atTop (nhds 0)`. This correctly formalizes (R(3,k+1) − R(3,k)) / k → 0 as k → ∞, which is the standard definition of R(3,k+1) − R(3,k) = o(k). The cast to ℝ is appropriate for division. + +- **Edge cases:** + - For k = 0: ramseyR3(1) − ramseyR3(0), divided by 0 in Part 2, gives 0/0 which Lean evaluates to 0. This doesn't affect the limit statement since `atTop` only cares about sufficiently large k. + - The `sInf` of an empty set in ℕ is 0 by convention. For k = 0, the defining set `{N | ∀ G, ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree 0}` requires every graph to have a 0-clique in the complement, which is vacuously true (the empty set is a 0-clique). So `sInf` is 0, which is fine. For k ≥ 1, the Ramsey property is non-vacuous and sInf yields the true Ramsey number. + +- **Relationship between parts:** If Part 1 is true (differences → ∞) and Part 2 is also true (differences = o(k)), this would mean the differences grow, but slower than linearly. This is consistent — for example, if R(3,k) ~ c·k²/log k (the conjecture in Problem 165), then R(3,k+1) − R(3,k) ~ 2ck/log k, which does tend to ∞ but is o(k). So both parts being simultaneously true is plausible and the formalization does not introduce any inconsistency. + +**No mathematical flaws identified.** The formalization faithfully and correctly captures both parts of Erdős Problem 544. diff --git a/ai-review/545.md b/ai-review/545.md new file mode 100644 index 0000000000..61c9bc475d --- /dev/null +++ b/ai-review/545.md @@ -0,0 +1,84 @@ +# AI Review: Erdős Problem 545 + +## 1. Code Reuse + +Several definitions in `545.lean` are duplicated across other Erdős problem files: + +- **`ContainsSubgraphCopy`** — Identical definitions appear in `546.lean` (same name), `87.lean` (`ContainsSubgraph`), and `79.lean` (`IsSubgraphOf`). All define the same concept: an injective graph homomorphism preserving adjacency. +- **`ramseyNumber`** — Duplicated verbatim in `546.lean`. Problem `87.lean` defines the equivalent `graphRamseyNumber` on a type-polymorphic graph (rather than `Fin k`). Problem `79.lean` defines `RamseyProp` (an asymmetric two-graph version). + +**Recommendation:** Extract `ContainsSubgraphCopy` and `ramseyNumber` into a shared utility in `FormalConjecturesForMathlib`. The existing `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` only covers *hypergraph* Ramsey numbers (`hypergraphRamsey`), so a companion file for graph Ramsey numbers would be appropriate. Problem 87's `graphRamseyNumber` is arguably the cleanest version since it is type-polymorphic rather than restricted to `Fin k`. + +## 2. Citations + +The docstring references `[ErGr75]` and `[Er84b]` but the website provides page numbers that are missing: + +| Citation | Formalization | Website | +|----------|--------------|---------| +| ErGr75 | `Erdős, P. and Graham, R.` | `[ErGr75, p.526]` | +| Er84b | `Erdős, P.` | `[Er84b, p.11]` | + +The website also mentions **[Su11]** (Sudakov, B., *A conjecture of Erdős on graph Ramsey numbers*, Advances in Mathematics 227 (2011), 601–609) in connection with the weaker Problem 546. While [Su11] is not directly about Problem 545, it is relevant context that the weaker bound R(G) ≤ 2^{O(√m)} was proved by Sudakov. + +**Recommendation:** +- Add page numbers: `[ErGr75, p.526]` and `[Er84b, p.11]`. +- Add full bibliographic details for Er84b as done in `546.lean`: *On some problems in graph theory, combinatorial analysis and combinatorial number theory*, Graph theory and combinatorics (Cambridge, 1983), Academic Press, London (1984), 1–17. +- Consider mentioning the relationship to Problem 546 and [Su11] in the module docstring. + +## 3. Variants + +The website notes **known counterexamples** for small values of m: + +> The problem fails for 2 ≤ m ≤ 5 and 7 ≤ m ≤ 9 (noted by contributor LouisD). + +This is a significant piece of information not captured in the formalization. It suggests the conjecture as literally stated is **false** for small m, and the intended conjecture may be for sufficiently large m (or may simply have a negative answer). + +**Recommendation:** Add a comment in the docstring noting the known counterexamples. Consider whether a variant with a "for all sufficiently large m" or "for all m ≥ m₀" qualification should be formalized alongside the literal statement. + +## 4. Readability + +The code is generally well-structured and readable: + +- `asCompleteAsPossible` is clearly documented and the adjacency predicate is understandable. +- The symmetry and irreflexivity proofs are concise. +- The theorem statement reads naturally. + +**Minor suggestions:** +- The module docstring could mention the relationship to Problem 546 (the weaker bound that was proved by Sudakov). +- The `asCompleteAsPossible` docstring could note that vertex `n` may be isolated when `t = 0`. + +## 5. Formalizability + +The problem is **precise and clearly formalizable**. The statement specifies: +- A graph G with m = C(n,2) + t edges (0 ≤ t < n) and no isolated vertices. +- A specific comparison graph H (the "as complete as possible" construction). +- A clean inequality R(G) ≤ R(H). + +**Ambiguity assessment: Low.** The only source of ambiguity is whether the conjecture is intended to hold for all m or only sufficiently large m, given the known small counterexamples. The formalization takes the literal interpretation (all valid n, t), which is a reasonable default. + +## 6. Correctness + +The formalization is **mathematically sound** with some observations: + +### Correct aspects: +- **Edge count:** `asCompleteAsPossible n t` correctly has C(n,2) + t edges: C(n,2) from K_n on vertices {0,...,n-1}, plus t edges from vertex n to vertices {0,...,t-1}. +- **No isolated vertices condition:** `∀ v : Fin k, ∃ w : Fin k, G.Adj v w` correctly captures this. +- **Ramsey number definition:** Using `sInf` on the set of N where every 2-coloring of K_N contains a monochromatic copy of G is standard. For finite graphs, this set is nonempty by Ramsey's theorem, so `sInf` returns the correct value. +- **Subgraph (not induced subgraph) embedding:** The definition correctly requires only that adjacency is preserved (not non-adjacency), matching the standard notion of graph Ramsey numbers. +- **Vertex count flexibility:** G lives on `Fin k` for arbitrary k, while H lives on `Fin (n+1)`. This is correct — the conjecture applies to any graph G with the right edge count and no isolated vertices, regardless of its vertex count. + +### Observations: +- **`asCompleteAsPossible n 0` has an isolated vertex** (vertex n), which is technically inconsistent with the "no isolated vertices" requirement on G. However, this is mathematically harmless: R(K_n ∪ {isolated vertex}) = R(K_n) for n ≥ 2, since finding K_n as a subgraph in N vertices automatically allows embedding the isolated vertex into any remaining vertex when N > n. +- **Known counterexamples not reflected:** The formalization uses `answer(sorry)`, allowing the answer to be True or False, which correctly handles the possibility that the conjecture is false. However, the known counterexamples for small m (2 ≤ m ≤ 5, 7 ≤ m ≤ 9) strongly suggest `answer(False)` would be correct for the literal statement. The formalization does not document this. +- **`sInf ∅ = 0` edge case:** If the Ramsey number set is empty (which shouldn't happen for finite graphs by Ramsey's theorem, but isn't proven here), `sInf` would return 0. This is a standard caveat for `noncomputable` Ramsey number definitions in this codebase and is acceptable. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication with 546, 87, 79; should extract shared definitions | +| Citations | Missing page numbers and full bibliographic details | +| Variants | Known counterexamples for small m not documented | +| Readability | Good overall; minor improvements possible | +| Formalizability | High — low ambiguity, clean mathematical statement | +| Correctness | Mathematically sound; main concern is that literal statement is likely false due to small counterexamples | diff --git a/ai-review/546.md b/ai-review/546.md new file mode 100644 index 0000000000..5979a826b2 --- /dev/null +++ b/ai-review/546.md @@ -0,0 +1,79 @@ +# Erdős Problem 546 — Review + +## 1. Code Reuse + +**Major issue.** The definitions `ContainsSubgraphCopy` and `ramseyNumber` are duplicated verbatim across at least five files: 545, 546, 547, 548, and 549. These should be factored into a shared utility. + +More importantly, **Mathlib already provides `SimpleGraph.IsContained`** (in `Mathlib.Combinatorics.SimpleGraph.Copy`), which is definitionally equivalent to `ContainsSubgraphCopy`: + +- `SimpleGraph.IsContained A B` is `Nonempty (Copy A B)`, where `Copy A B` is a structure wrapping an injective homomorphism — exactly the same as `∃ f, Injective f ∧ ∀ u v, A.Adj u v → B.Adj (f u) (f v)`. + +The `ramseyNumber` definition could be rewritten using `G ⊑ H ∨ G ⊑ Hᶜ` (where `⊑` is `IsContained`), eliminating the need for the custom `ContainsSubgraphCopy`. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` already uses `IsContained` for a related Ramsey concept (`sizeRamsey`). The no-isolated-vertices condition there uses `∀ v, 0 < H.degree v`, which is cleaner than the existential formulation `∀ v, ∃ w, G.Adj v w` used here (though they are equivalent for `DecidableRel`). + +## 2. Citations + +The formalization's docstring includes: +- `[Er84b]` — matches the website's source ("Er84b, p.10"). The full citation in the docstring is good. +- `[Su11]` — matches the website's reference to Sudakov (2011). Full citation is good. + +**Missing citation:** The website also mentions **Alon, Krivelevich, and Sudakov (2003)** who proved the special case when G is bipartite. This earlier partial result is not mentioned in the docstring. + +The docstring references are otherwise well-formatted and consistent with the website. + +## 3. Variants + +The docstring correctly notes: +- "A more precise question is Problem 545" — consistent with the website. +- "The analogous question for ≥ 3 colours is still open" — consistent with the website. + +**Missing formalization:** The multicolor variant (≥ 3 colors) is mentioned in the docstring but is not formalized as a separate conjecture. Given that this is explicitly described as still open on the website, it could merit its own `sorry`-ed statement (possibly as a separate problem or as a variant within this file). + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- The docstring is clear and well-structured, with both the informal statement and the formal interpretation spelled out. +- The `answer(True)` pattern correctly signals the problem is solved. +- Using `G.edgeSet.ncard` for edge count is appropriate for the potentially non-`Decidable` setting. +- The no-isolated-vertices condition `∀ v : Fin k, ∃ w : Fin k, G.Adj v w` is clear but could alternatively use `∀ v, 0 < G.degree v` (as in `SizeRamsey.lean`) if `DecidableRel G.Adj` were available, which would more directly express "minimum degree ≥ 1." + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The original problem statement "Is it true that R(G) ≤ 2^{O(m^{1/2})}?" uses big-O notation, which has a standard interpretation: there exists a universal constant C > 0 such that R(G) ≤ 2^{C√m} for all G (with no isolated vertices and m edges). The formalization correctly unpacks this. + +The only minor source of ambiguity is what "R(G)" means — the diagonal graph Ramsey number (every 2-coloring of K_N contains a monochromatic copy of G). The formalization's definition matches this standard interpretation exactly. + +## 6. Correctness + +**Assessment: Mathematically correct.** + +Detailed analysis: + +1. **`ContainsSubgraphCopy` (line 44–45):** Correctly captures "H contains a copy of G as a subgraph" via an injective function preserving adjacency. This is the standard notion (non-induced subgraph containment). Matches Mathlib's `SimpleGraph.IsContained`. + +2. **`ramseyNumber` (line 50–52):** Defines R(G) as `sInf {N | ∀ H : SimpleGraph (Fin N), ContainsSubgraphCopy G H ∨ ContainsSubgraphCopy G Hᶜ}`. This correctly captures the diagonal Ramsey number: the minimum N such that every graph on N vertices contains G or its complement contains G. By the classical Ramsey theorem (since any graph G on k vertices satisfies R(G) ≤ R(k,k)), the set is non-empty for any finite G, so `sInf` is well-defined and returns the correct minimum. + +3. **No-isolated-vertices condition (line 70):** `∀ v : Fin k, ∃ w : Fin k, G.Adj v w` correctly expresses that every vertex has at least one neighbor. For k = 0, this is vacuously true (the empty graph on 0 vertices trivially satisfies the bound since R(G) = 0 ≤ 1 = 2^{C·0}). For k = 1, the condition correctly fails (since `SimpleGraph` is irreflexive). For k ≥ 2, this is minimum degree ≥ 1. + +4. **Main statement (lines 67–72):** The theorem states `answer(True) ↔ ∃ C : ℝ, C > 0 ∧ ∀ k G, (no isolated vertices) → (ramseyNumber G : ℝ) ≤ 2 ^ (C * √(ncard(edgeSet G)))`. This correctly formalizes R(G) ≤ 2^{C√m}. The cast to `ℝ` is necessary for the exponentiation, and `Real.sqrt` on the cast of `ncard` is appropriate. + +5. **`answer(True)` tag (line 67):** Correct — the problem was proved affirmatively by Sudakov [2011]. + +6. **Category tag `research solved` (line 66):** Consistent with the website's "PROVED" status. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `ContainsSubgraphCopy` duplicated across 5 files; Mathlib's `IsContained` should be used instead | +| Citations | Minor gap | Missing Alon–Krivelevich–Sudakov (2003) partial result | +| Variants | Minor gap | Multicolor (≥ 3 colors) open variant mentioned but not formalized | +| Readability | Good | Clear docstring and code | +| Formalizability | Excellent | Unambiguous, standard definitions | +| Correctness | Excellent | Mathematically faithful, no flaws | diff --git a/ai-review/547.md b/ai-review/547.md new file mode 100644 index 0000000000..46644a8bac --- /dev/null +++ b/ai-review/547.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 547 + +## 1. Code Reuse + +**Significant duplication identified.** Both `ContainsSubgraphCopy` and `ramseyNumber` are defined identically (modulo namespace) in at least six files: `545.lean`, `546.lean`, `547.lean`, `548.lean`, `549.lean`, and `550.lean`. Additional near-duplicates (`Embeds`, `ramseyNum`) appear in `568.lean`, `569.lean`, and `570.lean`. + +Furthermore, Mathlib already provides `SimpleGraph.IsContained` (from `Mathlib.Combinatorics.SimpleGraph.Copy`), which is used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` (line 46). This definition captures the same concept as `ContainsSubgraphCopy` — the existence of an injective adjacency-preserving map. The local `ContainsSubgraphCopy` could potentially be replaced by `G.IsContained H` from Mathlib, or at minimum a shared definition should be extracted into a utility file to eliminate the duplication across the Erdős problem files. + +Similarly, the `ramseyNumber` definition for graphs (diagonal Ramsey number) is duplicated across multiple files and would benefit from a shared definition in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`, which currently only defines `hypergraphRamsey` for uniform hypergraphs. + +## 2. Citations + +The docstring citations are incomplete compared to the website. Specifically: + +**Current citations (abbreviated):** +- `[BuEr76] Burr, S. A. and Erdős, P. (1976).` — Missing title and publication details. +- `[Zh11] Zhao, Y. (2011).` — Missing title and publication details. + +**Website references not mentioned:** +- Gerencsér and Gyárfás — proved R(Pₙ) = ⌊3n/2⌋ − 1 for paths. +- Harary — proved R(K₁,ₙ₋₁) = 2n−2 (even n), 2n−3 (odd n) for stars. +- Grossman, Harary, and Klawe — disproved Burr's sharpness conjecture for bipartition sizes. +- Montgomery, Pavez-Signé, and Yan — proved Burr's conjecture for trees of bounded maximum degree. +- Norin, Sun, and Zhao — proved R(S₂ₜ,ₜ) ≥ (4.2 − o(1))t for double stars. +- Burr — lower bound R(T) ≥ max(t₁ + 2t₂, 2t₁) − 1 for trees with bipartition sizes t₁ ≥ t₂. + +The docstring should include full bibliographic details for the two cited references. The additional results are informative context but not strictly required. + +## 3. Variants + +The formalization captures only the main conjecture: R(T) ≤ 2n − 2 for all trees T on n vertices. + +**Variants from the website not captured:** +- **Paths:** R(Pₙ) = ⌊3n/2⌋ − 1 (Gerencsér–Gyárfás, proved). +- **Stars:** R(K₁,ₙ₋₁) = 2n − 2 for even n, 2n − 3 for odd n (Harary, proved). +- **Double stars:** R(S_{t₁,t₂}) = 2t₁ when t₁ ≥ 3t₂ − 2 (Grossman et al., proved). +- **Burr's lower bound:** R(T) ≥ max(t₁ + 2t₂, 2t₁) − 1 for bipartition sizes t₁ ≥ t₂. +- **Bounded degree case:** For trees with Δ(T) ≤ cn, proved by Montgomery–Pavez-Signé–Yan. + +These are related but distinct results. The most natural variant to include would be Burr's lower bound, as it shows the conjecture is essentially tight. + +## 4. Readability + +The code is clean and readable. The docstrings on both `ContainsSubgraphCopy` and `ramseyNumber` provide clear mathematical descriptions. The main theorem statement is concise and directly maps to the informal statement. The namespace `Erdos547` keeps definitions appropriately scoped. + +Minor suggestion: the docstring on the main theorem could mention the connection to the Erdős–Sós conjecture (problem 548) and Zhao's result for large n, as this is mathematically significant context already present in the module docstring. + +## 5. Formalizability + +**High formalizability.** The problem statement "If T is a tree on n vertices then R(T) ≤ 2n − 2" is completely precise: +- "Tree on n vertices" has a standard graph-theoretic definition (connected acyclic graph), captured by `SimpleGraph.IsTree` in Mathlib. +- R(T) is the standard diagonal Ramsey number for graphs, well-defined for any finite graph. +- The bound 2n − 2 is a concrete arithmetic expression. + +There is essentially no ambiguity in the statement. The only minor subtlety is whether R(T) refers to the diagonal graph Ramsey number (as formalized) or the classical integer Ramsey number R(n, n); here the graph version is clearly intended by the problem statement, and the formalization is correct. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed assessment: + +- **`ContainsSubgraphCopy`**: Correctly defines subgraph isomorphism (injective homomorphism). This is the standard notion for Ramsey theory on graphs. + +- **`ramseyNumber`**: Defined as `sInf {N : ℕ | ∀ (H : SimpleGraph (Fin N)), ContainsSubgraphCopy G H ∨ ContainsSubgraphCopy G Hᶜ}`. This is the standard diagonal graph Ramsey number. The use of `sInf` on `ℕ` returns 0 for an empty set, but by the classical Ramsey theorem for graphs, the set is always non-empty, so `sInf` yields the true minimum. This is mathematically sound. + +- **Constraint `n ≥ 2`**: Appropriate. For n = 1, the tree is a single isolated vertex, R(T) = 1, and 2·1 − 2 = 0, so the bound fails trivially. For n = 2, the tree is K₂, R(K₂) = 2, and 2·2 − 2 = 2, which is tight. The constraint correctly excludes the degenerate case. + +- **Arithmetic**: `2 * n - 2` in `ℕ` is safe since n ≥ 2 ensures no underflow. + +- **Status tag `open`**: The website marks this as "decidable" (resolved up to a finite check), since Zhao proved the result for all sufficiently large n. Marking it as `open` is defensible since the full conjecture has not been verified for all n, but a note acknowledging Zhao's partial resolution would be appropriate. + +- **`IsTree` usage**: The formalization correctly uses Mathlib's `SimpleGraph.IsTree` which requires connected + acyclic, the standard definition. + +**No mathematical flaws identified.** The formalization faithfully and correctly captures the conjecture as stated on the website. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Significant duplication of `ContainsSubgraphCopy` and `ramseyNumber` across ~6 files; Mathlib's `IsContained` may be usable | +| Citations | Present but incomplete — missing titles, publication details; several website references omitted | +| Variants | Only main conjecture captured; several proved special cases and the lower bound not formalized | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete for the main conjecture as stated | diff --git a/ai-review/548.md b/ai-review/548.md new file mode 100644 index 0000000000..cd16a618a7 --- /dev/null +++ b/ai-review/548.md @@ -0,0 +1,99 @@ +# AI Review: Erdős Problem 548 + +## Summary + +Erdős Problem 548 is the **Erdős–Sós conjecture**: every graph on $n$ vertices ($n \geq k+1$) with at least $\frac{k-1}{2}n + 1$ edges contains every tree on $k+1$ vertices as a subgraph. The formalization is largely correct, with minor issues around citation completeness and code reuse. + +--- + +## 1. Code Reuse + +**Issue: `ContainsSubgraphCopy` is duplicated across multiple files.** + +The identical definition appears in both `ErdosProblems/547.lean` (line 40) and `ErdosProblems/548.lean` (line 39): + +```lean +def ContainsSubgraphCopy {V W : Type*} (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : V → W, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) +``` + +A closely related but argument-swapped version exists in `ErdosProblems/580.lean` (line 40): + +```lean +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` + +**Recommendation:** Unify these into a single definition in `FormalConjecturesForMathlib`, e.g. in the existing `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` directory. Note the argument order inconsistency: in 548, `ContainsSubgraphCopy T G` means "G contains T", while in 580, `ContainsSubgraph G T` means the same. A unified definition should pick one convention. + +Note: Mathlib provides `SimpleGraph.Embedding` (which preserves *and reflects* adjacency). The formalization correctly uses the weaker notion (injective homomorphism — preserves but does not reflect adjacency), which is the standard definition for subgraph containment in extremal graph theory. + +--- + +## 2. Citations + +The formalization includes: +- `[Er64c]` +- `[Er74c, p.78]` +- `[Er93, p.345]` + +The [erdosproblems.com/548](https://www.erdosproblems.com/548) page lists: +- `[Er64c]` ✓ +- `[Er74c, p.78]` ✓ +- **`[Er78, p.30]`** ✗ — missing +- `[Er93, p.345]` ✓ +- **`[Va99, 3.55]`** ✗ — missing + +**Recommendation:** Add the two missing references `[Er78]` and `[Va99]` to the docstring. + +--- + +## 3. Variants + +The website mentions a **stronger version** conjectured by Erdős and Sós concerning forests: requiring at least $\max\left(\binom{2k-1}{2}+1,\; (k-1)n - (k-1)^2 + \binom{k-1}{2} + 1\right)$ edges to guarantee containment of every **forest** with $k$ edges. The current formalization only captures the tree version, not the forest generalization. + +The website also notes that the conjecture **implies** problems 547 and 557. Problem 547 (tree Ramsey numbers) is formalized separately, which is appropriate. + +**Recommendation:** Consider adding a comment in the docstring noting the existence of the forest variant. A separate formalization of the forest variant could be valuable but is not strictly necessary. + +--- + +## 4. Readability + +The code is clean and well-structured: +- The docstring clearly states the mathematical content. +- The comment explaining the multiplication-by-2 trick to avoid natural number division is helpful. +- The namespace `Erdos548` keeps definitions local. + +**Minor suggestion:** The docstring says "This is the Erdős–Sós conjecture" but the website identifies it as a conjecture of "Erdős and Sós" (without the en-dash name). This is a stylistic choice and both are acceptable in the literature. + +--- + +## 5. Formalizability + +**Assessment: Highly formalizable, minimal ambiguity.** + +The problem statement is precise: it specifies exact bounds on vertex count, edge count, and the conclusion. The only potential ambiguity is the meaning of "contains every tree" — whether this means subgraph containment (injective homomorphism) or induced subgraph (embedding). The standard interpretation in extremal graph theory is subgraph containment (not necessarily induced), and the formalization correctly uses this interpretation. + +The website labels this as **FALSIFIABLE** (open, could be disproved with a finite counterexample), with a **$100 prize**. The formalization correctly tags it as `category research open`. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis of the edge condition: + +- The problem requires $|E(G)| \geq \frac{k-1}{2} \cdot n + 1$. +- The formalization expresses this as $2 \cdot |E(G)| \geq (k-1) \cdot n + 2$, which is equivalent over the reals and avoids natural number division. ✓ + +**Natural number subtraction edge case (k = 0):** When $k = 0$, the expression `(k - 1) * n` evaluates to `0` in `ℕ` (since `0 - 1 = 0`), making the edge condition `2|E| ≥ 2`, i.e., `|E| ≥ 1`. The "real" condition for $k = 0$ would be $|E| \geq 1 - n/2$, which is trivially satisfied for any graph. However, this discrepancy is harmless: when $k = 0$, the tree $T$ has 1 vertex (`Fin 1`), and any graph on $n \geq 1$ vertices trivially contains it via any injective map (adjacency preservation is vacuous since $T$ has no edges). So the conclusion holds regardless of the edge condition, and the slightly stronger hypothesis for $k = 0$ is inconsequential. + +**Tree definition:** `T.IsTree` (from Mathlib) correctly requires the graph to be connected and acyclic. A tree on $k+1$ vertices has exactly $k$ edges, consistent with the problem's intent. + +**Vertex type:** Using `Fin n` and `Fin (k + 1)` for the vertex sets is standard and correct for graphs on a fixed finite number of vertices. + +**Subgraph notion:** The `ContainsSubgraphCopy` definition provides the correct notion — an injective adjacency-preserving map (not necessarily reflecting non-adjacency). This matches the standard graph-theoretic meaning of "contains as a subgraph." + +**Overall correctness verdict:** The formalization faithfully captures the Erdős–Sós conjecture. No mathematical flaws identified. diff --git a/ai-review/549.md b/ai-review/549.md new file mode 100644 index 0000000000..1e4cd8be1f --- /dev/null +++ b/ai-review/549.md @@ -0,0 +1,61 @@ +# AI Review: Erdős Problem 549 + +## 1. Code Reuse + +**Major issue.** Both `ContainsSubgraphCopy` and `ramseyNumber` are duplicated verbatim across problems 545, 546, 547, and 549 — each within its own namespace. These should be refactored into a shared utility file. + +Additionally, Mathlib already provides `SimpleGraph.IsContained` (from `Mathlib.Combinatorics.SimpleGraph.Copy`), which is used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`. The custom `ContainsSubgraphCopy` is essentially equivalent to `IsContained` (an injective adjacency-preserving map). Problem 549 should use the Mathlib definition instead of rolling its own. + +Similarly, `ramseyNumber` could be defined once in a shared module (alongside the related `sizeRamsey` in `SizeRamsey.lean`) and imported by all the Erdős problems that need it (545–549). + +## 2. Citations + +The docstring includes three references: [EFRS82], [Bu74], and [NSZ16]. These are accurate, but the website (erdosproblems.com/549) lists additional relevant references that are not included: + +- **[BuEr76]** Burr, S. A. and Erdős, P. (1976) — verified the formula for specific tree constructions. +- **[DuSt24]** Dubó, C. and Stein, M. (2024) — elementary proof of a weaker upper bound R(T) ≤ ⌈4.27492k⌉ + 1. +- **[MPY25]** Montgomery, R., Pavez-Signé, M., and Yan, J. (2025) — proved the conjecture holds for trees with bounded maximum degree ≤ ck. + +The existing [EFRS82] reference attributes the problem to Erdős, Faudree, Rousseau, and Schelp, which matches the website. The [Bu74] and [NSZ16] references also match. However, the citation format could be improved — the website gives fuller bibliographic details (journal names, specific results) that could enrich the docstring. + +## 3. Variants + +**Partially captured.** The formalization only encodes the original (disproved) conjecture. The website describes additional results that could be formalized as variants: + +- **Positive special cases:** The formula R(T) = 4k − 1 has been confirmed for specific tree families, such as broom graphs (a star with an attached path). These could be stated as separate theorems. +- **Bounded degree result [MPY25]:** For trees with maximum degree ≤ ck, the conjecture holds. This is a natural variant. +- **Quantitative counterexample bounds [NSZ16]:** The counterexample gives R(T) ≥ (4.2 − o(1))k for the double star, and [NSZ16] also proved R(T) ≤ (4.21526 + o(1))k. These quantitative bounds could be formalized. + +None of these are captured in the current formalization. + +## 4. Readability + +The code is generally readable. A few suggestions: + +- The bipartition condition via `Finset.univ.filter (fun v => c v = 0)` is clear but somewhat verbose. A brief comment explaining that every tree is bipartite, so this condition constrains the *sizes* of the parts, would improve clarity. +- The `open SimpleGraph Finset` at the top is appropriate and keeps the main theorem statement clean. +- The `answer(False)` pattern is idiomatic for disproved conjectures in this codebase. + +## 5. Formalizability + +**High — the problem is precise and clearly formalizable.** + +The original conjecture is unambiguous: it asserts an exact value for R(T) for a well-defined class of trees. The key concepts — tree, bipartition, Ramsey number — are all standard and have clear formal definitions. + +The only mild source of ambiguity is in the counterexample statement on the website, which uses asymptotic notation (o(1)), making exact formalization of the *disproof* harder. However, the formalization sidesteps this by simply asserting the universal statement is false (`answer(False)`), which is clean and unambiguous. + +## 6. Correctness + +**Correct overall, with minor observations.** + +- **`answer(False)` is correct.** The conjecture was disproved by Norin, Sun, and Zhao [NSZ16]. The formalization encodes `False ↔ (∀ k ≥ 1, ∀ T tree with bipartition (k, 2k), R(T) = 4k − 1)`, which correctly asserts the universal statement is false. + +- **Bipartition encoding is correct.** The formalization requires the existence of a proper 2-coloring (`T.Coloring (Fin 2)`) where the color classes have sizes k and 2k. Since every tree is bipartite, such a coloring exists iff the tree has 3k vertices with parts of size k and 2k. The unique bipartition of a tree (up to swapping colors) means this condition is well-defined and correctly captures the intended hypothesis. + +- **Vertex type is correct.** The tree is defined on `Fin (3 * k)`, which is consistent with having k + 2k = 3k total vertices. + +- **Natural number subtraction.** The expression `4 * k - 1` is safe because k ≥ 1 guarantees 4k ≥ 4 > 0, avoiding underflow. + +- **`sInf` for Ramsey number.** The definition uses `sInf` over natural numbers. If the defining set were empty, `sInf` would return 0 by convention. This cannot happen for finite graphs by the classical Ramsey theorem, but this well-definedness is not proved within the formalization. This is a pre-existing issue shared with problems 545–547 and is not specific to 549. + +- **No mathematical flaws identified.** The formalization faithfully represents the disproved conjecture. An experienced mathematician would not find obvious errors. diff --git a/ai-review/55.md b/ai-review/55.md new file mode 100644 index 0000000000..a87b459ae9 --- /dev/null +++ b/ai-review/55.md @@ -0,0 +1,113 @@ +# Review: Erdős Problem 55 + +**File:** `FormalConjectures/ErdosProblems/55.lean` + +--- + +## 1. Code Reuse + +**Problem 54 defines a redundant `IsRamsey2Complete`.** The definition `Erdos54.IsRamsey2Complete A` (in `54.lean`) is exactly `Erdos55.IsRamseyComplete A 2`. These two definitions should be unified. Problem 54 could import and reuse `IsRamseyComplete` from Problem 55 (or both could use a shared definition in `FormalConjecturesForMathlib`). + +The counting pattern `((Finset.Icc 1 N).filter (fun n => n ∈ A)).card` appears identically in both `54.lean` and `55.lean`, as well as in both theorems within `55.lean` itself. This could be factored into a helper definition (e.g., `countingFunction A N`) to reduce repetition and improve readability. + +No existing utility in `FormalConjecturesForMathlib` directly captures the "Ramsey complete" concept, though `Combinatorics/Additive/Basis.lean` provides the related notion of `IsAsymptoticAddBasisOfOrder`, which captures "all sufficiently large elements are representable as sums" — the non-colored analogue. The Ramsey complete concept adds a coloring constraint on top of this. + +## 2. Citations + +The formalization cites: + +> [CFP21] Conlon, D., Fox, J., and Pham, H. T., _The upper bound for Ramsey complete sequences_, 2021. + +Problem 54 cites the same authors but with a different title: + +> [CFP21] Conlon, D., Fox, J., and Pham, H.T., _Subset sums, completeness and colorings_. (2021). + +The website ([erdosproblems.com/55](https://www.erdosproblems.com/55)) credits "Conlon, Fox, and Pham" but does not give a specific paper title. These appear to be two different papers by the same authors. The citation in `55.lean` should be verified against the actual paper. The full citation for the paper resolving this problem is likely: Conlon, D., Fox, J., and Pham, H.T., *Subset sums, completeness and colorings*, **J. Combin. Theory Ser. B** 155 (2022), 1–28. The title "The upper bound for Ramsey complete sequences" does not appear to correspond to a known published paper and may be a fabrication or confusion with an earlier preprint title. + +The website also mentions the historical result by **Burr and Erdős (1985)** establishing bounds for the r=2 case and **Burr's** result that k-th power sequences are Ramsey r-complete for all r, k ≥ 1. These are not cited in the formalization, which is acceptable since they are historical context rather than the solving reference. + +The website mentions related problems **[54]** and **[843]**, which are not cross-referenced in the docstring. Adding a note about Problem 54 being the r=2 special case would be helpful. + +## 3. Variants + +The formalization captures two components: +- **Upper bound** (`erdos_55`): Existence of an r-Ramsey complete set with the stated density bound. +- **Lower bound** (`erdos_55.variants.lower_bound`): Optimality of the bound — if the counting function is too small, the set cannot be Ramsey complete. + +The website's problem statement is broader: *"prove any non-trivial bounds about the growth rate of such an A for r > 2."* The formalization captures the strongest known result (tight bounds), which subsumes the original ask. + +**Missing variants:** +- Burr's result that k-th power sequences {1^k, 2^k, 3^k, ...} are Ramsey r-complete for all r, k ≥ 1 is mentioned on the website but not formalized. This is a natural companion result. +- The historical Burr–Erdős bound of |A ∩ {1,...,N}| ≪ (log N)³ for r=2 is not captured (though this is subsumed by the stronger result). + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The docstring for `erdos_55` could mention that this is a generalization of Problem 54 to arbitrary r ≥ 2. +- The docstring for the lower bound variant says "showing the upper bound is best possible" which is slightly confusing — it would be clearer to say "showing that the growth rate Θ(r(log N)²) is optimal." + +## 5. Formalizability + +The problem is well-defined and the formalization is precise. The key concepts — r-coloring, monochromatic subset sum, counting function — all have unambiguous mathematical meanings that translate cleanly into Lean. + +The only source of mild ambiguity in the original problem is the phrase "best possible," which can mean either: +- (a) The growth rate r(log N)² cannot be improved (i.e., no r-Ramsey complete set can have counting function o(r(log N)²)), or +- (b) The exact constant cannot be improved. + +The formalization captures interpretation (a) via the lower bound variant, which is the standard mathematical reading. + +**Assessment: Low ambiguity.** The problem is clearly formalizable. + +## 6. Correctness + +### Definition `IsRamseyComplete` + +The definition is mathematically correct: +- Uses `Finset ℕ` for S, which automatically enforces distinctness of elements. +- The subset condition `(↑S : Set ℕ) ⊆ A` correctly restricts to elements of A. +- The monochromatic condition `∃ c : Fin r, ∀ x ∈ S, χ x = c` is standard. +- `S.sum id = n` correctly expresses that n is the sum of the elements. +- The empty set has sum 0, so for n ≥ 1 (ensured by N₀ ≥ 1), the finset must be nonempty. No explicit nonemptiness condition is needed. + +### Theorem `erdos_55` (Upper Bound) + +**Quantifier ordering concern:** The constant C is existentially quantified *inside* the universal quantification over r: + +``` +∀ r, 2 ≤ r → ∃ A, IsRamseyComplete A r ∧ ∃ C > 0, ∃ N₀, ∀ N ≥ N₀, ... ≤ C * r * (log N)² +``` + +This allows C to depend on r. However, the actual result of Conlon–Fox–Pham gives an **absolute constant** C independent of r (the factor r is already explicit in the bound `C · r · (log N)²`). The formalization is **correct but weaker than the actual theorem**. To capture the full strength: + +``` +∃ C > 0, ∀ r, 2 ≤ r → ∃ A, IsRamseyComplete A r ∧ ∃ N₀, ∀ N ≥ N₀, ... ≤ C * r * (log N)² +``` + +This is a **notable weakness** in the formalization. + +### Theorem `erdos_55.variants.lower_bound` + +The lower bound states: there exists c > 0 such that if |A ∩ {1,...,N}| ≤ c·r·(log N)² for all large N, then A is not r-Ramsey complete. + +Taking the contrapositive: if A is r-Ramsey complete, then for all N₀, there exists N ≥ N₀ with |A ∩ {1,...,N}| > c·r·(log N)². This gives a lower bound that holds **infinitely often**, not **eventually always**. + +A stronger (and likely true) statement would be: any r-Ramsey complete set satisfies |A ∩ {1,...,N}| > c·r·(log N)² for all sufficiently large N. However, since |A ∩ {1,...,N}| is non-decreasing in N while c·r·(log N)² is increasing, the "infinitely often" version does not trivially imply the "eventually always" version. The formalized version may be slightly weaker than what was actually proved, but it is not *incorrect* — it is a valid consequence of the actual theorem. + +The same quantifier ordering concern applies here: c is inside ∀ r, allowing c to depend on r. + +### Use of `Real.log` + +The formalization uses the natural logarithm (`Real.log`). Since the bound involves an arbitrary constant C (or c), the choice of logarithm base is absorbed into the constant, so this is correct. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Definition correctness | Correct | +| Upper bound correctness | Correct but weaker than optimal (C depends on r) | +| Lower bound correctness | Correct but possibly weaker (infinitely often vs. eventually always; c depends on r) | +| Completeness | Main result and optimality captured; Burr's k-th powers result missing | +| Code reuse opportunity | `IsRamsey2Complete` in Problem 54 should be unified with `IsRamseyComplete` | + +**Overall: The formalization is mathematically sound but could be strengthened by pulling the constants C and c outside the ∀ r quantifier to match the full strength of the Conlon–Fox–Pham result.** diff --git a/ai-review/550.md b/ai-review/550.md new file mode 100644 index 0000000000..5c36a3852e --- /dev/null +++ b/ai-review/550.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 550 + +## 1. Code Reuse + +**Significant duplication detected.** The definitions `ContainsSubgraphCopy` and `offDiagRamseyNumber` are copied verbatim across at least three files: + +- `ErdosProblems/549.lean` (lines 45–55) +- `ErdosProblems/550.lean` (lines 44–55) +- `ErdosProblems/551.lean` (lines 51–62) + +These should be factored into a shared utility, e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean` or a new shared file. + +Additionally, Mathlib provides `SimpleGraph.IsContained` (used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean:46`), which appears to capture the same notion as `ContainsSubgraphCopy`. Investigating whether `IsContained` is a drop-in replacement would be worthwhile. + +The `completeMultipartiteGraph` definition is specific to this problem and does not appear elsewhere in the codebase. It is cleanly implemented. Mathlib's `completeBipartiteGraph` works on `V ⊕ W` (sum types) rather than `Σ i, Fin (sizes i)`, so it is not directly interchangeable with the approach here, but the `bipSizes`/`completeMultipartiteGraph` formulation is arguably more natural for this problem since it generalizes to arbitrary k-partite graphs. + +## 2. Citations + +The formalization cites: + +- **[EFRS85]** Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., *Multipartite graph—sparse graph Ramsey numbers*, Combinatorica **5** (1985), 311–318. +- **[Ch77]** Chvátal, V., *Tree-complete graph Ramsey numbers*, J. Graph Theory **1** (1977), 93. + +The website (erdosproblems.com/550) confirms [EFRS85] as the original source. The Chvátal reference [Ch77] is background context correctly attributed. The citations are properly formatted with journal, volume, year, and pages. + +**No missing citations.** The website does not list additional references beyond what is included. + +## 3. Variants + +The website presents a single formulation of this problem. The formalization captures the full generality: arbitrary k ≥ 2, arbitrary monotone positive part sizes, and arbitrary trees on sufficiently large n. **No missing variants.** + +The docstring additionally notes Chvátal's result R(T, Kₘ) = (m−1)(n−1) + 1 as context, which is appropriate background but is not formalized (nor does it need to be, as it is a known theorem rather than a variant of the conjecture). + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The `let` bindings for `m₁` and `m₂` in the theorem statement improve readability. +- The `bipSizes` helper is clear and well-named. +- The `completeMultipartiteGraph` definition using sigma types is idiomatic Lean. +- The docstrings are thorough and include LaTeX-formatted mathematical statements. + +**Minor suggestion:** The namespace `Erdos550` is clear but could note in a comment that the local definitions duplicate shared infrastructure (if/when shared definitions are created). + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** The statement specifies: +- The ordering constraint m₁ ≤ ··· ≤ mₖ (captured by `Monotone sizes`) +- "Sufficiently large n" (captured by the existential `∃ N₀, ∀ n ≥ N₀`) +- The Ramsey number inequality with explicit bound + +The only potential ambiguity is what "sufficiently large" means—whether N₀ may depend on k and the sizes mᵢ. The formalization correctly allows N₀ to depend on all of these (since k, sizes, and all hypotheses are in scope when N₀ is introduced). **Ambiguity: negligible.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **χ(G) substitution:** For a complete k-partite graph with k ≥ 2 non-empty parts, χ(G) = k. The formalization correctly substitutes k for χ(G) in the bound, giving (k−1)(R(T, K_{m₁,m₂}) − 1) + m₁. The hypothesis `hsizes_pos : ∀ i, 0 < sizes i` ensures all parts are non-empty, which is necessary for χ(G) = k. + +- **Monotonicity:** `hsizes_mono : Monotone sizes` on `Fin k` ensures sizes 0 ≤ sizes 1 ≤ ··· ≤ sizes (k−1), matching the problem's m₁ ≤ ··· ≤ mₖ. + +- **K_{m₁,m₂} construction:** `completeMultipartiteGraph (bipSizes m₁ m₂)` correctly constructs the complete bipartite graph with part sizes m₁ and m₂ (the two smallest), matching the problem statement. + +- **Natural number subtraction:** The expression `offDiagRamseyNumber T (...) - 1` uses ℕ subtraction. Since any Ramsey number R(G₁, G₂) for non-empty graphs G₁, G₂ is ≥ 1 (and trees on n ≥ N₀ vertices are non-empty), this does not underflow in practice. Similarly, `k - 1` is safe since k ≥ 2. + +- **sInf well-definedness:** The `offDiagRamseyNumber` uses `sInf`, which returns 0 for the empty set in ℕ. For finite graphs, the classical Ramsey theorem guarantees the defining set is nonempty, so sInf returns the true minimum. This is mathematically sound for the intended use. + +- **IsTree:** The formalization uses Mathlib's `SimpleGraph.IsTree`, which correctly characterizes trees (connected acyclic graphs). This is appropriate. + +**No mathematical flaws identified.** The formalization faithfully captures the conjecture as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Duplication of `ContainsSubgraphCopy` and `offDiagRamseyNumber` across 549/550/551; should be shared | +| Citations | Complete and correctly formatted | +| Variants | All captured | +| Readability | Good | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/551.md b/ai-review/551.md new file mode 100644 index 0000000000..58153181d1 --- /dev/null +++ b/ai-review/551.md @@ -0,0 +1,85 @@ +# Erdős Problem 551 — Review + +## 1. Code Reuse + +There is significant code duplication. The definitions `ContainsSubgraphCopy`, `offDiagRamseyNumber`, and `cycleGraph` are copy-pasted verbatim across problems 549, 550, 551, and 552. These should be extracted into a shared utility file. + +More importantly, **Mathlib already provides equivalent infrastructure**: + +- `SimpleGraph.IsContained G H` (`G ⊑ H`) in `Mathlib.Combinatorics.SimpleGraph.Copy` is semantically equivalent to `ContainsSubgraphCopy G H`. It is defined via injective graph homomorphisms (not embeddings), matching the non-induced containment notion used here. +- `SimpleGraph.Copy G H` gives the type of copies (injective homomorphisms), providing a richer API. + +The custom `ContainsSubgraphCopy` could be replaced by `SimpleGraph.IsContained`, and `offDiagRamseyNumber` could be refactored to use it. A shared definition of `offDiagRamseyNumber` using Mathlib's `IsContained` should live in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. + +The `cycleGraph` definition is also duplicated (with slight variations) in problems 552, 554, 555, and 720. A single shared definition would be appropriate. + +The `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` file defines `hypergraphRamsey` (r-uniform hypergraph Ramsey numbers), which is a different concept and not directly reusable here. + +## 2. Citations + +The website (erdosproblems.com/551) lists the following: + +- **[EFRS78]** Erdős, Faudree, Rousseau, and Schelp — the original question. +- **Bondy and Erdős** proved it for $k > n^2 - 2$. +- **Nikiforov** extended to $k \geq 4n + 2$. +- **Keevash, Long, and Skokan** proved it for $k \geq C \frac{\log n}{\log \log n}$ for some constant $C$, establishing it for sufficiently large $n$. + +The formalization's docstring references match. However, there are two discrepancies: + +1. The docstring says Bondy and Erdős proved it for "$k > n^2 - 2$" citing [BoEr73]. The website confirms this. +2. The docstring says Nikiforov extended to "$k \geq 4n + 2$" citing [Ni05]. The website confirms this. +3. The docstring says Keevash, Long, and Skokan established it "for sufficiently large $n$" citing [KLS21]. The website is more precise: the result holds when $k \geq C \frac{\log n}{\log \log n}$, which is a stronger statement than just "sufficiently large $n$." The docstring could be more precise here. + +Additionally, the website notes the problem status as **decidable** (resolved up to finite verification), which the formalization does not mention. The `@[category research open]` tag may be slightly misleading — the problem is essentially resolved modulo finite checking thanks to [KLS21]. + +## 3. Variants + +The website mentions two additional questions posed by the original authors: + +1. **For fixed $n$, what is the smallest $k$ satisfying $R(C_k, K_n) = (k-1)(n-1)+1$?** +2. **For fixed $n$, what is the minimum value of $R(C_k, K_n)$?** + +Neither of these variants is captured by the formalization. While the main identity is the primary conjecture, these subsidiary questions are mathematically interesting and could be formalized as separate statements or noted in the docstring. + +## 4. Readability + +The code is generally readable. A few observations: + +- The `cycleGraph` definition and its `loopless` proof are clear and well-structured. +- The use of `⊤ : SimpleGraph (Fin n)` for $K_n$ is idiomatic and well-explained in the docstring. +- The `offDiagRamseyNumber` definition using `sInf` is clean, though it could benefit from a note that the set is nonempty (which follows from Ramsey's theorem) to ensure the `sInf` is meaningful and doesn't degenerate to `0`. +- The hypothesis names `hk`, `hn`, `hne` are standard and clear. +- The namespace `Erdos551` appropriately scopes all local definitions. + +## 5. Formalizability + +The problem statement is **precisely formalizable**. The identity $R(C_k, K_n) = (k-1)(n-1)+1$ for $k \geq n \geq 3$ (excluding $k = n = 3$) is a concrete equation involving well-defined combinatorial objects. There is no ambiguity in: + +- The definition of the cycle graph $C_k$. +- The definition of the complete graph $K_n$. +- The off-diagonal Ramsey number $R(G_1, G_2)$. +- The excluded case $k = n = 3$ (where $R(C_3, K_3) = R(K_3, K_3) = 6 \neq 5$). + +The only potential source of ambiguity is whether "contains a copy" means as a subgraph (non-induced) or as an induced subgraph. The formalization correctly uses non-induced containment (injective homomorphism), which is the standard convention in Ramsey theory. + +**Formalizability: unambiguous.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Verification of the statement:** The conjecture asserts $R(C_k, K_n) = (k-1)(n-1)+1$ for $k \geq n \geq 3$, $\neg(k=3 \wedge n=3)$. This matches the literature exactly. + +**Verification of definitions:** + +- `ContainsSubgraphCopy`: Correctly captures non-induced subgraph containment via injective adjacency-preserving maps. ✓ +- `offDiagRamseyNumber`: Defined as $\inf\{N \mid \forall H \text{ on } \operatorname{Fin} N,\; G_1 \subseteq H \lor G_2 \subseteq H^c\}$. This is the standard definition. ✓ +- `cycleGraph k`: Adjacency is `(i+1) mod k = j ∨ (j+1) mod k = i`, which correctly captures the cycle $C_k$. The `loopless` and `symm` proofs are correct. ✓ +- The complete graph $K_n$ as `⊤ : SimpleGraph (Fin n)` is correct — it's the graph where every pair of distinct vertices is adjacent. ✓ +- The exclusion `¬(k = 3 ∧ n = 3)` is necessary because $R(C_3, K_3) = R(K_3, K_3) = 6$, while $(3-1)(3-1)+1 = 5$. ✓ + +**Potential concern with `sInf`:** If the defining set for `offDiagRamseyNumber` were empty, `sInf` would return `0`, which would be mathematically incorrect. However, by Ramsey's theorem the set is always nonempty for finite graphs, so this is not an actual issue — but the definition does not prove this inline. A more robust definition might use `Nat.find` with a proof of existence, though for a `sorry`-based conjecture statement the current approach is acceptable. + +**Hypothesis ordering:** The formalization uses `k ≥ n` and `n ≥ 3`, from which `k ≥ 3` follows. This is correct and minimal. + +**Overall assessment: correct and complete for the main conjecture. The two subsidiary questions from the website are not captured.** diff --git a/ai-review/552.md b/ai-review/552.md new file mode 100644 index 0000000000..0037a9d3e5 --- /dev/null +++ b/ai-review/552.md @@ -0,0 +1,109 @@ +# AI Review: Erdős Problem 552 + +## 1. Code Reuse + +Several definitions in `552.lean` are duplicated from other files or redundant with Mathlib: + +### `ContainsSubgraphCopy` (lines 38–39) +This is a hand-rolled version of what Mathlib provides via `SimpleGraph.IsContained` (`G ⊑ H`) in `Mathlib.Combinatorics.SimpleGraph.Copy`. The Mathlib version uses the `Copy` structure (injective homomorphisms) and provides a rich API (`Copy.id`, `Copy.comp`, `Copy.mapEdgeSet`, `Copy.mapNeighborSet`, etc.). The custom definition is semantically equivalent but lacks this ecosystem. Notably, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` already uses `G.IsContained R` from Mathlib. + +**Recommendation:** Replace `ContainsSubgraphCopy G H` with `G.IsContained H` from Mathlib. + +### `offDiagRamseyNumber` (lines 44–47) +This identical definition appears in `551.lean` (lines 59–62). Neither is factored into a shared utility file. Using Mathlib's `IsContained` would also simplify this definition. + +**Recommendation:** Extract `offDiagRamseyNumber` into a shared file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean` or a new utility), parameterized over Mathlib's `IsContained`. + +### `cycleGraph` (lines 51–60) +Mathlib provides `SimpleGraph.cycleGraph : (n : ℕ) → SimpleGraph (Fin n)` in `Mathlib.Combinatorics.SimpleGraph.Circulant`, defined via `circulantGraph {1}`. This is a cleaner, more general definition with proven properties. The hand-rolled version in 552.lean (and identically in 551.lean, 555.lean, 556.lean) uses modular arithmetic and takes an unnecessary proof obligation `hk : k ≥ 3`. + +**Recommendation:** Replace with Mathlib's `SimpleGraph.cycleGraph 4`. The Mathlib version handles all `n` (returning `⊥` for `n = 0` and degeneracies for small `n`), so no proof obligation is needed. + +### `starGraph` (lines 64–68) +Mathlib provides `SimpleGraph.completeBipartiteGraph V W : SimpleGraph (V ⊕ W)`, which for `V = Unit` and `W = Fin n` yields a star on `n + 1` vertices. However, the vertex type would be `Unit ⊕ Fin n` rather than `Fin (n + 1)`, so using it directly would require establishing an equivalence. The custom `starGraph` definition is reasonable for clarity, though it could be related to the Mathlib version via an isomorphism. + +**Recommendation:** The custom `starGraph` is acceptable. Consider adding a comment noting the relationship to `completeBipartiteGraph Unit (Fin n)`. + +## 2. Citations + +The website (erdosproblems.com/552) lists these references: +- Burr, Erdős, Faudree, Rousseau, Schelp (1989) — cited as [BEFRS89] in the docstring ✓ +- Parsons (1975) — cited as [Pa75] in the docstring ✓ +- Wu, Sun, Zhang, Radziszowski (2015) — **not cited in the formalization** +- Zhang, Chen, Cheng (2017) — **not cited in the formalization** + +The docstring uses shorthand references `[BEFRS89]` and `[Pa75]` without full bibliographic information (titles, journal names, page numbers). Problem 551's docstring provides full citations as a model. + +**Recommendation:** +- Expand `[BEFRS89]` to its full form, e.g.: `Burr, S. A., Erdős, P., Faudree, R. J., Rousseau, C. C., and Schelp, R. H., *Ramsey numbers for stars-versus-connected graphs*, ...` +- Expand `[Pa75]` to its full form: `Parsons, T. D., *Ramsey graphs and block designs*, J. Combin. Theory Ser. A 20 (1976), 12–19.` (Note: commonly cited as 1975 but published 1976.) +- Consider adding references to Wu–Sun–Zhang–Radziszowski (2015) and Zhang–Chen–Cheng (2017) if their results inform the known bounds. + +## 3. Variants + +The website describes additional context beyond the formalized question: +1. **Exact values for special cases:** Parsons proved R(C₄, Sₙ) = n + ⌈√n⌉ when n = q² + 1 for prime power q, and R(C₄, Sₙ) = n + ⌈√n⌉ + 1 when n = q² for prime power q. +2. **Extended results:** Results for n = q² ± t (0 ≤ t ≤ q) exist. +3. **Universality conjecture:** In all known cases, R(C₄, Sₙ) = n + ⌈√n⌉ + O(1), suggesting a stronger conjecture that R(C₄, Sₙ) ∈ {n + ⌈√n⌉, n + ⌈√n⌉ + 1} for all n. + +The formalization captures only the specific question: "for any c > 0, are there infinitely many n with R(C₄, Sₙ) ≤ n + √n − c?" This is the correct core question from Erdős. The exact-value results and extended cases are partial results rather than separate conjectures, so their omission is acceptable, though they could be mentioned in the docstring for context. + +**Assessment:** All essential variants are captured. The formalization focuses correctly on the open Erdős question. + +## 4. Readability + +### Strengths +- The docstring clearly explains the problem, known bounds, and notation. +- Proof of `loopless` for both `cycleGraph` and `starGraph` is clean and short. +- The `symm` proofs using `Or.elim` / `Or.inr` / `Or.inl` are idiomatic. + +### Suggestions +- The use of `answer(sorry)` with `↔` is a convention in this codebase for open problems. This is readable to those familiar with the pattern but could benefit from a brief comment for newcomers. +- The cast `(offDiagRamseyNumber ... : ℝ)` on line 89 is necessary for the real-valued inequality but slightly obscures the statement. This is unavoidable given the use of `Real.sqrt`. +- Using Mathlib's `SimpleGraph.cycleGraph` would remove the `(by omega)` proof term on line 89, making the theorem statement cleaner. + +## 5. Formalizability + +The problem asks: "Is it true that, for any c > 0, there are infinitely many n such that R(C₄, Sₙ) ≤ n + √n − c?" + +**Assessment: Moderately high precision, with one subtle ambiguity.** + +The core mathematical content is precise: +- C₄ and Sₙ are standard graph-theoretic objects. +- R(G₁, G₂) is the standard off-diagonal Ramsey number. +- The bound n + √n − c is unambiguous. + +The phrase "infinitely many n" is correctly formalized as `∀ N : ℕ, ∃ n : ℕ, n ≥ N ∧ ...` (line 88). + +**Potential ambiguity:** The problem asks to "determine" R(C₄, Sₙ), and the specific question about n + √n − c is one aspect. The broader question of determining the exact value for all n is arguably the full problem. However, the \$100 prize is specifically attached to the question about whether R(C₄, Sₙ) ≤ n + √n − c for infinitely many n, so the formalization correctly captures the intended question. + +**Ambiguity level: Low.** The formalization is faithful to the stated question. + +## 6. Correctness + +### Mathematical Correctness + +The formalization is **mathematically correct** with one minor concern: + +1. **`offDiagRamseyNumber` well-definedness (lines 44–47):** The definition uses `sInf` over natural numbers. If the set `{N | ...}` is empty (which would mean no finite Ramsey number exists), then `sInf ∅ = 0` in `ℕ`. For C₄ vs Sₙ, the Ramsey number is known to exist and be finite (by the general Ramsey theorem for graphs), so this is not an issue in practice. However, the definition does not include a proof or assertion that the set is nonempty. This is a general concern with this `sInf`-based approach—if applied to graphs for which a finite Ramsey number doesn't exist, it would silently return 0. For the specific application here, correctness is ensured by classical Ramsey theory. + +2. **`cycleGraph` correctness (lines 51–60):** The adjacency relation `(i.val + 1) % k = j.val ∨ (j.val + 1) % k = i.val` correctly defines the cycle C_k for k ≥ 3. The `loopless` proof correctly handles the edge cases. This is equivalent to Mathlib's `cycleGraph` (via circulant graphs with jump set {1}) for k ≥ 3. + +3. **`starGraph` correctness (lines 64–68):** The definition correctly makes vertex 0 adjacent to all other vertices and no other edges. This is K_{1,n} on n + 1 vertices. ✓ + +4. **Theorem statement (lines 86–91):** The `answer(sorry) ↔ ...` pattern correctly encodes an open problem where the answer (true or false) is unknown. The quantifier structure `∀ c > 0, ∀ N, ∃ n ≥ N, R(C₄, Sₙ) ≤ n + √n − c` correctly formalizes "for any c > 0, infinitely many n satisfy the bound." The cast to `ℝ` is necessary and correct for using `Real.sqrt`. ✓ + +5. **Subtle point on `Real.sqrt` vs ⌈√n⌉:** The known upper bound is n + ⌈√n⌉ + 1 (using the ceiling), while the problem asks about n + √n − c (using the exact square root). Since ⌈√n⌉ ≤ √n + 1, the question is essentially whether the gap between R(C₄, Sₙ) and n + √n can be made arbitrarily negative. The formalization correctly uses `Real.sqrt ↑n` (the exact real square root) rather than a ceiling, matching the problem statement. ✓ + +### Completeness +The formalization is complete for the specific Erdős question. No mathematical content is missing. + +### Summary +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `ContainsSubgraphCopy`, `offDiagRamseyNumber`, and `cycleGraph` should use Mathlib equivalents or be shared | +| Citations | Shorthand only; two references from the website are missing | +| Variants | Core question captured; exact-value results omitted (acceptable) | +| Readability | Good; would improve slightly with Mathlib's `cycleGraph` | +| Formalizability | Low ambiguity; faithful to the stated problem | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/553.md b/ai-review/553.md new file mode 100644 index 0000000000..d8e37e8062 --- /dev/null +++ b/ai-review/553.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 553 + +## 1. Code Reuse + +**Issue found: Duplicate definition of `ramseyR3`.** + +The definition `ramseyR3` in `Erdos553` (line 42–43) is *identical* to `Erdos544.ramseyR3` in `FormalConjectures/ErdosProblems/544.lean` (line 41–42): + +```lean +noncomputable def ramseyR3 (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree 3 ∨ ¬Gᶜ.CliqueFree n} +``` + +This definition should be factored into a shared utility (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean` or similar) and imported by both 544 and 553. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey r n` for uniform hypergraph Ramsey numbers with 2-coloring. For `r = 2`, `hypergraphRamsey 2 n` is the diagonal Ramsey number `R(n, n)`, which is not directly what's needed here (the off-diagonal `R(3, n)`), but the general approach of defining Ramsey numbers via `sInf` is consistent. + +The `ramseyR33` definition for the 3-colour asymmetric Ramsey number is unique to this problem and does not appear elsewhere in the codebase. + +## 2. Citations + +**Website (erdosproblems.com/553) lists:** +- **[ErSo80]** — Erdős and Sós (1980) — original problem. +- **[AlRo05]** — Alon and Rödl (2005) — solved the problem, showing R(3,3,n) ≍ n³(log n)^{O(1)}. +- **[Sh83]** — Shearer (1983) — showed R(3,n) ≪ n²/log n. +- Related problems: **Problem 925**. + +**Formalization docstring lists:** [ErSo80], [AlRo05], [Sh83] — all matching the website. + +**Minor gap:** The website notes a relation to Problem 925, but this is not mentioned in the Lean docstring. Consider adding a `See also [925]` note (though this is optional since it's metadata rather than a citation). + +**Citations assessment: Adequate.** All three references match. Full bibliographic details (author names, years) are not given on the website itself, so the shorthand references are acceptable. + +## 3. Variants + +The website states a single problem: show R(3,3,n)/R(3,n) → ∞. The formalization captures exactly this statement. No additional variants are listed on the website. + +**Variants assessment: Complete.** + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings explain the mathematical definitions. +- The module docstring accurately states the problem and its resolution. +- The namespace `Erdos553` keeps definitions local. +- The statement `erdos_553` is clearly formulated with an explicit ε-N definition of divergence to ∞. + +**Minor suggestion:** The docstring for `ramseyR33` says "the complement (G₁ ⊔ G₂)ᶜ" — this is correct but could note that `⊔` is the lattice join (edge union), which makes (G₁ ⊔ G₂)ᶜ the set of edges in neither colour class, i.e., the third colour. This is already implicit but could aid a reader unfamiliar with the lattice structure on `SimpleGraph`. + +**Readability assessment: Good.** + +## 5. Formalizability + +The original problem statement is precise and unambiguous: +- R(3, n) and R(3, 3, n) are standard, well-defined Ramsey-theoretic quantities. +- The asymptotic statement R(3,3,n)/R(3,n) → ∞ has a clear and standard mathematical meaning. +- The Lean formalization correctly renders this as: ∀ C > 0, ∃ N₀, ∀ n ≥ N₀, C · R(3,n) ≤ R(3,3,n). + +There is no ambiguity in the problem statement. + +**Formalizability assessment: Fully formalizable, no ambiguity.** + +## 6. Correctness + +**Definitions:** + +- `ramseyR3 n`: Correctly captures R(3, n) as the minimum N such that every graph on N vertices has either a 3-clique or its complement has an n-clique. This is the standard graph-theoretic formulation of the off-diagonal Ramsey number R(3, n). ✓ + +- `ramseyR33 n`: Correctly models R(3, 3, n). A 3-colouring of K_N is represented by two edge-disjoint graphs G₁, G₂ (the first two colour classes); the third colour class consists of all remaining edges, i.e., (G₁ ⊔ G₂)ᶜ. The definition requires that either G₁ has a triangle, G₂ has a triangle, or (G₁ ⊔ G₂)ᶜ has an n-clique. The `Disjoint G₁ G₂` precondition correctly ensures the colouring is well-defined (no edge gets two colours). ✓ + + **Subtle point:** One might ask whether we need G₁ and G₂ to be *simple* graphs (irreflexive). In Lean 4's Mathlib, `SimpleGraph` is by definition irreflexive and symmetric, so this is automatic. The disjointness condition plus the complement construction correctly partitions all edges of K_N into three classes. ✓ + +- **Well-definedness of `sInf`:** Both definitions use `sInf` on a set of natural numbers. If the set is empty, `sInf ∅ = 0` in Lean's `ℕ`. For `ramseyR3`, the classical Ramsey theorem guarantees the set is nonempty for all n. For `ramseyR33`, this also holds by Ramsey's theorem. The formalization does not prove nonemptiness, but since the theorem statement only concerns the *ratio* of these values for large n, and both are known to be positive and finite, this is not an issue for the correctness of the conjecture statement. ✓ + +**Theorem statement:** + +The statement `∀ C : ℝ, C > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → C * (ramseyR3 n : ℝ) ≤ (ramseyR33 n : ℝ)` correctly formalizes R(3,3,n)/R(3,n) → ∞. This is the standard ε-N formulation: the ratio exceeds any positive constant C for sufficiently large n. ✓ + +**Tag:** `@[category research solved, AMS 5]` — correctly marked as solved (Alon and Rödl, 2005). ✓ + +**Correctness assessment: Correct and complete. No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `ramseyR3` is duplicated in 544.lean — should be shared | +| Citations | All three references match the website | +| Variants | Complete — single problem, fully captured | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/554.md b/ai-review/554.md new file mode 100644 index 0000000000..5cf36fc5b9 --- /dev/null +++ b/ai-review/554.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 554 + +## 1. Code Reuse + +The definitions `cycleGraph` and `multicolorRamseyNumber` in `554.lean` are **duplicated verbatim** across at least four files: + +- `FormalConjectures/ErdosProblems/554.lean` (lines 36–39, 47–52) +- `FormalConjectures/ErdosProblems/555.lean` (lines 41–44, 52–57) +- `FormalConjectures/ErdosProblems/556.lean` (lines 37–40, 48–53) +- `FormalConjectures/ErdosProblems/557.lean` (similarly) + +All definitions are textually identical (same `Adj`, `symm`, `loopless` proofs; same `sInf` formulation). These should be factored into a shared utility file (e.g., `FormalConjectures/Util/RamseyGraph.lean` or similar) and imported by each problem file. Each file currently places these in its own namespace (`Erdos554`, `Erdos555`, etc.), which prevents any cross-problem lemma reuse. + +The representation of $K_3$ as `⊤ : SimpleGraph (Fin 3)` is standard and correct — no reuse issue there. + +## 2. Citations + +The formalization cites: + +> [Er81c] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*. Monographies de L'Enseignement Mathématique, 1981. + +The website (erdosproblems.com/554) lists several additional references: + +- **[Sc16]** Schur — established $C^k \ll R_k(K_3) \ll k!$ +- **[BoEr73]** Bondy & Erdős — proved $n2^k + 1 \leq R_k(C_{2n+1}) \leq 2n(k+2)!$ +- **[ErGr75]** Erdős & Graham +- **[JeSk21]** Jenssen & Skokan +- **[DaJo17]** Day & Johnson +- **[ACJMR25]** Axenovich et al. (2025) — improved upper bound to $R_k(C_{2n+1}) \leq (4n-2)^k k^{k/n} + 1$ + +The docstring attribution "[Er81c]" as "Erdős, P. and Graham, R." is consistent with the website listing it as a problem of Erdős and Graham. However, the docstring could benefit from mentioning the broader citation context — particularly the Bondy–Erdős bounds and the recent Axenovich et al. improvement, which are the most significant known results on this problem. + +## 3. Variants + +The website states the problem as: + +> Show that $\lim_{k\to\infty} R_k(C_{2n+1})/R_k(K_3) = 0$ for any $n \geq 2$. + +The formalization captures **exactly one** statement and no variants. This is appropriate — the website does not list distinct sub-problems or variants for Problem 554 (unlike Problem 555, which has separate upper/lower bounds and a Chung–Graham specialization). The single statement fully captures the problem. + +One potential variant not formalized: the website notes the problem is open **even for $n = 2$** (i.e., $C_5$). A specialized variant `erdos_554.variants.n_eq_2` for $C_5$ specifically could be added, though this is arguably just a special case of the general statement and not strictly necessary. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The docstring for `cycleGraph` is clear and correctly describes the adjacency relation. +- The docstring for `multicolorRamseyNumber` is well-written and provides good mathematical context. +- The main theorem's docstring clearly states the limit formulation and its ε-δ reformulation. +- **Minor:** The `by omega` tactic call on line 67 (proving `2 * n + 1 ≥ 3` from `n ≥ 2`) is fine but could benefit from a brief comment for readers unfamiliar with `omega`. + +Overall readability: **Good**. + +## 5. Formalizability + +The problem as stated on the website is: + +> Show that $\lim_{k\to\infty} R_k(C_{2n+1})/R_k(K_3) = 0$ for any $n \geq 2$. + +This is **precisely formalizable** with essentially no ambiguity: +- $R_k(G)$ is a well-defined finite quantity (by the finite Ramsey theorem for graphs). +- The limit is a standard real-valued limit. +- $C_{2n+1}$ and $K_3$ are standard graph-theoretic objects. + +The only subtlety is the degenerate case $k = 0$ or $k = 1$ where $R_k$ might be undefined or trivial (when $k = 0$, there are no colors, so the `sInf` of an empty set yields 0 in Lean's natural numbers). The formalization sidesteps this correctly by using the ε-δ formulation with "for all $k \geq K_0$", which allows ignoring small $k$. + +**Ambiguity assessment: Very low.** The statement is unambiguous and the formalization captures it faithfully. + +## 6. Correctness + +### Mathematical correctness + +The ε-δ formulation correctly captures $\lim_{k\to\infty} R_k(C_{2n+1})/R_k(K_3) = 0$: + +$$\forall \varepsilon > 0,\ \exists K_0,\ \forall k \geq K_0,\quad R_k(C_{2n+1}) \leq \varepsilon \cdot R_k(K_3)$$ + +This is equivalent to the limit being 0, **provided** $R_k(K_3) > 0$ for sufficiently large $k$. Since $R_k(K_3) \geq 3$ for all $k \geq 1$ (any 2-vertex graph trivially contains no triangle, so you need at least 3 vertices), this is not an issue. The formalization is correct. + +### Definition correctness + +- **`cycleGraph`:** The adjacency `j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m` correctly captures that $i$ and $j$ are adjacent iff they differ by 1 mod $m$. The `i ≠ j` guard prevents self-loops. For $m \geq 3$ this produces exactly the cycle $C_m$. **Correct.** + +- **`multicolorRamseyNumber`:** Uses `sInf` over all $N$ such that every symmetric $k$-coloring of pairs from $\text{Fin}\ N$ contains a monochromatic copy. This is the standard definition. One subtle point: the coloring function `c : Fin N → Fin N → Fin k` assigns colors to **all** pairs including diagonal entries $(i, i)$, but since the monochromatic copy condition only checks `G.Adj u v` (and `cycleGraph` has no self-loops, and `⊤` on `Fin 3` also has no self-loops), the diagonal values are irrelevant. **Correct.** + +- **`⊤ : SimpleGraph (Fin 3)` for $K_3$:** The top element of the `SimpleGraph` lattice on `Fin 3` is the complete graph $K_3$. **Correct.** + +- **Main theorem:** The cast to `ℝ` for the inequality is appropriate since ε is real-valued. The quantifier structure `∀ ε > 0, ∃ K₀, ∀ k ≥ K₀, R_k(C_{2n+1}) ≤ ε · R_k(K_3)` faithfully encodes the limit. **Correct.** + +### Potential concern + +The `multicolorRamseyNumber` definition uses `sInf` on natural numbers. If the set is empty (e.g., if $k = 0$), `sInf ∅ = 0` in `ℕ`. For $k \geq 1$ and any non-empty graph $G$, the Ramsey number is well-defined and finite, so the set is non-empty. For $k = 0$, `Fin 0` is empty, so the condition is vacuously true for $N = 0$, meaning `sInf` returns 0. This edge case does not affect the theorem since $K_0$ can be chosen large enough to avoid it. + +### Verdict + +**The formalization is mathematically correct and complete.** It faithfully captures Erdős Problem 554 as stated on the website. No flaws identified. diff --git a/ai-review/555.md b/ai-review/555.md new file mode 100644 index 0000000000..6f1ab98ddb --- /dev/null +++ b/ai-review/555.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 555 + +## 1. Code Reuse + +**Significant duplication found.** Both `cycleGraph` and `multicolorRamseyNumber` are defined identically (or near-identically) in multiple files: + +- **`cycleGraph`**: duplicated in 554.lean, 555.lean, 556.lean, 765.lean, 86.lean (identical), and similar variants in 551.lean, 552.lean. +- **`multicolorRamseyNumber`**: duplicated in 554.lean, 555.lean, 556.lean, 557.lean, 558.lean (identical). + +These definitions should be centralized—either in a shared utility file under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` or a common Erdős Ramsey import. This would reduce maintenance burden and ensure consistency. Note that `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` already defines `hypergraphRamsey` and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` defines `sizeRamsey`, so there is precedent for shared Ramsey-theoretic definitions in that directory. + +## 2. Citations + +The formalization references **[Er81c]** and **[ChGr75]**. The website (erdosproblems.com/555) lists these same two references: + +- **Er81c** — Erdős (1981) +- **ChGr75** — Chung and Graham (1975) + +The citations are consistent with the website. However, they are given in shorthand form (e.g., `[Er81c]`, `[ChGr75]`) without full bibliographic details. The website does not provide expanded citations either, so this is acceptable. + +## 3. Variants + +The formalization captures three results: + +1. **Lower bound** (erdos_555): $R_k(C_{2n}) \geq C \cdot k^{1+1/(2n)}$ +2. **Upper bound** (erdos_555.variants.upper_bound): $R_k(C_{2n}) \leq C \cdot k^{1+1/(n-1)}$ +3. **Chung–Graham upper bound** (erdos_555.variants.chung_graham_upper): $R_k(C_4) \leq k^2 + k + 1$ + +**Missing variant:** The Chung–Graham *lower bound* is absent. The website states: + +> Chung and Graham [ChGr75] showed that $R_k(C_4) > k^2 - k + 1$ when $k - 1$ is a prime power. + +This conditional lower bound is not formalized. It would be a natural companion to the existing `chung_graham_upper` theorem: + +```lean +theorem erdos_555.variants.chung_graham_lower (k : ℕ) (hk : k ≥ 2) + (hp : Nat.Prime (k - 1) ∨ IsPrimePow (k - 1)) : + multicolorRamseyNumber (cycleGraph 4 (by omega)) k > k ^ 2 - k + 1 := by + sorry +``` + +Also, the overarching problem as stated on the website is to **determine** (i.e., find the exact asymptotic value of) $R_k(C_{2n})$, which is a stronger ask than merely establishing upper and lower bounds. The formalization does not capture this "determine" aspect, though formalizing an exact determination is inherently difficult until the answer is known. + +## 4. Readability + +The code is generally readable. A few suggestions: + +- The docstring for `multicolorRamseyNumber` uses $\operatorname{Fin}$ notation which mixes LaTeX and Lean conventions. Consider using more standard math notation in the docstring (e.g., "$[N]$" or "$\{1, \ldots, N\}$") and reserving `Fin` for the Lean code itself. +- The `cycleGraph` adjacency condition `j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m` is correct but could benefit from a brief inline comment noting this encodes "vertices at distance 1 on the cycle." +- The proof obligation `(by omega)` for `m ≥ 3` in `cycleGraph (2 * n) (by omega)` is clean, though it relies on the fact that `n ≥ 2` implies `2 * n ≥ 3` (actually `2 * n ≥ 4 ≥ 3`), which is correct. + +## 5. Formalizability + +**Assessment: High formalizability with mild ambiguity.** + +The asymptotic bounds ($\ll$ notation) are inherently about eventual behavior and involve implicit constants. The formalization handles this well by existentially quantifying over a constant $C > 0$ and a threshold $K_0$, making the statement fully precise. This is the standard way to formalize asymptotic inequalities. + +The one source of ambiguity is the original problem statement: "Determine the value of $R_k(C_{2n})$." This is not a conjecture with a definite true/false answer but rather an open-ended research directive. The formalization correctly sidesteps this by formalizing the known bounds instead, which are precise mathematical statements. + +The Chung–Graham bound $R_k(C_4) \leq k^2 + k + 1$ is fully precise and cleanly formalized. + +## 6. Correctness + +**Mostly correct, with observations:** + +- **Lower bound (erdos_555):** The exponent $1 + 1/(2n)$ matches the literature. The existential form with $C > 0$ and $K_0$ is the correct way to express $R_k(C_{2n}) \gg k^{1+1/(2n)}$. **Correct.** + +- **Upper bound (erdos_555.variants.upper_bound):** The exponent $1 + 1/(n-1)$ matches the literature. Same existential structure. **Correct.** However, note that when $n = 2$, the exponent becomes $1 + 1/(2-1) = 2$, and for the cast `(n : ℝ) - 1` there is no issue since $n \geq 2$ ensures this is positive. The division `1 / ((n : ℝ) - 1)` is well-defined. **No issues.** + +- **Chung–Graham upper bound (chung_graham_upper):** States $R_k(C_4) \leq k^2 + k + 1$ for $k \geq 2$. This matches the literature. **Correct.** + +- **Category tags:** All three theorems are tagged `category research solved`. The website marks the overall problem as **OPEN** (determining the exact value of $R_k(C_{2n})$). However, the specific bounds being formalized *are* proven results, so tagging them as `solved` is defensible—they are known results, not open conjectures. This is a matter of convention: the bounds are solved, but the problem they contribute to is open. + +- **Potential edge case in `multicolorRamseyNumber`:** When `k = 0` (zero colors), the set being infimized is `{N | ∀ c : Fin N → Fin N → Fin 0, ...}`. Since `Fin 0` is empty, for `N ≥ 1` there are no colorings, so the condition is vacuously true, giving `sInf = 0` or `1` depending on whether `N = 0` admits a coloring. For `N = 0`, there are no colorings either (since `Fin 0 → Fin 0 → Fin 0` has exactly one function but `Fin 0` is empty). This edge case doesn't affect the theorems (which use `k ≥ 2`), but the definition could note this behavior. Similarly, when `k = 1`, the Ramsey number should equal `|V(G)|` for any graph G with at least one edge, which this definition handles correctly. + +**Overall: The formalization is mathematically correct and complete for the bounds it captures. The missing Chung–Graham lower bound is the only gap relative to the website's content.** diff --git a/ai-review/556.md b/ai-review/556.md new file mode 100644 index 0000000000..8e55b55312 --- /dev/null +++ b/ai-review/556.md @@ -0,0 +1,65 @@ +# AI Review: Erdős Problem 556 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `cycleGraph` and `multicolorRamseyNumber` in `Erdos556` are copy-pasted verbatim across many files. The identical `cycleGraph` definition appears in at least 15 files (555, 556, 569, 570, 572, 594, 666, 720, 737, 765, 86, 554, etc.), and `multicolorRamseyNumber` appears in at least 4 files (554, 555, 556, 557, 558). + +These should be factored into a shared utility file under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` — neither `cycleGraph` nor `multicolorRamseyNumber` currently exists there. The `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` file defines `hypergraphRamsey` (for uniform hypergraph Ramsey numbers with 2-coloring of r-subsets), which is a different concept from the graph Ramsey number `multicolorRamseyNumber` used here. + +Note: Problem 551 defines a slightly different `cycleGraph` (without the `i ≠ j` guard, instead proving irreflexivity from modular arithmetic). The version in 556 uses `i ≠ j ∧ (...)` while 551 uses just the disjunction. These are logically equivalent for `m ≥ 3`, but the implementations differ, which further motivates a single canonical definition. + +## 2. Citations + +The docstring references: +- `[Er81]` — Erdős, P., *On the combinatorial problems which I would most like to see solved* (1981). +- `[Er81c]` — Erdős, P., (1981). + +**Issues:** +- `[Er81c]` has no title. The website also provides `[Er81c]` without a full title, so this is consistent with the source, but it would be better to note that the full bibliographic details are unavailable. +- The website additionally mentions related results by Łuczak, Kohayakawa–Simonovits–Skokan, and Benevides–Skokan, none of which are cited in the docstring. While these are not original source citations, they document the resolution of the conjecture and would add value. +- The background text "A problem of Bondy and Erdős" matches the website. + +## 3. Variants + +**The formalization is incomplete with respect to variants.** + +The website lists this problem as **"DECIDABLE (Resolved up to a finite check)"** and provides the following resolution information: + +1. **Odd case (proved for large n):** Kohayakawa, Simonovits, and Skokan proved $R_3(C_n) \leq 4n - 3$ when $n$ is sufficiently large and odd. +2. **Even case (exact value):** Benevides and Skokan proved $R_3(C_n) = 2n$ for sufficiently large even $n$. +3. **Łuczak's asymptotic result:** $R_3(C_n) \leq (4 + o(1))n$ for all $n$, and $R_3(C_n) \leq 3n + o(n)$ for even $n$. + +The formalization only captures the single upper bound $R_3(C_n) \leq 4n - 3$ for all $n \geq 3$. Useful variants would include: +- The even-cycle exact value $R_3(C_{2n}) = 2n$ (for large $n$). +- Tightness: for odd $n$, equality $R_3(C_n) = 4n - 3$ (stated in the docstring as "best possible for odd $n$" but not formalized). +- The asymptotic bounds of Łuczak. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring says "This inequality is best possible for odd $n$" but this sharpness is not formalized as a separate statement (e.g., a matching lower bound theorem). Adding a comment or separate theorem for the lower bound would improve clarity. +- The `multicolorRamseyNumber` definition's docstring is well-written and clearly explains the meaning of the parameters. +- The namespace `Erdos556` is appropriately scoped. + +## 5. Formalizability + +**The problem is unambiguously formalizable.** The statement "$R_3(C_n) \leq 4n - 3$" is a precise, quantitative inequality about a well-defined combinatorial quantity. There is no ambiguity in: +- The definition of $R_3(G)$ (3-color Ramsey number for graphs). +- The cycle graph $C_n$. +- The bound $4n - 3$. + +**Assessment: No ambiguity.** This is one of the cleanest possible formalization targets — a concrete inequality about a concrete combinatorial invariant. + +## 6. Correctness + +**The formalization is mathematically correct but has a subtlety worth noting.** + +- **The statement is correct:** For all $n \geq 3$, the conjecture $R_3(C_n) \leq 4n - 3$ is a valid (and now resolved) mathematical statement. +- **The `cycleGraph` definition is correct:** It correctly defines $C_m$ as the graph on $\text{Fin}\;m$ where $i \sim j$ iff $i \neq j$ and $j \equiv i+1 \pmod{m}$ or $i \equiv j+1 \pmod{m}$. The symmetry and irreflexivity proofs are correct. +- **The `multicolorRamseyNumber` definition is correct:** It correctly captures the $k$-color Ramsey number via `sInf` over natural numbers $N$ such that every symmetric $k$-coloring of pairs from $\text{Fin}\;N$ contains a monochromatic copy (injective homomorphism) of $G$. +- **Edge case for `sInf`:** If the set is empty (i.e., no finite $N$ suffices), then `sInf ∅ = 0` in `ℕ`, which would make the inequality trivially true (since `0 ≤ 4n - 3` for `n ≥ 3`). However, Ramsey's theorem guarantees the set is nonempty for finite graphs and finite $k$, so this is not a real issue — just a definitional subtlety. +- **Natural number subtraction:** The bound `4 * n - 3` uses natural number subtraction. Since `n ≥ 3`, we have `4 * n ≥ 12 > 3`, so no underflow occurs. This is correct. +- **The `category` tag says `solved`**, which is consistent with the website's "DECIDABLE" status and the known proofs for both the odd and even cases (at least for sufficiently large $n$). However, the full conjecture for *all* $n \geq 3$ (not just sufficiently large $n$) may require finite verification. The `solved` tag is reasonable given the state of the art. + +**No mathematical flaws identified.** The formalization faithfully captures the intended conjecture. diff --git a/ai-review/557.md b/ai-review/557.md new file mode 100644 index 0000000000..e0c3e688ef --- /dev/null +++ b/ai-review/557.md @@ -0,0 +1,63 @@ +# AI Review: Erdős Problem 557 + +## 1. Code Reuse + +The `multicolorRamseyNumber` definition is **duplicated verbatim** across at least 5 files: `554.lean`, `555.lean`, `556.lean`, `557.lean`, and `558.lean`. This definition should be extracted to a shared ForMathlib file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/MulticolorRamsey.lean`) and imported by all consumers. + +Note that `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` already defines `Combinatorics.hypergraphRamsey` (for uniform hypergraph Ramsey numbers with 2 colors), and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` defines `SimpleGraph.sizeRamsey`. The multicolor graph Ramsey number is a natural companion to these and belongs alongside them. + +Similarly, Problem 547 and 548 each define their own `ContainsSubgraphCopy`, which is essentially the "monochromatic copy" concept used inside `multicolorRamseyNumber`. Unifying these would improve consistency. + +## 2. Citations + +The formalization references: + +> [ErGr75] Erdős, P. and Graham, R., _On partition theorems for finite graphs_. Infinite and finite sets (Colloq., Keszthely, 1973; dedicated to P. Erdős on his 60th birthday), Vol. I; Colloq. Math. Soc. János Bolyai, Vol. 10, North-Holland, Amsterdam, 1975, pp. 515–527. + +The website attributes the problem to Erdős and Graham, referenced as [ErGr75, p. 516]. The citation in the formalization is consistent with what appears on the website, with appropriate bibliographic detail. The page number (p. 516) could optionally be included in the docstring to match the website's specificity, but this is minor. + +## 3. Variants + +The website lists no additional variants beyond the main conjecture. It notes: + +- The bound would be **optimal**, as $R_k(S_n) \geq kn - O(k)$ for the star $S_n = K_{1,n-1}$. +- This problem is **implied by Problem 548** (the Erdős–Sós conjecture). + +Neither of these requires a separate formalized variant — the optimality remark is a known lower bound (not a conjecture), and the implication from Problem 548 is a relationship between problems rather than a variant. **No variants are missing.** + +## 4. Readability + +The code is clean and readable. The docstring on `multicolorRamseyNumber` clearly explains the mathematical meaning of the definition, including what constitutes a $k$-colouring and a monochromatic copy. The theorem statement `erdos_557` is concise and well-structured. + +Minor suggestions: +- The module docstring could mention the relationship to Problem 548 (Erdős–Sós conjecture) and the optimality of the bound for stars, as noted on the website. +- The page number `[ErGr75, p. 516]` could be added to match the website citation. + +## 5. Formalizability + +The problem is **highly formalizable**. It asks a precise yes/no question: does there exist an absolute constant $C$ such that $R_k(T) \leq kn + C$ for all $k \geq 1$, all $n \geq 1$, and all trees $T$ on $n$ vertices? There is no ambiguity in the statement — the multicolor Ramsey number $R_k(T)$ is a well-defined quantity, trees are well-defined, and the bound $kn + C$ is a concrete arithmetic expression. + +The use of `answer(sorry)` wrapping is appropriate for an open problem whose truth value is unknown. + +**Ambiguity assessment: None.** The statement is completely precise. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +**Definition of `multicolorRamseyNumber`:** Takes the infimum over all $N$ such that every symmetric $k$-coloring of pairs from $\text{Fin}(N)$ yields a monochromatic injective copy of $G$. This correctly captures $R_k(G)$. + +- The coloring `c : Fin N → Fin N → Fin k` assigns colors to all ordered pairs, including the diagonal $(i, i)$. This is harmless: since trees (and all simple graphs) satisfy `G.loopless`, the adjacency predicate `G.Adj u v` implies `u ≠ v`, so diagonal values are never queried. The symmetry constraint `∀ i j, c i j = c j i` correctly models edge coloring of the complete graph. +- Using `sInf` on `ℕ` means `sInf ∅ = 0`. However, for any finite graph $G$ and $k \geq 1$, the classical Ramsey theorem guarantees the defining set is nonempty, so this is not an issue. (The formalization need not prove this separately since the conjecture would be trivially true in that degenerate case anyway.) + +**Theorem statement:** +- `∃ C : ℕ` — The constant is a natural number. This is appropriate: the conjecture asserts $R_k(T) \leq kn + C$ with $C$ an absolute constant, and since both sides are natural numbers and $kn \geq 1$ already, restricting $C$ to $\mathbb{N}$ is without loss of generality (if the optimal $C$ were negative, the bound $kn$ would suffice). +- The quantifier order `∀ (n : ℕ) (hn : n ≥ 1) (T : SimpleGraph (Fin n)), T.IsTree → ∀ k : ℕ, k ≥ 1 →` correctly universally quantifies over all trees and all numbers of colors, with $C$ preceding (and thus independent of) all of them. This matches the "absolute constant" requirement. +- `T.IsTree` uses Mathlib's `SimpleGraph.IsTree`, which requires connected and acyclic — the standard definition. +- The bound `k * n + C` correctly represents $kn + C$. + +**Edge cases:** +- $n = 1$: A tree on 1 vertex has no edges. $R_k(T) = 1$ trivially (any single vertex gives a monochromatic copy). The bound gives $k + C \geq 1$, which holds for $k \geq 1$ and $C \geq 0$. +- $k = 1$: $R_1(T) = n$ for any tree $T$ on $n$ vertices (a single color always gives a monochromatic copy, and you need at least $n$ vertices for an injective map). The bound gives $n + C \geq n$, which holds. + +**Verdict: Correct and complete.** No mathematical flaws identified. diff --git a/ai-review/558.md b/ai-review/558.md new file mode 100644 index 0000000000..56ccf63c9f --- /dev/null +++ b/ai-review/558.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 558 + +## 1. Code Reuse + +**Duplicate definition found.** The `multicolorRamseyNumber` definition at lines 44–49 of `558.lean` is identical to the one in `FormalConjectures/ErdosProblems/555.lean` (lines 52–57). Both are scoped inside separate namespaces (`Erdos558` and `Erdos555`), so they do not conflict, but this is a clear candidate for extraction into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Ramsey.lean` or a shared definitions file). + +The existing `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` (the 2-color uniform hypergraph Ramsey number), which is a different concept. The existing `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` defines the size Ramsey number, also different. Neither is directly reusable for this problem. + +**Recommendation:** Extract `multicolorRamseyNumber` into a shared location and import it in both 555.lean and 558.lean. Problem 560 also defines its own `sizeRamseyNumber` in a similar pattern—there may be an opportunity to consolidate all Ramsey-type definitions. + +## 2. Citations + +The formalization references: +- **[ChGr75]** Chung, F.R.K. and Graham, R.L., *On multicolor Ramsey numbers for complete bipartite graphs*, J. Combin. Theory Ser. B 18 (1975), 164–169. +- **[ARS99]** Alon, N., Rónyai, L. and Szabó, T., *Norm-graphs: variations and applications*, J. Combin. Theory Ser. B 76 (1999), 280–290. + +The website at [erdosproblems.com/558](https://www.erdosproblems.com/558) lists the same two references (Chung & Graham 1975, Alon–Rónyai–Szabó 1999). The citations in the formalization match the website and include full journal details, which is good. + +**No issues found with citations.** + +## 3. Variants + +The formalization captures three variants beyond the main open problem: + +| Variant | Formalized? | Source | +|---------|-------------|--------| +| General problem: determine R_k(K_{s,t}) | ✅ `erdos_558` | Main problem | +| R_k(K_{2,2}) = (1+o(1))k² | ✅ `erdos_558.variants.K22` | [ChGr75] | +| R_k(K_{3,3}) = (1+o(1))k³ | ✅ `erdos_558.variants.K33` | [ARS99] | +| s ≥ (t-1)!+1 ⟹ R_k(K_{s,t}) ≍ k^t | ✅ `erdos_558.variants.ars` | [ARS99] | +| Explicit Chung–Graham bounds (general s,t) | ❌ Not formalized | [ChGr75] | + +**Missing variant:** The website gives explicit Chung–Graham (1975) bounds for general s, t: +- Lower bound: $(2\pi\sqrt{st})^{1/(s+t)} \cdot (s+t)/e^2 \cdot k^{(st-1)/(s+t-1)}$ +- Upper bound: $(t-1)(k + k^{1/s})^s$ + +These explicit bounds are not formalized. While the asymptotic results are arguably more important, these explicit bounds are the primary general result cited on the website and would complete the picture. + +## 4. Readability + +The code is generally well-structured and readable: + +- The namespace `Erdos558` cleanly scopes the local definition. +- The docstrings are clear and include LaTeX-formatted mathematical statements. +- The variant naming convention (`erdos_558.variants.K22`, `.K33`, `.ars`) is intuitive and hierarchical. +- The `multicolorRamseyNumber` definition has a clear docstring explaining the encoding. + +**Minor suggestions:** +- The docstring for `multicolorRamseyNumber` could note that diagonal entries `c i i` are irrelevant (since `G.Adj` is irreflexive), which is a subtlety a reader might wonder about. +- The main theorem `erdos_558` uses `answer((sorry : ℕ → ℕ → ℕ → ℕ) s t k)` which is the standard pattern for open "determine" problems, but a brief comment explaining this convention might help new readers. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with inherent ambiguity in the main problem.** + +The main problem statement "Determine R_k(K_{s,t})" is inherently ambiguous—it asks for an exact formula or characterization, which is hard to formalize precisely. The formalization handles this reasonably by encoding it as equality with an unknown function `sorry : ℕ → ℕ → ℕ → ℕ`, wrapped in `answer(...)`. This is a pragmatic choice for an open problem where the answer is not yet known. + +The variant statements are all precise and unambiguously formalizable: +- The asymptotic statements (K22, K33) use the standard ε-δ formulation of (1+o(1)). +- The Θ-type bound (ars) uses existential constants C₁, C₂ > 0 with a threshold K₀. + +**Ambiguity level: Low for variants, moderate for the main problem** (inherent to "determine"-type problems). + +## 6. Correctness + +### Definition of `multicolorRamseyNumber` + +The definition correctly captures the standard multicolor Ramsey number: +- **Coloring model:** A symmetric function `c : Fin N → Fin N → Fin k` with the explicit symmetry condition `∀ i j, c i j = c j i`. This correctly models a k-coloring of edges of K_N. +- **Monochromatic copy:** An injective map `f : V → Fin N` such that all edges of G map to edges of the same color. This is the standard definition. +- **Use of `sInf`:** Returns 0 if the set is empty (which cannot happen for finite graphs and k ≥ 1 by the finite Ramsey theorem). This is a sound convention. + +**Subtlety (correct but worth noting):** The coloring function assigns a color to `c i i` (the diagonal), but this is harmless since `G.Adj u v` implies `u ≠ v` for a `SimpleGraph`, so diagonal colors are never inspected in the monochromatic copy condition. + +**Edge case analysis:** +- **k = 0:** `Fin 0` is empty, so for N ≥ 1 no coloring `c : Fin N → Fin N → Fin 0` exists, making the universal statement vacuously true. For N = 0, we need `∃ a : Fin 0, ...` which is false. So `sInf` returns 1. This is mathematically reasonable (with 0 colors, no edges can be colored, so any single vertex trivially satisfies the condition vacuously). +- **k = 1:** The only color is `0 : Fin 1`, so the condition reduces to the existence of an injective map from V to Fin N, i.e., N ≥ |V|. So R_1(G) = |V|, which is correct. + +### Main Theorem (`erdos_558`) + +The constraints `s ≥ 1` and `t ≥ 1` are appropriate—K_{0,t} is edgeless, making the Ramsey number degenerate. The formalization correctly parameterizes over all k (including k = 0, 1, though these are trivial cases). + +### Variant K22 + +Correctly formalizes R_k(K_{2,2}) = (1+o(1))k² using the standard epsilon formulation. The bounds `(1-ε)k² ≤ R_k(K_{2,2}) ≤ (1+ε)k²` for all sufficiently large k are mathematically equivalent to the asymptotic statement. ✅ + +### Variant K33 + +Same structure as K22, correctly formalizes R_k(K_{3,3}) = (1+o(1))k³. ✅ + +### Variant ARS + +The condition `s ≥ Nat.factorial (t - 1) + 1` correctly encodes s ≥ (t-1)! + 1. Note that when t = 1, `Nat.factorial (1 - 1) + 1 = 0! + 1 = 2`, so s ≥ 2 is required. However, K_{s,1} is a star graph, and its multicolor Ramsey number is known to be s(k-1)+1 by a simple pigeonhole argument—the ARS result gives R_k(K_{s,1}) = Θ(k), which is correct (linear in k, i.e., k^1 = k^t where t=1). + +**Potential issue with Nat subtraction:** `t - 1` in Lean's `ℕ` is truncated subtraction. When `t = 0`, we get `Nat.factorial 0 + 1 = 2`, so `s ≥ 2`. But the hypothesis `ht : t ≥ 1` ensures t ≥ 1, so the case t = 0 never arises. The hypotheses `hs` and `ht` correctly guard against degenerate cases. ✅ + +**Overall correctness assessment: Sound.** No mathematical errors found. The formalization faithfully represents the known results for Erdős Problem 558. + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | ⚠️ Duplicate `multicolorRamseyNumber` definition (also in 555.lean); should be extracted | +| Citations | ✅ Complete and match the website | +| Variants | ⚠️ Three key variants captured; explicit Chung–Graham general bounds missing | +| Readability | ✅ Clean, well-documented code | +| Formalizability | ✅ Variants precise; main "determine" problem inherently open-ended | +| Correctness | ✅ Mathematically sound; edge cases handled correctly | diff --git a/ai-review/559.md b/ai-review/559.md new file mode 100644 index 0000000000..b5c298f141 --- /dev/null +++ b/ai-review/559.md @@ -0,0 +1,151 @@ +# Review: Erdős Problem 559 + +**File:** `FormalConjectures/ErdosProblems/559.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `sizeRamseyNumber` definition.** + +The file defines a local `Erdos559.sizeRamseyNumber` that is duplicated verbatim in at least three other files: +- `FormalConjectures/ErdosProblems/560.lean` (`Erdos560.sizeRamseyNumber`) +- `FormalConjectures/ErdosProblems/720.lean` (`Erdos720.sizeRamseyNumber`) +- Likely also in `566.lean` and `911.lean` + +All four copies define the same concept — the diagonal size Ramsey number R̂(G) — using the same `Bool`-valued coloring formulation. + +Moreover, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` already provides a shared definition: + +```lean +noncomputable def sizeRamsey {α β : Type*} [Fintype α] [Fintype β] + (G : SimpleGraph α) (H : SimpleGraph β) : ℕ := + sInf { m | ∃ (n : ℕ) (F : SimpleGraph (Fin n)), + F.edgeSet.ncard = m ∧ + ∀ (R : SimpleGraph (Fin n)), R ≤ F → + G.IsContained R ∨ H.IsContained (F \ R) } +``` + +This is the asymmetric version r̂(G, H). The diagonal case `sizeRamsey G G` is mathematically equivalent to the local `sizeRamseyNumber G`: the shared definition quantifies over subgraphs R ≤ F (partitioning edges into "red" R and "blue" F \ R), while the local definition uses a symmetric `Bool`-valued coloring function. These are equivalent representations of 2-edge-colorings. + +**Recommendation:** Replace all local `sizeRamseyNumber G` definitions with `SimpleGraph.sizeRamsey G G` from the shared library. This eliminates quadruplicate code and ensures consistency. The equivalence between the two formulations (subgraph-based vs. Bool-coloring) would need a small lemma, but it is straightforward. + +Minor technical difference: the shared definition uses `Set.ncard` while the local uses `Nat.card`. For finite graphs on `Fin N`, these are equal, so this is not a semantic issue. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/559](https://www.erdosproblems.com/559):** + +The website provides extensive context. The formalization cites only one reference: + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Rödl & Szemerédi 2000 | `[RoSz00]` — full citation provided | Yes | **OK.** Correct and complete citation. | +| Beck 1983 | Not cited | Yes (`[Be83b]`) — asked the original question, proved linear bound for paths | **Missing.** Beck originally posed this problem. The website says "Beck asked this question" in [Be83b]. The formalization's docstring attributes the conjecture generically without crediting Beck. | +| Tikhomirov 2022 | Not cited | Yes (`[Ti22b]`) — improved the lower bound to n·exp(c√(log n)) | **Missing.** This is a significant improvement to the Rödl–Szemerédi counterexample and is worth documenting. | + +**Additional references on the website not in the formalization:** +- Friedman & Pippenger [FrPi87] — proved linearity for trees +- Haxell, Kohayakawa & Luczak [HKL95] — proved linearity for cycles +- Javadi, Khoeini, Omidi & Pokrovskiy [JKOP19] — alternative proof for cycles +- Kohayakawa, Rödl, Schacht & Szemerédi [KRSS11] — upper bound n^{5/3+o(1)} for d=3 +- Conlon, Nenadov & Trujić [CNT22] — upper bound n^{8/5} for d=3 +- Draganić & Petrova [DrPe22] — best known upper bound n^{3/2+o(1)} for d=3 + +These are relevant for variants (see §3) but not essential for the main theorem's docstring. + +**Recommendation:** Add Beck [Be83b] as the originator of the question. Consider mentioning Tikhomirov's improved lower bound in the docstring. + +--- + +## 3. Variants + +The formalization captures only the main disproved conjecture. Several natural variants are missing: + +1. **Rödl–Szemerédi lower bound (explicit).** The counterexample gives R̂(G) ≫ n(log n)^c for some c > 0 and specific graphs G with max degree 3. This could be formalized as: + ``` + ∃ c > 0, ∀ n ≥ n₀, ∃ G : SimpleGraph (Fin n), + (∀ v, degree v ≤ 3) ∧ sizeRamseyNumber G ≥ n * (log n)^c + ``` + +2. **Tikhomirov's improved lower bound.** R̂(G) ≫ n·exp(c√(log n)) for d=3, which is strictly stronger than the Rödl–Szemerédi bound. + +3. **Best known upper bound (Draganić–Petrova).** For max degree 3 graphs on n vertices, R̂(G) ≤ n^{3/2+o(1)}. The gap between the lower bound n·exp(c√(log n)) and upper bound n^{3/2+o(1)} is the main remaining open question. + +4. **Positive cases.** The conjecture is true for restricted graph classes: + - Paths: R̂(P_n) ≤ C·n (Beck [Be83b]) — already formalized in Problem 720 + - Trees: R̂(T) ≤ C_d·n for trees T with max degree d (Friedman–Pippenger [FrPi87]) + - Cycles: R̂(C_n) ≤ C·n (Haxell–Kohayakawa–Luczak [HKL95]) — already formalized in Problem 720 + +The tree result (item 4b) is particularly natural as a variant since it affirms the conjecture for trees. + +**Recommendation:** At minimum, add the explicit Rödl–Szemerédi lower bound as a variant. The open question about the correct exponent for d=3 is also worth formalizing. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Docstrings:** Both the module-level and theorem-level docstrings are clear and informative. The mathematical notation ($\hat{R}(G)$, $\ll_d$) is well-explained. +- **Definition docstring:** The `sizeRamseyNumber` definition has a detailed docstring explaining the coloring model. This is good, though it would be unnecessary if the shared `sizeRamsey` were used instead. +- **Degree condition:** `∀ v, Nat.card (G.neighborSet v) ≤ d` is a reasonable encoding of "maximum degree ≤ d", though `G.degree v ≤ d` would be more idiomatic if `DecidableRel G.Adj` were available. Since the graph is on `Fin n`, decidability should be derivable, but the `Nat.card` formulation avoids needing the instance explicitly, which is a practical choice. +- **Namespace:** `Erdos559` is appropriate. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The original conjecture is precise: for every d ≥ 1, there exists C_d such that every graph G on n vertices with maximum degree ≤ d satisfies R̂(G) ≤ C_d · n. All constituent concepts (size Ramsey number, maximum degree, graph on n vertices) have standard, unambiguous definitions. + +The disproved status is also unambiguous: Rödl and Szemerédi explicitly constructed counterexample graphs. + +**Ambiguity level: None.** This is a cleanly formalizable statement with no room for interpretation issues. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `sizeRamseyNumber` + +The definition correctly formalizes R̂(G) as: +- Infimum over edge counts m +- Where there exists a host graph H on Fin N with m edges +- Such that every symmetric Bool-coloring of H's vertex pairs +- Yields a monochromatic copy of G (injective, adjacency-preserving, color-uniform) + +**Subtlety — coloring domain:** The coloring `c : Fin N → Fin N → Bool` is defined on all vertex pairs, not just edges. The symmetry constraint `∀ i j, c i j = c j i` is imposed, but there is no constraint on `c i i` (diagonal) or on `c i j` when `¬H.Adj i j` (non-edges). This is harmless: the monochromatic copy condition `∀ u v, G.Adj u v → c (f u) (f v) = b` only examines colors on actual edges of H (since `G.Adj u v → H.Adj (f u) (f v)` is required). Non-edge colors are irrelevant. + +**Subtlety — edge counting:** `Nat.card H.edgeSet` counts edges correctly for `SimpleGraph (Fin N)` since `Fin N` is finite, making `edgeSet` a finite set, so `Nat.card` agrees with cardinality. + +### Theorem: `erdos_559` + +```lean +theorem erdos_559 : + answer(False) ↔ (∀ d : ℕ, d ≥ 1 → + ∃ C : ℕ, ∀ n : ℕ, n ≥ 1 → + ∀ G : SimpleGraph (Fin n), + (∀ v, Nat.card (G.neighborSet v) ≤ d) → + sizeRamseyNumber G ≤ C * n) +``` + +- **`answer(False) ↔ P`:** This expands to `False ↔ P`, which is equivalent to `¬P`. So the theorem asserts the conjecture is false, matching the "disproved" status. ✓ +- **Quantifier structure:** "For all d ≥ 1, there exists C such that for all n ≥ 1 and all graphs G on n vertices with max degree ≤ d, R̂(G) ≤ C·n." This exactly matches the standard statement. ✓ +- **C : ℕ vs C : ℝ:** The constant C is a natural number. Since `sizeRamseyNumber G` and `n` are both natural numbers, and the inequality is `≤`, using ℕ for C is fine — if a real constant c works, then ⌈c⌉ also works. ✓ +- **d ≥ 1 guard:** Appropriate. For d = 0, the only graph is the empty graph (no edges), for which R̂(G) = 0 trivially. The conjecture is vacuously true for d = 0, so restricting to d ≥ 1 is mathematically correct (and matches the standard formulation). ✓ +- **n ≥ 1 guard:** Avoids the degenerate case of `Fin 0` (empty graph). For n = 0, `SimpleGraph (Fin 0)` has no vertices, so `sizeRamseyNumber G = 0 ≤ C * 0` is trivially true. The guard is not strictly necessary but is harmless. ✓ +- **Max degree encoding:** `∀ v, Nat.card (G.neighborSet v) ≤ d` correctly states that every vertex has degree at most d. ✓ + +### Potential concern: empty infimum + +If the set `{m | ...}` in `sizeRamseyNumber` is empty (i.e., no finite graph is Ramsey for G), then `sInf ∅ = 0` in ℕ. This would make `sizeRamseyNumber G = 0`, which could be vacuously ≤ C * n. However, for any finite graph G, the complete graph on sufficiently many vertices is Ramsey for G (by the finite Ramsey theorem), so the set is always nonempty for finite G. Thus this edge case does not arise in practice. + +**Verdict: Correct and complete for the main statement.** The formalization faithfully captures the disproved conjecture. The primary deficiency is the lack of variants (explicit lower bounds, the open question about the correct growth rate for d = 3) and the duplicated `sizeRamseyNumber` definition. diff --git a/ai-review/560.md b/ai-review/560.md new file mode 100644 index 0000000000..1e2e9aba4b --- /dev/null +++ b/ai-review/560.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 560 + +## 1. Code Reuse + +**Issue found.** There is an existing `SimpleGraph.sizeRamsey` definition in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` (lines 41–46) that defines the off-diagonal size Ramsey number r̂(G, H). The diagonal size Ramsey number r̂(G) used in Problem 560 is simply `sizeRamsey G G`. The local `sizeRamseyNumber` definition in 560.lean (lines 65–74) is a bespoke re-implementation that duplicates this concept. + +Furthermore, the identical `sizeRamseyNumber` definition is copy-pasted in `FormalConjectures/ErdosProblems/559.lean` (lines 50–59). Both should ideally be consolidated. + +The two implementations differ in encoding: +- **ForMathlib version**: Uses a subgraph `R ≤ F` to represent the "red" edges, with "blue" being `F \ R`. Uses `IsContained` and `ncard`. +- **Local version**: Uses a symmetric boolean function `c : Fin N → Fin N → Bool` as the coloring. Uses `Nat.card` and manually encodes the monochromatic-copy condition. + +These are mathematically equivalent, but the ForMathlib version is more idiomatic and leverages Mathlib's `IsContained` API. Consider replacing the local definition with `SimpleGraph.sizeRamsey G G` to reduce duplication and improve maintainability. + +## 2. Citations + +The citations in the docstring are accurate and complete relative to the website. + +| Reference | Website | Docstring | Match? | +|-----------|---------|-----------|--------| +| ErRo93 (lower bound) | Erdős & Rousseau | Erdős, P. and Rousseau, C.C., *The size Ramsey number of a complete bipartite graph*, Discrete Mathematics, 1993 | Yes | +| EFRS78b (upper bound) | Erdős, Faudree, Rousseau & Schelp | Erdős, P., Faudree, R.J., Rousseau, C.C., and Schelp, R.H., *The size Ramsey number*, Periodica Mathematica Hungarica, 1978 | Yes | +| NeRo78 (upper bound) | Nešetřil & Rödl | Nešetřil, J. and Rödl, V., *The Ramsey property for graphs with forbidden complete subgraphs*, Journal of Combinatorial Theory, Series B, 1978 | Yes | +| CFW23 (conjecture) | Conlon, Fox & Wigderson | Conlon, D., Fox, J., and Wigderson, Y., *Ramsey numbers of books and quasirandomness*, Combinatorica, 2023 | Yes | + +All four references match. No missing citations. + +## 3. Variants + +The formalization captures three statements: +1. **Lower bound** (ErRo93): R̂(K_{n,n}) > (1/60) n² 2ⁿ for n ≥ 6 +2. **Upper bound** (EFRS78b, NeRo78): R̂(K_{n,n}) < (3/2) n³ 2ⁿ for n ≥ 1 +3. **Asymptotic conjecture** (CFW23): R̂(K_{n,n}) ≍ n³ 2ⁿ + +**Missing variant:** The website mentions a more general result from CFW23 for the rectangular case K_{s,t}: +- General lower bound: R̂(K_{s,t}) ≫ s^{2−s/t} · t · 2^s +- When t ≫ s log s: R̂(K_{s,t}) ≍ s² · t · 2^s +- CFW23 conjecture that this asymptotic holds for all s ≤ t (which specializes to n³ · 2ⁿ when s = t = n) + +These general K_{s,t} results could be considered additional variants, though they go beyond the scope of Problem 560 as stated (which specifically asks about K_{n,n}). Their omission is reasonable. + +## 4. Readability + +The code is well-structured and readable. The docstrings clearly explain the mathematical content. A few minor notes: + +- The `sizeRamseyNumber` definition's docstring is clear about the encoding choice (symmetric boolean function for 2-coloring). +- The three theorems are logically ordered: lower bound, upper bound, then the open conjecture. +- The `n ≥ 6` and `n ≥ 1` conditions are explicitly stated in both the docstrings and the theorem statements. + +No significant readability issues. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original problem statement "Determine R̂(K_{n,n})" is inherently imprecise — it asks to find the exact asymptotic behavior rather than prove a specific bound. However, the formalization correctly interprets this as: + +- The known bounds (which are precise, proven results), and +- The CFW23 conjecture on the exact asymptotic order (R̂(K_{n,n}) ≍ n³ 2ⁿ) + +The Θ-notation (≍) is correctly encoded as the existence of constants C₁, C₂ > 0 and a threshold N₀ such that C₁ n³ 2ⁿ ≤ R̂(K_{n,n}) ≤ C₂ n³ 2ⁿ for all n ≥ N₀. This is the standard formalization of asymptotic equivalence and is unambiguous. + +The size Ramsey number itself has a standard definition in the literature and is precisely formalizable. + +## 6. Correctness + +**Overall: Correct, with one definitional concern.** + +### Definition of `sizeRamseyNumber` + +The definition correctly captures the size Ramsey number. The key components are: +- Quantification over all graph sizes N and all graphs H on Fin N +- Edge count via `Nat.card H.edgeSet` +- Universal quantification over symmetric boolean colorings +- Existence of a monochromatic copy: injective map preserving adjacency in H with all edges receiving the same color + +**Subtle point:** The coloring function `c : Fin N → Fin N → Bool` is defined on all vertex pairs, not just edges of H. This is harmless: since the monochromatic-copy condition requires `H.Adj (f u) (f v)` for all edges of G, the color values on non-edges of H are never relevant. The quantifier "∀ c symmetric" is technically stronger than "∀ edge-colorings of H" but produces an equivalent definition. + +### Lower bound (lines 82–86) + +`∀ n ≥ 6, R̂(K_{n,n}) > (1/60) n² 2ⁿ` + +Matches the website and ErRo93. The n ≥ 6 condition is correctly included. **Correct.** + +### Upper bound (lines 93–98) + +`∀ n ≥ 1, R̂(K_{n,n}) < (3/2) n³ 2ⁿ` + +The n ≥ 1 condition is necessary: for n = 0, K_{0,0} has no edges so R̂(K_{0,0}) = 0 (any graph with 0 edges trivially contains a monochromatic copy of the empty graph), and (3/2)(0)³ 2⁰ = 0, so strict inequality would fail. The website does not explicitly state a lower bound on n for the upper bound, but n ≥ 1 is mathematically necessary for the strict inequality. **Correct.** + +### Asymptotic conjecture (lines 107–115) + +`∃ C₁ > 0, C₂ > 0, N₀, ∀ n ≥ N₀, C₁ n³ 2ⁿ ≤ R̂(K_{n,n}) ≤ C₂ n³ 2ⁿ` + +This correctly formalizes R̂(K_{n,n}) ≍ n³ 2ⁿ. Note that the upper bound direction is already known (take C₂ = 3/2), so the essential content of the conjecture is the lower bound C₁ n³ 2ⁿ ≤ R̂(K_{n,n}), which would improve the known n² 2ⁿ lower bound to n³ 2ⁿ. **Correct.** + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `SimpleGraph.sizeRamsey G G` from ForMathlib; duplicated with 559.lean | +| Citations | Complete and accurate | +| Variants | All primary variants captured; general K_{s,t} omitted (acceptable) | +| Readability | Good | +| Formalizability | High; low ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/561.md b/ai-review/561.md new file mode 100644 index 0000000000..b8fce186eb --- /dev/null +++ b/ai-review/561.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 561 + +## 1. Code Reuse + +**Several opportunities for reuse exist but are not leveraged.** + +- **`SimpleGraph.sizeRamsey`** in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean:41-46` defines the two-color size Ramsey number using a subgraph decomposition (`R ≤ F` for red, `F \ R` for blue) and `IsContained`. Problem 561 instead defines its own `twoColorSizeRamseyNumber` (lines 50–59) using an explicit `c : Fin n → Fin n → Bool` coloring function. These are mathematically equivalent, and the library definition should be preferred. The library version also benefits from using Mathlib's `SimpleGraph.IsContained` rather than inlining the injective-embedding condition. + +- **`Erdos552.starGraph`** in `FormalConjectures/ErdosProblems/552.lean:64-68` defines a single star graph `K_{1,n}` on `Fin (n + 1)`. Problem 561 defines `disjointUnionStars` from scratch using sigma types. While the disjoint union construction is different from a single star, the adjacency pattern used in `disjointUnionStars` (center at index 0, leaves at nonzero indices within each component) mirrors `starGraph` exactly. One could consider constructing `disjointUnionStars` compositionally from `starGraph` via a sigma-type disjoint union combinator, though the current direct definition is also reasonable. + +- **`Erdos560.sizeRamseyNumber`** in `FormalConjectures/ErdosProblems/560.lean:65-74` defines a single-graph size Ramsey number using the same Bool-coloring approach as 561. This is yet another duplicate. There are now three independent definitions of essentially the same concept across the codebase (library `sizeRamsey`, Erdos560's `sizeRamseyNumber`, and Erdos561's `twoColorSizeRamseyNumber`). + +- **Minor**: Problem 561 uses `H.edgeSet.ncard` while Problem 560 uses `Nat.card H.edgeSet`. These should be equal for finite edge sets but the inconsistency is worth unifying. + +**Recommendation**: Replace `twoColorSizeRamseyNumber` with the library's `SimpleGraph.sizeRamsey`, or at minimum prove they are equal and add a comment explaining the relationship. + +## 2. Citations + +**The formalization is missing two important references documented on the website.** + +The website (erdosproblems.com/561) lists three references: + +1. **[BEFRS78]** Burr, Erdős, Faudree, Rousseau, and Schelp — cited in the formalization as proving the result. However, the website clarifies that [BEFRS78] only proved the case "when all the $n_i$ are identical and all the $m_i$ are identical," not the general conjecture. The formalization's docstring does not note this limitation. + +2. **[GySc02]** Győri and Schelp — proved the result under the condition $\binom{\ell_k}{2} > \sum_{k \le i \le s+t} \ell_i$ for all $2 \le k \le s+t$. **Not cited in the formalization.** + +3. **[DJKR25]** Davoodi, Javadi, Kamranian, and Raeisi — proved additional special cases including $s = 1$, $s = 2$ with $n_1 = n_2$, and various parity conditions. **Not cited in the formalization.** + +Also, the full title of [BEFRS78] on the website is associated with *Ramsey numbers for the pair sparse graph–path or cycle*, Trans. Amer. Math. Soc. The formalization includes this citation, which matches. + +**Recommendation**: Add citations for [GySc02] and [DJKR25]. Clarify that [BEFRS78] only established the special case, not the general conjecture. + +## 3. Variants + +**Partial results documented on the website are not captured as separate variant theorems.** + +The website describes three levels of partial progress: +- [BEFRS78]: all $n_i$ identical and all $m_j$ identical +- [GySc02]: under a binomial coefficient condition on the $\ell_k$ +- [DJKR25]: $s = 1$; $s = 2$ with $n_1 = n_2$; various parity conditions + +These could be formalized as `erdos_561.variants.*` theorems with `@[category research solved]` tags, similar to the pattern used in Problem 560 (which has separate `lower_bound` and `upper_bound` variants). This would make the formalization more complete and informative. + +**Recommendation**: Add at least the [BEFRS78] special case as a variant, since it is the most cleanly statable: +``` +theorem erdos_561.variants.identical_stars (s t n_val m_val : ℕ) ... +``` + +## 4. Readability + +**Generally good, with a few suggestions.** + +- The `disjointUnionStars` definition is well-documented with a clear docstring explaining the vertex structure. The sigma-type encoding `(Σ i : Fin s, Fin (deg i + 1))` is natural for dependent disjoint unions. + +- The `lFun` name is somewhat opaque. A name like `maxStarPairSum` or `ellK` would better convey intent. + +- The main theorem statement at lines 79–90 is well-structured with clear hypotheses. The monotonicity conditions `hn_mono` and `hm_mono` correctly encode the non-increasing degree sequences. + +- The `twoColorSizeRamseyNumber` definition (lines 50–59) is long and could benefit from factoring out the "monochromatic copy" condition, especially if it were reusing library definitions. + +## 5. Formalizability + +**The problem is precisely stated and clearly formalizable. Low ambiguity.** + +The conjecture gives an exact formula for $\hat{R}(F_1, F_2)$ in terms of the degree sequences. All objects (stars, disjoint unions, size Ramsey numbers, the $\ell_k$ function) have standard unambiguous definitions in combinatorics. + +The only potential source of ambiguity is the definition of the size Ramsey number itself: some authors define $\hat{R}(G_1, G_2)$ requiring that $H$ be a complete graph on some vertex set (the "classical" Ramsey setting), while others allow $H$ to be any graph. The formalization uses the latter (any graph $H$), which is the standard definition of the *size* Ramsey number (as opposed to the *vertex* Ramsey number). This is correct. + +**Assessment**: Unambiguous. The conjecture is a concrete equality with well-defined terms. + +## 6. Correctness + +**The formalization is mathematically correct, with one subtle point worth verifying.** + +### Indexing +The website uses 1-indexed sequences: $n_1, \ldots, n_s$ and $m_1, \ldots, m_t$, with $\ell_k = \max\{n_i + m_j - 1 : i + j = k\}$ for $2 \le k \le s + t$, giving $s + t - 1$ terms. + +The formalization uses 0-indexed `Fin s` and `Fin t`, with $\ell_k = \max\{n_i + m_j - 1 : i + j = k\}$ for $0 \le k \le s + t - 2$, summed via `Finset.range (s + t - 1)`. This is the correct re-indexing: setting $i' = i - 1$, $j' = j - 1$, $k' = k - 2$ maps the 1-indexed sum to the 0-indexed sum bijectively. **Correct.** + +### Natural number subtraction in `lFun` +The expression `n p.1 + m p.2 - 1` uses natural number subtraction. If `n p.1 + m p.2 = 0`, this would underflow to 0 instead of the intended $-1$. However, the theorem hypotheses `hn_pos` and `hm_pos` guarantee `n i ≥ 1` and `m j ≥ 1`, so `n p.1 + m p.2 ≥ 2`, making the subtraction safe. Note that `lFun` itself does not carry these hypotheses — it is a standalone definition that could produce incorrect results if called with zero-valued degree functions. This is acceptable since the hypotheses are present in the theorem statement. **Correct under the stated hypotheses.** + +### `Finset.sup` vs `Finset.sup'` +The `lFun` definition uses `Finset.sup` which returns `⊥ = 0` on an empty set (for `ℕ` with `Bot` instance). For $k$ outside the range $[0, s+t-2]$, the filter produces an empty set and `lFun` returns 0, which is harmless since those values of $k$ are not included in the sum. **Correct.** + +### `twoColorSizeRamseyNumber` correctness +The definition correctly encodes the two-color size Ramsey number: +- It minimizes over edge counts of host graphs $H$ +- For every symmetric coloring $c$, it requires either a red copy of $G_1$ or a blue copy of $G_2$ +- The symmetry condition `∀ i j, c i j = c j i` is correct +- The embedding conditions `Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) ∧ c (f u) (f v) = b` correctly encode a monochromatic subgraph copy + +One subtle point: the coloring function $c$ is defined on all pairs, not just edges. However, only edge values matter (since embeddings require `H.Adj (f u) (f v)`), so this is fine. **Correct.** + +### Monotonicity hypotheses +The hypotheses `hn_mono` and `hm_mono` encode *non-increasing* sequences, which matches the problem statement. The direction `i₁ ≤ i₂ → n i₂ ≤ n i₁` is correct (larger index → smaller or equal value). **Correct.** + +### Overall assessment +The formalization is **mathematically correct and complete** for the main conjecture as stated on the website. The primary gap is the absence of variant theorems for the known partial results and the missed opportunity to reuse the library's `sizeRamsey` definition. diff --git a/ai-review/563.md b/ai-review/563.md new file mode 100644 index 0000000000..9fbed1e8e5 --- /dev/null +++ b/ai-review/563.md @@ -0,0 +1,111 @@ +# Review: Erdős Problem 563 + +## 1. Code Reuse + +**Several opportunities identified:** + +- **`EdgeTwoColoring` structure (Problems 639, 76):** Problem 639 defines a reusable `EdgeTwoColoring` structure bundling a `Fin n → Fin n → Bool` colouring with a symmetry proof. Problem 563 currently inlines the symmetry condition `∀ i j, c i j = c j i` inside `fErdos563`. Adopting the `EdgeTwoColoring` structure (or a shared version) would improve consistency across problems 559, 560, 561, 563, and 639. + +- **Problem 161 (`fBalanced`, `IsBalancedColouring`):** Problem 161 is the direct hypergraph generalization of Problem 563. Its `fBalanced` and `IsBalancedColouring` definitions handle `t`-uniform hypergraphs. Problem 563 is the special case `t = 2`. In principle, `fErdos563 n α` should be equivalent to `Erdos161.fBalanced 2 n α` (up to strict vs. non-strict inequality — see Correctness below). However, Problem 161 colours `t`-element *subsets* (as `Finset (Fin n) → Bool`) rather than using a symmetric pair function, so the representations differ. Unifying these would require a bridging lemma, which may not be worth the complexity — but the relationship should at least be documented. + +- **`edgesOfColorInSubset`:** This function is unique to Problem 563. No other problem defines an identical edge-counting helper, though Problem 639's `edgesNotInMonoTriangleCount` uses a similar `p.1 < p.2` filtering pattern. The implementation is reasonable and self-contained. + +- **`hypergraphRamsey` (FormalConjecturesForMathlib):** The Ramsey number definition is conceptually related (α = 0 case) but structurally different enough that direct reuse is impractical. + +**Verdict:** Minor reuse opportunities exist (shared `EdgeTwoColoring` type), but the current self-contained approach is acceptable given the problem's specific quantitative structure. + +## 2. Citations + +**Website ([erdosproblems.com/563](https://www.erdosproblems.com/563)) states:** +> [Er90b] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and differences*. Mathematics of Ramsey theory, Algorithms Combin. 5 (1990), 12-28. + +**Formalization states:** +> [Er90b] Erdős, P., *Problems and results on graphs and hypergraphs: similarities and differences* (1990), p.21. + +**Assessment:** The citation is essentially correct. The formalization includes the page number (p.21), which matches the website's listing as originating from that page. The full journal information ("Mathematics of Ramsey theory, Algorithms Combin. 5, 12-28") is omitted in the formalization but the shorthand is adequate and consistent with other problems in the codebase. The website also notes this is listed as "#39 in Ramsey Theory" in the UCSD graph problem collection, which the formalization does not mention — this is fine to omit. + +**No missing citations.** The website lists no additional references beyond [Er90b]. + +## 3. Variants + +**Website mentions:** +1. The case α = 0 reduces to classical Ramsey numbers (asking for 2-colourings with no monochromatic clique of size m). +2. The probabilistic method gives F(n, α) ≍_α log n (matching asymptotic order but not the precise constant). +3. Problem 161 generalizes this to t-uniform hypergraphs. + +**Formalization captures:** Only the main conjecture (F(n, α) ~ c_α · log n). + +**Assessment:** The formalization correctly restricts to the core conjecture. The α = 0 / Ramsey connection is a remark rather than a variant. The F(n, α) ≍ log n result (known via the probabilistic method) could be stated as a separate solved theorem, since it is a known partial result. Problem 161 already exists as a separate formalization. No critical variants are missing. + +**Potential addition:** A solved variant stating `∃ C₁ C₂ > 0, ∀ᶠ n, C₁ * log n ≤ F(n,α) ≤ C₂ * log n` would capture the known asymptotic order. + +## 4. Readability + +**Strengths:** +- The module docstring clearly explains the problem with LaTeX notation. +- The helper `edgesOfColorInSubset` is well-documented and cleanly separates edge-counting from the main definition. +- The `fErdos563` docstring explains the mathematical meaning. + +**Suggestions:** +- The `edgesOfColorInSubset` docstring mentions "An edge {i, j} (with i < j) has colour c(i,j)" but the function does not require or enforce that `c` is symmetric. This is fine for the implementation (the caller enforces symmetry), but could be clarified. +- The filter condition `fun p => p.1 < p.2 ∧ c p.1 p.2 = color` is compact and correct. No issues. +- `open Finset Filter` and `open scoped Topology` are appropriate for the definitions and theorem used. + +**Overall readability: Good.** The code is concise and well-structured. + +## 5. Formalizability + +**Assessment: High formalizability with one subtlety.** + +The problem statement on the website is: +> F(n, α) ~ c_α · log n + +The asymptotic notation "~" means F(n,α) / log(n) → c_α as n → ∞. This is precise and unambiguous once F(n, α) is defined. + +The definition of F(n, α) itself — "the smallest m such that there exists a 2-colouring of K_n such that every m-subset contains more than α · C(m,2) edges of each colour" — is precise enough to formalize, though there is a subtlety about whether the threshold applies to subsets of size *exactly* m or *at least* m. The formalization uses "≥ m", which is the standard and correct interpretation (once the property holds for all sets of size ≥ m, it defines the threshold). + +**Ambiguity level: Low.** The only potential source of ambiguity is the strict inequality "> α · C(m,2)" vs. non-strict "≥ α · C(m,2)". The website uses "more than", which maps to strict inequality. The formalization correctly uses strict inequality (`>`). Note that Problem 161 uses non-strict inequality (`≤` on the other side, i.e., `α * ... ≤ count`), which is equivalent to `count ≥ α * ...`, a non-strict version. This is a minor inconsistency between the two related problems — see Correctness. + +## 6. Correctness + +**Definition of `edgesOfColorInSubset`:** Correct. It counts pairs `(i, j)` with `i < j` in `X ×ˢ X` where `c i j = color`. The `i < j` condition ensures each edge is counted exactly once. This equals the number of edges of the given colour in the induced subgraph on X. + +**Definition of `fErdos563`:** This uses `sInf` over the set of valid `m` values. The structure is: +``` +sInf {m : ℕ | ∃ c (symmetric), ∀ X with |X| ≥ m, ∀ color, edgeCount > α · C(|X|,2)} +``` + +**Potential issue — direction of the quantifier over colourings:** + +The website states: *"the smallest m such that there exists a 2-colouring of K_n where every subset X with |X| ≥ m contains more than α·C(|X|,2) edges of each colour."* + +The formalization uses `∃ c, ... ∀ X ...`, meaning: there *exists* a colouring such that every large subset is balanced. This matches the website. The idea is that F(n, α) measures how large subsets need to be before *some* colouring can guarantee balance everywhere — this is the correct "minimax" reading where we minimize over m and maximize (existentially) over colourings. + +**However**, this interpretation is somewhat unusual. Typically in Ramsey theory, one asks about colourings adversarially (∀ colourings). Let me re-read the website carefully: + +> "Let F(n,α) denote the smallest m such that there exists a 2-colouring of edges of K_n where every subset X ⊆ [n] with |X| ≥ m contains more than α·(|X| choose 2) edges of each colour." + +The formalization matches this literally: F(n,α) = inf{m | ∃ colouring c, ∀ X with |X|≥m, both colours are well-represented}. This is correct. The interpretation is: a "good" colouring is one that is so balanced that even in moderate subsets both colours appear substantially. F(n,α) asks: how large must subsets be before such a good colouring exists? + +**Strict vs. non-strict inequality:** The formalization uses `>` (strict), matching "more than" on the website. Problem 161 uses `≤` (i.e., `α * C(|X|,t) ≤ count`, non-strict). For the asymptotic conjecture, this distinction is immaterial (it can only affect F by ±1 at most), but it is a formal inconsistency between the two related problems. + +**`C(m,2)` computation:** The formalization computes `C(|X|,2)` as `|X| * (|X| - 1) / 2` using real arithmetic. This is correct: for natural number `k`, `C(k,2) = k(k-1)/2`. The use of real-valued expressions avoids natural number subtraction issues. + +**Theorem statement:** `Tendsto (fun n => F(n,α) / log n) atTop (nhds c)` for some `c > 0`. This correctly captures `F(n,α) ~ c_α · log n`. + +**Edge case:** When n = 0 or n = 1, `fErdos563` returns `sInf ∅ = 0` if no valid m exists, or `sInf` of some set. The theorem statement uses `atTop` so only the asymptotic behaviour matters, making edge cases irrelevant. + +**Verdict: Mathematically correct.** The formalization faithfully captures the conjecture as stated on the website. The only minor issue is the strict-vs-non-strict inconsistency with Problem 161, which does not affect correctness of this problem in isolation. + +--- + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code Reuse | Minor opportunities | Could share `EdgeTwoColoring`; relationship to Problem 161 could be documented | +| Citations | Correct | Matches website; full journal info omitted but acceptable | +| Variants | Adequate | Known F ≍ log n result could be added as solved variant | +| Readability | Good | Clean, well-documented code | +| Formalizability | High | Low ambiguity; strict/non-strict is the only subtlety | +| Correctness | Correct | Faithful formalization; minor inconsistency with Problem 161's inequality direction | diff --git a/ai-review/565.md b/ai-review/565.md new file mode 100644 index 0000000000..ff564f5f5f --- /dev/null +++ b/ai-review/565.md @@ -0,0 +1,123 @@ +# AI Review: Erdős Problem 565 + +## 1. Code Reuse + +The codebase contains several Ramsey-related definitions that are worth comparing: + +- **`graphRamseyNumber`** (ErdosProblems/87.lean): The classical graph Ramsey number using `ContainsSubgraph` (non-induced copy via injective homomorphism). Not suitable here because the induced Ramsey number requires a biconditional (preserving both edges *and* non-edges relative to a color class), not just edge-preservation. +- **`sizeRamsey`** (FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean): Minimizes the number of *edges* in the host graph (not vertex count), and uses `IsContained` for non-induced copies. Not applicable. +- **`hypergraphRamsey`** (FormalConjecturesForMathlib/Combinatorics/Ramsey.lean): The uniform hypergraph Ramsey number. A different concept entirely. +- **`inducedFinSubgraph`** and **`FinGraphIso`** (ErdosProblems/638.lean): Defines induced subgraphs along embeddings and graph isomorphism for `Fin m` graphs. These are related conceptually but serve a different structural role. + +**Verdict:** The `inducedRamseyNumber` definition is fundamentally distinct from all existing Ramsey definitions in the codebase because it uniquely requires the biconditional characterization of induced monochromatic copies. The local definition is appropriate. However, since `sizeRamsey` was promoted to `FormalConjecturesForMathlib`, one could argue `inducedRamseyNumber` deserves the same treatment if other problems reference it. + +## 2. Citations + +**Website (erdosproblems.com/565) lists:** +- Existence established independently by Deuber, Erdős–Hajnal–Pósa, and Rödl (1970s) +- Kohayakawa, Prömel, Rödl (1998): R*(G) < 2^{O(n(log n)²)} +- Fox and Sudakov (2008): alternative proof of the above +- Conlon, Fox, Sudakov (2012): R*(G) < 2^{O(n log n)} +- Aragão, Campos, Dahia, Filipe, Marciano (2025): R*(G) < 2^{O(n)} (the solution) + +**Formalization includes:** +- "A problem of Erdős and Rödl" +- "Proved by Aragão, Campos, Dahia, Filipe, and Marciano" + +**Missing:** The formalization omits the intermediate results (Kohayakawa–Prömel–Rödl, Fox–Sudakov, Conlon–Fox–Sudakov) and the foundational existence results (Deuber, Erdős–Hajnal–Pósa). While not strictly required, including a brief note about the progression of bounds would improve scholarly context. At minimum, the Deuber and Erdős–Hajnal–Pósa contributions to the existence of R*(G) should be acknowledged alongside Rödl. + +## 3. Variants + +The formalization captures only the final exponential bound R*(G) ≤ 2^{Cn}. The website documents a progression of increasingly tight bounds. Potential variants that could be formalized: + +- **Intermediate bounds** (historical): R*(G) ≤ 2^{O(n(log n)²)} or R*(G) ≤ 2^{O(n log n)}, which are weaker but were significant milestones. +- **Lower bounds**: The problem as stated on the website is only the upper bound. Are there known lower bounds on R*(G) for specific graph families? +- **Bipartite special case**: Rödl proved the 2^{O(n)} bound for bipartite graphs earlier; this could be a separate, potentially easier, lemma. + +**Verdict:** Only the main conjecture is formalized. This is acceptable since it is the definitive result, but the bipartite special case (proved much earlier by Rödl) would be a natural variant. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The docstring on `inducedRamseyNumber` clearly explains the mathematical meaning and spells out the biconditional condition. This is good. +- The namespace `Erdos565` keeps definitions scoped. +- The use of `sInf` is standard for "minimum m" definitions, consistent with other Ramsey number definitions in the codebase. +- The coloring is represented as `c : Fin m → Fin m → Bool` with a symmetry hypothesis `∀ i j, c i j = c j i`. This is a common pattern in the codebase (also used in Problem 638). An alternative would be to use `Sym2 (Fin m) → Bool`, which would enforce symmetry structurally, but the current approach is consistent with codebase conventions and is arguably more readable. + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem statement is precise and unambiguous: + +- "Let R*(G) be the induced Ramsey number" — well-defined concept. +- "the minimal m such that there is a graph H on m vertices such that any 2-colouring of the edges of H contains an induced monochromatic copy of G" — precise. +- "R*(G) ≤ 2^{Cn} for all graphs G on n vertices" — clear asymptotic claim. + +The only potential ambiguity in the original problem is the O(n) notation, which hides a universal constant. The formalization correctly resolves this by existentially quantifying over a constant C : ℕ. + +**Verdict:** Fully formalizable with no ambiguity. The formalization correctly resolves the big-O notation. + +## 6. Correctness + +This is the most critical section. I analyze the definition and theorem in detail. + +### Definition: `inducedRamseyNumber` + +```lean +noncomputable def inducedRamseyNumber {V : Type*} [Fintype V] + (G : SimpleGraph V) : ℕ := + sInf {m : ℕ | ∃ (H : SimpleGraph (Fin m)), + ∀ (c : Fin m → Fin m → Bool), + (∀ i j, c i j = c j i) → + ∃ (b : Bool) (f : V → Fin m), Function.Injective f ∧ + ∀ u v, u ≠ v → (G.Adj u v ↔ (H.Adj (f u) (f v) ∧ c (f u) (f v) = b))} +``` + +**Structure:** `sInf` of `{m | ∃ H, ∀ coloring c, ∃ color b, injection f, ...}`. This correctly captures: "the minimum m such that *some* graph H on m vertices forces every 2-coloring to contain an induced monochromatic copy of G." + +**The biconditional:** +`G.Adj u v ↔ (H.Adj (f u) (f v) ∧ c (f u) (f v) = b)` + +- **Forward direction (→):** If G has edge {u,v}, then H has edge {f(u),f(v)} colored b. Edges of G embed as edges of H in color b. Correct. +- **Backward direction (←):** If G does NOT have edge {u,v}, then ¬(H.Adj (f u) (f v) ∧ c (f u) (f v) = b), i.e., either {f(u),f(v)} is not an edge of H, or it is an edge of H but with color ¬b. This means: non-edges of G map to non-edges-of-color-b in the image. + +This correctly captures "G is isomorphic (as an induced subgraph) to the color-b subgraph of H restricted to the image of f." This is the standard meaning of "induced monochromatic copy." + +**Coloring domain:** The coloring `c` is defined on all pairs `Fin m → Fin m → Bool`, including non-edges of H and diagonal pairs. This is harmless because: +- Diagonal pairs (i, i) are never queried: the hypothesis `u ≠ v` combined with injectivity of f ensures f(u) ≠ f(v). +- Non-edge colors are irrelevant: they appear in the biconditional only in conjunction with `H.Adj`, which is false for non-edges, making the RHS false regardless of c. +- Quantifying over all symmetric `c` (including irrelevant non-edge colors) is therefore equivalent to quantifying over all 2-colorings of E(H). No overcounting or undercounting occurs. + +**`sInf` on potentially empty set:** If the set is empty, `sInf ∅ = 0` for ℕ. However, the induced Ramsey theorem guarantees the set is nonempty for every finite graph G, so this is not an issue for the theorem statement. The definition is still well-typed regardless. + +### Theorem: `erdos_565` + +```lean +theorem erdos_565 : + ∃ C : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + inducedRamseyNumber G ≤ 2 ^ (C * n) := by + sorry +``` + +**Fidelity to the problem:** The problem asks for R*(G) ≤ 2^{O(n)}. The formalization states ∃ C : ℕ, ∀ n, ∀ G on n vertices, R*(G) ≤ 2^{C·n}. This is a valid (and standard) way to express the 2^{O(n)} bound. + +**C : ℕ vs C : ℝ:** Using C : ℕ is slightly stronger than necessary (it excludes fractional constants). However, since for any real constant c > 0, we have 2^{cn} ≤ 2^{⌈c⌉·n}, the natural number version is equivalent to the real version for the purpose of an upper bound. This is correct. + +**Small cases:** +- n = 0: `Fin 0` is empty, so G is the empty graph. `inducedRamseyNumber G` should be 0 or 1 (an empty host graph trivially satisfies the condition vacuously, or a single-vertex graph works). `2^(C*0) = 1`. The inequality holds. +- n = 1: The only graph on `Fin 1` has no edges. R*(single vertex) = 1. `2^(C*1) ≥ 2 ≥ 1`. Fine. + +**Verdict: The formalization is mathematically correct.** The definition of `inducedRamseyNumber` faithfully captures the standard notion of induced Ramsey number, and the theorem statement correctly formalizes the exponential upper bound. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No existing definition is suitable; local definition is justified | +| Citations | Missing intermediate results and foundational existence references | +| Variants | Only the main result; bipartite special case could be added | +| Readability | Good; clean and consistent with codebase conventions | +| Formalizability | Fully formalizable; no ambiguity | +| Correctness | **Correct.** Definition and theorem are mathematically sound | diff --git a/ai-review/568.md b/ai-review/568.md new file mode 100644 index 0000000000..865735cded --- /dev/null +++ b/ai-review/568.md @@ -0,0 +1,75 @@ +# Erdos Problem 568 — AI Review + +## 1. Code Reuse + +**Significant reuse opportunities exist.** + +- **`Embeds` vs `SimpleGraph.IsContained`**: The file defines its own `Embeds` (injective adjacency-preserving map), which is essentially equivalent to Mathlib's `SimpleGraph.IsContained` (used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`). The local `Embeds` could be replaced with `IsContained`. + +- **`ramseyNum` vs existing Ramsey infrastructure**: `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` for uniform hypergraphs, but the graph Ramsey number (2-uniform case) is not directly provided. The local `ramseyNum` is reasonable as a standalone definition, though it could potentially be related to `hypergraphRamsey 2` with appropriate encoding. + +- **`IsRamseySizeLinear`**: `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` defines `IsRamseySizeLinear`, which captures the *size Ramsey* version of the linear property. Problem 568 asks about the standard Ramsey number (not the size Ramsey number), so `IsRamseySizeLinear` is not directly applicable, but the pattern is similar. + +- **`IsConnectedGraph` and `IsTreeGraph`**: Mathlib provides `SimpleGraph.Connected` and `SimpleGraph.IsTree`. These could replace the local definitions. The local `IsConnectedGraph` uses `Relation.ReflTransGen G.Adj` which is equivalent to Mathlib's `SimpleGraph.Connected` (which uses `G.Reachable`). The local `IsTreeGraph` characterizes trees as connected graphs with |E| + 1 = |V|, which is one of many equivalent characterizations available in Mathlib. + +**Recommendation**: Replace `Embeds` with `IsContained`, and `IsConnectedGraph`/`IsTreeGraph` with their Mathlib counterparts to reduce definition duplication. + +## 2. Citations + +The docstring references: + +> [EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R. + +The website (erdosproblems.com/568) attributes the problem to **[EFRS93]** and notes it appears as problem #33 in the Ramsey Theory section. The formalization's citation is incomplete — it lists the authors but omits the paper title, journal, and year. A more complete citation would be: + +> [EFRS93] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R. (1993). *Ramsey size linear graphs.* + +The header also says "A problem of Erdős, Faudree, Rousseau, and Schelp" which matches the website. + +## 3. Variants + +The website presents a single statement with no listed variants. The formalization captures the problem as stated: given a graph G satisfying the two Ramsey conditions (linear for trees, quadratic for complete graphs), is G Ramsey size linear? + +No variants appear to be missing. + +## 4. Readability + +The code is generally readable. A few notes: + +- The docstring clearly states the problem in LaTeX-style mathematics. +- The `answer(sorry) ↔ ...` pattern is the standard idiom for open yes/no problems in this codebase. +- The use of `⊤ : SimpleGraph (Fin n)` for the complete graph K_n is idiomatic Lean/Mathlib, though a brief comment or notation might aid readers unfamiliar with this convention. +- Variable names (`C₁`, `C₂`, `C`, `n`, `k`) are standard and clear. +- The "no isolated vertices" condition `∀ v : Fin k, ∃ w, H.Adj v w` is a natural encoding. + +Overall readability is good. + +## 5. Formalizability + +**The problem is well-suited for formalization.** The original statement uses asymptotic notation (`R(G, T_n) << n`), which the formalization correctly translates to explicit constant bounds (`≤ C * n`). This is the standard way to formalize "big-O" statements. + +**Ambiguity assessment: Low.** The concepts involved (Ramsey numbers, trees, complete graphs, edge counts, isolated vertices) are all precisely defined. The only mild ambiguity is in the asymptotic notation `<<`, which universally means O(·) in this context and is correctly captured. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Ramsey number definition**: `ramseyNum` correctly defines R(G, H) as the minimum N such that every graph F on Fin N either contains G as a subgraph or its complement contains H as a subgraph. The use of `sInf` with the convention `sInf ∅ = 0` in ℕ is safe since Ramsey's theorem guarantees the set is nonempty for finite G, H. + +- **Tree characterization**: `IsTreeGraph` requires connectivity and |E| + 1 = |V|, which is a correct and well-known characterization of finite trees. + +- **Hypothesis (1)**: `∃ C₁, ∀ n, ∀ T on Fin n, IsTreeGraph T → ramseyNum G T ≤ C₁ * n` — correctly captures R(G, T_n) = O(n) uniformly over all trees. The constant C₁ is universal over all n and all trees, which is the right interpretation. + +- **Hypothesis (2)**: `∃ C₂, ∀ n, ramseyNum G (⊤ : SimpleGraph (Fin n)) ≤ C₂ * n²` — correctly captures R(G, K_n) = O(n²). + +- **Conclusion**: `∃ C, ∀ k, ∀ H on Fin k, (no isolated vertices) → ramseyNum G H ≤ C * |E(H)|` — correctly captures R(G, H) = O(m) where m = |E(H)|. + +- **Scope of constants**: C₁, C₂ are in the hypotheses; C is in the conclusion. All are quantified inside the scope of the universal over G, so they may depend on G. This is correct — the question asks whether *every* G satisfying the hypotheses is Ramsey size linear (with a G-dependent constant). + +- **Edge cases**: The empty graph (Fin 0) is handled correctly: the "no isolated vertices" condition is vacuously true, and the Ramsey number is 0, satisfying 0 ≤ C * 0. + +- **Use of ℕ for constants**: Using natural number constants instead of real-valued constants is fine for upper bounds of this form, since the Ramsey number is a natural number and O(·) bounds can always be stated with integer constants (by rounding up). + +**No mathematical flaws identified.** diff --git a/ai-review/569.md b/ai-review/569.md new file mode 100644 index 0000000000..1b3920ba5e --- /dev/null +++ b/ai-review/569.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 569 + +## 1. Code Reuse + +Several definitions in this file are duplicated from other Erdős problems and could be replaced with existing Mathlib or codebase utilities: + +- **`Embeds`** (lines 34–37): This is exactly `SimpleGraph.IsContained` from Mathlib (`Mathlib.Combinatorics.SimpleGraph.Copy`). Mathlib defines `Copy A B` as an injective graph homomorphism, and `IsContained A B` (notation `A ⊑ B`) as `Nonempty (Copy A B)`. The local `Embeds` is semantically identical and should be replaced with `IsContained`. + +- **`cycleGraph`** (lines 49–52): Mathlib now provides `SimpleGraph.cycleGraph` in `Mathlib.Combinatorics.SimpleGraph.Circulant`, defined via `circulantGraph {1}`. The local definition uses explicit modular arithmetic for adjacency, which is equivalent but redundant. The Mathlib version does not require an `m ≥ 3` proof argument (it handles all `n : ℕ`, with `cycleGraph 0 = ⊥`, `cycleGraph 1 = ⊥`, `cycleGraph 2 = ⊤`). The local version could be replaced, with the `m ≥ 3` constraint moved to the theorem statement. + +- **`ramseyNum`** (lines 42–45): No shared Ramsey number definition exists in the codebase utilities, though the identical definition appears in Problems 568, 570, and many others. This is a strong candidate for extraction into `FormalConjecturesForMathlib`. The `SizeRamsey.lean` utility file defines the *size* Ramsey number but not the standard graph Ramsey number. + +- **No isolated vertices** (line 65): The pattern `∀ v : Fin n, ∃ w, H.Adj v w` is used identically in Problems 568, 570, and others. Problem 79 defines `NoIsolatedVertices` as a named predicate; the `SizeRamsey.lean` utility uses `∀ v, 0 < H.degree v` instead (equivalent with `DecidableRel`). Consider using a shared definition. + +## 2. Citations + +The file references `[EFRS93]` with: +> Erdős, P., Faudree, R., Rousseau, C., and Schelp, R. + +The website (erdosproblems.com/569) lists the source as [EFRS93] and identifies this as problem #34 in Ramsey Theory from the UCSD graphs problem collection. The citation in the file is **incomplete** — it lacks the paper title. Problem 570 provides a more complete citation: +> Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., _Multipartite graph—sparse graph Ramsey numbers_ (1993). + +The same title and year should be added to Problem 569's citation, since both problems come from the same paper. + +## 3. Variants + +The website states the problem as: + +> Let $k \geq 1$. Determine the best possible constant $c_k$ such that $R(C_{2k+1}, H) \leq c_k m$ for any graph $H$ on $m$ edges without isolated vertices. + +The formalization captures the **existence** variant (does such a $c_k$ exist?) but not the **optimization** variant (determine the best possible $c_k$). The website's phrasing "determine the best possible constant" suggests the problem is asking for both existence and the exact value. The formalization only asks for existence, which is the weaker (and more standard) reading. + +Problem 570 is a closely related refinement: it conjectures the specific bound $R(C_k, H) \leq 2m + \lfloor(k-1)/2\rfloor$ for all cycles (not just odd ones) and sufficiently large $m$. This is a stronger conjecture. Problem 570 is marked as solved. The relationship between 569 and 570 is not documented in the file; a docstring note linking them would improve context. + +No other variants are present on the website. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `erdos_569` could mention that $c_k$ depends only on $k$ (which is already captured by the quantifier structure, but worth stating for clarity). +- The constant `c` is typed as `ℕ`, which is fine since the Ramsey number and edge count are natural numbers, and the bound is a natural number inequality. +- Namespacing under `Erdos569` is clean and prevents name collisions with duplicated definitions in other problem files. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: for each $k \geq 1$, find a constant $c_k$ such that for any graph $H$ with $m$ edges and no isolated vertices, $R(C_{2k+1}, H) \leq c_k \cdot m$. The only minor ambiguity is whether "determine the best possible constant" means merely proving existence or finding the exact value; the formalization takes the standard interpretation of proving existence. + +The notions of Ramsey number, cycle graph, edge count, and isolated vertices are all standard and unambiguous. + +## 6. Correctness + +**Overall assessment: Correct, with minor observations.** + +The formalization is mathematically correct and faithfully captures the existence version of the problem. Specific observations: + +- **Ramsey number definition**: The `ramseyNum` definition uses `sInf` over sets of natural numbers $N$ such that every 2-coloring of $K_N$ (represented as a graph on `Fin N`) contains the first graph or the complement contains the second. This is the standard definition of the graph Ramsey number $R(G, H)$. **Correct.** + +- **Cycle graph**: The local `cycleGraph` correctly defines the cycle $C_m$ for $m \geq 3$: vertex $i$ is adjacent to $i \pm 1 \pmod{m}$, with the irreflexivity condition `i ≠ j`. The `symm` and `loopless` proofs are correct. When instantiated with $m = 2k+1$ and $k \geq 1$, we get $m \geq 3$, which is satisfied by `by omega`. **Correct.** + +- **No isolated vertices**: Expressed as `∀ v : Fin n, ∃ w, H.Adj v w`. This correctly captures that every vertex has at least one neighbor. **Correct.** + +- **Quantifier structure**: The theorem states `∀ k ≥ 1, ∃ c, ∀ n H, (no isolated vertices) → R(C_{2k+1}, H) ≤ c · |E(H)|`. This matches the problem: for each $k$, a constant $c_k$ (depending on $k$ but not on $H$) exists. **Correct.** + +- **Type of constant `c`**: The constant `c` is `ℕ`. Since $R(C_{2k+1}, H)$ and `H.edgeSet.ncard` are both natural numbers, and the bound is `c * ncard`, this works. In principle, $c_k$ could be non-integral in the optimal bound, but the existence of some (possibly non-optimal) integer constant $c_k$ satisfying the bound is equivalent to the existence of a real constant (by taking the ceiling). **Correct.** + +- **Edge of definition concern**: If `H` has 0 edges and no isolated vertices (which is impossible for a nonempty graph, but possible vacuously for `Fin 0`), the bound becomes $R(C_{2k+1}, H) \leq 0$. When `n = 0`, the hypothesis `∀ v : Fin 0, ∃ w, H.Adj v w` is vacuously true, and `H.edgeSet.ncard = 0`, so the bound becomes `ramseyNum (cycleGraph ...) H ≤ 0`. For the empty graph on 0 vertices, the Ramsey number should be 0 or 1 depending on convention. Since `sInf` of the empty set in `ℕ` is 0, and for `N = 0` the statement `∀ (F : SimpleGraph (Fin 0)), ...` is vacuously true (there is exactly one such graph, the empty graph, and `Embeds` into it from `C_{2k+1}` fails but `Embeds H Fᶜ` holds trivially for the empty `H`), `ramseyNum` would be 0. So the bound `0 ≤ c * 0 = 0` holds. **No issue in practice**, but worth noting as an edge case that works out. + +**No mathematical flaws identified.** The formalization is a faithful and correct rendering of the problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `Embeds` and `cycleGraph` can be replaced with Mathlib's `IsContained` and `cycleGraph`; `ramseyNum` is widely duplicated and should be shared | +| Citations | Incomplete — missing paper title and year; should match Problem 570's fuller citation | +| Variants | Captures existence but not optimization; relationship to Problem 570 undocumented | +| Readability | Good | +| Formalizability | High — unambiguous standard definitions | +| Correctness | Correct and complete | diff --git a/ai-review/57.md b/ai-review/57.md new file mode 100644 index 0000000000..7acc817bda --- /dev/null +++ b/ai-review/57.md @@ -0,0 +1,151 @@ +# Review: Erdős Problem 57 + +**File:** `FormalConjectures/ErdosProblems/57.lean` + +--- + +## 1. Code Reuse + +**Two opportunities identified.** + +**(a) `oddCycleLengths` from Problem 58.** The formalization of Problem 57 inlines the predicate `Odd n ∧ ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n` directly in the quantifier. Problem 58 (`FormalConjectures/ErdosProblems/58.lean`, line 36) already defines: + +```lean +def oddCycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n : ℕ | Odd n ∧ ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} +``` + +This is exactly the set membership predicate used in Problem 57's `∀ n ∈ T`. Using it would make the statement more concise and consistent across problems. + +**(b) `IsThick` from Problem 26.** Problem 26 (`FormalConjectures/ErdosProblems/26.lean`, line 35) defines: + +```lean +def IsThick {ι : Type*} (A : ι → ℕ) : Prop := ¬Summable (fun i ↦ (1 : ℝ) / A i) +``` + +The current formalization encodes divergence via "for any bound B, there exists a finite set whose reciprocals exceed B." This is mathematically equivalent to non-summability but is expressed differently. While `IsThick` is indexed over a sequence rather than a set, the pattern is closely related. The current "for any bound B" formulation is arguably more self-contained since it avoids depending on `Summable` and is a direct unfolding of the definition, but referencing `IsThick` or at least noting the connection would improve cross-problem consistency. + +**Recommendation:** Import or at minimum reference `oddCycleLengths` from Problem 58. Consider whether adopting a `Summable`-based formulation (closer to `IsThick`) would be preferable for consistency across the codebase. + +--- + +## 2. Citations + +The formalization cites: + +| Ref | In formalization | On website | +|-----|-----------------|------------| +| [ErHa66] | Erdős, P. and Hajnal, A., _On chromatic number of graphs and set-systems_, 1966 | ✓ Listed | +| [LiMo20] | Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_, 2020 | ✓ Listed | + +The website lists significantly more references not mentioned in the formalization: + +- **[Er69b], [Er74d], [Er81], [Er90], [Er93], [Er94b], [Er95], [Er95d], [Er96], [Er97b]** — Various Erdős papers where the problem and its variants were discussed over the decades. +- **[Va99]** — Likely Vardi or similar; listed on the website without full detail. + +The [LiMo20] citation in the formalization gives the year as 2020; the published version appeared in _J. Amer. Math. Soc._ **36** (2023), 1191–1234. The arXiv preprint is from 2020. Consider noting the journal publication: + +> [LiMo20] Liu, H. and Montgomery, R., _A solution to Erdős and Hajnal's odd cycle problem_, J. Amer. Math. Soc. 36 (2023), 1191–1234. + +**Recommendation:** Add the journal information for [LiMo20]. The additional Erdős references are not strictly necessary but [Er81] is relevant if the upper density variant is added (see §3). + +--- + +## 3. Variants + +**Three missing variants identified from the website.** + +**(a) Positive upper density (Erdős [Er81]).** Erdős later asked whether the odd cycle lengths $\{a_i\}$ of a graph with infinite chromatic number must have positive upper density among the odd numbers. This is a strictly stronger statement than the reciprocal divergence (positive upper density implies reciprocal divergence, but not conversely). This could be formalized as: + +```lean +-- Variant: must the odd cycle lengths have positive upper density? +theorem erdos_57.variants.positive_upper_density {V : Type*} (G : SimpleGraph V) + (hχ : G.chromaticNumber = ⊤) : + 0 < (oddCycleLengths G).upperDensity := by sorry +``` + +**(b) Upper density ≥ 1/2 ([Er95d], [Er96]).** Erdős speculated that the upper density (or upper logarithmic density) of the odd cycle lengths must be at least 1/2. This is an even stronger claim. + +**(c) Lower density can be 0 (noted on website).** The website observes that the lower density of odd cycle lengths can be 0, since there exist graphs of arbitrarily large chromatic number and girth. This could be formalized as a counterexample statement. + +**(d) Relationship to Problem 65.** Problem 65 concerns the sum of reciprocals of *all* distinct cycle lengths (not just odd ones) in finite graphs with $kn$ edges. The [LiMo20] paper that proved Problem 57 also resolved the sharp bound in Problem 65. A cross-reference note would be appropriate. + +**Recommendation:** At minimum, add variant (a) as it is explicitly attributed to Erdős and is a natural strengthening. A cross-reference to Problem 65 would also be valuable. + +--- + +## 4. Readability + +The formalization is clear and well-structured. Specific observations: + +- The docstring comment explaining how "$\sum 1/a_i = \infty$" is formalized (lines 42–44) is excellent — it makes the encoding choice transparent. +- The inline predicate `Odd n ∧ ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n` is readable but long. Using `oddCycleLengths` (from Problem 58) would shorten the statement and improve scannability. +- The namespace `Erdos57` is appropriately scoped. +- The `open SimpleGraph Finset` is standard and matches other problems. + +**Overall:** Good readability. Adopting `oddCycleLengths` would be the single biggest improvement. + +--- + +## 5. Formalizability + +The problem as stated is precise and unambiguous: + +- "Graph with infinite chromatic number" — well-defined. +- "Lengths of its odd cycles" — the set of natural numbers $n$ such that $G$ contains a cycle of length $n$ and $n$ is odd. Well-defined. +- "$\sum 1/a_i = \infty$" — the sum of reciprocals of elements of the above set diverges. The set may be finite or infinite; if finite the sum is finite, so divergence implies the set is infinite. + +There are no ambiguities in the statement. The formalization correctly interprets all terms. + +The encoding choice (using "for all bounds B, exists a finite subset exceeding B" rather than "¬Summable") is a valid and arguably more elementary way to express divergence, avoiding the Mathlib `Summable` API. Both formulations are equivalent. + +**Assessment:** No ambiguity. The problem is straightforwardly formalizable. + +--- + +## 6. Correctness + +**6a. Hypothesis — infinite chromatic number (line 48):** + +`G.chromaticNumber = ⊤` correctly asserts that the chromatic number is infinite in `ℕ∞` (where `⊤ = ∞`). This is the standard Mathlib encoding. ✓ + +**6b. The Finset T and its constraints (lines 49–50):** + +The statement asserts: for any `B : ℝ`, there exists `T : Finset ℕ` such that every `n ∈ T` satisfies: +- `Odd n` — n is odd. Since `Odd n` in Lean means `∃ k, n = 2*k + 1`, this excludes 0. ✓ +- `∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n` — n is the length of some cycle in G. By `IsCycle.three_le_length`, any cycle has length ≥ 3, so all elements of T are odd numbers ≥ 3. ✓ + +The elements of T are drawn from `oddCycleLengths G` (in the sense of Problem 58). T is not required to be the *full* set of odd cycle lengths — it is a finite subset. This is correct: divergence of a series over a set S is equivalent to saying that for any bound, some finite subset of S has partial sum exceeding that bound. ✓ + +**6c. The sum (line 51):** + +`B ≤ ∑ n ∈ T, (1 / (n : ℝ))` — since all `n ∈ T` satisfy `n ≥ 3 > 0`, the cast `(n : ℝ)` is positive and `1 / (n : ℝ)` is well-defined and positive. The sum is a standard `Finset.sum`. ✓ + +**6d. Faithfulness to the original problem:** + +The original conjecture (proved by Liu-Montgomery): "If G has infinite chromatic number and $a_1 < a_2 < \cdots$ are the lengths of its odd cycles, then $\sum 1/a_i = \infty$." + +The formalization encodes exactly this: given infinite chromatic number, the reciprocals of odd cycle lengths form a divergent series. The ordering $a_1 < a_2 < \cdots$ in the original statement is just an enumeration convention and does not add mathematical content; the formalization correctly works with the *set* of odd cycle lengths rather than a specific enumeration. ✓ + +**6e. Edge case — empty vertex type:** + +If `V` is empty, then `G` has no edges, and `G.chromaticNumber = 0 ≠ ⊤`, so the hypothesis is vacuously unsatisfied. No issue. ✓ + +**6f. Edge case — no odd cycles:** + +If `G` has infinite chromatic number but (hypothetically) no odd cycles, then no `T` with odd cycle lengths exists except `∅`, which sums to 0. This would make the theorem false for `B > 0`. But this cannot happen: by the Erdős-Hajnal result (and indeed by the weaker classical fact that bipartite graphs have chromatic number ≤ 2), a graph with infinite chromatic number must contain odd cycles. The theorem as stated is consistent. ✓ + +**Verdict:** The formalization is mathematically correct and faithfully captures the proved theorem. No errors or incompleteness in the primary statement. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `oddCycleLengths` (Problem 58) should be reused; `IsThick` (Problem 26) is related | +| Citations | [LiMo20] should include journal info; [Er81] relevant if variants are added | +| Variants | Missing: positive upper density [Er81], upper density ≥ 1/2 [Er95d/Er96], cross-ref to Problem 65 | +| Readability | Good; would improve by using `oddCycleLengths` | +| Formalizability | No ambiguity; straightforwardly formalizable | +| Correctness | Correct and complete for the primary statement | diff --git a/ai-review/570.md b/ai-review/570.md new file mode 100644 index 0000000000..ad50aef749 --- /dev/null +++ b/ai-review/570.md @@ -0,0 +1,167 @@ +# Review: Erdos Problem 570 + +**File:** `FormalConjectures/ErdosProblems/570.lean` + +--- + +## 1. Code Reuse + +**Issue: `Embeds`, `ramseyNum`, and `cycleGraph` are duplicated verbatim across multiple files.** + +All three definitions in `Erdos570` are exact copies of the same definitions in: +- `FormalConjectures/ErdosProblems/568.lean` (lines 33–42) +- `FormalConjectures/ErdosProblems/569.lean` (lines 36–52) + +And `cycleGraph` alone is duplicated in at least 17 files (551, 552, 554, 555, 556, 569, 570, 572, 594, 60, 666, 720, 737, 765, 811, 842, 86). + +Similarly, `Embeds` is equivalent to `ContainsSubgraphCopy` defined in files 545–551 and others. These are the same definition under different names. + +None of these definitions are in `FormalConjecturesForMathlib`. The closest shared definitions are: +- `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` — defines `hypergraphRamsey` (hypergraph-level, not directly usable here) +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` — defines `sizeRamsey` (a different concept) + +**Recommendation:** Promote `Embeds`, `ramseyNum`, and `cycleGraph` into a shared module in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. This would eliminate duplication across ~20 files and provide a single source of truth. At minimum, 568, 569, and 570 should share these definitions since they are identical. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/570](https://www.erdosproblems.com/570):** + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research solved]` | Proved | **Correct.** | +| AMS classification | `AMS 5` (combinatorics) | Graph theory / Ramsey theory | **Correct.** AMS 05 is combinatorics. | +| Reference tag | `[EFRS93]` | Erdos, Faudree, Rousseau, Schelp (1993) | **Correct.** | +| Full citation | "Multipartite graph—sparse graph Ramsey numbers (1993)" | Same | **Correct.** | +| Resolution history | Not mentioned | Even k: EFRS93; k=3: Goddard–Kleitman 1994 / Sidorenko 1991; k=5: Jayawardene 1999; odd k≥7: Cambie–Freschi–Morawski–Petrova–Pokrovskiy 2026 | **Missing.** The docstring does not mention how the problem was resolved or cite the resolving papers. | +| Related problems | Not mentioned | Problem #569, also referenced as #35 in Ramsey collection | **Missing.** Problem 569 is the closely related question (linear bound R(C_{2k+1}, H) ≤ c_k · m for odd cycles). A cross-reference would be helpful. | + +**Recommendation:** Add a note to the docstring summarizing the resolution history and cross-referencing Problem 569. + +--- + +## 3. Variants + +The formalization captures the single main conjecture: for all k ≥ 3, for sufficiently large m, R(C_k, H) ≤ 2m + ⌊(k-1)/2⌋ for all H with m edges and no isolated vertices. + +The website reveals that the problem was resolved piecewise: +1. **Even k**: Proved by the original authors (EFRS93). +2. **k = 3**: Proved independently by Goddard–Kleitman and Sidorenko. +3. **k = 5**: Proved by Jayawardene. +4. **Odd k ≥ 7**: Proved by Cambie et al. (2026). + +These individual cases could be formalized as separate theorems (e.g., `erdos_570_even`, `erdos_570_k3`) since they were proved by different authors using different techniques. However, since the overall conjecture is now fully resolved, the single unified statement is a reasonable choice. + +**Also notable:** Problem 569 asks for the weaker bound R(C_{2k+1}, H) ≤ c_k · m (linear in m but with an unspecified constant). Problem 570 is a strengthening that pins down the constant to 2 with an additive correction of ⌊(k-1)/2⌋. One could formalize the implication 570 → 569 (for odd cycles) as a sanity check. + +**Assessment:** The core conjecture is correctly captured. The omission of individual case statements is acceptable. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Module docstring:** Clear and concise. States the problem in standard mathematical notation with LaTeX. +- **Theorem docstring:** Restates the problem with all key definitions explained (C_k, R(G,H)). +- **Namespace:** `Erdos570` appropriately isolates the local definitions. +- **Definition docstrings:** `Embeds`, `ramseyNum`, and `cycleGraph` all have clear docstrings. +- **No isolated vertices:** The condition `∀ v : Fin n, ∃ w, H.Adj v w` is immediately recognizable as "no isolated vertices." + +**Minor observations:** +- The `open SimpleGraph` is minimal and appropriate. +- The file is short (72 lines) and focused. + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +Every component of the statement has a precise mathematical meaning: +- **Cycle graph C_k**: Well-defined for k ≥ 3. The formalization correctly constructs it as a SimpleGraph on Fin k with adjacency defined by modular arithmetic. +- **Ramsey number R(G, H)**: The two-color graph Ramsey number is well-defined for finite graphs G and H. The Ramsey theorem guarantees the defining set `{N | ...}` is non-empty, so `sInf` produces the correct value. +- **"No isolated vertices"**: Standard graph-theoretic notion, unambiguously formalized as `∀ v, ∃ w, H.Adj v w`. +- **"Sufficiently large m"**: Captured by `∃ M₀, ... H.edgeSet.ncard ≥ M₀ → ...`. Standard formalization of "for all sufficiently large." +- **Floor division**: `⌊(k-1)/2⌋` is exactly Lean's natural number division `(k - 1) / 2`. + +The only potential source of ambiguity in the original problem is what "graph" means (simple? allowing multi-edges?). The formalization uses `SimpleGraph`, which is the standard convention for Ramsey theory and is unambiguously correct here. + +**Ambiguity level: Essentially none.** + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `Embeds` + +```lean +def Embeds {V W : Type*} (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : V → W, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v) +``` + +This defines subgraph isomorphism (injective homomorphism): an injective map preserving adjacency. This is the correct notion for Ramsey theory — "H contains a copy of G" means G is isomorphic to a subgraph of H. Note this is *not* induced subgraph containment (it does not require reflecting non-adjacency), which is intentional and standard. + +### Definition: `ramseyNum` + +```lean +noncomputable def ramseyNum {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : ℕ := + sInf {N : ℕ | ∀ (F : SimpleGraph (Fin N)), + Embeds G F ∨ Embeds H Fᶜ} +``` + +This defines R(G, H) as the minimum N such that every 2-coloring of the edges of K_N (equivalently, every graph F on Fin N) contains either G in the "red" graph F or H in the "blue" graph F^c. This is the standard definition. + +**Subtlety:** If the defining set were empty, `sInf ∅ = 0` in ℕ, which would be mathematically incorrect. However, the Ramsey theorem guarantees the set is non-empty for finite graphs G and H. In this formalization, both G = cycleGraph k hk (on Fin k) and H (on Fin n) are finite, so this is not a concern. + +### Definition: `cycleGraph` + +```lean +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) +``` + +Correctly constructs C_m: vertex i is adjacent to i+1 mod m and i-1 mod m, with the i ≠ j guard ensuring irreflexivity. The symmetry and irreflexivity proofs are correct. The hypothesis m ≥ 3 ensures the cycle is non-degenerate (C_1 and C_2 are not standard cycles). + +### Theorem: `erdos_570` + +```lean +theorem erdos_570 : answer(True) ↔ ∀ (k : ℕ) (hk : k ≥ 3), + ∃ M₀ : ℕ, ∀ (n : ℕ) (H : SimpleGraph (Fin n)), + (∀ v : Fin n, ∃ w, H.Adj v w) → + H.edgeSet.ncard ≥ M₀ → + ramseyNum (cycleGraph k hk) H ≤ 2 * H.edgeSet.ncard + (k - 1) / 2 +``` + +Breaking down the quantifier structure: + +1. **`answer(True) ↔ ...`**: The problem asks "is it true that...?" and the answer is yes (proved). The `answer(True)` pattern correctly encodes this. + +2. **`∀ (k : ℕ) (hk : k ≥ 3)`**: For every integer k ≥ 3. Correct. + +3. **`∃ M₀ : ℕ`**: There exists a threshold M₀ (depending on k). This captures "for sufficiently large m." Note M₀ may depend on k, which is correct — different cycle lengths may require different thresholds. + +4. **`∀ (n : ℕ) (H : SimpleGraph (Fin n))`**: For any graph H on any finite vertex set. The quantification over n allows H to have any number of vertices. This is correct — the problem constrains H by its edge count, not its vertex count. + +5. **`(∀ v : Fin n, ∃ w, H.Adj v w)`**: H has no isolated vertices. Correct. + +6. **`H.edgeSet.ncard ≥ M₀`**: H has at least M₀ edges (i.e., m is "sufficiently large"). Correct. + +7. **`ramseyNum (cycleGraph k hk) H ≤ 2 * H.edgeSet.ncard + (k - 1) / 2`**: R(C_k, H) ≤ 2m + ⌊(k-1)/2⌋. The use of `ncard` (which returns the cardinality for finite sets and 0 for infinite sets) is appropriate since edgeSet on Fin n is always finite. The expression `(k - 1) / 2` is natural number floor division, which equals ⌊(k-1)/2⌋. Correct. + +### Edge cases + +- **n = 0**: Fin 0 is empty, so the "no isolated vertices" condition is vacuously true, but H has 0 edges, so the hypothesis `H.edgeSet.ncard ≥ M₀` fails for M₀ ≥ 1. The conclusion is vacuously true. No issue. +- **k = 3**: ⌊(3-1)/2⌋ = 1, so the bound is R(C_3, H) ≤ 2m + 1. This matches the known result for triangles. +- **k = 4**: ⌊(4-1)/2⌋ = 1, so the bound is R(C_4, H) ≤ 2m + 1. +- **k = 5**: ⌊(5-1)/2⌋ = 2, so the bound is R(C_5, H) ≤ 2m + 2. + +These all match the expected values from the literature. + +**Verdict: Correct and complete.** The formalization faithfully captures Erdos Problem 570. No mathematical flaws are present. The quantifier structure correctly encodes "for sufficiently large m" via the existential M₀, the cycle graph and Ramsey number definitions are standard, and the bound matches the original problem statement exactly. diff --git a/ai-review/571.md b/ai-review/571.md new file mode 100644 index 0000000000..ca0bede735 --- /dev/null +++ b/ai-review/571.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 571 + +## 1. Code Reuse + +**`ContainsSubgraph` and `extremalNumber` are duplicated extensively.** These identical definitions appear in 29 and 8 files respectively across the Erdős problems. They should be factored out into a shared file in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` (e.g., `Turan.lean` or `ExtremalNumber.lean`). Files 571 and 572, for example, contain byte-for-byte identical definitions. + +Bipartiteness is encoded as `G.Colorable 2`, which is the standard Mathlib representation. `Mathlib.Combinatorics.SimpleGraph.Bipartite` is already imported in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` and provides `SimpleGraph.IsBipartite`, which is definitionally `G.Colorable 2`. Either could be used; the current choice is fine. + +## 2. Citations + +The docstring references `[erdosproblems.com/571]` but includes no further citations. The website lists the following primary sources: + +- [Er74c, p.78], [Er75], [Er78, p.30], [Er81], [ErSi84], [Er91] + +And notable partial results by: + +- Bukh and Conlon (2018) — proved the statement for finite families of graphs +- Conlon, Janzer, Lee (2021) — proved specific Turán exponents of the form 3/2 − 1/(2s) +- Jiang and Qiu (2020, 2023) — proved additional specific rational exponents + +The docstring should at minimum cite the Erdős–Simonovits attribution more precisely. It currently says "Erdős Problem 571 (Erdős–Simonovits)" which is acceptable as a short attribution, but adding at least one or two key references (e.g., [Er81] or [ErSi84]) would improve traceability. + +## 3. Variants + +The website describes the general concept of **Turán exponents**: a rational α ∈ [1, 2) is a Turán exponent if there exists a bipartite graph G with ex(n; G) ≍ n^α. The formalization captures the core conjecture that *every* rational in [1, 2) is a Turán exponent. + +**Missing variant consideration:** The website notes the result of Bukh and Conlon (2018) that the statement holds when "bipartite graph" is replaced by "finite family of bipartite graphs." This weakened version could be a useful companion conjecture (already proved), but its omission is understandable since the main conjecture is about a single graph. + +No other variants are described on the website, so the formalization captures the primary problem. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The module docstring is clear and self-contained. +- The theorem statement is well-structured with clear quantifier ordering. +- The docstring on `erdos_571` explains the asymptotic notation `≍` precisely, which is good. +- One minor improvement: the docstring could clarify that α ranges over *all* rationals in [1, 2), emphasizing the universality (currently clear from the `∀ α : ℚ` in the code but could be more explicit in prose). + +## 5. Formalizability + +**Assessment: Highly formalizable (low ambiguity).** + +The problem statement is precise: +- "Rational α ∈ [1, 2)" — unambiguous. +- "Bipartite graph G" — well-defined. The formalization uses `G.Colorable 2` on a finite type, which is correct. +- "ex(n; G) ≍ n^α" — the asymptotic notation is the only potential source of ambiguity, but it has a standard meaning (bounded above and below by constant multiples), which the formalization correctly unpacks into the two-sided bound with constants c₁, c₂ and threshold N₀. + +The only subtle question is whether G should be required to be *finite*. The formalization achieves this via `∃ (U : Type) (_ : Fintype U)`, which correctly ensures a finite graph. This matches the standard meaning in extremal graph theory. + +## 6. Correctness + +### Status Tag: **INCORRECT** +The formalization is tagged `@[category research solved]`, but the problem is listed as **OPEN** on erdosproblems.com. This should be changed to `@[category research open]`. + +Erdős himself expressed doubt about the conjecture in 1978: *"I am not entirely sure that a trivial counterexample can not be found."* Significant partial progress has been made (many specific rational exponents have been shown to be Turán exponents), but the full conjecture for all rationals in [1, 2) remains open. + +### Mathematical Correctness: **Correct** + +The formalization correctly captures: +1. **Universal quantification over rationals in [1, 2):** `∀ α : ℚ, 1 ≤ α → α < 2 →` +2. **Existence of a finite bipartite graph:** `∃ (U : Type) (_ : Fintype U) (G : SimpleGraph U), G.Colorable 2` +3. **Two-sided asymptotic bound:** The existence of constants c₁, c₂ > 0 and threshold N₀ with `c₁ · n^α ≤ ex(n; G) ≤ c₂ · n^α` for n ≥ N₀. +4. **The cast `(α : ℝ)`** correctly lifts the rational exponent to a real exponent for the power function. + +**One potential concern with `extremalNumber`:** The definition uses `sSup` over a set of natural numbers. If the set is empty (which cannot happen since the empty graph on n vertices has 0 edges and contains no subgraph), `sSup` returns 0, which is fine. If the set is unbounded (which cannot happen for graphs on `Fin n`), `sSup ∅` in `ℕ` is 0 by convention. The definition is mathematically sound for finite graphs. + +**Overall:** The formalization is mathematically correct, but the `solved` tag is wrong and should be `open`. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `ContainsSubgraph` and `extremalNumber` duplicated across ~29/8 files; should be shared | +| Citations | Minimal; should add key references [Er81], [ErSi84] | +| Variants | Core conjecture captured; Bukh–Conlon family variant omitted (acceptable) | +| Readability | Good | +| Formalizability | High (low ambiguity) | +| Correctness | Mathematically correct, but **status tag is wrong** (`solved` → `open`) | diff --git a/ai-review/572.md b/ai-review/572.md new file mode 100644 index 0000000000..c73a6438fb --- /dev/null +++ b/ai-review/572.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 572 + +## 1. Code Reuse + +The file defines three local definitions — `cycleGraph`, `ContainsSubgraph`, and `extremalNumber` — inside the `Erdos572` namespace. These identical definitions are duplicated across **many** other Erdős problem files (569, 570, 571, 575, 576, 713, 714, 765, 766, and more). No shared version exists in `FormalConjecturesForMathlib`; a search confirms that `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` contains no cycle graph, extremal number, or subgraph containment definitions. + +**Recommendation:** These three definitions are strong candidates for extraction into a shared utility module (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Extremal.lean`). This would eliminate substantial duplication across at least 15+ problem files. Until then, the local definitions are consistent with the current codebase convention. + +## 2. Citations + +The website (erdosproblems.com/572) references the following: + +| Tag | Full reference | +|-----|---------------| +| [Er64c] | Erdős, P., *On extremal problems of graphs and generalized graphs*. Israel J. Math. 2 (1964), 183–190. | +| [BoSi74] | Bondy, J.A. and Simonovits, M., *Cycles of even length in graphs*. J. Combin. Theory Ser. B 16 (1974), 97–105. | +| [Be66] | Benson, C.T., *Minimal regular graphs of girths eight and twelve*. Canad. J. Math. 18 (1966), 1091–1094. | +| [Er38] | Erdős, P., *On sequences of integers no one of which divides the product of two others and on some related problems*. Mitt. Forsch.-Inst. Math. Mech. Univ. Tomsk 2 (1938), 74–82. | +| [LUW95] / [LUW99] | Lazebnik, Ustimenko, and Woldar results on lower bounds. | +| [Er71], [Er74c], [Er93] | Additional Erdős references on the website. | + +**Assessment:** The docstring includes [Er64c], [BoSi74], [Er38], and [Be66] with full bibliographic entries — these are accurate and match the website. However, the website also mentions: +- **Lazebnik–Ustimenko–Woldar [LUW95]** who proved `ex(n; C_{2k}) ≫ n^{1 + 2/(3k-3+ν)}` — a significant partial result toward the conjecture. This is not cited in the docstring. +- The website mentions **Wenger** for the k=4 case; the docstring includes this attribution but without a formal citation entry. +- The website lists [Er71], [Er74c], and [Er93] as additional references not included in the docstring. + +**Recommendation:** Add a citation for [LUW95] (or [LUW99]) and a proper Wenger citation to be comprehensive. + +## 3. Variants + +The website mentions **Problem 765** as a related problem (asymptotic formula for `ex(n; C₄)`), which is formalized separately in `765.lean` — this is appropriate. + +The main conjecture as stated is specifically for the **lower bound** `ex(n; C_{2k}) ≫ n^{1+1/k}` for k ≥ 3. The website notes: +- The **upper bound** `ex(n; C_{2k}) ≪ k · n^{1+1/k}` is already proved (Bondy–Simonovits). This is mentioned in the docstring but not formalized — which is reasonable since the problem asks for the lower bound. +- The conjecture is **known for k = 2, 3, 4, 5** and open for k ≥ 6. The formalization does not separately state the known cases as solved variants. This is a minor gap — one could add solved variants for k ∈ {2, 3, 4, 5} to record the state of knowledge, though this is not strictly required. +- No other variants of Problem 572 are described on the website. + +**Recommendation:** Consider adding solved variants for k = 2 (Erdős–Klein), k = 3, 5 (Benson), and k = 4 (Wenger) to fully capture the known partial results. The docstring already mentions these but they aren't formalized. + +## 4. Readability + +The code is well-structured and readable: +- The docstring provides clear mathematical context with proper LaTeX notation. +- Each definition has a descriptive docstring explaining its mathematical meaning. +- The namespace `Erdos572` cleanly scopes the local definitions. +- The `by omega` tactic call in the theorem statement for `2 * k ≥ 3` is clean and appropriate. + +**Minor suggestions:** +- The `cycleGraph` docstring says "Vertex $i$ is adjacent to vertex $i + 1 \pmod{m}$ and vertex $i - 1 \pmod{m}$" — this is mathematically clear. +- The theorem statement reads naturally: there exists c > 0 and N₀ such that for n ≥ N₀, `c · n^{1+1/k} ≤ ex(n; C_{2k})`. + +**Overall:** Readability is good. No changes needed. + +## 5. Formalizability + +The problem as stated on the website — "Show that for k ≥ 3, ex(n; C_{2k}) ≫ n^{1+1/k}" — is **precise and unambiguously formalizable**. The notation `≫` (Vinogradov notation) has a standard meaning: there exists a constant c > 0 (possibly depending on k) such that the inequality holds for all sufficiently large n. + +**Ambiguity assessment: LOW.** The only potential ambiguity is: +- Whether c depends on k: In the standard interpretation (and in the formalization), c is allowed to depend on k. The formalization correctly makes c depend on k by quantifying ∀ k first, then ∃ c. +- The meaning of "subgraph": The formalization uses injective homomorphism (i.e., subgraph copy / graph minor without contraction), which is the standard meaning in Turán theory. This is correct. + +## 6. Correctness + +**Mathematical correctness: CORRECT.** + +The formalization accurately captures the conjecture: + +1. **Cycle graph definition:** `cycleGraph (2 * k) (by omega)` correctly constructs C_{2k} for k ≥ 3, giving 2k ≥ 6 ≥ 3. The adjacency relation (mod-arithmetic neighbors with inequality check) correctly defines a cycle. ✓ + +2. **Subgraph containment:** `ContainsSubgraph` requires an injective graph homomorphism — this is the standard notion of "H-free" in extremal graph theory. ✓ + +3. **Extremal number:** `extremalNumber` takes the supremum over edge counts of H-free graphs on Fin n. This matches the standard definition of ex(n; H). The use of `ncard` (which returns 0 for infinite sets) is safe here since `edgeSet` of a `SimpleGraph (Fin n)` is always finite. ✓ + +4. **Theorem statement:** The quantifier structure `∀ k ≥ 3, ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, c · n^{1+1/k} ≤ ex(n; C_{2k})` correctly formalizes the Vinogradov lower bound. ✓ + +5. **Exponent computation:** `1 + 1 / (k : ℝ)` correctly computes the exponent 1 + 1/k in the reals. ✓ + +6. **Well-definedness concern:** The `extremalNumber` definition uses `sSup` on a set of natural numbers. For `n ≥ 1`, the set is nonempty (the empty graph has 0 edges and is H-free) and bounded above (by n choose 2). For `n = 0`, the set is `{0}` and the supremum is 0. This is well-defined. ✓ + +7. **Category tag:** `@[category research open, AMS 5]` — the problem is indeed open (for general k ≥ 3) and AMS classification 05 (Combinatorics) is correct. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Moderate | Three definitions duplicated across 15+ files; shared module recommended | +| Citations | ⚠️ Minor gaps | Missing LUW95/LUW99 and Wenger citations | +| Variants | ⚠️ Minor gap | Known cases k=2,3,4,5 not formalized as solved variants | +| Readability | ✅ Good | Clean, well-documented code | +| Formalizability | ✅ High | Unambiguous problem statement | +| Correctness | ✅ Correct | Mathematically sound formalization | diff --git a/ai-review/573.md b/ai-review/573.md new file mode 100644 index 0000000000..771c43e59b --- /dev/null +++ b/ai-review/573.md @@ -0,0 +1,84 @@ +# Erdős Problem 573 — Review + +## 1. Code Reuse + +**Significant duplication with Problem 574.** Problem 574 (`FormalConjectures/ErdosProblems/574.lean`) defines `ContainsCycleOfLength` and `exConsecutiveCycles k hk n`, which is the generalization of Problem 573 to arbitrary k ≥ 2. Problem 573 is exactly the k = 2 case: `exConsecutiveCycles 2 (by omega) n` should equal `exC3C4 n`. The current formalization redefines bespoke `TriangleFree`, `C4Free`, and `exC3C4` instead of reusing or referencing the definitions from 574. + +**`TriangleFree` vs Mathlib's `CliqueFree 3`.** Mathlib provides `SimpleGraph.CliqueFree 3`, which is the standard way to express triangle-freeness. Problem 581 already uses `G.CliqueFree 3` for this purpose. The custom `TriangleFree` definition in 573 is equivalent but nonstandard within the codebase. + +**`C4Free` vs `CycleFourFree` from Problem 1008.** Problem 1008 (`FormalConjectures/ErdosProblems/1008.lean`) defines `ContainsCycleFour` and `CycleFourFree` with a more explicit all-distinct-vertices formulation. Problem 573's `C4Free` is a third, distinct encoding of the same property. + +**Recommendation:** Ideally, Problem 573 would reuse `exConsecutiveCycles` from 574 (or vice versa, with a shared definition). At minimum, consider using Mathlib's `CliqueFree 3` for triangle-freeness, and aligning the C4-free definition with one of the existing formulations (574's `ContainsCycleOfLength` or 1008's `ContainsCycleFour`). + +## 2. Citations + +The formalization lists: +- [Er71] Erdős, P., *Topics in combinatorial analysis*, 1971, p.103. +- [Er75] Erdős, P., *Problems and results on combinatorial number theory*, 1975. +- [ErSi82] Erdős, P. and Simonovits, M., 1982. +- [Er93] Erdős, P., 1993, p.336. + +The website (erdosproblems.com/573) additionally references **[KST54]** (Kővári, Sós, and Turán), which is mentioned in the docstring's prose ("Kővári, Sós, and Turán proved that...") but not listed as a formal citation in the header block. This reference should be added for completeness and consistency with the website. + +The existing citations match those on the website. The [ErSi82] entry could benefit from a more complete title/journal to match the level of detail in the other entries. + +## 3. Variants + +The formalization captures the main conjecture: ex(n; {C₃, C₄}) ~ (n/2)^{3/2}. + +The website notes that Problem 574 is the direct generalization (to {C_{2k−1}, C_{2k}} for k ≥ 2), and that Problem 765 concerns ex(n; C₄) specifically. The docstring in 573 does not cross-reference these related problems. Problem 574's docstring does note "The case k = 2 (forbidding C₃ and C₄) is Erdős Problem 573", but 573 does not reciprocate. + +No additional variants are missing — the problem as stated on the website is a single yes/no asymptotic question, and the formalization captures it fully. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- **Good:** Clear docstrings on all definitions explaining the mathematical content. +- **Good:** The comment on `C4Free` explaining why only `a ≠ c` and `b ≠ d` suffice for distinctness is helpful. +- **Minor:** The file opens `Filter` and `scoped Topology Real` but only `Filter` (for `atTop`) and `Real` are actually used. The `Topology` opening is needed for `nhds` notation, so this is fine but could be annotated. +- **Suggestion:** A cross-reference to Problem 574 ("This is the k = 2 case of Problem 574") would aid navigation. + +## 5. Formalizability + +**High.** The problem statement "Is it true that ex(n; {C₃, C₄}) ~ (n/2)^{3/2}?" is completely precise: +- The extremal number ex(n; {C₃, C₄}) is a well-defined combinatorial quantity. +- The asymptotic equivalence f(n) ~ g(n) has a standard meaning: f(n)/g(n) → 1 as n → ∞. + +There is no ambiguity in the mathematical statement. The only design choice is how to encode the graph-theoretic primitives (cycle containment, edge counting), which is a formalization choice rather than a mathematical ambiguity. + +## 6. Correctness + +### TriangleFree — Correct +The definition `∀ u v w, G.Adj u v → G.Adj v w → ¬G.Adj u w` correctly captures triangle-freeness. If a triangle on {u, v, w} existed, all three adjacencies would hold. Taking any ordering yields a contradiction via this definition (using symmetry of `Adj`). + +### C4Free — Correct +The definition `∀ a b c d, a ≠ c → b ≠ d → G.Adj a b → G.Adj b c → G.Adj c d → ¬G.Adj d a` correctly captures C₄-freeness. + +- **Distinctness argument (verified):** Given the premises, a ≠ b, b ≠ c, and c ≠ d all follow from irreflexivity of `Adj`. Combined with the explicit a ≠ c and b ≠ d, this gives 5 of the 6 pairwise distinctness conditions. The remaining case a = d is vacuous: the conclusion ¬G.Adj d a = ¬G.Adj a a, which holds by irreflexivity. So when the conclusion is actually challenged (i.e., G.Adj d a holds), we must have a ≠ d, giving full distinctness. +- **Completeness:** Any 4-cycle a-b-c-d-a with distinct vertices satisfies all premises, so the definition catches all C₄ subgraphs. +- **No false positives:** The definition doesn't rule out any non-C₄ structure; non-cycle configurations of 4 edges on 4 vertices (like a path) will not satisfy all four adjacency premises simultaneously. + +### exC3C4 — Correct with a minor note +The `sSup` is well-defined because: (1) the set is nonempty (the empty graph on `Fin n` has 0 edges and is both triangle- and C₄-free), and (2) the set is bounded above by n(n−1)/2. For sSup on ℕ (a conditionally complete lattice), this suffices. + +The use of `edgeSet.ncard` (as opposed to `edgeFinset.card`) avoids the need for `DecidableRel` instances, which is a clean design choice consistent with the `noncomputable` annotation. + +### Main theorem — Correct +The statement `Tendsto (fun n => (exC3C4 n : ℝ) / ((n : ℝ) / 2) ^ ((3 : ℝ) / 2)) atTop (nhds 1)` faithfully encodes ex(n; {C₃, C₄}) ~ (n/2)^{3/2}. The cast to ℝ is necessary for the division and exponentiation, and `nhds 1` with `atTop` is the standard Lean/Mathlib encoding of "tends to 1 as n → ∞". + +The `answer(sorry) ↔ ...` wrapper correctly reflects the open status of the problem (the answer is unknown). + +### Docstring mathematical claims +The docstring states: "Erdős and Simonovits proved that ex(n; {C₄, C₅}) = (n/2)^{3/2} + O(n)." This is a known result and is correctly stated. It also states: "Kővári, Sós, and Turán proved that the extremal number for forbidding C₄ together with any odd cycle is ~ (n/2)^{3/2}." This attribution is slightly imprecise — KST (1954) proved the upper bound ex(n; K_{s,t}) = O(n^{2−1/s}) for s ≤ t, which gives ex(n; C₄) = O(n^{3/2}) since C₄ = K_{2,2}. The specific claim about "{C₄} ∪ {odd cycles}" achieving the (n/2)^{3/2} asymptotic involves combining KST upper bounds with algebraic lower bound constructions (e.g., incidence graphs of projective planes). The docstring could be more precise here, but this is a minor expository issue, not a formalization error. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication with Problems 574, 581, and 1008. Could use shared definitions. | +| Citations | Missing [KST54] as a formal reference. Otherwise matches website. | +| Variants | Main conjecture fully captured. Could cross-reference Problems 574 and 765. | +| Readability | Good. Minor improvements possible (cross-references). | +| Formalizability | Unambiguous. Fully formalizable. | +| Correctness | **Correct.** All definitions faithfully encode the intended mathematics. Minor imprecision in docstring attribution of KST result. | diff --git a/ai-review/574.md b/ai-review/574.md new file mode 100644 index 0000000000..bf6c841d9e --- /dev/null +++ b/ai-review/574.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 574 + +## 1. Code Reuse + +Several related files define overlapping cycle and extremal-number machinery: + +- **572.lean** defines `cycleGraph`, `ContainsSubgraph`, and `extremalNumber` (for a single forbidden graph). +- **573.lean** defines `TriangleFree`, `C4Free`, and `exC3C4` — the special case k=2 of this very problem. +- **575.lean** defines `ContainsSubgraph`, `turanNumber`, `turanNumberFamily` (for a family of forbidden graphs), and `IsBipartite`. + +Problem 574 redefines `ContainsCycleOfLength` and `exConsecutiveCycles` from scratch rather than reusing any of the above. In particular: + +- **575's `turanNumberFamily`** is a generic Turán number for a family of forbidden graphs and could express `exConsecutiveCycles` directly (forbid the family {C_{2k-1}, C_{2k}}). +- **572's `cycleGraph`** already constructs the cycle graph C_m, which could be used with a subgraph-containment predicate instead of the ad hoc `ContainsCycleOfLength`. +- **573's specialized definitions** for the k=2 case are completely independent from 574's general definitions, so the claimed relationship "The case k=2 is Erdős Problem 573" is only a mathematical statement, not a code-level connection. + +**Recommendation:** Consider refactoring `exConsecutiveCycles` to use 575's `turanNumberFamily` or 572's `cycleGraph` + `ContainsSubgraph`. This would unify the extremal graph theory infrastructure and make the k=2 specialization to Problem 573 provably equivalent at the code level. + +## 2. Citations + +The website (https://www.erdosproblems.com/574) lists: + +- **[ErSi82]** Erdős, P. and Simonovits, M. (1982) + +The formalization's docstring says: + +> A problem of Erdős and Simonovits. +> [ErSi82] Erdős, P. and Simonovits, M. + +This matches the website. The website does not provide a full paper title or journal for [ErSi82]. The formalization's citation is consistent with what is available. + +**No issues found.** + +## 3. Variants + +The website states the problem as: + +> Is it true that, for k ≥ 2, ex(n; {C_{2k-1}, C_{2k}}) = (1+o(1))(n/2)^{1+1/k}? + +The formalization captures exactly this statement: for each fixed k ≥ 2, the ratio `ex(n; {C_{2k-1}, C_{2k}}) / (n/2)^{1+1/k}` tends to 1 as n → ∞. + +The website does not mention additional variants. The docstring correctly notes that k=2 is Problem 573. + +**All variants captured.** + +## 4. Readability + +The code is generally readable, with clear docstrings explaining the mathematical content. A few observations: + +- The `ContainsCycleOfLength` definition quantifies over all pairs `i j : Fin m` with `j.val = (i.val + 1) % m`, rather than only quantifying over `i` and setting `j` to be the successor. This is logically equivalent but slightly less natural to read — a formulation like `∀ i : Fin m, G.Adj (f i) (f ⟨(i.val + 1) % m, ...⟩)` would be more direct. +- The unused proof argument `(_ : m ≥ 3)` in `ContainsCycleOfLength` is good for ensuring well-formedness but could benefit from a brief comment explaining why it's needed (to ensure m represents a valid cycle). +- The `by omega` proofs inside `exConsecutiveCycles` for showing `2 * k - 1 ≥ 3` and `2 * k ≥ 3` are clean and appropriate. + +**Minor suggestion:** The docstring's `[ErSi82]` at the end of the theorem docstring is a bare reference tag with no surrounding text. Consider a sentence like "See [ErSi82] for the original statement." + +## 5. Formalizability + +The problem statement is precise and unambiguous: + +- The extremal number ex(n; F) for a family F of forbidden subgraphs is a standard, well-defined quantity in extremal graph theory. +- The asymptotic claim `= (1+o(1)) · (n/2)^{1+1/k}` has a single natural interpretation: the ratio tends to 1. +- The parameter range k ≥ 2 is explicit. + +**Assessment: Fully formalizable with no ambiguity.** The formalization correctly translates the asymptotic equivalence as `Tendsto ... atTop (nhds 1)`. + +## 6. Correctness + +### Mathematical correctness + +The formalization is **mathematically correct**. Specifically: + +1. **Cycle containment:** `ContainsCycleOfLength G m hm` correctly requires m distinct vertices forming a cycle — it demands an injective map `f : Fin m → V` with adjacency along consecutive vertices (mod m). This is the standard definition. + +2. **Extremal number:** `exConsecutiveCycles k hk n` takes the supremum over edge counts of graphs on `Fin n` that avoid both C_{2k-1} and C_{2k}. This is correct. + +3. **Asymptotic statement:** The `Tendsto` formulation correctly expresses `ex(n; {C_{2k-1}, C_{2k}}) ~ (n/2)^{1+1/k}` by asserting the ratio converges to 1. + +### Potential concern: well-definedness of sSup + +The definition `exConsecutiveCycles k hk n` uses `sSup` on a set of natural numbers. For this to be meaningful, the set must be bounded above (which it is — any graph on n vertices has at most n(n-1)/2 edges) and nonempty (the empty graph always qualifies with 0 edges). In Lean 4 / Mathlib, `sSup` on `ℕ` with `ConditionallyCompleteLattice` returns 0 for the empty set, but here the set is always nonempty so this is fine. However, the formalization does not explicitly prove boundedness or nonemptiness; this is acceptable for a conjecture statement (not a proof), but worth noting. + +### Edge case: n = 0 or n = 1 + +When n = 0 or n = 1, the graph has 0 edges and the denominator `(n/2)^{1+1/k}` tends to 0. But since the `Tendsto` is along `atTop`, these finite edge cases don't matter — the filter ignores them. + +**Verdict: Correct and complete.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant opportunities — 572, 573, 575 have overlapping definitions | +| Citations | Matches website | +| Variants | All captured | +| Readability | Good, minor suggestions | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/575.md b/ai-review/575.md new file mode 100644 index 0000000000..3895dd9419 --- /dev/null +++ b/ai-review/575.md @@ -0,0 +1,74 @@ +# AI Review: Erdős Problem 575 + +## 1. Code Reuse + +**Significant duplication found.** The file defines `ContainsSubgraph`, `turanNumber`, `turanNumberFamily`, and `IsBipartite` locally in the `Erdos575` namespace. All of these have equivalents elsewhere: + +- **`ContainsSubgraph`** and **`turanNumber`/`turanNumberFamily`**: Identical definitions exist in `Erdos180` (180.lean:34–53) and at least 28 other Erdős problem files. These should be factored into a shared utility (e.g., in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`). + +- **`IsBipartite`**: Mathlib already provides `SimpleGraph.IsBipartite` as an abbreviation for `G.Colorable 2` (in `Mathlib.Combinatorics.SimpleGraph.Bipartite`, line 282). The custom definition in 575.lean (`∃ f : V → Fin 2, ∀ u v, G.Adj u v → f u ≠ f v`) is mathematically equivalent — a 2-coloring where adjacent vertices get different colors is exactly `Colorable 2`. The Mathlib version should be preferred, as it comes with a library of lemmas (e.g., the equivalence with `IsBipartiteWith`, odd-cycle characterizations, degree-sum identities). The codebase already imports `Mathlib.Combinatorics.SimpleGraph.Bipartite` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` and uses `IsBipartite` from Mathlib there (line 74). + +**Recommendation:** Replace the local `IsBipartite` with `SimpleGraph.IsBipartite` from Mathlib, and consolidate `ContainsSubgraph`, `turanNumber`, and `turanNumberFamily` into a shared definition file. + +## 2. Citations + +The website (erdosproblems.com/575, last edited 18 January 2026) attributes the problem to **Erdős and Simonovits [ErSi82]** and notes it is also listed as Problem #51 in the Extremal Graph Theory problem collection. The formalization cites: + +> [ErSi82] Erdős, P. and Simonovits, M., _Compactness results in extremal graph theory_, Combinatorica **2** (1982), 275-288. + +This matches the website's attribution. The website does not provide additional bibliographic detail beyond [ErSi82]. The citation in the docstring is complete and correctly formatted. + +**No issues found.** + +## 3. Variants + +The website states the problem as: + +> Is it true that, for every F, if there is a bipartite graph in F then there exists some bipartite G ∈ F such that ex(n; G) ≪_F ex(n; F)? + +The formalization captures exactly this: it asks for a bipartite member whose Turán number is at most C · ex(n; F) for some constant C > 0 and all n ≥ 1. The asymptotic notation ≪_F is correctly rendered as an existential over a constant C depending on F (but not n). + +The website also references **Problem 180**, which is the same question but without the bipartite restriction (i.e., for arbitrary families). The formalization's docstring notes "See also Problem 180," which correctly captures this relationship. Problem 180 was disproved by a folklore counterexample. + +**No missing variants.** The problem as stated on the website has a single formulation, and it is fully captured. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The docstrings are clear and well-written. +- The `haveI := fv; haveI := dr;` pattern in `turanNumber` and `turanNumberFamily` is a standard Lean 4 idiom for bringing instances into scope, though slightly verbose. +- The `answer(sorry)` pattern follows the codebase convention. + +**Minor suggestion:** The theorem statement spans many lines with nested quantifiers. This is inherent to the mathematical content and is acceptable. + +## 5. Formalizability + +The problem is **precise and clearly formalizable**. The statement involves: +- Finite families of finite graphs (captured by `ι : Type` with `[Fintype ι]` and graphs on `Fin (k i)`) +- The Turán number ex(n; H) and ex(n; F) (well-defined combinatorial quantities) +- The asymptotic domination condition ex(n; G) ≪ ex(n; F) (captured as ∃ C > 0, ∀ n ≥ 1, ex(n; G) ≤ C · ex(n; F)) +- Bipartiteness (standard graph-theoretic notion) + +**Ambiguity assessment: Very low.** The only potential subtlety is the interpretation of "≪_F" — does it mean O(·) (i.e., ex(n; G) = O(ex(n; F))) or the weaker ex(n; G)/ex(n; F) → 1? The standard meaning in extremal combinatorics is the O(·) interpretation (bounded by a constant factor), which is what the formalization uses. This is correct. + +## 6. Correctness + +**The formalization is mathematically correct with one technical caveat:** + +### What's correct: +- The quantifier structure is right: for every finite nonempty family containing a bipartite member, there exists a bipartite member whose individual Turán number is O(family Turán number). +- `ContainsSubgraph` correctly captures subgraph containment via injective homomorphisms (this is the standard "subgraph isomorphism" / "copy" notion used in extremal graph theory, not the weaker homomorphism notion). +- `turanNumber` and `turanNumberFamily` use `sSup` over the set of achievable edge counts, which is the correct definition. +- The bipartite condition `∃ i, IsBipartite (H i)` correctly requires at least one bipartite member in the family. +- The conclusion `∃ i, IsBipartite (H i) ∧ ∃ C, 0 < C ∧ ∀ n, 1 ≤ n → ...` correctly asks for a *bipartite* member satisfying the bound (not just any member). + +### Technical caveat — well-definedness of `sSup`: +The `turanNumber` and `turanNumberFamily` definitions use `sSup` on a set of natural numbers. In Lean 4 / Mathlib, `sSup` on `ℕ` returns 0 for unbounded or empty sets. For a fixed `n`, the set of achievable edge counts is bounded (by n(n-1)/2) and nonempty (the empty graph achieves 0 edges), so `sSup` is well-defined and gives the correct maximum. This is fine for all n ≥ 1 as required by the theorem. + +However, the existential `∃ (V : Type)` in the sSup set ranges over *all types*, not just `Fin n`. This is mathematically harmless (the cardinality constraint `Fintype.card V = n` restricts to types of size n, and all such types yield the same graphs up to isomorphism), but it means the set is technically a proper class projected into ℕ. In Lean 4, this is handled by universe polymorphism, and the definition works correctly. + +### Minor observation on `answer(sorry)`: +The problem is marked `open` with `answer(sorry)`, meaning the expected truth value is unknown. This is consistent with the website's status (open). + +**Overall assessment: Correct and complete.** The formalization faithfully captures the mathematical content of Erdős Problem 575 as stated on erdosproblems.com. No mathematical flaws identified. diff --git a/ai-review/576.md b/ai-review/576.md new file mode 100644 index 0000000000..b3ab24a61f --- /dev/null +++ b/ai-review/576.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 576 + +**File:** `FormalConjectures/ErdosProblems/576.lean` + +## 1. Code Reuse + +**Significant duplication exists.** Three definitions in this file — `hypercubeGraph`, `ContainsSubgraph`, and `turanNumber` — are duplicated nearly verbatim across multiple files: + +| Definition | 576.lean | 575.lean | 1035.lean | 578.lean | +|---|---|---|---|---| +| `hypercubeGraph` | ✓ (lines 37–47) | — | ✓ (lines 37–47) | ✓ (lines 41–50, slightly different) | +| `ContainsSubgraph` | ✓ (lines 51–52) | ✓ (lines 37–38) | ✓ (lines 51–52) | — (inlined) | +| `turanNumber` | ✓ (lines 56–59) | ✓ (lines 42–45) | — | — | + +All three definitions should be extracted to a shared location in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. The `hypercubeGraph` in 578.lean omits the explicit `u ≠ v` guard (relying on Hamming distance 1 implying distinctness), which is slightly cleaner; a shared definition should follow that pattern. + +## 2. Citations + +The docstring references: `[Er64c], [ErSi70,p.378], [Er74c,p.78], [Er75], [Er81], [Er93,p.334]`. + +The website (erdosproblems.com/576) lists: `[Er64c], [ErSi70], [Er74c], [Er75], [Er81], [Er93]`. + +**Observations:** +- The page-number annotations (e.g., `[ErSi70,p.378]`) are not present on the website. These are fine to include as additional precision but should not be confused with the website's format. +- The website also cites more recent results: **[SuTo22]** (Sudakov–Tomon, 2022) and **[JaSu22]** (Janzer–Sudakov, 2022) which improved upper bounds for general Q_k. These are not mentioned in the formalization. While these are results rather than problem references, they provide important context and could be added to the module docstring. + +## 3. Variants + +**The formalization captures only the Q_3 case; the website states the problem more generally.** + +The website frames the problem as: "Determine the asymptotic behavior of ex(n; Q_k)" for general k-dimensional hypercube graphs. Key aspects not captured: + +- **General Q_k problem:** The broader open question about ex(n; Q_k) for arbitrary k is not formalized. Recent results (Sudakov–Tomon 2022, Janzer–Sudakov 2022) give upper bounds like ex(n; Q_k) = o(n^{2−1/k}), but the precise asymptotics remain open for all k ≥ 3. +- **Historical evolution of the conjecture:** The website notes that Erdős *originally* conjectured ex(n; Q_3) ≫ n^{5/3}, but *later* asked whether ex(n; Q_3) ≈ n^{8/5}. The formalization only captures the later version, which is appropriate since it supersedes the earlier one. +- **Q_3 minus an edge:** The website mentions that for Q_3 with one edge removed, ex(n; G) ≈ n^{3/2}. This is a known result, not a conjecture, but provides useful context. + +**Recommendation:** Consider adding a second theorem statement for the general Q_k problem, or at minimum, mention the broader context in the module docstring. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The module docstring clearly states the conjecture with appropriate LaTeX. +- The theorem docstring provides good mathematical context, including the known Erdős–Simonovits bounds. +- The `hypercubeGraph` definition includes an explicit `u ≠ v` conjunct in the adjacency predicate. This is **logically redundant** — if exactly one coordinate differs, the vertices are necessarily distinct. The `loopless` proof is trivial in both cases, but the redundancy slightly clutters the definition. Compare with 578.lean which omits it cleanly. +- The `open SimpleGraph Finset` at line 30 is appropriate and keeps the theorem statement compact. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** The asymptotic statement ex(n; Q_3) ≍ n^{8/5} is unambiguously captured by the existence of positive constants c, C and a threshold N such that c·n^{8/5} ≤ ex(n; Q_3) ≤ C·n^{8/5} for all n ≥ N. This is the standard Θ-notation formalization and introduces no ambiguity. + +One subtlety: the website's phrasing is more of an open *question* ("asked whether ex(n; Q_3) ≈ n^{8/5}") rather than a firm conjecture. The formalization wraps this as a direct theorem statement (with `sorry`), which is standard practice in this codebase for open problems. The `category research open` attribute correctly marks it. + +**Ambiguity level: Very low.** All objects (hypercube graph, Turán number, asymptotic bounds) have standard, universally agreed-upon definitions. + +## 6. Correctness + +### 6a. `hypercubeGraph` — Correct +The adjacency relation `u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1` correctly defines Q_k: two binary strings of length k are adjacent iff their Hamming distance is exactly 1. The symmetry and irreflexivity proofs are correct. + +### 6b. `ContainsSubgraph` — Correct +The definition as an injective graph homomorphism (i.e., a subgraph isomorphism onto an induced-or-not subgraph) is the standard notion used in extremal graph theory. Note this is a *not-necessarily-induced* copy, which is the correct notion for Turán-type problems. + +### 6c. `turanNumber` — Correct but with a caveat +The definition `sSup {m : ℕ | ∃ (V : Type) ...}` correctly captures ex(n; H) as the maximum number of edges in an H-free graph on n vertices. For any fixed n ≥ 1, the set is nonempty (the empty graph on n vertices has 0 edges and is H-free) and bounded above (by n choose 2), so `sSup` is well-defined on ℕ. + +**Universe-level caveat:** The quantifier `∃ (V : Type)` ranges over types in a fixed universe. Since we only consider finite types of a given cardinality, this is mathematically harmless — for any n, `Fin n` witnesses the relevant type. However, if universe polymorphism issues arise in downstream proofs, this could become an obstacle. + +### 6d. The main theorem — Correct +The statement: +``` +∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + c * (n : ℝ) ^ ((8 : ℝ) / 5) ≤ (turanNumber (hypercubeGraph 3) n : ℝ) ∧ + (turanNumber (hypercubeGraph 3) n : ℝ) ≤ C * (n : ℝ) ^ ((8 : ℝ) / 5) +``` +correctly formalizes "ex(n; Q_3) = Θ(n^{8/5})". The two-sided bound with a shared threshold N is standard. The exponent `(8 : ℝ) / 5` is correct. + +**Note on the conjecture's status:** The *upper bound* ex(n; Q_3) ≤ C·n^{8/5} is already known (Erdős–Simonovits). The genuinely open part is the *lower bound*. The formalization bundles both directions together, which is mathematically correct (the conjecture as a whole is open since one direction remains unproven). + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Three definitions duplicated across 3–4 files; should be shared | +| Citations | Matches website; could add [SuTo22], [JaSu22] for context | +| Variants | Only Q_3 case; general Q_k not formalized | +| Readability | Good; minor redundancy in `hypercubeGraph` adjacency definition | +| Formalizability | Very low ambiguity; cleanly formalizable | +| Correctness | Mathematically correct and complete for the Q_3 conjecture | diff --git a/ai-review/577.md b/ai-review/577.md new file mode 100644 index 0000000000..7ecfd250c4 --- /dev/null +++ b/ai-review/577.md @@ -0,0 +1,94 @@ +# Review: Erdos Problem 577 + +## 1. Code Reuse + +Several files in the codebase define closely related concepts: + +- **`ErdosProblems/1008.lean:36-38`** defines `ContainsCycleFour`, which has an identical core predicate to `IsFourCycle` (6 distinctness conditions + 4 cyclic adjacency conditions), but existentially quantified over vertices. The `IsFourCycle` definition in 577 is essentially the body of `ContainsCycleFour`. These two files should share a common definition. + +- **`ErdosProblems/159.lean:47-50`** defines `C4` as an explicit `SimpleGraph (Fin 4)` with modular adjacency. This is a more algebraic approach to the same structure. Problem 577 could alternatively phrase "contains a 4-cycle" via `ContainsSubgraph G C4` (also defined in 159.lean), though the current tuple-based approach may be more convenient for expressing vertex-disjointness. + +- **`ErdosProblems/914.lean:47-55`** (Hajnal-Szemerédi theorem) is structurally the closest analogue: it asks for `m` vertex-disjoint copies of `K_r` in a graph on `r*m` vertices with a minimum degree condition. The disjointness pattern there uses `Finset` with `Disjoint (S i) (S j)`, while 577 uses `Set` via `fourCycleVertices`. For consistency across the codebase, these should use the same approach. The `Finset`-based approach in 914 is arguably cleaner since it avoids the intermediate `fourCycleVertices` helper. + +**Recommendation:** Extract a shared 4-cycle predicate (or reuse `ContainsCycleFour` from 1008) and consider aligning the vertex-disjointness pattern with 914.lean's `Finset`-based approach. + +## 2. Citations + +The website (erdosproblems.com/577) lists: +- **[Er90c]** as the source of the conjecture (Erdos and Faudree) +- **[Wa10]** as the proof by Wang + +The formalization's docstring matches: +- `[Er90c] Erdős, P., Some of my favourite problems in various branches of combinatorics, Matematiche (Catania) 45 (1990), 59-73.` +- `[Wa10] Wang, H., Proof of the Erdős-Faudree conjecture on quadrilaterals, Graphs and Combinatorics 26 (2010), 833-877.` + +**Assessment:** Citations are complete and consistent with the website. No issues. + +## 3. Variants + +The website lists no variants of this problem. The problem statement is singular and self-contained. No additional variants need to be captured. + +**Assessment:** Complete. + +## 4. Readability + +The code is generally readable, with a few notes: + +- **`IsFourCycle` (lines 39-41):** Clear docstring and definition. The conjunction of 6 distinctness + 4 adjacency conditions is explicit and easy to verify. + +- **`fourCycleVertices` (lines 44-45):** Simple and clear. + +- **`haveI := dG` (line 59):** This pattern for introducing a `DecidableRel` instance is somewhat awkward. It's a Lean idiom but could benefit from a brief inline comment for readers unfamiliar with the pattern. + +- **Tuple type (line 61):** `Fin k → Fin (4 * k) × Fin (4 * k) × Fin (4 * k) × Fin (4 * k)` is verbose. A type alias or using a structure would improve readability but is not strictly necessary. + +- **Conjunction structure (lines 62-64):** The two-part conjunction (all are 4-cycles, and all are pairwise disjoint) is clean and standard. + +**Assessment:** Good readability. Minor improvements possible but not necessary. + +## 5. Formalizability + +The informal statement is: + +> *If G is a graph with 4k vertices and minimum degree at least 2k then G contains k vertex-disjoint 4-cycles.* + +Every component is precisely defined: +- "graph with 4k vertices" — finite simple graph on a vertex set of cardinality 4k +- "minimum degree at least 2k" — every vertex has degree ≥ 2k +- "k vertex-disjoint 4-cycles" — k subgraphs each isomorphic to C4, with pairwise disjoint vertex sets + +There is no ambiguity in the statement. The only minor interpretive choice is whether "4-cycle" means an induced C4 (no diagonal edges) or a not-necessarily-induced C4 (only cyclic edges required). The standard graph-theoretic interpretation is the latter (a subgraph isomorphic to C4), which is what the formalization captures. This is correct. + +**Assessment:** Fully formalizable with no ambiguity. Rating: unambiguous. + +## 6. Correctness + +The formalization is mathematically correct and complete: + +- **Vertex count:** `Fin (4 * k)` correctly models a graph on 4k vertices. + +- **Minimum degree:** `∀ v : Fin (4 * k), 2 * k ≤ G.degree v` correctly encodes that every vertex has degree at least 2k. + +- **4-cycle definition:** `IsFourCycle G a b c d` requires: + - All 6 pairwise distinctness conditions (correct — C(4,2) = 6 pairs) + - 4 adjacency conditions in cyclic order: a~b, b~c, c~d, d~a (correct for a 4-cycle) + - Does NOT require non-adjacency of diagonals a~c, b~d — this is correct, since "containing a 4-cycle" means containing a subgraph isomorphic to C4, not an *induced* subgraph. + +- **Vertex-disjointness:** `Disjoint (fourCycleVertices (cycles i)) (fourCycleVertices (cycles j))` for `i ≠ j` is the standard formulation. + +- **Edge case k = 0:** The statement asks for 0 vertex-disjoint 4-cycles in a graph on 0 vertices, which is vacuously true (existence of a function `Fin 0 → ...` is trivially satisfied). This is mathematically sound. + +- **Relationship to Hajnal-Szemerédi (Problem 914):** Setting r=4 in 914 gives: a graph on 4m vertices with min degree ≥ 3m has m vertex-disjoint K4. Problem 577 requires only min degree ≥ 2k (weaker) but asks for C4s (weaker than K4). These are related but independent results — 577 is not a special case of 914. + +**Assessment:** The formalization is correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Opportunities exist (shared C4 def with 1008; align disjointness pattern with 914) | +| Citations | Complete and accurate | +| Variants | Complete (none exist) | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/578.md b/ai-review/578.md new file mode 100644 index 0000000000..08288ba579 --- /dev/null +++ b/ai-review/578.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 578 + +## 1. Code Reuse + +**Hypercube graph duplication.** The `hypercubeGraph` definition in `578.lean` is essentially a duplicate of the one in `ErdosProblems/86.lean`. The definitions differ only slightly: +- **578.lean:** `Adj u v := (Finset.univ.filter fun i => u i ≠ v i).card = 1` — no explicit `u ≠ v` guard. Irreflexivity is proved from the fact that filtering yields card 0 when `u = v`. +- **86.lean:** `Adj u v := u ≠ v ∧ (Finset.univ.filter (fun i => u i ≠ v i)).card = 1` — includes an explicit `u ≠ v` conjunct. + +Both are mathematically equivalent (if the filter has card 1 then `u ≠ v` follows). A third variant exists in `Wikipedia/SnakeInTheBox.lean` using `Finset (Fin n)` vertices with `symmDiff`. These should be unified into a single definition in `FormalConjecturesForMathlib`. + +**Random graph encoding duplication.** The `toGraph578` definition is identical to `toGraph625` in `ErdosProblems/625.lean` (and a similar one in `ErdosProblems/799.lean`). All use the same `u ≠ v ∧ ec (min u v) (max u v) = true` pattern. This should be factored out into a shared definition. + +**Subgraph copy pattern.** The formalization manually writes out `∃ f, Function.Injective f ∧ ∀ u v, G.Adj u v → H.Adj (f u) (f v)`. This same "injective graph homomorphism" pattern appears in 20+ other Erdős problem files (e.g., 548, 547, 549, 550, 62, 87, 146, etc.). A unified `ContainsSubgraphCopy` predicate in `FormalConjecturesForMathlib` would improve consistency. + +## 2. Citations + +The formalization cites: +- **[Er90c]** — Erdős, P., *Problems and results in graph theory and combinatorics*. 1990. +- **[Ri00]** — Riordan, O., *Spanning subgraphs of random graphs*. Combinatorics, Probability and Computing, 2000. + +The erdosproblems.com/578 page confirms these are the relevant references: the conjecture originated with Erdős and Bollobás, and Riordan solved it. The citations match the website. No additional references are listed on the website that are missing from the formalization. + +## 3. Variants + +The docstring correctly notes that Riordan proved the stronger result for any edge-probability `> 1/4`, not just `1/2`. However, **only the `p = 1/2` case is formalized**. A natural variant would be: + +``` +theorem erdos_578_stronger : + ∀ p : ℝ, p > 1/4 → + ∀ ε : ℝ, ε > 0 → + ∃ d₀ : ℕ, ∀ d : ℕ, d ≥ d₀ → ... +``` + +This would require a proper G(n, p) model rather than the Boolean matrix enumeration (which only handles p = 1/2). The omission is reasonable given the complexity of formalizing G(n, p) for general p, but it should be noted. + +The website also mentions that Riordan proved the count of hypercube copies follows a normal distribution — this is not captured, but is arguably a separate result rather than a variant. + +## 4. Readability + +- **`toGraph578`**: The name is opaque. A name like `boolMatrixToGraph` or reusing a shared definition would be clearer. +- **`hypercubeGraph`**: Clear and well-named. The docstring is good. +- **Main theorem**: The statement is a single large expression. Breaking it up with intermediate definitions (e.g., a `graphFraction` helper as done in `799.lean`, or a `containsHypercube` predicate) would improve readability. +- **Docstring quality**: The docstring is thorough, explaining both the probabilistic and combinatorial interpretations. The "Equivalently" paragraph is a nice touch. +- Overall readability is adequate but could be improved through factoring. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise: "a random graph G(2^d, 1/2) almost surely contains Q_d as d → ∞." Every component has a clear mathematical meaning: +- G(n, 1/2) is the Erdős–Rényi random graph model (well-defined). +- Q_d is the d-dimensional hypercube graph (well-defined). +- "Contains a copy" means there exists an injective graph homomorphism (standard meaning). +- "Almost surely as d → ∞" means the probability tends to 1. + +The only potential ambiguity — whether "contains a copy" means subgraph (edge-preserving) or induced subgraph (edge-preserving and edge-reflecting) — is resolved correctly. Since Q_d has the same number of vertices as G(2^d, 1/2), a subgraph copy is necessarily a *spanning* subgraph, consistent with Riordan's paper title "Spanning subgraphs of random graphs." The formalization correctly uses the weaker (non-induced) notion. + +## 6. Correctness + +**Assessment: Correct.** + +**Hypercube graph definition:** Correctly defines Q_d. Vertices are binary strings of length d; two are adjacent iff they differ in exactly one coordinate (Hamming distance 1). The `symm` and `loopless` proofs are valid. + +**Boolean matrix encoding of G(n, 1/2):** The encoding maps each `ec : Fin n → Fin n → Bool` to a graph using `ec (min u v) (max u v)`. The docstring claims this correctly represents G(n, 1/2). This is mathematically justified: for each fixed upper-triangular pattern (which determines the graph), all lower-triangular and diagonal entries are free. Since the number of free entries is constant across all graphs, the uniform distribution on matrices induces the uniform distribution on labeled graphs, which is G(n, 1/2). ✓ + +**Probability encoding:** The statement `count_good ≥ (1-ε) * count_total` correctly expresses "probability ≥ 1 - ε" under the uniform distribution. The outer quantification `∀ ε > 0, ∃ d₀, ∀ d ≥ d₀` correctly captures "tends to 1." ✓ + +**Subgraph containment:** The existence of an injective `f : (Fin d → Bool) → Fin (2^d)` that preserves adjacency correctly captures "G contains a copy of Q_d." Since both vertex sets have cardinality 2^d, any injective map is automatically bijective, so this asks for Q_d as a spanning subgraph — matching the intended meaning. ✓ + +**No mathematical issues identified.** The formalization is a faithful encoding of the problem as stated on erdosproblems.com. diff --git a/ai-review/579.md b/ai-review/579.md new file mode 100644 index 0000000000..d1c737e3bd --- /dev/null +++ b/ai-review/579.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 579 + +## 1. Code Reuse + +**`ContainsK222` duplication of existing patterns.** The codebase already has multiple definitions for "graph G contains a copy of graph H" — `ContainsSubgraph` (in 765.lean, 714.lean, 926.lean, 60.lean, 87.lean, 62.lean) and `ContainsCopy` (in 736.lean), both using the standard injective-homomorphism pattern: +```lean +∃ f : U → V, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v) +``` +Mathlib provides `SimpleGraph.completeMultipartiteGraph`, which can express K_{2,2,2} as `completeMultipartiteGraph (Fin 3) (fun _ => Fin 2)`. Using `ContainsSubgraph G (completeMultipartiteGraph (Fin 3) (fun _ => Fin 2))` would eliminate the manual 15-distinctness-condition, 12-edge definition and align with the rest of the codebase. The current `ContainsK222` is correct but ad hoc. + +**Independent set encoding.** The formalization uses `(G.induce (S : Set (Fin n))).CliqueFree 2` to express that S is independent. This is mathematically correct (CliqueFree 2 = no edges in the induced subgraph). However, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` already provides `indepNum` with the notation `α(G)` and the lemma `indepNum_pos`. An alternative formulation could express the conclusion as `c * n ≤ α(G)`, though the current approach of exhibiting an explicit witness set S is also reasonable and arguably more constructive. + +**Edge counting.** The use of `G.edgeSet.ncard` is consistent with 20+ other Erdős problem files (533, 917, 816, 765, 809, etc.). No issue here. + +## 2. Citations + +The docstring currently references only `[erdosproblems.com/579](https://www.erdosproblems.com/579)`. The website lists four references: + +- **[EHSS83]** — Erdős, Hajnal, Sós, Szemerédi (1983), the original paper posing the conjecture and proving the δ > 1/8 case. +- **[Er90]** — Erdős (1990) +- **[Er91]** — Erdős (1991) +- **[Er93, p.340]** — Erdős (1993), page 340 + +None of these are included in the formalization's docstring. Adding at least [EHSS83] as the primary source would be appropriate. The website also notes a connection to Problem 533, which is not mentioned in the docstring. + +## 3. Variants + +The formalization captures the main conjecture. Potential variants not captured: + +1. **The proved case δ > 1/8.** The docstring notes that Erdős, Hajnal, Sós, and Szemerédi proved the conjecture for δ > 1/8, but this is not formalized as a separate theorem. A natural companion statement would be: + ```lean + theorem erdos_579_partial : + ∀ δ : ℝ, 1/8 < δ → ∃ c : ℝ, 0 < c ∧ ∃ N : ℕ, ... + ``` + This would represent a known result rather than an open conjecture. + +2. **Generalization to K_{t,t,t}-free graphs.** The problem is specific to K_{2,2,2}, but the natural generalization to K_{t,t,...,t}-free graphs (complete k-partite graphs with parts of size t) is a well-studied area in Ramsey-Turán theory. This is arguably a different problem family, so the omission is justified. + +3. **Connection to Problem 533.** The website lists Problem 533 as related. Problem 533 concerns Ramsey-Turán density δ₃(5), which was shown to be 1/12 by Balogh and Lenz. The K_{2,2,2}-free condition in Problem 579 is closely related since K_{2,2,2} is the octahedron graph (which is K₃-free-colorable in a specific sense relevant to Ramsey-Turán theory). A cross-reference in the docstring would be helpful. + +## 4. Readability + +**`ContainsK222` definition.** The explicit enumeration of 15 distinctness conditions and 12 edges is verbose but unambiguous. The docstring clearly explains that K_{2,2,2} is "the complete tripartite graph with three parts of size 2, also known as the octahedron." This is good. However, the wall of conjuncts is hard to audit visually — a reader must manually verify that all 15 of the C(6,2) = 15 distinctness pairs are present and all 12 cross-part edges are listed. Using `completeMultipartiteGraph` would make this self-evidently correct by construction. + +**Main theorem statement.** The quantifier structure `∀ δ > 0, ∃ c > 0, ∃ N, ∀ n ≥ N, ∀ G, ¬ContainsK222 G → δn² ≤ |E(G)| → ∃ S, cn ≤ |S| ∧ S is independent` is clear and reads naturally. The nesting faithfully represents "for any density threshold, there exists a linear-size independent set guarantee for sufficiently large graphs." + +**Minor readability note.** The `Erdos579` namespace is clean and appropriately scoped. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement from erdosproblems.com is precise: + +- **"K_{2,2,2}-free"**: K_{2,2,2} (the octahedron / complete tripartite graph with parts of size 2) is a well-defined graph. "G is K_{2,2,2}-free" means G contains no subgraph isomorphic to K_{2,2,2}. Unambiguous. +- **"at least δn² edges"**: A concrete numerical condition. Unambiguous. +- **"independent set of size ≫_δ n"**: The Vinogradov notation ≫_δ means "at least c_δ · n for some constant c_δ > 0 depending on δ." The formalization correctly interprets this as ∃ c > 0, ... c·n ≤ |S|. Unambiguous. +- **"n sufficiently large"**: Standard asymptotic qualifier, correctly formalized as ∃ N, ∀ n ≥ N. Unambiguous. + +There is no ambiguity in any component of this problem. The only interpretive choice — whether "K_{2,2,2}-free" means no subgraph copy or no *induced* subgraph copy — is resolved correctly. The standard graph-theoretic convention is that "H-free" means no subgraph copy (not necessarily induced), and the formalization uses this convention via `¬ContainsK222 G`. + +## 6. Correctness + +**Assessment: Correct, with one minor observation.** + +**K_{2,2,2} definition:** The definition correctly enumerates: +- 6 vertices partitioned into 3 pairs: {a₁, a₂}, {b₁, b₂}, {c₁, c₂} +- All 15 = C(6,2) distinctness conditions (3 within-part + 12 cross-part). Verified by manual count: within-part (a₁≠a₂, b₁≠b₂, c₁≠c₂) = 3; a₁ vs {b₁,b₂,c₁,c₂} = 4; a₂ vs {b₁,b₂,c₁,c₂} = 4; b₁ vs {c₁,c₂} = 2; b₂ vs {c₁,c₂} = 2; total = 3+4+4+2+2 = 15. ✓ +- All 12 cross-part edges: |A×B| + |A×C| + |B×C| = 4+4+4 = 12. ✓ +- No within-part edges are required (correct for a complete tripartite graph). ✓ + +**Edge count:** `G.edgeSet.ncard` counts the number of edges as a natural number (using `Set.ncard`, which works for possibly infinite sets but returns the correct finite count for finite graphs). The comparison `δ * (n : ℝ)^2 ≤ (G.edgeSet.ncard : ℝ)` correctly casts to reals for comparison with δn². ✓ + +**Independent set:** `(G.induce (S : Set (Fin n))).CliqueFree 2` means the induced subgraph on S has no edge (no clique of size 2), which is exactly the definition of S being an independent set in G. ✓ + +**Quantifier structure:** The constant c > 0 depends on δ (existentially quantified after δ is universally quantified), and N depends on both δ and (implicitly) c. This correctly captures the asymptotic statement. ✓ + +**Minor observation on `n = 0`.** When `n = 0`, `Fin 0` is empty, so any G is vacuously K_{2,2,2}-free, the edge set is empty (0 edges), and the condition `δ * 0² ≤ 0` holds. The conclusion requires ∃ S with `c * 0 ≤ |S|`, which is satisfied by S = ∅. So the statement is not vacuously problematic for small n, but the "sufficiently large" quantifier (∃ N, ∀ n ≥ N) makes this moot anyway. No issue. + +**Overall:** The formalization is a faithful and mathematically correct encoding of Erdős Problem 579 as stated on erdosproblems.com. No mathematical flaws identified. diff --git a/ai-review/58.md b/ai-review/58.md new file mode 100644 index 0000000000..9d32e1181e --- /dev/null +++ b/ai-review/58.md @@ -0,0 +1,92 @@ +# Review: Erdős Problem 58 + +## 1. Code Reuse + +The `oddCycleLengths` definition in this file is essentially a filtered version of the `cycleLengths` / `cycleSpectrum` pattern that already appears in at least three other Erdős problem files: + +- `FormalConjectures/ErdosProblems/751.lean` — `cycleLengths` +- `FormalConjectures/ErdosProblems/752.lean` — `cycleLengths` +- `FormalConjectures/ErdosProblems/84.lean` — `cycleSpectrum` + +All use the identical idiom `{n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n}`. Problem 58's `oddCycleLengths` adds only `Odd n` to the predicate. A shared definition of `cycleLengths` in `FormalConjecturesForMathlib` would allow `oddCycleLengths` to be expressed as a filter: + +```lean +def oddCycleLengths G := cycleLengths G ∩ {n | Odd n} +``` + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides useful chromatic number lemmas (`le_chromaticNumber_of_pairwise_adj`, `lt_chromaticNumber_iff_not_colorable`, etc.) that could be leveraged in a proof. The `IsNClique` predicate used in the statement is from Mathlib and is the standard choice. + +## 2. Citations + +The docstring cites: +- Gyárfás [Gy92] — **correctly cited** with full journal reference. +- Bollobás and Erdős as originators — mentioned but no primary reference given. +- Bollobás and Shelah for the k=1 case — mentioned but no reference given. + +**Missing from the docstring but present on erdosproblems.com:** +- **[Er90]** — listed as the original source on the website. Should be cited. +- **[GaHuMa21]** — Gao, Huo, and Ma (2021) established the stronger result that if χ(G) ≥ 2k+3 then G contains cycles of k+1 consecutive odd lengths. This is an important extension worth mentioning. + +**Recommendation:** Add `[Er90]` as the original source citation and mention the Gao–Huo–Ma strengthening for completeness. + +## 3. Variants + +The formalization captures the main Gyárfás result (upper bound + equality characterization). Two related results are **not** formalized: + +1. **Gyárfás's stronger structural result:** If G is 2-connected and has odd cycles of ≤ k different lengths, then G is either K_{2k+2} or contains a vertex of degree ≤ 2k. This is mentioned in the docstring but not formalized. It is a strictly stronger result that implies the chromatic number bound. + +2. **Gao–Huo–Ma (2021):** If χ(G) ≥ 2k+3, then G contains cycles of k+1 *consecutive* odd lengths. This is a strengthening/extension not mentioned at all. + +Whether these warrant separate formalized statements is debatable — the Gyárfás structural result would be a natural companion theorem, while the Gao–Huo–Ma result could be its own problem. + +## 4. Readability + +The code is clean and well-structured: +- The `oddCycleLengths` helper is clearly defined with a docstring. +- The main theorem has a descriptive docstring referencing the conjecture history. +- The namespace `Erdos58` scopes the definitions appropriately. +- The statement is a conjunction `A ∧ B` cleanly separating the bound from the equality characterization. + +**Minor suggestion:** The docstring says "clique subgraph" but the formal statement uses `IsNClique` which is a clique within the graph (not necessarily an induced subgraph). This is correct since K_{2k+2} as a subgraph is equivalent to having a clique of that size, but the phrasing could be slightly more precise. + +## 5. Formalizability + +The problem as stated on erdosproblems.com is precise and unambiguous: + +> "If G is a graph which contains odd cycles of ≤ k different lengths then χ(G) ≤ 2k+2, with equality if and only if G contains K_{2k+2}." + +This is directly and obviously formalizable. There is no ambiguity in any of the terms: "odd cycles," "different lengths," chromatic number, and complete graph are all standard graph-theoretic notions with well-established formal counterparts. + +**Ambiguity assessment: None.** The statement is fully precise. + +## 6. Correctness + +### What the formalization gets right + +- The `oddCycleLengths` definition correctly captures the set of lengths of odd cycles via `Walk.IsCycle` and `Odd n`. +- The upper bound `G.chromaticNumber ≤ (2 * k + 2 : ℕ)` correctly states the main result (with the implicit coercion from `ℕ` to `ℕ∞`). +- The equality characterization via `IsNClique` correctly captures "G contains K_{2k+2}." +- The `@[category research solved, AMS 5]` attributes are correct. +- The conjunction structure is logically sound: the (←) direction of the iff depends on the upper bound (first conjunct), which is available since both are proved under the same hypothesis. + +### Potential concern: `ncard` on potentially infinite sets + +`Set.ncard` returns 0 for infinite sets. If `oddCycleLengths G` were infinite, then `ncard = 0 ≤ k` for all k, which would make the hypothesis vacuously true for all k — claiming χ(G) ≤ 2 for any graph with infinitely many odd cycle lengths, which is false. + +**However, this is not actually a bug** because the `[Fintype V]` constraint ensures the vertex set is finite, which means there are finitely many cycles, hence finitely many cycle lengths, so `oddCycleLengths G` is always a finite set. The `ncard` correctly counts elements of finite sets. + +### Limitation: restriction to finite graphs + +The formalization requires `[Fintype V]`, restricting to finite graphs. The original Gyárfás theorem holds for **all** graphs (finite and infinite). For an infinite graph with odd cycles of at most k different lengths, the chromatic number is still ≤ 2k+2. Dropping the `[Fintype V]` would require either: +- Adding an explicit `(oddCycleLengths G).Finite` hypothesis (which is implied by having ≤ k lengths but not captured by `ncard` alone), or +- Using `Set.encard` or `Set.Finite.toFinset` instead of `ncard`. + +This is a **minor incompleteness** — the finite case is the most important and the formalization is correct within its scope. + +### Edge case check (k = 0) + +When k = 0: `oddCycleLengths G` is empty (G is bipartite), `2*0+2 = 2`, so χ(G) ≤ 2 (correct for bipartite graphs), and χ(G) = 2 iff G contains K₂ (an edge). This is correct: a bipartite graph has χ = 2 iff it has at least one edge. + +### Verdict + +The formalization is **mathematically correct** for finite graphs. The only incompleteness is the restriction to finite vertex types, which is a deliberate design choice that avoids the `ncard`-on-infinite-sets pitfall. No flaws attributable to ambiguity (there is none in the original statement). diff --git a/ai-review/580.md b/ai-review/580.md new file mode 100644 index 0000000000..825f2bfa4c --- /dev/null +++ b/ai-review/580.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 580 + +## 1. Code Reuse + +**Issue: Custom `ContainsSubgraph` should be replaced with Mathlib's graph embedding.** + +The `ContainsSubgraph` definition at line 40 is duplicated verbatim across ~29 files in the ErdosProblems directory. Mathlib provides `SimpleGraph.Embedding` (notation `↪g`) which captures exactly the same concept: an injective function preserving adjacency. Problem 738 (`738.lean:48`) already demonstrates the preferred pattern: + +```lean +Nonempty (T ↪g G) +``` + +This is mathematically equivalent to `ContainsSubgraph G T` and should be used instead. This would eliminate the local definition entirely and improve consistency with the rest of the codebase. + +## 2. Citations + +The citations are incomplete. The formalization lists shorthand references without full bibliographic details. + +**Current (lines 27–31):** +``` +[EFLS95] Erdős, P., Füredi, Z., Loebl, M., and Sós, V.T. +[AKS95] Ajtai, M., Komlós, J., and Szemerédi, E. +[Zh11] Zhao, Y. +``` + +**Suggested (based on erdosproblems.com):** + +- [EFLS95] should include title and publication venue. This is the paper where the conjecture was originally stated. +- [AKS95] Ajtai, Komlós, and Szemerédi (1995) — proved an asymptotic version: if at least $(1+\epsilon)n/2$ vertices have degree at least $(1+\epsilon)n/2$, the conclusion holds for sufficiently large $n$ (depending on $\epsilon$). +- [Zh11] Zhao, Y. (2011) — proved the conjecture for all sufficiently large $n$. + +Additionally, the website notes the current status as **"DECIDABLE — Resolved up to a finite check"**, meaning Zhao's result reduces the problem to finitely many cases. This status is not reflected in the docstring, which labels it only with `category research open`. While technically the finite check hasn't been completed, the "resolved up to a finite check" status is worth noting. + +## 3. Variants + +**Missing variant: The Komlós–Sós conjecture.** + +The erdosproblems.com page notes a generalization due to Komlós and Sós: *If at least $n/2$ vertices of an $n$-vertex graph $G$ have degree at least $k$, then $G$ contains every tree with at most $k$ edges (equivalently, at most $k+1$ vertices).* + +Problem 580 is the special case $k = \lfloor n/2 \rfloor$ of this more general conjecture. The generalized version is not captured anywhere in the formalization. It could be added as a separate conjecture or as an additional statement in this file. + +## 4. Readability + +- **Replace `ContainsSubgraph` with `↪g`** as discussed above. This is both more concise and leverages Mathlib's API. +- The degree-filtering expression on line 55 is somewhat dense: + ```lean + n / 2 ≤ (Finset.univ.filter (fun v => n / 2 ≤ G.degree v)).card + ``` + This is acceptable, but a short local definition (e.g., `highDegreeCount`) or a comment could improve clarity. This is a minor point. +- The docstring (lines 44–51) is clear and well-structured. + +## 5. Formalizability + +**Assessment: Precisely formalizable, with minor ambiguity in the literature.** + +The erdosproblems.com statement is unambiguous: "at least $n/2$ vertices have degree at least $n/2$" and "every tree on at most $n/2$ vertices." All quantities are concrete and the formalization maps them directly using natural number floor division. + +However, there is a subtle discrepancy with the standard literature formulation of the Loebl–Komlós–Sós conjecture, which is typically phrased in terms of **edges** rather than vertices: "every tree with at most $k$ edges" (i.e., at most $k+1$ vertices). A tree on $m$ vertices has $m-1$ edges, so "at most $n/2$ vertices" is slightly weaker than "at most $n/2$ edges" (the latter allows trees with up to $\lfloor n/2 \rfloor + 1$ vertices). The formalization matches the erdosproblems.com wording, which is reasonable, but the distinction is worth noting for anyone comparing against the research literature. + +**Ambiguity level: Low.** The only real question is the edges-vs-vertices distinction, which the formalization resolves by following the website statement. + +## 6. Correctness + +**Assessment: Correct modulo the edges-vs-vertices distinction noted above.** + +Detailed analysis of the formalization: + +- **Degree condition** (line 55): `n / 2 ≤ (Finset.univ.filter (fun v => n / 2 ≤ G.degree v)).card` — correctly states that at least $\lfloor n/2 \rfloor$ vertices have degree $\geq \lfloor n/2 \rfloor$. Natural number division gives the standard floor semantics. For even $n$, this is exact; for odd $n$ (say $n=7$), this requires at least 3 vertices of degree $\geq 3$, which is the standard interpretation. + +- **Tree size bound** (line 57): `k ≤ n / 2` where the tree lives on `Fin k` — correctly bounds the number of vertices of the tree. + +- **Tree condition** (line 57): `T.IsTree` — uses Mathlib's standard definition (connected and acyclic), which is correct. + +- **Subgraph containment** (line 57): `ContainsSubgraph G T` — correctly asks for an injective adjacency-preserving map from the tree's vertices into $G$'s vertices. + +- **`answer(sorry)` wrapper**: Appropriate since the conjecture is believed true and has been verified for large $n$, but has not been fully proved for all $n$. + +- **`DecidableRel` instances** (lines 54, 56): Correctly provided for both `G.Adj` and `T.Adj`, needed for `G.degree` computations and potentially for `IsTree`. + +**Potential concern — "at least half"**: The phrase "at least half the vertices" from the problem description would naturally mean $\geq \lceil n/2 \rceil$ vertices, whereas the formalization uses $\geq \lfloor n/2 \rfloor$ (since `n / 2` in Lean is floor division). For even $n$ these coincide. For odd $n$, the formalization's threshold is one less, making the hypothesis *weaker* and the conjecture *stronger*. This is actually the standard convention in the literature (the threshold is $\lfloor n/2 \rfloor$, not $\lceil n/2 \rceil$), so the formalization is correct. But the docstring's use of "at least $n/2$ vertices" (line 46) could be clarified to say "at least $\lfloor n/2 \rfloor$ vertices" to make the floor division explicit. + +**No mathematical flaws identified.** The formalization is a faithful encoding of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Needs improvement — replace custom `ContainsSubgraph` with Mathlib's `↪g` | +| Citations | Incomplete — missing titles, venues, and status note | +| Variants | Missing — Komlós–Sós generalization not captured | +| Readability | Good — minor improvement possible with `↪g` | +| Formalizability | High — low ambiguity | +| Correctness | Correct — faithful to the website statement | diff --git a/ai-review/581.md b/ai-review/581.md new file mode 100644 index 0000000000..d833336e1d --- /dev/null +++ b/ai-review/581.md @@ -0,0 +1,82 @@ +# Review: Erdős Problem 581 + +## 1. Code Reuse + +Several related definitions exist in the codebase that overlap with this formalization: + +- **Erdős 127** (`ErdosProblems/127.lean`): Defines `maxBipartiteSubgraphSize` via a max-cut approach (`cutSize` over vertex bipartitions). This is mathematically equivalent to `maxBipartiteEdges` in Problem 581 (which uses `Coloring (Fin 2)`), but the two definitions are structurally different. Problem 127 requires `DecidableEq`, `DecidableRel G.Adj`, and uses `edgeFinset.card`, while Problem 581 avoids decidability via `Set.ncard`. These are related enough that a shared definition or an equivalence lemma would be valuable, but unifying them is non-trivial due to the different typeclass requirements. + +- **Mathlib's `IsBipartite`**: The condition `Nonempty (H.Coloring (Fin 2))` is equivalent to `H.IsBipartite` (available via `Mathlib.Combinatorics.SimpleGraph.Bipartite`, already imported in `FormalConjecturesForMathlib`). Using `IsBipartite` directly would be more idiomatic and improve discoverability. However, this is a minor stylistic point — the current formulation is mathematically correct. + +- **`largestInducedBipartiteSubgraphSize`** in `FormalConjecturesForMathlib/.../Definitions.lean:73`: Counts *vertices* of the largest *induced* bipartite subgraph, which is a different quantity (vertex count of induced subgraph vs. edge count of spanning subgraph). Not directly reusable here. + +- **Erdős 74, 111, 744**: These define variants of "edge distance to bipartite" — minimum edges to delete to achieve bipartiteness. Related but distinct concept from maximizing bipartite subgraph edges. + +**Verdict**: No existing definition can be directly substituted, but a shared `maxBipartiteEdges` definition (or equivalence with Problem 127's `maxBipartiteSubgraphSize`) would reduce duplication. Consider using `IsBipartite` in place of `Nonempty (H.Coloring (Fin 2))`. + +## 2. Citations + +The formalization cites: +- `[CEG79] Chung, F. R. K., Erdős, P., and Graham, R. L., 1979.` +- `[Al96] Alon, N., *Bipartite subgraphs*. Combinatorica 16 (1996), 301–311.` + +The erdosproblems.com/581 page confirms Alon (1996) as the resolver. The [Al96] citation matches across both the website and the formalization, and also appears in Problem 127 (same paper resolved both problems). + +The [CEG79] citation attribution to Chung, Erdős, and Graham is consistent with the standard "CEG" abbreviation. The full paper title is not provided in the docstring, but neither does the website provide it — this is acceptable. + +**Verdict**: Citations are accurate and consistent with the website. + +## 3. Variants + +The erdosproblems.com page states the problem simply as: "determine f(m)" where f(m) is as defined. The formalization captures the resolved form: the tight asymptotic characterization f(m) = m/2 + Θ(m^{4/5}). No additional variants or sub-questions are mentioned on the website. + +**Verdict**: The formalization fully captures the problem and its resolution. No missing variants. + +## 4. Readability + +The code is well-structured: +- Clear module docstring explaining the problem and its resolution. +- Each definition has an informative docstring explaining its mathematical meaning. +- The comment about `Set.ncard` avoiding decidability instances is helpful. +- The note that quantifying over `Fin n` suffices is a good justification. +- Variable names (`c₁`, `c₂`) are clear. + +Minor suggestions: +- The exponent `(4 : ℝ) / 5` could potentially be written as `(4 / 5 : ℝ)` for slightly cleaner appearance, though the current form is unambiguous. + +**Verdict**: Good readability. No significant issues. + +## 5. Formalizability + +The problem as stated on the website ("determine f(m)") is somewhat vague — "determine" could mean finding an exact formula, tight asymptotics, or the order of growth. The formalization resolves this ambiguity by encoding the known result: existence of constants c₁, c₂ > 0 bounding f(m) between m/2 + c₁·m^{4/5} and m/2 + c₂·m^{4/5}. This is precisely what Alon proved. + +The definitions are sufficiently precise: +- `maxBipartiteEdges` is well-defined: the set being supped over is non-empty (the empty graph on the same vertex set is always a bipartite subgraph with 0 edges) and bounded (by the number of edges in G). +- `f(m)` is well-defined: for any m, triangle-free graphs with m edges exist (e.g., matchings, stars, paths), so the infimum is over a non-empty set. The set is also bounded below by 0. + +**Verdict**: High formalizability. The resolved statement is precisely formalizable with no ambiguity. + +## 6. Correctness + +**Definition `maxBipartiteEdges`**: Correct. A spanning subgraph H ≤ G that admits a proper 2-coloring is exactly a bipartite subgraph of G (on the same vertex set). Counting its edges via `edgeSet.ncard` is appropriate. The sSup correctly finds the maximum since the set is non-empty and bounded above (by G's edge count) in ℕ. + +**Definition `f(m)`**: Correct. The sInf over all triangle-free graphs with exactly m edges of their `maxBipartiteEdges` value captures "the largest k guaranteed in every such graph." The quantification over `Fin n` for all n is a standard way to range over all finite graphs up to isomorphism. + +**Theorem statement**: Correct. The double inequality m/2 + c₁·m^{4/5} ≤ f(m) ≤ m/2 + c₂·m^{4/5} for positive constants matches Alon's result. The condition `0 < m` correctly excludes the trivial case m = 0. + +**Potential subtlety**: The `sSup` in `maxBipartiteEdges` operates on `ℕ` which has `sSup ∅ = 0` and `sSup` of a non-empty bounded set equals the maximum. As argued above, the set is always non-empty (contains 0) and bounded, so `sSup` returns the actual maximum. Similarly, `sInf` on `ℕ` for `f(m)` returns the actual minimum of a non-empty set (non-empty since triangle-free graphs with m edges exist for all m ≥ 0), which equals the minimum since ℕ is well-ordered. + +**Verdict**: The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity: could use `IsBipartite`; could share definition with Problem 127 | +| Citations | Accurate and consistent with the website | +| Variants | Complete — no missing variants | +| Readability | Good | +| Formalizability | High — no ambiguity in the resolved statement | +| Correctness | Correct and complete | + +**Overall**: This is a clean, correct formalization. The main actionable suggestion is considering `IsBipartite` instead of `Nonempty (H.Coloring (Fin 2))` for idiomatic consistency, and exploring whether `maxBipartiteEdges` could be unified with Problem 127's `maxBipartiteSubgraphSize` to reduce duplication. diff --git a/ai-review/582.md b/ai-review/582.md new file mode 100644 index 0000000000..f96c4a49b4 --- /dev/null +++ b/ai-review/582.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 582 + +## 1. Code Reuse + +**Erdős Problem 924** (`FormalConjectures/ErdosProblems/924.lean`) is the direct generalization of this problem: it asserts that for all $k \geq 2$ and $l \geq 3$, there exists a $K_{l+1}$-free graph such that every $k$-coloring of its edges contains a monochromatic $K_l$. Problem 582 is the special case $k = 2$, $l = 3$. However, the two formalizations use different encoding styles: + +- **582** uses the subgraph partition approach: a 2-coloring is a subgraph $H \leq G$, with color classes $H$ and $G \setminus H$, and the conclusion uses `CliqueFree`. +- **924** uses an explicit coloring function `c : Fin n → Fin n → Fin k` with a symmetry condition, and uses `IsNClique` for the monochromatic clique. + +These are mathematically equivalent for $k = 2, l = 3$, but the differing formalizations mean one cannot be trivially derived from the other in Lean. The subgraph approach in 582 is arguably more idiomatic for the 2-color case and matches the pattern used in `SizeRamsey.lean` (`R ≤ F` / `F \ R`) and Problem 925 (`IsNotRamseyForTriangle`). No change needed, but a comment noting the relationship to 924 could be added. + +## 2. Citations + +The formalization cites: + +> [Fo70] Folkman, J., *Graphs with monochromatic complete subgraphs in every edge coloring*. SIAM J. Appl. Math. 18 (1970), 19-24. + +The website [erdosproblems.com/582](https://www.erdosproblems.com/582) confirms this reference and additionally notes: + +- The question was originally posed by **Erdős and Hajnal (1967)**, which is not mentioned in the formalization's docstring. +- **Lower bound** $N \geq 21$: Bikov and Nenov (2020). +- **Upper bound** $N \leq 786$: Lange, Radziszowski, and Xu (2014). +- Historical upper bound improvements: Frankl–Rödl (1986, $7 \times 10^{11}$), Spencer (1988, $3 \times 10^9$), Lu (2007, $9697$), Dudek–Rödl (2008, $941$). +- There is a **\$100 Erdős prize** for proving or disproving $N \leq 100$. + +**Recommendation:** The docstring should attribute the original question to Erdős and Hajnal, not just Folkman. The bounds $21 \leq N \leq 786$ stated in the docstring are consistent with the website. + +## 3. Variants + +The formalization captures only the **qualitative existence** question ("does such a graph exist?"). The website describes additional quantitative aspects: + +- **Bounds on the Folkman number** $f(3, 3; 4)$: the smallest number of vertices $N$ of such a graph. Currently $21 \leq N \leq 786$. These bounds could be formalized as separate statements. +- **Erdős \$100 prize**: Is $N \leq 100$? This is an open problem that could be stated as a separate conjecture. +- **General Folkman numbers**: Covered by Problem 924. + +The qualitative existence result is the core of the problem and is appropriately formalized. The quantitative variants are interesting but are separate results. + +## 4. Readability + +The code is clean and readable. The docstring clearly explains the encoding: $H \leq G$ represents one color class, $G \setminus H$ the other. The `answer(True)` wrapper correctly signals the expected answer. The namespace `Erdos582` is standard. + +Minor suggestions: +- The module docstring could mention "Folkman numbers" more prominently (e.g., "The smallest such graph defines the Folkman number $f(3,3;4)$"). +- A cross-reference to Problem 924 (the generalization) would be helpful, matching the back-reference already present in 924's docstring. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem is a precise combinatorial existence question with no ambiguity. The objects involved (simple graphs, cliques, edge 2-colorings) are all standard and well-defined in Mathlib. The encoding of a 2-coloring as a partition into $H$ and $G \setminus H$ is a well-known and faithful representation. + +## 6. Correctness + +**Assessment: Correct and complete.** + +The formalization accurately captures the mathematical content: + +- **$K_4$-freeness**: `G.CliqueFree 4` correctly states that $G$ contains no complete subgraph on 4 vertices. +- **2-coloring of edges**: Any `SimpleGraph (Fin n)` with `H ≤ G` represents a valid partition of edges of $G$ into two color classes $H$ and $G \setminus H$. Since `G \ H` is defined by `(G \ H).Adj v w ↔ G.Adj v w ∧ ¬H.Adj v w`, the two classes are disjoint and cover all edges of $G$. Conversely, every 2-coloring of edges induces such an $H$. +- **Monochromatic $K_3$**: `¬H.CliqueFree 3 ∨ ¬(G \ H).CliqueFree 3` correctly asserts that at least one color class contains a triangle. +- **`answer(True)`**: Correct, since existence was proved by Folkman (1970). + +One subtle point worth noting: the quantifier `∀ (H : SimpleGraph (Fin n)), H ≤ G →` ranges over all subgraphs of $G$, not just "colorings" in some restricted sense. This is exactly right — any subset of edges forms a valid subgraph and represents a valid color class. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Good — consistent with codebase patterns; related to Problem 924 | +| Citations | Minor gap — should attribute Erdős–Hajnal (1967) as originators | +| Variants | Adequate — existence captured; quantitative bounds are separate | +| Readability | Good — clean, well-documented | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/583.md b/ai-review/583.md new file mode 100644 index 0000000000..68816d2bcc --- /dev/null +++ b/ai-review/583.md @@ -0,0 +1,80 @@ +# Review: Erdős Problem 583 + +## 1. Code Reuse + +**`IsPathCover` in `FormalConjecturesForMathlib/.../Invariants.lean` (lines 140–147):** +This defines a *vertex-disjoint* path cover that covers all *vertices*. Problem 583 is fundamentally different — it requires an *edge-disjoint* path decomposition that covers all *edges*. The two concepts are not interchangeable, so `IsPathCover`/`pathCoverNumber` cannot be repurposed here. + +**Erdős Problem 184 (`ErdosProblems/184.lean`):** +This problem (decomposing edges into O(n) cycles and single edges) uses the closest structural pattern: `Fin k → Finset (Sym2 (Fin n))` for parts, with pairwise `Disjoint` and a biconditional edge-coverage condition. Problem 583 uses the same pattern but with `Walk`/`IsPath` instead of abstract `Finset` parts, which is arguably more natural for paths. No direct reuse opportunity, but the patterns are consistent across the codebase. + +**Other edge-disjoint problems (585, 641, 915):** These use similar `Disjoint ... edges.toFinset` idioms. The formalization of 583 follows established conventions. + +**Verdict:** No significant code reuse opportunity. The formalization correctly uses inline definitions rather than pulling in an unsuitable abstraction. + +## 2. Citations + +The website lists two references for the origin: **[ErGa59]** and **[Er71]**. The formalization's module docstring only cites [ErGa59]: + +> [ErGa59] Erdős, P. and Gallai, T., *On the minimal number of vertices representing the edges of a graph*, 1959. + +The reference **[Er71]** (Erdős 1971) is missing. It should be added, as the website attributes the problem to both sources. The theorem docstring mentions `[ErGa59]` only, and should also include `[Er71]`. + +## 3. Variants + +The website describes several notable related results and variants that are **not captured** by the formalization: + +- **Lovász's result:** Every graph decomposes into at most ⌊n/2⌋ edge-disjoint paths *and cycles*. This is a proven theorem (not a conjecture) and a natural companion statement. +- **Hajós conjecture:** Graphs with all even-degree vertices decompose into at most ⌊n/2⌋ edge-disjoint *cycles*. This is a distinct open conjecture. +- **Partial results:** Confirmed for planar graphs (Blanché–Bonamy–Bonichon), max degree ≤ 5 (Bonamy–Perrett), 2-degenerate graphs (Anto–Basavaraju), and graphs where even-degree vertices form a forest (Pyber). + +None of these variants or partial results are formalized. Some (especially Lovász's result, which is a theorem) could be valuable additions. + +## 4. Readability + +The code is clear and follows established conventions in the codebase. Minor observations: + +- The `haveI := dG` pattern for bringing decidability into scope is standard but could be slightly cleaner if `DecidableRel G.Adj` were placed as an instance argument `[DecidableRel G.Adj]` instead. However, this matches the pattern used in other Erdős problems (e.g., 184), so consistency favors the current approach. +- The `Σ (v w : Fin n), G.Walk v w` sigma type for bundling paths with their endpoints is readable and idiomatic. +- The four conjuncts in the existential are well-structured: bound, path validity, disjointness, coverage. + +**Verdict:** Readable. No changes needed. + +## 5. Formalizability + +The problem statement is precise and unambiguous: + +> "Every connected graph on n vertices can be partitioned into at most ⌈n/2⌉ edge-disjoint paths." + +All terms have standard mathematical meanings: "connected graph," "n vertices," "partitioned" (of the edge set), "edge-disjoint paths," and ⌈n/2⌉. There is no ambiguity requiring interpretation. + +**Verdict:** Fully and obviously formalizable. No ambiguity. + +## 6. Correctness + +The formalization is **correct and complete**. Detailed analysis: + +**Bound encoding:** `k ≤ (n + 1) / 2` in `ℕ` correctly computes ⌈n/2⌉. For even n, `(n+1)/2 = n/2 = ⌈n/2⌉`. For odd n, `(n+1)/2 = (n+1)/2 = ⌈n/2⌉`. Verified for small cases (n=0 → 0, n=1 → 1, n=2 → 1, n=3 → 2, etc.). + +**Edge partition:** The combination of: +- Pairwise edge-disjointness: `∀ i j, i ≠ j → Disjoint (paths i).2.2.edges.toFinset (paths j).2.2.edges.toFinset` +- Complete edge coverage: `∀ e, e ∈ G.edgeFinset ↔ ∃ i, e ∈ (paths i).2.2.edges.toFinset` + +correctly encodes that the paths form a partition of the edge set. The `↔` in the coverage condition is slightly redundant in the `→` direction (walk edges are automatically graph edges), but this is harmless and arguably improves clarity. + +**Path validity:** `(∀ i, (paths i).2.2.IsPath)` ensures each walk has no repeated vertices (hence no repeated edges). In Mathlib, `Walk.IsPath` permits trivial (zero-length) walks, but since k is existentially quantified, a proof would not waste budget on trivial paths. This is not a correctness issue. + +**Connectivity:** `G.Connected` is required, matching the problem statement. For `n = 0`, `Connected` on `Fin 0` is false (requires `Nonempty`), so the statement is vacuously true. For `n = 1`, the unique graph is connected with no edges, satisfied by `k = 0`. + +**Verdict:** Mathematically correct. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities; existing `IsPathCover` is vertex-disjoint, not edge-disjoint | +| Citations | **Missing [Er71] reference** | +| Variants | Not captured (Lovász's theorem, Hajós conjecture, partial results) | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/584.md b/ai-review/584.md new file mode 100644 index 0000000000..400034a1b4 --- /dev/null +++ b/ai-review/584.md @@ -0,0 +1,114 @@ +# Review: Erdős Problem 584 + +## 1. Code Reuse + +**`EdgesShareVertex` duplicates `edgesAdjacent`.** +The definition `EdgesShareVertex` at line 42 of `584.lean`: +```lean +def EdgesShareVertex {V : Type*} (e₁ e₂ : Sym2 V) : Prop := + ∃ v : V, v ∈ e₁ ∧ v ∈ e₂ +``` +is identical to `edgesAdjacent` defined in +`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Domination.lean:116`: +```lean +def edgesAdjacent (e e' : Sym2 α) : Prop := ∃ v, v ∈ e ∧ v ∈ e' +``` +The local definition should be replaced with a reference to the existing `edgesAdjacent`. + +**`EdgesOnCommonCycle` is novel.** No existing definition in the codebase captures the notion of two edges lying on a common bounded-length cycle. This definition is well-constructed and uses `Walk.IsCycle`, `Walk.length`, and `Walk.edges` from Mathlib consistently with other cycle-related problems (e.g., 585, 626, 640). + +**Structural patterns.** The overall structure (∃ c > 0, ∀ n, ∀ δ, ∀ G with density condition, ∃ subgraph H ≤ G with properties) follows established conventions seen in problems 23, 134, and 1008. + +## 2. Citations + +The formalization references: +- `[DuEr82] Duke, R.A. and Erdős, P., 1982.` +- `[DER84] Duke, R.A., Erdős, P., and Rödl, V., 1984.` + +**Missing reference:** The website also cites **[FoSu08b] Fox, J. and Sudakov, B.** for proving Part 2 (the H₂ statement) when δ > n^{−1/5}. This reference should be added to the docstring. + +**Incomplete bibliographic data:** The existing references lack paper titles. The website does not provide full titles either, so the shorthand form is acceptable, but adding the Fox-Sudakov reference is important since it documents known progress on Part 2. + +**Known results not documented in the docstring:** +- Duke and Erdős proved the H₁ statement for sufficiently large n (depending on δ). +- Duke, Erdős, and Rödl proved a weaker version of H₁ with δ⁵ replacing δ³. +- Fox and Sudakov proved the H₂ statement when δ > n^{−1/5}. + +These would add useful mathematical context. + +## 3. Variants + +The formalization captures both parts mentioned on the website: +- **Part 1 (H₁):** Subgraph with ≫ δ³n² edges; every two edges on a common cycle of length ≤ 6; edges sharing a vertex on a common cycle of length 4. +- **Part 2 (H₂):** Subgraph with ≫ δ²n² edges; every two edges on a common cycle of length ≤ 8. + +**Missing variants for known partial results:** +1. The Duke-Erdős-Rödl result (H₁ with δ⁵ instead of δ³) could be formalized as a solved variant. +2. The Fox-Sudakov result (H₂ under the restriction δ > n^{−1/5}) could be formalized as a solved variant. +3. The Duke-Erdős result (H₁ for sufficiently large n depending on δ) could be formalized as a solved variant. + +These would mirror the pattern seen in problem 585, which formalizes known lower and upper bounds as separate `variants` theorems. + +## 4. Readability + +The code is well-structured and readable: +- Helper definitions (`EdgesOnCommonCycle`, `EdgesShareVertex`) are cleanly separated with descriptive docstrings. +- The namespace `Erdos584` keeps things tidy. +- The two parts are clearly distinguished. + +**Minor suggestions:** +- The docstring for Part 1 mentions "a subgraph $H_1$" and Part 2 mentions "$H_2$", but in the Lean code both use `H`. This is fine since they are different theorems with different scopes. +- The docstring for `EdgesOnCommonCycle` could clarify that the cycle is sought in `G` (the original graph), not in the subgraph. This distinction is mathematically important and correctly implemented, but the one-line doc `"Two edges of a graph lie on a common cycle of length at most k"` doesn't make this explicit. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The statement is precise enough for formalization. The main interpretive choices are: + +1. **"≫ δ³n² edges"** — Standard asymptotic notation meaning "≥ cδ³n² for some absolute constant c > 0". The formalization correctly uses `∃ c > 0` with c independent of n, δ, and G. ✅ + +2. **"δn² edges"** — The formalization uses `≥ δ * n²`, which is the right choice (the statement is monotone in the number of edges: having more edges only makes it easier to find the subgraph). ✅ + +3. **"cycle of length at most 6" vs "cycle of length 4"** — The original problem says "common cycle of length at most 6" for arbitrary pairs and "common cycle of length 4" for adjacent pairs. The "length 4" for adjacent edges likely means exactly C₄. See Correctness below. ⚠️ + +4. **The cycle is in G, not in H** — This is clearly stated in the problem and correctly formalized. ✅ + +Overall ambiguity is low. The only real question is the exact-vs-at-most interpretation for length 4. + +## 6. Correctness + +**Overall assessment: Mostly correct, with one notable issue.** + +### Issue: "Cycle of length 4" — exact vs. at most + +The problem states that edges sharing a vertex should "lie on a common cycle of length 4". The formalization uses `EdgesOnCommonCycle G e₁ e₂ 4`, which checks for a cycle of length **at most** 4. In a simple graph, the only cycles of length ≤ 4 are triangles (length 3) and 4-cycles (length 4). + +The original problem almost certainly means **exactly** a 4-cycle (C₄). Two adjacent edges lying on a common triangle is a strictly different (and easier) condition than lying on a common C₄. Using `≤ 4` makes the conclusion weaker (easier to satisfy), so the formalized conjecture is **weaker** than what Erdős, Duke, and Rödl intended. + +**Recommendation:** Either: +- Change to `c.length = 4` for the adjacent-edge case, or +- Add a comment explaining that `≤ 4` is used deliberately as a conservative formalization. + +This is likely attributable to the reuse of `EdgesOnCommonCycle` (which naturally uses ≤) rather than an intentional choice. + +### Verified correct aspects: + +- **Quantifier structure:** ∃ c > 0, ∀ n > 0, ∀ δ ∈ (0,1], ∀ G, ... — the constant c is universal. ✅ +- **Subgraph relation:** `H ≤ G` correctly expresses that H is a subgraph (same vertex set, subset of edges). ✅ +- **Edge density:** `G.edgeFinset.card ≥ δ * n²` with δ ∈ (0,1] is appropriate. Note that n² rather than n(n-1)/2 is used for the edge count, but this only affects the constant and is standard. ✅ +- **Cycles in G vs H:** The `EdgesOnCommonCycle G e₁ e₂ k` correctly requires cycles in the original graph G, not the subgraph H. ✅ +- **Part 2 uses δ² and cycle length 8:** Matches the problem statement. ✅ +- **Both parts use `Fin n`:** Appropriate for finite graphs on n vertices. ✅ +- **`DecidableEq` for `edgeFinset`:** Using `Fin n` provides this automatically. ✅ + +### Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | ⚠️ `EdgesShareVertex` duplicates existing `edgesAdjacent` | +| Citations | ⚠️ Missing Fox-Sudakov [FoSu08b] reference | +| Variants | ⚠️ Known partial results not formalized | +| Readability | ✅ Clear and well-structured | +| Formalizability | ✅ High, low ambiguity | +| Correctness | ⚠️ "Length 4" should likely be exact, not ≤ 4 | diff --git a/ai-review/585.md b/ai-review/585.md new file mode 100644 index 0000000000..eeca803691 --- /dev/null +++ b/ai-review/585.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 585 + +## 1. Code Reuse + +No significant reuse opportunities identified. The formalization already uses Mathlib's `SimpleGraph`, `Walk`, `IsCycle`, `edgeFinset`, etc. The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean` file deals with graph *diameter*, which is unrelated to this cycle-based problem. No custom definitions from the broader codebase are applicable here. + +## 2. Citations + +The docstring references match the website well but could be improved: + +- **[Er76b]** is cited as `Erdős, P., _Problems in combinatorial and graph theory_ (1976)`. The website lists the source simply as `[Er76b]` without a full title. The current citation is reasonable. +- **[PRS95]** is cited as `Pyber, L., Rödl, V., and Szemerédi, E., _Dense graphs without 3-regular subgraphs_ (1995)`. This matches the known reference. +- **[CJMM24]** is cited as `Chakraborti, D., Janzer, O., Methuku, A., and Montgomery, R. (2024)` but **no paper title is given**. The title should be included for completeness (the paper is "Edge-disjoint cycles with the same vertex set"). + +**Recommendation:** Add the paper title for [CJMM24]. + +## 3. Variants + +The formalization captures three statements: + +1. **Main open problem** — exact value of the maximum (tagged `research open`) +2. **Lower bound** — Ω(n log log n) from [PRS95] (tagged `research solved`) +3. **Upper bound** — O(n (log n)^C) from [CJMM24] (tagged `research solved`) + +**Missing variant:** The website notes that Chakraborti, Janzer, Methuku, and Montgomery [CJMM24] also proved a stronger generalization: there exists a constant C > 0 such that for any k ≥ 2, if a graph on n vertices has at least c_k · n · (log n)^C edges, then it contains **k pairwise edge-disjoint cycles** sharing the same vertex set. This k-wise generalization is not captured in the formalization and would be a natural additional variant. + +## 4. Readability + +The code is well-structured and readable: + +- The predicate `NoTwoEdgeDisjointCyclesSameVertexSet` has a clear name and docstring. +- The definition `maxEdgesNoEdgeDisjointCycles` clearly captures the extremal quantity. +- The variant theorems are logically organized under the `.variants` namespace. + +**Minor suggestions:** +- The name `NoTwoEdgeDisjointCyclesSameVertexSet` is quite long. This is acceptable for clarity but could potentially be shortened to something like `NoEdgeDisjointCyclePair` without loss of meaning. +- No other readability issues. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement is precise: it asks for the maximum number of edges in a graph on n vertices avoiding two edge-disjoint cycles on the same vertex set. All terms ("edge-disjoint," "cycle," "same vertex set," "graph on n vertices") have standard, unambiguous graph-theoretic meanings that map directly to Mathlib concepts. + +The only mild source of ambiguity is whether "cycle" means a simple cycle (vertices visited at most once, except the starting vertex) or allows more general closed walks. The standard graph-theoretic convention—and the one used in the formalization via Mathlib's `Walk.IsCycle`—is the simple cycle interpretation, which is correct. + +## 6. Correctness + +### Definition: `NoTwoEdgeDisjointCyclesSameVertexSet` + +The definition states: +``` +¬∃ (u v : Fin n) (c₁ : G.Walk u u) (c₂ : G.Walk v v), + c₁.IsCycle ∧ c₂.IsCycle ∧ + c₁.support.toFinset = c₂.support.toFinset ∧ + Disjoint c₁.edges.toFinset c₂.edges.toFinset +``` + +**Analysis:** +- **Cycle definition:** Mathlib's `Walk.IsCycle` (line 84 of `Paths.lean`) requires the walk to be a circuit (nonempty trail from u to u) with `p.support.tail.Nodup`. This means all vertices except the repeated start/end vertex are distinct—exactly the standard notion of a simple cycle. ✓ +- **Same vertex set:** `c₁.support.toFinset = c₂.support.toFinset` correctly captures that the two cycles visit exactly the same set of vertices. Note that the cycles may start at different vertices (existentials over `u` and `v` independently), which is correct since the starting vertex of a cycle is arbitrary. ✓ +- **Edge-disjointness:** `Disjoint c₁.edges.toFinset c₂.edges.toFinset` correctly captures that no edge is shared. ✓ +- **Non-triviality:** If c₁ = c₂ (same walk), then their edge sets are identical, so the disjointness condition fails (a nonempty cycle has at least 3 edges). Thus the definition correctly requires two *distinct* cycles. ✓ + +### Definition: `maxEdgesNoEdgeDisjointCycles` + +Uses `sSup` over `{m : ℕ | ∃ G : SimpleGraph (Fin n), NoTwoEdgeDisjointCyclesSameVertexSet G ∧ G.edgeFinset.card = m}`. + +- The set is always nonempty (the empty graph on n vertices has 0 edges and trivially satisfies the condition). +- The set is bounded above (at most n(n-1)/2 edges). +- `sSup` on `ℕ` with its `ConditionallyCompleteLattice` instance returns the maximum for nonempty bounded-above sets. ✓ + +### Main theorem: `erdos_585` + +States `∀ n, maxEdgesNoEdgeDisjointCycles n = answer(sorry)`. This asks for the exact extremal function, consistent with the open problem. Tagged `research open`. ✓ + +### Lower bound: `erdos_585.variants.lower_bound` + +States `∃ c > 0, ∃ N₀, ∀ n ≥ N₀, c * n * log(log(n)) ≤ maxEdges(n)`. This correctly formalizes "≫ n log log n" as an asymptotic lower bound. Tagged `research solved`. ✓ + +### Upper bound: `erdos_585.variants.upper_bound` + +States `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, maxEdges(n) ≤ n * (log n)^C`. This correctly formalizes "at most n(log n)^{O(1)}" as an asymptotic upper bound. Tagged `research solved`. ✓ + +### Overall Correctness Assessment + +**The formalization is mathematically correct and complete for the core problem.** No flaws identified in the definitions or theorem statements. The only gap is the missing k-wise generalization variant from [CJMM24], which is an additional result beyond the original Erdős problem statement. diff --git a/ai-review/586.md b/ai-review/586.md new file mode 100644 index 0000000000..ba4d227c80 --- /dev/null +++ b/ai-review/586.md @@ -0,0 +1,78 @@ +# AI Review: Erdős Problem 586 + +**File:** `FormalConjectures/ErdosProblems/586.lean` + +## 1. Code Reuse + +A generic `CoveringSystem` / `StrictCoveringSystem` framework exists in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`. Problems 7 and 273 use it directly. However, Problem 586 defines a local `IsCoveringSystem` using `Fin k`, `ℤ`-valued residues, and `ℕ`-valued moduli—mirroring the approach of Problem 947. + +**Assessment:** The local definition is reasonable here. The generic `CoveringSystem` uses `Ideal R`, which would make the pairwise non-divisibility condition on moduli (`¬(n i ∣ n j)`) harder to express naturally (it would require reasoning about ideal divisibility rather than natural number divisibility). The local definition is simpler, more self-contained, and more readable for this specific problem. That said, there is a proliferation of ad-hoc covering system definitions across the codebase (Problems 2, 8, 27, 586, 947 all define their own). A unified approach would be beneficial long-term, but is not a blocker for this problem. + +**Recommendation:** Acceptable as-is. Could optionally import and use `CoveringSystem ℤ` for consistency with Problems 7/273, but the local definition is defensible. + +## 2. Citations + +The website ([erdosproblems.com/586](https://www.erdosproblems.com/586)) lists the following references: +- **ErGr80** — Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathematique (1980) +- **Er96b**, **Er97**, **Er97c**, **Er97e** — various Erdős publications + +The formalization only cites **[BBMST22]** (Balister, Bollobás, Morris, Sahasrabudhe, and Tiba), which is the paper that resolved the problem. The primary historical source **[ErGr80]** is not mentioned in the docstring, nor are the other Erdős references. + +**Recommendation:** Consider adding a reference to [ErGr80] as the original source. The other Erdős references (Er96b, Er97, etc.) are less critical but could be noted. The [BBMST22] citation is correctly included and properly formatted. + +## 3. Variants + +The website presents a single statement: *"Is there a covering system such that no two of the moduli divide each other?"* No variants are listed. + +The formalization captures this single statement. Problem 7's docstring helpfully notes the connection: "Selfridge showed that this problem [Problem 7] would have a positive answer if a covering system with pairwise non-divisible moduli existed (see Problem 586)." This cross-reference is in Problem 7 but not in Problem 586. + +**Recommendation:** Consider adding a note in Problem 586's docstring mentioning the connection to Problem 7 (Selfridge's reduction), since it provides important mathematical context. + +## 4. Readability + +The code is clean and readable: +- The `IsCoveringSystem` definition is clearly documented with a docstring explaining each component. +- The theorem statement is well-structured with a clear docstring. +- The namespace `Erdos586` prevents name collisions with other problems' `IsCoveringSystem` definitions. + +**Minor note:** The `IsCoveringSystem` docstring says "with $n_i \geq 2$" which correctly matches the formalization `2 ≤ n i`. + +**Assessment:** Good readability. No changes needed. + +## 5. Formalizability + +The problem statement is unambiguous and precisely formalizable: +- "Covering system" has a standard mathematical definition (finite collection of congruence classes covering all integers). +- "No two of the moduli divide each other" is a clear pairwise condition. +- The answer (no) is known and correctly encoded. + +**Assessment:** Fully formalizable with no ambiguity. The statement is one of the cleanest covering system problems to formalize. + +## 6. Correctness + +The formalization is **correct**. + +**Detailed analysis:** + +- **`IsCoveringSystem k a n`** requires (1) all moduli ≥ 2, and (2) every integer `z` is covered by some congruence class `a_i mod n_i`. This is the standard definition. ✓ + +- **`answer(False) ↔ ∃ ... IsCoveringSystem k a n ∧ ∀ i j, i ≠ j → ¬(n i ∣ n j)`**: Since `answer(False)` is filled in, this reduces to `False ↔ ∃ ...`, i.e., `¬ ∃ ...`, asserting no such covering system exists. This matches the known result (BBMST22 proved the answer is no). ✓ + +- **Pairwise non-divisibility:** The condition `∀ i j : Fin k, i ≠ j → ¬(n i ∣ n j)` correctly captures "no two moduli divide each other." Note that this is stronger than distinctness—it implies `n i ≠ n j` for `i ≠ j` (since equal values trivially divide each other), so distinctness of moduli is automatically enforced. ✓ + +- **No degenerate cases:** When `k = 0`, `Fin 0` is empty, so `IsCoveringSystem 0 a n` requires every integer to be covered by an empty collection—which is false. So `k = 0` is correctly excluded. For `k ≥ 1`, a single congruence class `a mod n` with `n ≥ 2` cannot cover all integers, so `k ≥ 2` is effectively required for a valid covering system. The non-divisibility condition is vacuously true for `k ≤ 1`, but this doesn't matter since the covering property fails. ✓ + +- **Encoding convention:** The use of `(n i : ℤ) ∣ (z - a i)` correctly lifts the natural number modulus to ℤ for the divisibility check, which is the standard way to express `z ≡ a_i (mod n_i)` in Lean. ✓ + +**Assessment:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Acceptable | Local def is simpler than generic `CoveringSystem`; justified | +| Citations | Minor gap | Missing [ErGr80] and other Erdős references from website | +| Variants | Minor gap | Could cross-reference Problem 7 (Selfridge connection) | +| Readability | Good | Clean, well-documented | +| Formalizability | Excellent | Unambiguous, fully precise | +| Correctness | Correct | No mathematical issues found | diff --git a/ai-review/588.md b/ai-review/588.md new file mode 100644 index 0000000000..accd9cacc1 --- /dev/null +++ b/ai-review/588.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 588 + +## 1. Code Reuse + +**Significant reuse opportunity with Problem 101.** Problem 588 is a direct generalization of Problem 101 (the case k=4). The definitions in 588.lean are parameterized versions of those in 101.lean: + +- `NoKPlusOneCollinear 4 P` ≡ `NoFiveCollinear P` (from 101.lean) +- `kRichLineCount 4 P` ≡ `fourRichLineCount P` (from 101.lean) + +Problem 101 could be refactored to import and reuse the parameterized definitions from 588.lean, with `erdos_101` stated as a corollary of the k=4 case of `erdos_588`. Alternatively, 588.lean could import the hardcoded definitions from 101.lean and generalize them. + +No relevant utilities were found in `FormalConjecturesForMathlib` for this combinatorial geometry problem. + +## 2. Citations + +The formalization's docstring mentions only: +- The reference link to erdosproblems.com/588 +- The connection to Problem #101 +- Sylvester's result that f₃(n) = n²/6 + O(n) + +**Missing citations from the website:** +- **[Er84]** (presumed Erdős 1984, original problem source) +- **[BGS74]** (Burr, Grünbaum, Sloane 1974) +- **[FuPa84]** (Füredi, Palásti 1984) +- **[Ka63]** — Kárteszi (1963): proved f_k(n) ≫_k n log n +- **[Gr76]** — Grünbaum (1976): proved f_k(n) ≫_k n^{1+1/(k-2)} +- **[SoSt13]** — Solymosi & Stojaković (2013): construction showing f_k(n) ≫_k n^{2−O_k(1/√(log n))} + +The website also notes a **$100 prize** for resolution, which is not mentioned in the formalization. + +**Recommendation:** Add the key citations to the docstring, at minimum [Ka63], [Gr76], and [SoSt13] which establish the known lower bounds. + +## 3. Variants + +The formalization captures only the main conjecture (the upper bound question: is f_k(n) = o(n²)?). + +**Not captured:** +- The known lower bounds could be formalized as separate theorems (Kárteszi's n log n bound, Grünbaum's n^{1+1/(k-2)} bound, Solymosi-Stojaković's near-quadratic bound). +- The Sylvester result f₃(n) = n²/6 + O(n) is mentioned in the docstring but not formalized. + +These are supplementary results rather than variants of the conjecture itself, so their omission is reasonable. The core conjecture is fully captured. + +## 4. Readability + +The code is clean and well-structured: +- Helper definitions (`NoKPlusOneCollinear`, `kRichLineCount`) are clearly named and documented with docstrings. +- The o(n²) statement is correctly unfolded into the standard ε-N formulation. +- The namespace `Erdos588` prevents name collisions. + +**Minor suggestions:** +- The docstring for `kRichLineCount` could note that for k ≥ 2 and finite P, the set of k-rich lines is finite (bounded by C(n,2)), which justifies the use of `Set.ncard`. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: it asks whether a specific asymptotic bound holds for a well-defined combinatorial quantity. The key concepts — points in R², collinearity, lines through points, counting — all have standard Mathlib formalizations. + +The only minor source of ambiguity is the phrase "k-rich lines" — one must decide whether this means "exactly k" or "at least k" points. The formalization correctly uses "at least k" (via `k ≤ Set.ncard ...`), which matches standard usage and the website's phrasing. + +The o(n²) asymptotic is unambiguously formalized via the ε-N definition. + +## 6. Correctness + +**Assessment: Mathematically correct and complete.** + +Detailed verification: + +1. **`NoKPlusOneCollinear k P`**: States that no (k+1)-element subset of P is collinear. This is equivalent to "no line contains k+1 or more points of P." ✓ + +2. **`kRichLineCount k P`**: Counts AffineSubspaces L with `Module.finrank ℝ L.direction = 1` (i.e., lines) such that at least k points of P lie on L. The use of `Set.ncard` is appropriate: for k ≥ 2 and finite P, the set of k-rich lines is finite (each is determined by a pair of its points in P), so `Set.ncard` gives the correct count. For the vacuous cases k ∈ {0,1}, the set could be infinite and `Set.ncard` would return 0, but these cases are excluded by the k ≥ 4 hypothesis in the main theorem. ✓ + +3. **Main theorem `erdos_588`**: The statement correctly formalizes "f_k(n) = o(n²) for all k ≥ 4" as: for every k ≥ 4, for every ε > 0, there exists N such that for all n ≥ N and all point sets P of size n with no (k+1) collinear, the count of k-rich lines is at most ε·n². ✓ + +4. **`answer(sorry)` wrapper**: Appropriate for an open problem where the answer (true/false) is unknown. The biconditional correctly encodes that the answer determines whether the bound holds. ✓ + +5. **Consistency with Problem 101**: Instantiating k=4 in `erdos_588` yields exactly the statement of `erdos_101` (modulo the `answer(sorry)` wrapper in 588 vs. the direct statement in 101). Note that 101.lean does NOT use `answer(sorry)`, which is a minor inconsistency — either both should use it (if the answer is unknown) or neither should. The website lists both as open with a prize, so both should arguably use `answer(sorry)`. + +**No mathematical flaws identified.** diff --git a/ai-review/589.md b/ai-review/589.md new file mode 100644 index 0000000000..8e5dbcba84 --- /dev/null +++ b/ai-review/589.md @@ -0,0 +1,102 @@ +# Erdős Problem 589 — AI Review + +## 1. Code Reuse + +The file defines `AtMostKOnAnyLine` using a hand-rolled collinearity check (`a * p 0 + b * p 1 = c`). Several existing alternatives in the codebase could be considered: + +- **`NoKCollinear k P`** in `FormalConjectures/ErdosProblems/960.lean:38` — Uses Mathlib's `Collinear ℝ` and is parametric in `k`. Semantically, `NoKCollinear (k+1) S` is equivalent to `AtMostKOnAnyLine k S` (no `k+1` points collinear ↔ at most `k` on any line). The main difference is that 960 uses `EuclideanSpace ℝ (Fin 2)` while 589 uses `Fin 2 → ℝ`. These types are definitionally equal modulo the `PiLp` wrapper, but in practice interconversion requires coercions. + +- **`NonTrilinear`** in `FormalConjecturesForMathlib/Geometry/2d.lean:54` — Defined as `A.Triplewise (fun x y z ↦ ¬ Collinear ℝ {x, y, z})`, this captures the "no three collinear" case (equivalent to `AtMostKOnAnyLine 2`). However, it operates on `Set P` rather than `Finset`, and does not generalize to "no four on a line." + +- **`InGeneralPosition`** appears in several files (838.lean:40, 827.lean:38, 216.lean:52) but is always specialized to "no three collinear" and is not parametric. + +**Recommendation:** The `AtMostKOnAnyLine` definition is a reasonable local choice since it needs to handle both k=2 and k=3, and `NoKCollinear` from 960.lean uses a different point type. However, a shared utility (perhaps in `FormalConjecturesForMathlib/`) that unifies these parametric collinearity predicates using Mathlib's `Collinear ℝ` would reduce duplication across at least problems 589, 651, 735, 838, 846, and 960. If such a refactor is undertaken, using Mathlib's `Collinear ℝ` rather than the coordinate-level `a * p 0 + b * p 1 = c` encoding would be preferable for composability with other Mathlib lemmas. + +## 2. Citations + +The website ([erdosproblems.com/589](https://www.erdosproblems.com/589)) lists the following references: + +| Tag | Reference | +|-----|-----------| +| [Er84] | Erdős, P., *Some old and new problems on combinatorial geometry*, 1984 | +| [FuKa91] | Furstenberg, H. & Katznelson, Y. — Density Hales-Jewett theorem (proves g(n) = o(n)) | +| [Fu91b] | Füredi, Z. — Lower bound n^{1/2} log n ≪ g(n) | +| [BaSo18] | Balogh, J. & Solymosi, J. — Upper bound g(n) ≪ n^{5/6+o(1)} | + +The formalization's docstrings cite [Fu91b] and [BaSo18] correctly by theorem attribution. However: + +- **Missing:** The original problem source [Er84] is not cited in the module docstring or anywhere in the file. +- **Missing:** The [FuKa91] result (g(n) = o(n) via the density Hales-Jewett theorem) is mentioned in the module docstring as a known bound but is not attributed to Furstenberg–Katznelson. + +**Recommendation:** Add `[Er84]` as the primary reference and explicitly attribute the `g(n) = o(n)` result to [FuKa91] in the module docstring. + +## 3. Variants + +The website notes: + +1. **g(n) = o(n)** — Proved by Furstenberg–Katznelson via the density Hales-Jewett theorem. The formalization mentions this in the docstring ("o(n)") but does not formalize it as a separate theorem. This is a notable intermediate result that could be stated as a variant. + +2. **General (k, l) version** — The problem generalizes: for sets with no k collinear, find largest subset with no l collinear (3 ≤ l < k). The formalization only addresses the (4, 3) case. Since `AtMostKOnAnyLine` is already parametric, a generalized version would be straightforward to state. + +**Recommendation:** Consider adding: +- A `erdos_589.variants.sublinear` theorem formalizing g(n) = o(n). +- Optionally, a generalized (k, l) variant using the existing parametric `AtMostKOnAnyLine`. + +## 4. Readability + +The code is well-structured and readable: + +- `AtMostKOnAnyLine` has a clear docstring explaining both the "at most k" and "no k+1 collinear" interpretations. +- `erdos589_g` has a good docstring connecting it to the mathematical definition. +- The two theorems are clearly labeled as lower/upper bounds with proper attribution. +- The namespace `Erdos589` keeps definitions scoped. + +**Minor suggestions:** +- The module docstring could include the [Er84] original reference. +- The docstring mentions "Füredi [Fu91b]" proved the lower bound but also proved the upper half of the sandwich `g(n) = o(n)`. It may be clearer to separate these attributions (the o(n) upper bound is from [FuKa91], not [Fu91b]). + +## 5. Formalizability + +The problem is **precisely formalizable**. The statement "Let g(n) be maximal such that..." defines an extremal function over finite point sets in ℝ², which is a well-defined combinatorial optimization problem. + +**Ambiguity assessment: Low.** The only potential source of ambiguity is the meaning of "estimate g(n)," which is inherently open-ended. The formalization sidesteps this by formalizing specific known bounds rather than the vague "estimate" directive. This is the correct approach. + +The use of `sSup` for `erdos589_g` is well-defined because: +- The set `{m | ...}` is nonempty (m = 0 works trivially, taking T = ∅). +- The set is bounded above by n (since T ⊆ S and S.card = n). +- For `ℕ` with its `ConditionallyCompleteLattice` instance, `sSup` of a nonempty bounded set returns the maximum. + +## 6. Correctness + +**Definition correctness:** + +- `AtMostKOnAnyLine k S` checks that no subset of S of size k+1 lies on a common line. This is mathematically equivalent to "at most k points of S on any line." ✓ +- For k=3: no 4 points on a line (the hypothesis on the full set). ✓ +- For k=2: no 3 points on a line (the property of the chosen subset). ✓ +- The collinearity encoding via `∃ (a b c : ℝ), (a ≠ 0 ∨ b ≠ 0) ∧ ∀ p ∈ T, a * p 0 + b * p 1 = c` correctly characterizes points on a line in ℝ². The condition `a ≠ 0 ∨ b ≠ 0` correctly excludes the degenerate case. ✓ + +**`erdos589_g` correctness:** + +The definition `sSup {m : ℕ | ∀ S, S.card = n → AtMostKOnAnyLine 3 S → ∃ T, T ⊆ S ∧ m ≤ T.card ∧ AtMostKOnAnyLine 2 T}` captures "the largest m guaranteed across all valid inputs." This correctly defines g(n) as a minimax quantity: for every valid point set, there exists a good subset of size ≥ m. ✓ + +**Theorem statement correctness:** + +- **Lower bound** (`erdos_589`): States ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, g(n) ≥ C√n log n. This matches Füredi's result g(n) ≫ √n log n. ✓ +- **Upper bound** (`erdos_589.variants.upper_bound`): States ∀ ε > 0, ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, g(n) ≤ C · n^{5/6+ε}. This correctly encodes the Balogh–Solymosi bound g(n) ≪ n^{5/6+o(1)}, since the o(1) in the exponent means that for any ε > 0, n^{o(1)} ≤ n^ε for sufficiently large n. ✓ + +**Category tags:** + +Both theorems are tagged `category research solved`. While the overall problem ("estimate g(n)") is listed as **open** on the website (better bounds are sought), the individual bounds stated here are indeed proven results. The tags are appropriate for the specific theorems as stated. ✓ + +**Potential issue:** None identified. The formalization is mathematically correct and complete for the bounds it claims to capture. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | `AtMostKOnAnyLine` duplicates `NoKCollinear` from 960.lean; a shared utility would reduce duplication | +| Citations | Missing [Er84] and [FuKa91] attributions | +| Variants | Missing g(n) = o(n) variant and general (k,l) variant | +| Readability | Good overall; minor docstring improvements suggested | +| Formalizability | Fully formalizable, low ambiguity | +| Correctness | All definitions and theorem statements are mathematically correct ✓ | diff --git a/ai-review/59.md b/ai-review/59.md new file mode 100644 index 0000000000..ed757cb9c2 --- /dev/null +++ b/ai-review/59.md @@ -0,0 +1,78 @@ +# Review: Erdős Problem 59 + +## 1. Code Reuse + +**Several Mathlib definitions could replace the custom ones defined in this file.** + +- **`ContainsSubgraph`** (line 36–37): Mathlib now provides `SimpleGraph.Copy` (an injective graph homomorphism structure), `SimpleGraph.IsContained` (`A ⊑ B`, defined as `Nonempty (Copy A B)`), and `SimpleGraph.Free` (`¬A ⊑ B`). These are mathematically equivalent to the custom `ContainsSubgraph`. Using `H.Free F` in place of `¬ContainsSubgraph F H` would integrate better with Mathlib's extremal graph theory library. + +- **`turanNumber`** (line 41–44): Mathlib provides `SimpleGraph.extremalNumber n H`, defined as `sup { G : SimpleGraph (Fin n) | H.Free G } (#·.edgeFinset)`. This is cleaner than the custom definition, which quantifies over an arbitrary `(V : Type)` with `Fintype.card V = n` and uses `sSup` over projected edge counts. The Mathlib version directly works over `Fin n`, avoiding potential universe issues. + +- **`countGFreeGraphs`** (line 47–48): No direct Mathlib equivalent exists for counting H-free graphs. This definition is fine as-is. + +- **Broader codebase duplication**: At least 12 other Erdős problem files (60, 62, 146, 147, 180, 571, 572, 575, 576, 713, 714, 765) define essentially identical `ContainsSubgraph` and extremal number definitions. A shared utility would eliminate this duplication, but this is a codebase-wide concern, not specific to Problem 59. + +## 2. Citations + +The docstring references `[Er90, Er93, Er97c, Va99]` for the conjecture and `[EFR86]`, `[MoSa16]` for results. Comparing to [erdosproblems.com/59](https://www.erdosproblems.com/59): + +- The website cites **[Er93, p.335]** — the page number is missing from the formalization's docstring. +- The website cites **[Va99, 3.56]** — the section number is missing from the formalization's docstring. +- All other citations match: [Er90], [Er97c], [EFR86], [MoSa16]. + +**Recommendation**: Update the docstring to use `[Er93, p.335]` and `[Va99, 3.56]` for precision. + +## 3. Variants + +**Two variants mentioned on the website are not captured:** + +1. **Morris–Saxton weaker conjecture**: Morris and Saxton conjecture that the weaker bound `2^{O(ex(n;G))}` holds for *all* graphs G (i.e., there exists a constant C depending on G such that the count is at most `2^{C · ex(n;G)}`). This is a natural follow-up now that the original conjecture is disproved and could be formalized as a separate theorem/conjecture. + +2. **The C₄ case**: The website notes that the specific case G = C₄ is separately posed in [Va99]. This could be stated as a variant (it remains open whether the original bound holds for C₄, even though it fails for C₆). + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The docstrings are thorough and clearly explain the mathematical content, the disproof, and the positive result for non-bipartite graphs. +- The naming `countGFreeGraphs` uses "G" while the definition parameter is `H`. This is a minor inconsistency inherited from the problem statement (which uses G for the forbidden graph) vs. the common convention (H for the forbidden graph). Not a real issue, but `countHFreeGraphs` would be more consistent with the parameter name. +- The `turanNumber` definition signature has argument order `(H : SimpleGraph U) (n : ℕ)`, while Mathlib's `extremalNumber` uses `(n : ℕ) (H : SimpleGraph W)`. This difference could cause confusion for readers familiar with Mathlib. + +## 5. Formalizability + +**The problem is fully formalizable and the statement is unambiguous.** + +The original conjecture asks whether `#{G-free labeled graphs on n vertices} ≤ 2^{(1+o(1))·ex(n;G)}` for every graph G. This is a precise asymptotic statement. The formalization correctly unpacks the `o(1)` notation as: for every ε > 0, the bound `2^{(1+ε)·ex(n;G)}` holds for all sufficiently large n. This is a standard and correct way to formalize `1 + o(1)` in the exponent. + +The only minor subtlety is that the `o(1)` could in principle allow negative values approaching 0 (i.e., a lower bound tighter than `2^{ex(n;G)}`), while the ε-formulation only uses positive ε. However, since the conjecture is an *upper* bound, positive ε suffices — the formulations are equivalent in this context. + +**Assessment**: No ambiguity. Fully formalizable as stated. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`answer(False)`**: The conjecture was disproved, so `answer(False) ↔ P` encodes `False ↔ P`, i.e., `¬P`. This correctly states that the universally quantified bound does NOT hold for all graphs. + +- **Quantifier structure**: `∀ U H, ∀ ε > 0, ∃ N, ∀ n ≥ N, count ≤ 2^{(1+ε)·ex(n;H)}` correctly captures "for every graph H, eventually the count is at most `2^{(1+ε)·ex(n;H)}`" for all ε > 0. This is the right formalization of the `2^{(1+o(1))·ex(n;G)}` bound. + +- **`ContainsSubgraph`**: Correctly defines subgraph containment via injective homomorphism (not induced — adjacency is only required in the forward direction). This matches the standard combinatorial notion used in extremal graph theory. + +- **`turanNumber`**: Uses `sSup` over natural numbers. For graphs on `n` vertices, the set `{m | ...}` is bounded above by `n choose 2` and nonempty (the empty graph is always H-free with 0 edges), so `sSup` is well-behaved. However, the definition quantifies over `∃ (V : Type)` (universe `Type 0`) rather than using `Fin n` directly. This is mathematically equivalent but introduces an unnecessary universe dependency. The Mathlib `extremalNumber` definition avoids this. + +- **`countGFreeGraphs`**: Uses `Nat.card` on the subtype `{F : SimpleGraph (Fin n) // ¬ContainsSubgraph F H}`. Since `SimpleGraph (Fin n)` is a finite type, this subtype is also finite and `Nat.card` returns the correct cardinality. This is a correct formalization of the count of labeled H-free graphs. + +- **Potential well-definedness concern with `sSup`**: The `turanNumber` definition takes `sSup` of a set of natural numbers. In Mathlib, `sSup` on `ℕ` returns 0 for empty sets and for unbounded sets. The set is nonempty (the empty graph always qualifies) and bounded (by `n(n-1)/2`), so `sSup` behaves correctly. However, because the existential ranges over `V : Type` rather than `Fin n`, one must verify that Lean's type theory doesn't introduce issues with the supremum ranging over a proper class of witnesses — in practice the edge count `m` is still bounded, so the *set of m values* is a bounded subset of ℕ regardless. + +**Verdict**: The formalization is correct and complete. No mathematical flaws. The use of custom definitions rather than Mathlib's `extremalNumber` and `IsContained` is a stylistic/reuse concern, not a correctness issue. + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | Custom definitions could be replaced by Mathlib's `IsContained`/`Free`/`extremalNumber` | +| Citations | Missing page/section numbers: should be `[Er93, p.335]` and `[Va99, 3.56]` | +| Variants | Missing Morris–Saxton weaker conjecture (`2^{O(ex(n;G))}` for all G) and C₄ special case | +| Readability | Good overall; minor naming inconsistency (`countGFreeGraphs` vs parameter `H`) | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/593.md b/ai-review/593.md new file mode 100644 index 0000000000..4f1afe9482 --- /dev/null +++ b/ai-review/593.md @@ -0,0 +1,103 @@ +# Erdős Problem 593 — Review + +## 1. Code Reuse + +The codebase contains several other hypergraph definitions across Problems 832, 833, 836, 616, 716, and 1075. However, **Problem 593's `Hypergraph3` structure is appropriately distinct** from all of these: + +- **Problems 832, 833, 836** define `UniformHypergraph`/`Hypergraph` with `Finset (Finset V)` (finite edge sets) and `[DecidableEq V]`. Problem 593 correctly uses `Set (Finset V)` (potentially infinite edge sets) because the ambient hypergraph H may have uncountably many vertices and edges — essential for discussing uncountable chromatic number. +- **Problems 616, 1075** work on `Fin n` vertices, restricting to finite hypergraphs, which is unsuitable here. +- **FormalConjecturesForMathlib** provides `SimpleGraph.Coloring` and `chromaticNumber`/`chromaticCardinal` infrastructure, but these are for 2-uniform graphs, not 3-uniform hypergraphs. No existing Mathlib hypergraph coloring API exists that could be reused. + +**Verdict:** No meaningful code reuse opportunity. The self-contained definitions are justified by the problem's requirements (arbitrary type-level vertices, uncountable chromatic number via `Set`-based edges). + +## 2. Citations + +The formalization references: +- `[EGH75]` — Erdős, P., Galvin, F., and Hajnal, A. +- `[Er95d]` — Erdős, P. + +The website (erdosproblems.com/593) lists the same two references with the same tags. Neither the formalization nor the website provides full publication details (journal, title, page numbers) for these references. The formalization is consistent with the website. + +The website also mentions a **$500 prize** for this problem, which is not noted in the formalization. This is not an error but could be of interest. + +## 3. Variants + +The website states the problem as: *"Characterize those finite 3-uniform hypergraphs which appear in every 3-uniform hypergraph of chromatic number > ℵ₀."* + +The formalization captures this as a single biconditional conjecture: the obligatory hypergraphs are exactly the 2-colorable ones, by analogy with the known graph result. This is a reasonable formalization of the "characterize" question — it proposes a concrete answer and asserts it as an iff. + +The website does not mention additional variants beyond the main characterization problem. The docstring's discussion of the graph analogy (bipartite graphs vs. odd cycles) provides helpful context. + +**No missing variants identified.** + +## 4. Readability + +The code is well-structured and readable: +- Each definition has a clear docstring explaining the mathematical concept. +- The namespace `Erdos593` prevents name collisions with the many other hypergraph definitions in the codebase. +- The theorem statement reads naturally as a biconditional. +- The module docstring provides good mathematical context. + +**Minor suggestion:** The `ContainsCopy` definition could clarify in its docstring that this is a *non-induced* subhypergraph embedding (only edges of F must map to edges of H; non-edges of F are unconstrained). This is the correct notion for the problem but could be made explicit. + +## 5. Formalizability + +**Assessment: Moderate ambiguity in the original, well-resolved by the formalization.** + +The original problem says "characterize" without proposing a specific answer. The formalization makes the reasonable choice of conjecturing that the answer is 2-colorability, based on the graph analogy that Erdős himself describes. This is a well-motivated conjecture rather than a known fact. + +Key formalization decisions that are mathematically sound: +- **Proper coloring** = no monochromatic edge (∃ two vertices in each edge with different colors). This is the standard hypergraph coloring convention. +- **Uncountable chromatic number** = no proper coloring with countably many colors. This correctly captures "chromatic number > ℵ₀". +- **"Appears in"** = injective vertex map sending edges to edges. This is the standard subhypergraph containment notion. + +The one genuine ambiguity is whether the conjecture (2-colorability ↔ obligatory) is the "right" characterization. The formalization is transparent about this being conjectural. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definitions + +1. **`Hypergraph3`**: Uses `Set (Finset V)` for edges with a uniformity constraint. This allows infinite edge sets on arbitrary vertex types, which is necessary for hypergraphs with uncountable chromatic number. ✓ + +2. **`IsProperColoring`**: `∀ e ∈ H.edges, ∃ x ∈ e, ∃ y ∈ e, c x ≠ c y` — correctly states that no edge is monochromatic. For 3-element edges, this is equivalent to saying each edge uses at least 2 colors, which is the standard notion. ✓ + +3. **`HasUncountableChromaticNumber`**: `∀ (C : Type*) [Countable C], ¬∃ c : V → C, H.IsProperColoring c` — correctly asserts that no countable color set suffices. This is exactly "chromatic number > ℵ₀". ✓ + +4. **`ContainsCopy`**: `∃ f : W ↪ V, ∀ e ∈ F.edges, e.map f ∈ H.edges` — uses an injective map (embedding) that sends each edge of F to an edge of H. `Finset.map` with an embedding preserves cardinality, so the image of a 3-element edge is a 3-element set. This correctly captures subhypergraph containment. ✓ + +5. **`Is2Colorable`**: `∃ c : V → Bool, H.IsProperColoring c` — existence of a proper 2-coloring. ✓ + +### Theorem Statement + +```lean +theorem erdos_593 (W : Type*) [Fintype W] + (F : Hypergraph3 W) : + (∀ (V : Type*) (H : Hypergraph3 V), + H.HasUncountableChromaticNumber → H.ContainsCopy F) ↔ + F.Is2Colorable +``` + +This says: a finite 3-uniform hypergraph F is contained in every 3-uniform hypergraph of uncountable chromatic number **if and only if** F is 2-colorable. This correctly captures both directions: +- (→) If F is obligatory, then F must be 2-colorable. +- (←) If F is 2-colorable, then F is obligatory. + +The `[Fintype W]` constraint ensures F is finite (finitely many vertices, and hence finitely many possible 3-element edges). The universally quantified `V : Type*` allows the ambient hypergraph to live in any universe, which is appropriate. + +**No mathematical flaws identified.** + +### One Technical Note + +The `edges` field of `Hypergraph3 W` for the finite hypergraph F is a `Set (Finset W)`, which in principle could be any set of 3-element subsets (including a non-computable one). Since W is `Fintype`, there are only finitely many 3-element subsets of W, so any such set is automatically finite. This is technically correct but means F's edge set is not explicitly required to be finite — it is implicitly finite by the `Fintype` constraint on vertices. This is fine mathematically. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities; self-contained definitions are justified | +| Citations | Consistent with erdosproblems.com/593; no additional details available | +| Variants | Complete — no missing variants | +| Readability | Good; minor suggestion to clarify non-induced embedding | +| Formalizability | Well-formalized; the conjectured characterization is well-motivated | +| Correctness | **Correct and complete** | diff --git a/ai-review/594.md b/ai-review/594.md new file mode 100644 index 0000000000..2a4d9c7231 --- /dev/null +++ b/ai-review/594.md @@ -0,0 +1,133 @@ +# Review: Erdős Problem 594 + +## 1. Code Reuse + +**Significant duplication exists.** Three definitions in `Erdos594` are duplicated verbatim across many files: + +| Definition | Duplicated in | +|---|---| +| `cycleGraph` | 551, 552, 554, 555, 556, 569, 570, 572, 666, 720, 737, 765, 86, and others (~17 files total) | +| `ContainsCopy` | Multiple files under various names (`ContainsSubgraph`, `ContainsSubgraphCopy`, `Embeds`) | +| `HasUncountableChromaticNumber` | 737.lean (identical definition) | + +**Mathlib alternatives:** +- **`cycleGraph`**: Mathlib provides `SimpleGraph.cycleGraph : (n : ℕ) → SimpleGraph (Fin n)` in `Mathlib.Combinatorics.SimpleGraph.Circulant`, defined via `circulantGraph {1}`. It handles all `n` (returning `⊥` for `n = 0`) without requiring a proof obligation `m ≥ 3`. The hand-rolled version is extensionally equivalent for `m ≥ 3` but less idiomatic. +- **`ContainsCopy`**: This is essentially an injective graph homomorphism. Mathlib has `SimpleGraph.Hom` and related infrastructure (`H →g G`). The predicate could potentially be expressed using `SimpleGraph.IsContained` or similar, though the exact API match should be verified. +- **`HasUncountableChromaticNumber`**: The `FormalConjecturesForMathlib` file defines `chromaticCardinal` (line 136 of `Coloring.lean`) as `sInf {κ : Cardinal | ∃ (C : Type u) (_ : Cardinal.mk C = κ), Nonempty (G.Coloring C)}`. The predicate `HasUncountableChromaticNumber` could be expressed as `Cardinal.aleph 1 ≤ G.chromaticCardinal` or equivalently `Cardinal.omega < G.chromaticCardinal`, which would connect to the existing infrastructure. + +**Recommendation:** All three definitions should be factored into shared utility files. At minimum, `cycleGraph` and `HasUncountableChromaticNumber` should be shared with Problem 737, which is explicitly related and uses identical definitions. + +## 2. Citations + +**Website (erdosproblems.com/594):** +- Problem statement: "Does every graph G with chromatic number ≥ ℵ₁ contain all sufficiently large odd cycles?" +- Status: Proved (solved in the affirmative) +- References: ErHa66, Er69b, EHS74 +- Related problems: 593, 737 +- Tags: Graph theory, Set theory + +**Formalization citations:** +- [ErHa66] Erdős, P. and Hajnal, A., *On chromatic number of graphs and set-systems*, Acta Math. Acad. Sci. Hung. **17** (1966), 61–99. ✓ +- [Er69b] Erdős, P., *Problems and results in combinatorial analysis and graph theory*, Proof Techniques in Graph Theory (1969), 27–35. ✓ +- [EHS74] Erdős, P., Hajnal, A., and Shelah, S., *On some general properties of chromatic numbers*, Topics in Topology, Colloq. Math. Soc. Janos Bolyai **8** (1974), 243–255. ✓ + +**Assessment:** All three references are documented with full bibliographic details. The website uses the same shorthand codes (ErHa66, Er69b, EHS74), so the formalization is consistent. The website notes that Problems 593 and 737 are related; the docstring mentions Problem 594's connection via [EHS74] but does not cross-reference 593 or 737 explicitly. This is acceptable since the formalization focuses on its own statement. + +## 3. Variants + +The website states the problem simply as: "Does every graph G with chromatic number ≥ ℵ₁ contain all sufficiently large odd cycles?" It was proved true by Erdős, Hajnal, and Shelah. + +The formalization captures the core problem. However, there are natural variants worth considering: + +1. **All cycles (not just odd):** The related Problem 593 asks whether such graphs contain all sufficiently large *even* cycles as well. The EHS74 paper actually proves the result for all sufficiently large cycles (both odd and even). The formalization restricts to odd cycles as stated in the original Erdős–Hajnal question, which is correct to the problem as posed. + +2. **Edge-through variant:** Problem 737 strengthens this to ask whether there exists an *edge* through which all sufficiently large cycles pass. This is a separate problem (proved by Thomassen), correctly formalized in 737.lean. + +3. **Finite chromatic number threshold:** The problem specifically concerns chromatic number ≥ ℵ₁ (uncountable). One could ask about finite but large chromatic number — this is captured by Problem 921 (minimum odd cycle length as a function of chromatic number and vertex count). + +**Assessment:** The formalization captures the single variant stated on the website. No variants are missing from what the website presents. + +## 4. Readability + +**Strengths:** +- The docstrings are clear and mathematically precise. +- The namespace `Erdos594` properly scopes the definitions. +- The theorem statement reads naturally: for any graph with uncountable chromatic number, there exists N₀ such that all odd n ≥ N₀ (with n ≥ 3) yield a cycle C_n as a subgraph. + +**Weaknesses:** +- The `cycleGraph` definition uses raw modular arithmetic rather than Mathlib's circulant-based definition, which is less idiomatic. +- The `ContainsCopy` name is slightly non-standard; `ContainsSubgraph` or `IsContained` would be more conventional. Problem 737 uses an equivalent but differently-structured definition for cycle containment. +- Using Mathlib's `SimpleGraph.cycleGraph` would eliminate the `(hn : n ≥ 3)` proof obligation throughout, simplifying the theorem statement from `∀ (n : ℕ) (hn : n ≥ 3), Odd n → n ≥ N₀ → ContainsCopy G (cycleGraph n hn)` to something cleaner. + +**Overall readability: Good.** The code is well-structured and clearly conveys the mathematical content. + +## 5. Formalizability + +The problem as stated is precise and clearly formalizable: +- "Graph with chromatic number ≥ ℵ₁" — well-defined (uncountable chromatic number). +- "Contains all sufficiently large odd cycles" — well-defined (existence of N₀ threshold, containment as a subgraph via injective adjacency-preserving map). +- "Odd cycle C_n" — well-defined (cycle graph on n vertices with n odd). + +**Ambiguity assessment: Very low.** The only potential subtlety is the meaning of "contains" — whether it means subgraph (injective homomorphism preserving adjacency) or induced subgraph (preserving both adjacency and non-adjacency). The formalization uses the weaker notion (subgraph), which is the standard interpretation in this context and is correct: the EHS74 result establishes the existence of cycle subgraphs, not necessarily induced ones. This is also the appropriate choice since odd cycles as subgraphs implies odd cycles as (topological) minors. + +**Formalizability rating: Excellent.** No ambiguity issues. + +## 6. Correctness + +### Definition: `HasUncountableChromaticNumber` + +```lean +def HasUncountableChromaticNumber {V : Type*} (G : SimpleGraph V) : Prop := + ∀ (α : Type*) [Countable α], IsEmpty (G.Coloring α) +``` + +This states that no proper coloring exists with any countable color set. This correctly captures "chromatic number ≥ ℵ₁". A graph has chromatic number < ℵ₁ iff it is colorable by some countable type, so the negation (no countable coloring exists) is equivalent to chromatic number ≥ ℵ₁. **Correct.** + +### Definition: `cycleGraph` + +```lean +def cycleGraph (m : ℕ) (_ : m ≥ 3) : SimpleGraph (Fin m) where + Adj i j := i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m) +``` + +For m ≥ 3, this defines i ~ j iff they differ by exactly 1 mod m. The `i ≠ j` guard is technically redundant for m ≥ 3 (since (i+1) % m ≠ i when m ≥ 2), but it makes the `loopless` proof trivial. The symmetry and loopless proofs are correct. **Correct.** + +### Definition: `ContainsCopy` + +```lean +def ContainsCopy {V W : Type*} + (G : SimpleGraph V) (H : SimpleGraph W) : Prop := + ∃ f : W → V, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v) +``` + +This is a standard definition of (non-induced) subgraph containment via injective graph homomorphism. **Correct.** + +### Theorem: `erdos_594` + +```lean +theorem erdos_594 : answer(True) ↔ + ∀ {V : Type*} (G : SimpleGraph V), + HasUncountableChromaticNumber G → + ∃ N₀ : ℕ, ∀ (n : ℕ) (hn : n ≥ 3), Odd n → n ≥ N₀ → + ContainsCopy G (cycleGraph n hn) := by + sorry +``` + +The statement says: "It is true that every graph with uncountable chromatic number contains, as a subgraph, every sufficiently large odd cycle." This faithfully captures the problem from erdosproblems.com/594. + +**Potential concern — universe polymorphism:** The statement quantifies over `{V : Type*}`, which means it quantifies over types in some universe. The `HasUncountableChromaticNumber` definition also quantifies over `(α : Type*)` for the color type. In principle, one should ensure that the universe levels are consistent — the color type α should range over at least the same universe as V. In Lean 4 with `Type*`, this is handled via universe polymorphism and should be fine, but it is worth noting that the mathematical statement is about a single graph (in a fixed set-theoretic universe), while the formalization implicitly works across all Lean universes. This is standard practice in Lean formalizations and not a flaw. + +**Potential concern — the existential N₀ is independent of G:** The formalization places `∃ N₀` *inside* the universal quantifier over G, so N₀ can depend on G. This is correct: the EHS74 result says that for *each* such graph G, there exists a threshold N₀(G) beyond which all odd cycles appear. A stronger claim (uniform N₀ independent of G) would be false, since one can construct graphs with uncountable chromatic number that avoid any single fixed odd cycle. + +**Assessment: Correct and complete.** The formalization accurately captures the mathematical content of the problem. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | ⚠️ Needs work — `cycleGraph`, `ContainsCopy`, and `HasUncountableChromaticNumber` are duplicated across many files; Mathlib alternatives exist for `cycleGraph` | +| Citations | ✅ All three references match the website with full bibliographic details | +| Variants | ✅ The single variant on the website is captured | +| Readability | ✅ Good — clear docstrings and well-structured code | +| Formalizability | ✅ Excellent — no ambiguity in the mathematical statement | +| Correctness | ✅ Correct and complete — faithful to the mathematical content | diff --git a/ai-review/595.md b/ai-review/595.md new file mode 100644 index 0000000000..96834c47d1 --- /dev/null +++ b/ai-review/595.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 595 + +## 1. Code Reuse + +The formalization expresses "union of countably many triangle-free graphs" manually via an indexed family `H : ℕ → SimpleGraph V` with subgraph and covering conditions. There is no pre-existing utility in `FormalConjecturesForMathlib` for graph union/decomposition — the ad-hoc pattern used here is the standard idiom throughout the codebase (cf. Erdős 1017 for edge partitions). + +However, there is a **strong conceptual connection to graph coloring** that could be leveraged. Expressing "G is the union of countably many triangle-free graphs" is equivalent to saying there exists a proper edge-coloring `c : V → V → ℕ` of G such that each color class is triangle-free. This is closely related to the notion of `Colorable` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`, though that file deals with vertex colorings rather than edge-class decompositions with a triangle-free constraint. The `colorable_iff_induce_eq_bot` theorem (line 108) shows the pattern of expressing colorability via induced subgraphs equaling `⊥`, which is analogous but not directly reusable here since the constraint is triangle-freeness rather than independence. + +**Verdict:** No directly reusable code. The current approach is idiomatic for this codebase. + +## 2. Citations + +**Website (erdosproblems.com/595) states:** +- Problem of Erdős and Hajnal +- Status: **Open**, $250 prize +- Tags: Graph theory, Set theory +- References: [Er87], [Fo70], [NeRo75] +- Related problems: 582, 596 +- Contributor: Noga Alon + +**Formalization docstring includes:** +- [Er87] Erdős, P., *Some problems and results on combinatorial number theory*, Graph theory and its applications: East and West (1987). ✓ +- [Fo70] Folkman, J., *Graphs with monochromatic complete subgraphs in every edge coloring*, SIAM J. Appl. Math. 18 (1970), 19-24. ✓ +- [NeRo75] Nešetřil, J. and Rödl, V., *The Ramsey property for graphs with forbidden complete subgraphs*, J. Combinatorial Theory Ser. B 20 (1976), 243-249. ✓ + +**Issue:** The docstring cites [Er87] as *"Some problems and results on combinatorial number theory"* but the website and problem context refer to it as *"Some problems and results in combinatorial number theory"* (note "in" vs "on"). The website may also cite this paper slightly differently. Additionally, the [NeRo75] citation says the year is 1975 in the tag but the body says 1976 — the actual publication year is 1976, so the tag [NeRo75] is slightly misleading (though this appears to match the website convention). These are minor discrepancies. + +**Missing:** The formalization does not mention the $250 prize, the related problems (582, 596), the "Set theory" tag, or the contribution of Noga Alon. These are informational and not strictly required. + +## 3. Variants + +The website lists a single problem statement: *"Is there an infinite graph G which contains no K₄ and is not the union of countably many triangle-free graphs?"* + +The formalization captures exactly this statement. The docstring also mentions the finite version (Folkman [Fo70] and Nešetřil–Rödl [NeRo75]: for every n ≥ 1, there exists a K₄-free graph that is not the union of n triangle-free graphs), which provides important context but is not formalized here — appropriately so, since it is a known result rather than the open problem. + +Problem 596 generalizes this to arbitrary pairs (G₁, G₂) and is formalized separately. Problem 582 captures the base case (Folkman's theorem for 2-colorings). The relationship between 595 and these problems is well-handled by separate files. + +**Verdict:** All variants are appropriately captured. The single open problem is formalized; the known finite results are documented in the docstring for context. + +## 4. Readability + +The code is clean and readable. A few observations: + +- The decomposition `∃ (H : ℕ → SimpleGraph V), (∀ i, H i ≤ G) ∧ (∀ i, (H i).CliqueFree 3) ∧ (∀ u v, G.Adj u v → ∃ i, (H i).Adj u v)` is long but clear. Each conjunct has an obvious reading: (1) subgraphs of G, (2) each triangle-free, (3) cover all edges. +- The use of `answer(sorry)` for the `↔` wrapper is consistent with the codebase convention for open problems. +- The namespace `Erdos595` and theorem name `erdos_595` follow established conventions. + +**Minor suggestion:** The type `V : Type` (without universe annotation) is used. This is fine for the statement but could theoretically be universe-restricted. Other problems in the codebase use `Type*` or explicit universe annotations. This is a very minor stylistic point and not a real issue. + +## 5. Formalizability + +The problem statement is **highly precise and clearly formalizable**: + +- "Infinite graph" → `Infinite V` + `SimpleGraph V` ✓ +- "Contains no K₄" → `CliqueFree 4` ✓ +- "Union of countably many triangle-free graphs" → indexed family over `ℕ` of subgraphs covering all edges ✓ + +There is essentially **no ambiguity** in this problem. The only potential ambiguity is what "union" means precisely — whether it requires the subgraphs to be edge-disjoint (partition) or merely covering. The standard combinatorial reading is "covering" (not necessarily disjoint), and the formalization correctly uses this interpretation via `∀ u v, G.Adj u v → ∃ i, (H i).Adj u v` rather than requiring disjointness. + +**Ambiguity assessment: Very low.** The statement is a clean yes/no question with standard graph-theoretic terminology. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +**Detailed analysis:** + +1. **Existential structure:** The problem asks "Is there an infinite graph G...?" The formalization wraps this as `answer(sorry) ↔ ∃ ...`, meaning the answer is True iff such a graph exists. This is correct for an open yes/no question. + +2. **K₄-freeness:** `G.CliqueFree 4` correctly captures "contains no K₄" (no complete subgraph on 4 vertices). + +3. **Triangle-free decomposition:** The negated condition `¬∃ (H : ℕ → SimpleGraph V), ...` correctly states that no decomposition into countably many triangle-free subgraphs exists. Specifically: + - `∀ i, H i ≤ G` — each H_i is a subgraph of G (edges of H_i are a subset of edges of G). ✓ + - `∀ i, (H i).CliqueFree 3` — each H_i is triangle-free. ✓ + - `∀ u v, G.Adj u v → ∃ i, (H i).Adj u v` — every edge of G is covered by some H_i. ✓ + +4. **Countability:** Using `ℕ` as the index type correctly captures "countably many." ✓ + +5. **Vertex type:** Using `V : Type` (in a single universe) is appropriate. The existential `∃ (V : Type)` doesn't restrict to any particular cardinality beyond the `Infinite V` constraint, which is correct. + +6. **Edge vs. vertex union:** The formalization correctly treats the "union" as an edge-covering decomposition. The subgraphs all share the same vertex type V, and the covering condition is on edges. This is the standard interpretation. + +**Potential subtlety:** One could ask whether the subgraphs `H i` should be allowed to have different vertex sets. The current formalization forces all subgraphs to have the same vertex type `V` as `G`, which is fine because any subgraph of `G` can be expressed as a `SimpleGraph V` where some vertices are simply isolated. This does not restrict generality. + +**Verdict: Correct.** No mathematical flaws identified. The formalization faithfully captures the problem as stated on erdosproblems.com. diff --git a/ai-review/596.md b/ai-review/596.md new file mode 100644 index 0000000000..44e1cf15b2 --- /dev/null +++ b/ai-review/596.md @@ -0,0 +1,114 @@ +# AI Review: Erdős Problem 596 + +## 1. Code Reuse + +The `HasMonochromaticCopy` definition in `Erdos596` is locally defined but captures a standard Ramsey-theoretic concept. Several existing codebase utilities are relevant: + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`** — Contains chromatic number lemmas, anti-Ramsey numbers (`antiRamseyNum`), and rainbow homomorphisms (`IsRainbow`). The `HasMonochromaticCopy` concept is the dual of rainbow coloring; however, none of these definitions directly subsume it. +- **`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`** — Defines `hypergraphRamsey` for 2-colored uniform hypergraph Ramsey numbers. This is structurally related but operates in a different setting (hypergraphs, 2 colors). +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`** — Defines `sizeRamsey G H` (minimum edges guaranteeing monochromatic copy in 2-colorings). Conceptually related but specialized to 2 colors and edge-count minimization. +- **Mathlib's `SimpleGraph.Copy` and `SimpleGraph.Free`** — Provide `G ⊑ H` (non-induced containment) and `G.Free H` (non-induced freeness). Problem 596 uses `IsEmpty (G₁ ↪g H)` instead, which expresses *induced* subgraph-freeness (see Correctness section). + +**Verdict:** The `HasMonochromaticCopy` definition is reasonable as a local definition. It could potentially be promoted to `ForMathlib` since it captures a fundamental Ramsey-theoretic concept used across multiple problems (cf. problem 609's similar `HasMonoCycle609`). No existing definition can replace it directly. + +## 2. Citations + +**Website (erdosproblems.com/596):** The only citation listed is `[Er87]` — Erdős, P. + +**Formalization docstring cites:** +- `[Er87] Erdős, P., _Some problems and results in combinatorial number theory_ (1987).` + +**Issue:** The title in the formalization says "combinatorial number theory" but the website does not provide the full title. Comparing with problem 595's docstring, which cites the same paper as: +> `[Er87] Erdős, P., _Some problems and results on combinatorial number theory_, Graph theory and its applications: East and West (1987).` + +The 596 docstring is missing the venue "Graph theory and its applications: East and West" and uses slightly different wording ("in" vs "on"). **The citation should be updated to match the full form used in 595.** + +Additionally, the docstring mentions Nešetřil–Rödl and Erdős–Hajnal results but does not provide formal citation entries for these. The website confirms these attributions but also does not provide full references. This is acceptable for a docstring but could be improved. + +## 3. Variants + +The problem as stated on erdosproblems.com asks "For which graphs G₁, G₂ is it true that..." — this is a classification question. The formalization captures the existential form: "there exist G₁, G₂ such that both properties hold." + +**Assessment:** The existential formulation is appropriate. The full classification problem ("characterize all such pairs") is not formalizable as a single theorem statement without specifying what the characterization looks like. The docstring correctly notes that "the full characterization of all such pairs remains open." The formalization captures the core resolved content (existence of such a pair) and is tagged `solved`, which is consistent. + +**No missing variants.** The problem is fundamentally about the existence of a counterexample to the Erdős–Hajnal conjecture, and the formalization captures exactly this. + +## 4. Readability + +The code is well-structured and readable: + +- The `HasMonochromaticCopy` definition has a clear docstring explaining the mathematical meaning. +- The main theorem has inline comments explaining parts (a) and (b). +- The namespace `Erdos596` prevents name collisions. +- The module docstring provides good mathematical context. + +**Minor suggestions:** +- The coloring `c : V → V → α` (and `c : V → V → Fin n`, `c : V → V → ℕ`) is a function on ordered pairs of vertices, not on edges. This is a common convention but means `c u v` and `c v u` are independent values. The `HasMonochromaticCopy` definition only checks `c (φ u) (φ v)` for adjacent pairs, so the coloring need not be symmetric. This is mathematically fine (the existential quantification absorbs it) but could be noted for clarity. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- "G₁-free graph" is well-defined (no copy of G₁ as a subgraph). +- "n-coloring of the edges" is standard (function from edges to Fin n). +- "Monochromatic copy of G₂" is standard. +- "ℵ₀-coloring" means countably many colors (ℕ-valued coloring). +- The existential form ("there exist G₁, G₂") is unambiguous. + +The only subtle point is the distinction between "subgraph" and "induced subgraph" — see Correctness. + +## 6. Correctness + +### 6a. Induced vs. Non-Induced Subgraph Freeness + +**This is the most significant issue in the formalization.** + +The formalization uses `IsEmpty (G₁ ↪g H)` to express "H is G₁-free." Since `↪g` is `SimpleGraph.Embedding` (a `RelEmbedding`), this means the embedding preserves adjacency *in both directions* — i.e., it finds an *induced* copy. Therefore `IsEmpty (G₁ ↪g H)` means "H has no induced copy of G₁." + +However, the standard graph-theoretic meaning of "G₁-free" (or "H contains no G₁") typically means H has no copy of G₁ as a *subgraph* (not necessarily induced). That is, the standard notion requires only that if u,v are adjacent in G₁ then φ(u), φ(v) are adjacent in H — but does NOT require that non-adjacent vertices in G₁ map to non-adjacent vertices in H. + +**For the known example G₁ = C₄:** The distinction between "no C₄ as a subgraph" and "no induced C₄" matters. A graph can contain an induced C₄ without containing C₄ as a subgraph (impossible — induced ⊂ subgraph), but more importantly, a graph can contain C₄ as a subgraph without containing an induced C₄ (e.g., K₄ contains C₄ as a subgraph but not as an induced subgraph since the extra diagonal edges break the induced property). So "C₄-free" (no subgraph copy) is a *stronger* condition than "no induced C₄." + +The Nešetřil–Rödl theorem and the Erdős–Hajnal result about C₄-free graphs refer to the standard (subgraph) notion of C₄-freeness. **The formalization should use `SimpleGraph.Free` or `SimpleGraph.Copy` (non-induced containment) rather than `↪g` (induced embedding).** + +Mathlib provides: +- `G₁ ⊑ H` (`SimpleGraph.IsContained`) — non-induced containment via `SimpleGraph.Copy` +- `G₁.Free H` — defined as `¬(G₁ ⊑ H)` + +**The correct formulation would replace `IsEmpty (G₁ ↪g H)` with something expressing non-induced freeness.** Note that problem 595 avoids this issue by using `G.CliqueFree 4` (which is defined in terms of clique sets, not embeddings). + +**Severity: Moderate to High.** The statement is provably weaker than intended for part (a) (existential over H satisfying the stronger induced-freeness condition, which is easier to satisfy) and provably stronger than intended for part (b) (universal over H satisfying induced-freeness only, which excludes some graphs that should be covered). The conjunction could potentially still be satisfiable but would not capture the intended mathematical content. + +### 6b. The `HasMonochromaticCopy` Definition + +The definition: +```lean +def HasMonochromaticCopy ... (c : V → V → α) : Prop := + ∃ (φ : G ↪g H) (color : α), ∀ u v, G.Adj u v → c (φ u) (φ v) = color +``` + +Uses `G ↪g H` (induced embedding) to find the monochromatic copy. For monochromatic copies, this is the *wrong direction* of strictness: using an induced embedding makes it *harder* to find a monochromatic copy (since the embedding must also reflect non-adjacency). The standard notion requires only a graph homomorphism that is injective and preserves adjacency — i.e., a `SimpleGraph.Copy` or injective homomorphism. + +**However**, for part (a), using `↪g` in `HasMonochromaticCopy` makes the statement *stronger* (harder to satisfy, since we require monochromatic induced copies), so if it's provable, it implies the standard version. For part (b), using `↪g` makes the statement *weaker* (easier to avoid induced monochromatic copies). So both uses of `↪g` introduce issues, but in opposite directions. + +### 6c. Coloring Domain + +The coloring `c : V → V → Fin n` is defined on all ordered pairs of vertices, not just edges. This is fine — it's a standard over-specification that doesn't affect correctness since `HasMonochromaticCopy` only evaluates `c` on pairs that are adjacent in H. + +### 6d. Tag: `solved` + +The problem is tagged `@[category research solved, AMS 5]`. The website marks the problem as **OPEN** (the full classification remains open), but the existential statement (existence of at least one such pair) is indeed resolved. The tag is defensible given that the formalized statement is the existential version, but a note in the docstring acknowledging the discrepancy with the website's "open" status would be helpful. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `HasMonochromaticCopy` is reasonable as local def; no exact match in codebase | +| Citations | Citation missing venue; should match problem 595's fuller form | +| Variants | Existential formulation appropriately captures resolved content | +| Readability | Good; clear docstrings and comments | +| Formalizability | High; problem is precise and unambiguous | +| Correctness | **Issue: uses induced embeddings (`↪g`) instead of non-induced containment for "G₁-free" and monochromatic copies. Should use `SimpleGraph.Copy`/`SimpleGraph.Free` or injective homomorphisms instead.** | + +**Overall:** The formalization captures the right mathematical spirit but has a technically incorrect use of induced graph embeddings where non-induced subgraph containment is intended. This is the primary issue to address. diff --git a/ai-review/597.md b/ai-review/597.md new file mode 100644 index 0000000000..e5e060e44b --- /dev/null +++ b/ai-review/597.md @@ -0,0 +1,68 @@ +# AI Review: Erdős Problem 597 + +## 1. Code Reuse + +**`OrdinalSet`**: The abbreviation `abbrev OrdinalSet (α : Ordinal) := {a : Ordinal // a < α}` is duplicated verbatim in at least three files: `597.lean`, `118.lean`, and `601.lean`. This could be extracted to a shared utility module (e.g., under `FormalConjecturesForMathlib/SetTheory/Ordinal/`) to avoid repetition. + +**`OrdGraphPartition`**: This is a novel hybrid definition combining the ordinal partition relation with a graph embedding (rather than a second ordinal). It is closely related to: +- `OrdPartition` in `118.lean` (standard α → (β, γ)² with two ordinals) +- `OrdinalCardinalRamsey` in `FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean` (α → (β, c)² with a cardinal instead of an ordinal/graph) + +The `OrdGraphPartition` definition is structurally distinct enough that direct reuse of those alternatives is not feasible — it genuinely requires a graph-specific second alternative. However, if more problems of this shape arise, a shared parametric definition could be considered. + +**`ContainsBiclique`**: This definition is unique to `597.lean`. The related `807.lean` defines `IsBicliqueCover` (decomposing into bicliques), which serves a different purpose. No existing codebase definition can replace `ContainsBiclique`. + +## 2. Citations + +The formalization references: +- **[Er87]** — Listed as: Erdős, P., *Some problems on finite and infinite graphs*, 1987. +- **[Va99]** — Listed as: Todorcevic, S., *Partition Problems in Topology*, 1999, Problem 7.84. + +**Issue with [Va99]:** The abbreviation "Va" does not correspond to the author Todorcevic (which would conventionally be abbreviated "To"). Furthermore, Todorcevic's *Partition Problems in Topology* was published in 1989 (Contemporary Mathematics, Volume 84, AMS), not 1999. The "7.84" in the website reference code "Va99,7.84" might refer to Problem 7.84 in a different source, or the "84" could be a conflation with the volume number. This citation should be verified and corrected — either the author attribution is wrong (it may refer to a different work by a "Va..." author) or the abbreviation/year should be corrected to match Todorcevic's 1989 publication. + +The website (erdosproblems.com/597) lists references "Er87" and "Va99,7.84" without further bibliographic detail, so the formalization's expansion of these is a best-effort interpretation. The Er87 reference appears consistent with the standard Erdős reference. + +## 3. Variants + +The website mentions a **secondary question about finite graphs G** specifically: whether the relation holds when G is a finite graph that is K₄-free (without needing the K_{ℵ₀,ℵ₀}-free condition, which is automatic for finite graphs). The current formalization does not separately state this finite variant. Since `¬ContainsBiclique G (aleph 0)` is trivially satisfied for any finite graph, the main statement does subsume the finite case, but the finite case is mathematically interesting in its own right and could be stated as a separate corollary or variant for clarity. + +## 4. Readability + +The code is well-structured and readable: +- The module docstring clearly explains the problem context, known results, and historical motivation. +- Each definition (`OrdinalSet`, `ContainsBiclique`, `OrdGraphPartition`) has a descriptive docstring with mathematical notation. +- The `OrdGraphPartition` docstring carefully explains both alternatives (order-embedded copy for color 0, graph copy for color 1). +- Naming is clear and consistent. + +**Minor suggestion:** The docstring for `OrdGraphPartition` could note that `f` is not required to be symmetric — only the "upper triangle" (i < j) is consulted — to preempt potential confusion for readers familiar with the standard formulation over unordered pairs. + +## 5. Formalizability + +The problem is a yes/no open question: does the partition relation ω₁² → (ω₁·ω, G)² hold for all graphs G satisfying the stated conditions? This is formalized using `answer(sorry)`, which is appropriate for an open problem whose truth value is unknown. + +The underlying mathematical concepts — ordinal partition relations, order embeddings, clique-freeness, biclique containment — are all well-defined and precisely formalizable. The statement involves no significant ambiguity; all quantifiers and conditions are clear. + +**Ambiguity level: Low.** The only minor interpretive question is whether "copy of G" means subgraph or induced subgraph in the color-1 graph. The standard convention in partition calculus is subgraph containment, which is what the formalization implements. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the main statement. + +**Ordinal arithmetic is correct:** +- `(aleph 1).ord ^ 2` is ω₁², the ordinal square of ω₁. ✓ +- `(aleph 1).ord * (aleph 0).ord` is ω₁ · ω. ✓ + +**`ContainsBiclique` is correct:** Requires disjoint sets A, B with |A| ≥ κ, |B| ≥ κ, and complete bipartite adjacency between them. This is the standard definition of containing K_{κ,κ} as a subgraph. ✓ + +**`OrdGraphPartition` is correct:** +- The coloring function `f : OrdinalSet α → OrdinalSet α → Fin 2` is defined on all ordered pairs. Conditions only inspect pairs with i < j (for the ordinal embedding) or g u < g v (for the graph embedding), effectively coloring unordered pairs. This is equivalent to the standard formulation over [α]². ✓ +- The first alternative requires an order embedding of OrdinalSet β into OrdinalSet α with all pairs colored 0. ✓ +- The second alternative requires an injective map g : V → OrdinalSet α such that every edge of G maps (in the correct order) to a color-1 pair. Since `SimpleGraph.Adj` is symmetric, for each edge {u,v}, the condition is checked for whichever of (g u, g v) or (g v, g u) is ordered correctly — ensuring every edge is covered. ✓ + +**The main theorem statement is correct:** +- Universal quantification over all types V and graphs G. ✓ +- Cardinal bound `#V ≤ aleph 1` captures "at most ℵ₁ vertices". ✓ +- `G.CliqueFree 4` captures "K₄-free". ✓ +- `¬ContainsBiclique G (aleph 0)` captures "no K_{ℵ₀,ℵ₀}". ✓ + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. diff --git a/ai-review/599.md b/ai-review/599.md new file mode 100644 index 0000000000..7b2aa07b2d --- /dev/null +++ b/ai-review/599.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 599 + +## 1. Code Reuse + +**Independent sets:** The formalization manually encodes the independent set condition as `(∀ u ∈ A, ∀ v ∈ A, ¬G.Adj u v)`. Mathlib provides `SimpleGraph.IsIndepSet` (defined as `s.Pairwise (fun v w ↦ ¬G.Adj v w)`), which is semantically equivalent since `G.Adj` is irreflexive. The formalization should use `G.IsIndepSet A` and `G.IsIndepSet B` for consistency with the rest of the codebase and interoperability with Mathlib lemmas. Multiple other Erdős problems (73, 151, 615, 750, 804) face similar duplication issues with independent set definitions. + +**Vertex-disjoint paths:** Problem 915 defines `HasInternallyDisjointPaths` for internally vertex-disjoint paths between two fixed vertices. Problem 599 requires fully vertex-disjoint A–B paths (disjoint on full support, not just internal vertices), which is a different notion. The definitions in `FormalConjecturesForMathlib/.../Definitions.lean` (`InternallyDisjoint`, `InfinitelyConnected`) also use internal disjointness. No existing codebase definition captures the full-support disjointness used here, so the custom encoding is justified. + +**Vertex separators:** Problem 150 defines `IsVertexSeparator` (disconnection of the complement subgraph), but this is a different notion from the A–B separation used in Problem 599. No reuse opportunity here. + +## 2. Citations + +The formalization lists three references: +- **[Er81]** — `Erdős, P. (1981).` — No title or journal provided. The website also provides no further detail for this reference. ✅ Matches. +- **[Er87]** — `Erdős, P. (1987).` — No title or journal provided. The website also provides no further detail. ✅ Matches. +- **[AhBe09]** — `Aharoni, R. and Berger, E., Menger's theorem for infinite graphs. Inventiones Mathematicae 176 (2009), 1-62.` — ✅ Matches the website. + +No missing citations. The attribution `T. F. Bloom` for the website page is noted but not required in the formalization. + +## 3. Variants + +The website presents a single variant of this problem. The formalization captures it completely: +- The conjecture is stated for arbitrary (possibly infinite) graphs via `V : Type*`. +- The finite case (classical Menger's theorem) is subsumed. +- No additional variants are listed on the website. + +✅ All variants captured. + +## 4. Readability + +**Minor improvements possible:** +- Replace the manual independent set predicates with `G.IsIndepSet A` and `G.IsIndepSet B`. This would reduce line 56–57 from two quantified lines to two concise terms. +- The existential block is well-structured: the index type `ι`, source/destination functions, path family, and separator `S` are clearly laid out. +- The conjunctive conditions are in logical order (sources in A, destinations in B, paths, disjointness, S meets each path uniquely, S separates). + +**Overall:** Readable. The main readability improvement would be adopting `IsIndepSet`. + +## 5. Formalizability + +The Erdős-Menger conjecture is a precisely stated combinatorial/graph-theoretic conjecture. The concepts involved — disjoint paths, vertex separators, independent sets — are all standard and unambiguous. + +**Ambiguity assessment:** Very low. The only minor point is whether "a set S containing exactly one vertex from each path" means S consists of *only* those chosen vertices (one per path), or whether S may contain additional vertices. The standard reading allows extra vertices (the word "containing" is inclusive), and the formalization correctly reflects this: the condition `∀ i, ∃! v, v ∈ S ∧ v ∈ (p i).support` ensures each path meets S in exactly one vertex but does not prevent S from having vertices outside all paths. This is equivalent to the stricter reading in practice — any extra vertices in S only make the separation condition easier to satisfy, and for the existence statement this does not matter. + +**Verdict:** Unambiguous and clearly formalizable. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +| Aspect | Assessment | +|--------|-----------| +| Universe polymorphism (`V : Type*`) | ✅ Correctly handles infinite graphs | +| Disjointness of A, B (`Disjoint A B`) | ✅ Required by the problem | +| Independence of A, B | ✅ Semantically equivalent to `IsIndepSet` (see §1) | +| Paths from A to B (`src i ∈ A`, `dst i ∈ B`, `IsPath`) | ✅ Correct | +| Full vertex-disjointness (`List.Disjoint ... support`) | ✅ Correct for this problem (not internal disjointness) | +| S meets each path in exactly one vertex (`∃!`) | ✅ Correct | +| Separation condition (every walk from A to B meets S) | ✅ Correct — using walks is equivalent to using paths for separation (every walk contains a subpath, whose support is a subset of the walk's support) | +| `answer(True)` | ✅ Correct — the conjecture was proved affirmatively by Aharoni–Berger [AhBe09] | +| `@[category research solved, AMS 5]` | ✅ Correct — solved, graph theory | + +**Subtle points verified:** +1. The disjointness condition `∀ i j, i ≠ j → List.Disjoint (p i).support (p j).support` implicitly forces distinct indices to map to genuinely different paths (a path's support is nonempty, so it cannot be disjoint from itself). This is correct behavior. +2. The formalization does not require S ⊆ ⋃ᵢ (p i).support, so S may contain "extra" vertices. This does not affect correctness — such vertices are redundant but harmless for the existence statement. +3. Endpoints of paths (in A ∪ B) are allowed to be in S. This is consistent with Menger's theorem. +4. The full-support disjointness means each vertex of A (resp. B) is used as a source (resp. destination) by at most one path. This is the correct Menger duality. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Verdict | +|-----------|---------| +| Code reuse | Use `G.IsIndepSet` instead of manual encoding | +| Citations | ✅ Complete and consistent with website | +| Variants | ✅ All captured | +| Readability | Good; minor improvement via `IsIndepSet` | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/60.md b/ai-review/60.md new file mode 100644 index 0000000000..7e02d56e15 --- /dev/null +++ b/ai-review/60.md @@ -0,0 +1,177 @@ +# Review: Erdős Problem 60 + +**File:** `FormalConjectures/ErdosProblems/60.lean` + +--- + +## 1. Code Reuse + +**Issue: All four local definitions duplicate functionality now available in Mathlib.** + +Mathlib (via `Mathlib.Combinatorics.SimpleGraph`) now provides direct replacements for every definition in this file: + +| Local definition | Mathlib replacement | Location | +|---|---|---| +| `cycleGraph60` | `SimpleGraph.cycleGraph` | `Mathlib/Combinatorics/SimpleGraph/Circulant.lean:62` | +| `ContainsSubgraph60` | `SimpleGraph.IsContained` (via `Copy`) | `Mathlib/Combinatorics/SimpleGraph/Copy.lean:237` | +| `extremalNumber60` | `SimpleGraph.extremalNumber` | `Mathlib/Combinatorics/SimpleGraph/Extremal/Basic.lean:78` | +| `labeledC4Count` | `SimpleGraph.labelledCopyCount` | `Mathlib/Combinatorics/SimpleGraph/Copy.lean:406` | + +**Details:** + +1. **`cycleGraph60`** manually constructs the cycle via modular arithmetic. Mathlib's `SimpleGraph.cycleGraph n` defines it as `circulantGraph {1}` on `Fin n`, which is cleaner and comes with lemmas. Note: Mathlib's version is defined for all `n : ℕ` (returning `⊥` for `n = 0`) rather than requiring `m ≥ 3`. + +2. **`ContainsSubgraph60`** is an existential over injective homomorphisms. Mathlib now has `SimpleGraph.Copy A B` (a structure for injective homomorphisms from `A` to `B`) and `SimpleGraph.IsContained A B` (notation `A ⊑ B`), which is `Nonempty (Copy A B)`. The negation, `SimpleGraph.Free A B`, means `¬A ⊑ B`. + +3. **`extremalNumber60`** uses `sSup` over a set of naturals. Mathlib's `SimpleGraph.extremalNumber n H` uses `Finset.sup` over the finset of `H`-free graphs, which is more robust (no need to verify boundedness for `sSup`). Note the argument order differs: Mathlib uses `(n : ℕ) (H)` while the formalization uses `(H) (n : ℕ)`. + +4. **`labeledC4Count`** counts injective maps `Fin 4 → Fin n` preserving cycle adjacency via `Finset.univ.filter`. Mathlib's `SimpleGraph.labelledCopyCount G H` counts `Fintype.card (Copy H G)`, which generalizes this to any pair of finite graphs. + +**Also duplicated across the project:** Identical `cycleGraph`, `ContainsSubgraph`, and `extremalNumber` definitions appear in Problems 765, 572, 551, 556, 86, 594, 181, 736, and many others, each with a different numeric suffix. This is a significant project-wide code reuse opportunity now that Mathlib provides canonical versions. + +**Recommendation:** Rewrite the theorem statement in terms of Mathlib's `SimpleGraph.extremalNumber`, `SimpleGraph.cycleGraph`, and `SimpleGraph.labelledCopyCount`. This would eliminate all four local definitions. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/60](https://www.erdosproblems.com/60):** + +The website lists: +- **Status:** Open +- **Tags:** Graph theory, Cycles +- **References:** [Er90], [Er93], [HeMaYa21] +- **Related problem:** Problem 765 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open | **Correct.** | +| AMS classification | `AMS 5` | Graph theory (Combinatorics) | **Correct.** | +| Citation `[Er90]` | `Erdős, P. (1990).` | `Erdős (1990)` | **Incomplete.** Missing title and publication venue. | +| Citation `[Er93]` | `Erdős, P. (1993).` | `Erdős (1993), p. 335` | **Incomplete.** Missing title, venue, and page reference. Problem 765 has the full citation: *"On some of my favourite theorems"*, Combinatorics, Paul Erdős is eighty, Vol. 2 (Keszthely, 1993), 97–132. This should be adopted here. | +| Citation `[HeMaYa21]` | **Missing** | He, Ma, and Yang (2021) | **Missing.** A partial result proving the conjecture for $n = q^2 + q + 1$ where $q$ is even is not mentioned. | +| Related problems | Problem 765 mentioned in docstring | Problem 765 | **Correct.** | + +**Recommendation:** Add the `[HeMaYa21]` citation and note the partial result in the docstring. Flesh out `[Er90]` and `[Er93]` with full bibliographic details as done in Problem 765. + +--- + +## 3. Variants + +**Missing variant: the He–Ma–Yang partial result.** + +The website reports that He, Ma, and Yang [HeMaYa21] proved the conjecture for the special case $n = q^2 + q + 1$ where $q$ is an even integer. This could be formalized as a standalone theorem: + +```lean +@[category research solved, AMS 5] +theorem erdos_60.variants.even_prime_power : + ∃ (c : ℝ) (_ : c > 0), + ∀ q : ℕ, 2 ∣ q → + let n := q ^ 2 + q + 1 + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber60 (cycleGraph60 4 (by omega)) n → + (labeledC4Count n G : ℝ) ≥ c * (n : ℝ) ^ ((1 : ℝ) / 2) := by + sorry +``` + +**Missing variant: "at least 2 copies."** + +The docstring notes that Erdős and Simonovits "could not even prove that at least 2 copies of $C_4$ are guaranteed." This weaker statement — that exceeding `ex(n; C₄)` guarantees at least 2 copies of $C_4$ — could be formalized as an intermediate variant: + +```lean +@[category research open, AMS 5] +theorem erdos_60.variants.at_least_two : + ∃ (N₀ : ℕ), ∀ n : ℕ, N₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber60 (cycleGraph60 4 (by omega)) n → + labeledC4Count n G ≥ 16 := by -- 2 unlabeled copies × 8 labelings each + sorry +``` + +**Assessment:** The core conjecture is captured. The partial result and the weaker "at least 2" variant are absent but would enrich the formalization. + +--- + +## 4. Readability + +The code is reasonably readable. Specific observations: + +- **Numeric suffixes:** All definitions have a `60` suffix (`cycleGraph60`, `ContainsSubgraph60`, `extremalNumber60`) to avoid namespace clashes. This is a project-wide pattern but makes the code less readable than using the `Erdos60` namespace for disambiguation (which is already present). Since the definitions are scoped to `namespace Erdos60`, the suffixes are strictly redundant. +- **`labeledC4Count` vs `labelledCopyCount`:** The definition hardcodes the C₄ pattern rather than composing with `cycleGraph60`. While pragmatic, it obscures the relationship to the general cycle graph and makes it less obvious that the definition is counting C₄ copies specifically. The inline encoding is equivalent but a reader must verify this manually. +- **Docstrings:** The module docstring and theorem docstring are clear and informative. The `labeledC4Count` docstring correctly notes the 8× overcounting factor. +- **`open Classical`:** Declared at the top level via `open SimpleGraph Classical`. The `Classical` open is needed for decidability but could be scoped more tightly. + +**Minor:** American spelling "labeled" vs British "labelled" (Mathlib uses "labelled"). + +--- + +## 5. Formalizability + +**Assessment: Formalizable with minor interpretive choices; low ambiguity.** + +The conjecture is: "Does every graph on $n$ vertices with $> \mathrm{ex}(n; C_4)$ edges contain $\gg n^{1/2}$ many copies of $C_4$?" + +The key interpretive choices are: + +1. **The $\gg$ notation.** In Erdős's combinatorial usage, $f(n) \gg g(n)$ means $f(n) \geq c \cdot g(n)$ for some absolute constant $c > 0$ and all sufficiently large $n$, i.e., $f = \Omega(g)$. The formalization correctly interprets this as $\exists c > 0, \exists N_0, \forall n \geq N_0, \text{count}(G) \geq c \cdot n^{1/2}$. This is standard and unambiguous. + +2. **"Copies" — labeled vs. unlabeled.** The problem doesn't specify. The formalization counts *labeled* copies (injective maps from $\mathrm{Fin}\,4$ preserving adjacency). Since labeled = 8 × unlabeled for $C_4$, and 8 is a constant, the choice doesn't affect the $\gg n^{1/2}$ statement. The formalization is correct either way. + +3. **"Copies" — subgraph copies vs. induced subgraph copies.** The formalization uses *subgraph* copies (injective homomorphisms, not embeddings), meaning it only requires that C₄ edges are present but allows additional edges between the four vertices. For $C_4$, this is the standard convention in extremal graph theory. An induced copy would additionally require that non-edges of $C_4$ are non-edges of $G$, which is not the typical intent. + +**Ambiguity level: Low.** All interpretive choices are resolved in the standard way. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `cycleGraph60` + +The adjacency relation `i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m)` correctly encodes the cycle $C_m$: vertex $i$ is adjacent to $i \pm 1 \pmod{m}$. The symmetry and irreflexivity proofs are correct. For $m = 4$, this produces the 4-cycle with edges $\{0,1\}, \{1,2\}, \{2,3\}, \{3,0\}$. + +### Definition: `ContainsSubgraph60` + +The definition `∃ f : U → V, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v)` correctly defines (non-induced) subgraph containment via injective homomorphism. This is the standard notion in extremal graph theory. + +### Definition: `extremalNumber60` + +`sSup {m : ℕ | ∃ G : SimpleGraph (Fin n), ¬ContainsSubgraph60 G H ∧ G.edgeSet.ncard = m}` computes the supremum of edge counts among $H$-free graphs on $n$ vertices. For the intended use ($H = C_4$, $n$ finite): + +- **Nonemptiness:** The empty graph is always $C_4$-free with 0 edges, so the set is nonempty. +- **Boundedness:** Any graph on $n$ vertices has at most $\binom{n}{2}$ edges, so the set is bounded. +- **`sSup` on `ℕ`:** Since `ℕ` has `ConditionallyCompleteLinearOrderBot`, `sSup` on a nonempty bounded set equals the maximum. This is correct. + +However, there is a **subtle fragility**: if the conditions above were not met (e.g., for a degenerate $H$), `sSup` could return a junk value. Mathlib's `SimpleGraph.extremalNumber` uses `Finset.sup` over the finite set of $H$-free graphs, which avoids this concern entirely. + +### Definition: `labeledC4Count` + +Counts functions $f : \mathrm{Fin}\,4 \to \mathrm{Fin}\,n$ satisfying injectivity and $G.\mathrm{Adj}(f(i), f(i+1))$ for all $i \in \mathrm{Fin}\,4$. Since addition in $\mathrm{Fin}\,4$ wraps around ($3 + 1 = 0$), the four conditions are: +$$G.\mathrm{Adj}(f(0), f(1)),\quad G.\mathrm{Adj}(f(1), f(2)),\quad G.\mathrm{Adj}(f(2), f(3)),\quad G.\mathrm{Adj}(f(3), f(0))$$ +This is exactly the set of edges of $C_4$. **Correct.** + +Note that `labeledC4Count` does not reference `cycleGraph60` — it independently encodes the same adjacency pattern. This is a missed opportunity for composition but does not affect correctness. + +### Theorem: `erdos_60` + +```lean +theorem erdos_60 : answer(sorry) ↔ + ∃ (c : ℝ) (_ : c > 0) (N₀ : ℕ), + ∀ n : ℕ, N₀ ≤ n → + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard > extremalNumber60 (cycleGraph60 4 (by omega)) n → + (labeledC4Count n G : ℝ) ≥ c * (n : ℝ) ^ ((1 : ℝ) / 2) +``` + +- **`answer(sorry)`:** Standard pattern for open problems where the truth value is unknown. Correct. +- **Logical structure:** "There exist $c > 0$ and $N_0$ such that for all $n \geq N_0$, every graph $G$ on $n$ vertices with more than $\mathrm{ex}(n; C_4)$ edges satisfies $\text{count}(G) \geq c \cdot n^{1/2}$." This faithfully captures the $\gg n^{1/2}$ statement. +- **Quantifier order:** The universal quantification over $G$ is inside the existential over $c$ and $N_0$, meaning the same constant $c$ works for all large $n$ and all graphs $G$. This is the correct reading of $\gg n^{1/2}$. +- **Cast to `ℝ`:** The comparison `(labeledC4Count n G : ℝ) ≥ c * (n : ℝ) ^ ((1 : ℝ) / 2)` is necessary because $n^{1/2}$ is irrational for non-square $n$. The cast is correct. +- **Edge count condition:** `G.edgeSet.ncard > extremalNumber60 ...` correctly captures "more than $\mathrm{ex}(n; C_4)$ edges." The strict inequality is essential — graphs with *exactly* $\mathrm{ex}(n; C_4)$ edges can be $C_4$-free. + +### Potential concern: `(1 : ℝ) / 2` exponent + +The expression `(n : ℝ) ^ ((1 : ℝ) / 2)` computes $n^{0.5} = \sqrt{n}$. In Lean's `Real.rpow`, this is well-defined for $n \geq 0$ (which holds since $n : \mathbb{N}$). For $n = 0$, `(0 : ℝ) ^ (1/2) = 0`, so the inequality becomes `count ≥ 0`, which is trivially true. This is harmless since the statement only needs to hold for $n \geq N_0$. + +**Verdict: Correct and complete.** The formalization faithfully captures the open content of Erdős Problem 60. The interpretive choices ($\gg$ as $\Omega$, labeled copies, non-induced subgraph copies) are all standard. No mathematical flaws are present. The main improvement opportunities are in code reuse (adopting Mathlib definitions) and citation completeness (adding [HeMaYa21]). diff --git a/ai-review/600.md b/ai-review/600.md new file mode 100644 index 0000000000..12621c602c --- /dev/null +++ b/ai-review/600.md @@ -0,0 +1,102 @@ +# AI Review: Erdős Problem 600 + +## 1. Code Reuse + +**Significant overlap with Problem 80** (`FormalConjectures/ErdosProblems/80.lean`), which is explicitly referenced as a related problem on the website. + +Problem 80 defines: +- `bookSize G u v` — counts common neighbors via `(G.neighborFinset u ∩ G.neighborFinset v).card` +- `EveryEdgeInTriangle G` — every edge lies in at least one triangle, defined via `0 < bookSize G u v` + +Problem 600 independently defines: +- `trianglesThrough G u v` — counts common neighbors via `(Finset.univ.filter fun w => w ≠ u ∧ w ≠ v ∧ G.Adj u w ∧ G.Adj v w).card` +- `IsTriangleCovered G` — equivalent to `EveryEdgeInTriangle`, defined via `0 < trianglesThrough G u v` + +These are mathematically equivalent: in a `SimpleGraph` (irreflexive), `neighborFinset u` excludes `u` itself, so `neighborFinset u ∩ neighborFinset v` yields exactly the vertices `w ≠ u`, `w ≠ v` adjacent to both. The explicit `w ≠ u ∧ w ≠ v` guards in `trianglesThrough` are therefore redundant given `SimpleGraph` irreflexivity but do not change the result. + +**Recommendation:** Refactor to reuse `Erdos80.bookSize` and `Erdos80.EveryEdgeInTriangle`, or extract these definitions into a shared utility (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/BookSize.lean`). This would eliminate duplicated definitions and make the relationship between Problems 80 and 600 explicit in the code. + +Additionally, Problem 80 is more general in its type signature (`{V : Type*} [Fintype V] [DecidableEq V]` with `[DecidableRel G.Adj]`) compared to Problem 600's concrete `Fin n`. The Problem 80 style is more idiomatic and reusable. + +## 2. Citations + +The formalization includes: +- **[RuSz78]** — Full citation: Ruzsa, I.Z. and Szemerédi, E., *Triple systems with no six points carrying three triangles*. Combinatorics (Proc. Fifth Hungarian Colloq., Keszthely, 1976), Vol. II, Colloq. Math. Soc. János Bolyai 18, North-Holland, 1978, pp. 939–945. +- **[Er87]** — Cited as: Erdős, P., 1987. + +These match what is available on erdosproblems.com/600. The website does not provide a more detailed citation for [Er87], so the terse reference is acceptable. The docstring also correctly mentions the Ruzsa–Szemerédi result that `e(n, r) = o(n²)` for fixed `r`, consistent with the website. + +**No issues found.** + +## 3. Variants + +The problem on erdosproblems.com/600 poses exactly two questions: +1. Does `e(n, r+1) − e(n, r) → ∞` as `n → ∞`? +2. Does `e(n, r+1) / e(n, r) → 1` as `n → ∞`? + +Both are formalized as `erdos_600` (Part 1) and `erdos_600.variants.ratio` (Part 2). + +**All variants are captured.** + +## 4. Readability + +The code is generally readable. A few observations: + +- The docstrings are clear and include the mathematical notation. +- The definition of `erdosE` using `sInf` is a natural encoding of "the minimal m such that..." and reads well. +- The `trianglesThrough` definition, while correct, is less idiomatic than using `neighborFinset` intersection (as in Problem 80's `bookSize`). The intersection form is shorter and leverages existing Mathlib API. +- The `open Classical` is appropriate since `DecidableRel` instances are needed implicitly for `edgeFinset`. +- Part 2 is cleanly expressed using `Tendsto` and `nhds`, which is the standard Mathlib way to state limits. + +**Minor suggestion:** The Part 1 encoding as `∀ M, ∃ N₀, ∀ n ≥ N₀, ...` is a correct epsilon-delta unfolding of divergence to infinity, but could alternatively use `Tendsto ... atTop atTop` (composed with the difference function) for consistency with Part 2's filter-based style. This is a style preference, not an error. + +## 5. Formalizability + +The problem statement is **precise and unambiguously formalizable**. The definition of `e(n, r)` is a concrete combinatorial quantity with a clear extremal characterization. Both questions ask about asymptotic behavior of well-defined arithmetic expressions involving `e(n, r)`. + +**Ambiguity assessment: None.** The only interpretive choice is how to handle degenerate cases (small `n` or `r`), and the formalization handles these naturally: for `n ≤ 2`, no triangle-covered graphs exist, so `erdosE n r = 0` for all `r` (the sInf set contains 0 vacuously). This does not affect the asymptotic statements. + +## 6. Correctness + +### Definition of `erdosE` + +The definition correctly computes `sInf` over `{m : ℕ | ∀ G, IsTriangleCovered G → G.edgeFinset.card ≥ m → ∃ u v, G.Adj u v ∧ trianglesThrough G u v ≥ r}`. + +This is mathematically correct: `e(n, r)` is the smallest threshold on the number of edges that forces a triangle-covered graph to have an edge in ≥ `r` triangles. The set is always nonempty (any `m > n(n−1)/2` makes the condition vacuously true since no simple graph on `n` vertices can have that many edges), so `sInf` is well-defined and does not default to `0` spuriously. + +### Part 1 + +``` +∀ (r : ℕ), r ≥ 2 → ∀ M : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → erdosE n (r + 1) ≥ erdosE n r + M +``` + +This correctly encodes "`e(n, r+1) − e(n, r) → ∞`" via the standard definition: for every bound `M`, eventually `e(n, r+1) ≥ e(n, r) + M`. Working in `ℕ` with `≥ ... + M` avoids subtraction issues. Correct. + +### Part 2 + +``` +∀ (r : ℕ), r ≥ 2 → Tendsto (fun n => (erdosE n (r+1) : ℝ) / (erdosE n r : ℝ)) atTop (nhds 1) +``` + +This correctly encodes "`e(n, r+1) / e(n, r) → 1`" using Lean's `Tendsto` with the real-valued ratio. For small `n` where `erdosE n r = 0`, the ratio `0 / 0` evaluates to `0` in Lean's `ℝ` (by convention), but this affects only finitely many terms and does not impact the limit. Correct. + +### Subtle observation on `answer(sorry)` + +Both theorems use `answer(sorry)`, indicating the answer to the yes/no question is unknown. This is appropriate: both parts are open problems per erdosproblems.com. The `↔` structure means the eventual `answer(true)` or `answer(false)` will determine whether the stated property holds or its negation does. + +### Overall mathematical assessment + +**The formalization is correct and complete.** An experienced mathematician would not identify any flaws in the encoding. The definition of `e(n, r)` faithfully captures the extremal quantity, and both asymptotic questions are properly stated. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `trianglesThrough` and `IsTriangleCovered` duplicate `bookSize` and `EveryEdgeInTriangle` from Problem 80. Should be refactored to share definitions. | +| Citations | Correct and consistent with erdosproblems.com/600. | +| Variants | Both parts of the problem are captured. | +| Readability | Good. Minor style suggestions (use `neighborFinset` intersection, consider filter-based limit for Part 1). | +| Formalizability | Fully precise, no ambiguity. | +| Correctness | Correct and complete. No mathematical errors. | diff --git a/ai-review/601.md b/ai-review/601.md new file mode 100644 index 0000000000..87be785954 --- /dev/null +++ b/ai-review/601.md @@ -0,0 +1,144 @@ +# AI Review: Erdős Problem 601 + +## 1. Code Reuse + +**`OrdinalSet` is duplicated across three files.** The definition `abbrev OrdinalSet (α : Ordinal) := {a : Ordinal // a < α}` appears identically in: +- `ErdosProblems/118.lean:57` (namespace `Erdos118`) +- `ErdosProblems/597.lean:37` (namespace `Erdos597`) +- `ErdosProblems/601.lean:51` (namespace `Erdos601`) + +This should be factored out into a shared utility (e.g., `FormalConjecturesForMathlib/SetTheory/Ordinal/OrdinalSet.lean` or similar). Note that `FormalConjecturesForMathlib/SetTheory/Cardinal/SimpleGraph.lean` already defines `OrdinalCardinalRamsey` using a related pattern—this would be a natural home for a shared `OrdinalSet` definition. + +**`HasInfinitePath` could potentially be shared.** The definition of an infinite path as an injective `ℕ → V` sequence with consecutive adjacency is a natural graph-theoretic concept. `ErdosProblems/900.lean` defines `GraphHasLongPath` for finite paths, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` defines `InfinitelyConnected`. However, none of these exactly duplicate `HasInfinitePath`, so no immediate reuse opportunity exists for this particular definition beyond 601 itself. + +**Independent set definitions vary across the codebase.** `ErdosProblems/151.lean` and `615.lean` define `IsIndependentSet` for `Finset`-based vertex sets on finite graphs. The definition `HasIndepSetOfOrderType` in 601 is fundamentally different (order-type preservation via order embeddings), so code reuse is not directly applicable here. + +## 2. Citations + +The website [erdosproblems.com/601](https://www.erdosproblems.com/601) lists these references: +- **[EHM70]** Erdős, Hajnal, and Milner (1970) — ✅ Present in docstring +- **[Er81]** Erdős (1981) — ✅ Present +- **[Er82e]** Erdős (1982) — ✅ Present +- **[Er87]** Erdős (1987) — ✅ Present +- **[La90]** Larson (1990) — ⚠️ Referenced in the module docstring as "Larson proved this is true..." but the citation tag `[La90]` is **not listed** in the bibliography block at the bottom. A full citation entry should be added: + + `[La90] Larson, J.A., _A short proof of a partition theorem for the ordinal ω^ω_, + Ann. Pure Appl. Logic 101 (2000), 97–106.` + + (Note: The website says "[La90]" but this may refer to a 1990 preprint or a different Larson paper. The precise Larson reference for the Martin's axiom result should be verified.) + +All other citations match the website. + +## 3. Variants + +The problem as stated on the website is: "For **which** limit ordinals α is it true that..." — this is an open characterization problem, not a universal statement. + +The formalization `erdos_601` asserts the property for **all** limit ordinals: + +```lean +theorem erdos_601 (α : Ordinal) (hα : Order.IsSuccLimit α) : + EHMProperty α +``` + +This captures **one direction** of the problem (the conjecture that the answer is "all limit ordinals"), which is the natural strongest conjecture. However, the problem has interesting sub-cases mentioned on the website that are **not** captured as separate theorems: + +- **The $\alpha = \omega_1^{\omega+2}$ case** ($250 prize) — could be formalized as a separate theorem. +- **The Martin's axiom conditional result** (Larson) for $\alpha < 2^{\aleph_0}$ — this is a known result that could be stated as a separate theorem, conditional on Martin's axiom. +- **The Erdős-Hajnal-Milner result** for $\alpha < \omega_1^{\omega+2}$ — this is a proved theorem that could be formalized separately. + +These partial/conditional results are not captured. Whether they should be is a project-level decision, but they represent mathematically significant milestones. + +## 4. Readability + +The code is **well-structured and readable**. Each definition is clearly documented with docstrings that explain the mathematical content. The separation into `OrdinalSet`, `HasInfinitePath`, `HasIndepSetOfOrderType`, and `EHMProperty` provides a clean logical decomposition. + +Minor suggestions: +- The docstring for `HasIndepSetOfOrderType` says "an order embedding from `OrdinalSet α` into itself" — this is correct but could be slightly clearer by saying "an order embedding whose image forms an independent set, witnessing that the independent set has order type α." +- The module docstring is thorough and provides good context. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with moderate ambiguity.** + +The original problem asks "for which limit ordinals α" — this is a characterization question, not a yes/no conjecture. The formalization chooses to assert the property for all limit ordinals, which is one natural interpretation (the strongest conjecture). This is a reasonable choice. + +Key formalizability considerations: + +- **"Infinite path"** — The formalization defines this as an injective sequence `f : ℕ → V` with `G.Adj (f n) (f (n+1))`. This is a standard and unambiguous formalization of a one-way infinite path (ray). The original problem says "infinite path" which could in principle mean a two-way infinite path (double ray), but the one-way interpretation is standard in this context and matches the literature. + +- **"Independent set of order type α"** — Formalized via an order embedding `OrdinalSet α ↪o OrdinalSet α`. This is mathematically correct: an order embedding from `OrdinalSet α` into itself whose image is independent witnesses an independent set of order type at least α, and since the ambient set has order type α, the order type is exactly α. + +- **"Graph with vertex set α"** — Formalized as `SimpleGraph (OrdinalSet α)`. This is the standard interpretation. + +The problem is **sufficiently precise** for formalization. The main ambiguity is whether the question asks for a characterization or a universal statement, and the formalization makes a defensible choice. + +## 6. Correctness + +**Overall assessment: Largely correct, with one notable issue.** + +### The `Order.IsSuccLimit` predicate + +The formalization uses `Order.IsSuccLimit α` to express "α is a limit ordinal." In Mathlib: +- `Order.IsSuccLimit a` means `¬ IsMin a ∧ IsSuccPrelimit a` — i.e., `a` is not minimal and is not a successor of any element. +- For ordinals, this correctly excludes 0 (which is minimal) and excludes successor ordinals. +- This matches the standard mathematical definition of a limit ordinal (nonzero, non-successor). + +**This is correct.** + +### `HasInfinitePath` definition + +```lean +def HasInfinitePath {V : Type*} (G : SimpleGraph V) : Prop := + ∃ f : ℕ → V, Function.Injective f ∧ ∀ n : ℕ, G.Adj (f n) (f (n + 1)) +``` + +This requires injectivity and adjacency of consecutive vertices. This is the standard definition of an infinite (one-way) path in a graph. **Correct.** + +### `HasIndepSetOfOrderType` definition + +```lean +def HasIndepSetOfOrderType {α : Ordinal} + (G : SimpleGraph (OrdinalSet α)) : Prop := + ∃ e : OrdinalSet α ↪o OrdinalSet α, + ∀ i j : OrdinalSet α, i ≠ j → ¬G.Adj (e i) (e j) +``` + +This says: there exists an order embedding from `OrdinalSet α` into itself such that the image is an independent set. An order embedding `OrdinalSet α ↪o OrdinalSet α` is an injective, order-preserving map, and since both domain and codomain have order type α, the image has order type exactly α. The independence condition uses `i ≠ j` (rather than `i < j`), which is fine because `SimpleGraph.Adj` is symmetric and irreflexive. + +**Correct.** + +### `EHMProperty` and the main theorem + +```lean +def EHMProperty (α : Ordinal) : Prop := + ∀ G : SimpleGraph (OrdinalSet α), + HasInfinitePath G ∨ HasIndepSetOfOrderType G +``` + +This states that every simple graph on the ordinal α has either an infinite path or an independent set of order type α. This is exactly the Erdős-Hajnal-Milner property. + +**One subtle issue:** The `HasInfinitePath` definition is polymorphic over any type `V`, but when used within `EHMProperty`, `V` is instantiated to `OrdinalSet α`. For finite limit ordinals (specifically ω, the smallest limit ordinal), `OrdinalSet ω` is countably infinite, so `HasInfinitePath` is non-trivially satisfiable. For `α = ω` itself, the property is essentially a consequence of Ramsey's theorem (every infinite graph has either an infinite path or an infinite independent set). The formalization handles this correctly. + +**However, there is a potential concern about universe levels.** The `OrdinalSet` is defined as a subtype of `Ordinal`, which lives in a specific universe. The `SimpleGraph` is then over this type. For very large ordinals, this should still work within Lean's type theory, but it's worth noting that the formalization implicitly works in a single universe. + +### Theorem statement correctness + +The theorem asserts the EHM property for all limit ordinals. The known results are: +- True for α < ω₁^(ω+2) (proved by EHM) +- True for α < 2^ℵ₀ under Martin's axiom (Larson) +- Open in general + +The formalization conjectures the strongest possible result (true for all limit ordinals). This is a natural and standard interpretation of the problem, though the original problem technically asks "for which" limit ordinals — leaving open the possibility that the answer is "not all." The formalization should perhaps be marked more carefully as a conjecture rather than a theorem, but this is a project-wide convention issue. + +**The formalization is mathematically correct and faithfully captures the strongest interpretation of the Erdős-Hajnal-Milner conjecture.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `OrdinalSet` duplicated in 3 files; should be shared | +| Citations | Missing explicit `[La90]` bibliography entry | +| Variants | Only the universal conjecture is stated; specific sub-cases not captured | +| Readability | Good; clear decomposition and documentation | +| Formalizability | Good; minor ambiguity in characterization vs. universal statement | +| Correctness | Correct; faithful formalization of the EHM property | diff --git a/ai-review/602.md b/ai-review/602.md new file mode 100644 index 0000000000..2424498c5b --- /dev/null +++ b/ai-review/602.md @@ -0,0 +1,70 @@ +# Review: Erdős Problem 602 + +## 1. Code Reuse + +`HasPropertyB` is defined independently in three separate problem files, each within its own namespace: + +- **602** (`Erdos602.HasPropertyB`): `{α : Type*} {ι : Type*} (A : ι → Set α) → Prop` — general sets indexed by an arbitrary type. +- **901** (`Erdos901.HasPropertyB`): `Finset (Finset ℕ) → Prop` — finite hypergraphs over `ℕ`. +- **1022** (`Erdos1022.HasPropertyB`): `{n : ℕ} → Finset (Finset (Fin n)) → Prop` — finite hypergraphs over `Fin n`. + +All three encode the same concept (existence of a 2-coloring where no member set is monochromatic), but operate on different type structures. The definition in 602 is the most general. A unified `HasPropertyB` definition could be placed in `FormalConjecturesForMathlib/Combinatorics/` and specialized for each use case, avoiding the current duplication. The 901 and 1022 definitions could be derived as instances or corollaries of the general one. + +No existing definition in `FormalConjecturesForMathlib` currently captures Property B. Related code exists in `Combinatorics/SimpleGraph/Coloring.lean` (chromatic numbers, proper colorings) and `Combinatorics/Ramsey.lean` (2-colorings for Ramsey theory), but these target graph/hypergraph coloring in different frameworks and are not directly applicable. + +## 2. Citations + +The Lean docstring states: + +> `[Er87] Erdős, P., _Some problems and results on combinatorial number theory_.` + +The website (erdosproblems.com/602) lists the source as **[Er87]** without expanding the full bibliographic entry. The title given in the Lean file appears reasonable for a 1987 Erdős paper, though the year is not explicitly included in the citation line. The attribution to **Komjáth** is correctly noted in both the website description and the Lean module docstring. No additional references or literature are mentioned on the website. + +**Suggestion:** Add the year to the citation for completeness: `[Er87] Erdős, P., _Some problems and results on combinatorial number theory_ (1987).` + +## 3. Variants + +The website presents a single problem statement with no variants, partial results, or related sub-questions. The formalization captures exactly this single statement. No variants are missing. + +## 4. Readability + +The code is clean and well-structured: + +- The `HasPropertyB` definition has a clear docstring explaining the concept in both mathematical and informal terms. +- The theorem statement `erdos_602` has a comprehensive docstring that states the problem in standard mathematical notation. +- Hypotheses are well-named (`hcount`, `hfin`, `hne1`) and each captures a distinct condition from the problem. +- The use of `#(↥(A i)) = ℵ₀` for cardinality is idiomatic Lean/Mathlib. + +**Minor suggestion:** The `HasPropertyB` docstring says "both colours appear" which is slightly informal — it could say "every set in the family contains elements of both colours" for precision, but this is a very minor point. + +## 5. Formalizability + +The problem is stated precisely on the website: + +> "Let $(A_i)$ be a family of sets with $|A_i|=\aleph_0$ for all $i$, such that for any $i\neq j$ we have $|A_i\cap A_j|$ finite and $\neq 1$. Is there a $2$-colouring of $\cup A_i$ such that no $A_i$ is monochromatic?" + +This is precise enough to be unambiguously formalizable. The only minor points of interpretation: + +1. **Index set**: The problem does not restrict the index set. The formalization correctly uses an arbitrary type `ι`. +2. **Ground set**: The problem does not restrict the ambient set. The formalization correctly uses an arbitrary type `α`. +3. **"$|A_i \cap A_j|$ finite and $\neq 1$"**: This is a conjunction — the intersection is finite AND its cardinality is not 1. The formalization correctly separates this into two hypotheses. + +**Ambiguity level: Very low.** The statement is essentially a direct set-theoretic question with no hidden parameters or implicit conventions. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed analysis: + +- **`hcount : ∀ i, #(↥(A i)) = ℵ₀`** correctly captures that each $A_i$ is countably infinite ($|A_i| = \aleph_0$). The use of cardinal `#` on the subtype `↥(A i)` is the standard Mathlib idiom for set cardinality. + +- **`hfin : ∀ i j, i ≠ j → (A i ∩ A j).Finite`** correctly captures that pairwise intersections are finite. + +- **`hne1 : ∀ i j, i ≠ j → (A i ∩ A j).ncard ≠ 1`** correctly captures that pairwise intersections do not have cardinality 1. The use of `Set.ncard` is appropriate here: since `hfin` guarantees finiteness, `ncard` will return the true finite cardinality (it returns 0 for infinite sets, but that case is excluded by `hfin`). + +- **`HasPropertyB A`** correctly states the conclusion: there exists a function `c : α → Bool` such that for every index `i`, the set `A i` contains elements colored both `true` and `false`. The coloring is defined on all of `α` rather than just `⋃ i, A i`, but this is equivalent since only elements within some `A i` are tested. + +- **Edge cases**: If `ι` is empty, the conclusion holds vacuously (the universal quantifier over an empty type is trivially true), which is mathematically correct — an empty family trivially has Property B. If some `A i` is empty, this contradicts `hcount` (since `#∅ = 0 ≠ ℵ₀`), so this case is excluded. + +- **No missing hypotheses**: The formalization does not require decidable equality on `ι` or `α`, which is correct — the statement is purely existential and does not need decidability. No nonemptiness constraint on `ι` is needed either. + +**Verdict: No flaws identified.** The formalization faithfully and completely captures the mathematical content of Erdős Problem 602 as stated on the website. diff --git a/ai-review/603.md b/ai-review/603.md new file mode 100644 index 0000000000..ebf8288fb4 --- /dev/null +++ b/ai-review/603.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 603 + +## 1. Code Reuse + +**Problem 602** (`FormalConjectures/ErdosProblems/602.lean`) is the most closely related formalization. It handles the sibling problem: families of countably infinite sets with `|A_i ∩ A_j| ≠ 1` (and finite intersections), concluding that a 2-coloring suffices (`HasPropertyB`). Problems 602 and 603 share the same provenance (Komjáth, [Er87]), the same `open Cardinal Set`, and nearly identical hypothesis structures (`hcount`, intersection constraints). + +The `HasPropertyB` definition from 602 could be generalized to an `n`-color version or a cardinal-parametric version that would serve both problems. Currently, 603 inlines its non-monochromaticity conclusion directly (`∃ c : α → ℕ, ∀ i, ∃ x ∈ A i, ∃ y ∈ A i, c x ≠ c y`) rather than using a named predicate. A shared definition like `HasColoringAvoidingMonochromatic (A : ι → Set α) (κ : Type*) := ∃ c : α → κ, ∀ i, ∃ x ∈ A i, ∃ y ∈ A i, c x ≠ c y` would unify both problems and be reusable by other coloring problems in the codebase (593, 836, 1022). + +**Problem 703** (`FormalConjectures/ErdosProblems/703.lean`) also uses the `|A ∩ B| ≠ r` forbidden-intersection pattern, though in the finite/extremal combinatorics setting. The intersection constraint idiom `(A i ∩ A j).ncard ≠ k` appears in multiple problems. + +No existing utility function directly captures the "non-monochromatic ℵ₀-coloring" predicate that 603 needs, so no direct reuse is possible without refactoring. + +## 2. Citations + +The formalization cites: + +> [Er87] Erdős, P., _Some problems on finite and infinite graphs_. + +The website (erdosproblems.com/603) lists the reference as **[Er87]** and attributes the problem to **Komjáth**, but does not provide the full bibliographic entry for [Er87]. Note that Problem 602 cites [Er87] as _"Some problems and results on combinatorial number theory"_, which is a **different title**. Both cannot be correct for the same citation key. The standard reference for [Er87] in the Erdős bibliography is typically: + +> Erdős, P., "Some problems on finite and infinite graphs," _Israel Journal of Mathematics_, 56 (1987), 1–7. + +The 602 citation title appears to be incorrect (that title corresponds to a different Erdős paper). The 603 citation title is likely the correct one, but should be verified against the actual publication. Ideally both 602 and 603 should use the same full bibliographic entry for [Er87] since they cite the same source. + +The website also credits **Stijn Cambie** and **Desmond Weisenberg** for additional contributions, which are not mentioned in the formalization (this is not strictly necessary). + +## 3. Variants + +The formalization captures **only one direction** of the problem. The original problem on erdosproblems.com asks: + +> **Find the smallest cardinal $C$** such that $\bigcup A_i$ can always be coloured with at most $C$ colours so that no $A_i$ is monochromatic. + +This is an optimization problem asking for the exact value of the minimum cardinal. The formalization instead conjectures a specific upper bound: that $C \leq \aleph_0$ (i.e., $\mathbb{N}$-many colors suffice). The docstring is transparent about this being "conjectured by analogy" with the Komjáth result for the $\neq 1$ case, which is good. + +**Missing variants:** + +- **The exact characterization**: A complete formalization would include a statement identifying the exact minimum cardinal, or at minimum a lower bound showing that finitely many colors do not always suffice. +- **The Komjáth result for $|A_i \cap A_j| \neq 1$**: The docstring mentions that Komjáth showed $\aleph_0$ colors suffice when intersections avoid size 1. This is a proved result (distinct from Problem 602, which adds a finiteness constraint and gets a 2-coloring) and could be formalized as a companion theorem. It would provide useful context and a structural template. +- **Finite color variants**: It would be natural to also conjecture (or refute) that finitely many colors suffice, i.e., whether $C$ is finite or necessarily $\aleph_0$. + +## 4. Readability + +The formalization is concise and readable. Minor suggestions: + +- The conclusion `∃ c : α → ℕ, ∀ i : ι, ∃ x ∈ A i, ∃ y ∈ A i, c x ≠ c y` would benefit from a named predicate (as discussed in §1) to make the mathematical intent immediately clear. A reader must parse the nested existentials to understand "no $A_i$ is monochromatic under coloring $c$." +- The hypothesis names `hcount` and `hne2` are clear and consistent with 602's `hcount` and `hne1`. +- The module docstring is well-written and clearly states the problem and its context. + +## 5. Formalizability + +**Assessment: Partially formalizable as stated.** + +The original problem asks to "find" a cardinal, which is not a single theorem statement—it's an open-ended question. The formalization makes a reasonable *specific conjecture* (that $\aleph_0$ suffices), which is clearly formalizable and well-expressed. + +The underlying mathematical concepts are all standard and well-supported in Lean/Mathlib: +- Countable infinity via `Cardinal` and `ℵ₀` +- Set intersection via `Set.inter` and `Set.ncard` +- Coloring as a function `α → ℕ` + +**Ambiguity level: Low-to-moderate.** The problem statement itself is precise, but it asks a question ("find $C$") rather than making an assertion. The formalization resolves this ambiguity by conjecturing a specific answer. Whether this is the *intended* conjecture is a matter of mathematical judgment—the analogy with Komjáth's $\neq 1$ result is reasonable but not stated explicitly in the original problem. + +## 6. Correctness + +**The formalization is mathematically sound but incomplete as a representation of the full problem.** + +**What is correct:** + +- The use of `#(↥(A i)) = ℵ₀` correctly encodes "countably infinite." +- The use of `(A i ∩ A j).ncard ≠ 2` correctly captures the intersection constraint. Since `Set.ncard` returns 0 for infinite sets, infinite intersections automatically satisfy the condition `ncard ≠ 2`, which is consistent with the mathematical meaning of $|A_i \cap A_j| \neq 2$ (an infinite intersection has cardinality $\geq \aleph_0 \neq 2$). +- The coloring `c : α → ℕ` correctly models "at most $\aleph_0$ colours" since $|\mathbb{N}| = \aleph_0$. +- The conclusion correctly expresses non-monochromaticity: for each $A_i$, there exist two elements receiving different colors. +- The `i ≠ j` guard on the intersection condition is correct (without it, the condition $|A_i \cap A_i| = |A_i| = \aleph_0 \neq 2$ would be vacuously true anyway via ncard returning 0 for infinite sets, so the guard is mathematically redundant but stylistically appropriate). + +**What is incomplete:** + +- The formalization only captures the conjectured upper bound $C \leq \aleph_0$, not the full optimization problem of determining the exact minimum $C$. A complete formalization would either (a) also prove a lower bound, or (b) characterize $C$ exactly. +- The Komjáth result for $\neq 1$ mentioned in the docstring is not formalized (though Problem 602 formalizes a related but distinct statement with stronger hypotheses). + +**No mathematical flaws are present.** The statement, as far as it goes, correctly captures a natural and well-motivated conjecture arising from the original problem. diff --git a/ai-review/604.md b/ai-review/604.md new file mode 100644 index 0000000000..eac49bdc3e --- /dev/null +++ b/ai-review/604.md @@ -0,0 +1,96 @@ +# Review: Erdős Problem 604 + +## 1. Code Reuse + +There is significant potential for code reuse with related distance problems already in the codebase: + +- **Problem 89** (`ErdosProblems/89.lean`): The distinct distances problem (all-pairs). It defines `minimalDistinctDistances` and uses Mathlib's `=O[atTop]` big-O notation, which is more idiomatic than the explicit-constant formulation used in Problem 604. Problem 604 could be reformulated using asymptotic notation for consistency. +- **Problem 661** (`ErdosProblems/661.lean`): The bipartite distance problem. It defines `bipartiteDistinctDistances` using `Set.ncard` on a set comprehension, whereas Problem 604 uses `Finset.image` followed by `Finset.card`. These are different approaches to counting distinct distances — Problem 661's `Set.ncard` approach is arguably more standard in the codebase but both work. +- **Problem 1083** (`ErdosProblems/1083.lean`): Higher-dimensional distinct distances. Defines `distinctDistanceCountInDim` using `Set.ncard` on pairs — another related distance-counting utility. + +The `pinnedDistances` definition in Problem 604 is specific to the pinned variant and doesn't have a direct analogue elsewhere, so defining it locally is reasonable. However, one could consider factoring out a shared distance-counting utility across Problems 89, 604, 661, and 1083. + +## 2. Citations + +The docstring currently lists only: + +> [Er57] Erdős, P. (1957) +> [Er61] Erdős, P. (1961) + +The [erdosproblems.com/604](https://www.erdosproblems.com/604) page lists substantially more references: + +> [Er57], [Er61], [Er75f, p.99], [Er83c], [Er85], [Er87b, p.169], [Er90], [Er95], [Er97b], [Er97c], [Er97e], [Er97f] + +Additionally, the Katz–Tardos result is mentioned in the docstring prose but not given a proper citation. The website attributes the best known bound to: + +> Katz, N. H. and Tardos, G. (2004) + +**Recommendation:** Expand the citation list to match the website, and add a proper `[KaTa04]` citation for Katz–Tardos. + +## 3. Variants + +The formalization captures only the strongest form of the conjecture: that some point has $\gg n/\sqrt{\log n}$ pinned distances. The website describes several additional variants that are **not** formalized: + +1. **Weaker pinned distance conjecture:** $\exists x \in A$ such that $\#\{d(x,y) : y \in A\} \gg n^{1-o(1)}$. This is a strictly weaker statement and would be worth formalizing separately. +2. **Average version (sum conjecture):** $\sum_{x \in A} d(x) \gg n^2/\sqrt{\log n}$, where $d(x)$ counts pinned distances from $x$. This is a natural strengthening. +3. **Many-points variant:** Whether $\gg n$ many points (not just one) must each have $\gg n/\sqrt{\log n}$ pinned distances. +4. **Katz–Tardos partial result:** The best known bound $n^{c - o(1)}$ with $c = (48 - 14e)/(55 - 16e) \approx 0.8641$ could be formalized as a solved variant (analogous to how Problem 89 formalizes the Guth–Katz $n/\log n$ result). + +**Recommendation:** Add at least the Katz–Tardos bound as a solved variant and the $n^{1-o(1)}$ weaker form as an open variant. The approach in Problem 89 (which formalizes both the conjecture and the Guth–Katz partial result, plus proves the implication between them) is a good model to follow. + +## 4. Readability + +The code is clean and well-structured overall: + +- The `pinnedDistances` helper is clearly documented and has a natural definition. +- The namespace `Erdos604` is appropriately scoped. +- The docstring explains the problem well, including context about the integer grid optimality. + +Minor readability suggestions: +- The docstring could more clearly separate the conjecture statement from the context/history (e.g., separate the Katz–Tardos remark into its own paragraph or a `-- Known results` comment). +- Consider adding a brief `@[simp]` or definitional lemma for `pinnedDistances` to make downstream reasoning easier. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem as stated on the website is precise enough to formalize. The $\gg$ notation is standard asymptotic notation and the formalization correctly renders it as $\exists C > 0, \exists N_0, \forall n \geq N_0, \ldots \geq C \cdot n / \sqrt{\log n}$. + +One minor source of ambiguity from the website: there is a question of whether the conjecture asks for *one* point $x$ with many pinned distances or *many* points $x$ with many pinned distances. The website notes this ambiguity explicitly. The formalization chooses the "one point" interpretation ($\exists x \in A$), which is the standard reading of the problem. + +The alternative reading (many points, or average version) could be formalized as separate variants. + +## 6. Correctness + +**Overall: Correct with minor observations.** + +### Verified correct aspects: +- The use of `Finset (EuclideanSpace ℝ (Fin 2))` correctly models $n$ distinct points in $\mathbb{R}^2$ (a `Finset` enforces distinctness). +- The asymptotic formulation with explicit constants is mathematically equivalent to the $\gg$ notation. +- `Real.log` is the natural logarithm, consistent with the standard meaning of $\log$ in the problem. +- The `answer(sorry)` wrapper correctly reflects that this is an open problem with unknown truth value. + +### Minor observation — self-distance: +`pinnedDistances x A` is defined as `A.image (fun y => dist x y)`. When `x ∈ A`, this includes `dist x x = 0` in the image. The informal statement asks for "distinct distances from $x$ to other points in $A$", which would exclude the zero self-distance. This means the formalized count could be off by 1 compared to the informal statement. However, since the bound is asymptotic ($\geq C \cdot n / \sqrt{\log n}$), an additive error of 1 does not affect correctness — the formalization is equivalent to the intended statement up to adjusting $C$ or $N_0$. + +Strictly speaking, the cleaner formalization would be: +```lean +noncomputable def pinnedDistances (x : EuclideanSpace ℝ (Fin 2)) + (A : Finset (EuclideanSpace ℝ (Fin 2))) : Finset ℝ := + (A.erase x).image (fun y => dist x y) +``` +or equivalently filtering out `dist x x`. But this is a cosmetic issue for an asymptotic statement. + +### Stylistic comparison with Problem 89: +Problem 89 uses Mathlib's `Asymptotics.IsBigO` (`=O[atTop]`) notation, which is more idiomatic for asymptotic statements in Lean/Mathlib. Problem 604 instead uses explicit quantification over constants. Both are correct, but adopting the `=O[atTop]` style would improve consistency with Problem 89 and make the relationship between the two problems (604 is a strengthening of 89) more formally transparent. + +### Summary + +| Category | Assessment | +|---|---| +| Code reuse | Moderate opportunity — shared distance utilities with Problems 89/661/1083 | +| Citations | **Incomplete** — many references from the website are missing | +| Variants | **Incomplete** — weaker form, average version, and Katz–Tardos bound not formalized | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | Correct (minor self-distance cosmetic issue, does not affect validity) | diff --git a/ai-review/605.md b/ai-review/605.md new file mode 100644 index 0000000000..7958bbfe70 --- /dev/null +++ b/ai-review/605.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 605 + +## 1. Code Reuse + +**Partial overlap with Problem 90.** The `pairsAtDistance` helper in `605.lean` is closely related to `Erdos90.unitDistancePairsCount` in `ErdosProblems/90.lean`. Both filter `offDiag` by a distance predicate. Key differences: + +| | Problem 90 | Problem 605 | +|---|---|---| +| Space | ℝ² | ℝ³ (EuclideanSpace ℝ (Fin 3)) | +| Distance | Fixed at 1 | Parametric `d : ℝ` | +| Counting | Unordered (divides by 2) | Ordered (raw offDiag count) | + +A shared utility `Finset.pairsAtDist` parameterized over the ambient metric space, the target distance, and ordered-vs-unordered could serve both problems. However, the definitions are small (one line each), so the duplication is minor and extracting a shared helper may not be worthwhile unless more problems need the same pattern. Several other Erdős problems in the geometry/distance family (e.g., 96, 132, 135, 232) also work with `EuclideanSpace ℝ (Fin n)` and distance predicates, so a shared definition could eventually pay off. + +The `FormalConjecturesForMathlib/Geometry/2d.lean` file contains `distinctDistances` using `offDiag`, but it counts *distinct* distances rather than pairs at a *given* distance, so it is not directly reusable here. + +No existing code in `FormalConjecturesForMathlib/` provides sphere-constraint predicates or repeated-distance counting that could be reused. + +## 2. Citations + +**Comparison with [erdosproblems.com/605](https://www.erdosproblems.com/605):** + +The Lean docstring includes three references: `[EHP89]`, `[SwVa04]`, and `[Er85]`. The website confirms: + +- **[EHP89]** — Erdős, Hickerson, Pach (1989). ✅ Matches website. Full citation in the Lean file matches. +- **[SwVa04]** — Swanepoel and Valtr (2004). ✅ Matches website. Full citation in the Lean file matches. +- **[Er85]** — Erdős (1985), the original problem source. ✅ Present in the Lean file as the origin attribution. The website cites this problem to Erdős; the specific 1985 reference is appropriate. + +The mathematical results quoted (u_{√2}(n) ≍ n^{4/3}, u_D(n) ≫ n log* n improved to u_D(n) ≫ n√(log n), best upper bound n^{4/3}) all match the website. + +**No missing citations.** The Lean file accurately reflects the references on the website. + +## 3. Variants + +The website describes the problem in terms of a specific function u_D(n) — the maximum number of unit-distance pairs among n points on a sphere of radius D. Several quantitative variants are discussed: + +1. **The special case D = √2:** u_{√2}(n) ≍ n^{4/3} (tight bounds known). +2. **General D > 1:** n√(log n) ≪ u_D(n) ≪ n^{4/3} (gap between lower and upper bounds). +3. **The qualitative question (Problem 605 itself):** Does u_D(n)/n → ∞? + +The formalization captures only variant (3), the qualitative existence question. This is appropriate since that is what Problem 605 asks. The quantitative bounds (variants 1 and 2) are follow-up results that go beyond the problem statement. One could argue that formalizing the *solved* quantitative bounds (especially u_{√2}(n) ≍ n^{4/3}) would be a natural companion, but the current formalization correctly captures the stated problem. + +**The related Problem 90** (unit distances in the plane) is noted on the website. The codebase already has a separate formalization for Problem 90. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- **`pairsAtDistance` docstring says "ordered pairs"** and the theorem docstring clarifies the equivalence with unordered pairs. This is good practice. +- **Namespace `Erdos605`** keeps the helper definition scoped. Good. +- **`open Filter`** is needed for `Tendsto`/`atTop`. Fine. +- The sphere constraint `∀ x ∈ A, ‖x‖ = R` is clear and idiomatic. It constrains points to lie on a sphere of radius R centered at the origin. Since the problem is translation-invariant, centering at the origin is without loss of generality. A brief comment noting this WLOG could aid readability but is not necessary. + +**Overall: readable and well-documented.** + +## 5. Formalizability + +The problem as stated is **precise and unambiguously formalizable**. It asks for the existence of a function f(n) → ∞ such that n points can be placed on S² achieving ≥ f(n)·n same-distance pairs. All quantifiers are clear: + +- "n distinct points on the surface of a two-dimensional sphere" — finitely many distinct points on S² ⊂ ℝ³. +- "at least f(n)n many pairs of points whose distances are the same" — there exists a single distance d such that ≥ f(n)n (unordered) pairs realize that distance. +- "f(n) → ∞ as n → ∞" — standard limit condition. + +**Ambiguity level: Very low.** The only potential ambiguity is whether "pairs" means ordered or unordered, but this does not affect the truth of the statement (dividing/multiplying f by 2 preserves the limit condition). The formalization resolves this by using ordered pairs, which is documented. + +## 6. Correctness + +### 6.1 answer(True) + +The problem is marked as solved in the affirmative on the website. Erdős, Hickerson, and Pach [EHP89] showed u_D(n) ≫ n log* n → ∞, confirming the existence of such f. The `answer(True)` tag is **correct**. + +### 6.2 Sphere encoding + +The constraint `∀ x ∈ A, ‖x‖ = R` with `R > 0` correctly encodes "n points on a sphere of radius R centered at the origin in ℝ³." Since the problem is invariant under rigid motions, centering at the origin is WLOG. **Correct.** + +### 6.3 Distance counting + +`pairsAtDistance A d` counts ordered pairs `(p₁, p₂)` in `A.offDiag` with `dist p₁ p₂ = d`. For a set of n points, if k unordered pairs are at distance d, then `pairsAtDistance A d = 2k`. The formalization requires `2k ≥ f(n) · n`. The original problem requires `k ≥ g(n) · n` for some g → ∞. Since `f(n) = 2g(n) → ∞ ⟺ g(n) → ∞`, the ordered-pair formulation is **equivalent**. **Correct.** + +### 6.4 Quantifier structure + +The formalization states: +``` +∃ f, (f → ∞) ∧ ∀ n ≥ 2, ∃ R > 0, ∃ A (with |A| = n, on sphere of radius R), ∃ d, pairsAtDistance A d ≥ f(n) · n +``` + +This matches the problem: a single function f (not depending on n) that tends to infinity, such that for every n, one can find a sphere and a point configuration achieving the bound. The radius R is allowed to depend on n, which is appropriate — the problem says "a sphere" without fixing its size. **Correct.** + +### 6.5 Use of exact equality for distance + +The filter condition `dist p.1 p.2 = d` uses exact real equality. This is standard in combinatorial geometry formalizations and matches the mathematical statement. **Correct.** + +### 6.6 `n ≥ 2` guard + +The constraint `n ≥ 2` is sensible — for n < 2 there are fewer than 2 points, so no pairs exist. This avoids vacuous edge cases. **Correct.** + +### 6.7 Potential concern: `Tendsto f atTop atTop` + +This requires f : ℕ → ℝ to tend to +∞. Since f maps to ℝ and `atTop` on ℝ means tending to +∞, this correctly encodes "f(n) → ∞ as n → ∞." **Correct.** + +### Summary + +**The formalization is mathematically correct and complete.** It faithfully captures the qualitative question posed by Erdős Problem 605, with appropriate handling of ordered-vs-unordered pairs (documented equivalence), sphere encoding (WLOG centered at origin), and quantifier structure. No flaws identified. diff --git a/ai-review/606.md b/ai-review/606.md new file mode 100644 index 0000000000..627c156679 --- /dev/null +++ b/ai-review/606.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 606 + +## 1. Code Reuse + +Several related Erdős problems in the codebase define nearly identical geometric primitives independently. Consolidation opportunities include: + +- **`numLinesDetermined`** (606.lean:43–46) counts distinct lines as a set of `AffineSubspace` objects via `affineSpan ℝ {a, b}`. Problem 960 defines a nearly identical `lineThrough` (960.lean:61–63) as `affineSpan ℝ {p, q}`. These could share a common definition. +- **`Point2` abbreviation**: Problem 209 defines `abbrev Point2 := EuclideanSpace ℝ (Fin 2)`. The `FormalConjecturesForMathlib/Geometry/2d.lean` file provides the `ℝ²` notation for the same type. Problem 606 spells out `EuclideanSpace ℝ (Fin 2)` everywhere — it could use one of these shorthands for conciseness. +- **`IsLine` predicate**: Problem 209 defines `IsLine` as `Module.finrank ℝ L.direction = 1`. Problems 588 and 960 inline this same condition. Problem 606 avoids this entirely by constructing lines via `affineSpan`, which is a valid alternative approach, but the two representations of "line" in the codebase are not unified. +- **`NoKCollinear`**: Problems 588 and 960 both define variants of this. Not directly needed by 606 but illustrates the pattern of duplicated geometry primitives. + +**Recommendation**: Extract a shared `lineThrough` or `lineDetermined` definition and the `ℝ²` notation into a utility file. Problem 606 could then be expressed more concisely. + +## 2. Citations + +The website (erdosproblems.com/606) lists: + +- **[Er85]** — Erdős, P. (1985) — Original problem formulation. +- **[ErSa88]** — Erdős, P. and Salamon, P. (1988) — Complete solution for sufficiently large n. + +The formalization's docstring cites these as: + +``` +[Er85] Erdős, P. +[ErSa88] Erdős, P. and Salamon, P. +``` + +**Issues**: +- The citations lack years. The website shows [Er85] is from 1985 and [ErSa88] is from 1988. These years should be included. +- The citations lack titles or publication venues. The website does not provide full bibliographic details either, but at minimum the years should be documented. +- The attribution of the problem to Grünbaum is correctly mentioned in the docstring. +- The "Solved" status is correctly noted. + +## 3. Variants + +The formalization includes two theorems: + +1. **`erdos_606`** — The main result: for sufficiently large n, all integers in `[c·n^{3/2}, C(n,2)]` are achievable line counts except `C(n,2) - 1` and `C(n,2) - 3`. +2. **`erdos_606.variants.sylvester_gallai`** — The Sylvester-Gallai lower bound: if n ≥ 2 points are not all collinear, they determine at least n lines. + +**Assessment**: The website mentions three components: +- The Sylvester-Gallai lower bound (captured by the variant). +- The Erdős partial result about `[cn^{3/2}, C(n,2)]` minus two exceptions (captured by the main theorem). +- The complete solution by Erdős-Salamon for sufficiently large n. + +The main theorem captures the Erdős-Salamon characterization. However, a natural additional variant would be: + +- **Small line counts**: The problem asks for *all* possible values of f(n). The formalization only captures the "upper range" `[cn^{3/2}, C(n,2)]`. Values below `cn^{3/2}` — particularly the achievable values in the range `[n, cn^{3/2})` (which includes structured configurations like points on a bounded number of lines) — are not addressed. The Erdős-Salamon result for sufficiently large n is described on the website as "too complex to describe here," suggesting the full characterization involves more cases than what's formalized. +- **The value 1**: All n points being collinear yields f(n) = 1. This degenerate case is implicitly excluded by the Sylvester-Gallai variant but could be noted explicitly. + +## 4. Readability + +**Strengths**: +- The definitions `numLinesDetermined` and `achievableLineCounts` are clean and well-documented. +- The docstrings clearly explain the mathematical content. +- The namespace `Erdos606` keeps things organized. + +**Suggestions**: +- Use the `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean` (or `Point2` from 209.lean) instead of repeatedly writing `EuclideanSpace ℝ (Fin 2)`. This would significantly reduce visual clutter. +- The cast `(k : ℝ)` in the main theorem's lower bound condition `(k : ℝ) ≥ c * (n : ℝ) ^ ((3 : ℝ) / 2)` is functional but slightly awkward. A helper predicate or a cleaner expression of the interval condition could improve readability. +- The exponent `((3 : ℝ) / 2)` could use `(3 / 2 : ℝ)` for slightly cleaner notation, though this is minor. + +## 5. Formalizability + +**Assessment: High formalizability with one caveat.** + +The problem as stated on the website — "What are the possible values of f(n)?" — is an open-ended classification question. The formalization resolves this ambiguity by encoding the known answer (the Erdős-Salamon result), which is a precisely stated mathematical theorem. This is appropriate. + +The key definitions are unambiguous: +- "Distinct lines determined by n points" has a clear formal meaning via affine spans. +- The exceptions `C(n,2) - 1` and `C(n,2) - 3` are precise. +- The "sufficiently large n" quantifier is standard. + +The only mild ambiguity is whether the Erdős-Salamon result *completely* characterizes all achievable values or only those in the stated range. The website says the problem is "solved (for all sufficiently large n) completely," suggesting the full answer may include more structure at the lower end than what's captured. But the formalization focuses on the main published result, which is a reasonable choice. + +## 6. Correctness + +**Main theorem (`erdos_606`)**: + +The statement asserts three things for sufficiently large n: +1. Every k in `[cn^{3/2}, C(n,2)]` with k ≠ C(n,2)−1 and k ≠ C(n,2)−3 is achievable. +2. C(n,2) − 1 is not achievable. +3. C(n,2) − 3 is not achievable. + +**Potential issues**: + +- **Subtraction on naturals**: The conditions `k ≠ n.choose 2 - 1` and `k ≠ n.choose 2 - 3` use natural number subtraction. For n ≥ 3, `n.choose 2 ≥ 3`, so this is fine. But the "sufficiently large n" quantifier ensures this. The non-achievability claims `n.choose 2 - 1 ∉ achievableLineCounts n` and `n.choose 2 - 3 ∉ achievableLineCounts n` similarly rely on n being large enough that these are meaningful. This is handled correctly by the `∃ N₀` quantifier. + +- **Lower bound direction**: The formalization says `∀ k, (k : ℝ) ≥ c * n^(3/2) → k ≤ n.choose 2 → ... → k ∈ achievableLineCounts n`. This is correct: it asserts achievability for all integers in the interval, excluding the two exceptions. + +- **Non-achievability of the two exceptions**: The claims that `C(n,2) - 1` and `C(n,2) - 3` are not achievable are well-known classical results. `C(n,2) - 1` is impossible because removing one line from the complete set means exactly two points coincide or become collinear, which forces other line losses. `C(n,2) - 3` is impossible by a similar combinatorial argument. The formalization correctly states these as unconditional (for large n) non-membership. + +- **The Sylvester-Gallai variant**: The statement says for A with |A| ≥ 2 and `numLinesDetermined A > 1`, we have `numLinesDetermined A ≥ A.card`. This is mathematically correct — it's a well-known consequence of the Sylvester-Gallai theorem. The condition `numLinesDetermined A > 1` correctly encodes "not all collinear" (if all points are collinear, they determine exactly 1 line). + +- **`numLinesDetermined` definition correctness**: The definition counts the set `{l | ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ l = affineSpan ℝ {a, b}}` via `Set.ncard`. This correctly counts the number of distinct lines, since `affineSpan ℝ {a, b}` is the unique line through distinct points a, b, and the set comprehension over all such pairs with the distinctness condition captures exactly the lines determined by A. Using `Set.ncard` (as opposed to `Finset.card`) is appropriate since the set of affine subspaces may not be obviously finite without further argument, and `ncard` handles this gracefully (returning 0 for infinite sets, which won't arise in practice for finite point sets in ℝ²). + +**Overall correctness: Sound.** The formalization correctly captures the known mathematical result. No mathematical errors detected. + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Minor opportunities | Could use shared `ℝ²` notation and a common `lineThrough` definition | +| Citations | Incomplete | Missing years (1985, 1988) and titles | +| Variants | Adequate | Main result + Sylvester-Gallai; lower range characterization not captured | +| Readability | Good | Would benefit from `ℝ²` notation to reduce verbosity | +| Formalizability | High | Precisely stated; minor ambiguity about completeness of characterization | +| Correctness | Correct | Mathematically sound; natural number subtraction handled by sufficiently-large-n quantifier | diff --git a/ai-review/607.md b/ai-review/607.md new file mode 100644 index 0000000000..fa2c58a182 --- /dev/null +++ b/ai-review/607.md @@ -0,0 +1,102 @@ +# AI Review: Erdős Problem 607 + +**File:** `FormalConjectures/ErdosProblems/607.lean` + +## 1. Code Reuse + +Several opportunities for reuse exist: + +- **`Collinear607`** is identical in logic to `Collinear` in `ErdosProblems/733.lean:44–45`, which uses the same cross-product vanishing definition for `ℝ × ℝ`. A shared utility definition could serve both. +- **Mathlib's `Collinear ℝ`** is the standard collinearity predicate used across the codebase (e.g., in `ErdosProblems/827.lean`, `735.lean`, and `FormalConjecturesForMathlib/Geometry/2d.lean`). It operates on `Set` rather than a three-point predicate, so adapting it here would require a thin wrapper, but would improve consistency with the rest of the codebase. +- The **line incidence** concept (counting points on a line through two points) appears in various forms in `ErdosProblems/101.lean` and `588.lean` using `AffineSubspace` and `Set.ncard`. The `AffineSubspace`-based approach is more canonical in Mathlib but heavier; the current lightweight approach is acceptable for a self-contained formalization. +- No existing line spectrum definition exists elsewhere in the codebase, so `lineSpectrum607` and `achievableSpectra607` are necessarily new. + +**Verdict:** The `Collinear607` definition is duplicated from 733.lean and could be shared. Otherwise, the bespoke definitions are reasonable for this problem's unique concepts. + +## 2. Citations + +The website ([erdosproblems.com/607](https://www.erdosproblems.com/607)) lists: +- **[Er85]** as the original source (Erdős). +- **[SzTr83]** as the proof by Szemerédi and Trotter. + +The docstring references match: +- `[Er85] Erdős, P., *Problems and results in combinatorial geometry*.` — matches the website. +- `[SzTr83] Szemerédi, E. and Trotter, W. T., *Extremal problems in discrete geometry* (1983).` — matches the website. + +The website also notes a **$250 prize** associated with this problem, which is not mentioned in the formalization (this is fine — prize information is not mathematically relevant). + +**Verdict:** Citations are consistent with the website. + +## 3. Variants + +The website states that Erdős noted the bound exp(O(√n)) would be **"best possible."** This implies a matching lower bound: + +> There exist configurations witnessing F(n) ≥ exp(c√n) for some c > 0. + +This lower bound variant is **not captured** in the formalization. Only the upper bound (proved by Szemerédi–Trotter) is formalized. A complete treatment could include a second conjecture or theorem for the lower bound, confirming tightness of the exponential order. + +No other variants are mentioned on the website. + +**Verdict:** The upper bound is captured. The matching lower bound (asserting tightness) is missing and could be added as a separate statement. + +## 4. Readability + +The code is well-structured and readable: +- The `Erdos607` namespace and `607` suffixes on helper definitions prevent name collisions. +- Each definition has a clear docstring explaining its mathematical meaning. +- The progression from `Collinear607` → `lineIncidence607` → `lineSpectrum607` → `achievableSpectra607` → `erdos_607` follows a logical buildup. + +Minor suggestions: +- The module docstring could mention that the bound is known to be tight (per Erdős's remark). +- The `lineSpectrum607` definition is somewhat dense as a single expression; a brief inline comment on the biUnion/image pipeline could help, though the docstring already explains the intent. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem as stated on the website is precise: +- "Lines determined by P" = lines through at least two points of P. +- "A" = the set of distinct incidence values |ℓ ∩ P|. +- "F(n)" = number of distinct sets A achievable by n-point configurations. +- The upper bound F(n) ≤ exp(O(√n)) is a standard asymptotic claim. + +There is essentially **no ambiguity** in the statement. The only interpretive choice is whether "n-point configuration" means n distinct points (natural for Finset) or allows repeated points (a multiset). The Finset formalization enforces distinctness, which is the standard convention in combinatorial geometry. + +**Verdict:** The problem is unambiguously formalizable. The Finset (distinct points) interpretation is correct. + +## 6. Correctness + +### Collinear607 +The cross-product test `(q.1 - p.1) * (r.2 - p.2) = (r.1 - p.1) * (q.2 - p.2)` is the standard collinearity criterion for three points in ℝ². Correctly identifies when p, q, r are collinear (including degenerate cases where r = p or r = q, which evaluate to 0 = 0). + +### lineIncidence607 +Counts `|{r ∈ P : Collinear607 p q r}|`. For distinct p, q this equals |ℓ(p,q) ∩ P|, which is the correct incidence count. The points p and q themselves are counted (as they should be, since they lie on the line). + +### lineSpectrum607 +Iterates over all ordered pairs (p, q) in P with p ≠ q, computes the incidence of their line, and collects distinct values into a Finset ℕ. Since any two distinct points on the same line yield the same incidence value, this correctly produces {|ℓ ∩ P| : ℓ is a line determined by P}. The use of `biUnion` and `image` into `Finset ℕ` correctly deduplicates. + +### achievableSpectra607 +Defined as `{S | ∃ P : Finset (ℝ × ℝ), P.card = n ∧ lineSpectrum607 P = S}`, correctly ranging over all n-point configurations. + +### erdos_607 +The theorem states: ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, `achievableSpectra607 n` is finite and its cardinality ≤ exp(C√n). + +- The **finiteness** conjunct is necessary since `achievableSpectra607 n` is a `Set (Finset ℕ)`, not a `Finset`. This is a sound modeling choice. +- The asymptotic form `∃ C > 0, ∃ n₀, ∀ n ≥ n₀` correctly captures the O(√n) bound from the problem statement. +- Using `Set.ncard` (which returns 0 for infinite sets) paired with the explicit `Finite` conjunct is the correct idiom. + +### Potential concern +The formalization only captures the **upper bound**. Per the website, the result is described as affirming Erdős's question "whether F(n) ≤ exp(O(√n))," and the formalization correctly captures this as a theorem (marked `solved`). The fact that the bound is tight is a separate (unstated) claim. + +**Verdict:** The formalization is mathematically correct and complete with respect to the stated problem. No flaws identified. The only gap is the missing tightness/lower bound variant, which is a separate claim. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `Collinear607` duplicates `733.lean`; Mathlib's `Collinear ℝ` could be used instead | +| Citations | Correct and consistent with website | +| Variants | Upper bound captured; lower bound (tightness) not captured | +| Readability | Good | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete for the stated problem | diff --git a/ai-review/608.md b/ai-review/608.md new file mode 100644 index 0000000000..fd61776611 --- /dev/null +++ b/ai-review/608.md @@ -0,0 +1,102 @@ +# Review: Erdős Problem 608 + +**File:** `FormalConjectures/ErdosProblems/608.lean` + +## 1. Code Reuse + +Several related definitions exist in the codebase: + +- **Problem 1012** (`ContainsCycleOfLength`): A general definition for detecting cycles of arbitrary length using injective functions `f : Fin m → V`. This could be adapted to define "edge contained in a C₅" but is a *containment* predicate, not an *edge-counting* definition, so it does not directly replace `numEdgesInC5`. +- **Problem 24** (labeled C₅ counting): Counts labeled 5-cycles via injective functions `Fin 5 → Fin (5n)` with adjacency conditions. This counts *cycles*, not *edges in cycles*, so the concerns are different. +- **Problem 1016** (`numEdges`): Uses a similar `Finset.univ.filter ... .card` pattern for edge counting. +- **Problems 904, 905, 1034**: Use the same `G.edgeFinset.card > n²/4` density threshold pattern. + +**Verdict:** No existing definition can directly replace `numEdgesInC5`. The definition is specific to counting edges (not cycles) that participate in a C₅, which is the precise quantity the problem asks about. The definition is appropriately self-contained. + +A possible improvement would be to factor out a general `numEdgesInCycle` definition parameterized by cycle length, which could serve Problems 608 and similar future formalizations, but this is not strictly necessary. + +## 2. Citations + +Comparing the docstring with [erdosproblems.com/608](https://www.erdosproblems.com/608): + +- **[EFR92]** — Docstring: "Erdős, Faudree, Rousseau (1992)". Website confirms this. Missing full title/journal info (not provided on the website either). **OK.** +- **[Er97d]** — Docstring: "Erdős (1997)". Website confirms. **OK.** +- **[GHV19]** — Docstring: "Grzesik, A., Hu, P., and Volec, J." Website confirms. Missing full title/journal info (not provided on the website). **OK.** + +**Issue:** The docstring states "Füredi and Maleki constructed graphs with more than n²/4 edges where at most c·n² + O(n) edges are in a C₅." The website attributes the *tight construction* to [GHV19], noting that "Füredi and Maleki (unpublished) provided early counterexamples." The docstring's attribution is somewhat misleading — it implies Füredi and Maleki found the optimal construction with constant c = (2+√2)/16, whereas the website suggests [GHV19] established both the construction and the matching lower bound. Consider revising to clarify that [GHV19] proved the tight result and that Füredi–Maleki's contribution was an earlier (unpublished) counterexample. + +## 3. Variants + +The website notes an important generalization: + +- For **C₅** (k=2): The conjecture (2/9)n² is **disproved**; the correct constant is c = (2+√2)/16 ≈ 0.2134 < 2/9 ≈ 0.2222. +- For **C_{2k+1} with k ≥ 3**: [GHV19] **confirmed** the (2/9)n² − O(n) bound is tight. + +The formalization captures only the C₅ case, which is the original Erdős Problem 608. The generalization to longer odd cycles is a distinct (and solved) result that could be mentioned in the docstring but is not required as a separate formalization under this problem number. **No variants are missing for the scope of Problem 608.** + +## 4. Readability + +The code is well-structured and readable: + +- The `numEdgesInC5` definition has a clear docstring explaining the counting convention (ordered pairs with u < v to avoid double-counting). +- The theorem statement is concise. +- Variable names (w₁, w₂, w₃) are natural for the intermediate cycle vertices. + +**Minor suggestion:** The docstring for `numEdgesInC5` says "Edges are counted as ordered pairs (u, v) with u < v" — technically these are *ordered* pairs constrained to u < v, which is equivalent to counting *unordered* edges. The phrase "unordered edges {u, v}" would be slightly clearer, but this is cosmetic. + +## 5. Formalizability + +The problem is **fully formalizable** with no ambiguity: + +- "Graph with n vertices and more than n²/4 edges" is precise. +- "Edges contained in a C₅" is well-defined: an edge {u,v} is in a C₅ if there exists a 5-cycle in G that uses {u,v} as one of its edges. +- The threshold (2/9)n² is a specific numeric constant. +- The disproved status is unambiguous. + +**Ambiguity level: None.** The statement is a clean combinatorial claim with no room for interpretation. + +## 6. Correctness + +### 6.1 `numEdgesInC5` definition + +The definition correctly counts edges contained in a C₅: + +- It iterates over pairs (u, v) with u < v and G.Adj u v (i.e., edges of G). +- For each edge, it checks for the existence of w₁, w₂, w₃ such that u–w₁–w₂–w₃–v–u forms a 5-cycle. +- The distinctness of all five vertices is enforced by `({p.1, p.2, w₁, w₂, w₃} : Finset (Fin n)).card = 5`. + +**Key correctness argument:** Any edge {u,v} that lies in *some* C₅ will be detected. If the C₅ is a–b–c–d–e–a and {u,v} = {a,b} (with a < b so u=a, v=b), then the "other way around" the cycle gives the path a–e–d–c–b, so setting w₁=e, w₂=d, w₃=c satisfies all adjacency conditions. By symmetry of cycles, this works regardless of which edge of the C₅ is {u,v}. **The definition is correct.** + +### 6.2 Theorem statement + +```lean +theorem erdos_608 : answer(False) ↔ + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + (G.edgeFinset.card : ℝ) > (n : ℝ) ^ 2 / 4 → + (numEdgesInC5 G : ℝ) ≥ 2 / 9 * (n : ℝ) ^ 2 +``` + +- `answer(False) ↔ P` asserts ¬P, encoding that the conjecture P is **false** (disproved). **Correct.** +- The universal quantification over all n and all graphs G on Fin n is correct. +- The edge density condition `> n²/4` matches the problem statement ("more than n²/4 edges"). Over ℝ this correctly handles non-integer thresholds. **Correct.** +- The conclusion `numEdgesInC5 G ≥ (2/9) * n²` matches the conjectured bound. **Correct.** +- The tags `@[category research solved, AMS 5]` are appropriate (combinatorics, solved/disproved). + +### 6.3 Potential concern: `DecidableRel` / `Classical` + +The file opens `scoped Classical`, making `DecidableRel G.Adj` available classically. This is needed for `edgeFinset` and the `Finset.univ.filter` in `numEdgesInC5`. The `noncomputable` annotation on `numEdgesInC5` is consistent with this. **No issues.** + +### 6.4 Verdict + +**The formalization is mathematically correct and complete.** The `numEdgesInC5` definition faithfully captures the concept of "number of edges contained in a C₅," and the theorem statement correctly encodes the disproved conjecture. No mathematical flaws are present. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reusable definitions found; `numEdgesInC5` is appropriately specific | +| Citations | Mostly accurate; Füredi–Maleki attribution should clarify their work was unpublished/preliminary | +| Variants | C₅ case fully captured; C_{2k+1} generalization noted but out of scope | +| Readability | Good; minor cosmetic suggestion on docstring wording | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | **Correct and complete** | diff --git a/ai-review/609.md b/ai-review/609.md new file mode 100644 index 0000000000..ae275de5b6 --- /dev/null +++ b/ai-review/609.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 609 + +## 1. Code Reuse + +The formalization defines a custom `HasMonoCycle609` predicate using raw functions `χ : Fin N → Fin N → Fin c` to represent edge colorings. The codebase has substantial `SimpleGraph.Coloring` infrastructure in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`, but that machinery is for *vertex* coloring, not edge coloring. Since Problem 609 is about edge colorings of complete graphs, the custom approach is justified. No existing definition in FormalConjecturesForMathlib directly captures monochromatic cycles in edge-colored complete graphs. + +Several other Erdős problems (e.g., 57, 58, 63–65, 71–72, 584–585, 626, 640–642) define similar custom monochromatic cycle/path predicates. There is an opportunity for a shared utility (e.g., a general `HasMonoCycle` definition parameterized by graph size and color count), but this is not a deficiency of the current file — it is a codebase-wide pattern. + +**Verdict:** No actionable reuse opportunity; the custom definition is appropriate. + +## 2. Citations + +The website [erdosproblems.com/609](https://www.erdosproblems.com/609) lists five references: + +| Tag | Authors | Present in formalization? | +|-----|---------|--------------------------| +| [ErGr75] | Erdős, P. and Graham, R. | Yes | +| [Ch97] | Chung (1997) | **No** — Chung asked whether f(n) → ∞ | +| [DaJo17] | Day, A. N. and Johnson, J. R. | Yes | +| [GiHu24] | Girão and Hunter (2024) | **No** — proved f(n) ≪ 2^n / n^{1−o(1)} | +| [JaYi25] | Janzer, O. and Yip, C. H. | Yes | + +**Issues:** +- [Ch97] is missing. Chung's question (whether f(n) → ∞) is historically significant and answered affirmatively by Day–Johnson. +- [GiHu24] is missing. Girão and Hunter proved an intermediate upper bound f(n) ≪ 2^n / n^{1−o(1)}, which sits between the trivial bound and Janzer–Yip. +- The existing references lack titles, journal names, and years (only shorthand tags are given). The website itself only provides shorthand, so this matches the source. + +## 3. Variants + +The formalization captures three statements: +1. `erdos_609` — Existence of a monochromatic odd cycle (finiteness of f(n)). +2. `erdos_609.variants.lower_bound` — Day–Johnson lower bound: f(n) ≥ 2^{c√(log n)}. +3. `erdos_609.variants.upper_bound` — Janzer–Yip upper bound: f(n) ≤ C · n^{3/2} · 2^{n/2}. + +**Missing variants:** +- **Girão–Hunter upper bound** [GiHu24]: f(n) ≪ 2^n / n^{1−o(1)}. This is a weaker but historically important intermediate bound. +- **Avoidability of short cycles**: The website notes that C₅ and C₇ can be avoided for large n, implying f(n) ≥ 9 eventually. This could be a concrete variant. +- **Chung's question** [Ch97]: Whether f(n) → ∞. This is implied by the Day–Johnson lower bound but could be stated as a standalone (weaker) result: `∀ M, ∃ n₀, ∀ n ≥ n₀, ...`. + +The most significant omission is the Girão–Hunter bound. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The `HasMonoCycle609` definition has a clear docstring explaining what a monochromatic cycle is. +- The modular arithmetic in `⟨(i.val + 1) % k, Nat.mod_lt _ (by have := i.isLt; omega)⟩` is somewhat dense but correct. A helper like `Fin.cycle_succ` could improve readability, though this is minor. +- The three theorem statements follow a consistent pattern and are well-documented. +- The namespace `Erdos609` keeps definitions contained. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem as stated on the website ("Estimate f(n)") is inherently imprecise — "estimate" is not a formally definable goal. However, the formalization correctly decomposes this into precise, formalizable sub-statements (existence, lower bound, upper bound), which is the right approach. + +Minor ambiguities: +- **Logarithm base**: `Real.log` is the natural logarithm. The Day–Johnson paper likely uses log base 2. This only affects the constant c, not the form of the bound, so it is mathematically equivalent. +- **"Odd cycle"**: The formalization uses `Odd k` where k is the number of vertices. In a cycle, the number of edges equals the number of vertices, so an odd number of vertices gives an odd cycle. This is standard and correct. +- **Self-loops**: The coloring χ is defined on all pairs (u, v) including u = v, but `HasMonoCycle609` requires injective vertex sequences with k ≥ 3, so self-loops never appear in cycles. Not an issue. + +**Verdict:** High formalizability. The decomposition into sub-statements is appropriate for the imprecise "estimate" directive. + +## 6. Correctness + +### `HasMonoCycle609` +Correctly defines a monochromatic cycle: k ≥ 3 distinct vertices forming a cycle where all edges share one color. The wrap-around edge v_{k-1} → v_0 is correctly handled via modular arithmetic. ✓ + +### `erdos_609` +States that every symmetric n-coloring of K_{2^n+1} contains a monochromatic odd cycle. This is mathematically correct — K_{2^n} can be n-colored to avoid odd cycles (partition vertices by binary coordinates into bipartite graphs), but K_{2^n+1} cannot. The symmetry condition `∀ u v, χ u v = χ v u` correctly models undirected edges. ✓ + +### `erdos_609.variants.lower_bound` +States existence of c > 0 and n₀ such that for n ≥ n₀, there exists a symmetric n-coloring of K_{2^n+1} where every monochromatic odd cycle has length ≥ 2^{c√(log n)}. This correctly formalizes the Day–Johnson result. ✓ + +### `erdos_609.variants.upper_bound` +States existence of C > 0 and n₀ such that for n ≥ n₀, every symmetric n-coloring of K_{2^n+1} contains a monochromatic odd cycle of length ≤ C · n^{3/2} · 2^{n/2}. This correctly formalizes the Janzer–Yip result. ✓ + +### Category tag concern +All three theorems are tagged `category research solved`. The website marks Problem 609 as **OPEN** ("Estimate f(n)"). However, each individual formalized statement *is* a theorem proved in the literature, so the tag is defensible — it refers to the specific statement, not the overarching problem. Still, a comment noting that the full problem (tight estimation of f(n)) remains open would be valuable for clarity. + +### AMS classification +Tagged `AMS 5` (Combinatorics). This is correct for a Ramsey-theoretic graph coloring problem. + +**Verdict:** The formalization is mathematically correct and complete for the statements it captures. No flaws identified. The gap between the lower bound 2^{c√(log n)} and upper bound C · n^{3/2} · 2^{n/2} correctly reflects the current state of knowledge. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No issues; custom definitions appropriate | +| Citations | Missing [Ch97] and [GiHu24] | +| Variants | Missing Girão–Hunter bound; minor omissions | +| Readability | Good | +| Formalizability | High | +| Correctness | Correct and complete for stated theorems | diff --git a/ai-review/610.md b/ai-review/610.md new file mode 100644 index 0000000000..2344f396df --- /dev/null +++ b/ai-review/610.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 610 + +## 1. Code Reuse + +**Major duplication detected.** The definitions `IsMaximalCliqueFS`, `IsCliqueTransversal`, and `cliqueTransversalNum`/`cliqueTransversalNumber` are copy-pasted identically (modulo minor naming) across three files: + +- `FormalConjectures/ErdosProblems/610.lean` (namespace `Erdos610`) +- `FormalConjectures/ErdosProblems/611.lean` (namespace `Erdos611`) +- `FormalConjectures/ErdosProblems/151.lean` (namespace `Erdos151`) + +These should be factored into a shared file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/CliqueTransversal.lean`). + +Additionally, Mathlib already provides: + +- `SimpleGraph.IsClique` — used correctly by the formalization. +- `Maximal G.IsClique s` (in `Mathlib.Combinatorics.SimpleGraph.Clique`) — equivalent to the custom `IsMaximalCliqueFS` but defined on `Set α`. The custom definition `∀ v ∉ S, ¬G.IsClique ↑(insert v S)` is logically equivalent to the `Maximal` predicate for finite sets (since any proper superset must contain at least one new element), but using `Maximal` directly would be more idiomatic and would avoid reinventing existing infrastructure. +- `SimpleGraph.indepNum` and `SimpleGraph.IsIndepSet` — Problem 151 redefines `IsIndependentSet` and `independenceNumber` instead of using these. + +**Recommendation:** Extract the shared definitions into a common file. Consider building `IsMaximalCliqueFS` as a wrapper around `Maximal G.IsClique ↑S` to leverage existing Mathlib lemmas about maximal elements. + +## 2. Citations + +The formalization includes three references: +- **[EGT92]** Erdős, P., Gallai, T., and Tuza, Zs., *Covering the cliques of a graph with vertices*, Discrete Mathematics, 1992. ✅ Matches website. +- **[Er94]** Erdős, P., *Some old and new problems in various branches of combinatorics*, Discrete Mathematics, 1994. ✅ Matches website. +- **[Er99]** Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Le Matematiche, 1999. ✅ Matches website (journal listed as "Matematiche (Catania)" on the site; "Le Matematiche" is the full journal name — acceptable). + +**Missing from the formalization (present on the website):** +- The website notes that a positive answer to the strong form would follow from resolving **Problem 151**, via the Ajtai–Komlós–Szemerédi result that $H(n) \gg \sqrt{n \log n}$. The docstring does not mention this connection. +- The website mentions Kim's lower bound for $R(3,k)$ as providing evidence for tightness. This is contextual rather than a direct citation requirement. +- The website lists **Related Problems: 151, 611**. The docstring does not mention these. + +**Recommendation:** Add a note in the module docstring mentioning the connection to Problems 151 and 611, e.g.: "A positive answer to the strong form would follow from Problem 151 (Erdős–Gallai conjecture on $\tau(G) \leq n - H(n)$), since Ajtai, Komlós, and Szemerédi proved $H(n) \gg \sqrt{n \log n}$." + +## 3. Variants + +The formalization captures three variants: + +| Variant | Status | Captured? | +|---------|--------|-----------| +| Weak form: $\tau(G) \leq n - \omega(n)\sqrt{n}$ | Open | ✅ `erdos_610` | +| Strong form: $\tau(G) \leq n - c\sqrt{n \log n}$ | Open | ✅ `erdos_610.variants.strong` | +| Known bound (EGT92): $\tau(G) \leq n - \sqrt{2n} + O(1)$ | Solved | ✅ `erdos_610.variants.known_bound` | + +The Erdős–Gallai conjecture that $\tau(G) \leq n - f(n)$ (where $f(n)$ is the largest independent set guaranteed in triangle-free graphs on $n$ vertices) is formalized separately as **Problem 151**, which is appropriate since it is its own numbered problem. + +**Assessment:** All variants specific to Problem 610 are captured. The decomposition into three statements (weak conjecture, strong conjecture, known result) is well-structured. + +## 4. Readability + +The code is generally well-organized and readable. Minor suggestions: + +- **Naming consistency:** Problem 610 uses `cliqueTransversalNum` while Problem 151 uses `cliqueTransversalNumber`. If these are meant to be the same concept (and they are), the naming should be consistent. +- **Docstrings:** Each definition has a clear docstring. The module-level docstring gives good context. +- **Structure:** The progression from known bound → weak conjecture → strong conjecture is logical. The file reads well top-to-bottom. +- **Minor:** The `2 ≤ S.card` condition in `IsCliqueTransversal` is explained nowhere in the code. A brief comment noting that singleton maximal cliques (isolated vertices) are excluded by convention would help readers unfamiliar with the clique transversal literature. + +## 5. Formalizability + +**Assessment: Fully formalizable, no ambiguity.** + +The problem as stated on erdosproblems.com is precise: +- "Clique transversal number" has a standard definition. +- The bounds $n - \omega(n)\sqrt{n}$ and $n - c\sqrt{n \log n}$ are unambiguous. +- The known result $\tau(G) \leq n - \sqrt{2n} + O(1)$ is formalized as $\exists C, \forall n \geq 1, \forall G, \tau(G) \leq n - \sqrt{2n} + C$, which is a correct rendering of $O(1)$. + +The only subtlety is the convention of excluding singleton maximal cliques from the transversal requirement, which is the standard convention in the Erdős–Gallai–Tuza papers and is correctly implemented. + +**Ambiguity level: None.** The mathematical content is completely precise. + +## 6. Correctness + +### Definitions + +- **`IsMaximalCliqueFS`**: Correctly captures maximal cliques. The condition that $S$ is a clique and no single vertex can be added is equivalent to the standard definition of maximality. ✅ + +- **`IsCliqueTransversal`**: Correctly requires that the transversal intersects every maximal clique of size $\geq 2$. The exclusion of singletons is the standard convention (otherwise the problem is trivial: every vertex is a maximal clique of size 1 in the complement graph, forcing $\tau(G) = n$). ✅ + +- **`cliqueTransversalNum`**: Uses `sInf` over the set of achievable cardinalities. This is well-defined because the full vertex set `Finset.univ` is always a valid clique transversal, so the set is nonempty. Since `sInf` on `ℕ` returns 0 for the empty set, and the set is never empty here, this correctly computes the minimum. ✅ + +### Theorem Statements + +- **`erdos_610` (weak form)**: `Tendsto ω atTop atTop` correctly captures $\omega(n) \to \infty$. The bound `(cliqueTransversalNum G : ℝ) ≤ (n : ℝ) - ω n * Real.sqrt (n : ℝ)` correctly formalizes $\tau(G) \leq n - \omega(n)\sqrt{n}$. The `n ≥ 1` guard is appropriate (for $n = 0$, `Fin 0` is empty so the graph is vacuous). The `answer(sorry)` wrapper is appropriate for an open problem with unknown truth value. ✅ + +- **`erdos_610.variants.strong`**: The bound uses `Real.sqrt ((n : ℝ) * Real.log (n : ℝ))`, correctly formalizing $\sqrt{n \log n}$. Here `Real.log` is the natural logarithm, which is the standard convention in combinatorics. The `n ≥ 2` guard is appropriate since $\log 1 = 0$ and $\log 0$ is undefined (Mathlib defines `Real.log 0 = 0`). ✅ + +- **`erdos_610.variants.known_bound`**: Correctly states $\exists C > 0, \forall n \geq 1, \forall G, \tau(G) \leq n - \sqrt{2n} + C$. Note that $C$ is not required to be positive (the existential is over all reals), which is fine — it makes the statement slightly stronger. Correctly tagged `category research solved`. ✅ + +### Potential Issues + +1. **`cliqueTransversalNum` for trivial graphs:** For the graph on `Fin 1` (a single vertex, no edges), every maximal clique has size 1 (below the threshold), so the empty set is a valid transversal and `cliqueTransversalNum = 0`. The weak-form bound becomes `0 ≤ 1 - ω(1)`, which requires `ω(1) ≤ 1`. This is not a problem since $\omega$ only needs to tend to infinity — it can be arbitrarily small for finitely many values. ✅ No issue. + +2. **Casting considerations:** The statement casts `cliqueTransversalNum G` (a `ℕ`) to `ℝ` and compares with `(n : ℝ) - ...`. Since subtraction on `ℝ` can be negative while `cliqueTransversalNum` is always $\geq 0$, the bound is well-formed and the cast is correct. ✅ + +**Overall correctness assessment: The formalization is mathematically correct and complete.** No flaws identified. An experienced mathematician would find the formalization faithful to the original problem. diff --git a/ai-review/611.md b/ai-review/611.md new file mode 100644 index 0000000000..d57ae4dbd2 --- /dev/null +++ b/ai-review/611.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 611 + +## 1. Code Reuse + +**Significant duplication with Problem 610.** The definitions `IsMaximalCliqueFS`, `IsCliqueTransversal`, and `cliqueTransversalNum` are identically defined in both `Erdos610` and `Erdos611` namespaces (compare `610.lean:50–62` with `611.lean:45–57`). These should be extracted into a shared module under `FormalConjecturesForMathlib` (or a common `ErdosProblems/CliqueTransversal.lean` utility file) and imported by both problems. + +Additionally, `AllMaxCliquesAtLeast` from 611 could be useful for other clique-related problems and is a natural candidate for shared infrastructure. + +No existing definitions in `FormalConjecturesForMathlib` cover maximal clique transversals. Mathlib provides `SimpleGraph.IsClique` and `SimpleGraph.IsNClique` but has no built-in notion of maximal clique or clique transversal number. The custom definitions here are necessary, but should be centralized. + +## 2. Citations + +The formalization includes three references: + +| Tag | Formalization | Website | +|-----|--------------|---------| +| [EGT92] | Erdős, P., Gallai, T., and Tuza, Z., *Covering the cliques of a graph with vertices*. Discrete Mathematics (1992). | Matches ✓ (website uses "Zs." for Tuza's initial; formalization uses "Z." — minor inconsistency) | +| [Er94] | Erdős, P., *Some old and new problems in various branches of combinatorics*. Discrete Mathematics (1994). | Matches ✓ | +| [Er99] | Erdős, P., *Some of my favourite problems in various branches of combinatorics*. Matematiche (Catania) (1999). | Matches ✓ | + +The Bollobás–Erdős result (`variants.bollobas_erdos`) has no specific paper citation in the docstring. The website also does not provide a specific citation for this result beyond naming the authors. Acceptable, but a citation would strengthen the formalization. + +## 3. Variants + +The formalization captures three statements: + +1. **Main conjecture** (`erdos_611`): If all maximal cliques have ≥ cn vertices, then τ(G) = o(n). ✓ +2. **Known bound** (`variants.known_bound`): τ(G) ≤ n − √(kn) when all maximal cliques have ≥ k vertices. ✓ +3. **Bollobás–Erdős** (`variants.bollobas_erdos`): Threshold n + 3 − 2√n for τ(G) ≤ 1. ✓ + +**Missing variants from the website:** + +- **The k_c(n) estimation problem**: The website poses a second question — "For c > 0, estimate the minimal k_c(n) such that if every maximal clique has at least k_c(n) vertices, then τ(G) < (1−c)n." This is a distinct open problem not captured. +- **Lower bound on k_c(n)**: The website notes that Erdős–Gallai–Tuza proved k_c(n) ≥ n^{c'/log log n} for some c' > 0. This known result is not formalized. + +## 4. Readability + +The code is generally clean and well-structured. Some observations: + +- The docstrings are clear and provide the mathematical context well. +- The `AllMaxCliquesAtLeast` definition name is descriptive. +- The use of `⌈c * n⌉₊` (natural number ceiling) for the threshold in the main conjecture is a reasonable discretization choice. +- The `hc1 : c ≤ 1` hypothesis in the main theorem is a nice touch, making explicit that the constant must be at most 1. +- Minor: The `Erdos611` namespace prefix could be documented as a convention. + +## 5. Formalizability + +**Assessment: Mostly precise, with one area of ambiguity.** + +The main conjecture (τ(G) = o_c(n)) is inherently asymptotic and the formalization correctly renders it as an ε-N statement: for all ε > 0, there exists N₀ such that for n ≥ N₀, τ(G) ≤ εn. This is the standard and unambiguous way to formalize little-o. + +The known bound and Bollobás–Erdős results are concrete inequalities and are straightforwardly formalizable. + +**Ambiguity in the original problem:** The phrase "every maximal clique of G on n vertices has at least cn vertices" is ambiguous about whether isolated vertices (singleton maximal cliques) are included. The formalization sidesteps this by filtering on cliques with ≥ 2 vertices in `IsCliqueTransversal`, which is a reasonable convention but diverges slightly from a literal reading. See Correctness below. + +## 6. Correctness + +### 6.1 Main Conjecture (`erdos_611`) — Largely Correct + +The ε-N formulation faithfully captures the asymptotic statement. The use of `⌈c * n⌉₊` as the threshold (rather than, say, `⌊c * n⌋`) is a conservative choice — it rounds up, making the hypothesis slightly stronger, which is the safe direction for the conclusion. + +### 6.2 Known Bound (`variants.known_bound`) — Correct + +The bound τ(G) ≤ n − √(kn) matches the website. The hypotheses `n ≥ 1` and `k ≥ 1` are appropriate. + +### 6.3 Bollobás–Erdős (`variants.bollobas_erdos`) — Minor Issue with `Nat.sqrt` + +The threshold is formalized as `n + 3 - 2 * Nat.sqrt n`, where `Nat.sqrt n = ⌊√n⌋`. For non-perfect-square n, `⌊√n⌋ < √n`, so `2 * ⌊√n⌋ < 2√n`, and thus the formalized threshold `n + 3 − 2⌊√n⌋` is *strictly greater* than the mathematical threshold `n + 3 − 2√n`. This makes the formalized hypothesis *stronger* (fewer graphs satisfy it), and hence the formalized theorem is *weaker* than the actual Bollobás–Erdős result. + +For example, at n = 5: √5 ≈ 2.236, so the mathematical threshold is ≈ 3.53, i.e., ⌈3.53⌉ = 4. The formalized threshold is 5 + 3 − 2·2 = 4. In this case they agree. But at n = 8: √8 ≈ 2.83, mathematical threshold ≈ 5.34, formalized threshold = 8 + 3 − 2·2 = 7. The mathematical ceiling would be 6, but the formalization requires 7. This is a genuine weakening. + +**Recommendation:** Use `⌈2 * Real.sqrt n⌉₊` instead of `2 * Nat.sqrt n` to more faithfully capture the continuous threshold. The current formalization is *not incorrect* (it's a valid but weaker statement), but it doesn't capture the full strength of the result. + +### 6.4 The 2-Vertex Filter in `IsCliqueTransversal` + +Both `IsCliqueTransversal` and `AllMaxCliquesAtLeast` only consider maximal cliques with ≥ 2 vertices. This means: + +- **Singleton cliques (isolated vertices) are excluded** from the transversal requirement. The standard mathematical definition of clique transversal typically requires hitting *all* maximal cliques. +- In the main conjecture, this is not an issue because for large n and c > 0, the hypothesis forces all maximal cliques to have ≥ ⌈cn⌉ ≥ 2 vertices, so no singletons exist. +- In the `known_bound` variant with k = 1, the 2-vertex filter means isolated vertices needn't be covered, potentially yielding a smaller τ(G) than the standard definition. This makes the upper bound easier to satisfy and is a slight weakening. +- This is a defensible modeling choice (since covering isolated vertices is trivial and uninteresting), but it should be documented. + +### 6.5 Summary Table + +| Statement | Correctness | Notes | +|-----------|------------|-------| +| `erdos_611` (main) | ✅ Correct | Faithful ε-N rendering of o(n) | +| `variants.known_bound` | ✅ Correct | Matches website | +| `variants.bollobas_erdos` | ⚠️ Weakened | `Nat.sqrt` vs. real √n; valid but weaker | +| Missing: k_c(n) question | ❌ Not captured | Second question from website | +| Missing: k_c(n) lower bound | ❌ Not captured | Known result from [EGT92] | diff --git a/ai-review/612.md b/ai-review/612.md new file mode 100644 index 0000000000..a8a9d40775 --- /dev/null +++ b/ai-review/612.md @@ -0,0 +1,119 @@ +# AI Review: Erdős Problem 612 + +## 1. Code Reuse + +The codebase has several relevant modules in `FormalConjecturesForMathlib/`: + +- **`DiamExtra.lean`**: Defines `SimpleGraph.diam`, `SimpleGraph.ediam`, `SimpleGraph.eccent`, `SimpleGraph.radius`, and `SimpleGraph.center`. The formalization already uses `G.diam` from this file. Notable: `diam_ne_zero` and `dist_le_diam_of_mem_path` are still `proof_wanted`, so any proof attempt would need these filled in first. +- **`Clique.lean`**: Defines `SimpleGraph.indepNum` (independence number). Not directly used but could be relevant for connecting clique-freeness to structural properties. +- **`Coloring.lean`**: Defines `SimpleGraph.chromaticNumber` and includes `le_chromaticNumber_of_pairwise_adj` (clique size ≤ chromatic number) and `card_div_indepNum_le_chromaticNumber`. These would be essential for formalizing the known colorability-based results (3-colorable, 4-colorable cases) if those were added as variants. + +The existing `G.CliqueFree` and `G.minDegree` come from Mathlib and are used appropriately. No redundant definitions are introduced. + +## 2. Citations + +The docstring references four papers: + +| Tag | Docstring | Website | +|-----|-----------|---------| +| [EPPT89] | Erdős, Pach, Pollack, Tuza, *Radius, diameter, and minimum degree*, J. Combin. Theory Ser. B 47 (1989), 73–79 | Matches: source listed as Erdős, Pach, Pollack, and Tuza [EPPT89] | +| [CSS21] | Czabarka, Singgih, Székely, *Counterexample to a conjecture of Erdős, Pach, Pollack, and Tuza on diameter and minimum degree*, 2021 | Matches | +| [CDS09] | Czabarka, Dankelmann, Székely, *Diameter and degree conditions for $K_{t,t}$-free graphs*, 2009 | Matches | +| [CSS23] | Czabarka, Smith, Székely, *Diameter bounds for 4-colourable graphs*, 2023 | Matches | + +**Issue**: The website also references a 2025 result by Cambie and Jooken providing constructions for K₄-free graphs with minimum degree 16 achieving diameter ≥ (31/216)n + O(1). This is not mentioned in the docstring. While it does not contradict the amended conjecture (since 31/216 ≈ 0.1435 < 7/48 ≈ 0.1458 = (3 − 2/3)/16), it is a notable recent development showing the bound is nearly tight for k = 3. Consider adding a note about this. + +## 3. Variants + +**Formalized:** +1. `erdos_612` — The amended conjecture for general k ≥ 2 (open) +2. `erdos_612.variants.triangle_free` — The k = 2 case (solved, [EPPT89]) +3. `erdos_612.variants.general_bound` — The 3n/(d+1) bound without clique-freeness (solved, [EPPT89]) + +**Not formalized but mentioned in docstring:** +- The 3-colorable case ([CDS09]) — proved for χ(G) ≤ 3 (weaker than K₄-free) +- The 4-colorable case ([CSS23]) — proved for χ(G) ≤ 4 (weaker than K₅-free) + +**Not mentioned or formalized:** +- The disproved original conjecture (appropriate to omit as a theorem, but it could be formalized as a *false* statement for pedagogical completeness) +- The Cambie–Jooken 2025 lower bound construction + +**Recommendation**: The 3-colorable and 4-colorable cases are natural intermediate variants and would be straightforward to formalize using `G.Colorable 3` / `G.Colorable 4` from Mathlib. These are known results and could be tagged `category research solved`. Adding them would make the formalization more complete relative to the known landscape described in the docstring. For example: + +```lean +theorem erdos_612.variants.three_colorable : + ∃ C : ℝ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + G.Connected → + G.Colorable 3 → + G.minDegree ≥ 1 → + (G.diam : ℝ) ≤ (7 / 3 : ℝ) * ((n : ℝ) / (G.minDegree : ℝ)) + C := by + sorry +``` + +## 4. Readability + +The code is well-structured and readable: + +- The module docstring clearly explains the history: original conjecture → counterexample → amended conjecture → known cases. +- Citation tags are consistently used and cross-referenced between docstrings and the bibliography. +- The namespace `Erdos612` is clean and the variant naming convention (`erdos_612.variants.triangle_free`, `erdos_612.variants.general_bound`) is descriptive. +- The `O(1)` convention of using `∃ C : ℝ` with C quantified before the graph is correctly and consistently applied across all three theorems. + +**Minor suggestion**: The `triangle_free` variant's docstring says "absolute constant C" which is mathematically precise. The main theorem says "constant C depending only on k" — also precise since C is quantified after k but before n and G. Good. + +No readability issues identified. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The key mathematical content is: +- "Connected graph with n vertices" → `G.Connected` on `SimpleGraph (Fin n)` — precise +- "Minimum degree d" → `G.minDegree` — precise +- "Diameter D" → `G.diam` — precise +- "Contains no K_{k+1}" → `G.CliqueFree (k + 1)` — precise +- "D ≤ (3 − 2/k) · n/d + O(1)" → `∃ C, ... (G.diam : ℝ) ≤ (3 - 2/(k:ℝ)) * (n:ℝ)/(G.minDegree:ℝ) + C` — precise + +The only source of ambiguity in the original problem is the O(1) notation, which could mean: +1. A universal constant (independent of everything) +2. A constant depending on k but not on n or d + +The formalization correctly chooses interpretation (2) for the main theorem and interpretation (1) for the triangle-free and general-bound variants, matching the mathematical intent. + +The problem statement on the website is precise enough that no reasonable alternative formalization exists. + +## 6. Correctness + +**Mathematical correctness: Sound with minor observations.** + +**Correct aspects:** +- The amended conjecture `D ≤ (3 − 2/k) · n/d + C` is correctly attributed to [CSS21] and correctly formalized. +- The quantifier order `∀ k, ∃ C, ∀ n G, ...` correctly captures that C may depend on k. +- `k ≥ 2` is the right lower bound: k = 1 means K₂-free (edgeless), incompatible with connectedness for n ≥ 2. k = 2 is the triangle-free case. +- The `triangle_free` variant correctly specializes to `CliqueFree 3` with coefficient 2 = 3 − 2/2. +- The general bound correctly uses `3 * (n / (minDegree + 1))` rather than `3 * (n / minDegree)`, matching the literature's 3n/(d+1). +- The `minDegree ≥ 1` hypothesis is needed to make n/d well-defined and is implied by connectedness for n ≥ 2 anyway. + +**Observation on vacuous truth for n ≤ 1:** +- For `Fin 0`, the graph has no vertices, cannot be connected (no vertices to connect), so the statement is vacuously true. +- For `Fin 1`, the graph is connected (trivially), has `minDegree = 0`, so `minDegree ≥ 1` fails, making the statement vacuously true. +- This is all fine — no mathematical issue here. + +**Observation on `diam` for connected graphs:** +- Mathlib's `SimpleGraph.diam` (via `DiamExtra.lean`) is ℕ-valued. For connected finite graphs, this is the standard graph diameter. The cast `(G.diam : ℝ)` is correct. + +**Potential subtlety — division in the real-valued bound:** +- The expression `(n : ℝ) / (G.minDegree : ℝ)` performs real division. When `G.minDegree ≥ 1`, the denominator is ≥ 1, so no division-by-zero issue arises. Correct. + +**Overall assessment: The formalization is mathematically correct and faithfully represents the amended conjecture and known results. No flaws identified.** + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Good | Uses Mathlib and project infrastructure appropriately | +| Citations | Good, minor gap | Missing 2025 Cambie–Jooken reference from website | +| Variants | Adequate | Missing 3-colorable and 4-colorable solved cases | +| Readability | Excellent | Clear structure, good docstrings, consistent notation | +| Formalizability | High | Unambiguous mathematical content, clean translation | +| Correctness | Correct | No mathematical errors; quantifier structure and edge cases handled properly | diff --git a/ai-review/613.md b/ai-review/613.md new file mode 100644 index 0000000000..35036f3e8f --- /dev/null +++ b/ai-review/613.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 613 + +## 1. Code Reuse + +The formalization uses standard Mathlib constructs (`SimpleGraph`, `Colorable`, `maxDegree`, `edgeFinset`, `Nat.choose`) and does not define any custom utilities. This is appropriate given the problem's self-contained nature. + +Several existing files in the codebase use overlapping concepts: + +- **`SizeRamsey.lean`** (`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`): Defines `sizeRamsey` and the size Ramsey number. Problem 613 is fundamentally about a size Ramsey number (specifically r̂(K₁,ₙ, 𝓕) where 𝓕 is the family of odd cycles). The formalization could potentially be restated using `sizeRamsey` for a more canonical encoding, though the direct combinatorial statement as written is also valid and arguably more readable. +- **Problem 553** (`ErdosProblems/553.lean`): Uses `⊔` for graph union in a similar Ramsey-theoretic context. +- **Problem 744** (`ErdosProblems/744.lean`): Uses `Colorable 2` with `Nat.choose` in edge count bounds. +- **Problem 934** (`ErdosProblems/934.lean`): Uses `maxDegree` comparison patterns similar to `G₂.maxDegree < n`. + +No significant code duplication or missed reuse opportunities. + +## 2. Citations + +**Website (erdosproblems.com/613) lists:** +- Original sources: [Er81e], [Er91], [Er93, p.345], [Er99] +- Faudree's unpublished result (conjecture holds for graphs on exactly 2n+1 vertices) +- Pikhurko's disproof with bounds: n² + 0.577n^(3/2) < r̂(K₁,ₙ, 𝓕) < n² + √2·n^(3/2) + n + +**Formalization cites:** +- [Pi01] Pikhurko, O., _Size Ramsey numbers of stars versus 3-chromatic graphs_, Combinatorica 21 (2001), 403–412. + +**Issues:** +- The original Erdős sources ([Er81e], [Er91], [Er93], [Er99]) are not cited. At minimum, the primary source should be referenced. +- Faudree's result is not mentioned. +- The citation format is otherwise good and the Pikhurko reference is correct and complete. + +## 3. Variants + +**Captured:** +- `erdos_613`: The original (false) conjecture, encoded as `answer(False) ↔ ∀ ...`. +- `erdos_613.variants.disproof`: The existential negation (Pikhurko's result). + +**Missing:** +- **Faudree's positive result**: The conjecture holds when G has exactly 2n+1 vertices (i.e., the restricted case `m = 2 * n + 1`). This is mentioned on the website and would be a natural variant. +- **Pikhurko's quantitative bounds**: The website gives explicit asymptotic bounds on the size Ramsey number r̂(K₁,ₙ, 𝓕). These could be formalized as additional variants. +- **Size Ramsey number formulation**: The problem can be stated as r̂(K₁,ₙ, 𝓕) = C(2n+1, 2) − C(n, 2), which connects to the `sizeRamsey` definition in the codebase. + +## 4. Readability + +The formalization is clear and well-structured. + +**Strengths:** +- Good docstrings explaining both the conjecture and its disproof. +- Clean separation of the original conjecture and the disproof variant. +- The `answer(False)` encoding clearly signals the problem is disproved. + +**Suggestions:** +- The module docstring could briefly explain the Ramsey-theoretic motivation (that this concerns the size Ramsey number of stars vs. odd cycles), which would help readers understand *why* this edge count and decomposition appear. +- The edge count formula `Nat.choose (2 * n + 1) 2 - Nat.choose n 2 - 1` is correct but could benefit from a brief inline comment noting its value (e.g., `-- = 3n(n+1)/2 - 1`). + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: it specifies an exact edge count, a graph decomposition into two components with explicit properties (bipartite and bounded max degree), and asks a yes/no question. All concepts have standard Mathlib definitions. + +The only minor source of ambiguity is the meaning of "union" — it could mean edge-disjoint decomposition or set-theoretic union (allowing shared edges). The formalization uses `⊔` (lattice supremum, i.e., set-theoretic union of adjacencies), which is the standard graph-theoretic interpretation and is strictly more permissive than disjoint union. Since the conjecture is *disproved*, using the weaker (more permissive) interpretation makes the disproof *stronger* — if even the union-based decomposition fails, the disjoint version certainly fails too. This is the correct choice. + +## 6. Correctness + +**Overall: Correct and mathematically sound.** + +**Detailed analysis:** + +- **`answer(False)` encoding**: `answer(False) ↔ P` elaborates to `False ↔ P`, which is equivalent to `¬P`. This correctly encodes that the conjecture is false. + +- **Edge count**: `Nat.choose (2 * n + 1) 2 - Nat.choose n 2 - 1` correctly computes C(2n+1, 2) − C(n, 2) − 1. Since C(2n+1, 2) = n(2n+1) ≥ 21 and C(n, 2) ≤ C(n, 2) for n ≥ 3, natural number subtraction does not underflow. ✓ + +- **Vertex type**: Using `∀ (m : ℕ) (G : SimpleGraph (Fin m))` correctly quantifies over all finite simple graphs. Any finite graph can be represented on `Fin m` for sufficiently large `m`. ✓ + +- **Bipartiteness**: `G₁.Colorable 2` is the standard Mathlib encoding of bipartiteness (existence of a proper 2-coloring). ✓ + +- **Maximum degree**: `G₂.maxDegree < n` correctly captures "maximum degree less than n." For `Fin m` (a `Fintype`), `maxDegree` is well-defined. ✓ + +- **Graph union**: `G₁ ⊔ G₂ = G` means `∀ u v, G.Adj u v ↔ G₁.Adj u v ∨ G₂.Adj u v`, correctly encoding that G is the union of G₁ and G₂. Importantly, this also implies G₁ ≤ G and G₂ ≤ G (all edges of G₁ and G₂ are edges of G). ✓ + +- **Disproof variant**: The existential `∃ n ≥ 3, ∃ m G, edge_count ∧ ¬∃ decomposition` is exactly the (classical) negation of the universal conjecture. The two theorems are logically equivalent under classical logic (which is opened). ✓ + +- **Potential concern — `DecidableRel` instance**: `edgeFinset` and `maxDegree` require `DecidableRel G.Adj`. This is provided by `open scoped Classical`, which supplies decidability for all propositions. This is standard practice. ✓ + +**No mathematical errors identified.** The formalization is a faithful encoding of the problem as stated on erdosproblems.com. diff --git a/ai-review/614.md b/ai-review/614.md new file mode 100644 index 0000000000..bf3e9bab69 --- /dev/null +++ b/ai-review/614.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 614 + +## 1. Code Reuse + +**Opportunity identified.** The definition `HasInducedDegreeProp` (line 43) computes degree in an induced subgraph via: + +```lean +k ≤ (S.filter (G.Adj v)).card +``` + +This is exactly the `inducedDegree` function already defined in `FormalConjectures/ErdosProblems/637.lean:51-53`: + +```lean +noncomputable def inducedDegree {n : ℕ} (G : SimpleGraph (Fin n)) + (S : Finset (Fin n)) (v : Fin n) : ℕ := + (S.filter fun w => G.Adj v w).card +``` + +The same `S.filter (G.Adj v)` pattern also appears in Erdős problems 814, 1031, and 88. Ideally `inducedDegree` would be extracted to a shared utility (e.g., in `FormalConjectures/Util/`) and reused across all these problems. At minimum, 614 could import or reference 637's definition. + +Additionally, Mathlib provides `SimpleGraph.Subgraph.induce` and `SimpleGraph.Subgraph.degree` which could express this property more idiomatically, though the current `Finset.filter`-based approach is consistent with the rest of the codebase. + +## 2. Citations + +The formalization references: + +> [FRS97] Faudree, R., Rousseau, C., and Schelp, R., *Problems in graph theory from Memphis*. The Mathematics of Paul Erdős, II (1997). + +The website (erdosproblems.com/614) attributes the problem to "a problem of Erdős, Faudree, Rousseau, and Schelp" and cites [FRS97]. The docstring lists only three authors (Faudree, Rousseau, Schelp) for the reference, which is correct — the [FRS97] paper is by those three authors, while Erdős is the problem poser. The attribution in line 28 ("A problem of Erdős, Faudree, Rousseau, and Schelp.") correctly includes all four names. + +**No citation issues found.** The reference matches the website. + +## 3. Variants + +The website lists no additional variants, partial results, or related conjectures for this problem. The formalization captures the single stated problem: determine \( f(n,k) \). + +**No missing variants.** + +## 4. Readability + +The code is well-structured and readable: + +- The `HasInducedDegreeProp` definition is clearly documented with a docstring explaining the mathematical meaning. +- The `erdos614_f` function is documented and its connection to the problem is explicit. +- The main theorem statement is clean. + +**Minor suggestions:** + +- The `HasInducedDegreeProp` definition on line 43 uses `(S.filter (G.Adj v)).card`. Note that `v` is quantified as `v ∈ S`, but the filter `S.filter (G.Adj v)` counts *all* vertices in `S` adjacent to `v`, including potentially `v` itself — however, since `SimpleGraph.Adj` is irreflexive (`G.Adj v v` is always `False`), this correctly excludes `v`. This is mathematically correct but a brief comment noting this could aid readers unfamiliar with `SimpleGraph`. +- The definition could be slightly more readable by using the `inducedDegree` helper from 637 (if shared), making the intent `k ≤ inducedDegree G S v` immediately transparent. + +## 5. Formalizability + +The problem statement is: "Let \( f(n,k) \) be minimal such that there is a graph with \( n \) vertices and \( f(n,k) \) edges where every set of \( k+2 \) vertices induces a subgraph with maximum degree at least \( k \). Determine \( f(n,k) \)." + +**Assessment: Moderately ambiguous as a formalization target.** + +The phrase "determine \( f(n,k) \)" is inherently open-ended — it asks for a closed-form expression or asymptotic characterization, but doesn't specify which. The formalization handles this by using `answer(sorry)`, which is the standard placeholder for an unknown answer in this codebase. + +The definition of \( f(n,k) \) itself is precise and unambiguous: it is the minimum number of edges in a graph on \( n \) vertices satisfying the induced degree property. The formalization correctly captures this via `sInf`. + +One subtle point: the formalization restricts to `n ≥ k + 2` in the theorem statement (line 59), which is necessary for the problem to be non-vacuous (there must exist subsets of size `k + 2`). This is a good modeling choice. + +**Potential concern with `sInf`:** If no graph on `n` vertices satisfies the property, `sInf ∅ = 0` for `ℕ`. However, the complete graph `K_n` always satisfies the property (every subset of `k+2` vertices has maximum degree `k+1 ≥ k` when `n ≥ k+2`), so the set is non-empty for `n ≥ k + 2`. This is mathematically sound, though it might be worth stating as a lemma for completeness. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +1. **`HasInducedDegreeProp` (lines 41–43):** For every subset `S` of `Fin n` with `|S| = k + 2`, there exists a vertex `v ∈ S` such that `v` is adjacent (in `G`) to at least `k` vertices in `S`. This is equivalent to saying the induced subgraph `G[S]` has maximum degree ≥ `k`. ✓ + +2. **`erdos614_f` (lines 48–50):** Defined as `sInf` of the set of edge counts of graphs satisfying the property. This correctly captures the *minimum* number of edges. ✓ + +3. **Main theorem (lines 59–61):** States that for all `n ≥ k + 2`, `erdos614_f n k` equals some answer to be determined. This is the right shape for an open "determine" problem. ✓ + +4. **Edge case analysis:** When `k = 0`, the property requires every pair of vertices (`k + 2 = 2`) to have a vertex adjacent to at least 0 others in the pair — this is vacuously true (0 ≤ anything), so `f(n, 0) = 0`. This is correctly handled. When `k = 1`, every triple must contain a vertex with at least 1 neighbor in the triple, i.e., at least one edge in every triple. This is the condition for the complement having no triangle, which is also correctly captured. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the problem as stated on erdosproblems.com. diff --git a/ai-review/615.md b/ai-review/615.md new file mode 100644 index 0000000000..02d244bb16 --- /dev/null +++ b/ai-review/615.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 615 + +## 1. Code Reuse + +**Issue: Custom `IsIndependentSet` duplicates Mathlib's `SimpleGraph.IsIndepSet`.** + +The file defines its own `IsIndependentSet` on `Finset V`: +```lean +def IsIndependentSet {V : Type*} (G : SimpleGraph V) (S : Finset V) : Prop := + ∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v +``` + +Mathlib already provides `SimpleGraph.IsIndepSet` (on `Set V`), which is used in Problem 22's formalization via `G.IsIndepSet ↑s`. The two are mathematically equivalent (`Set.Pairwise s (fun u v => ¬G.Adj u v)` vs the explicit double quantification). Replacing the custom definition with Mathlib's would improve consistency with the rest of the codebase. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` defines `indepNum` with notation `α(G)`, which could be used in the `ramseyTuranNumber` definition instead of the explicit independence-set-size condition. + +**Issue: Inconsistent edge-counting API.** + +Problem 615 uses `G.edgeFinset.card` while the closely related Problem 22 uses `G.edgeSet.ncard`. Both work for `Fin n`, but consistency across related problems would be preferable. + +**Note:** The `ramseyTuranNumber` definition is declared but never used in any theorem statement. It serves only as documentation. This is acceptable but could be noted. + +## 2. Citations + +**Issue: Missing reference [Er91].** + +The website lists **[Er91]** (Erdős, 1991) as a reference, but the formalization's docstring does not mention it. + +**Issue: References lack full bibliographic details.** + +The website does not provide full citation details (titles, journals, page numbers) for most references, so the formalization's abbreviated references are acceptable. However, Problem 22 demonstrates a better citation style with italicized titles and journal names: + +``` +[FLZ15] Fox, J., Loh, P.-S., and Zhao, Y., _The critical window for the classical +Ramsey–Turán problem_, Combinatorica, 2015. +``` + +The references in Problem 615 give only author lists and years, without titles or journals. Adopting the Problem 22 style would improve documentation: +- [EHSSS93] → should include title if known +- [EHSS83] → should include title if known +- [Su03] → should include title if known +- [FLZ15] → can borrow the full citation from Problem 22 + +## 3. Variants + +**Included:** The EHSS theorem (`erdos_615.variants.EHSS`) correctly formalizes the Erdős–Hajnal–Sós–Szemerédi result that rt(n; 4, εn) < (1/8 + o(1))n² for fixed ε > 0. + +**Missing:** Sudakov's result [Su03] is mentioned in the docstring but not formalized as a variant. The result states that rt(n; 4, n·e^{−f(n)}) = o(n²) whenever f(n)/√(log n) → ∞. This is a natural intermediate result between EHSS and the Fox–Loh–Zhao disproof and would be a valuable variant to include. + +**Missing:** The Fox–Loh–Zhao lower bound [FLZ15] — that rt(n; 4, n·e^{−f(n)}) ≥ (1/8 − o(1))n² whenever f(n) = o(√(log n / log log n)) — is the key result disproving the conjecture. While it is described in the docstring, it is not formalized as a separate variant theorem. Since the main theorem `erdos_615` only captures the negation of the original question, an explicit formalization of the FLZ lower bound would be mathematically richer. + +**Cross-reference:** The website notes "See also Problem #22," which is the Bollobás–Erdős conjecture on rt(n; 4, εn) ≥ n²/8, also proved by Fox–Loh–Zhao. Problem 22 is formalized separately, which is appropriate, but a cross-reference in the docstring would be helpful. + +## 4. Readability + +- **Good:** The module docstring is thorough, explaining the problem, its equivalent Ramsey–Turán formulation, the history, and the resolution. +- **Good:** The `ramseyTuranNumber` definition, while unused, aids understanding. +- **Minor:** Using Mathlib's `IsIndepSet` instead of a custom `IsIndependentSet` would make the code more idiomatic and recognizable to Lean/Mathlib users. +- **Minor:** The EHSS variant uses the dotted namespace `erdos_615.variants.EHSS`, which is a clean organizational pattern. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem is stated precisely in terms of well-defined combinatorial quantities: +- Graph on n vertices with a specified edge threshold +- Existence of K₄ (4-clique) +- Existence of an independent set of size ≥ n/log n +- Quantification over a constant c > 0 + +The only potential source of ambiguity is the base of the logarithm. The formalization uses `Real.log`, which is the natural logarithm. The original problem statement uses "log n" without specifying the base, but in combinatorics this conventionally means the natural logarithm (or is irrelevant since changing the base only affects the constant). The formalization's choice is standard and correct. + +The EHSS variant's "o(1)" is cleanly formalized as ∀ δ > 0, ∃ N₀, ... ≤ (1/8 + δ)n², which is the standard ε-δ encoding of asymptotic bounds. + +## 6. Correctness + +**Main theorem (`erdos_615`): Correct.** + +The statement `answer(False) ↔ ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G, edges ≥ (1/8 − c)n² → (has K₄) ∨ (has large indep set)` correctly encodes the problem. Since `answer(False)` resolves to `False`, the biconditional asserts the negation of the existential — i.e., no such constant c exists. This matches the disproof by Fox, Loh, and Zhao. + +**EHSS variant (`erdos_615.variants.EHSS`): Correct.** + +The formalization states: for any ε > 0 and δ > 0, for sufficiently large n, any K₄-free graph on n vertices with independence number < εn has ≤ (1/8 + δ)n² edges. This correctly captures rt(n; 4, εn) < (1/8 + o(1))n². The use of ≤ rather than < for the edge bound is inconsequential for the asymptotic statement. + +**One subtle point:** In the main theorem, `¬G.CliqueFree 4` means "G contains a 4-clique" (i.e., G is not K₄-free). This is the correct encoding of "G contains a K₄." + +**`ramseyTuranNumber` definition: Mathematically sound but with edge cases.** + +The definition uses `sSup` on ℕ. For the empty set, `sSup ∅ = 0` in ℕ, which aligns with the docstring's "Returns 0 if no such graph exists." The set is always bounded above (by n(n−1)/2 for graphs on Fin n), so `sSup` is well-behaved for the intended use cases. However, for degenerate parameters (e.g., ℓ = 0, where no graph can have independence number < 0 on a nonempty vertex set), the behavior could be surprising. This is a minor concern since the definition is not used in any theorem. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | Custom `IsIndependentSet` should use Mathlib's `IsIndepSet`; inconsistent edge-counting API vs Problem 22 | +| Citations | Needs improvement | Missing [Er91]; references lack titles/journals compared to Problem 22's style | +| Variants | Partial | EHSS included; Sudakov [Su03] and FLZ lower bound not formalized; no cross-ref to Problem 22 | +| Readability | Good | Clear docstring and organization; minor improvements possible with Mathlib idioms | +| Formalizability | Excellent | Precise statement, minimal ambiguity | +| Correctness | Correct | Both theorem statements accurately capture the intended mathematics | diff --git a/ai-review/616.md b/ai-review/616.md new file mode 100644 index 0000000000..27eb7738b0 --- /dev/null +++ b/ai-review/616.md @@ -0,0 +1,90 @@ +# AI Review — Erdős Problem 616 + +## 1. Code Reuse + +The file defines its own `UniformHypergraph`, `IsTransversal`, `coveringNumber`, `inducedSub`, and `HasLocalCoveringProperty` from scratch within a local namespace `Erdos616`. Several other problem files define closely related structures: + +- **`ErdosProblems/834.lean`** defines a general `Hypergraph (V : Type*)` with `IsUniform`, `IsTransversal`, `degree`, `vertices`, `eraseEdge`, and `eraseVertex`. This is the most general and reusable hypergraph structure in the codebase. +- **`ErdosProblems/833.lean`**, **`836.lean`** define similar `Hypergraph` structures with uniformity predicates. +- **`ErdosProblems/1024.lean`**, **`1076.lean`**, **`716.lean`** define `Fin n`-based hypergraph structures similar to 616.lean's approach. + +There is no shared hypergraph library in `FormalConjectures/Util/` or `FormalConjecturesForMathlib/`. Each problem file rolls its own definitions. While 834.lean's `Hypergraph` structure is more general (type-polymorphic rather than `Fin n`-indexed), the current approach of local definitions within namespaces is the established pattern in this codebase. No immediate refactoring is needed, but a shared hypergraph module could reduce duplication across ~10 files. + +**Verdict:** No reuse opportunity that would improve this file without a broader codebase refactor. The current self-contained approach is consistent with project conventions. + +## 2. Citations + +The website ([erdosproblems.com/616](https://www.erdosproblems.com/616)) lists: + +- **[EHT91]** — The formalization references: `Erdős, P., Hajnal, A., and Tuza, Zs., _Local constraints ensuring small representing sets_. J. Combin. Theory Ser. A 58 (1991), 78-84.` This matches the website's source for the bounds. +- **[Er99]** — The website also cites this as the original source for Problem #616. **This citation is missing from the formalization's docstring.** + +**Issue:** The `[Er99]` citation should be added for completeness, as the website attributes the problem statement to it. The full reference would be something like: `Erdős, P. (1999)` — the website does not provide the full bibliographic entry but it is listed as a reference. + +## 3. Variants + +The problem asks to "determine the best constant $t$" satisfying the given property. The formalization captures: + +1. **Upper bound** (`erdos_616`): $\tau(G) \leq \frac{1}{5}r$ — ✅ Present +2. **Lower bound** (`erdos_616.variants.lower_bound`): $\tau(G) \geq \frac{3}{16}r + \frac{7}{8}$ — ✅ Present + +These are the bounds from [EHT91] as stated on the website: $\frac{3}{16}r + \frac{7}{8} \leq t \leq \frac{1}{5}r$. + +The problem fundamentally asks to determine the *exact* best constant $t$, which is still open (the gap between $3/16$ and $1/5$ has not been closed). Neither theorem individually resolves the problem — they bracket $t$. The formalization captures both sides of the known bounds, which is appropriate. However, there is no statement expressing the open question of determining the exact value of $t$, though this would be difficult to formalize without knowing the answer. + +**Verdict:** All known concrete variants are captured. + +## 4. Readability + +The code is well-structured and readable: + +- Clear docstrings on every definition and theorem. +- Logical ordering: structure → transversal → covering number → induced subhypergraph → local property → theorems. +- Namespace `Erdos616` prevents name collisions. +- The variant naming convention `erdos_616.variants.lower_bound` is clear. + +**Minor suggestions:** +- The `coveringNumber` definition uses `sInf` over `{k : ℕ | ∃ S, S.card = k ∧ IsTransversal G S}`. This is mathematically clean but note that `sInf ∅ = 0` for `ℕ`, so if a hypergraph has no transversal (impossible for finite hypergraphs on `Fin n`, but worth noting), the covering number would silently be 0. This is fine in practice since `Fin n` is finite and the empty set is trivially a transversal of a hypergraph with no edges. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem statement is precise enough to formalize: + +- "r-uniform hypergraph" — well-defined ✅ +- "covering number / transversal number τ(G)" — well-defined ✅ +- "every subgraph on at most 3r−3 vertices has τ(G') ≤ 1" — well-defined ✅ +- The bounds $\frac{1}{5}r$ and $\frac{3}{16}r + \frac{7}{8}$ are explicit numerical claims ✅ + +The one subtle point is the meaning of "subgraph on at most $3r-3$ vertices." This could mean: +- **(a)** The induced subhypergraph on a vertex set $W$ with $|W| \leq 3r-3$ (edges of $G$ contained in $W$) — this is what the formalization implements. +- **(b)** Any subhypergraph whose vertex set has size $\leq 3r-3$. + +Interpretation (a) is the standard one in the literature (and the one used in [EHT91]), so the formalization is correct. + +**Ambiguity level:** Low. The statement is precise. + +## 6. Correctness + +### Problem status discrepancy +The website marks Problem 616 as **OPEN**. The formalization tags both theorems as `category research solved`. This is a significant discrepancy. The *bounds* were proved in [EHT91], but the problem of determining the *exact best constant* $t$ remains open. The individual bound statements are proven results, so tagging them as `solved` is defensible if interpreted as "these specific bounds are established results," but it could be misleading since the overarching problem is still open. + +**Recommendation:** Consider whether the tags should reflect the status of the specific statements (which are solved) or the overall problem (which is open). A comment clarifying this would help. + +### Mathematical correctness of the upper bound +The upper bound theorem states: for all $r \geq 3$, for all $r$-uniform hypergraphs $G$ with the local covering property, $\tau(G) \leq \frac{1}{5}r$. This matches the result of [EHT91]. ✅ + +### Mathematical correctness of the lower bound +The lower bound states: for all $r \geq 3$, there exists a hypergraph $G$ with the local covering property and $\tau(G) \geq \frac{3}{16}r + \frac{7}{8}$. This matches [EHT91]. ✅ + +### Subtlety with natural number arithmetic +The `HasLocalCoveringProperty` uses `3 * r - 3` where `r : ℕ`. Since $r \geq 3$ in the theorem statements, `3 * r - 3 ≥ 6 > 0`, so natural number subtraction does not underflow. However, the *definition* itself does not require $r \geq 3$. For $r = 0$, `3 * 0 - 3 = 0` in `ℕ`, so the condition would require all subsets of size $\leq 0$ (i.e., the empty set) to have covering number $\leq 1$, which is vacuously strong but not problematic since it's only invoked with the $r \geq 3$ precondition. This is fine. ✅ + +### Structural issue with `UniformHypergraph` +The structure fixes the vertex set to `Fin n` for a specific `n`. This means the lower bound existentially quantifies over `n` (the number of vertices), which is correct — one must exhibit a concrete hypergraph. The upper bound universally quantifies over `n`, which is also correct. ✅ + +### The `coveringNumber` edge case +For a hypergraph with no edges, every set (including ∅) is a transversal, so the infimum set contains 0, and `coveringNumber = 0`. This is the standard convention. ✅ + +**Verdict:** The formalization is mathematically correct. The only concern is the `solved` tag vs. the problem being open on the website, but this is a metadata/tagging issue rather than a mathematical one. diff --git a/ai-review/618.md b/ai-review/618.md new file mode 100644 index 0000000000..6d15404dd9 --- /dev/null +++ b/ai-review/618.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 618 + +## 1. Code Reuse + +**Significant overlap with Problem 619 and Problem 134.** + +- **Problem 619** (`619.lean`) defines `triangleFreeDiamCompletion r G` — a strictly more general version of `triangleFreeDiam2Completion` from 618, parameterized by the target diameter `r`. The definition in 618 is literally `triangleFreeDiamCompletion 2 G`. These two problems should share a single definition; 618's `triangleFreeDiam2Completion` could be replaced by `Erdos619.triangleFreeDiamCompletion 2` (or the shared definition could be factored into a common utility file). + +- **Problem 134** (`134.lean`) formalizes the same mathematical content — it is the same conjecture with a slightly different formalization style. Problem 134 uses `HasDiameterAtMostTwo` (a custom predicate) and counts added edges as `H.edgeFinset.card - G.edgeFinset.card`, whereas 618 uses `H.diam ≤ 2` and `(H.edgeFinset \ G.edgeFinset).card`. The website itself notes that Alon observed Problem 618 is "essentially equivalent" to Problem 134. Having both formalizations is defensible (they originate from different entries on erdosproblems.com), but the docstring for 618 should cross-reference Problem 134 explicitly. + +- **DiamExtra utilities** in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean` provide diameter lemmas that could be useful but are not imported. + +## 2. Citations + +The docstring references: +- `[EGR98]` — shorthand only; no full citation is given in 618.lean. + +The website (erdosproblems.com/618) lists: +- **[EGR98]**: Erdős, Gyárfás, and Ruszinkó (the original problem source). The full citation should be: Erdős, P., Gyárfás, A. and Ruszinkó, M., *How to decrease the diameter of triangle-free graphs*, Combinatorica **18** (1998), 493–501. (This full citation already appears in the module docstring of 619.lean but is missing from 618.lean.) +- **[Er99]**: Referenced on the website but not mentioned in the formalization at all. +- **Alon's proof**: The website links to Alon's note at `web.math.princeton.edu/~nalon/PDFS/remark1901.pdf`. The formalization says "Proved by Alon" but gives no specific reference. The proper reference may be the note linked on the website, or possibly [Al94] as cited in Problem 134. +- **Related problems**: The website mentions Problem 619 as related. This is not cross-referenced in 618.lean. + +**Recommendation:** Add the full [EGR98] citation (as in 619.lean), add the [Er99] reference, provide Alon's specific publication, and cross-reference Problems 134 and 619. + +## 3. Variants + +The website describes one main statement, plus contextual results: +- Simonovits showed that graphs with maximum degree $\gg n^{1/2}$ can have $h_2(G) \gg n^2$ (mentioned in docstring but not formalized as a variant). +- [EGR98] proved that graphs with no isolated vertices and constant maximum degree satisfy $h_2(G) \ll n \log n$ (not mentioned or formalized). +- The equivalence with Problem 134 means Alon's strong form ($O(n^{2-\varepsilon})$ edges suffice when max degree $< n^{1/2-\varepsilon}$) is a relevant strengthening — this is formalized in 134.lean but not as a variant of 618. + +**Assessment:** The main conjecture is captured. The Simonovits lower bound and the [EGR98] result for constant-degree graphs are natural companion results that could be added as variants, though their omission is not a major gap since they are contextual rather than part of the core conjecture. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The definition `triangleFreeDiam2Completion` has a clear docstring explaining its semantics. +- The theorem statement includes a helpful English reformulation in the docstring ("Formulated as: for every ε > 0..."). +- **Improvement opportunity:** The cast `(triangleFreeDiam2Completion G : ℝ)` and `(n : ℝ) ^ ((1 : ℝ) / 2)` are standard Lean idioms but somewhat noisy. The `(1 : ℝ) / 2` could be written as `(1/2 : ℝ)` for slightly better readability, though this is minor. +- The quantifier structure `∀ ε : ℝ, ε > 0 → ∃ δ : ℝ, δ > 0 ∧ ∃ N₀ : ℕ, ...` faithfully captures the little-o formulation. This is a reasonable epsilon-delta encoding. + +## 5. Formalizability + +**Assessment: Clearly formalizable, with one subtle point.** + +The original problem uses asymptotic notation: "if $G$ has maximum degree $o(n^{1/2})$ then $h_2(G) = o(n^2)$." This is a statement about sequences of graphs (or more precisely, a uniform statement across all graphs on $n$ vertices for large $n$). The formalization correctly unpacks the $o(\cdot)$ notation into an explicit $\varepsilon$-$\delta$ form: + +> For every $\varepsilon > 0$, there exist $\delta > 0$ and $N_0$ such that for all $n \geq N_0$, every triangle-free graph on $n$ vertices with max degree $\leq \delta n^{1/2}$ satisfies $h_2(G) \leq \varepsilon n^2$. + +This is a standard and correct way to formalize such asymptotic statements. The problem is unambiguous enough to be formalizable without difficulty. + +**Comparison with Problem 134:** Problem 134 uses a different (but logically related) formulation: max degree $< n^{1/2-\varepsilon}$ rather than $\leq \delta n^{1/2}$. The 618 formulation (small constant times $n^{1/2}$) is actually a weaker hypothesis than 134's ($n^{1/2-\varepsilon}$), so 618 is a weaker statement than 134 — any proof of 134 implies 618, but not conversely. This is consistent with the website's claim that Alon's solution of 134 "also solves" 618. + +## 6. Correctness + +**Mathematical correctness: Mostly correct, with one technical concern.** + +### Strengths: +- The `triangleFreeDiam2Completion` definition correctly captures $h_2(G)$: it takes the infimum over the number of added edges across all triangle-free supergraphs of diameter $\leq 2$. +- The `CliqueFree 3` encoding of "triangle-free" is standard and correct. +- The degree bound `∀ v, degree(v) ≤ δ · n^{1/2}` with `≤` is appropriate. +- The conclusion `h_2(G) ≤ ε · n^2` matches the $o(n^2)$ claim. + +### Concerns: + +1. **Edge counting via set difference:** The definition uses `(H.edgeFinset \ G.edgeFinset).card = k` to count added edges. Since `G ≤ H` (every edge of `G` is in `H`), this is equivalent to `H.edgeFinset.card - G.edgeFinset.card = k`. This is correct. Problem 134 uses the subtraction form `H.edgeFinset.card - G.edgeFinset.card ≤ δ * n^2` instead, which is also correct. The two approaches are equivalent given `G ≤ H`. + +2. **`sInf` on empty set:** If no triangle-free supergraph of diameter $\leq 2$ exists (the constraint set is empty), then `sInf ∅ = 0` for `ℕ`. This would make the theorem vacuously easier to satisfy (the conclusion becomes `0 ≤ ε · n^2`, which is trivially true). In practice, for the graphs in question (on $n$ vertices with $n$ large), such completions exist (one can always add enough edges), so this is not a mathematical issue, but it is a slight imprecision — the definition's docstring correctly notes this edge case. + +3. **Connected requirement in the definition but not the theorem hypothesis:** The definition of `triangleFreeDiam2Completion` requires the supergraph `H` to be connected (which is implied by `H.diam ≤ 2` for non-trivial graphs anyway, since finite diameter implies connectedness for graphs with $\geq 2$ vertices). This is fine but slightly redundant — `diam ≤ 2` for a graph on $\geq 2$ vertices already implies connectedness. For $n \leq 1$, the graph is trivially connected and has diameter 0, so there is no issue. + +4. **The original graph need not be connected:** The theorem does not require `G` to be connected, which is correct — the original problem statement does not assume connectivity of $G$. + +5. **Quantifier order is correct:** The $\forall \varepsilon, \exists \delta, \exists N_0, \forall n \geq N_0, \forall G$ structure correctly captures the intended uniformity. + +### Overall Assessment: +The formalization is **correct and complete** as a faithful rendering of the stated problem. The equivalence with Problem 134 (noted on the website) is not formalized but would require a separate theorem. The main theorem statement faithfully captures the little-o conjecture in explicit quantifier form. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | Needs improvement | Should share definition with 619.lean; cross-reference 134 | +| Citations | Incomplete | Missing full [EGR98] citation, [Er99], Alon reference | +| Variants | Adequate | Main conjecture captured; Simonovits bound could be added | +| Readability | Good | Clear docstrings and faithful epsilon-delta formulation | +| Formalizability | High | Unambiguous; standard epsilon-delta encoding of little-o | +| Correctness | Correct | Mathematically sound; minor redundancy in Connected condition | diff --git a/ai-review/619.md b/ai-review/619.md new file mode 100644 index 0000000000..40cda89d25 --- /dev/null +++ b/ai-review/619.md @@ -0,0 +1,74 @@ +# AI Review: Erdős Problem 619 + +## 1. Code Reuse + +The formalization defines a custom `triangleFreeDiamCompletion` function. No existing definition in `FormalConjecturesForMathlib` captures this concept. The relevant utility files are: + +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DiamExtra.lean` — provides `diam`, `ediam`, `eccent`, `radius` for `SimpleGraph`, but nothing for edge-addition completions. +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` — provides `indepNum` and clique-related definitions, but `CliqueFree 3` is already from Mathlib. + +The custom definition is necessary and appropriate. No obvious reuse opportunity exists. + +## 2. Citations + +The docstring references: + +> [EGR98] Erdős, P., Gyárfás, A. and Ruszinkó, M., *How to decrease the diameter of triangle-free graphs*, Combinatorica **18** (1998), 493–501. + +The website (https://www.erdosproblems.com/619) lists **three** references: + +1. **[EGR98]** — Erdős, Gyárfás, and Ruszinkó (1998) — present in the formalization. +2. **[Er99]** — Erdős (1999) — **missing** from the formalization. +3. **[AGR00]** — Alon, Gyárfás, and Ruszinkó (2000) — **missing** from the formalization. This paper proved that without the triangle-free constraint, adding n/2 edges suffices to obtain diameter at most 4. + +The website also lists related problems **#134** and **#618**, which are not cross-referenced. + +**Recommendation:** Add [Er99] and [AGR00] citations to the docstring, and note the related problems. + +## 3. Variants + +The docstring mentions related results for h_3 and h_5 (from [EGR98]), which is good context. However: + +- The [AGR00] result (without the triangle-free constraint, n/2 edges suffice for diameter ≤ 4) is a natural variant that is not mentioned. +- The formalization only formalizes the h_4 question. The known results h_3(G) ≤ n and h_5(G) ≤ (n-1)/2 are stated in the docstring but not formalized as separate theorems. These could be separate `proof_wanted` statements to capture the full picture from [EGR98]. + +**Assessment:** The core question is captured. Supporting results are described but not formalized. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The `triangleFreeDiamCompletion` definition is well-documented with a clear docstring explaining the edge case (returns 0 for empty infimum). +- The namespace `Erdos619` keeps the definition scoped appropriately. +- The main theorem statement reads naturally as a mathematical proposition. + +**No readability issues.** + +## 5. Formalizability + +The problem is a yes/no question ("does there exist a constant c > 0 such that..."), which is well-suited to formalization. The `answer(sorry) ↔ ...` pattern correctly captures this. + +**Minor ambiguity in the source:** The website states h_r(G) achieves "diameter r" while the formalization uses `H.diam ≤ r` (diameter *at most* r). The `≤` interpretation is mathematically standard and correct — since adding edges can only decrease diameter, requiring exactly diameter r would be unnatural (you might overshoot). The formalization makes the right choice here. + +**Assessment:** The problem is clearly formalizable with low ambiguity. The only interpretive choice (= vs ≤ for target diameter) is resolved correctly. + +## 6. Correctness + +### Strengths + +- **`triangleFreeDiamCompletion` definition is correct:** It computes the infimum over all supergraphs H of G that are triangle-free, connected, have diameter ≤ r, counting the number of added edges via `(H.edgeFinset \ G.edgeFinset).card`. +- **The `G ≤ H` constraint** correctly ensures H is a supergraph (H contains all edges of G). +- **`H.Connected` is required** in the completion, which is essential since diameter is only meaningful for connected graphs. +- **`G.CliqueFree 3` and `G.Connected`** are both required of the input graph G, matching the problem's "connected triangle-free graph" hypothesis. + +### Potential Issues + +1. **`sInf` on empty set returns 0:** If no valid completion exists for some G and r, then `triangleFreeDiamCompletion r G = 0`. This would make the inequality `0 < (1-c) * n` vacuously easy to satisfy for that G, potentially strengthening the theorem beyond its intent. In practice, for `r = 4` on a finite connected graph, a completion likely always exists (one can add edges to create a high-connectivity triangle-free graph of small diameter), so this edge case is unlikely to be triggered. The docstring correctly notes this behavior. + +2. **The `N₀` threshold:** The formalization includes `∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ →`, allowing small cases to be excluded. The original problem states the property for "every connected graph G on n vertices" without an explicit lower bound on n. However, this `N₀` threshold is standard for asymptotic combinatorial statements and does not materially affect correctness — for small n, the bound `(1-c)n` is trivially satisfied or the statement is vacuous. + +3. **Type choice `Fin n`:** Using `Fin n` for vertices is the standard approach for finite graphs in this codebase and is correct. + +### Verdict + +The formalization is **mathematically correct and complete** for the core question. The interpretation choices (≤ vs = for diameter, inclusion of N₀) are all defensible and standard. The only substantive gap is the missing citations and the absence of formalized supporting results from [EGR98]. diff --git a/ai-review/62.md b/ai-review/62.md new file mode 100644 index 0000000000..2bee6d91e5 --- /dev/null +++ b/ai-review/62.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 62 + +## 1. Code Reuse + +**`HasChromaticNumberAleph1` should use `chromaticCardinal`.** +The codebase already defines `SimpleGraph.chromaticCardinal` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136-137`, which returns a `Cardinal` and can distinguish between different infinite chromatic numbers. Problem 918 (`ErdosProblems/918.lean`) uses `G.chromaticCardinal = ℵ₁` throughout for exactly the same concept. The custom `HasChromaticNumberAleph1` definition in Problem 62 is mathematically equivalent but is ad hoc and inconsistent with the rest of the codebase. The hypothesis `HasChromaticNumberAleph1 G₁` could be replaced by `G₁.chromaticCardinal = aleph 1`. + +**`ContainsSubgraph` may duplicate existing Mathlib infrastructure.** +Mathlib's `SimpleGraph` has `SimpleGraph.Hom` (graph homomorphisms) and `SimpleGraph.Embedding` (injective graph homomorphisms preserving adjacency and non-adjacency). The definition `ContainsSubgraph` here is an injective homomorphism that preserves adjacency but not necessarily non-adjacency — this is strictly weaker than `SimpleGraph.Embedding` (which preserves the induced subgraph structure). For the purpose of this problem, the non-induced notion is the correct one (the problem says "subgraph", not "induced subgraph"). However, this definition is essentially `Nonempty (H →g G)` restricted to injective maps, which could potentially be expressed using existing Mathlib primitives. At minimum, if this definition is needed, it should be factored into `FormalConjecturesForMathlib` so other problems can reuse it. + +## 2. Citations + +The formalization cites: +- **[EHS74]** Erdős, P., Hajnal, A., and Shelah, S. — ✅ Present +- **[Er87]** Erdős, P. — ✅ Present + +**Missing from the website:** +- **[Er90]** — Erdős, P. (1990) — not cited in formalization +- **[Er95d]** — Erdős, P. (1995) — not cited in formalization +- **[Va99, 7.89]** — appears in Vaidya's work — not cited in formalization + +The [Er87] citation in the formalization is incomplete: it says only `*Some problems on finite and infinite graphs*` without journal/volume information. The [EHS74] citation is more complete but should be verified against the actual publication data. + +## 3. Variants + +**Captured:** +- **Strong version** (`erdos_62`): Common subgraph with infinite chromatic number (χ ≥ ℵ₀). ✅ +- **Weak version** (`erdos_62.variants.weak`): Common subgraph with chromatic number ≥ 4. ✅ + +**Not captured (but mentioned in docstring):** +- **Finite collection variant**: The problem on the website (and in the docstring for `erdos_62`) asks whether the result extends to *any finite collection* of graphs with chromatic number ℵ₁, not just two. This is mentioned textually in the `erdos_62` docstring but is not formalized as a separate theorem. It should be, since it is a strictly stronger and distinct conjecture. A formalization would universally quantify over a `Finset` or `Fin n`-indexed family of graphs. + +**Erdős's "probable" conjecture** (mentioned in the weak version docstring): that every graph with χ = ℵ₁ contains all graphs of χ = 4 with sufficiently large girth. This is a separate conjecture that implies the weak version but is not formalized. This is reasonable to omit as it is a different problem, but worth noting. + +## 4. Readability + +The code is reasonably readable. Suggestions: + +- The docstrings are well-written and provide good mathematical context. +- The `open SimpleGraph Cardinal` is clean and appropriate. +- The namespace `Erdos62` is clear. +- Minor: The `HasChromaticNumberAleph1` definition would benefit from a brief note explaining why both conditions (not countably colorable AND ℵ₁-colorable) are needed — i.e., that together they pin down χ = ℵ₁ exactly. This is mathematically obvious but helpful for readers unfamiliar with cardinal arithmetic. +- If `chromaticCardinal` is adopted (see §1), the custom definitions become unnecessary, making the file shorter and more immediately comprehensible to someone familiar with the codebase conventions. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: +- "Graphs with chromatic number ℵ₁" — well-defined. +- "Common subgraph" — well-defined (a graph that embeds into both). +- "Infinite chromatic number" / "chromatic number ≥ 4" — well-defined. + +The only mild ambiguity is whether "subgraph" means induced or non-induced. The formalization uses non-induced (adjacency-preserving injection), which is the standard graph-theoretic meaning of "subgraph" and is the correct choice. The problem as stated on the website is clearly formalizable without further interpretation. + +## 6. Correctness + +**`HasChromaticNumberAleph1` — Correct.** +The conjunction `(∀ (α : Type*) [Countable α], IsEmpty (G.Coloring α)) ∧ (∃ α : Type*, #α = aleph 1 ∧ Nonempty (G.Coloring α))` correctly characterizes χ(G) = ℵ₁. The first clause says χ > ℵ₀ (not countably colorable) and the second says χ ≤ ℵ₁ (ℵ₁-colorable). Together they give χ = ℵ₁. + +**`ContainsSubgraph` — Correct.** +The definition `∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v)` correctly captures "G contains H as a (non-induced) subgraph." + +**Strong version (`erdos_62`) — Correct with a caveat.** +The conclusion `H.chromaticNumber = ⊤` in `ℕ∞` means H is not finitely colorable, i.e., χ(H) ≥ ℵ₀. This is exactly what "infinite chromatic number" means. The formalization correctly captures the problem. + +**Weak version (`erdos_62.variants.weak`) — Correct.** +The conclusion `¬ H.Colorable 3` means H is not 3-colorable, i.e., χ(H) ≥ 4. This matches the problem statement asking for chromatic number ≥ 4. + +**One potential concern:** The existential `∃ (U : Type*) (H : SimpleGraph U)` quantifies H as an abstract graph. This is correct — the problem asks whether a *common* graph H exists that embeds into both G₁ and G₂, not whether some specific subgraph of G₁ is also a subgraph of G₂. The formalization correctly allows H to be any graph (with its own vertex type) that maps into both. + +**No mathematical flaws identified.** The formalization is correct and complete for the two stated variants. The main gap is the missing finite-collection variant (see §3). + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Improvement needed | Should use `chromaticCardinal`; `ContainsSubgraph` should be in shared library | +| Citations | ⚠️ Incomplete | Missing [Er90], [Er95d], [Va99] | +| Variants | ⚠️ Partially complete | Finite collection variant mentioned but not formalized | +| Readability | ✅ Good | Clear, well-documented | +| Formalizability | ✅ High | Unambiguous problem statement | +| Correctness | ✅ Correct | No mathematical flaws found | diff --git a/ai-review/620.md b/ai-review/620.md new file mode 100644 index 0000000000..b4deeebaaa --- /dev/null +++ b/ai-review/620.md @@ -0,0 +1,101 @@ +# AI Review: Erdős Problem 620 + +## Summary + +Erdős Problem 620 formalizes the Erdős-Rogers problem: given a $K_4$-free graph on $n$ vertices, how large a triangle-free induced subgraph must it contain? The formalization captures the known result $f(n) = n^{1/2+o(1)}$ via two theorems (lower and upper bound). + +--- + +## 1. Code Reuse + +The formalization uses standard Mathlib primitives (`SimpleGraph`, `CliqueFree`, `induce`, `Finset`) and introduces no custom definitions. This is appropriate — the statements are clean existential/universal assertions over these standard objects. + +Nearby problems in the codebase define related but distinct concepts: +- **621.lean**: `IsTriangleIndependent`, `IsTriangleTransversal` — edge-set notions, not vertex-set induced subgraph notions. Not reusable here. +- **151.lean**: `IsCliqueTransversal`, `independenceNumber`, `H(n)` — vertex clique transversals and independence number for triangle-free graphs. The function `H(n)` (minimum independence number over triangle-free graphs on $n$ vertices) is conceptually related (it's Ramsey-type), but Problem 620 asks about the largest triangle-free *induced subgraph*, not the largest independent set within one. Not directly reusable. +- **610.lean / 611.lean**: Clique transversal numbers — different problem structure. + +**Verdict**: No reuse opportunities identified. The formalization is appropriately self-contained. + +--- + +## 2. Citations + +**Website (erdosproblems.com/620) lists:** +- Erdős and Rogers (original problem) +- Bollobás and Hind (early bounds) +- Krivelevich (improved bounds) +- Wolfovitz (improved upper bound) +- Shearer (current best lower bound) +- Mubayi and Verstraëte (current best upper bound) +- Contributors thanked: Noga Alon and Zach Hunter + +**Formalization docstring lists:** +- [ErRo62] Erdős, P. and Rogers, C.A. +- [EGT92] Erdős, P., Gallai, T. and Tuza, Z. +- [Er99] Erdős, P. +- [Sh95] Shearer, J.B. +- [MuVe24] Mubayi, D. and Verstraëte, J. + +**Issues:** +- The citations use shorthand references (e.g., `[Sh95]`, `[MuVe24]`) without full bibliographic details (titles, journal names, page numbers). Other problems in this codebase (e.g., 621.lean) provide full citation strings. This should be made consistent. +- Bollobás–Hind, Krivelevich, and Wolfovitz are mentioned on the website as providing intermediate bounds but are not cited. This is acceptable since they are superseded, but noting their contribution would improve completeness. +- [EGT92] appears in the citations but its relevance to Problem 620 specifically is unclear from the docstring — it is more directly associated with Problem 621. If it is cited because it discusses the Erdős-Rogers problem in some form, this should be clarified. + +--- + +## 3. Variants + +The formalization provides two theorems: +1. `erdos_620` — lower bound: $f(n) \geq n^{1/2 - \varepsilon}$ +2. `erdos_620.variants.upper` — upper bound: $f(n) \leq n^{1/2 + \varepsilon}$ + +**Missing variants:** +- **Precise Shearer lower bound**: $f(n) \gg n^{1/2} (\log n)^{1/2} / \log\log n$. This is strictly stronger than the formalized $n^{1/2 - \varepsilon}$ lower bound and represents the actual state of the art. +- **Precise Mubayi–Verstraëte upper bound**: $f(n) \ll n^{1/2} \log n$. Similarly stronger than the formalized $n^{1/2 + \varepsilon}$ upper bound. +- **General Erdős-Rogers function**: The problem is a special case ($s = 3$, $t = 4$) of the general question: for $K_t$-free graphs, how large a $K_s$-free induced subgraph is guaranteed? Formalizing $f_{s,t}(n)$ would be a natural generalization. +- **The open question itself**: The precise asymptotic behavior of $f(n)$ remains unknown. For instance, does $f(n)/n^{1/2}$ grow polynomially in $\log n$? This is not captured. + +--- + +## 4. Readability + +The code is clean and readable. Specific observations: + +- **Good**: Clear separation into lower and upper bound theorems with descriptive docstrings. +- **Good**: Use of the `Erdos620` namespace to scope definitions. +- **Good**: The docstring explains the mathematical context well and states the known bounds. +- **Minor**: The expression `(1 : ℝ) / 2 - ε` and `(1 : ℝ) / 2 + ε` could arguably be written as `1 / 2 - ε` with appropriate coercions, but the explicit type annotation is a standard Lean idiom and aids clarity. +- **Minor**: The docstring mentions "the precise asymptotic behaviour of $f(n)$ remains open" but the formalization captures only the $n^{1/2+o(1)}$ characterization. The relationship between what is formalized and what remains open could be stated more precisely. + +--- + +## 5. Formalizability + +**Assessment: Clearly formalizable (low ambiguity).** + +The formalized statements are precise and unambiguous: +- "Every $K_4$-free graph on $n$ vertices contains a triangle-free induced subgraph of size $\geq n^{1/2 - \varepsilon}$" — this is a clean $\forall\exists$ statement over finite objects. +- The upper bound is similarly clean. + +The $o(1)$ exponent characterization is elegantly captured by the $\forall \varepsilon > 0, \exists N$ formulation — this is a standard and correct way to formalize $n^{1/2+o(1)}$ in the exponent. + +The *precise* bounds (involving $\log n$ and $\log\log n$ factors) would be somewhat more involved to formalize but are certainly doable using `Real.log`. + +--- + +## 6. Correctness + +**Mathematical correctness: Sound, with one concern about the status tag.** + +**The statements are mathematically correct.** Specifically: + +- **Lower bound** (`erdos_620`): States $\forall \varepsilon > 0, \exists N, \forall n \geq N$, every $K_4$-free graph on $n$ vertices has a triangle-free induced subgraph of size $\geq n^{1/2 - \varepsilon}$. This follows from Shearer's bound $f(n) \gg n^{1/2} (\log n)^{1/2} / \log\log n \geq n^{1/2 - \varepsilon}$ for large $n$. ✓ + +- **Upper bound** (`erdos_620.variants.upper`): States $\forall \varepsilon > 0, \exists N, \forall n \geq N$, there exists a $K_4$-free graph on $n$ vertices where every triangle-free induced subgraph has $\leq n^{1/2 + \varepsilon}$ vertices. This follows from Mubayi–Verstraëte's bound $f(n) \ll n^{1/2} \log n \leq n^{1/2 + \varepsilon}$ for large $n$. ✓ + +- **Together** these correctly characterize $f(n) = n^{1/2+o(1)}$, since the lower bound gives $\liminf \frac{\log f(n)}{\log n} \geq 1/2$ and the upper bound gives $\limsup \frac{\log f(n)}{\log n} \leq 1/2$. ✓ + +**Status tag concern**: Both theorems are tagged `category research solved`. The erdosproblems.com website marks Problem 620 as **OPEN** — the precise asymptotics of $f(n)$ are unknown. However, the formalized statements capture the *known* result $f(n) = n^{1/2+o(1)}$, not the open problem of determining the precise asymptotics. The `solved` tag is technically correct for what is formalized, but is potentially misleading because it suggests the Erdős problem itself is resolved. This tension should be acknowledged more explicitly in the docstring — e.g., "These statements are known results; the original Erdős-Rogers problem of determining the precise asymptotics remains open." + +**No mathematical errors detected.** The use of `G.induce (↑S : Set (Fin n))` correctly constructs the induced subgraph, and `CliqueFree 3` / `CliqueFree 4` correctly encode triangle-freeness and $K_4$-freeness respectively. diff --git a/ai-review/621.md b/ai-review/621.md new file mode 100644 index 0000000000..7f4aa0ef2a --- /dev/null +++ b/ai-review/621.md @@ -0,0 +1,58 @@ +# AI Review: Erdős Problem 621 + +## 1. Code Reuse + +The definitions `IsTriangleIndependent` and `IsTriangleTransversal` are unique to this file and do not exist elsewhere in the codebase or in `FormalConjecturesForMathlib`. No existing implementations can be directly repurposed. + +**Minor issue:** The `mkEdge` abbreviation uses `Quot.mk _ (a, b)` to construct `Sym2` values, but the rest of the codebase consistently uses `Sym2.mk (a, b)` (see e.g. `810.lean`, `811.lean`, `742.lean`, `743.lean`). The `mkEdge` helper should be replaced with direct use of `Sym2.mk` for consistency, or at minimum, its implementation should be changed to use `Sym2.mk` rather than the lower-level `Quot.mk`. + +## 2. Citations + +The citations match the website accurately: + +- **[EGT96]** Erdős, P., Gallai, T., and Tuza, Z., *Covering and independence in triangle structures*, Discrete Mathematics 150 (1996), 89–101. ✓ +- **[NoSu16]** Norin, S. and Sun, Y., *Triangle-independent sets vs. triangle-transversals*, European Journal of Combinatorics 56 (2016), 95–104. ✓ + +Both references are correctly attributed and the journal information is complete. + +## 3. Variants + +**The stronger result proved by Norin and Sun is not captured.** The website states that Norin and Sun actually proved: + +$$\alpha_1(G) + \tau_B(G) \leq n^2/4$$ + +where $\tau_B(G)$ is the minimum number of edges whose removal makes $G$ bipartite. Since $\tau_1(G) \leq \tau_B(G)$ (every set of edges that makes $G$ bipartite is in particular a triangle transversal), this is strictly stronger than the original conjecture. The formalization only captures the weaker original conjecture. + +A variant formalizing the stronger Norin–Sun result would be a valuable addition. This would require defining `τ_B(G)` (the bipartite edge deletion number / odd cycle transversal number for edges). + +The website also mentions related Problem #23 (concerning $\tau_B(n) \leq n^2/25$), which is formalized separately in `23.lean`. + +## 4. Readability + +The code is generally readable. Specific observations: + +- **`mkEdge` abbreviation:** As noted above, using `Sym2.mk` directly (or an alias defined in terms of `Sym2.mk`) would be more consistent with codebase conventions and immediately recognizable to readers familiar with Mathlib. +- **`IsTriangleIndependent` definition:** The three-way conjunction `¬(ab ∈ S ∧ bc ∈ S) ∧ ¬(ab ∈ S ∧ ac ∈ S) ∧ ¬(bc ∈ S ∧ ac ∈ S)` is a correct but verbose way of saying "at most one of the three edges is in S." An alternative would be a cardinality-based formulation (the number of triangle edges in S is ≤ 1), though the explicit pairwise formulation is arguably easier to work with in proofs. +- **Theorem statement:** Clean and well-structured. The use of `4 * (S.card + T.card) ≤ n ^ 2` to avoid rational division is standard practice. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is a precise combinatorial inequality involving well-defined graph-theoretic quantities. The definitions of $\alpha_1(G)$ (maximum triangle-independent edge set) and $\tau_1(G)$ (minimum triangle transversal) are standard and admit no ambiguity. The bound $n^2/4$ is a concrete numerical target. This is an ideal candidate for formalization. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsTriangleIndependent`:** Correctly requires (1) $S \subseteq E(G)$, and (2) for all triangles $(a, b, c)$, no two of the three edges $\{a,b\}$, $\{b,c\}$, $\{a,c\}$ are both in $S$. The pairwise non-membership condition is equivalent to "at most one edge per triangle." The universal quantification over all triples $(a, b, c)$ with the three adjacency hypotheses correctly captures all triangles (each triangle is hit by multiple permutations, which is harmless). Distinctness of vertices is guaranteed by irreflexivity of `SimpleGraph.Adj`. + +- **`IsTriangleTransversal`:** Correctly requires (1) $T \subseteq E(G)$, and (2) for every triangle, at least one edge is in $T$. The disjunction `mkEdge a b ∈ T ∨ mkEdge b c ∈ T ∨ mkEdge a c ∈ T` is the standard formulation. + +- **`erdos_621` theorem:** The statement correctly captures the conjecture. By taking $S$ with the maximality hypothesis (`hS_max`) and $T$ with the minimality hypothesis (`hT_min`), $S.\text{card} = \alpha_1(G)$ and $T.\text{card} = \tau_1(G)$. The inequality `4 * (S.card + T.card) ≤ n ^ 2` is the integer-arithmetic equivalent of $\alpha_1(G) + \tau_1(G) \leq n^2/4$. + +- **Edge symmetry:** `mkEdge a b = mkEdge b a` holds by definition of `Sym2`, so edge orientation is not an issue. The definitions correctly treat edges as unordered pairs. + +**No mathematical flaws identified.** The formalization is a faithful rendering of the original conjecture. diff --git a/ai-review/622.md b/ai-review/622.md new file mode 100644 index 0000000000..861adec75d --- /dev/null +++ b/ai-review/622.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 622 + +**File:** `FormalConjectures/ErdosProblems/622.lean` + +## 1. Code Reuse + +The formalization defines two custom notions: `IsSpannedByCycle` and `numCycleSpannedSubsets`. These are problem-specific and do not appear in `FormalConjecturesForMathlib/`. A search of the broader codebase finds no existing definitions that could replace them. + +Several other Erdős problems work with cycles (`IsCycle` is used in 22 problem files), but each defines its own problem-specific predicates (e.g., `HasCycleWithKChords` in 767, `ContainsCycleOfLength` in 1012, `NoTwoEdgeDisjointCyclesSameVertexSet` in 585). The concept of "subset spanned by a cycle" is unique to this problem and does not overlap with those. + +The formalization correctly reuses Mathlib's `SimpleGraph.Walk.IsCycle`, `Walk.support`, `SimpleGraph.IsRegularOfDegree`, and `Finset.powerset.filter` rather than reimplementing them. No further reuse opportunities are apparent. + +## 2. Citations + +The docstring references match what appears on [erdosproblems.com/622](https://www.erdosproblems.com/622): + +- **[Er99]**: Cited as the original source, attributed to Erdős and Faudree. The docstring correctly states "A problem of Erdős and Faudree [Er99]", matching the website. +- **[DKM25]**: Cited as the resolution, attributed to Draganić, Keevash, and Müyesser. The theorem docstring correctly states "Proved by Draganić, Keevash, and Müyesser [DKM25]", matching the website. + +The website itself only provides these shorthand references, so the docstrings are consistent with the source. + +## 3. Variants + +The website and docstring mention two important negative cases showing the conditions are tight: + +1. **Minimum degree n+1 (instead of regularity):** The answer is no; $K_{n,n}$ with a spanning star in each part is a counterexample. +2. **Regular of degree n (instead of n+1):** The answer is no; $K_{n,n}$ is a counterexample. + +These variants are documented in the module docstring but are **not formalized as separate statements**. Since they are negative results (counterexamples showing necessity of conditions) rather than standalone conjectures, this is a reasonable editorial choice. However, formalizing them as companion lemmas (e.g., showing the specific counterexamples have few cycle-spanned subsets) would strengthen the formalization by confirming the conditions in `erdos_622` are essential. This is a minor gap. + +## 4. Readability + +The code is clean and well-structured: + +- The module docstring provides excellent context: problem statement, attribution, key observations, related cases, and resolution. +- `IsSpannedByCycle` and `numCycleSpannedSubsets` are clearly named and have informative docstrings. +- The theorem statement is well-formatted and the quantifier structure (∀ε > 0, ∃N, ∀n ≥ N, ...) is standard and readable. +- The namespace `Erdos622` appropriately scopes the definitions. + +No readability improvements are needed. + +## 5. Formalizability + +The problem as stated on the website ("Must G have ≫ 2^{2n} subsets that are spanned by a cycle?") has moderate ambiguity: + +- **"≫ 2^{2n}"** is informal asymptotic notation meaning "at least c · 2^{2n} for some constant c > 0" (i.e., a positive proportion of all subsets). This is imprecise but standard in combinatorics. +- **"Spanned by a cycle"** is standard graph theory terminology: a subset S is spanned by a cycle if there exists a cycle whose vertex set is exactly S. + +The formalization resolves the ambiguity by formalizing the stronger DKM25 result: for all ε > 0 and sufficiently large n, the count is at least (1/2 - ε) · 2^{2n}. This is the natural ε-δ formulation of "at least (1/2 + o(1)) · 2^{2n}" (where the o(1) term may be negative) and is unambiguous. The choice to formalize the tight result rather than just the original "≫" question is appropriate and standard. + +**Assessment: Low ambiguity.** The informal statement is standard enough that any combinatorialist would agree on the intended meaning, and the formalization captures the strongest known result precisely. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Definition `IsSpannedByCycle`:** +- `∃ v ∈ S, ∃ p : G.Walk v v, p.IsCycle ∧ p.support.toFinset = S` +- Correctly requires a closed walk that is a cycle (Mathlib's `IsCycle`: circuit with no repeated interior vertices, which enforces length ≥ 3 since a walk v → w → v reuses the edge {v,w} and thus is not a trail). +- `p.support.toFinset = S` correctly identifies the vertex set of the cycle with S (the support of a cycle v → w₁ → ··· → wₖ → v is [v, w₁, ..., wₖ, v], and `toFinset` removes the duplicate v). +- The existential over `v ∈ S` is harmless: any vertex of a cycle can serve as the starting vertex. +- Edge cases are correctly handled: ∅ is not spanned (∃ v ∈ ∅ is false), singletons are not spanned (no cycle of length 1), pairs are not spanned (no cycle of length 2 in a simple graph). + +**Definition `numCycleSpannedSubsets`:** +- Counts subsets of `Fin (2 * n)` satisfying `IsSpannedByCycle G` using `powerset.filter`. Straightforward and correct. + +**Theorem `erdos_622`:** +- The quantifier structure `∀ ε > 0, ∃ N, ∀ n ≥ N` correctly captures "for sufficiently large n". +- `G.IsRegularOfDegree (n + 1)` on `Fin (2 * n)` correctly encodes "(n+1)-regular on 2n vertices". For small n (n < 2), no such graph exists (degree n+1 would exceed the number of non-self neighbors 2n−1), so the statement is vacuously true — this is correct behavior. +- The bound `(1/2 - ε) * 2^(2n)` correctly captures "at least (1/2 + o(1)) · 2^{2n}" in the lower-bound direction. This is consistent with the DKM25 result and Erdős's upper bound observation (at least (1/2 + o(1)) · 2^{2n} sets are NOT on a cycle, giving an upper bound of (1/2 − o(1)) · 2^{2n} for cycle-spanned sets). +- The `answer(True) ↔` wrapper correctly indicates the answer to the original yes/no question is affirmative. + +**Potential subtlety worth noting:** The theorem quantifies over ALL (n+1)-regular graphs on 2n vertices for each n, which is the correct universal statement. The `∃ N` threshold is placed before the graph quantifier, meaning the same N works for all graphs simultaneously (not a different N per graph). This is the correct reading — the DKM25 result gives a uniform bound. + +**Verdict: Correct and complete.** No mathematical flaws identified. diff --git a/ai-review/625.md b/ai-review/625.md new file mode 100644 index 0000000000..1209cd4b71 --- /dev/null +++ b/ai-review/625.md @@ -0,0 +1,80 @@ +# Review: Erdős Problem 625 + +## 1. Code Reuse + +The formalization defines its own `finChromaticNumber`, `cochromaticNumber`, and `toGraph625` locally in the `Erdos625` namespace, but the codebase already provides reusable versions: + +- **`SimpleGraph.Cocolorable`** (`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:118`): Defines cocolorability using `G.induce {v | coloring v = i} = ⊥ ∨ ... = ⊤`, which is equivalent to the explicit pairwise condition used in 625.lean. +- **`SimpleGraph.cochromaticNumber`** (`Coloring.lean:131`): Returns `ℕ∞` via `⨅ n ∈ setOf G.Cocolorable, (n : ℕ∞)`. +- **`SimpleGraph.chromaticNumber`** (Mathlib): Already available and used throughout the codebase with notation `χ(G)`. + +The local `finChromaticNumber` and `cochromaticNumber` in 625.lean are ℕ-valued and specialized to `Fin n`, while the library versions are `ℕ∞`-valued and work on general `SimpleGraph V`. For this problem (finite graphs on `Fin n`), the library versions should be usable after coercing to ℕ via `ENat.toNat`. Reusing the library definitions would improve consistency and allow leveraging existing lemmas (e.g., `colorable_iff_induce_eq_bot`, the example showing `Colorable n → Cocolorable n`). + +**Recommendation:** Replace local definitions with imports from `FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring` and Mathlib's `SimpleGraph.chromaticNumber`. The `toGraph625` construction for encoding G(n,1/2) is problem-specific and appropriately defined locally. + +## 2. Citations + +The formalization cites: + +> [ErGi93] Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*, 1993. + +The website (erdosproblems.com/625) confirms this reference and additionally notes: + +- The problem was originally posed circa **1989** at a random graphs conference in Poznań, Poland. +- A prize of **\$1000 for disproof** and **\$100 for proof** is offered. +- Recent progress: **Heckel [He24]** and **Steiner [St24b]** independently showed the difference is unbounded. **Heckel [He24c]** proved that for any ε > 0, χ(G) − ζ(G) ≥ n^{1−ε} for approximately 95% of all n. Heckel conjectures χ(G) − ζ(G) ≍ n/(log n)³. + +The citation [ErGi93] is appropriate as the primary reference. The docstring could optionally mention the asymmetric prize structure or Heckel's recent near-resolution, but this is not strictly necessary for the formalization. + +## 3. Variants + +The formalization captures the core question: does χ(G) − ζ(G) → ∞ almost surely? + +**Missing variants or related conjectures from the literature:** +- **Heckel's conjecture** on the precise asymptotics: χ(G) − ζ(G) ≍ n/(log n)³. This is a stronger quantitative conjecture that could be a separate theorem statement. +- The known bounds n/(2 log₂ n) ≤ ζ(G) ≤ χ(G) ≤ (1+o(1)) n/(2 log₂ n) are not captured, though these are established results rather than conjectures. + +The formalization adequately captures the main open problem. Heckel's asymptotic conjecture would be a natural companion statement but is not part of the original Erdős problem. + +## 4. Readability + +The code is generally readable with clear docstrings. Suggestions: + +- The name `toGraph625` is problem-specific and clear in context but somewhat opaque; a name like `boolMatrixToGraph` would be more descriptive. However, the problem-specific naming avoids namespace collisions and is a reasonable convention. +- The docstring on `erdos_625` clearly explains both the probabilistic and combinatorial formulations and their equivalence. +- The `finChromaticNumber` and `cochromaticNumber` definitions use `sInf` over explicit set-builder notation, which is standard and readable. + +**Minor:** The `open SimpleGraph Finset` at the top could be scoped more narrowly if desired. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The original problem asks whether χ(G) − ζ(G) → ∞ "almost surely" for G ~ G(n, 1/2). This involves: + +1. **Chromatic number χ(G):** Standard, well-defined graph invariant. +2. **Cochromatic number ζ(G):** Well-defined — minimum number of parts where each part induces a clique or independent set. +3. **G(n, 1/2) model:** The uniform distribution over labeled graphs on n vertices. The formalization cleverly sidesteps measure theory by using the equivalent combinatorial counting formulation (fraction of Boolean matrices). +4. **"Almost surely" / "tends to infinity":** The formalization correctly interprets this as: for every M and ε > 0, eventually the fraction of graphs with χ − ζ ≥ M is ≥ 1 − ε. This is the standard definition. + +The only source of minor ambiguity is whether "almost surely" should be interpreted in the product probability space (a single random graph sequence) or in the marginal sense (probability over G(n,1/2) for each n). These are equivalent for monotone-like properties by standard arguments, and the formalization uses the latter (cleaner for finite combinatorics). + +## 6. Correctness + +**Overall assessment: Mathematically correct with minor observations.** + +### Strengths: +- **Graph encoding is sound.** The `toGraph625` function maps `Fin n → Fin n → Bool` to `SimpleGraph (Fin n)` using `ec (min u v) (max u v)`, effectively reading only the upper-triangular entries. Since every graph has exactly the same number of preimages (2^{n(n+1)/2} matrices map to each graph, due to free diagonal and lower-triangular entries), the fraction of matrices with property P equals the G(n,1/2) probability of P. The docstring correctly explains this. +- **Chromatic number definition** is standard: minimum k such that a proper k-coloring exists. +- **Cochromatic number definition** correctly requires each color class to be either a clique or an independent set, matching the mathematical definition. +- **The main statement** correctly encodes "χ − ζ → ∞ a.s." as the ε-δ counting condition. +- **Natural number subtraction** `finChromaticNumber - cochromaticNumber` is safe here because χ(G) ≥ ζ(G) always holds (any proper coloring is a valid cochromatic coloring, since each color class is an independent set). + +### Observations: +- **`sInf` over potentially empty sets:** If n = 0, both `finChromaticNumber` and `cochromaticNumber` take `sInf` of sets that include k = 0 (vacuously). For n ≥ 1, the chromatic number set excludes k = 0 (no function `Fin n → Fin 0` exists) but includes k = n. The `sInf` of a nonempty subset of ℕ is well-defined and correct. For the empty set, `sInf ∅ = 0` in ℕ, but this edge case (n = 0) is harmless since graphs on 0 vertices trivially satisfy any coloring bound. +- **`answer(sorry)`** is appropriately used since the problem is open — though recent work by Heckel strongly suggests the answer is **true**, the full result for all n has not been established. +- **The `@[category research open, AMS 5 60]` tag** is appropriate (Graph Theory and Probability). + +### No mathematical errors detected. + +The formalization is a faithful and correct encoding of Erdős Problem 625. The main recommendation is to reuse the existing `Cocolorable`/`cochromaticNumber` and Mathlib's `chromaticNumber` definitions rather than defining local versions. diff --git a/ai-review/626.md b/ai-review/626.md new file mode 100644 index 0000000000..c91f439ead --- /dev/null +++ b/ai-review/626.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 626 + +**File:** `FormalConjectures/ErdosProblems/626.lean` + +--- + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`finChromaticNumber`**: This definition is duplicated verbatim from Erdős Problem 625 (`FormalConjectures/ErdosProblems/625.lean:51`). Both define: + ``` + noncomputable def finChromaticNumber {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sInf {k : ℕ | ∃ f : Fin n → Fin k, ∀ u v, G.Adj u v → f u ≠ f v} + ``` + This should be factored into a shared utility, or better yet, replaced with Mathlib's `SimpleGraph.chromaticNumber`. The Mathlib version works for arbitrary types and is defined as `sInf {n | G.Colorable n}` where `Colorable n` means there exists a proper coloring into `Fin n`. For graphs on `Fin n` (a finite type), Mathlib's `chromaticNumber` should be equivalent to the local `finChromaticNumber`, though proving this equivalence would require a small lemma. + +- **`HasGirthGt`**: Mathlib provides `SimpleGraph.girth` (natural number, via `ENat.toNat` of `egirth`) and `SimpleGraph.egirth` (extended natural). The local `HasGirthGt G m` asserts every cycle has length > m, which is equivalent to `G.girth > m` (or `m < G.girth`). Erdős Problem 108 directly uses `SimpleGraph.girth` from Mathlib. The local walk-based definition could be replaced with `m < G.girth` for consistency with the rest of the codebase. + +- **`g` and `h` definitions**: These are problem-specific and unlikely to be reusable elsewhere, so defining them locally is appropriate. + +**Recommendation:** Replace `finChromaticNumber` with Mathlib's `SimpleGraph.chromaticNumber` and `HasGirthGt` with a condition on Mathlib's `SimpleGraph.girth`. If `finChromaticNumber` is needed across multiple Erdős problems, extract it to a shared utility file. + +--- + +## 2. Citations + +The formalization includes these references: +- `[Er59b]` Erdős, P., *Graph theory and probability*, Canad. J. Math., 1959. +- `[Er62b]` Erdős, P., *On circuits and subgraphs of chromatic graphs*, Mathematika, 1962. +- `[Er69b]` Erdős, P., *Problems and results in chromatic graph theory*, 1969. +- `[Ko88]` Kostochka, A.V., *The minimum Hadwiger number for graphs with a given mean degree of vertices*, Metody Diskret. Analiz., 1988. + +The website [erdosproblems.com/626](https://www.erdosproblems.com/626) lists the same four citation keys: `[Er59b]`, `[Er62b]`, `[Er69b]`, `[Ko88]`. The website does not provide full bibliographic details beyond the keys, so the expanded bibliographic information in the formalization's docstring is a welcome addition and appears accurate. **Citations match.** + +--- + +## 3. Variants + +The formalization captures two parts: +1. **Part 1** (`erdos_626`): Existence of $\lim_{n\to\infty} g_k(n)/\log n$ for $k \geq 4$. +2. **Part 2** (`erdos_626.variants.maximal_chromatic`): Existence of $\lim_{n\to\infty} \log h^{(m)}(n)/\log n$ for $m \geq 1$. + +**Missing variant — the even $m$ conjecture:** The website states that for **even** $m$, Erdős suspected the limit lies in $\left[\frac{2}{m+2}, \frac{2}{m}\right]$ but had "no good guess for the value" and could not prove this even for $m = 4$. This is a distinct sub-conjecture not captured by the formalization. While the Part 2 docstring mentions the odd $m$ bound $\leq \frac{2}{m+1}$ and the conjecture that it is sharp, it omits the even $m$ interval entirely. + +**Missing variant — sharpness for odd $m$:** The docstring mentions Erdős conjectured the bound $\frac{2}{m+1}$ is sharp for odd $m$, but this is not formalized as a separate conjecture (e.g., that the limit equals $\frac{2}{m+1}$ for odd $m$). This could be a worthwhile additional variant statement. + +**The "what is its value?" part:** The problem asks not only whether the limit exists but also what its value is. The formalization only asks for existence (via `∃ L`), not for the conjectured value. This is reasonable since the value is only conjectured for odd $m$, but it is worth noting. + +--- + +## 4. Readability + +**Overall:** The code is well-structured and readable. The docstrings are informative and include the relevant bounds. A few suggestions: + +- The `attribute [local instance] Classical.propDecidable` on line 54 is a common pattern but could benefit from a brief comment explaining why it's needed (it enables classical decidability for the `sInf`/`sSup` definitions). +- The `open SimpleGraph Filter` and `open scoped Topology` are appropriate for the definitions used. +- The naming convention `g` and `h` for the functions matches the mathematical notation, which is good for readability in this context, though it's somewhat terse for Lean code. The docstrings compensate for this. +- The Part 2 theorem name `erdos_626.variants.maximal_chromatic` is descriptive and follows the codebase convention. + +--- + +## 5. Formalizability + +**Part 1 ($g_k(n)$ limit):** The statement is precise and clearly formalizable. The definition of $g_k(n)$ as a supremum over girth values for graphs with chromatic number $k$ on $n$ vertices is unambiguous. + +**Part 2 ($h^{(m)}(n)$ limit):** Also precise and formalizable. The definition of $h^{(m)}(n)$ as a supremum of chromatic numbers is clear. + +**Ambiguity level: Low.** Both questions are well-posed existence-of-limit questions. The only ambiguity is the "what is its value?" part of the second question, which is inherently open-ended and not easily formalized as a single theorem statement. The formalization reasonably addresses this by asking only for existence. + +One subtle point: the use of `sSup` for `g` and `h` relies on the set being bounded (or returning `0` for the empty set in ℕ). For `g k n`, if no graph on `n` vertices has chromatic number exactly `k`, the set is empty and `sSup ∅ = 0` in ℕ, which is a reasonable default. Similarly for `h`. This is mathematically fine for the limit statements since only the asymptotic behavior matters. + +--- + +## 6. Correctness + +**Definition of `finChromaticNumber`:** Correct. It computes $\inf\{k \mid \exists f: \text{Fin}(n) \to \text{Fin}(k), \text{proper}\}$, which is the standard chromatic number. Note that for the empty graph (n = 0), the set includes $k = 0$ (the empty function vacuously satisfies the coloring condition), so the chromatic number is 0. This is consistent with convention. + +**Definition of `HasGirthGt`:** Correct. For every vertex $v$ and every cycle $p$ starting and ending at $v$, the cycle length exceeds $m$. This correctly captures "girth > m" (including the case where there are no cycles, i.e., acyclic graphs have infinite girth, so `HasGirthGt G m` holds for all $m$). + +**Definition of `g k n`:** Correct as a supremum. For acyclic graphs (trees/forests), which have chromatic number ≤ 2, the `HasGirthGt` condition holds for all $m$, but since $k \geq 4$, such graphs are excluded by the chromatic number condition. For $k \geq 4$, any graph with chromatic number $k$ must contain cycles, so the set $\{m \mid \exists G, \chi(G) = k \land \text{girth}(G) > m\}$ is bounded above, making `sSup` well-defined and finite. **However**, since `sSup` on `ℕ` returns `0` for unbounded sets (via `sSup_eq_zero` or conditionally bounded lattice behavior), and the set is of the form $\{0, 1, \ldots, M\}$ for some $M$, the supremum correctly returns $M$. This is fine. + +**Definition of `h m n`:** Correct. The supremum of chromatic numbers over graphs with girth > m on n vertices. This set is always bounded (chromatic number ≤ n), so sSup is well-defined. + +**Part 1 theorem statement:** The `Tendsto` statement asks whether $(g_k(n))/\log n \to L$ as $n \to \infty$, for some real $L$. This correctly formalizes the question. The cast `(g k n : ℝ)` and `Real.log (n : ℝ)` are appropriate. **Potential issue:** When $n = 0$ or $n = 1$, $\log n \leq 0$, making the ratio undefined or negative. The `Tendsto` with `atTop` filter means we only care about the eventual behavior, so this is not a mathematical issue — but if `Real.log 0 = 0` (which it is in Mathlib), then division by zero gives `0/0` which Lean defines as `0`. This doesn't affect the limit statement since `atTop` ignores finitely many terms. + +**Part 2 theorem statement:** Similarly correct. $\log(h^{(m)}(n))/\log n \to L$. Same considerations about small $n$ apply and are similarly benign. + +**Constraint on $m$:** Part 2 requires $m \geq 1$. The website doesn't explicitly restrict $m$, but $m = 0$ would mean girth > 0, which is trivially true for all simple graphs (since simple graphs have no loops, all cycles have length ≥ 3), making $h^{(0)}(n)$ just the maximum chromatic number of any graph on $n$ vertices, which equals $n$. So $\log h^{(0)}(n)/\log n \to 1$, and the limit trivially exists. The restriction $m \geq 1$ is thus not mathematically necessary but is reasonable for focusing on the interesting cases. + +**Overall correctness: Good.** The formalization is mathematically sound. No obvious flaws. The main gap is the missing even-$m$ variant mentioned in Section 3. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `finChromaticNumber` duplicated from Problem 625; `HasGirthGt` could use Mathlib's `girth` | +| Citations | Match the website; expanded bibliographic details are accurate | +| Variants | Missing the even-$m$ interval conjecture and the odd-$m$ sharpness sub-conjecture | +| Readability | Good; clear docstrings and conventional naming | +| Formalizability | High; low ambiguity in the problem statement | +| Correctness | Mathematically sound; no flaws identified | diff --git a/ai-review/627.md b/ai-review/627.md new file mode 100644 index 0000000000..45bd218931 --- /dev/null +++ b/ai-review/627.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 627 + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`cliqueNumber627`** is identical to `Erdos778.cliqueNumber` in `FormalConjectures/ErdosProblems/778.lean:61–62`. Both define `sSup {k : ℕ | ¬G.CliqueFree k}`. These should be unified into a shared utility. + +- **Mathlib's `SimpleGraph.cliqueNum`** (in `Mathlib.Combinatorics.SimpleGraph.Clique`) is defined as `sSup {n | ∃ s, G.IsNClique n s}`, which is mathematically equivalent since `¬G.CliqueFree k ↔ ∃ s, G.IsNClique k s` by definition of `CliqueFree`. This is a direct drop-in replacement. + +- **Mathlib's `SimpleGraph.chromaticNumber`** (in `Mathlib.Combinatorics.SimpleGraph.Coloring`) returns `ℕ∞` via `⨅ n ∈ setOf G.Colorable, (n : ℕ∞)`. For finite graphs on `Fin n`, the graph is always finitely colorable (identity coloring works), so `ENat.toNat G.chromaticNumber` recovers the `ℕ`-valued chromatic number. The custom `chromaticNumber627` computes `sInf {k | ∃ f : Fin n → Fin k, ∀ u v, G.Adj u v → f u ≠ f v}`, which is equivalent to `sInf {k | G.Colorable k}` since `Colorable` is `Nonempty (G.Coloring (Fin k))`. Replacing with Mathlib's definition would improve maintainability and give access to the extensive existing API. + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`** provides the notation `χ(G)` for `G.chromaticNumber` and many useful lemmas about chromatic numbers that could be leveraged. + +**Recommendation:** Replace both custom definitions with Mathlib equivalents, or at minimum extract the shared `cliqueNumber` definition with problem 778 into a utility file. + +## 2. Citations + +The website ([erdosproblems.com/627](https://www.erdosproblems.com/627)) lists the following references: + +- **[Er61d]** — Erdős (1961): Proved f(n) ≫ n^{1/2}/log n via graphs with ω(G)=2 and large chromatic number. +- **[Er67c]** — Erdős (1967): Established f(n) ≍ n/(log₂ n)² and the limit, if it exists, lies in [1/4, 4]. +- **[Er69b]** — Erdős (1969). +- **[Zy52]** — Zykov (1952): Independently proved (with Tutte) that for every k, there exists a graph with ω(G)=2 and χ(G)=k. +- **[AFM25]** — Araujo, Filipe, and Miyazaki (2025): Connected this problem to Ramsey numbers; improved the upper bound to approximately 3.7. + +The formalization's theorem docstring cites `[Er61d][Er67c][Er69b]`, which matches the core Erdős references. The module docstring mentions only `[Er67c]`. Missing from the formalization are **[Zy52]** and the recent **[AFM25]** result. While [Zy52] provides historical context, the [AFM25] result is notable as a recent advance on the problem and could be mentioned in the module docstring. + +## 3. Variants + +The problem as stated on the website is a single question: does the limit exist? The formalization captures exactly this. The website also mentions: + +- Erdős's 1967 result that f(n) ≍ n/(log₂ n)² with the limit in [1/4, 4] — this is mentioned in the module docstring but not formalized as a separate theorem. +- The Araujo–Filipe–Miyazaki (2025) improved upper bound (~3.7) — not mentioned. + +These are partial results toward the conjecture rather than variants. **No variants appear to be missing.** One could consider formalizing the known bounds (f(n) ≍ n/(log₂ n)² and L ∈ [1/4, 4] if it exists) as separate auxiliary theorems, but this is optional enrichment rather than a missing variant. + +## 4. Readability + +The code is reasonably readable. Suggestions: + +- The suffix `627` on helper definitions (`chromaticNumber627`, `cliqueNumber627`, `f627`) is a standard convention in this codebase for avoiding name collisions but reduces readability. Using Mathlib's existing `cliqueNum` and `chromaticNumber` would eliminate the need for these suffixed names entirely. +- The docstrings on the helper definitions are clear and appropriate. +- The `cliqueNumber627 G > 0` guard in `f627` correctly avoids division by zero and is self-documenting. + +## 5. Formalizability + +**High formalizability; low ambiguity.** The problem asks whether a specific real-valued limit exists. All components are precisely defined: + +- The clique number ω(G) and chromatic number χ(G) are standard graph-theoretic invariants. +- The function f(n) = max_{G on n vertices} χ(G)/ω(G) is well-defined for each n ≥ 1. +- The limit lim_{n→∞} f(n) / (n/(log₂ n)²) is a standard real analysis question. + +The only minor ambiguity is whether "graphs on n vertices" means labeled or unlabeled, but this doesn't matter since the ratio χ(G)/ω(G) is isomorphism-invariant and the formalization correctly ranges over all `SimpleGraph (Fin n)`. + +**Assessment: Unambiguous and directly formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct** with some minor observations: + +**Correct aspects:** + +- `chromaticNumber627` correctly computes the minimum number of colors for a proper coloring. The set `{k | ∃ f : Fin n → Fin k, ...}` is nonempty (contains `n`) and its infimum is the chromatic number. +- `cliqueNumber627` correctly computes the clique number. The set `{k | ¬CliqueFree k}` always contains 0 (the empty clique), is bounded above by `n` for graphs on `Fin n`, and its supremum is the clique number. +- `f627` correctly takes the supremum of χ(G)/ω(G) over all graphs with positive clique number. The set is finite (finitely many graphs on `Fin n`) and nonempty for n ≥ 1 (e.g., the complete graph has ω = n > 0). +- The `answer(sorry)` pattern correctly handles the open nature of the problem — the answer is `True` iff the limit exists. +- The limit expression `Tendsto (fun n => f627 n / (n / (logb 2 n)^2)) atTop (nhds L)` correctly formalizes the question. + +**Edge case observations (non-issues for the limit):** + +- For n = 0: `f627 0` = `sSup ∅` (no graphs on `Fin 0` with positive clique number), which is technically a junk value for `ℝ`'s `ConditionallyCompleteLinearOrder`. This does not affect the `atTop` limit. +- For n = 0 and n = 1: `Real.logb 2 n` is 0 or negative, making the denominator 0 (via Lean's `x / 0 = 0` convention). Again, irrelevant for the limit. +- The `sSup` in `f627` is over a finite nonempty set for n ≥ 1, so it equals the maximum, which is the intended semantics. + +**No mathematical flaws identified.** The formalization faithfully captures the problem statement. diff --git a/ai-review/628.md b/ai-review/628.md new file mode 100644 index 0000000000..f12d0ab31d --- /dev/null +++ b/ai-review/628.md @@ -0,0 +1,71 @@ +# AI Review: Erdős Problem 628 + +## 1. Code Reuse + +The formalization uses standard Mathlib constructs throughout: `SimpleGraph.chromaticNumber`, `SimpleGraph.CliqueFree`, `SimpleGraph.induce`, and `Disjoint` on `Set V`. No custom definitions are introduced, and none are needed — this is appropriate. + +Several sibling problems use overlapping infrastructure: +- **Problem 640** uses `(G.induce S).chromaticNumber` in the same pattern. +- **Problem 620** uses `CliqueFree` for clique-free conditions. +- **Problem 747** uses `Disjoint` on sets for vertex-disjointness. +- **FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean** provides extended chromatic number lemmas (e.g., `le_chromaticNumber_iff_colorable`, critical edge/vertex definitions) that could be useful in a proof but are not needed for the statement. + +No code from the existing codebase can replace or simplify the current statement. Problem 627 defines a custom `chromaticNumber627` for `Fin n` graphs, but Problem 628 correctly avoids this and uses Mathlib's general `chromaticNumber`. + +**Verdict:** No reuse opportunities; current usage of Mathlib API is appropriate. + +## 2. Citations + +The formalization cites: +- `[Er68b]` Erdős, P., *On chromatic number of graphs and set-systems* (1968). + +The [erdosproblems.com/628](https://www.erdosproblems.com/628) page lists additional references: +- **[BrJu69]** Brown and Jung (1969) — resolved the special case $a = b = 3$ by proving such graphs contain two vertex-disjoint odd cycles. +- **[BKPS09]** Balogh, Kostochka, Prince, and Stiebitz (2009) — proved the conjecture for quasi-line graphs and for graphs with independence number 2. +- **[So22]** Song (2022) — provides a comprehensive survey of the problem. + +**Recommendation:** Add the additional references to the module docstring for completeness, at minimum [BrJu69] since it resolves a notable special case mentioned in the literature. + +## 3. Variants + +The formalization captures only the general conjecture. The website identifies: + +- **Special case $a = b = 3$ (i.e., $k = 5$):** This was the original question Erdős posed, resolved affirmatively by Brown and Jung (1969). It could be stated as a separate (solved) theorem. +- **Terminology:** The website uses the term *$(a,b)$-splittable*, which could be mentioned in the docstring for discoverability. +- **Partial results for restricted graph classes** (quasi-line graphs, independence number 2) from [BKPS09] could also be formalized as separate theorems. + +**Recommendation:** Consider adding the Brown-Jung special case as a separate solved theorem, since it is a historically significant resolved instance. + +## 4. Readability + +The code is clean and readable. The theorem statement directly mirrors the mathematical conjecture. The docstring clearly states the problem with appropriate LaTeX. The namespace `Erdos628` is consistent with project conventions. + +Minor suggestions: +- The docstring could mention the term "$(a,b)$-splittable" for searchability. +- The hypothesis names (`hk`, `hclique`, `ha`, `hb`, `hab`) are clear and conventional. + +**Verdict:** Good readability, no significant issues. + +## 5. Formalizability + +The conjecture is precisely stated and unambiguously formalizable. All concepts involved (chromatic number, clique-freeness, induced subgraph, vertex-disjointness) have well-established formal definitions in Mathlib. There is no room for misinterpretation of the mathematical statement. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **Chromatic number type:** `G.chromaticNumber` returns `ℕ∞` in Mathlib. The hypothesis `hk : G.chromaticNumber = k` with `k : ℕ` implicitly asserts finite chromatic number via coercion `(k : ℕ∞)`. This is correct — the conjecture concerns finite chromatic number. + +- **Clique-free condition:** `G.CliqueFree k` means $G$ contains no clique of size $k$, i.e., no $K_k$. Combined with $\chi(G) = k$, this means the clique number is strictly less than the chromatic number (the "interesting" regime where $\omega(G) < \chi(G)$). This matches the conjecture. + +- **Induced subgraph equivalence:** The website says "disjoint subgraphs" while the formalization uses induced subgraphs on disjoint vertex sets. These are equivalent: any subgraph $H$ on vertex set $S$ satisfies $\chi(H) \leq \chi(G[S])$, so if vertex-disjoint subgraphs with high chromatic number exist, the induced subgraphs on those vertex sets have at least as high chromatic number. Conversely, induced subgraphs are subgraphs. So the formulation is correct. + +- **Parameter constraints:** With $a, b \geq 2$ and $a + b = k + 1$, we get $k \geq 3$. This is consistent — for $k \leq 2$, the clique-free condition is either trivially false ($k = 1$ implies $\chi(G) = 1$, so $G$ has no edges, hence is $K_1$-free which means no vertices) or yields $a + b = 3$ which contradicts $a, b \geq 2$. + +- **Chromatic number comparison:** `(G.induce S).chromaticNumber ≥ a` compares `ℕ∞` with `ℕ` (via coercion). This correctly captures "chromatic number at least $a$." + +- **No nonemptiness issues:** The existential quantification over $S$ and $T$ means any witness must be nonempty (since empty induced subgraphs have chromatic number 0, which is $< 2 \leq a$). + +**Verdict:** The formalization is correct and complete. No mathematical flaws identified. diff --git a/ai-review/629.md b/ai-review/629.md new file mode 100644 index 0000000000..baa59ca80c --- /dev/null +++ b/ai-review/629.md @@ -0,0 +1,83 @@ +# Review: Erdos Problem 629 + +## 1. Code Reuse + +**Significant duplication found.** The definitions `IsProperListColoring`, `IsChoosable`, and `listChromaticNumber` in this file are duplicated verbatim across at least four other files: + +- `FormalConjectures/ErdosProblems/630.lean` +- `FormalConjectures/ErdosProblems/631.lean` +- `FormalConjectures/ErdosProblems/753.lean` +- `FormalConjectures/ErdosProblems/799.lean` + +These definitions should be centralized into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/ListColoring.lean`) and imported by all five files. The existing file `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already provides related coloring utilities and would be a natural home. + +Additionally, `G.Colorable 2` (used on line 66 for the bipartiteness condition) aligns with Mathlib's `SimpleGraph.IsBipartite` abbreviation in `Mathlib.Combinatorics.SimpleGraph.Bipartite`. While functionally identical, using `G.IsBipartite` would improve clarity. + +## 2. Citations + +The docstring cites two references: + +- **[ERT80]** Erdos, Rubin, and Taylor — cited with full bibliographic details. Matches the website. +- **[HMT96]** Hanson, MacGillivray, and Toft — cited with full bibliographic details. Matches the website. + +**Missing citation:** The website also lists **[RaSr00] Radhakrishnan, J. and Srinivasan, A.** who proved an improved lower bound $2^k \cdot (k / \log k)^{1/2} \ll n(k)$. This result is not mentioned in the docstring and not formalized. + +## 3. Variants + +The formalization captures: +- The original lower bound $2^{k-1} < n(k)$ from [ERT80] +- The original upper bound $n(k) < k^2 \cdot 2^{k+2}$ from [ERT80] +- The exact values $n(2) = 6$ [ERT80] and $n(3) = 14$ [HMT96] + +**Missing variants from the website:** +1. **Improved lower bound** [RaSr00]: $2^k \cdot (k / \log k)^{1/2} \ll n(k)$. This is a strictly stronger result than the formalized lower bound and is a notable omission. (Note: formalizing this asymptotic bound would require defining asymptotic notation, which adds complexity.) +2. **Recursive upper bound** [HMT96]: $n(k) \leq k \cdot n(k-2) + 2^k$. This recursive bound from the same paper that proved $n(3) = 14$ is not formalized. +3. **Relationship to $m(k)$**: The website mentions $m(k) \leq n(k) \leq m(k+1)$, relating the bipartite list chromatic problem to a chromatic number 3 problem. Not formalized (and would require defining $m(k)$). + +## 4. Readability + +The code is generally well-structured and readable. + +- The three core definitions (`IsProperListColoring`, `IsChoosable`, `listChromaticNumber`) have clear docstrings and are easy to follow. +- The `erdos629_n` definition is concise and well-documented. +- Theorem names follow a consistent convention (`erdos_629`, `erdos_629.variants.*`). +- Minor suggestion: the namespace `Erdos629` keeps definitions local, which is good for avoiding name clashes but contributes to the duplication problem noted in section 1. + +## 5. Formalizability + +**High formalizability.** The problem statement is precise and unambiguous. All key concepts — bipartite graph, list chromatic number, minimum vertex count — have clear combinatorial definitions that translate directly into Lean. + +The only source of mild ambiguity is the phrase "determine $n(k)$", which is inherently open-ended (it asks for an exact characterization). The formalization wisely sidesteps this by encoding specific known bounds and values rather than trying to formalize the open question itself. + +The asymptotic bound from [RaSr00] ($\ll$ notation) would be harder to formalize precisely due to the need for asymptotic framework, but the other missing variants (recursive bound, exact values) are straightforwardly formalizable. + +## 6. Correctness + +**The formalization is mathematically correct**, with the following observations: + +**Definitions are sound:** +- `IsProperListColoring` correctly requires both list membership and proper coloring (no adjacent vertices share a color). +- `IsChoosable` correctly universally quantifies over all list assignments with lists of size $\geq k$. +- Using $\mathbb{N}$ as the color set is without loss of generality since it is countably infinite and any finite list coloring can be embedded in $\mathbb{N}$. +- `listChromaticNumber` via `sInf` is correct for finite graphs (which is the only context where it is used, via `Fin n`). Note: for the empty graph on `Fin 0`, `sInf` would return 0 since `IsChoosable` holds vacuously for all $k$; this is arguably correct (the empty graph needs 0 colors). +- `erdos629_n` correctly computes the infimum over vertex counts of bipartite graphs exceeding choosability $k$. + +**Bound statements are correct:** +- The condition `hk : k >= 1` on both bounds is necessary: for $k = 0$, the lower bound would require $2^{0-1} < n(0)$, but in $\mathbb{N}$ arithmetic, $0 - 1 = 0$ so this becomes $1 < n(0)$, while $n(0) = 1$ (a single vertex suffices), making the bound false. The guard is correctly placed. +- The strict inequalities match the published results. +- The exact values $n(2) = 6$ and $n(3) = 14$ match the literature. + +**Category tags:** All four theorems are tagged `category research solved`, which is accurate — these are individually proved results. The overall problem of determining $n(k)$ exactly remains open per the website, but the formalization correctly focuses on the known results rather than the open determination question. + +**No mathematical errors identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication across 5 files; centralization recommended | +| Citations | Two of three website references present; [RaSr00] missing | +| Variants | Core bounds captured; three additional results from website omitted | +| Readability | Good | +| Formalizability | High; statement is precise and unambiguous | +| Correctness | Correct and complete for the results it formalizes | diff --git a/ai-review/63.md b/ai-review/63.md new file mode 100644 index 0000000000..b3fd931764 --- /dev/null +++ b/ai-review/63.md @@ -0,0 +1,92 @@ +# Review: Erdős Problem 63 + +## 1. Code Reuse + +No additional code from `FormalConjecturesForMathlib` is needed. The formalization uses only standard Mathlib API: +- `SimpleGraph.chromaticNumber` for chromatic number +- `SimpleGraph.Walk` / `Walk.IsCycle` / `Walk.length` for cycle containment + +The cycle-existence pattern `∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = ...` is the established idiom across the codebase (problems 57, 58, 64, 71, etc.). The infinite chromatic number encoding `G.chromaticNumber = ⊤` matches problems 57 and 62. No refactoring opportunities here. + +## 2. Citations + +The formalization includes: +- `[Er93,Er94b,Er95,Er95d,Er96,Er97b]` — listed as "Various papers by Erdős" +- `[LiMo20]` — Liu, H. and Montgomery, R., *A solution to Erdős and Hajnal's odd cycle problem*, 2020. + +**Missing from the website:** +- `[ErHa66]` — Erdős, P. and Hajnal, A. (cited on the website in context of David Penman's observation about uncountable chromatic number) +- `[dBEr51]` — de Bruijn-Erdős theorem (cited on the website in Zach Hunter's argument showing the conjecture follows from Liu-Montgomery) +- `[Re24]` — Reiher, Theorem 3.17 (cited on the website) + +**Specific page reference missing:** The website cites `[Er93, p.342]` with the specific page number; the formalization just says `[Er93]`. + +**Recommendation:** Add `[ErHa66]` since it is relevant to the problem's intellectual lineage. The `[dBEr51]` and `[Re24]` references are about the proof technique rather than the problem statement, so omitting them is defensible. Add the page number to the `[Er93]` reference. + +## 3. Variants + +**Missing variant:** The website notes that $2^n$ could potentially be replaced by any sufficiently rapidly growing sequence (such as perfect squares). This generalization is not captured in the formalization. + +A variant could look like: +```lean +/-- Variant: Can 2^n be replaced by n^2 (or any sufficiently rapidly growing sequence)? -/ +theorem erdos_63.variants.squares : answer(sorry) ↔ + ∀ (V : Type*) (G : SimpleGraph V), + G.chromaticNumber = ⊤ → + ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n ^ 2 := by + sorry +``` + +**Cross-reference:** The website says "See also Problem #64" (finite graphs with min degree ≥ 3 containing a cycle of length $2^k$). This cross-reference is not mentioned in the docstring. Consider adding a note. + +## 4. Readability + +The code is clean and follows established conventions. Specific observations: + +- **Good:** The docstring explains the formalization of "infinitely many $n$" as `∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ ...`, which is helpful for readers unfamiliar with this encoding. +- **Good:** The `answer(True)` wrapper correctly signals this is a solved problem with affirmative answer. +- **Minor:** The module docstring says "Proved by Liu and Montgomery [LiMo20]" but the docstring on the theorem says "Conjectured by Mihók and Erdős" — having both attribution and resolution in the theorem docstring is good practice and is done here. +- **No issues** with naming, indentation, or structure. + +## 5. Formalizability + +**Assessment: Unambiguous and straightforward.** + +Every component of the informal statement has a direct formal counterpart: + +| Informal | Formal | +|----------|--------| +| "graph" | `SimpleGraph V` | +| "infinite chromatic number" | `G.chromaticNumber = ⊤` | +| "contains a cycle of length $2^n$" | `∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = 2 ^ n` | +| "for infinitely many $n$" | `∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ ...` | + +There is essentially no ambiguity in the problem statement. The only minor interpretive question is whether "graph" means finite or infinite graphs; the formalization allows both (no `[Fintype V]` constraint), which is the correct reading for this problem since infinite chromatic number is the hypothesis. Contrast with Problem 64, which explicitly restricts to finite graphs. + +## 6. Correctness + +**Assessment: Correct and complete.** + +- **`chromaticNumber = ⊤`:** In Mathlib, `SimpleGraph.chromaticNumber` has type `ℕ∞` (i.e., `WithTop ℕ`), so `= ⊤` correctly represents infinite chromatic number. This is consistent with usage in problems 57 and 62. + +- **Cycle encoding:** The pattern `∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = 2 ^ n` correctly encodes "G contains a cycle of length $2^n$." Note that `IsCycle` in Mathlib requires the walk to be non-trivial (length ≥ 1), visit no vertex twice (except the start/end), and traverse no edge twice. In a `SimpleGraph` (no multi-edges, no self-loops), cycles must have length ≥ 3. This means cycles of length $2^0 = 1$ and $2^1 = 2$ cannot exist, but this is harmless: the statement asserts existence for infinitely many $n$, so the relevant values are $n \geq 2$ (giving lengths 4, 8, 16, ...). + +- **"Infinitely many" encoding:** `∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ ...` is the standard formalization of "the set $\{n \in \mathbb{N} \mid P(n)\}$ is infinite," equivalent to the set being cofinal in $\mathbb{N}$. This is correct. + +- **`answer(True)`:** The problem was proved affirmatively by Liu and Montgomery (2020). The `answer(True)` is correct. + +- **Universal quantification over `V : Type*`:** The statement quantifies over all types `V` and all simple graphs on `V`. This is the standard universe-polymorphic encoding and is correct. + +**No mathematical flaws identified.** The formalization faithfully captures the original problem. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ Good | Uses standard idioms; no reuse opportunities missed | +| Citations | ⚠️ Minor gaps | Missing `[ErHa66]`, page ref for `[Er93]` | +| Variants | ⚠️ Missing | Rapidly growing sequence variant not captured | +| Readability | ✅ Good | Clear, well-documented | +| Formalizability | ✅ Excellent | Unambiguous statement | +| Correctness | ✅ Correct | Mathematically faithful formalization | diff --git a/ai-review/630.md b/ai-review/630.md new file mode 100644 index 0000000000..8034a7436c --- /dev/null +++ b/ai-review/630.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 630 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsProperListColoring`, `IsChoosable`, and `listChromaticNumber` are duplicated verbatim across at least five files: + +- `ErdosProblems/629.lean` +- `ErdosProblems/630.lean` +- `ErdosProblems/631.lean` +- `ErdosProblems/753.lean` +- `ErdosProblems/799.lean` + +Similarly, `IsPlanar` (as an opaque predicate) is duplicated across `630.lean`, `631.lean`, `1018.lean`, and `1019.lean`. + +Each file places these definitions in its own namespace (e.g., `Erdos630`), which avoids name clashes but prevents cross-file reuse. These definitions could be consolidated into a shared utility file (e.g., under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`). + +Additionally, `listChromaticNumber` is defined in `630.lean` but never used — the theorem statement uses `IsChoosable G 3` directly, which is equivalent to stating χ_L(G) ≤ 3. The unused definition could be removed. + +No existing definitions in `FormalConjecturesForMathlib` cover list coloring or choosability; Mathlib itself does not yet have these concepts, so the custom definitions are necessary. + +## 2. Citations + +The formalization references two papers: + +- **[ERT80]** Erdős, P., Rubin, A. L., and Taylor, H., *Choosability in graphs*. Proceedings of the West Coast Conference on Combinatorics, Graph Theory and Computing (1980). +- **[AlTa92]** Alon, N. and Tarsi, M., *Colorings and orientations of graphs*. Combinatorica 12 (1992), 125-134. + +The website (erdosproblems.com/630) confirms these are the correct references: the problem was posed in [ERT80] and solved affirmatively by Alon and Tarsi. The citations are consistent with the website. The website also references Problem 631 as a related problem. + +Minor note: The [ERT80] citation in `630.lean` omits some publication details present in the more complete citation in `629.lean` (which includes "Congressus Numerantium XXVI" and page numbers "125–157"). Consider using the fuller citation for consistency. + +## 3. Variants + +The formalization captures the main result (every planar bipartite graph is 3-choosable) as a single theorem. The website does not list additional sub-problems or variants for Problem 630 specifically. + +Problem 631 (every planar graph is 5-choosable) is the natural generalization that drops the bipartite hypothesis, and it is formalized separately in `631.lean`, which is appropriate. + +One could consider adding a tightness variant (existence of a planar bipartite graph that is not 2-choosable), which would show that 3 is best possible. This is known — e.g., the complete bipartite graph K_{2,4} is planar and bipartite but not 2-choosable. However, this is not stated on the website as part of Problem 630, so its omission is defensible. + +**No missing variants relative to the website.** + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The docstrings clearly explain `IsProperListColoring`, `IsChoosable`, and `listChromaticNumber` with LaTeX-style mathematical notation. +- The `IsPlanar` opaque predicate is clearly documented as a placeholder for a missing Mathlib formalization. +- The theorem statement `erdos_630` is clean and directly readable. +- The unused `listChromaticNumber` definition is minor clutter; removing it would slightly improve clarity since the theorem does not reference it. +- Using `G.Colorable 2` for bipartiteness is mathematically correct but less immediately legible than `G.IsBipartite` (which exists in Mathlib). Either is acceptable; `Colorable 2` has the advantage of staying in the coloring language of the problem. + +## 5. Formalizability + +**High formalizability.** The problem statement — "Is every planar bipartite graph 3-choosable?" — is precise and unambiguous. The key concepts (planar graph, bipartite graph, list chromatic number / choosability) all have standard mathematical definitions. + +The only source of formalization difficulty is **planarity**, which lacks a Mathlib definition and is axiomatized here as an opaque predicate. This is the standard approach in the codebase and is appropriate: the theorem statement is meaningful modulo any future definition of planarity that satisfies expected properties. + +**Ambiguity assessment: Very low.** The statement admits no reasonable alternative interpretation. + +## 6. Correctness + +The formalization is **mathematically correct**. + +- **Bipartiteness via `G.Colorable 2`**: This is equivalent to the standard definition of bipartiteness (a graph whose vertex set can be partitioned into two independent sets). For simple graphs, 2-colorability and bipartiteness are equivalent. ✓ +- **Choosability via `IsChoosable G 3`**: The definition correctly quantifies over all list assignments L where every vertex gets a list of size ≥ 3, and requires the existence of a proper coloring from those lists. This matches the standard definition of 3-choosability. ✓ +- **Conclusion `IsChoosable G 3` vs `listChromaticNumber G ≤ 3`**: These are equivalent, and using `IsChoosable` directly avoids an unnecessary `sInf` indirection. ✓ +- **`IsPlanar` as opaque predicate**: Since planarity is not formalized in Mathlib, using an opaque predicate is the correct approach. The theorem will become provable once a concrete definition is provided and the Alon-Tarsi theorem is formalized. ✓ +- **Universe / type constraints**: The theorem is stated for `{V : Type*} [Fintype V]`, restricting to finite graphs. This is appropriate since planarity is typically discussed for finite graphs, and the `IsPlanar` predicate already requires `[Fintype V]`. ✓ +- **`[DecidableEq V]` omission**: Problem 630 does not require `[DecidableEq V]` (unlike 631, which includes it). This is fine since neither `IsChoosable` nor the hypotheses need decidable equality. ✓ + +**No mathematical errors or incompleteness identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication with 629, 631, 753, 799; consolidation recommended | +| Citations | Correct and consistent with website; minor formatting differences vs. 629 | +| Variants | Complete relative to website | +| Readability | Good; unused `listChromaticNumber` is minor clutter | +| Formalizability | High; only planarity requires an opaque predicate | +| Correctness | Correct and complete | diff --git a/ai-review/631.md b/ai-review/631.md new file mode 100644 index 0000000000..1525baf997 --- /dev/null +++ b/ai-review/631.md @@ -0,0 +1,92 @@ +# Review of Erdős Problem 631 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsProperListColoring`, `IsChoosable`, and `IsPlanar` are independently redefined in Erdős Problems 629, 630, 631, and 632 — four separate files with near-identical copies. These should be extracted to a shared module (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/ListColoring.lean`). + +- `IsProperListColoring` is verbatim identical across all four files. +- `IsChoosable` is verbatim identical across 629, 630, and 631 (632 generalizes to `IsABChoosable`). +- `IsPlanar` is verbatim identical in 630 and 631. + +The existing `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides chromatic number utilities, critical edge/vertex definitions, and coloring-related lemmas, but does not address list coloring. A natural home for the shared list coloring definitions would be alongside this file. + +**Recommendation:** Extract `IsProperListColoring`, `IsChoosable`, and `IsPlanar` into a shared utility and import them in 629–632. + +## 2. Citations + +The website (https://www.erdosproblems.com/631) lists the following references: + +- **[ERT80]** Erdős, Rubin, and Taylor — original problem formulation. +- **[Th94]** Thomassen — proved χ_L(G) ≤ 5 for planar graphs. +- **[Vo93]** Voigt — constructed a planar graph with χ_L(G) = 5. +- **[Gu96]** Gutner — provided a simpler construction of a planar graph with χ_L(G) = 5. + +The formalization's docstring includes [ERT80], [Th94], and [Vo93] with full bibliographic details. **Missing: [Gu96]** (Gutner's simpler construction). While this omission is minor (Gutner's result is the same as Voigt's, just a simpler proof), completeness would be improved by including it, especially since the website lists it. + +The existing citation formatting is good — full author names, paper titles, journal names, and years are provided, matching the website's content. + +## 3. Variants + +The original problem asks two questions: + +1. "Does every planar graph G have χ_L(G) ≤ 5?" +2. "Is this best possible?" + +The formalization captures both: + +- `erdos_631` — Thomassen's theorem: every planar graph is 5-choosable (question 1). +- `erdos_631.variants.tight` — Voigt's construction: there exists a planar graph that is not 4-choosable (question 2). + +**All variants from the problem statement are captured.** No additional variants are mentioned on the website. + +## 4. Readability + +The code is generally readable. A few observations: + +- **Docstrings are clear** and correctly describe the mathematical content. +- **The `answer(True) ↔` pattern** in `erdos_631` is somewhat unusual compared to `erdos_630`, which directly states the theorem without wrapping. Since both are solved problems, consistency would improve readability. Problem 630 directly states `theorem erdos_630 ... : IsChoosable G 3`, while 631 wraps it in `answer(True) ↔ ∀ ...`. The direct style (as in 630) is arguably cleaner for solved results. +- **The `DecidableEq V` instance** in `erdos_631` is not obviously needed. `IsProperListColoring` uses `∈` on `Finset ℕ` (which has `DecidableEq` built in) and `≠` on `ℕ`. It may be an artifact; if unnecessary, removing it would reduce clutter. +- **Naming** follows conventions well: `erdos_631` for the main result, `erdos_631.variants.tight` for the tightness result. + +## 5. Formalizability + +**Assessment: Partially formalizable with a key gap.** + +The core definitions (`IsProperListColoring`, `IsChoosable`) are fully precise and directly formalizable. The mathematical content — list coloring, choosability — is well-defined and unambiguous. + +The **critical gap** is `IsPlanar`, which is declared as an `opaque` predicate. This is acknowledged in the docstring ("Mathlib does not yet have a formalization of graph planarity"). This means: + +- The statements are well-typed and meaningful, but neither `erdos_631` nor `erdos_631.variants.tight` can be *proved* in Lean without a concrete definition of planarity. +- The `opaque` declaration prevents unfolding, so any proof would need to work purely through the interface of `IsPlanar` — which currently has no axioms or lemmas attached. +- This is a reasonable engineering choice for a conjecture-tracking repository. It clearly marks the dependency on an unformalized concept. + +**Ambiguity: Low.** The problem statement is precise. "Planar graph" and "list chromatic number" are standard, well-defined concepts. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed assessment: + +- **`IsProperListColoring`**: Correctly requires (1) each vertex is colored from its list, and (2) adjacent vertices receive distinct colors. This is the standard definition. + +- **`IsChoosable G k`**: Correctly states that for *every* list assignment where each list has at least *k* colors, a proper list coloring exists. This is equivalent to χ_L(G) ≤ k. Note: using `ℕ` as the color type is fine — any finite set of colors can be embedded into `ℕ`, so this is without loss of generality. + +- **`erdos_631` (Thomassen's theorem)**: The statement `∀ (V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V), IsPlanar G → IsChoosable G 5` correctly formalizes "every planar graph is 5-choosable." The restriction to `Fintype V` is appropriate since planar graphs are finite (or at least the theorem is about finite planar graphs). + +- **`erdos_631.variants.tight` (Voigt's construction)**: The statement `∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), IsPlanar G ∧ ¬IsChoosable G 4` correctly formalizes "there exists a planar graph that is not 4-choosable." Using `Type` (universe 0) rather than `Type*` for the existential is fine and avoids universe polymorphism complications. + +- **`answer(True)` wrapper**: Both theorems use `answer(True) ↔ ...`. This is appropriate since both questions were answered affirmatively (the answer to "is every planar graph 5-choosable?" is True, and the answer to "is 5 best possible?" is also True). + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on the website. + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Significant duplication with 629, 630, 632; extract shared defs | +| Citations | [Gu96] missing; others are complete and well-formatted | +| Variants | All captured | +| Readability | Good; minor style inconsistency with `answer(True)` pattern | +| Formalizability | Well-defined modulo opaque `IsPlanar`; low ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/632.md b/ai-review/632.md new file mode 100644 index 0000000000..7fe844da10 --- /dev/null +++ b/ai-review/632.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 632 + +## 1. Code Reuse + +**Moderate opportunity for consolidation.** The definition `IsABChoosable` in 632.lean is a generalization of k-choosability (the `b=1` case recovers standard choosability). The closely related files 629, 630, 631, 753, and 799 all independently define `IsChoosable` and/or `IsProperListColoring` with identical or near-identical implementations. While 632's `IsABChoosable` is strictly more general, these definitions have not been consolidated into a shared utility (e.g., a `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/ListColoring.lean`). + +No existing utility in `FormalConjecturesForMathlib/` covers (a,b)-choosability — the definition in 632.lean is unique to this file and appropriately so, since it's a specialized concept. The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` file provides extended Mathlib coloring infrastructure (critical edges, chromatic number lemmas, etc.) but nothing for list coloring or choosability. + +**Recommendation:** No immediate reuse opportunity for 632 itself, but if a shared `ListColoring.lean` is created in the future, `IsABChoosable` could be defined there and 632 could import it. + +## 2. Citations + +The file references two papers: + +- **[ERT80]** Erdős, P., Rubin, A.L., and Taylor, H., *Choosability in graphs*, Proceedings of the West Coast Conference on Combinatorics, Graph Theory and Computing, Congressus Numerantium 26 (1980), 125–157. +- **[DHS19]** Dvořák, Z., Hu, X., and Sereni, J.-S., *A 4-choosable graph that is not (8:2)-choosable*, Advances in Combinatorics (2019). + +These match the information on [erdosproblems.com/632](https://www.erdosproblems.com/632), which lists the problem as originating from [ERT80] and disproved by Dvořák, Hu, and Sereni. The citation format is consistent with other files in the codebase (e.g., 631.lean uses the same [ERT80] reference with slightly different venue wording — "Humboldt State Univ., Arcata, Calif." vs. "Congressus Numerantium 26" — both are acceptable descriptions of the same proceedings). + +**No issues found.** + +## 3. Variants + +The website describes only a single conjecture: (a,b)-choosability implies (am,bm)-choosability for all m ≥ 1. The formalization captures exactly this statement. The website mentions the connection that (a,1)-choosability corresponds to standard a-choosability (list chromatic number ≤ a), but this is an observation about the definition rather than a separate variant. + +One possible variant not captured: the website notes the specific counterexample parameters (a graph that is (4,1)-choosable but not (8,2)-choosable). This could be stated as an explicit existential variant, e.g.: + +```lean +theorem erdos_632.variants.counterexample : answer(True) ↔ + ∃ (V : Type) (_ : Fintype V) (G : SimpleGraph V), + IsABChoosable G 4 1 ∧ ¬IsABChoosable G 8 2 +``` + +This would make the specific counterexample result independently statable, following the pattern used in 631.lean where Voigt's construction is a separate `erdos_631.variants.tight` theorem. However, this is a minor enhancement — the main theorem already implies the existence of such a counterexample. + +**Minor gap:** The specific counterexample could be stated as an explicit variant. + +## 4. Readability + +The code is clean and well-structured: + +- The `IsABChoosable` definition has a clear docstring explaining the concept. +- The theorem docstring correctly states the conjecture and attributes it to [ERT80], noting the disproof by [DHS19]. +- The namespace `Erdos632` is appropriate. +- Variable names (`L` for list assignment, `S` for selected subsets, `u`/`v` for vertices) follow standard graph theory conventions. + +**No issues found.** The code is readable and follows codebase conventions. + +## 5. Formalizability + +The problem is **fully formalizable with no ambiguity**. The concept of (a,b)-choosability has a precise combinatorial definition: + +- Lists of colors assigned to vertices (modeled as `V → Finset ℕ`) +- Size constraints on lists (`a ≤ card`) +- Selection of subsets of prescribed size (`card = b`) +- Disjointness condition on adjacent vertices + +All of these are standard Finset operations with well-defined semantics. The universal quantification over graphs, parameters, and the multiplier m is straightforward. + +**Assessment: No ambiguity.** The conjecture as stated on erdosproblems.com translates directly and unambiguously into the formal statement. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +### Definition of `IsABChoosable` + +```lean +def IsABChoosable {V : Type*} (G : SimpleGraph V) (a b : ℕ) : Prop := + ∀ L : V → Finset ℕ, (∀ v, a ≤ (L v).card) → + ∃ S : V → Finset ℕ, (∀ v, S v ⊆ L v) ∧ (∀ v, (S v).card = b) ∧ + (∀ u v, G.Adj u v → Disjoint (S u) (S v)) +``` + +This correctly captures the standard definition: for every list assignment with lists of size ≥ a, there exists a selection of b-element subsets from each list such that adjacent vertices receive disjoint subsets. The three conjuncts — subset inclusion, cardinality, and disjointness — are exactly what's needed. + +**Verified:** When b = 1, this reduces to standard list colorability (disjoint singletons ⟺ distinct colors), consistent with the literature. + +### Theorem statement + +```lean +theorem erdos_632 : answer(False) ↔ ∀ (V : Type*) (G : SimpleGraph V) (a b m : ℕ), + 1 ≤ m → IsABChoosable G a b → IsABChoosable G (a * m) (b * m) +``` + +- `answer(False)` correctly encodes that the conjecture is **disproved** (the answer is "no"). +- The `↔` means `False ↔ (conjecture)`, so the conjecture is false — matching the disproof by Dvořák, Hu, and Sereni. +- The condition `1 ≤ m` correctly excludes the degenerate case m = 0 (where (0,0)-choosability would be trivially true but meaningless). +- The quantification over all `V : Type*` (universe-polymorphic, no finiteness constraint) is acceptable: the counterexample uses a finite graph, and the universal statement over all graphs (including infinite ones) is at least as strong as the finite case. + +**Edge cases verified:** +- **b = 0:** (a,0)-choosable is always true (empty subsets are always disjoint), and (am,0)-choosable is also always true, so the implication holds trivially. No issue. +- **a = 0, b > 0:** (0,b)-choosable is false for nonempty graphs (can't pick b elements from a possibly empty list), so the implication holds vacuously. No issue. +- **b > a:** (a,b)-choosable is false (can't pick b elements from a list of size a), so the implication holds vacuously. No issue. + +### Missing constraints + +The formalization does **not** require `b ≤ a` or `1 ≤ b`, which the standard formulation often assumes. However, as shown above, all degenerate cases are handled correctly (vacuous or trivial truth), so this is not a mathematical error — just a stylistic choice to avoid unnecessary hypotheses. + +**Verdict: Correct and complete.** No mathematical flaws identified. The formalization faithfully represents the disproved conjecture from [ERT80] and is consistent with the counterexample of [DHS19]. diff --git a/ai-review/633.md b/ai-review/633.md new file mode 100644 index 0000000000..c5a03d42ff --- /dev/null +++ b/ai-review/633.md @@ -0,0 +1,94 @@ +# Review: Erdos Problem 633 + +## 1. Code Reuse + +**Significant duplication exists.** Problems 633 and 634 share *verbatim identical* definitions for all six core building blocks: +- `sqDist` (633:39 = 634:33) +- `sideLengthsSq` (633:44 = 634:38) +- `NonDegenerate` (633:48 = 634:42) +- `triangleRegion` (633:54 = 634:48) +- `triangleInterior` (633:61 = 634:55) +- `CanDissectInto` (633:69 = 634:63) + +Problem 173 also duplicates `sqDist` (as `euclideanDistSq`), `sideLengthsSq` (as `triangleSideSqs`), and `NonDegenerate` (as `TriangleNonDegenerate`). Problem 898 has yet another copy (`sqDist898`, `NonDegenerate898`). + +These definitions should be extracted into a shared utility file (e.g., `FormalConjectures/Util/TriangleGeometry.lean`) and imported by all four problems. The current duplication creates maintenance burden and risks divergence. + +## 2. Citations + +The website (erdosproblems.com/633) distinguishes three references from Soifer's book: +- **[So09c]** — Original report of Erdos's question +- **[So09b]** — Proof that triangles with integrally independent sides/angles can only be cut into square numbers +- **[So09]** — Results on similarity-based cuts + +The formalization uses only **[So09]** uniformly. Since all three refer to the same book (*The Mathematical Coloring Book*, Springer, 2009), this is acceptable, but it would be more precise to use the website's finer-grained citation keys (e.g., `[So09b]` for the `soifer` theorem and `[So09c]` for the `existence` variant). + +The website also notes a **$25 reward** for the problem and mentions the related **Problem #634**. The docstring does not mention Problem 634; a cross-reference would be helpful given the shared definitions. + +## 3. Variants + +The formalization captures all the main variants from the website: +- **Square dissection** (`erdos_633.variants.square_dissection`): Any triangle → n² pieces. Matches website. ✓ +- **Existence** (`erdos_633.variants.existence`): Some triangle only admits square dissections. Matches website. ✓ +- **Soifer's theorem** (`erdos_633.variants.soifer`): Integrally independent sides+angles → only square dissections. Matches website. ✓ +- **Main open problem** (`erdos_633`): Full classification. Matches website. ✓ + +**One variant is absent:** The website mentions a result about *similarity* (as opposed to congruence): "Every triangle can be cut into n similar triangles when n ≠ 2, 3, 5, and some triangle exists that cannot be cut into 2, 3, or 5 similar triangles." This is arguably a distinct problem direction and its omission is reasonable, but including it would give a more complete picture. + +## 4. Readability + +The code is well-structured and well-documented. A few observations: + +- **Docstrings are clear** and each definition has a helpful mathematical explanation. +- The nested tuple type `(ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ)` with projections `.1`, `.2.1`, `.2.2` is syntactically heavy throughout `CanDissectInto` and the main theorem. A type alias (e.g., `abbrev Triangle := (ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ)`) or a structure with named fields (e.g., `structure Triangle where A B C : ℝ × ℝ`) would improve readability. +- The `V i` projections `(V i).1`, `(V i).2.1`, `(V i).2.2` appear many times and are hard to parse at a glance. A local pattern match or destructuring would help. +- The namespace `Erdos633` properly scopes all local definitions. + +## 5. Formalizability + +**Mostly formalizable, with one inherent difficulty.** + +The solved variants (square dissection, existence, Soifer's theorem) are precisely stated and clearly formalizable. The definitions of `IntIndepSides`, `IntIndepAngles`, `CanDissectInto`, etc., are all concrete and unambiguous. + +The main open problem asks to "classify" triangles with a given property. This is formalized as computing the exact set: +```lean +{T : (ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ) | NonDegenerate T.1 T.2.1 T.2.2 ∧ ...} = answer(sorry) +``` +Classification problems are inherently vague about what form the answer should take. The `answer(sorry)` approach is the standard convention in this codebase for open problems, so this is acceptable. However, a "classification" in mathematical practice typically means a human-readable characterization (e.g., "exactly those triangles with integrally independent sides and angles"), not an extensional set description. The formalization captures the extensional content correctly; the intensional "classification" aspect is necessarily informal. + +**Ambiguity level: Low.** The constituent definitions are all precise. The only ambiguity is in what constitutes a "classification," which is a meta-mathematical question. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed assessment: + +- **SSS congruence via squared side length multisets:** For non-degenerate triangles in ℝ², equal multisets of squared side lengths iff the triangles are congruent (related by an isometry, including reflections). This is the standard SSS criterion. ✓ + +- **`NonDegenerate`:** Uses the cross-product determinant test for collinearity. Correct. ✓ + +- **`triangleRegion` and `triangleInterior`:** Barycentric coordinate characterizations of the closed convex hull and open interior. Standard and correct. ✓ + +- **`CanDissectInto`:** The five conditions (non-degeneracy, congruence, containment, disjoint interiors, coverage) correctly formalize "dissection into n congruent triangles." The coverage + disjoint interiors together give a valid tiling where overlaps occur only on boundaries. ✓ + +- **`IntIndepSides`:** No nontrivial ℤ-linear combination of the three side lengths vanishes. Standard definition of integral (linear) independence. ✓ + +- **`IntIndepAngles`:** The condition `a₁α + a₂β + a₃γ = kπ → a₁ = a₂ = a₃` correctly captures integral independence of the angles modulo the constraint α + β + γ = π. The trivial relation (all coefficients equal) is exactly the one arising from that constraint. This matches Soifer's definition. ✓ + +- **`angle` function:** Uses arccos of the normalized dot product of edge vectors emanating from the vertex. Returns values in [0, π]. For non-degenerate triangles, this gives the correct interior angle. ✓ + +- **Main theorem `erdos_633`:** Defines the set of all embedded non-degenerate triangles in ℝ² that can only be dissected into perfect-square numbers of congruent triangles. This set is closed under isometries (since all constituent definitions are isometry-invariant), so it correctly encodes congruence classes even though it works with specific embeddings. ✓ + +**One minor observation:** The main theorem works with concrete point triples rather than congruence classes. Two congruent triangles placed at different positions are distinct elements of the set. This is standard in formal geometry but means the "classification" answer would need to be a set closed under isometries. Not a correctness issue, but worth noting. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication with Problems 634, 173, 898. Should extract shared definitions. | +| Citations | Acceptable but could use finer-grained citation keys [So09b], [So09c] per the website. | +| Variants | All major variants captured. Similarity variant omitted (reasonable). | +| Readability | Good overall. Tuple projections are heavy; a type alias or structure would help. | +| Formalizability | High. Only inherent vagueness is what "classify" means. | +| Correctness | Correct. No mathematical flaws found. | diff --git a/ai-review/634.md b/ai-review/634.md new file mode 100644 index 0000000000..04d0142235 --- /dev/null +++ b/ai-review/634.md @@ -0,0 +1,140 @@ +# AI Review: Erdős Problem 634 + +**File:** `FormalConjectures/ErdosProblems/634.lean` +**Problem:** Find all $n$ such that some triangle can be cut into $n$ congruent triangles. + +--- + +## 1. Code Reuse + +**Significant duplication exists.** The file defines `sqDist`, `sideLengthsSq`, `NonDegenerate`, `triangleRegion`, and `triangleInterior` from scratch. These same definitions (or near-identical variants) appear in at least three other Erdős problems: + +- `ErdosProblems/633.lean` — identical `sqDist`, `sideLengthsSq`, `NonDegenerate`, `triangleRegion`, `triangleInterior` +- `ErdosProblems/353.lean` — identical `sqDist`, `NonDegenerate` +- `ErdosProblems/898.lean` — `sqDist898`, `InInterior898` (same logic, different names) + +**Mathlib alternatives available:** + +| Custom definition | Mathlib replacement | +|---|---| +| `sqDist` | `dist` from `Mathlib.Topology.MetricSpace` (or `inner_self` for squared) | +| `NonDegenerate` | `AffineIndependent` from `Mathlib.LinearAlgebra.AffineSpace.Independent` | +| `triangleRegion` | `convexHull ℝ {A, B, C}` from `Mathlib.Analysis.Convex.Hull` (already used in `FormalConjecturesForMathlib/Geometry/2d.lean`) | +| `triangleInterior` | Interior characterization via strictly positive barycentric coordinates in `Mathlib.Analysis.Normed.Affine.AddTorsorBases` | + +`FormalConjecturesForMathlib/Geometry/2d.lean` already imports the relevant Mathlib modules and defines `ConvexIndep`, `IsConvexPolygon`, `triangle_area`, and `IsIsosceles` using Mathlib primitives. A shared utility file for triangle geometry would eliminate the quadruplication. + +**Recommendation:** Extract shared triangle primitives (`sqDist`, `NonDegenerate`, `triangleRegion`, `triangleInterior`, `sideLengthsSq`) into a common utility, or refactor to use Mathlib's `convexHull` and `AffineIndependent`. + +--- + +## 2. Citations + +**Website (erdosproblems.com/634) lists:** +- Soifer, A., *The Mathematical Coloring Book*, Springer, 2009. — **[So09c]** ✅ Cited in the file. +- Beeson, Michael — proved $n = 7$ and $n = 11$ are impossible. ✅ Mentioned in variant docstrings but not as a formal reference tag. +- Zhang [Zh25] — recent (2025) progress on $n^2 ab$ forms. ❌ **Not mentioned** in the formalization. +- The website notes a **$25 prize** for the problem. Not mentioned (minor). + +**Recommendation:** Add `[Zh25]` reference for Zhang's work, and consider adding a formal citation tag for Beeson's results alongside the docstring mentions. + +--- + +## 3. Variants + +**Captured variants:** +- ✅ Perfect squares $n^2$ (`erdos_634.variants.squares`) +- ✅ $2n^2$ (`erdos_634.variants.two_squares`) +- ✅ $3n^2$ (`erdos_634.variants.three_squares`) +- ✅ $6n^2$ (`erdos_634.variants.six_squares`) +- ✅ $n^2 + m^2$ (`erdos_634.variants.sum_of_squares`) +- ✅ $\neg 7$ (`erdos_634.variants.not_seven`) +- ✅ $\neg 11$ (`erdos_634.variants.not_eleven`) + +**Missing variants from the website:** +- ❌ **Zhang's $n^2 ab$ form:** For integers $a \geq b$, if $n \geq 3\lceil(a^2 + b^2 + ab - a - b)/(ab)\rceil$, then $n^2 ab$ admits a dissection. +- ❌ **Similarity variant (Soifer):** Every triangle can be cut into $N$ *similar* (not necessarily congruent) triangles for all $N \neq 2, 3, 5$. +- ❌ **Similar-to-original variant (Snover, Waiveris, Williams):** If the smaller triangles must be similar to the *original* triangle, only $n^2$, $n^2 + m^2$, and $3n^2$ are possible. +- ❌ **Open case $n = 19$:** The website specifically highlights that $n = 19$ (the smallest prime $\equiv 3 \pmod{4}$ after 7 and 11) remains unknown. + +**Note on redundancy:** The `two_squares` variant is subsumed by `sum_of_squares` (take $m = n$), making it technically redundant. However, keeping it for clarity is reasonable since it's a separate result in the literature. + +--- + +## 4. Readability + +**Strengths:** +- Clean, well-structured definitions with clear docstrings explaining mathematical meaning. +- The barycentric coordinate formulation of `triangleRegion` and `triangleInterior` is explicit and self-contained. +- Good use of `Multiset` for SSS congruence characterization. +- The `CanDissectInto` definition clearly separates its five conditions (non-degeneracy, congruence, containment, disjoint interiors, covering). + +**Suggestions:** +- The nested tuple type `Fin n → (ℝ × ℝ) × (ℝ × ℝ) × (ℝ × ℝ)` with projections like `(V i).2.1` is somewhat hard to parse. A named structure (e.g., `Triangle2D`) or using `Fin n → Fin 3 → ℝ × ℝ` could improve readability. +- Accessing vertices via `(V i).1`, `(V i).2.1`, `(V i).2.2` appears 10+ times and is the main readability bottleneck. + +--- + +## 5. Formalizability + +**Assessment: Highly formalizable (low ambiguity).** + +The problem statement "find all $n$ such that some triangle can be cut into $n$ congruent triangles" is geometrically precise: +- "Triangle" — unambiguous (non-degenerate triangle in the plane). +- "Cut into" — standard geometric dissection (partition into non-overlapping pieces covering the whole). +- "Congruent triangles" — all pieces are triangles with the same side lengths (up to isometry). +- "$n$" — the exact count of pieces. + +The only minor ambiguity is whether "cut into" allows the pieces to share boundary points (edges/vertices). The formalization correctly resolves this by requiring disjoint *interiors* while allowing shared boundaries — this is the standard convention for geometric dissections. + +**Ambiguity level: Very low.** The formalization choices are all natural and standard. + +--- + +## 6. Correctness + +### Main conjecture (`erdos_634`) +The statement asserts that no prime $p \equiv 3 \pmod{4}$ admits a congruent triangle dissection. This **correctly matches** the conjecture stated on erdosproblems.com. The formalization direction (universal negative) is appropriate for an open conjecture. + +### Congruence characterization +Using multisets of *squared* side lengths for SSS congruence is **correct**. Two triangles in $\mathbb{R}^2$ are congruent (related by an isometry, including reflections) if and only if their side length multisets agree. Squaring is monotone on $[0, \infty)$, so comparing squared lengths is equivalent to comparing lengths. ✅ + +### Dissection definition (`CanDissectInto`) +The five conditions correctly formalize a tiling: +1. **Non-degeneracy of pieces** — prevents degenerate (zero-area) "triangles." ✅ +2. **Pairwise congruence** — all $n$ pieces are congruent to each other. ✅ +3. **Containment** — each piece lies within the original triangle. ✅ +4. **Disjoint interiors** — pieces don't overlap (except possibly on boundaries). ✅ +5. **Covering** — every point of the original is in at least one piece. ✅ + +These are the standard conditions for a geometric dissection. **No mathematical flaws identified.** + +### `HasCongruentDissection` +Correctly existentially quantifies over the outer triangle and requires it to be non-degenerate. ✅ + +### Variant correctness +- **Squares:** Any triangle can be subdivided into $n^2$ congruent copies by a grid of lines parallel to the sides. ✅ Well-known folklore result. +- **$2n^2$, $3n^2$, $6n^2$, $n^2 + m^2$:** These are established results from Soifer [So09c]. The statements correctly match the literature. ✅ +- **$\neg 7$, $\neg 11$:** Beeson proved these impossibility results. ✅ + +### Edge case: $n = 0$ and $n = 1$ +- `HasCongruentDissection 0`: `Fin 0` is empty, so the covering condition fails for any non-degenerate triangle. Correctly false. ✅ +- `HasCongruentDissection 1`: Requires a single congruent copy tiling the original — so the piece must equal the original triangle. This is trivially true by taking the triangle itself. Note that 1 = $1^2$, consistent with the `squares` variant. ✅ + +### Potential subtle issue +The `NonDegenerate` definition uses the 2D cross product (determinant), which is orientation-sensitive: it's positive for one orientation and negative for the other, but the definition only checks $\neq 0$, which is correct for non-degeneracy. ✅ + +**Overall correctness assessment: Sound.** No mathematical errors found. The formalization faithfully captures the problem as stated on erdosproblems.com. + +--- + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code reuse | ⚠️ Needs improvement | Quadruplication of geometric primitives across Erdős problems; Mathlib alternatives available | +| Citations | ⚠️ Minor gaps | Missing Zhang [Zh25]; Beeson cited informally only | +| Variants | ⚠️ Partially complete | Core variants present; missing Zhang's generalization, similarity variants, and $n = 19$ highlight | +| Readability | ✅ Good | Clear structure; nested tuple projections are the main friction point | +| Formalizability | ✅ Excellent | Very low ambiguity; standard geometric concepts | +| Correctness | ✅ Correct | Mathematically sound; no flaws identified | diff --git a/ai-review/635.md b/ai-review/635.md new file mode 100644 index 0000000000..3c39c1c47a --- /dev/null +++ b/ai-review/635.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 635 + +## 1. Code Reuse + +The `maxDivAvoidance` definition follows the exact same `sSup` pattern used across many Erdős problem formalizations: + +- `erdos131F` in `ErdosProblems/131.lean` (non-dividing sets — closest thematic analog) +- `nonAvgMax` in `ErdosProblems/186.lean` (non-averaging sets) +- `kAdmissible` in `ErdosProblems/874.lean` (admissible subsets) +- `Set.IsAPOfLengthFree.maxCard` in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` + +All use the pattern `sSup {k | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ Property A ∧ A.card = k}`. This is a well-established idiom in the codebase and does not need to be consolidated into a shared utility (the property varies each time). No existing definition can substitute for `DivAvoidance`, which is problem-specific. + +The density utilities in `FormalConjecturesForMathlib/Data/Set/Density.lean` (`Set.upperDensity`, `Set.HasDensity`, etc.) are not directly applicable here since the main theorem is stated in the ε-N form rather than as a density limit, but could be used in an alternative formulation. + +**Verdict:** No meaningful code reuse opportunities. The current implementation appropriately defines problem-specific concepts. + +## 2. Citations + +The formalization references: +- `[Gu83]` — Guy, R. K., *Unsolved Problems in Number Theory* (1983) +- `[Ru99]` — Ruzsa, I., related correspondence and results (1999) + +The website ([erdosproblems.com/635](https://www.erdosproblems.com/635)) additionally references: +- **[El79]** — Elliott (1979), whose inequality Terence Tao observed implies the upper bound result. **This citation is missing from the formalization.** +- The resolution of the upper bound is attributed to ChatGPT-5.2 (prompted by Leeham), with Tao's observation connecting it to Elliott's work. **This attribution is missing from the docstring.** + +The `[Ru99]` citation as "Ruzsa, I., related correspondence and results (1999)" is vague. A more precise citation would be helpful if available from the website. + +**Recommendation:** Add `[El79]` citation and note the resolution attribution in the docstring for the main theorem. + +## 3. Variants + +The formalization captures three statements: +1. **`erdos_635.variants.t_eq_one`**: Exact result for t = 1 (max = ⌊(N+1)/2⌋). +2. **`erdos_635.variants.t_eq_two_lower`**: Lower bound for t = 2 (N/2 + c·log N). +3. **`erdos_635`**: The main upper bound conjecture for all t ≥ 1. + +The original problem asks two questions: (a) "How large can |A| be?" and (b) "Is it true that |A| ≤ (1/2 + o(1))N?" The formalization captures (b) and the known special cases. Question (a) in full generality (exact asymptotics) is too broad to formalize as a single theorem statement, so omitting it is reasonable. + +**Verdict:** All formalizable variants are captured. No missing variants. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The `DivAvoidance` definition and `maxDivAvoidance` are clearly documented with matching LaTeX in the docstrings. +- The namespace `Erdos635` keeps definitions local. +- The main theorem `erdos_635` directly quantifies over sets `A` rather than using `maxDivAvoidance`, which is slightly inconsistent with the variant theorems that do use `maxDivAvoidance`. However, the direct formulation is arguably clearer for the main result since it avoids an unnecessary layer of indirection. +- The docstring for the main theorem helpfully includes the equivalent reformulation in terms of `maxDivAvoidance`. + +**Verdict:** Good readability. No changes recommended. + +## 5. Formalizability + +The problem statement "whenever $a, b \in A$ with $b - a \geq t$, we have $(b-a) \nmid b$" is precise and unambiguous. The formalization is straightforward. + +One subtlety worth noting: the definition uses natural number subtraction (`b - a` in `ℕ`), which truncates to 0 when `a > b`. This is handled correctly because the condition `b - a ≥ t` with `t ≥ 1` is false when `a ≥ b`, making the implication vacuously true. The formalization is therefore equivalent to the mathematical statement which implicitly assumes `b > a`. + +The $o_t(1)$ notation (where the rate may depend on $t$) is correctly captured by having `N₀` depend on both `t` and `ε` (since `∃ N₀` is quantified after `∀ t` and `∀ ε`). + +**Verdict:** Fully formalizable, no ambiguity. Statement is precise. + +## 6. Correctness + +### `DivAvoidance` definition — **Correct** + +The definition `∀ a ∈ A, ∀ b ∈ A, b - a ≥ t → ¬(b - a ∣ b)` correctly formalizes the condition. Key verification: + +- Natural number subtraction is safe here: when `a > b`, `b - a = 0` and `0 ≥ t` is false for `t ≥ 1`, so the condition is vacuous. +- The condition `¬(b - a ∣ b)` is equivalent to `¬(b - a ∣ a)` (since `b = a + (b-a)`, divisibility of `b` by `b-a` is equivalent to divisibility of `a` by `b-a`). Both are mathematically correct readings of the problem. + +### `erdos_635.variants.t_eq_one` — **Correct** + +When t = 1, the odd numbers in {1,...,N} satisfy DivAvoidance: for odd a < b, the difference b - a is even (≥ 2), and an even number cannot divide an odd number. The set has cardinality ⌊(N+1)/2⌋. The claim that this is the maximum is a known result. The formula `(N + 1) / 2` in ℕ (Lean's natural number division) correctly computes ⌊(N+1)/2⌋. + +### `erdos_635.variants.t_eq_two_lower` — **Correct** + +The construction (odd numbers ∪ {2^k : k odd}) satisfies DivAvoidance with t = 2: +- Between two odd numbers: difference is even, cannot divide an odd number. +- Between an odd number a and a power 2^k (or vice versa): the difference is odd and ≥ 3, and the only odd divisor of any power of 2 is 1, so the difference cannot divide the power of 2. Going the other way: if d = b - a divides b, then d divides a = b - d, hence d divides gcd(a, b). This argument confirms non-divisibility. +- Between two powers 2^j and 2^k (both with odd exponents, k > j): the difference 2^j(2^{k-j} - 1) divides 2^k only if (2^{k-j} - 1) divides 2^{k-j}, which requires 2^{k-j} - 1 = 1, i.e., k = j + 1. But consecutive entries in {2^k : k odd} have k-j ≥ 2, so this cannot occur. + +The cardinality is ⌊(N+1)/2⌋ + ⌊log₂(N)/2⌋ (no overlap since 2^k is always even for k ≥ 1). This is N/2 + Θ(log N). The use of `Real.log` (natural log) is fine since log₂ N = ln N / ln 2 and the constant c absorbs the base change. + +### `erdos_635` (main theorem) — **Correct** + +The ε-N formulation correctly captures "|A| ≤ (1/2 + o_t(1))N" as: for all t ≥ 1, for all ε > 0, there exists N₀ (depending on t and ε) such that for all N ≥ N₀, every qualifying A has |A| ≤ (1/2 + ε)N. The `answer(True)` is correct since this has been resolved affirmatively. + +### Category tags — **Correct with caveat** + +All three theorems are tagged `category research solved`. The variant results (t=1, t=2) are classical and clearly solved. The main theorem is reported as solved (via Elliott's inequality / Tao's observation). The website still marks the overall problem as OPEN (likely because the full "how large can |A| be?" question remains open), but the specific yes/no question formalized here is indeed solved. The tags are appropriate for what is formalized. + +**Verdict:** The formalization is mathematically correct and complete. No errors found. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities; problem-specific definitions are appropriate | +| Citations | **Missing [El79] (Elliott 1979) and resolution attribution** | +| Variants | Complete | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The only actionable item is adding the Elliott citation and resolution attribution to the docstring. diff --git a/ai-review/636.md b/ai-review/636.md new file mode 100644 index 0000000000..0172a9effa --- /dev/null +++ b/ai-review/636.md @@ -0,0 +1,87 @@ +# Review: Erdős Problem 636 + +## 1. Code Reuse + +The `inducedSubgraphSignatures` helper is custom to this file. No existing definition in `FormalConjecturesForMathlib` serves the same purpose. However, the codebase offers related patterns: + +- **Problem 637** (`637.lean`) uses a nearly identical structure: same clique/independence bounds via `∀ S, G.IsClique ... → S.card ≤ C * Real.logb 2 n`, same complement-graph pattern for independence. The two problems could share a common predicate for "Ramsey-like graph" (clique and independence number both ≤ C log₂ n), but this is a minor factoring opportunity, not a correctness issue. +- **Mathlib's `SimpleGraph.cliqueNum` and `SimpleGraph.indepNum`** exist and could replace the inline universal quantification over cliques/independent sets. The current formulation (`∀ S, G.IsClique ↑S → S.card ≤ ...`) is logically equivalent to bounding `cliqueNum` and is consistent with Problem 637's style, so this is acceptable. +- **`edgeSet.ncard`** is used rather than `edgeFinset.card`. Since the induced subgraph on a finite vertex set has finitely many edges, `ncard` returns the correct value. Using `Finset`-based `edgeFinset.card` would be slightly more canonical for decidable finite graphs but is not incorrect here. + +**Verdict:** No significant reuse opportunity missed. Consistency with Problem 637 is good. + +## 2. Citations + +The formalization's docstring references: +- `[Er93]` — Erdős, P., *On some of my favourite theorems* (1993), p.346. +- `[Er97d]` — Erdős, P., *Some of my new and almost new problems and results in combinatorics and graph theory* (1997). +- `[KwSu21]` — Kwan, M. and Sudakov, B., *Proof of a conjecture on induced subgraphs of Ramsey graphs* (2021). + +The website (erdosproblems.com/636) states: +- The problem originated with Erdős, Faudree, and Sós. **It also credits Alon and Bollobás** in [Er93]. The docstring does not mention Alon and Bollobás. + +**Recommendation:** Add a note that Erdős credits Alon and Bollobás in [Er93], per the website: "Erdős credits Alon and Bollobás in [Er93]." Otherwise, citations are complete and match the website. + +## 3. Variants + +The website does not describe additional variants beyond the main statement. The formalization captures the single main conjecture (the n^{5/2} lower bound on distinct induced subgraph signatures). The historical n^{3/2} lower bound by Erdős–Faudree–Sós is mentioned in the docstring for context but is not separately formalized, which is appropriate since it is superseded by the proved n^{5/2} result. + +**Verdict:** All variants captured. No missing formulations. + +## 4. Readability + +The code is clean and well-structured: +- The `inducedSubgraphSignatures` helper is clearly documented with a LaTeX-style docstring explaining the (|S|, |E(G[S])|) pair. +- The main theorem statement has a thorough docstring explaining the mathematical content. +- Naming follows codebase conventions (`erdos_636`, `Erdos636` namespace). +- Structure parallels Problem 637, making both easy to compare. + +**Minor suggestions:** +- The docstring says `[Er93, p.346][Er97d]` — adding a semicolon or comma between the two citations would improve readability: `[Er93, p.346]; [Er97d]`. + +**Verdict:** Highly readable. No significant issues. + +## 5. Formalizability + +The original problem uses asymptotic notation ("≫ log n", "≫ n^{5/2}"). The formalization resolves this via explicit quantification over constants: + +- "No complete graph or independent set on ≫ log n vertices" becomes: for all C > 0, if all cliques/independent sets have size ≤ C log₂ n, then... +- "≫ n^{5/2} distinct signatures" becomes: there exists c > 0 such that the count is ≥ c · n^{5/2}. +- An N₀ threshold handles the "sufficiently large n" aspect. + +This is the standard and correct way to formalize asymptotic statements. The problem is unambiguous in its meaning once the asymptotic notation is unpacked. + +**Verdict:** Fully and unambiguously formalizable. The chosen quantifier structure is the canonical translation of the asymptotic statement. + +## 6. Correctness + +**Mathematical analysis:** + +The problem asks whether a Ramsey-type graph (no large clique or independent set) must have many induced subgraphs that are pairwise distinguishable by their (vertex count, edge count) pair. The formalization correctly captures this: + +1. **Clique bound:** `∀ S : Finset (Fin n), G.IsClique (↑S) → S.card ≤ C * Real.logb 2 n` — correctly bounds the clique number. + +2. **Independence bound:** `∀ S : Finset (Fin n), Gᶜ.IsClique (↑S) → S.card ≤ C * Real.logb 2 n` — correctly expresses the independence number bound as the clique number of the complement. This is standard and correct. + +3. **Conclusion:** `(inducedSubgraphSignatures G).card ≥ c * n ^ (5/2)` — the `inducedSubgraphSignatures` definition computes the image of all vertex subsets under the map S ↦ (|S|, |E(G[S])|), collecting distinct pairs into a `Finset`. The cardinality of this image is exactly the number of distinct (vertex count, edge count) signatures, which is what the problem asks for. + +4. **`answer(True)`:** The problem is a yes/no question ("Must G contain...?"), and Kwan–Sudakov proved the answer is yes. The `answer(True) ↔ ...` wrapper is correct. + +5. **Quantifier order:** `∀ C > 0, ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G, ...` — this is the correct order. The constants c and N₀ may depend on C, which is exactly right for formalizing the asymptotic claim. + +6. **Edge case:** When n = 0 or n = 1, the graph trivially satisfies the clique/independence bounds, and the conclusion c · n^{5/2} ≤ 0 or c · 1 is handled by the N₀ threshold. No issues here. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities; consistent with codebase patterns | +| Citations | Minor: Alon and Bollobás attribution from [Er93] not mentioned | +| Variants | Complete | +| Readability | Excellent | +| Formalizability | Unambiguous; standard asymptotic translation | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The only actionable item is a minor citation addition (Alon and Bollobás credit). diff --git a/ai-review/637.md b/ai-review/637.md new file mode 100644 index 0000000000..bd541dd18b --- /dev/null +++ b/ai-review/637.md @@ -0,0 +1,127 @@ +# AI Review: Erdős Problem 637 + +## 1. Code Reuse + +**Shared structure with Problem 636.** Problems 636 and 637 share nearly identical hypothesis structure (clique/independence number ≤ C·log₂(n) via `G.IsClique` / `Gᶜ.IsClique`). The two files independently define their own helper functions (`inducedSubgraphSignatures` in 636, `inducedDegree` / `inducedDistinctDegrees` in 637). There may be value in extracting the shared "Ramsey-type graph on Fin n" hypothesis pattern, but given the lightweight nature of each problem file, the duplication is acceptable. + +**`inducedDegree` vs Mathlib.** The custom `inducedDegree` definition computes `(S.filter fun w => G.Adj v w).card`. An equivalent Mathlib-based expression would be `(G.neighborFinset v ∩ S).card` or `(G.induce ↑S).degree ⟨v, hv⟩` (for `v ∈ S`). The custom definition is arguably clearer for this self-contained problem and avoids subtype coercion overhead, so the choice is reasonable. + +**`graphCliqueNumber` in Problem 813.** Problem 813 defines a standalone `graphCliqueNumber` function. Mathlib also provides `SimpleGraph.cliqueNum`. However, Problem 637 does not use a clique number definition at all — it instead inlines the bound as a universal quantification over cliques (∀ S, IsClique S → |S| ≤ C·log n). This inline approach is actually more direct and avoids needing to reason about `sSup`, so the current choice is sound. + +**`α(G)` notation in FormalConjecturesForMathlib.** The file `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` provides `α(G)` notation for `indepNum G`. This is not used in 637, which instead encodes independence number constraints via `Gᶜ.IsClique`. Again, the inline approach is preferable here for the same reasons. + +**Verdict:** No significant code reuse opportunities missed. The current approach of self-contained helper definitions is appropriate. + +## 2. Citations + +The formalization includes three references: + +| Citation | Formalization | Website | Match? | +|----------|--------------|---------|--------| +| [Er97d] Erdős 1997 | ✅ "Some of my favourite problems in various branches of combinatorics" | ✅ Present | ✅ | +| [BuSu07] Bukh & Sudakov 2007 | ✅ "Induced subgraphs of Ramsey graphs with many distinct degrees" | ✅ Present | ✅ | +| [JKLY20] Jenssen, Keevash, Long & Yepremyan 2020 | ✅ "Distinct degrees in induced subgraphs" | ✅ Present | ✅ | + +The website also credits **Zach Hunter** as a contributor, which is not mentioned in the formalization docstring. This is a minor omission (likely a website contributor, not a paper author). + +The docstring correctly attributes the problem to "Erdős, Faudree, and Sós" matching the website. + +**Verdict:** Citations are complete and accurate. + +## 3. Variants + +The docstring mentions the **JKLY20 strengthening**: there exists an induced subgraph (with no restriction on vertex count) having ≫ n^{2/3} distinct degrees. This variant is **not formalized** as a separate theorem. + +A formalization of this variant would look like: + +```lean +theorem erdos_637_jkly20 : + ∀ C : ℝ, C > 0 → + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ G : SimpleGraph (Fin n), + (∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + (∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → + (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ)) → + ∃ S : Finset (Fin n), + (inducedDistinctDegrees G S : ℝ) ≥ c * (↑n : ℝ) ^ ((2 : ℝ) / 3) +``` + +This is a mathematically distinct (and in one sense stronger) result that could merit its own theorem statement. + +**Verdict:** The main conjecture is captured. The JKLY20 variant is documented but not formalized — this is a minor gap. + +## 4. Readability + +The code is well-structured and readable: + +- **Helper definitions** (`inducedDegree`, `inducedDistinctDegrees`) are cleanly separated with docstrings explaining the mathematical meaning. +- **Namespace** `Erdos637` properly scopes the definitions. +- **Docstring** is thorough — it includes the mathematical statement, attribution, proof status, and related results. +- **Variable naming** is conventional: `C` for the Ramsey constant, `c₁`/`c₂` for the conclusion constants, `N₀` for the threshold, `S` for vertex subsets. + +Minor suggestions: +- The docstring for `inducedDegree` says "degree of vertex v in the induced subgraph G[S]" but the function doesn't require `v ∈ S`. This is technically the number of neighbors of v within S, which equals the degree in G[S] only when v ∈ S. Since `inducedDistinctDegrees` maps over S, this is not a bug, but the docstring could be more precise (e.g., "The number of neighbors of v within S"). + +**Verdict:** Very readable. One minor docstring imprecision. + +## 5. Formalizability + +The original problem uses asymptotic notation ("≫ log n", "≫ n", "≫ n^{1/2}") which is inherently informal. The formalization must make explicit choices: + +1. **"No complete graph or independent set on ≫ log n vertices"** → Formalized as: for all C > 0, if clique and independence numbers are ≤ C·log₂(n), then... The universal quantification over C correctly captures "O(log n)" — for any constant C, the conclusion holds (with c₁, c₂ depending on C). + +2. **"≫ n vertices"** → Formalized as ≥ c₁·n for some c₁ > 0 (i.e., Ω(n)). + +3. **"≫ n^{1/2} distinct degrees"** → Formalized as ≥ c₂·n^{1/2} for some c₂ > 0 (i.e., Ω(√n)). + +These are standard and unambiguous translations of the asymptotic notation into quantified statements. The choice of log base 2 is immaterial (any constant base works, absorbed into C). The quantifier ordering (∀ C, ∃ c₁ c₂ N₀, ∀ n ≥ N₀) is correct. + +**Verdict:** The asymptotic statement is sufficiently precise to be unambiguously formalizable. The formalization makes the standard choices. + +## 6. Correctness + +### Quantifier structure +The statement `∀ C > 0, ∃ c₁ > 0, ∃ c₂ > 0, ∃ N₀, ∀ n ≥ N₀, ...` is correct. The constants c₁, c₂ are allowed to depend on C, which is mathematically necessary (the density of the induced subgraph and the number of distinct degrees depend on how close the graph is to being Ramsey-extremal). + +### Clique number constraint +```lean +∀ S : Finset (Fin n), G.IsClique (↑S : Set (Fin n)) → (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ) +``` +This correctly states that every clique has size ≤ C·log₂(n), which is equivalent to ω(G) ≤ C·log₂(n). + +### Independence number constraint +```lean +∀ S : Finset (Fin n), Gᶜ.IsClique (↑S : Set (Fin n)) → (S.card : ℝ) ≤ C * Real.logb 2 (↑n : ℝ) +``` +A clique in the complement graph is an independent set in G. This correctly encodes α(G) ≤ C·log₂(n). + +### Induced degree computation +`inducedDegree G S v = (S.filter fun w => G.Adj v w).card` counts the neighbors of v within S. Since `SimpleGraph` enforces `G.Adj v v = False` (loopless), this correctly gives the degree of v in G[S] when v ∈ S. Since `inducedDistinctDegrees` maps over vertices in S, the degrees are computed only for vertices actually in the induced subgraph. + +### Distinct degree count +`inducedDistinctDegrees G S = (S.image fun v => inducedDegree G S v).card` correctly counts the number of distinct degree values among vertices of S in the induced subgraph. + +### Conclusion +```lean +∃ S : Finset (Fin n), (S.card : ℝ) ≥ c₁ * (↑n : ℝ) ∧ + (inducedDistinctDegrees G S : ℝ) ≥ c₂ * (↑n : ℝ) ^ ((1 : ℝ) / 2) +``` +This correctly asserts the existence of a large induced subgraph with many distinct degrees. The exponent `(1 : ℝ) / 2` correctly represents √n. + +### Edge case: n = 0 +When n = 0, the graph has no vertices. The statement requires n ≥ N₀, so by choosing N₀ ≥ 1, this edge case is avoided. The existential ∃ N₀ handles this gracefully. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. The encoding of asymptotic bounds via universal/existential quantification is standard and faithful to the original problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ No significant opportunities missed | +| Citations | ✅ Complete and accurate | +| Variants | ⚠️ JKLY20 variant (n^{2/3} distinct degrees, no vertex restriction) documented but not formalized | +| Readability | ✅ Clean and well-documented; minor docstring imprecision on `inducedDegree` | +| Formalizability | ✅ Standard, unambiguous translation of asymptotic statement | +| Correctness | ✅ Mathematically correct and complete | diff --git a/ai-review/638.md b/ai-review/638.md new file mode 100644 index 0000000000..1bb0388115 --- /dev/null +++ b/ai-review/638.md @@ -0,0 +1,187 @@ +# Review: Erdős Problem 638 + +**File:** `FormalConjectures/ErdosProblems/638.lean` + +--- + +## 1. Code Reuse + +**Issue: `inducedFinSubgraph` duplicates Mathlib's `SimpleGraph.comap`.** + +Mathlib provides `SimpleGraph.comap (f : α → β) (G : SimpleGraph β) : SimpleGraph α`, which defines `Adj i j := G.Adj (f i) (f j)` — exactly what `inducedFinSubgraph` does at lines 42–46: +```lean +def inducedFinSubgraph {V : Type*} (G : SimpleGraph V) {m : ℕ} + (f : Fin m ↪ V) : SimpleGraph (Fin m) where + Adj i j := G.Adj (f i) (f j) +``` +This could be replaced by `G.comap f`, reducing the definition to a one-liner or eliminating it entirely. + +**Issue: `FinGraphIso` reimplements `Nonempty (G ≃g H)`.** + +Mathlib's `SimpleGraph.Iso` (notation `G ≃g H`) is an equivalence on vertices preserving adjacency. For two graphs on `Fin m`, the custom `FinGraphIso` (line 49–50) is logically equivalent to `Nonempty (G ≃g H)`: +```lean +def FinGraphIso {m : ℕ} (G H : SimpleGraph (Fin m)) : Prop := + ∃ σ : Equiv.Perm (Fin m), ∀ i j, G.Adj i j ↔ H.Adj (σ i) (σ j) +``` +An `Equiv.Perm (Fin m)` that preserves adjacency is exactly a `G ≃g H`. Using Mathlib's `Iso` would improve interoperability with the rest of the library. + +**Issue: `HasMonoTriangle` is a bespoke monochromatic-triangle predicate.** + +Problems 76 and 639 define their own monochromatic triangle predicates (`IsMonochromaticTriangle` in 76.lean, `EdgeTwoColoring.inMonoTriangle` in 639.lean). Problem 638's `HasMonoTriangle` is the most general (arbitrary `SimpleGraph V`, arbitrary color type), but all three are independently defined. Consider promoting `HasMonoTriangle` or a variant to `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` so that 638, 639, and 76 can share a common notion. However, the different problems operate on different structures (complete graphs on `Fin n` vs. arbitrary `SimpleGraph V`), so unification would require some design work. + +**Recommendation:** Replace `inducedFinSubgraph` with `SimpleGraph.comap` and `FinGraphIso` with `Nonempty (G ≃g H)`. Consider consolidating monochromatic triangle definitions across problems 76, 638, and 639. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/638](https://www.erdosproblems.com/638):** + +The website lists: +- **Status:** Open +- **Tags:** Graph theory, Ramsey theory +- **Reference:** [Er97d] +- **Additional context:** Erdős noted "if the answer is affirmative many extensions and generalisations will be possible." +- **Related problems:** Problem 639 (same paper [Er97d]) + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open | **Correct.** | +| AMS classification | `AMS 5` | Combinatorics / Graph theory | **Correct.** AMS class 5 = Combinatorics. | +| Citation tags | None | [Er97d] | **Missing.** The reference [Er97d] (Erdős, *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania), 1997) is not cited in the docstring. Problem 639 correctly cites this same paper — the citation text could be copied. | +| Erdős's remark | Not mentioned | "if the answer is affirmative many extensions and generalisations will be possible" | **Missing.** This remark provides useful mathematical context and could be added to the module docstring. | +| Related problems | Not mentioned | Problem 639 | **Missing.** Problem 639 comes from the same paper and concerns monochromatic triangles in 2-colorings of $K_n$. A cross-reference would be valuable. | + +**Recommendation:** Add the citation `[Er97d] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, Matematiche (Catania), 1997.` to the module docstring, matching the format used in 639.lean. Add a note about the relationship to Problem 639 and Erdős's remark about extensions. + +--- + +## 3. Variants + +The formalization captures the core question as stated on the website. Two potential variants are worth discussing: + +**1. Replacing "monochromatic triangle" with "monochromatic $K_r$":** +The question naturally generalizes from triangles ($K_3$) to arbitrary cliques $K_r$. Erdős's remark ("if the answer is affirmative many extensions and generalisations will be possible") likely alludes to such generalizations. However, the problem as posed on the website is specifically about triangles, so the formalization is faithful. + +**2. Weakening "every finite induced subgraph" to "every finite subgraph":** +The problem uses "induced subgraph" specifically. The formalization correctly captures this via `inducedFinSubgraph` (pulling back along an embedding). This is stronger than merely requiring every finite *subgraph* (not necessarily induced) to be in $S$, and the formalization matches the stated problem. + +**3. Fixing κ to specific cardinals:** +One could ask the question for specific cardinals (e.g., κ = ℵ₀ only, or κ = ℵ₁). The formalization universally quantifies over all infinite cardinals, which matches the problem statement. + +**Assessment:** The core open problem is correctly captured with no missing variants. The generalizations alluded to by Erdős are not formalized, which is appropriate since they are not part of the stated problem. + +--- + +## 4. Readability + +The code is generally well-structured. Specific observations: + +- **Module docstring (lines 19–27):** Clear and accurately describes the problem. Could be enriched with the [Er97d] citation and Erdős's remark about extensions. +- **Definition docstrings:** `HasMonoTriangle` (line 33–34), `inducedFinSubgraph` (line 40–41), and `FinGraphIso` (line 48) all have clear, concise docstrings. +- **Namespace:** `Erdos638` is consistent with the project convention. +- **Opens:** `open SimpleGraph Cardinal` is minimal and appropriate. +- **Variable naming:** The variable `d` in `HasMonoTriangle` (`∃ a b d : V`) is slightly unusual — `c` would be the natural third vertex name, but `c` is already used for the coloring. The choice of `d` is a reasonable workaround. An alternative would be `v₁ v₂ v₃` or `x y z`. +- **Theorem statement:** The main theorem (lines 63–76) is long but necessarily so given the complexity of the statement. The indentation and line breaks are well-chosen, making the quantifier structure readable. + +**Minor suggestion:** The coloring in the Ramsey property hypothesis uses `c : Fin m → Fin m → Fin n`, which colors all vertex pairs (including the diagonal `c v v`). While mathematically harmless (diagonal values are never inspected by `HasMonoTriangle`), a comment noting this convention might aid readability. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Moderately ambiguous; the formalization makes reasonable choices.** + +The original problem statement is: +> "Let S be a family of finite graphs where for every n, there exists $G_n \in S$ such that coloring edges with n colors yields a monochromatic triangle. For every infinite cardinal κ, does there exist a graph G where every finite induced subgraph is in S, and coloring edges with κ colors produces a monochromatic triangle?" + +Several aspects require interpretation: + +**1. What is "a family of finite graphs"?** +The formalization indexes $S$ by vertex count: `S : (m : ℕ) → Set (SimpleGraph (Fin m))`. This means $S$ is partitioned by number of vertices, and membership is up to isomorphism (via `FinGraphIso`). This is a natural and standard encoding. An alternative would be to define $S$ as an isomorphism-closed class of finite graphs, but the current approach is equivalent and more concrete. + +**2. What is the "Ramsey property"?** +The formalization interprets this as: for every $n \geq 1$, there exists a graph in $S$ on some number of vertices $m$ such that any $n$-coloring of its edges contains a monochromatic triangle. This is a standard meaning of "Ramsey property (for triangles)" and matches the website's description. + +**3. "Every finite induced subgraph of $G$ belongs to $S$":** +The formalization quantifies over all embeddings `f : Fin m ↪ V` for all `m`, requiring each induced subgraph to be isomorphic to some member of `S m`. This includes the trivial cases $m = 0$ (empty graph) and $m = 1$ (single vertex), meaning $S$ must contain these trivial graphs. This is a very mild technical artifact — in practice, any reasonable family $S$ would include these. The formalization is faithful to the literal statement. + +**4. Universe considerations:** +The existential `∃ (V : Type) (G : SimpleGraph V)` and the universal `∀ (α : Type)` are both in `Type 0`. This means the theorem applies to cardinals representable in the base universe. For the mathematical content, this is not a limitation in practice — all "standard" infinite cardinals (ℵ₀, ℵ₁, etc.) are representable. + +**Ambiguity level: Low.** The main concepts (Ramsey property, induced subgraph, cardinal coloring) all have standard mathematical meanings that the formalization captures correctly. The only interpretive choices are the indexing scheme for $S$ and the treatment of trivial graphs, both of which are natural. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition: `HasMonoTriangle` (lines 35–38) + +```lean +def HasMonoTriangle {V : Type*} (G : SimpleGraph V) {α : Type*} + (c : V → V → α) : Prop := + ∃ a b d : V, G.Adj a b ∧ G.Adj b d ∧ G.Adj a d ∧ + c a b = c b d ∧ c a b = c a d +``` + +- **Pairwise adjacency:** `G.Adj a b ∧ G.Adj b d ∧ G.Adj a d` correctly encodes that $\{a, b, d\}$ form a triangle in $G$. Since `SimpleGraph` has `loopless`, these adjacencies imply $a \neq b$, $b \neq d$, $a \neq d$, so the three vertices are distinct. ✓ +- **Monochromatic condition:** `c a b = c b d ∧ c a b = c a d` asserts all three edge colors are equal. Note that `c` is not required to be symmetric *within the definition*, but all usage sites impose `∀ u v, c u v = c v u`. Given symmetry, `c a b`, `c b d`, and `c a d` are canonical representatives of the colors of edges $\{a,b\}$, $\{b,d\}$, $\{a,d\}$ respectively. ✓ +- **Minor note:** The condition checks `c a b = c b d` rather than `c a b = c d b`. With the imposed symmetry, these are equal, so there is no issue. Without symmetry, the definition would be checking a directed-coloring condition, which would be non-standard. The design is correct as used. + +### Definition: `inducedFinSubgraph` (lines 42–46) + +Correctly pulls back $G$'s adjacency along an embedding $f : \text{Fin}\ m \hookrightarrow V$. Equivalent to `SimpleGraph.comap f G`. The `symm` and `loopless` proofs are straightforward delegations. ✓ + +### Definition: `FinGraphIso` (lines 49–50) + +Correctly defines isomorphism of two graphs on the same vertex set `Fin m` via a permutation. Equivalent to `Nonempty (G ≃g H)`. ✓ + +### Theorem: `erdos_638` (lines 63–76) + +**Quantifier structure:** +``` +answer(sorry) ↔ ∀ S (Ramsey property) ∀ κ ≥ ℵ₀, ∃ V G, [induced subgraphs in S] ∧ [κ-coloring has mono triangle] +``` + +- **∀ S:** Universal quantification over all families with the Ramsey property. ✓ +- **∀ κ ≥ ℵ₀:** Universal quantification over all infinite cardinals. ✓ +- **∃ V G:** Existence of a graph $G$ on some vertex type $V$. ✓ + +**Ramsey property hypothesis (lines 66–69):** +```lean +∀ n : ℕ, n ≥ 1 → + ∃ m : ℕ, ∃ G ∈ S m, + ∀ (c : Fin m → Fin m → Fin n), (∀ u v, c u v = c v u) → + HasMonoTriangle G c +``` + +- The `n ≥ 1` guard is appropriate: `Fin 0` is empty, so a 0-coloring is vacuous. For $n \geq 1$, the statement says some graph in $S$ forces a monochromatic triangle under any symmetric $n$-coloring. This correctly encodes the Ramsey property for triangles. ✓ +- The coloring domain `Fin m → Fin m → Fin n` covers all vertex pairs. Non-edge and diagonal colors are irrelevant since `HasMonoTriangle` only inspects adjacencies. ✓ + +**Induced subgraph condition (lines 72–73):** +```lean +∀ (m : ℕ) (f : Fin m ↪ V), + ∃ H ∈ S m, FinGraphIso (inducedFinSubgraph G f) H +``` + +- For every $m$-element subset of $V$ (encoded via an embedding), the induced subgraph is isomorphic to some member of $S(m)$. This is the correct encoding of "every finite induced subgraph belongs to $S$ up to isomorphism." ✓ +- **Technical note:** The quantification includes $m = 0$ and $m = 1$, requiring $S(0)$ and $S(1)$ to be nonempty (containing the empty and trivial graphs respectively). This is a mild strengthening but doesn't affect the mathematical content since any Ramsey-type family would include these. ✓ + +**Coloring condition (lines 74–75):** +```lean +∀ (α : Type) (_ : #α = κ) (c : V → V → α), + (∀ u v, c u v = c v u) → HasMonoTriangle G c +``` + +- Quantifies over all types $\alpha$ of cardinality $\kappa$ and all symmetric colorings. This correctly captures "every $\kappa$-coloring of the edges contains a monochromatic triangle." ✓ +- Using `∀ (α : Type) (_ : #α = κ)` rather than fixing a specific type of cardinality $\kappa$ is the right approach — it ensures the result is independent of the choice of color type. ✓ + +### Potential concern: coloring domain includes non-edges + +The coloring `c : V → V → α` assigns colors to all ordered pairs of vertices, not just edges of $G$. This is standard practice — the relevant mathematical content involves only the colors of actual edges, and the `HasMonoTriangle` predicate only inspects edge colors. However, it means the theorem quantifies over more colorings than strictly necessary (those that also color non-edges). This does not affect correctness: if every coloring of all pairs forces a monochromatic triangle, then certainly every coloring of just the edges does. The converse also holds by extending any edge-coloring arbitrarily to non-edges. ✓ + +**Verdict: Correct and complete.** The formalization faithfully captures the open content of Erdős Problem 638. The definitions are mathematically sound, the quantifier structure is correct, and the encoding choices (indexing $S$ by vertex count, using embeddings for induced subgraphs, function-based colorings) are natural and equivalent to the standard mathematical formulation. No mathematical flaws are present. The only improvements would be code reuse (replacing custom definitions with Mathlib equivalents) and adding the missing citation. diff --git a/ai-review/639.md b/ai-review/639.md new file mode 100644 index 0000000000..e47963d8d8 --- /dev/null +++ b/ai-review/639.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 639 + +## 1. Code Reuse + +**Erdős Problem 76** (`FormalConjectures/ErdosProblems/76.lean`) defines a nearly identical concept: + +```lean +-- Problem 76's approach (Sym2-based, no explicit symmetry field needed): +def EdgeTwoColoring (n : ℕ) := Sym2 (Fin n) → Bool + +-- Problem 639's approach (structure with explicit symmetry constraint): +structure EdgeTwoColoring (n : ℕ) where + color : Fin n → Fin n → Bool + symm : ∀ u v : Fin n, color u v = color v u +``` + +Both represent 2-colorings of edges of K_n but use incompatible representations. Problem 76's `Sym2`-based definition is arguably cleaner since symmetry is enforced by the type rather than a proof obligation. A shared definition in `FormalConjecturesForMathlib` (e.g., under `Combinatorics/SimpleGraph/`) would benefit both files and any future Ramsey-adjacent problems. Both definitions also overlap conceptually with the edge coloring structures in Problems 129, 911, and the Ramsey utilities in `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`. + +**Recommendation:** Extract a shared `EdgeTwoColoring` definition (preferably the `Sym2` variant) into `FormalConjecturesForMathlib` and refactor both Problem 76 and Problem 639 to use it. + +## 2. Citations + +The formalization cites: +- `[Er97d]` Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania), 1997. +- `[KeSu04]` Keevash, P. and Sudakov, B., *On the number of edges not covered by monochromatic copies of a fixed graph*, 2004. + +The website (erdosproblems.com/639) additionally mentions: +- **Erdős, Rousseau, and Schelp** solved the problem for large n (unpublished). +- **Alon** observed the conjecture follows from a result of **Pyber** (at most ⌊n²/4⌋ + 2 monochromatic cliques cover all edges of a 2-coloured K_n, for sufficiently large n). + +These intermediate results are not cited in the formalization. While not strictly necessary (the Keevash–Sudakov result subsumes them), including them as a historical note in the docstring would improve completeness. The existing citations are accurate. + +## 3. Variants + +The formalization captures only the case n ≥ 7. According to Keevash and Sudakov's complete result: +- For **n ≤ 5**, the threshold is C(n, 2) (i.e., every edge can fail to be in a monochromatic triangle). +- For **n = 6**, the threshold is **10** (not ⌊36/4⌋ = 9). +- For **n ≥ 7**, the threshold is ⌊n²/4⌋. + +The n = 6 case is notable: the answer is 10, which is *strictly greater* than ⌊36/4⌋ = 9, so the inequality `≤ n²/4` in the formalization would be **false** for n = 6. The `7 ≤ n` precondition correctly excludes this, but the small cases are mathematically interesting variants that could be stated separately. + +**Recommendation:** Consider adding the small-case results (n ≤ 5 and n = 6) as separate lemmas or documenting them in the docstring, since the Keevash–Sudakov paper characterizes all n. + +## 4. Readability + +The code is well-structured and readable overall. Minor observations: + +- The `EdgeTwoColoring` structure and helper definitions (`inMonoTriangle`, `edgesNotInMonoTriangleCount`) are clearly documented with docstrings. +- The use of `Set.ncard` for counting the set of pairs is clean and appropriate for a noncomputable definition. +- `inMonoTriangle` does not explicitly require `u ≠ v` in its definition. While this doesn't affect correctness (since `edgesNotInMonoTriangleCount` restricts to `p.1 < p.2`), adding `u ≠ v` as a hypothesis to `inMonoTriangle` would make it more robust as a standalone definition. +- The namespace `Erdos639` keeps definitions local, which is good practice. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The original problem statement ("Is it true that if the edges of K_n are 2-coloured then there are at most n²/4 edges which do not occur in a monochromatic triangle?") is precise and directly formalizable. The only minor ambiguity is whether "n²/4" means the exact rational value or its floor; the formalization correctly interprets this as ⌊n²/4⌋ via natural number division, matching the Keevash–Sudakov result. The problem is a clean combinatorial statement with no hidden quantifiers or implicit assumptions. + +## 6. Correctness + +**Assessment: Correct and mathematically sound**, with one minor note. + +**What is correct:** +- The `EdgeTwoColoring` structure correctly models a symmetric 2-coloring of edges. The `symm` field ensures the coloring is well-defined on unordered pairs. +- `inMonoTriangle` correctly characterizes when an edge {u,v} participates in a monochromatic triangle: there exists w ≠ u, w ≠ v such that all three edge-colors agree. +- `edgesNotInMonoTriangleCount` correctly counts unordered edges (via `p.1 < p.2`) not in any monochromatic triangle. +- The bound `n ^ 2 / 4` in ℕ correctly computes ⌊n²/4⌋. +- The precondition `7 ≤ n` matches exactly the range for which Keevash–Sudakov proved the ⌊n²/4⌋ bound. +- Diagonal entries (`color u u`) are irrelevant: `inMonoTriangle` only evaluates colors on edges between distinct vertices, and `edgesNotInMonoTriangleCount` only counts edges with `p.1 < p.2`. + +**Minor note:** The `EdgeTwoColoring` structure assigns a color to `color u u` (the diagonal) but this value is never used meaningfully. An explicit `irrefl` field or a comment noting this would improve clarity, though it does not affect correctness. + +**Conclusion:** The formalization is a faithful and correct translation of the Keevash–Sudakov theorem for n ≥ 7. No mathematical flaws are present. The main areas for improvement are code reuse (shared edge-coloring definition with Problem 76) and completeness (stating the small-case variants). diff --git a/ai-review/640.md b/ai-review/640.md new file mode 100644 index 0000000000..38d6fbc599 --- /dev/null +++ b/ai-review/640.md @@ -0,0 +1,110 @@ +# AI Review: Erdős Problem 640 + +## 1. Code Reuse + +The formalization uses standard Mathlib constructs (`SimpleGraph.Walk`, `IsCycle`, `chromaticNumber`, `induce`) and does not define any custom helpers. Several related Erdős problems in the codebase use similar patterns: + +- **Erdős 57** (`57.lean`): Uses the same `Walk`/`IsCycle`/`Odd p.length` pattern for odd cycles, but only cares about cycle *lengths*, not the induced subgraph on cycle vertices. +- **Erdős 740** (`740.lean`): Also concerns chromatic number and odd cycles, but asks about *subgraphs* avoiding short odd cycles rather than induced subgraphs on cycle vertices. +- **Erdős 111** (`111.lean`): Uses `G.induce` on vertex subsets and `chromaticNumber`, similar structural patterns. + +The `oddCycleLengths` helper defined in several other files (Erdős 57, 58, 63, 72, etc.) is not applicable here since Problem 640 requires the actual cycle walk (to extract its vertex set), not merely the set of odd cycle lengths. + +No existing utility in `FormalConjecturesForMathlib/` directly addresses the "chromatic number of the induced subgraph on a cycle's vertices" concept. The current formalization is appropriately self-contained. + +**Verdict:** No meaningful code reuse opportunities missed. + +## 2. Citations + +The formalization includes: +> [Er97d] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania) 52 (1997), 53-97. + +The website ([erdosproblems.com/640](https://www.erdosproblems.com/640)) lists: +- **[Er97d, p.84]** — matching the formalization. +- Attribution: "A problem of Erdős and Hajnal." +- Additional credit: Raphael Steiner (for noting a variant). + +The formalization correctly attributes the problem to Erdős and Hajnal and cites the correct reference with page number. The docstring's citation format is consistent with the website. + +**Verdict:** Citations are accurate and complete. + +## 3. Variants + +The website notes a variant due to Raphael Steiner: + +> *Steiner has noted that this is equivalent to replacing "odd cycle" with "path."* + +That is, the problem is equivalent to asking: does there exist $f(k)$ such that every graph with $\chi(G) \geq f(k)$ contains a **path** whose vertices span an induced subgraph of chromatic number $\geq k$? + +This variant is **not captured** in the formalization. Since the two formulations are stated to be equivalent, it would be a reasonable addition as a separate theorem or at minimum a docstring note. + +**Verdict:** One known variant (path version) is not formalized or mentioned. + +## 4. Readability + +The formalization is clear and concise. A few minor observations: + +- The set `{w : V | w ∈ p.support}` is idiomatic but could alternatively be expressed via a coercion like `(p.support.toFinset : Set V)`. However, the current form is arguably more transparent about what's happening. +- The docstring clearly explains the problem, provides the trivial $k=3$ case, and gives the source reference. +- The namespace `Erdos640` and theorem name `erdos_640` follow the project conventions. + +**Verdict:** Readable and well-documented. No changes needed. + +## 5. Formalizability + +The original problem statement is: + +> *Let $k \geq 3$. Does there exist some $f(k)$ such that if a graph $G$ has chromatic number $\geq f(k)$ then $G$ must contain some odd cycle whose vertices span a graph of chromatic number $\geq k$?* + +This is a precise yes/no question with unambiguous mathematical content: +- "Odd cycle" is standard (a cycle of odd length). +- "Vertices span a graph" means the induced subgraph on those vertices — standard graph-theoretic terminology. +- The quantifier structure (∀k ∃f ∀G ...) is clear. + +The only minor ambiguity is whether "graph" means finite graph or allows infinite graphs. The formalization allows arbitrary graphs (including infinite ones), which is the more general and natural reading given the Erdős-Hajnal context (they frequently considered infinite chromatic numbers). The use of `ℕ∞` for chromatic number handles both cases gracefully. + +**Verdict:** The problem is unambiguously formalizable. No meaningful ambiguity exists. + +## 6. Correctness + +The formalization: +```lean +theorem erdos_640 : + answer(sorry) ↔ + ∀ k : ℕ, 3 ≤ k → + ∃ f : ℕ, + ∀ (V : Type*) (G : SimpleGraph V), + (f : ℕ∞) ≤ G.chromaticNumber → + ∃ (v : V) (p : G.Walk v v), + p.IsCycle ∧ Odd p.length ∧ + (k : ℕ∞) ≤ (G.induce {w : V | w ∈ p.support}).chromaticNumber +``` + +**Quantifier structure:** ∀k≥3, ∃f∈ℕ, ∀V ∀G, χ(G)≥f → ∃ odd cycle C in G s.t. χ(G[V(C)])≥k. This faithfully captures the problem statement. ✓ + +**Chromatic number type:** `G.chromaticNumber` has type `ℕ∞`. The threshold `f` is a natural number cast to `ℕ∞` via `(f : ℕ∞)`, correctly allowing comparison. The target `k` is similarly cast. ✓ + +**Odd cycle representation:** An odd cycle is represented as `p : G.Walk v v` with `p.IsCycle ∧ Odd p.length`. In Mathlib, `Walk.IsCycle` requires the walk to be a closed trail (no repeated edges) of length ≥ 1 with no repeated internal vertices. This is the standard definition of a cycle. ✓ + +**Induced subgraph on cycle vertices:** `G.induce {w : V | w ∈ p.support}` restricts $G$ to the vertex set of the cycle. `Walk.support` returns the list of all vertices visited; converting to a set removes the duplicate start/end vertex. This correctly models "the graph spanned by the cycle's vertices." ✓ + +**The `answer(sorry)` wrapper:** This is the standard pattern for open yes/no problems in the codebase, where the answer is unknown. ✓ + +**Potential subtlety — `Walk.support` membership:** For a cycle $v \to v_1 \to \cdots \to v_{n-1} \to v$, `Walk.support` is `[v, v_1, \ldots, v_{n-1}, v]`. The set `{w | w ∈ p.support}` correctly collapses the duplicate, yielding exactly the $n$ distinct vertices of the cycle. ✓ + +**No issues found.** The formalization is mathematically correct and complete for the primary problem statement. + +**Verdict:** Correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ No missed opportunities | +| Citations | ✅ Accurate and complete | +| Variants | ⚠️ Path-equivalence variant (Steiner) not mentioned | +| Readability | ✅ Clear and well-documented | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Mathematically sound | + +**Overall:** High-quality formalization. The only actionable item is optionally documenting the equivalent "path" variant noted by Steiner on the website. diff --git a/ai-review/641.md b/ai-review/641.md new file mode 100644 index 0000000000..e3dd8eef95 --- /dev/null +++ b/ai-review/641.md @@ -0,0 +1,100 @@ +# Review of Erdős Problem 641 + +## 1. Code Reuse + +**Erdős Problem 585** (`FormalConjectures/ErdosProblems/585.lean`) defines: + +```lean +def NoTwoEdgeDisjointCyclesSameVertexSet {n : ℕ} (G : SimpleGraph (Fin n)) : Prop := + ¬∃ (u v : Fin n) (c₁ : G.Walk u u) (c₂ : G.Walk v v), + c₁.IsCycle ∧ c₂.IsCycle ∧ + c₁.support.toFinset = c₂.support.toFinset ∧ + Disjoint c₁.edges.toFinset c₂.edges.toFinset +``` + +This is precisely the `k = 2` special case of the pattern used in Problem 641. The two problems are mathematically related (585 asks for max edges in graphs satisfying this property; 641 asks whether high chromatic number forces the negation of this property for general `k`). The idiom — `Walk.IsCycle`, `support.toFinset` equality, `Disjoint edges.toFinset` — is shared. A unified helper predicate parameterized by `k` could serve both files, but given that 585 only needs `k = 2` and already has a named definition, the duplication is minor and arguably clearer. + +Erdős Problems 583, 584, and 642 use similar walk/cycle/edge-disjointness patterns. The chromatic number helper lemmas in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` are available but not needed here since only the `≤ chromaticNumber` comparison is used. + +## 2. Citations + +The website (https://www.erdosproblems.com/641) lists: +- **Co-author**: Hajnal (the docstring correctly says "A problem of Erdős and Hajnal"). +- **[Er92b]**: Erdős, P., problems in combinatorics. +- **[Er97d, p.84]**: Erdős, P., some of my favourite problems, p.84. +- **Disproof**: Janzer, Steiner, and Sudakov. + +The formalization's citations match: `[Er92b]`, `[Er97d, p.84]`, and `[JSS24]`. These are consistent with the website. The citation style uses shorthand labels rather than full bibliographic entries, but this is the convention used throughout the codebase. No citations are missing. + +## 3. Variants + +The formalization provides two theorems: + +1. **`erdos_641`** — The original conjecture, marked as disproved (`answer(False)`). +2. **`erdos_641.variants.disproof`** — The existential negation (there exists `k` for which no threshold works). + +The website additionally notes a specific structural consequence of the disproof: the existence of a constant `c > 0` such that for sufficiently large `n`, there is an `n`-vertex graph with chromatic number at least `c · log log n / log log log n` that contains no 4-regular subgraph. This quantitative strengthening is not captured in the formalization. It could be added as a further variant, though it would require additional Lean infrastructure (e.g., stating regularity of subgraphs). Its omission is reasonable given the complexity. + +The connection to 4-regular subgraphs is mathematically important: two edge-disjoint cycles on the same vertex set yield a 4-regular subgraph (degree 2 from each cycle). The disproof constructs graphs with no 4-regular subgraph at all, which is strictly stronger. A brief comment noting this connection might aid readability but is not essential. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The module docstring clearly introduces the problem, its history, and its resolution. +- The two theorems have informative docstrings explaining the conjecture and its disproof. +- The use of `Fin k → Σ (v : Fin n), G.Walk v v` to encode a family of cycles is a clean pattern consistent with other problems (e.g., 583). +- The pairwise conditions (same vertex set, edge-disjoint) are clearly stated. + +Minor suggestion: the condition `(∀ i j, (cycles i).2.support.toFinset = (cycles j).2.support.toFinset)` quantifies over *all* pairs including `i = j`, which is harmless (reflexivity) but slightly loose. A more idiomatic version might fix a reference vertex set and require all cycles to match it, but the current formulation is logically equivalent and arguably more concise. + +## 5. Formalizability + +The problem is fully formalizable as stated. The key concepts — chromatic number, cycles in graphs, edge-disjointness, shared vertex sets — all have clean formal counterparts in Mathlib. + +**Ambiguity assessment: Low.** The phrase "k edge-disjoint cycles on the same set of vertices" has a clear mathematical meaning: k cycles that are pairwise edge-disjoint and share the same vertex set. The formalization faithfully captures this. There is no ambiguity in the original problem statement that would affect the formalization. + +## 6. Correctness + +### Quantifier structure + +The original problem asks: *"Is there some function f such that for all k ≥ 1, if χ(G) ≥ f(k) then..."* — this is a single function `f : ℕ → ℕ` that works uniformly for all `k`: + +``` +∃ f : ℕ → ℕ, ∀ k ≥ 1, ∀ G, χ(G) ≥ f(k) → [property] +``` + +The formalization instead uses: + +``` +∀ k ≥ 1, ∃ f : ℕ, ∀ G, χ(G) ≥ f → [property] +``` + +This swaps the quantifier order: for each `k`, there exists a (possibly different) threshold `f`. The formalized RHS is *weaker* than the original conjecture (a single uniform `f` implies per-`k` thresholds, but not vice versa). + +**However**, since both statements are **false** (the disproof shows failure at `k = 2`), this quantifier discrepancy has no effect on the truth value. Disproving the weaker statement is actually *harder*, so `answer(False) ↔ [weaker RHS]` is a strictly stronger claim — which is fine since it's still true. + +If the conjecture had been true, this distinction would matter: proving the formalized version would not suffice to establish the original conjecture. For a disproved problem, the mismatch is benign but worth noting for mathematical precision. + +**Recommendation**: Consider reformulating to match the original quantifier structure: + +```lean +∃ f : ℕ → ℕ, ∀ k : ℕ, 1 ≤ k → ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (f k : ℕ∞) ≤ G.chromaticNumber → ... +``` + +This would be a more faithful formalization of the original question, and the disproof (failure at `k = 2`) would still immediately apply. + +### Cycle representation + +Each cycle is `Σ (v : Fin n), G.Walk v v` — a starting vertex paired with a closed walk. `Walk.IsCycle` ensures the walk is a closed trail with distinct internal vertices, so each vertex has degree exactly 2 in the cycle. This correctly models graph-theoretic cycles. + +The use of `support.toFinset` to extract the vertex set of each cycle is correct: `support` lists vertices with the start repeated at the end, and `toFinset` eliminates duplicates. + +### Disproof variant + +`erdos_641.variants.disproof` states `∃ k ≥ 1, ∀ f, ∃ G, χ(G) ≥ f ∧ ¬[k edge-disjoint cycles]`. This is the logical negation of the main theorem's RHS, which is consistent. The docstring correctly notes `k = 2` suffices. + +### Overall correctness assessment + +The formalization is **mathematically correct** for the claim it makes. The quantifier order differs from the original problem statement but does not affect the truth value for this disproved conjecture. No experienced mathematician would identify a flaw in the logical content; the only observation would be the quantifier ordering difference noted above. diff --git a/ai-review/642.md b/ai-review/642.md new file mode 100644 index 0000000000..fbffbc89ea --- /dev/null +++ b/ai-review/642.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 642 + +## 1. Code Reuse + +**Problem 767** (`ErdosProblems/767.lean`) defines `HasCycleWithKChords`, which counts chords incident to a *single vertex* on a cycle, using an injective `Fin m → V` representation. Problem 642's `numChords` counts *all* chords of a cycle and uses the Mathlib-native `Walk.IsCycle` representation. These are meaningfully different concepts with different cycle representations, so no direct reuse is feasible. + +**Problem 81** (`ErdosProblems/81.lean`) defines `HasInducedCycle` (a cycle with *no* chords) and `IsChordal`. These are related concepts (chordality is the opposite extreme of the condition here), but the definitions serve different purposes and are not reusable. + +No relevant utilities were found in `FormalConjecturesForMathlib/` for chord counting or cycle-constraint edge maximization. The `numChords` definition is appropriately self-contained. + +## 2. Citations + +The formalization references: +- **[CES96]** Chen, Erdős, Staton — *Proof of a conjecture of Bollobás on nested cycles*, J. Combin. Theory Ser. B (1996). +- **[DMMS24]** Draganić, Methuku, Munhá Correia, Sudakov — *Cycles with many chords* (2024). +- **[Er97d]** Erdős — *Some old and new problems in various branches of combinatorics*, Discrete Math. (1997). + +The website (erdosproblems.com/642) lists the same three references. The website uses shorthand `[Er97d, p.84]` with a page number; the formalization omits the page number but includes the full title. This is acceptable. All citations are consistent with the website. + +## 3. Variants + +The website lists only the single question: "Is it true that f(n) ≪ n?" No variants or sub-problems are mentioned. The formalization captures exactly this question. **No missing variants.** + +## 4. Readability + +The code is well-structured and readable: + +- The `numChords` definition has a clear docstring explaining what a chord is. +- The theorem statement reads naturally: existence of a constant C bounding edges by C·n under the cycle-chord condition. +- The module docstring provides good mathematical context, including the problem history and known partial results. +- Variable declarations are cleanly separated from the definitions. + +**Minor suggestion:** The `numChords` docstring says "A chord is an edge of G connecting two vertices that appear in the walk's support but is not itself an edge traversed by the walk." This is accurate and clear. No readability issues. + +## 5. Formalizability + +The problem statement is precise and unambiguous: + +- "Cycle" has a standard graph-theoretic meaning (simple closed path), well-captured by `Walk.IsCycle`. +- "Chord" is explicitly defined in the problem statement: an edge between two non-consecutive vertices of the cycle. +- "More vertices than chords" is a clear numerical comparison. +- "f(n) ≪ n" means f(n) = O(n) in standard combinatorial notation, correctly formalized as ∃ C, ... ≤ C·n. + +**Assessment: Unambiguous.** The problem is straightforwardly formalizable with no room for interpretation differences. + +## 6. Correctness + +### 6.1 `numChords` definition (lines 53–55) + +```lean +noncomputable def numChords {u v : V} (p : G.Walk u v) : ℕ := + (G.edgeFinset.filter (fun e => + (∀ w, w ∈ e → w ∈ p.support.toFinset) ∧ e ∉ p.edges.toFinset)).card +``` + +This filters `G.edgeFinset` (a `Finset (Sym2 V)`) for edges where: +1. Both endpoints lie in the walk's vertex support (`∀ w, w ∈ e → w ∈ p.support.toFinset`). +2. The edge is not traversed by the walk (`e ∉ p.edges.toFinset`). + +This correctly captures the mathematical definition of a chord. For a cycle `v₀ → v₁ → ··· → vₘ₋₁ → v₀`, the chords are exactly the edges of G connecting cycle vertices that are not consecutive cycle edges. **Correct.** + +### 6.2 Cycle vertex count (line 69) + +`p.support.toFinset.card` for a cycle `p : G.Walk v v` with `p.IsCycle`: The walk support is the list `[v, v₁, ..., vₘ₋₁, v]` (start vertex repeated at end). Converting to a finset deduplicates, yielding `{v, v₁, ..., vₘ₋₁}` with cardinality m = number of distinct vertices in the cycle = number of cycle edges. This matches the standard meaning of "number of vertices" in a cycle. **Correct.** + +### 6.3 Theorem statement (lines 65–71) + +The statement asserts: ∃ C : ℕ, ∀ n, ∀ G on Fin n, (every cycle has more vertices than chords) → |E(G)| ≤ C·n. + +This is equivalent to asking whether f(n) = O(n), where f(n) is the extremal function. The use of `C : ℕ` rather than `C : ℝ` is a minor strengthening (integer constant vs. real constant), but since any real bound can be rounded up to an integer, this is mathematically equivalent. **Correct.** + +### 6.4 Use of `answer(sorry)` + +The problem is listed as **open** on the website. Using `answer(sorry)` is appropriate since the truth value is unknown. **Correct.** + +### 6.5 DecidableRel instance + +The `[DecidableRel G.Adj]` instance in the theorem quantification is needed for `G.edgeFinset` to be computable. This is a standard Lean/Mathlib technicality and does not affect mathematical content. **Correct.** + +### Overall assessment + +The formalization is **mathematically correct and complete**. The `numChords` definition faithfully captures the graph-theoretic notion of a chord, and the theorem statement correctly encodes the extremal question f(n) = O(n). No flaws identified. diff --git a/ai-review/643.md b/ai-review/643.md new file mode 100644 index 0000000000..fdb5312679 --- /dev/null +++ b/ai-review/643.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 643 + +## 1. Code Reuse + +Several other Erdős problem files define similar hypergraph structures that could potentially be unified: + +- **616.lean** (line 41): `structure UniformHypergraph (n r : ℕ)` with `edges : Finset (Finset (Fin n))` — very close to what 643 needs. +- **836.lean** (line 45): `structure Hypergraph (V : Type*)` with `IsUniform` predicate (line 49) — more general, parameterized over vertex type. +- **837.lean** (line 46): Another `structure UniformHypergraph (n k : ℕ)`. +- **1075.lean** (line 35): Yet another `structure UniformHypergraph (n r : ℕ)`. +- **747.lean** (line 51): Uses `Disjoint e₁ e₂` for vertex-disjoint edges, same pattern as the complementary pairs definition. + +The `IsUniformHypergraph` def in 643.lean is a plain predicate rather than a structure, which is simpler but less aligned with the rest of the codebase. A shared `UniformHypergraph` structure (like those in 616/837/1075) could serve multiple problems. However, `HasComplementaryPairs` is specific to this problem and has no reuse candidates. + +**Recommendation:** Consider adopting the `structure UniformHypergraph` pattern used elsewhere (e.g., 616.lean), or creating a shared utility. The current standalone definition works but contributes to fragmentation. + +## 2. Citations + +The docstring references match the website content well: + +| Docstring | Website | Status | +|-----------|---------|--------| +| [Er77b] Erdős, P., *Problems and results on combinatorial number theory III* | Consistent | OK | +| [Er97d] Erdős, P., *Some of my favourite problems in number theory, combinatorics, and geometry* | Consistent | OK | +| [Fu84] Füredi, Z., *Hypergraphs in which all disjoint pairs have distinct unions* | Consistent | OK | +| [PiVe09] Pikhurko, O. and Verstraëte, J., *Bounds on the size of a set with complementary pairs* | Consistent | OK | + +The docstring also correctly reproduces all the known bounds from the website (Füredi's bounds, Pikhurko–Verstraëte's improved bounds). No missing citations or discrepancies found. + +## 3. Variants + +The original problem has several layers: + +1. **The main asymptotic question** (formalized): Is $f(n;t) = (1+o(1))\binom{n}{t-1}$ for $t \geq 3$? +2. **The general estimation problem** (not formalized): "Estimate $f(n;t)$" — this is open-ended and difficult to formalize precisely. +3. **Füredi's conjecture** (not formalized): The lower bound $\binom{n-1}{t-1} + \lfloor(n-1)/t\rfloor$ is sharp for $t \geq 4$. +4. **The $t = 2$ case** (mentioned in docstring, not formalized): $f(n;2) = (1/2+o(1))n^{3/2}$ (equivalent to the Zarankiewicz problem for $C_4$). +5. **Existence of the limit** (not formalized): Whether $\lim_{n\to\infty} f(n;t)/\binom{n}{t-1}$ exists for $t \geq 4$. + +The formalization captures variant (1), which is the core question Erdős asked. Variants (3)–(5) are related but distinct conjectures. The omission of these is reasonable — Füredi's conjecture (3) is a separate, stronger conjecture, the $t=2$ case (4) is a known result, and (5) is a tangential question. + +**No significant variants are missing from what the problem directly asks.** + +## 4. Readability + +The code is clean and well-structured: + +- The namespace `Erdos643` keeps definitions local. +- `IsUniformHypergraph` and `HasComplementaryPairs` have clear docstrings explaining the mathematical meaning. +- The main theorem statement is readable and closely mirrors the mathematical formulation. +- The use of `({A, B} : Finset (Finset (Fin n))) ≠ {C, D}` to encode "distinct unordered pairs" is a natural Lean idiom. + +**Minor suggestion:** The docstring for `HasComplementaryPairs` says "$A \cap B = C \cap D = \emptyset$" but the code uses `Disjoint A B ∧ Disjoint C D`. While equivalent for `Finset`, one could add a brief note that `Disjoint` here means empty intersection for clarity to readers less familiar with Lean. + +## 5. Formalizability + +The problem has two parts with different formalizability: + +- **"Estimate $f(n;t)$"**: Not precisely formalizable — it's an invitation for bounds, not a yes/no question. +- **"Is it true that $f(n;t) = (1+o(1))\binom{n}{t-1}$?"**: Fully formalizable as an asymptotic statement. The epsilon-delta characterization used in the formalization is the standard way to express $g(n) = 1 + o(1)$. + +The formalization correctly targets the precise sub-question. The $o(1)$ notation is unambiguous in this context (it means $f(n;t)/\binom{n}{t-1} \to 1$ as $n \to \infty$ with $t$ fixed). + +**Formalizability: High.** The statement is precise and admits a clean formal encoding. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +**Upper bound direction:** The statement says that for $|H| > (1+\varepsilon)\binom{n}{t-1}$ the configuration is forced. This correctly encodes $f(n;t) \leq (1+\varepsilon)\binom{n}{t-1} + O(1)$, which for large $n$ gives $\limsup f(n;t)/\binom{n}{t-1} \leq 1 + \varepsilon$. Since $\varepsilon > 0$ is arbitrary, this yields $\limsup \leq 1$. + +**Lower bound direction:** The existence of $H$ with $|H| \geq (1-\varepsilon)\binom{n}{t-1}$ edges avoiding the configuration implies $f(n;t) > (1-\varepsilon)\binom{n}{t-1}$, hence $\liminf f(n;t)/\binom{n}{t-1} \geq 1 - \varepsilon$. Since $\varepsilon$ is arbitrary, $\liminf \geq 1$. + +**Together:** These give $f(n;t)/\binom{n}{t-1} \to 1$, which is exactly $f(n;t) = (1+o(1))\binom{n}{t-1}$. + +**Complementary pairs definition:** The condition `{A, B} ≠ {C, D}` (as unordered pairs) correctly prevents the trivial case where $(C,D)$ is just $(A,B)$ or $(B,A)$. In the $t$-uniform setting with $t \geq 3$, the disjointness conditions automatically ensure $A \neq B$ and $C \neq D$ (since $|A| = |B| = t > 0$). Furthermore, one can verify that all four edges $A, B, C, D$ must be distinct: if $A = C$, then $A \cup B = A \cup D$ with $A$ disjoint from both $B$ and $D$, forcing $B = D$ and contradicting $\{A,B\} \neq \{C,D\}$. Similarly for other identifications. + +**The `answer(sorry)` wrapper** is appropriate for an open problem where the truth value is unknown. + +**No mathematical errors or incompleteness found.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor fragmentation; could share `UniformHypergraph` with 616/837/1075 | +| Citations | Complete and accurate | +| Variants | Core question captured; omission of related conjectures is reasonable | +| Readability | Good | +| Formalizability | High — the statement is precise | +| Correctness | Correct and complete | diff --git a/ai-review/644.md b/ai-review/644.md new file mode 100644 index 0000000000..bce33eb0f8 --- /dev/null +++ b/ai-review/644.md @@ -0,0 +1,107 @@ +# Erdos Problem 644 — Review + +## 1. Code Reuse + +Several existing definitions in the codebase overlap with concepts used in 644.lean: + +- **`Hypergraph.IsUniform`** (ErdosProblems/834.lean:57–58) and **`UniformHypergraph`** (ErdosProblems/616.lean:41–43) both capture the notion of a k-uniform family. Problem 644 defines its own `IsKUniformFamily` which is functionally equivalent but uses the representation `ι → Finset ℕ` rather than a structured `Hypergraph` type or `UniformHypergraph` bundled structure. + +- **`Hypergraph.IsTransversal`** (834.lean:84–86) and **`IsTransversal`** (616.lean:46–47) define hitting sets (a set that intersects every edge). Problem 644 inlines this concept directly in the theorem statements rather than factoring it into a named definition. + +**Assessment:** The `IsKUniformFamily` definition is simple and self-contained, and the alternative representations (structured `Hypergraph` or `Fin n`-based `UniformHypergraph`) don't naturally fit Problem 644's setup, which requires an arbitrary index type and `Finset ℕ`-valued sets. The choice to use a lightweight function-based representation `ι → Finset ℕ` is reasonable here. However, the transversal condition `∀ i : ι, ∃ x ∈ T, x ∈ F i` is repeated verbatim in four places across the two theorems and could be factored into a named predicate (e.g., `IsTransversal F T`) for clarity and DRY. + +## 2. Citations + +The website (erdosproblems.com/644) lists two references: +- **[EFKT92]**: Erdős, P., Fon-Der-Flaass, D., Kostochka, A., and Tuza, Z. +- **[Er97d]**: Erdős, P. + +The formalization's docstring includes both references with the same shorthand identifiers. The website itself does not provide full bibliographic titles or journal details beyond author names, so the formalization matches the available source. No citations are missing. + +## 3. Variants + +The website poses two questions: +1. Is f(k,7) = (1+o(1))(3/4)k? +2. For every r ≥ 3, does there exist c_r such that f(k,r) = (1+o(1))c_r·k? + +Both are captured: +- `erdos_644` formalizes question 1 (r = 7, c = 3/4). +- `erdos_644.variants.general_constant` formalizes question 2 (general r ≥ 3, existential c). + +The known exact results f(k,3) = 2k, f(k,4) = ⌊3k/2⌋, f(k,5) = ⌊5k/4⌋, f(k,6) = k are mentioned in the module docstring but not formalized as separate theorems. Since these are established results rather than open conjectures, their omission is defensible, though formalizing them as `known_result` lemmas would strengthen the file. + +**All variants from the source are captured.** + +## 4. Readability + +The code is well-structured: +- The module docstring clearly states the problem, known results, and references. +- Helper definitions (`IsKUniformFamily`, `HasRWisePairHitting`) are cleanly separated with their own docstrings. +- The theorem docstrings explain the mathematical content in standard notation. + +**Suggestions:** +- Extract the repeated transversal condition `∀ i : ι, ∃ x ∈ T, x ∈ F i` into a named definition `IsHittingSet F T` or similar. This would reduce duplication across the four occurrences (two per theorem) and make the theorem statements more scannable. +- The Part 2 theorem name `erdos_644.variants.general_constant` is clear and follows project conventions. + +## 5. Formalizability + +The problem is precisely stated and straightforwardly formalizable. The key mathematical concepts are: +- k-uniform set families (finite sets of fixed cardinality) +- r-wise pair-hitting property (every r members can be "pierced" by some pair) +- Transversal / hitting set (a set intersecting every member) +- Asymptotic behavior f(k,r) ~ c·k captured via ε-δ quantification + +The o(1) asymptotic notation is the main potential source of ambiguity, but the ε-K₀ formulation used in the code is the standard and unambiguous way to formalize it. + +**Ambiguity level: Low.** The problem admits a clean, unambiguous formalization. + +## 6. Correctness + +### 6.1 The o(1) formalization + +The statement f(k,7) = (1+o(1))(3/4)k is equivalent to: for all ε > 0, for sufficiently large k, (3/4 − ε)k ≤ f(k,7) ≤ (3/4 + ε)k. The formalization captures this as: +- **Upper bound:** Every k-uniform family with 7-wise pair-hitting has a transversal of size ≤ (3/4 + ε)k. +- **Lower bound:** There exists a k-uniform family with 7-wise pair-hitting where every transversal has size ≥ (3/4 − ε)k. + +This correctly encodes (3/4 − ε)k ≤ f(k,7) ≤ (3/4 + ε)k. **Correct. ✓** + +### 6.2 HasRWisePairHitting: injectivity of S + +The definition quantifies over all functions `S : Fin r → ι`, including non-injective ones. The original problem says "every collection of r of the A_i's," which typically means r *distinct* sets. However, if S is non-injective, its image contains fewer than r distinct sets, and any pair hitting r distinct sets automatically hits any sub-collection. Therefore the non-injective cases are implied by the injective cases, making the two formulations equivalent. **Correct. ✓** + +### 6.3 HasRWisePairHitting: the pair {x, y} allows x = y + +The definition `∃ x y : ℕ, ∀ j, x ∈ F (S j) ∨ y ∈ F (S j)` does not require x ≠ y. If x = y, the condition reduces to a single element hitting all r sets (a common element). The original problem says "some pair {x, y}" which in standard combinatorial usage means a 2-element set (x ≠ y). + +However, allowing x = y only *weakens* the hypothesis (more families satisfy the r-wise pair-hitting condition), which makes: +- The upper bound statement *stronger* (must hold for a larger class of families). +- The lower bound statement *weaker* (more families available as witnesses, but the witness still needs to demonstrate large transversal size; families with common elements in every r-tuple would have trivially small transversals, so they wouldn't serve as useful lower-bound witnesses anyway). + +In practice, this discrepancy is unlikely to affect the truth of the asymptotic statement, but it is technically a deviation from the standard meaning. **Minor issue — mathematically inconsequential for the asymptotic result, but adding `x ≠ y` would be more faithful to the original statement.** + +### 6.4 Ground set restricted to ℕ + +The formalization uses `Finset ℕ` for the sets in the family. Since all sets are finite, any ground set can be encoded into ℕ, so this is without loss of generality. **Correct. ✓** + +### 6.5 Index type universe + +The quantification `∀ (ι : Type)` (Type 0) is sufficient. For finite sets over ℕ, only countably many distinct sets exist, so any family has at most countably many distinct members. A Type 0 index suffices. **Correct. ✓** + +### 6.6 Part 2: general_constant + +The Part 2 formalization correctly existentially quantifies over c > 0 and uses the same ε-δ pattern. The requirement c > 0 is appropriate since f(k,r) grows linearly in k for all known values of r. **Correct. ✓** + +### 6.7 Wrapping in `answer(sorry)` + +Both theorems use the `answer(sorry) ↔ ...` pattern, which is appropriate for open problems where the truth value is unknown. **Correct. ✓** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor: transversal condition could be factored out; existing `Hypergraph` types don't naturally fit | +| Citations | Complete — matches website | +| Variants | Complete — both questions captured | +| Readability | Good; minor improvement possible by extracting transversal predicate | +| Formalizability | High — low ambiguity, standard ε-δ encoding of asymptotics | +| Correctness | Sound overall. One minor point: `HasRWisePairHitting` allows x = y (degenerate "pair"), which is technically more permissive than the standard combinatorial meaning of "pair {x,y}." This is mathematically inconsequential for the asymptotic result but could be tightened with an `x ≠ y` constraint for faithfulness. | diff --git a/ai-review/646.md b/ai-review/646.md new file mode 100644 index 0000000000..471eb12ab5 --- /dev/null +++ b/ai-review/646.md @@ -0,0 +1,94 @@ +# Review: Erdős Problem 646 + +**File:** `FormalConjectures/ErdosProblems/646.lean` + +## 1. Code Reuse + +No existing helper lemmas in `FormalConjecturesForMathlib/` directly apply. However, some related infrastructure exists: + +- **`FormalConjecturesForMathlib/Data/Nat/Squarefree.lean`** defines `squarefreePart` using factorization and has lemmas about even/odd exponents. In principle, "n! is divisible by an even power of every p_i" is equivalent to saying the squarefree part of n! is coprime to ∏ p_i. However, the current formulation using `Even (padicValNat p n.factorial)` is more direct and readable. +- **Mathlib's `padicValNat_factorial`** (Legendre's formula) is the key computation tool: `v_p(n!) = ∑_{i≥1} ⌊n/p^i⌋`. This is already available via the standard imports. +- **`FormalConjectures/ErdosProblems/404.lean`** uses a similar pattern (`padicValNat p (∑ i ∈ S, i.factorial)`) but addresses a different question (bounding p-adic valuations of sums of factorials). No code can be directly shared. + +**Verdict:** No actionable code reuse opportunities. The formalization is appropriately self-contained. + +## 2. Citations + +The website ([erdosproblems.com/646](https://www.erdosproblems.com/646)) lists three references: + +| Reference | Website | Lean file | +|-----------|---------|-----------| +| [ErGr80, p. 77] | ✅ Listed | ❌ Missing | +| [Er97e] | ✅ Listed | ❌ Missing | +| [Be97] | ✅ Listed | ✅ Present (with full bibliographic data) | + +**Issue:** The docstring omits the original Erdős–Graham reference **[ErGr80]** (Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number theory*, Monographies de L'Enseignement Mathématique, 1980, p. 77) and **[Er97e]**. The [ErGr80] reference is the original source of the problem and should be cited. The Berend [Be97] citation is correct and complete. + +**Recommendation:** Add [ErGr80, p. 77] to the module docstring. Optionally add [Er97e] if the full reference can be identified (it appears to be one of Erdős's 1997 problem collection papers). + +## 3. Variants + +The website notes that Berend proved a **stronger result**: not only are there infinitely many such n, but the sequence of such n has **bounded gaps** (where the bound depends on the initial set of primes). + +This bounded-gaps result is mentioned in the module docstring but is **not formalized**. A natural formalization would be: + +```lean +/-- Berend's stronger result: the sequence of n where n! has even p-adic +valuation for all primes in the set has bounded gaps. -/ +theorem erdos_646.variants.bounded_gaps : + ∀ (primes : Finset ℕ), (∀ p ∈ primes, Nat.Prime p) → + ∃ B : ℕ, ∀ n : ℕ, ∃ m ∈ Set.Icc n (n + B), + ∀ p ∈ primes, Even (padicValNat p m.factorial) := by + sorry +``` + +**Recommendation:** Consider adding the bounded-gaps variant, since it is the actual content of Berend's theorem and is strictly stronger than mere infinitude. + +## 4. Readability + +The formalization is clean and readable. Minor observations: + +- The `answer(True) ↔` wrapper clearly communicates this is a yes/no problem with answer "yes." +- The set-builder notation `{n : ℕ | ∀ p ∈ primes, Even (padicValNat p n.factorial)}` directly mirrors the mathematical statement. +- The namespace `Erdos646` is consistent with project conventions. +- The category tag `@[category research solved, AMS 11]` correctly marks this as solved. + +**Verdict:** No readability improvements needed. + +## 5. Formalizability + +The original problem asks: "Are there infinitely many n such that n! is divisible by an even power of each of the p_i?" + +**Ambiguity analysis:** + +- **"divisible by an even power"** could theoretically mean (a) the exact exponent of p in n! is even, or (b) there exists some even k such that p^k | n!. Interpretation (b) is trivially true for all n (take k = 0), so interpretation (a) is clearly intended. The formalization correctly uses interpretation (a) via `Even (padicValNat p n.factorial)`. +- **"distinct primes"** — The problem says "let p_1, ..., p_k be distinct primes." Using `Finset ℕ` with the condition `∀ p ∈ primes, Nat.Prime p` correctly captures this: elements of a `Finset` are distinct by definition. +- **Quantifier structure** — The problem implicitly quantifies universally over all finite sets of primes. The formalization correctly does `∀ (primes : Finset ℕ), (∀ p ∈ primes, Nat.Prime p) →`. + +**Verdict:** The problem is unambiguous (up to the trivial interpretation issue) and straightforwardly formalizable. Assessment: **low ambiguity**. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the main statement. + +Detailed verification: + +- **Direction:** `answer(True)` asserts the answer is "yes," consistent with Berend's proof. +- **Quantification:** Universal over all finite sets of primes — correct. +- **Core predicate:** `Even (padicValNat p n.factorial)` correctly captures "the exponent of p in the prime factorization of n! is even," which is equivalent to "n! is divisible by an even power of p" under the standard interpretation. +- **Infinitude:** `Set.Infinite` correctly captures "infinitely many n." +- **Edge case — empty set:** When `primes = ∅`, the condition `∀ p ∈ primes, ...` is vacuously true for all n, so the set is `Set.univ`, which is infinite. This is mathematically harmless and consistent with the universal quantifier. +- **Edge case — n = 0:** `0! = 1`, so `padicValNat p 1 = 0`, which is even. So n = 0 is always in the set. This is fine. + +**Verdict:** The formalization is correct. No mathematical flaws. The only incompleteness is the missing bounded-gaps variant (see §3), which goes beyond the original question. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No opportunities — appropriate | +| Citations | **Missing [ErGr80, p. 77] and [Er97e]** | +| Variants | **Bounded-gaps variant not formalized** | +| Readability | Good | +| Formalizability | Low ambiguity, straightforward | +| Correctness | Correct and complete for the main statement | diff --git a/ai-review/648.md b/ai-review/648.md new file mode 100644 index 0000000000..023a88df7f --- /dev/null +++ b/ai-review/648.md @@ -0,0 +1,99 @@ +# AI Review: Erdős Problem 648 + +## 1. Code Reuse + +**`greatestPrimeFactor` definition is duplicated.** Problem 648 defines its own `greatestPrimeFactor` at line 42 as `n.primeFactorsList.foldr max 0`. This identical definition appears in at least two other files: +- `ErdosProblems/649.lean:33` +- `ErdosProblems/976.lean:34` + +Additionally, a shared utility `Nat.maxPrimeFac` exists in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean:28`, defined as `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. This is mathematically equivalent for `n > 1` and also returns `0` for `n ≤ 1` (for `n = 0` via `Set.Infinite.Nat.sSup_eq_zero`, for `n = 1` via the empty set). The shared definition comes with supporting lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`). + +**Recommendation:** Replace the local `greatestPrimeFactor` with `Nat.maxPrimeFac` from the shared utility, or at minimum consolidate the three identical `primeFactorsList.foldr max 0` definitions into one shared computable definition. + +The `sSup` + `Fin t` + `StrictMono` pattern for defining "longest subsequence with property" is a well-established idiom in the codebase (see Problems 357, 400, 391). No further reuse concern there. + +The asymptotic statement uses explicit constants rather than the `=O[atTop]` notation from `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean`. This is a reasonable choice since the theorem captures a two-sided bound (≍) rather than a one-sided big-O, and the explicit formulation is arguably clearer. + +## 2. Citations + +The docstring references `[Ca25b]` (Cambie, S., _Longest decreasing sequences of largest prime factors_), which matches the website. + +**Missing citation:** The website also lists the original source as `[Er95c]`, which is not mentioned in the docstring. This should be added to indicate the problem's origin. + +**Missing OEIS reference:** The website references OEIS sequence **A391750** as related to this problem. This could be noted in the docstring for completeness. + +## 3. Variants + +The docstring correctly describes Cambie's further question: whether there exists a constant $c$ such that $g(n) \sim c\sqrt{n/\log n}$, with $2 \leq c \leq 2\sqrt{2}$. + +**This variant is not formalized.** A natural companion conjecture would be: + +``` +conjecture erdos_648_variant : + ∃ c : ℝ, 2 ≤ c ∧ c ≤ 2 * √2 ∧ + Filter.Tendsto (fun n => (g n : ℝ) / √((n : ℝ) / Real.log (n : ℝ))) + Filter.atTop (nhds c) +``` + +This is an open question (not yet proven) and would capture the stronger asymptotic claim. Whether to include it depends on project conventions for open sub-questions. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstring for `g` is clear and matches the mathematical definition. +- The theorem docstring correctly explains the asymptotic notation $\asymp$. +- The `open Real` at the top is appropriate given the use of `Real.sqrt` and `Real.log`. +- Namespace `Erdos648` keeps definitions local and avoids clashes. + +**No significant readability issues.** + +## 5. Formalizability + +The problem is **fully formalizable as stated**. There is no ambiguity: + +- $P(m)$ (greatest prime factor) is a standard, well-defined function. +- $g(n)$ is defined as the maximum length of a strictly increasing sequence in $[2, n)$ with strictly decreasing greatest prime factors. This is well-defined since the domain is finite, so the maximum exists. +- The asymptotic relation $g(n) \asymp \sqrt{n/\log n}$ has a standard mathematical meaning (two-sided bound with positive constants, eventually). + +**Ambiguity assessment: None.** The statement is precise and admits a unique formalization up to cosmetic choices. + +## 6. Correctness + +### Definition of `greatestPrimeFactor` +`n.primeFactorsList.foldr max 0` returns the maximum element of the prime factors list, or `0` if the list is empty (i.e., when $n \leq 1$). This correctly models $P(m)$ for the intended domain ($m \geq 2$). + +### Definition of `g` +The `sSup` is well-behaved here: +- **Nonemptiness:** $t = 0$ is in the set (the empty sequence vacuously satisfies all conditions). +- **Boundedness:** Any valid sequence has at most $n - 2$ elements (integers in $[2, n)$), and in fact at most $\pi(n)$ elements (since the `StrictAnti` condition on greatest prime factors requires distinct prime factor values). So the set is bounded above. +- Thus `sSup` returns the actual maximum, which matches the intended definition. + +The constraints correctly capture the original problem: +- `∀ i, 2 ≤ a i ∧ a i < n` — all elements in $[2, n)$ ✓ +- `StrictMono a` — the sequence is strictly increasing (since `Fin t` is totally ordered) ✓ +- `StrictAnti (fun i => greatestPrimeFactor (a i))` — greatest prime factors strictly decrease ✓ + +### Theorem statement +The formalization: +```lean +∃ c₁ c₂ : ℝ, 0 < c₁ ∧ 0 < c₂ ∧ +∃ N : ℕ, ∀ n : ℕ, N ≤ n → + c₁ * Real.sqrt ((n : ℝ) / Real.log (n : ℝ)) ≤ (g n : ℝ) ∧ + (g n : ℝ) ≤ c₂ * Real.sqrt ((n : ℝ) / Real.log (n : ℝ)) +``` + +This is the standard formalization of $g(n) \asymp \sqrt{n/\log n}$. For small $n$ where $\log n \leq 0$, the expression $\sqrt{n/\log n}$ becomes $\sqrt{\text{negative}} = 0$ under `Real.sqrt`, but the "for sufficiently large $n$" clause ($N \leq n$) ensures we only evaluate at $n$ where $\log n > 0$ (i.e., $n \geq 3$). This is handled correctly. + +**Verdict: The formalization is mathematically correct and complete.** No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `greatestPrimeFactor` should use shared `Nat.maxPrimeFac` or be consolidated | +| Citations | Missing `[Er95c]` (original source) and OEIS A391750 | +| Variants | Cambie's constant question described but not formalized | +| Readability | Good, no issues | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/649.md b/ai-review/649.md new file mode 100644 index 0000000000..250d8ddd12 --- /dev/null +++ b/ai-review/649.md @@ -0,0 +1,74 @@ +# AI Review: Erdős Problem 649 + +## 1. Code Reuse + +**Issue found.** The file defines a local `greatestPrimeFactor` (line 33) using `n.primeFactorsList.foldr max 0`, but the codebase already has a canonical library definition `Nat.maxPrimeFac` in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean`, defined as `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. This library definition: + +- Has the same junk value behavior (returns 0 for n ≤ 1). +- Comes with proven lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`). +- Is already used by closely related consecutive-integer problems: Problem 370 (line 38), Problem 371 (line 33), and Problem 373. + +The local definition is an exact duplicate of the one in Problem 648 (`Erdos648.greatestPrimeFactor`). **Recommendation:** Replace the local `greatestPrimeFactor` with `Nat.maxPrimeFac` to align with the established pattern in the codebase and enable reuse of existing lemmas. + +## 2. Citations + +The formalization cites: +- `[Er95c]` as: *Erdős, P., "Some of my favourite problems which recently have been solved".* + +The website (erdosproblems.com/649) lists additional references: +- **[Ma35]** Mahler — on prime factors of n(n+1). **Missing from the formalization.** +- **[Ro64b]** Rotkiewicz — result on primitive roots. **Missing from the formalization.** + +The website also documents specific results by **Alan Tong** (for any prime p, infinitely many primes q make the statement fail, via quadratic reciprocity) and **Euro Vidal Sampaio** (observations about the p=19, q=2 case), and a connection to the **2020 Romanian Mathematical Olympiad** (Problem 6). None of these are mentioned in the formalization. + +**Recommendation:** Add the missing citations [Ma35] and [Ro64b] to the docstring, and consider noting the extended results by Tong and Sampaio. + +## 3. Variants + +The website describes several natural extensions/variants: + +1. **Tong's generalization:** For any prime p, there are infinitely many primes q for which the pair (p, q) fails. This strengthens the counterexample beyond just (2, 7). **Not captured.** +2. **Sampaio's observation:** The problem fails when one prime is 2 in a broader family of cases (e.g., p=19, q=2 forces 73 | n). **Not captured.** +3. **Romanian Olympiad variant:** Infinitely many odd primes p exist where P(n)P(n+1) ≠ 2p for all n. **Not captured.** + +**Recommendation:** Consider adding at least one variant theorem, particularly Tong's stronger result, which is a natural strengthening of the disproof. + +## 4. Readability + +The code is short and readable. Minor observations: + +- The docstring clearly states the problem, the answer (no), and the key counterexample (p=2, q=7, no solutions to 2^k ≡ -1 mod 7). This is good. +- The namespace `Erdos649` is clean and appropriately scoped. +- The local `greatestPrimeFactor` definition is clear, though as noted above it should be replaced with the library version for consistency. + +No significant readability issues. + +## 5. Formalizability + +**High formalizability.** The problem statement is completely precise: given two primes p and q, does there exist n > 0 such that P(n) = p and P(n+1) = q? There is no ambiguity in the mathematical content. + +The disproof is also concrete and elementary: one must show that 2^k ≢ -1 (mod 7) for all k, which is a finite check (the powers of 2 mod 7 cycle through {1, 2, 4} and never hit 6). This is straightforwardly formalizable. + +**Ambiguity level: None.** The statement is fully precise. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- The statement `answer(False) ↔ ∀ p q, Prime p → Prime q → ∃ n, 0 < n ∧ greatestPrimeFactor n = p ∧ greatestPrimeFactor (n + 1) = q` correctly encodes: "The answer is no (False) if and only if the universal claim holds." Since the answer is indeed no (the claim is false), `answer(False)` is the right wrapper. +- The constraint `0 < n` is necessary and correct — without it, n = 0 would give `greatestPrimeFactor 0 = 0`, which is not prime. +- The `greatestPrimeFactor` function returns 0 for n ≤ 1, which correctly makes P(1) = 0 ≠ any prime, so n = 1 would need both P(1) = p (impossible) — this is fine. +- The docstring correctly identifies the counterexample: p = 2, q = 7 fails because if P(n) = 2 then n = 2^k, and we need 7 | (2^k + 1), i.e., 2^k ≡ -1 ≡ 6 (mod 7). Since ord_7(2) = 3 and the powers cycle {1, 2, 4}, we never reach 6. This is correct. + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | **Should use `Nat.maxPrimeFac`** from library instead of local definition | +| Citations | **Incomplete** — missing [Ma35] and [Ro64b] from website | +| Variants | **Not captured** — Tong's generalization and others missing | +| Readability | Good | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/65.md b/ai-review/65.md new file mode 100644 index 0000000000..2a20a6f01b --- /dev/null +++ b/ai-review/65.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 65 + +## 1. Code Reuse + +Several existing definitions in the codebase could be repurposed: + +- **`cycleLengths` (Problem 751, line 40–41)** and **`cycleSpectrum` (Problem 84, line 50–51)** both define the set of cycle lengths in a graph identically: + ``` + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} + ``` + The formalization of Problem 65 rebuilds this concept inline via universally quantified `T_G` and `T_K` Finsets constrained to equal the cycle-length set. Extracting a shared `cycleLengths` definition (or promoting one of the existing ones) would reduce redundancy across at least three problems. + +- **Mathlib's `completeBipartiteGraph`** (defined in `Mathlib.Combinatorics.SimpleGraph.Basic`) constructs `SimpleGraph (V ⊕ W)`. The formalization defines a custom `completeBipartiteGraph65` on `Fin (a + b)` using index arithmetic. Problem 567 already uses the Mathlib version (`completeBipartiteGraph (Fin 3) (Fin 3)`). While the custom definition avoids dealing with `Sum` types, it introduces a redundant definition that must be independently verified. Switching to Mathlib's version (with an equivalence `Fin (a + b) ≃ Fin a ⊕ Fin b`) would be more canonical. + +## 2. Citations + +The formalization's docstring references: + +- **[GKS84]** — Gyárfás, Komlós, Szemerédi, 1984 — ✅ Matches the website. +- **[LiMo20]** — Liu and Montgomery, published J. Amer. Math. Soc. 36 (2023), 1191–1234 — ✅ Matches the website (preprint 2020, published 2023). + +**Missing citation:** The website lists an additional result: **Montgomery et al. (forthcoming)**, which demonstrated that for sufficiently large $k$, the sum is actually **maximized** (not minimized) when $G$ is complete bipartite. This result is critical context (see §6 Correctness) and should be referenced in the docstring. + +**Related problem:** The website also references **Problem #57** as related. This cross-reference is absent from the docstring. + +## 3. Variants + +The original problem on erdosproblems.com asks two questions: + +1. Is $\sum 1/a_i \gg \log k$? +2. Is the sum minimized when $G$ is a complete bipartite graph? + +The formalization only addresses question (2). Question (1) — the asymptotic lower bound — is not formalized but is noted as proved in the docstring. This is acceptable since (1) is resolved, though a separate theorem capturing the proved bound could be valuable for completeness. + +The formalization restricts to graphs where the edge count is exactly $a \cdot b$ for some partition $a + b = n$. This is a reasonable way to compare against $K_{a,b}$, but it is a narrower statement than the original question which considers arbitrary $kn$ edges. A more general formulation might quantify: for all $G$ with $n$ vertices and $e$ edges, $\sum 1/a_i \geq \min_{a+b=n, ab \leq e} \sum_{K_{a,b}} 1/a_i$. + +## 4. Readability + +Several readability improvements are possible: + +- **Inline cycle-length sets are verbose.** The `T_G` construction takes 3 lines of hypotheses (lines 67–69) to say "T_G is the set of cycle lengths of G." Similarly for `T_K` (lines 71–74). Using a named definition like `cycleLengths` would reduce this to a single line each. + +- **Existential quantification of `T_K` is unnecessary.** Since $K_{a,b}$ is fixed once $a$ and $b$ are given, `T_K` is determined — it's the cycle lengths of `completeBipartiteGraph65 a b`. The existential `∃ (T_K : Finset ℕ), ...` makes it look like there is a choice, when in fact the constraints uniquely determine `T_K`. It would be clearer to define `T_K` directly (e.g., as a `let` binding or a separate definition). + +- **Namespace helps** — the `Erdos65` namespace is good practice. + +## 5. Formalizability + +The problem as stated on the website is reasonably precise but has some ambiguity: + +- **"Minimised by the complete bipartite graph"** — which complete bipartite graph? For a given $n$ and edge count $e = kn$, there may be multiple partitions $a + b = n$ with $ab$ close to $e$. The formalization sidesteps this by parameterizing over $(a, b)$ and requiring $ab = |E(G)|$ exactly, but this means it only applies when $kn$ factors as $ab$ with $a + b = n$. + +- **"$kn$ edges"** — the parameter $k$ can be non-integer in general (e.g., $n = 5, e = 7$ gives $k = 7/5$). The formalization avoids $k$ entirely and works with exact edge counts, which is appropriate. + +- **Overall assessment:** The core mathematical content is precise enough to formalize. The main ambiguity is which complete bipartite graph to compare against, and the formalization makes a reasonable choice. **Moderate ambiguity** — the formalization resolves it in one particular way. + +## 6. Correctness + +**CRITICAL ISSUE — Likely false as stated.** According to the erdosproblems.com page, Montgomery et al. (forthcoming) demonstrated that for sufficiently large $k$, the sum $\sum 1/a_i$ is actually **maximized** (not minimized) by the complete bipartite graph. If this result is correct, then the formalization's inequality direction: + +$$\sum_{m \in T_K} \frac{1}{m} \leq \sum_{m \in T_G} \frac{1}{m}$$ + +is the **wrong direction** — the complete bipartite graph would have the *largest* sum, not the smallest. The `answer(sorry)` wrapper provides some protection (it could evaluate to `False`), but the docstring and variable naming strongly suggest the intended reading is that $K_{a,b}$ minimizes the sum. + +**If Montgomery et al.'s result holds:** The conjecture as posed by Erdős is answered in the **negative** — $K_{a,b}$ does not minimize the sum. The formalization should either: + - Be updated to reflect the negative answer (with `answer(sorry)` resolving to `False`), or + - Be reformulated to capture the *correct* extremal question (what *does* minimize the sum?), or + - At minimum, document the Montgomery et al. result in the docstring and note the conjecture may be false. + +**Other correctness observations:** +- The constraint `a * b = G.edgeFinset.card` correctly ensures equal edge counts for comparison. +- The `completeBipartiteGraph65` definition correctly implements $K_{a,b}$ on `Fin (a + b)`. +- The `[DecidableRel G.Adj]` instance is correctly placed for `edgeFinset` to be computable. +- The use of `1 / (m : ℝ)` for the reciprocal sum is correct (integer division would lose information). + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code Reuse | Opportunities exist (`cycleLengths`, Mathlib's `completeBipartiteGraph`) | +| Citations | Missing Montgomery et al. (forthcoming); missing cross-ref to Problem 57 | +| Variants | Only formalizes question (2); question (1) omitted (acceptable since proved) | +| Readability | Verbose inline cycle-length sets; unnecessary existential for T_K | +| Formalizability | Moderate ambiguity in original statement; formalization makes reasonable choices | +| Correctness | **Likely false** — recent results suggest K_{a,b} maximizes, not minimizes, the sum | diff --git a/ai-review/650.md b/ai-review/650.md new file mode 100644 index 0000000000..9d811be277 --- /dev/null +++ b/ai-review/650.md @@ -0,0 +1,128 @@ +# Review: Erdős Problem 650 + +## 1. Code Reuse + +The codebase defines asymptotic notation `≪` and `≫` in +`FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean` (lines 20–21) via +`Asymptotics.IsBigO`. The theorem `erdos_650` manually unrolls the `≪` condition +(∃ C > 0, ∃ M₀, ∀ m ≥ M₀, f(m) ≤ C · √m) rather than using: + +```lean +(fun m => (erdos650F m : ℝ)) ≪ (fun m => Real.sqrt (m : ℝ)) +``` + +These are equivalent for non-negative functions, and using `≪` would be more +concise and consistent with other problems in the codebase. + +Problem 648 (`ErdosProblems/648.lean`) has a nearly identical structure: +`sSup`-defined extremal function, `Real.sqrt`, and explicit asymptotic bounds. +The two files share the same pattern but no definitions are factored out. This is +acceptable given that the problems define different combinatorial objects. + +Problem 691 (`ErdosProblems/691.lean`) defines `countMultiples` for counting +integers in a range divisible by elements of a set. This is related to but +distinct from the matching notion in 650 (691 counts total multiples; 650 counts +a maximum *matching* of multiples to distinct set elements). + +No existing utility definition can replace `divMatchCount` or `erdos650F`. + +## 2. Citations + +The formalization cites: +- `[Er95c]` — Erdős, P., *Problems and results in combinatorial number theory*. +- `[ErSa59]` — Erdős, P. and Sarányi, J. + +The erdosproblems.com page sources the problem to **[Er95c, p.5]**, which matches. +However, the website indicates the problem was **solved** by Erdős and Selfridge +(referenced in works from 1978 and 1986). This solving result is not cited. + +The citation for [ErSa59] is incomplete — it lacks a title and publication venue. +The full reference should be: +> Erdős, P. and Sarányi, J., *Über ein Extremalproblem*, (1959). + +## 3. Variants + +The erdosproblems.com page mentions a **stronger result**: $f(st) \leq s + t$ +for all integers $s, t \geq 1$, which implies $f(m) \leq 2\lceil\sqrt{m}\rceil$. +This sharper variant is not captured by the formalization, which only states the +weaker $f(m) \ll m^{1/2}$. Formalizing the stronger bound would be a natural +addition: + +```lean +theorem erdos_650_strong : + ∀ s t : ℕ, 1 ≤ s → 1 ≤ t → erdos650F (s * t) ≤ s + t := by sorry +``` + +## 4. Readability + +The code is well-structured and readable. The docstrings on `divMatchCount` and +`erdos650F` clearly explain the mathematical meaning. Minor suggestions: + +- The module docstring says "the interval $[t, t+2N)$ contains at least $f(m)$ + integers each divisible by a distinct element of $A$." This could be slightly + misleading — it's not that each integer is divisible by a distinct element, but + rather that there exists a *matching* of at least $f(m)$ integers to distinct + elements. The formal definition is correct; the English phrasing could be + tightened. +- The `2 * N` in the Lean code corresponds to `2N` in the math — this is clear. + +## 5. Formalizability + +The problem is clearly formalizable. The key concepts (bipartite matching via +injective functions, interval containment, divisibility) all have direct Lean +representations. The `sSup`/`sInf` approach is standard in this codebase. + +**Ambiguity assessment: Low.** The mathematical statement is precise. The only +mild ambiguity is whether $N \geq 1$ is required; this is implicitly enforced by +the constraint $A \subseteq \{1, \ldots, N\}$ with $|A| = m \geq 1$. + +## 6. Correctness + +### Definitions + +**`divMatchCount`** (lines 41–46): Correctly defines the maximum matching size. +The use of `Fin r → ℕ` with `Function.Injective` on both `b` and `a` correctly +encodes "r distinct integers matched to r distinct set elements." The case +$r = 0$ is vacuously satisfied (empty functions), ensuring the set is nonempty +and `sSup` is well-defined. The set is bounded above by $\min(|A|, 2N)$, so +`sSup` on `ℕ` returns the correct maximum. + +**`erdos650F`** (lines 51–54): Correctly computes the infimum (worst-case) +matching count over all valid configurations $(N, A, t)$. The `sInf` on `ℕ` is +well-founded, so this returns the minimum achievable value. This matches the +mathematical definition of "largest value *guaranteed*." + +### Theorem statement + +**`erdos_650`** (lines 62–67): The right-hand side correctly states $f(m) \leq +C\sqrt{m}$ for sufficiently large $m$, with $C > 0$. + +### Critical issue: Problem status + +The formalization is tagged `category research open`, but the erdosproblems.com +page indicates the problem is **solved** — the answer is **yes**. Erdős and +Selfridge established $f(m) \ll m^{1/2}$, confirming the conjecture. Combined +with the Erdős–Sarányi lower bound $f(m) \gg m^{1/2}$, this gives +$f(m) \asymp m^{1/2}$. + +Accordingly: +- The tag should be changed from `category research open` to + `category research solved`. +- The `answer(sorry)` should be replaced with `answer(True)`. + +### Minor note on `sInf` edge case + +When $m = 0$, the set $A$ is empty, and `divMatchCount ∅ t N = 0` for all $t, N$ +(no elements to match). So `erdos650F 0 = 0`, and the theorem's RHS holds +vacuously (with any $M_0 \geq 1$). This edge case is handled correctly. + +## Summary + +| Criterion | Assessment | +|-----------------|------------| +| Code reuse | Could use `≪` notation; no shared definitions to extract | +| Citations | [ErSa59] incomplete; solving reference (Erdős–Selfridge) missing | +| Variants | Stronger bound $f(st) \leq s+t$ not captured | +| Readability | Good; minor docstring wording improvement possible | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Definitions and theorem are mathematically correct, but **problem is mislabeled as open when it is solved** | diff --git a/ai-review/651.md b/ai-review/651.md new file mode 100644 index 0000000000..ace23e084b --- /dev/null +++ b/ai-review/651.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 651 + +## 1. Code Reuse + +There is significant duplication across the codebase for the core geometric definitions used here. + +**`InConvexPositionRk`** (line 46) is a parametric-dimension generalization of `InConvexPosition` / `ConvexIndep`, which appears in at least five other files: +- `FormalConjecturesForMathlib/Geometry/2d.lean:60` — `ConvexIndep` (on `Set ℝ²`, not `Finset`) +- `ErdosProblems/838.lean:48` — `InConvexPosition` (on `Finset ℝ²`) +- `ErdosProblems/216.lean:61` — `InConvexPosition` (on `Finset Point`) +- `ErdosProblems/93.lean:40` — `InConvexPosition` (uses `Set` difference instead of `Finset.erase`) +- `ErdosProblems/660.lean:40` — `InConvexPosition3d` (on `Finset ℝ³`) + +`InConvexPositionRk k` is strictly a generalization of all of the above (modulo the `Finset` vs `Set` distinction). Ideally, a single parametric definition would live in `FormalConjecturesForMathlib` and be reused. The `ConvexIndep` definition in `2d.lean` is the closest canonical version but operates on `Set ℝ²` rather than `Finset (EuclideanSpace ℝ (Fin k))`. + +**`InGeneralPositionRk`** (line 39) is the higher-dimensional generalization of the planar `InGeneralPosition` defined in `838.lean`, `827.lean`, and `216.lean`. The planar versions use collinearity (`¬Collinear ℝ`) for triples, while the general version uses `AffineIndependent ℝ` for (k+1)-tuples. These are equivalent but defined differently. + +**Recommendation:** A shared utility defining `InGeneralPosition` and `InConvexPosition` parametrically over dimension (as done here) would eliminate duplication. Problem 660's `InConvexPosition3d` is literally `InConvexPositionRk 3`. + +Additionally, the `ℝ^` notation from `FormalConjecturesForMathlib/Geometry/Euclidean.lean:19` (`notation "ℝ^" n => EuclideanSpace ℝ (Fin n)`) could be used to improve readability. + +## 2. Citations + +The formalization includes two citations: +- **[Er97e]**: `Erdős, P., *Some of my favourite problems which recently have been solved*, 1997.` +- **[PoZa22]**: `Pohoata, C. and Zakharov, D., *Convex polytopes from fewer points*, 2022.` + +The website (erdosproblems.com/651) lists the same two references. The formalization's citation for [Er97e] is slightly abbreviated (the website's full reference is: *Some of my favourite problems which recently have been solved*, Proc. Int. Conf. on Discrete Math. (1997), 527–533). Compare with `660.lean` which includes the full publication details for the same reference. **Recommendation:** Add the full publication details to match the website and for consistency with other files (e.g., 660.lean). + +## 3. Variants + +The website mentions several aspects not captured by the formalization: + +1. **Connection to Problem 107 (Erdős-Klein-Szekeres):** The 2D case ($k=2$) of this function $f_k(n)$ is exactly the Erdős-Szekeres function $f(n)$ from Problem 107. This connection is not mentioned. + +2. **Monotonicity:** The website states $f_2(n) > f_3(n) > \cdots$. This is a non-trivial structural fact that could be formalized as a variant. + +3. **Specific disproof bound:** Pohoata and Zakharov proved $f_3(n) \leq 2^{o(n)}$, which is mentioned in the docstring but not formalized as a separate theorem. This would be analogous to how Problem 107 formalizes the Suk bound and HMPT bound as separate variant theorems. + +4. **k=2 case remains open:** For $k=2$, the exponential lower bound $f_2(n) \geq 2^{n-2}+1$ is known and the conjecture $f_2(n) = 2^{n-2}+1$ is open (Problem 107). The formalization doesn't distinguish this. + +**Recommendation:** Add variants for: +- The monotonicity property +- The Pohoata-Zakharov upper bound $f_3(n) \leq 2^{o(n)}$ +- A note linking $f_2 = f$ from Problem 107 + +## 4. Readability + +The code is generally well-structured and readable. Minor suggestions: + +- The `Rk` suffix in `InGeneralPositionRk` / `InConvexPositionRk` is functional but slightly awkward. Since the dimension `k` is already a parameter, names like `InGeneralPosition` and `InConvexPosition` (within the `Erdos651` namespace) would suffice. +- The docstrings are clear and well-written. +- The `fk` function name could be more descriptive (e.g., `convexPositionNumber`), though `fk` matches the mathematical notation. + +## 5. Formalizability + +**Assessment: High.** The problem is precisely stated. The key concepts — general position, convex position, and the Ramsey-type function $f_k(n)$ — all have unambiguous mathematical definitions that translate directly to Lean. + +The only mild ambiguity is what "convex polyhedron" means in the original statement. The formalization interprets this as "convex position" (no point interior to the convex hull of the others), which is the standard interpretation and equivalent to "vertices of a convex polytope." This is correct. + +The asymptotic nature of the conjecture (exponential lower bound) is handled cleanly via the "eventually greater than $(1+c)^n$" formulation with an explicit $N_0$ threshold, avoiding any need for asymptotic notation. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`InGeneralPositionRk k P`**: Requires that any injective selection of $k+1$ points from $P$ is affinely independent. This is the standard definition of general position in $\mathbb{R}^k$ (no $k+1$ points on a hyperplane). ✓ + +- **`InConvexPositionRk k S`**: Requires every point to lie outside the convex hull of the remaining points. This is equivalent to saying the points are precisely the vertices of their convex hull (extreme points). ✓ + +- **`fk k n`**: Defined as $\inf\{m \mid \forall P, |P|=m \wedge \text{general position} \Rightarrow \exists Q \subseteq P, |Q|=n \wedge \text{convex position}\}$. This correctly captures the Ramsey-type function. Note that `sInf ∅ = 0` in `ℕ`, but this is harmless since the conjecture only concerns asymptotic behavior (for $n \geq N_0$). ✓ + +- **The theorem statement**: `answer(False) ↔ ∀ k ≥ 2, ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, f_k(n) > (1+c)^n`. The answer is `False`, meaning the universal statement over all $k \geq 2$ is false. This is correct: Pohoata-Zakharov showed $f_3(n) \leq 2^{o(n)}$, which means $f_3(n)$ does NOT grow at least exponentially, disproving the conjecture for $k=3$ (and hence for all $k \geq 3$ by monotonicity). ✓ + +- **Subtle point on quantifier structure**: The conjecture as formalized is $\forall k \geq 2$, which is disproved by a single counterexample ($k=3$). The problem on the website asks whether the exponential bound holds, and the answer is no. The formalization correctly captures this. However, it's worth noting that the $k=2$ case is still conjectured to hold (Problem 107 conjectures $f_2(n) = 2^{n-2}+1$). The formalization does not distinguish between dimensions where the bound holds and where it fails, but it doesn't need to — the conjecture as stated on the website is about all dimensions simultaneously. + +**No mathematical flaws identified.** diff --git a/ai-review/652.md b/ai-review/652.md new file mode 100644 index 0000000000..5a132b2d59 --- /dev/null +++ b/ai-review/652.md @@ -0,0 +1,67 @@ +# Review: Erdos Problem 652 + +## 1. Code Reuse + +The local definition `numDistinctDistances` in 652.lean is functionally equivalent to definitions in several other files: + +- **`Erdos653.distinctDistances`** (`FormalConjectures/ErdosProblems/653.lean:39–41`): Counts distinct distances from a point to all others in an indexed configuration `Fin n → EuclideanSpace ℝ (Fin 2)`. Semantically identical, but uses a different point-set representation (indexed function vs Finset). +- **`Erdos1082.distinctDistancesFrom`** (`FormalConjectures/ErdosProblems/1082.lean:40–41`): Counts distinct distances from a Finset of `ℝ²` to a point. Very close to the 652 definition but does not filter out the point itself (so it includes the zero distance if `pt ∈ points`). Also uses the `ℝ²` notation rather than `EuclideanSpace ℝ (Fin 2)`. +- **`EuclideanGeometry.distinctDistances`** (`FormalConjecturesForMathlib/Geometry/2d.lean:194–195`): Counts total distinct *pairwise* distances, not per-point — a different concept. + +**Recommendation:** The 652 definition is appropriate for its use case. However, a shared "distinct distances from a point" utility (analogous to `Erdos1082.distinctDistancesFrom` but with the self-exclusion filter) could serve problems 652, 653, 654, and 1082. This would be a natural addition to `FormalConjecturesForMathlib/Geometry/2d.lean`. The `TODO(csonne): Move to ForMathlib` comment in 1082.lean suggests this consolidation is already planned. + +## 2. Citations + +The docstring references: +- `[Ma21]` Mathialagan, S., *Distinct distances for points along a curve in the plane*. 2021. + +**Missing:** The original source `[Er97e]` (Erdős, P., *Some of my favourite problems which recently have been solved*) is listed on [erdosproblems.com/652](https://www.erdosproblems.com/652) but is not cited in the formalization. Problem 653, which comes from the same Erdős paper, does cite `[Er97e]`. This should be added for consistency. + +## 3. Variants + +The website mentions several related facts not captured by the formalization: + +- **Trivial case:** $R(x_1) = 1$ is always achievable (place all points on a circle around $x_1$). +- **Product bound:** $R(x_1) \cdot R(x_2) \gg n$ always holds. +- **Elekes counterexample:** Erdős originally conjectured $R(x_3)/\sqrt{n} \to \infty$, but Elekes disproved this — there exist configurations where the third-smallest $R$ value is $O(\sqrt{n})$. +- **Mathialagan's quantitative bound:** $R(x_k) \gg \sqrt{kn}$ for $2 \leq k \leq n^{1/3}$, which is strictly stronger than $\alpha_k \to \infty$. + +The current formalization only captures the qualitative statement $\alpha_k \to \infty$. The quantitative bound of Mathialagan ($R(x_k) \gg \sqrt{kn}$) would make a valuable additional formalization, as it is the actual proved result and is strictly stronger. + +## 4. Readability + +The code is well-structured and readable. The docstrings clearly explain both the helper definition and the theorem statement. Two minor suggestions: + +- The docstring on `erdos_652` could more explicitly state the equivalence: "The following is equivalent to $\alpha_k \to \infty$" and briefly indicate *why* (i.e., that `α_k > C` is equivalent to asserting that for infinitely many `n`, every `n`-point set has fewer than `k` points with fewer than `C√n` distinct distances). +- The `Erdos652` namespace is clean and self-contained. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The problem statement on the website is precise: it defines $R(x_i)$, $\alpha_k$, and asks whether $\alpha_k \to \infty$. The only potential source of ambiguity is whether the $n$ points are required to be distinct, but this is the standard convention in combinatorial geometry, and using `Finset` enforces it naturally. + +The reformulation from "$\alpha_k \to \infty$" to the explicit $\varepsilon$-$K$ form is a standard logical equivalence and introduces no ambiguity. + +## 6. Correctness + +**Assessment: Correct.** + +The formalization accurately captures $\alpha_k \to \infty$ as $k \to \infty$. Here is a detailed verification: + +**Definition check:** `numDistinctDistances p S` computes `((S.filter (· ≠ p)).image (dist p)).card`, which is exactly $\#\{d(p,q) : q \in S, q \neq p\}$ — the number of distinct distances from $p$ to other points in $S$. This matches $R(x_i)$ in the problem statement. + +**Quantifier structure check:** The theorem states: +$$\forall C > 0,\; \exists K,\; \forall k \geq K,\; \forall N,\; \exists n \geq N,\; \forall S \text{ with } |S|=n: \; |\{p \in S : R(p) < C\sqrt{n}\}| < k$$ + +This is equivalent to $\alpha_k \to \infty$ by the following argument: +- $\alpha_k > C$ iff $C \notin \{\alpha : \forall^{\infty} n,\; \exists S,\; R_k(S) < \alpha\sqrt{n}\}$ +- Negating: $\exists^{\infty} n$ such that $\forall S$ with $|S|=n$, $R_k(S) \geq C\sqrt{n}$ +- $R_k(S) \geq C\sqrt{n}$ iff $|\{p \in S : R(p) < C\sqrt{n}\}| < k$ +- $\alpha_k \to \infty$ iff $\forall C > 0, \exists K, \forall k \geq K, \alpha_k \geq C$, which matches the formalization's quantifier structure. + +**Answer check:** `answer(True)` is correct — the problem was proved in the affirmative by Mathialagan [Ma21]. + +**Tags check:** `@[category research solved, AMS 5 52]` — correctly marked as solved. AMS 52 (convex and discrete geometry) is appropriate. + +**No mathematical flaws identified.** The formalization is a faithful and complete translation of the problem as stated. diff --git a/ai-review/653.md b/ai-review/653.md new file mode 100644 index 0000000000..b7966affb6 --- /dev/null +++ b/ai-review/653.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 653 + +## 1. Code Reuse + +Several related definitions exist in the codebase: + +- **`EuclideanGeometry.distinctDistances`** in `FormalConjecturesForMathlib/Geometry/2d.lean:194` counts total pairwise distinct distances over a `Finset ℝ²`. This is *not* directly reusable — Problem 653 needs per-point distance counts `R(x_i)`, not overall pairwise counts. + +- **`Erdos652.numDistinctDistances`** in `ErdosProblems/652.lean:47` computes per-point distinct distances from a `Finset`-based representation, which is semantically equivalent to `Erdos653.distinctDistances` but uses a different point representation (`Finset` vs `Fin n →`). + +- **`Erdos654.numDistinctDistances`** in `ErdosProblems/654.lean:59` is nearly identical in structure to `Erdos653.distinctDistances` — same `Fin n`-indexed approach, same filter/image/card pattern — but uses `ℝ × ℝ` with squared Euclidean distance rather than `EuclideanSpace ℝ (Fin 2)` with `dist`. + +**Recommendation:** The three problems 652, 653, 654 share essentially the same `R(x_i)` definition with minor representation differences. A shared utility in `FormalConjecturesForMathlib` parameterized by the point type (any `MetricSpace`) and point-set representation would eliminate duplication. However, given that each problem has its own namespace and the definitions are short, the current approach is acceptable. + +The `ℝ²` notation from `FormalConjecturesForMathlib/Geometry/2d.lean:25` could be used to shorten `EuclideanSpace ℝ (Fin 2)`, though this would require an additional import. + +## 2. Citations + +**Website ([erdosproblems.com/653](https://www.erdosproblems.com/653)) states:** +- Original source: [Er97e] +- Recommended citation: T. F. Bloom, Erdős Problem #653, https://www.erdosproblems.com/653 +- Known results: Erdős and Fishburn proved g(n) > 3n/8; Csizmadia proved g(n) > 7n/10; both groups proved g(n) < n − cn^{2/3} for some constant c > 0. + +**Formalization states:** +- `[Er97e] Erdős, P., *Some of my favourite problems which recently have been solved*.` + +**Assessment:** The citation [Er97e] matches the website's listed source. The full bibliographic entry in the docstring is reasonable. No discrepancies. + +## 3. Variants + +The website mentions significant known bounds: +- **Lower bound:** g(n) > 7n/10 (Csizmadia), improving g(n) > 3n/8 (Erdős–Fishburn). +- **Upper bound:** g(n) < n − cn^{2/3} for some c > 0. + +These partial results are not captured in the formalization. They could be formalized as separate lemmas: +- A lower bound theorem: `∃ N, ∀ n ≥ N, ∀ x, numDistinctR n x ≥ ...` (or more precisely, `g(n) > 7n/10`). +- An upper bound theorem: `∃ c > 0, ∃ N, ∀ n ≥ N, ∀ x, numDistinctR n x < n − c * n^{2/3}`. + +The upper bound is mathematically noteworthy because it shows g(n) cannot equal n for large n, yet it is still compatible with g(n) ≥ (1 − o(1))n (since n − cn^{2/3} = (1 − cn^{−1/3})n and cn^{−1/3} → 0). + +**No variants of the core question are missing.** The website poses only the single question about g(n) ≥ (1 − o(1))n. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The docstrings are clear and accurately describe the mathematical content. +- The module docstring includes the ordering "R(x₁) ≤ ··· ≤ R(x_n)" from the original problem statement, which is appropriate context even though the ordering is irrelevant to the formalization of g(n). This is fine — it faithfully reproduces the original statement. +- The definition names `distinctDistances` and `numDistinctR` are descriptive. +- `open Finset Classical` is appropriately scoped within the namespace. + +**Minor suggestion:** The type `EuclideanSpace ℝ (Fin 2)` appears three times and could be aliased or use the `ℝ²` notation, but this is cosmetic. + +## 5. Formalizability + +**The problem is precisely formalizable.** The statement "g(n) ≥ (1 − o(1))n" has an unambiguous mathematical meaning: + +> For every ε > 0, for all sufficiently large n, g(n) ≥ (1 − ε)n. + +This is exactly what the formalization captures. The little-o notation is standard and admits a unique epsilon-delta interpretation. + +The definition of g(n) = max over all n-point configurations of the number of distinct R(x_i) values is also unambiguous. + +**Ambiguity level: None.** This is a clean, well-posed combinatorial geometry question. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`distinctDistances`**: Correctly filters out index `i` itself (`· ≠ i`), maps to distances via `dist`, and counts distinct values via `image ... .card`. This faithfully captures R(x_i) = #{|x_j − x_i| : j ≠ i}. + +- **`numDistinctR`**: Correctly computes the number of distinct values in {R(x_1), ..., R(x_n)} by imaging the R-function over `Fin n` and taking the cardinality. This is g(n) for a specific configuration; the theorem then takes the existential (∃ x) to capture the maximum. + +- **Theorem statement**: The formulation `∃ x, numDistinctR n x ≥ (1 − ε) * n` correctly captures "g(n) ≥ (1 − ε)n" because g(n) is a maximum — it equals or exceeds a bound iff some configuration achieves that bound. + +- **Injectivity omission**: Unlike Problem 654, the formalization does not require `Function.Injective x` (i.e., distinct points). This is **mathematically harmless** for this problem: collapsing points can only reduce distinct distance counts and distinct R-values, so non-injective configurations cannot be maximal. The maximum g(n) is always achieved by injective configurations. + +- **`answer(sorry)`**: Correctly used — the problem is open, so the answer (True or False) is unknown. + +- **Category tag `[category research open, AMS 52]`**: Consistent with the website's "OPEN" status. AMS classification 52 (Convex and discrete geometry) is appropriate. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Acceptable; shared R(x_i) utility could reduce duplication across 652/653/654 | +| Citations | Correct; matches website source | +| Variants | Core question captured; known bounds not formalized (optional) | +| Readability | Good | +| Formalizability | Unambiguous; cleanly formalizable | +| Correctness | **Correct and complete** | diff --git a/ai-review/654.md b/ai-review/654.md new file mode 100644 index 0000000000..daab016a65 --- /dev/null +++ b/ai-review/654.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 654 + +## 1. Code Reuse + +**Several opportunities for reuse exist, and the current implementation is inconsistent with codebase conventions.** + +Problem 654 uses `ℝ × ℝ` with a custom `sqEuclideanDist` definition, whereas the majority of related problems in the codebase use `EuclideanSpace ℝ (Fin 2)` with Mathlib's `dist`: + +- **Problem 98** (`98.lean:43-52`): Defines `FourPointsConcyclic` and `NoFourConcyclic` over `Finset (EuclideanSpace ℝ (Fin 2))` using `dist`. +- **Problem 652** (`652.lean:47-49`): Defines `numDistinctDistances` using `((S.filter (· ≠ p)).image (dist p)).card` — functionally identical to 654's version. +- **Problem 653** (`653.lean:39-41`): Defines `distinctDistances` using `Fin n` indexing and `dist` — structurally identical to 654's `numDistinctDistances` but with standard `dist` instead of `sqEuclideanDist`. + +The custom `sqEuclideanDist` in 654 is mathematically equivalent to using `dist` for the purpose of counting distinct distances (since `d(p,q) = d(p',q')` iff `d(p,q)² = d(p',q')²` for nonneg distances), but it introduces unnecessary divergence from the rest of the codebase. Switching to `EuclideanSpace ℝ (Fin 2)` with `dist` would align with problems 98, 652, 653, 655, and others. + +## 2. Citations + +The docstring references `[Er87b][ErPa90][Er97e]` and mentions a disproof by "Aletheia [Fe26]." + +Cross-referencing with [erdosproblems.com/654](https://www.erdosproblems.com/654): +- **[Er87b]**, **[ErPa90]**, **[Er97e]** — All present on the website. These are correct. +- **[Fe26]** — Referenced on the website as a recent result by Aletheia disproving the stronger conjecture `f(n) > (1-o(1))n`. This matches the docstring. + +The docstring does not include full bibliographic entries for the citations. Other files in the codebase (e.g., 652.lean) include inline citation details like author name and title. The references here are shorthand only. Consider expanding, e.g.: +- `[Er87b]` — Erdős, 1987 +- `[ErPa90]` — Erdős & Pach, 1990 +- `[Er97e]` — Erdős, *Some of my favourite problems which recently have been solved*, 1997 + +## 3. Variants + +The website describes several variants and related conjectures: + +| Variant | Captured? | +|---------|-----------| +| Main conjecture: `f(n) > (1/3 + c)n` for some `c > 0` | **Yes** — this is what the formalization states. | +| Stronger conjecture: `f(n) > (1 - o(1))n` | **No** — mentioned in the docstring as disproved, but not formalized. | +| Conditional conjecture (no three collinear + at most 2 on a circle per point ⟹ `f(n) > (1-o(1))n`) | **No** — not formalized. Mentioned on the website under [Er87b, ErPa90]. | +| Erdős's remark [Er97e] that the trivial bound "can be significantly improved" | **Partially** — the trivial bound `f(n) ≥ (n-1)/3` is mentioned in the docstring but not formalized. | + +The main open conjecture is correctly captured. The conditional conjecture involving no-three-collinear is a distinct (and potentially interesting) variant that could merit a separate formalization or at least acknowledgment in the docstring, since the website presents it as a separate conjecture that Erdős believed should hold. + +## 4. Readability + +**Generally good, with some suggestions:** + +- The `NoFourConcyclic` definition (lines 51–54) lists six pairwise distinctness conditions on four indices. This is correct but verbose. A `Finset`-based approach (as in Problem 98) using `S.card = 4 → ¬FourPointsConcyclic S` would be more concise and arguably more readable. +- The docstring comment on `numDistinctDistances` (lines 57–58) explaining why squared distances work is helpful. +- The `open Finset Classical` at line 34 is appropriate. +- The namespace `Erdos654` is consistent with other files. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** The mathematical statement is unambiguous: +- "No four points on a circle" has a standard meaning (no four concyclic on a circle of positive radius). +- "Distinct distances from a point" is well-defined. +- The quantifier structure (∃c > 0, ∃N₀, ∀n ≥ N₀, ∀ configurations, ∃ point with many distances) is standard. + +**Ambiguity level: Low.** The only minor ambiguity is whether "no four on a circle" includes degenerate circles (radius 0) or lines (infinite radius). The formalization correctly handles both: `Function.Injective pts` excludes coincident points, and `FourConcyclic` requires `r_sq > 0` with a finite center, excluding lines. This matches standard mathematical usage. + +## 6. Correctness + +**The formalization is mathematically correct, with one minor observation.** + +**Correct aspects:** +- The quantifier structure faithfully captures `f(n) > (1/3 + c)n` for large `n`: existential over `c > 0` and `N₀`, universal over `n ≥ N₀` and all valid configurations, existential over a point with sufficiently many distances. +- `Function.Injective pts` correctly ensures distinct points (necessary since distinct distances are meaningless with coincident points). +- `FourConcyclic` with `r_sq > 0` correctly models "four points on a circle" (positive radius, finite center). +- `numDistinctDistances` using squared distances is mathematically equivalent to using regular distances for counting distinct values (the map `d ↦ d²` is injective on nonneg reals). +- The strict inequality `>` matches the problem statement. +- `answer(sorry)` is appropriate since this is an open problem. + +**Minor observation:** +- The `NoFourConcyclic` definition does not require the four *points* to be distinct — it requires the four *indices* to be distinct. Combined with `Function.Injective pts` in the theorem statement, this correctly ensures the four points are distinct. This coupling is subtle but correct. + +**No mathematical flaws identified.** The formalization accurately captures the intended conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Non-standard `ℝ × ℝ` representation; could reuse `EuclideanSpace`-based definitions from 98/652/653 | +| Citations | Correct shorthand references; could benefit from expanded bibliographic details | +| Variants | Main conjecture captured; conditional conjecture (no-three-collinear) not formalized | +| Readability | Good; `NoFourConcyclic` could be more concise with Finset-based approach | +| Formalizability | High — low ambiguity, standard mathematical definitions | +| Correctness | Correct and complete for the main conjecture | diff --git a/ai-review/655.md b/ai-review/655.md new file mode 100644 index 0000000000..880ec13805 --- /dev/null +++ b/ai-review/655.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 655 + +## 1. Code Reuse + +**Several opportunities for reuse and consistency improvements exist.** + +- **Problem 654** (`FormalConjectures/ErdosProblems/654.lean`) is the sister problem by the same authors (Erdős–Pach) and addresses a closely related question about distinct distances under a "no four concyclic" constraint. However, the two formalizations use incompatible representations: + - Problem 654 uses `ℝ × ℝ` with a custom `sqEuclideanDist`. + - Problem 655 uses `EuclideanSpace ℝ (Fin 2)` with Mathlib's `dist`. + + These should ideally use a consistent representation. Mathlib's `EuclideanSpace ℝ (Fin 2)` (as used in 655) is the more canonical choice. + +- **`FormalConjecturesForMathlib/Geometry/Metric.lean`** defines `unitDistNum` for counting unit-distance pairs, but there is no shared utility for counting distinct pairwise distances. A common `distinctDistanceCount` helper could serve both 654 and 655 (and potentially other distance problems). + +- Problem 654 defines `FourConcyclic` and `NoFourConcyclic`; Problem 655 defines `NoThreeEquidistantFromCenter`. These are related geometric constraints that could live in a shared geometry utilities file. + +## 2. Citations + +The formalization's docstring references: +> *Reference:* [erdosproblems.com/655](https://www.erdosproblems.com/655) + +The website attributes the problem to **Erdős and Pach**, citing **[Er97e]**. The docstring does mention "Erdős–Pach" in the theorem comment, which is good. However: + +- The specific citation **[Er97e]** should be included for traceability. Problem 654's docstring lists `[Er87b][ErPa90][Er97e]` — Problem 655 should similarly include the relevant subset of these references. +- The website also credits **Zach Hunter** for providing a counterexample (see Correctness below), which is not mentioned anywhere in the formalization. + +## 3. Variants + +**The formalization captures only the literal statement, which is known to be false.** + +The erdosproblems.com page notes that the original problem statement is ambiguous and that commentators suggest the intended configuration likely had additional constraints such as "no three points collinear and no four points concyclic" (general position). Under such stronger hypotheses, the question may still be interesting and open. This stronger variant is not captured. + +A more complete formalization might include: +- The literal statement (with a note that it is false). +- A variant with general position assumptions (no three collinear, no four concyclic), which may be the "intended" open problem. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The `NoThreeEquidistantFromCenter` predicate has six pairwise-distinctness hypotheses spelled out explicitly. This is correct but verbose. A comment or alternative formulation using `Finset.card` (e.g., "there is no 3-element subset of `P \ {p}` all at the same distance from `p`") might improve clarity. +- `distinctDistanceCount` uses `Set.ncard` on a `Set ℝ` defined via existential quantifiers. This is mathematically clean but could potentially be replaced with a `Finset`-based formulation (image of pairs under `dist`, then card) for easier reasoning in proofs. Note that `Set.ncard` requires the set to be finite for meaningful results, and this finiteness is not immediately obvious from the definition (though it follows from `P` being a `Finset`). + +## 5. Formalizability + +**The problem as literally stated is precise and unambiguous enough to formalize.** The formalization correctly captures the literal meaning: given n points in R² such that no circle centered at one passes through three others, must there be at least (1+c)n/2 distinct distances? + +However, the **intent** of the problem is ambiguous, as noted on the website. The condition "no circle centered at x_i passes through three others" was likely meant to impose a more restrictive general position assumption than what it literally says. This ambiguity is in the original problem, not an artifact of the formalization. + +## 6. Correctness + +**CRITICAL ISSUE: The conjecture as formalized is known to be FALSE.** + +Zach Hunter observed that **n equally-spaced points on a circle** provide a counterexample: + +- **The hypothesis is satisfied:** For any point p among n equally-spaced points on a circle of radius R, the distance to another point at angular separation k is 2R sin(kπ/n). By the identity sin(θ) = sin(π − θ), points at angular separations k and n−k are equidistant from p. Since sin is strictly monotone on (0, π/2) and (π/2, π), distinct values of min(k, n−k) yield distinct distances. Thus each distance value is achieved by exactly 2 points (or 1 for the antipodal point when n is even). No three other points are ever equidistant from any center point, so `NoThreeEquidistantFromCenter` holds. + +- **The conclusion fails:** The number of distinct pairwise distances is ⌊n/2⌋, which equals n/2 (asymptotically). This does NOT exceed (1+c)·n/2 for any fixed c > 0. + +**Consequences for the formalization:** + +1. The `answer(sorry)` wrapper should resolve to `False` (or the problem should be tagged as disproved/having a known counterexample), not left as `open`. +2. The `@[category research open, AMS 52]` tag is incorrect — the problem (as literally stated) is resolved. +3. If the intent is to formalize the "corrected" version (with general position assumptions), the hypotheses need strengthening. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Moderate opportunity — shared distance/geometry utilities with Problem 654 | +| Citations | Missing [Er97e] reference and Zach Hunter counterexample credit | +| Variants | Only literal (false) statement captured; intended general-position variant missing | +| Readability | Good, minor verbosity in distinctness conditions | +| Formalizability | Literal statement is precise; original intent is ambiguous | +| **Correctness** | **INCORRECT — the conjecture is known to be false as stated; should not be tagged `open`** | diff --git a/ai-review/656.md b/ai-review/656.md new file mode 100644 index 0000000000..233f530e6a --- /dev/null +++ b/ai-review/656.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 656 + +## 1. Code Reuse + +**The local `Nat.upperDensity` definition is redundant and should be replaced.** + +- **`FormalConjecturesForMathlib/Data/Set/Density.lean`** provides a generic `Set.upperDensity` (line 51–53) that computes `atTop.limsup` of `Set.partialDensity`. For `ℕ` with the default `A := Set.univ`, this is mathematically equivalent to the ad-hoc `Nat.upperDensity` defined at line 39–41 of `656.lean`. Both compute `limsup_{N → ∞} |A ∩ {0,…,N−1}| / N`; they differ only in surface-level encoding (`Finset.filter`/`Finset.range` vs `Set.interIio`/`ncard`). + +- **Problem 109** (`FormalConjectures/ErdosProblems/109.lean`) is the closest sibling problem—the "Erdős sumset conjecture"—and it already uses `Set.upperDensity` from the shared library (line 39). Problem 656 should do the same for consistency. In fact, 656 is a strengthening of 109: if `B + B + t ⊆ A` with B infinite, one can derive B + C ⊆ A with B, C both infinite (take C = B shifted by t). The website explicitly notes the connection to problem 109. + +- **Sumset notation**: Problem 109 uses `open Pointwise` and writes `B + C ⊆ A` cleanly. Problem 656 instead spells out the sumset condition element-wise (`∀ b₁ ∈ B, ∀ b₂ ∈ B, ∃ a ∈ A, …`). While the element-wise form is needed here due to the ℤ-shift, the approach could still be made more idiomatic—see Readability below. + +- **Problems 333, 335, 342, 378** all define their own local `upperDensity` variants. This is a codebase-wide pattern of duplication that should eventually be consolidated around the shared `Set.upperDensity`. + +## 2. Citations + +The formalization's module docstring includes: + +> [Er75b] Erdős, P., *Problems and results on combinatorial number theory III*, 1975. +> +> [KMRR24] Kra, B., Moreira, J., Richter, F., and Robertson, D., 2024. + +The erdosproblems.com page lists the same two references ([Er75b] and [KMRR24]), so the citations are consistent with the website. However: + +- **[KMRR24] is missing its title.** The full reference should include the paper title for traceability. The paper is: Kra, B., Moreira, J., Richter, F., and Robertson, D., *Infinite sumsets in sets with positive density*, 2024. +- The website describes this as a candidate for "a density version of Hindman's theorem" and notes its connection to **Problem 109**. This context would be helpful in the docstring. + +## 3. Variants + +**No variants are missing.** The erdosproblems.com page states a single problem with no additional variants or sub-questions. The problem has been solved affirmatively (proved by KMRR24), so there are no remaining open sub-cases. + +One could consider whether a stronger variant (e.g., with lower density instead of upper density, or with additional structural requirements on B) is interesting, but none are mentioned on the website. + +## 4. Readability + +The code is reasonably readable, but has some areas for improvement: + +- **Verbose sumset encoding**: The condition `∀ b₁ ∈ B, ∀ b₂ ∈ B, ∃ a ∈ A, (a : ℤ) = ↑b₁ + ↑b₂ + t` works but is more complex than necessary. An alternative is to express the containment more directly, e.g., `∀ b₁ ∈ B, ∀ b₂ ∈ B, (↑b₁ + ↑b₂ + t).toNat ∈ A ∧ 0 ≤ ↑b₁ + ↑b₂ + t`, or to cast A to a set of integers and write `(↑) '' A` (the image under the coercion). As it stands, the existential `∃ a ∈ A` is slightly indirect—it asserts the existence of a witness rather than stating membership directly. + +- **Explicit `Classical.decPred`**: The density definition on line 41 uses `@Finset.filter _ (· ∈ A) (Classical.decPred (· ∈ A))` instead of just opening `Classical` at the top. Problems 333 uses `open scoped Classical` to avoid this verbosity. + +- **Namespace naming**: `Erdos656` is fine and consistent with other problems. + +## 5. Formalizability + +**The problem is fully precise and unambiguously formalizable.** + +The statement "Let A ⊆ ℕ have positive upper density; must there exist an infinite B ⊆ ℕ and integer t such that B + B + t ⊆ A?" is completely precise. Every term (upper density, infinite set, sumset, integer shift, subset) has a standard mathematical definition. There is no room for ambiguity in the statement. + +**Ambiguity assessment: None.** This is one of the more cleanly stated Erdős problems. + +## 6. Correctness + +**The formalization is mathematically correct, with one minor stylistic concern.** + +**Positive aspects:** + +- The `answer(True)` wrapper correctly reflects the affirmative resolution by KMRR24. +- The `@[category research solved, AMS 5 11]` tag is accurate. +- The use of `B : Set ℕ` and `t : ℤ` correctly captures the domain: B lives in ℕ while the shift t is an integer. +- The casting `(a : ℤ) = ↑b₁ + ↑b₂ + t` correctly handles the mixed-type arithmetic. The existence of `a ∈ A` (a natural number) implicitly enforces that `b₁ + b₂ + t ≥ 0`, which is the right constraint. Since B is infinite and t is fixed, this is satisfiable for any choice of B with sufficiently large minimum element. +- The quantifier structure `∀ b₁ ∈ B, ∀ b₂ ∈ B` correctly includes the case `b₁ = b₂`, matching the standard definition of B + B (the sumset includes `2b` for `b ∈ B`). + +**Minor concern:** + +- The existential formulation `∃ a ∈ A, (a : ℤ) = ↑b₁ + ↑b₂ + t` is equivalent to but slightly less direct than asserting membership. It is logically correct: the existence of such an `a` is equivalent to saying the integer `b₁ + b₂ + t` is non-negative and its natural number representation lies in A. No mathematical content is lost or distorted. + +**Verdict: Correct and complete.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Should use `Set.upperDensity` from `FormalConjecturesForMathlib` instead of local definition; Problem 109 already does this | +| Citations | [KMRR24] missing paper title; connection to Problem 109 not noted | +| Variants | Complete — no missing variants | +| Readability | Adequate; verbose `Classical.decPred` and element-wise sumset encoding could be simplified | +| Formalizability | Fully precise, no ambiguity | +| **Correctness** | **Correct and complete** | diff --git a/ai-review/657.md b/ai-review/657.md new file mode 100644 index 0000000000..448ddefbdd --- /dev/null +++ b/ai-review/657.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 657 + +## 1. Code Reuse + +**`numDistances` is duplicated.** The identical definition appears in both `657.lean:37-38` and `135.lean:39-40`: + +```lean +noncomputable def numDistances (A : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + (((A ×ˢ A).filter (fun p => p.1 ≠ p.2)).image (fun p => dist p.1 p.2)).card +``` + +Additionally, `FormalConjecturesForMathlib/Geometry/2d.lean:194-195` provides `EuclideanGeometry.distinctDistances` using `offDiag` instead of `filter`: + +```lean +noncomputable def distinctDistances (points : Finset ℝ²) : ℕ := + (points.offDiag.image fun (pair : ℝ² × ℝ²) => dist pair.1 pair.2).card +``` + +The `offDiag` variant is cleaner and semantically equivalent. However, note the type difference: `Finset ℝ²` vs `Finset (EuclideanSpace ℝ (Fin 2))`. These are definitionally equal but may cause friction in practice. A shared utility definition (or consolidation to the Mathlib variant) would reduce duplication across problems 93, 95, 135, 657, 958, and 959. + +**`NoIsoscelesTriangles` could use `IsIsosceles`.** The file `FormalConjecturesForMathlib/Geometry/2d.lean:200-201` defines: + +```lean +def IsIsosceles {α : Type*} [Dist α] (p q r : α) : Prop := + dist p q = dist q r ∨ dist q r = dist r p ∨ dist r p = dist p q +``` + +The current `NoIsoscelesTriangles` definition (requiring `numDistances S = 3` for every 3-element subset) is mathematically equivalent to requiring that no triple of points satisfies `IsIsosceles`. Using `IsIsosceles` directly would avoid re-invoking the `numDistances` machinery for 3-element subsets. However, the current formulation has the advantage of being self-contained and directly mirroring the problem statement's language ("determines 3 distinct distances"). + +**Recommendation:** At minimum, deduplicate `numDistances` with Problem 135. Consider whether a shared definition in a utility file would be appropriate given the large number of Erdős distance problems. + +## 2. Citations + +The formalization lists: `[Er73]`, `[Er75f]`, `[ErPa90]`, `[Er97e]`. + +The website (erdosproblems.com/657) attributes the problem to Erdős and Davies via [Er73], and mentions subsequent work by Füredi, Ruzsa, and Pach. The website also references key results by: +- **Dumitrescu [Du08]**: established $(\\log n)^c \leq f(n) \leq 2^{O(\sqrt{\log n})}$ +- **Hunter, Alfaiz, Tang**: improved lower bound to $2^{c(\log n)^{1/9}} \leq f(n)$ +- **Straus**: observation about higher-dimensional constructions + +The docstring references `[Er73]`, `[Er75f]`, `[ErPa90]`, `[Er97e]` without expanding the full citation details (journal, year, pages). Other files in the codebase (e.g., 135.lean, 503.lean) provide fuller citation information. The references should be expanded to include full titles at minimum, matching the convention used elsewhere. The progress results (Dumitrescu, Hunter et al.) are not mentioned in the docstring; while not strictly necessary, noting them would provide useful context. + +## 3. Variants + +The website notes: +- The problem extends to $\mathbb{R}^k$ for higher dimensions. +- **Straus's observation**: For $2^k \geq n$, there exist $n$ points in $\mathbb{R}^k$ without isosceles triangles determining at most $n - 1$ distances (showing the answer may differ in higher dimensions). +- Related to Problem #135 (four-point-five-distance conjecture, which is the "next level" of the same type of question). + +**No higher-dimensional variant is formalized.** The problem as stated is specifically for $\mathbb{R}^2$, which matches the core question. However, a natural generalization to $\mathbb{R}^k$ (parameterized by dimension) would capture the full scope of the problem. The cross-reference to Problem 135 is not mentioned in the docstring. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The `numDistances` definition is clear but uses `A ×ˢ A` with a filter, which counts each ordered pair. Since `dist` is symmetric, the image step correctly collapses `(a, b)` and `(b, a)` to the same distance, so the result is correct despite using ordered pairs. +- The `NoIsoscelesTriangles` definition is readable. Quantifying over all 3-element subsets `S ⊆ A` is natural and mirrors the mathematical statement. +- The theorem statement's "equivalent reformulation" (∀ C > 0, ∃ N₀, ...) is clearly documented in the docstring, which is helpful. +- The namespace `Erdos657` keeps definitions local, avoiding clashes with the duplicate `numDistances` in `Erdos135`. + +**Minor suggestion:** The docstring could note that "no isosceles triangles" includes equilateral triangles (since equilateral is a special case of isosceles in standard mathematical convention). The formalization correctly excludes both, but this is worth noting for clarity. + +## 5. Formalizability + +**The problem is precisely formalizable.** The statement is unambiguous: + +- "Set of $n$ points" → `Finset (EuclideanSpace ℝ (Fin 2))` with `A.card = n`. +- "Every 3-point subset determines 3 distinct distances" → `NoIsoscelesTriangles` as defined. +- "At least $f(n) \cdot n$ distinct distances for some $f(n) \to \infty$" → the equivalent ∀ C > 0, ∃ N₀ formulation. + +The only potential ambiguity is whether "no isosceles triangles" should exclude degenerate (collinear) configurations. In the current formalization, collinear triples are allowed as long as all three pairwise distances are distinct. This is the correct interpretation: the condition is about distances, not about whether the points form a non-degenerate triangle. A collinear triple with all distinct pairwise distances is not isosceles and should be permitted. + +**Assessment: No ambiguity.** The problem is fully precise and the formalization captures it faithfully. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed verification: + +1. **`numDistances` correctness:** For a finite set $A$, the definition computes $|\{d(p, q) : p, q \in A, p \neq q\}|$. Using ordered pairs and then taking the image under `dist` is correct because `dist` is symmetric, so `dist p q = dist q p`, and the image automatically deduplicates. The filter `p.1 ≠ p.2` correctly excludes self-distances (which are always 0). + +2. **`NoIsoscelesTriangles` correctness:** For a 3-element subset $\{a, b, c\}$, `numDistances S = 3` means the three pairwise distances $d(a,b), d(a,c), d(b,c)$ are all distinct. This is exactly the condition that no isosceles triangle is formed (including equilateral as a special case). The quantification over all 3-element subsets correctly captures "no isosceles triangles in $A$." + +3. **Equivalence of the reformulation:** The original asks for $f(n) \to \infty$ such that the number of distinct distances is $\geq f(n) \cdot n$. The formalized version states: $\forall C > 0, \exists N_0, \forall A$ with $|A| \geq N_0$ and no isosceles triangles, $\text{numDistances}(A) \geq C \cdot |A|$. This is a standard and correct reformulation of "$f(n) \to \infty$" in the sense that the minimum ratio $\text{numDistances}(A)/|A|$ over all valid $A$ of size $n$ tends to infinity. The equivalence is exact. + +4. **Use of `answer(sorry)`:** The problem is open, and `answer(sorry)` correctly reflects that the truth value is unknown. The biconditional `answer(sorry) ↔ [statement]` is the standard pattern for open problems in this codebase. + +5. **Category tag:** `@[category research open, AMS 5 52]` correctly marks this as an open research problem in combinatorial geometry (AMS class 52). + +**No mathematical errors detected.** The formalization is complete and correct for the core problem as stated on erdosproblems.com. diff --git a/ai-review/658.md b/ai-review/658.md new file mode 100644 index 0000000000..e1da3db96c --- /dev/null +++ b/ai-review/658.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 658 + +## 1. Code Reuse + +No directly reusable code was found for the specific axis-aligned square problem. The codebase has extensive Ramsey theory and additive combinatorics infrastructure (e.g., `ContainsMonoAPofLength` in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`, monochromatic subset sums in `531.lean`, coloring patterns like `χ : α → Fin k`), but these address different combinatorial structures (arithmetic progressions, subset sums, graph colorings). The `ContainsAxisAlignedSquare` definition is a bespoke geometric predicate that doesn't have a natural analogue elsewhere in the codebase. The use of `Finset.Icc` and `×ˢ` (Finset product) is standard and consistent with how other problems in the repository define grid subsets. + +## 2. Citations + +The website ([erdosproblems.com/658](https://www.erdosproblems.com/658)) lists the following references: + +- **[Er97e]** — the original Erdős reference where the problem appears. +- **[FuKa91]** — Furstenberg and Katznelson, who proved the qualitative statement via the density Hales–Jewett theorem. +- **[So04]** — Solymosi, who gave a quantitative proof (with poor bounds). + +The formalization's docstring mentions Furstenberg–Katznelson and Solymosi by name but does not include the specific citation keys [Er97e], [FuKa91], [So04]. It also does not mention that the original problem citation is [Er97e]. The docstring should ideally include these specific references for traceability. + +## 3. Variants + +**Important gap identified.** The website notes: + +> "A problem of Graham, if the square is restricted to be axis-aligned. It is unclear whether in [Er97e] Erdős had this restriction in mind." + +The formalization **only captures the axis-aligned variant** (the "problem of Graham" attribution is correctly noted in the docstring). The more general variant — where the four vertices form an arbitrary square (possibly tilted/rotated) in the grid — is not formalized. A tilted square with vertices at, e.g., $(a, b)$, $(a+d, b+e)$, $(a+d-e, b+d+e)$, $(a-e, b+d)$ (for arbitrary $d, e$ not both zero) would be a natural additional conjecture to include. Since the website explicitly flags the ambiguity, it would be valuable to include both variants, perhaps as `erdos_658_axis_aligned` and `erdos_658_general`, with a comment noting the ambiguity. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The `ContainsAxisAlignedSquare` definition is well-documented and clearly names its intent. +- The separation of the geometric predicate into its own definition is good practice. +- The quantifier structure in `erdos_658` is clear and follows the standard density Ramsey pattern (∀ δ > 0, ∃ N₀, ∀ N ≥ N₀, ...). +- Minor: The module docstring says "vertices of an axis-aligned square" which is precise, but the website's problem statement simply says "vertices of a square." Adding a note about this distinction in the module docstring would improve clarity for readers unfamiliar with the ambiguity. + +## 5. Formalizability + +**Assessment: High formalizability (for the axis-aligned case).** + +The axis-aligned square problem as stated is fully precise and admits a clean formalization, which is exactly what has been done. The density condition, grid structure, and geometric predicate are all unambiguous. + +**Ambiguity in the original problem:** The main source of ambiguity is whether "square" means axis-aligned or arbitrary orientation. The website explicitly flags this: "It is unclear whether in [Er97e] Erdős had this restriction in mind." The formalization resolves this ambiguity by choosing the axis-aligned interpretation, which is the version attributed to Graham and proved via density Hales–Jewett. This is a reasonable choice but should be more explicitly documented. + +The general (tilted) square variant is also formalizable — it would require parameterizing over two integer offsets $(d, e)$ rather than one, and checking that the four points form a non-degenerate square — but is slightly more involved. + +## 6. Correctness + +**Assessment: Mathematically correct for the axis-aligned variant.** + +Detailed verification: + +- **`ContainsAxisAlignedSquare`**: Requires $d \geq 1$ (non-degeneracy) and all four corners $(a, b)$, $(a+d, b)$, $(a, b+d)$, $(a+d, b+d)$ in $A$. This correctly characterizes axis-aligned squares with vertices in $\mathbb{N} \times \mathbb{N}$. Using $\mathbb{N}$ coordinates is fine since the theorem constrains $A \subseteq \{1, \ldots, N\}^2$. + +- **Grid definition**: `Finset.Icc 1 N ×ˢ Finset.Icc 1 N` correctly represents $\{1, \ldots, N\}^2$. + +- **Density condition**: `(A.card : ℝ) ≥ δ * (N : ℝ) ^ 2` correctly expresses $|A| \geq \delta N^2$. The cast to $\mathbb{R}$ is necessary and correct. + +- **Quantifier structure**: $\forall \delta > 0, \exists N_0, \forall N \geq N_0$ correctly captures "for all sufficiently large $N$ depending on $\delta$." + +- **`answer(True)`**: Correct. The problem is marked as proved on the website, and the axis-aligned version was indeed proved by Furstenberg–Katznelson (qualitatively) and Solymosi (quantitatively). + +- **Tags**: `category research solved` is correct. `AMS 5` (combinatorics) is appropriate. + +**No mathematical flaws identified.** The formalization faithfully captures the axis-aligned density square problem. The only incompleteness is the missing general (tilted) square variant, which is attributable to the ambiguity in Erdős's original statement. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reusable code found; bespoke definition is appropriate | +| Citations | Missing specific citation keys [Er97e], [FuKa91], [So04] | +| Variants | Only axis-aligned variant captured; general square variant missing | +| Readability | Good; minor improvement possible noting axis-aligned vs. general ambiguity | +| Formalizability | High for axis-aligned case; general case also formalizable | +| Correctness | Correct and complete for the axis-aligned interpretation | diff --git a/ai-review/660.md b/ai-review/660.md new file mode 100644 index 0000000000..d89894a660 --- /dev/null +++ b/ai-review/660.md @@ -0,0 +1,57 @@ +# AI Review: Erdős Problem 660 + +## 1. Code Reuse + +Several opportunities for code reuse exist: + +- **`InConvexPosition3d`**: Problem 651 (`FormalConjectures/ErdosProblems/651.lean`) already defines a dimension-generic `InConvexPositionRk (k : ℕ) (S : Finset (EuclideanSpace ℝ (Fin k)))` that is definitionally identical to the one in 660 (both use `S.erase p` and `convexHull`). Problem 660 could import and reuse `Erdos651.InConvexPositionRk 3` instead of defining its own `InConvexPosition3d`. There are at least 7 independent definitions of convex position across the codebase (problems 93, 94, 96, 216, 651, 660, 838), which suggests a shared library definition would be beneficial. + +- **`distinctDistanceCount3d`**: Problem 98 (`FormalConjectures/ErdosProblems/98.lean`) defines `distinctDistanceCount` for ℝ² using the same `Set.ncard` approach with the same structure (`∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ ...`). A dimension-generic version could serve both. Meanwhile, problem 93 takes a different approach, returning a `Finset ℝ` via `A.offDiag.image`, which is arguably cleaner since it avoids needing `Set.ncard` for what is clearly a finite set. + +## 2. Citations + +The formalization references: +- `[Er97e]` Erdős 1997 — **Correct and matches the website.** +- `[Al63]` Altman 1963 — **Correct and matches the website.** + +**Missing reference**: The website also mentions `[Er75f]`, in which Erdős claims that Altman proved the vertices of a convex polygon determine `≫ n` distances (a stronger result than ⌊n/2⌋). This reference is not included in the 660 docstring. It may be worth adding for completeness, though it pertains more to the 2D case. + +## 3. Variants + +The formalization captures the core conjecture as stated on the website: that vertices of a convex polyhedron in ℝ³ determine at least (1 − o(1))n/2 distinct distances. + +**No missing variants are apparent.** The problem as stated on erdosproblems.com is a single question. The 2D analog (problem 93) is correctly cross-referenced in the docstring. The website does not mention any additional variants or stronger conjectures for the 3D case. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The name `InConvexPosition3d` is clear but inconsistent with `InConvexPositionRk` in problem 651. A uniform naming convention would improve navigability. +- The name `distinctDistanceCount3d` is descriptive. However, using a `Finset`-based approach (like problem 93's `offDiag.image`) rather than `Set.ncard` would be more idiomatic for a finite computation and would avoid the need for the `Set.ncard` machinery. The `Set.ncard` approach requires showing the set is finite before extracting useful cardinality facts, adding proof burden. +- The docstring is well-written and correctly explains the o(1) formulation in ε-N terms. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem is stated precisely: given n points in ℝ³ in convex position, are there at least (1 − o(1))n/2 distinct distances? The formalization correctly interprets the "o(1)" asymptotic notation as the standard ε-N formulation: for every ε > 0 there exists N such that for all n ≥ N, the distinct distance count is at least (1 − ε)n/2. + +One subtlety: the problem asks "are there at least (1 − o(1))n/2 distinct distances?" — this is phrased as a question (yes/no), which the formalization correctly captures with the `answer(sorry) ↔` pattern, leaving the truth value undetermined. + +There is minor inherent ambiguity in the original problem statement around "vertices of a convex polyhedron": does this require the points to be in *general position* (no degeneracies), or merely in convex position? The formalization uses convex position (no point in the convex hull of the others), which is the standard and most natural interpretation. + +## 6. Correctness + +**The formalization is mathematically correct with one minor note.** + +- **Convex position definition**: `InConvexPosition3d` correctly captures the notion that every point is a vertex of the convex hull (no point is redundant). This is the right definition for "vertices of a convex polyhedron." + +- **Distinct distance count**: `distinctDistanceCount3d` correctly counts the number of distinct positive real numbers that arise as distances between distinct pairs. The use of `d = dist p q` (rather than `dist p q = d`) is fine — it defines the same set. + +- **Asymptotic formulation**: The ε-N formulation correctly captures the "at least (1 − o(1))n/2" requirement. The inequality `(distinctDistanceCount3d P : ℝ) ≥ (1 - ε) * (n : ℝ) / 2` is correct. Note: operator precedence means this is `((1 - ε) * n) / 2`, which matches the intended `(1 - ε) · n/2`. + +- **The `answer(sorry)` pattern**: This correctly leaves the truth value of the conjecture open, consistent with the problem's open status on the website. + +- **Minor note on the bound**: The original problem asks for `(1 - o(1))n/2` distances. The formalization uses `(1 - ε) * n / 2`. For small n (below N), the bound could be vacuously satisfied or even negative (when ε > 1), but this is harmless since the statement only requires it for n ≥ N, and for large n the bound is meaningful and correct. + +**Overall assessment**: The formalization is faithful to the mathematical content of Erdős Problem 660. The main improvement opportunities are around code reuse (sharing definitions with problems 93, 98, and especially 651) rather than correctness issues. diff --git a/ai-review/661.md b/ai-review/661.md new file mode 100644 index 0000000000..e586ed72de --- /dev/null +++ b/ai-review/661.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 661 + +## 1. Code Reuse + +The file defines a custom `bipartiteDistinctDistances` using `Set.ncard`: + +```lean +noncomputable def bipartiteDistinctDistances + (X Y : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard {d : ℝ | ∃ x ∈ X, ∃ y ∈ Y, d = dist x y} +``` + +**Existing code in the codebase:** + +- `EuclideanGeometry.distinctDistances` in `FormalConjecturesForMathlib/Geometry/2d.lean` counts distinct distances within a *single* point set using `Finset.offDiag.image`. This is fundamentally different (self-distances with `p ≠ q` vs. cross-distances), so it cannot be directly reused. + +- Erdős 91 (`ErdosProblems/91.lean`) uses the `Finset`-based pattern `((A ×ˢ A).filter ...).image (fun pq => dist pq.1 pq.2) |>.card`. A bipartite analogue would be `((X ×ˢ Y).image (fun p => dist p.1 p.2)).card`, which avoids `Set.ncard` in favor of the more direct `Finset.card`. This would be stylistically more consistent with the rest of the codebase (Erdős 91, 93, 652, 657 all use `Finset.image`/`Finset.card`), but the current definition is mathematically equivalent and perfectly correct. + +**Verdict:** The custom definition is justified since no existing bipartite variant exists. Consider whether a shared `bipartiteDistinctDistances` utility in `FormalConjecturesForMathlib/Geometry/` would benefit other problems (e.g., if bipartite distance counting arises elsewhere). Minor stylistic preference: `(X ×ˢ Y).image (fun p => dist p.1 p.2) |>.card` would be more consistent with codebase conventions. + +## 2. Citations + +The formalization lists: +- [ErPa90] Erdős, P. and Pach, J. (1990) +- [Er92e] Erdős, P. (1992) +- [Er97e] Erdős, P. (1997) +- [Er97f] Erdős, P. (1997) + +The website (erdosproblems.com/661) lists: [ErPa90], [Er92e], [Er97e], [Er97f]. + +**Verdict:** Citations match. The formalization includes author names and years as short descriptions, which go beyond the website's bare tags. No issues. + +## 3. Variants + +The website mentions two additional aspects not captured by the formalization: + +1. **Higher-dimensional variants:** The problem can be posed in ℝ³. In ℝ⁴, Lenz showed that one can choose points x₁,…,xₙ, y₁,…,yₙ ∈ ℝ⁴ such that d(xᵢ, yⱼ) = 1 for all i, j (using points on two orthogonal circles), giving just 1 distinct bipartite distance. This resolves the ℝ⁴ case trivially. + +2. **Generalized F vs f formulation:** If F(2n) denotes the minimum number of distinct bipartite distances (over all choices of n + n points) and f(2n) the minimum number of distinct distances among any 2n points, the question becomes: is F = o(f)? + +3. **Related problem:** Problem 89 is mentioned as related. + +**Verdict:** The ℝ² case (the primary formulation) is captured. The higher-dimensional variants and the F-vs-f reformulation are not formalized. The ℝ⁴ Lenz result would make a nice additional theorem if desired. The ℝ³ open question could be a separate conjecture. + +## 4. Readability + +The code is clean and well-structured: +- The `bipartiteDistinctDistances` helper is clearly documented. +- The docstring on `erdos_661` restates the problem and explains the ε-N encoding of little-o. +- Namespace `Erdos661` keeps definitions scoped. + +**Minor suggestions:** +- The docstring could mention that this is equivalent to asking whether the minimum bipartite distinct distance count is o(n/√log n). +- No readability issues otherwise. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem asks whether bipartite distinct distances can be made o(n/√log n). This is precise: +- "Distinct distances d(xᵢ, yⱼ)" is unambiguous — count the distinct values in {dist(xᵢ, yⱼ) : 1 ≤ i, j ≤ n}. +- "o(n/√log n)" is standard asymptotic notation. +- "For all large n" means "for all sufficiently large n." + +The only minor ambiguity is whether the points x₁,…,xₙ and y₁,…,yₙ must be distinct within each group or across groups. The formalization uses `Finset`, which enforces distinctness within each set but allows overlap between X and Y. This is the standard interpretation in combinatorial geometry. + +**Verdict:** The problem is unambiguously formalizable. The ε-N encoding of little-o is the standard and correct approach. Ambiguity level: **very low**. + +## 6. Correctness + +**The ε-N formulation of o(n/√log n):** +The formalization states: for every ε > 0, there exists N such that for all n ≥ N, the bipartite distinct distance count is ≤ ε · n / √(log n). This is precisely the definition of "the count is o(n/√log n)." ✓ + +**Edge case analysis:** +- For n = 0 or n = 1: `Real.log 0 = 0` and `Real.log 1 = 0` in Mathlib, so `Real.sqrt (Real.log n) = 0`, making the RHS `ε * n / 0 = 0`. This would require 0 distinct bipartite distances, which is vacuously true for n = 0 (empty sets) but problematic for n = 1 (one pair gives exactly 1 distance). However, since N can be chosen arbitrarily large, these cases are avoided. ✓ + +**The `bipartiteDistinctDistances` definition:** +- Uses `Set.ncard` on `{d : ℝ | ∃ x ∈ X, ∃ y ∈ Y, d = dist x y}`. Since X, Y are finite, this set is finite (at most |X| · |Y| elements), so `Set.ncard` correctly returns the cardinality. ✓ +- The set includes distance 0 if any point lies in both X and Y. This is consistent with counting all bipartite pairs. ✓ +- Distances are non-negative (`dist x y ≥ 0`), so the set is a subset of [0, ∞). ✓ + +**Cast to ℝ:** +The comparison `(bipartiteDistinctDistances X Y : ℝ) ≤ ε * (n : ℝ) / Real.sqrt (Real.log (n : ℝ))` correctly casts the ℕ count to ℝ for comparison with the real-valued bound. ✓ + +**Overall mathematical assessment:** +The formalization is correct and complete for the primary ℝ² formulation of the problem. An experienced mathematician would not identify any flaws in the statement. The `answer(sorry)` wrapper correctly indicates this is an open problem whose truth value is unknown. + +**Verdict:** **Correct and complete** for the primary problem statement. No mathematical errors. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Custom definition justified; minor stylistic alternative available (`Finset.image` pattern) | +| Citations | Match website exactly | +| Variants | Primary ℝ² case captured; higher-dimensional variants and F-vs-f formulation not included | +| Readability | Good | +| Formalizability | Very low ambiguity; clearly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/662.md b/ai-review/662.md new file mode 100644 index 0000000000..c8295eb57a --- /dev/null +++ b/ai-review/662.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 662 + +## 1. Code Reuse + +Several existing codebase components could be leveraged: + +- **`Metric.IsSeparated'`** from `FormalConjecturesForMathlib/Topology/MetricSpace/MetricSeparated.lean` (line 34): Defines `ε`-separated sets via `s.Pairwise (ε ≤ edist · ·)`. The current formalization manually inlines the separation condition (`∀ p ∈ P, ∀ q ∈ P, p ≠ q → dist p q ≥ 1`). Using `IsSeparated'` would be more idiomatic, though it works in `ℝ≥0∞` (extended nonneg reals) rather than `ℝ`, so the conversion cost may outweigh the benefit. + +- **`ℝ²` notation** from `FormalConjecturesForMathlib/Geometry/2d.lean` (line 25): Provides `scoped notation "ℝ²" => EuclideanSpace ℝ (Fin 2)`. The current file writes out `EuclideanSpace ℝ (Fin 2)` explicitly. Using the notation would improve readability. + +- **`closePairCount` pattern**: The `(P ×ˢ P).filter` pattern used here is standard across many Erdős geometry problems (668, 756, 132, 135, 217, 605, etc.). Each problem defines its own local version. There is no shared utility for this, so the current approach is consistent with codebase conventions. + +**Verdict:** Minor opportunities. Could use `ℝ²` notation; the `IsSeparated'` predicate is available but the type mismatch (`ℝ≥0∞` vs `ℝ`) makes it a marginal improvement at best. + +## 2. Citations + +**Website ([erdosproblems.com/662](https://www.erdosproblems.com/662)):** +- Reference: **[Er97e, p.532]** +- Attribution: "A problem of Erdős, Lovász, and Vesztergombi." + +**Formalization (662.lean):** +- Docstring reference: `[Er97e, p.532]` — matches website. +- Attribution: "A problem of Erdős, Lovász, and Vesztergombi." — matches website. + +**Verdict:** Citations are correctly documented and match the website. + +## 3. Variants + +The website's problem statement is notably garbled. As written on the website, the problem says "the number of distances d(xᵢ, xⱼ) ≤ t is less than or equal to f(t)" — which is nonsensical because the number of distances among n points can be up to n(n−1), whereas f(t) is a fixed constant depending only on t. The website itself acknowledges this: "This does not make sense as written; there must be at least one typo." + +The formalization interprets the problem as: the number of close pairs is at most **n · f(t)** (i.e., bounded by n times the lattice neighbor count). This is a natural and mathematically reasonable interpretation — in the triangular lattice, each of the n points contributes at most f(t) neighbors within distance t, giving n · f(t) ordered close pairs total. The conjecture then asserts the triangular lattice is extremal. + +The website also mentions a "particular" sub-question: "Is it true that the number of distances ≤ √3 − ε is less than 1?" This is also nonsensical as written (number of distances < 1 means zero distances, which is trivially false for n ≥ 2). This variant is **not captured** in the formalization, which is reasonable given that it is incoherent as stated. + +**Verdict:** The formalization captures the most natural interpretation of the main conjecture. Omitted variants are justifiably omitted due to being nonsensical as written. The docstring correctly acknowledges the ambiguity. + +## 4. Readability + +The code is well-structured and readable: + +- **`triangularLatticeNeighborCount`**: The docstring clearly explains the connection between integer pairs (a, b) with a² + ab + b² ≤ t² and triangular lattice neighbors. The mathematical derivation (squared distance in the triangular lattice is a² + ab + b²) is correct and documented. +- **`closePairCount`**: Clean, self-explanatory definition. +- **Main theorem**: The quantifier structure (∀ t > 0, ∃ N, ∀ n ≥ N, ...) is clear. + +Minor suggestions: +- Could use the `ℝ²` notation from `Geometry/2d.lean` for brevity. +- The docstring note about typos is helpful context. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The original problem as stated on the website is **not** precise enough to be obviously formalizable — the website itself calls it nonsensical. The formalization makes an interpretive leap (multiplying f(t) by n) that is mathematically well-motivated but not explicitly stated in the source. + +The core mathematical concepts are all cleanly formalizable: +- Triangular lattice neighbor count via the quadratic form a² + ab + b²: precise. +- Unit-separated point sets in ℝ²: precise. +- Counting ordered close pairs: precise. +- The asymptotic threshold N depending on t: precise. + +**Verdict:** The formalization is precise, but the underlying problem statement is acknowledged as ambiguous. The interpretation chosen is the most natural one and is clearly documented. **Medium ambiguity** — the n · f(t) normalization is an editorial choice, not something explicitly stated in the source. + +## 6. Correctness + +### Triangular Lattice Model +The quadratic form a² + ab + b² correctly represents squared distances in the standard triangular lattice with unit spacing. Specifically, the triangular lattice can be generated by vectors (1, 0) and (1/2, √3/2), and the squared distance from the origin to the point a·(1,0) + b·(1/2, √3/2) is: + +(a + b/2)² + (b√3/2)² = a² + ab + b²/4 + 3b²/4 = a² + ab + b² ✓ + +The definition correctly excludes (0, 0) via the `p ≠ (0, 0)` condition, and uses `Set.ncard` which is appropriate for this countable-but-potentially-infinite set (though for any finite t, the set is finite). ✓ + +### Sanity Check: f(1) = 6 +For t = 1: we need a² + ab + b² ≤ 1 with (a, b) ≠ (0, 0) and a, b ∈ ℤ. The solutions are (±1, 0), (0, ±1), (1, −1), (−1, 1) — exactly 6. ✓ (Matches the docstring claim.) + +### Sanity Check: f(√3) = 12 +For t = √3: we need a² + ab + b² ≤ 3. Additional solutions beyond the 6 above: (±1, ±1), (±2, ∓1), (±1, ∓2) — wait, let me verify: +- (1, 1): 1 + 1 + 1 = 3 ≤ 3 ✓ +- (−1, −1): same ✓ +- (2, −1): 4 − 2 + 1 = 3 ≤ 3 ✓ +- (−2, 1): same ✓ +- (1, −2): 1 − 2 + 4 = 3 ≤ 3 ✓ +- (−1, 2): same ✓ + +That gives 6 + 6 = 12. ✓ (Matches the docstring claim.) + +### Close Pair Count +Uses ordered pairs via `P ×ˢ P` with filter for `pq.1 ≠ pq.2 ∧ dist pq.1 pq.2 ≤ t`. This correctly counts ordered pairs (both (i,j) and (j,i)), consistent with the problem statement which says "ordered pairs." ✓ + +### Theorem Statement +The quantifier structure `∀ t > 0, ∃ N, ∀ n ≥ N, ...` correctly captures "provided n is sufficiently large depending on t." The bound `closePairCount P t ≤ n * triangularLatticeNeighborCount t` is the natural per-point normalization. ✓ + +The use of `answer(sorry)` correctly wraps this as an open problem whose truth value is unknown. ✓ + +### Potential Issue: Non-strict inequality for distance +The problem uses `dist p q ≥ 1` (non-strict) for separation and `dist pq.1 pq.2 ≤ t` (non-strict) for counting. This is standard and correct for a lattice packing interpretation. + +### Potential Issue: t > 0 condition +The theorem requires `t > 0`, which is sensible — for t < 1, f(t) = 0, and with unit separation, there are no close pairs, making the bound trivially true. The interesting case is t ≥ 1. This is fine. + +**Verdict:** The formalization is **mathematically correct and complete** for the chosen interpretation. The triangular lattice model is accurately represented, the counting definitions are sound, and the theorem statement faithfully encodes the conjecture. No flaws identified. Any incompleteness is attributable to the ambiguity of the original problem statement, which is openly acknowledged. diff --git a/ai-review/663.md b/ai-review/663.md new file mode 100644 index 0000000000..c856f6d11f --- /dev/null +++ b/ai-review/663.md @@ -0,0 +1,78 @@ +# Review of Erdős Problem 663 + +## 1. Code Reuse + +**Problem 457** (`FormalConjectures/ErdosProblems/457.lean`) defines an essentially identical function `q(n, k)` — the least prime not dividing `∏ i ∈ Finset.Icc 1 ⌊k⌋₊, (n + i)` — but uses `Nat.find` with a constructive existence proof (`Nat.exists_prime_not_dvd`) instead of `sInf`. The two approaches compute the same value on valid inputs, but the `Nat.find` approach is arguably superior: it carries a built-in proof of existence, whereas the `sInf` approach silently returns `0` on the empty set (which can never arise in practice, but the formalization does not prove this). + +**Problem 388** (`FormalConjectures/ErdosProblems/388.lean:48`) defines `consecutiveProduct (m k : ℕ) := ∏ i ∈ Finset.range k, (m + 1 + i)`, which is exactly the product used inside `leastNondividingPrime`. This could be reused for clarity and consistency, though it lives in a different namespace. + +**Recommendation:** Consider aligning the definition of `leastNondividingPrime` with the `Nat.find`-based `q` from Problem 457, or at least referencing it. The `sInf` vs `Nat.find` discrepancy between two closely related problems (663 and 457, which even cross-reference each other) is a consistency issue. + +## 2. Citations + +The formalization lists: +- `[BEGL96] Balog, A., Erdős, P., Graham, R. L., and Leep, D.` +- `[Er97e] Erdős, P.` + +The website (erdosproblems.com/663) lists the same two references with the same citation keys. The formalization matches the website. However, neither the website nor the formalization provides full publication details (journal, year, title) for these references — the formalization accurately mirrors the website's level of detail. + +The website also mentions: +- A heuristic argument by **Terence Tao** in the comments section supporting the conjecture. +- Related OEIS sequence **A391668**. + +These are not included in the formalization, which is acceptable (comments and OEIS links are supplementary). + +## 3. Variants + +The website states: + +> "The bound $q(n,k) < (1+o(1))k\log n$ is easy. It may be true that this improved bound holds even up to $k = o(\log n)$." + +The docstring mentions both facts but only the main conjecture (fixed $k$) is formalized as a theorem. The **extended variant** — that the bound $q(n,k) < (1+o(1))\log n$ may hold even when $k$ grows as $o(\log n)$ — is **not formalized**. This would be a natural additional variant to include, e.g.: + +``` +theorem erdos_663.variants.growing_k : answer(sorry) ↔ + ∀ f : ℕ → ℕ, (∀ᶠ n in Filter.atTop, f n ≤ Real.log n) → + (fun n => (f n : ℝ) / Real.log n) →ᶠ[Filter.atTop] 0 → + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (leastNondividingPrime n (f n) : ℝ) < (1 + ε) * Real.log (n : ℝ) +``` + +The website also references **Problem 457** as related. Problem 457 asks about the reverse direction: whether $q(n, \log n) \geq (2+\varepsilon)\log n$ infinitely often. The cross-reference "See also problem 457" is present in the docstring, which is good. + +## 4. Readability + +The code is well-structured and readable overall. + +- The `leastNondividingPrime` definition has a clear docstring explaining what it computes and its edge-case behavior (returning 0). +- The theorem statement has a helpful docstring that explicitly spells out the ε-δ unfolding of the $o(1)$ notation. +- The use of `Finset.range k` with `(n + i + 1)` to represent $\prod_{i=1}^{k}(n+i)$ is a standard idiom but slightly less transparent than `Finset.Icc 1 k` with `(n + i)` as used in Problem 457. The latter more directly mirrors the mathematical notation $\prod_{1 \le i \le k}(n+i)$. + +**Minor suggestion:** The argument order `leastNondividingPrime n k` differs from Problem 457's `q n k` only in that `k` is `ℕ` in 663 but `ℝ` in 457 (to accommodate $k = \log n$). This is reasonable given the different contexts. + +## 5. Formalizability + +The problem is **fully formalizable** with essentially no ambiguity. + +- "$q(n,k)$ = least prime not dividing $\prod_{1 \le i \le k}(n+i)$" is entirely precise. +- The asymptotic statement "$q(n,k) < (1+o(1))\log n$" with "$k$ fixed and $n$ sufficiently large" has a standard, unambiguous ε-δ interpretation: for all ε > 0, there exists $N_0$ such that for all $n \geq N_0$, $q(n,k) < (1+\varepsilon)\log n$. The formalization correctly captures this. +- The only source of potential ambiguity is the base of $\log$: in analytic number theory, $\log$ universally means the natural logarithm, and `Real.log` is the natural logarithm. This is correct. + +**Ambiguity level: Very low.** The statement is precise and standard. + +## 6. Correctness + +**Product indexing:** `∏ i ∈ Finset.range k, (n + i + 1)` evaluates to $(n+1)(n+2)\cdots(n+k)$, which correctly matches $\prod_{1 \le i \le k}(n+i)$. ✓ + +**Asymptotic unfolding:** The formalization correctly expands "$q(n,k) < (1+o(1))\log n$ for fixed $k$" as: +$$\forall k \geq 2,\; \forall \varepsilon > 0,\; \exists N_0,\; \forall n \geq N_0,\; q(n,k) < (1+\varepsilon)\log n.$$ +This is mathematically correct. ✓ + +**`sInf` edge case:** If the set `{p | Nat.Prime p ∧ ¬(p ∣ product)}` were empty, `sInf` returns `0`. Since `0 < (1+ε) * log n` for large `n`, this would make the inequality trivially true. In reality, this set is always nonempty (a finite product has finitely many prime divisors, so there always exists a prime not dividing it), so this edge case cannot arise. The formalization is correct but does not encode this nonemptiness guarantee — unlike Problem 457's `Nat.find` approach which proves it. This is a **minor inelegance** rather than a correctness issue. + +**Type casting:** `(leastNondividingPrime n k : ℝ)` correctly casts the natural number result to ℝ for comparison with `(1 + ε) * Real.log (n : ℝ)`. ✓ + +**Quantifier order:** The universal quantification over $k$ before $\varepsilon$ is correct — the conjecture claims the bound holds for each fixed $k \geq 2$, and the $N_0$ may depend on both $k$ and $\varepsilon$. ✓ + +**Overall assessment:** The formalization is **mathematically correct and complete** for the main conjecture. The only gap is the missing variant for growing $k = o(\log n)$. diff --git a/ai-review/664.md b/ai-review/664.md new file mode 100644 index 0000000000..cb8a0c0941 --- /dev/null +++ b/ai-review/664.md @@ -0,0 +1,63 @@ +# Review: Erdős Problem 664 + +## 1. Code Reuse + +No significant code from `FormalConjecturesForMathlib` is directly applicable. The formalization relies only on basic `Finset` operations (`card`, `∩`, `Nonempty`), `Fin n` as the universe type, and `Real.sqrt` — all from Mathlib. The existing library infrastructure (arithmetic progressions, Sidon sets, density, etc.) does not overlap with this problem's domain of transversals of near-sunflower families. + +Problem 1159 formalizes the closely related weaker variant (projective plane blocking sets with bounded multiplicity) and uses `Configuration.ProjectivePlane`. No code is shared between the two, which is appropriate since 664 works with arbitrary families while 1159 uses projective planes directly. + +## 2. Citations + +The formalization includes references **[Er81]** and **[Er97f]**, matching the website. Specific details: + +- **[Er81]**: Listed as `Erdős, P., _Combinatorial problems in geometry and number theory_ (1981)` — matches the website citation tag. +- **[Er97f]**: Listed as `Erdős, P., _Some of my new and almost new problems and results in combinatorial number theory_ (1997)` — matches the website citation tag. +- **Alon's disproof**: Mentioned in the docstring ("Disproved by Alon using random subsets of lines of a projective plane, with c = 2/5") but no formal citation is given. The website also does not provide a specific Alon paper citation, so this is consistent. +- **Related problem**: The website lists Problem #1159 as the weaker open variant. The formalization of 664 does not cross-reference 1159. Adding a note like `See also: Erdős Problem 1159 for the weaker projective plane variant` would improve traceability. + +## 3. Variants + +The website describes a **weaker variant** from [Er81]: replacing the pairwise intersection condition `|A_i ∩ A_j| ≤ 1` with the stronger structural requirement that every pair of points lies in exactly one A_i (i.e., the A_i form the lines of a projective plane). This weaker conjecture **remains open** and is conjectured by Alon to also be false. + +This variant is **not captured** in the formalization of 664, but it **is formalized separately** as Problem 1159 (`erdos_1159`), which asks whether every finite projective plane has a blocking set hitting each line in at most C points. This separation is reasonable since 1159 has a different status (open vs. disproved) and uses different mathematical structures (`Configuration.ProjectivePlane`). + +**No missing variants** — the two formalizations together cover the problem landscape described on the website. + +## 4. Readability + +The code is clear and well-structured: + +- The module docstring provides the mathematical context, the conjecture statement, the resolution, and citations. +- The theorem docstring concisely restates the problem and its resolution. +- Variable names (`c`, `n`, `m`, `A`, `B`, `K`, `i`, `j`) follow standard mathematical conventions. +- The `Erdos664` namespace prevents name collisions. + +**Minor suggestion**: The docstring says "with $c = 2/5$" but doesn't clarify that this is the specific constant used in Alon's counterexample construction, not a threshold. A reader might wonder whether the conjecture fails only at c = 2/5 or for all c. The website clarifies that Alon's construction works for c = 2/5, but doesn't claim this is tight. + +## 5. Formalizability + +The problem is **fully formalizable** as stated. The original conjecture uses the notation `|B ∩ A_i| ≪_c 1` (bounded by a constant depending only on c), which is correctly interpreted as `∃ K : ℕ, ... ((A i) ∩ B).card ≤ K` with K quantified after c. + +**Ambiguity assessment: Low.** The only potential ambiguity is whether c > 0 is required (the original says "c < 1"). The formalization adds `0 < c`, which is mathematically inconsequential: for c ≤ 0, the condition |A_i| > c√n is trivially satisfied by any non-empty set, so restricting to c > 0 is a weakening. Since the statement is being disproved (answer is False), proving the weaker statement false implies the stronger statement is also false. + +## 6. Correctness + +**The formalization is mathematically correct.** + +**Quantifier structure analysis:** + +The RHS states: ∀ c ∈ (0,1), ∃ K, ∀ n m, ∀ A : Fin m → Finset (Fin n), [conditions] → ∃ B, [transversal with bounded intersection]. + +Its negation (what Alon proved): ∃ c ∈ (0,1) such that ∀ K, ∃ n, m, A satisfying the conditions where every transversal B has |B ∩ A_j| > K for some j. + +This correctly matches Alon's result: for c = 2/5, using random subsets of lines of a projective plane of order q (with n = m = q² + q + 1), any blocking set must intersect some line in Ω(log n) points, which exceeds any fixed K for large enough q. + +**Key correctness checks:** + +- **K depends on c, not on n or m**: Correct — K is quantified after c but before n, m. +- **B ⊆ {1,...,n}**: Enforced by `B : Finset (Fin n)`. This is without loss of generality since elements outside {1,...,n} cannot intersect any A_i. +- **Intersection commutativity**: `(A i) ∩ B` vs `B ∩ (A i)` — equivalent by commutativity of Finset intersection. +- **`answer(False)`**: Correctly reflects the disproved status. +- **Edge cases**: When m = 0, the conclusion holds vacuously (B = ∅ works). When n = 0, the hypothesis fails (|A_i| = 0 > 0 = c√0 is false). Both are handled correctly by the quantifier structure. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the conjecture as stated on the website. diff --git a/ai-review/665.md b/ai-review/665.md new file mode 100644 index 0000000000..2ee19a8390 --- /dev/null +++ b/ai-review/665.md @@ -0,0 +1,82 @@ +# Review: Erdős Problem 665 + +## 1. Code Reuse + +**Issue found.** Problem 903 (`FormalConjectures/ErdosProblems/903.lean`) defines its own `IsPairwiseBalancedDesign` in the `Erdos903` namespace: + +```lean +def IsPairwiseBalancedDesign {n : ℕ} (blocks : Finset (Finset (Fin n))) : Prop := + ∀ x y : Fin n, x ≠ y → + ∃! B : Finset (Fin n), B ∈ blocks ∧ x ∈ B ∧ y ∈ B +``` + +Problem 665 defines a variant in `Erdos665` that adds block-size constraints (`2 ≤ B.card ∧ B.card < n`). These two definitions should be unified. The 665 version is more standard (PBDs conventionally require non-trivial block sizes). A shared definition could be placed in a utility module, with 665's size constraints applied as an additional predicate or folded into the base definition. Problem 903's definition without the size constraints is technically non-standard, though for the specific statement of 903 it is unlikely to affect correctness (singleton blocks cover no pairs and the full ground set as a block forces a trivial design). + +Additionally, Mathlib provides `Configuration.ProjectivePlane` in `Mathlib.Combinatorics.Configuration`, which is relevant since the docstring discusses Shrikhande–Singhi's conditional result linking PBDs to projective planes. This connection is not formalized but could be noted. + +## 2. Citations + +The formalization includes three references: `[ErLa82]`, `[ShSi85]`, and `[Er97f]`. Compared to the website: + +- **[ErLa82]**: The formalization says "Erdős, P. and Larson, J. A., 1982." The website does not give full titles for these references either, but the standard reference is: Erdős, P. and Larson, J. A., "On pairwise balanced block designs with the sizes of blocks as uniform as possible," *Annals of Discrete Mathematics*, 1982. A full title would be preferable. +- **[Er97f]**: The formalization says "Erdős, P., 1997." The website cites this as **[Er97f, p.3]** — the page number is missing from the formalization. +- **[ShSi85]**: The formalization says "Shrikhande, S. S. and Singhi, N. M., 1985." Again, a full paper title is not provided. +- **Missing link to Problem 723**: The website explicitly mentions the related problem [723] (the prime power conjecture for projective planes). The formalization's docstring does not cross-reference Problem 723, which exists in the codebase at `FormalConjectures/ErdosProblems/723.lean`. + +## 3. Variants + +**Missing variant.** The website describes a more general form of the problem: + +> Find the slowest-growing function $h(n)$ such that for all large $n$, a PBD exists with $|A_i| > \sqrt{n} - h(n)$ for all blocks. + +The formalization only captures the special case where $h(n)$ is a constant $C$. The general variant is mathematically richer and captures the known partial results more naturally: + +- Erdős & Larson proved $h(n) \ll n^{1/2 - c}$ for some $c > 0$. +- Under Cramér-type prime gap bounds, $h(n) \ll (\log n)^2$. +- Assuming the prime power conjecture, $h(n) \asymp H(n)$ where $H(n)$ is the largest prime gap below $n$. + +A formalization of the general variant would be a valuable addition. + +## 4. Readability + +The code is clear and well-structured. The `IsPairwiseBalancedDesign` definition has a helpful docstring. Minor suggestions: + +- The theorem docstring mentions the Shrikhande–Singhi conditional result, which is good context. It could additionally note the connection to Problem 723. +- The block-size constraint `(↑B.card : ℝ) > Real.sqrt ↑n - C` involves a coercion from `ℕ` to `ℝ` which is standard but adds some visual noise. This is unavoidable given that `Real.sqrt` returns a real. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: it asks a yes/no question about the existence of a constant. The definition of a PBD is standard and unambiguous. The formalization correctly uses `answer(sorry)` to encode the unknown boolean answer. + +The only source of mild ambiguity is whether "block size $> \sqrt{n} - C$" means strict or non-strict inequality. The website uses "$>$" and the formalization uses strict inequality (`>`), which is consistent. Since $C$ is a free constant, the choice between strict and non-strict inequality is immaterial (adjusting $C$ by any $\varepsilon > 0$ converts between them). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **PBD definition**: Correctly requires (a) all blocks have cardinality in $[2, n)$, and (b) every pair of distinct elements appears in exactly one block. This matches the standard definition. +- **Main statement**: Correctly asks whether $\exists C > 0, \exists n_0, \forall n \geq n_0, \exists$ a PBD on $\text{Fin}(n)$ with all blocks of size $> \sqrt{n} - C$. This faithfully captures the problem on the website. +- **Use of `Fin n`**: Appropriate — the ground set $\{1, \ldots, n\}$ is naturally modeled by `Fin n`. +- **Use of `Finset (Finset (Fin n))`**: Blocks are modeled as a `Finset` of `Finset`s. This means blocks are distinct (no repeated blocks). For a PBD this is correct — the unique-pair property implies blocks are distinct anyway. +- **Quantifier structure**: The `∃ C > 0, ∃ n₀, ∀ n ≥ n₀` structure correctly captures "for all sufficiently large $n$." +- **Expected answer**: The expected answer is **no** (conditionally on the prime power conjecture), so `answer(sorry)` should resolve to `False`. This is consistent with the formalization. +- **`C > 0` constraint**: This is mathematically harmless (if $C \leq 0$ worked, any $C' > 0$ would also work since larger $C$ weakens the constraint). So requiring $C > 0$ does not change the mathematical content. It does prevent the trivial case $C = 0$ from needing separate treatment. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the main question as stated on the website. The only gap is the missing general variant (see §3), which is a separate question rather than a correctness issue. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Duplicate PBD definition with Problem 903; should unify | +| Citations | Missing page number for [Er97f, p.3]; missing cross-ref to Problem 723; no full paper titles | +| Variants | General $h(n)$ variant not captured | +| Readability | Good | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Correct and complete for the main question | diff --git a/ai-review/666.md b/ai-review/666.md new file mode 100644 index 0000000000..a9b1940ff4 --- /dev/null +++ b/ai-review/666.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 666 + +## 1. Code Reuse + +The definitions `hypercubeGraph` and `cycleGraph` in `666.lean` are duplicated verbatim across at least five files: `86.lean`, `576.lean`, `578.lean`, `1035.lean`, and `666.lean`. These could be extracted into a shared utility (e.g., in `FormalConjectures/Util/`). Currently no such shared graph utility exists. + +Additionally, the subgraph containment pattern used inline: +```lean +∃ f : Fin 6 → (Fin n → Bool), Function.Injective f ∧ + ∀ i j, (cycleGraph 6 (by omega)).Adj i j → H.Adj (f i) (f j) +``` +is equivalent to the `ContainsSubgraph` definition used in Problems 59, 87, 146, 147, 765, 1035, 1079, and others: +```lean +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` +Problem 666 inlines this rather than using the named abstraction. Problem 86 (the closely related C₄ variant) also inlines it, so there is at least internal consistency between the two sibling problems. + +**Recommendation:** Extract `hypercubeGraph`, `cycleGraph`, and `ContainsSubgraph` into shared definitions. At minimum, note the duplication. + +## 2. Citations + +The citations in `666.lean` match those on [erdosproblems.com/666](https://www.erdosproblems.com/666): + +| Citation | In file | On website | +|----------|---------|------------| +| [Er91] Erdős, *Some of my favourite problems...* | Yes | Yes | +| [Er92b] Erdős, *Some of my old and new problems...* | Yes | Yes | +| [Er97f] Erdős, *Some recent problems and results...* | Yes | Yes | +| [Ch92] Chung, *Subgraphs of a hypercube...* | Yes | Yes | +| [BDT93] Brouwer, Dejter, Thomassen, *Highly symmetric subgraphs...* | Yes | Yes | + +All citations are complete with full bibliographic details. No discrepancies found. + +## 3. Variants + +The website mentions a generalized variant suggested by Erdős: + +> Perhaps for every $k \geq 3$, there exist constants $c$ and $a_k < 1$ such that every subgraph of $Q_n$ with $\geq c \cdot n^{a_k} \cdot 2^n$ edges contains $C_{2k}$, where $a_k \to 0$ as $k \to \infty$. + +**This variant is not captured in the formalization.** The current formalization only addresses the specific $C_6$ question. Since this is a separate generalized conjecture (and is not directly the statement of Problem 666 but rather a related suggestion), its omission is understandable but worth noting. + +The website also lists Problem 86 (the $C_4$ analogue) as a related problem. Problem 86 is formalized separately in `86.lean` with a consistent structure. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The module docstring clearly states both the problem and its resolution, matching best practices seen in other files. +- The `hypercubeGraph` and `cycleGraph` definitions have clear docstrings with LaTeX. +- The theorem docstring restates the problem and the disproof result. +- Minor: Problem 86 marks `hypercubeGraph` as `noncomputable`, while Problem 666 does not. This inconsistency is cosmetic (both are behind `sorry`) but could cause issues if proofs are ever filled in, since `edgeFinset` requires decidability. + +**Readability is good overall.** Using `ContainsSubgraph` would slightly improve readability of the theorem statement. + +## 5. Formalizability + +The problem is **precisely and unambiguously formalizable**. All components have clear mathematical definitions: + +- The hypercube graph $Q_n$ is standard. +- The cycle graph $C_6$ is standard. +- "Subgraph of $Q_n$" means a graph on the same vertex set whose edge set is a subset — captured by the condition `∀ u v, H.Adj u v → (hypercubeGraph n).Adj u v`. +- The edge count threshold $\varepsilon \cdot n \cdot 2^{n-1}$ is explicit. +- "Contains a $C_6$" means there exists an injective graph homomorphism from $C_6$ into $H$ — the standard notion. + +There is no meaningful ambiguity in this problem statement. **Ambiguity: None.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Answer value:** `answer(False)` correctly encodes that the conjecture is disproved. The biconditional `False ↔ (statement)` asserts the statement is false, consistent with the known counterexamples by Chung [Ch92] and Brouwer–Dejter–Thomassen [BDT93]. + +**Logical structure:** The RHS correctly formalizes "for every $\varepsilon > 0$, for sufficiently large $n$, every subgraph of $Q_n$ with $\geq \varepsilon \cdot n \cdot 2^{n-1}$ edges contains a $C_6$." The quantifier structure ($\forall \varepsilon > 0, \exists N, \forall n \geq N, \forall H, \ldots$) is correct. + +**Edge count expression:** `ε * ↑n * (2 : ℝ) ^ (n - 1 : ℕ)` correctly computes $\varepsilon \cdot n \cdot 2^{n-1}$. The use of `(n - 1 : ℕ)` (truncated subtraction) is safe because the existential quantifier over $N$ means we only need this for sufficiently large $n$, where truncated subtraction agrees with integer subtraction. + +**Subgraph condition:** `∀ u v, H.Adj u v → (hypercubeGraph n).Adj u v` correctly encodes that $H$ is a spanning subgraph of $Q_n$ (edges of $H$ are a subset of edges of $Q_n$, on the same vertex set). + +**Cycle containment:** The injective homomorphism condition correctly captures containing $C_6$ as a subgraph (not merely as a closed walk or topological minor). This is the standard combinatorial notion. + +**Potential technical concern:** The statement uses `H.edgeFinset.card`, which in Lean/Mathlib requires `DecidableRel H.Adj` and `Fintype H.edgeSet`. Since `H` is universally quantified as an arbitrary `SimpleGraph (Fin n → Bool)`, this relies on classical decidability (available via `open Classical` in the imports). This is mathematically sound but worth noting for proof engineering. + +**No mathematical errors found.** + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Duplicated definitions; could use shared `hypercubeGraph`, `cycleGraph`, `ContainsSubgraph` | +| Citations | Complete and accurate | +| Variants | General $C_{2k}$ variant from website not captured | +| Readability | Good | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct | diff --git a/ai-review/667.md b/ai-review/667.md new file mode 100644 index 0000000000..03a1b7e33b --- /dev/null +++ b/ai-review/667.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 667 + +**File:** `FormalConjectures/ErdosProblems/667.lean` + +--- + +## 1. Code Reuse + +The file defines three custom helpers: `edgesInSubset`, `HasDensityProperty`, and `erdosH`, plus `erdosC` for the asymptotic constant. + +- **`edgesInSubset`**: Counts edges within a vertex subset by filtering `S ×ˢ S` for ordered adjacent pairs. There is no exact Mathlib equivalent for counting edges induced on a `Finset` of vertices of a `SimpleGraph`. Mathlib's `SimpleGraph.edgeFinset` gives all edges of a graph, but filtering to a vertex-induced subgraph would require similar manual work. The custom definition is reasonable. +- **`erdosH` / `sSup` pattern**: The `sSup {m : ℕ | ∀ G ...}` pattern is used consistently across many Erdős problems (765, 573, 500, 59, 146, 1079, etc.). No shared utility exists for this; each problem defines its own. This is acceptable since the quantifier structure varies per problem. +- **`erdosC` / `Filter.liminf` pattern**: Similar liminf-over-atTop patterns appear in other problems (e.g., 671). The `Set.lowerDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean` uses `Filter.liminf` as well, but for a different purpose (natural density of integer sets). No reuse opportunity. +- **`IsNClique`**: Correctly uses the standard Mathlib definition `SimpleGraph.IsNClique`, which is widely used across the codebase (problems 924, 58, 22, 19, 167, 1174, 1010, 1011, 1013, etc.). + +**Verdict:** No significant reuse opportunities missed. The custom definitions are appropriate. + +## 2. Citations + +The docstring references `[Er97f]` attributed to "Erdős, P., Faudree, R., Rousseau, C., and Schelp, R." + +The [erdosproblems.com/667](https://www.erdosproblems.com/667) page lists the same attribution. However, the full bibliographic entry is incomplete in both the website and the formalization — no paper title, journal, or year is given beyond the shorthand `[Er97f]`. + +The formalization faithfully reproduces what is available on the website. No additional citation information can be extracted. + +**Verdict:** Citations match the website. The reference is as complete as the source allows. + +## 3. Variants + +The website provides additional context about known bounds: +- When q = 1, this reduces to the classical Ramsey problem, with known bounds 1/(p−1) ≤ c(p, 1) ≤ 2/(p+1). +- When q = C(p−1, 2) + 1, it is known that c(p, q) = 1. +- Erdős, Faudree, Rousseau, and Schelp proved c(p, C(p−1, 2)) ≤ 1/2. + +These are known partial results, not separate conjectures or problem variants. They provide supporting evidence for why strict monotonicity is plausible but are not themselves open problems requiring separate formalization. + +**Verdict:** No additional variants to capture. The formalization addresses the single open question. + +## 4. Readability + +The code is well-structured: +- Helper definitions (`edgesInSubset`, `HasDensityProperty`, `erdosH`, `erdosC`) are each given clear docstrings that connect the Lean definition to the mathematical notation. +- The namespace `Erdos667` prevents name collisions. +- The `open SimpleGraph Finset Filter Classical` is standard for this codebase. + +Minor observations: +- The `edgesInSubset` docstring says "count of pairs (u, v) with u < v" which accurately describes the filtering by `e.1 < e.2`. +- The main theorem docstring clearly restates the problem and expands the strict monotonicity condition. + +**Verdict:** Readable and well-documented. No improvements needed. + +## 5. Formalizability + +The problem is a yes/no question: "Is c(p,q) strictly increasing in q for 1 ≤ q ≤ C(p−1, 2) + 1?" + +This is precise and unambiguous: +- H(n; p, q) is defined as a concrete extremal quantity over finite graphs. +- c(p, q) is a standard liminf of a ratio of logarithms. +- "Strictly increasing" over a discrete range is equivalent to c(p, q) < c(p, q+1) for each consecutive pair. +- The range 1 ≤ q ≤ C(p−1, 2) + 1 is explicit. + +There is no ambiguity in the statement. The only subtlety is that the problem is open, so the `answer(sorry)` pattern correctly encodes that we don't know whether the answer is yes or no. + +**Verdict:** Fully formalizable. No ambiguity. + +## 6. Correctness + +### Definition of `edgesInSubset` +Counts ordered pairs (u, v) in S × S with u < v and G.Adj u v. Since `Fin n` has a linear order, filtering by `<` correctly counts each edge exactly once. This is correct. + +### Definition of `HasDensityProperty` +States that every p-element subset of vertices spans at least q edges. Matches the mathematical definition. + +### Definition of `erdosH` +Uses `sSup {m : ℕ | ∀ G, HasDensityProperty G p q → ∃ S, G.IsNClique m S}`. This is the largest m guaranteed across all graphs with the density property. The set is: +- **Nonempty**: Always contains 0 (the empty clique `IsNClique 0 ∅` holds trivially). +- **Bounded above**: Bounded by n (cannot have a clique larger than n vertices). +- **Downward-closed**: If every dense graph has an m-clique, it also has an m′-clique for m′ ≤ m (by taking subsets). + +So `sSup` over ℕ (which has `ConditionallyCompleteLinearOrderBot`) is well-defined and equals the maximum of the set. This correctly captures H(n; p, q). + +### Definition of `erdosC` +Uses `Filter.liminf` of `log(H(n))/log(n)` as n → ∞. For finitely many small n (where log(n) = 0), the ratio is ill-defined (0/0 = 0 by convention in Lean), but this does not affect the liminf since it depends only on the tail behavior. This correctly captures c(p, q). + +### Main theorem `erdos_667` +States: `answer(sorry) ↔ ∀ p ≥ 1, ∀ q, 1 ≤ q → q < (p-1).choose 2 + 1 → erdosC p q < erdosC p (q+1)`. + +- The universal quantification over p ≥ 1 matches "let p ≥ 1 be fixed." +- The condition `1 ≤ q ∧ q < (p-1).choose 2 + 1` correctly captures q ranging over {1, ..., C(p−1, 2)}, which is the set where consecutive strict increase must hold to establish monotonicity on {1, ..., C(p−1, 2) + 1}. +- For p = 1 or p = 2, the range is empty (C(0,2) + 1 = 1 and C(1,2) + 1 = 1), so the statement is vacuously true. The first nontrivial case is p = 3 where q ∈ {1} and we need c(3,1) < c(3,2). This is mathematically appropriate. +- The `answer(sorry)` pattern correctly encodes this as an open yes/no question. + +**One subtle note on `Nat` subtraction**: `(p - 1).choose 2` uses natural number subtraction. For p = 0 (excluded by p ≥ 1), this would give `(0 - 1).choose 2 = 0.choose 2 = 0` in ℕ, which is harmless. The constraint p ≥ 1 ensures the intended behavior. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities | +| Citations | Match website; reference is incomplete at source | +| Variants | No additional variants to capture | +| Readability | Clean and well-documented | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/668.md b/ai-review/668.md new file mode 100644 index 0000000000..1a088f7b8a --- /dev/null +++ b/ai-review/668.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 668 + +## 1. Code Reuse + +There is significant duplication with **Problem 90** (`ErdosProblems/90.lean`) and **Problem 96** (`ErdosProblems/96.lean`), both of which define their own unit distance counting functions and work in ℝ²: + +- **Problem 90** defines `unitDistancePairsCount` (unordered pairs via `offDiag` divided by 2) and its own `maxUnitDistances` (via `sSup`). It also proves `unitDistanceCounts_BddAbove`, a lemma showing the set of achievable counts is bounded — something Problem 668 lacks but implicitly relies on for `sSup` to be meaningful. +- **Problem 96** defines `unitDistancePairCount` (ordered pairs via `offDiag`). + +Problem 668 defines yet another variant, `unitDistanceCount`, using the Cartesian product `P ×ˢ P` with an explicit `pq.1 ≠ pq.2` filter. All three files independently define essentially the same concept. These definitions should be consolidated into a shared utility (e.g., in `FormalConjecturesForMathlib/`). + +Additionally, Problem 668's `maxUnitDistances` duplicates Problem 90's definition of the same name. The `AreCongruent` definition could also be reused by other geometric problems (e.g., 687, 633, 634 which also deal with congruence in ℝ²). + +**Recommendation:** Extract `unitDistanceCount`, `maxUnitDistances`, and `AreCongruent` into a shared file. At minimum, reuse Problem 90's `maxUnitDistances` and its `BddAbove` lemma. + +## 2. Citations + +The formalization cites: + +> [Er97f] Erdős, P., *Some of my favourite problems which recently have been solved*. Proceedings of the International Conference on Set-theoretic Topology and its Applications (Matsuyama, 1994) (1997), 59-79. + +The [erdosproblems.com/668](https://www.erdosproblems.com/668) page lists three references: +1. **[Er97f]** — Erdős (1997) ✓ (present in formalization) +2. **[EHSVZ25]** — Engel, Hammond-Lee, Su, Varga, and Zsámboki (2025) ✗ (missing) +3. **[AMP25]** — Alexeev, Mixon, and Parshall (2025) ✗ (missing) + +The latter two references concern computational studies finding evidence of uniqueness (up to graph isomorphism) for maximizers with 5 ≤ n ≤ 21. These are relevant to the additional commentary and to Part 2 of the formalization. They should be included in the docstring. + +## 3. Variants + +The website poses two questions: +1. Does the number of incongruent maximizing sets tend to infinity? → Captured by `erdos_668`. +2. Is the count always > 1 for n > 3? → Captured by `erdos_668.variants.part2`. + +**Both variants are captured.** The formalization also correctly notes in the Part 2 docstring that computational evidence suggests this part may be false (the count is 1 for n = 4, and computational studies suggest uniqueness for many small n). This is a faithful representation. + +The website's additional commentary about computational evidence suggesting uniqueness up to *graph isomorphism* for 5 ≤ n ≤ 21 is worth noting — this is a stronger notion than geometric congruence, so uniqueness up to graph isomorphism implies uniqueness up to congruence, providing even stronger evidence that Part 2 is false. + +## 4. Readability + +**Generally good**, with some suggestions: + +- In `unitDistanceCount`, the condition `pq.1 ≠ pq.2 ∧ dist pq.1 pq.2 = 1` contains a redundant conjunct: `dist x y = 1` already implies `x ≠ y` (since `dist x x = 0 ≠ 1`). Removing `pq.1 ≠ pq.2` would simplify the definition without changing semantics. +- The counting convention (ordered vs. unordered pairs) differs from Problem 90 (which counts unordered pairs). This is mathematically inconsequential for the maximization problem, but the inconsistency across the codebase could cause confusion. A comment clarifying the choice of ordered pairs would help. +- Problem 90 uses the notation `ℝ²` while Problem 668 uses the more verbose `EuclideanSpace ℝ (Fin 2)`. Consistency would improve readability. + +## 5. Formalizability + +**High formalizability.** The problem is precise enough to be unambiguously formalized: + +- "Incongruent point sets" is a well-defined geometric concept (up to distance-preserving bijections of the ambient space). +- "Maximise the number of unit distances" is well-defined given a fixed n. +- "Tends to infinity" has a standard ε-N formalization. + +The only source of ambiguity is the second part ("always > 1 for n > 3"), where Erdős's own commentary contradicts the conjecture for n = 4. The formalization handles this correctly by using `answer(sorry)`, acknowledging the answer may be `False`. + +**Ambiguity: Low.** The mathematical content is clear and standard. + +## 6. Correctness + +### Main theorem (`erdos_668`) + +The formalization states: for every M, there exists N such that for all n ≥ N, there exist M pairwise non-congruent n-point sets each achieving the maximum unit distance count. + +This is a correct formalization of "the number of incongruent maximizing configurations tends to infinity." ✓ + +**Potential concern with `maxUnitDistances`:** The definition uses `sSup` on a set of natural numbers. For this to be well-defined: +- The set must be **nonempty**: ✓ (for any n, take any n-point set). +- The set must be **bounded above**: ✓ (bounded by n·(n−1)), but unlike Problem 90, **no `BddAbove` lemma is provided**. This is a gap — without it, a prover working with this definition would need to establish boundedness from scratch. This is not a correctness bug (the definition is correct), but it's an incompleteness. + +### AreCongruent definition + +The definition requires a distance-preserving map `f : ℝ² → ℝ²` with `f '' P = Q`. This correctly captures geometric congruence: +- Any distance-preserving map on Euclidean space is automatically an affine isometry (by Mazur-Ulam), so this includes all rigid motions and reflections. ✓ +- The condition `f '' P = Q` ensures surjectivity onto Q. ✓ +- Reflections are allowed, which is standard for "congruent" in this context. ✓ + +### Part 2 (`erdos_668.variants.part2`) + +Correctly formalizes "for all n > 3, there exist two non-congruent maximizers." The docstring appropriately flags that this is likely false as stated. ✓ + +### Summary + +The formalization is **mathematically correct and complete**. No experienced mathematician would identify flaws in the logical content. The main gaps are: +1. Missing `BddAbove` lemma for `maxUnitDistances` (a proof convenience issue, not a correctness issue). +2. Missing citations for [EHSVZ25] and [AMP25]. +3. Duplicated definitions that should be shared with Problem 90. diff --git a/ai-review/669.md b/ai-review/669.md new file mode 100644 index 0000000000..e47bd311dd --- /dev/null +++ b/ai-review/669.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 669 + +## 1. Code Reuse + +**Significant duplication exists with Problems 588 and 101.** + +- `atLeastKPointLineCount` in 669 (lines 54–58) is **definitionally identical** to `kRichLineCount` in `ErdosProblems/588.lean` (lines 42–45). Both count lines through at least k points using the same `Module.finrank ℝ L.direction = 1` characterization and `Set.ncard` pattern. These should share a common definition (or one should import the other). + +- Problem 101's `fourRichLineCount` (`ErdosProblems/101.lean:45–48`) is the specialization to k = 4 of the same definition. + +- Problem 102 (`ErdosProblems/102.lean:35–38`) also duplicates this pattern. + +- Several files (209, 210, 211) use a `Point2` abbreviation (`abbrev Point2 := EuclideanSpace ℝ (Fin 2)`) for cleaner signatures. The `FormalConjecturesForMathlib/Geometry/2d.lean` file provides a scoped notation `ℝ²` for the same type. Problem 669 could use either for conciseness. + +**Recommendation:** Extract the k-rich line counting definition into a shared utility (or have 669 import from 588, since `kRichLineCount` is already a parameterized version). The `exactlyKPointLineCount` definition is unique to 669 and does not appear elsewhere in the codebase. + +## 2. Citations + +The formalization's citations are **consistent with the website** (erdosproblems.com/669): + +- **[Er97f]** — Erdős, P., *Some of my new and almost new problems and results in combinatorial geometry* (1997). ✓ Matches. +- **[BGS74]** — Burr, S. A., Grünbaum, B., and Sloane, N. J. A., *The orchard problem*, Geometriae Dedicata (1974). ✓ Matches. +- Cross-reference to Problem #101. ✓ Matches. + +**Missing from the formalization:** The website lists related OEIS sequences A003035, A006065, A008997. These are not mentioned in the docstring. This is minor but could be added for completeness. + +## 3. Variants + +The formalization captures three aspects: +1. Existence of lim F_k(n)/n² (Part 1, `erdos_669`) +2. Existence of lim f_k(n)/n² (Part 2, `erdos_669.variants.littleF_limit_exists`) +3. Trivial upper bound F_k(n) ≤ n(n−1)/(k(k−1)) (`erdos_669.variants.trivial_bound`) + +**Missing variants that could be formalized:** +- **f_k(n) ≤ F_k(n)** — Stated as trivial in the docstring but not formalized. This is a straightforward consequence of the definitions. +- **f_2(n) = F_2(n) = C(n,2)** — Stated in the docstring but not formalized. +- **The k = 3 (Orchard) result:** f_3(n) = n²/6 − O(n) and F_3(n) = n²/6 − O(n) from [BGS74]. This is a known result that could be stated as a theorem. +- **Determining the actual limit values** — The original problem asks to "determine" the limits, not merely show they exist. The formalization only captures existence. A stronger variant could state the conjectured or known values for specific k. +- **The limit inequality** lim F_k(n)/n² ≤ 1/(k(k−1)) — this follows from the trivial bound but is not stated as a corollary about the limit itself. + +## 4. Readability + +The code is **generally readable** with clear docstrings and naming conventions. Minor suggestions: + +- The type `EuclideanSpace ℝ (Fin 2)` appears 8 times. A local abbreviation (as in Problem 209's `Point2` or `2d.lean`'s `ℝ²`) would reduce visual clutter. +- The nested set-builder notation `{p : EuclideanSpace ℝ (Fin 2) | p ∈ (P : Set _) ∧ p ∈ L}` is heavy. A helper predicate like `pointsOnLine P L` could improve clarity, especially since it appears in both `atLeastKPointLineCount` and `exactlyKPointLineCount`. +- The names `bigF` and `littleF` are good informal names matching the mathematical notation F_k and f_k. + +## 5. Formalizability + +**The problem is partially formalizable with inherent ambiguity.** + +The original statement "Estimate f_k(n) and F_k(n)" is vague — "estimate" does not have a precise mathematical meaning. The formalization makes the reasonable choice of interpreting this as proving the existence of the limits lim F_k(n)/n² and lim f_k(n)/n², which is one natural sub-question. + +However, "determine lim F_k(n)/n² and lim f_k(n)/n²" is stronger than proving existence — it asks for explicit values. The formalization only captures existence. This is a defensible choice since the explicit values are unknown for general k, but it should be noted as a weakening of the original problem. + +**Ambiguity level: Moderate.** The core definitions (F_k, f_k) are precise. The question "estimate" is inherently informal. The formalization captures a well-defined mathematical sub-problem. + +## 6. Correctness + +### Definitions + +- **Line characterization via `Module.finrank ℝ L.direction = 1`**: Correct. A 1-dimensional affine subspace of ℝ² is precisely an affine line. This is the standard approach used across the codebase (101, 102, 105, 588, 960, etc.). + +- **`atLeastKPointLineCount`**: Correctly counts lines through ≥ k points using `Set.ncard` on the set of qualifying affine subspaces. ✓ + +- **`exactlyKPointLineCount`**: Correctly counts lines through exactly k points. ✓ + +- **`bigF` and `littleF` via `sSup`**: These use `sSup` on ℕ over the set of achievable line counts for n-point configurations. This is mathematically correct: for any fixed n, the set of achievable values is nonempty (any n-point configuration witnesses some value) and bounded above (by C(n,2)), so `sSup` on `ℕ` (which is a `ConditionallyCompleteLinearOrderBot`) returns the correct maximum. For n = 0, the set is {0} and sSup = 0, which is correct. + +### Theorems + +- **`erdos_669` (limit of F_k(n)/n²)**: The ε-N formulation with `≤ ε` (rather than `< ε`) is **mathematically equivalent** to the standard limit definition for existence purposes. The hypothesis `k ≥ 2` is correct — for k < 2 the definitions are degenerate. ✓ + +- **`erdos_669.variants.littleF_limit_exists`**: Same structure, same correctness. ✓ + +- **`erdos_669.variants.trivial_bound`**: States F_k(n) ≤ n(n−1)/(k(k−1)). This is the correct simplification of C(n,2)/C(k,2) = [n(n−1)/2] / [k(k−1)/2] = n(n−1)/(k(k−1)). The bound holds for all n and k ≥ 2. ✓ + +### Potential Technical Concern + +The `sSup` definitions quantify over *all* `Finset (EuclideanSpace ℝ (Fin 2))` of a given cardinality, which is correct since we want the maximum over all possible n-point configurations in the plane. There is no issue with the uncountability of configurations — `sSup` on ℕ only cares about the *set of achievable natural number values*, which is finite and bounded. + +### Division by Zero + +In the limit statements, when n = 0, the expression `(bigF k 0 : ℝ) / (0 : ℝ)^2` evaluates to `0 / 0 = 0` in Lean (since division by zero returns 0 in ℝ). This is harmless since the ε-N formulation only requires the bound to hold for n ≥ N₀, and one can always choose N₀ ≥ 1. + +### Summary + +The formalization is **mathematically correct** for what it claims. The main limitation is that it captures limit *existence* rather than the full "determine the limit" question, but this is attributable to the ambiguity of the original problem statement rather than an error in the formalization. diff --git a/ai-review/670.md b/ai-review/670.md new file mode 100644 index 0000000000..209e506787 --- /dev/null +++ b/ai-review/670.md @@ -0,0 +1,87 @@ +# Review: Erdős Problem 670 + +## 1. Code Reuse + +The custom predicate `AllPairwiseDistancesDifferByOne` is specific to this problem and has no direct equivalent in the codebase. Related but distinct predicates exist: + +- **`Metric.IsSeparated'`** (`FormalConjecturesForMathlib/Topology/MetricSpace/MetricSeparated.lean`): Requires *points* to be pairwise ε-separated in distance. Problem 670 requires *pairwise distances* (the real numbers `dist a b`) to be separated from each other by at least 1. These are fundamentally different concepts. +- **`AllPairwiseDistinctDists`** (`ErdosProblems/1088.lean`): Requires all pairwise distances to be *distinct*. Problem 670 strengthens this to require separation by at least 1. +- **`IsUnitSeparated`** (`ErdosProblems/103.lean`): Requires all pairwise *point* distances ≥ 1. Again different from requiring the *differences of distances* to be ≥ 1. + +**Verdict:** No existing utility can replace `AllPairwiseDistancesDifferByOne`. The predicate is appropriately defined locally. + +## 2. Citations + +The formalization cites: + +> [Er97f] Erdős, P., *Some of my new and almost new problems and results in combinatorial geometry*. (1997) + +The website (erdosproblems.com/670) lists the reference as **[Er97f]** with tags "geometry, distances." The citation in the docstring matches the website reference key. The full bibliographic entry appears reasonable for this reference key. + +**Verdict:** Citation is consistent with the website. + +## 3. Variants + +The website lists no additional variants or sub-problems for Problem 670 beyond the single statement. The formalization captures the one stated conjecture. Erdős's result for d=1 is mentioned in the docstring but not formalized separately, which is appropriate since it is a known result rather than an open conjecture. + +**Verdict:** All variants are captured. + +## 4. Readability + +**Minor issues:** + +- **Predicate name**: `AllPairwiseDistancesDifferByOne` reads as "differ by exactly one" rather than "differ by at least one." A name like `AllPairwiseDistsSeparatedByOne` or `AllPairwiseDistsDifferByAtLeastOne` would be more precise, though admittedly more verbose. +- **Docstring for the predicate**: The docstring correctly says "separated by at least 1," which clarifies the name. +- **Main theorem docstring**: Clear and well-written. The "Formalized as" paragraph is a helpful bridge between the informal and formal statements. + +**Verdict:** Good readability overall. The predicate name is slightly misleading but the docstring compensates. + +## 5. Formalizability + +The original problem statement is: + +> Let A ⊆ ℝ^d be a set of n points such that all pairwise distances differ by at least 1. Is the diameter of A at least (1+o(1))n²? + +**Ambiguity analysis:** + +- **"all pairwise distances differ by at least 1"**: Unambiguous — for any two distinct unordered pairs of points, the absolute difference of their distances is ≥ 1. +- **"(1+o(1))n²"**: The o(1) is as n → ∞. The formalization interprets this as: for every ε > 0, there exists N such that for n ≥ N, diameter ≥ (1−ε)n². This is the standard ε-N unwinding of "diameter ≥ (1+o(1))n²" and is correct. +- **Uniformity in dimension**: The problem says "Let A ⊆ ℝ^d" without fixing d. The formalization makes N independent of d (quantifying ∀ d inside the ∃ N). This is the natural reading: the trivial lower bound of C(n,2) is already dimension-free, and the conjecture strengthens it. This seems like the intended interpretation. + +**Verdict:** The statement is precise enough to formalize unambiguously. The only mild question is whether the o(1) bound should be uniform in d, and the formalization's choice (uniform) is the natural and stronger reading. + +## 6. Correctness + +**The predicate `AllPairwiseDistancesDifferByOne`:** + +The unordered-pair exclusion logic uses four hypotheses on elements a, b, c, d ∈ A: +1. `a ≠ b` — first pair is non-degenerate +2. `c ≠ d` — second pair is non-degenerate +3. `a ≠ c ∨ b ≠ d` — not the same ordered pair +4. `a ≠ d ∨ b ≠ c` — not the reversed ordered pair + +Conditions (3) and (4) together are equivalent to ¬((a=c ∧ b=d) ∨ (a=d ∧ b=c)), which is exactly {a,b} ≠ {c,d} as unordered pairs. **This is correct.** + +**The main theorem:** + +- The ε-N formulation correctly captures `diameter ≥ (1+o(1))n²`. +- `A.card = n` correctly constrains the point count. +- `Metric.diam (A : Set (EuclideanSpace ℝ (Fin d)))` correctly computes the diameter of the finite point set coerced to a set. +- The bound `(1 - ε) * (n : ℝ) ^ 2` is the right threshold. + +**Potential subtlety:** `Metric.diam` returns `0` for the empty set and `sSup` of pairwise distances otherwise. For a `Finset` coerced to `Set`, the set is bounded, so `Metric.diam` equals the maximum pairwise distance. This is the correct notion of diameter here. + +**Edge cases:** For n = 0 or 1, `AllPairwiseDistancesDifferByOne` holds vacuously. The bound (1−ε)·n² ≤ 0 holds for n=0 and fails for n=1 when ε < 1, but N can be chosen ≥ 2 to skip these cases. No issue. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reusable code available; local predicate is appropriate | +| Citations | Consistent with erdosproblems.com | +| Variants | All captured | +| Readability | Good; minor predicate naming suggestion | +| Formalizability | Unambiguous; uniform-in-d choice is natural | +| Correctness | Correct and complete | diff --git a/ai-review/671.md b/ai-review/671.md new file mode 100644 index 0000000000..a25cf2847b --- /dev/null +++ b/ai-review/671.md @@ -0,0 +1,129 @@ +# Review: Erdős Problem 671 + +## 1. Code Reuse + +The formalization defines three custom functions: `lagrangeBasisEval`, `lebesgueFunction`, and `lagrangeInterpolation`. These are specific to the Lagrange interpolation setting of this problem. + +- **Erdős Problem 1152** (`ErdosProblems/1152.lean`) also deals with triangular arrays of interpolation nodes in [-1,1] with `Function.Injective` distinctness constraints. It uses `Polynomial ℝ` from Mathlib rather than custom evaluation functions, because that problem requires degree constraints on the interpolating polynomial. The node array representation `(n : ℕ) → Fin n → ℝ` is the same in both files, but since this is just a dependent function type (not a custom definition), there is nothing to factor out. +- **FormalConjecturesForMathlib**: No Lagrange interpolation, Lebesgue function (in the approximation-theoretic sense), or related utilities exist there. The polynomial files (`Algebra/Polynomial/Basic.lean`, etc.) deal with algebraic properties (Bunyakovsky/Schinzel conditions, Hasse derivatives) unrelated to interpolation theory. +- **Mathlib**: Mathlib has `Lagrange.basis` and `Lagrange.interpolate` in `Mathlib.RingTheory.Polynomial.Lagrange`, which work over general fields using `Polynomial` objects. These could in principle replace `lagrangeBasisEval` and `lagrangeInterpolation`, but since Problem 671 only needs point evaluations (not the polynomial objects), and requires taking absolute values and limits, the custom real-valued evaluation functions are more ergonomic here. Using Mathlib's `Lagrange.interpolate` would require `Polynomial.eval` calls at every use site, adding complexity for no gain. + +**Verdict:** No reusable code available in the local codebase. Custom definitions are appropriate and well-scoped. + +## 2. Citations + +The formalization's docstring only references: + +> *Reference:* [erdosproblems.com/671](https://www.erdosproblems.com/671) + +The website (erdosproblems.com/671) lists the following references: +- **[Er82e]** — Erdős (attributed problem source) +- **[Er97f]** — Erdős (1997) +- **[Va99, 2.40]** — Vértesi, *Classical (unweighted) and weighted interpolation* (1999), Problem 2.40 +- **[Be31]** — Bernstein (1931), who proved that for any choice of nodes there exists a point where the Lebesgue function has infinite limsup +- **[ErVe80]** — Erdős & Vértesi (1980), who proved that for any node sequence there exists a continuous function where interpolation diverges at almost all points + +The formalization does not include any of these reference keys. By comparison, the closely related Problem 1152 includes `[Va99, 2.42]` and `[EKS89]` in its docstring. Problem 671 should similarly cite at least **[Va99, 2.40]** (the specific Vértesi catalog entry) and the original problem source. + +**Verdict:** Citations are incomplete. The docstring should include reference keys from the website, particularly [Va99, 2.40] and [Er82e]. + +## 3. Variants + +The website describes two related questions, and the formalization captures both: + +- **Part 1** (`erdos_671`): Does there exist a node array where for every continuous f, some point x witnesses both divergent Lebesgue function and convergent interpolation? +- **Part 2** (`erdos_671.variants.part2`): Does there exist a node array where the Lebesgue function diverges everywhere, yet for every continuous f, some point still has convergent interpolation? + +Part 2 is strictly stronger than Part 1 (if Part 2 holds, Part 1 follows immediately since the universal Lebesgue divergence subsumes the pointwise requirement). The website does not list further variants. + +**Verdict:** All variants are captured. + +## 4. Readability + +The code is clean and well-organized: + +- **Definition names** are clear: `lagrangeBasisEval`, `lebesgueFunction`, `lagrangeInterpolation`. +- **Docstrings** include LaTeX formulas matching the definitions. +- **Module docstring** provides a good informal description of both parts. +- **Namespace** `Erdos671` cleanly scopes the helper definitions. + +**Minor suggestions:** +- The module docstring uses the notation $\mathcal{L}^n f(x)$ and $p_i^n$ but the theorem docstrings don't reference these, which is fine since the formal names are self-explanatory. +- The `.variants.part2` naming convention is consistent with the rest of the codebase. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem asks two yes/no existence questions, which are inherently precise. Key formalizability considerations: + +- **"Triangular array of nodes"**: Formalized as `(n : ℕ) → Fin n → ℝ`, which is the standard dependent-type representation. Clear and unambiguous. +- **"Distinct nodes"**: Captured by `Function.Injective (nodes n)` for each n. Unambiguous. +- **"Lebesgue function has infinite limsup"**: Formalized as `∀ M : ℝ, ∃ᶠ n in atTop, lebesgueFunction (nodes n) x ≥ M`. This is the standard ε-characterization of limsup = +∞ (for every bound M, the function exceeds M infinitely often). Unambiguous. +- **"L^n f(x) → f(x)"**: Formalized as `Tendsto (fun n => lagrangeInterpolation (nodes n) f x) atTop (nhds (f x))`. Standard pointwise convergence. Unambiguous. +- **Continuity domain**: `ContinuousOn f (Icc (-1) 1)` correctly restricts to continuous functions on the closed interval, matching the problem's "continuous f: [-1,1] → ℝ". + +The only subtle point is the quantifier structure: in Part 1, the point x depends on both the nodes and f. In Part 2, the Lebesgue divergence is uniform in x (independent of f), while the convergence point depends on f. Both parts capture these dependencies correctly. + +**Verdict:** The problem is unambiguous and precisely formalizable. The formalization's quantifier structure matches the informal statement exactly. + +## 6. Correctness + +### Definition: `lagrangeBasisEval` + +```lean +∏ j ∈ univ.erase i, (x - a j) / (a i - a j) +``` + +This computes `∏_{j ≠ i} (x - a_j)/(a_i - a_j)`, which is the standard Lagrange basis polynomial. Under the injectivity assumption, `a i ≠ a j` for `j ≠ i`, so `a i - a j ≠ 0` and division is well-defined. The product of quotients equals the quotient of products in this case, so this correctly gives the basis polynomial value. + +**Key property check:** At `x = a i`, each factor becomes `(a i - a j)/(a i - a j) = 1`, so the product is 1. At `x = a k` for `k ≠ i`, the factor with `j = k` is `(a k - a k)/(a i - a k) = 0`, so the product is 0. This confirms the Lagrange interpolation property. + +**Edge case:** When `n = 0`, `Fin 0` is empty, so the function is vacuously defined (never called in sums). When `n = 1`, `univ.erase i` is empty, so the product is 1 (the empty product), which is correct: the unique basis polynomial for a single node is the constant 1. + +### Definition: `lebesgueFunction` + +`∑ i : Fin n, |lagrangeBasisEval a i x|` — standard definition. Correct. + +### Definition: `lagrangeInterpolation` + +`∑ i : Fin n, f (a i) * lagrangeBasisEval a i x` — standard definition. Correct. + +### Theorem: `erdos_671` (Part 1) + +The formal statement: +``` +∃ nodes, (∀ n i, nodes n i ∈ [-1,1]) ∧ (∀ n, Injective (nodes n)) ∧ + ∀ f, ContinuousOn f [-1,1] → ∃ x ∈ [-1,1], + (∀ M, ∃ᶠ n in atTop, lebesgueFunction (nodes n) x ≥ M) ∧ + Tendsto (fun n => lagrangeInterpolation (nodes n) f x) atTop (nhds (f x)) +``` + +Matches the informal statement: there exists a node array in [-1,1] with distinct nodes per row, such that for every continuous f, there is a point x in [-1,1] where the Lebesgue function grows unboundedly (limsup = ∞) yet interpolation converges to f(x). Correct. + +### Theorem: `erdos_671.variants.part2` (Part 2) + +The formal statement: +``` +∃ nodes, (∀ n i, nodes n i ∈ [-1,1]) ∧ (∀ n, Injective (nodes n)) ∧ + (∀ x ∈ [-1,1], ∀ M, ∃ᶠ n in atTop, lebesgueFunction (nodes n) x ≥ M) ∧ + (∀ f, ContinuousOn f [-1,1] → ∃ x ∈ [-1,1], + Tendsto (fun n => lagrangeInterpolation (nodes n) f x) atTop (nhds (f x))) +``` + +Matches the informal statement: the Lebesgue function diverges at every point in [-1,1], yet for every continuous f there is some point where interpolation converges. The Lebesgue divergence and convergence conditions are correctly separated as independent conjuncts. Correct. + +**Potential subtlety — `n = 0` indexing:** The nodes function `(n : ℕ) → Fin n → ℝ` includes `n = 0`, where `Fin 0` is empty. At `n = 0`, `lebesgueFunction (nodes 0) x = 0` (empty sum) and `lagrangeInterpolation (nodes 0) f x = 0` (empty sum). This does not affect the `∃ᶠ n in atTop` or `Tendsto` conditions since they concern the tail behavior of the sequence, and finitely many degenerate terms are irrelevant. + +**Verdict:** The formalization is mathematically correct and complete. All definitions match their standard mathematical counterparts, and both theorem statements accurately capture the informal problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reusable code; local definitions are appropriate | +| Citations | **Incomplete** — should include [Va99, 2.40], [Er82e], and other reference keys from the website | +| Variants | Both parts captured correctly | +| Readability | Good; clean code with clear documentation | +| Formalizability | Unambiguous; quantifier structure is precise | +| Correctness | Correct and complete | diff --git a/ai-review/673.md b/ai-review/673.md new file mode 100644 index 0000000000..fa30b0c708 --- /dev/null +++ b/ai-review/673.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 673 + +## 1. Code Reuse + +**`sortedDivisors`**: This identical definition appears in three places: +- `Erdos673.sortedDivisors` (673.lean:50–51) +- `Erdos1099.sortedDivisors` (1099.lean:47–48) +- `Erdos1100.sortedDivisors` (1100.lean:43–44) + +All three are `(Nat.divisors n).sort (· ≤ ·)`. This is a strong candidate for extraction into a shared utility (e.g., `FormalConjectures/Util/Divisors.lean`). + +**`HasNaturalDensityZero`**: A local definition is provided at line 61. Meanwhile, `FormalConjecturesForMathlib/Data/Set/Density.lean` provides a general-purpose `Set.HasDensity` definition where `S.HasDensity 0` is equivalent to "density zero." The local definition uses `Finset.range N` with a filter and `Tendsto ... (nhds 0)`, while the library version uses `Set.interIio` and `partialDensity`. These are mathematically equivalent for `ℕ`, but the library version does not require `DecidablePred`. Problem 673's definition also differs slightly: it counts elements in `Finset.range N` (i.e., `{0, ..., N-1}`), while the library uses `Set.interIio` (i.e., `{x | x < b}`), which are the same for `ℕ`. The local definition could be replaced by `Set.HasDensity S 0`, though the `DecidablePred` requirement in the current version would need to be dropped. + +**`erdosG` pattern**: The `(divs.zip divs.tail).map ... .sum` pattern is also used in Erdős 1099 (`hAlpha`). Problem 1099's docstring already cross-references Problem 673, acknowledging the structural similarity. + +## 2. Citations + +The formalization cites: +- `[Er79e]` — Erdős, P., *Some unconventional problems in number theory* (1979). +- `[Er82e]` — Erdős, P., *Some new problems and results in number theory* (1982). + +The website (erdosproblems.com/673) lists the same two references: `[Er79e]` and `[Er82e]`. **The citations match.** + +One minor note: the website mentions Terence Tao's observation in connection with Problem 448 ("a mistaken conjecture of Erdős, which he soon corrected"), but the formalization does not reference Problem 448 explicitly. This is acceptable since Problem 448 is a separate problem; the cross-reference is informational rather than a required citation. + +## 3. Variants + +The problem on erdosproblems.com poses two questions: +1. Does $G(n) \to \infty$ for almost all $n$? +2. Can one prove an asymptotic formula for $\sum_{n \leq X} G(n)$? + +The formalization captures: +- **Part 1** (`erdos_673`): $G(n) \to \infty$ for almost all $n$. ✅ +- **Part 2** (`erdos_673.variants.average`): $(1/X)\sum_{n \leq X} G(n) \to \infty$. ⚠️ **Partial capture.** + +**Missing variant**: The original question 2 asks for an *asymptotic formula* for $\sum_{n \leq X} G(n)$, which is stronger than merely showing the average tends to infinity. The formalized Part 2 captures only Erdős's remark that the average diverges ("easy to prove $(1/X)\sum_{n \leq X} G(n) \to \infty$"), not the full question of an asymptotic formula. An asymptotic formula would specify the leading term growth rate (e.g., $\sum_{n \leq X} G(n) \sim f(X)$ for some explicit $f$). This is arguably the hardest part of Problem 673 to formalize, since the precise asymptotic may not be known or may be difficult to state precisely. + +Additionally, the docstring mentions the Erdős–Tenenbaum result that $G(n)/\tau(n)$ has a continuous distribution function. This could be formalized as a variant (existence of a continuous CDF for the limiting distribution of $G(n)/\tau(n)$), though formalizing distribution functions and continuity of CDFs would be significantly more involved. Its omission is understandable. + +## 4. Readability + +The code is clean and readable overall. Specific observations: + +- **`sortedDivisors`**: Clear and well-documented. +- **`erdosG`**: The `let` binding and pipeline are idiomatic. The docstring correctly explains the mathematical definition. +- **`HasNaturalDensityZero`**: The name is descriptive. The definition is self-contained and easy to follow. +- **Theorem names**: `erdos_673` and `erdos_673.variants.average` follow the project convention. +- **Namespace**: `Erdos673` is used consistently. +- **Minor**: The `open Filter` at line 45 is needed for `atTop` and `nhds`. This is standard. + +No significant readability issues. + +## 5. Formalizability + +**Part 1** (almost-all divergence): Fully formalizable. The concept "for almost all $n$" is captured as "the exceptional set has natural density zero," which is the standard interpretation. The definition of $G(n)$ is concrete and computable. **Assessment: Unambiguous and precise.** + +**Part 2** (average divergence): As formalized (the average tends to $\infty$), this is fully formalizable and unambiguous. However, the *original* question 2 (an asymptotic formula for $\sum_{n \leq X} G(n)$) is under-specified — it asks "can one prove" an asymptotic formula without stating what the formula should be. This makes the original question inherently hard to formalize as a precise theorem statement: one would need to either (a) existentially quantify over the asymptotic form, or (b) supply a specific conjectured asymptotic. The formalization sidesteps this by capturing only the weaker "average diverges" result. **Assessment: The formalized statement is precise; the unformalizable part (exact asymptotic) is reasonably omitted.** + +**Overall formalizability: High.** The main ambiguity is in Question 2's "asymptotic formula," which the formalization handles by capturing a weaker but well-defined statement. + +## 6. Correctness + +### Part 1: `erdos_673` + +**Statement**: `answer(True) ↔ ∀ M : ℝ, HasNaturalDensityZero {n : ℕ | erdosG n ≤ M}` + +- The `answer(True)` is justified: the problem is marked as proved on the website, and Tao's argument (via $\tau(n)/4 \leq G(n) \leq \tau(n)$ for even $n$) establishes it. +- The formalization correctly interprets "almost all $n$" as: for every bound $M$, the set $\{n : G(n) \leq M\}$ has density zero. This is the standard number-theoretic meaning. ✅ +- **`erdosG` correctness**: The function computes $\sum_{i} d_i / d_{i+1}$ by zipping `divs` with `divs.tail` and summing the ratios `p.1 / p.2`. Since `sortedDivisors` returns divisors in increasing order, `p.1 = d_i` and `p.2 = d_{i+1}`, so the ratio is $d_i / d_{i+1}$. This matches the problem statement. ✅ +- **Edge cases**: For $n = 0$, `Nat.divisors 0 = ∅`, so `sortedDivisors 0 = []` and `erdosG 0 = 0`. For $n = 1$, divisors are `{1}`, so `divs.tail = []`, `zip` produces `[]`, and `erdosG 1 = 0`. These are sensible: $G(1) = 0$ (no consecutive pairs). The formalization quantifies over all `n : ℕ`, including 0 and 1, but since `{n | erdosG n ≤ M}` having density zero is about the asymptotic proportion, finitely many exceptions are irrelevant. ✅ +- **`HasNaturalDensityZero` correctness**: Uses `Finset.range N` (i.e., `{0, ..., N-1}`) and `DecidablePred`. The `DecidablePred` requirement is satisfied since membership in `{n : ℕ | erdosG n ≤ M}` involves decidable operations (but `erdosG` is `noncomputable`, so the `DecidablePred` instance would come from `Classical.dec`). In practice, the `[DecidablePred (· ∈ A)]` instance constraint is unnecessary clutter — removing it and using `Classical.dec` implicitly would be cleaner. ✅ (correct but slightly inelegant) + +### Part 2: `erdos_673.variants.average` + +**Statement**: `Tendsto (fun X : ℕ => (Finset.sum (Finset.range X) erdosG) / (X : ℝ)) atTop atTop` + +- This says $(1/X)\sum_{n=0}^{X-1} G(n) \to \infty$. The problem states $(1/X)\sum_{n \leq X} G(n)$, which is $\sum_{n=1}^{X} G(n)$. The formalization uses `Finset.range X = {0, ..., X-1}`, which includes $n = 0$ (where $G(0) = 0$). This is an off-by-one relative to the standard number-theoretic convention of summing over $1 \leq n \leq X$. However, since $G(0) = 0$, the difference is $G(0) = 0$ from including $n = 0$ and omitting $G(X)$ from the sum. Asymptotically, this is negligible and does not affect the truth of the statement. ✅ +- The target filter is `atTop` (divergence to $+\infty$), which correctly captures "$\to \infty$." ✅ +- No `answer(...)` wrapper is used here — the statement is asserted directly as `True` (a bare theorem, not wrapped in `answer(True) ↔ ...`). This is a stylistic inconsistency with Part 1, which uses `answer(True)`. Since Part 2 is also a proved result, wrapping it in `answer(True) ↔ ...` would be more consistent. ⚠️ Minor inconsistency. + +### Summary of Correctness Issues + +| Issue | Severity | +|-------|----------| +| `HasNaturalDensityZero` requires `DecidablePred` unnecessarily | Low (stylistic) | +| Part 2 uses `Finset.range X` instead of $\{1, \ldots, X\}$ | Negligible (asymptotically equivalent) | +| Part 2 not wrapped in `answer(True) ↔ ...` | Low (stylistic inconsistency) | +| Asymptotic formula variant not captured | Medium (incomplete but justified) | +| `sortedDivisors` duplicated across files | Low (code reuse opportunity) | + +**Overall correctness: Sound.** The mathematical content is correctly formalized. No experienced mathematician would identify a mathematical flaw. The minor issues are stylistic or about completeness of variant coverage. diff --git a/ai-review/674.md b/ai-review/674.md new file mode 100644 index 0000000000..2b00a46a39 --- /dev/null +++ b/ai-review/674.md @@ -0,0 +1,72 @@ +# Review: Erdős Problem 674 + +## 1. Code Reuse + +No meaningful reuse opportunities. This problem concerns the Diophantine equation $x^x \cdot y^y = z^z$ over natural numbers, using only basic `ℕ` arithmetic (`^`, `*`, `>`). All needed operations are already in Mathlib core. The additive combinatorics infrastructure in `FormalConjecturesForMathlib/Combinatorics/` (sum-free sets, Sidon sets, AP-free sets, convolutions) is unrelated. + +## 2. Citations + +The formalization cites **[Ko40]** and **[Er79]**, which are the two primary references. The website ([erdosproblems.com/674](https://www.erdosproblems.com/674)) lists additional references for partial results: + +- **[Mi59]** Mills — proved no non-trivial solutions exist when $4xy > z^2$ +- **[Sc58]** Schinzel — proved constraints on the prime factors of solutions +- **[De75b]** Dem'janenko — established that all variables must share identical prime factors +- **[Uc84]** Uchiyama — showed only finitely many solutions exist for fixed rational ratios + +These are not cited in the formalization. Since none of these results are formalized as theorems, their omission from the docstring is acceptable, though mentioning them as context would improve scholarly completeness. The two citations that *are* present match the website. + +The docstring gives Ko's full name as "Ko, C." and a title for the paper. The website content is consistent with this. Er79 is attributed to Erdős correctly. No discrepancies found. + +## 3. Variants + +The formalization includes two statements: + +1. **`erdos_674`** — Existence of a solution (answered `True`). ✓ +2. **`erdos_674.variants.unique_families`** — Whether Ko's infinite families are the only solutions. This is the deeper open question from [Er79]. + +**Missing or incomplete variants:** + +- **Ko's coprime result** is mentioned in the docstring ("Ko proved there are none if $\gcd(x,y) = 1$") but is not formalized as a separate theorem. This is a clean, precise statement that could be captured: + ``` + theorem erdos_674.variants.coprime_no_solution : + ¬∃ x y z : ℕ, x > 1 ∧ y > 1 ∧ z > 1 ∧ Nat.Coprime x y ∧ x ^ x * y ^ y = z ^ z + ``` +- **The specific example** $(x, y, z) = (2^{12} \cdot 3^6,\; 2^8 \cdot 3^8,\; 2^{11} \cdot 3^7)$ is mentioned in the docstring but not formalized as a witness lemma. This would make `erdos_674` more concrete and provable. +- **The general parameterized family** from the website (parameterized by $n$ with $a = 2^{n+1}$, $b = 2^n - 1$) is not formalized. This family is central to the open variant question but is not captured. + +## 4. Readability + +The code is clean and readable. The docstring provides good mathematical context with the example solution and historical background. Minor suggestions: + +- The first theorem's docstring says "Yes. [Ko40]" — Ko proved the coprime impossibility, not the existence of solutions per se. The existence of solutions (with non-coprime arguments) is what the example demonstrates. The attribution could be slightly more precise: the solution family was found by Ko, but the "Yes" answer comes from exhibiting solutions, not from the coprime-case theorem. +- The variant docstring adequately describes the open question but the `sorry` in the predicate position makes the intent hard to parse for someone unfamiliar with the problem. + +## 5. Formalizability + +**Main theorem (`erdos_674`):** Fully formalizable. The equation $x^x \cdot y^y = z^z$ with $x, y, z > 1$ over $\mathbb{N}$ is entirely precise. The answer `True` is well-defined and could be proved by exhibiting the witness from the docstring. **Ambiguity: None.** + +**Variant (`erdos_674.variants.unique_families`):** Not yet formalizable as written. Both `answer(sorry)` and the predicate body `sorry` are placeholders. The key difficulty is formalizing "the infinite families found by Ko" — this requires encoding the parameterized solution family: + +$$a = 2^{n+1}, \quad b = 2^n - 1$$ +$$x = 2^{a(b-n)} \cdot b^{2b} \cdot 2^{2n}, \quad y = 2^{a(b-n)} \cdot b^{2b} \cdot b^2, \quad z = 2^{a(b-n)} \cdot b^{2b} \cdot 2^{n+1} \cdot b$$ + +and asking whether every solution $(x, y, z)$ with $x, y, z > 1$ belongs to this family (up to permutation of $x$ and $y$). This is formalizable in principle but requires careful encoding. **Ambiguity: Moderate** — the parameterized family needs to be precisely defined, and it's unclear from the problem statement whether there are additional known families beyond this one or whether "Ko's families" refers to a single parameterized family. + +## 6. Correctness + +**Main theorem:** Mathematically correct. The use of `ℕ` instead of `ℤ` is appropriate since $x, y, z > 1$ restricts to positive integers $\geq 2$, which are naturals. The equation $x^x \cdot y^y = z^z$ and the existential quantification faithfully capture the problem from the website. The answer `True` is correct per the website (status: proved, with explicit solutions known). **No flaws.** + +**Variant:** Incomplete rather than incorrect. The double `sorry` makes it impossible to assess correctness of the mathematical content, since there is no mathematical content to assess. The *intent* described in the docstring is correct: Erdős [Er79] did ask whether Ko's families are the only solutions, and this remains open. However, the formalization does not yet encode this question. + +**One subtle point:** The formalization quantifies over `ℕ` while the original problem says "integer solutions." Since $x^x$ is not well-defined for negative integers in the usual sense (e.g., $(-3)^{-3}$ is a fraction), restricting to positive integers is the standard interpretation and is correct. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities — problem uses only basic ℕ arithmetic | +| Citations | Core citations [Ko40], [Er79] present and correct; 4 supplementary references from website omitted | +| Variants | Main existence captured; open question is a placeholder; coprime impossibility and explicit witness lemma are missing | +| Readability | Good; minor attribution clarity improvement possible | +| Formalizability | Main theorem: fully formalizable, no ambiguity. Variant: not yet formalizable (double sorry), moderate ambiguity in defining "Ko's families" | +| Correctness | Main theorem: correct. Variant: incomplete (placeholder), intent is correct | diff --git a/ai-review/675.md b/ai-review/675.md new file mode 100644 index 0000000000..ac14103464 --- /dev/null +++ b/ai-review/675.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 675 + +## 1. Code Reuse + +**`IsSumOfTwoSquares`**: Duplicated verbatim in Problem 222 (`FormalConjectures/ErdosProblems/222.lean:43`). The definitions are identical: +```lean +def IsSumOfTwoSquares (n : ℕ) : Prop := ∃ a b : ℕ, n = a ^ 2 + b ^ 2 +``` +This should be factored into a shared definition in `FormalConjecturesForMathlib`. + +**`smoothNumbers`**: Duplicated in Problem 240 (`FormalConjectures/ErdosProblems/240.lean:45`). The definitions are semantically identical (`0 < n` vs `n ≥ 1`): +```lean +-- Problem 675 +def smoothNumbers (P : Set ℕ) : Set ℕ := {n | n ≥ 1 ∧ ∀ p, Nat.Prime p → p ∣ n → p ∈ P} +-- Problem 240 +def smoothNumbers (P : Set ℕ) : Set ℕ := {n | 0 < n ∧ ∀ q, Nat.Prime q → q ∣ n → q ∈ P} +``` +Should be unified into a shared definition. + +**`squarefreeSet`**: Uses Mathlib's `Squarefree` directly, which is good. The project also has `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` with additional squarefree infrastructure (`squarefreePart`, `squarePart`, `squarefree_infinite`) that could be relevant for future proof work on Part 3. + +## 2. Citations + +The formalization references: +> [Er79] Erdős, P., _Some unconventional problems in number theory_ (1979). + +The website (erdosproblems.com/675) confirms [Er79] as the primary reference. No additional references are listed on the website beyond the [Er79] tag. + +The docstring also correctly notes that "Elementary sieve theory implies the set of squarefree numbers has the translation property." The website elaborates that Brun's sieve extends this to sets avoiding divisors from pairwise coprime sets B ⊆ ℕ with ∑_{b exp(n^c) for some constant c > 0?" This is precise and directly formalizable. + +**Verdict**: All three parts are unambiguous and precisely formalizable. + +## 6. Correctness + +**`HasTranslationProperty`**: Correctly formalizes "for every n, there exists t ≥ 1 such that for all 1 ≤ a ≤ n, a ∈ A ↔ a + t ∈ A." Matches the mathematical statement exactly. + +**`IsSumOfTwoSquares`**: Standard definition using natural number squares. Note this includes 0 = 0² + 0² and 1 = 0² + 1², which is correct. + +**`squarefreeSet`**: Uses `{n | Squarefree n}` from Mathlib. Note that `Squarefree 0` is false and `Squarefree 1` is true in Mathlib, which is standard. The set includes 1, which is the correct convention. + +**`smoothNumbers`**: The condition `n ≥ 1` excludes 0 and the primality condition is vacuously true for 1 (which has no prime factors), so 1 ∈ smoothNumbers P for all P. This is correct: 1 is divisible only by primes from any set. + +**`minimalTranslation`**: Uses `sInf` on the set `{t : ℕ | t ≥ 1 ∧ ...}`. If this set is empty, `sInf ∅ = 0` for ℕ. In the context of Part 3, the docstring and the known result that squarefree numbers satisfy the translation property guarantee non-emptiness. The formalization does not explicitly assume non-emptiness, but the statement `(minimalTranslation squarefreeSet n : ℝ) > Real.exp ((n : ℝ) ^ c)` would be trivially false when `minimalTranslation` returns 0 (since exp is always positive). This means the formalization implicitly requires non-emptiness for the statement to hold, which is mathematically correct given that squarefree numbers do have the translation property. No issue here. + +**Part 2 density condition**: The formalization uses `Finset.range (x + 1)` which gives {0, 1, ..., x}, so filtering for primes ≤ x. The condition `c₁ * x / log x ≤ count` correctly captures the asymptotic notation `≫ x/log x`. The use of `∃ N₁, ∀ x ≥ N₁` correctly expresses "for all large x." + +**Part 3 growth bound**: The statement `∃ c > 0, ∃ N₀, ∀ n ≥ N₀, minimalTranslation squarefreeSet n > exp(n^c)` correctly formalizes the question. The use of `answer(sorry) ↔ ...` correctly handles the yes/no nature of the question. + +**Verdict**: The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `IsSumOfTwoSquares` and `smoothNumbers` are duplicated in Problems 222 and 240 respectively; should be shared | +| Citations | Adequate; matches website | +| Variants | All three sub-questions captured | +| Readability | Good | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/676.md b/ai-review/676.md new file mode 100644 index 0000000000..3e2683354a --- /dev/null +++ b/ai-review/676.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 676 + +## 1. Code Reuse + +The formalization is self-contained and uses only basic Mathlib primitives (`Nat.Prime`, natural number arithmetic). No definitions from `FormalConjecturesForMathlib` are needed or would simplify the statement. The problem's core is a straightforward existential statement over natural numbers with a primality predicate, so no additional library infrastructure applies. + +No code reuse opportunities identified. + +## 2. Citations + +The formalization cites: + +> [Er79] Erdős, P., _Some unconventional problems in number theory_. Acta Math. Acad. Sci. Hungar. 33 (1979), 71–80. + +The website (erdosproblems.com/676) lists two references: **[Er79]** and **[Er79d]**. The formalization only includes [Er79]. The second reference [Er79d] should be investigated and included if it is a distinct publication. (Note: Erdős had multiple 1979 publications; [Er79d] may refer to a different paper in the same year.) + +**Action needed:** Add [Er79d] citation or verify it refers to the same paper. + +## 3. Variants + +The website describes three additional variants/related questions **not captured** in the formalization: + +1. **Non-prime version (Selfridge–Wagstaff):** If the requirement that $p$ is prime is dropped (i.e., $n = am^2 + b$ for any $m \geq 2$, $a \geq 1$, $0 \leq b < m$), a preliminary computer search by Selfridge and Wagstaff suggested infinitely many exceptions exist, with the count of exceptions up to $x$ being $< x^c$ for some $c < 1$. + +2. **General form:** Given an infinite set $A \subseteq \mathbb{N}$ and function $f : A \to \mathbb{N}$, when can every large number be written as $am^2 + b$ for $m \in A$, $a \geq 1$, $0 \leq b < f(m)$? + +3. **Minimal coefficient $c_n$:** What is the minimal $c_n$ such that $n = ap^2 + b$ with $0 \leq b < c_n p$ for some prime $p \leq \sqrt{n}$? Erdős conjectured $\limsup c_n = \infty$ and asked whether $c_n < n^{o(1)}$. + +Variants (1) and (3) are concrete enough to formalize. Variant (2) is a general meta-question and may be too open-ended to formalize meaningfully. + +**Action needed:** Consider adding at least variant (3) as `erdos_676.variants.minimal_coefficient`, since it is a specific conjecture by Erdős. Variant (1) could also be formalized as a related statement. + +## 4. Readability + +The code is clean and readable. The docstring clearly restates the problem and explains the formalization choices. The namespace `Erdos676` properly scopes the theorem. The module-level documentation provides appropriate mathematical context (sieve results, Erdős's opinion on the likely answer). + +No readability issues identified. + +## 5. Formalizability + +The main statement is **fully precise and unambiguously formalizable**. The problem asks a yes/no question ("Is every sufficiently large integer of the form...?") with all quantifiers and constraints explicitly specified. There is no ambiguity in: +- "sufficiently large integer" → $\exists N_0, \forall n \geq N_0$ +- "of the form $ap^2 + b$" → $n = a \cdot p^2 + b$ +- The constraints on $p$ (prime), $a$ ($\geq 1$), and $b$ ($0 \leq b < p$) + +The restriction from integers to natural numbers is harmless since "sufficiently large" integers are positive. + +**Ambiguity level: None.** This is one of the more cleanly formalizable Erdős problems. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification:** + +The theorem states: +```lean +answer(sorry) ↔ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ p a b : ℕ, Nat.Prime p ∧ a ≥ 1 ∧ b < p ∧ n = a * p ^ 2 + b +``` + +This faithfully captures the problem. Key observations: + +- **Types are correct.** Using `ℕ` for all variables is appropriate. Since $a \geq 1$ and $b \geq 0$ are both natural number constraints, and primes are natural numbers, no integer types are needed. The "sufficiently large" threshold handles the restriction from $\mathbb{Z}$ to $\mathbb{N}$. + +- **Constraints are complete.** The conjunction `Nat.Prime p ∧ a ≥ 1 ∧ b < p` correctly enforces: $p$ is prime, $a$ is a positive integer, and $0 \leq b < p$ (the lower bound $b \geq 0$ is automatic from `b : ℕ`). + +- **The representation is correct.** The equation `n = a * p ^ 2 + b` with the given constraints matches the problem statement exactly. Mathematically, this is equivalent to requiring that $n \bmod p^2 < p$ for some prime $p$ with $p^2 \leq n$, which is the intended condition. + +- **The `answer(sorry)` usage is correct.** The problem is open and Erdős suspected the answer is "no" (i.e., `answer(False)`), but the `sorry` correctly reflects that the answer is unknown. + +- **No missing edge cases.** The constraint $a \geq 1$ ensures $n \geq p^2 \geq 4$, so the "sufficiently large" threshold is meaningful. + +**No correctness issues identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities — formalization is appropriately self-contained | +| Citations | **Missing [Er79d] reference** listed on the website | +| Variants | **Three variants missing**, at least two are formalizable | +| Readability | Good — no issues | +| Formalizability | Excellent — no ambiguity | +| Correctness | Correct and complete for the main statement | diff --git a/ai-review/679.md b/ai-review/679.md new file mode 100644 index 0000000000..ffea3108e7 --- /dev/null +++ b/ai-review/679.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 679 + +## 1. Code Reuse + +**Issue: Duplicate `omega` definition should use Mathlib's `ArithmeticFunction.omega`.** + +The file defines a local `omega` at lines 33–35: +```lean +noncomputable def omega (n : ℕ) : ℕ := + (Nat.primeFactorsList n).toFinset.card +``` + +This identical definition also appears in `ErdosProblems/452.lean:43–45`. Meanwhile, several other Erdős problems (69, 248, 306, 413, 890, 891) use Mathlib's built-in `ArithmeticFunction.omega` via `open scoped ArithmeticFunction.omega`, which provides the notation `ω`. Problem 685 uses yet another variant (`n.primeFactors.card`). + +**Recommendation:** Replace the custom `omega` with `open scoped ArithmeticFunction.omega` and use `ω` throughout, consistent with problems 248 and 413 (which are the related problems cited on the website for this very problem). + +## 2. Citations + +The file references: +> [Er79d] Erdős, P., _Some unconventional problems in number theory_. Math. Mag. 52 (1979), 67-70. + +The website (erdosproblems.com/679) confirms [Er79d] as the original source. The citation format is acceptable. + +**Missing information:** +- The website lists related problems **#248** and **#413**. These should be cross-referenced in the module docstring, especially since both are formalized in this codebase and concern the same `ω` function. +- The website credits **DottedCalculator** for the disproof of the stronger variant. The file mentions this in the docstring but without a formal citation or link to the result. +- The website notes that **xertik** is currently working on the problem. + +## 3. Variants + +**Missing variant:** The website states: + +> A similar question can be asked for Ω (prime factors with multiplicity), replacing log k / log log k with log₂ k. + +This `Ω` variant is not captured in the formalization. Given that problem 413 already imports both `ω` and `Ω` scoped notations, adding this variant would be straightforward. + +The two variants that ARE formalized (the main ε-question and DottedCalculator's disproof) correspond to what the website describes, though Part 2 has a correctness issue (see §6). + +## 4. Readability + +- The docstrings are clear and well-written, with LaTeX rendering of the mathematical statements. +- The separation into Part 1 (open) and Part 2 (disproved stronger form) is logical. +- The namespace `Erdos679` is clean. +- Minor: The docstring for Part 1 says "1 ≤ k < n" but the formalization only has `k₀ ≤ k` and `k < n`. Since k₀ is existentially quantified (and must be ≥ some value for the bound to be nontrivial), this is mathematically equivalent, but the docstring could note that the `1 ≤ k` condition is subsumed by the `k₀ ≤ k` condition. + +## 5. Formalizability + +**Part 1:** The problem is precise enough to formalize. The key quantifier structure—∀ ε > 0, ∃ k₀, infinitely many n such that ∀ k ∈ [k₀, n), the bound holds—is unambiguous. The choice to have k₀ depend on ε but not on n is explicitly stated in both the docstring and the website, and correctly reflected in the quantifier ordering. + +**Part 2:** The disproof statement is mathematically precise: ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∃ k < n with the lower bound. However, the formalization has a domain issue (see §6). + +**Ω variant:** The website's description ("replace log k / log log k with log₂ k") is precise enough to formalize. + +**Overall ambiguity: Low.** The problem is stated in standard analytic number theory language with well-defined quantities. + +## 6. Correctness + +### Part 1 (`erdos_679`) — Correct + +The quantifier structure is: +``` +∀ ε > 0, ∃ k₀, Set.Infinite {n | ∀ k, k₀ ≤ k → k < n → ω(n-k) < (1+ε) · log k / log log k} +``` + +This correctly captures: for every ε > 0, there exists a uniform threshold k₀ (independent of n) such that infinitely many n satisfy the bound for all k in [k₀, n). The use of `answer(sorry)` correctly reflects that this is an open problem whose truth value is unknown. The category tag `research open` is accurate. + +One subtlety: when `log log k ≤ 0` (i.e., k ≤ e ≈ 2), the RHS is non-positive (or undefined in the 0/0 sense, which Lean resolves to 0), making the bound impossible to satisfy. This is handled correctly by the existential k₀, which can be chosen large enough to avoid this regime. + +### Part 2 (`erdos_679.variants.disproof`) — **CRITICAL BUG: Trivially True** + +The statement is: +``` +∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∃ k < n, ω(n-k) ≥ log k / log log k + c · log k / (log log k)² +``` + +**This is trivially provable and does not capture DottedCalculator's result.** The existential `∃ k < n` allows `k = 0`. In Lean 4, `Real.log 0 = 0`, so the entire RHS evaluates to `0 / 0 + c * 0 / 0² = 0 + 0 = 0` (since division by zero is 0 in Lean). Then `ω(n - 0) = ω(n) ≥ 0` holds trivially for all n (as ω returns a natural number cast to ℝ). + +Concretely: choose `c = 1`, `N₀ = 1`. For any `n ≥ 1`, pick `k = 0`. Then `k < n` holds, and `(ω(n) : ℝ) ≥ 0` is immediate. QED — but this proves nothing about the actual number-theoretic content. + +**Fix:** Add a lower bound on k to ensure the logarithmic quantities are meaningful. For example, require `k ≥ 3` (so that `log log k > 0`), or more conservatively, add a threshold: +```lean +theorem erdos_679.variants.disproof : + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ k : ℕ, k ≥ 3 ∧ k < n ∧ + (omega (n - k) : ℝ) ≥ + Real.log (k : ℝ) / Real.log (Real.log (k : ℝ)) + + c * Real.log (k : ℝ) / (Real.log (Real.log (k : ℝ))) ^ 2 := by + sorry +``` + +Alternatively, a stronger and more natural fix would require `k` to be "sufficiently large" (e.g., `k ≥ k₀` for some existentially quantified `k₀`), mirroring the structure of Part 1. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Needs improvement** — duplicate `omega` def; should use Mathlib's `ArithmeticFunction.omega` | +| Citations | **Mostly correct** — missing cross-references to related problems #248, #413 | +| Variants | **Incomplete** — Ω variant (with multiplicity) not formalized | +| Readability | **Good** — clear docstrings, logical structure | +| Formalizability | **High** — low ambiguity, standard number theory | +| Correctness | **Part 1: Correct. Part 2: Critical bug** — trivially true due to k=0 exploiting Lean's `log 0 = 0` and `0/0 = 0` conventions | diff --git a/ai-review/682.md b/ai-review/682.md new file mode 100644 index 0000000000..9aa54723ea --- /dev/null +++ b/ai-review/682.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 682 + +## 1. Code Reuse + +**`primeGap` utility:** The expression `nth Nat.Prime (n + 1) - nth Nat.Prime n` appearing in the formalization is exactly the definition of `primeGap n` from `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean:23`. The formalization could import this and use `primeGap n` in place of the inline subtraction for clarity and consistency with other problems (e.g., 6, 218, 233). + +**`HasDensity` / density infrastructure:** The "almost all" condition is encoded manually as `∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, card(filter) ≤ ε * N`. The codebase provides `Set.HasDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean:86–88`, which defines density via `Tendsto` of partial densities. The exceptional set could instead be expressed as: + +``` +{n : ℕ | ¬ ∃ m, ...}.HasDensity 0 +``` + +This would be more idiomatic and consistent with problems like 218 (`HasDensity (1/2)`). The current ε-N formulation is logically equivalent to `HasDensity 0` but less compositional. + +**`IsLPF` from Problem 681:** Problem 681 (`FormalConjectures/ErdosProblems/681.lean:28`) defines `IsLPF p m` (least prime factor). Problem 682 correctly uses `Nat.minFac` from Mathlib instead, which is the standard approach. No change needed here. + +## 2. Citations + +**Website data (erdosproblems.com/682):** +- The problem is marked as **PROVED**. +- The website credits **Gafni and Tao [GaTa25]**, who showed the number of exceptional n ∈ [1, X] is ≪ X/(log X)². +- The website notes Erdős originally believed the statement should hold for **all** large n, but discovered a **conditional counterexample** using Dickson's conjecture: if infinitely many pairs (2183 + 30030d, 2201 + 30030d) are both prime, they form consecutive primes with no suitable m, since 30030 = 2·3·5·7·11·13 divides every integer in the interval. +- The website references **related problems 680 and 681**. +- OEIS sequence **A386978** is mentioned. + +**Current formalization:** The docstring references `[GaTa25]` with an abbreviated description. It is missing: +- The Dickson's conjecture counterexample context (which motivated the "almost all" rather than "all large n" formulation). +- The cross-references to problems 680 and 681. +- The OEIS reference A386978. +- The full citation: Gafni, A. and Tao, T. (the formalization has this but uses shorthand `[GaTa25]`). + +## 3. Variants + +The formalization captures only the main "almost all" statement. The website describes additional content not formalized: + +1. **Erdős's original stronger conjecture** (for all large n) — known to be conditionally false via Dickson's conjecture. This could be formalized as a separate statement showing it is **not** true for all large n (conditional on Dickson's conjecture or unconditionally as a negation). + +2. **Quantitative bound from Gafni–Tao:** The exceptional set in [1, X] has size ≪ X/(log X)². This is strictly stronger than density zero and could be formalized as a variant, e.g., `∃ C > 0, ∀ᶠ N in atTop, card(exceptions in range N) ≤ C * N / (log N)^2`. + +3. **Asymptotic under prime tuples conjecture:** Gafni–Tao show the exception count is asymptotically ~ c · X/(log X)² for an explicit constant c > 0, conditional on a variant of the prime tuples conjecture. + +## 4. Readability + +The formalization is reasonably readable but could be improved: + +- **Use `primeGap`:** Replace the inline `nth Nat.Prime (n + 1) - nth Nat.Prime n` with `primeGap n` (requires importing `FormalConjecturesForMathlib.NumberTheory.PrimeGap`). +- **Use `HasDensity`:** Replace the manual ε-N encoding with `{n : ℕ | ¬∃ m, ...}.HasDensity 0`, which is more declarative and self-documenting. +- **Naming:** The statement is clear. The use of `nth Nat.Prime n` for p_n is standard in this codebase. + +## 5. Formalizability + +**Assessment: Low ambiguity.** The problem is quite precise: + +- "Almost all n" has a standard meaning (natural density 1 / exceptional set has density 0), and the formalization correctly interprets this. +- "Least prime factor" is unambiguous and corresponds to `Nat.minFac`. +- "Consecutive primes p_n and p_{n+1}" is standard and correctly modeled by `nth Nat.Prime`. +- The inequality p(m) ≥ p_{n+1} - p_n is precise. + +The only mild ambiguity is whether "almost all" means natural density zero or something weaker (e.g., logarithmic density zero), but natural density is the standard convention and the Gafni–Tao result establishes even more (the X/(log X)² bound implies density zero). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Density encoding:** The ε-N formulation `∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, |exceptions ∩ [0, N)| ≤ ε · N` is equivalent to saying the proportion of exceptions tends to 0, i.e., the exceptional set has natural density 0. This correctly captures "almost all n." + +- **The existential over m:** The formalization requires `∃ m : ℕ, nth Nat.Prime n < m ∧ m < nth Nat.Prime (n + 1) ∧ primeGap n ≤ minFac m`. This correctly asks for an integer strictly between consecutive primes whose least prime factor is at least the prime gap. This matches the website statement. + +- **Subtraction safety:** Since `nth Nat.Prime (n + 1) > nth Nat.Prime n` for all n (consecutive primes are strictly increasing), the natural number subtraction `nth Nat.Prime (n + 1) - nth Nat.Prime n` does not underflow. This is safe. + +- **`minFac` behavior:** Since m is strictly between consecutive primes (hence m ≥ 3 and composite for n ≥ 1), `Nat.minFac m` correctly returns the smallest prime factor of m. For n = 0 (primes 2 and 3), there is no m with 2 < m < 3, so n = 0 is always exceptional — but finitely many exceptions don't affect density, so this is fine. + +- **Tag correctness:** The `@[category research solved, AMS 11]` tag correctly marks the problem as solved, matching the website status. AMS classification 11 (Number Theory) is appropriate. + +**No mathematical flaws identified.** The formalization is a faithful translation of the problem as stated on erdosproblems.com. + +### Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Could use `primeGap` and `HasDensity 0` from existing utilities | +| Citations | Missing Dickson's conjecture context, cross-refs to 680/681, OEIS A386978 | +| Variants | Missing quantitative ≪ X/(log X)² bound and conditional counterexample | +| Readability | Good; would benefit from `primeGap` and `HasDensity` abstractions | +| Formalizability | Low ambiguity — all terms have standard precise meanings | +| Correctness | **Correct and complete** for the main statement | diff --git a/ai-review/683.md b/ai-review/683.md new file mode 100644 index 0000000000..dd9736125e --- /dev/null +++ b/ai-review/683.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 683 + +## 1. Code Reuse + +**`largestPrimeFactor` duplication:** Problem 683 defines its own `largestPrimeFactor` (line 34) as `n.primeFactorsList.foldl max 1`. The codebase already provides `Nat.maxPrimeFac` in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean:28`, defined noncomputably as `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. This function is used by **27 other files** in the codebase (e.g., problems 976, 977, 928, etc.) and comes equipped with useful lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`). + +The local `largestPrimeFactor` differs from `Nat.maxPrimeFac` in two ways: +- **Convention for n ≤ 1:** `largestPrimeFactor` returns `1`; `maxPrimeFac` returns `0`. +- **Computability:** `largestPrimeFactor` is computable; `maxPrimeFac` is noncomputable. + +For the purposes of this formalization, both conventions work (since `Nat.choose n k ≥ 2` whenever `1 ≤ k ≤ n` and `n ≥ 2`, so the junk value never matters). The formalization should use `Nat.maxPrimeFac` for consistency with the rest of the codebase and to benefit from existing API lemmas. + +Separately, Problem 928 (`FormalConjectures/ErdosProblems/928.lean:59`) defines *yet another* local `largestPrimeFactor` using `n.primeFactors.max'` with junk value `0`. This proliferation of duplicate definitions across files is a codebase-wide issue. + +**`Nat.choose`:** Correctly uses Mathlib's standard `Nat.choose`. No issue. + +## 2. Citations + +**Website data (erdosproblems.com/683):** +- References: **[Er76d]** and **[Er79d]** — both appear in the formalization's docstring. ✓ +- Prior results mentioned: Sylvester–Schur theorem **[Er34]**, and Erdős's result **[Er55d]** that ∃ c > 0 with P(C(n,k)) ≫ k log k for k ≤ n/2. +- The website states this problem is **essentially equivalent to Problem 961**. +- The website notes Erdős [Er79d] suggested the bound likely holds for every c > 0 with finitely many exceptions. +- Standard prime gap heuristics suggest P(C(n,k)) > e^{c√k} for some c > 0 (for k ≤ n/2). +- OEIS sequences: **A006530**, **A074399**, **A121359**. + +**Current formalization issues:** +- The docstring includes [Er76d] and [Er79d] ✓, and [Er55d] ✓. +- Missing: The equivalence with Problem 961 is not mentioned. +- Missing: The [Er34] reference for the Sylvester–Schur theorem is not included in the reference tag (only mentioned informally in the docstring text via "Sylvester-Schur theorem"). +- Missing: OEIS references A006530, A074399, A121359. +- Missing: The stronger conjecture that the bound holds for *every* c > 0 with finitely many exceptions. +- The citation format uses shorthand `[Er76d][Er79d]` without full bibliographic data. Other problems in the codebase (e.g., 928, 961) include full citation details in the module docstring. + +## 3. Variants + +The formalization captures only the main conjecture. The website describes additional content not formalized: + +1. **Equivalence with Problem 961:** The website notes this problem is "essentially equivalent" to Problem 961 (which concerns the minimum length of a run of consecutive integers > k guaranteed to contain an integer with a prime factor > k). This relationship could be documented or cross-referenced. + +2. **Stronger conjecture (every c > 0):** Erdős [Er79d] suggested the bound P(C(n,k)) ≥ min(n−k+1, k^{1+c}) likely holds for *every* c > 0 (with finitely many exceptions), not just for *some* c > 0. This stronger form could be formalized as a variant: + ``` + ∀ c : ℝ, c > 0 → ∀ᶠ (p : ℕ × ℕ) in atTop, 1 ≤ p.2 → p.2 ≤ p.1 → + largestPrimeFactor (Nat.choose p.1 p.2) ≥ min (p.1 - p.2 + 1) (p.2 ^ (1 + c)) + ``` + +3. **Exponential conjecture:** Prime gap heuristics suggest the even stronger bound P(C(n,k)) > e^{c√k} for some c > 0 (when k ≤ n/2). This is not formalized. + +4. **Restriction to k ≤ n/2:** The known result of Erdős [Er55d] (P(C(n,k)) ≫ k log k) and the Sylvester–Schur theorem are stated for k ≤ n/2. The formalization uses the range 1 ≤ k ≤ n. While the website statement also uses 1 ≤ k ≤ n (because the min with n−k+1 handles the upper half), the classical results concern k ≤ n/2. This distinction could be noted. + +## 4. Readability + +The formalization is short and reasonably readable, but could be improved: + +- **Use `Nat.maxPrimeFac`:** Replace the custom `largestPrimeFactor` with the standard `Nat.maxPrimeFac` from the shared library. This removes the need for a local definition and its accompanying docstring. +- **Namespace pollution:** The `Erdos683` namespace wrapping a local `largestPrimeFactor` is unnecessary if the shared utility is used. +- **Coercion clarity:** The expression `(largestPrimeFactor (Nat.choose n k) : ℝ)` involves a ℕ → ℝ coercion. This is standard and clear. +- **The `min` expression:** `min (↑(n - k + 1)) ((k : ℝ) ^ (1 + c))` — the natural number subtraction `n - k` is safe since `k ≤ n` is assumed. The coercion ↑ is applied *after* the subtraction, which is correct: it computes `n - k + 1` in ℕ (no underflow since k ≤ n), then coerces to ℝ. + +## 5. Formalizability + +**Assessment: Low-to-moderate ambiguity.** + +The problem statement is fairly precise, but there are some subtleties: + +- **"Largest prime factor"** is standard and unambiguous for integers ≥ 2. The convention for n = 0 or n = 1 does not matter here since C(n,k) ≥ 2 for relevant values. +- **The bound itself** is explicit: P(C(n,k)) ≥ min(n−k+1, k^{1+c}). No ambiguity. +- **Quantifier structure:** The website asks "Is it true that there exists c > 0 such that for every 1 ≤ k ≤ n..." — this is faithfully captured by `∃ c : ℝ, c > 0 ∧ ∀ n k : ℕ, ...`. ✓ +- **Minor ambiguity — "for every 1 ≤ k ≤ n":** Does this mean "for all n and all k with 1 ≤ k ≤ n" (as formalized) or implicitly "for all sufficiently large n"? The website statement uses "for every", not "for all sufficiently large". The formalization correctly takes the literal interpretation. However, Erdős [Er79d]'s "for every c > 0 with finitely many exceptions" variant suggests that the intended statement may have an implicit "for all sufficiently large" qualifier. This ambiguity exists in the source, not the formalization. +- **The `answer(sorry)` wrapper:** This wraps the statement in a truth-value metaproblem (does the conjecture hold?). The `answer(sorry)` pattern is standard in this codebase for open problems. ✓ + +## 6. Correctness + +**The formalization is mathematically correct**, with one minor observation. + +Detailed analysis: + +- **Quantifier order:** `∃ c > 0, ∀ n k, 1 ≤ k → k ≤ n → ...` correctly expresses "there exists a universal constant c > 0 such that for all valid (n, k)..." ✓ + +- **Natural number subtraction:** The term `n - k + 1` is computed in ℕ. Since `k ≤ n` is assumed, `n - k` does not underflow, so `n - k + 1 = (n - k) + 1` in ℕ is correct. ✓ + +- **Real coercion:** The comparison `(largestPrimeFactor (Nat.choose n k) : ℝ) ≥ min (↑(n - k + 1)) ((k : ℝ) ^ (1 + c))` correctly lifts everything to ℝ (necessary because `k ^ (1 + c)` with real exponent `c` requires real-valued exponentiation). ✓ + +- **Edge case k = n:** When k = n, C(n,n) = 1, which has no prime factors. `largestPrimeFactor 1 = 1` (by the foldl definition). The RHS is `min (n - n + 1) (n ^ (1 + c)) = min 1 (n ^ (1 + c)) = 1` for n ≥ 1. So the bound becomes `1 ≥ 1`, which holds. ✓ + +- **Edge case k = 1:** When k = 1, C(n,1) = n, so `largestPrimeFactor n`. The RHS is `min n (1 ^ (1 + c)) = min n 1 = 1`. Since `largestPrimeFactor n ≥ 1` always (by the foldl definition with initial value 1), this holds trivially. ✓ + +- **Edge case n = k = 1:** C(1,1) = 1, `largestPrimeFactor 1 = 1`, RHS = `min 1 1 = 1`. Bound is `1 ≥ 1`. ✓ + +- **Consistency with website:** The website statement asks for P(C(n,k)) ≥ min(n−k+1, k^{1+c}). The formalization matches exactly. ✓ + +- **Tag correctness:** `@[category research open, AMS 11]` — the problem is open on the website. ✓. AMS 11 (Number Theory) is appropriate. ✓ + +- **Difference from `maxPrimeFac` convention:** As noted above, `largestPrimeFactor` returns `1` for n ≤ 1 while `maxPrimeFac` returns `0`. If the formalization switched to `maxPrimeFac`, the edge case `k = n` would give `maxPrimeFac 1 = 0` on the LHS vs `1` on the RHS, making the bound **fail** for `k = n`. To use `maxPrimeFac`, the range would need to be restricted to `1 ≤ k < n` (or `k ≤ n - 1`), or the junk value handled explicitly. This is a meaningful difference that would need attention during refactoring. + +**No mathematical flaws identified.** The formalization faithfully translates the problem as stated on erdosproblems.com. + +### Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Should use `Nat.maxPrimeFac` (with range adjustment for k = n edge case) instead of local `largestPrimeFactor`; 3 competing definitions across codebase | +| Citations | Missing equivalence with Problem 961, full [Er34] reference, OEIS sequences, stronger conjecture from [Er79d] | +| Variants | Missing "for every c > 0" stronger form, exponential conjecture e^{c√k}, cross-reference to Problem 961 | +| Readability | Good; would benefit from using shared `maxPrimeFac` utility | +| Formalizability | Low-to-moderate ambiguity — only question is whether "for every" implicitly means "for all sufficiently large" | +| Correctness | **Correct and complete** for the main statement; edge cases verified | diff --git a/ai-review/684.md b/ai-review/684.md new file mode 100644 index 0000000000..3644f6f195 --- /dev/null +++ b/ai-review/684.md @@ -0,0 +1,151 @@ +# Review: Erdos Problem 684 + +**File:** `FormalConjectures/ErdosProblems/684.lean` + +--- + +## 1. Code Reuse + +**Issue: `smoothPart` is defined locally but a closely related concept exists in Problem 933.** + +Problem 933 (`FormalConjectures/ErdosProblems/933.lean`) defines `smoothPart23`, a {2,3}-smooth part using `padicValNat`. Problem 684 defines a general `smoothPart m k` that computes the k-smooth part of `m` by taking the product of `p ^ (m.factorization p)` over all primes `p ≤ k`. + +These are conceptually related: `smoothPart23 n = smoothPart n 3` (at least for `n > 0`). A unified `smoothPart` definition factored into a shared utility file (e.g., `ForMathlib/NumberTheory/SmoothPart.lean`) would allow Problem 933 to define its specialized version in terms of the general one. + +No existing code in `FormalConjecturesForMathlib/` covers smooth parts, factorization-based products, or binomial coefficient decompositions. There is nothing directly reusable from the existing `ForMathlib` directory. + +**Recommendation:** Factor `smoothPart` into a shared utility file. Problem 933 could then use `smoothPart n 3` instead of its ad hoc `smoothPart23`. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/684](https://www.erdosproblems.com/684):** + +| Item | In formalization | On website | Assessment | +|------|-----------------|------------|------------| +| Status | Tagged `solved` | **Open** | **Mismatch.** The website lists this problem as open. See detailed discussion below. | +| [Er79d] | Yes, full citation given | Yes | OK. Citation text is complete. | +| Tang bound | Mentioned in docstring | Yes, attributed to "Tang and ChatGPT" | **Minor omission.** The website credits this as collaborative work with ChatGPT; the formalization just says "Tang proved." | +| Heuristic f(n) ~ 2 log n | Mentioned | Yes, attributed to "Sothanaphan and ChatGPT" | **Minor omission.** The website credits Sothanaphan and ChatGPT; the formalization gives no attribution for this heuristic. | +| Conditional RH bound | Not mentioned | Yes: f(n) ≤ n^{2/3+o(1)} under RH | **Missing.** The website mentions an improved conditional bound under the Riemann Hypothesis. | +| OEIS A392019 | Not mentioned | Yes | **Missing.** Should be noted in the docstring. | + +**Critical issue — `solved` vs. `open`:** The formalization tags both theorems with `category research solved`, but the website lists Problem 684 as **open**. The problem asks to "find bounds for f(n)." While Mahler's theorem proves f(n) → ∞ and Tang provides an upper bound, the problem of determining tight bounds remains open. The `solved` tag is misleading. The main theorem (`erdos_684`, that f(n) → ∞) captures a known result (consequence of Mahler's theorem), not a resolution of the full problem. + +**Recommendation:** +- Change `category research solved` to `category research open` on at least the main theorem, or add a note explaining that these are partial results on an open problem. +- Add the OEIS reference A392019 to the docstring. +- Credit Tang's result more precisely (collaborative with ChatGPT, per the website). +- Consider mentioning the conditional RH bound n^{2/3+o(1)}. + +--- + +## 3. Variants + +The formalization captures two statements: +1. **Main theorem:** f(n) → ∞ (consequence of Mahler's theorem). +2. **Upper bound variant:** f(n) ≤ n^{30/43 + o(1)} (Tang's result). + +**Missing variants that could be formalized:** + +1. **Conditional upper bound (RH):** f(n) ≤ n^{2/3 + o(1)} assuming the Riemann Hypothesis. This is mentioned on the website: + ``` + theorem erdos_684.variants.upper_bound_conditional_RH : + RiemannHypothesis → + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos684F n : ℝ) ≤ (n : ℝ) ^ ((2 : ℝ) / 3 + ε) + ``` + +2. **Heuristic lower bound conjecture:** f(n) ~ 2 log n for "most" n. This is vague as stated ("most n" is imprecise), but could be formalized as a density statement or as a conjecture about typical behavior. Since it's a heuristic rather than a conjecture, it may be appropriately left as prose. + +3. **Mahler's theorem itself** (the underlying tool): For any ε > 0, integers k, l, writing (n+1)···(n+k) = ab where a has only primes ≤ l and b has only primes > l, then a < n^{1+ε} for large n. This is a more general statement that implies the main theorem and could be independently useful. + +4. **Open problem proper:** The actual open question — finding tight/effective bounds on f(n) — is not directly captured. The formalization captures known partial results but not the open problem itself. + +--- + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **`smoothPart` definition:** Clear and well-documented. The docstring accurately describes it as "the largest divisor of m whose prime factors are all at most k." +- **`erdos684F` definition:** The use of `Nat.find` with a fallback of `0` is clean. The docstring correctly notes the fallback behavior. +- **Namespace:** `Erdos684` is appropriate. +- **Docstrings:** Both theorem-level docstrings are informative and provide good mathematical context. +- **Minor:** The module docstring uses LaTeX notation (`$\binom{n}{k} = uv$`) consistently, which is good. + +**One suggestion:** The `smoothPart` definition uses `(Finset.range (k + 1)).filter Nat.Prime`. This could alternatively be written as `(Finset.Icc 2 k).filter Nat.Prime` to more directly reflect the mathematical description "primes in [2, k]" and avoid including 0 and 1 in the range (which are filtered out anyway). This is a very minor style point. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one subtlety.** + +The core definitions are precise: +- The decomposition of C(n,k) = uv where u is k-smooth and v has all prime factors > k is unique (since every positive integer has a unique factorization into a k-smooth part and a k-rough part). +- f(n) as the smallest k with the k-smooth part of C(n,k) exceeding n² is well-defined (or nonexistent). + +**Subtlety — existence of k:** The definition of `erdos684F` returns 0 if no such k exists. For small n, it's conceivable that no k ∈ [0,n] has smoothPart(C(n,k), k) > n². The `Nat.find` searches over all ℕ, not just [0,n], so it would find k > n where C(n,k) = 0, and smoothPart(0, k) needs consideration. Since `0.factorization p = 0` for all p, `smoothPart 0 k = 1`, so 1 > n² fails for n ≥ 2. Thus for k > n the condition fails, and `erdos684F` correctly only finds k ≤ n if it finds anything. + +**Edge cases:** For n = 0 and n = 1, n² ∈ {0, 1}, and smoothPart(C(n,0), 0) = smoothPart(1, 0) = 1 (empty product), so 1 > 0 holds for n=0 and 1 > 1 fails for n=1. The main theorem only concerns large n, so these edge cases don't affect correctness. + +**Ambiguity level: Low.** The original problem statement "find bounds for f(n)" is inherently open-ended, but the formalization reasonably interprets this as capturing known bounds (f(n) → ∞ and the Tang upper bound). The mathematical content being formalized is precise. + +--- + +## 6. Correctness + +**The formalization is mathematically correct for what it captures, but has a categorization issue.** + +### Definition: `smoothPart` +```lean +noncomputable def smoothPart (m k : ℕ) : ℕ := + ∏ p ∈ (Finset.range (k + 1)).filter Nat.Prime, p ^ (m.factorization p) +``` + +- **Correctness:** This correctly computes the k-smooth part. `Nat.factorization` gives the p-adic valuation for the prime factorization, and the product over primes p ≤ k of p^{v_p(m)} gives the largest divisor of m with all prime factors ≤ k. ✓ +- **m = 0 case:** `(0).factorization p = 0` for all p, so `smoothPart 0 k = 1`. This is a reasonable convention (the "smooth part" of 0 is 1, i.e., the empty product). ✓ +- **Matches problem statement:** The problem defines u as the part of C(n,k) whose prime factors are in [2,k]. Since `factorization` only assigns nonzero values to primes, including 0 and 1 in `Finset.range (k+1)` is harmless (they contribute p^0 = 1 to the product). ✓ + +### Definition: `erdos684F` +```lean +noncomputable def erdos684F (n : ℕ) : ℕ := + if h : ∃ k : ℕ, smoothPart (n.choose k) k > n ^ 2 + then Nat.find h + else 0 +``` + +- **Correctness:** Uses `Nat.find` to get the smallest k satisfying the condition. Returns 0 as a sentinel when no k exists. ✓ +- **Domain:** Searches over all ℕ, not just [0,n]. As analyzed in Section 5, this is fine because for k > n, C(n,k) = 0 and smoothPart(0,k) = 1, which doesn't exceed n² for n ≥ 2. ✓ + +### Theorem: `erdos_684` +```lean +theorem erdos_684 : + ∀ K : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → erdos684F n > K +``` + +- **Logical structure:** "For every bound K, for all sufficiently large n, f(n) > K." This is the standard way to express f(n) → ∞ for a ℕ-valued function. ✓ +- **Mathematical correctness:** This is indeed a consequence of Mahler's theorem. Mahler's theorem implies that for fixed k, the k-smooth part of C(n,k) is o(n^ε) for any ε > 0, so in particular it is eventually < n² for each fixed k. Thus the smallest k achieving smoothPart > n² must grow without bound. ✓ +- **Categorization concern:** Tagged `category research solved`, but the full Erdős problem ("find bounds for f(n)") is open. This theorem captures a known *partial result*, not the resolution of the problem. See Section 2. + +### Theorem: `erdos_684.variants.upper_bound` +```lean +theorem erdos_684.variants.upper_bound : + ∀ ε : ℝ, ε > 0 → ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + (erdos684F n : ℝ) ≤ (n : ℝ) ^ ((30 : ℝ) / 43 + ε) +``` + +- **Correctness:** This correctly formalizes "f(n) ≤ n^{30/43 + o(1)}" as: for every ε > 0, eventually f(n) ≤ n^{30/43 + ε}. This is the standard way to formalize "exponent + o(1)" bounds. ✓ +- **Attribution:** The website attributes this to Tang (with ChatGPT). The formalization should reflect this more precisely. + +### Potential issue: `erdos684F` when no k exists + +If `erdos684F n = 0` because no k satisfies the condition, then the main theorem requires `0 > K` for all K, which is false. So the theorem implicitly asserts that for large n, some k does satisfy the condition (i.e., f(n) is well-defined and positive). This is mathematically correct: for k = n, C(n,n) = 1 with smoothPart = 1, so this k doesn't work. But for appropriate intermediate k, the smooth part does exceed n². Actually, this deserves more thought— + +For the theorem to be nontrivially true, we need that for large n, ∃ k such that smoothPart(C(n,k), k) > n². This is not immediately obvious and is itself a mathematical claim. If it fails for some large n, then erdos684F n = 0, and 0 > K fails for K ≥ 0. The theorem would then be false. However, standard results on binomial coefficients and smooth numbers do guarantee this: for k around log n, the central binomial region has C(n,k) growing, and the smooth part captures a substantial portion. The proof via Mahler's theorem handles this. So the formalization is correct, but a docstring note acknowledging that the well-definedness of f(n) for large n is part of the content would improve clarity. + +**Verdict: Correct.** The formalization accurately captures known partial results on Erdős Problem 684. The main issues are (1) the `solved` categorization when the problem is open on the website, and (2) minor citation gaps. No mathematical flaws in the definitions or theorem statements. diff --git a/ai-review/685.md b/ai-review/685.md new file mode 100644 index 0000000000..0e4d210491 --- /dev/null +++ b/ai-review/685.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 685 + +## 1. Code Reuse + +**Issue found.** The file defines a local `omega` function: + +```lean +def omega (n : ℕ) : ℕ := n.primeFactors.card +``` + +Mathlib already provides `ArithmeticFunction.cardDistinctFactors` with scoped notation `ω` (via `open scoped ArithmeticFunction.omega`), defined in `Mathlib.NumberTheory.ArithmeticFunction.Misc`. Several other Erdős problem files (69, 248, 890, 891) already use the Mathlib version. Problems 679 and 452 also define redundant local versions identical in spirit. + +The local `omega` uses `n.primeFactors.card` while Mathlib uses `n.primeFactorsList.dedup.length`. These are definitionally equivalent for all `n : ℕ` (both return 0 for `n = 0`), but using the Mathlib version would provide access to existing lemmas (`cardDistinctFactors_apply_prime_pow`, `cardDistinctFactors_eq_one_iff`, etc.) and maintain consistency with the rest of the codebase. + +**Recommendation:** Replace the local `omega` with `open scoped ArithmeticFunction.omega` and use `ω` throughout, as done in `ErdosProblems/69.lean`. + +## 2. Citations + +The formalization includes: + +> [Er79d] Erdős, P., _Some unconventional problems in number theory_. Mathematics Magazine 52 (1979), 67-70. + +The erdosproblems.com page lists the reference tag as **[Er79d]** without expanding it. The full citation in the formalization matches the actual publication: Erdős, P., "Some Unconventional Problems in Number Theory," *Mathematics Magazine*, Vol. 52, No. 2 (March 1979), pp. 67–70 (published by Taylor & Francis / MAA). + +**Verdict:** The citation is correct and complete. No issues. + +## 3. Variants + +The erdosproblems.com statement includes two formulations: + +1. **Main form (captured):** For $n^\varepsilon < k \leq n^{1-\varepsilon}$, is $\omega\binom{n}{k} = (1+o(1)) \cdot k \cdot \sum_{k n^{1-o(1)}$." This remark is contextual and does not require separate formalization. + +**Recommendation:** Add a variant theorem `erdos_685_variant` capturing the $k \geq (\log n)^c$ formulation. This is a natural strengthening that Erdős explicitly asked about. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The `primeReciprocalSum` helper is well-named and clearly documented. +- The main theorem statement is dense but follows standard patterns in this codebase. +- The docstring clearly explains the mathematical content with LaTeX. + +**One readability concern:** The cast-heavy expression `|(↑(omega (n.choose k)) : ℝ) - ↑k * primeReciprocalSum k n|` could be slightly improved by using intermediate `let` bindings or a clearer cast pattern, but this is a minor stylistic point and consistent with other files. + +**Verdict:** Readability is acceptable. No action needed. + +## 5. Formalizability + +The original problem uses "$o(1)$" asymptotic notation, which is inherently informal. The formalization must unpack this. There are two key decisions: + +1. **What does $(1+o(1))$ mean?** The formalization interprets it as: for every $\delta > 0$, eventually the relative error is at most $\delta$. This is the standard $\varepsilon$-$\delta$ expansion of $o(1)$ and is correct. + +2. **Is the $o(1)$ uniform in $k$?** The formalization makes it uniform: for fixed $\varepsilon$ and $\delta$, a single $N_0$ works for ALL $k$ in the range $[n^\varepsilon, n^{1-\varepsilon}]$ simultaneously. The original phrasing "for all $n^\varepsilon < k \leq n^{1-\varepsilon}$" strongly suggests uniformity (the $o(1)$ is as $n \to \infty$, not as $k \to \infty$). This is the natural interpretation. + +**Verdict:** The problem is reasonably formalizable despite the asymptotic notation. The choices made are well-justified. **Low ambiguity** — the only real question is uniformity in $k$, and the formalization makes the natural choice. + +## 6. Correctness + +### Mathematical analysis + +The formalization states: for all $\varepsilon \in (0,1)$, for all $\delta > 0$, there exists $N_0$ such that for all $n \geq N_0$ and $k$ with $n^\varepsilon < k \leq n^{1-\varepsilon}$: + +$$|\omega\binom{n}{k} - k \cdot \sum_{k < p < n} \frac{1}{p}| \leq \delta \cdot k \cdot \sum_{k < p < n} \frac{1}{p}$$ + +This is equivalent to $\omega\binom{n}{k} = (1 + o(1)) \cdot k \cdot \sum_{k 0$ (which holds when $0 \leq k \leq n$), this agrees with the standard $\omega$ function. + +- **`primeReciprocalSum` definition:** Uses `Finset.range n` filtered by `k < p ∧ Nat.Prime p`, giving primes $p$ with $k < p < n$. This matches $\sum_{k 0 ✓ + +**Missing from the website:** +- **Weaker variant:** The website mentions a variant where the covering is only required to hit all but o(y / log y) integers in [1, y], rather than all of them. This is not formalized. +- **Known bounds as solved variants:** Iwaniec's Y(x) ≪ x² and the FGKMT lower bound could be formalized as `category research solved` theorems, similar to how problem 688 formalizes its known lower bound. + +## 4. Readability + +The code is well-structured and readable: + +- `PrimeCovering` is clearly defined with an informative docstring. +- Both theorem statements have clear docstrings explaining the mathematical content. +- The namespace `Erdos687` keeps the scope clean. + +**Minor suggestions:** +- The `PrimeCovering` docstring mentions "the covering system used in the Jacobsthal function," which could be more precise — the Jacobsthal function is defined via coprimality, not directly via covering systems. Saying "related to the Jacobsthal function" would be more accurate. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement defines Y(x) precisely as a maximum over covering functions and asks for asymptotic bounds. Both the weak form (o(x²)) and strong form (x^{1+o(1)}) have standard, unambiguous mathematical translations: + +- Y(x) = o(x²) means: for all ε > 0, Y(x) < εx² for sufficiently large x. +- Y(x) ≤ x^{1+o(1)} means: for all ε > 0, Y(x) ≤ x^{1+ε} for sufficiently large x. + +Both are captured correctly. The only minor ambiguity in the original problem is the phrasing "Y(x) ≪ x^{1+o(1)}" — the Vinogradov symbol ≪ technically allows a multiplicative constant, but since any constant C can be absorbed into the exponent (C · x^{1+ε} ≤ x^{1+2ε} for large x), the formalization's choice to omit the constant and use `≤` is mathematically equivalent and simpler. + +The `answer(sorry)` wrapper correctly reflects the open status of the problem (the answer is not yet known). + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +**`PrimeCovering` definition (line 37–38):** +- `∀ n : ℕ, 1 ≤ n → n ≤ y → ∃ p : ℕ, p.Prime ∧ p ≤ x ∧ n % p = a p % p` +- This correctly states that every integer n ∈ {1, …, y} is congruent to a(p) mod p for some prime p ≤ x. +- The use of `n % p = a p % p` in `ℕ` correctly captures the congruence n ≡ a(p) (mod p), since both sides are reduced to the canonical representative in {0, …, p−1}. +- The function `a : ℕ → ℕ` is defined on all naturals, but only its values at primes ≤ x matter. This is a standard and harmless over-specification. + +**Weak form (`erdos_687`, lines 46–52):** +- Correctly encodes Y(x) = o(x²): for every ε > 0, eventually Y(x) < εx². +- Uses strict inequality `<`, which is standard for little-o. + +**Strong form (`erdos_687.variants.strong`, lines 59–65):** +- Correctly encodes: for every ε > 0, eventually Y(x) ≤ x^{1+ε}. +- Uses `≤` (non-strict), which is appropriate here. + +**No mathematical flaws detected.** The formalization accurately captures the problem as stated on the website. The quantifier structure (∀ε > 0, ∃X, ∀x ≥ X, ∀ covering, bound on y) correctly expresses both asymptotic claims. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ✅ Acceptable | Minor duplication with 688; justified by different prime criteria | +| Citations | ⚠️ Incomplete | Missing Iwaniec, FGKMT, Maier–Pomerance references and cross-links to 688/689/970 | +| Variants | ⚠️ Partial | Missing the "approximate covering" variant (all but o(y/log y)) and known bounds as solved theorems | +| Readability | ✅ Good | Clear structure and docstrings; minor Jacobsthal reference could be tightened | +| Formalizability | ✅ Excellent | Low ambiguity, standard asymptotic translations | +| Correctness | ✅ Correct | Mathematically sound encoding of both weak and strong forms | diff --git a/ai-review/688.md b/ai-review/688.md new file mode 100644 index 0000000000..6fbf20580f --- /dev/null +++ b/ai-review/688.md @@ -0,0 +1,91 @@ +# Review: Erdos Problem 688 + +## 1. Code Reuse + +**Potential reuse identified with Problem 687.** + +Problem 687 (`FormalConjectures/ErdosProblems/687.lean`) defines `PrimeCovering x y a` which covers `[1, y]` using primes `p ≤ x`. Problem 688's `PrimeCoveringInRange n ε a` covers `[1, n]` using primes in `(n^ε, n]`. These are structurally similar but 688 adds a lower bound on the prime range. A unified definition parameterized by both a lower and upper bound on the primes could serve both: + +```lean +def PrimeCoveringBounded (lo hi target : ℕ → ℝ) (n : ℕ) (a : ℕ → ℕ) : Prop := + ∀ m : ℕ, 1 ≤ m → m ≤ n → + ∃ p : ℕ, p.Prime ∧ lo n < (p : ℝ) ∧ (p : ℝ) ≤ hi n ∧ m % p = a p % p +``` + +However, given that 687 and 688 are in separate namespaces and the definitions are short, the current approach of independent definitions is reasonable and arguably more readable. **No strong recommendation to refactor.** + +The abstract `CoveringSystem` in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` is too general (arbitrary `CommSemiring`, ideal-based) to be directly useful here, where the covering is restricted to a specific range of prime moduli. + +**Style note:** Problem 689 uses the `[MOD p]` notation (`a p ≡ m [MOD p]`) and `Finset.Icc` rather than bare `%` and manual bounds. Problem 688 could adopt this for consistency across the 687/688/689 cluster, but the current form is mathematically equivalent. + +## 2. Citations + +The erdosproblems.com page for Problem 688 cites: + +- **[Er79d]** as the source reference. + +The formalization's docstring does not include this citation. It should be added: + +``` +*Reference:* P. Erdős, [Er79d]. See [erdosproblems.com/688](https://www.erdosproblems.com/688). +``` + +The exact expansion of [Er79d] is not given on the website. This appears to be a 1979 Erdős paper. The formalization correctly attributes the lower bound `ε_n ≫ (log log log n)/(log log n)` to Erdős, consistent with the website. + +## 3. Variants + +The formalization captures: + +1. **Main conjecture** (`erdos_688`): Is `ε_n = o(1)`? — Formalized as: for any fixed `δ > 0`, eventually no covering exists using primes in `(n^δ, n]`. +2. **Lower bound** (`erdos_688.variants.lower_bound`): `ε_n ≫ (log log log n)/(log log n)` — Formalized as: there exists `C > 0` such that eventually a covering exists with `ε = C · log log log n / log log n`. + +The erdosproblems.com page does not list additional variants beyond these. The "Estimate ε_n" part of the problem is inherently open-ended, but the specific sub-question (is `ε_n = o(1)`?) and the known bound are the natural formalizable components. **All identifiable variants are captured.** + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- **Consistency with sibling problems**: Problem 689 uses `≡ ... [MOD p]` and `Finset.Icc`, while 688 uses `m % p = a p % p` and manual `1 ≤ m → m ≤ n`. Using `[MOD p]` and `Finset.Icc` would improve consistency across the 687–689 cluster, though the current form is correct. +- **Docstring for lower bound**: The docstring on `erdos_688.variants.lower_bound` says "there exists a covering using primes in ..." which correctly describes the existential statement. Clear and accurate. +- The `answer(sorry)` pattern on the main conjecture correctly signals that the truth value is unknown. + +**Overall readability: Good.** + +## 5. Formalizability + +The original problem statement "Estimate ε_n" is inherently imprecise — it's a request for bounds rather than a yes/no question. The specific sub-question "is ε_n = o(1)?" is fully precise and admits a clean formalization. + +The definition of ε_n itself (as a supremum) is not directly formalized; instead, the formalization directly states the consequence of ε_n = o(1). This is a reasonable choice that avoids the technical overhead of defining ε_n as a supremum and then stating properties about it. The equivalence between "ε_n = o(1)" and "for all δ > 0, eventually no covering with primes in (n^δ, n]" relies on the monotonicity of feasibility in ε (more primes available with smaller ε), which is mathematically obvious. + +**Assessment: Low ambiguity.** The sub-question formalized is precise. The broader "estimate ε_n" directive is inherently open-ended but the formalization captures the most natural yes/no question from it. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Main conjecture direction**: `ε_n = o(1)` means `ε_n → 0`. For any fixed `δ > 0`, eventually `ε_n < δ`. Since ε_n is the *maximal* ε for which a covering exists, and the set of feasible ε values is downward-closed (smaller ε means more primes in the range `(n^ε, n]`, making covering easier), having `ε_n < δ` means no covering is possible with ε = δ. The formalization's `¬∃ a, PrimeCoveringInRange n δ a` captures exactly this. ✓ + +- **Lower bound direction**: `ε_n ≫ f(n)` means `ε_n ≥ C·f(n)` for some `C > 0` and all large `n`. Since ε_n is the max feasible ε, this means covering IS achievable with `ε = C·f(n)`. The formalization's `∃ a, PrimeCoveringInRange n (C * ...) a` captures exactly this. ✓ + +- **`PrimeCoveringInRange` definition**: The condition `(n : ℝ) ^ ε < (p : ℝ)` correctly implements the strict lower bound `n^ε < p`. The condition `p ≤ n` gives the upper bound. The residue condition `m % p = a p % p` is equivalent to `m ≡ a(p) (mod p)` for natural numbers with `p > 0` (guaranteed by `p.Prime`). ✓ + +- **Edge case**: When `ε ≤ 0`, `n^ε ≤ 1` so all primes up to n are available. When `ε ≥ 1`, `n^ε ≥ n` so no primes are in range (for `n ≥ 2`). Both cases behave correctly under the definition. ✓ + +- **Category tags**: Main conjecture tagged `research open` — consistent with the website (status: OPEN). Lower bound tagged `research solved` — correct, as this is a known result of Erdős. ✓ + +- **Minor note on `answer(sorry)` semantics**: The biconditional `answer(sorry) ↔ (∀ δ > 0, ...)` means the formal statement is: "The answer to the question is True if and only if ε_n = o(1)." Since `answer(sorry)` will eventually be replaced by `True` or `False`, this correctly encodes the open question. ✓ + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor opportunity with Problem 687; not strongly recommended | +| Citations | Missing [Er79d] reference from erdosproblems.com | +| Variants | All variants captured | +| Readability | Good; minor style inconsistency with Problem 689 | +| Formalizability | Low ambiguity; well-chosen sub-question | +| Correctness | Correct and complete | diff --git a/ai-review/690.md b/ai-review/690.md new file mode 100644 index 0000000000..d6de8265ab --- /dev/null +++ b/ai-review/690.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 690 + +## 1. Code Reuse + +No directly reusable code from `FormalConjecturesForMathlib/` was identified. The problem concerns natural densities of integers filtered by their k-th smallest prime factor, which is a specialized number-theoretic concept not covered by the existing additive combinatorics utilities (e.g., `sumConv`, `sumRep`, `IsSidon`, `IsAddComplete`). The custom definitions `sortedPrimeFactors`, `kthSmallestPrimeFactor`, `countKthPrimeFactor`, and `IsUnimodalOnPrimes` are appropriately purpose-built. + +One minor note: `Nat.primeFactors` and `Finset.sort` are already Mathlib primitives, so the implementation correctly leverages existing infrastructure where possible. + +## 2. Citations + +The docstring cites: +- **[Er79e]** Erdős, P., *Some unconventional problems in number theory*. Math. Mag. 52 (1979), 67–70. + +The [erdosproblems.com/690](https://www.erdosproblems.com/690) page additionally references: +- **[Ca25]** Cambie (2025), who showed d_k(p) is unimodal for 1 ≤ k ≤ 3 but not for 4 ≤ k ≤ 20. + +The docstring on `erdos_690` mentions Cambie's result informally ("Cambie confirmed...") but does not include the **[Ca25]** citation in the bracketed reference format used for [Er79e]. This should be added for consistency: + +``` +[Ca25] Cambie, S., (2025). [full citation from erdosproblems.com] +``` + +## 3. Variants + +The erdosproblems.com page mentions a **related variant**: whether the density of integers whose k-th smallest *divisor* (not just prime factor) equals d is unimodal. Erdős proved this density is demonstrably **not** unimodal. This variant is **not captured** in the formalization and could be added as a separate theorem or noted in the docstring. + +## 4. Readability + +The code is well-structured and readable: +- Clear separation of helper definitions (`sortedPrimeFactors`, `kthSmallestPrimeFactor`, `countKthPrimeFactor`, `IsUnimodalOnPrimes`). +- Each definition has a descriptive docstring with LaTeX notation. +- The namespace `Erdos690` cleanly scopes the helpers. +- The main theorem statement is self-contained and follows the problem structure logically. + +**Minor suggestion:** The docstring for `countKthPrimeFactor` says "in {1, …, N}" but the implementation counts integers in {1, …, N} via `Finset.range N` with `n + 1` offset. This is correct but the parameter name `N` could be slightly misleading since `Finset.range N` gives {0, …, N−1}. Consider renaming to clarify, or adding a note. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem is precisely stated: the density d_k(p) = lim_{N→∞} |{n ≤ N : the k-th smallest prime factor of n is p}| / N is a well-defined concept from analytic number theory. The question of whether this function is unimodal in p (for fixed k) is unambiguous. + +The only potential source of ambiguity is the definition of "unimodal." The formalization defines it as: there exists a prime m such that f is non-decreasing on primes ≤ m and non-increasing on primes ≥ m. This is the standard mathematical definition of unimodality restricted to the domain of primes, and is appropriate. + +One subtlety: the formalization implicitly assumes the density d_k(p) exists (as a limit) for all primes p and all k ≥ 1. This is a classical result in analytic number theory and is mathematically justified, but it is bundled into the existential `∃ d_k` rather than stated as a separate fact. + +## 6. Correctness + +**Overall assessment: Correct, with one metadata concern.** + +### Logical structure + +The theorem states: +``` +answer(False) ↔ ∀ k ≥ 1, ∃ d_k, (d_k is the density) ∧ (d_k is unimodal on primes) +``` + +Since `answer(False)` elaborates to `False`, this becomes `False ↔ (∀ k ≥ 1, d_k exists and is unimodal)`, i.e., `¬(∀ k ≥ 1, d_k is unimodal)`. This correctly captures the answer "No" — it is not the case that d_k(p) is unimodal for every k ≥ 1. This matches Cambie's result showing non-unimodality for k ≥ 4. + +### Definition correctness + +- **`sortedPrimeFactors`**: Correctly sorts `Nat.primeFactors n` in increasing order. For n = 0 or n = 1, this is empty, which is handled correctly downstream (returns 0 via `getD`). +- **`kthSmallestPrimeFactor`**: Uses 1-indexing (k − 1 as list index), returns 0 for out-of-bounds. Since 0 is not prime, this cleanly separates "has a k-th prime factor" from "does not" when evaluating at primes. +- **`countKthPrimeFactor`**: Counts integers in {1, …, N} correctly via `Finset.range N` with `n + 1` offset. +- **`IsUnimodalOnPrimes`**: Standard unimodality definition. The mode m is required to be prime, which is appropriate since the domain is primes. +- **Density definition**: Uses `Filter.Tendsto ... atTop (nhds (d_k p))`, the standard Lean/Mathlib way to express convergence of a sequence to a limit. The `N + 1` in the denominator avoids division by zero. Correct. + +### Metadata concern + +The formalization is tagged `category research solved`, but the erdosproblems.com page lists the problem status as **Open**. Cambie's result (unimodal for k ≤ 3, not for 4 ≤ k ≤ 20) does definitively answer the yes/no question "is d_k(p) unimodal for all k?" with "No," so tagging it as `solved` is arguably justified. However, the discrepancy with the website's status should be noted — the website may consider the full characterization (for exactly which k is d_k unimodal?) to still be open. + +### Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | No opportunities identified | +| Citations | Missing [Ca25] reference | +| Variants | Divisor variant not captured | +| Readability | Good | +| Formalizability | High (low ambiguity) | +| Correctness | Mathematically correct | diff --git a/ai-review/691.md b/ai-review/691.md new file mode 100644 index 0000000000..e444cb8e42 --- /dev/null +++ b/ai-review/691.md @@ -0,0 +1,128 @@ +# AI Review: Erdős Problem 691 + +## 1. Code Reuse + +Several definitions in `691.lean` duplicate existing infrastructure in the codebase: + +### `IsBehrend` (lines 47–50) +The file defines its own `IsBehrend` using a hand-rolled `countMultiples` and `Tendsto`. However, **Erdős Problem 26** (`FormalConjectures/ErdosProblems/26.lean`, line 62) already defines: +```lean +def IsBehrend {ι : Type*} (A : ι → ℕ) : Prop := (MultiplesOf A).HasDensity 1 +``` +This uses `Set.HasDensity` from `FormalConjecturesForMathlib/Data/Set/Density.lean` (line 86–88), which is the canonical density infrastructure for the project. The 691 definition should be refactored to use `Set.HasDensity 1` applied to the set of multiples, rather than reimplementing density from scratch via `countMultiples`. + +### `countMultiples` (lines 43–44) +This is a bespoke counting function. The density library already provides `Set.partialDensity` (line 36–39 of `Density.lean`), which generalizes this concept. The multiples set could be defined as: +```lean +def multiplesOf (A : Set ℕ) : Set ℕ := {n | ∃ a ∈ A, a ∣ n} +``` +and then `IsBehrend A` becomes `(multiplesOf A).HasDensity 1`. This mirrors the approach in Problem 26. + +### `SetPairwiseCoprime` (lines 53–54) +This definition is completely redundant. Mathlib provides `Set.Pairwise` and `Nat.Coprime`, and the codebase already uses the idiomatic form `A.Pairwise Nat.Coprime` in multiple places: +- `FormalConjectures/ErdosProblems/12.lean` (lines 114, 124) +- `FormalConjectures/ErdosProblems/307.lean` (lines 60, 71) + +The custom `SetPairwiseCoprime` should be replaced with `A.Pairwise Nat.Coprime`. + +### `ReciprocalSumDiverges` (lines 58–60) +Erdős Problem 26 (`26.lean`, line 35) defines: +```lean +def IsThick {ι : Type*} (A : ι → ℕ) : Prop := ¬Summable (fun i ↦ (1 : ℝ) / A i) +``` +The 691 definition uses a different but equivalent characterization (every bound is exceeded by some finite partial sum). While mathematically equivalent, using `¬Summable` is more idiomatic in Lean/Mathlib and more concise. However, since Problem 26 uses an indexed sequence `ι → ℕ` rather than a `Set ℕ`, the definitions aren't directly interchangeable without an adapter. A set-based version like `¬Summable (fun a : A ↦ (1 : ℝ) / (a : ℕ))` would be cleaner. + +**Recommendation:** Refactor `691.lean` to use `Set.HasDensity`, `Set.Pairwise Nat.Coprime`, and a `¬Summable`-based divergence condition. Remove all four custom definitions. + +## 2. Citations + +### Website content (erdosproblems.com/691) +The website states the problem as: +> Given $A \subseteq \mathbb{N}$, let $M_A = \{n \geq 1 : a \mid n \text{ for some } a \in A\}$ be the set of multiples of $A$. Find a necessary and sufficient condition on $A$ for $M_A$ to have density $1$. + +References listed on the website: +- **[Er79e, p.77]** — Erdős, P., *Some old and new problems on combinatorial number theory* (1979) +- **[Te96]** — Tenenbaum (related to lacunary sequence results) + +### Lean file citations +The docstring references `[Er79e]` with the full title, which matches the website. However: +- The website also mentions **Tenenbaum's result [Te96]** on lacunary sequences and the block sequence results, which are not cited in the Lean file. Since these relate to the open general problem rather than the pairwise coprime case formalized here, their omission is acceptable. +- The citation format is consistent with the website's reference style. + +**No issues with citations.** + +## 3. Variants + +The website describes several aspects of Problem 691: + +1. **The general open problem:** Find a necessary and sufficient condition for $A$ to be Behrend. This is the main open problem — **not formalized**. +2. **Pairwise coprime case (solved):** For pairwise coprime integers $\geq 2$, Behrend $\iff \sum 1/a = \infty$. **This is what is formalized.** +3. **Block sequence case:** Union of intervals $(n_k, (1+\eta_k)n_k) \cap \mathbb{Z}$ — conditions on $\sum \eta_k$. **Not formalized.** +4. **Tenenbaum's lacunary result:** Threshold at $\beta = \log 2$ for lacunary sequences with power-law $\eta_k = k^{-\beta}$. **Not formalized.** + +The docstring says "The general characterization remains open," which correctly acknowledges the broader problem. However, the formalization only captures the pairwise coprime case, which is a known/solved result rather than the open problem itself. The file is tagged `category research solved`, which is accurate for the pairwise coprime case. + +**Assessment:** The main open problem (general characterization) is not formalized. The block sequence and lacunary variants are also missing. The formalization captures the most important solved partial result. Formalizing the general open problem is difficult precisely because the answer is unknown, so the current approach of formalizing the solved case is reasonable. However, the docstring could more explicitly separate "what we formalize (solved case)" from "what remains open (general case)." + +## 4. Readability + +### Issues: +1. **`N + 1` offset pattern** (lines 49–50): The `IsBehrend` definition uses `N + 1` in both the `countMultiples` argument and the denominator to avoid division by zero at `N = 0`. This is functional but slightly obscure. Using `Set.HasDensity` would eliminate this awkwardness entirely, since the density library handles the `N = 0` case internally. + +2. **`n + 1` in `countMultiples`** (line 44): The filter checks `a ∣ (n + 1)` because `Finset.range N` gives `{0, ..., N-1}` and we want to check divisibility of `{1, ..., N}`. This off-by-one adjustment is a readability hazard. + +3. **Namespace clutter:** Four definitions (`countMultiples`, `IsBehrend`, `SetPairwiseCoprime`, `ReciprocalSumDiverges`) are defined when all could be replaced by existing library constructs. + +4. **`open Classical Filter` and `open scoped BigOperators Topology`:** The `BigOperators` scope is opened but `∑` is not used in the theorem statement (only in `ReciprocalSumDiverges`). The opens are fine but slightly broader than necessary. + +### Positive aspects: +- The docstrings are clear and informative. +- The mathematical notation in comments matches the formal definitions well. +- The theorem statement is cleanly structured with explicit hypotheses. + +## 5. Formalizability + +The pairwise coprime case is **fully formalizable** with no ambiguity: + +- "Pairwise coprime integers all $\geq 2$" — precise. +- "Behrend sequence" (density of multiples equals 1) — standard definition, precise. +- "$\sum 1/a = \infty$" — precise (divergence of the harmonic-type sum). +- The biconditional is a clean, well-defined mathematical statement. + +The general Problem 691 ("find a necessary and sufficient condition") is **not formalizable** in its current open form because the characterization is unknown. The approach of formalizing the solved special case is the correct strategy. + +**Ambiguity assessment: None.** The pairwise coprime case as stated is completely unambiguous and admits a clean formalization. + +## 6. Correctness + +### Mathematical correctness: +The theorem statement is **mathematically correct**. The result that a pairwise coprime set $A \subseteq \{2, 3, 4, \ldots\}$ is Behrend if and only if $\sum_{a \in A} 1/a = \infty$ is a well-known theorem in combinatorial number theory. For primes, this follows from Mertens' theorem and inclusion-exclusion; the pairwise coprime generalization is established in the literature (see Davenport-Erdős, 1936/1951, and subsequent work). + +### Formalization correctness: +There are subtle issues worth noting: + +1. **The `a ≥ 2` hypothesis is correct and necessary.** Without it, if $1 \in A$, then $M_A = \mathbb{N}$ trivially and the equivalence breaks (the reciprocal sum including $1/1$ always diverges for an infinite set, but the result is about the interplay between coprimality and density). + +2. **`SetPairwiseCoprime` vs `Set.Pairwise Nat.Coprime`:** The custom definition `∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.Coprime a b` is mathematically equivalent to `A.Pairwise Nat.Coprime`, which unfolds to `∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.Coprime a b`. So the definition is correct but redundant. + +3. **`countMultiples` correctness:** The function counts `|{m ∈ {1,...,N} : ∃ a ∈ A, a ∣ m}|`. This correctly captures $|M_A \cap \{1, \ldots, N\}|$. The implementation via `(Finset.range N).filter (fun n => ∃ a ∈ A, a ∣ (n + 1))` is correct: `Finset.range N = {0, ..., N-1}`, and checking `a ∣ (n+1)` for `n ∈ {0,...,N-1}` is equivalent to checking divisibility for `{1,...,N}`. + +4. **`IsBehrend` density calculation:** The definition computes `countMultiples A (N+1) / (N+1)` as `N` ranges over `ℕ`. At `N = 0`, this gives `countMultiples A 1 / 1`, which counts multiples in `{1}` — correct. The limit as `N → ∞` correctly captures natural density approaching 1. + +5. **`ReciprocalSumDiverges` correctness:** The definition says for every $C > 0$, there exists a finite subset $F$ with $\sum_{a \in F} 1/a > C$. Note that elements of $F$ are only required to be in $A$ (via `∀ a ∈ F, a ∈ A`), not that $F \subseteq \{a \geq 2\}$. However, since the theorem hypothesis `hA` already ensures all elements of $A$ are $\geq 2$, any such $F$ will automatically have elements $\geq 2$, so there's no risk of division by zero (no element equals 0). This is correct. + +6. **Potential issue with `0 ∈ A`:** If `0 ∈ A`, then `countMultiples` would find `0 ∣ (n+1)` is false for all `n` (since `0 ∣ m` iff `m = 0` in `ℕ`), so `0` contributes nothing to multiples. Meanwhile `1/0 = 0` in the reciprocal sum. The hypothesis `hA : ∀ a ∈ A, a ≥ 2` rules this out, so there is no issue. + +### Overall correctness assessment: +**The formalization is mathematically correct and complete for the pairwise coprime case.** There are no logical errors. The main deficiencies are stylistic (redundant definitions, not leveraging existing infrastructure), not mathematical. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Poor** — Four redundant definitions; should use `Set.HasDensity`, `Set.Pairwise Nat.Coprime`, and `¬Summable` | +| Citations | **Good** — Matches website; omission of Tenenbaum reference is acceptable | +| Variants | **Partial** — Only the solved pairwise coprime case is formalized; general open problem and other partial results are missing | +| Readability | **Fair** — Off-by-one adjustments obscure intent; using library definitions would improve clarity | +| Formalizability | **Excellent** — The pairwise coprime case is completely unambiguous | +| Correctness | **Correct** — No mathematical or logical errors in the formalization | diff --git a/ai-review/692.md b/ai-review/692.md new file mode 100644 index 0000000000..eb50cb6759 --- /dev/null +++ b/ai-review/692.md @@ -0,0 +1,72 @@ +# AI Review: Erdős Problem 692 + +## 1. Code Reuse + +**Density infrastructure:** `FormalConjecturesForMathlib/Data/Set/Density.lean` provides generic `partialDensity`, `upperDensity`, `lowerDensity`, and `HasDensity` definitions that conceptually overlap with the custom `HasDelta1Density` in this file. However, the generic infrastructure operates on `Set β` with `ncard`-based counting, while the current formalization uses `Finset.range`-based counting divided by `N`. These are mathematically equivalent but structurally different. Refactoring to use the shared density infrastructure would require defining the relevant set (integers with exactly one divisor in `(n, m)`) as a `Set ℕ` and appealing to `HasDensity`. This is feasible but would add indirection without clear benefit for a self-contained problem. + +**Unimodality:** Erdős Problem 690 (`ErdosProblems/690.lean`) defines `IsUnimodalOnPrimes`, which captures unimodality restricted to primes. Problem 692 instead formalizes unimodality directly via the quasiconcavity characterization (no strict local minima) over all naturals `> n + 1`. These are conceptually related but not directly reusable due to the different domains (primes vs. naturals). + +**Verdict:** No immediate code reuse opportunity that would improve the formalization. The custom definitions are appropriate for this problem's specificity. + +## 2. Citations + +The formalization references: +- `[Er79e]` — Erdős, P., *Some unconventional problems in number theory* (1979). +- `[Ob1]` — Oberwolfach problem session (1986). +- `[Ca25]` — Cambie, S., disproved the conjecture by exhibiting non-unimodality for n = 3. + +**Missing from the website:** +- **[Fo08]** — Kevin Ford provided sharper bounds for δ₁(n, m) for various ranges of n and m. This reference appears on erdosproblems.com/692 but is absent from the formalization's docstring. +- The website notes the related **Problem 446**, which is not cross-referenced. +- The website attributes Erdős's result that "δ₁(n, m) ≪ 1/(log n)^c for all m, for some constant c > 0" which is not mentioned in the docstring. + +**Recommendation:** Add `[Fo08]` citation and a note about related Problem 446 for completeness. + +## 3. Variants + +The website poses two questions: +1. Is δ₁(n, m) unimodal for m > n + 1? +2. For fixed n, where does δ₁(n, m) achieve its maximum value? + +**Only question (1) is formalized.** Question (2), regarding the location of the maximum, is not captured. This is a distinct mathematical question that could be formalized separately (e.g., as a statement about the argmax of the density function). This omission should be documented. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstring clearly explains the mathematical content, the counterexample values, and the encoding strategy ("The RHS formalizes unimodality..."). +- The helper definitions (`countDivisorsInOpenInterval`, `delta1Approx`, `HasDelta1Density`) have good names and clear docstrings. +- The namespace `Erdos692` properly scopes the definitions. +- One minor suggestion: the docstring refers to "The RHS formalizes unimodality" — it would be slightly clearer to say "The RHS formalizes unimodality via quasiconcavity (no strict local minima)." + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The notion of δ₁(n, m) as the natural density of {k ∈ ℕ⁺ : k has exactly one divisor in (n, m)} is precise and unambiguous. The concept of unimodality (as a function of m for fixed n) is standard and well-captured by the quasiconcavity characterization. + +One subtle point: the formalization universally quantifies over the density values (`∀ d₁ d₂ d₃, HasDelta1Density n m₁ d₁ → ...`). If the natural density fails to exist for some (n, m), the relevant `HasDelta1Density` hypotheses would be unsatisfiable, making the implication vacuously true. This means the RHS is really: "for all n, IF the densities exist, THEN they are unimodal in m." This is slightly weaker than "the densities exist AND are unimodal." In practice this is not an issue — these densities are known to exist by standard analytic number theory — but it is a minor gap in the formalization's completeness. + +The problem as stated on the website is precise enough to be obviously formalizable. There is no significant ambiguity. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`answer(False)` encoding:** Since `answer(False)` elaborates to `False`, the theorem `answer(False) ↔ P` is equivalent to `¬P`. Since `P` asserts unimodality for all n, `¬P` asserts that unimodality fails for some n — which is exactly Cambie's result (it fails at n = 3). ✓ + +- **Unimodality characterization:** The RHS states: for all m₁ < m₂ < m₃ (all > n + 1), with densities d₁, d₂, d₃ respectively, we have d₁ ≤ d₂ ∨ d₃ ≤ d₂. This is equivalent to: ¬(d₁ > d₂ ∧ d₃ > d₂), i.e., d₂ is never a strict local minimum. For functions on a linearly ordered set, this "no strict local minimum" condition (applied to ALL triples, not just consecutive values) is exactly quasiconcavity, which is equivalent to unimodality. ✓ + +- **Open interval (n, m):** The `countDivisorsInOpenInterval` correctly uses strict inequalities `n < d ∧ d < m`, matching the mathematical problem's open interval notation. ✓ + +- **Natural density:** `delta1Approx` computes |{k ∈ {1,...,N} : k has exactly one divisor in (n,m)}| / N via `Finset.range (N + 1)` filtered by `0 < k`. The limit as N → ∞ gives the natural density. ✓ + +- **Constraint m > n + 1:** The formalization requires `n + 1 < m₁`, which gives m₁ > n + 1, ensuring the interval (n, m) contains at least one integer (namely n + 1) as a potential divisor. This matches the problem statement's restriction m > n + 1. ✓ + +- **Counterexample consistency:** The docstring values δ₁(3,6) = 0.35, δ₁(3,7) ≈ 0.33, δ₁(3,8) ≈ 0.3619 show a dip at m = 7 (a strict local minimum), which contradicts the unimodality claim. These values are consistent with the website. ✓ + +**Potential concern (minor):** As noted in §5, the existential quantification over density values means the statement is vacuously true if densities don't exist. This does not affect correctness for the counterexample (Cambie's computed densities exist), but a maximally precise formalization could assert density existence as part of the claim. + +**Overall verdict:** The formalization is correct and faithfully captures the disproved unimodality conjecture. The only gaps are (a) the omission of the second variant (location of maximum), (b) the missing Ford citation, and (c) the minor vacuous-truth subtlety around density existence. diff --git a/ai-review/693.md b/ai-review/693.md new file mode 100644 index 0000000000..878b9f9afd --- /dev/null +++ b/ai-review/693.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 693 + +## 1. Code Reuse + +The local definition `HasDivisorIn` (line 37) captures "m has a divisor in (n, 2n)." Several related Erdős problems define nearly identical predicates: + +- **Problem 446** (`446.lean`): `countWithDivisor` filters `Finset.Ioo n (2 * n)` for divisors — a counting version of the same concept. +- **Problem 450** (`450.lean`): `countWithDivisorInRange` checks `∃ d ∈ Finset.Ioo n (2 * n), d ∣ m`. +- **Problem 692** (`692.lean`): `countDivisorsInOpenInterval` counts divisors of `k` in an open interval `(n, m)`. + +All four problems work with "divisors in (n, 2n)" but each defines its own predicate. A shared utility in `FormalConjecturesForMathlib` (e.g., a `HasDivisorInInterval` predicate or a unified counting function) could consolidate these. That said, `HasDivisorIn` is a simple 1-line existential and the local definition is not unreasonable for a standalone problem file. + +No existing definition in `FormalConjecturesForMathlib` directly provides this functionality. The closest infrastructure is `Nat.divisors` (from Mathlib) and the interval finsets `Finset.Ioo`, which are already used in 446/450/692. + +## 2. Citations + +The formalization cites: + +> [Er79e] Erdős, P., _Some unconventional problems in number theory_. Acta Math. Acad. Sci. Hungar. (1979). + +**Website content** (erdosproblems.com/693): +- References [Er79e] — consistent with the formalization. +- Notes problem **#446** as related — not mentioned in the formalization's docstring. Consider adding a cross-reference. +- Notes OEIS sequence **A391118** as possibly related — not mentioned in the formalization. +- The website's problem statement says "Estimate $\max_i a_{i+1} - a_i$" as the general question, with "Is this $\leq (\log n)^{O(1)}$?" as the specific conjecture. + +**Recommendation**: Add a note that Problem 446 is related (per the website). Optionally mention OEIS A391118. + +## 3. Variants + +The website poses the problem in two parts: + +1. **General form**: "Estimate $\max_i a_{i+1} - a_i$." — an open-ended estimation problem. +2. **Specific conjecture**: "Is this $\leq (\log n)^{O(1)}$?" — a yes/no question. + +The formalization captures only the specific yes/no conjecture (2), wrapped in `answer(sorry)` since the problem is open. The general estimation form (1) is inherently harder to formalize as it asks for an asymptotic estimate rather than a yes/no bound, and is arguably not a precise conjecture at all but rather a research direction. The formalization's scope is appropriate. + +No other variants are mentioned on the website. + +## 4. Readability + +The code is clean and well-structured: + +- The `HasDivisorIn` helper is clearly named and documented with a docstring. +- The theorem statement is readable: the universal quantifiers over `a`, `b` with the gap condition `∀ m, a < m → m < b → ¬HasDivisorIn m n` clearly express "a and b are consecutive elements of A." +- The namespace `Erdos693` avoids name collisions. +- The module docstring gives the mathematical context. + +**Minor suggestion**: The subtraction `(b : ℝ) - (a : ℝ)` casts to `ℝ` to avoid natural number subtraction issues. This is a good practice and is correctly done. + +## 5. Formalizability + +The problem is precise and clearly formalizable: + +- The set $A$ of integers in $[n, n^k]$ with a divisor in $(n, 2n)$ is completely determined. +- "Maximum gap between consecutive elements" is a well-defined quantity. +- The bound $(\log n)^{O(1)}$ has a standard meaning: there exists a constant $C$ such that the quantity is $\leq (\log n)^C$ for all sufficiently large $n$. +- The only parameter is $k \geq 2$, with $n$ sufficiently large depending on $k$. + +**Ambiguity**: Essentially none. This is one of the more precisely stated Erdős problems. The only minor question is whether "integers" means positive integers or all integers, but since the interval $[n, n^k]$ with $n$ sufficiently large contains only positive integers, this is moot. + +## 6. Correctness + +The formalization is **correct and complete**. Detailed verification: + +- **Quantifier structure**: `∀ k ≥ 2, ∃ C, ∃ N₀, ∀ n ≥ N₀` — correctly captures "for each $k \geq 2$, for sufficiently large $n$ (depending on $k$)." The constant $C$ is also allowed to depend on $k$ (existentially quantified after `∀ k`), which is appropriate since $(\log n)^{O(1)}$ means $O(1)$ may depend on $k$. + +- **Set membership**: `n ≤ a`, `b ≤ n ^ k`, `HasDivisorIn a n`, `HasDivisorIn b n` — correctly identifies $a, b \in A \cap [n, n^k]$. + +- **Consecutiveness**: `a < b` and `∀ m, a < m → m < b → ¬HasDivisorIn m n` — correctly expresses that $a$ and $b$ are consecutive in $A$, with no elements of $A$ strictly between them. + +- **Gap bound**: `(b : ℝ) - (a : ℝ) ≤ (Real.log (n : ℝ)) ^ C` — correctly formalizes the gap being at most $(\log n)^C$. Using `C : ℕ` rather than `C : ℝ` is marginally more restrictive but mathematically equivalent (for large $n$ where $\log n > 1$, any real exponent can be rounded up to a natural number). + +- **`HasDivisorIn` definition**: `∃ d, d ∣ m ∧ n < d ∧ d < 2 * n` — correctly captures "m has a divisor in the open interval $(n, 2n)$." + +- **`answer(sorry)` usage**: Correct for an open problem where the yes/no answer is unknown. + +- **Edge cases**: If $A \cap [n, n^k]$ is empty or a singleton, the statement is vacuously true (no consecutive pair exists). This is fine — for large $n$ and $k \geq 2$, the set is guaranteed to be non-empty with many elements (every multiple of $n+1$ in the range is in $A$, for instance). + +- **Boundary gaps**: The formalization measures gaps between consecutive *elements of A*, not gaps from the endpoints $n$ or $n^k$ to the nearest element. This matches the standard reading of "maximum gap between consecutive elements of this set" as stated in the problem. + +**No mathematical flaws identified.** diff --git a/ai-review/696.md b/ai-review/696.md new file mode 100644 index 0000000000..9888c74cf6 --- /dev/null +++ b/ai-review/696.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 696 + +## 1. Code Reuse + +The file defines its own `countSat` helper (line 51) for computing the count of integers in `{1, …, N}` satisfying a predicate. This pattern is replicated across multiple Erdős problem files: + +- **691.lean** defines `countMultiples` with the same `(Finset.range N).filter (…)).card` pattern. +- **692.lean** defines `delta1Approx` with the same structure. + +There is no shared utility in `FormalConjecturesForMathlib/` or `Util/` for natural density computations. A shared definition like: + +```lean +noncomputable def naturalDensity (P : ℕ → Prop) (N : ℕ) : ℝ := + (((Finset.range N).filter (fun n => P (n + 1))).card : ℝ) / ((N : ℕ) : ℝ) +``` + +could be extracted and reused by problems 691, 692, 696, and likely many others. The `IsModChain` definition is unique to this problem and cannot be reused. + +## 2. Citations + +**Website states:** `[Er79e, p.81]` +**File states:** `[Er79e] Erdős, P., _Some unconventional problems in number theory_ (1979), p. 81.` + +The website does not provide the full title inline—it only lists the tag `[Er79e]`. The expanded title in the file is helpful but should be verified: the reference [Er79e] on erdosproblems.com corresponds to Erdős's 1979 paper. The title given in the file ("Some unconventional problems in number theory") matches the known paper. **Citation is acceptable.** + +The website also notes a related problem **695**, which is not mentioned in the file's docstring. Consider adding a cross-reference. + +## 3. Variants + +The website states the full problem as: + +> Let h(n) be the largest ℓ such that there is a sequence of primes p₁ < ⋯ < pₗ all dividing n with p_{i+1} ≡ 1 (mod pᵢ). Let H(n) be the largest u such that there is a sequence of integers d₁ < ⋯ < dᵤ all dividing n with d_{i+1} ≡ 1 (mod dᵢ). +> +> **Estimate h(n) and H(n).** Is it true that H(n)/h(n) → ∞ for almost all n? + +The formalization captures only the "Is it true that H(n)/h(n) → ∞ for almost all n?" question. The broader request to "estimate h(n) and H(n)" — including the conjectured normal order h(n) ~ log*(n) — is **not captured**. This is reasonable since the estimation question is vague ("estimate"), but worth noting as an intentional omission. + +The website also notes that h(n) → ∞ for almost all n is "easy to see" (proved by Wouter van Doorn). This sub-result is not formalized as a separate lemma, which would be a natural companion statement. + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- **`hPrime` and `hDivisor`**: The names are adequate but could be slightly more descriptive (e.g., `longestPrimeModChain`, `longestDivisorModChain`). However, the current names mirror the mathematical notation h(n) and H(n), which is a reasonable convention. +- The docstring on `erdos_696` clearly explains the density formulation. Good. +- The `countSat` name is generic and not self-documenting. Something like `countSatisfying` would be marginally clearer. + +Overall readability is **good**. + +## 5. Formalizability + +The problem as stated on the website ("Is it true that H(n)/h(n) → ∞ for almost all n?") is precise enough to formalize. The key choices are: + +- **"Almost all" = natural density 1**: This is the standard interpretation in analytic number theory and is correctly used here. +- **"→ ∞"**: The formalization interprets "H(n)/h(n) → ∞ for almost all n" as "for every M > 0, the density of {n : H(n) ≥ M · h(n)} is 1." This is the correct way to express this: it says the set of exceptions to H(n)/h(n) ≥ M has density 0, for every fixed M. + +**One subtlety**: When h(n) = 0, the ratio H(n)/h(n) is undefined. The formalization sidesteps this by using the inequality H(n) ≥ M · h(n) rather than a ratio, which gracefully handles h(n) = 0 (the inequality becomes H(n) ≥ 0, which is always true). This is mathematically sound—if h(n) = 0 then n has no prime divisors satisfying the chain condition, so n = 1, which has density 0. + +**Assessment: Low ambiguity.** The formalization makes sensible, standard choices. + +## 6. Correctness + +### IsModChain definition (line 37) +The definition uses `List.IsChain (fun a b => a < b ∧ a ∣ (b - 1))`. This encodes: consecutive elements satisfy a < b and a | (b − 1), i.e., b ≡ 1 (mod a). This correctly captures the mod-chain condition. + +**Potential issue with subtraction on ℕ**: Since `b - 1` is natural number subtraction, when `b = 0` we get `0 - 1 = 0` in ℕ, so `a ∣ 0` is always true. However, the `a < b` condition ensures `b ≥ 1` (since `a` is a natural number and `a < b`), so when `a ≥ 1` (which is guaranteed for primes and for positive divisors), `b ≥ 2` and `b - 1 ≥ 1`, making the subtraction safe. For the divisor case, `d₁` could technically be 0 (0 divides n only when n = 0), but the `a < b` strict ordering with natural numbers means the chain elements are positive once the first element is positive. **No actual bug**, but the reasoning relies on implicit positivity. + +### hPrime definition (line 42) +Uses `sSup` over `{k | ∃ l : List ℕ, l.length = k ∧ IsModChain l ∧ ∀ p ∈ l, Nat.Prime p ∧ p ∣ n}`. + +**Concern with sSup**: The set might not be bounded above (though in practice it is, since n has finitely many prime divisors). More importantly, `sSup` on `ℕ` with `conditionallyCompleteLatticeBot` returns 0 for the empty set and for unbounded sets. For n = 0 or n = 1 (no prime divisors), the set of achievable lengths is `{0}` (the empty list), so `hPrime n = 0`. This is mathematically sensible. + +For n with at least one prime divisor, the set is bounded by the number of prime factors of n, so `sSup` is well-defined and correct. + +### hDivisor definition (line 47) +Same structure. For n = 0, every natural number divides 0, but the chain must be strictly increasing, so the set of lengths is still bounded (by any practical consideration chains of divisors of 0 could be arbitrarily long). **This is actually a subtle issue**: if n = 0, then every positive integer divides 0, and one could construct arbitrarily long mod-chains (e.g., 1, 2, 3, 7, 43, ... — primes where each is 1 mod the previous). So `hDivisor 0` would be `sSup ℕ = 0` (since the set is unbounded in the natural numbers and sSup of an unbounded set in ℕ is 0 by convention). This edge case at n = 0 is harmless for the density statement since it concerns only n = 0. + +### Main theorem (line 63) +The density formulation uses `countSat (fun n => (hDivisor n : ℝ) ≥ M * (hPrime n : ℝ)) (N + 1)` divided by `(N + 1)`, tending to 1. + +The `N + 1` shift ensures we never divide by zero (denominator is always ≥ 1) and that we're counting among `{1, …, N+1}`. This is a standard and correct approach. + +The `answer(sorry)` wrapper correctly indicates this is an open problem whose truth value is unknown. + +### Summary of correctness +The formalization is **mathematically correct** for the intended question. The only points worth noting: +1. The n = 0 edge case for `hDivisor` is degenerate but harmless. +2. The formalization correctly avoids division-by-zero issues in the ratio H(n)/h(n) by using the equivalent inequality form. +3. The broader "estimate h(n) and H(n)" question is intentionally omitted. + +**Overall assessment: Correct and faithful formalization of the main question.** diff --git a/ai-review/698.md b/ai-review/698.md new file mode 100644 index 0000000000..3742334e06 --- /dev/null +++ b/ai-review/698.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 698 + +**File:** `FormalConjectures/ErdosProblems/698.lean` + +## 1. Code Reuse + +The formalization uses `Nat.gcd`, `Nat.choose`, and `Filter.Tendsto` directly from Mathlib, which is appropriate. No custom helper definitions are introduced, and none are needed given the simplicity of the statement. + +**Closely related files in the codebase:** +- **Erdős 699** (`ErdosProblems/699.lean`): Same Erdős–Szekeres origin. Asks whether a prime p ≥ i divides gcd(C(n,i), C(n,j)). Uses the identical `Nat.gcd (Nat.choose n i) (Nat.choose n j)` expression. No shared helper is needed since each problem's statement is self-contained, but the three files (698, 699, 700) could benefit from a shared module-level docstring noting their common origin in [ErSz78]. +- **Erdős 700** (`ErdosProblems/700.lean`): Related Erdős–Szekeres problem on min gcd(n, C(n,k)). Defines its own `f` and `greatestPrimeFactor` helpers, which are problem-specific and not reusable here. +- **OEIS A80170** (`OEIS/80170.lean`): GCD of specific binomial coefficients C((i+2)k, k). Different setup; no reuse opportunity. + +**Verdict:** No code reuse issues. The formalization appropriately uses Mathlib primitives directly. + +## 2. Citations + +The docstring references `[ErSz78]` and `[Be11]` in shorthand. + +From [erdosproblems.com/698](https://www.erdosproblems.com/698): +- **[ErSz78]** corresponds to Erdős and Szekeres (1978) — the original paper posing the problem. +- **[Be11]** corresponds to Bergman (2011) — the resolution. + +The website does not provide full bibliographic details beyond author names and years, so the shorthand notation in the formalization is consistent with the source. The sibling file `700.lean` expands [ErSz78] slightly to "Erdős, P. and Szekeres, G., 1978" but this level of detail is not critical for a formalization file. + +**Verdict:** Citations are consistent with the website. No issues. + +## 3. Variants + +The original problem on the website asks qualitatively whether gcd(C(n,i), C(n,j)) → ∞ uniformly (i.e., whether there exists h(n) → ∞ serving as a lower bound). The formalization captures exactly this. + +**Missing variant — Bergman's quantitative bound:** The docstring mentions Bergman's specific result: +$$\gcd\left(\binom{n}{i}, \binom{n}{j}\right) \gg n^{1/2} \cdot 2^i / i^{3/2}$$ +but this quantitative bound is not formalized as a separate theorem or variant. Since the problem is marked as solved and Bergman's bound is the resolution, formalizing it would strengthen the file. A natural addition would be: + +```lean +/-- Bergman's quantitative bound [Be11]. -/ +theorem erdos_698_bergman_bound : + ∃ C : ℝ, C > 0 ∧ ∀ n i j : ℕ, 2 ≤ i → i < j → j ≤ n / 2 → + C * n ^ (1/2 : ℝ) * 2 ^ i / i ^ (3/2 : ℝ) ≤ Nat.gcd (Nat.choose n i) (Nat.choose n j) +``` + +**Also not formalized:** The Erdős–Szekeres observation that gcd(C(n,i), C(n,j)) ≥ C(n,i)/C(j,i) ≥ 2^i, and its sharpness at i=1, j=p, n=2p. These are mentioned in the docstring but not captured as formal statements. + +**Verdict:** The core problem is captured. The quantitative Bergman bound and the Erdős–Szekeres lower bound mentioned in the docstring are not formalized as variants but could be valuable additions. + +## 4. Readability + +The code is concise and well-structured: +- The module docstring clearly states the problem, its history, and the resolution. +- The `open Filter` is necessary and minimal. +- The namespace `Erdos698` is clean. +- The `answer(True)` pattern correctly indicates this is a solved problem with an affirmative answer. +- The LaTeX in the docstring is well-formatted. + +**Minor observation:** The `@[category research solved, AMS 5 11]` tag includes AMS class 5 (combinatorics) alongside 11 (number theory). The sibling problems 699 and 700 use only `AMS 11`. While the problem does have a combinatorial flavor (binomial coefficients), this is a minor stylistic inconsistency. + +**Verdict:** Highly readable. No significant issues. + +## 5. Formalizability + +The problem is completely precise and directly formalizable. The statement "there exists h(n) → ∞ such that gcd(C(n,i), C(n,j)) ≥ h(n) for all 2 ≤ i < j ≤ n/2" is unambiguous and translates naturally into Lean. + +The only potential source of ambiguity is the meaning of "n/2" — in the original mathematical statement this is a real number, but since j is a natural number, j ≤ n/2 (real) is equivalent to j ≤ ⌊n/2⌋ (natural). The Lean formalization uses `n / 2` (natural number floor division), which is mathematically equivalent. + +**Verdict:** No ambiguity. The problem is perfectly suited for formalization. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +**Statement structure:** `∃ h : ℕ → ℕ, Tendsto h atTop atTop ∧ ∀ n i j, 2 ≤ i → i < j → j ≤ n/2 → h n ≤ gcd(C(n,i), C(n,j))` + +This correctly captures: there is a function h going to infinity such that for all valid triples (n,i,j), the GCD is at least h(n). + +**Edge cases are handled correctly:** +- For n ≤ 5: the constraint 2 ≤ i < j ≤ ⌊n/2⌋ is unsatisfiable (since ⌊n/2⌋ ≤ 2 and we need i ≥ 2, i < j ≤ 2, which is impossible). The universal statement is vacuously true for these n, so h(n) is unconstrained. This is correct behavior. +- For n = 6: the only valid pair is (i,j) = (2,3). gcd(C(6,2), C(6,3)) = gcd(15,20) = 5. So h(6) ≤ 5 is required. + +**The `answer(True)` is correct:** Bergman proved the affirmative, so the answer is indeed True. + +**Natural number codomain for h:** Using h : ℕ → ℕ with `Tendsto h atTop atTop` is standard and sufficient. Since gcd values are natural numbers, the comparison h(n) ≤ gcd(...) stays in ℕ, which is clean. + +**One subtle point:** The formalization asks for h(n) to depend only on n, not on i or j. This is the correct reading of the problem — the GCD lower bound should hold uniformly over all valid (i,j) pairs for a given n. This matches the original problem statement and Bergman's result (where the bound n^{1/2} · 2^i / i^{3/2} ≥ C·n^{1/2} for i ≥ 2, so taking h(n) ∼ n^{1/2} works). + +**Verdict:** The formalization is correct and complete for the core problem statement. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | **No issues.** Uses Mathlib primitives appropriately. | +| Citations | **Consistent with website.** Shorthand references match source. | +| Variants | **Core captured; quantitative bound not formalized.** Bergman's explicit bound and the Erdős–Szekeres 2^i observation from the docstring could be added as variants. | +| Readability | **Excellent.** Clean, concise, well-documented. | +| Formalizability | **Unambiguous.** Directly and naturally formalizable. | +| Correctness | **Correct.** No mathematical flaws. Edge cases handled properly. | + +**Overall:** This is a clean, correct formalization of the core qualitative problem. The main opportunity for improvement is adding the quantitative Bergman bound as a variant theorem, since it is the actual resolution and is already described in the docstring. diff --git a/ai-review/70.md b/ai-review/70.md new file mode 100644 index 0000000000..926a7cd263 --- /dev/null +++ b/ai-review/70.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 70 + +**File:** `FormalConjectures/ErdosProblems/70.lean` + +## 1. Code Reuse + +The codebase contains **at least six** other ordinal partition relation definitions across different Erdős problem files (118, 597, 1167, 1169, 1170, 1171, 1172). Problem 70's `OrdinalPartition3_2` is the only one that uses raw `Ordinal` types with manually encoded monotonicity conditions. The other definitions follow a cleaner pattern: + +- **Problem 118** (`OrdPartition`): Uses `OrdinalSet α` (a subtype `{a : Ordinal // a < α}`) and `↪o` order embeddings. +- **Problem 1169** (`OrdinalPartitionPair`): Uses `{x : Ordinal // x < α}` subtypes and `StrictMono`. +- **Problem 1170** (`OrdinalPartition`): Same subtype approach with `StrictMono`. + +Problem 70 should ideally be refactored to use subtypes and `StrictMono` (or `↪o`) for consistency. A generalized partition relation definition parameterized by subset size and number of colors—placed in `FormalConjecturesForMathlib`—would consolidate all these ad hoc definitions. At minimum, `OrdinalPartition3_2` should adopt the subtype idiom used by the majority of sibling files. + +## 2. Citations + +The code currently cites: + +> [Er87] Erdős, P., *On some of my favourite unsolved problems* (1987). + +The [erdosproblems.com/70](https://www.erdosproblems.com/70) page lists: + +- **[Er87]** — present ✓ +- **[Va99, 7.83]** — **missing** from the code + +The reference **[Va99]** should be added. Additionally, the known partial result by Erdős and Rado—that $\mathfrak{c} \to (\omega + n, 4)^3_2$ for all $2 \leq n < \omega$—is mentioned on the website but absent from the code's documentation. + +**Recommendation:** Add `[Va99, 7.83]` to the citation list and mention the Erdős–Rado partial result in the docstring. + +## 3. Variants + +The website does not describe any additional variants of this problem beyond the main statement. The Erdős–Rado partial result ($\mathfrak{c} \to (\omega + n, 4)^3_2$) is a known sub-case, not a separate variant. No variants appear to be missing. + +## 4. Readability + +Several readability issues: + +1. **Inconsistent style with sibling files.** Other ordinal partition problems use `{x : Ordinal // x < α}` subtypes and `StrictMono` or `↪o`, making the embedding structure immediately clear. Problem 70 manually encodes monotonicity with three separate universally quantified conditions (`g i < g j`, `g i < α`, and the coloring condition). This is harder to parse at a glance. + +2. **Coloring function domain.** The function `f : Ordinal → Ordinal → Ordinal → Fin 2` accepts *any* three ordinals, not just increasing triples below `α`. While mathematically harmless (only increasing triples in the image of `g` are examined), it obscures the intended domain. A function on the subtype would make the intent explicit. + +3. **Definition name.** `OrdinalPartition3_2` encodes "3-element subsets, 2 colors" in the name, but the relationship between the name and the standard notation is unclear. A name like `OrdinalPartitionTriples` or a generalized `OrdinalPartitionRel` with parameters would be clearer. + +## 5. Formalizability + +**Assessment: Unambiguous and fully formalizable.** + +The partition relation $\alpha \to (\beta, \gamma)^3_2$ is a standard definition in infinitary combinatorics / partition calculus. All constituent concepts (ordinals, cardinals, order types, colorings of triples, homogeneous sets) have precise set-theoretic definitions. The parameters ($\mathfrak{c}$, countable ordinals, finite $n \geq 2$) are all standard. + +The only source of ambiguity is the arrow notation itself, which has multiple typographic conventions in the literature (placement of subscripts/superscripts). However, the mathematical content is unambiguous once the convention is fixed. + +## 6. Correctness + +### What is correct + +- **The `OrdinalPartition3_2` definition correctly captures the 2-coloring of triples partition relation.** The coloring function takes three ordinals and returns `Fin 2`; the homogeneity condition requires all increasing triples in the image of a strictly increasing embedding to receive the same color. ✓ +- **The embedding correctly encodes order type.** A strictly increasing function from ordinals below `β` into ordinals below `α` yields a subset of order type exactly `β`. ✓ +- **`Cardinal.continuum.ord`** correctly represents $\mathfrak{c}$ as an initial ordinal. ✓ +- **`β.card ≤ ℵ₀`** correctly characterizes countable ordinals. ✓ +- **`2 ≤ n`** and coercion `(↑n : Ordinal)` correctly capture finite $n \geq 2$. ✓ +- **`answer(sorry)`** is appropriate since the problem is open. ✓ + +### Notation error in docstrings (significant) + +Both the module-level docstring and the definition docstring write the partition relation as: + +$$\mathfrak{c} \to (\beta, n)^2_3$$ + +This notation, with **superscript 2 and subscript 3**, denotes (in standard partition calculus convention) a **3-coloring of pairs**. However, the code implements a **2-coloring of triples**, which should be written: + +$$\mathfrak{c} \to (\beta, n)^3_2$$ + +(superscript 3 = triples, subscript 2 = two colors). The website [erdosproblems.com/70](https://www.erdosproblems.com/70) correctly writes $(\beta, n)_2^3$ (which in LaTeX renders identically to $(\beta, n)^3_2$). The code's docstrings have the subscript and superscript **swapped**. + +This is a documentation-only error—the code implementation is correct—but it could seriously mislead a reader who trusts the docstring notation over the code. + +**Recommendation:** Change `^2_3` to `^3_2` (or `_2^3`) in all docstrings. + +### Summary + +| Criterion | Status | +|-----------|--------| +| Code reuse | Could adopt subtype/StrictMono idiom from sibling files | +| Citations | Missing [Va99, 7.83]; missing Erdős–Rado partial result | +| Variants | Complete | +| Readability | Below standard compared to sibling partition problems | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Implementation correct; **docstring notation has sub/superscripts swapped** | diff --git a/ai-review/700.md b/ai-review/700.md new file mode 100644 index 0000000000..adc99d2b2c --- /dev/null +++ b/ai-review/700.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 700 + +## 1. Code Reuse + +**Issue found.** The file defines its own `greatestPrimeFactor` (line 47) using `n.primeFactorsList.foldl max 0`, but `Nat.maxPrimeFac` already exists in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` with a well-developed API including `maxPrimeFac_zero`, `maxPrimeFac_one`, `prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, and `one_lt_maxPrimeFac_iff`. The library version is noncomputable (uses `sSup`), while the local version is computable; however, since the theorems are all `sorry`'d anyway, the noncomputability is not a practical concern and the library's theorem infrastructure would be more useful. At minimum, a proof of equivalence should be provided to bridge the two definitions, or the statements should be refactored to use `Nat.maxPrimeFac` directly. + +This same issue exists across multiple Erdős problems (648, 649, 683, 976, 977) that each define their own `greatestPrimeFactor` variant with slightly different implementations (`foldl` vs `foldr`, returning 0 vs 1 for edge cases). A unified approach is warranted. + +Additionally, the closely related problems 698 and 699 (also by Erdős–Szekeres, also from [ErSz78], also involving gcd of binomial coefficients) share mathematical context. No cross-references exist in the code. + +## 2. Citations + +**Minor issue.** The citation `[ErSz78]` in the docstring correctly matches the website attribution: "Erdős, P. and Szekeres, G., 1978." The module docstring (line 32) gives the expanded form, which is good. However, the full bibliographic entry is incomplete — the paper title and journal are missing. For reference, the paper is: + +> Erdős, P. and Szekeres, G. (1978). "Some number theoretic problems on binomial coefficients." *Australian Mathematical Society Gazette*, 5(3), 97–99. + +The website also references OEIS sequence A091963, which is not mentioned in the formalization. + +## 3. Variants + +**Significant omission.** The website poses three questions. The formalization captures: + +| Website Question | Formalization | Status | +|---|---|---| +| Characterize composite n with f(n) = n/P(n) | **Not formalized** (only mentioned in Part (a) docstring) | OPEN | +| Upper bound: f(n) ≤ n/P(n) | Part (a) — `erdos_700.variants.upper_bound` | Solved (correctly tagged) | +| Infinitely many composite n with f(n) > √n | Part (b) — `erdos_700.variants.infinitely_many_large` | Open | +| f(n) ≪_A n/(log n)^A for every A > 0 | Part (c) — `erdos_700` | Open | + +The **primary open question** from the website — "Characterise those composite n such that f(n) = n/P(n)" — is the headline problem but is only alluded to in the docstring of Part (a). It should be formalized as a separate open theorem, perhaps as an existential characterization predicate or at least a `sorry`'d placeholder acknowledging that the characterization is sought. + +Additionally, two known results mentioned in the module docstring are not formalized: +- **Lower bound:** f(n) ≥ p(n) (the smallest prime factor of n) — this is a natural companion to Part (a). +- **Equality cases:** f(n) = n/P(n) when n is a semiprime or n = 30 — these are concrete solved results that could serve as useful lemmas. + +## 4. Readability + +**Good overall.** The code is clean and well-structured: + +- The `f` function (lines 39–44) is clearly defined with an explicit threshold at n ≥ 4 and a readable Finset construction. +- The `min'` proof obligation is discharged inline, which is compact but clear. +- Part (b) sensibly avoids `Real.sqrt` by using `(f n) ^ 2 > n` with an explanatory docstring (line 62). +- Part (c) clearly explains the ∀-∃ expansion of the Vinogradov ≪_A notation in its docstring. + +**Minor readability suggestions:** +- The `greatestPrimeFactor` docstring says "Returns 0 if n ≤ 1" but this isn't obvious from `primeFactorsList.foldl max 0` without knowing that `primeFactorsList` is empty for n ≤ 1. A brief comment or a simp lemma would help. +- The namespace `Erdos700` is used, which is consistent with the codebase convention. + +## 5. Formalizability + +**Assessment: High formalizability with moderate ambiguity in Part (c).** + +- **Part (a) upper bound:** Entirely precise and clearly formalizable. No ambiguity. +- **Part (b):** Precisely stated. The reformulation as `f(n)^2 > n` is a faithful translation to ℕ. No ambiguity. +- **Part (c):** The Vinogradov notation f(n) ≪_A n/(log n)^A is moderately ambiguous: + - The subscript A means the implied constant may depend on A. The formalization correctly handles this by existentially quantifying C after universally quantifying A. + - The original uses real A > 0; the formalization restricts to `A : ℕ` with `0 < A`. This is **mathematically equivalent** because the bound for integer A ≥ ⌈r⌉ implies the bound for real r > 0 (with a possibly different constant), since (log n)^A is monotone in A for n ≥ 3. + - There is a subtle domain issue: `Real.log n` is negative for 0 < n < 1 and zero for n = 0 or n = 1, but since we're working with natural n ≥ N₀ and N₀ is existentially quantified, this is handled by choosing N₀ ≥ 3. +- **Missing characterization question:** The actual open problem ("characterise those n...") is inherently hard to formalize because it asks for a characterization rather than a yes/no answer. One approach would be to formalize it as the existence of a decidable predicate P on ℕ such that f(n) = n/P(n) ↔ P(n), but the "right" formalization depends on the expected form of the answer. + +## 6. Correctness + +**Mostly correct, with observations:** + +- **f(n) definition (lines 39–44):** Correct. The range `Finset.Icc 2 (n/2)` faithfully captures {k : 1 < k ≤ n/2} since 1 < k is equivalent to 2 ≤ k. The threshold n ≥ 4 ensures the range is nonempty (since n/2 ≥ 2 for n ≥ 4). The junk value of 0 for n < 4 is reasonable. + +- **Part (a) — upper bound (lines 54–57):** Correct. The hypotheses `4 ≤ n` and `¬ Nat.Prime n` together characterize composite n ≥ 4. Note that n = 1 is not prime but has n < 4, and is excluded. The inequality `f n ≤ n / greatestPrimeFactor n` is the correct known upper bound. + +- **Part (b) — infinitely many large (lines 64–68):** Correct. The condition `¬ Nat.Prime n ∧ 2 ≤ n` correctly captures composite numbers (since 0, 1 are excluded by 2 ≤ n, and 2, 3 are excluded by ¬ Prime). The use of `(f n) ^ 2 > n` faithfully represents f(n) > √n over ℕ. **Note:** The known answer is True (take n = p² for primes p), as stated in the module docstring. This means the `answer(sorry)` should likely be `answer(True)`, though leaving it as `sorry` is acceptable per project conventions if the solver is expected to determine the answer. + +- **Part (c) — asymptotic bound (lines 77–84):** Mathematically sound. The hypotheses `¬ Nat.Prime n` and `2 ≤ n` correctly restrict to composites. The quantifier structure (∀ A, ∃ C, ∃ N₀, ∀ n ≥ N₀, ...) correctly captures the Vinogradov notation with A-dependent constants. + + **One potential issue:** The division `(n : ℝ) / (Real.log (n : ℝ)) ^ A` could be problematic when `Real.log n = 0` (i.e., n = 0 or n = 1), but this is handled by the existentially quantified N₀ — choosing N₀ ≥ 2 avoids division by zero. The inequality would hold vacuously or with the convention that division by zero in Lean's reals gives 0 (making the RHS = 0, which would make the inequality false). But since N₀ can be chosen freely, this is not a correctness issue. + +**Summary of correctness concerns:** +1. The main open problem (characterization) is not formalized — only the solved upper bound is. +2. Part (b)'s answer is known to be True from the p² argument, yet it's left as `sorry`. +3. No mathematical errors were found in the three formalized parts. + +## Overall Assessment + +The formalization is **mathematically correct** for the three parts it includes, with clean code and clear docstrings. The main deficiency is the **omission of the primary open question** (the characterization problem) and two known auxiliary results (the lower bound f(n) ≥ p(n) and the semiprime equality cases). The local `greatestPrimeFactor` should be replaced with or bridged to the library's `Nat.maxPrimeFac`. The citation is correct but could include the full bibliographic entry. diff --git a/ai-review/701.md b/ai-review/701.md new file mode 100644 index 0000000000..e803f82de0 --- /dev/null +++ b/ai-review/701.md @@ -0,0 +1,90 @@ +# Review: Erdős Problem 701 + +## 1. Code Reuse + +**There is a near-duplicate formalization in `FormalConjectures/Paper/Chvatal.lean`.** + +`Chvatal.lean` defines `Decreasing` (equivalent to `IsDownwardClosed`) and `Intersecting` (equivalent to `IsIntersectingFamily`), and states the same conjecture as `exists_maximal_star`. The two files independently define the same concepts and theorem. These should be consolidated. + +Differences between the two: +- `IsDownwardClosed` quantifies as `∀ A ∈ F, ∀ B, B ⊆ A → B ∈ F`; `Decreasing` uses `∀ A B, B ⊆ A → A ∈ F → B ∈ F` (different argument order). +- `IsIntersectingFamily` uses `(A ∩ B).Nonempty`; `Intersecting` uses `A ∩ B ≠ ∅`. These are equivalent via `Finset.nonempty_iff_ne_empty`. +- `Chvatal.lean` requires `[Fintype α]`; `701.lean` does not. Both require `[Nonempty α]`. + +Additionally, Mathlib provides potentially relevant abstractions: +- `IsLowerSet` from `Mathlib.Order.UpperLower.Basic` generalizes downward-closed families. +- `Set.Intersecting` from `Mathlib.Combinatorics.SetFamily.Intersecting` provides a general intersecting predicate for semilattices. +- `memberSubfamily` / `nonMemberSubfamily` from `Mathlib.Combinatorics.SetFamily.Compression.Down` provide degree-computation utilities. + +Using Mathlib's `Set.Intersecting` or at minimum unifying with `Chvatal.lean` would reduce duplication. + +## 2. Citations + +The formalization references only `[erdosproblems.com/701](https://www.erdosproblems.com/701)`. + +The website lists the following references that should be documented: +- **[Er81, p.26]** — Original source (Erdős, 1981). +- **[Ch74]** — Chvátal proved a variant under a stronger monotonicity condition (injection-based ordering on subsets of {1,…,n}). +- **[St74]** — Sterboul proved the result when maximal sets have equal size, pairwise intersections have at most one element, and at least two maximal sets have non-empty intersection. +- **[FrKu23]** — Frankl and Kupavskii established the result when the family has covering number 2. +- **[Bo11]** — Borg proposed a weighted generalization, proving it under certain additional assumptions. + +The docstring should at minimum cite Chvátal as the originator of the conjecture (it is called "Chvátal's Conjecture" in the docstring but without a citation to Chvátal's paper). + +## 3. Variants + +The website mentions several partial results that could be formalized as separate theorems: +- **Chvátal's partial result [Ch74]**: The conjecture holds under a stronger injection-based monotonicity condition. +- **Sterboul's partial result [St74]**: Holds when maximal sets have equal size and pairwise intersections have ≤ 1 element. +- **Frankl–Kupavskii [FrKu23]**: Holds for families with covering number 2. +- **Borg's weighted generalization [Bo11]**: A weighted version of the conjecture. + +None of these variants are currently captured. The formalization states only the main open conjecture. This is acceptable but the variants represent natural companion theorems. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The definitions `IsDownwardClosed` and `IsIntersectingFamily` are well-documented with docstrings. +- The theorem's docstring clearly states the conjecture in both formal and informal terms. +- The `open Finset` is appropriate given heavy use of `Finset` operations. +- The namespace `Erdos701` cleanly scopes the local definitions. + +No significant readability improvements needed. + +## 5. Formalizability + +**The problem is precisely stated and clearly formalizable.** Chvátal's conjecture is a well-known, precisely defined combinatorial statement. There is no ambiguity in the informal statement: "downward closed," "intersecting subfamily," and "degree of an element" all have standard mathematical meanings that translate directly to the formal definitions given. + +The only potential source of ambiguity is the scope of "family of sets" — the original statement doesn't explicitly require finiteness of the family or ground set. However, using `Finset (Finset α)` (a finite family of finite sets) is the standard setting for this conjecture and is appropriate. The conjecture is trivially true for infinite families in certain interpretations and is traditionally studied in the finite regime. + +**Ambiguity assessment: Very low.** The formalization faithfully captures the standard mathematical meaning. + +## 6. Correctness + +**The formalization is mathematically correct.** + +The statement captures Chvátal's conjecture accurately: for any downward-closed (finite) family F of finite sets, there exists an element x whose degree (number of sets in F containing x) is at least as large as the cardinality of any intersecting subfamily of F. This is equivalent to saying the maximum intersecting subfamily size is at most the maximum degree. + +Detailed verification: + +- **Downward closure** (`IsDownwardClosed`): Correctly defined as closure under taking subsets. ✓ +- **Intersecting family** (`IsIntersectingFamily`): Correctly requires every pair of members to have nonempty intersection. ✓ +- **Conclusion** (`∃ x, ∀ F' ⊆ F, IsIntersectingFamily F' → F'.card ≤ (F.filter (fun A => x ∈ A)).card`): The existential quantification over x with universal quantification over all intersecting subfamilies F' correctly formalizes "the maximum degree is at least the maximum intersecting subfamily size." ✓ +- **`[Nonempty α]` assumption**: Necessary to ensure the existential `∃ x : α` is satisfiable. Without this, the statement would be vacuously unprovable for an empty type. ✓ +- **Edge cases**: When F is empty, any x works (0 ≤ 0). When F = {∅}, no non-empty subfamily is intersecting (∅ ∩ ∅ is empty), so the bound holds trivially. ✓ + +**One potential concern**: The formalization does not require the quantified element x to belong to the "ground set" of the family (i.e., ⋃ F). In principle, the existential `∃ x : α` could be witnessed by an element not appearing in any set in F, in which case the degree would be 0. However, this is not a problem — if the conjecture holds, it holds in particular for the element of maximum degree, which (for non-trivial F containing non-empty sets) will be an element appearing in some member of F. For trivial F (empty or {∅}), the conjecture holds regardless. + +**No mathematical flaws identified.** The formalization is correct and complete. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Significant duplication** with `Chvatal.lean`; Mathlib abstractions available | +| Citations | **Incomplete** — missing [Er81], [Ch74], [St74], [FrKu23], [Bo11] | +| Variants | **Not captured** — several known partial results exist | +| Readability | **Good** — clean, well-documented | +| Formalizability | **Very low ambiguity** — standard, precisely defined conjecture | +| Correctness | **Correct** — faithful formalization with no mathematical flaws | diff --git a/ai-review/702.md b/ai-review/702.md new file mode 100644 index 0000000000..b29301140c --- /dev/null +++ b/ai-review/702.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 702 + +## 1. Code Reuse + +Several related patterns exist in the codebase: + +- **Problem 703** (`703.lean`) uses the same `(A ∩ B).card` pattern for intersection cardinality conditions on set families, with a `sSup`-based extremal definition `T(n, r)`. +- **Problem 701** (`701.lean`) defines `IsIntersectingFamily` for families where all pairs have nonempty intersection — related but not directly reusable (checks `Nonempty` rather than `.card = 1`). +- **Problem 722** (`722.lean`) demonstrates the `Finset (Finset (Fin n))` + uniformity + `Nat.choose` pattern. +- **Johnson graph** (`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Johnson.lean`) works with intersection cardinality of k-element subsets. + +The formalization is self-contained and does not need to extract helper definitions. No existing definitions can be directly reused to simplify this file. The current approach is appropriate. + +## 2. Citations + +The formalization cites: + +> [Fr77] Frankl, P., *On families of finite sets no two of which intersect in a singleton*, Bull. Austral. Math. Soc. 17 (1977), 125–134. + +The website lists the following origin references that are **not included** in the formalization: +- [Er75f, p.108] +- [Er76b, p.186] +- [Er81] +- [Er82e] + +The website also mentions **Katona (unpublished)** proved the k=4 case, which the docstring does mention. The website notes that the problem is related to **Problem 703**, which could be mentioned in the module docstring as a cross-reference. + +**Recommendation:** Add the Erdős origin references and a "See also: Problem 703" note to the module docstring for completeness. + +## 3. Variants + +The website does not describe additional variants beyond the main statement. The formalization captures the single known statement. No variants appear to be missing. + +## 4. Readability + +The code is clean and readable. The module docstring clearly states the problem, the theorem docstring provides mathematical context with LaTeX, and the Lean signature is well-structured with meaningful hypothesis names (`hk`, `hkn`, `hF_unif`, `hF_large`). No readability improvements needed. + +## 5. Formalizability + +The problem statement is precise and clearly formalizable: it involves a concrete cardinality bound on a uniform set family, with a concrete intersection condition. There is minimal ambiguity in the mathematical content itself. + +However, there is an **implicit assumption** in the informal statement that is standard in extremal combinatorics but not explicitly stated: the ground set must be large enough relative to k for the conclusion to be meaningful (see Correctness below). This is a formalizability concern arising from the informal statement omitting a well-understood hypothesis. + +**Assessment:** High formalizability, with one implicit hypothesis that must be made explicit. + +## 6. Correctness + +**There is a significant correctness issue: the formalization is missing a lower bound on `n` relative to `k`.** + +The formalization has `hkn : k ≤ n`, but this is insufficient. The theorem as stated is **false** for small values of n: + +**Counterexample:** Let k = 4, n = 5. Then: +- `Nat.choose (n - 2) (k - 2) = C(3, 2) = 3` +- There are `C(5, 4) = 5` four-element subsets of `Fin 5` +- Take any family F of 4 or more such subsets, so `F.card > 3` ✓ +- But any two 4-element subsets of a 5-element set intersect in at least `4 + 4 - 5 = 3` elements +- Therefore **no** two members can intersect in exactly 1 element ✗ + +This counterexample generalizes: for two k-element subsets of [n] to intersect in exactly 1 element, we need `n ≥ 2k - 1` (otherwise any two k-subsets intersect in at least `2k - n ≥ 2` elements). The same issue arises for all n < 2k - 1 where `C(n, k) > C(n-2, k-2)`. + +**Concrete failing cases for k = 4:** +| n | C(n-2, k-2) | C(n, k) | Min intersection | Theorem holds? | +|---|-------------|---------|-----------------|----------------| +| 4 | 1 | 1 | 4 | Vacuously (can't exceed bound) | +| 5 | 3 | 5 | 3 | **FALSE** | +| 6 | 6 | 15 | 2 | **FALSE** | +| 7 | 10 | 35 | 1 | Needs verification | + +**Fix:** Add a hypothesis ensuring n is large enough. The minimal necessary condition is: +``` +(h2k : 2 * k - 1 ≤ n) +``` +This replaces `hkn : k ≤ n` (since `2 * k - 1 ≤ n` implies `k ≤ n` for k ≥ 4). However, Frankl's proof may require a stronger bound (e.g., `n ≥ f(k)` for some function). The precise threshold from Frankl (1977) should be checked; at minimum, `n ≥ 2k - 1` is necessary for the conclusion to be satisfiable. + +**Summary:** The formalization is mathematically incorrect as stated due to a missing hypothesis. The fix is straightforward but requires verifying the exact threshold from the literature. diff --git a/ai-review/703.md b/ai-review/703.md new file mode 100644 index 0000000000..0be51f42d4 --- /dev/null +++ b/ai-review/703.md @@ -0,0 +1,95 @@ +# Erdős Problem 703 — Review + +## 1. Code Reuse + +The definition of `T` (lines 39–42) follows a common `sSup` extremal-number pattern found throughout the codebase: + +- **Erdős 1023** (`ErdosProblems/1023.lean:38–45`): `unionFreeMax` uses the same `sSup {k | ∃ F, F.card = k ∧ ...}` idiom. +- **Erdős 1024** (`ErdosProblems/1024.lean:42–68`): Hypergraph with intersection cardinality constraint `(e₁ ∩ e₂).card ≤ 1`, also using `sSup`/`sInf` for extremal values. +- **Erdős 500** (`ErdosProblems/500.lean:58–65`): Forbidden substructure with `sSup` for extremal number. +- **Erdős 702** (`ErdosProblems/702.lean:43–48`): Closely related problem on forbidden intersection sizes in uniform families, using the same `Finset (Finset (Fin n))` representation. + +No shared utility definition for "maximum family size subject to a pairwise constraint" currently exists. Given that problems 500, 702, 703, 1023, and 1024 all use essentially the same pattern, a generic helper could be considered, though the constraints differ enough that the current standalone definition is reasonable. + +The `FormalConjecturesForMathlib/Combinatorics/SetFamily/VCDim.lean` and `FormalConjecturesForMathlib/Data/Finset/Powerset.lean` files contain relevant set-family machinery but nothing directly applicable. + +## 2. Citations + +The formalization cites only: + +> [FrRo87] Frankl, P. and Rödl, V., *Forbidden intersections*, Trans. Amer. Math. Soc. 300 (1987), 259–286. + +The website (erdosproblems.com/703) lists the following additional references: + +- **[Er75f,p.108]** — original source of the problem +- **[Er76b]**, **[Er81]**, **[Er82e]** — further Erdős references +- **[FrFu84b]** — Frankl and Füredi, optimal construction for large *n* +- **[Fr77b]** — Frankl's result for the case *r* = 1 +- **[FrWi81]** — Frankl and Wilson, connection to unit distance graph chromatic number + +The formalization's citation of [FrRo87] is appropriate since that is the paper proving the conjecture. The original problem source [Er75f,p.108] and the related problem 702 could also be noted for completeness. + +The website also indicates the problem carried a **$250 prize**. + +## 3. Variants + +The website frames the problem more broadly as: "Estimate $T(n,r)$ for $r \geq 2$." The specific conjecture about the $(2 - \delta)^n$ upper bound in the range $\varepsilon n < r < (1/2 - \varepsilon)n$ is the main sub-question, and is what the formalization captures. + +**Not captured:** +- The broader question of estimating $T(n,r)$ outside the range $\varepsilon n < r < (1/2 - \varepsilon)n$. +- Frankl and Füredi's determination of the optimal construction for sufficiently large $n$ [FrFu84b]. +- Frankl's result for the special case $r = 1$ [Fr77b]. +- The website's note relating this to problem 702 (forbidden intersection = 1 in uniform families). + +The formalization captures the principal conjecture (the Frankl–Rödl theorem). The omission of the other variants is acceptable since they are either vague ("estimate $T(n,r)$") or separate results. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring on `T` says "subsets of $\{0, \ldots, n-1\}$" while the module docstring and theorem docstring say "subsets of $\{1, \ldots, n\}$." The `Fin n` representation is $\{0, \ldots, n-1\}$, so the `T` docstring is technically correct and the theorem docstring follows the original problem statement. This minor inconsistency is cosmetic but could confuse a careful reader. Consider using $\{1, \ldots, n\}$ everywhere (matching the original problem statement) with a parenthetical note that this is represented as `Fin n`. +- The `r ≥ 1` precondition mentioned on the website is implicit in the formalization (the hypotheses `ε * n < r` with `ε > 0` ensure `r ≥ 1` for `n ≥ 1`). This is fine. + +## 5. Formalizability + +The problem is **fully formalizable** with essentially no ambiguity. The key concepts — families of subsets, intersection cardinality, maximum family size — all have direct Lean/Mathlib counterparts. + +The only minor source of ambiguity is whether the condition $|A \cap B| \neq r$ applies to all pairs $(A, B)$ including $A = B$, or only to distinct pairs $A \neq B$. See the correctness section below. + +**Ambiguity assessment: Very low.** The mathematical content is precise and the formalization captures it faithfully. + +## 6. Correctness + +### 6.1 Self-intersection condition + +The formalization requires `∀ A ∈ F, ∀ B ∈ F, (A ∩ B).card ≠ r` (line 42). When `A = B`, this reduces to `A.card ≠ r`, meaning no member of the family can have cardinality exactly `r`. + +In the combinatorics literature, the Frankl–Rödl theorem is typically stated for **distinct** pairs $A \neq B$ (as in Problem 702, which explicitly has `A ≠ B` at line 47). Including the $A = B$ case makes the definition of $T(n,r)$ slightly more restrictive. + +**Impact on the theorem:** This does not affect correctness of the theorem statement. The formalization's $T$ is at most the "standard" $T$ (since it's more restrictive), so proving the upper bound $(2-\delta)^n$ for the standard $T$ implies it for this $T$. Conversely, the difference between the two definitions is at most $\binom{n}{r}$ (the number of excluded $r$-element sets), which is polynomial in $n$ — negligible compared to the exponential bound. Either convention yields equivalent results for this problem. + +However, for semantic fidelity to the standard definition, adding `A ≠ B` (or equivalently, a comment noting the convention) would be an improvement. + +### 6.2 Well-definedness of `sSup` + +The set `{k : ℕ | ∃ F : Finset (Finset (Fin n)), F.card = k ∧ ...}` is: +- **Nonempty:** The empty family (k = 0) trivially satisfies the condition. +- **Bounded above:** There are at most $2^{2^n}$ families of subsets of `Fin n`, so $k \leq 2^{2^n}$. + +Therefore `sSup` is well-defined and equals the maximum. This is correct. + +### 6.3 Quantifier structure + +The theorem states: $\forall \varepsilon > 0,\; \exists \delta > 0,\; \forall n\; \forall r,\; \varepsilon n < r < (1/2 - \varepsilon)n \implies T(n,r) < (2-\delta)^n$. + +This matches the website's formulation. The quantifier order (δ depends on ε but not on n or r) is correct and reflects the uniform bound in the Frankl–Rödl theorem. + +### 6.4 Edge cases + +- When $\varepsilon \geq 1/2$, the condition $(1/2 - \varepsilon)n \leq 0$, so no valid $r$ exists and the statement is vacuously true. This is harmless. +- When $n = 0$, no valid $r$ exists. Vacuously true. +- The statement does not require $\delta < 2$. This is fine: the existential quantifier means the prover simply chooses a small enough $\delta$. + +### 6.5 Overall assessment + +**The formalization is mathematically correct.** The only substantive observation is the $A = B$ vs $A \neq B$ distinction in the definition of `T`, which does not affect the truth of the theorem but differs from the standard convention. An experienced combinatorialist would likely flag this as a minor style issue rather than an error. diff --git a/ai-review/704.md b/ai-review/704.md new file mode 100644 index 0000000000..745dcc70d0 --- /dev/null +++ b/ai-review/704.md @@ -0,0 +1,80 @@ +# Review: Erdős Problem 704 + +## 1. Code Reuse + +Several opportunities for code reuse and consolidation exist: + +- **`unitDistanceGraph` vs `UnitDistancePlaneGraph`**: Problem 508 (`FormalConjectures/ErdosProblems/508.lean:42-44`) defines `UnitDistancePlaneGraph : SimpleGraph ℝ²` with `Adj x y := dist x y = 1`. Problem 704 defines its own `unitDistanceGraph` for general ℝⁿ with `Adj x y := x ≠ y ∧ dist x y = 1`. These are logically equivalent (since `dist x y = 1` implies `x ≠ y`), but use different styles. The 704 definition could serve as a generalization of the 508 definition, or the two could be unified so that `UnitDistancePlaneGraph` is defined as `unitDistanceGraph 2`. Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean:93-98` defines yet another `UnitDistancePlaneGraph` for finite point sets. Three separate unit distance graph definitions is fragile. + +- **`chromaticNumber_unitDist` vs `SimpleGraph.chromaticNumber`**: The file defines `chromaticNumber_unitDist` as `sInf {k : ℕ | (unitDistanceGraph n).Colorable k}`, which is essentially reimplementing `SimpleGraph.chromaticNumber` as a `ℕ` value. Mathlib's `SimpleGraph.chromaticNumber` returns `ℕ∞`, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` provides extensive infrastructure around it (notation `χ(G)`, comparison lemmas, etc.). The formalization could use `(unitDistanceGraph n).chromaticNumber` (as `ℕ∞`) directly and cast to `ℝ` where needed, or at minimum document the relationship. This would allow reuse of the `χ(·)` notation and lemmas like `le_chromaticNumber_iff_colorable`. + +- **Related problems**: Problems 508, 705, 706, and 1007 all deal with unit distance graphs and could benefit from a shared definition. Problem 706 (`FormalConjectures/ErdosProblems/706.lean:36-41`) defines `multiDistanceGraph` which generalizes unit distance graphs — `unitDistanceGraph n` could be defined as a special case. + +## 2. Citations + +The formalization's references are mostly accurate but incomplete compared to [erdosproblems.com/704](https://www.erdosproblems.com/704): + +- **[FrWi81]** — Correctly cited: Frankl, P. and Wilson, R. M., *Intersection theorems with geometric consequences*. Combinatorica 1 (1981), 357–368. ✅ +- **[LaRo72]** — Correctly cited: Larman, D. G. and Rogers, C. A., *The realization of distances within sets in Euclidean space*. Mathematika 19 (1972), 1–24. ✅ +- **[Er81]** — Missing. The website lists an original Erdős reference from 1981 that should be included for provenance. +- **[Pr20]** — Missing. Prosanov (2020) provided an alternative proof of the Larman–Rogers upper bound, mentioned on the website but not in the formalization's docstring. Should be added as a reference. + +## 3. Variants + +The formalization captures three aspects: +1. Existence of the limit `lim χ(Gₙ)^{1/n}` (main open question) ✅ +2. Frankl–Wilson lower bound ✅ +3. Larman–Rogers upper bound ✅ + +**Missing variants:** +- **"Does χ(Gₙ) grow exponentially?"** — The website poses this as a distinct question. While the Frankl–Wilson lower bound answers it affirmatively, it could be stated as a separate, simpler theorem (e.g., `∃ c > 1, ∀ᶠ n in atTop, chromaticNumber_unitDist n ≥ c ^ n`). +- **Larman–Rogers conjecture**: The website notes that Larman and Rogers conjectured the truth is `(2^{3/2} + o(1))^n`. This could be stated as a conjectural variant. +- **Trivial upper bound**: The website mentions `χ(Gₙ) ≤ (2 + √n)^n` from cube tiling. This elementary bound could be included. +- **Connection to n=2 case**: The docstring mentions the Hadwiger–Nelson problem but doesn't formalize the relationship (i.e., that `chromaticNumber_unitDist 2 = χ(ℝ²)` from Problem 508). + +## 4. Readability + +The code is generally well-structured. Suggestions: + +- **Redundant guard**: In `unitDistanceGraph`, `Adj x y := x ≠ y ∧ dist x y = 1` — the `x ≠ y` is redundant because `dist x y = 1` implies `x ≠ y` (since `dist x x = 0`). Removing it would simplify the definition and match the style of Problem 508's `UnitDistancePlaneGraph`. However, keeping it makes the `loopless` proof more explicit, so this is a minor style preference. +- **Division by n**: The expression `(1 : ℝ) / (n : ℝ)` in the limit statement could be written as `(n : ℝ)⁻¹` for conciseness, though both are clear. +- **Namespace**: The use of `Erdos704` namespace is clean and consistent with the codebase convention. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem's core components are all well-defined: +- The unit distance graph in ℝⁿ is precisely defined. +- The chromatic number is a standard graph-theoretic quantity. +- The limit question is a precise analytical question. + +The only source of mild ambiguity is the phrase "estimate the chromatic number," which is inherently open-ended. The formalization handles this appropriately by stating specific known bounds and the limit question separately. + +The `(1 + o(1))` notation in the bounds is standard but requires a formalization choice. The current approach (existential constants `C > 0` and `N₀`) correctly captures a weaker-but-implied consequence of the `(1 + o(1))` statements. A more precise formalization would be `Tendsto (fun n => χ(Gₙ) / 1.2^n) atTop (nhds 1)` for the lower bound and similarly for the upper, but the current formulation is reasonable and explicitly documented. + +## 6. Correctness + +**Overall: Mathematically sound with minor concerns.** + +- **`unitDistanceGraph` definition**: Correct. The adjacency relation properly uses Euclidean distance, and the `SimpleGraph` requirements (symmetry, irreflexivity) are satisfied. ✅ + +- **`chromaticNumber_unitDist` definition**: Uses `sInf` on `ℕ`, which returns `0` if the set is empty (i.e., no finite coloring exists). The docstring correctly documents this. Since the unit distance graph in ℝⁿ is known to be finitely colorable (by the Larman–Rogers bound for n ≥ 1, and trivially for n = 0), this is not a practical issue. However, using Mathlib's `chromaticNumber : ℕ∞` would be more robust. ⚠️ Minor concern. + +- **Main theorem (`erdos_704`)**: The `answer(sorry)` pattern correctly encodes the fact that it is unknown whether the limit exists (the answer is either `True` or `False`). The limit formulation `Tendsto (fun n => (chromaticNumber_unitDist n : ℝ) ^ (1/n)) atTop (nhds L)` is mathematically correct for the question "does lim χ(Gₙ)^{1/n} exist?" ✅ + + - **Edge case at n=0**: When `n = 0`, `(1:ℝ)/(0:ℝ) = 0` in Lean, so the term becomes `k^0 = 1` for any `k`. This is harmless since `atTop` only requires eventual behavior. ✅ + +- **Lower bound (`erdos_704.variants.lower_bound`)**: States `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, χ(Gₙ) ≥ C · (6/5)^n`. This is a correct (weaker) consequence of the Frankl–Wilson result `χ(Gₙ) ≥ (1+o(1)) · 1.2^n`. The use of `6/5` for `1.2` is exact in rationals. ✅ + +- **Upper bound (`erdos_704.variants.upper_bound`)**: States `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, χ(Gₙ) ≤ C · 3^n`. This correctly captures `(3+o(1))^n`. Note: `(3+o(1))^n` is equivalent to `C · 3^n` for appropriate C only in the sense that for any ε > 0, `(3+ε)^n / 3^n → ∞`. So the formalization `C · 3^n` is actually *strictly stronger* than `(3+o(1))^n` — it would mean `χ(Gₙ) ≤ C · 3^n` for all large n, while `(3+o(1))^n` only gives `χ(Gₙ) ≤ (3+εₙ)^n` with `εₙ → 0`. The formalization should be `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, χ(Gₙ) ≤ (3 + ε)^n` to accurately capture `(3+o(1))^n`. **This is a correctness issue.** ⚠️ + + Similarly, the lower bound `(1+o(1)) · 1.2^n` is different from `(1.2+o(1))^n`. The formulation `C · (6/5)^n` correctly captures `(1+o(1)) · 1.2^n` (since the `o(1)` multiplies, not exponentiates). So the lower bound is fine. ✅ + +**Summary of concerns:** +| Issue | Severity | +|-------|----------| +| Upper bound formalization is stronger than the cited result | Medium — `C · 3^n` is strictly stronger than `(3+o(1))^n` | +| Custom `sInf`-based chromatic number instead of Mathlib's | Low — functionally equivalent for this use case | +| Missing citations ([Er81], [Pr20]) | Low | +| Missing variants (L-R conjecture, explicit exponential growth) | Low | diff --git a/ai-review/706.md b/ai-review/706.md new file mode 100644 index 0000000000..b07a794694 --- /dev/null +++ b/ai-review/706.md @@ -0,0 +1,97 @@ +# Review: Erdős Problem 706 + +## 1. Code Reuse + +The file defines `multiDistanceGraph` locally in the `Erdos706` namespace. Several related definitions exist in the codebase: + +- **`Erdos508.UnitDistancePlaneGraph`** (`508.lean:42`): Unit distance graph on `ℝ²` (using `EuclideanGeometry` notation). Note this uses a different vertex type (`ℝ²`) than 706's graph (`EuclideanSpace ℝ (Fin 2)`), so they are not directly interchangeable despite being mathematically equivalent spaces. +- **`Erdos704.unitDistanceGraph`** (`704.lean:51`): Unit distance graph on `EuclideanSpace ℝ (Fin n)` for arbitrary dimension. Structurally very similar to 706's definition — the only difference is that 704 checks `dist x y = 1` while 706 checks `dist x y ∈ A`. +- **`SimpleGraph.UnitDistancePlaneGraph`** (`GraphConjectures/Definitions.lean:96`): Unit distance graph on a *subset* `V : Set (EuclideanSpace ℝ (Fin 2))`, used by problem 705. + +The `multiDistanceGraph` in 706 is a natural generalization of 704's `unitDistanceGraph` (specialized to dimension 2 but with multiple distances). Mathematically, `multiDistanceGraph {1}` should be equivalent to the unit distance graph, but this relationship is not documented or proven. This is acceptable since the definitions live in separate namespaces and serve different problems. + +**Verdict:** The local definition is reasonable. A shared utility could unify 704 and 706 (a multi-distance graph in ℝⁿ), but the added generality may not be worth the coupling. + +## 2. Citations + +The website attributes this problem to **[Er81]**, which is not cited in the formalization's docstring. The docstring should include: + +> [Er81] P. Erdős, *Problems and results in combinatorial analysis and combinatorics*, 1981. + +The cross-references to problems [508], [704], [705] match the website's "See also" section. The mention of the Hadwiger–Nelson problem and the bounds `5 ≤ L(1) ≤ 7` are consistent with the website content. + +**Verdict:** Missing the [Er81] citation. + +## 3. Variants + +The website's problem statement asks two things: +1. **"Estimate L(r)"** — a broad, open-ended request. +2. **"In particular, is it true that L(r) ≤ r^{O(1)}?"** — the specific polynomial bound question. + +The formalization captures only (2). The broader estimation question (1) is inherently vague and not readily formalizable as a single theorem, so omitting it is defensible. However, some concrete variants could be added: + +- The **r = 1 case** (Hadwiger–Nelson): already formalized in `508.lean`, but a lemma connecting `multiDistanceGraph {1}` to the unit distance graph would strengthen the cross-reference. +- **Known bounds for general r**: If any bounds are known (e.g., exponential upper bounds), they could be formalized as solved variants. + +**Verdict:** The main question is captured. The omission of the general "estimate" question is acceptable. A variant linking the r = 1 case to problem 508 would be a nice addition. + +## 4. Readability + +The code is clean and well-structured: +- The `multiDistanceGraph` definition is clearly documented with a docstring. +- The theorem docstring explains both the informal question and the formalized interpretation. +- Variable names (`C`, `K`, `r`, `A`) match standard mathematical notation. +- The namespace `Erdos706` keeps definitions contained. + +Minor suggestions: +- The module docstring mentions `5 ≤ L(1) ≤ 7` but the more recent bound is `5 ≤ L(1) ≤ 7` (de Grey 2018 for the lower bound). This is correctly stated. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The specific question "Is L(r) ≤ r^{O(1)}?" is precise and clearly formalizable. The broader "Estimate L(r)" is not. + +The formalization makes a mathematically substantive choice: it works with the **infinite** multi-distance graph on all of `EuclideanSpace ℝ (Fin 2)` rather than with finite point sets as in the original statement. The original defines L(r) as the supremum of χ(G) over all finite point configurations P. These are equivalent by the **de Bruijn–Erdős compactness theorem** (a finite graph is k-colorable iff every finite subgraph is k-colorable, extended to the infinite case). This equivalence is non-trivial but well-established. Working with the infinite graph is arguably cleaner for formalization since it avoids quantifying over finite point sets. + +**Verdict:** High formalizability for the specific polynomial question. The infinite-vs-finite distinction is mathematically sound but relies on an implicit appeal to compactness. + +## 6. Correctness + +### Definition correctness +`multiDistanceGraph` is correct: +- `Adj x y := x ≠ y ∧ dist x y ∈ A` — properly excludes self-loops and captures the distance condition. +- `symm` proof uses `dist_comm` — correct. +- `loopless` proof uses the `x ≠ y` condition — correct. +- The definition does not restrict `A` to positive reals; this is handled in the theorem hypotheses instead. This is a good design choice since `dist x y ≥ 0` and `x ≠ y ⟹ dist x y > 0`, so non-positive elements of A would have no effect. + +### Theorem correctness +The formalization: +```lean +∃ C K : ℕ, ∀ (r : ℕ), 1 ≤ r → ∀ (A : Finset ℝ), A.card = r → + (∀ a ∈ A, (0 : ℝ) < a) → + (multiDistanceGraph (↑A : Set ℝ)).Colorable (C * r ^ K) +``` + +This correctly captures "L(r) ≤ C · r^K for all r ≥ 1": +- `∃ C K : ℕ` — using ℕ for C and K is fine since chromatic numbers are natural and any real polynomial bound can be dominated by a natural-coefficient one for integer arguments ≥ 1. +- `1 ≤ r` — correctly excludes the vacuous r = 0 case (an empty distance set gives a graph with no edges, trivially 1-colorable). +- `A.card = r` and `∀ a ∈ A, 0 < a` — correctly constrains A to be a set of r positive distances. +- `Colorable (C * r ^ K)` — when C = 0, this would require `Colorable 0`, which is false for the nonempty vertex type `EuclideanSpace ℝ (Fin 2)`, so C ≥ 1 is implicitly forced. This is fine. +- The use of `answer(sorry)` correctly wraps this as a yes/no question (the answer is expected to be `True` or `False`). + +### Potential concern +The formalization quantifies over the infinite graph on all of ℝ². As noted in §5, this is equivalent to the original finite formulation by compactness, but a mathematician might initially expect the finite formulation. A comment noting this equivalence would be helpful. + +**Verdict:** Mathematically correct and complete for the polynomial bound question. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Acceptable; local definition is justified | +| Citations | **Missing [Er81] reference** | +| Variants | Main question captured; general "estimate" omitted (acceptable) | +| Readability | Good | +| Formalizability | High for the specific question | +| Correctness | Correct and complete | diff --git a/ai-review/708.md b/ai-review/708.md new file mode 100644 index 0000000000..1c66d60aa0 --- /dev/null +++ b/ai-review/708.md @@ -0,0 +1,111 @@ +# AI Review: Erdős Problem 708 + +## 1. Code Reuse + +The formalization uses standard patterns (`Finset.Icc`, `BigOperators` products, `Finset.max'`, divisibility) that appear across many Erdős problems. Relevant existing code: + +- **Problem 709** (`ErdosProblems/709.lean`): The companion problem from the same Erdős–Surányi paper [ErSu59]. It defines `f(n)` explicitly via `sInf`. Problem 708 could similarly define `g(n)` using `sInf` for consistency and to enable stating known results about `g` (e.g., `g(2) = 2`, `g(3) = 4`), but the current direct formulation is acceptable. +- **`FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean`**: Defines `lcmInterval` for LCM of consecutive integers — related but not directly applicable here. +- **Problem 388** (`ErdosProblems/388.lean`): Defines `consecutiveProduct` — a pattern for products over consecutive integers. +- **Problem 137, 457, 931**: Use `Finset.Ioc`/`Finset.Icc` with products and divisibility in structurally similar ways. + +No existing utility directly encapsulates the "find a subset of an interval whose product is divisible by a given product" pattern. The current formalization is self-contained and does not duplicate existing definitions. + +## 2. Citations + +The website (https://www.erdosproblems.com/708) states: + +> A problem of Erdős and Surányi, who proved that $g(n) \geq (2-o(1))n$, and that $g(3) = 4$. Gallai first considered such problems and observed $g(2) = 2$. +> +> [ErSu59] Erdős, P. and Surányi, J. (1959). + +The formalization's docstring cites: + +> [ErSu59] Erdős, P. and Surányi, J., 1959. + +**Minor discrepancy**: The formalization uses a period after "J." and a comma before 1959, while the website uses parentheses around the year: `(1959)`. This is cosmetic but should be made consistent with the website format for accuracy. The website also notes a **$100 reward** (or 1000 rupees, whichever is greater), which is not mentioned in the formalization (not required, but notable context). + +## 3. Variants + +The formalization captures two variants: + +| Variant | Formalized? | Notes | +|---------|-------------|-------| +| $g(n) \leq (2+o(1))n$ (weak) | ✅ `erdos_708` | Correctly encoded via ∀ε>0, ∃N₀ | +| $g(n) \leq 2n$ (strong) | ✅ `erdos_708.variants.strong` | Direct statement | +| $g(n) \geq (2-o(1))n$ (known lower bound) | ❌ | Proved by Erdős–Surányi; could be a `solved` variant | +| $g(2) = 2$ (Gallai) | ❌ | Known exact value | +| $g(3) = 4$ (Erdős–Surányi) | ❌ | Known exact value | +| Companion problem about $c_n$ | Separate file (709) | Correctly separated | + +**Recommendation**: The known lower bound $g(n) \geq (2-o(1))n$ and the exact values $g(2)=2$, $g(3)=4$ are mathematically significant results mentioned on the website. Including them as `[category research solved]` variants would improve completeness, following the pattern used in Problem 709 which formalizes both known bounds. + +## 4. Readability + +The code is clean and well-structured: + +- The module docstring clearly states the problem, known results, and reference. +- Both theorem statements have individual docstrings explaining the mathematical content. +- The namespace `Erdos708` and `open Nat Finset` / `open scoped BigOperators` are appropriate. +- The weak/strong variant naming convention (`erdos_708` / `erdos_708.variants.strong`) is consistent with the codebase. + +**Minor suggestion**: The docstring for the weak form says "For every $\varepsilon > 0$, there exists $N_0$ such that for all nonempty $A \subseteq \{2, 3, \ldots\}$ with $|A| \geq N_0$..." — this is a correct unfolding of $g(n) \leq (2+o(1))n$ and reads well. + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one subtle point.** + +The problem statement is precise enough to formalize. The key quantities ($g(n)$, the set $A$, the interval $I$, the subset $B$, product divisibility) are all well-defined. The $o(1)$ notation in the weak form is standard and correctly captured by the ε–N₀ formulation. + +**Subtle ambiguity — "consecutive integers" vs. "consecutive natural numbers"**: The original problem says "any set $I$ of $\max(A)$ consecutive integers." The formalization uses `k : ℕ`, restricting intervals to start at non-negative integers. The original likely intends consecutive *positive* integers (or possibly all integers). Since: +- The universal quantifier over `k` means the conjecture must hold for the *hardest* interval, and +- For large `k`, the ℕ and ℤ formulations are equivalent, +- The `k = 0` case is degenerate (0 in the interval makes divisibility trivial), + +this restriction does not affect the mathematical content of the conjecture. The formalization is correct as stated, though adding `1 ≤ k` would be more faithful to the likely intended interpretation. + +## 6. Correctness + +### Interval size +`Finset.Icc k (k + A.max' hA - 1)` contains exactly `A.max' hA` elements when `A.max' hA ≥ 1` (which holds since all elements of $A$ are ≥ 2). This correctly encodes "max(A) consecutive integers." ✅ + +### Weak form (erdos_708) +The statement: +``` +∀ ε : ℝ, 0 < ε → ∃ N₀ : ℕ, ∀ (A : Finset ℕ) (hA : A.Nonempty), + N₀ ≤ A.card → (∀ a ∈ A, 2 ≤ a) → ∀ (k : ℕ), + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + (B.card : ℝ) ≤ (2 + ε) * A.card ∧ + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) +``` + +This says: for any ε > 0, for sufficiently large sets A (with |A| ≥ N₀), and any interval of max(A) consecutive naturals, there exists B in that interval with |B| ≤ (2+ε)|A| and prod(A) | prod(B). This correctly captures $g(n) \leq (2+o(1))n$. ✅ + +**Note**: The bound is on `A.card` (= n), not on `A.max'`. The original g(n) is defined in terms of n = |A|, and the formalization quantifies over all A with |A| ≥ N₀. This is correct because N₀ depends only on ε, not on A. ✅ + +### Strong form (erdos_708.variants.strong) +``` +∀ (A : Finset ℕ) (hA : A.Nonempty), (∀ a ∈ A, 2 ≤ a) → ∀ (k : ℕ), + ∃ B : Finset ℕ, B ⊆ Finset.Icc k (k + A.max' hA - 1) ∧ + B.card ≤ 2 * A.card ∧ + (∏ a ∈ A, a) ∣ (∏ b ∈ B, b) +``` + +This says: for ALL nonempty A ⊆ {2,3,...} and all k, there exists B with |B| ≤ 2|A| in the interval. This correctly captures $g(n) \leq 2n$. ✅ + +### Potential edge case: natural number subtraction +In `k + A.max' hA - 1`, since all values are in ℕ and `A.max' hA ≥ 2`, we have `k + A.max' hA ≥ k + 2 > 0`, so the subtraction does not underflow. ✅ + +### Overall correctness assessment +The formalization is **mathematically correct** for both variants. The only minor concern is the ℕ vs ℤ domain for the interval start point, which does not affect the mathematical content of the conjecture (see Section 5). + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ✅ Good | Self-contained; could define g(n) via sInf like 709 but not required | +| Citations | ⚠️ Minor | Year format differs from website (`1959.` vs `(1959)`) | +| Variants | ⚠️ Incomplete | Missing known results: g(n) ≥ (2-o(1))n, g(2)=2, g(3)=4 | +| Readability | ✅ Good | Clean, well-documented | +| Formalizability | ✅ Good | Precise statement with minor domain subtlety (ℕ vs ℤ) | +| Correctness | ✅ Correct | Both forms accurately capture the intended conjectures | diff --git a/ai-review/709.md b/ai-review/709.md new file mode 100644 index 0000000000..49218dbee4 --- /dev/null +++ b/ai-review/709.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 709 + +## 1. Code Reuse + +**Opportunities identified:** + +- **Problem 710** (`FormalConjectures/ErdosProblems/710.lean`) uses a nearly identical `sInf` pattern with `Function.Injective g` and divisibility constraints. Problem 710 uses `Fin n → ℕ` with `Function.Injective g` as its assignment function, which is arguably cleaner than 709's `g : ℕ → ℕ` with a manual injectivity condition restricted to elements of `A`. However, since 709 takes an arbitrary finite set `A ⊆ {2, 3, ...}` rather than the fixed set `{1, ..., n}`, using a total function `g : ℕ → ℕ` is a reasonable design choice. An alternative would be to use a subtype `↥A → ℕ` with `Function.Injective`, which would more closely mirror 710's style. + +- **Problem 708** (`FormalConjectures/ErdosProblems/708.lean`) uses the same interval construction `Finset.Icc k (k + A.max' hA - 1)` and the same quantifier structure over `A : Finset ℕ` with `hA : A.Nonempty`. The interval pattern could potentially be factored into a shared definition across 708/709, though this is minor. + +- **Problem 711** (`FormalConjectures/ErdosProblems/711.lean`) demonstrates the same `sInf` + divisibility + injectivity pattern. + +- No existing utility lemmas in `FormalConjecturesForMathlib` were identified that would simplify the current definition or theorem statements. + +## 2. Citations + +**Issue found.** The [erdosproblems.com/709](https://www.erdosproblems.com/709) website lists two references: + +- **[ErSu59]** — Erdős, P. and Surányi, J. (1959) +- **[Er92c]** — Erdős, P. (1992) + +The formalization's module docstring only mentions `[ErSu59]`. The reference `[Er92c]` is missing and should be added. The full citation for [Er92c] should be included once the exact paper details are determined. + +## 3. Variants + +**Partially captured.** + +- The known lower bound `(log n)^c ≪ f(n)` is formalized as `erdos_709`. ✓ +- The known upper bound `f(n) ≪ n^{1/2}` is formalized as `erdos_709.variants.upper`. ✓ +- **Missing:** The original problem asks to "obtain good bounds for f(n), **or even an asymptotic formula**." Problem 710 includes an asymptotic formula variant using `Filter.Tendsto`, but 709 does not have an analogous open-ended variant. This could be added as a `sorry`-based `answer(sorry)` statement, similar to how 710 handles its asymptotic question. +- The website marks the problem as **OPEN**, which is consistent with the fact that no tight asymptotic formula is known. The known bounds (`erdos_709` and `erdos_709.variants.upper`) are correctly tagged `category research solved`. + +## 4. Readability + +**Generally good, with minor suggestions:** + +- The injectivity condition `(∀ a₁ ∈ A, ∀ a₂ ∈ A, a₁ ≠ a₂ → g a₁ ≠ g a₂)` is verbose. Using `Set.InjOn g ↑A` would be more idiomatic and concise: + ```lean + Set.InjOn g ↑A + ``` + This is equivalent and mirrors standard Mathlib style. + +- The definition of `f` and the two theorem statements are clearly structured and the docstrings are informative. The module docstring provides good context. + +- The `open Nat Finset` at the top is appropriate and keeps the code uncluttered. + +## 5. Formalizability + +**Assessment: Mostly formalizable, with moderate ambiguity.** + +The known bounds `(log n)^c ≪ f(n) ≪ n^{1/2}` are precise mathematical statements and are directly formalizable. The core definition of `f(n)` is also precise. + +The main source of ambiguity in the original problem is the open-ended request to "obtain good bounds for f(n), or even an asymptotic formula." This is inherently informal — "good bounds" is subjective. The formalization sidesteps this appropriately by only formalizing the specific known results. + +One subtlety: the original problem says "in any interval $I$ of $f(n) \cdot \max(A)$ consecutive integers." This is over the integers $\mathbb{Z}$, while the formalization restricts to natural numbers (`∀ k : ℕ`). See the Correctness section for discussion. + +## 6. Correctness + +**Assessment: Mostly correct, with two issues to flag.** + +### 6a. Natural numbers vs. integers (minor) + +The original problem statement considers intervals of consecutive **integers**, while the formalization quantifies over `k : ℕ`, restricting to intervals `[k, k + m·max(A) - 1]` of natural numbers. This means: + +- Intervals containing negative integers are excluded from the formalization. +- The interval `[0, m·max(A) - 1]` includes 0, and `a ∣ 0` holds for all `a`, giving a "free" assignment target. This could make the natural-number version of `f(n)` potentially smaller than the integer version. + +In practice, this distinction is unlikely to affect the asymptotic bounds, since the hardest cases for the universally quantified `k` involve intervals far from 0. However, for full mathematical precision, the definition could be strengthened to quantify over `k : ℤ` and use an integer interval, or at minimum exclude 0 as an assignment target. + +### 6b. Natural number subtraction (minor technical issue) + +The interval bound `k + m * A.max' hA - 1` uses natural number subtraction. When `m = 0`, this becomes `k + 0 - 1 = k - 1` (which underflows to 0 when `k = 0`). This means `Finset.Icc 0 0 = {0}` for `m = 0, k = 0`, which has cardinality 1 rather than the intended 0. However, this edge case does not affect the `sInf` in any meaningful way — `m = 0` will not satisfy the condition for `n ≥ 2`, and for `n ≤ 1` the problem is trivial. A cleaner alternative would be to use `Finset.Ico k (k + m * A.max' hA)` (half-open interval), which avoids the subtraction entirely and gives the same set of `m * max(A)` consecutive integers. + +### 6c. Bound formulations (correct) + +- The lower bound `∃ c > 0, ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, f(n) ≥ C · (log n)^c` correctly captures `(log n)^c ≪ f(n)`. +- The upper bound `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, f(n) ≤ C · n^(1/2)` correctly captures `f(n) ≪ n^{1/2}`. +- Both are correctly tagged as `category research solved` with `AMS 5 11`. + +### 6d. Definition well-formedness (correct) + +The `sInf` over `ℕ` with `Nat.sInf` returns 0 when the set is empty, which would correspond to no valid `m` existing. For `n ≥ 2`, there always exists some sufficiently large `m` that works (e.g., `m = n` trivially), so the set is nonempty and `sInf` returns a meaningful value. + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code reuse | Minor opportunity | Could use `Set.InjOn`; shared interval pattern with 708 | +| Citations | **Missing [Er92c]** | Only [ErSu59] is cited; website lists [Er92c] too | +| Variants | Partial | Known bounds captured; asymptotic formula variant missing | +| Readability | Good | `Set.InjOn` would be more concise for injectivity | +| Formalizability | Good | Known bounds are precise; "good bounds" is inherently informal | +| Correctness | Good with caveats | ℕ vs ℤ domain; nat subtraction in interval bound; both minor | diff --git a/ai-review/71.md b/ai-review/71.md new file mode 100644 index 0000000000..9d86feed0e --- /dev/null +++ b/ai-review/71.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 71 + +## 1. Code Reuse + +Several definitions in the codebase duplicate functionality used inline in `71.lean`: + +- **Cycle lengths**: Both `Erdos84.cycleSpectrum` (`84.lean:50`) and `Erdos752.cycleLengths` (`752.lean:38`) define the identical set `{n | ∃ v, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = n}`. Problem 71 inlines this pattern in its conclusion rather than referencing a shared definition. A shared `cycleLengths` definition (or the existing ones) could be extracted and reused across problems 58, 65, 71, 72, 84, 751, and 752. + +- **Average degree**: `SimpleGraph.averageDegree` is defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Invariants.lean:171` as `(∑ v, (G.degree v : ℚ)) / Fintype.card α`. Problem 71 uses the equivalent formulation `2 * |E| / |V|` over `ℝ` inline. These are mathematically equal by the handshaking lemma but differ in type (`ℚ` vs `ℝ`). The inline version is acceptable, but the two representations should ideally converge. + +- **Problem 72** (`72.lean`) has nearly identical structure — average degree threshold implying cycle existence — and could share infrastructure with Problem 71. + +## 2. Citations + +The formalization cites: + +> [Bo77] Bollobás, B., *Cycles modulo k*. Bull. London Math. Soc. 9 (1977), 97-98. + +The website ([erdosproblems.com/71](https://www.erdosproblems.com/71)) additionally lists: + +- **[Er82e]** — Erdős source where the conjecture is credited to Erdős and Burr +- **[Er95]** — Additional Erdős reference +- **[Er97b]** — Additional Erdős reference + +These three Erdős references are missing from the formalization's docstring. They should be included, at minimum [Er82e] as the original source of the conjecture. + +The website also notes **"See also Problem 72"**, which is closely related (density-zero cycle sets with average degree conditions). This cross-reference is absent from the formalization. + +## 3. Variants + +The formalization captures the main statement but misses one natural variant: + +- **Optimal constant**: The website notes that "the optimal dependence of the constant $c(P)$ on $P$ remains unknown." A variant stating a conjectured or known bound on $c$ as a function of $a$ and $d$ could be added, though this may be too open-ended to formalize precisely at present. + +- **Relationship to Problem 72**: Problem 72 asks whether a density-zero set $A$ exists with the same average-degree-implies-cycle property. Since every infinite AP has positive density, Problem 71 is in some sense a special case of the broader theme. This relationship is worth noting but does not constitute a missing variant per se. + +No other variants are documented on the website. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- **Naming the AP membership predicate**: The nested `∃ k : ℕ, m = a + k * d` could be replaced by a named predicate (e.g., `m ∈ Set.range (fun k => a + k * d)`) or use the existing `Set.IsAPOfLengthWith` from `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`, though this may be over-engineering for a single use. + +- **Docstring naming**: The docstring labels this the "Erdős-Burr conjecture." This name is more commonly associated with a different conjecture (about Ramsey numbers of bounded-degree graphs). The website does not use this name — it simply says the problem is "credited to Erdős and Burr." Consider removing or qualifying the name to avoid confusion. + +- **Average degree comment**: The inline comment "The average degree of a graph $G$ on $n > 0$ vertices is $2|E(G)|/n$" is helpful context. + +## 5. Formalizability + +**Assessment: Fully formalizable with low ambiguity.** + +The problem statement on the website is precise: + +> "Is it true that for every infinite arithmetic progression $P$ which contains even numbers there is some constant $c = c(P)$ such that every graph with average degree at least $c$ contains a cycle whose length is in $P$?" + +All components are well-defined: +- "Infinite arithmetic progression" → parametrized by $a, d$ with $d \geq 1$ +- "Contains even numbers" → $\exists k, 2 \mid (a + kd)$ +- "Average degree" → standard graph-theoretic quantity +- "Cycle whose length is in $P$" → standard notion + +The only minor source of ambiguity is whether "graph" means finite or infinite. The formalization restricts to finite graphs (`Fintype V`), which is the standard interpretation for average degree problems in extremal graph theory. This is correct. + +## 6. Correctness + +**Assessment: Correct and complete, with one cosmetic concern.** + +The formalization is mathematically sound: + +- **Arithmetic progression**: `{a + k * d | k : ℕ}` with `d ≥ 1` correctly represents an infinite AP over the naturals. The infiniteness is automatic since distinct $k$ values yield distinct elements when $d \geq 1$. + +- **Even element condition**: `∃ k : ℕ, Even (a + k * d)` is equivalent to "$P$ contains even numbers." This is the correct necessary condition — without it, one could take $P = \{1, 3, 5, \ldots\}$ and complete bipartite graphs $K_{n,n}$ (which are bipartite, hence have no odd cycles) would be counterexamples with arbitrarily large average degree. + +- **Average degree**: `(2 * G.edgeFinset.card : ℝ) / (Fintype.card V : ℝ)` equals $2|E|/|V|$, the standard definition. The guard `0 < Fintype.card V` prevents division by zero. + +- **Cycle existence**: The conclusion `∃ m, (∃ k, m = a + k * d) ∧ ∃ v, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = m` correctly asserts a cycle whose length belongs to the AP. Mathlib's `Walk.IsCycle` enforces length $\geq 3$ (a cycle must visit at least 3 distinct vertices), so degenerate cases (e.g., $m = 0, 1, 2$) are automatically excluded. + +- **Universality over graphs**: The formalization quantifies over all types `V` with `Fintype` and `DecidableEq`, which covers all finite simple graphs up to isomorphism. This is the correct level of generality. + +**Cosmetic concern**: The docstring calls this the "Erdős-Burr conjecture," which typically refers to a conjecture about Ramsey numbers (proved by Lee in 2017). This could confuse readers familiar with that more famous conjecture. The website attributes it to Erdős and Burr but does not use the compound name. + +**Overall**: The formalization is a faithful and correct translation of the problem. No mathematical flaws identified. diff --git a/ai-review/710.md b/ai-review/710.md new file mode 100644 index 0000000000..5c2dbe0488 --- /dev/null +++ b/ai-review/710.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 710 + +## 1. Code Reuse + +**Problem 711 defines a strict generalization.** The function `Erdos711.f n m` (in `ErdosProblems/711.lean:40–45`) is identical in structure to `erdos710F n` (in `ErdosProblems/710.lean:47–52`), and the 711 docstring explicitly states "When $m = n$ this coincides with the function in Problem 710." Both definitions use the same `sInf` over a set of `f` values with an injective `Fin n → ℕ` function satisfying interval and divisibility constraints. + +**Recommendation:** `erdos710F n` should be defined as `Erdos711.f n n` (or vice versa), rather than duplicating the definition. This would make the mathematical relationship explicit and reduce maintenance burden. At minimum, a lemma `erdos710F n = Erdos711.f n n` should be stated. + +**Other reusable patterns:** +- Problem 709 (`ErdosProblems/709.lean`) uses an analogous `sInf` + injective assignment + divisibility pattern. +- `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean` provides `≫` and `≪` notation for asymptotic bounds, though the current formalization uses explicit ε-N formulations instead. + +## 2. Citations + +The Lean file cites: +- **[ErPo80]** with full bibliographic details — matches the website. ✓ + +**Missing citation:** The website also references **[Er92c]**, in which Erdős offered a prize of 2000 rupees (1992 value) for an asymptotic formula. This reference is not mentioned in the Lean file. While not strictly necessary for the mathematics, it provides useful historical context and should be included for completeness per the project's documentation standards. + +## 3. Variants + +The formalization captures three statements: +1. **`erdos_710`** — The main open problem: obtain an asymptotic formula for $f(n)$, formalized as $f(n)/g(n) \to 1$ for an unknown function $g$ (using `answer(sorry)`). ✓ +2. **`erdos_710.variants.lower`** — The Erdős–Pomerance lower bound $f(n) \geq (2/\sqrt{e} - \varepsilon) \cdot n \cdot \sqrt{\log n / \log\log n}$. ✓ +3. **`erdos_710.variants.upper`** — The Erdős–Pomerance upper bound $f(n) \leq (1.7399 + \varepsilon) \cdot n \cdot \sqrt{\log n}$. ✓ + +**Assessment:** All variants from the website appear to be captured. The cross-reference to Problem 711 is noted in the docstring ("See also [711]"). No missing variants identified. + +## 4. Readability + +The code is well-structured and readable: +- The definition of `erdos710F` clearly separates the four conditions (injectivity, lower bound of interval, upper bound of interval, divisibility). +- The docstrings are thorough and include the LaTeX formulation. +- The use of `Fin n → ℕ` with `i.val + 1` to represent 1-indexed $a_k$ is a standard Lean idiom. +- The namespace `Erdos710` keeps the scope clean. + +**Minor suggestions:** +- The exponent `((1 : ℝ) / 2)` appears multiple times; a local notation or `Real.sqrt` could improve readability, though this is a stylistic preference. +- The comment on the upper bound theorem explaining why 1.7399 is used instead of 1.7398... is helpful and appreciated. + +## 5. Formalizability + +**Assessment: Highly formalizable; low ambiguity.** + +The original problem statement ("obtain an asymptotic formula for $f(n)$") is inherently open-ended — it asks for a formula rather than a yes/no answer. The formalization handles this well by using `answer(sorry)` as a placeholder for the unknown asymptotic function, with the statement asserting $f(n)/g(n) \to 1$. + +The definition of $f(n)$ itself is completely precise: +- The interval $(n, n+f)$ is unambiguous (open interval of integers, i.e., strict inequalities). +- The divisibility condition $k \mid a_k$ for $1 \leq k \leq n$ is precise. +- "Distinct integers" is formalized via `Function.Injective`. +- "Minimal" is formalized via `sInf`. + +The only mild formalization subtlety is the use of `sInf` on `ℕ`: if the defining set were empty, `sInf ∅ = 0` in Lean. However, for all $n$, a sufficiently large interval $(n, n+f)$ contains distinct multiples of $1, 2, \ldots, n$, so the set is always non-empty and this is not an issue. + +## 6. Correctness + +### Definition (`erdos710F`) +The definition correctly formalizes $f(n)$ as described in the problem: +- **Interval:** `n < g i` and `g i < n + f` correctly encode $a_k \in (n, n+f)$ as an open interval. ✓ +- **Distinctness:** `Function.Injective g` ensures all $a_k$ are distinct. ✓ +- **Divisibility:** `(i.val + 1) ∣ g i` correctly maps `Fin n` (0-indexed) to the 1-indexed condition $k \mid a_k$. ✓ +- **Minimality:** `sInf` correctly selects the minimal such $f$. ✓ + +### Main theorem (`erdos_710`) +The formulation as `Filter.Tendsto (fun n => f(n) / g(n)) atTop (nhds 1)` is the standard way to express "$f(n)$ is asymptotic to $g(n)$." The use of `answer(sorry)` for the unknown asymptotic function is appropriate for an open problem. ✓ + +### Lower bound (`erdos_710.variants.lower`) +- `2 / (Real.exp 1) ^ ((1 : ℝ) / 2)` correctly represents $2/\sqrt{e}$. ✓ +- `(Real.log n / Real.log (Real.log n)) ^ ((1 : ℝ) / 2)` correctly represents $\sqrt{\log n / \log\log n}$. ✓ +- The $\varepsilon$-$N_0$ formulation correctly captures the "$o(1)$" term in the original bound. ✓ + +### Upper bound (`erdos_710.variants.upper`) +- The bound uses $\sqrt{\log n}$, which matches the Erdős–Pomerance paper [ErPo80]. ✓ +- **Note:** The WebFetch extraction from erdosproblems.com appears to render the upper bound as $n(\log\log n)^{1/2}$, but this is almost certainly a rendering/extraction error on the website (or in parsing), since $n\sqrt{\log\log n}$ would be *smaller* than the lower bound $n\sqrt{\log n / \log\log n}$ for large $n$, which is impossible. The formalization's use of $\sqrt{\log n}$ is consistent with the original paper and mathematically correct. ✓ +- The use of $1.7399$ as a rational upper bound on the constant $1.7398\ldots$ is a sound pragmatic choice that slightly weakens the bound but maintains correctness, and is well-documented. ✓ + +### Category tags +- `erdos_710`: tagged `research open` — matches the website status ("Open"). ✓ +- `erdos_710.variants.lower` and `.upper`: tagged `research solved` — correct, as these are proven results from [ErPo80]. ✓ + +**Overall correctness assessment: No mathematical errors identified. The formalization is correct and complete.** diff --git a/ai-review/711.md b/ai-review/711.md new file mode 100644 index 0000000000..46a8733421 --- /dev/null +++ b/ai-review/711.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 711 + +## 1. Code Reuse + +**Problem 710 shares nearly identical structure.** The definition `Erdos711.f n m` generalizes `Erdos710.erdos710F n` — specifically, `Erdos711.f n n` should equal `Erdos710.erdos710F n`. Both use the same `sInf` pattern over `Fin n → ℕ` with `Function.Injective`, interval bounds, and divisibility constraints. Currently each file defines its own version independently. + +**Recommendation:** Factor out a shared definition (e.g., in a common utility or in 711.lean itself) and define `erdos710F n := f n n`. This would make the stated relationship between the two problems machine-checkable and reduce duplication. The docstring on line 39 of 711.lean already notes this coincidence, but it is not formalized. + +**Other related patterns in the codebase:** +- Problem 650 (`divMatchCount`) uses a similar `sSup`/`sInf` pattern with `Fin`-indexed injective functions and divisibility. +- `FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` provides `lcmInterval` which could support divisibility arguments. +- `FormalConjecturesForMathlib/Order/Interval/Finset/Nat.lean` has interval cardinality lemmas. + +No existing utility directly replaces the current definition, but shared infrastructure could benefit both 710 and 711. + +## 2. Citations + +**Website (erdosproblems.com/711) states:** +- Original source: Erdős and Pomerance [ErPo80] — *Matching the natural numbers up to n with distinct multiples in another interval*. Nederl. Akad. Wetensch. Proc. Ser. A 83 (= Indag. Math. 42) (1980), 147–161. +- Erdős [Er92c, p.36] offered 1000 rupees for solutions to either part. +- Van Doorn [vD26] solved Part 2. +- Related: Problem [710]. + +**Formalization cites:** +- `[ErPo80] Erdős, P. and Pomerance, C., 1980.` — Abbreviated; the full citation is given in 710.lean but not in 711.lean. +- `[vD26] van Doorn, 2026.` — No full citation details. + +**Issues:** +- The `[ErPo80]` citation in 711.lean is truncated compared to the full reference in 710.lean. Should include the paper title and journal. +- The `[Er92c]` reference (1000 rupees offer) from the website is not mentioned. This is minor but could be included as historical context. +- `[vD26]` lacks a full reference (title, venue). This may be acceptable if it's a preprint, but should be made as complete as possible. + +## 3. Variants + +The website states two parts: +1. Prove that $\max_m f(n,m) \leq n^{1+o(1)}$. +2. Prove that $\max_m (f(n,m) - f(n,n)) \to \infty$. + +**Both parts are captured** by `erdos_711` (Part 1) and `erdos_711.variants.divergence` (Part 2). + +**No missing variants.** The website does not list additional sub-questions beyond these two. The known bounds ($\max_m f(n,m) \ll n^{3/2}$ from Erdős–Pomerance, and $f(n,m) - f(n,n) \gg (\log n / \log \log n) \cdot n$ from van Doorn) are mentioned in docstrings but not separately formalized, which is a reasonable choice since Part 1 subsumes the $n^{3/2}$ bound and Part 2 subsumes the divergence result. + +One could consider formalizing the stronger quantitative result of van Doorn as a separate variant (analogous to how 710.lean formalizes both the lower and upper bounds separately), but this is optional. + +## 4. Readability + +**Overall: Good.** The file is clean, well-structured, and follows the conventions of the codebase. + +**Minor suggestions:** +- The namespace `Erdos711` and function name `f` are fine within the namespace, but the generic name `f` could cause confusion if the namespace is opened alongside other problem files. Problem 710 uses the more descriptive `erdos710F`. Consider `erdos711F` for consistency, though the namespacing does protect against collisions. +- The docstrings clearly explain both the mathematical definition and the formalization choices. +- The `category research open` tag on Part 1 and `category research solved` on Part 2 correctly reflect the current status (Part 2 solved by van Doorn, Part 1 still open). + +## 5. Formalizability + +**Assessment: High precision, clearly formalizable.** + +The problem is well-defined: $f(n,m)$ is the minimum of a set of natural numbers satisfying explicit combinatorial constraints. The formalization correctly uses `sInf` over a well-specified set. + +**One subtle point:** The set over which `sInf` is taken could be empty for degenerate inputs (e.g., $n = 0$ or very small intervals). In Lean 4 / Mathlib, `sInf ∅ = 0` for `ℕ`, so `f 0 m = 0` for all `m`. This is mathematically benign (the empty matching trivially works in any interval of width 0). For $n \geq 1$, the set is always nonempty since one can always find a sufficiently large interval containing multiples of $1, 2, \ldots, n$. This is fine. + +**Ambiguity level: Low.** The problem statement on the website is precise enough that there is essentially one natural formalization. + +## 6. Correctness + +**Definition of `f`:** Correct. The set `{f : ℕ | ∃ g : Fin n → ℕ, Function.Injective g ∧ (∀ i, m < g i) ∧ (∀ i, g i < m + f) ∧ (∀ i, (i.val + 1) ∣ g i)}` accurately captures: find $n$ distinct integers $a_1, \ldots, a_n$ in the open interval $(m, m+f)$ with $k \mid a_k$. The use of `i.val + 1` correctly maps `Fin n` (which is 0-indexed) to the 1-indexed condition $k \mid a_k$ for $k = 1, \ldots, n$. + +**Part 1 (`erdos_711`):** The formalization `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ∀ m, f(n,m) ≤ n^{1+ε}` correctly captures $\max_m f(n,m) \leq n^{1+o(1)}$. The $o(1)$ notation means "for any $\varepsilon > 0$, eventually $\leq n^{1+\varepsilon}$", which is exactly what is stated. The `∀ m` quantifier correctly captures the $\max_m$ since the bound holds uniformly. **Correct.** + +**Part 2 (`erdos_711.variants.divergence`):** The formalization `∀ C, ∃ N₀, ∀ n ≥ N₀, ∃ m, f n m ≥ f n n + C` correctly captures $\max_m (f(n,m) - f(n,n)) \to \infty$. **Correct.** + +**Status tags:** Part 1 is `open` and Part 2 is `solved` — both match the website. **Correct.** + +**No mathematical flaws identified.** The formalization is faithful to the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could share definition with 710; currently duplicated | +| Citations | [ErPo80] should include full reference; [vD26] lacks details | +| Variants | Complete — both parts captured | +| Readability | Good; minor naming consideration | +| Formalizability | High — problem is precise and unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/712.md b/ai-review/712.md new file mode 100644 index 0000000000..4411bf24b5 --- /dev/null +++ b/ai-review/712.md @@ -0,0 +1,116 @@ +# AI Review: Erdős Problem 712 + +## 1. Code Reuse + +Problem 712's definitions (`IsKkrFree`, `exrKkr`) are the general versions from which Problem 500's definitions (`IsK43Free`, `ex3K43`) are exact specializations with `r = 3`, `k = 4`. The relationship is already noted in the Problem 500 review. Relevant codebase overlap: + +- **Problem 500 (`ErdosProblems/500.lean`):** `IsK43Free` is equivalent to `IsKkrFree 3 4`; `ex3K43 n` is equivalent to `exrKkr 3 4 n`. Problem 500 could import and specialize 712's definitions to eliminate duplication. +- **Problem 1020 (`ErdosProblems/1020.lean`):** Defines `IsRUniform H r` as `∀ e ∈ H, e.card = r`, which is exactly the first conjunct of `IsKkrFree`. This could be factored into a shared utility. +- **Ramsey (`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`):** Works with r-subsets of `Finset (Fin m)` in a similar pattern (coloring functions on finsets), but the structural differences make direct reuse impractical. + +**Recommendation:** Extract `IsRUniform` (the `∀ e ∈ H, e.card = r` condition) into a shared definition used by Problems 500, 712, and 1020. Define `IsK43Free` as an abbreviation for `IsKkrFree 3 4`. + +## 2. Citations + +The website ([erdosproblems.com/712](https://www.erdosproblems.com/712)) lists three references: +- [Er71, p.104] +- [Er74c, p.76] +- [Er81] + +The formalization's module docstring does **not** include explicit citation tags for these references, unlike Problem 500 which lists `[Er61]`, `[Er71]`, `[Er74c]`, `[Er81]`, and `[Ra10]` with brief descriptions. For consistency, Problem 712 should include these references with at least minimal bibliographic detail, e.g.: + +``` +[Er71] Erdős, P., *Topics in combinatorial analysis*, Proc. Second Louisiana Conf. on +Combinatorics, Graph Theory and Computing (1971), 2–20. + +[Er74c] Erdős, P., *Problems and results on combinatorial number theory III* (1974). + +[Er81] Erdős, P., *Combinatorial problems and results* (1981). +``` + +The cross-reference to Problem 500 ("See also [500] for the case r = 3 and k = 4") is present and correct. + +## 3. Variants + +The website describes a single problem: determine the Turán density for the complete r-uniform hypergraph K_k^r, for all k > r > 2. The formalization captures this fully via the universal quantification `∀ k r : ℕ, 2 < r → r < k → ...`. + +The website also notes: +- The $500 prize is for determining the value for **any fixed** k > r > 2. +- The $1000 prize is for "clearing up the whole set of problems." + +The formalization's `∀ k r` quantification corresponds to the $1000 "whole set" version. One could argue that the $500 version (for a single fixed pair (k, r)) should also be formalized as a separate, weaker statement. However, the stronger universal statement subsumes it, and the docstring correctly documents both prizes. + +**No missing variants**, though a per-pair version could be added for completeness. + +## 4. Readability + +The code is clean and well-structured: +- Clear module docstring with LaTeX notation explaining the problem, known results (Turán's theorem for r = 2), prize amounts, and cross-reference to Problem 500. +- Definitions are concise and use standard Mathlib idioms (`Finset.powersetCard`, `sSup`). +- The namespace `Erdos712` scopes definitions appropriately. +- `open Finset Filter` is appropriate for the imports used. + +Minor suggestions: +- The docstring for `IsKkrFree` could note that the first condition enforces r-uniformity and the second enforces K_k^r-freeness, to help readers unfamiliar with hypergraph Turán theory. +- The theorem's docstring uses an em-dash "—" consistently with other files. + +**Overall readability: Good.** + +## 5. Formalizability + +The problem asks to "determine" a value — it is a "find the answer" problem rather than a "prove/disprove" problem. This poses an inherent formalization challenge: the answer is not conjectured for any k > r > 2, unlike the (3, 4) case where Turán conjectured 5/9. + +The formalization handles this via `answer(sorry)`, which is the project's standard mechanism for open determination problems. The `∃ L, Tendsto ... (nhds L) ∧ L = answer(sorry)` pattern bundles: +1. **Existence** of the limit (which is known, by Katona–Nemetz–Simonovits compactness arguments for Turán densities). +2. **Determination** of the limit's value (which is open). + +This bundling is appropriate. The problem as stated on the website is precise and unambiguous: the definitions of r-uniform hypergraph, complete r-uniform hypergraph K_k^r, and the extremal number ex_r(n, K_k^r) are completely standard in extremal combinatorics. + +**Assessment: Fully formalizable with no ambiguity.** The only interpretive choice — bundling existence with determination — is standard and mathematically sound. + +## 6. Correctness + +### Definition `IsKkrFree` +```lean +def IsKkrFree {n : ℕ} (r k : ℕ) (H : Finset (Finset (Fin n))) : Prop := + (∀ e ∈ H, e.card = r) ∧ + ∀ S : Finset (Fin n), S.card = k → ¬(S.powersetCard r ⊆ H) +``` +- First conjunct: correctly enforces r-uniformity. ✓ +- Second conjunct: correctly states that no k-vertex set has all C(k, r) of its r-element subsets present in H. This is the standard definition of K_k^r-freeness for r-uniform hypergraphs. ✓ +- `S.powersetCard r` correctly produces all r-element subsets of S, and `⊆ H` checks they are all edges. ✓ + +### Definition `exrKkr` +```lean +noncomputable def exrKkr (r k n : ℕ) : ℕ := + sSup {m : ℕ | ∃ H : Finset (Finset (Fin n)), IsKkrFree r k H ∧ H.card = m} +``` +- Takes the supremum over cardinalities of K_k^r-free r-uniform hypergraphs on Fin n. ✓ +- The set is nonempty: the empty hypergraph satisfies `IsKkrFree r k ∅` (vacuously r-uniform, and no r-subset of any k-set is in ∅), giving m = 0. ✓ +- The set is bounded above by C(n, r) (the total number of r-element subsets of Fin n). ✓ +- Therefore `sSup` on `ℕ` (which uses `ConditionallyCompleteLattice`) correctly computes the maximum. ✓ + +**Edge cases:** +- If k > n: no k-element subset of Fin n exists, so the K_k^r-freeness condition is vacuous. Then `exrKkr r k n = C(n, r)`. This is mathematically correct (every r-uniform hypergraph is vacuously K_k^r-free when k > n). +- If r > n: no r-element subset of Fin n exists, so only the empty hypergraph is r-uniform. Then `exrKkr r k n = 0`. Correct. +- If r ≤ 2 or k ≤ r: excluded by the theorem's hypotheses `2 < r` and `r < k`. The definitions still make sense, but are not needed. ✓ + +### Main theorem `erdos_712` +```lean +theorem erdos_712 : ∀ k r : ℕ, 2 < r → r < k → + ∃ L : ℝ, Tendsto + (fun n : ℕ => (exrKkr r k n : ℝ) / (Nat.choose n r : ℝ)) + atTop (nhds L) ∧ L = answer(sorry) +``` +- Asserts: for all k > r > 2, the Turán density ex_r(n, K_k^r)/C(n, r) converges to some limit L as n → ∞. ✓ +- The `answer(sorry)` for L can depend on k and r (it is inside the `∀`), which is correct — the density depends on both parameters. ✓ +- The existence of the Turán density (i.e., that this limit exists) is known for all r-uniform forbidden hypergraphs by Katona–Nemetz–Simonovits averaging arguments. So the `∃ L, Tendsto ...` part is a known result, while the `L = answer(sorry)` part captures the open determination. ✓ +- The `@[category research open, AMS 5]` annotation correctly marks this as an open research problem in combinatorics (AMS class 05). ✓ + +### Potential subtlety: `sSup` well-definedness +The `sSup` on `ℕ` for an empty set returns 0 (since `bot` for `ℕ` is 0), and for a nonempty bounded set returns the maximum. As argued above, the set is always nonempty (contains 0) and bounded, so `sSup` is well-behaved. However, Lean's `sSup` for `ℕ` returns 0 for **unbounded** sets as well (since `ℕ` is not a `CompleteLattice`). This is not an issue here because the set is always bounded, but it's worth noting that no explicit `BddAbove` hypothesis appears in the definition — the boundedness is an implicit mathematical fact that would need to be established in any proof. ✓ + +### Division by zero +When `Nat.choose n r = 0` (which happens when n < r), the ratio `(exrKkr r k n : ℝ) / (Nat.choose n r : ℝ)` is `0 / 0 = 0` in Lean's real number division. Since we are taking a limit as n → ∞, only finitely many terms have n < r, so this does not affect the `Tendsto` statement. ✓ + +**Overall correctness: Sound.** No mathematical errors identified. The formalization faithfully captures Erdős Problem 712 as stated on the website — the determination of hypergraph Turán densities for complete r-uniform hypergraphs with k > r > 2. diff --git a/ai-review/713.md b/ai-review/713.md new file mode 100644 index 0000000000..e109d4839d --- /dev/null +++ b/ai-review/713.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 713 + +## 1. Code Reuse + +**`ContainsSubgraph` and `extremalNumber` are duplicated extensively.** These identical definitions appear in at least 20+ files across the codebase (571, 714, 765, 766, 572, 1157, and many others), each scoped to their own namespace. They should be extracted into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Extremal.lean` or similar) and imported by all problem files that need them. + +Specific duplicates most relevant to Problem 713: +- `Erdos571.ContainsSubgraph` (571.lean:33) — identical definition +- `Erdos571.extremalNumber` (571.lean:38) — identical definition +- `Erdos714.ContainsSubgraph` (714.lean:32) — identical definition +- `Erdos714.extremalNumber` (714.lean:37) — identical definition + +No existing shared utility in `FormalConjecturesForMathlib` currently provides these definitions. + +## 2. Citations + +The docstring states: + +> *Reference:* [erdosproblems.com/713](https://www.erdosproblems.com/713) +> A problem of Erdős and Simonovits, worth \$500. See also Problem \#571. + +The website (erdosproblems.com/713) provides additional context not reflected in the formalization's docstrings: + +- **Historical note:** Erdős initially conjectured (1967) that ex(n; G) ~ cn^α where α has the form 1 + 1/k or 2 − 1/k for integer k ≥ 2. Erdős and Simonovits (1970) disproved this initial conjecture. This historical context is absent from the docstrings and would be informative. +- **Hypergraph counterexample:** Frankl and Füredi (1987) showed the analogous statement fails for hypergraphs. Füredi and Gerbner (2021) extended these counterexamples. These are not mentioned. +- **Prize amount:** The docstring correctly notes $500. + +**Recommendation:** Add a brief note about the historical context (the disproved 1967 conjecture) and the known hypergraph counterexamples to provide fuller context. + +## 3. Variants + +The website asks two questions in one: + +1. *"Is it true that for every bipartite graph G, there exists some α ∈ [1,2) and c > 0 such that ex(n; G) ~ cn^α?"* +2. *"Must α be rational?"* + +The formalization captures **both** variants: +- `erdos_713` (Part 1): The asymptotic existence question. +- `erdos_713.variants.rationality` (Part 2): The rationality of α. + +**All variants from the website are captured.** This is well done. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The docstrings for Part 1 and Part 2 are clear and include the mathematical notation. +- The `open SimpleGraph Filter` and `open scoped Topology` are appropriate for the definitions used. +- **Suggestion:** The module docstring could be slightly expanded to explain *why* the problem is important (it concerns the structure of Turán numbers for bipartite graphs, a central question in extremal graph theory). + +## 5. Formalizability + +**Assessment: Moderately high formalizability, with one subtlety.** + +The problem statement on the website uses the asymptotic notation "ex(n; G) ~ cn^α", meaning ex(n; G) / (cn^α) → 1 as n → ∞. This is a precise mathematical statement and is clearly formalizable. + +**Subtlety about "every bipartite graph G":** The website says "every bipartite graph G" without explicitly stating "finite." The formalization quantifies over `(U : Type) [Fintype U] (G : SimpleGraph U)`, which restricts to finite graphs. This is the standard intended reading in extremal graph theory — ex(n; H) is only defined for finite forbidden subgraphs. This is correct. + +**The quantifier structure on α is unambiguous:** for each G, there exists a single α and c such that the asymptotic holds. This is correctly captured. + +**Ambiguity level: Low.** The statement is precise enough to formalize unambiguously. + +## 6. Correctness + +### Part 1 (`erdos_713`) + +**The formalization is mathematically correct.** Specifically: + +- **Bipartiteness via `G.Colorable 2`:** This correctly encodes that G is bipartite (2-colorable). This is the standard Mathlib representation. +- **Range of α:** `1 ≤ α ∧ α < 2` correctly captures α ∈ [1, 2). +- **Asymptotic:** `Tendsto (fun n => (extremalNumber G n : ℝ) / (c * n ^ α)) atTop (nhds 1)` correctly formalizes ex(n; G) ~ cn^α (i.e., the ratio tends to 1). +- **`answer(sorry)` wrapper:** Correctly used since this is an open problem whose truth value is unknown. + +**One potential concern with `extremalNumber`:** The definition uses `sSup` over a set of natural numbers. For n = 0 or n = 1 (where no edges exist), the set `{m | ∃ G : SimpleGraph (Fin n), ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m}` is well-defined but the supremum behavior for `ℕ` with `sSup` (which returns 0 for the empty set in `ℕ`) could be edge-case-sensitive. However, since the asymptotic statement concerns n → ∞, small values of n are irrelevant to the limit, so this is not a real issue. + +**Another subtle point:** The definition of `ContainsSubgraph` uses injective homomorphisms (not necessarily induced subgraphs). This is the standard definition for Turán-type extremal problems: H is a subgraph of G if there's an edge-preserving injection. This is correct — the Turán extremal number forbids H as a (not necessarily induced) subgraph. + +### Part 2 (`erdos_713.variants.rationality`) + +**The formalization is mathematically correct.** + +- It correctly states: *if* α and c witness the asymptotic for some bipartite G, *then* α must be rational. +- The quantifier structure `∀ ... G, Colorable 2 → ∀ α ... → ∀ c ... → Tendsto ... → ∃ q : ℚ, (q : ℝ) = α` is logically correct: it says that any α appearing as an exponent in such an asymptotic must be rational. +- The `answer(sorry)` wrapper is appropriate. + +**No mathematical flaws identified.** The formalization is correct and complete. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — `ContainsSubgraph` and `extremalNumber` duplicated in 20+ files | +| Citations | **Minor gaps** — historical context and hypergraph counterexamples from website not mentioned | +| Variants | **Complete** — both parts of the problem are captured | +| Readability | **Good** — clear docstrings, appropriate opens | +| Formalizability | **High** — low ambiguity, standard mathematical definitions | +| Correctness | **Correct** — no mathematical flaws identified | diff --git a/ai-review/714.md b/ai-review/714.md new file mode 100644 index 0000000000..47dec7b718 --- /dev/null +++ b/ai-review/714.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 714 + +## 1. Code Reuse + +**`ContainsSubgraph` and `extremalNumber` are duplicated across 29+ files.** The definitions in `714.lean` are identical to those in `713.lean`, `765.lean`, `766.lean`, `571.lean`, `572.lean`, and many others. These could be factored into a shared utility (e.g., `FormalConjectures/Util/ExtremalGraph.lean`), but this is a codebase-wide concern rather than specific to this file. + +Note that some files (e.g., `147.lean`, `575.lean`, `576.lean`) use an alternative `turanNumber` definition based on `Fintype`/`edgeFinset` rather than `Fin n`/`edgeSet.ncard`. The `extremalNumber` definition used in `714.lean` (via `Fin n` and `ncard`) is consistent with other extremal number problems like 713, 765, and 766, so the choice is fine internally — but the project would benefit from consolidation. + +No Mathlib definition of extremal/Turán number was found that could replace the local one. + +## 2. Citations + +The website lists the following references: +- **[Er64c], [Er67b], [Er69], [Er71, p.103], [Er74c, p.77], [Er75], [Er81], [Er93, p.334]** — various Erdős papers +- **[KST54]** — Kövári, Sós, Turán (1954) +- **[Br66]** — Brown (1966) +- **[ERS66]** — Erdős, Rényi, Sós (1966) + +The formalization's docstring mentions "Kövári, Sós, and Turán" for the upper bound and that "the conjectured lower bound is known for r = 2 and r = 3," but does not cite: +- Brown [Br66] (who proved the r = 3 case) +- Erdős, Rényi, and Sós [ERS66] (who independently proved the r = 3 case) +- Any specific Erdős paper references + +**Recommendation:** Add citations for Brown [Br66] and Erdős–Rényi–Sós [ERS66] by name, since the docstring already mentions partial results for r = 2 and r = 3 without attribution. + +The website also lists related problems **#147**, **#768** (K_{2,2} = C₄), and **#1158** (hypergraph generalization). The formalization does not mention these. It would be helpful to note them in the module docstring, as 713 does with problem 571. + +## 3. Variants + +The website lists only a single problem statement: "Is it true that ex(n; K_{r,r}) ≫ n^{2-1/r}?" + +The formalization captures exactly this statement. **No additional variants are listed on the website**, so no variants are missing. + +One could argue that a natural companion statement — the known cases r = 2 and r = 3 — could be formalized as separate solved theorems (analogous to how `765.lean` formalizes both the solved asymptotic formula and the open refined conjecture). However, this is optional and the current formalization is complete with respect to the website. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The module docstring gives the problem statement in LaTeX but could include a brief plain-English summary (e.g., "This asks whether the Kövári–Sós–Turán upper bound is tight for complete bipartite graphs K_{r,r}"). +- The docstring on `erdos_714` is thorough and provides good mathematical context. +- The use of `completeBipartiteGraph (Fin r) (Fin r)` from Mathlib is documented in the docstring, which is helpful. + +**Overall readability is good.** No significant improvements needed. + +## 5. Formalizability + +The problem is **highly formalizable and unambiguous**. The statement "ex(n; K_{r,r}) ≫ n^{2-1/r}" has a precise mathematical meaning: there exist constants C > 0 and N₀ such that for all n ≥ N₀, ex(n; K_{r,r}) ≥ C · n^{2-1/r}. This is exactly what the formalization captures. + +The objects involved are all standard: +- K_{r,r} is the complete bipartite graph, available as `completeBipartiteGraph` in Mathlib +- ex(n; H) is the Turán extremal number, defined locally +- The asymptotic lower bound ≫ is expressed via explicit constants + +**Ambiguity assessment: None.** The statement is completely precise. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +### 6.1 The `ContainsSubgraph` definition +The definition correctly captures injective graph homomorphisms (subgraph containment up to isomorphism). This is the standard notion used in extremal graph theory: H is a subgraph of G if there is an injective vertex map preserving adjacency. ✓ + +### 6.2 The `extremalNumber` definition +`extremalNumber H n` computes the supremum over all edge counts of simple graphs on `Fin n` that are H-free. This correctly captures ex(n; H). ✓ + +**Technical note on well-definedness:** The set `{m : ℕ | ∃ G : SimpleGraph (Fin n), ¬ContainsSubgraph G H ∧ G.edgeSet.ncard = m}` is bounded above (by n(n-1)/2) and nonempty (the empty graph is always H-free for r ≥ 2), so `sSup` is well-defined for the intended use. However, `sSup` on `ℕ` returns 0 for the empty set. This is not an issue here since the set is always nonempty for the problem's intended range. + +### 6.3 The main theorem statement +```lean +∀ r : ℕ, 2 ≤ r → + ∃ C : ℝ, 0 < C ∧ + ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + C * (n : ℝ) ^ ((2 : ℝ) - 1 / (r : ℝ)) ≤ + (extremalNumber (completeBipartiteGraph (Fin r) (Fin r)) n : ℝ) +``` + +This states: for all r ≥ 2, there exist C > 0 and N₀ such that for all n ≥ N₀, C · n^{2-1/r} ≤ ex(n; K_{r,r}). + +This is a faithful formalization of "ex(n; K_{r,r}) ≫ n^{2-1/r} for all r ≥ 2." ✓ + +**Note on the quantifier structure:** The constant C is allowed to depend on r (since ∃ C is inside ∀ r), which is correct — in the original problem, the implicit constant in the ≫ notation is allowed to depend on r. + +### 6.4 The `answer(sorry)` wrapper +The statement is wrapped in `answer(sorry) ↔ ...`, which is the standard pattern in this codebase for open problems where the truth value is unknown. This is appropriate since the problem is open. ✓ + +### 6.5 The `completeBipartiteGraph (Fin r) (Fin r)` representation +This produces a graph on `Fin r ⊕ Fin r` (2r vertices) where every vertex on the left is adjacent to every vertex on the right. This is the standard K_{r,r}. ✓ + +### 6.6 Problem status +The problem is tagged `category research open`, which matches the website (status: OPEN). ✓ + +### 6.7 AMS classification +Tagged `AMS 5` (combinatorics). Appropriate. ✓ + +**Overall correctness assessment: The formalization is correct and complete. No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `ContainsSubgraph` and `extremalNumber` duplicated across 29+ files; consolidation opportunity | +| Citations | Missing attribution for Brown and Erdős–Rényi–Sós (r=3 case); no related problem cross-references | +| Variants | Complete — no variants missing | +| Readability | Good | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/715.md b/ai-review/715.md new file mode 100644 index 0000000000..0c605b2f93 --- /dev/null +++ b/ai-review/715.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 715 + +## 1. Code Reuse + +**Potential reuse from Problem 182:** The file `FormalConjectures/ErdosProblems/182.lean` defines `ContainsKRegularSubgraph`, which captures the notion of containing a k-regular subgraph via an injective graph homomorphism. Problem 715 could potentially use this definition instead of the current inline `∃ H : G.Subgraph, ...` formulation. + +However, the two approaches are **not equivalent**: +- **715's approach** uses `SimpleGraph.Subgraph`, which represents a subgraph as a subset of vertices and edges of the original graph. This is a *sub-object* approach: `H.degree v` counts neighbors within `H.verts`, and all edges must be edges of `G`. +- **182's approach** (`ContainsKRegularSubgraph`) uses an existential over an abstract type `U` with an injective homomorphism into `G`. This is a *homomorphism-based* approach. + +These are mathematically equivalent for the purpose of "contains a k-regular subgraph," but the Subgraph-based formulation in 715 is more natural and idiomatic for Mathlib. No change recommended. + +**Problem 82** defines `IsRegularInduced` combining `S.IsInduced` with `(S.coe).IsRegularOfDegree k`, which uses `.coe` to convert a subgraph to a `SimpleGraph` on `H.verts` and then checks regularity. Problem 715 instead checks `H.degree v = 3` directly for all `v : H.verts`. Per the Mathlib source (`SimpleGraph.Subgraph`, line ~800), `G'.coe.degree v = G'.degree v`, so these approaches are equivalent. The current approach in 715 is slightly more direct. + +## 2. Citations + +**Website (erdosproblems.com/715):** +- References: [Er75], [Er81] +- Attribution: "A problem of Berge (or Berge and Sauer)" +- Key results: Alon, Friedland, and Kalai [AFK84]; Tashkinov [Ta82] + +**Formalization:** +- The docstring references [Er75], [Er81], [Ta82], and [AFK84] — all matching the website. +- The module docstring includes full citation entries for all four references. +- The citations [Er75] and [Er81] in the module docstring are missing their full titles/publication details (just "Erdős, P. (1975)." and "Erdős, P. (1981)."). This matches the website which also doesn't provide full details for these two, so this is acceptable but could be improved if full bibliographic data is available (e.g., [Er75] is likely "Problems and results on combinatorial number theory III" and [Er81] is likely "On the combinatorial problems which I would most like to see solved"). +- **Minor issue:** The website describes this as "A problem of Berge (or Berge and Sauer)" — the module docstring correctly includes this attribution. + +**Verdict:** Citations are consistent with the website. No issues. + +## 3. Variants + +The website poses two questions: +1. "Does every regular graph of degree 4 contain a regular subgraph of degree 3?" +2. "Is there any r such that every regular graph of degree r must contain a regular subgraph of degree 3?" + +The formalization captures: +- **Main theorem (`erdos_715`):** The degree-4 case — correctly formalized. +- **Variant (`erdos_715.variants.r_geq_5`):** The r ≥ 5 case, attributed to Alon, Friedland, and Kalai — correctly formalized. + +**Assessment:** Both questions from the website are fully captured. The second question is answered affirmatively for all r ≥ 5 (via the AFK84 result), and the first question (r = 4) is the main theorem (via Tashkinov). Together, these imply every r-regular graph with r ≥ 4 contains a 3-regular subgraph, which fully resolves the problem. All variants are covered. + +## 4. Readability + +The code is clean and well-structured: +- The module docstring provides good context including problem history and key results. +- The theorem docstrings clearly state what is being formalized and who proved it. +- The inline comment in the main theorem docstring explaining the subgraph formulation (`H.coe`, `H.verts`) is helpful. +- Naming follows conventions (`erdos_715`, `erdos_715.variants.r_geq_5`). + +**Minor suggestion:** The variant could include a brief note that together with the main theorem, this resolves the full problem for all r ≥ 4. But this is cosmetic. + +**Verdict:** Readable and well-documented. No significant issues. + +## 5. Formalizability + +The problem statement is precise and unambiguous: +- "Regular graph of degree 4" → `G.IsRegularOfDegree 4` on a `SimpleGraph V` with `Fintype V`. +- "Contains a regular subgraph of degree 3" → existence of `H : G.Subgraph` with `H.verts.Nonempty` and `∀ v : H.verts, H.degree v = 3`. + +The only potential ambiguity in the original problem is what "subgraph" means — it could mean *induced* subgraph or *spanning* subgraph or just any subgraph. The formalization correctly uses the general notion (any subgraph, not necessarily induced or spanning), which matches the mathematical intent. + +**Verdict:** Fully formalizable with no ambiguity. The problem is a clean yes/no question about graph structure. + +## 6. Correctness + +**Main theorem (`erdos_715`):** +- The statement `∀ (V : Type*) [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj], G.IsRegularOfDegree 4 → ∃ H : G.Subgraph, H.verts.Nonempty ∧ ∀ v : H.verts, H.degree v = 3` correctly formalizes "every 4-regular simple graph contains a 3-regular subgraph." +- The `answer(True)` wrapper correctly indicates the answer is affirmative. +- The `Fintype V` constraint is appropriate (the result is about finite graphs). +- The `H.verts.Nonempty` condition is essential — without it, the empty subgraph would trivially satisfy the degree condition vacuously. This is correctly included. +- `H.degree v` for `v : H.verts` counts neighbors in the subgraph (confirmed by Mathlib source), so `H.degree v = 3` correctly captures 3-regularity of the subgraph. + +**Variant (`erdos_715.variants.r_geq_5`):** +- The universal quantification over `r : ℕ` with `r ≥ 5` is correct. +- The structure mirrors the main theorem appropriately. +- Note that `r` is universally quantified but appears after `G`, which means for a *fixed* graph `G`, the statement says: for any `r ≥ 5`, if `G` is r-regular, then it contains a 3-regular subgraph. This is logically equivalent to the intended "every r-regular graph (r ≥ 5) contains a 3-regular subgraph" since `G` and `r` are both universally quantified. The ordering doesn't matter. ✓ + +**Potential subtlety:** The formalization uses `SimpleGraph`, which by definition excludes multi-edges and self-loops. The original problem likely intends simple graphs, so this is correct. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Category | Assessment | +|---|---| +| Code Reuse | No reuse needed; current approach is idiomatic | +| Citations | Consistent with website; minor improvement possible for [Er75]/[Er81] titles | +| Variants | All variants captured | +| Readability | Clean and well-documented | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | + +**Overall:** This is a well-done formalization with no substantive issues. diff --git a/ai-review/716.md b/ai-review/716.md new file mode 100644 index 0000000000..359f820101 --- /dev/null +++ b/ai-review/716.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 716 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** Problem 1157 (`FormalConjectures/ErdosProblems/1157.lean`) already defines a fully general framework that subsumes Problem 716: + +- `UniformHypergraph r n` — an r-uniform hypergraph on n vertices (generalizes `Hypergraph3`) +- `edgesSpannedBy H S` — counts edges within a vertex subset (equivalent to `(H.edges.filter (· ⊆ S)).card`) +- `IsFree H k s` — no k vertices span s or more edges (for k=6, s=3, this is exactly `Hypergraph3.isFree`) +- `extremalNumber r n k s` — the extremal number f_r(n; k, s) + +Problem 716 is precisely the special case r=3, k=6, s=3 of Problem 1157 (as noted in 1157's own docstring). The theorem `erdos_716` could be stated as a corollary: + +``` +extremalNumber 3 n 6 3 ≤ ε * n ^ 2 for large n +``` + +Additionally, `Hypergraph3` is independently redefined in both `716.lean` and `1076.lean` with identical structure. The `UniformHypergraph` structure from `616.lean`, `1075.lean`, and `1157.lean` would also suffice. A shared definition (perhaps in a utility file) would reduce duplication. + +Problem 794 also defines `ContainsSubhypergraph` using the same `(H.filter (· ⊆ S)).card` pattern, further confirming this is a recurring idiom that could be centralized. + +## 2. Citations + +The formalization includes: +- [BES73] Brown, Erdős, Sós — ✓ present, citation text is reasonable +- [RuSz78] Ruzsa, Szemerédi — ✓ present, citation text is reasonable + +The website lists additional original source references not in the formalization: +- **[Er71, p.105]** — missing +- **[Er74c, p.80]** — missing +- **[Er75]** — missing +- **[Er75b, p.299]** — missing +- **[Er81, p.30]** — missing + +These are Erdős's own papers where the problem appears. While not strictly necessary, including at least the earliest reference [Er71] would improve traceability. + +The website also identifies this result as known as the **"Ruzsa–Szemerédi problem"**, which could be mentioned in the docstring. + +## 3. Variants + +The website lists two related problems: +- **Problem 1178** — generalization to k vertices and k−3 edges (the case t=2 of the Brown–Erdős–Sós conjecture). **Not referenced** in 716.lean. +- **Problem 1157** — the completely general Brown–Erdős–Sós conjecture. **Not referenced** in 716.lean, though 1157.lean correctly references 716 as a special case. + +No variants of Problem 716 itself are described on the website beyond these generalizations, so the formalization does not miss any variant of the specific problem. However, cross-references to 1157 and 1178 in the docstring would be valuable. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- **Naming**: `isFree` is vague — `isFamilyFree` or `isRuzsaSzemerediProperty` would be more descriptive. In the broader codebase, `IsFree` (1157), `IsFkFree` (1076), and `IsK43Free` (500) all refer to different notions of "free"; a more specific name helps. +- **Docstring on `isFree`**: The comment says "every 6-element subset of vertices contains at most 2 edges." This is correct and clear, but could explicitly note the equivalence: "Equivalently, H contains no member of F as a subhypergraph." +- **Namespace**: The `Erdos716` namespace is appropriate and prevents collisions with the duplicate `Hypergraph3` in `Erdos1076`. + +## 5. Formalizability + +**High — the problem is unambiguous and straightforwardly formalizable.** + +The statement "ex₃(n, F) = o(n²)" is a standard asymptotic claim that translates directly into the ε-N₀ formulation used. The family F (all 3-uniform hypergraphs on 6 vertices with 3 edges) is a well-defined finite combinatorial object. The notion of F-freeness (no 6-vertex subset spans 3+ edges) is a clean finitary condition. + +The only potential ambiguity is whether "on 6 vertices" means "with vertex set of size exactly 6" or "on at most 6 vertices." This is standard combinatorial language meaning exactly 6, and the formalization correctly uses `S.card = 6`. Moreover, the two interpretations yield equivalent F-freeness conditions: if 5 vertices span 3 edges, adding any 6th vertex gives a 6-element set also spanning those 3 edges, so the ≤2 constraint on 6-element sets implies the same on all smaller sets. This subtle point means the choice is immaterial for correctness. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +1. **F-freeness equivalence**: The formalization defines F-free as "every 6-element vertex subset spans at most 2 edges." This is equivalent to the standard definition "H contains no subhypergraph isomorphic to any F ∈ F" (where F is the family of 3-uniform hypergraphs on 6 vertices with 3 edges). + - *Forward direction*: If some F ∈ F embeds into H via injection f : Fin 6 → Fin n, the 6 image vertices span at least 3 edges (the images of F's edges), contradicting isFree. + - *Reverse direction*: If 6 vertices in H span ≥ 3 edges, those edges form a member of F, and the inclusion map witnesses the embedding. + +2. **o(n²) formulation**: The theorem states: for all ε > 0, there exists N₀ such that for all n ≥ N₀, every F-free 3-uniform hypergraph on n vertices has ≤ εn² edges. This is the standard definition of ex₃(n, F) = o(n²), correctly formalized without needing to explicitly define the extremal number. + +3. **answer(True)**: The problem is marked as solved affirmatively, consistent with the Ruzsa–Szemerédi result. + +4. **Edge representation**: Edges as `Finset (Finset (Fin n))` correctly models simple 3-uniform hypergraphs (no repeated edges, edges are unordered). The `uniform` field ensures all edges have cardinality 3. + +5. **Tag correctness**: `@[category research solved, AMS 5]` — AMS 5 (Combinatorics) is appropriate. "research solved" is correct. + +**No mathematical errors or incompleteness detected.** + +--- + +**Summary**: The formalization is correct and captures the intended problem faithfully. The main improvement opportunity is leveraging the existing definitions in `1157.lean` (or a shared utility) to avoid duplicating `Hypergraph3` and the F-free concept. Additional cross-references and citations would improve documentation. diff --git a/ai-review/717.md b/ai-review/717.md new file mode 100644 index 0000000000..ce1a30cbae --- /dev/null +++ b/ai-review/717.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 717 + +## 1. Code Reuse + +**Issue found.** The `ContainsSubdivision` definition (lines 46–60) is duplicated verbatim in `FormalConjectures/ErdosProblems/718.lean` (lines 43–54). Both files independently define the same predicate with identical structure: an injective map `Fin k ↪ V` for branch vertices, walks that are paths, internal-vertex disjointness between distinct paths, and internal vertices disjoint from branch vertices. + +This should be factored into a shared module (e.g., under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`). The `subdivisionNumber` definition from 717.lean could also live there, as it is a natural companion. Problem 1021 also defines a related (but distinct) notion of 1-subdivision (`subdivisionKComplete`), which is a different concept and does not duplicate this code. + +Mathlib does not currently have a definition for topological Kₖ minors or graph subdivisions, so no upstream reuse is possible at present. + +## 2. Citations + +The docstring cites **[FLS13]** with full bibliographic details: + +> Fox, J., Lee, C., and Sudakov, B., *Chromatic number, clique subdivisions, and the conjectures of Hajós and Erdős–Fajtlowicz*, Combinatorica 33 (2013), 181–197. + +The website (erdosproblems.com/717) also lists the following references, which are mentioned in the docstring's historical narrative but without full bibliographic details: + +- **[ErFa81]** — Erdős, P. and Fajtlowicz, S. (1981) +- **[Er81]** — Erdős, P. (1981) +- **[Di52]** — Dirac, G. A. (1952) +- **[Ca74]** — Catlin, P. A. (1974) + +The docstring correctly attributes historical results (Dirac proved Hajós for χ = 4; Catlin disproved for χ ≥ 7; Erdős–Fajtlowicz gave the strong disproof), and the primary citation [FLS13] is complete and accurate. The omission of full bibliographic details for the historical references is acceptable since they provide context rather than the main result. + +## 3. Variants + +The website states a single problem with no additional variants. The formalization captures exactly the problem as stated. No missing variants. + +## 4. Readability + +The code is well-structured and readable: + +- The `ContainsSubdivision` definition has a clear docstring and inline comments explaining the three conjuncts (paths are paths, internal vertices disjoint across paths, internal vertices disjoint from branch vertices). +- The `subdivisionNumber` definition is clean and well-documented. +- The main theorem docstring states the problem, attributes it, and gives the formula in LaTeX. + +**Minor suggestion:** The expression `(paths i j h).support.tail.dropLast` appears four times. A local notation or helper predicate for "internal vertices of a path" could improve clarity, though this is a stylistic preference rather than a defect. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The original problem uses asymptotic notation (≪), which the formalization correctly interprets as the existence of an absolute constant C > 0. All quantities involved — chromatic number, subdivision number, vertex count — are well-defined combinatorial invariants. The problem is a clean universal statement over finite graphs, and the formalization captures it precisely. + +The only potential source of ambiguity in the original statement is the implicit assumption that n is large enough (to avoid log n = 0). The formalization handles this with the guard `2 ≤ n`, which is the minimal condition ensuring `Real.log n > 0`. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed analysis: + +### Operator precedence +The expression `C * Real.sqrt (n : ℝ) / Real.log (n : ℝ) * (subdivisionNumber G : ℝ)` parses as `((C * √n) / log n) * σ(G)` due to left-associativity of `*` and `/` at equal precedence. This equals `C · (√n / log n) · σ(G)`, matching the intended formula. + +### The `2 ≤ n` guard +For n = 0: no vertices, so χ = 0, trivially true but vacuously handled. +For n = 1: log(1) = 0, so Lean's division by zero yields 0 on the RHS, making the inequality `1 ≤ 0` false. The guard correctly excludes this case. +For n ≥ 2: log(n) > 0, and the formula is well-defined. This is the right threshold. + +### `ContainsSubdivision` definition +The definition correctly formalizes "G contains a topological Kₖ": +- **Branch vertices**: k distinct vertices via `Fin k ↪ V` (injective). +- **Subdivision paths**: walks indexed by ordered pairs `i < j` (avoiding double-counting for undirected graphs). +- **Path condition**: each walk is a path (`IsPath`). +- **Internal vertex extraction**: `support.tail.dropLast` correctly removes the first and last vertices (the branch vertices) from the walk's support, yielding exactly the internal/subdivision vertices. +- **Disjointness**: Internal vertices of distinct paths are pairwise disjoint, and no internal vertex coincides with any branch vertex. Both conditions are necessary and correctly stated. + +### `subdivisionNumber` definition +Uses `sSup` on `{k : ℕ | ContainsSubdivision G k}`. For `Fintype V`, the set is bounded above by `Fintype.card V` (you cannot embed more than |V| branch vertices). The set is nonempty (every graph contains a subdivision of K₀). Since `ℕ` with its `ConditionallyCompleteLattice` instance defines `sSup` of a bounded nonempty set as the maximum, this correctly computes σ(G). + +### `chromaticNumber.toNat` +For `SimpleGraph (Fin n)` with `n ≥ 2`, the graph is finite, so `chromaticNumber` returns a finite value in `ℕ∞`, and `.toNat` extracts the natural number correctly. + +### `answer(True)` wrapper +This is the standard pattern in the codebase for solved yes/no problems. Since Fox–Lee–Sudakov proved the answer is yes, `answer(True) ↔ ∃ C ...` correctly asserts that the mathematical statement holds. + +### Overall mathematical judgment +The formalization is a faithful and complete translation of the problem from erdosproblems.com/717. An experienced mathematician would not identify any flaws. The statement is unambiguous and the formalization handles all edge cases correctly. diff --git a/ai-review/718.md b/ai-review/718.md new file mode 100644 index 0000000000..7b12fbc346 --- /dev/null +++ b/ai-review/718.md @@ -0,0 +1,82 @@ +# Review: Erdős Problem 718 + +## 1. Code Reuse + +**Issue: Duplicate `ContainsSubdivision` definition.** + +The `ContainsSubdivision` definition in `ErdosProblems/718.lean` (lines 43–54) is *identical* to the one in `ErdosProblems/717.lean` (lines 46–60). These two files define the same concept independently within separate namespaces (`Erdos717` and `Erdos718`). This should be factored out into a shared definition — ideally in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean`, which already contains related graph-theoretic definitions. + +Furthermore, `Definitions.lean` (lines 103–105) already defines `InternallyDisjoint` using `Disjoint p.support.tail.dropLast q.support.tail.dropLast`, which captures the same internal-vertex-disjointness concept used in `ContainsSubdivision`. The handrolled pointwise version (`∀ v, v ∈ ... → v ∉ ...`) is logically equivalent but less idiomatic. A shared `ContainsSubdivision` definition could be written more cleanly using `InternallyDisjoint`. + +## 2. Citations + +The docstring references match the website content well: + +- **[KoSz96]** — Komlós, J. and Szemerédi, E., *Topological cliques in graphs II*. Combinatorics, Probability and Computing (1996), 5, 79–90. ✅ Matches website. +- **[BoTh96]** — Bollobás, B. and Thomason, A., *Proof of a conjecture of Mader, Erdős and Hajnal on topological complete subgraphs*. European J. Combin. (1998), 19, 883–887. ✅ Matches website. (Note: the citation key says 96 but the publication year is 1998; this reflects the preprint/submission timeline and is consistent with the website.) +- The website also references the original conjecture source as **[Er81]** (Erdős, Hajnal, and Mader, 1981) and Dirac's result as **[Di60]** and Mader's as **[Ma67]**. The docstring mentions these results in prose but does not give formal citation keys for them. This is acceptable since they provide background context rather than the solution. + +**Minor note:** The website explicitly attributes the conjecture to 1981. The docstring says "A conjecture of Erdős, Hajnal, and Mader" without a year. Adding "[Er81]" would improve traceability. + +## 3. Variants + +The website presents a single problem statement: "Is there some constant $C > 0$ such that any graph on $n$ vertices with $\geq Cr^2n$ edges contains a subdivision of $K_r$?" The formalization captures exactly this statement. No additional variants are mentioned on the website. ✅ + +## 4. Readability + +The code is reasonably readable. Suggestions for improvement: + +- **Factor out `ContainsSubdivision`** as noted above — this would reduce the file to just the theorem statement and make the mathematical content more prominent. +- **The internal disjointness conditions** (lines 48–54) are dense. Using `InternallyDisjoint` from `Definitions.lean` and a separate "internal vertices avoid branch vertices" predicate would improve clarity. +- The `[DecidableRel G.Adj]` instance is necessary for `edgeFinset` but could benefit from a brief comment explaining why. + +## 5. Formalizability + +The problem as stated on the website is completely precise and unambiguously formalizable. It asks for the existence of a constant $C$ such that a quantitative edge-density condition forces a topological $K_r$ minor. All terms have standard graph-theoretic definitions. **No ambiguity.** ✅ + +## 6. Correctness + +### 6a. The `ContainsSubdivision` definition + +The definition correctly captures the notion of a topological $K_k$ minor (also called a $K_k$-subdivision or $TK_k$): +- Branch vertices are injected via `f : Fin k ↪ V`. ✅ +- Paths between every ordered pair `i < j` are provided. ✅ +- Each walk is required to be a path (no repeated vertices). ✅ +- Internal vertices of distinct paths are disjoint. ✅ +- Internal vertices avoid all branch vertices. ✅ + +This is mathematically correct. + +### 6b. The main theorem statement — **CORRECTNESS BUG** + +The statement as formalized is **false** due to a boundary case. + +```lean +∃ C : ℝ, C > 0 ∧ + ∀ (n r : ℕ), + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ C * (r : ℝ) ^ 2 * (n : ℝ) → + ContainsSubdivision G r +``` + +**The problem:** Consider `n = 0`, `r = 1`. The graph `G` on `Fin 0` is the unique empty graph with 0 edges. The hypothesis becomes `0 ≥ C · 1 · 0 = 0`, which is true. But the conclusion `ContainsSubdivision G 1` requires an injection `Fin 1 ↪ Fin 0`, which is impossible since `Fin 0` is empty. So the conclusion is false while the hypothesis is true. + +Since this holds for **every** `C > 0`, the existential `∃ C > 0, ...` is **false**, making the entire statement trivially false. + +**Suggested fix:** Add a guard on `n`, such as: +- `∀ (n r : ℕ) (hn : 0 < n)`, or +- `∀ (n r : ℕ) (h : r ≤ n)`, or +- Replace `≥` with `>` (strict inequality), which would make the hypothesis `0 > 0` false when `n = 0`, vacuously satisfying the implication. + +The cleanest fix mathematically is probably requiring `r ≤ n` or `0 < n`, since the strict inequality approach subtly changes the mathematical content. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ❌ Duplicate `ContainsSubdivision` (same as 717.lean); should use shared definition | +| Citations | ✅ Correct, minor improvement possible (add [Er81] year) | +| Variants | ✅ Complete | +| Readability | ⚠️ Acceptable, but would benefit from shared definitions | +| Formalizability | ✅ Unambiguous | +| Correctness | ❌ Statement is false due to `n = 0, r ≥ 1` boundary case | diff --git a/ai-review/719.md b/ai-review/719.md new file mode 100644 index 0000000000..d4256f6d93 --- /dev/null +++ b/ai-review/719.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 719 + +## 1. Code Reuse + +**Several opportunities for reuse exist with other hypergraph Turán problems in the codebase.** + +- **Problem 712** (`ErdosProblems/712.lean`) defines `exrKkr r k n`, a general r-uniform Turán number ex_r(n, K_k^r). Setting `k = r + 1` yields exactly `turanHypergraphNumber n r` from Problem 719. Similarly, `IsKkrFree r (r+1) H` is equivalent to the conjunction `IsRUniformHypergraph n r H ∧ IsHypergraphCliqueFree r H`. These definitions could be unified: Problem 719 could import and specialize Problem 712's definitions rather than re-deriving them. + +- **Problem 500** (`ErdosProblems/500.lean`) defines `IsK43Free` and `ex3K43`, which are the specialization of the same concepts to r=3, k=4. All three problems (500, 712, 719) independently define r-uniform Turán numbers using the same `sSup` pattern. + +- **Problem 1178** (`ErdosProblems/1178.lean`) defines `IsRUniform` identically to `IsRUniformHypergraph` (modulo naming and the extra `n` parameter in 719's version). + +**Recommendation:** Extract shared definitions (`IsRUniform`, Turán number, clique-freeness) into a common utility or at minimum have 719 reference 712's more general `exrKkr`. + +## 2. Citations + +The formalization references: + +> [Er81] Erdős, P., *On the combinatorial problems which I would most like to see solved*, 1981. + +The website ([erdosproblems.com/719](https://www.erdosproblems.com/719)) attributes the problem to Erdős and Sauer, with reference [Er81]. The formalization's docstring correctly identifies this as a conjecture of Erdős and Sauer. + +**Note:** Problem 500 in the codebase also cites [Er81] but gives the title as *Combinatorial problems and results* (1981). These may be different 1981 Erdős papers, or one title may be inaccurate. The title used in 719 ("On the combinatorial problems which I would most like to see solved") matches the commonly cited 1981 paper and is consistent with Problem 1178's citation of the same reference. The discrepancy in Problem 500 should be investigated separately. + +No additional references are listed on the website beyond [Er81]. + +## 3. Variants + +The website states a single variant of the problem. The formalization captures this faithfully: decompose any r-uniform hypergraph into edge-disjoint copies of K_r^r and K_{r+1}^r, with at most ex_r(n; K_{r+1}^r) many pieces. + +**No missing variants identified.** + +## 4. Readability + +The code is well-structured and readable: + +- Each definition (`IsRUniformHypergraph`, `IsHypergraphCliqueFree`, `turanHypergraphNumber`, `pieceEdges`) has a clear docstring with LaTeX notation. +- The main theorem statement is broken into five clearly separated conjuncts. +- The `pieceEdges` helper is a clean way to unify the edge sets of K_r^r and K_{r+1}^r copies. + +**Minor suggestions:** +- The `IsRUniformHypergraph` definition takes `n` as an explicit argument even though it is already determined by the type of `H`. This is slightly redundant (the `n` in the predicate name already comes from `Fin n`). Problem 1178's `IsRUniform` avoids this. +- The theorem's five conjuncts could benefit from a brief inline comment labeling each condition (e.g., "-- pieces are valid", "-- coverage", "-- containment", "-- edge-disjointness", "-- bound on count"). + +## 5. Formalizability + +**The problem is formalizable but has moderate ambiguity.** + +The website's phrasing — "Is every r-hypergraph G on n vertices expressible as a union of at most ex_r(n; K_{r+1}^r) many copies of K_r^r and K_{r+1}^r, where no two copies share a K_r^r?" — requires interpretation in several places: + +- **"Copies of K_r^r and K_{r+1}^r"**: K_r^r is a single r-edge (trivially a complete r-uniform hypergraph on r vertices), and K_{r+1}^r is the complete r-uniform hypergraph on r+1 vertices (i.e., all (r+1 choose r) = r+1 edges). The formalization correctly models these via `pieceEdges`. + +- **"No two copies share a K_r^r"**: This means edge-disjointness (no r-edge belongs to two different pieces). The formalization captures this correctly with the `Disjoint (pieceEdges r S₁) (pieceEdges r S₂)` condition. + +- **"Union"**: The edges of G are exactly the union of edges from all pieces. The formalization captures both directions: every edge of H is in some piece (conjunct 2), and every edge from a piece is in H (conjunct 3). + +- **Range of r**: The problem does not explicitly restrict r. For r = 0 or r = 1, the statement becomes degenerate or false (see Correctness section). The intended scope is likely r ≥ 2. + +**Assessment:** Moderately unambiguous. The core mathematical content is clear, but the range of r is not specified. + +## 6. Correctness + +**The formalization is largely correct, with one notable concern.** + +### What is correct: +- The Turán number `turanHypergraphNumber` correctly models ex_r(n; K_{r+1}^r) via `sSup` over r-uniform K_{r+1}^r-free hypergraphs. The set is nonempty (contains the empty hypergraph with 0 edges) and bounded above (by C(n,r)), so `sSup` is well-defined. +- The decomposition conditions (coverage, containment, edge-disjointness, cardinality bound) faithfully capture the problem statement. +- `pieceEdges` correctly distinguishes K_r^r (single edge) from K_{r+1}^r (all r-subsets of an (r+1)-set), with a fallback to ∅ for other cardinalities. +- The `answer(sorry) ↔ ...` pattern is appropriate for a yes/no open problem. + +### Concern — missing constraint on r: +The formalization universally quantifies over all `n r : ℕ`, including degenerate cases: +- **r = 0**: A 0-uniform hypergraph has edges of size 0 (only ∅). The Turán number ex_0(n; K_1^0) = 0 for n ≥ 1 (since any edge ∅ ⊆ every 1-element set). The conjecture would require decomposing {∅} into ≤ 0 pieces, which is impossible. So the conjecture is **false** for r = 0. +- **r = 1**: ex_1(n; K_2^1) = 1 for n ≥ 2 (at most one singleton edge allowed). A 1-uniform hypergraph with 3 or more edges cannot be decomposed into ≤ 1 piece. So the conjecture is **false** for r = 1 as well. + +Since the `answer(sorry)` would need to be `False` to account for these degenerate cases, but the intended mathematical conjecture (for r ≥ 2) is believed to be true, adding a hypothesis `2 ≤ r` (or at minimum `1 ≤ r`) would better align the formalization with the intended conjecture. + +### Minor observation — multiset of pieces: +The pieces are modeled as a `Finset (Finset (Fin n))`, meaning two distinct pieces cannot be the same vertex set. This is mathematically fine: two K_{r+1}^r copies on the same vertex set produce identical edge sets and could never be edge-disjoint (unless their edge sets are empty, which doesn't happen for r ≥ 1). Similarly, two K_r^r copies on the same vertex set would be the same edge. So no expressiveness is lost. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Opportunities exist with Problems 712, 500, 1178 | +| Citations | Correct; minor cross-problem inconsistency in [Er81] title | +| Variants | Complete | +| Readability | Good; minor improvements possible | +| Formalizability | Clear modulo range of r | +| Correctness | Sound for r ≥ 2; missing `2 ≤ r` hypothesis makes the universal statement false for degenerate cases | diff --git a/ai-review/72.md b/ai-review/72.md new file mode 100644 index 0000000000..1040ad74f8 --- /dev/null +++ b/ai-review/72.md @@ -0,0 +1,151 @@ +# Review: Erdős Problem 72 + +**File:** `FormalConjectures/ErdosProblems/72.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated density-zero definition.** + +The file defines a local `HasDensityZero` (line 43) using an ε-N formulation: +```lean +def HasDensityZero (A : Set ℕ) : Prop := + ∀ ε : ℝ, ε > 0 → ∃ N : ℕ, ∀ n : ℕ, n ≥ N → + (Set.ncard (A ∩ Set.Iic n) : ℝ) ≤ ε * (n : ℝ) +``` + +The library file `FormalConjecturesForMathlib/Data/Set/Density.lean` already provides `Set.HasDensity`, and numerous other Erdős problems use `A.HasDensity 0` to express density zero — including Problems 12, 340, 357, 845, 932, 940, and others. Problem 72 is the **only** file that defines and uses the custom `HasDensityZero`. + +The two definitions are mathematically equivalent (the ε-N formulation is equivalent to saying the partial density tends to 0), but they differ in their primitives: +- `HasDensityZero` uses `Set.Iic n` (closed interval {0, …, n}) and raw `ncard`. +- `Set.HasDensity` uses `Set.interIio` (half-open interval {0, …, n−1}) and `partialDensity` (a ratio). + +**Recommendation:** Replace `HasDensityZero A` with `A.HasDensity 0` from the shared library. This eliminates the local definition, improves consistency with the rest of the codebase, and connects Problem 72 to existing library lemmas (e.g., `hasDensity_zero_of_finite`, monotonicity, etc.). The import would need to change from `FormalConjectures.Util.ProblemImports` to also include `FormalConjecturesForMathlib.Data.Set.Density`. + +**Graph infrastructure:** The use of `SimpleGraph`, `Walk.IsCycle`, `edgeFinset`, etc. is standard Mathlib and requires no custom definitions. No reuse issues there. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/72](https://www.erdosproblems.com/72):** + +The website lists references: [Er94b], [Er95], [Er97b], [Er97c], [Bo77], [Ve05], [LiMo20]. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős 1994b | Not cited | [Er94b] | **Missing.** | +| Erdős 1995 | Not cited | [Er95] | **Missing.** | +| Erdős 1997b | Not cited | [Er97b] | **Missing.** | +| Erdős 1997c | Not cited | [Er97c] | **Missing.** | +| Bollobás 1977 | Mentioned in docstring but not formally cited | [Bo77] | **Missing citation.** The docstring says "Bollobás proved such a constant exists when A is an infinite arithmetic progression" but does not provide a full reference. | +| Verstraëte 2005 | `[Ve05]` — full citation with journal, volume, pages | [Ve05] | ✓ OK. | +| Liu–Montgomery 2020 | `[LiMo20]` — full citation | [LiMo20] | ✓ OK, though note the label says 2020 while the publication year in the citation body says 2023 (JAMS 36, 2023). The 2020 date presumably refers to the preprint. Minor inconsistency. | + +**Additional notes from the website not reflected in the docstring:** +- Erdős believed no such c exists if A is the set of powers of 2 (i.e., he conjectured the opposite of what Liu–Montgomery proved). This historical context is absent. +- Erdős had no conjecture regarding A as squares or primes ± 1. +- The problem carried a $100 prize. + +--- + +## 3. Variants + +The formalization captures only the existential statement (∃ A with density 0 and ∃ c > 0 such that …). Missing variants: + +**1. Liu–Montgomery powers-of-2 variant (proved):** +The docstring mentions that Liu and Montgomery showed powers of 2 work, but this is not formalized as a separate theorem. This is a strictly stronger and more concrete result: +```lean +theorem erdos_72.variants.powers_of_two : + ∃ (c : ℝ), c > 0 ∧ + ∃ (N₀ : ℕ), ∀ (n : ℕ), n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) (hd : DecidableRel G.Adj), + haveI := hd + 2 * (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) → + ∃ (k : ℕ), (∃ m : ℕ, k = 2 ^ m) ∧ + ∃ (v : Fin n), ∃ (p : G.Walk v v), p.IsCycle ∧ p.length = k := by + sorry +``` + +**2. Connection to Problem 71:** +Problem 71 (Bollobás's theorem) is a special case: for every infinite arithmetic progression containing even numbers, there exists such a c. The docstring alludes to this but doesn't cross-reference Problem 71. A note linking the two would improve context. + +**3. Even cycle lengths:** +Liu and Montgomery's result actually proves more generally that any set of even numbers with sufficient density structure works. The formalization could note this. + +**Assessment:** The core existential statement is present and correct. The most notable missing variant is the Liu–Montgomery powers-of-2 result, which is the headline achievement and deserves its own theorem statement. + +--- + +## 4. Readability + +The code is short (65 lines) and well-structured. Observations: + +- **Docstrings:** Both the module-level and theorem-level docstrings are clear and provide good mathematical context. +- **Namespace:** `Erdos72` is appropriate and consistent with the codebase convention. +- **`HasDensityZero` docstring:** The definition's docstring accurately describes the ε-N formulation. However, the notation `{0, …, n}` in the docstring corresponds to `Set.Iic n`, which is correct. +- **`haveI := hd` pattern:** The `haveI` on line 60 is a standard Lean idiom for making a `DecidableRel` instance available. Readable to Lean users. +- **Stylistic inconsistency with Problem 71:** Problem 71 quantifies over a general type `(V : Type*) [Fintype V] [DecidableEq V]` while Problem 72 uses `Fin n`. Both approaches are valid, but the inconsistency is noticeable for adjacent problems about the same topic (cycle lengths under average degree conditions). Problem 71's approach is more general (it doesn't require "sufficiently many vertices"), while Problem 72's `Fin n` approach naturally accommodates the `N₀` threshold. This is a defensible design choice. + +**Minor suggestion:** The module docstring could explicitly note that Problem 72 generalizes Problem 71. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement from the website — "Is there a set A ⊂ ℕ of density 0 and a constant c > 0 such that every graph on sufficiently many vertices with average degree ≥ c contains a cycle whose length is in A?" — is precise. All key concepts are standard: + +- **"Density 0"**: Natural (asymptotic) density zero is a standard notion with a single accepted definition. +- **"Average degree ≥ c"**: Average degree = 2|E|/|V|, so 2|E| ≥ c·|V|. Unambiguous. +- **"Cycle whose length is in A"**: A cycle is a closed walk with no repeated vertices (except the endpoints). Its length is the number of edges. Standard. +- **"Sufficiently many vertices"**: The ∃ N₀ quantifier handles this. + +The only minor ambiguity is whether the problem refers to simple graphs only (no multi-edges or self-loops). The use of `SimpleGraph` in the formalization resolves this in favor of simple graphs, which is the standard interpretation. + +**Ambiguity level: Very low.** This is a cleanly stated combinatorial problem. + +--- + +## 6. Correctness + +**The formalization is mathematically correct and complete for the main statement. No critical bugs.** + +### Detailed analysis: + +**Average degree encoding (✓):** +The condition `2 * (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ)` correctly encodes "average degree ≥ c" since average degree = 2|E|/n, and multiplying through by n gives 2|E| ≥ cn. This avoids division-by-zero issues when n = 0. + +**Density-zero definition (✓, with caveat):** +The `HasDensityZero` definition uses `Set.Iic n` = {0, …, n}, so the count is |A ∩ {0, …, n}|. Standard definitions typically use {1, …, n}. The difference is at most 1, which is asymptotically irrelevant: +- If |A ∩ {0, …, n}| ≤ εn for large n, then |A ∩ {1, …, n}| ≤ εn too. +- Conversely, |A ∩ {0, …, n}| ≤ |A ∩ {1, …, n}| + 1, and (|A ∩ {1,…,n}| + 1)/n → 0 if |A ∩ {1,…,n}|/n → 0. + +So the definition is equivalent to the standard one. However, as noted in §1, it should be replaced by `Set.HasDensity A 0` for consistency. + +**Cycle existence (✓):** +The conclusion `∃ k ∈ A, ∃ v : Fin n, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = k` correctly requires a cycle of length k where k ∈ A. Mathlib's `Walk.IsCycle` requires the walk to be a trail (no repeated edges), have no repeated internal vertices, and have length ≥ 3. This matches the standard graph-theoretic definition of a cycle. + +**Quantifier structure (✓):** +The structure `∃ A, HasDensityZero A ∧ ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∀ G, …` correctly allows N₀ to depend on A and c. This is the natural reading of the problem. + +**`answer(True)` (✓):** +The problem was solved affirmatively (such A and c exist), so `answer(True)` is correct. The `answer(True) ↔ ∃ …` expands to `True ↔ ∃ …`, which holds iff the RHS is provable. Since Verstraëte proved existence and Liu–Montgomery gave an explicit A (powers of 2), this is correct. + +**Edge case: small n (✓):** +For n = 0, `Fin 0` is empty, so `∃ v : Fin 0, …` is false, but `2 * 0 ≥ c * 0` holds (it's `0 ≥ 0`). This would require `True → False`, i.e., the implication fails. However, since N₀ is existentially quantified, the prover can choose N₀ ≥ 3 to avoid degenerate cases. No issue here. + +**AMS classification:** +`AMS 5` (combinatorics) is appropriate for a graph theory / extremal combinatorics problem. + +### Minor observations (not bugs): + +1. **The set A may contain 0, 1, or 2.** No cycle has length < 3, so these elements are vacuously irrelevant. This is harmless but slightly inelegant — one could add `∀ a ∈ A, 3 ≤ a` without loss of generality, though it's unnecessary. + +2. **`Fin n` vs general `(V : Type*)`:** As noted in §4, Problem 71 uses a general finite type while Problem 72 uses `Fin n`. The `Fin n` approach is arguably cleaner here because the "sufficiently many vertices" condition naturally maps to `∀ n ≥ N₀`. + +**Verdict: Correct and complete for the main existential statement. The formalization faithfully captures the problem as stated on the website. The only actionable recommendation is replacing `HasDensityZero` with the library's `Set.HasDensity · 0` (§1) and adding the Liu–Montgomery powers-of-2 variant (§3).** diff --git a/ai-review/720.md b/ai-review/720.md new file mode 100644 index 0000000000..94f26646b6 --- /dev/null +++ b/ai-review/720.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 720 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** + +- **Size Ramsey number**: `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` already defines `SimpleGraph.sizeRamsey` — the asymmetric 2-color size Ramsey number R̂(G, H). Problem 720 defines its own `Erdos720.sizeRamseyNumber`, and Problem 559 (`FormalConjectures/ErdosProblems/559.lean`) defines an identical copy `Erdos559.sizeRamseyNumber`. All three should be unified. The diagonal case R̂(G) = R̂(G, G) could be defined as `SimpleGraph.sizeRamsey G G` using the existing library definition. + + However, the definitions differ in modeling choices: + - `SizeRamsey.lean` uses `R : SimpleGraph (Fin n), R ≤ F` (subgraph as coloring) and `IsContained` (from Mathlib's `SimpleGraph.Copy`) for embeddings. It uses `ncard` for edge counting. + - Problem 720 (and 559) use `c : Fin N → Fin N → Bool` with a symmetry condition for coloring, manual injective adjacency-preserving maps for embeddings, and `Nat.card` for edge counting. + + The `SizeRamsey.lean` approach is preferable: it leverages Mathlib's `IsContained`/`Copy` infrastructure and the subgraph representation is more idiomatic. Migrating to this definition would be a meaningful improvement. + +- **Path and cycle graphs**: `pathGraph` and `cycleGraph` are redefined locally in at least 10 different Erdős problem files (720, 765, 556, 559, 569, 594, 551, 552, 737, 1105, etc.). These definitions are essentially identical each time. They should be factored into a shared utility file in `FormalConjecturesForMathlib`. (Mathlib itself may have `SimpleGraph.pathGraph` or similar in the future, but it doesn't currently appear to be imported.) + +## 2. Citations + +The formalization cites only **[Be83b]** (Beck 1983). The website at erdosproblems.com/720 lists additional source references where the problem was originally posed: + +- **[Er76c, p.5]** +- **[EFRS78b]** (Erdős, Faudree, Rousseau, Schelp) +- **[Er78, p.33]** +- **[Er81]** +- **[Er82e]** + +These should be included in the docstring for completeness. The website also notes: +- A **$100 prize** was associated with this problem. +- The problem is **related to Problem #559** (size Ramsey numbers for bounded-degree graphs). +- The full citation for [Be83b] as given on the website is: Beck, J., *On size Ramsey number of paths, trees, and circuits I*, J. Graph Theory 7 (1983), 115–129. This matches what is in the formalization. + +## 3. Variants + +The original problem posed **three questions**: +1. Is it true that R̂(Pₙ)/n → ∞? +2. Is it true that R̂(Pₙ)/n² → 0? +3. Is it true that R̂(Cₙ) = o(n²)? + +The formalization captures **Beck's stronger result** (linear upper bounds) via two theorems: +- `erdos_720`: ∃ C, ∀ n, R̂(Pₙ) ≤ C·(n+1) +- `erdos_720.variants.cycles`: ∃ C, ∀ n ≥ 3, R̂(Cₙ) ≤ C·n + +This correctly subsumes all three original questions: +- Q1 is answered **negatively** (R̂(Pₙ)/n is bounded, not → ∞). +- Q2 and Q3 are answered **affirmatively** (linear ≪ n² implies o(n²)). + +The docstring correctly explains this relationship. **All variants are adequately captured** by the two theorems, since Beck's result is strictly stronger than each individual question. + +One might additionally formalize the original three questions as separate statements for pedagogical completeness, but this is not necessary for correctness. + +## 4. Readability + +The code is **generally readable**. Specific notes: + +- The docstrings are well-written and clearly explain the mathematical context, including how Beck's result resolves the original questions. +- The `pathGraph` definition is clear: vertex set `Fin (n+1)` with adjacency `i ~ i+1`. The `loopless` proof is clean. +- The `cycleGraph` definition includes the `i ≠ j` guard to prevent self-loops, which is good. +- The `sizeRamseyNumber` definition is somewhat verbose due to the manual coloring/embedding setup. Using `SizeRamsey.lean`'s approach with `IsContained` and subgraph coloring would be more concise and more readable. +- The use of `Nat.card H.edgeSet` vs `H.edgeSet.ncard` is a minor readability issue — `ncard` is the more standard Mathlib convention for potentially infinite sets. + +## 5. Formalizability + +**The problem is unambiguously formalizable.** The size Ramsey number is a well-defined combinatorial quantity. The definitions of path graphs, cycle graphs, graph embeddings, and 2-colorings are all standard and admit no ambiguity. Beck's theorem is a precise mathematical statement (existence of a constant C giving a linear upper bound). **Ambiguity: none.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **Path graph convention**: `pathGraph n` has `n + 1` vertices {0, …, n} and n edges. The standard notation Pₙ sometimes means "path on n vertices" and sometimes "path of length n." The formalization uses the "length n" convention (so Pₙ has n+1 vertices). The bound `C * (n + 1)` is linear in the number of vertices, consistent with Beck's result regardless of convention. ✓ + +- **Cycle graph**: `cycleGraph n hn` has n vertices and n edges (for n ≥ 3). The bound `C * n` is linear. ✓ + +- **Coloring model**: The formalization colors all vertex pairs `c : Fin N → Fin N → Bool` (with symmetry), not just edges of H. This is equivalent to the standard definition (coloring only edges) because the monochromatic copy condition requires `H.Adj (f u) (f v)` — so non-edge colorings are irrelevant to the Ramsey property. ✓ + +- **Embedding model**: The formalization requires an injective map f preserving adjacency (i.e., a graph homomorphism that is injective). It does NOT require non-adjacency preservation. This matches the standard definition of "monochromatic copy" in Ramsey theory. ✓ + +- **Edge count**: Using `Nat.card H.edgeSet` counts the edges of H. For a finite simple graph on `Fin N`, the edge set is finite, so `Nat.card` returns the correct cardinality. ✓ + +- **sInf on ℕ**: The use of `sInf` on ℕ returns 0 for an empty set. In principle, if no graph is Ramsey for G (which cannot happen for finite G), the definition would return 0. For all finite graphs G, a Ramsey graph H exists (the complete graph on sufficiently many vertices), so the infimum is well-defined. ✓ + +- **Logical structure of `erdos_720`**: States `∃ C, ∀ n, sizeRamseyNumber (pathGraph n) ≤ C * (n + 1)`. The constant C is a natural number, which is fine since the bound is an integer inequality. ✓ + +- **Logical structure of `erdos_720.variants.cycles`**: States `∃ C, ∀ n, (hn : n ≥ 3) → sizeRamseyNumber (cycleGraph n hn) ≤ C * n`. The dependent hypothesis `hn` appears both in the cycle graph construction and as a premise. ✓ + +**No mathematical errors identified.** The formalization is correct and complete. + +### Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | Should use shared `SizeRamsey.lean` definition; path/cycle graphs duplicated across ~10 files | +| Citations | Missing 5 source references from the website; [Be83b] is correctly cited | +| Variants | All three original questions are subsumed by the two theorems ✓ | +| Readability | Good; would improve by using Mathlib's `IsContained` and `ncard` | +| Formalizability | Unambiguous, fully formalizable ✓ | +| Correctness | Mathematically correct and complete ✓ | diff --git a/ai-review/721.md b/ai-review/721.md new file mode 100644 index 0000000000..2eeaba867c --- /dev/null +++ b/ai-review/721.md @@ -0,0 +1,90 @@ +# Review: Erdős Problem 721 + +## 1. Code Reuse + +**Significant duplication exists.** Problem 721 defines its own `APInRange`, `HasMonoAP`, `VDWProperty`, and `vanDerWaerden` from scratch. The codebase already provides relevant shared infrastructure: + +- **`FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`** defines `Set.IsAPOfLengthWith`, `Set.IsAPOfLength`, `ContainsMonoAPofLength`, and related API. These are more general and well-developed. `APInRange` and `HasMonoAP` could be reformulated in terms of these. + +- **Erdős Problem 169** (`FormalConjectures/ErdosProblems/169.lean`) independently defines its own `VDWProperty` and `vanDerWaerdenNumber` for the diagonal case W(k). While 169 uses the diagonal van der Waerden number and 721 uses the off-diagonal W(j,k), these are closely related, and a shared definition of the off-diagonal number (from which the diagonal is a special case) would be preferable. + +- Problem 169's `vanDerWaerdenNumber` uses `Nat.find` (backed by an explicit existence lemma `vdw_exists`), which is more principled than 721's use of `sInf`, which silently returns 0 if the set is empty. + +**Recommendation:** Extract a shared off-diagonal van der Waerden number definition into `FormalConjecturesForMathlib`, backed by a van der Waerden existence lemma, and have both 169 and 721 import it. + +## 2. Citations + +The formalization's docstring includes: [Sc21], [BlSi23], [KeMe23], [Gr22], [Hu22]. + +The website (erdosproblems.com/721) additionally lists: +- **[Er80]** — Erdős (1980) +- **[Er81]** — Erdős (1981) + +These original Erdős references are **missing** from the formalization's docstring and should be added, as they are the source of the problem itself. + +All citations use shorthand (e.g., `[Sc21] Schoen, T. (2021)`) rather than full bibliographic entries. The website also provides only shorthand, so this is consistent with the source, though adding paper titles would improve traceability. For example: +- [Sc21] likely refers to Schoen, "New bounds in the three-term AP problem" (2021) +- [KeMe23] refers to Kelley and Meka, "Strong bounds for 3-progressions" (2023) +- [BlSi23] refers to Bloom and Sisask's improvement on Kelley-Meka (2023) + +## 3. Variants + +The formalization captures two statements: + +1. **Upper bound** (`erdos_721`): ∃ c ∈ (0,1) such that W(3,k) < exp(k^c) for large k. +2. **Lower bound** (`erdos_721.variants.lower_bound`): W(3,k) grows superpolynomially. + +The website asks for "reasonable bounds" and specifically whether W(3,k) < exp(k^c) for some c < 1, plus "non-trivial lower bounds." Both aspects are captured. + +**Potentially missing variant:** The website and docstring mention the quantitatively stronger results: +- W(3,k) ≤ exp(O((log k)^9)) [BlSi23/KeMe23] +- W(3,k) ≥ exp(c(log k)^2 / log log k) [Hu22] + +These are much stronger than what is formalized but are harder to state precisely in Lean. The current formalization captures the qualitative content of Erdős's original question faithfully. The stronger bounds could be added as additional variants if desired. + +## 4. Readability + +**Generally good.** The definitions are clearly named and documented with docstrings. Specific observations: + +- The docstring for `vanDerWaerden` says "the infimum of all such n" — for ℕ with a nonempty set, `sInf` gives the minimum, so this is correct but could say "minimum" for clarity. +- The namespace `Erdos721` cleanly scopes the local definitions. +- The `APInRange` definition is intuitive and well-documented. +- The relationship between the main theorem and its variant is clear from the naming convention. + +## 5. Formalizability + +**High — the problem is precisely formalizable.** Erdős's question has two concrete parts: + +1. Is W(3,k) < exp(k^c) for some c < 1? — This is a precise mathematical statement. +2. Find non-trivial lower bounds — This is less precise, but the formalization reasonably interprets it as superpolynomial growth. + +**Ambiguity assessment: Low.** The only mild ambiguity is in "non-trivial lower bounds," which the formalization resolves by asking for superpolynomial growth (W(3,k) > k^d for every fixed d). This is a natural and defensible interpretation. The formalized lower bound is weaker than the known results (which give specific exponential-type lower bounds), but it captures the spirit of the question. + +## 6. Correctness + +**The formalization is mathematically correct with one definitional concern:** + +### Correct aspects: +- `APInRange` correctly requires d ≥ 1, excluding trivial constant progressions. +- `VDWProperty j k n` correctly uses an asymmetric 2-coloring definition: every coloring has a j-AP in true or a k-AP in false. This matches the standard definition of W(j,k). +- The range {0, …, n−1} vs the website's {1, …, n} is an irrelevant offset that does not affect van der Waerden numbers. +- The upper bound theorem correctly quantifies: ∃ c ∈ (0,1), ∃ N₀, ∀ k ≥ N₀, W(3,k) < exp(k^c). +- The lower bound correctly states: ∀ d, ∃ N₀, ∀ k ≥ N₀, W(3,k) > k^d. +- `VDWProperty` is monotone in n (if it holds for n, it holds for any n' ≥ n), so `sInf` gives a well-defined minimum when the set is nonempty. + +### Concern: +- **`vanDerWaerden` uses `sInf` without an existence guarantee.** If the set `{n | VDWProperty j k n}` is empty, `sInf` returns 0 by convention on ℕ. Van der Waerden's theorem guarantees nonemptiness for j, k ≥ 1, but no such lemma is stated in this file (unlike Problem 169, which provides `vdw_exists`). This means the definition is technically well-formed but "silently wrong" for degenerate inputs. Since the theorems only use `vanDerWaerden 3 k` for large k, this is not a soundness issue for the stated results, but it is a gap in the infrastructure. Adding an existence lemma (even as `sorry`) would make the definition more robust. + +### Minor note on docstring accuracy: +- The docstring claims Bloom-Sisask [BlSi23] gives the best known upper bound, improving on Kelley-Meka [KeMe23]. This attribution appears correct: Kelley-Meka proved the breakthrough bound, and Bloom-Sisask refined it. However, the stated bound exp(O((log k)^9)) should be verified against the actual papers, as the exact exponent has varied across versions of these results. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant opportunity — should use shared AP infrastructure and unify VDW definitions with Problem 169 | +| Citations | Missing [Er80] and [Er81] from the website | +| Variants | Both upper and lower bounds captured; stronger quantitative variants could be added | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | Correct, with a minor definitional gap (no VDW existence lemma) | diff --git a/ai-review/722.md b/ai-review/722.md new file mode 100644 index 0000000000..cdeb4bdb28 --- /dev/null +++ b/ai-review/722.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 722 + +## 1. Code Reuse + +Several related definitions exist in the codebase that overlap with the definitions in 722.lean: + +- **Problem 207** (`FormalConjectures/ErdosProblems/207.lean:40`): Defines `IsSteinerTripleSystem`, which is the special case S(2,3,n) of the general `IsSteinerSystem` defined in 722. Problem 207 could be refactored to use `IsSteinerSystem 2 3 n` from 722, with the pair-based uniqueness condition (`u ≠ v → ∃! e, ...`) replaced by the subset-based formulation. + +- **Problem 903** (`FormalConjectures/ErdosProblems/903.lean:38`): Defines `IsPairwiseBalancedDesign`, which is essentially a Steiner system S(2,k,n) without fixing k (blocks can have varying sizes). This is a generalization in a different direction—it relaxes the uniform block size but fixes r=2. + +- **Problem 665** and **Problem 732**: Also define variants of pairwise balanced designs with additional constraints on block sizes. + +**Recommendation**: A shared, general `IsSteinerSystem` definition (or even a more general `t`-design definition) placed in a utility/combinatorics module would reduce duplication. Problem 722's `IsSteinerSystem` is the most general among these and could serve as the canonical definition, with `IsSteinerTripleSystem` derived as a special case. + +## 2. Citations + +The formalization's docstring includes: +- [Ha61] Hanani (1961) — ✅ Matches website +- [Wi72] Wilson (1972–1975) — ✅ Matches website +- [Ke14] Keevash (2014) — ✅ Matches website + +**Missing**: The website lists **[Er81]** (Erdős, 1981) as the original source of the problem. This should be added to the docstring for completeness: + +> [Er81] Erdős, P., *Problems and results in graph theory and combinatorics*, 1981. + +## 3. Variants + +The website presents a single formulation of the problem (existence of Steiner systems given divisibility conditions, for sufficiently large n). The formalization captures this faithfully. No additional variants are mentioned on the website. + +The formalization correctly captures the progressive resolution history (Kirkman → Hanani → Wilson → Keevash) in the docstring, which matches the website. + +**No missing variants.** + +## 4. Readability + +The code is well-structured and readable: + +- The `IsSteinerSystem` and `SteinerDivisibilityConditions` definitions are clearly separated and well-documented. +- The main theorem statement reads naturally and mirrors the mathematical statement closely. +- The namespace `Erdos722` keeps definitions scoped appropriately. +- The docstrings provide good mathematical context including the resolution history. + +**Minor suggestion**: The docstring for `SteinerDivisibilityConditions` uses the notation $0 \le i < r$ in the module doc but the Lean code uses `∀ i < r`, which is consistent. No issues. + +## 5. Formalizability + +The problem is **highly formalizable** with essentially no ambiguity: + +- "Steiner system S(r,k,n)" has a precise, universally agreed-upon definition in combinatorics. +- The "trivial necessary divisibility conditions" are completely explicit: $\binom{k-i}{r-i} \mid \binom{n-i}{r-i}$ for $0 \le i < r$. +- "Sufficiently large n" is cleanly captured by the existential $\exists N_0, \forall n \ge N_0$. +- The parameters $k > r \ge 1$ are unambiguous. + +**Ambiguity assessment: None.** This is one of the cleanest problem-to-formalization translations possible. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +### Definition: `IsSteinerSystem` +- Requires all blocks to have cardinality exactly k: ✅ +- Requires every r-element subset to be contained in exactly one block (via `∃!`): ✅ +- Uses `Finset (Finset (Fin n))` for the block family, which correctly models finite subsets of an n-element ground set: ✅ + +### Definition: `SteinerDivisibilityConditions` +- The standard necessary conditions for S(r,k,n) state that for any set of i points (0 ≤ i < r), the number of blocks containing all i points must be the integer $\lambda_i = \binom{n-i}{r-i} / \binom{k-i}{r-i}$. The divisibility condition $\binom{k-i}{r-i} \mid \binom{n-i}{r-i}$ correctly captures the integrality requirement: ✅ +- Natural number subtraction is safe here: since i < r and k > r ≥ 1, we have k - i > 0 and r - i > 0. For the n terms, n ≥ N₀ can be assumed large enough that n - i > 0: ✅ + +### Main theorem: `erdos_722` +- The universal quantification over r and k with r ≥ 1 and k > r: ✅ (matches the problem's hypotheses) +- The existential N₀ depending on r and k (since they are quantified outside): ✅ (correctly models "sufficiently large in terms of k and r") +- The `answer(True)` wrapper correctly reflects that this is a solved problem (proved by Keevash): ✅ +- The `@[category research solved, AMS 5]` annotation is appropriate (combinatorics, solved): ✅ + +**No mathematical flaws identified.** + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Opportunity to share `IsSteinerSystem` with Problem 207 and related problems | +| Citations | Missing [Er81] original source reference | +| Variants | Complete — no missing variants | +| Readability | Excellent | +| Formalizability | Unambiguous, cleanly formalizable | +| Correctness | Fully correct and complete | diff --git a/ai-review/724.md b/ai-review/724.md new file mode 100644 index 0000000000..083a8c440f --- /dev/null +++ b/ai-review/724.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 724 + +## 1. Code Reuse + +**Partial overlap with Problem 725.** File `FormalConjectures/ErdosProblems/725.lean` defines `IsLatinRectangle` for k×n Latin rectangles. A Latin square of order n is precisely an n×n Latin rectangle, so `IsLatinSquare` from 724 is a special case. However, the definitions differ slightly in form: 724 uses `Function.Bijective` for both rows and columns (appropriate when k = n), while 725 uses `Function.Bijective` for rows and `Function.Injective` for columns (appropriate when k ≤ n). These are equivalent when k = n but not in general, so a shared definition would require either picking one form or proving their equivalence at k = n. + +**Recommendation:** Consider extracting the Latin square and MOLS definitions into a shared utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/LatinSquare.lean`) that both 724 and 725 could import. This would also benefit problems 722, 732, 734, and 665 which deal with related combinatorial design concepts. + +No existing Mathlib definitions for Latin squares or MOLS were found; these are custom to this codebase. + +## 2. Citations + +The docstring includes references [Er81], [CES60], [Wi74], and [Be83c], which all appear on the website. However, the website also mentions: + +- **[BPS60]**: Bose, Parker, and Shrikhande (1960) — proved f(n) ≥ 2 for all n ≥ 7, disproving Euler's conjecture. This reference is **missing** from the docstring. + +**Recommendation:** Add the [BPS60] citation and the historical note about Euler's disproven conjecture, as this provides important context for the problem's progression. Suggested addition to the docstring: + +``` +[BPS60] Bose, R.C., Parker, E.T., and Shrikhande, S.S., Further results on the construction +of mutually orthogonal Latin squares and the falsity of Euler's conjecture, 1960. +``` + +## 3. Variants + +The website presents a single formulation: whether f(n) >> n^{1/2}. No additional variants are mentioned. The formalization captures this single variant. **No missing variants.** + +## 4. Readability + +The code is well-structured and readable: +- Definitions are layered logically: `IsLatinSquare` → `AreOrthogonalLatinSquares` → `IsMOLS` → `maxMOLS` → `erdos_724`. +- Each definition has a clear docstring explaining the mathematical concept. +- The namespace `Erdos724` prevents name collisions. + +**Minor suggestion:** The docstring for `maxMOLS` could note the classical upper bound (maxMOLS n ≤ n - 1 for n ≥ 2) to help readers understand why the sSup is well-defined for the relevant domain. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement "Is f(n) >> n^{1/2}?" uses standard Vinogradov notation, which has a single unambiguous interpretation: there exist constants C > 0 and N₀ such that f(n) ≥ C·√n for all n ≥ N₀. The formalization captures this precisely. + +The only source of ambiguity is the open nature of the problem — we don't know if the answer is yes or no — which the `answer(sorry)` pattern handles correctly by leaving the truth value as a placeholder. + +The underlying definitions (Latin square, orthogonality, MOLS) are entirely standard and admit no ambiguity. + +## 6. Correctness + +### Overall assessment: **Mostly correct, with one notable definitional concern.** + +### What is correct: +- **`IsLatinSquare`**: Correctly requires each row and each column to be a bijection on `Fin n`. This is the standard definition. +- **`AreOrthogonalLatinSquares`**: Correctly requires the superposition map (i,j) ↦ (L₁(i,j), L₂(i,j)) to be injective on `Fin n × Fin n`. Since the domain and codomain are both finite sets of the same size (n²), injectivity is equivalent to bijectivity, matching the standard definition. +- **`IsMOLS`**: Correctly requires each member to be a Latin square and every distinct pair to be orthogonal. This is the standard definition of mutually orthogonal Latin squares. +- **Theorem statement**: The formalization `∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → (maxMOLS n : ℝ) ≥ C * Real.sqrt (n : ℝ)` is the correct encoding of f(n) >> n^{1/2}. +- **`answer(sorry)` pattern**: Correctly used for an open problem. + +### Concern — `maxMOLS` and `sSup` well-definedness: + +The definition `maxMOLS (n : ℕ) : ℕ := sSup {k : ℕ | ∃ L : Fin k → Fin n → Fin n → Fin n, IsMOLS L}` uses `sSup` on a set of natural numbers. In Mathlib, `sSup` on `ℕ` (via `ConditionallyCompleteLinearOrderBot`) returns the true supremum only when the set is **nonempty and bounded above**. For unbounded or empty sets, it returns a junk value (0). + +- **Nonemptiness**: The set always contains k = 0 (vacuously, `IsMOLS` holds for an empty family), so nonemptiness is not an issue. +- **Boundedness for n ≥ 2**: The classical result that at most n − 1 MOLS of order n exist ensures boundedness, so `sSup` is well-defined. +- **Degeneracy for n = 0 and n = 1**: When n ≤ 1, the `IsMOLS` conditions are vacuously satisfied for arbitrarily large k: + - For **n = 0**: `Fin 0` is empty, so all quantified conditions (row/column bijectivity, injectivity of the pairing map on the empty product) hold vacuously for every k. + - For **n = 1**: There is exactly one function `Fin 1 → Fin 1 → Fin 1`, so all k squares in any family are identical. Bijectivity and injectivity on single-element types hold trivially. + + In both cases, the set `{k | ...}` is unbounded, so `sSup` returns 0 (junk), making `maxMOLS 0` and `maxMOLS 1` mathematically meaningless. + +**Impact on the theorem**: The theorem uses `∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → ...`, so small values of n are excluded. **The theorem statement itself is not affected.** However, the definition `maxMOLS` is not faithful to the mathematical concept for n ≤ 1, which could cause confusion or issues if the definition were reused elsewhere. + +**Possible fix**: Add `BddAbove` or an explicit `n ≥ 2` guard: +```lean +noncomputable def maxMOLS (n : ℕ) : ℕ := + if n ≤ 1 then 0 + else sSup {k : ℕ | ∃ L : Fin k → Fin n → Fin n → Fin n, IsMOLS L} +``` +Alternatively, one could define `maxMOLS` using `Finset.sup` over a bounded range, or use `iSup` with an explicit proof of boundedness. However, since the theorem is unaffected, this is a **low-priority** concern. + +### Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor opportunity | Could share Latin square defs with Problem 725 | +| Citations | Missing one | [BPS60] not included | +| Variants | Complete | Single variant, correctly captured | +| Readability | Good | Clear layered definitions with docstrings | +| Formalizability | High | Standard definitions, unambiguous statement | +| Correctness | Correct (with caveat) | `maxMOLS` degenerates for n ≤ 1 but theorem is unaffected | diff --git a/ai-review/725.md b/ai-review/725.md new file mode 100644 index 0000000000..a552603771 --- /dev/null +++ b/ai-review/725.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 725 + +## 1. Code Reuse + +**Partial overlap with Problem 724.** The file `ErdosProblems/724.lean` defines `IsLatinSquare` for n×n Latin squares (requiring both row and column *bijectivity*), while 725 defines `IsLatinRectangle` for k×n rectangles (row bijectivity, column *injectivity*). The distinction is correct — for k < n, column bijectivity is impossible, so injectivity is the right condition. These definitions are compatible (a Latin square is a Latin rectangle with k = n) but not directly reusable since they live in separate namespaces. A shared definition could be extracted (e.g., `IsLatinRectangle` in a common file, with `IsLatinSquare` as an alias when k = n), but this is a minor concern. + +The counting pattern using `Set.ncard` on a subset of a finite function type is standard and used across multiple Erdős problems (e.g., 731, 990). No reusable utility from `FormalConjecturesForMathlib` applies directly here. + +## 2. Citations + +The docstring references: +- **[ErKa46]** Erdős, P. and Kaplansky, I., *The asymptotic number of Latin rectangles* (1946). ✓ Matches website. +- **[Ya51]** Yamamoto, K., *On the asymptotic number of Latin rectangles* (1951). ✓ Matches website. +- **[Er81]** Erdős, P. (1981). ✓ Matches website (the source attribution). + +The website also mentions: +- **OEIS sequence [A001009](https://oeis.org/A001009)** — not mentioned in the formalization. Could be added to the docstring for reference. +- **Ralf Stephan** as a contributor — minor, not needed in the formalization. + +Citations are adequate. The full citation format (with journal names) is not provided on the website either, so the current level of detail is appropriate. + +## 3. Variants + +**The formalization captures only a restricted sub-conjecture, not the full problem.** + +The website states the problem as: *"Give an asymptotic formula for the number of k×n Latin rectangles."* This is an open-ended problem asking for asymptotic formulas across *all* growth rates of k relative to n. + +The formalization restricts to the specific conjecture that $L(k,n) \sim e^{-\binom{k}{2}} (n!)^k$ holds for $k = o(\sqrt{n})$. This is a well-known specific conjecture, but it does not cover: + +1. **The full range of k.** For k growing faster than $\sqrt{n}$ (e.g., k proportional to n), the formula $e^{-\binom{k}{2}} (n!)^k$ is known to break down, and a different asymptotic formula is needed. The real open problem includes finding formulas for *all* regimes of k. +2. **The intermediate range.** The range between what's currently proven (roughly $k = o(n^{1/3})$ by Yamamoto and possibly further by later work such as Godsil–McKay 1990) and $k = o(\sqrt{n})$ may already be resolved in the literature. The formalization does not discuss this. +3. **A second variant** could state the conjecture for $k = o(n^{1/2+\varepsilon})$ or for larger ranges with correction terms. + +**Recommendation:** Add a comment noting that this formalizes one specific sub-conjecture of the broader problem. Consider adding a second theorem statement for the full-range problem (perhaps as an existential statement about the existence of an asymptotic formula for arbitrary k(n)). + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Definition names** (`IsLatinRectangle`, `latinRectangleCount`) are clear and follow naming conventions. +- **Docstrings** use LaTeX notation consistently and explain the mathematical content well. +- **The `open Filter` is necessary** for `atTop` and `∀ᶠ` notation. +- **Minor suggestion:** The denominator expression `Real.exp (-(↑(Nat.choose (k n) 2) : ℝ)) * ((Nat.factorial n : ℝ) ^ (k n))` is somewhat dense. Introducing a local `let` binding (e.g., `let denom := ...`) or a helper definition could improve readability, but this is a matter of taste. + +Overall readability is good. + +## 5. Formalizability + +**The original problem is vague; the formalization makes a precise choice.** + +The problem as stated — "Give an asymptotic formula for the number of k×n Latin rectangles" — is not directly formalizable because: +- It asks to *give* a formula, not to prove a specific formula correct. +- It does not specify the range of k relative to n. +- The notion of "asymptotic formula" is informal. + +The formalization makes reasonable choices: +- Fixes the conjectured formula to $e^{-\binom{k}{2}} (n!)^k$. +- Fixes the range to $k = o(\sqrt{n})$. +- Expresses the asymptotic equivalence as a ratio tending to 1. + +These choices transform the vague problem into a precise, formalizable statement. **Ambiguity rating: High in the original, Low in the formalization.** The gap between the two is the main concern. + +## 6. Correctness + +### Definition correctness +- **`IsLatinRectangle`**: Correctly requires row bijectivity (each row is a permutation of Fin n) and column injectivity (distinct entries in each column). This is the standard definition. ✓ +- **`latinRectangleCount`**: Uses `Set.ncard` on a subset of `Fin k → Fin n → Fin n`, which is a finite type, so the cardinality is well-defined and finite. ✓ + +### Statement correctness +The formal statement has several aspects to evaluate: + +1. **Growth condition $k(n) = o(\sqrt{n})$:** Expressed as `Tendsto (fun n => (k n : ℝ) / Real.sqrt ↑n) atTop (nhds 0)`. ✓ Mathematically correct encoding of the little-o condition. + +2. **Condition `∀ n, k n ≤ n`:** This ensures the Latin rectangle is well-defined (need k ≤ n for injective columns). Using `∀ n` rather than `∀ᶠ n in atTop` is slightly stronger than necessary but harmless — one can always modify k at finitely many points. + +3. **Condition `∀ᶠ n in atTop, 2 ≤ k n`:** Ensures k(n) ≥ 2 eventually. For k = 0, the count is 1 (empty rectangle); for k = 1, the count is n!. Both trivially satisfy the formula (since $\binom{0}{2} = \binom{1}{2} = 0$). So this condition is not mathematically necessary for the formula to hold, but it excludes degenerate cases. Minor concern: the condition should arguably be `1 ≤ k n` or simply dropped, since the formula holds trivially for k = 0 and k = 1. + +4. **The asymptotic formula itself:** The ratio $L(k,n) / (e^{-\binom{k}{2}} (n!)^k) \to 1$ correctly encodes $L(k,n) \sim e^{-\binom{k}{2}} (n!)^k$. ✓ + +5. **Potential issue — is this already known?** The Erdős–Kaplansky result covers $k = o((\log n)^{3/2-\varepsilon})$ and Yamamoto covers $k \leq n^{1/3-o(1)}$. Later results by Godsil and McKay (1990) extended the range significantly (to $k = o(n^{6/7})$ under certain formulations). If the Godsil–McKay or subsequent results already cover $k = o(\sqrt{n})$, then this "conjecture" is actually a theorem, and the `open` tag would be incorrect. **This should be investigated against the current literature.** The website lists the problem as open, but this may refer to the full-range problem, not the specific sub-conjecture formalized here. + +### Summary of correctness concerns +- **Major:** The formalized conjecture (for $k = o(\sqrt{n})$) may already be a known theorem, making the `open` tag potentially incorrect. The broader problem (all k) remains open. +- **Minor:** The condition `2 ≤ k n` is unnecessary since the formula holds for k ∈ {0, 1} trivially. +- **Minor:** `∀ n, k n ≤ n` could be relaxed to `∀ᶠ n in atTop, k n ≤ n`. diff --git a/ai-review/726.md b/ai-review/726.md new file mode 100644 index 0000000000..de9952a45d --- /dev/null +++ b/ai-review/726.md @@ -0,0 +1,57 @@ +# AI Review: Erdos Problem 726 + +## 1. Code Reuse + +No directly reusable code was found in the existing codebase. While several Erdos problems deal with sums over primes or divisor-related quantities (e.g., 964, 673, 448), none share the specific structure of summing `1/p` over primes filtered by a residue condition. The `erdos726Sum` helper is appropriately defined locally. No infrastructure from `FormalConjecturesForMathlib/Data/Set/Density.lean` or other utility files applies here, since the problem is about a pointwise asymptotic, not a density statement. + +## 2. Citations + +The Lean file states: + +``` +*Reference:* [erdosproblems.com/726](https://www.erdosproblems.com/726) + +A conjecture of Erdős, Graham, Ruzsa, and Straus. + +[EGRS75] Erdős, P., Graham, R., Ruzsa, I., and Straus, E. +``` + +The website attributes the conjecture to Erdős, Graham, Ruzsa, and Straus [EGRS75], matching the Lean file. No paper title or publication venue is provided on the website itself, so the incomplete citation is not a fault of the formalization. The website also mentions for context: "For comparison the classical estimate of Mertens states that $\sum_{p \le n} 1/p \sim \log\log n$." This contextual note is not included in the Lean docstring but is not required. + +**Status:** The problem is marked **open** on the website, matching the `@[category research open, AMS 11]` annotation. + +## 3. Variants + +The website does not mention any variants of this problem. The formalization captures the single stated conjecture. No issues here. + +## 4. Readability + +The code is clean and readable. The `erdos726Sum` helper has a clear docstring explaining the sum. The theorem statement is well-structured: it directly expresses the asymptotic equivalence `f(n) / g(n) → 1` using `Tendsto`. The `open Filter Nat` and `open scoped Topology Real` are appropriate for the notation used. + +Minor suggestion: the LaTeX in the theorem docstring uses `\mathbf{1}_{n \in (p/2, p) \pmod{p}}` which correctly matches the indicator function in the helper definition. + +No readability issues. + +## 5. Formalizability + +The problem is precisely stated: it is a concrete asymptotic equivalence of a well-defined arithmetic sum. There is no ambiguity in the mathematical statement. The sum, the indicator condition, and the asymptotic target `(log log n) / 2` are all unambiguous. + +**Assessment: Fully formalizable, no ambiguity.** + +## 6. Correctness + +The formalization is **correct**. Detailed verification: + +- **Summation range:** `(Finset.range (n + 1)).filter Nat.Prime` gives all primes `p` with `p ≤ n`. This matches the problem's $\sum_{p \le n}$. + +- **Indicator condition:** The code checks `2 * (n % p) > p`. Since `n % p ∈ {0, 1, ..., p-1}`: + - For odd primes `p` (all primes > 2): `2r > p` with integer `r` is equivalent to `r ≥ (p+1)/2`, which is exactly the integers in the open interval `(p/2, p)`. Correct. + - For `p = 2`: `n % 2 ∈ {0, 1}`, and `2 * 0 = 0 > 2` is false, `2 * 1 = 2 > 2` is false. So `p = 2` never contributes, which is correct since `(1, 2)` contains no integers. + +- **Weight:** Each contributing prime adds `(1 : ℝ) / (p : ℝ)`, matching the `1/p` term. + +- **Asymptotic statement:** `Tendsto (fun n => erdos726Sum n / (Real.log (Real.log n) / 2)) atTop (nhds 1)` correctly expresses `f(n) ~ g(n)` as `f(n)/g(n) → 1`. For small `n` where `log(log(n))` is nonpositive, this ratio may be ill-behaved, but `Tendsto ... atTop` only concerns eventual behavior, so this is fine. + +- **Division by zero:** For `n ≤ 2`, `log(log(n)) ≤ 0` and division produces `0` or negative values in the denominator. In Lean's `ℝ`, division by zero yields `0`. This does not affect the `atTop` filter statement, which only requires the ratio to eventually be near `1`. + +**No mathematical flaws identified. The formalization is a faithful rendering of the conjecture.** diff --git a/ai-review/729.md b/ai-review/729.md new file mode 100644 index 0000000000..d20d1844b5 --- /dev/null +++ b/ai-review/729.md @@ -0,0 +1,73 @@ +# Review: Erdős Problem 729 + +## 1. Code Reuse + +**Mathlib's `Nat.smoothNumbers`** (`Mathlib/NumberTheory/SmoothNumbers.lean`) defines `smoothNumbers (n : ℕ) : Set ℕ := {m | m ≠ 0 ∧ ∀ p ∈ primeFactorsList m, p < n}`. The custom `DenomPSmooth` predicate is essentially equivalent to checking membership in `Nat.smoothNumbers (P + 1)` — the only difference is that `smoothNumbers` uses strict `<` while `DenomPSmooth` uses `≤`. Since `ℚ.den` is always a positive natural number, the `m ≠ 0` condition is automatically satisfied. Thus: + +``` +DenomPSmooth a b n P ↔ + ((n.factorial : ℚ) / ((a.factorial : ℚ) * (b.factorial : ℚ))).den ∈ Nat.smoothNumbers (P + 1) +``` + +Using the Mathlib definition would provide access to existing lemmas about smooth numbers (decidability, closure properties, etc.) and reduce custom definitions. Several other problems in the codebase (e.g., Problem 961) already use `Nat.smoothNumbers`. + +Additionally, `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` provides `maxPrimeFac`, which could offer an alternative characterization: the denominator is P-smooth iff `maxPrimeFac(den) ≤ P` (for den > 1). + +## 2. Citations + +The formalization cites: + +> [EGRS75] Erdős, P., Graham, R., Ruzsa, I. Z., and Straus, E. G., *On the prime factors of $\binom{2n}{n}$*, Math. Comp. **29** (1975), 83–92. + +The website (erdosproblems.com/729) does not appear to list this specific citation. The [EGRS75] paper is a real, well-known paper about prime factors of central binomial coefficients, and is thematically related (factorial expressions and their prime structure), but it is unclear whether this is the actual source for Problem 729 or if the problem originates from a different Erdős publication. The website does not provide a clear primary reference. This citation should be verified against the website's actual listed references. + +The docstring states "Proved by Barreto and Leeham." The website attributes the solution to similar names but the details appear uncertain (the website metadata suggests involvement of AI tools). This attribution should be independently verified and may need updating if the website's information changes. + +## 3. Variants + +The problem as stated on erdosproblems.com asks: + +> Let $C > 0$ be a constant. Are there infinitely many integers $a, b, n$ with $a + b > n + C \log n$ such that the denominator of $\frac{n!}{a! b!}$ contains only primes $\ll_C 1$? + +The formalization captures this as: for all $C > 0$ and all prime bounds $P$, the set of such triples is finite. This is correct and in fact slightly more general than necessary — the original uses $P \ll_C 1$ (P depending on C), while the formalization quantifies $\forall P$ independently of $C$. Since $\forall C, \forall P$ implies $\forall C, \forall P(C)$, the formalization is at least as strong as the original. Conversely, since P is universally quantified, it captures the strongest possible version. + +No additional variants of the problem appear on the website. The formalization appears to capture the complete problem. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- **Tuple destructuring**: The triple `(t.1, t.2.1, t.2.2)` for `(a, b, n)` is standard in the codebase but slightly harder to parse than named destructuring. A comment or documentation mapping `t.1 ↦ a`, `t.2.1 ↦ b`, `t.2.2 ↦ n` in the set-builder notation could help, though this is a stylistic preference and other problems use the same convention. +- **DenomPSmooth docstring**: The docstring is clear and well-written. +- **Module docstring**: Clear and informative, correctly summarizing the mathematical content. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem statement is precise: +- "Denominator of $n!/(a! b!)$" is unambiguous — it refers to the denominator of the rational number in lowest terms. +- "Contains only primes $\ll_C 1$" means all prime factors are bounded by some constant (depending on C). The formalization makes this explicit with a universal quantifier over $P$. +- "$a + b > n + C \log n$" is a precise arithmetic inequality. + +The only minor ambiguity is whether $\log$ means natural log or log base 2; this does not affect the truth of the statement (only the constant), and the formalization uses `Real.log` (natural log), which is the standard convention. + +The `answer(True)` wrapper correctly indicates this is a solved problem with affirmative answer (the set IS finite). + +## 6. Correctness + +**Assessment: Mathematically correct.** + +The formalization accurately captures the intended problem: + +1. **`DenomPSmooth` is correct**: It checks that every prime divisor of the denominator of $n!/(a! b!)$ (as a rational number in lowest terms) is at most $P$. The use of `ℚ` and `.den` correctly obtains the denominator in lowest terms, since Lean's rational numbers are stored in canonical (reduced) form. + +2. **No division-by-zero issues**: Factorials are always positive, so `(a.factorial : ℚ) * (b.factorial : ℚ) ≠ 0` always holds, and the division is well-defined. + +3. **The finiteness claim is the correct formulation**: "Are there infinitely many?" with answer "no" is equivalent to "the set is finite" with answer "yes" (`answer(True)`). + +4. **Quantifier structure is correct**: The universal quantification $\forall C > 0, \forall P$ correctly captures (and is equivalent to) the original problem's $P \ll_C 1$ dependency, since the formalization's statement is logically equivalent — making P independent of C is at least as strong, and the converse holds because the original quantification is $\exists$ infinitely many (negated to finiteness). + +5. **The category tags** `research solved` and `AMS 11` (number theory) are appropriate. + +**No mathematical flaws identified.** The formalization is a faithful and complete representation of the problem. diff --git a/ai-review/73.md b/ai-review/73.md new file mode 100644 index 0000000000..0b1eda6f17 --- /dev/null +++ b/ai-review/73.md @@ -0,0 +1,127 @@ +# Review: Erdős Problem 73 + +## 1. Code Reuse + +**Custom `IndepSetIn` definition is unnecessary.** The file defines `SimpleGraph.IndepSetIn` (lines 35–37), a custom predicate for an independent set within a vertex subset. Mathlib already provides: + +- `SimpleGraph.IsIndepSet` (in `Mathlib.Combinatorics.SimpleGraph.Clique`, line 789): `abbrev IsIndepSet (s : Set α) : Prop := s.Pairwise (fun v w ↦ ¬G.Adj v w)` +- `SimpleGraph.IsNIndepSet` (line 854): a structure combining `IsIndepSet` with `card_eq`. + +The custom `IndepSetIn` bundles two things: (a) `I ⊆ S` (containment in a subset) and (b) pairwise non-adjacency. This could be replaced by `G.IsIndepSet ↑I ∧ I ⊆ S`, using Mathlib's existing definition. This would improve interoperability with other lemmas. + +**Inconsistency across the codebase.** Multiple Erdős problems define their own independent set predicates: +- Problem 73: `SimpleGraph.IndepSetIn` (containment + non-adjacency) +- Problem 750: `Erdos750.IsIndepSet` (non-adjacency, allows u = v) +- Problem 804: `Erdos804.IsIndepSet` (non-adjacency, does **not** require u ≠ v — subtly different) +- Problem 922: uses `Set.Pairwise` inline with `¬G.Adj` + +A shared definition (or consistent use of Mathlib's `SimpleGraph.IsIndepSet`) would reduce redundancy. + +**Bipartiteness encoding.** The formalization encodes bipartiteness via a 2-coloring function `f : Fin n → Bool` with the property that adjacent non-deleted vertices get different colors. Mathlib defines `IsBipartite G := G.Colorable 2`, which is equivalent. Problem 74 uses `IsBipartite` directly. The manual encoding here is not wrong but is less idiomatic. + +**Related problem 922.** Problem 922 is closely related (same hypothesis, different conclusion: chromatic number ≤ k + 2 vs. vertex deletion to bipartite). The two problems share the independent-set hypothesis, but formalize it differently: Problem 73 uses `IndepSetIn` while Problem 922 uses `Set.Pairwise`. A shared helper would be beneficial. + +## 2. Citations + +**Website references (erdosproblems.com/73):** +- [EHS82] Erdős, P., Hajnal, A., and Szemerédi, E., *On almost bipartite large chromatic graphs* (1982) +- [Er94b] Erdős, P., *Some old and new problems in various branches of combinatorics* (1994) +- [Er95] Erdős, P. (1995) — specific title not listed on website +- [Er96] Erdős, P. (1996) — specific title not listed on website +- [Er97d] Erdős, P. (1997) — specific title not listed on website +- [Re99] Reed, B. — the solving paper + +**Formalization references:** +- [Re99] Reed, B., *Mangoes and blueberries*. Combinatorica 19 (1999), 267–296. ✅ Correct and complete. + +**Missing citations:** The formalization only cites [Re99]. The website lists [EHS82], [Er94b], [Er95], [Er96], [Er97d] as additional references. While [Re99] is the key solving reference, the docstring could mention [EHS82] since that paper is foundational to this line of problems (it appears in Problem 74 as well). + +**Related problem link:** The website notes that Problem 73 is related to Problem 922. This relationship is not mentioned in the formalization's docstring. + +## 3. Variants + +**The website does not list explicit variants** for this problem. Reed's note that the k = 0 case is trivial (a non-bipartite graph contains an odd cycle, violating the hypothesis) could be formalized as a variant: + +```lean +theorem erdos_73.variants.k_eq_zero : + ∀ (n : ℕ) (G : SimpleGraph (Fin n)), + (∀ S : Finset (Fin n), ∃ I : Finset (Fin n), G.IndepSetIn I S ∧ + 2 * I.card ≥ S.card) → + ∃ f : Fin n → Bool, ∀ ⦃u v⦄, G.Adj u v → f u ≠ f v +``` + +This would state that k = 0 implies bipartiteness directly (no vertex removal needed). + +**No other variants are missing.** + +## 4. Readability + +**Overall structure is clear.** The docstrings explain the mathematical content well, including both the informal and precise formulations. + +**Suggestions:** +- The condition `2 * I.card ≥ S.card - k` (line 58) is a clean integer encoding of |I| ≥ (|S| - k)/2, avoiding division. This is well-chosen. However, a brief inline comment explaining this encoding (as Problem 922 does on line 42: `The condition \`2 * T.card + k ≥ S.card\` encodes $|T| \geq (|S| - k) / 2$.`) would help readers. Note that these two encodings are slightly different: `2 * I.card ≥ S.card - k` vs. `2 * T.card + k ≥ S.card`. Since we're working with natural numbers (where subtraction truncates at 0), these are **not equivalent**: `2 * I.card ≥ S.card - k` is trivially satisfied when `S.card ≤ k` (since `S.card - k = 0` in ℕ). Meanwhile `2 * T.card + k ≥ S.card` still imposes a real constraint. See the Correctness section below for more. +- The bipartiteness condition on lines 60 is somewhat dense. It asserts the existence of a Bool-valued function `f` such that for all adjacent vertices outside `T`, `f u ≠ f v`. This is correct but could benefit from a helper definition (or reference to `IsBipartite`). + +## 5. Formalizability + +**The informal statement is precise and formalizable.** The problem is clearly stated: for each k, there is a constant C(k) such that any graph satisfying the independent-set condition can be made bipartite by removing at most C vertices. This is a standard "bounded modification" result. + +**Ambiguity assessment: Low.** The only potential ambiguity is: +- "Every subgraph H" — does this mean every *induced* subgraph, or every subgraph? The website says "every subgraph H contains an independent set of size ≥ (n-k)/2." In graph theory, the standard reading for this type of Ramsey-theoretic statement is *induced* subgraph (equivalently, every vertex subset). The formalization correctly uses arbitrary `S : Finset (Fin n)` and tests independent sets within `S`, which corresponds to induced subgraphs. This is the standard interpretation. +- "Union of a bipartite graph and O_k(1) many vertices" — the website phrasing is slightly different from the formalization. The website says "G is the union of a bipartite graph and O_k(1) many vertices," meaning G can be decomposed by removing a bounded number of vertices to leave a bipartite graph. The formalization captures this correctly. + +## 6. Correctness + +### 6.1 The `answer(True)` wrapper + +The theorem is stated as `answer(True) ↔ ...`, asserting the statement is true. This is consistent with the problem being proved by Reed [Re99]. ✅ + +### 6.2 The independent set condition + +The hypothesis states: for all `S : Finset (Fin n)`, there exists `I` with `G.IndepSetIn I S ∧ 2 * I.card ≥ S.card - k`. + +**Potential issue with natural number subtraction.** The condition `2 * I.card ≥ S.card - k` uses natural number subtraction, which truncates to 0. This means: +- When `S.card ≤ k`, the condition becomes `2 * I.card ≥ 0`, which is trivially true for any `I` (including the empty set). +- The mathematical statement requires |I| ≥ (|S| - k) / 2, which for |S| ≤ k should indeed be trivially satisfied (any independent set works). + +So the truncation is actually **mathematically correct** here — when the subset has at most k vertices, the condition is vacuous, which matches the intended meaning. ✅ + +**Comparison with Problem 922's encoding:** Problem 922 uses `2 * T.card + k ≥ S.card`, which is equivalent to `T.card ≥ (S.card - k) / 2` but avoids truncation entirely. The two encodings are equivalent over ℕ: +- `2 * c ≥ a - b` (with ℕ truncation) ⟺ `2 * c + b ≥ a` (no truncation needed) + +This is because for natural numbers, `x ≥ a - b ↔ x + b ≥ a`. So the conditions are provably equivalent. The Problem 922 style is slightly more robust, but both are correct. ✅ + +### 6.3 The bipartiteness conclusion + +The conclusion states: there exists `T : Finset (Fin n)` with `T.card ≤ C` and a coloring `f : Fin n → Bool` such that for all `u, v` not in `T`, if `G.Adj u v` then `f u ≠ f v`. + +This correctly encodes "removing T makes G bipartite": the induced subgraph on `Fin n \ T` is 2-colorable. The function `f` is defined on all of `Fin n` but its values on `T` are unconstrained — this is fine because we only require the proper-coloring property outside `T`. ✅ + +### 6.4 The `IndepSetIn` definition + +```lean +def SimpleGraph.IndepSetIn {V : Type*} (G : SimpleGraph V) + (I S : Finset V) : Prop := + I ⊆ S ∧ ∀ ⦃u⦄, u ∈ I → ∀ ⦃v⦄, v ∈ I → u ≠ v → ¬G.Adj u v +``` + +This is correct: `I` must be a subset of `S`, and no two distinct vertices in `I` are adjacent. The `u ≠ v` guard is necessary since `SimpleGraph` has `G.loopless : ¬G.Adj v v`, but including it makes the definition self-contained. ✅ + +### 6.5 Quantifier structure + +The theorem quantifies `∀ k : ℕ, ∃ C : ℕ, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), ...`. This correctly captures "for every k, there exists a constant C (depending only on k)" and works for all finite graphs of all sizes. ✅ + +### 6.6 Overall mathematical correctness + +The formalization is **correct and complete**. It faithfully captures Reed's theorem: for every k, there is a uniform bound C(k) on the number of vertices that must be removed to make any graph satisfying the independent-set condition bipartite. No mathematical flaws detected. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Custom `IndepSetIn` could use Mathlib's `IsIndepSet`; bipartiteness could use `IsBipartite` | +| Citations | [Re99] correct; missing [EHS82] and other website references; missing link to Problem 922 | +| Variants | k = 0 trivial case could be added as a variant | +| Readability | Good overall; would benefit from inline comment on the ℕ subtraction encoding | +| Formalizability | High — low ambiguity, standard graph-theoretic statement | +| Correctness | ✅ Correct and complete. Natural number subtraction is handled properly. | diff --git a/ai-review/731.md b/ai-review/731.md new file mode 100644 index 0000000000..a82baddf0c --- /dev/null +++ b/ai-review/731.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 731 + +## 1. Code Reuse + +**`Nat.centralBinom` should be used instead of `Nat.choose (2 * n) n`.** + +Mathlib defines `Nat.centralBinom n` in `Mathlib.Data.Nat.Choose.Central` with the lemma `Nat.centralBinom_eq_choose : Nat.centralBinom n = Nat.choose (2 * n) n`. Several other Erdős problems in the repository (376, 377, 396, 397, 730) already use `Nat.centralBinom`. Problem 731 should follow suit for consistency and to leverage existing Mathlib API lemmas. + +**Natural density infrastructure exists but is not directly applicable.** `FormalConjecturesForMathlib/Data/Set/Density.lean` provides `Set.HasDensity` which could express "density zero" cleanly. However, `Set.HasDensity` uses `Set.interIio` (counting elements in `{x | x < b}`) while the formalization uses `Finset.Icc 1 x` (counting elements in `{1, ..., x}`). These differ by an off-by-one that is immaterial to the limit, but switching would require restructuring the statement. The current inline formulation is acceptable and consistent with many other problems in the codebase (e.g., 333, 377). + +**The `sInf` pattern for `leastNonDivisorCentralBinom` mirrors `leastNondividingPrime` in Problem 663.** No further reuse opportunity here, as the two definitions apply to different objects. + +## 2. Citations + +The website (https://www.erdosproblems.com/731) lists: +- **[EGRS75]** Erdős, Graham, Ruzsa, and Straus (1975) +- **Related OEIS sequence:** A006197 + +The formalization includes: +- `[EGRS75] Erdős, P., Graham, R., Ruzsa, I., and Straus, E., *On the number theory of binomial coefficients*, 1975.` + +**The OEIS reference A006197 is missing from the formalization.** It should be added to the docstring references for completeness, following the pattern used in Problem 730 which cites OEIS A129515. + +## 3. Variants + +The website states the problem as: *Find a reasonable function f(n) such that, for almost all n, the least m not dividing C(2n,n) satisfies m ~ f(n).* + +The formalization captures only the **known asymptotic result** from [EGRS75] — that m = exp((log n)^{1/2+o(1)}) — not the actual open question of identifying a precise f(n). The docstring acknowledges this ("The open problem asks to find a precise closed-form function f(n)...") but no formal statement of the open question is provided. + +**The open question itself is difficult to formalize** because the answer f(n) is unknown and the problem is existential in nature ("find f(n)"). One could formalize it as: + +``` +∃ f : ℕ → ℝ, Tendsto (fun n => leastNonDivisorCentralBinom n / f n) atTop (nhds 1) +``` + +(with the density-one caveat), but this is trivially true (take f = leastNonDivisorCentralBinom) and the real content — that f should be a "reasonable closed-form function" — resists formalization. **The current approach of formalizing the known result is the pragmatic choice.** + +No other variants are mentioned on the website. + +## 4. Readability + +The formalization is generally readable, with a few suggestions: + +- **Use `Nat.centralBinom`** as noted above — this is both more readable and more idiomatic. +- The `let m : ℝ := ...` binding inside the filter predicate is a nice touch for readability. +- The module docstring clearly explains the mathematical content and distinguishes the known result from the open question. +- Minor: the `open Finset Filter Real` could be placed after the docstring for consistency with other files. + +## 5. Formalizability + +**The known result formalized here is unambiguous and clearly formalizable.** The statement "m = exp((log n)^{1/2+o(1)}) for almost all n" has a precise meaning: for every ε > 0, the natural density of n where m ∉ [exp((log n)^{1/2-ε}), exp((log n)^{1/2+ε})] is zero. This is exactly what the formalization captures. + +**The actual open problem (finding f(n)) is ambiguous** — "reasonable function" and "closed-form" are informal mathematical notions with no standard formal definition. This ambiguity is inherent to the problem statement on the website, not introduced by the formalization. + +**Assessment: Low ambiguity for the formalized statement; high ambiguity for the unformalised open question.** + +## 6. Correctness + +**The `category` tag is questionable.** The formalization is marked `@[category research solved, AMS 5 11]` but the website lists the problem as **OPEN**. This is because the formalization captures the known result (which is indeed proved in the literature) rather than the actual open problem. This is defensible but potentially misleading — a reader might think Problem 731 itself is solved. Consider either: + - Changing to `category research open` and restructuring to capture the open question, or + - Adding a clear comment that this formalizes the known partial result, not the full open problem. + +**The density-zero formulation is mathematically correct.** The statement that for all ε > 0, the proportion of n ∈ {1,...,x} where m falls outside [exp((log n)^{1/2-ε}), exp((log n)^{1/2+ε})] tends to 0 as x → ∞ is a faithful translation of "m = exp((log n)^{1/2+o(1)}) for almost all n" in the natural density sense. + +**The `leastNonDivisorCentralBinom` definition is correct.** For all n ≥ 0, the set {m ∈ ℕ | 2 ≤ m ∧ ¬(m ∣ C(2n,n))} is nonempty (indeed infinite, since C(2n,n) is finite and has finitely many divisors), so `sInf` returns the actual minimum. The choice of `sInf` over `Nat.find` is fine since the set is a subset of ℕ with the well-ordering property. + +**Edge case at n = 0:** C(0,0) = 1, no m ≥ 2 divides 1, so leastNonDivisorCentralBinom 0 = 2. At n = 0, log 0 is -∞ in ℝ (or 0 in Lean's `Real.log`), and the exponential bounds become degenerate. However, this affects only finitely many n and hence has no impact on the density statement. **No correctness issue.** + +**Potential subtlety with exponentiation:** When ε > 1/2, the exponent `1/2 - ε` is negative, and `(log n)^{1/2-ε}` for log n > 1 tends to 0, making the lower bound exp(→0) → 1. This makes the interval wider, which is correct — the statement becomes weaker for larger ε, as expected. **No issue.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Use `Nat.centralBinom` instead of `Nat.choose (2 * n) n` | +| Citations | Add OEIS A006197 reference | +| Variants | Open question not formalized (justifiably) | +| Readability | Good; minor improvements possible | +| Formalizability | Known result: unambiguous. Open question: inherently ambiguous | +| Correctness | Mathematically correct, but `category` tag may be misleading | diff --git a/ai-review/732.md b/ai-review/732.md new file mode 100644 index 0000000000..3cbe3fde05 --- /dev/null +++ b/ai-review/732.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 732 + +## 1. Code Reuse + +**Multiple redundant PBD definitions exist across the codebase.** The concept of a pairwise balanced design is independently defined in at least four files: + +| File | Definition Name | Style | +|------|----------------|-------| +| `732.lean:43` | `IsPBD` | `∀ B ∈ blocks, 2 ≤ B.card` + `∃! B, B ∈ blocks ∧ i ∈ B ∧ j ∈ B` | +| `734.lean:49` | `IsPBBD` | `(blocks.filter (fun B => a ∈ B ∧ b ∈ B)).card = 1` | +| `903.lean:38` | `IsPairwiseBalancedDesign` | `∃! B : Finset (Fin n), B ∈ blocks ∧ x ∈ B ∧ y ∈ B` | +| `665.lean:42` | `IsPairwiseBalancedDesign` | Same as 732 but also requires `B.card < n` | + +These are all logically equivalent on the pair-covering condition (up to minor differences in the block size constraints). A shared definition in `FormalConjecturesForMathlib/Combinatorics/` would eliminate duplication. The 732 and 903 definitions are essentially identical (903 lacks the `2 ≤ B.card` condition but is otherwise the same `∃!` formulation). The 734 definition uses `filter + card = 1` instead of `∃!`, which is equivalent but stylistically different. + +Additionally, `blockSizeMultiset` at `732.lean:48` could be a general utility — problem 733 defines a similar `lines.val.map Finset.card` inline for line-compatible multisets. + +**Recommendation:** Extract a shared `IsPBD` definition and `blockSizeMultiset` utility into a common combinatorics module. + +## 2. Citations + +The docstring reference is incomplete: + +- **Current (732.lean:36):** `[Er81] Erdős, P., 1981.` +- **Website (erdosproblems.com/732):** Lists `[Er81]` as the source. No further bibliographic detail is given on the website itself. +- **734.lean provides a fuller citation** for the same [Er81]: `Erdős, P., Problems and results in graph theory and combinatorics, Proceedings of the Southeastern Conference on Combinatorics, Graph Theory, and Computing (1981), p. 35.` + +Since both 732 and 734 cite [Er81] and are from the same 1981 paper, the fuller citation from 734 should be used here as well. + +The docstring correctly mentions Alon's result and Erdős's upper bound. The website also references the related problem #733, which the docstring does not mention — though this is minor since the `/-! ... -/` header doesn't need to be exhaustive about related problems. + +**Recommendation:** Expand the `[Er81]` citation to match the full form used in `734.lean`. + +## 3. Variants + +The website describes **two** questions for Problem 732: + +1. **Characterization question:** "Are there necessary and sufficient conditions for a sequence to be block-compatible?" The trivial necessary condition $\sum_i \binom{X_i}{2} = \binom{n}{2}$ is mentioned. +2. **Counting question:** "Do at least $\exp(c\sqrt{n}\log n)$ block-compatible sequences exist for large $n$?" + +The formalization **only captures variant (2)** — the counting lower bound. Variant (1), the characterization question, is not formalized. This is arguably the harder one to formalize since it asks for "necessary and sufficient conditions" which is inherently imprecise (what constitutes a characterization?). However, the necessary condition $\sum_i \binom{X_i}{2} = \binom{n}{2}$ is a precise, formalizable statement that could be captured separately as a lemma or auxiliary theorem. + +**Recommendation:** Consider adding the necessary condition as a separate lemma (it follows directly from counting pairs). Acknowledge in a comment that the characterization variant is omitted due to its inherent imprecision. + +## 4. Readability + +The code is **well-structured and readable**. The definitions are cleanly separated (`IsPBD`, `blockSizeMultiset`, `IsBlockCompatible`), well-documented with docstrings, and the theorem statement follows naturally. + +Minor observations: +- The docstring uses "block-compatible sequences" and "multisets of block sizes" interchangeably. This is fine since sorted sequences biject with multisets, but the code could briefly note this equivalence for clarity. +- The `blockSizeMultiset` function accesses `blocks.val` (the underlying multiset of a finset). This is a correct but somewhat low-level idiom; a reader unfamiliar with Lean's `Finset` internals might benefit from a brief comment. + +## 5. Formalizability + +The counting lower bound (variant 2) is **precisely and unambiguously formalizable**. All components have clear mathematical definitions: +- Pairwise balanced design: well-defined combinatorial object. +- Block-compatible multiset: existence of a PBD with given block sizes. +- The lower bound $\exp(c\sqrt{n}\log n)$: standard asymptotic statement. + +The characterization question (variant 1) is **not obviously formalizable** in a single theorem statement, since "necessary and sufficient conditions" is open-ended. + +**Ambiguity assessment: Low.** The formalized portion is precise. + +## 6. Correctness + +The formalization is **mathematically correct** for the counting variant. Detailed analysis: + +### IsPBD (line 43–45) +- Requires `2 ≤ B.card` for all blocks: matches the condition $X_i > 1$ (equivalently $|A_i| \geq 2$). +- Requires every pair of distinct elements of `Fin n` belongs to exactly one block (`∃!`): matches the standard definition of a pairwise balanced design. +- Note: Unlike `665.lean`, this does **not** require `B.card < n`. This is appropriate — the original problem says $X_i \leq n$, and since blocks are subsets of `Fin n`, their cardinality is automatically $\leq n$. The case $|A_i| = n$ (the whole set as a single block) is technically allowed and is only possible when $n \leq 2$. + +### blockSizeMultiset (line 48–49) +- Uses `blocks.val.map Finset.card` to produce a `Multiset ℕ`. This correctly extracts the multiset of sizes. Since `Finset` has no duplicate elements (as sets), distinct blocks map to potentially equal sizes, which the multiset captures correctly. + +### IsBlockCompatible (line 53–54) +- Correctly existentially quantifies over PBDs with the given size multiset. + +### erdos_732 (lines 63–68) +- `answer(True)`: Correct — the problem is proved (by Alon) in the affirmative. +- The structure `∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ∃ S : Finset (Multiset ℕ), ...` correctly expresses "for all sufficiently large $n$, there are at least $\exp(c\sqrt{n}\log n)$ block-compatible multisets." +- The finset `S` witnesses a collection of distinct block-compatible multisets. Since elements of a `Finset` are distinct, `S.card` counts distinct multisets, which is the right notion. +- The bound `(S.card : ℝ) ≥ Real.exp (c * Real.sqrt n * Real.log n)` correctly encodes the lower bound. + +### Potential subtle issue +The statement asks for existence of a *set* `S` of block-compatible multisets of size $\geq \exp(c\sqrt{n}\log n)$. This is a valid way to express a lower bound on the *total count* of block-compatible multisets, but it is slightly weaker than saying "the number of block-compatible multisets is at least ...". In principle, one could imagine the total number being infinite (or uncountably many) — but since blocks are `Finset (Finset (Fin n))` and `Fin n` is finite, there are finitely many possible PBDs and hence finitely many block-compatible multisets. So the two formulations are equivalent. No issue here. + +### Verdict +**Correct and complete** for the counting variant. The omission of variant (1) is a completeness gap but not a correctness issue, and is justified by the imprecision of the characterization question. diff --git a/ai-review/733.md b/ai-review/733.md new file mode 100644 index 0000000000..854f432189 --- /dev/null +++ b/ai-review/733.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 733 + +## 1. Code Reuse + +**Collinear definition is duplicated.** The file defines its own `Collinear` (cross-product vanishing) at line 44, which is identical to `Collinear607` in `ErdosProblems/607.lean`. Both problems concern the same geometric setup (lines determined by point sets in ℝ²), and problem 733 is described in its own docstring as "essentially the same as problem 607, but with multiplicities." + +Potential consolidation opportunities: + +- **`Collinear`**: Should be factored into a shared utility (e.g., `FormalConjecturesForMathlib/Geometry/2d.lean`), or both problems should use Mathlib's `Collinear ℝ` from `Mathlib.LinearAlgebra.AffineSpace.AffineSubspace`. The `NonTrilinear` definition in `FormalConjecturesForMathlib/Geometry/2d.lean` already uses Mathlib's `Collinear ℝ {x, y, z}`, demonstrating a precedent for the Mathlib version. +- **`IsLine`**: The concept of a line determined by a point set (maximal collinear subset containing a given pair) is common to problems 607, 733, and 960. A shared definition would reduce duplication. +- **Line spectrum vs. line multiset**: Problem 607 defines `lineSpectrum607` (the *set* of distinct line sizes) while 733 defines `IsLineCompatible` (the *multiset* of line sizes). These are closely related and could share the underlying line-determination machinery. + +## 2. Citations + +The docstring references: + +- `[Er81]` — listed as "Erdős, P., 1981." This is incomplete. The website lists the source as `[Er81]` but does not give a full citation either. The docstring entry is consistent with the website. +- `[SzTr83]` — listed as "Szemerédi, E. and Trotter, W. T., *Extremal problems in discrete geometry*. Combinatorica 3 (1983), 381–392." This matches the standard citation and is consistent with the website's attribution. + +**No issues with citations.** Both references match what is documented on erdosproblems.com/733. + +## 3. Variants + +The website includes an additional question not captured in the formalization: + +> Erdős noted it is "easy" to prove there exist at least $\exp(cn^{1/2})$ such sequences for some constant $c > 0$, but expected the upper bound to be difficult. He further asked: **Does the limit $\lim_{n \to \infty} \frac{\log f(n)}{n^{1/2}}$ exist, and if so, what is its value?** + +This limit question is a meaningful variant/follow-up that is **not captured** by `erdos_733`. The current formalization only addresses the upper bound $\exp(C\sqrt{n})$. + +A complete formalization could additionally include: +1. The lower bound $\exp(c\sqrt{n})$ (which Erdős called "easy"). +2. The existence (or non-existence) of the limit $\lim_{n\to\infty} \frac{\log f(n)}{\sqrt{n}}$. + +## 4. Readability + +The code is well-structured and readable: + +- **Definitions are well-documented** with docstrings explaining the mathematical meaning. +- **Naming is clear**: `Collinear`, `IsLine`, `IsLineCompatible`, `achievableLineMultisets` all have transparent names. +- **The theorem statement** is cleanly formatted with the quantifier structure $\exists C > 0, \exists n_0, \forall n \geq n_0, \ldots$ clearly visible. + +Minor suggestions: +- The `Collinear` definition could benefit from a note that it is equivalent to Mathlib's `Collinear ℝ` for `ℝ × ℝ`, or a `TODO` indicating planned consolidation with problem 607. +- The `open Classical` at line 38 is broad; it may be preferable to use more targeted `open` statements, though this is a minor stylistic point. + +## 5. Formalizability + +**The problem is formalizable and the formalization is reasonable.** + +The original problem statement uses "sequences" $1 < X_1 \leq \cdots \leq X_m \leq n$, which are sorted non-decreasing sequences of integers ≥ 2. This is mathematically equivalent to multisets of natural numbers ≥ 2, and the formalization correctly uses `Multiset ℕ`. The constraint $X_i \geq 2$ is enforced structurally through `IsLine` requiring `2 ≤ L.card`, and $X_i \leq n$ follows from lines being subsets of $P$. + +**Ambiguity assessment: Low.** The problem is precisely stated. The only mild ambiguity is whether "line" means any line in ℝ² or only lines determined by at least 2 points of the configuration — the formalization correctly uses the latter interpretation (via `IsLine` requiring `2 ≤ L.card`), which is standard. + +The $\exp(O(\sqrt{n}))$ notation in the problem is formalized as $\exists C > 0$ such that the count is $\leq \exp(C\sqrt{n})$, which is the correct interpretation. + +## 6. Correctness + +**The formalization is mathematically correct**, with the following detailed analysis: + +### Collinear definition +The cross-product test $(q_1 - p_1)(r_2 - p_2) = (r_1 - p_1)(q_2 - p_2)$ is the standard characterization of collinearity in ℝ². ✓ + +### IsLine definition +`IsLine P L` requires: +1. $L \subseteq P$ — line points come from the configuration. ✓ +2. $|L| \geq 2$ — a line contains at least 2 points. ✓ +3. $L = P.\text{filter}(\lambda r.\, \text{Collinear}(p, q, r))$ for some distinct $p, q \in P$ — $L$ is the *maximal* set of points in $P$ lying on the line through $p$ and $q$. ✓ + +This correctly captures the notion of a "line determined by $P$" as the full intersection of an affine line with $P$. Two different pairs $(p, q)$ and $(p', q')$ on the same affine line will produce the same filtered set, so each geometric line is represented at most once in a `Finset` of lines. ✓ + +### IsLineCompatible definition +The existential quantification over `lines : Finset (Finset (ℝ × ℝ))` with: +- `∀ L ∈ lines, IsLine P L` — every element is a valid line. ✓ +- `∀ L, IsLine P L → L ∈ lines` — every valid line is included. ✓ +- `lines.val.map Finset.card = M` — the multiset of cardinalities equals $M$. ✓ + +This ensures `lines` is exactly the set of all lines determined by $P$, and $M$ records their sizes as a multiset. ✓ + +### Theorem statement +The statement asserts $\exists C > 0, \exists n_0, \forall n \geq n_0$: +1. `(achievableLineMultisets n).Finite` — the set of achievable multisets is finite. +2. `ncard ≤ \exp(C\sqrt{n})` — with the claimed upper bound. + +The finiteness assertion is necessary for `ncard` to be meaningful (otherwise `ncard` returns 0 for infinite sets). The finiteness itself is mathematically obvious since there are finitely many multisets of naturals in $\{2, \ldots, n\}$ with sum at most $\binom{n}{2}$, but it's good practice to state it explicitly. ✓ + +**No mathematical errors detected.** The formalization faithfully captures the upper bound portion of Erdős Problem 733 as stated on the website. + +### Incompleteness +The missing variant (limit question) noted in §3 is attributable to the website listing it as supplementary context rather than as the core problem statement. The core conjecture — the $\exp(O(\sqrt{n}))$ upper bound — is correctly formalized. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `Collinear` and line machinery duplicated from problem 607; should consolidate | +| Citations | Correct and consistent with erdosproblems.com | +| Variants | Missing: lower bound and limit existence question | +| Readability | Good; clear naming and documentation | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete for the core conjecture | diff --git a/ai-review/734.md b/ai-review/734.md new file mode 100644 index 0000000000..bf38e9a64e --- /dev/null +++ b/ai-review/734.md @@ -0,0 +1,90 @@ +# Review: Erdős Problem 734 + +## 1. Code Reuse + +The codebase contains **five** separate definitions of pairwise balanced block designs across different Erdős problem files, with no shared utility module: + +| File | Definition | Style | +|------|-----------|-------| +| `ErdosProblems/734.lean` | `IsPBBD` | `filter` + `card = 1` | +| `ErdosProblems/903.lean` | `IsPairwiseBalancedDesign` | `∃!` formulation | +| `ErdosProblems/665.lean` | `IsPairwiseBalancedDesign` | `∃!` + block size constraints | +| `ErdosProblems/732.lean` | `IsPBD` | `∃!` + min size 2 | +| `ErdosProblems/722.lean` | `IsSteinerSystem` | `∃!` (generalized) | + +**Recommendation:** A shared `IsPairwiseBalancedDesign` definition should be factored into `FormalConjecturesForMathlib` (or a shared utility file) and reused across problems 665, 732, 734, and 903. Problem 732's `IsPBD` (which adds a minimum block size of 2) is closest to the standard combinatorial definition. Problem 734's `IsPBBD` could be replaced by any of the `∃!`-based definitions, since the `filter`-based formulation is equivalent but non-standard relative to the rest of the codebase. + +## 2. Citations + +The formalization cites: + +> [Er81] Erdős, P., *Problems and results in graph theory and combinatorics*, Proceedings of the Southeastern Conference on Combinatorics, Graph Theory, and Computing (1981), p. 35. + +The website (erdosproblems.com/734) lists: +- **[Er81, p.35]** as the source. +- **[dBEr48]** (de Bruijn, N.G. and Erdős, P., *On a combinatorial problem*, 1948) for the Erdős–de Bruijn theorem that m ≥ n. + +The docstring informally references the Erdős–de Bruijn result ("Erdős and de Bruijn proved that any PBBD has m ≥ n blocks") but does not give the formal citation tag `[dBEr48]`. Since the website explicitly lists this reference, it should be included. Additionally, the website includes a remark by Erdős: *"this will probably not be very difficult to prove but so far I was not successful"* — this could optionally be included for context. + +**Recommendation:** Add `[dBEr48]` as a formal citation in the docstring, e.g.: +``` +[dBEr48] de Bruijn, N.G. and Erdős, P., _On a combinatorial problem_, 1948. +``` + +## 3. Variants + +The website lists a single statement with no variants. The formalization captures the full problem as stated. No additional variants are missing. + +## 4. Readability + +**Minor issues:** + +- **Naming:** `IsPBBD` is an unusual abbreviation. The rest of the codebase uses `IsPairwiseBalancedDesign` (903) or `IsPBD` (732). Consider using one of these for consistency. +- **Definition style:** The `filter`-based definition (`(blocks.filter (fun B => a ∈ B ∧ b ∈ B)).card = 1`) is less idiomatic than the `∃!` formulation used in every other file. The `∃!` style is more readable and closer to the standard mathematical statement ("there exists a unique block containing both a and b"). +- **Namespace:** `Erdos734` is consistent with other files. +- The `open Finset` is fine and scoped appropriately. + +Overall readability is good. The docstring clearly explains the problem, the connection to Erdős–de Bruijn, and what "non-trivial" means. + +## 5. Formalizability + +The problem is **mostly precise** but has one point of mild ambiguity: + +- **"Non-trivial"**: The original problem says "a non-trivial pairwise balanced block design." The standard trivial PBBD on n points is the complete design consisting of all $\binom{n}{2}$ pairs. The formalization interprets "non-trivial" as requiring at least one block of size ≥ 3, which correctly excludes exactly the trivial all-pairs design. This is the standard interpretation in the literature. + +- **Block size constraints**: The original statement does not explicitly require blocks to have size ≥ 2, and neither does the formalization. This is acceptable: empty and singleton blocks cannot cover any pair, so they are irrelevant to the covering condition and would never appear in an optimal construction. + +- **O(√n) quantification**: The big-O bound is properly formalized with an existential constant C > 0 and threshold N₀. This is correct. + +**Assessment:** Low ambiguity. The only interpretive choice ("non-trivial" = at least one block of size ≥ 3) is standard and well-justified. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification:** + +1. **PBBD definition** (`IsPBBD`): States that for every pair of distinct elements a, b ∈ Fin n, exactly one block contains both. This is the standard definition of a pairwise balanced design. ✓ + +2. **Non-triviality** (`∃ B ∈ blocks, 2 < B.card`): Requires at least one block of size ≥ 3. This correctly excludes the trivial all-pairs design (the only PBBD where all blocks have size exactly 2). ✓ + +3. **Block size multiplicity bound**: `∀ t : ℕ, ((blocks.filter (fun B => B.card = t)).card : ℝ) ≤ C * (n : ℝ) ^ ((1 : ℝ) / 2)` correctly states that the number of blocks of any given size t is at most C√n. The bound applies to *all* t (including t = 0 or t = 1, which is fine since no blocks of those sizes would appear in a valid PBBD anyway). ✓ + +4. **Existential structure**: `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, ∃ blocks, ...` correctly formalizes "for all sufficiently large n, there exists a PBBD satisfying..." with a universal constant C. ✓ + +5. **Connection to Erdős–de Bruijn**: The docstring correctly notes that m ≥ n implies some block size must appear Ω(√n) times (by pigeonhole over at most n − 1 possible block sizes). The conjecture asks whether the complementary O(√n) upper bound is achievable for *all* sizes simultaneously. ✓ + +**One subtle point:** The formalization uses `(n : ℝ) ^ ((1 : ℝ) / 2)` for √n. This is mathematically equivalent to `Real.sqrt n` for n ≥ 0, but using `Real.sqrt` would be more idiomatic in Lean/Mathlib. This is a stylistic rather than correctness issue. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could share PBBD definition with 4+ other files | +| Citations | Missing formal `[dBEr48]` citation | +| Variants | Complete — no missing variants | +| Readability | Good; minor naming/style inconsistencies vs. codebase | +| Formalizability | Low ambiguity; standard interpretation of "non-trivial" | +| Correctness | **Correct and complete** | diff --git a/ai-review/735.md b/ai-review/735.md new file mode 100644 index 0000000000..eae0b875e1 --- /dev/null +++ b/ai-review/735.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 735 + +## 1. Code Reuse + +Several opportunities for reuse exist: + +- **`R2` abbreviation (line 46):** The codebase already provides `scoped[EuclideanGeometry] notation "ℝ²" => EuclideanSpace ℝ (Fin 2)` in `FormalConjecturesForMathlib/Geometry/2d.lean:25`. The local `abbrev R2` could be replaced with the standard `ℝ²` notation for consistency. Other files use similar ad-hoc aliases (`Point2` in `ErdosProblems/210.lean:34`), so there is a broader consolidation opportunity. + +- **`NoThreeCollinear` (lines 63–66):** An equivalent definition `NonTrilinear` exists in `FormalConjecturesForMathlib/Geometry/2d.lean:52–55`, defined as `A.Triplewise (fun x y z ↦ ¬ Collinear ℝ {x, y, z})`. This is semantically identical but uses `Set.Triplewise` instead of explicit quantification with distinctness hypotheses. The existing `NonTrilinear` could be used directly (with a coercion from `Finset` to `Set`). + +- **`AllCollinear` (lines 59–60):** No existing shared definition, but several other problems (506, 210) define equivalent notions. This is a candidate for extraction to a shared utility. + +- **`IsIncentreConfiguration` (lines 77–87):** Mathlib provides `EuclideanGeometry.Triangle.incenter` and angle bisector utilities in `Mathlib.Geometry.Euclidean.Incenter`. The current self-contained barycentric computation is correct and arguably clearer for this specific use case, but could optionally be connected to Mathlib's incenter definition. + +## 2. Citations + +The website (erdosproblems.com/735) lists: +- **Original reference:** [Er81] (Erdős's mention of the problem) +- **Attribution:** Originally posed by **Murty** +- **Acknowledgement:** Noga Alon + +The formalization's docstring cites: +- [ABKPR08] Ackerman, Buchin, Knauer, Pinchasi, Rote — the paper that *proved* the conjecture. + +**Issue:** The original reference [Er81] from the website is not mentioned in the formalization. While [ABKPR08] is the resolution paper and is correctly cited, the original Erdős reference should also be included for completeness. The website acknowledges Noga Alon, which is also absent from the docstring. + +## 3. Variants + +The problem as stated on erdosproblems.com is a single question ("when can one assign positive weights...?") with Murty's conjecture giving the answer. The formalization captures this as a biconditional (iff), asserting that the four configurations are both necessary and sufficient. + +**No additional variants** appear on the website. The formalization captures the complete problem. + +## 4. Readability + +The code is well-structured and readable: + +- The definitions are cleanly separated (`AdmitsBalancedWeighting`, `AllCollinear`, `NoThreeCollinear`, `AllButOneCollinear`, `IsIncentreConfiguration`), each with a docstring. +- The incenter configuration definition includes a helpful comment explaining the angle bisector theorem and the ratios used. +- The use of `let` bindings for `a`, `b`, `c`, `bisA`, `bisB`, `bisC`, `inc` makes the geometric construction easy to follow. + +**Minor suggestions:** +- The docstring for `IsIncentreConfiguration` mentions "projective equivalences" but the definition does not capture them (see Correctness below). This discrepancy between comment and code could confuse readers. +- Using the standard `ℝ²` notation instead of the local `R2` abbrev would improve consistency with the rest of the codebase. + +## 5. Formalizability + +The problem is **highly formalizable** for cases 1–3, which are purely combinatorial/incidence-geometric properties. + +**Ambiguity for case 4:** The phrase "or a projective equivalence" introduces significant ambiguity: +- What precisely constitutes a "projective equivalence" in the context of ℝ² (as opposed to ℝP²)? +- Are we considering projective transformations of the plane that keep all 7 points finite (i.e., no point maps to infinity)? +- The Ackerman et al. paper likely uses a precise formulation, but the erdosproblems.com statement leaves this implicit. + +The balanced weighting property depends only on the incidence structure (which subsets of points are collinear), so it is projectively invariant. This means the fourth case should really be: "any 7-point configuration with the same incidence structure as the incenter configuration." This is a precise combinatorial condition and is fully formalizable, but it is not what the current code implements. + +**Assessment:** Moderate ambiguity due to the "projective equivalence" clause. The underlying mathematics is precise (the Ackerman et al. proof gives a complete classification), but faithfully formalizing case 4 requires care. + +## 6. Correctness + +### AdmitsBalancedWeighting (lines 50–56): **Correct** +The definition correctly captures the "magic configuration" property. Lines through ≥ 2 points of S are represented by pairs (p₁, q₁) with p₁ ≠ q₁, both in S. The collinearity filter `Collinear ℝ ({p₁, q₁, x})` correctly identifies points on the line through p₁ and q₁. Different pairs defining the same line produce the same filtered sum (trivially), and the universal quantification ensures all line-sums are equal. + +### AllCollinear (lines 59–60): **Correct** +Direct use of Mathlib's `Collinear` on the full point set. + +### NoThreeCollinear (lines 63–66): **Correct** +Quantifies over all distinct triples and negates collinearity. Equivalent to `NonTrilinear`. + +### AllButOneCollinear (lines 69–70): **Correct** +Existentially picks a point p ∈ S such that S \ {p} is collinear but S itself is not. This correctly captures "all but one point on a line." + +### IsIncentreConfiguration (lines 77–87): **Partially Correct — Missing Projective Equivalences** + +The angle bisector feet and incenter coordinates are **mathematically correct**: +- `bisA = (b/(b+c))·B + (c/(b+c))·C` correctly places the foot of the A-bisector on BC, dividing BC in ratio AB:AC = c:b (by the angle bisector theorem, using the section formula with weights b and c). +- `bisB = (a/(a+c))·A + (c/(a+c))·C` correctly places the foot of the B-bisector on AC. +- `bisC = (a/(a+b))·A + (b/(a+b))·B` correctly places the foot of the C-bisector on AB. +- `inc = (a/(a+b+c))·A + (b/(a+b+c))·B + (c/(a+b+c))·C` is the standard barycentric formula for the incenter with weights (a, b, c) proportional to opposite side lengths. + +For any non-degenerate triangle, all 7 points are guaranteed distinct (the incenter is interior; the bisector feet are on the boundary but not at vertices), so the `Finset` literal contains exactly 7 elements. + +**Critical gap:** The docstring and theorem statement mention "or a projective equivalence," but `IsIncentreConfiguration` only captures the literal incenter configuration parameterized by a Euclidean triangle. It does **not** capture projective images of this configuration. + +This matters because: +1. The balanced weighting property depends only on incidence structure (which triples are collinear), making it projectively invariant. +2. Projective transformations do not preserve the metric structure (distances, angles), so a projective image of an incenter configuration is generally **not** the incenter configuration of any triangle. +3. Therefore, there exist valid magic configurations in ℝ² that satisfy the balanced weighting property, match the incidence pattern of the incenter configuration, but are NOT literally an incenter configuration. The current formalization would classify such configurations as not belonging to case 4, making the **backward direction (←)** of the iff **too strong** (it proves more than is true) and the **forward direction (→) too weak** (it fails to cover all valid case-4 configurations). + +More precisely: as stated, the theorem `erdos_735` claims `AdmitsBalancedWeighting S ↔ (case1 ∨ case2 ∨ case3 ∨ IsIncentreConfiguration S)`. Since `IsIncentreConfiguration` is too narrow, there exist point sets S that admit a balanced weighting but satisfy none of the four disjuncts on the right — making the forward direction (→) **false as stated**. + +**Suggested fix:** Replace `IsIncentreConfiguration` with a definition that captures the incidence structure abstractly, e.g., "there exists a bijection from S to the 7-point incenter configuration that preserves collinearity of triples," or equivalently, "S is the image of an incenter configuration under a projective transformation of ℝ² (that maps all 7 points to finite points)." + +### Overall Correctness Verdict + +The formalization is **mathematically incorrect** due to the omission of projective equivalences in case 4. Cases 1–3 are correct. The incorrectness is **attributable to ambiguity** in the original problem statement (the phrase "or a projective equivalence" is informal), but the mathematical content of the Ackerman et al. theorem is clear enough that a correct formalization is possible. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `NonTrilinear` from `2d.lean` and `ℝ²` notation could be reused | +| Citations | Missing [Er81] original reference; [ABKPR08] correctly cited | +| Variants | Complete — no missing variants | +| Readability | Good; minor docstring/notation issues | +| Formalizability | Moderate ambiguity around "projective equivalence" | +| Correctness | **Incorrect** — `IsIncentreConfiguration` is too restrictive (missing projective equivalences), making the forward direction of the iff false | diff --git a/ai-review/736.md b/ai-review/736.md new file mode 100644 index 0000000000..d70c38a30f --- /dev/null +++ b/ai-review/736.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 736 + +## 1. Code Reuse + +Several definitions in this file are duplicated across the codebase: + +- **`ContainsCopy` (lines 42–44):** This identical definition appears in `ErdosProblems/181.lean:52`, `ErdosProblems/594.lean:56–58`, and likely others. All three define the same concept: an injective map preserving adjacency. This should be extracted to a shared utility. Additionally, Mathlib provides `SimpleGraph.Embedding` (`↪g`), used in Problems 738 and 596. A `SimpleGraph.Embedding` is a stronger notion (it reflects adjacency too, i.e., it is an *induced* subgraph embedding), while `ContainsCopy` is a weaker "subgraph copy" notion (preserves but does not reflect adjacency). The weaker notion is correct here since the problem asks about *subgraphs*, not *induced subgraphs*. However, the relationship should be documented, and the definition centralized. + +- **`cardChromaticNumber` (lines 48–50):** This exact definition is duplicated in `ErdosProblems/739.lean:50–52` and `ErdosProblems/740.lean:47–49`. Moreover, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136` already provides `SimpleGraph.chromaticCardinal`, defined as `sInf {κ : Cardinal | ∃ (C : Type u) (_ : Cardinal.mk C = κ), Nonempty (G.Coloring C)}`. This is semantically identical to `cardChromaticNumber` (using `Cardinal.mk C = κ` instead of `#α = κ`, which is the same thing). All three Erdős problem files (736, 739, 740) should use the shared `chromaticCardinal` definition instead. + +## 2. Citations + +The website ([erdosproblems.com/736](https://www.erdosproblems.com/736)) lists: +- **[Er81]** — Erdős's original mention +- **[Er93, p. 343]** — Further reference +- **Attribution:** Originally a conjecture of **Walter Taylor** +- **[KoSh05]** — Komjáth and Shelah, proving consistency of a negative answer + +The formalization's docstring cites: +- [Er81] ✓ +- [Er93, p. 343] ✓ +- Walter Taylor attribution ✓ +- [KoSh05] with full bibliographic details ✓ + +**Assessment:** All references from the website are present in the formalization. The citation of [KoSh05] includes full bibliographic data (authors, title, journal, year, pages), which exceeds the website's level of detail. Citations are **complete and correct**. + +## 3. Variants + +The website mentions a **general problem**: "Characterise families F_α of finite graphs such that there exists a graph of chromatic number ℵ_α whose finite subgraphs belong to F_α." The website also notes that the conjecture generalizes: one can replace ℵ₁ with any uncountable cardinal κ. + +The formalization captures only the specific ℵ₁ version. The generalization to arbitrary uncountable κ is **not formalized**. This is a reasonable choice since the original Taylor conjecture specifically concerns ℵ₁, and the general characterization problem is much broader and more open-ended (not a single conjecture but a research program). However, a note in the docstring acknowledging the generalization would be helpful. + +**Assessment:** The primary conjecture is captured. The generalization is absent but this is acceptable given its open-ended nature. + +## 4. Readability + +The code is clean and well-structured: + +- The module docstring clearly states the problem, attributes it to Taylor, and notes the Komjáth-Shelah consistency result. +- The `ContainsCopy` and `cardChromaticNumber` definitions each have clear docstrings. +- The theorem statement reads naturally as a direct formalization of the problem. + +**Minor suggestions:** +- The `answer(sorry)` pattern with an `↔` is the standard template for independence results in this codebase. The docstring correctly explains that the conjecture is not provable in ZFC, which contextualizes the `sorry` on the left-hand side. +- Using the shared `chromaticCardinal` definition (see Code Reuse) would reduce local boilerplate and make the file shorter. + +## 5. Formalizability + +The problem is **highly formalizable**. The statement involves: +- Graph chromatic number at the cardinal level — well-defined. +- Existence of graphs with a given chromatic number — well-defined. +- The "every finite subgraph of G_m is a subgraph of G" condition — well-defined. + +The only subtlety is the **set-theoretic independence**: Komjáth and Shelah showed the conjecture is consistently false. The formalization handles this via the `answer(sorry)` pattern, which leaves the truth value undetermined. This is the correct approach for ZFC-independent statements. + +**Ambiguity assessment:** Very low. The mathematical content is precise and unambiguous. The only question is whether the formalization should explicitly quantify over models of set theory (it does not, and should not — Lean's type theory serves as the ambient foundation, and the `answer(sorry)` pattern is the project's standard idiom for independence results). + +## 6. Correctness + +### `ContainsCopy` (lines 42–44): **Correct** +The definition correctly captures "H is isomorphic to a subgraph of G" via an injective adjacency-preserving map. This is the standard notion of (non-induced) subgraph copy. + +### `cardChromaticNumber` (lines 48–50): **Correct** +Takes the infimum over cardinals κ such that a proper κ-coloring exists. This correctly captures the cardinal chromatic number. Note: for the empty graph, `sInf` of the set `{κ | ∃ α, #α = κ ∧ Nonempty (G.Coloring α)}` gives `0` (since `G.Coloring PEmpty` exists), but this is a degenerate case irrelevant to the theorem (which assumes chromatic number = ℵ₁). + +### `erdos_736` (lines 62–71): **Mathematically correct with minor observations** + +The statement reads: for all graphs G with `cardChromaticNumber G = aleph 1`, for every cardinal m, there exists a graph G_m with `cardChromaticNumber Gm = m` such that every finite subgraph of G_m is a subgraph of G. + +**Analysis of the quantification:** +- The universal quantification over `m : Cardinal.{u}` includes m = 0, m = 1, finite values, ℵ₀, ℵ₁, and larger cardinals. For m = 0, one needs a graph with chromatic number 0 (the empty graph on an empty type), whose only finite subgraph is the empty graph — trivially a subgraph of G. For m = 1, the edgeless graph on a single vertex works (its finite subgraphs are isolated vertices). So the quantification over all cardinals is fine, not just infinite ones. +- The "every finite subgraph of G_m is a subgraph of G" clause is formalized as: for every `[Fintype U]` and `H : SimpleGraph U`, if `ContainsCopy Gm H` then `ContainsCopy G H`. This quantifies over all graphs on finite types, checking containment. This correctly captures "every finite subgraph of G_m appears in G." + +**One subtle point:** The formalization quantifies over `U : Type u`, which must live in the same universe as V and W. For finite types this should not matter (all finite types can be represented in any universe), but formally one might worry about universe issues. In practice, any finite graph can be represented on `Fin n` which lives in `Type 0 ⊆ Type u`, so this is not a real concern. + +**Verdict on the `answer(sorry)` usage:** The conjecture is known to be ZFC-independent (consistently false by [KoSh05], and the positive direction might be consistently true under large cardinal hypotheses or specific models). The `answer(sorry)` pattern correctly leaves the truth value open. This is appropriate. + +### Overall Correctness Verdict + +The formalization is **mathematically correct**. The statement faithfully captures the Taylor conjecture as described on erdosproblems.com. The use of `answer(sorry)` is appropriate for a ZFC-independent statement. No mathematical errors were identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `cardChromaticNumber` duplicated in 739, 740; should use shared `chromaticCardinal` from `Coloring.lean`. `ContainsCopy` duplicated in 181, 594; should be centralized. | +| Citations | **Complete** — all website references ([Er81], [Er93], [KoSh05], Taylor attribution) are present | +| Variants | Primary conjecture captured; generalization to arbitrary κ noted on website but reasonably omitted | +| Readability | Good; clean structure, clear docstrings | +| Formalizability | High — low ambiguity, precise mathematical content | +| Correctness | **Correct** — faithful formalization of the conjecture with appropriate handling of ZFC independence | diff --git a/ai-review/737.md b/ai-review/737.md new file mode 100644 index 0000000000..1d10ab01ef --- /dev/null +++ b/ai-review/737.md @@ -0,0 +1,78 @@ +# Review: Erdős Problem 737 + +## 1. Code Reuse + +**Significant duplication with Problem 594.** The definitions `HasUncountableChromaticNumber` and `cycleGraph` in `737.lean` are identical (character-for-character, modulo namespace) to those in `594.lean`. This is consistent with the broader project pattern—`cycleGraph` is independently defined in ~19 problem files—but these two problems are directly related (737's docstring explicitly references 594), making them strong candidates for shared definitions. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` defines `chromaticCardinal`, a cardinal-valued chromatic number that can distinguish infinite cardinalities. The condition `HasUncountableChromaticNumber G` could alternatively be expressed as `Cardinal.aleph 1 ≤ G.chromaticCardinal`, though the current self-contained predicate is arguably clearer and avoids pulling in cardinal arithmetic infrastructure. + +`ContainsCycleThroughEdge` is unique to 737 and appropriately specialized—it extends 594's `ContainsCopy` with the edge-containment constraint. No reuse concern here. + +## 2. Citations + +The docstring references `[EHS74]` and `[Th83]` in shorthand only. Problem 594 provides the full citation for [EHS74]: + +> Erdős, P., Hajnal, A., and Shelah, S., *On some general properties of chromatic numbers*, Topics in Topology, Colloq. Math. Soc. Janos Bolyai **8** (1974), 243–255. + +The `[Th83]` reference (Thomassen's proof) is missing a full citation. It should be: + +> Thomassen, C., *Infinite graphs in which every vertex has small degree*, Journal of Combinatorial Theory, Series B **35** (1983), 129–141. + +(Note: The specific Thomassen paper should be verified against the erdosproblems.com source. The website does not list the full Thomassen citation directly.) + +The `[Er81]` shorthand in the `@[category]` annotation docstring is also unexpanded and has no corresponding full citation in the file. + +The website's recommended citation format is: *T. F. Bloom, Erdős Problem #737, https://www.erdosproblems.com/737* + +## 3. Variants + +The problem as stated on erdosproblems.com has a single formulation: the existence of an edge through which all sufficiently long cycles pass. The formalization captures exactly this variant. No additional variants are listed on the website. + +One could consider a weaker variant asking whether G merely contains all sufficiently large cycles (without the edge constraint)—but that is precisely Problem 594, which is already separately formalized. The relationship between the two problems is correctly noted in the docstring. + +**No missing variants.** + +## 4. Readability + +The code is well-structured and readable: + +- Each definition has a clear docstring explaining the mathematical content. +- The `cycleGraph` definition uses natural modular arithmetic, which is intuitive. +- The `ContainsCycleThroughEdge` definition clearly separates the three requirements: injectivity, adjacency preservation, and edge containment. +- The main theorem statement reads naturally when parsed alongside the definitions. + +**Minor suggestions:** +- The proof term `hm` in `cycleGraph m hm` is carried through as a parameter to `ContainsCycleThroughEdge` and into the theorem statement (`∀ (n : ℕ) (hn : n ≥ 3), n ≥ N₀ → ContainsCycleThroughEdge G u v n hn`). This is slightly awkward but necessary given the definition structure. An alternative would be to define `cycleGraph` for all `m : ℕ` (with a junk value for `m < 3`) to avoid threading the proof, but this is a minor stylistic point and the current approach is defensible. + +## 5. Formalizability + +**High formalizability; low ambiguity.** The problem is precisely stated: + +- "Graph with chromatic number ℵ₁" is unambiguous (the formalization generalizes to ≥ ℵ₁, which is correct and stronger). +- "Cycle of length n" is unambiguous for simple graphs (n vertices = n edges in a cycle). +- "Contains a cycle ... containing [an edge] e" has a clear graph-theoretic meaning: an injective cycle subgraph passing through a specific edge. +- "For all large n" has standard mathematical meaning: ∃ N₀, ∀ n ≥ N₀. + +The only minor ambiguity is whether "chromatic number ℵ₁" means exactly ℵ₁ or ≥ ℵ₁. The formalization uses ≥ ℵ₁ (uncountable), which is the stronger and more natural interpretation—if χ(G) > ℵ₁, the result still holds since G contains a subgraph with χ = ℵ₁. This is mathematically correct. + +**Assessment: Unambiguously formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +**Detailed verification:** + +- **`HasUncountableChromaticNumber`**: Correctly captures χ(G) ≥ ℵ₁ by asserting that no proper coloring exists with any countable color set. The quantification over `(α : Type*) [Countable α]` is appropriate—it covers all countable types including finite ones. + +- **`cycleGraph`**: Correctly defines C_m for m ≥ 3. The adjacency relation `i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m)` correctly makes vertex i adjacent to i±1 mod m. The symmetry and irreflexivity proofs are correct. + +- **`ContainsCycleThroughEdge`**: Correctly requires (1) an injective map f : Fin m → V, (2) adjacency preservation from the cycle to G, and (3) existence of a cycle edge mapping to the specified edge {u,v} in either orientation. The injectivity ensures the image is genuinely a cycle (not a closed walk with repeated vertices). + +- **Main theorem**: The structure `∃ u v, G.Adj u v ∧ ∃ N₀, ∀ n ≥ 3, n ≥ N₀ → ContainsCycleThroughEdge G u v n hn` correctly captures: "there exists an edge {u,v} such that for all sufficiently large n (with n ≥ 3), G contains a cycle of length n through {u,v}." The `G.Adj u v` requirement ensures {u,v} is actually an edge of G, which is necessary and correct. + +- **`answer(True)`**: Correct—the problem is solved affirmatively by Thomassen [Th83]. + +- **Universe considerations**: The implicit `{V : Type*}` quantification is universe-polymorphic, which is appropriate for a statement about arbitrary graphs. + +**No mathematical flaws identified.** An experienced mathematician would find this formalization faithful to the original problem. diff --git a/ai-review/738.md b/ai-review/738.md new file mode 100644 index 0000000000..e6447f7ea9 --- /dev/null +++ b/ai-review/738.md @@ -0,0 +1,89 @@ +# AI Review: Erdos Problem 738 + +## 1. Code Reuse + +**Custom definition could be replaced.** The file defines `HasInfiniteChromaticNumber` locally: + +```lean +def HasInfiniteChromaticNumber {V : Type*} (G : SimpleGraph V) : Prop := + ∀ n : ℕ, IsEmpty (G.Coloring (Fin n)) +``` + +Mathlib provides `SimpleGraph.chromaticNumber : SimpleGraph V → ℕ∞`, and `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already builds lemmas around it (including notation `χ(G)`). The condition `HasInfiniteChromaticNumber G` is equivalent to `χ(G) = ⊤`. Using the Mathlib concept would improve consistency. + +However, the custom definition is mathematically equivalent and arguably more transparent for readability. Other problems in the codebase (e.g., Erdos 110, 737) also define their own chromatic number predicates locally, so this is consistent with current project conventions. + +All other concepts (`CliqueFree`, `IsTree`, `↪g`, `Coloring`) are standard Mathlib definitions — no custom replacements needed. + +## 2. Citations + +The formalization cites: + +> [Er81] Erdős, P., _On the combinatorial problems which I would most like to see solved_. Combinatorica 1 (1981), 25-42. + +The erdosproblems.com page for Problem 738 lists: +- **Source:** [Er81] +- **Attribution:** A conjecture of Gyárfás + +The citation matches the website. The docstring correctly attributes it as "Gyárfás conjecture." No missing references. + +## 3. Variants + +The erdosproblems.com page states the problem as: + +> If a graph G has infinite chromatic number and is triangle-free (contains no K₃), must G contain every tree as an induced subgraph? + +The formalization captures this single statement. The website does not mention additional variants. **No missing variants.** + +Note: The broader Gyárfás conjecture (sometimes stated for graphs with no odd cycles of length ≤ k, or for graphs excluding a fixed tree) is a family of related conjectures, but Problem 738 as stated on the website specifically concerns the triangle-free case with *every* finite tree. The formalization correctly captures this specific version. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring clearly explains the mathematical content. +- The `HasInfiniteChromaticNumber` helper is well-named and well-documented. +- The namespace `Erdos738` keeps definitions scoped. +- The structure follows project conventions. + +**No significant readability concerns.** + +## 5. Formalizability + +The problem is **precisely stated and unambiguously formalizable**. Each component maps cleanly to established mathematical concepts: + +- "infinite chromatic number" → cannot be properly colored with finitely many colors +- "triangle-free" → `CliqueFree 3` +- "finite tree" → `IsTree` on `Fin m` +- "induced subgraph" → graph embedding (`↪g`) + +There is one subtlety worth noting: the problem asks whether G must contain every **tree** as an induced subgraph, and trees are formalized on `Fin m` (finite vertex sets). This is correct since the problem concerns finite trees. The universality over all `m : ℕ` and all trees `T : SimpleGraph (Fin m)` correctly captures "every finite tree." + +**Ambiguity level: Very low.** The statement is a clean yes/no question with standard graph-theoretic definitions. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +1. **Infinite chromatic number:** `∀ n : ℕ, IsEmpty (G.Coloring (Fin n))` correctly states that G cannot be properly colored with any finite number of colors. This is the standard definition of infinite chromatic number for simple graphs. + +2. **Triangle-free:** `G.CliqueFree 3` is the standard Mathlib formalization of "contains no K₃." + +3. **Every finite tree as induced subgraph:** The conclusion `∀ (m : ℕ) (T : SimpleGraph (Fin m)), T.IsTree → Nonempty (T ↪g G)` correctly states that for every finite tree T, there exists an embedding of T into G. Crucially, `↪g` is `RelEmbedding` on the adjacency relation, which has `map_rel_iff'` — an **iff** condition. This means the embedding preserves both adjacency and non-adjacency, making it an *induced* subgraph embedding. This correctly captures the problem's requirement. + +4. **Quantifier structure:** The universal quantification over `V : Type*` and `G : SimpleGraph V` correctly captures "for all graphs G." The formalization is universe-polymorphic, which is appropriate. + +5. **Answer wrapper:** `answer(sorry)` correctly reflects that the problem is open (the answer is unknown). + +**No mathematical flaws identified.** The formalization faithfully captures the Gyárfás conjecture as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Minor: could use Mathlib's `chromaticNumber = ⊤` instead of custom def, but current approach is consistent with project conventions | +| Citations | Correct and complete | +| Variants | All variants captured (single statement problem) | +| Readability | Good | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/739.md b/ai-review/739.md new file mode 100644 index 0000000000..08d94ddd07 --- /dev/null +++ b/ai-review/739.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 739 + +## 1. Code Reuse + +**Issue found.** The local definition `cardChromaticNumber` (lines 48–52) is a near-exact duplicate of `SimpleGraph.chromaticCardinal` defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136–137`. + +Compare: + +```lean +-- 739.lean (local) +noncomputable def cardChromaticNumber {V : Type u} + (G : SimpleGraph V) : Cardinal.{u} := + sInf {κ : Cardinal.{u} | ∃ (α : Type u), #α = κ ∧ Nonempty (G.Coloring α)} + +-- Coloring.lean (library) +noncomputable def chromaticCardinal.{u} {V : Type u} (G : SimpleGraph V) : Cardinal := + sInf {κ : Cardinal | ∃ (C : Type u) (_ : Cardinal.mk C = κ), Nonempty (G.Coloring C)} +``` + +These are definitionally the same (the anonymous `_ :` binder vs `∧` is a trivial syntactic difference). The local `cardChromaticNumber` should be replaced with `SimpleGraph.chromaticCardinal`. + +Additionally, the subgraph embedding pattern (injective homomorphism at lines 70–71) is used across 40+ files in the codebase. No shared `ContainsSubgraph` utility exists at the library level, so inline usage is consistent with codebase conventions. + +## 2. Citations + +The formalization's references are shorthand tags that lack full bibliographic detail. The website (https://www.erdosproblems.com/739) provides more context: + +- **[Ga73]** Galvin, F., 1973 — Proved the statement for 𝔪 = ℵ₀. Also showed that requiring *induced* subgraphs implies 2^𝔨 < 2^𝔫 for all cardinals 𝔨 < 𝔫. +- **[Ko88b]** Komjáth, P., 1988 — Established consistency of failure (with 𝔪 = ℵ₂, 𝔫 = ℵ₁) under 2^ℵ₀ = 2^ℵ₁ = 2^ℵ₂ = ℵ₃. +- **[Sh90]** Shelah, S., 1990 — Proved the affirmative under V = L for 𝔪 = ℵ₂, 𝔫 = ℵ₁. + +The docstring also omits that whether the answer is affirmative under GCH remains open, which is noted on the website. + +## 3. Variants + +The formalization captures the main question only. The website mentions an additional result by Galvin: requiring *induced* subgraphs (rather than arbitrary subgraphs) leads to the condition 2^𝔨 < 2^𝔫 for all 𝔨 < 𝔫. This induced-subgraph variant is not formalized. This is acceptable since it is a separate result rather than a variant of the conjecture, but could be noted in the docstring for completeness. + +## 4. Readability + +Generally good. Suggestions: + +- Replace the local `cardChromaticNumber` with the library's `SimpleGraph.chromaticCardinal` to reduce cognitive overhead and improve discoverability. +- The existential `∃ (W : Type u) (H : SimpleGraph W), ...` for subgraphs is clear and idiomatic. +- The use of fraktur variables (𝔪, 𝔫) nicely mirrors the mathematical notation. + +## 5. Formalizability + +**Assessment: High formalizability with one set-theoretic caveat.** + +The problem statement is precise enough to formalize. The core question — "does every infinite cardinal below the chromatic number appear as the chromatic number of a subgraph?" — translates cleanly into the language of cardinals and graph colorings. + +The main subtlety is that this problem is **independent of ZFC**: Komjáth showed it is consistent that the answer is no, while Shelah showed it follows from V = L. The formalization handles this correctly by wrapping the statement in `answer(sorry) ↔ ...`, which is the codebase convention for problems whose truth value is unknown or set-theoretically independent. + +**Ambiguity level: Low.** The only potential ambiguity is the meaning of "subgraph" (induced vs. non-induced), which the formalization resolves by using non-induced subgraphs (injective homomorphism preserving edges but not non-edges). This matches the standard graph-theoretic meaning. + +## 6. Correctness + +**The formalization is mathematically sound but has one notable observation:** + +### Correct aspects: +- The `cardChromaticNumber` / `chromaticCardinal` definition correctly computes the infimum over cardinals admitting a proper coloring. This extends the finite chromatic number to the transfinite setting. +- The subgraph condition (injective `f : W → V` preserving adjacency) correctly captures "isomorphic to a subgraph of G." +- The constraint `ℵ₀ ≤ 𝔪` correctly restricts to graphs with infinite chromatic number. +- The constraint `ℵ₀ ≤ 𝔫 ∧ 𝔫 < 𝔪` correctly restricts to infinite cardinals below 𝔪. +- The `answer(sorry)` wrapper is appropriate for a ZFC-independent statement. +- Universe handling (`Type u` throughout) is consistent and correct. + +### Observation — Galvin's result and the ℵ₀ case: +The docstring states "A question of Galvin [Ga73], who proved the case 𝔪 = ℵ₀." However, under the formalization's restriction that 𝔫 must be infinite (ℵ₀ ≤ 𝔫), the case 𝔪 = ℵ₀ is **vacuously true** — there are no infinite cardinals strictly less than ℵ₀. Galvin's actual non-trivial result is that every graph with chromatic number ℵ₀ has subgraphs of every *finite* chromatic number, which is a statement about finite 𝔫. This means the docstring's attribution is technically misleading in context: it describes a result that is non-trivial for the broader question (all 𝔫 < 𝔪) but vacuous for the restricted question as formalized (infinite 𝔫 < 𝔪). This is not an error in the formalization itself — the restriction to infinite 𝔫 is the natural focus for the open problem — but the docstring should clarify this. + +### No obvious mathematical flaws: +An experienced mathematician would find the formalization faithful to the intended problem. The choice to restrict to infinite 𝔫 is reasonable and captures the genuinely open (and set-theoretically interesting) part of the question. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `cardChromaticNumber` duplicates `SimpleGraph.chromaticCardinal` from the library | +| Citations | Shorthand only; missing GCH-related open question from website | +| Variants | Induced subgraph variant (Galvin) not captured; acceptable | +| Readability | Good; would improve by using library definition | +| Formalizability | High; low ambiguity | +| Correctness | Sound; docstring mention of Galvin's ℵ₀ case is vacuous under the formalization's infinite-𝔫 restriction | diff --git a/ai-review/740.md b/ai-review/740.md new file mode 100644 index 0000000000..b8050607ca --- /dev/null +++ b/ai-review/740.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 740 + +## 1. Code Reuse + +**Cardinal chromatic number — direct duplicate.** +`Erdos740.cardChromaticNumber` (line 47) is essentially identical to `SimpleGraph.chromaticCardinal` already defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136`: + +```lean +-- 740.lean (local) +noncomputable def cardChromaticNumber {V : Type u} + (G : SimpleGraph V) : Cardinal.{u} := + sInf {κ : Cardinal.{u} | ∃ (α : Type u), #α = κ ∧ Nonempty (G.Coloring α)} + +-- FormalConjecturesForMathlib (shared) +noncomputable def chromaticCardinal.{u} {V : Type u} (G : SimpleGraph V) : Cardinal := + sInf {κ : Cardinal | ∃ (C : Type u) (_ : Cardinal.mk C = κ), Nonempty (G.Coloring C)} +``` + +These are definitionally equivalent (both take `sInf` over the same set of cardinals). The local definition should be replaced with `SimpleGraph.chromaticCardinal`. + +**Subgraph embedding — partial reuse possible.** +The inline subgraph embedding predicate on line 67: +```lean +(∃ f : W → V, Function.Injective f ∧ ∀ a b, H.Adj a b → G.Adj (f a) (f b)) +``` +is the same pattern as `Erdos87.ContainsSubgraph` (`FormalConjectures/ErdosProblems/87.lean:38`). However, since `ContainsSubgraph` wraps the *entire* existential (including the graph), and here the graph `H` is already bound by an outer existential, direct reuse would require a refactor of `ContainsSubgraph` or a new shared predicate like `IsSubgraphOf`. This is a minor point — the inline version is acceptable for now. + +## 2. Citations + +**Module docstring** (line 24): `[Er69b][Er71, p.100][Er81][Er95d]` — matches the website. + +**Theorem docstring** (line 52): `[Er69b][Er71][Er81][Er95d]` — **missing the page reference `p.100`** for [Er71]. Should be `[Er69b][Er71, p.100][Er81][Er95d]` to match the website. + +The website also attributes the problem to "A question of Erdős and Hajnal", which is correctly reflected in both docstrings. + +## 3. Variants + +The website describes three related questions: + +| Variant | Described in docstring? | Formalized? | +|---------|------------------------|-------------| +| Main question (odd cycles of length ≤ r in infinite chromatic subgraph) | Yes | Yes | +| Generalized $f_r(\mathfrak{m})$ version (chromatic number ≥ $f_r(\mathfrak{m})$ suffices) | Yes (module doc) | No | +| Girth variant from [Er81] (no cycles at all of length ≤ C, not just odd) | **No** | No | + +**Missing variant:** The website states: *Erdős [Er81] also posed the analogous question with girth (requiring subgraphs with no cycles of length ≤ C).* This girth variant is not mentioned or formalized. It could be captured by dropping the `Odd p.length` hypothesis in the cycle condition. The [Er95d] triangle-free remark (even $r=3$ is open) is also not explicitly noted. + +The $f_r(\mathfrak{m})$ variant is described in the module docstring but not formalized as a separate theorem, which is acceptable since it is a strictly stronger conjecture and the main question is the one numbered 740. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- **Naming:** `cardChromaticNumber` is clear but non-standard relative to the shared codebase name `chromaticCardinal`. Switching to the shared definition would improve consistency. +- **Subgraph condition:** The inline embedding condition `(∃ f : W → V, Function.Injective f ∧ ∀ a b, H.Adj a b → G.Adj (f a) (f b))` is standard and readable. +- **Cycle condition:** `∀ (w : W) (p : H.Walk w w), p.IsCycle → Odd p.length → r < p.length` reads naturally as "every odd cycle has length > r", which is equivalent to "no odd cycle of length ≤ r". Clear. + +## 5. Formalizability + +**Assessment: High — the problem is precisely formalizable with minimal ambiguity.** + +The statement involves standard, well-defined objects: infinite cardinals, graph chromatic number, subgraphs, odd cycles, and cycle length. All of these have clear Lean/Mathlib counterparts. + +The only mild ambiguity is the word "subgraph" — it could mean "subgraph" (subset of vertices and edges), "induced subgraph", or "graph minor". In graph theory, the standard meaning is the first: a graph obtained by deleting vertices and/or edges. The formalization correctly captures this via an injective homomorphism (which is exactly a not-necessarily-induced subgraph embedding). This is the standard and intended interpretation. + +## 6. Correctness + +**Overall: Correct, with one subtle point worth noting.** + +**What the formalization states:** For every graph $G$ with infinite chromatic number $\mathfrak{m}$ and every $r \geq 1$, there exists a graph $H$ with chromatic number $\mathfrak{m}$ that embeds injectively into $G$ (preserving adjacency) and has no odd cycle of length $\leq r$. + +**Mathematically correct aspects:** +- The cardinal chromatic number definition correctly handles infinite chromatic numbers (unlike `Mathlib.chromaticNumber : ℕ∞` which collapses all infinite values to `⊤`). +- The condition `ℵ₀ ≤ 𝔪` correctly restricts to infinite cardinals. +- The subgraph embedding via injective homomorphism is the correct notion (not requiring induced subgraph, which would be too strong). +- The odd-cycle-freeness condition `p.IsCycle → Odd p.length → r < p.length` correctly captures "no odd cycle of length ≤ r". +- The universe polymorphism `Type u` is consistent throughout. + +**Subtle point:** The formalization quantifies over `𝔪 : Cardinal.{u}` and requires `cardChromaticNumber G = 𝔪`. This means the chromatic number is *exactly* $\mathfrak{m}$, not merely $\geq \mathfrak{m}$. This is correct for the main problem statement ("Let $G$ be a graph with chromatic number $\mathfrak{m}$"). The subgraph $H$ is also required to have chromatic number *exactly* $\mathfrak{m}$, matching the problem ("contains a subgraph of chromatic number $\mathfrak{m}$"). + +**No mathematical flaws identified.** The formalization is a faithful rendering of the main question of Erdős Problem 740. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `cardChromaticNumber` duplicates `chromaticCardinal` from shared library | +| Citations | Minor issue | Theorem docstring missing `p.100` page ref for [Er71] | +| Variants | Partial | Girth variant from [Er81] not mentioned | +| Readability | Good | Clear and idiomatic | +| Formalizability | High | Standard, unambiguous objects throughout | +| Correctness | Correct | Faithful formalization of the main problem | diff --git a/ai-review/742.md b/ai-review/742.md new file mode 100644 index 0000000000..e661fd1c06 --- /dev/null +++ b/ai-review/742.md @@ -0,0 +1,83 @@ +# AI Review: Erdos Problem 742 + +## 1. Code Reuse + +**Redundant `G.Connected` hypothesis.** In Mathlib, `SimpleGraph.diam` is defined as `ENat.toNat` of `ediam`. For a disconnected graph, `ediam = ⊤`, so `diam = 0`. Therefore `G.diam = 2` already implies `G.Connected`. The explicit `G.Connected` hypothesis is logically redundant, though it does improve readability by making the intent clear. + +**`HasDiameterAtMostTwo` in Erdos 133/134.** Problems 133 (`133.lean:49`) and 134 define a local predicate `HasDiameterAtMostTwo` using a common-neighbor characterization rather than `G.diam`. Problem 742 correctly uses the Mathlib `G.diam` instead, which is preferable. + +**Edge-criticality patterns.** Several other problems use `G.deleteEdges {Sym2.mk (v, w)}` for single-edge deletion (744, 1032, 1067, 917, 74, 1092). There is `IsCriticalEdges`/`IsCriticalEdge` in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:72-77`, but those are specific to chromatic-number criticality, not diameter criticality. No reusable diameter-critical predicate exists in the codebase. A shared `IsDiameterCritical` definition could be introduced but is not strictly necessary for a single use. + +**No other reuse opportunities identified.** The `DiamExtra.lean` utility file provides basic diameter lemmas but nothing directly applicable here. + +## 2. Citations + +The docstring references: +- `[CaHa79]` — attributed to "Murty and Plesnik" +- `[Fu92]` — Furedi's proof +- `[Er81]` — in the theorem attribute + +The website additionally notes: +- Furedi credits the conjecture to **"Murty and Simon"** (not Plesnik). The docstring says "Murty and Plesnik" which matches the `[CaHa79]` citation but omits the alternative attribution. +- Erdos indicated the conjecture traces back to **Ore in the 1960s**. The docstring says "also attributed to Ore" which is consistent. +- **Noga Alon** is acknowledged for contributions on the website; not mentioned in the formalization (minor). + +**Recommendation:** The citations are acceptable. Optionally, the docstring could note that Furedi attributes the conjecture to "Murty and Simon" per the website, to be comprehensive. + +## 3. Variants + +The website presents a single problem statement with no additional variants. The formalization captures the full conjecture. No variants are missing. + +However, one could argue that a weaker variant restricted to "sufficiently large $n$" (matching Furedi's actual theorem) would be a useful separate statement, since that is what has been proved. The current formalization captures the full conjecture for all $n$. + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- The docstring accurately describes the problem. +- The edge-deletion condition is broken into a readable disjunction: either the graph becomes disconnected or the diameter exceeds 2. +- The `Sym2.mk (v, w)` pattern for edge construction is standard in this codebase. +- The redundant `G.Connected` hypothesis, while logically unnecessary, arguably aids readability by making the premise explicit. + +**No readability issues.** + +## 5. Formalizability + +The problem is **clearly formalizable**. All concepts — graph on $n$ vertices, diameter 2, edge deletion increasing diameter (either via disconnection or increase beyond 2), and edge count bound — have precise mathematical definitions and direct Mathlib counterparts. + +**Ambiguity assessment: Low.** The only source of ambiguity is what "increases the diameter" means when deletion disconnects the graph (is the diameter then infinite or undefined?). The formalization handles this correctly by treating disconnection as a separate case in the disjunction, since Mathlib's `diam` returns 0 for disconnected graphs. This is the standard convention and matches the intended mathematical meaning. + +## 6. Correctness + +### Mostly correct, with one significant concern: + +**The `∀ n` vs. "sufficiently large $n$" discrepancy.** +The formalization quantifies over all $n$: +``` +∀ (n : ℕ) (G : SimpleGraph (Fin n)), ... +``` +But both the docstring and the website state that Furedi's result holds **"for sufficiently large $n$"**. The `answer(True)` asserts the bound holds for every $n$, including small values. This may well be true (small cases are presumably checkable), but: +1. The docstring says "This is true (for sufficiently large $n$)" — this is inconsistent with the `answer(True)` which claims truth for all $n$. +2. If any diameter-critical graph on a small $n$ has more than $\lfloor n^2/4 \rfloor$ edges, the formalization as stated would be false. + +**Verdict:** The conjecture as originally posed (by Murty-Plesnik/Ore) is indeed for all $n$, and the formalization captures that. Furedi's proof resolves it for large $n$. The `answer(True)` is a reasonable claim (small cases likely hold), but the docstring is misleading — it should either say the conjecture is believed true for all $n$ (with Furedi's proof covering large $n$), or the formalization should include an `∃ N, ∀ n ≥ N, ...` quantifier to match the proven result exactly. + +### Edge deletion condition — correct. +The condition `∀ v w, G.Adj v w → ¬(G.deleteEdges {Sym2.mk (v, w)}).Connected ∨ 2 < (G.deleteEdges {Sym2.mk (v, w)}).diam` correctly captures "every edge is critical for maintaining diameter 2." The disjunction is necessary because Mathlib's `diam` returns 0 for disconnected graphs, so `2 < diam` alone would miss the disconnection case. + +### Edge count bound — correct. +`G.edgeFinset.card ≤ n ^ 2 / 4` with natural number division gives $\lfloor n^2/4 \rfloor$. The complete bipartite graph $K_{\lfloor n/2 \rfloor, \lceil n/2 \rceil}$ achieves exactly $\lfloor n^2/4 \rfloor$ edges, confirming this is the correct tight bound. + +### Vacuous truth for small $n$ — fine. +For $n \le 2$, no graph can have `diam = 2`, so the statement is vacuously true. This is not an issue. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No significant reuse opportunities missed | +| Citations | Acceptable; minor: could mention Murty-Simon attribution | +| Variants | Complete — no missing variants | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | **`∀ n` vs. "sufficiently large $n$"**: docstring is inconsistent with the universal quantification in the formalization. Either update the docstring to clarify the conjecture is for all $n$, or weaken the statement. The `G.Connected` hypothesis is redundant but harmless. All other aspects are correct. | diff --git a/ai-review/743.md b/ai-review/743.md new file mode 100644 index 0000000000..11f8bce3a2 --- /dev/null +++ b/ai-review/743.md @@ -0,0 +1,94 @@ +# Review: Erdős Problem 743 + +## 1. Code Reuse + +**Limited reuse opportunities.** The formalization takes a self-contained approach using injective maps and `Sym2`-based edge identity conditions, which is clean and appropriate. + +Erdős Problem 76 (`FormalConjectures/ErdosProblems/76.lean`) defines `IsEdgeDisjointFamily` and `triangleEdges` for edge-disjoint triangle families using `Finset (Sym2 (Fin n))`. Problem 19 (`FormalConjectures/ErdosProblems/19.lean`) also deals with edge-disjoint unions (of cliques). However, both use fundamentally different formalizations (finsets of vertex-sets with edge-disjointness as `Disjoint` on `Finset (Sym2 _)`), and the current approach of injective embeddings with pointwise `Sym2.mk` comparisons is arguably more natural for the tree packing problem, where the trees have heterogeneous vertex types (`Fin (k.val + 2)` for each `k`). + +No utilities from `FormalConjecturesForMathlib` appear directly applicable. The `SimpleGraph.IsTree` predicate is from Mathlib (`Mathlib.Combinatorics.SimpleGraph.Acyclic`) and is correctly used. + +**Verdict:** No changes recommended. + +## 2. Citations + +The docstring references `[Er81] Erdős, P.` which matches the website's primary citation. + +The website lists additional references for partial results that are mentioned in the module docstring prose: +- **GyLe78** — Gyárfás & Lehel (1978): mentioned in prose ✓ +- **Fi83** — Fishburn (1983): mentioned in prose ✓ +- **Bo83** — Bollobás (1983): mentioned in prose ✓ +- **JKKO19** — Joos, Kim, Kühn & Osthus (2019): mentioned in prose ✓ +- **JaMo24** — Janzer & Montgomery (2024): mentioned in prose ✓ +- **ABCHPT21** — Allen, Böttcher, Clemens, Hladký, Piguet & Taraz (2021): **NOT mentioned**. The website credits them with proving the conjecture when all trees have maximum degree ≤ c·n/log(n) for some constant c > 0. This is a notable intermediate result between JKKO19 (bounded degree) and JaMo24. + +**Recommendation:** Consider adding a line to the module docstring mentioning the Allen–Böttcher–Clemens–Hladký–Piguet–Taraz result. + +## 3. Variants + +The main conjecture is fully captured: can K_n always be decomposed into edge-disjoint copies of trees T_2, …, T_n where T_k has k vertices? + +The website does not list separate variants — only partial results toward the same conjecture. The known partial results (bounded-degree trees, greedy packing of small trees, packing of large trees) are all weaker statements subsumed by the main conjecture. There are no distinct variant conjectures to formalize. + +**Verdict:** No missing variants. + +## 4. Readability + +The formalization is well-structured and readable: +- The module docstring clearly states the problem, attributes it to Gyárfás, and summarizes key partial results. +- The theorem docstring concisely restates the conjecture. +- Inline comments (`-- Each embedding is injective`, `-- The edge images are pairwise disjoint across different trees`, `-- Every edge of Kₙ is covered`) clearly label each condition. +- The indexing scheme (`Fin (n - 1)` with vertex type `Fin (k.val + 2)`) is slightly indirect but necessary to encode the heterogeneous tree sizes, and is well-handled. + +**Minor observation:** The `2 ≤ n` hypothesis is technically unnecessary — when `n ≤ 1`, `Fin (n - 1)` is empty (since `n - 1 = 0` in `ℕ`), making the universal quantifier over trees vacuous, and `Fin n` has at most one element so the edge-covering condition is also vacuous. The statement would be trivially satisfiable. However, including `2 ≤ n` is a defensible stylistic choice that signals to the reader the intended domain and avoids degenerate cases. + +**Verdict:** Readable. No changes needed. + +## 5. Formalizability + +The tree packing conjecture is highly amenable to formalization. The statement is purely combinatorial: given any sequence of trees with specified sizes, does an edge-disjoint packing into K_n exist? There is no ambiguity in the mathematical statement. + +Key aspects that are unambiguous: +- "Trees" — standard graph-theoretic definition (connected acyclic graphs), formalized via `SimpleGraph.IsTree`. +- "T_k has k vertices" — captured by the vertex type `Fin (k.val + 2)`. +- "Edge-disjoint union" — captured by the three conditions (injectivity, pairwise edge-disjointness, full edge coverage). +- "K_n" — the complete graph on n vertices, implicitly represented as all pairs of distinct elements of `Fin n`. + +**Verdict:** Unambiguous and clearly formalizable. No issues. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +**Detailed verification:** + +1. **Tree indexing:** `Fin (n - 1)` indexes n−1 trees. For `k : Fin (n - 1)` with `k.val = j` (where j ∈ {0, …, n−2}), tree `T k` has vertex type `Fin (j + 2)`, i.e., j + 2 vertices. This gives trees with 2, 3, …, n vertices — exactly T_2, …, T_n. ✓ + +2. **Edge count consistency:** K_n has n(n−1)/2 edges. The trees T_2, …, T_n have 1, 2, …, n−1 edges respectively (a tree on m vertices has m−1 edges). Total: 1 + 2 + ⋯ + (n−1) = n(n−1)/2. The edge counts match, confirming that a decomposition is at least numerically feasible. ✓ + +3. **Injectivity ensures faithful copies:** Since `f k` is injective, it maps the `k.val + 2` vertices of `T k` to distinct vertices of `Fin n`, so the image is a faithful copy of `T k` in K_n. Moreover, since K_n is complete and `f k` is injective, every edge `{a, b}` of `T k` maps to an actual edge `{f k a, f k b}` of K_n (because `a ≠ b` implies `f k a ≠ f k b`). ✓ + +4. **Intra-tree edge distinctness:** If `(a₁, b₁)` and `(a₂, b₂)` are distinct edges of `T k`, then `Sym2.mk (f k a₁, f k b₁) ≠ Sym2.mk (f k a₂, f k b₂)` follows from injectivity of `f k`. So edges within a single tree's image are automatically distinct without needing an explicit condition. ✓ + +5. **Inter-tree edge disjointness (condition 2):** Correctly states that for `k₁ ≠ k₂`, edge images from `T k₁` and `T k₂` do not collide. Combined with point 4, all edge images across all trees are distinct. ✓ + +6. **Edge covering (condition 3):** Every edge `{v, w}` of K_n (i.e., every pair with `v ≠ w` in `Fin n`) is the image of some tree edge. Combined with edge disjointness, this gives an exact partition of the edges of K_n. ✓ + +7. **No spurious requirements:** The formalization does not require induced subgraph embeddings (preservation of non-adjacency), which is correct — the tree packing conjecture only asks for edge-disjoint copies, not induced copies. ✓ + +8. **Open problem status:** The `answer(sorry)` pattern is appropriate for an open conjecture. The expected answer would be `True` if the conjecture holds. ✓ + +**Verdict:** Correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No actionable reuse opportunities | +| Citations | Minor: ABCHPT21 reference missing from docstring | +| Variants | Complete — no missing variants | +| Readability | Good — clear structure and comments | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The only recommendation is to add a mention of the Allen–Böttcher–Clemens–Hladký–Piguet–Taraz (2021) result to the module docstring for completeness of the historical record. diff --git a/ai-review/744.md b/ai-review/744.md new file mode 100644 index 0000000000..ac16ae7d3c --- /dev/null +++ b/ai-review/744.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 744 + +## 1. Code Reuse + +**Significant overlap with Problem 74.** The file `FormalConjectures/ErdosProblems/74.lean` defines nearly identical concepts: +- `SimpleGraph.edgeDistancesToBipartite` (line 40): the set of all edge-deletion counts that make a subgraph bipartite. +- `SimpleGraph.minEdgeDistToBipartite` (line 58): the minimum such count, using `sInf` — essentially the same as 744's `minEdgesToBipartite`. +- Problem 74 also proves `edgeDistancesToBipartite_nonempty` (line 48) and `subgraphEdgeDistsToBipartite_bddAbove` (line 75), which would be relevant utilities. + +The 744 definition `minEdgesToBipartite` differs in that it operates on a top-level `SimpleGraph (Fin n)` using `deleteEdges` with a `Finset (Sym2 V)`, while 74's version works on `Subgraph` using `ncard`. These are not directly interchangeable but represent duplicated concepts. Consider refactoring 744 to reuse 74's `minEdgeDistToBipartite` or extracting a shared definition. + +**Criticality definitions.** `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` defines: +- `IsCritical k` (line 96): vertex-critical definition (χ(G) = k and removing any vertex reduces χ). +- `IsCriticalEdge` / `IsCriticalEdges` (lines 72–77): edge-criticality in terms of chromatic number reduction. + +The 744 `IsKCritical` is a proper-subgraph (edge-critical) definition, which is the standard notion of k-critical in graph theory. It is semantically distinct from the vertex-critical `IsCritical` in Coloring.lean. The two notions are related but not equivalent (edge-critical ⇒ vertex-critical, but not conversely in general). The choice in 744 is correct for the problem, but it would improve consistency to either reuse the library definition or document why a different one is needed. + +Problems 917 and 1032 also define their own edge-critical variants; consolidation would benefit the codebase. + +## 2. Citations + +The formalization includes: +- `[Er81]` — Erdős, P. +- `[EHS82]` — Erdős, P., Hajnal, A., and Szemerédi, E. +- `[RoTu85]` — Rödl, V. and Tuza, Zs. + +**Missing citation:** The website also references `[Ga68]` — Gallai (1968), who gave the construction showing f₄(n) ≪ n^{1/2}. This is not included in the formalization. + +**Citation detail:** The existing citations are shorthand only (author names, no titles or publication venues). The website similarly provides only shorthand tags, so the formalization matches the source. However, Problem 74 does include a fuller citation for [EHS82] with the paper title and page numbers (line 110–111 of 74.lean). For consistency, 744 could adopt the same level of detail: +> Erdős, P. and Hajnal, A. and Szemerédi, E., *On almost bipartite large chromatic graphs*, Theory and practice of combinatorics (1982), 117–123. + +## 3. Variants + +The formalization captures only the main conjecture: "Is it true that f_k(n) → ∞ as n → ∞ for k ≥ 4?" + +**Missing variants from the website:** +- **f₄(n) ≫ log n**: The specific stronger question about logarithmic growth for k=4 is mentioned in the docstring but not formalized as a separate theorem/variant. +- **f₃(n) = 1**: The trivial case for odd cycles is noted on the website but not formalized. +- **Gallai's bound**: f₄(n) ≪ n^{1/2} (from [Ga68]). +- **Lovász's bound**: f_k(n) ≪ n^{1 − 1/(k−2)}. +- **Rödl–Tuza exact result**: f_k(n) = C(k−1, 2) for sufficiently large n. This is described in the docstring but could be formalized as a separate statement, which would be more useful than the current formulation (which only captures the negation of the divergence conjecture). + +Formalizing the Rödl–Tuza result directly would be mathematically more informative and is a natural companion statement. + +## 4. Readability + +The code is generally clear and well-structured. Suggestions: + +- The docstring for `IsKCritical` (line 40–42) is good. However, it says "every proper subgraph (strictly fewer edges)" — this parenthetical is helpful for clarifying the `H < G` ordering. +- The `minEdgesToBipartite` definition uses `(↑S : Set (Sym2 V))` for the coercion. This is fine but could benefit from a brief comment noting that `S` ranges over subsets of actual edges of `G` (currently it ranges over all `Finset (Sym2 V)`, including non-edges — which doesn't affect correctness since deleting non-edges is a no-op, but could be noted). +- The main theorem statement `erdos_744` is readable. The `answer(False)` pattern clearly signals the disproved status. + +## 5. Formalizability + +**Assessment: Highly formalizable with minor caveats.** + +The problem is precisely stated: f_k(n) is well-defined for each k and n (as an infimum over a specific class of graphs), and the question of whether it tends to infinity is unambiguous. + +**Ambiguity concerns:** +- **Empty infimum behavior.** When no k-critical graph on n vertices exists (e.g., n < k for most k), `fk k n = sInf ∅ = 0` in ℕ. This is a Lean convention (Nat.sInf of empty set is 0), not matching the mathematical intent where f_k(n) is typically only defined when k-critical graphs on n vertices exist. However, this does not affect the correctness of the Tendsto statement: since f_k(n) eventually equals C(k−1, 2) (a finite constant), it does not tend to infinity regardless of the behavior at small n. +- **Vertex type.** Using `Fin n` as the vertex type means the graph has exactly n vertices with no isolated vertices implicitly excluded. A k-critical graph on n vertices should use all n vertices (since in a k-critical graph, every vertex is needed). This is fine. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **`IsKCritical` is correct.** It captures: G is k-colorable, not (k−1)-colorable (so χ(G) = k), and every graph with strictly fewer edges on the same vertex set is (k−1)-colorable. This is exactly the standard definition of a k-critical graph. +- **`minEdgesToBipartite` is correct.** The infimum over cardinalities of edge sets whose removal yields a 2-colorable graph correctly captures the odd cycle transversal number / bipartite edge deletion distance. +- **`fk` is correct.** The infimum over all k-critical graphs on Fin n of their bipartite edge deletion distance matches f_k(n). +- **The main statement is correct.** `answer(False) ↔ ∀ k, k ≥ 4 → Tendsto (fk k) atTop atTop` asserts that it is false that f_k(n) → ∞ for all k ≥ 4. Since Rödl–Tuza showed f_k(n) stabilizes at C(k−1,2), this is indeed false. The biconditional `False ↔ False` is `True`, so the statement is provable (modulo the graph-theoretic content). + +**Minor note on `DecidableEq V` constraint.** The `minEdgesToBipartite` definition requires `[DecidableEq V]`, but this is automatically available for `Fin n`. No issue in practice. + +**No mathematical flaws identified.** The formalization faithfully captures the essence of the problem and its resolution. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Moderate overlap with Problem 74's bipartite distance definitions; could consolidate | +| Citations | Missing [Ga68]; existing citations lack full bibliographic detail | +| Variants | Only main conjecture captured; f₃=1, log n bound, Rödl–Tuza exact result not formalized | +| Readability | Good; minor improvements possible | +| Formalizability | High; minor caveat about sInf of empty set | +| Correctness | **Correct and complete** for the main statement | diff --git a/ai-review/745.md b/ai-review/745.md new file mode 100644 index 0000000000..ee3754fd24 --- /dev/null +++ b/ai-review/745.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 745 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/`. The problem concerns Erdős–Rényi random graphs and connected component sizes, which is unrelated to the additive combinatorics infrastructure (Sidon sets, representation functions, etc.) present elsewhere in the codebase. The formalization builds its own random graph model from scratch (`toGraph745`, `gnpWeight745`, `gnpProb745`, etc.), which is reasonable given the absence of a Mathlib random graph library. However, Mathlib does have `SimpleGraph.ConnectedComponent` and `SimpleGraph.Reachable`, both of which are already used here. + +## 2. Citations + +The formalization includes two references: +- **[Er81]**: Erdős, P., *On the combinatorial problems which I would most like to see solved*. Combinatorica 1 (1981), 25-42. +- **[KSS80]**: Komlós, J., Sulyok, M., and Szemerédi, E., *Linear problems in combinatorial number theory*. Acta Math. Acad. Sci. Hungar. 36 (1980), 341-365. + +These match the references listed on [erdosproblems.com/745](https://www.erdosproblems.com/745). The website lists the same two references ([Er81] as the original source, [KSS80] as the resolution). The citation formatting is correct and complete. + +## 3. Variants + +The website states the problem as: "Describe the size of the second largest component of the random graph on n vertices, where each edge is included independently with probability 1/n." The formalization captures the O(log n) upper bound that Erdős conjectured and KSS80 proved. No additional variants are listed on the website. + +More precise results are known in the literature — the second largest component of G(n, 1/n) has size Θ(log n), with the leading constant known explicitly — but capturing the O(log n) bound is a faithful formalization of the conjecture as stated. No variants appear to be missing. + +## 4. Readability + +The code is reasonably readable. Definitions are well-documented with docstrings. The `745` suffix convention avoids namespace collisions. The definition of `secondLargestComponent745` via `sInf` is mathematically elegant, though the docstring helpfully explains the characterization: the smallest k such that at most one component exceeds size k. + +Minor readability note: the `gnpWeight745` / `gnpProb745` definitions implement a bespoke finite probability model that takes some effort to parse, but this is inherent to the approach of working with explicit edge configurations rather than a measure-theoretic framework. + +## 5. Formalizability + +The original problem statement ("Describe the size of the second largest component") is deliberately open-ended. The formalization interprets this as the specific conjecture Erdős made: that the second largest component is O(log n) with high probability. This is a reasonable and standard interpretation. The "with high probability" aspect (for all ε > 0, eventually probability ≥ 1 − ε) is a clean formalization of the probabilistic statement. **Ambiguity is low** once the conjecture is taken as the target rather than the open-ended "describe." + +## 6. Correctness + +### 6a. `secondLargestComponent745` — Correct + +The definition `sInf {k | ∀ u v, componentSize G u > k → componentSize G v > k → G.Reachable u v}` correctly captures the second largest component size. If the two largest components have sizes L₁ ≥ L₂ ≥ ..., then: +- For k ≥ L₂: any vertex with component size > k must be in the unique largest component (assuming L₁ > L₂; if L₁ = L₂, then no vertex has component size > k, so the condition is vacuous). The condition holds. +- For k = L₂ − 1: vertices in two distinct components of size ≥ L₂ witness failure. + +So `sInf` = L₂. The set is always non-empty (k = n works vacuously since componentSize ≤ n). This is correct. + +### 6b. `gnpProb745` — **INCORRECT: Probability measure is not normalized** + +This is the critical issue in the formalization. The domain of summation is `Fin n → Fin n → Bool`, which has `2^(n²)` elements. However, `toGraph745` and `edgeCount745` only depend on the **upper-triangular** entries `ec i j` where `i < j` (via `min`/`max`). The diagonal and lower-triangular entries are ignored by the graph construction but still iterated over in the sum. + +For each upper-triangular configuration with `e` edges, there are `2^(n(n+1)/2)` total configurations (varying the `n(n+1)/2` unused entries) that all produce the same graph and the same weight `(1/n)^e · (1 − 1/n)^(C(n,2) − e)`. Therefore: + +``` +gnpProb745 n P = 2^(n(n+1)/2) · Pr_{G(n,1/n)}(P) +``` + +The true probability `Pr(P)` under G(n, 1/n) satisfies `Σ_P Pr(P) = 1`, but `gnpProb745 n (fun _ => True) = 2^(n(n+1)/2)`, which grows super-exponentially. + +**Consequence for the theorem**: The statement `gnpProb745 n (...) ≥ 1 − ε` becomes `2^(n(n+1)/2) · Pr(good) ≥ 1 − ε`, i.e., `Pr(good) ≥ (1 − ε) / 2^(n(n+1)/2)`. For large n, this right-hand side is essentially 0, so the theorem is **trivially true** — any event with positive probability satisfies it. The statement does not capture the intended "with high probability" meaning. + +**Fix**: Either: +1. Restrict the configuration space to upper-triangular functions `{p : Fin n × Fin n // p.1 < p.2} → Bool`, or +2. Divide `gnpProb745` by the total weight `2^(n(n+1)/2)` to normalize, or +3. Equivalently, sum only over canonical representatives (one per graph). + +### 6c. Theorem statement structure — Correct (modulo 6b) + +The quantifier structure `∃ C > 0, ∀ ε > 0, ∃ n₀, ∀ n ≥ n₀, Pr(...) ≥ 1 − ε` correctly formalizes "with high probability, the second largest component is O(log n)." The use of `Real.log` (natural logarithm) is appropriate. The cast `(secondLargestComponent745 G : ℝ)` is correct. + +### 6d. Minor observations + +- `gnpWeight745` can produce negative values when `n = 0` or `n = 1` (since `1 − 1/n` is negative or zero), but these degenerate cases don't affect the theorem's asymptotic statement. +- The `Classical.propDecidable` instance is needed for the `Finset.filter` on `Prop`-valued predicates (like `G.Reachable`). This is fine. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities found; standalone model is appropriate | +| Citations | Correct and complete | +| Variants | All relevant variants captured | +| Readability | Good | +| Formalizability | Low ambiguity once interpreted as Erdős's specific conjecture | +| **Correctness** | **INCORRECT — probability model is unnormalized, making the theorem trivially true** | + +**Severity**: High. The core theorem statement does not faithfully capture the mathematical content of Erdős Problem 745 due to the unnormalized probability measure. The fix is straightforward (restrict the configuration space or normalize the weight sum). diff --git a/ai-review/746.md b/ai-review/746.md new file mode 100644 index 0000000000..f7d6e9b92e --- /dev/null +++ b/ai-review/746.md @@ -0,0 +1,65 @@ +# Erdős Problem 746 — Review + +## 1. Code Reuse + +The file defines four local utilities: `toGraph`, `edgeCount`, `graphsWithEdges`, and `gnmFraction`, forming a G(n,m) random graph model based on Boolean edge configurations (`Fin n → Fin n → Bool`). + +**Erdős Problem 900** (`ErdosProblems/900.lean`) defines a cleaner G(n,m) model via `erdosRenyiProbability`, which works directly over `SimpleGraph (Fin n)` objects filtered by `G.edgeFinset.card = m`. This avoids the redundancy inherent in the Boolean encoding (where diagonal and lower-triangle entries are ignored but still enumerated). Neither approach is shared in a common utility file. + +**Recommendation:** Extract a shared G(n,m) probability definition (preferably the cleaner `erdosRenyiProbability` style from 900.lean) into `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` for reuse across problems 746, 900, and potentially others. The Boolean-encoding approach in 746 is correct but unnecessarily indirect. + +No other reusable code from `FormalConjecturesForMathlib/` is directly applicable here. + +## 2. Citations + +**Website sources:** [Er71,p.98], [Er81,p.16], [Er82e,p.69] + +**Code docstring references:** [ErRe66], [Po76], [Ko77], [KoSz83] + +The code cites `[ErRe66]` as the origin of the conjecture, but the website lists `[Er71,p.98]`, `[Er81,p.16]`, `[Er82e,p.69]` as sources. The reference `[ErRe66]` does not appear on the website. The solver references ([Po76], [Ko77], [KoSz83]) are consistent with the website's narrative about Pósa, Korshunov, and Komlós–Szemerédi, though the website does not list these as formal source citations. + +**Recommendation:** Update the docstring sources to match the website: replace `[ErRe66]` with `[Er71,p.98], [Er81,p.16], [Er82e,p.69]` and keep the solver references as supplementary context. + +## 3. Variants + +The problem as stated on the website asks only whether graphs with ≥ (1/2 + ε)n log n edges are almost surely Hamiltonian. The formalization captures this correctly. + +The docstring mentions the **sharp threshold result** of Komlós–Szemerédi: with (1/2)n log n + (1/2)n log log n + cn edges, the probability of Hamiltonicity tends to e^{-e^{-2c}}. This stronger result is **not formalized** — only mentioned in the module docstring. + +**Recommendation:** Consider adding an optional second theorem formalizing the sharp threshold, since the docstring already describes it and it is the definitive resolution. This would make the formalization more complete, though it is not strictly required by the problem statement. + +## 4. Readability + +The code is well-structured and readable. The `toGraph` construction using `min`/`max` for canonical edge representation is clear. The `gnmFraction` definition is straightforward. The docstring provides good mathematical context. + +Minor suggestions: +- The `open SimpleGraph Finset` at the top is broad; consider narrowing scope. +- The `answer(True) ↔ ...` wrapper is standard for the project but could benefit from a brief inline comment noting the problem is proved (already indicated by the `solved` tag). + +## 5. Formalizability + +The problem is **unambiguous and clearly formalizable**. The statement "almost surely a random graph on n vertices with ≥ (1/2 + ε)n log n edges is Hamiltonian" has a standard interpretation in random graph theory: + +- "Almost surely" means probability → 1, formalized as ∀ δ > 0, ∃ n₀, ∀ n ≥ n₀, P ≥ 1 − δ. +- The G(n,m) model is standard. +- `IsHamiltonian` is from Mathlib and has a well-defined meaning. + +There is no ambiguity in the statement. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed analysis:** + +- **Logarithm base:** `Real.log` is the natural logarithm, which is the correct convention in random graph theory. ✓ +- **Edge count bound:** The constraint `m ≤ n.choose 2` correctly caps the number of edges at the maximum for a simple graph. ✓ +- **"Almost surely" encoding:** The ∀ ε > 0, ∀ δ > 0, ∃ n₀, ∀ n ≥ n₀ quantifier structure correctly captures "for any threshold above (1/2)n log n, the probability of Hamiltonicity tends to 1." ✓ +- **Division by zero:** When `graphsWithEdges n m` is empty (m > n choose 2), `gnmFraction` returns 0. The theorem excludes this case via `m ≤ n.choose 2`. ✓ +- **Boolean encoding correctness:** The `toGraph`/`edgeCount` pair is consistent: both use the upper-triangle convention (`min`/`max` and `p.1 < p.2` respectively). Multiple Boolean functions mapping to the same graph are overcounted equally in numerator and denominator, so the fraction is correct. ✓ +- **IsHamiltonian from Mathlib:** Using the standard Mathlib definition avoids any risk of a nonstandard Hamiltonian cycle definition. ✓ +- **`answer(True)` direction:** The `↔` with `answer(True)` correctly asserts the conjecture is true, consistent with the solved status. ✓ + +**One subtle point:** The formalization quantifies ∀ m ≥ (1/2 + ε)·n·log(n), which is slightly stronger than the website's phrasing "with ≥ (1/2 + ε)n log n edges" (which could be read as fixing m = ⌈(1/2 + ε)n log n⌉). However, the monotonicity of Hamiltonicity probability in the G(n,m) model (adding edges can only help) makes the ∀ m formulation equivalent and actually more natural. This is correct. ✓ + +**No mathematical flaws identified.** diff --git a/ai-review/747.md b/ai-review/747.md new file mode 100644 index 0000000000..568f895ff5 --- /dev/null +++ b/ai-review/747.md @@ -0,0 +1,74 @@ +# Review: Erdős Problem 747 + +## 1. Code Reuse + +**`HasMatching` is duplicated.** The definition at `747.lean:49–51` is identical to `Erdos1020.HasMatching` in `1020.lean:43–45`. Both define a matching of size `k` as the existence of a subset `M ⊆ H` with `M.card = k` and pairwise disjoint edges. One shared definition (e.g., in a utility file or imported from 1020) would reduce duplication. + +**`threeEdges` could use `Finset.powersetCard`.** The current definition: +```lean +Finset.univ.powerset.filter (fun s => s.card = 3) +``` +is equivalent to: +```lean +Finset.univ.powersetCard 3 +``` +which is a Mathlib primitive (`Finset.powersetCard`) and would be more idiomatic. Similarly, `hypergraphsWithEdges` filters by card from `powerset` and could use `powersetCard m` on `threeEdges N`. + +**No matching Mathlib hypergraph library exists.** Mathlib has `SimpleGraph.Matching` for 2-uniform graphs but nothing for general hypergraphs, so the custom definitions here are necessary. However, Problem 1020 already provides the relevant abstractions (`IsRUniform`, `HasMatching`) and should be reused. + +## 2. Citations + +The formalization cites: +- [JKV08] Johansson, Kahn, and Vu — ✅ matches the website +- [Ka23] Kahn — ✅ matches the website + +**Missing:** The website also references **[Er81]** as the original Erdős source where the problem appeared. This should be added to the docstring for completeness. The website also attributes the problem to **Shamir (1979)**, which the docstring does mention, but a formal [Er81] citation line would be consistent with the project's citation conventions. + +## 3. Variants + +**Only the r = 3 case is formalized.** The original problem is specifically about 3-uniform hypergraphs, so this is faithful to Shamir's problem. However, Kahn's result [Ka23] establishes the sharp threshold for general r-uniform hypergraphs (r ≥ 2). A variant for general r would capture the full generality of the solved result, though it is not strictly required by the problem statement. + +**Only the upper bound (sufficiency) direction is formalized.** The problem asks "how large should ℓ(n) be?" — implicitly requesting the threshold function. The formalization captures that (1+ε)n log n edges suffice (the JKV08 upper bound). It does **not** formalize the complementary lower bound: that (1−ε)n log n edges do not suffice almost surely. A complete characterization of the threshold would include both directions. + +**The sharp threshold is not captured.** Kahn [Ka23] proved the sharp threshold is at n log n (i.e., the transition happens in a window of width o(n log n)). The formalization with (1+ε)n log n is consistent with, but strictly weaker than, the Ka23 result. The docstring claims "sharp threshold by Kahn [Ka23]" but the theorem statement only captures the coarser JKV08 result. + +## 4. Readability + +- **`threeEdges`**: As noted above, replacing `powerset.filter (fun s => s.card = 3)` with `powersetCard 3` would improve readability and signal intent more clearly. +- **`hypergraphsWithEdges`**: Same improvement applies — use `(threeEdges N).powersetCard m` instead of `(threeEdges N).powerset.filter (fun H => H.card = m)`. +- **Naming**: `hypergraphMatchingFraction` is descriptive. The theorem name `erdos_747` follows the project convention. +- **Overall structure**: Clean and well-organized. The progression from definitions to the main theorem is logical. + +## 5. Formalizability + +**Assessment: High.** The problem as stated on erdosproblems.com ("How large should ℓ(n) be...") is somewhat informal — it asks for a threshold rather than stating a precise mathematical claim. However, the underlying mathematics (the JKV08/Ka23 results) is completely precise. + +The formalization chooses to express "almost surely" via counting fractions of hypergraphs in the uniform model (fixed number of edges chosen uniformly at random). This is a standard and valid approach. An alternative would be the binomial model (each potential edge included independently with probability p), but the two models are asymptotically equivalent in this regime, and the uniform model is arguably cleaner for formalization. + +**Minor ambiguity:** The phrase "almost surely" in probability can mean "with probability 1" (measure-theoretic) or "with probability tending to 1" (asymptotic). The formalization correctly uses the latter interpretation (fraction ≥ 1−δ for all δ > 0 and sufficiently large n), which is the standard meaning in random graph theory. + +## 6. Correctness + +**The formalization is mathematically correct** for what it claims. Specific observations: + +- **Threshold value**: (1+ε)n log n is the correct order for the JKV08 result. ✅ +- **Vertex count**: 3n vertices for a perfect matching of n edges in a 3-uniform hypergraph. ✅ +- **Perfect matching definition**: n vertex-disjoint edges covering all 3n vertices. The `HasMatching H n` definition requires n pairwise disjoint edges, each of size 3 (since H is a subset of `threeEdges (3*n)`), which accounts for all 3n vertices. ✅ +- **Upper bound on m**: m ≤ C(3n, 3) ensures m is a valid number of edges. ✅ +- **Division by zero**: When `hypergraphsWithEdges` is empty, division returns 0. This cannot occur for valid m in [1, C(3n,3)] since C(C(3n,3), m) > 0. ✅ +- **`Real.log`**: Mathlib's `Real.log` is the natural logarithm, which matches the standard formulation. ✅ + +**One subtle issue:** The `HasMatching` definition does not explicitly enforce that edges in M are 3-element subsets. However, since M ⊆ H and H is drawn from `hypergraphsWithEdges (3*n) m`, all edges in H are elements of `threeEdges (3*n)`, so all edges have cardinality 3. This is correct but relies on the context of how `HasMatching` is used within `hypergraphMatchingFraction`, not on the definition itself. + +**Incompleteness (not incorrectness):** As noted in §3, the formalization only captures the sufficiency direction. This is a deliberate choice, not an error, but it means the theorem is weaker than the full result described in the docstring. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs improvement | `HasMatching` duplicated from 1020; `powersetCard` not used | +| Citations | ⚠️ Minor gap | Missing [Er81] reference | +| Variants | ⚠️ Partial | Only upper bound for r=3; no lower bound or general r | +| Readability | ✅ Good | Minor improvements possible with `powersetCard` | +| Formalizability | ✅ High | Standard probabilistic formalization, minimal ambiguity | +| Correctness | ✅ Correct | Mathematically sound for the claim made; incomplete vs. full result | diff --git a/ai-review/748.md b/ai-review/748.md new file mode 100644 index 0000000000..7580a58815 --- /dev/null +++ b/ai-review/748.md @@ -0,0 +1,112 @@ +# Review: Erdős Problem 748 + +## 1. Code Reuse + +The file defines its own `Erdos748.IsSumFree` for `Finset ℕ`: + +```lean +def IsSumFree (A : Finset ℕ) : Prop := + ∀ b ∈ A, ∀ c ∈ A, b + c ∉ A +``` + +An identical definition exists in `FormalConjectures/ErdosProblems/877.lean` (line 43) as `Erdos877.IsSumFree`, and a near-identical one in `FormalConjectures/ErdosProblems/792.lean` (line 45) as `Erdos792.IsSumFreeSet` (over `Finset ℤ`). + +There is also a generic definition in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 30): + +```lean +def IsSumFree (A : Set α) : Prop := Disjoint (A + A) A +``` + +This generic definition operates on `Set α` rather than `Finset ℕ`, and uses the pointwise sumset formulation. It is semantically equivalent (for subsets of ℕ), but bridging it to the `Finset` context would require coercion lemmas. The local definition is reasonable for a self-contained formalization, though a shared `Finset`-level definition used across problems 748, 877, and 792 would reduce duplication. + +**Verdict:** Mild duplication. A shared `IsSumFree` definition for `Finset ℕ` (or a bridge lemma to the generic `Set`-level one) could serve problems 748, 877, and 792 simultaneously. + +## 2. Citations + +The website [erdosproblems.com/748](https://www.erdosproblems.com/748) lists the following references: + +| Tag | Formalization | Website | +|------|---------------|---------| +| [CaEr90] | `Cameron, P.J. and Erdős, P.` (no title/journal) | Present | +| [Er94b] | `Erdős, P.` (no title/journal) | Present | +| [Er98] | `Erdős, P.` (no title/journal) | Present | +| [Gr04] | Full citation provided | Present | +| [Sa03] | Full citation provided | Present | + +The formalization includes full bibliographic details for [Gr04] and [Sa03] but only author names for [CaEr90], [Er94b], and [Er98]. This is consistent with the website, which also does not provide full details for these earlier references. No citations are missing. + +The website also mentions a connection to Problem #877 (maximal sum-free subsets) and OEIS sequence A007865. Neither is mentioned in the formalization's docstring — the Problem 877 connection could be a useful cross-reference. + +**Verdict:** Citations are complete and consistent with the website. Consider adding a cross-reference to Problem 877. + +## 3. Variants + +The formalization captures only the main asymptotic statement $f(n) = 2^{(1+o(1))n/2}$. + +The website and literature record a stronger result that could be formalized as a variant: + +- **Sharp asymptotic (Green [Gr04], Sapozhenko [Sa03]):** $f(n) \sim c_n \cdot 2^{n/2}$, where $c_n$ depends on the parity of $n$. This is mentioned in the module docstring but not formalized. A variant theorem could state: there exist constants $c_{\text{even}}, c_{\text{odd}} > 0$ such that $f(2m) / 2^m \to c_{\text{even}}$ and $f(2m+1) / 2^m \to c_{\text{odd}}$. + +- **Trivial lower bound:** The docstring mentions $f(n) \geq 2^{n/2}$ (by taking all subsets of $\{\lceil n/2 \rceil, \ldots, n\}$). This could be a standalone lemma, and would be provable (not `sorry`). + +**Verdict:** The main conjecture is captured. The stronger parity-dependent asymptotic and the trivial lower bound are natural variants that are not formalized. + +## 4. Readability + +The code is clean and well-structured: + +- The module docstring clearly explains the problem, its history, and resolution. +- The `IsSumFree` definition has a helpful docstring noting that $b, c$ need not be distinct. +- The `sumFreeSubsetCount` definition is clear. +- The theorem statement's docstring restates the result in both symbolic and epsilon-delta form. +- Namespacing under `Erdos748` avoids clashes with other problems' identically-named definitions. + +Minor observations: +- The `DecidablePred` instance is a nice touch for computability, though it's unused by the theorem. +- The `open Finset` is appropriately scoped. + +**Verdict:** Highly readable. No changes recommended. + +## 5. Formalizability + +The problem is unambiguous and fully formalizable: + +- "Sum-free subset" has a precise, standard mathematical definition (no element equals the sum of two elements from the set, where elements may repeat). The formalization correctly captures this. +- The asymptotic statement $f(n) = 2^{(1+o(1))n/2}$ is a standard asymptotic claim that translates cleanly to the epsilon-N₀ formulation used. +- The counting function over finite sets is well-defined and computable in principle. + +There is no ambiguity in the problem statement. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +**Definition of `IsSumFree`:** Correct. The condition `∀ b ∈ A, ∀ c ∈ A, b + c ∉ A` is the standard definition. Since the set is contained in $\{1, \ldots, n\} \subseteq \mathbb{N}$, there are no issues with $0$ (it's excluded from the range). Allowing $b = c$ is correct — sum-free sets forbid $2a \in A$ when $a \in A$. + +**Definition of `sumFreeSubsetCount`:** Correct. It counts `|{A ∈ 𝒫({1,...,n}) : IsSumFree(A)}|`, which is exactly $f(n)$. + +**Theorem statement:** The formalization states: + +$$\forall \varepsilon > 0,\; \exists N_0,\; \forall n \geq N_0: \quad 2^{(1-\varepsilon)n/2} \leq f(n) \leq 2^{(1+\varepsilon)n/2}$$ + +This is a correct unfolding of $f(n) = 2^{(1+o(1))n/2}$. Specifically: + +- The exponent `(1 - ε) * (n : ℝ) / 2` in Lean is parsed as `((1 - ε) * n) / 2` due to left-associativity, which equals $(1-\varepsilon) \cdot n/2$. Correct. +- The use of `(2 : ℝ) ^ (... : ℝ)` invokes `Real.rpow`, which is the correct operation for real-valued exponents. Correct. +- The cast `(sumFreeSubsetCount n : ℝ)` lifts the natural number count to ℝ for comparison. Correct. +- The `answer(True)` wrapper correctly indicates this is a proved result. + +**Potential subtlety:** When $\varepsilon \geq 1$, the exponent $(1 - \varepsilon) \cdot n / 2$ becomes non-positive, so $2^{(1-\varepsilon)n/2} \leq 1 \leq f(n)$ holds trivially (since the empty set is always sum-free). This is not a bug — the statement is vacuously easier for large $\varepsilon$, and the meaningful content is for small $\varepsilon > 0$. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Mild duplication with problems 877, 792; shared definition possible | +| Citations | Complete and consistent with website | +| Variants | Main conjecture captured; stronger parity-dependent asymptotic not formalized | +| Readability | Excellent | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/75.md b/ai-review/75.md new file mode 100644 index 0000000000..cfb69534b3 --- /dev/null +++ b/ai-review/75.md @@ -0,0 +1,100 @@ +# Review: Erdos Problem 75 + +## 1. Code Reuse + +Several existing definitions in the codebase could be reused or considered: + +- **`HasChromaticNumberAleph1`** (defined in `FormalConjectures/ErdosProblems/110.lean:45-47` and duplicated in `111.lean`): This definition captures "chromatic number exactly aleph_1" via two conditions: (1) no coloring by any countable type, and (2) existence of a coloring by a type of cardinality aleph_1. The current formalization instead uses `¬Nonempty (G.Coloring ℕ)`, which only asserts the graph is not countably colorable. While mathematically equivalent to chromatic number = aleph_1 *when combined with* `#V = aleph 1` (since any graph on aleph_1 vertices has chromatic number ≤ aleph_1), the intent would be clearer using `HasChromaticNumberAleph1` directly. However, `HasChromaticNumberAleph1` is defined locally in both 110.lean and 111.lean (not shared), so adopting it would require either importing one of those files or extracting it to a shared location. + +- **`chromaticCardinal`** (defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136-137`): An alternative would be to write `G.chromaticCardinal = ℵ_ 1`, as done in `ErdosProblems/1067.lean:59` and `1068.lean`. This is arguably the most canonical way to state "chromatic number aleph_1" in the codebase. + +- **`SimpleGraph.IndepSetIn`** (defined in `FormalConjectures/ErdosProblems/73.lean:35-37`): This captures "I is an independent set within S" as `I ⊆ S ∧ ∀ u ∈ I, ∀ v ∈ I, u ≠ v → ¬G.Adj u v`. The current formalization uses the equivalent but more verbose `(↑T : Set V).Pairwise (fun u v => ¬G.Adj u v)` inline. Using `IndepSetIn` would improve readability and consistency with Problem 73. + +**Recommendation**: Consider using `chromaticCardinal = ℵ_ 1` (most canonical) or `HasChromaticNumberAleph1` (most explicit), and `IndepSetIn` for the independent set condition. However, `IndepSetIn` is also defined locally in 73.lean rather than in a shared utility — both it and `HasChromaticNumberAleph1` would benefit from being extracted to shared definitions. + +## 2. Citations + +The formalization cites: +- `[EHS82]` Erdős, P., Hajnal, A., and Szemerédi, E., *On almost bipartite large chromatic graphs*, Annals of Discrete Mathematics 12 (1982), 117-123. +- `[Er95]` Erdős, P., *On some of my favourite theorems*, 1995. +- `[Er95d]` Erdős, P., *Problems and results in discrete mathematics*, Discrete Math., 1995. + +The website (erdosproblems.com/75) lists the same three references with the same page numbers ([EHS82] p. 120, [Er95] p. 11, [Er95d] p. 63). The citations match. + +**Note from the website**: The website mentions that Erdős's 1995 formulation omitted the requirement for aleph_1 vertices, calling it an oversight since EHS82 had already provided such a construction. The formalization correctly includes the aleph_1 vertex requirement in line with the original [EHS82] statement. It would be helpful to note this subtlety in the docstring. + +**Related problems**: The website lists Problems 74 and 750 as related. Problem 74 is already formalized in the codebase and deals with the same [EHS82] paper. A cross-reference in the docstring could be added. + +**Prize**: Erdős offered $1000 for complete solutions. This could be mentioned in the docstring. + +## 3. Variants + +The website describes two questions: +1. Does there exist such a graph where every n-vertex subset has an independent set of size > n^{1-ε} for all ε > 0 and large n? +2. A secondary question about independent sets "of size ≫ n." + +The formalization captures both: +- **Part 1** (`erdos_75`): The n^{1-ε} version — correctly formalized. +- **Part 2** (`erdos_75.variants.linear`): The linear version (∃ c > 0, independent set of size ≥ cn) — this is a natural interpretation of "≫ n" in the Erdős context, meaning "proportional to n". The linear variant is a strengthening of Part 1 (since cn > n^{1-ε} for large n). + +**Assessment**: Both variants from the website appear to be captured. The interpretation of "≫ n" as "linear in n" is reasonable given the paper title "On almost bipartite large chromatic graphs" — a graph where every n-vertex subgraph has a linear-sized independent set is "almost bipartite." + +## 4. Readability + +**Issues:** +- The inline independent set condition `(↑T : Set V).Pairwise (fun u v => ¬G.Adj u v)` is harder to parse at a glance than using a named definition like `IndepSetIn`. The cast `(↑T : Set V)` adds visual noise. +- The expression `(T.card : ℝ) > (n : ℝ) ^ ((1 : ℝ) - ε)` has many explicit type casts, which is unavoidable in Lean but makes the mathematical content harder to read. +- The chromatic number condition `¬Nonempty (G.Coloring ℕ)` requires the reader to reason that "not ℕ-colorable + aleph_1 vertices ⟹ chromatic number = aleph_1." Using `chromaticCardinal = ℵ_ 1` or `HasChromaticNumberAleph1` would make this explicit. +- The existential `∃ (V : Type) (_ : DecidableEq V) (G : SimpleGraph V)` is standard for this codebase. + +**Overall**: Readability is adequate but could be improved with named definitions. + +## 5. Formalizability + +The problem as stated on the website is precise and unambiguous for Part 1: the quantifiers ("for all ε > 0", "for sufficiently large n", "every set of n vertices", "independent set of size > n^{1-ε}") are all standard and have clear formal meanings. + +The only ambiguity is in Part 2 ("independent sets of size ≫ n"), where "≫" is informal notation. The linear interpretation (∃ c > 0 such that the independent set has size ≥ cn) is the standard reading in this combinatorial context. + +**Assessment**: High formalizability. The problem is a clear existence question with precise quantitative bounds. No significant ambiguity. + +## 6. Correctness + +### Part 1 (`erdos_75`) + +**Chromatic number encoding**: The formalization uses `#V = aleph 1 ∧ ¬Nonempty (G.Coloring ℕ)`. This is mathematically correct for encoding "chromatic number = aleph_1": +- `¬Nonempty (G.Coloring ℕ)` means no proper coloring exists with countably many colors, so chromatic number > ℵ₀. +- `#V = aleph 1` means at most ℵ₁ vertices, so the identity coloring (each vertex gets a distinct color) uses ℵ₁ colors, giving chromatic number ≤ ℵ₁. +- Together: chromatic number = ℵ₁. ✓ + +**Independent set condition**: `∃ T : Finset V, T ⊆ S ∧ (↑T : Set V).Pairwise (fun u v => ¬G.Adj u v) ∧ (T.card : ℝ) > (n : ℝ) ^ ((1 : ℝ) - ε)` correctly formalizes "S contains an independent set of size > n^{1-ε}". ✓ + +**Quantifier structure**: `∀ ε > 0, ∃ N, ∀ n ≥ N, ∀ S with |S| = n, ...` correctly captures "for all ε > 0, for sufficiently large n, every set of n vertices..." ✓ + +**`DecidableEq V` requirement**: Necessary for `Finset V` to function properly on an uncountable type. Correctly existentially quantified. ✓ + +**Potential concern**: The formalization quantifies over `Finset V` (finite subsets of V). Since V has cardinality ℵ₁, one might worry about whether all finite subsets are representable. However, `Finset V` with `DecidableEq V` correctly represents all finite subsets regardless of the cardinality of V, so this is fine. ✓ + +### Part 2 (`erdos_75.variants.linear`) + +**Structure**: Identical to Part 1 except the bound is `(T.card : ℝ) ≥ c * (n : ℝ)` with `∃ c > 0` and `∀ n ≥ 1`. ✓ + +**No threshold N**: Unlike Part 1, there is no "sufficiently large" threshold — the bound must hold for all n ≥ 1. This is correct for the linear variant: if every n-vertex subset contains an independent set of size cn, this should hold for all n (not just large n), since for small n it is a weaker condition. ✓ + +**Bound direction**: Uses `≥` instead of `>` (as in Part 1). This is a minor difference but mathematically insignificant — for the linear bound, `≥ cn` and `> cn` are essentially equivalent (one can adjust c slightly). ✓ + +### Overall Correctness Assessment + +The formalization is **mathematically correct**. The encoding of chromatic number = ℵ₁ via `#V = aleph 1 ∧ ¬Nonempty (G.Coloring ℕ)` is valid but indirect. No experienced mathematician would identify a flaw in the mathematical content. + +**Minor suggestion**: The `answer(sorry)` placeholder correctly indicates this is an open problem whose truth value is unknown. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `chromaticCardinal`, `HasChromaticNumberAleph1`, or `IndepSetIn` from elsewhere in the codebase; all are currently locally defined in other files | +| Citations | Match the website exactly; could add note about Erdős's 1995 omission and the $1000 prize | +| Variants | Both variants from the website are captured | +| Readability | Adequate; would benefit from named definitions for chromatic number and independent sets | +| Formalizability | High — problem is precise with standard quantifiers | +| Correctness | Correct and complete; no mathematical flaws | diff --git a/ai-review/750.md b/ai-review/750.md new file mode 100644 index 0000000000..ba57984ba0 --- /dev/null +++ b/ai-review/750.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 750 + +## 1. Code Reuse + +**Issue found.** The custom `IsIndepSet` definition (lines 44-47) duplicates functionality already available in Mathlib. + +- **Mathlib provides** `SimpleGraph.IsIndepSet : Set V → Prop` (defined via `Set.Pairwise`) in `Mathlib.Combinatorics.SimpleGraph.Clique`. +- **Problem 22** (`ErdosProblems/22.lean:60`) already correctly uses `G.IsIndepSet ↑s` with a `Finset` coerced to `Set`. +- The same custom definition is duplicated across problems 615, 151, and 804 with minor naming variations (`IsIndependentSet` vs `IsIndepSet`). +- **Wrapper utilities** exist in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` providing `α(G)` notation for `indepNum` and related lemmas. + +**Recommendation:** Replace the custom `Erdos750.IsIndepSet` with Mathlib's `SimpleGraph.IsIndepSet` by coercing the `Finset` to a `Set`, following the pattern used in Problem 22. + +## 2. Citations + +The formalization includes the following references: +- [Er69b], [ErHa67b], [EHS82], [Er94b], [Er95d] + +**These match the website** (erdosproblems.com/750, last edited 14 October 2025). The website lists the same five reference keys as original sources. The bibliographic details in the docstring (author names, titles, years) are consistent with the website's data. + +**Minor omission:** The website notes "See also [Problem #75](https://www.erdosproblems.com/75)." This cross-reference is not mentioned in the formalization's docstring. Problem 75 is closely related: it asks for a graph on ℵ₁ vertices with chromatic number ℵ₁ such that every set of n vertices contains an independent set of size > n^{1−ε}. Adding a cross-reference would aid navigation. + +## 3. Variants + +The docstring mentions two known partial results: +1. **f(m) = εm for fixed ε > 0** (conjectured in [Er69b], follows from [EHS82]). +2. **f(m) ≥ cm for c > 1/4** (proved in [ErHa67b]). + +**Neither of these is captured as a separate formal variant theorem.** Problem 75 formalizes a related but distinct question (on ℵ₁ vertices with subpolynomial independent sets). The known results mentioned in the docstring could be stated as: +- A theorem for the ε·m case (which is known to be true by [EHS82]). +- A theorem for the c·m case with c > 1/4 (proved by Erdős–Hajnal). + +These would be valuable additions since they are *settled* results, unlike the main open problem. + +## 4. Readability + +The formalization is generally readable. A few observations: + +- The `f(m) → ∞` condition is encoded as `∀ C : ℕ, ∃ M₀ : ℕ, ∀ m : ℕ, m ≥ M₀ → f m ≥ C`. This is a standard and correct encoding of "tends to infinity" for ℕ → ℕ functions, and is clear to a mathematician. +- Infinite chromatic number via `∀ k : ℕ, ¬G.Colorable k` is idiomatic and readable. +- The arithmetic bound `(S.card : ℝ) / 2 - (f S.card : ℝ) ≤ (I.card : ℝ)` is clear, though the coercions to ℝ add some noise. This is unavoidable for the division by 2. +- The custom `IsIndepSet` duplicates Mathlib, which could confuse readers expecting the standard definition. + +## 5. Formalizability + +**Assessment: Clearly formalizable with low ambiguity.** + +The problem statement is precise: +- "f(m) → ∞" is unambiguous. +- "graph with infinite chromatic number" is unambiguous. +- "every finite set of m vertices contains an independent set of size at least m/2 − f(m)" is unambiguous. +- The only mild ambiguity is "subgraph on m vertices" (website) vs "finite set of m vertices" (docstring). The intended meaning is the induced subgraph, and independence in the induced subgraph is equivalent to independence among those vertices in the original graph. The formalization correctly captures this. + +The problem is an existential question ("does there exist...") wrapped in a universal quantifier over f, which the `answer(sorry) ↔ ...` pattern handles appropriately since the yes/no answer is unknown. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **f : ℕ → ℕ** (rather than ℕ → ℝ): This is adequate. If the statement holds for all ℕ → ℕ functions tending to infinity, it holds for all ℝ-valued functions too (take ⌊f⌋, which also tends to infinity). Using ℕ avoids unnecessary coercion complexity. + +- **Infinite chromatic number:** `∀ k : ℕ, ¬G.Colorable k` correctly captures this. It also implicitly forces the vertex set V to be infinite (any finite graph on n vertices is n-colorable). + +- **Quantification over all finite subsets:** The formalization requires the independent set condition for *all* `S : Finset V`, not just for sufficiently large sets. This is correct because when `S.card` is small enough that `S.card / 2 - f(S.card) ≤ 0`, the condition is trivially satisfied by taking I = ∅. + +- **The bound `|S|/2 − f(|S|) ≤ |I|`:** This correctly formalizes "contains an independent set of size at least m/2 − f(m)" with the division done in ℝ. + +- **No completeness issues:** The main open question is fully captured. The formalization does not overconstrain or underconstrain the problem. + +**One subtle note:** The original problem uses "subgraph on m vertices" which typically means the induced subgraph on a set of m vertices. The formalization's approach — quantifying over finite subsets S and finding independent subsets I ⊆ S — is equivalent, since a set is independent in the induced subgraph on S iff it is independent in G and contained in S. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Custom `IsIndepSet` should use Mathlib's `SimpleGraph.IsIndepSet` | +| Citations | Complete and accurate; add cross-reference to Problem 75 | +| Variants | Known partial results (εm case, cm case) not formalized as separate theorems | +| Readability | Good; removing custom definition would improve it | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/751.md b/ai-review/751.md new file mode 100644 index 0000000000..5d56727473 --- /dev/null +++ b/ai-review/751.md @@ -0,0 +1,65 @@ +# Review: Erdős Problem 751 + +## 1. Code Reuse + +**Issue found.** The `cycleLengths` definition at line 40–41 is duplicated verbatim in `FormalConjectures/ErdosProblems/752.lean` (line 38–39). This should be factored out into a shared utility file (e.g., under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`) and imported by both 751 and 752. + +Additionally, the Bondy–Vince variant expresses the minimum degree condition as `∀ v : V, 3 ≤ G.degree v`, while Problem 64 uses the existing `G.minDegree ≥ 3` API. Using `G.minDegree` would be more idiomatic and consistent with other formalizations in the codebase. + +## 2. Citations + +The website (erdosproblems.com/751) lists the source as **[Er94b]**, which is not mentioned in the formalization's docstring. The docstring should include this original source reference. + +The Bondy–Vince citation `[BoVi98]` is present but incomplete. The full citation should include the volume number: + +> Bondy, J. A. and Vince, A., *Cycles in a graph whose lengths differ by one or two*. Journal of Graph Theory **27** (1998), 11–15. + +The website also credits Raphael Steiner for contributions, which may be worth noting. + +## 3. Variants + +**Missing variant.** The website states the problem has two parts: + +> "Let $G$ be a graph with chromatic number $\chi(G)=4$. If $m_1 i$) is $\geq (j-i) \cdot C \geq C$. So requiring all pairwise gaps $\geq C$ is equivalent to requiring all consecutive gaps $\geq C$. The `answer(False)` direction is correct. + +### Bondy–Vince variant (`erdos_751.variants.bondy_vince`) — Bug: empty graph + +**Issue.** The theorem is false as stated when `V` is the empty type. If $V = \emptyset$, the hypothesis `∀ v : V, 3 ≤ G.degree v` holds vacuously, but `cycleLengths G = ∅`, so the existential conclusion `∃ m₁ ∈ cycleLengths G, ...` is false. This makes the theorem provably false in Lean. + +**Fix:** Add a `[Nonempty V]` instance hypothesis, or add an explicit hypothesis like `(hcard : 4 ≤ Fintype.card V)` (a graph with minimum degree $\geq 3$ must have at least 4 vertices). The simplest fix is `[Nonempty V]`. + +### Other observations + +- The implication from Bondy–Vince to the main result relies on the fact that $\chi(G) = 4$ implies $G$ has a subgraph with minimum degree $\geq 3$ (by the degeneracy/coloring bound). This connection is mentioned in the docstring but not formalized as a separate lemma. It could be useful to add as an explicit lemma for proving `erdos_751` from `bondy_vince`. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `cycleLengths` duplicated with Problem 752; should use `G.minDegree` | +| Citations | Missing [Er94b] source; [BoVi98] citation missing volume number | +| Variants | Missing girth variant from the original problem | +| Readability | Good overall; minor consistency improvements possible | +| Formalizability | High — low ambiguity | +| Correctness | Main theorem correct; Bondy–Vince variant **has a bug** (false for empty V) | diff --git a/ai-review/752.md b/ai-review/752.md new file mode 100644 index 0000000000..d7dc259886 --- /dev/null +++ b/ai-review/752.md @@ -0,0 +1,99 @@ +# Review: Erdős Problem 752 + +## 1. Code Reuse + +The `cycleLengths` definition at line 38–39 is duplicated verbatim in **Erdős Problem 751** (`751.lean:40–41`) and nearly identically in **Erdős Problem 84** (`84.lean:50–51`, named `cycleSpectrum`). All three could share a single canonical definition, ideally placed in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean`. + +Additionally, the formalization re-derives two concepts that already exist in Mathlib: + +- **Girth.** The inline condition `∀ (v : V) (p : G.Walk v v), p.IsCycle → 2 * s < p.length` is equivalent to `2 * s < G.girth` (or `(2 * s : ℕ∞) < G.egirth`). Mathlib provides `SimpleGraph.girth` and `SimpleGraph.egirth` in `Mathlib.Combinatorics.SimpleGraph.Girth`. Other Erdős problems in this codebase (108, 705, 923) already use the Mathlib girth definitions. + +- **Minimum degree.** The inline condition `∀ v : V, k ≤ G.degree v` is equivalent to `k ≤ G.minDegree`. Mathlib provides `SimpleGraph.minDegree` in `Mathlib.Combinatorics.SimpleGraph.Finite` with lemma `minDegree_le_degree`. + +Using these Mathlib definitions would improve consistency with the rest of the codebase and reduce redundancy. + +## 2. Citations + +The docstring currently cites: +- `[SuVe08]` Sudakov, B. and Verstraëte, J. — ✅ Correct and complete. + +**Missing from the docstring** (present on [erdosproblems.com/752](https://www.erdosproblems.com/752)): +- `[Er92b]` — Erdős's original source for the problem. +- `[Er93, p.346]` — Another Erdős reference. +- `[Er94b]` — Another Erdős reference. +- The website also credits **Raphael Steiner** in the acknowledgments. + +These original Erdős references should be added to the docstring to match the website. + +## 3. Variants + +The formalization captures only the basic conjecture ("at least ≫ k^s distinct cycle lengths"). The website describes a **stronger result** actually proved by Sudakov and Verstraëte: + +> "Under the assumption of **average degree** k and girth > 2s, there are at least ≫ k^s many **consecutive even integers** which are cycle lengths in G." + +This is stronger in two ways: +1. **Average degree** (weaker hypothesis) rather than minimum degree. +2. **Consecutive even integers** as cycle lengths (stronger conclusion), not merely distinct cycle lengths. + +A variant capturing the full Sudakov–Verstraëte theorem would be valuable. Something like: + +```lean +theorem erdos_752.variants.sudakov_verstrate : + ∃ c : ℝ, c > 0 ∧ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (k s : ℕ), + k * Fintype.card V ≤ 2 * G.edgeFinset.card → -- average degree ≥ k + (∀ (v : V) (p : G.Walk v v), p.IsCycle → 2 * s < p.length) → + ∃ a : ℕ, ∀ i : ℕ, i < ⌊c * (k : ℝ) ^ s⌋₊ → + (a + 2 * i) ∈ cycleLengths G +``` + +The formalization also does not mention the known case s = 2 (proved by Erdős, Faudree, and Schelp), which the docstring references textually but does not formalize as a separate theorem. + +## 4. Readability + +The code is reasonably readable. Suggested improvements: + +- **Use Mathlib's `girth`**: Replace the inline walk condition with `2 * s < G.girth` (or the `egirth` variant). This is more idiomatic and immediately recognizable to mathematicians familiar with Mathlib. +- **Use Mathlib's `minDegree`**: Replace `∀ v : V, k ≤ G.degree v` with `k ≤ G.minDegree`. +- **Docstring label**: The docstring calls this the "Sudakov–Verstraëte Theorem" but the original conjecture is by Erdős–Faudree–Schelp. Consider labeling it "Erdős–Faudree–Schelp Conjecture (proved by Sudakov–Verstraëte)" for clarity. + +With Mathlib definitions the theorem would read: + +```lean +theorem erdos_752 : answer(True) ↔ + ∃ c : ℝ, c > 0 ∧ + ∀ (V : Type*) [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] + (k s : ℕ), + k ≤ G.minDegree → + 2 * s < G.girth → + c * (k : ℝ) ^ s ≤ ((cycleLengths G).ncard : ℝ) +``` + +This is shorter and more immediately comprehensible. + +## 5. Formalizability + +**Assessment: High — the problem is clearly formalizable with low ambiguity.** + +The original conjecture is stated precisely: given quantitative hypotheses (minimum degree ≥ k, girth > 2s), conclude a quantitative lower bound on the number of distinct cycle lengths. The only notation requiring interpretation is "≫" (Vinogradov notation), which is standardly formalized as "≥ c · f(k,s) for some absolute constant c > 0." The formalization correctly adopts this interpretation. + +Minor ambiguity: the problem doesn't specify whether the graph must be finite, but the formalization reasonably restricts to `Fintype V`. For infinite graphs the statement would be trivially true (infinite graphs with minimum degree k contain infinitely many cycle lengths under mild conditions), so the finite restriction is appropriate. + +## 6. Correctness + +**The formalization is mathematically correct for the original conjecture as stated.** An experienced mathematician would not find flaws in the logical structure. Specific checks: + +- ✅ The girth condition `p.IsCycle → 2 * s < p.length` correctly encodes "girth > 2s" (no cycle of length ≤ 2s). +- ✅ The minimum degree condition `∀ v : V, k ≤ G.degree v` correctly encodes "minimum degree ≥ k". +- ✅ The conclusion `c * k^s ≤ ncard(cycleLengths G)` correctly encodes "≫ k^s distinct cycle lengths." +- ✅ The existential quantifier over `c > 0` correctly captures the asymptotic constant. +- ✅ Using `Set.ncard` is appropriate: for a finite graph, the set of cycle lengths is finite (bounded by |V|), so `ncard` agrees with cardinality. Even if Lean cannot automatically prove finiteness, `ncard` returns 0 for infinite sets, and the bound `c * k^s ≤ 0` would be false for positive c and k, so the statement remains consistent. +- ✅ The `answer(True)` tag correctly reflects that the problem is solved in the affirmative. +- ✅ The universal quantification over all `V`, `G`, `k`, `s` is correct — the constant `c` is absolute (independent of all parameters). + +**One subtlety worth noting:** the quantification over `k` and `s` as `ℕ` means the statement includes the degenerate cases k = 0 and s = 0. When k = 0, the bound becomes `c * 0 ≤ ncard(...)`, which is trivially true. When s = 0, the girth condition becomes "girth > 0," which is always true (cycles have length ≥ 3), making the bound `c * 1 ≤ ncard(...)`. This is fine since any graph with minimum degree ≥ k ≥ 1 contains at least one cycle. These edge cases do not create mathematical issues. + +**Incompleteness:** As noted in §3, the formalization does not capture the full strength of Sudakov–Verstraëte (average degree + consecutive even cycle lengths). This is not a flaw per se — the original Erdős–Faudree–Schelp conjecture is correctly stated — but a variant for the stronger result would be a valuable addition. diff --git a/ai-review/753.md b/ai-review/753.md new file mode 100644 index 0000000000..d4a9d60383 --- /dev/null +++ b/ai-review/753.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 753 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsChoosable` and `listChromaticNumber` are independently defined in at least five files: + +- `ErdosProblems/629.lean` (with a separate `IsProperListColoring` helper) +- `ErdosProblems/630.lean` (same structure as 629) +- `ErdosProblems/631.lean` (same structure as 629) +- `ErdosProblems/753.lean` (inlines the proper-coloring conditions directly) +- `ErdosProblems/799.lean` + +All definitions are semantically equivalent. Problem 753's version differs slightly by inlining the coloring conditions rather than introducing a separate `IsProperListColoring` predicate. These could be centralized into a shared module (e.g., under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`), which already contains utilities for the ordinary chromatic number in `Coloring.lean`. Mathlib does not currently provide list chromatic number or choosability. + +## 2. Citations + +The citations are accurate and well-formatted: + +- **[ERT80]** — Erdős, Rubin, and Taylor, *Choosability in graphs*, 1980. The formalization includes full page numbers (125–157) and the conference proceedings name. This matches the website. +- **[Al92]** — Alon, *Choice numbers of graphs: a probabilistic approach*, 1992. Matches the website. + +The website attributes the problem to Erdős, Rubin, and Taylor [ERT80] and the disproof to Alon [Al92]. Both are correctly cited in the Lean file. + +## 3. Variants + +The website describes one key result beyond the original conjecture: Alon's upper bound showing that for every $n$, there exists a graph $G$ on $n$ vertices with $\chi_L(G) + \chi_L(\bar{G}) \ll \sqrt{n \log n}$. This is captured by `erdos_753.variants.alon_upper_bound`. No other variants are mentioned on the website, so coverage is complete. + +## 4. Readability + +The code is generally readable. Minor observations: + +- Unlike problems 629/630/631, problem 753 does not define a separate `IsProperListColoring` predicate, instead inlining both conditions. This is slightly less modular but perfectly readable for a self-contained file. +- The docstrings are clear and the LaTeX in module documentation is well-formatted. +- The theorem names follow the project conventions (`erdos_753`, `erdos_753.variants.alon_upper_bound`). + +## 5. Formalizability + +**The problem is clearly formalizable.** All concepts involved — list chromatic number, graph complement, the quantifier structure — are standard and unambiguous. The definition of $k$-choosability (for every list assignment of size $\geq k$, a proper list coloring exists) is the universally accepted one. There is no ambiguity in the problem statement. + +The one subtlety is in the use of $\mathbb{N}$ as the color space. This is adequate: for finite graphs with finite lists, any finite color set can be embedded in $\mathbb{N}$, so restricting to natural number colors loses no generality. + +## 6. Correctness + +**The formalization is mathematically correct.** + +### Main theorem (`erdos_753`) + +The statement encodes: $\lnot \exists\, c > 0,\; \forall\, n \geq 2,\; \forall\, G \text{ on } n \text{ vertices},\; \chi_L(G) + \chi_L(\bar{G}) > n^{1/2+c}$. + +This correctly captures the disproved conjecture via the `answer(False) ↔ P` pattern, since `False ↔ P` is equivalent to `¬P`. + +**Quantifier structure:** Correct. The original conjecture asks whether a *single* constant $c > 0$ witnesses a lower bound for *all* graphs on *all* sufficiently large $n$. The formalization uses $n \geq 2$, which is a sound choice: for $n = 0$, the only graph on `Fin 0` has `listChromaticNumber = 0` (vacuously 0-choosable), giving sum 0, which fails $0 > 0^{1/2+c} = 0$; this would trivially kill the universal quantifier for uninteresting reasons. The restriction $n \geq 2$ avoids this degeneracy. + +**Exponent:** The expression `(n : ℝ) ^ (1 / 2 + c)` is correct. Since `c : ℝ`, the subexpression `1 / 2` is real division yielding $0.5$, so the exponent is $1/2 + c$ as intended. + +### Alon upper bound variant + +The statement encodes: $\exists\, C > 0,\; \forall\, n \geq 2,\; \exists\, G \text{ on } n \text{ vertices},\; \chi_L(G) + \chi_L(\bar{G}) \leq C\sqrt{n \log n}$. + +This is existential over $G$, matching the website's description ("for every $n$, there exists a graph $G$ on $n$ vertices where..."). This is sufficient to disprove the conjecture: for any hypothetical $c > 0$, Alon's graph would give $n^{1/2+c} < C\sqrt{n \log n}$, i.e., $n^c < C\sqrt{\log n}$, which is impossible for large $n$. + +**Use of `Real.log`:** Mathlib's `Real.log` is the natural logarithm. Since the result is asymptotic and logarithms of different bases differ by a constant factor absorbed into $C$, this is correct. + +**Use of `Real.sqrt`:** For $n \geq 2$, $n \cdot \log n > 0$, so $\sqrt{n \log n}$ is well-defined and positive. Correct. + +### Minor docstring inconsistency + +The module-level docstring (line 27) says "the sum can be bounded above by $C\sqrt{n \cdot \log n}$," which could be misread as a *universal* bound (for all $G$). A universal bound is impossible — e.g., $K_n$ has $\chi_L(K_n) = n$ and $\chi_L(\bar{K_n}) = 1$, giving sum $n + 1 \gg \sqrt{n \log n}$. The variant theorem's own docstring (line 74) correctly states the existential form ("there exists a graph $G$"). The module-level docstring could be clarified to match, e.g., "there exists a graph on $n$ vertices with $\chi_L(G) + \chi_L(\bar{G}) \leq C\sqrt{n \log n}$." + +### `listChromaticNumber` well-definedness + +The definition uses `sInf` on $\mathbb{N}$, where `sInf ∅ = 0`. For any graph on `Fin n` with $n \geq 1$, the set $\{k \mid \text{IsChoosable}\; G\; k\}$ is nonempty (any $k \geq n$ works by a greedy argument), so `sInf` returns a meaningful value. For the empty graph on `Fin 0`, the set contains 0 (vacuously), so `sInf = 0`. No issues here given the $n \geq 2$ guard. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Definitions duplicated across 5 files; should be centralized | +| Citations | Correct and complete | +| Variants | All website variants captured | +| Readability | Good | +| Formalizability | Unambiguous; clearly formalizable | +| Correctness | Mathematically correct; minor docstring ambiguity in module header | diff --git a/ai-review/754.md b/ai-review/754.md new file mode 100644 index 0000000000..78b9d68396 --- /dev/null +++ b/ai-review/754.md @@ -0,0 +1,73 @@ +# Review: Erdos Problem 754 + +## 1. Code Reuse + +**Problem 92** (`ErdosProblems/92.lean`) defines nearly identical abstractions for the same problem structure in ℝ²: +- `maxEquidistantPointsAt(x, points)` — maximum equidistant points at a given center +- `hasMinEquidistantProperty(k, A)` — every point has ≥ k equidistant points +- `possible_f_values(n)` and `f(n)` — the supremal function + +Problem 754 is the ℝ⁴ analogue of Problem 92's setup. These definitions are currently hardcoded to `ℝ²` but could be generalized to `EuclideanSpace ℝ (Fin d)` and shared. + +**Problem 97** (`ErdosProblems/97.lean`) defines `HasNEquidistantPointsAt`, `HasNEquidistantPointsOn`, and `HasNEquidistantProperty` — again for ℝ². These are directly applicable abstractions. + +Problem 754 inlines the equidistant-point logic rather than reusing these definitions. If the Problem 92/97 definitions were generalized to arbitrary dimension (or placed in a shared utility), Problem 754 could be stated more concisely using `hasMinEquidistantProperty` or `HasNEquidistantProperty`. + +**Minor:** `FormalConjecturesForMathlib/Geometry/Euclidean.lean` provides the notation `ℝ^n` for `EuclideanSpace ℝ (Fin n)`, but Problem 754 does not use it (nor is it necessary). + +## 2. Citations + +The website (erdosproblems.com/754) lists: +- **[Er94b]** Erdős, P., *Some old and new problems on combinatorial geometry*. +- **[AEP88]** Avis, D., Erdős, P., and Pach, J. (no title given on website) +- **[Sw13]** Swanepoel, K.J. (no title given on website) + +The formalization's docstring includes all three references with matching shorthands. The titles/descriptions are abbreviated but consistent with how they appear on the website. No citations are missing or misattributed. The additional thanks to "Liu Dingyuan" on the website is metadata, not a citation. + +## 3. Variants + +The website describes two results not captured in the formalization: + +1. **Lower bound:** Avis, Erdős, and Pach proved n/2 + 2 ≤ f(n). This lower bound is not formalized. +2. **Swanepoel's stronger sum result:** Swanepoel proved that for any finite A ⊂ ℝ⁴ of size n and any choice of distance d(x) for each x ∈ A, the sum Σ_{x,y ∈ A} 1_{|x−y|=d(x)} ≤ n²/2 + O(n), with similar results for higher dimensions. This quantitative strengthening and the higher-dimensional generalization are not formalized. + +These are meaningful omissions — the lower bound in particular is a natural companion statement. + +## 4. Readability + +The formalization is reasonably readable. A few observations: + +- The inline filter expression `A.filter (fun y => x ≠ y ∧ dist x y = d)` is clear but could benefit from being extracted into a named definition (as Problems 92 and 97 do), improving both readability and reusability. +- The docstring clearly explains the reformulation from "f(n) ≤ n/2 + O(1)" to the ∃C universal bound, which is helpful. +- The quantifier structure `∀ n, ∀ A, A.card = n → ∀ k, ... → k ≤ n/2 + C` is slightly verbose — the `n` quantifier is redundant since `A.card` already determines it. One could simplify to `∀ A, ∀ k, ... → (k : ℝ) ≤ A.card / 2 + C`. However, keeping `n` explicit matches the problem's natural language phrasing, which is a reasonable stylistic choice. + +## 5. Formalizability + +The problem is precisely stated and straightforwardly formalizable. The definition of f(n) involves: +- A finite point set in ℝ⁴ (clear) +- Equidistance (well-defined via `dist`) +- The asymptotic bound "O(1)" meaning a universal constant (clearly captured by ∃C) + +There is essentially no ambiguity. The only interpretive choice is whether "equidistant from x" means at the same distance from x (yes, captured correctly) and whether the distance can vary per point x (yes, the existential ∃d is inside ∀x∈A). Both choices are standard and correct. + +**Assessment: Unambiguous.** The problem translates directly to formal mathematics. + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Detailed verification:** + +- **Unrolling f(n):** The statement "f(n) ≤ n/2 + O(1)" is equivalent to "∃C, ∀n, ∀A with |A|=n, if every x ∈ A has ≥ k equidistant neighbors, then k ≤ n/2 + C." This is exactly what the formalization states. The equivalence holds because f(n) is the supremum over all such witnessed k values. + +- **Point exclusion:** The filter `x ≠ y ∧ dist x y = d` correctly excludes x itself from the count, so we count *other* points equidistant from x. + +- **Distance d unconstrained:** Unlike Problem 97's `HasNEquidistantPointsAt` which requires `r > 0`, Problem 754 places no positivity constraint on d. This is harmless: if d < 0, then `dist x y = d` is vacuously false (distances are non-negative); if d = 0, then `x ≠ y ∧ dist x y = 0` is false in a metric space. So the unconstrained d is mathematically equivalent to requiring d > 0. + +- **answer(True):** The problem is marked as solved in the affirmative, matching the website's "PROVED" status and Swanepoel's result. + +- **Dimension:** `EuclideanSpace ℝ (Fin 4)` correctly represents ℝ⁴. + +- **Type casting:** `(k : ℝ) ≤ n / 2 + C` correctly handles the division (n/2 in ℝ, not integer division) and the comparison between the natural number k and the real bound. + +**No flaws identified.** The formalization is a faithful and complete encoding of the main conjecture as stated on the website. diff --git a/ai-review/755.md b/ai-review/755.md new file mode 100644 index 0000000000..c6e7f22ced --- /dev/null +++ b/ai-review/755.md @@ -0,0 +1,92 @@ +# Review: Erdős Problem 755 + +## 1. Code Reuse + +**Potential reuse opportunities identified:** + +- **`Triplewise` (`FormalConjecturesForMathlib/Data/Set/Triplewise.lean`):** The `triplewise_set_pred_iff` theorem (line 119) establishes an equivalence between `S.Triplewise (P {·, ·, ·})` and `∀ T ⊆ S, T.ncard = 3 → P T`. This is closely related to the structure of `unitEquilateralTriangleCount`, which counts 3-element subsets satisfying a pairwise distance predicate. The `Triplewise` machinery could serve as the foundation for a proof that operates on the counting definition. However, `Triplewise` operates on `Set` rather than `Finset`, so bridging the two would add complexity. The current standalone definition is reasonable. + +- **`unitDistNum` (`FormalConjecturesForMathlib/Geometry/Metric.lean`, line 25):** Counts unit distance *pairs* using `Finset.sym2`. This is conceptually related (unit distances) but counts pairs rather than triangles, so it cannot directly replace `unitEquilateralTriangleCount`. It could be useful in a proof relating pair counts to triangle counts. + +- **Erdős 1086 (`FormalConjectures/ErdosProblems/1086.lean`):** Uses a different counting approach — ordered triples via Cartesian products with `.filter` — for counting triangles with a given area. The two problems are thematically related (counting geometric configurations) but use incompatible counting strategies (unordered subsets via `Set.ncard` vs. ordered tuples via `Finset.card` on a filtered product). Neither approach is clearly superior; the choice in 755 (unordered subsets) is arguably more natural for this problem. + +- **Style note:** The definition uses `Set.ncard` on a set comprehension over `Finset`s, which is somewhat unusual in this codebase. Most other Erdős problems that count configurations use `Finset` operations directly (e.g., filtering `offDiag`, `sym2`, or Cartesian products). An alternative formulation using `(A.powerset.filter (fun T => T.card = 3 ∧ ...)).card` would be more idiomatic and avoid the `noncomputable` overhead of `Set.ncard`, though `noncomputable` is already needed due to `EuclideanSpace`. + +## 2. Citations + +The formalization cites three references. Comparing with the website: + +| Citation | Formalization | Website | Status | +|----------|--------------|---------|--------| +| [ErPu75] | Erdős, P. and Purdy, G., *Some extremal problems in geometry*. Journal of Combinatorial Theory, Series A 10 (1975), 246-252. | ✓ Listed | **Incorrect journal volume.** The JCT-A paper is from 1971 (volume 10). The 1975 paper by Erdős and Purdy is in a different venue. The year and volume may be conflated. Needs verification against the actual publication record. | +| [Er94b] | Erdős, P., *Some old and new problems in various branches of combinatorics*. Discrete Mathematics 165/166 (1997), 227-231. | ✓ Listed | **Year mismatch in citation key.** The key says `Er94b` (suggesting 1994) but the bibliographic entry says 1997. The Discrete Mathematics paper is indeed from 1997 (proceedings of a 1994 conference). The key likely reflects the conference year; the publication year 1997 in the entry is correct. | +| [CDL25b] | Clemen, F., Dumitrescu, A., and Liu, Y., *On the number of equilateral triangles determined by point sets in Euclidean space*. | ✓ Listed | **OK.** No publication venue listed, consistent with a preprint. | + +**Recommendation:** Verify the [ErPu75] citation details. JCT-A volume 10 is from 1971, not 1975. If the intended reference is the 1975 paper, the venue may be different (possibly *Journal of Combinatorial Theory, Series A*, volume 18, 1975). + +## 3. Variants + +The website states two versions of the problem: + +1. **Unit equilateral triangles in ℝ⁶:** The number is at most (1/27 + o(1))n³. ✅ **Captured** by `erdos_755`. + +2. **Equilateral triangles of any size in ℝ⁶:** Erdős believed the same bound should hold even for equilateral triangles of *any* size. ❌ **Not captured.** The docstring mentions this extension ("Erdős believed the bound should hold even for equilateral triangles of any size") but no formal statement is provided. + +The stronger result was proved by Clemen, Dumitrescu, and Liu [CDL25b], who showed T_d(n) = (1/27 + o(1))n³ for all even d ≥ 6 (any-size equilateral triangles, not just unit). This is a strictly stronger theorem that subsumes the unit case. + +**Recommendation:** Add a second theorem capturing the any-size variant. This would require a generalized counting function (replacing `dist x y = 1` with `∃ r > 0, ∀ x ∈ T, ∀ y ∈ T, x ≠ y → dist x y = r`). The website also mentions a connection to Problem #1086; a cross-reference in the docstring would be helpful. + +Additionally, the CDL25b result holds for all even d ≥ 6, not just d = 6. A fully general version parameterized by even dimension could be considered. + +## 4. Readability + +**Strengths:** +- The docstring clearly explains the ε-N₀ formulation and its relationship to the o(1) notation. +- The definition name `unitEquilateralTriangleCount` is descriptive. +- The theorem statement is clean and follows a standard asymptotic pattern. + +**Suggestions:** +- The definition's inner predicate `∀ x ∈ T, ∀ y ∈ T, x ≠ y → dist x y = 1` is clear but somewhat verbose. A helper predicate like `IsUnitEquilateral (T : Finset X) : Prop := T.card = 3 ∧ ∀ x ∈ T, ∀ y ∈ T, x ≠ y → dist x y = 1` could improve readability, though this is minor. +- The dimension `d` is a universe-polymorphic parameter in the definition but is fixed to `6` in the theorem. This is good design — the definition is reusable across dimensions. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The statement "the number of unit equilateral triangles is at most (1/27 + o(1))n³" is precise and unambiguous once the following choices are made: +- "Unit equilateral triangle" = three points with all pairwise distances exactly 1. +- "o(1)" is formalized as the standard ε-N₀ definition. +- Counting is over unordered triples (3-element subsets). + +All three choices are natural and standard. The formalization handles them correctly. The only potential subtlety is whether "equilateral triangle of size 1" means side length 1 (as formalized) or some other notion of "size" (e.g., circumradius), but side length is the universally standard interpretation and matches the Erdős–Purdy papers. + +**Ambiguity level: Very low.** The mathematical statement is precise enough to admit essentially one formalization. + +## 6. Correctness + +**Assessment: Mathematically correct, with one caveat about scope.** + +**Definition correctness:** +- `unitEquilateralTriangleCount` correctly counts 3-element subsets of `A` where all pairwise distances are 1. In ℝ⁶ (or any dimension ≥ 2), three points with all pairwise distances equal to 1 form an equilateral triangle. ✅ +- The `Set.ncard` usage is well-founded: the set of 3-element subsets of a finite set is finite, so `Set.ncard` returns the correct cardinality. ✅ + +**Theorem correctness:** +- The ε-N₀ formulation correctly captures the asymptotic bound `≤ (1/27 + o(1))n³`. Specifically, saying "for all ε > 0, there exists N₀ such that for all n ≥ N₀, count ≤ (1/27 + ε) · n³" is exactly the statement that `count/n³ ≤ 1/27 + o(1)`. ✅ +- The bound is an upper bound (≤), which is correct — the conjecture asserts the count is *at most* this quantity. ✅ +- The problem is marked `category research solved`, consistent with the CDL25b proof. ✅ + +**Caveat:** +- The formalization captures only the *unit* equilateral triangle version, while the solved result (CDL25b) proves the stronger *any-size* version. The formalization is correct for what it states, but it does not capture the full strength of either the conjecture or the solution. This is not an error in correctness but an incompleteness in coverage (see §3 Variants). + +**No mathematical flaws identified.** The formalization is sound. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor | `Triplewise` could be leveraged; `Set.ncard` approach is less idiomatic than `Finset` operations | +| Citations | Needs attention | [ErPu75] year/volume may be incorrect; [Er94b] key vs. year mismatch | +| Variants | Incomplete | Any-size equilateral triangle variant not formalized despite being mentioned and proved | +| Readability | Good | Clear docstring and theorem statement | +| Formalizability | Excellent | Unambiguous mathematical statement | +| Correctness | Correct | Mathematically sound; incomplete in scope | diff --git a/ai-review/756.md b/ai-review/756.md new file mode 100644 index 0000000000..d96cf360c6 --- /dev/null +++ b/ai-review/756.md @@ -0,0 +1,71 @@ +# Review: Erdős Problem 756 + +## 1. Code Reuse + +**Duplicated `pairCount` definition.** The `Erdos756.pairCount` function (line 45) is character-for-character identical to `Erdos132.pairCount` (132.lean, line 61) and essentially identical to `Erdos95.distMultiplicity` (95.lean, line 45), differing only in name and the use of `×ˢ` vs `.product` (which are notational synonyms). A shared definition should be factored into `FormalConjecturesForMathlib/Geometry/2d.lean` or a dedicated distance-utilities file and imported by problems 95, 132, and 756. + +Problem 957 uses `distFrequency` (unordered pair count = ordered count / 2), which is a derived concept and would also benefit from a shared `pairCount`. + +No existing shared utility in `FormalConjecturesForMathlib` captures this pattern. The closest is `unitDistNum` in `Geometry/Metric.lean`, which counts unit-distance pairs via `sym2` (unordered), but it is specialized to unit distances. + +## 2. Citations + +The docstring references: +- **[ErPa90]** — matches the website citation: Erdős, P. and Pach, J., *Variations on the theme of repeated distances*, Combinatorica (1990). **OK.** +- **[Er97b]** — Erdős, P., *Some of my favourite problems which recently have been solved*, Proceedings of the International Conference on Discrete Mathematics (ICDM) (1997). This reference does not appear on the erdosproblems.com/756 page. It may be a valid secondary source but is **not documented on the website**. Consider verifying or removing. +- **[Bh24]** — Bhowmick, A., *On a problem of Erdős and Pach on distances* (2024). This is the solving paper and is consistent with the website. **OK.** + +**Missing from the formalization:** The website also credits **Clemen, Dumitrescu, and Liu (2025)** for a stronger result on square grids showing $n^{c/\log\log n}$ distances with multiplicity $n^{1+c/\log\log n}$. This is a significant follow-up result not mentioned in the docstring. + +## 3. Variants + +The website describes a **stronger variant** originally posed by Erdős and Pach: whether *all* distances except the largest must occur with multiplicity $> n$. Hopf and Pannowitz (1934) proved the largest distance occurs at most $n$ times, so it is automatically a "limited-occurrence" distance. The question of whether *all other* distances have multiplicity $> n$ is a stronger claim than the formalized statement (which only asks for $\gg n$ many such distances). + +This stronger variant is **not captured** by the current formalization. It could be added as `erdos_756.variants.all_except_largest`. + +The relationship to Problem 132 (limited-occurrence distances) is noted via "See also" but the duality is worth highlighting: Problem 756 asks for many *high*-multiplicity distances while Problem 132 asks about *low*-multiplicity distances. Both originate from Erdős–Pach [ErPa90]. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The `highMultiplicityDistances` definition uses `Set ℝ` (an unrestricted set) and the theorem uses `Set.ncard` to measure its size. This is fine since the set is always finite for a finite point set, but it might be slightly cleaner to make it a `Finset` via `Finset.image` + filter on the finite set of realized distances. However, the current approach is arguably simpler and avoids carrying decidability hypotheses. +- The docstring on `highMultiplicityDistances` says "multiplicity greater than $|A|$" which matches the formal definition (`A.card < pairCount A d`, i.e., strictly greater). **Consistent.** +- The theorem docstring says "more than $n$ times (as ordered pairs)" — this is correct and the parenthetical clarification about ordered pairs is helpful since it differs from the unordered convention sometimes used elsewhere. + +## 5. Formalizability + +**Assessment: Low ambiguity — clearly formalizable.** + +The original problem asks "Can there be $\gg n$ many distinct distances each of which occurs for more than $n$ many pairs from $A$?" The phrase "$\gg n$" is standard asymptotic notation meaning "at least $cn$ for some constant $c > 0$." The formalization captures this correctly as $\exists c > 0, \exists N_0, \forall n \geq N_0, \exists A \ldots$ with $c \cdot n \leq$ the count of high-multiplicity distances. + +The one subtlety is the meaning of "pairs": ordered vs unordered. The formalization uses **ordered** pairs (via `pairCount`), which means a distance occurring for "$> n$ pairs" in the ordered sense means $> n/2$ unordered pairs. This is a factor-of-2 difference. Since Bhowmick's result gives $\lfloor n/4 \rfloor$ distances each occurring at least $n + 1$ times (as **unordered** pairs, i.e., $\geq 2(n+1)$ ordered pairs), the formalization is provable under either convention. The choice of ordered pairs is consistent with Problem 132's usage. **No mathematical issue**, but the convention should be documented (and it is, in the docstrings). + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Structure:** $\exists c > 0, \exists N_0, \forall n \geq N_0, \exists A$ with $|A| = n$ and $|\{d : \text{pairCount}(A, d) > n\}| \geq cn$. This correctly formalizes "for sufficiently large $n$, there exists an $n$-point set with $\Omega(n)$ distances of multiplicity $> n$." +- **Answer tag:** `answer(True)` — correct, since the problem has been solved in the affirmative by Bhowmick (2024). +- **Category tag:** `category research solved` — correct. +- **AMS classification:** `AMS 5 52` (Combinatorial geometry) — appropriate. +- **`pairCount` definition:** Correctly counts ordered pairs $(x, y) \in A \times A$ with $x \neq y$ and $\text{dist}(x, y) = d$. +- **`highMultiplicityDistances` definition:** Correctly identifies $\{d : |A| < \text{pairCount}(A, d)\}$, i.e., distances with strictly more than $|A|$ ordered pair occurrences. +- **Quantifier order:** The existential for $c$ and $N_0$ are outermost, then universal for $n$, then existential for $A$. This is correct for a "there exists a construction achieving $\Omega(n)$ high-multiplicity distances" statement. + +**One potential concern:** The use of `Set.ncard` on `highMultiplicityDistances A` is safe because for a finite point set $A$, the set of realized distances is finite (bounded by $\binom{n}{2}$), so `highMultiplicityDistances A` is always finite. `Set.ncard` returns the cardinality for finite sets and 0 for infinite sets, so this is fine. + +**No mathematical flaws identified.** The formalization is a faithful, complete, and correct rendering of the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `pairCount` duplicated across 132, 756, and (as `distMultiplicity`) 95. Should be shared. | +| Citations | [Er97b] not on website; Clemen–Dumitrescu–Liu (2025) result missing. | +| Variants | Stronger "all except largest" variant not captured. | +| Readability | Good. Clear docstrings, consistent conventions. | +| Formalizability | Low ambiguity. Clearly formalizable. | +| Correctness | Correct and complete. No mathematical flaws. | diff --git a/ai-review/758.md b/ai-review/758.md new file mode 100644 index 0000000000..2d832104b7 --- /dev/null +++ b/ai-review/758.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 758 + +## 1. Code Reuse + +**Issue found.** `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already provides: +- `Cocolorable` (line 118): `∃ coloring : V → Fin n, ∀ i, G.induce {v | coloring v = i} = ⊥ ∨ G.induce {v | coloring v = i} = ⊤` +- `cochromaticNumber` (line 131): `⨅ n ∈ setOf G.Cocolorable, (n : ℕ∞)` + +Problem 758 defines its own local `IsCochromaticColoring` and `cochromaticNumber` that are mathematically equivalent but differ in formulation: +- The local version spells out the cochromatic condition via explicit adjacency quantifiers rather than induced subgraph equality with `⊥`/`⊤`. +- The local `cochromaticNumber` returns `ℕ` (via `sInf`) while the utility version returns `ℕ∞` (via `⨅`). + +This same duplication exists in problems 625, 759, 760, 761, and 762. All should be consolidated to use the shared utility definitions. The `maxCochromaticNumber` definition is problem-specific and appropriately local. + +**Recommendation:** Replace `IsCochromaticColoring` and the local `cochromaticNumber` with the shared `Cocolorable` and `cochromaticNumber` from the utility file. Adjust `maxCochromaticNumber` to use `cochromaticNumber` from the utility (noting the `ℕ∞` type will require conversion via `ENat.toNat` or similar). + +## 2. Citations + +The formalization includes: +- `[ErGi93]` Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory* (1993). +- `[Gi86]` Gimbel, J., *The chromatic and cochromatic number of a graph* (1986). + +The website attributes the problem to Erdős and Gimbel and references [Gi86]. The citations are consistent with the website. The resolution credit to Bhavik Mehta (computational verification) is mentioned in the theorem docstring, consistent with the website. + +**No issues.** + +## 3. Variants + +The formalization captures only the specific question: is z(12) = 4? + +The website provides significantly more information: +- **Known values:** z(n) for 1 ≤ n ≤ 19 are: 1,1,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,6. +- **Open question:** Whether z(20) = 6 or 7 remains unknown. +- **Asymptotic result:** Gimbel showed z(n) ~ n/log(n). + +These additional results could be formalized as separate theorems (e.g., a table of known values, or the asymptotic characterization), but they go beyond the specific question asked in Problem 758. The formalization is faithful to the core question. + +**Minor suggestion:** Consider adding the full table of known z(n) values for 1 ≤ n ≤ 19 as an additional theorem, since these are all resolved. + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings explain each definition with LaTeX notation. +- The namespace `Erdos758` avoids name collisions. +- The progression from `IsCochromaticColoring` → `cochromaticNumber` → `maxCochromaticNumber` → `erdos_758` is logical. + +**Minor note:** The local definition `IsCochromaticColoring` takes `k` as an explicit parameter separately from the coloring function `c : V → Fin k`, which is slightly unusual—bundling them or using the utility definition would be more idiomatic. + +**No significant issues.** + +## 5. Formalizability + +The problem is entirely concrete and unambiguous: it asks whether a specific natural number (z(12)) equals 4. The definitions of cochromatic number and z(n) are standard and well-defined in combinatorics. There is no ambiguity whatsoever. + +**Assessment: Fully formalizable, no ambiguity.** + +## 6. Correctness + +### Definition: `IsCochromaticColoring` +Correctly captures the cochromatic condition: for each color class, either all distinct pairs are adjacent (clique) or no distinct pairs are adjacent (independent set). The universal quantification over all vertices with filtering by color assignment is mathematically sound. Empty color classes vacuously satisfy both conditions, which is correct (they don't affect the partition). + +### Definition: `cochromaticNumber` +Uses `sInf` over `{k : ℕ | ∃ c : V → Fin k, IsCochromaticColoring G k c}`. This is correct: +- The set is always nonempty for finite graphs (k = |V| works: assign each vertex a distinct color, making each class a singleton, which is trivially both a clique and independent set). +- `sInf` on `ℕ` returns 0 for the empty set, but this edge case doesn't arise for nonempty vertex sets. +- For the empty graph on `Fin 0`, k = 0 works (vacuous), so `cochromaticNumber = 0`, which is the standard convention. + +### Definition: `maxCochromaticNumber` +Uses `sSup` over `{k : ℕ | ∃ G : SimpleGraph (Fin n), cochromaticNumber G = k}`. This is correct: +- For `ℕ`, `sSup` (from `ConditionallyCompleteLinearOrderBot`) requires the set to be nonempty and bounded above for the expected behavior. Both conditions hold: there exists at least one graph on `Fin n` (so the set is nonempty), and `cochromaticNumber G ≤ n` for any graph on n vertices (so the set is bounded above). + +### Theorem statement: `erdos_758` +`answer(True) ↔ maxCochromaticNumber 12 = 4` correctly encodes: "The answer is yes, z(12) = 4." The `answer(True)` wrapper with the `solved` tag appropriately reflects the resolved status. + +**Assessment: Mathematically correct. No flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | **Should use shared utility definitions** from `FormalConjecturesForMathlib` | +| Citations | Correct and consistent with website | +| Variants | Core question captured; additional known values could be added | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct | diff --git a/ai-review/759.md b/ai-review/759.md new file mode 100644 index 0000000000..f153103dfd --- /dev/null +++ b/ai-review/759.md @@ -0,0 +1,91 @@ +# Review: Erdos Problem 759 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsCochromaticColouring` and `cochromaticNumber` in `759.lean` are essentially identical to those in: + +- **`ErdosProblems/758.lean`** (lines 41–51): Same logic, but uses American spelling `IsCochromaticColoring`. The definitions are structurally identical. +- **`ErdosProblems/762.lean`** (lines 47–57): Identical definitions with identical British spelling. +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`** (lines 118–131): Provides `Cocolorable` and `cochromaticNumber` using a different but equivalent formulation based on `G.induce` returning `⊥` or `⊤`, and returning `ℕ∞` instead of `ℕ`. + +**Recommendation:** All three Erdos problems (758, 759, 762) should share a single definition of `IsCochromaticColouring` and `cochromaticNumber`, ideally factored into a shared utility or using the `Cocolorable`/`cochromaticNumber` from `Coloring.lean`. The `Coloring.lean` version is more idiomatic (uses `induce` and `⊥`/`⊤`) but returns `ℕ∞`, which would require adaptation for the `ℕ`-valued uses in these problems. At minimum, the three Erdos files should import a single shared definition rather than each redeclaring it. + +The `maxCochromaticOnSurface` definition is unique to 759 and cannot be reused from elsewhere. + +## 2. Citations + +The citations in the docstring match those on [erdosproblems.com/759](https://www.erdosproblems.com/759): + +| Citation | Docstring | Website | Match? | +|----------|-----------|---------|--------| +| [ErGi93] | Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*, 1993. | Erdős and Gimbel (1993) | Yes | +| [Gi86] | Gimbel, J., *Some remarks on the cochromatic number of a graph*, 1986. | Gimbel (1986) | Yes | +| [GiTh97] | Gimbel, J. and Thomassen, C., *Coloring graphs with fixed genus and girth*, 1997. | Gimbel and Thomassen (1997) | Yes | + +All citations are properly documented. The website also mentions Raphael Steiner as a contributor, but this appears to be related to other problems (762), not 759 directly. + +## 3. Variants + +The problem asks to "determine the growth rate of z(S_n)." The formalization captures: + +- **`erdos_759`** (upper bound): z(S_n) ≤ C·√n/log n for large n (Gimbel–Thomassen) +- **`erdos_759.variants.lower_bound`**: z(S_n) ≥ C·√n/log n for large n (Gimbel) + +Together these establish z(S_n) = Θ(√n / log n), which is the complete answer to the problem. **All variants are captured.** + +One could argue that the intermediate result of Gimbel (the weaker upper bound z(S_n) ≪ √n) could be a separate variant, but since it is strictly superseded by the Gimbel–Thomassen upper bound, omitting it as a separate theorem is reasonable. + +## 4. Readability + +The code is well-structured and readable: + +- The namespace `Erdos759` cleanly scopes all definitions. +- Docstrings are clear and include LaTeX-formatted mathematical statements. +- The module docstring provides good context with the problem history. +- The separation into upper and lower bound theorems with descriptive names is natural. + +**Minor suggestion:** The `IsEmbeddableOnSurface` docstring could clarify that $S_n$ refers to the closed orientable surface of genus $n$ (i.e., the connected sum of $n$ tori). This is standard but worth being explicit. + +## 5. Formalizability + +**Assessment: Partially formalizable with axiomatization.** + +The core challenge is that **surface topology (and graph embeddings on surfaces) is not available in Mathlib**. The formalization addresses this by declaring `IsEmbeddableOnSurface` as `opaque`, which is a reasonable axiomatization. This means: + +- The definition cannot be unfolded or computed with. +- Any proof of the theorems would need to work with `IsEmbeddableOnSurface` axiomatically or provide an implementation. +- The `opaque` approach is honest about what is and isn't formalized. + +The asymptotic statement is made precise via the standard ∃C > 0, ∃N₀, ∀n ≥ N₀ pattern, which is unambiguous. The use of `Real.log` (natural logarithm) is appropriate since the base of the logarithm is absorbed into the constant C. + +**Ambiguity level: Low.** The original problem ("determine the growth rate") is somewhat informal, but the Gimbel–Thomassen result pins it down precisely to Θ(√n / log n), which is what the formalization captures. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** Detailed analysis: + +### Definitions + +- **`IsCochromaticColouring`**: Correctly captures that each color class induces either a clique or an independent set. The quantification over `u ≠ v` correctly excludes self-loops (which don't exist in `SimpleGraph`). + +- **`cochromaticNumber`**: Uses `sInf` on ℕ. The set `{k | ∃ c : V → Fin k, IsCochromaticColouring G k c}` is non-empty for any finite graph (take k = Fintype.card V and assign each vertex a distinct color), so `sInf` returns the correct minimum. Returns `0` only for graphs on `Fin 0`, which is correct (the empty graph has cochromatic number 0). + +- **`IsEmbeddableOnSurface`**: Opaque axiomatization. Takes graphs on `Fin m` (finite vertex sets), which is appropriate since surface embeddings are only meaningful for finite graphs. + +- **`maxCochromaticOnSurface`**: Uses `sSup` on ℕ. The set is non-empty (the empty graph on `Fin 0` is embeddable on any surface with cochromatic number 0). The set is bounded above in reality (by the Heawood bound on chromatic number for surfaces), but this cannot be proved from the `opaque` declaration alone. For the purposes of the conjecture statements, this is acceptable — the theorems assert bounds on this `sSup`, which would be vacuously provable if the set were empty or unbounded in a degenerate way, but mathematically the intent is clear. + +### Theorem Statements + +- **Upper bound** (`erdos_759`): ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, z(S_n) ≤ C·√n/log n. Correctly formalizes the Gimbel–Thomassen result. The cast `(maxCochromaticOnSurface n : ℝ)` correctly lifts the natural number to a real for comparison. + +- **Lower bound** (`erdos_759.variants.lower_bound`): ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, z(S_n) ≥ C·√n/log n. Correctly formalizes Gimbel's 1986 lower bound. + +- The existential quantification over N₀ correctly handles the edge cases where log n ≤ 0 (n = 0 or 1) or where the bound doesn't hold for small n. + +- The attribution in the docstrings is correct: the lower bound √n/log n is from Gimbel [Gi86], and the matching upper bound is from Gimbel–Thomassen [GiTh97]. + +### Potential Concern + +The use of `sSup` for `maxCochromaticOnSurface` on an unbounded-in-principle set (since `IsEmbeddableOnSurface` is opaque) means that one could, in theory, provide a pathological implementation of `IsEmbeddableOnSurface` that makes the set unbounded, causing `sSup` to return 0 on ℕ. This would make both theorems trivially true (0 ≤ anything positive). However, this is an artifact of the axiomatization and does not represent a mathematical error — any reasonable implementation would yield a bounded set. + +**Overall assessment: Correct and complete formalization of the solved problem, with an appropriate axiomatization for the missing topological infrastructure.** diff --git a/ai-review/76.md b/ai-review/76.md new file mode 100644 index 0000000000..ace25a27e6 --- /dev/null +++ b/ai-review/76.md @@ -0,0 +1,130 @@ +# Review: Erdos Problem 76 + +## 1. Code Reuse + +Several definitions in the codebase address closely related concepts: + +- **`EdgeTwoColoring`** is defined locally here as `Sym2 (Fin n) → Bool`, while Problem 639 (`ErdosProblems/639.lean:39-41`) defines its own `EdgeTwoColoring` as a `structure` with `color : Fin n → Fin n → Bool` and an explicit `symm` field. The Problem 76 encoding via `Sym2` is arguably more elegant since symmetry is enforced by the type rather than a proof obligation, but the two definitions are not interchangeable without conversion. Neither is factored into a shared utility. + +- **`HasEdgeDisjointTriangles`** in Problem 1009 (`ErdosProblems/1009.lean:45-53`) encodes edge-disjoint triangles using injective maps `Fin t → Fin 3 → Fin n` with explicit edge-disjointness on pairs. Problem 76 instead uses `Finset (Finset (Fin n))` with a separate `IsEdgeDisjointFamily` predicate. The two representations are mathematically equivalent but structurally different. The Problem 1009 encoding is more compact (triangles are indexed, not collected into a finset of finsets), while Problem 76's is perhaps more natural for counting purposes since `𝒯.card` directly gives the family size. + +- **`IsTriangleIndependent`** and related definitions in Problem 621 (`ErdosProblems/621.lean`) also work with `Sym2 (Fin n)` edges and triangles but focus on different properties (transversals rather than disjoint families). + +- **Mathlib's `SimpleGraph`**: Neither Problem 76 nor 639 use Mathlib's `SimpleGraph` type, instead rolling their own edge-coloring representations. Problem 1009 does use `SimpleGraph` directly. There is a design tension in the codebase between using `SimpleGraph` (which provides access to Mathlib's graph theory library) and using lightweight ad hoc definitions (which avoid the overhead of `SimpleGraph`'s decidability requirements). Problem 76's use of `Sym2 (Fin n) → Bool` is a reasonable middle ground. + +**Recommendation**: The `EdgeTwoColoring` and `IsEdgeDisjointFamily` definitions could be shared with Problems 639 and 1009 respectively, but the different encodings make this nontrivial. If the codebase moves toward a shared graph-coloring utility, `Sym2 (Fin n) → Bool` is the cleanest representation for 2-edge-colorings of complete graphs. + +## 2. Citations + +The formalization references: +- `[GrLe20]` Gruslys, V. and Letzter, S., *Minimising the number of triangles in a two-colouring of the edges of K_n*, J. Combin. Theory Ser. B (2020). + +The website (erdosproblems.com/76) lists the following references: +- **[Er95]** — not cited in the formalization +- **[Er97d]** — not cited in the formalization +- **[Va99, 3.54]** — not cited in the formalization +- **[GrLe20]** — cited ✓ + +**Missing citations**: The formalization omits [Er95], [Er97d], and [Va99]. These are the original sources where Erdős (with Faudree and Ordman) stated the conjecture. The docstring says "Conjectured by Erdős, Faudree, and Ordman" without a citation tag for the original conjecture. At minimum, [Er97d] should be cited as the source where Erdős explicitly asked this question, and [Va99] as the survey reference. + +**Note**: The website also mentions a related OEIS sequence A060407, which could be noted in the docstring for additional context. + +## 3. Variants + +The website describes a related open question from [Er97d]: + +> Erdős asks for a lower bound on edge-disjoint monochromatic triangles **in a single color** (maximized over both colors), conjecturing the answer is ≥ cn² for some constant c > 1/24. + +This variant is **not captured** in the formalization. The current theorem considers edge-disjoint monochromatic triangles of *either* color collectively. The [Er97d] variant asks: in any 2-colouring, can one always find ≥ cn² edge-disjoint triangles that are all the *same* color (choosing the better color)? + +This is a distinct and strictly stronger question (since monochromatic triangles of different colors can share edges only if their edges receive different colors, but restricting to a single color is still more constrained because you lose the triangles of the other color). The 1/24 threshold is notable — it is exactly half of 1/12, corresponding to the idea that one color should contribute at least half the triangles. + +**Recommendation**: Add a variant formalizing the single-color version, perhaps as `erdos_76.variants.single_color`. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **`triangleEdges`**: The definition `((T ×ˢ T).image (fun p => s(p.1, p.2))).filter (fun e => ¬e.IsDiag)` is clear and correct, but requires the reader to understand `s(·, ·)` notation for `Sym2.mk`. This is standard Lean/Mathlib convention. + +- **`IsMonochromaticTriangle`**: The conjunction `T.card = 3 ∧ ∃ c : Bool, ∀ e ∈ triangleEdges T, col e = c` is easy to read and directly expresses "T is a triangle and all its edges have the same color." + +- **`IsEdgeDisjointFamily`**: The pairwise disjointness condition is standard. Using Mathlib's `Disjoint` on `Finset` is appropriate. + +- **Theorem statement**: The quantifier structure `∀ ε > 0, ∃ N, ∀ n ≥ N, ∀ col, ∃ 𝒯, ...` correctly and readably encodes the asymptotic claim. The use of `(1 - ε) * (n : ℝ) ^ 2 / 12` is clear. + +- **Docstring**: The module docstring is thorough, includes a sketch of the extremal construction, and properly attributes the result. The `answer(True)` wrapper is explained in the theorem-level docstring via the "Formally:" paragraph. + +- **Minor nit**: The comment on `EdgeTwoColoring` says "Values at diagonal elements s(v, v) are irrelevant" — this is correct since the theorem only cares about `triangleEdges`, which filters out diagonals. It might be slightly cleaner to define `EdgeTwoColoring` on `{e : Sym2 (Fin n) // ¬e.IsDiag}` to enforce this at the type level, but the current approach is simpler and pragmatically fine. + +**Overall**: Readability is good. The definitions are appropriately named and documented. + +## 5. Formalizability + +The original problem uses the notation "(1 + o(1)) n²/12", which is asymptotic and requires interpretation. The standard formalization of "f(n) ≥ (1 + o(1)) g(n)" is: + +> For all ε > 0, there exists N such that for all n ≥ N, f(n) ≥ (1 - ε) g(n). + +The formalization adopts exactly this interpretation, which is correct and standard. + +**Potential ambiguity**: The phrase "edge-disjoint monochromatic triangles" could in principle be read two ways: +1. A family of triangles, each monochromatic (possibly in different colors), that are pairwise edge-disjoint. +2. A family of triangles that are all the same color and pairwise edge-disjoint. + +The standard reading in the literature (and the one used by Gruslys–Letzter) is interpretation (1), which is what the formalization captures. The [Er97d] variant explicitly asks about interpretation (2). So there is no ambiguity issue here — the formalization follows the correct reading. + +**Assessment**: High formalizability. The only informal element is the o(1) notation, which has a canonical ε-N translation. + +## 6. Correctness + +### `EdgeTwoColoring` +Defined as `Sym2 (Fin n) → Bool`. This correctly models a 2-coloring of all edges (and non-edges/diagonals, but those are irrelevant). ✓ + +### `triangleEdges` +Takes a `Finset (Fin n)` and returns the set of non-diagonal `Sym2` pairs. For a 3-element set {a, b, c}, this produces {s(a,b), s(a,c), s(b,c)} — exactly the 3 edges of a triangle. ✓ + +**Subtle point**: `triangleEdges` is defined for arbitrary `Finset (Fin n)`, not just 3-element sets. The `IsMonochromaticTriangle` definition correctly constrains `T.card = 3`. If T had repeated elements, `Finset` prevents this since `Finset` has no duplicates. ✓ + +### `IsMonochromaticTriangle` +Requires `T.card = 3` and a single color `c` such that all edges in `triangleEdges T` receive color `c`. This is correct. ✓ + +**Edge case**: For `T.card = 3`, `triangleEdges T` has exactly 3 elements (since the 3 vertices are distinct and all pairs are non-diagonal). The universal quantifier over these 3 edges correctly enforces monochromaticity. ✓ + +### `IsEdgeDisjointFamily` +Requires `∀ T₁ ∈ 𝒯, ∀ T₂ ∈ 𝒯, T₁ ≠ T₂ → Disjoint (triangleEdges T₁) (triangleEdges T₂)`. This is the standard definition of pairwise edge-disjointness. Since `𝒯` is a `Finset`, there are no duplicate triangles, and the `T₁ ≠ T₂` condition correctly handles the reflexive case. ✓ + +### Main theorem `erdos_76` + +The statement: +``` +∀ ε : ℝ, 0 < ε → +∃ N : ℕ, ∀ n : ℕ, N ≤ n → +∀ col : EdgeTwoColoring n, +∃ 𝒯 : Finset (Finset (Fin n)), + (∀ T ∈ 𝒯, IsMonochromaticTriangle col T) ∧ + IsEdgeDisjointFamily 𝒯 ∧ + (1 - ε) * (n : ℝ) ^ 2 / 12 ≤ (𝒯.card : ℝ) +``` + +**Quantifier structure**: For all ε > 0, for sufficiently large n, for any 2-coloring, there exists a large edge-disjoint monochromatic family. This correctly captures "(1 + o(1)) n²/12" as a lower bound. ✓ + +**Bound expression**: `(1 - ε) * (n : ℝ) ^ 2 / 12` — note that due to Lean's left-to-right parsing and operator precedence, this is `((1 - ε) * n²) / 12`, which equals `(1 - ε) · n²/12`. This is the intended bound. ✓ + +**`answer(True)` wrapper**: The problem is proved (by Gruslys–Letzter), so `answer(True)` is correct. The biconditional `answer(True) ↔ [statement]` means the statement is asserted to be true. ✓ + +**No issues with the coercion from `𝒯.card : ℕ` to `ℝ`**: The cast is monotone, so the inequality is well-formed. ✓ + +### Overall Correctness Assessment + +The formalization is **mathematically correct and complete** for the main problem. No experienced mathematician would identify a flaw. The only gap is the missing [Er97d] single-color variant (see §3), which is a separate question rather than an error in the current formalization. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `EdgeTwoColoring` and edge-disjoint triangle concepts exist in Problems 639 and 1009 with different encodings; no shared utility exists yet | +| Citations | [GrLe20] is cited; [Er95], [Er97d], and [Va99] from the website are missing | +| Variants | The single-color variant from [Er97d] (≥ cn² for c > 1/24) is not captured | +| Readability | Good — clean definitions, clear docstrings, well-structured theorem statement | +| Formalizability | High — the only informal element (o(1) notation) has a standard ε-N translation | +| Correctness | Correct and complete for the main problem; no mathematical flaws | diff --git a/ai-review/760.md b/ai-review/760.md new file mode 100644 index 0000000000..e30e987679 --- /dev/null +++ b/ai-review/760.md @@ -0,0 +1,72 @@ +# Review: Erdős Problem 760 + +## 1. Code Reuse + +**Significant duplication found.** Both Problem 760 and Problem 762 define identical local copies of `IsCochromaticColouring` and `cochromaticNumber`. Furthermore, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already provides: + +- `SimpleGraph.Cocolorable` (line 118) — an equivalent predicate defined via `G.induce {v | coloring v = i} = ⊥ ∨ ... = ⊤`, which is mathematically equivalent to the local `IsCochromaticColouring`. +- `SimpleGraph.cochromaticNumber` (line 131) — returning `ℕ∞` via `⨅ n ∈ setOf G.Cocolorable, (n : ℕ∞)`. + +The library definitions are preferable because: +- They use `ℕ∞`, which is consistent with `chromaticNumber`'s return type and avoids `sInf ∅ = 0` edge-case confusion with `ℕ`. +- They express the cochromatic condition structurally (induced subgraph equals `⊥` or `⊤`) rather than pointwise, which is more idiomatic Mathlib style. +- They avoid code duplication across Problems 760 and 762. + +**Recommendation:** Import `FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Coloring` and use `Cocolorable`/`cochromaticNumber` from there. If the `ℕ∞` return type is inconvenient for the bound statement, convert via `.toNat` (as is already done for `chromaticNumber`). + +## 2. Citations + +The docstring references match the website: + +| Citation | Docstring | Website | +|----------|-----------|---------| +| [ErGi93] | Erdős, P. and Gimbel, J. | Erdős, P. and Gimbel, J. | +| [AKS97] | Alon, N., Krivelevich, M., and Sudakov, B. | Alon, N., Krivelevich, M., and Sudakov, B. | + +The website does not provide paper titles or journal details for these references, and the formalization matches this. No discrepancies. + +## 3. Variants + +The formalization captures only the main conjecture (the sharp $m / \log m$ bound). The website additionally mentions: + +- **Erdős–Gimbel partial result [ErGi93]:** They proved the weaker bound $\zeta(H) \gg (m / \log m)^{1/2}$. This could be formalized as a separate theorem. +- **Optimality via complete graphs:** The docstring mentions this but doesn't formalize it. A separate statement showing $\zeta(K_m) = \lceil m / \log m \rceil \cdot \Theta(1)$ (or similar) could demonstrate sharpness. + +These are minor — the core conjecture is captured. + +## 4. Readability + +The code is clear and well-structured. Minor suggestions: + +- The `open Real` is unused beyond `Real.log`, which could be qualified instead. Low priority. +- The bound expression `C * (G.chromaticNumber.toNat : ℝ) / Real.log (G.chromaticNumber.toNat : ℝ)` is long but readable. Introducing a local `let m := (G.chromaticNumber.toNat : ℝ)` could improve it slightly. +- The docstring is informative and well-written. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem uses $f \gg g$ (Vinogradov notation), which is standard for "there exists $C > 0$ such that $f \geq C \cdot g$ for sufficiently large arguments." The formalization correctly interprets this as $\exists C > 0, \exists N_0, \forall G$ with $\chi(G) \geq N_0, \ldots$ + +The only minor ambiguity is the meaning of "subgraph" — which could mean general subgraph or induced subgraph. In the context of cochromatic number (a vertex-partition property), induced subgraphs are the natural choice, and this matches the AKS97 result. The formalization correctly uses `G.induce`. + +## 6. Correctness + +**Overall: Correct, with minor observations.** + +### Correct aspects: +- **Quantifier structure:** $\exists C > 0, \exists N_0, \forall n, \forall G$ on $\operatorname{Fin}(n)$ with $\chi(G) \geq N_0$ — this correctly formalizes the asymptotic statement. +- **Induced subgraph via `Finset`:** Using `∃ (S : Finset (Fin n))` and `G.induce (↑S)` correctly captures "there exists an induced subgraph." +- **`answer(True)`:** Correctly reflects that the conjecture was proved (by AKS97). +- **Finite graphs only:** Restricting to `Fin n` vertex sets is appropriate; the problem is inherently about finite graphs. +- **`chromaticNumber.toNat`:** Since `Fin n` is finite, `chromaticNumber` is always finite, so `.toNat` faithfully extracts the value. + +### Observations: +- **`Real.log` base:** Mathlib's `Real.log` is the natural logarithm. In combinatorics, $\log$ often means natural log (or the base doesn't matter up to constants, which are absorbed into $C$). This is fine. +- **Edge case when $m = 0$ or $m = 1$:** If $\chi(G) = 0$ (empty type) or $\chi(G) = 1$ (edgeless), then $\log m \leq 0$ and the bound $C \cdot m / \log m$ is nonpositive, so it's trivially satisfied. The $N_0$ threshold handles this gracefully. +- **Local `cochromaticNumber` returns `ℕ`:** The local definition uses `sInf` on `ℕ`, which gives 0 for the empty set. For finite graphs with at least one vertex, the set is always nonempty (color each vertex distinctly), so this is not a problem in practice. However, the `ℕ∞` version from the library is more robust. + +### Potential issue: +- The local `cochromaticNumber` requires `[Fintype V]`, but `G.induce (↑S : Set (Fin n))` has vertex type `↑S : Set (Fin n)`. This should have a `Fintype` instance since `S` is a `Finset`, so this works. No issue. + +**Verdict:** The formalization is mathematically correct and faithfully represents the problem as stated on the website. The main recommendation is to use the shared cochromatic number definitions from `FormalConjecturesForMathlib` to avoid code duplication with Problem 762. diff --git a/ai-review/761.md b/ai-review/761.md new file mode 100644 index 0000000000..780b4f07f6 --- /dev/null +++ b/ai-review/761.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 761 + +## 1. Code Reuse + +**Significant duplication identified.** The definitions `IsCochromaticColouring` and `cochromaticNumber` in `Erdos761` (lines 63–74) are **identical** to those in: +- `ErdosProblems/760.lean` (lines 46–58) +- `ErdosProblems/759.lean` (lines 50–60) +- `ErdosProblems/762.lean` (lines 47–57) +- `ErdosProblems/758.lean` (lines 41–51, with spelling variant "Coloring") + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already provides: +- `Cocolorable` (line 118): semantically equivalent using `G.induce S = ⊥ ∨ G.induce S = ⊤` +- `cochromaticNumber` (line 131): an `ℕ∞`-valued version using `Cocolorable` + +The local `IsCochromaticColouring`/`cochromaticNumber` definitions could be replaced by the utility library's `Cocolorable`/`cochromaticNumber`, though the utility version returns `ℕ∞` rather than `ℕ`, which would require `.toNat` conversion. At minimum, these five Erdős problems (758–762) should share a single definition. + +The `IsOrientation` predicate (lines 42–45) is essentially the same as the `Orientation` structure in `ErdosProblems/1006.lean` (lines 45–49), differing only in being a bare `Prop` vs. a structure with named fields. These could be unified. + +The `IsAcyclicColouring` and `dichromaticNumber` definitions appear to be unique to this file and are not candidates for reuse from elsewhere. + +## 2. Citations + +The website lists citation key **[ErGi93]** for this problem. The docstring in the Lean file (lines 31–33) correctly attributes Q1 to Erdős and Neumann-Lara and Q2 to Erdős and Gimbel, but **does not include the [ErGi93] reference tag**. Compare with Problem 760, which explicitly lists: + +> [ErGi93] Erdős, P. and Gimbel, J. + +A similar citation line should be added to the module docstring for Problem 761 to match the website's reference and the convention used in neighboring problems. + +## 3. Variants + +The website states two questions: +1. Must a graph with large chromatic number have large dichromatic number? +2. Must a graph with large cochromatic number contain a graph with large dichromatic number? + +The formalization captures both: +- `erdos_761` (line 83): Question 1 (χ large → δ large) +- `erdos_761.variants.cochromatic` (line 97): Question 2 (ζ large → induced subgraph with δ large) + +**All variants are captured.** The website also notes that a positive answer to Q2 implies Q1 via Problem 760; the docstring correctly mentions this relationship. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The `IsAcyclicColouring` definition (lines 50–53) quantifies over `∀ i : Fin k, ∀ v : V, c v = i → ...`, which is equivalent to the simpler `∀ v : V, ¬Relation.TransGen (fun u w => c u = c v ∧ c w = c v ∧ D u w) v v`. The current form is slightly more verbose but arguably more explicit about the color-class structure. +- The definitions are well-documented with docstrings that clearly explain the mathematical concepts. +- Namespace `Erdos761` keeps things contained. + +## 5. Formalizability + +**High formalizability.** The problem is stated precisely enough to admit an unambiguous formalization: + +- "Large chromatic number implies large dichromatic number" has a standard formalization as: ∀ n, ∃ m, χ(G) ≥ m → δ(G) ≥ n. +- The dichromatic number has a precise definition (minimum k such that every orientation admits an acyclic k-coloring). +- The cochromatic number has a precise definition (minimum colors where each class is complete or independent). + +**One minor ambiguity:** In Q2, "contain a graph with large dichromatic number" could mean either subgraph or induced subgraph. The formalization uses **induced subgraph** (`G.induce`), which is the natural choice for cochromatic number questions (since cochromatic properties concern vertex partitions and induced structure). This matches the convention in Problem 760 as well. The ambiguity is low. + +## 6. Correctness + +### Definitions + +**`IsOrientation`** (lines 42–45): Correctly requires that (1) oriented edges are graph edges, (2) every edge gets at least one direction, and (3) no edge gets both directions (antisymmetry). This is a complete and correct definition of a graph orientation. + +**`IsAcyclicColouring`** (lines 50–53): The relation `fun u w => c u = i ∧ c w = i ∧ D u w` restricts directed edges to within color class i. Using `Relation.TransGen` to detect cycles (v reaches itself) is correct. Since TransGen chains steps, every intermediate vertex in the chain must also satisfy `c u = i`, ensuring the entire directed path stays within the color class. **Correct.** + +**`dichromaticNumber`** (lines 57–60): Uses `sInf` over {k | ∀ D orientation, ∃ acyclic k-coloring}. For finite graphs, this set is always non-empty (k = |V| works, since unique colors prevent monochromatic edges), so `sInf` returns the correct minimum. **Correct.** + +**`IsCochromaticColouring`** (lines 64–68): Each color class must induce either a complete graph or an independent set. The disjunction is per-color-class (each class independently chooses complete or independent). **Correct.** + +**`cochromaticNumber`** (lines 72–74): Analogous to `dichromaticNumber`, uses `sInf`. Non-empty for finite graphs (k = |V| trivially works). **Correct.** + +### Theorem Statements + +**`erdos_761`** (lines 83–87): Formalizes Q1 as `∀ n, ∃ m, ∀ (s : ℕ) (G : SimpleGraph (Fin s)), χ(G) ≥ m → δ(G) ≥ n`. This correctly captures "graphs with sufficiently large chromatic number must have large dichromatic number." The use of `answer(sorry)` reflects that the problem is open and the truth value is unknown. Quantifying over `Fin s` covers all finite graphs up to isomorphism. **Correct.** + +**`erdos_761.variants.cochromatic`** (lines 97–102): Formalizes Q2 as `∀ n, ∃ m, ∀ (s : ℕ) (G : SimpleGraph (Fin s)), ζ(G) ≥ m → ∃ S : Finset (Fin s), δ(G.induce S) ≥ n`. This correctly captures "graphs with large cochromatic number contain an induced subgraph with large dichromatic number." **Correct.** + +**Note on the `induce` usage in Q2** (line 101): `G.induce (↑S : Set (Fin s))` induces on a `Set` coercion of a `Finset`. The `dichromaticNumber` function requires `[Fintype V]`. The induced subgraph on a `Set` from a `Finset` coercion should have a `Fintype` instance, so this should type-check. **Correct.** + +### Monotonicity of the Q2 → Q1 implication + +The docstring claims Q2 implies Q1 via Problem 760. This is mathematically sound: Problem 760 establishes χ(G) large → ∃ induced H with ζ(H) large. If Q2 holds (ζ(H) large → ∃ induced H' with δ(H') large), then combining gives χ(G) large → ∃ induced subgraph with δ large. Since the dichromatic number is monotone for induced subgraphs (any orientation of a subgraph extends to an orientation of the parent, so δ(H) ≤ δ(G)), this yields δ(G) large, confirming Q1. + +### Overall Assessment + +**The formalization is mathematically correct and complete.** The only actionable items are: +1. Add the [ErGi93] citation to the docstring. +2. Consider centralizing the duplicated `IsCochromaticColouring`/`cochromaticNumber` and `IsOrientation` definitions. diff --git a/ai-review/762.md b/ai-review/762.md new file mode 100644 index 0000000000..ef63c2d15d --- /dev/null +++ b/ai-review/762.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 762 + +## 1. Code Reuse + +**Significant duplication exists.** The local `IsCochromaticColouring` and `cochromaticNumber` definitions in `762.lean` are duplicated verbatim (or near-verbatim) across at least five Erdős problem files: 758, 759, 760, 761, and 762. Additionally, a shared definition already exists in the utility library: + +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:118-131`** defines `Cocolorable` and `cochromaticNumber`. + +However, there are semantic differences: +- The shared `cochromaticNumber` returns `ℕ∞` (extended naturals), while the local version returns `ℕ`. +- The shared `Cocolorable` is defined via `G.induce {v | coloring v = i} = ⊥ ∨ ... = ⊤`, while the local `IsCochromaticColouring` uses explicit universal quantification over pairs of vertices. + +These are equivalent for finite graphs, but the type difference (`ℕ∞` vs `ℕ`) means the shared version cannot be used as a drop-in replacement without adjusting the theorem statement. Ideally, all cochromatic-related Erdős problems (758–762, 625) should share a single definition, either by importing the shared utility or by creating a common local module. + +## 2. Citations + +The docstring references: +- **[EGS90]**: Erdős, P., Gimbel, J., and Straight, H.J., *Chromatic number versus cochromatic number in graphs with bounded clique number*, European J. Combin. 11 (1990), 235–240. ✅ Matches website. +- **[St24b]**: Steiner, R., *A counterexample to the Erdős–Gimbel–Straight conjecture*, 2024. ✅ Matches website. + +**Missing citation**: The website also lists **[ErGi93]** (Erdős, P. and Gimbel, J., *Some problems and results in cochromatic theory*, 1993) as a reference for this problem. This citation appears in the docstrings of problems 758–760 but is omitted from 762. It should be included for completeness, as the website attributes the conjecture to both [EGS90] and [ErGi93]. + +## 3. Variants + +The formalization captures the specific conjecture: *for K_5-free graphs with ζ(G) ≥ 4, is χ(G) ≤ ζ(G) + 2?* + +The docstring mentions the broader result from [EGS90]: for every n > 2 there exists f(n) such that if G is K_n-free then χ(G) ≤ ζ(G) + f(n). This general result is stated as background context only and is not formalized, which is appropriate since problem 762 specifically concerns the K_5 case with the conjectured bound of +2. + +No additional variants appear on the website. **All relevant variants are adequately addressed.** + +## 4. Readability + +The code is clean and well-structured. Minor observations: +- The docstring clearly explains the cochromatic number, states the conjecture, and documents the disproof. This is good. +- The naming is consistent (`IsCochromaticColouring`, `cochromaticNumber`) with the British spelling convention used in 759, 760, and 761 (though 758 uses the American `IsCochromaticColoring`—a minor inconsistency across the problem set, not within this file). +- The theorem statement is readable and follows the project's `answer(False) ↔ ...` convention for disproved conjectures. + +**No significant readability improvements needed.** + +## 5. Formalizability + +The problem is **highly formalizable and unambiguous**. The conjecture involves only standard, well-defined graph-theoretic concepts: +- Clique-freeness (K_5-free, i.e., `CliqueFree 5`) +- Cochromatic number (well-defined minimum over colorings) +- Chromatic number (standard Mathlib definition) +- A concrete numerical bound (ζ + 2) + +There is no ambiguity in the mathematical statement. The concepts are all finitary and combinatorial, making them straightforward to express in Lean. + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **`answer(False)`**: The conjecture was disproved by Steiner, so the answer is indeed `False`. The statement `answer(False) ↔ (∀ n G, ...)` asserts `¬(∀ n G, ...)`, which is correct: there exists a counterexample. + +- **`CliqueFree 5`**: In Mathlib, `G.CliqueFree 5` means G has no clique of size 5, i.e., ω(G) ≤ 4. Steiner's counterexample has ω(G) = 4, which satisfies this condition. ✅ + +- **`cochromaticNumber G ≥ 4`**: The local definition uses `sInf` over `ℕ`. For finite graphs on `Fin n`, the set `{k | ∃ c : V → Fin k, IsCochromaticColouring G k c}` is nonempty (using k = n with distinct colors), so `sInf` is well-behaved. Steiner's counterexample has ζ(G) = 4 ≥ 4. ✅ + +- **`G.chromaticNumber ≤ cochromaticNumber G + 2`**: The LHS is `ℕ∞` (Mathlib's `chromaticNumber`) and the RHS is `ℕ` coerced to `ℕ∞`. For finite graphs, `chromaticNumber` is finite, so the coercion is sound. Steiner's counterexample has χ(G) = 7 > 6 = ζ(G) + 2, falsifying this inequality. ✅ + +- **Quantification over `(n : ℕ) (G : SimpleGraph (Fin n))`**: This ranges over all finite simple graphs, which is the correct domain for the conjecture. ✅ + +**No mathematical flaws detected. The formalization is correct and complete.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Significant duplication with 5 other files; shared utility exists but uses `ℕ∞` vs `ℕ` | +| Citations | Missing [ErGi93] reference that appears on the website | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/763.md b/ai-review/763.md new file mode 100644 index 0000000000..18dc7e2ede --- /dev/null +++ b/ai-review/763.md @@ -0,0 +1,76 @@ +# Review: Erdős Problem 763 + +## 1. Code Reuse + +**Issue found.** The file defines its own local `repCount` and `repSum` in the `Erdos763` namespace, but the codebase already provides `AdditiveCombinatorics.sumRep` in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`. This existing definition computes exactly the same quantity: + +- `sumRep A n = ((antidiagonal n).filter (fun p => p.1 ∈ A ∧ p.2 ∈ A)).card` (via `sumRep_def`) +- `repCount A n = ((range (n+1)).filter (fun a => a ∈ A ∧ (n-a) ∈ A)).card` + +These are provably equal since `Finset.antidiagonal n` bijects with `Finset.range (n+1)` via `(a, b) ↦ a` (with `b = n - a`). Problem 28 (`28.lean`) already uses `sumRep` from the library directly. Problem 763 should do the same, replacing the local `repCount`/`repSum` definitions with `sumRep` and a partial sum over it (or defining only `repSum` in terms of `sumRep`). + +Problem 764 has the same duplication issue with its `repCount764` definition, though that is a 3-fold convolution for which no library definition exists yet. + +## 2. Citations + +**Correct.** The docstring references [Er65b], [Er70c], [ErFu56], and [MoVa90], which match the citations on [erdosproblems.com/763](https://www.erdosproblems.com/763) exactly: + +- [Er65b] and [Er70c]: Erdős's original conjecture references +- [ErFu56]: Erdős and Fuchs, who proved the negative answer +- [MoVa90]: Montgomery and Vaughan, who improved the error bound + +No citations are missing or misattributed. + +## 3. Variants + +**Partially captured.** The formalization captures the core O(1) version of the problem (which is indeed the question as posed on the website). However, the docstring describes two stronger results that are not formalized: + +1. **Erdős–Fuchs strong form**: Even $\sum_{n \leq N} 1_A \ast 1_A(n) = cN + o(N^{1/4}/(\log N)^{1/2})$ is impossible. +2. **Montgomery–Vaughan improvement**: The error term cannot be $o(N^{1/4})$. + +These are quantitative strengthenings of the result and would be natural additional theorems. They are not strictly required since the O(1) version is the problem as originally stated, but formalizing at least the $o(N^{1/4})$ version would capture the state of the art. + +The website also notes that Problem 764 (3-fold convolution analogue) is related; this cross-reference is not mentioned in the Lean code or docstring of 763 (though 764's file does reference 763). + +## 4. Readability + +**Good, with minor improvements possible.** + +- The docstring is clear and well-written, explaining both the problem and its resolution. +- The local definitions are clearly documented. +- **Improvement**: If `sumRep` from the library were used, the code would be shorter and more consistent with other files (e.g., Problem 28). The `repSum` definition would remain (as a partial sum), but the redundant `repCount` would be eliminated. +- The theorem statement itself is clean and readable. + +## 5. Formalizability + +**Unambiguous.** The problem as stated on the website is entirely precise: + +- $A \subseteq \mathbb{N}$ is a set of natural numbers. +- $1_A \ast 1_A(n)$ is the standard additive representation function (number of ordered pairs $(a, b) \in A \times A$ with $a + b = n$). +- The question asks whether $\sum_{n \leq N} 1_A \ast 1_A(n) = cN + O(1)$ can hold for some $c > 0$. + +There is no ambiguity in the statement. The only minor convention choice is whether $\mathbb{N}$ includes 0 (Lean's convention) or starts at 1 (some number theory conventions), but this does not affect the truth of the theorem. + +## 6. Correctness + +**Correct.** The formalization faithfully captures the Erdős–Fuchs theorem: + +- `answer(False) ↔ ∃ A c C, ...` encodes that the existential is false, i.e., no such $A$, $c$, $C$ exist. This correctly represents the "disproved" status (the answer to "can there exist..." is no). +- `repCount A n` correctly counts ordered pairs $(a, n-a)$ with both in $A$, matching $1_A \ast 1_A(n)$. +- `repSum A N` correctly computes $\sum_{n=0}^{N} 1_A \ast 1_A(n)$ using `Finset.range (N + 1)` (i.e., summing over $\{0, 1, \ldots, N\}$), matching $\sum_{n \leq N}$. +- The constraint `c > 0` is correct; the Erdős–Fuchs theorem requires $c > 0$ (for $c = 0$, finite sets trivially satisfy the bound). +- The absolute value bound $|\text{repSum}(A, N) - cN| \leq C$ correctly captures the $O(1)$ error term. +- The coercion `↑(repSum A N)` from $\mathbb{N}$ to $\mathbb{R}$ is necessary for the subtraction and absolute value to make sense, and is handled correctly. + +**No mathematical flaws identified.** An experienced mathematician would find this formalization correct and complete for the basic form of the Erdős–Fuchs theorem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Should use `sumRep` from library** | +| Citations | **Correct and complete** | +| Variants | **Core version captured; stronger quantitative forms omitted** | +| Readability | **Good** | +| Formalizability | **Unambiguous** | +| Correctness | **Correct** | diff --git a/ai-review/764.md b/ai-review/764.md new file mode 100644 index 0000000000..5cba5d930f --- /dev/null +++ b/ai-review/764.md @@ -0,0 +1,77 @@ +# Review: Erdős Problem 764 + +## 1. Code Reuse + +**Partial issue.** The file defines `repCount764` (3-fold convolution) and `repSum764` locally. The codebase provides `AdditiveCombinatorics.sumConv` (with notation `∗`) and `sumRep` (for 2-fold convolution) in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`. While `sumRep` only handles the 2-fold case, `sumConv` is general: the 3-fold convolution $1_A \ast 1_A \ast 1_A$ could be expressed as `(𝟙_A ∗ 𝟙_A) ∗ 𝟙_A` using the existing `sumConv` operator, or equivalently `sumConv (sumRep A) 𝟙_A`. + +The current implementation uses a Cartesian product of `Finset.range` with a filter, which is mathematically equivalent but bypasses the shared infrastructure. Refactoring `repCount764` in terms of `sumConv` would: +- Be more consistent with other files (Problems 28, 40, 66, 749, 943 all use `sumRep`/`sumConv`). +- Better express the mathematical intent (iterated convolution). +- Reduce code duplication across the 763/764 pair. + +No existing `sumRep3` or general k-fold convolution exists in the library, but composition of `sumConv` suffices here. + +## 2. Citations + +**Correct.** The docstring references [Er65b], [Er70c], and [Va72]. The website [erdosproblems.com/764](https://www.erdosproblems.com/764) lists exactly these references: + +- [Er65b] and [Er70c]: Erdős's original conjecture +- [Va72]: Vaughan's disproof (1972) + +No citations are missing or misattributed. The cross-reference to Problem 763 is correctly mentioned in the docstring. + +## 3. Variants + +**Partially captured.** The formalization captures the core $O(1)$ version of the problem (matching the question as stated on the website). The docstring mentions Vaughan's stronger result but it is not formalized: + +1. **Vaughan's strong form**: Even $\sum_{n \leq N} 1_A \ast 1_A \ast 1_A(n) = cN + o(N^{1/4}/(\log N)^{1/2})$ is impossible. + +The website also notes that Vaughan's proof applies more generally to any $h$-fold convolution with different main terms permitted. Neither this generalization nor the quantitative strengthening is formalized. + +These are not strictly required since the $O(1)$ version is the problem as originally posed, but the stronger quantitative form would be a natural additional theorem. + +## 4. Readability + +**Good, with improvements possible.** + +- The docstring is clear, explaining the problem, its relationship to Problem 763, and the resolution. +- The definitions are well-documented with LaTeX in doc comments. +- **Improvement 1**: Using `sumConv` from the library would make the mathematical structure (iterated convolution) more apparent and reduce the definition to a one-liner. +- **Improvement 2**: The name `repCount764` includes the problem number, which is unusual compared to 763's `repCount`. If both used the shared `sumConv`, the naming issue would be moot. +- **Improvement 3**: The `repCount764` definition uses `Finset.range (n + 1) ×ˢ Finset.range (n + 1)` with a filter on `p.1 + p.2 ≤ n`, which is harder to parse than using `Finset.antidiagonal` or nested sums. A cleaner approach: iterate over triples $(a_1, a_2, a_3)$ with $a_1 + a_2 + a_3 = n$ directly, or compose two convolutions. + +## 5. Formalizability + +**Unambiguous.** The problem as stated on the website is entirely precise: + +- $A \subseteq \mathbb{N}$ is a set of natural numbers. +- $1_A \ast 1_A \ast 1_A(n)$ is the standard 3-fold additive convolution (number of ordered triples $(a_1, a_2, a_3) \in A^3$ with $a_1 + a_2 + a_3 = n$). +- The question asks whether $\sum_{n \leq N} 1_A \ast 1_A \ast 1_A(n) = cN + O(1)$ can hold for some $c > 0$. + +There is no ambiguity. The convention choice of whether $\mathbb{N}$ includes 0 does not affect the theorem's truth. + +## 6. Correctness + +**Correct.** The formalization faithfully captures Vaughan's theorem: + +- `answer(False) ↔ ∃ A c C, ...` encodes that the existential is false, i.e., no such $A$, $c$, $C$ exist. This correctly represents the "disproved" status. +- `repCount764 A n` counts the 3-fold representations correctly. The filter checks `p.1 + p.2 ≤ n` (so that `n - p.1 - p.2 ≥ 0` in ℕ), and then requires `p.1 ∈ A ∧ p.2 ∈ A ∧ (n - p.1 - p.2) ∈ A`. This correctly enumerates ordered triples $(a_1, a_2, a_3)$ with $a_1 + a_2 + a_3 = n$ and all three in $A$: for each valid pair $(a_1, a_2)$, $a_3 = n - a_1 - a_2$ is determined, and the constraint `p.1 + p.2 ≤ n` ensures $a_3 \geq 0$. +- `repSum764 A N` correctly computes $\sum_{n=0}^{N} 1_A \ast 1_A \ast 1_A(n)$ via `Finset.range (N + 1)`. +- The constraint `c > 0` is correct; for $c = 0$, finite sets would trivially satisfy the bound. +- The absolute value bound `|↑(repSum764 A N) - c * ↑N| ≤ C` correctly captures the $O(1)$ error term. +- The coercion from ℕ to ℝ is necessary and handled correctly. + +**One subtlety worth noting**: The `repCount764` definition iterates over ordered pairs $(a_1, a_2)$ with $a_3$ implicitly determined, which counts *ordered* triples. This is the correct interpretation of $1_A \ast 1_A \ast 1_A(n)$ (convolution counts ordered representations). The count is consistent with the iterated convolution `(𝟙_A ∗ 𝟙_A) ∗ 𝟙_A`, since `sumConv` uses `antidiagonal` which also counts ordered pairs. + +**No mathematical flaws identified.** An experienced mathematician would find this formalization correct and complete for the basic form of Vaughan's theorem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Should use `sumConv` from library** | +| Citations | **Correct and complete** | +| Variants | **Core version captured; Vaughan's quantitative strengthening omitted** | +| Readability | **Good; definition could be cleaner with library primitives** | +| Formalizability | **Unambiguous** | +| Correctness | **Correct** | diff --git a/ai-review/765.md b/ai-review/765.md new file mode 100644 index 0000000000..e6701b91cc --- /dev/null +++ b/ai-review/765.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 765 + +## 1. Code Reuse + +**Significant duplication exists.** The three core definitions — `cycleGraph`, `ContainsSubgraph`, and `extremalNumber` — are copy-pasted across many Erdős problem files: + +- `cycleGraph`: duplicated in 60, 86, 551, 552, 554, 556, 569, 666, 720, 737, 811, and more. +- `ContainsSubgraph`: duplicated in 60, 87, 146, 571, 766, 926, and more. +- `extremalNumber` / `turanNumber`: duplicated in 60, 87, 113, 146, 147, 180, 571, 572, 926, 1079, 1157, 1178. + +All implementations are functionally identical (some append a problem-number suffix like `cycleGraph60`). These should ideally be consolidated into a shared utility file under `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`. Note that `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` already exists and defines shared graph invariants — it would be a natural home for `cycleGraph`, `ContainsSubgraph`, and `extremalNumber`. + +Mathlib does not currently provide a `SimpleGraph.cycleGraph` definition, so the custom one is necessary. However, Mathlib does have `SimpleGraph.Subgraph` and graph homomorphism infrastructure that could potentially replace `ContainsSubgraph`, though the current injective-homomorphism formulation is clean and standard. + +## 2. Citations + +**Website (erdosproblems.com/765) states:** +- Erdős and Klein proved ex(n; C₄) ≍ n^{3/2}. +- Reiman established: 1/(2√2) ≤ lim[ex(n; C₄)/n^{3/2}] ≤ 1/2. +- Erdős–Rényi and independently Brown showed the lower bound for n = q² + q + 1. +- Füredi (1983) proved exact values for q > 13: ex(n; C₄) = (1/2)q(q+1)². +- Erdős proved: ex(n; C₄) ≤ n^{3/2}/2 + n/4 + O(n^{1/2}). +- Erdős conjectured: ex(n; C₄) = n^{3/2}/2 + n/4 + O(n^{1/2}). +- Ma–Yang (2023) disproved the stronger conjecture (showing the n/4 term is wrong). + +**Docstring references:** +- `[Er93]` Erdős, P., *On some of my favourite theorems* — present and correct. +- `[MaYa23]` Ma, J. and Yang, T., *On the extremal number of subdivisions* — present and correct. + +**Missing from docstring:** +- Füredi's 1983 result is not mentioned in the docstring. The website attributes exact values for prime-power orders to Füredi, which is a significant result in the history of this problem. +- The website also attributes the upper bound ex(n; C₄) ≤ n^{3/2}/2 + n/4 + O(n^{1/2}) to Erdős specifically, and notes the stronger conjecture with n/4 as the second-order term. The docstring mentions this conjecture was disproved but does not state the conjecture precisely (n/4 second-order term). The phrase "His even stronger conjecture with n/4 second-order term" is somewhat vague. +- The `[Er90]` reference that appears on the website (and in problem 60) is not included here, though it may not be directly relevant. + +## 3. Variants + +**Captured:** +1. `erdos_765` (solved): The asymptotic formula ex(n; C₄) ~ (1/2)n^{3/2}. ✓ +2. `erdos_765.variants.refined` (open): ex(n; C₄) = n^{3/2}/2 + O(n). ✓ + +**Not captured:** +- The **stronger conjecture** ex(n; C₄) = n^{3/2}/2 + n/4 + O(n^{1/2}) that was disproved by Ma–Yang. While the docstring mentions it was disproved, formalizing it (tagged as `disproved`) would be valuable for completeness. The website specifically highlights this. +- **Füredi's exact result** for prime-power orders: ex(n; C₄) = (1/2)q(q+1)² when n = q² + q + 1 and q > 13. This is a concrete, formalizable result that could be a variant. + +## 4. Readability + +The code is generally well-structured and readable. A few observations: + +- **Good:** The docstrings clearly state the informal mathematics and then provide a "Formally:" translation. +- **Good:** The namespace `Erdos765` keeps definitions scoped. +- **Minor:** The exponent `(3 : ℝ) / 2` in the theorem statement is slightly verbose. An alternative would be defining a local notation or using `Real.sqrt`, but the current form is standard in this codebase. +- **Minor:** The `by omega` proof for `4 ≥ 3` is fine but could be documented once for readers unfamiliar with it. +- **Good:** The use of `ncard` (which works for potentially infinite sets) rather than `card` (which requires `Fintype`) is a reasonable choice, though for `SimpleGraph (Fin n)` the edge set is always finite, so `Finset.card` via `edgeFinset` would also work and might be more natural. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem "give an asymptotic formula for ex(n; C₄)" is inherently somewhat informal — "give an asymptotic formula" could mean different levels of precision. However, the formalization correctly interprets this as the well-established result ex(n; C₄) ~ (1/2)n^{3/2}, which is the standard resolution. + +The asymptotic statement is formalized as: +> For every ε > 0, there exists N₀ such that for all n ≥ N₀, |ex(n; C₄)/n^{3/2} - 1/2| < ε. + +This is a precise and correct formalization of f(n) ~ (1/2)n^{3/2}. The refined variant (O(n) error term) is also precisely stated using the standard big-O formalization (existence of a constant C). + +**One subtlety:** The `extremalNumber` definition uses `sSup` over natural numbers. For `sSup` to be well-behaved in `ℕ` (which has a `ConditionallyCompleteLattice` instance with `sSup ∅ = 0`), the set should be nonempty and bounded above. The set is nonempty (the empty graph has 0 edges and contains no C₄) and bounded above (at most n(n-1)/2 edges). However, these facts are not proved — they would need to be established during any proof of the theorems. This is standard practice for formalization and not a defect. + +## 6. Correctness + +**Main theorem (`erdos_765`) — Correct.** The formalization accurately captures ex(n; C₄) ~ (1/2)n^{3/2}. The ε-N₀ formulation is the standard definition of asymptotic equivalence for the ratio ex(n; C₄)/n^{3/2} → 1/2. The problem is correctly tagged as `solved`. + +**Refined variant (`erdos_765.variants.refined`) — Mostly correct, with caveats:** + +- The formalization states ∃ C > 0, ∀ n ≥ 1, |ex(n; C₄) - n^{3/2}/2| ≤ C·n. +- This is a correct formalization of ex(n; C₄) = n^{3/2}/2 + O(n). +- Tagged as `open`, which is correct — Ma–Yang disproved the stronger conjecture (with n/4 second-order term) but the weaker O(n) version remains open. +- **Potential issue:** The bound is stated for *all* n ≥ 1, including small n. In asymptotic number theory, O(n) bounds typically hold for "sufficiently large n." Requiring the bound from n = 1 technically makes the statement slightly stronger (the constant C must absorb small-n behavior). In practice this is fine since a sufficiently large C can handle finitely many small cases, but it's worth noting. + +**`cycleGraph` definition — Correct.** The adjacency relation correctly captures the cycle: vertex i is adjacent to vertex j iff j = (i+1) mod m or i = (j+1) mod m, with i ≠ j. The symmetry and irreflexivity proofs are correct. + +**`ContainsSubgraph` definition — Correct.** This defines subgraph containment via injective homomorphism (injective function preserving adjacency in one direction), which is the standard notion of subgraph isomorphism used in Turán-type extremal graph theory. + +**`extremalNumber` definition — Correct.** This defines ex(n; H) as the supremum of edge counts over H-free graphs on n vertices, which is the standard definition. + +**Overall mathematical correctness: Sound.** No mathematical errors identified. The formalization faithfully captures the known results and open problems. + +## Summary + +| Category | Assessment | +|---|---| +| Code Reuse | ⚠️ High duplication of `cycleGraph`, `ContainsSubgraph`, `extremalNumber` across many files | +| Citations | ✅ Core references present; Füredi (1983) missing | +| Variants | ⚠️ Main result and O(n) refinement captured; disproved n/4 conjecture and Füredi exact result not formalized | +| Readability | ✅ Clean, well-documented | +| Formalizability | ✅ High; low ambiguity | +| Correctness | ✅ Mathematically sound | diff --git a/ai-review/766.md b/ai-review/766.md new file mode 100644 index 0000000000..51df098f07 --- /dev/null +++ b/ai-review/766.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 766 + +## 1. Code Reuse + +**Significant duplication found.** The definitions `ContainsSubgraph` and `extremalNumber` are duplicated verbatim across at least 7 files: +- `ErdosProblems/571.lean` +- `ErdosProblems/572.lean` +- `ErdosProblems/713.lean` +- `ErdosProblems/714.lean` +- `ErdosProblems/765.lean` +- `ErdosProblems/766.lean` +- `ErdosProblems/60.lean` (as `ContainsSubgraph60` / `extremalNumber60`) + +These should be factored into a shared utility file (e.g., `ForMathlib/Combinatorics/SimpleGraph/ExtremalNumber.lean`). The `minExtremalNumber` definition is unique to Problem 766 and appropriately defined locally. + +## 2. Citations + +The website lists the original source as **[Er64c]**. The formalization's docstring only links to `erdosproblems.com/766` and does not cite the original paper. The citation should be added: + +> [Er64c] Erdős, P. (1964). + +The Dirac–Erdős result mentioned in the docstring is accurately described and matches the website's statement. + +## 3. Variants + +The problem on erdosproblems.com has two parts: +1. **"Give good estimates for f(n;k,l)"** — This is an open-ended request for bounds, not a precise conjecture. It is inherently not formalizable as a single theorem and is reasonably omitted. +2. **"Is f(n;k,l) a strictly monotone function of l?"** — This is formalized as `erdos_766`. + +Additionally, the known **Dirac–Erdős result** is captured as `erdos_766.variants.dirac_erdos`. This is appropriate. + +**All formalizable variants are captured.** + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The docstrings clearly state the mathematical content with LaTeX. +- The namespace `Erdos766` is clean and appropriately scoped. +- The definition names (`ContainsSubgraph`, `extremalNumber`, `minExtremalNumber`) are descriptive. +- The formal statement of `erdos_766` includes a helpful English gloss in the docstring explaining the quantifier structure. + +**No readability issues.** + +## 5. Formalizability + +**Part 1** ("give good estimates") is too vague to formalize — it asks for asymptotic bounds without specifying what "good" means. Omitting it is correct. + +**Part 2** (strict monotonicity) is unambiguous and precisely formalizable. The formalization interprets "for large n" as "there exists N₀ such that for all n ≥ N₀," which is the standard mathematical reading. The range "k < l ≤ k²/4" is encoded correctly using natural number arithmetic (`k < l`, `4 * l' ≤ k ^ 2`). + +**Ambiguity assessment: Low.** The monotonicity question is precise. The only interpretive choice is whether "strictly monotone" means pointwise for each pair (l, l') with a potentially different N₀, or uniformly with a single N₀ for all pairs. The formalization uses a **per-pair N₀** (N₀ depends on k, l, l'), which is the weaker (more likely true) interpretation. This is a reasonable default, though the stronger uniform version could also be considered as a variant. + +## 6. Correctness + +### Main theorem (`erdos_766`) + +The formalization is **mathematically correct**. Detailed analysis: + +- **`ContainsSubgraph`**: Correctly defines subgraph containment via injective homomorphism (i.e., subgraph isomorphism to a subgraph of G). This is the standard definition in extremal graph theory. + +- **`extremalNumber`**: Uses `sSup` over edge counts of H-free graphs on `Fin n`. The set is always non-empty (the edgeless graph is H-free for any H with edges) and bounded above (at most n(n-1)/2 edges), so `sSup` is well-defined and yields the correct value. In the degenerate case where H is edgeless, every graph "contains" H vacuously, making the set empty and `sSup = 0`; this is irrelevant here since l > k ≥ 2 forces H to have edges. + +- **`minExtremalNumber`**: Uses `sInf` over extremal numbers. **Potential edge case**: if no graph on k vertices has exactly l edges (e.g., l > k(k-1)/2), the set is empty and `sInf ∅ = 0` for ℕ. However, the hypotheses `k < l` and `4 * l' ≤ k ^ 2` ensure l < l' ≤ k²/4 ≤ k(k-1)/2 for k ≥ 2, so graphs with the required edge counts exist. The formalization is correct within its stated range. + +- **Quantifier structure**: `∀ k l l', k ≥ 2 → k < l → l < l' → 4 * l' ≤ k² → ∃ N₀, ∀ n ≥ N₀, f(n;k,l) < f(n;k,l')`. This correctly captures strict monotonicity for large n. + +- **`answer(sorry)` wrapper**: Standard pattern for open problems where the answer is unknown. + +### Dirac–Erdős variant (`erdos_766.variants.dirac_erdos`) + +**Mathematically correct but with a trivial edge case.** The statement asserts `minExtremalNumber n k (k^2/4 + 1) ≤ n^2/4 + 1` for all k ≥ 2 and all n. + +- For k ≥ 4, l = ⌊k²/4⌋ + 1 > k, so graphs with this many edges exist and the statement is substantive. +- For k = 2: l = 2 but max edges on 2 vertices is 1, so no graph exists, `sInf ∅ = 0`, and the bound holds trivially (0 ≤ n²/4 + 1). +- For k = 3: l = 3 = k, and a triangle K₃ has 3 edges on 3 vertices, so graphs exist. ex(n; K₃) = ⌊n²/4⌋ (Turán's theorem), so minExtremalNumber = ⌊n²/4⌋ ≤ ⌊n²/4⌋ + 1. Correct. + +The small-k cases are technically correct (if trivial). Adding a hypothesis `k ≥ 4` would make the theorem non-vacuous, but the current formulation is not wrong. + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `ContainsSubgraph` and `extremalNumber` duplicated across 7 files; should be shared | +| Citations | Missing [Er64c] reference from original source | +| Variants | All formalizable variants captured | +| Readability | Good | +| Formalizability | Low ambiguity; monotonicity question is precise | +| Correctness | Correct; minor trivial edge cases in Dirac–Erdős variant for k < 4 | diff --git a/ai-review/767.md b/ai-review/767.md new file mode 100644 index 0000000000..2d72f029e7 --- /dev/null +++ b/ai-review/767.md @@ -0,0 +1,98 @@ +# Review: Erdős Problem 767 + +## 1. Code Reuse + +**Extremal number pattern:** The `maxEdgesAvoidingCycleChords` definition (lines 56–58) follows the exact same `sSup {e : ℕ | ∃ G : SimpleGraph (Fin n), ¬Property G ∧ G.edgeSet.ncard = e}` pattern used in at least six other files: +- `extremalNumber` in 765.lean (line 55), 766.lean (line 44), 714.lean (line 37), 713.lean (line 39) +- `exC3C4` in 573.lean (line 51) +- `maxEdgesNoEdgeDisjointCycles` in 585.lean (line 56) + +However, 767's forbidden structure is a *property* of graphs (containing a cycle with k chords incident to a vertex), not containment of a fixed subgraph, so the `extremalNumber` from 765 (which takes a specific graph H) cannot be directly reused. The current standalone definition is appropriate. + +**Cycle representation:** The injective `f : Fin m → V` with modular adjacency `G.Adj (f i) (f ⟨(i.val + 1) % m, ...⟩)` is essentially identical to the cycle encodings in: +- Problem 81 (`HasInducedCycle`, line 41) +- Problem 574 (`ContainsCycleOfLength`, line 38) +- Problem 1091 (`HasOddCycleWithDiagonals`, line 41) + +A shared cycle definition could reduce duplication, but this is a codebase-wide concern, not specific to 767. + +**Chord/diagonal counting:** The chord-counting logic in `HasCycleWithKChords` is closely related to the diagonal counting in Problem 1091 (lines 46–50). Problem 1091 counts *all* diagonals across all pairs of cycle vertices, while 767 counts chords incident to a *specific* vertex. Problem 642's `numChords` (line 53) takes yet another approach using `Walk`-based edge filtering. No existing definition can be directly reused for 767's per-vertex chord count. + +**Verdict:** No direct reuse opportunity. The patterns are shared but the specifics differ meaningfully. + +## 2. Citations + +The formalization's docstring mentions: +- Czipszer (bound g_k(n) ≤ (k+1)n) — ✅ matches website +- Pósa (g_1(n) = 2n−4 for n ≥ 4) — ✅ matches website +- Jiang [Ji04] (proved equality for n ≥ 3k+3) — ✅ matches website + +**Missing from formalization but present on the website:** +- Erdős noted the lower bound g_k(n) ≥ (k+1)n − (k+1)² is "easy to see" +- Erdős verified the conjecture for k = 2, 3 when n ≥ 2k + 2 +- Lewin reportedly disproved the conjecture for general k (cited in Erdős 1969b), though there is uncertainty about whether this applied only to small n or was incorrect + +The Lewin claim is historically notable and could merit a comment in the docstring, even if just as a caveat. The Erdős partial results for k = 2, 3 are also worth noting for completeness. + +## 3. Variants + +The formalization captures only the main asymptotic result. Potential variants not formalized: + +1. **Pósa's exact result** (mentioned in docstring but not formalized): `g_1(n) = 2n − 4` for `n ≥ 4`. This is a concrete, verifiable special case and would make a natural variant theorem. + +2. **Czipszer's upper bound** (mentioned in docstring but not formalized): `g_k(n) ≤ (k+1)n` for all k. This is a clean, standalone inequality. + +3. **Erdős's lower bound**: `g_k(n) ≥ (k+1)n − (k+1)²`, described as "easy to see." Could be a variant or lemma. + +4. **Jiang's precise threshold**: The formalization uses `∃ N₀` (existential), but Jiang proved equality for `n ≥ 3k + 3` specifically. A variant with the explicit bound `N₀ = 3k + 3` would be more precise. + +At minimum, the Pósa and Czipszer results would be straightforward and valuable variants. + +## 4. Readability + +**Generally good.** The docstrings clearly explain the mathematical content and the definitions are well-structured. + +Minor observations: +- The `HasCycleWithKChords` definition uses `Set.ncard` on a `Set (Fin m)`, while the analogous Problem 1091 uses `Finset.univ.filter ... .card`. The `Finset` approach is arguably more idiomatic for finite types and avoids reliance on `Set.ncard`'s behavior on infinite sets (moot here, but a style inconsistency). +- The nested existential in `HasCycleWithKChords` (∃ m, ∃ hm, ∃ f, ... ∧ ∃ i₀, ...) is somewhat deep but acceptable for this kind of definition. +- The predecessor modular arithmetic `(i₀.val + m - 1) % m` is correct but slightly less transparent than a hypothetical `(i₀.val - 1 + m) % m` — though both are equivalent and the current form avoids subtraction on ℕ. This is fine. + +## 5. Formalizability + +**High.** The problem is precise and unambiguous once the key terms are pinned down: +- "Cycle" = simple cycle (injective vertex sequence with cyclic adjacency) +- "Chord incident to a vertex" = edge from a cycle vertex to a non-adjacent cycle vertex +- "k chords incident to a vertex" = at least k such chords sharing a common endpoint + +The only potential ambiguity is whether "k chords" means *exactly k* or *at least k*. The formalization uses *at least k* (via `k ≤ Set.ncard ...`), which is the standard extremal interpretation: g_k(n) is the max edges avoiding having any cycle with ≥ k chords at a single vertex. This is consistent with the known results (Pósa's g_1(n) = 2n−4 checks out under this interpretation). **No meaningful ambiguity.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +**`HasCycleWithKChords` (lines 43–52):** +- Cycle encoding: `m ≥ 3`, injective `f : Fin m → V`, consecutive adjacency via modular arithmetic. ✅ +- Chord set for vertex `f(i₀)`: filters `j : Fin m` with `j ≠ i₀` (not self), `j.val ≠ (i₀.val + 1) % m` (not successor), `j.val ≠ (i₀.val + m - 1) % m` (not predecessor), and `G.Adj (f i₀) (f j)`. This correctly identifies non-cycle-neighbor vertices adjacent to `f(i₀)`, i.e., chords incident to `f(i₀)`. ✅ +- Edge case m = 3: every vertex has exactly 2 cycle-neighbors, so 0 non-neighbors on the cycle, so 0 chords. Triangles never trigger the condition. ✅ + +**`maxEdgesAvoidingCycleChords` (lines 56–58):** +- Uses `sSup` on `{e : ℕ | ...}`. The set is nonempty (the empty graph contributes `e = 0`) and bounded above (at most `n*(n-1)/2` edges), so `sSup` on `ℕ` (with `ConditionallyCompleteLinearOrderBot`) returns the correct maximum. ✅ + +**`erdos_767` (lines 66–69):** +- States: for all `k ≥ 1`, ∃ `N₀` such that for `n ≥ N₀`, `g_k(n) = (k+1)n − (k+1)²`. +- The subtraction is on `ℕ`. For `n ≥ k+1`, we have `(k+1)*n ≥ (k+1)²`, so truncation does not occur. Since `N₀` is existentially quantified, it can be chosen large enough. ✅ +- The `answer(True)` wrapper correctly reflects that the problem is proved (affirmatively). ✅ +- The existential `∃ N₀` is slightly weaker than Jiang's explicit `N₀ = 3k + 3`, but is still a correct statement. ✅ + +**No mathematical errors identified.** The formalization is a faithful and correct encoding of the problem as stated on the website and in the literature. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No direct reuse available; patterns shared but specifics differ | +| Citations | Mostly complete; missing Lewin controversy and Erdős partial results | +| Variants | Main result only; Pósa and Czipszer results are natural missing variants | +| Readability | Good; minor style inconsistency (Set.ncard vs Finset.card) | +| Formalizability | High; no meaningful ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/768.md b/ai-review/768.md new file mode 100644 index 0000000000..cb39c2e277 --- /dev/null +++ b/ai-review/768.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 768 + +## 1. Code Reuse + +**Counting function duplication.** The `countA` function (line 41–42) duplicates the generic `countSat` already defined in Problem 696 (`FormalConjectures/ErdosProblems/696.lean:51`): + +```lean +noncomputable def countSat (P : ℕ → Prop) (N : ℕ) : ℕ := + ((Finset.range N).filter (fun n => P (n + 1))).card +``` + +`countA N` is exactly `countSat InSetA N`. If `countSat` were promoted to a shared utility (or imported from 696), the counting definition could be eliminated. Several other Erdős problems use the same `(Finset.range N).filter (fun n => P (n + 1))).card` pattern, suggesting this is a good candidate for a shared definition. + +**Asymptotic form.** Problem 202 (`FormalConjectures/ErdosProblems/202.lean:67`) and Problem 962 both use `exp(√(log N · log log N))`-type expressions. However, Problem 768's expression is `√(log N) · log log N` (note: square root of log N alone, multiplied by log log N), which is a genuinely different expression. No direct reuse opportunity for the asymptotic formula itself. + +## 2. Citations + +The formalization references `[Er74b]` in both the module docstring (line 28) and the theorem docstring (line 45). The website at erdosproblems.com/768 lists the same reference: + +> [Er74b] Erdős, P., *Problems and results on combinatorial number theory*. + +The citation matches. However, the website also provides additional context that could enrich the docstring: + +- **Motivation:** Erdős investigated this because |A ∩ [1,N]| provides an upper bound for counting integers n ≤ N admitting non-cyclic simple groups of order n. +- **Known bounds (by Erdős):** + - Lower: |A ∩ [1,N]|/N ≥ exp(−c√(log N) log log N) + - Upper: |A ∩ [1,N]|/N ≤ exp(−(1+o(1))√(log N log log N)) +- **Related OEIS sequences:** A001034, A352287. + +None of these are strictly required, but the motivation regarding simple groups provides valuable mathematical context. + +## 3. Variants + +The main conjecture is captured. No alternative variants are listed on the website. The known partial results (Erdős's upper and lower bounds) could be formalized as separate theorems but are results rather than conjecture variants. The formalization is complete with respect to the problem as stated. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The `InSetA` definition (line 37–38) is clear and has a good docstring. +- The `countA` function (line 41–42) is straightforward. +- The theorem docstring (lines 44–51) helpfully includes both the original mathematical statement and a description of how it was formalized, which is excellent practice. +- The formalized statement (lines 55–60) is readable and follows the standard pattern for asymptotic density problems in this codebase. + +No readability issues. + +## 5. Formalizability + +**Assessment: Clearly formalizable, with one standard subtlety handled well.** + +The original problem asks whether there exists c > 0 such that: + +|A ∩ [1,N]| / N = exp(−(c + o(1)) √(log N) · log log N) + +The o(1) notation is inherently informal. The formalization correctly interprets this as: + +−log(|A ∩ [1,N]| / N) / (√(log N) · log(log N)) → c as N → ∞ + +This is the standard and mathematically equivalent reformulation. The derivation is: + +1. Take −log of both sides: −log(|A ∩ [1,N]|/N) = (c + o(1)) · √(log N) · log log N +2. Divide by √(log N) · log log N: the left side tends to c. + +**Ambiguity level: Low.** The set A is precisely defined, and the asymptotic question has a unique standard interpretation. The only minor question is whether the problem allows c to depend on the formalization of o(1), but the limit formulation resolves this unambiguously. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed verification: + +- **`InSetA` (line 37–38):** Correctly captures "for every prime p | n, there exists d > 1 with d | n and d ≡ 1 (mod p)." The use of `d % p = 1` for natural numbers is correct since d, p > 0. The condition `d > 1` correctly excludes the trivial divisor d = 1 (which always satisfies d ≡ 1 mod p). The quantification over all primes p dividing n matches the problem statement. + +- **`countA` (line 41–42):** `Finset.range N` gives {0, ..., N−1}, and `fun n => InSetA (n + 1)` shifts to test {1, ..., N}. So `countA N` = |A ∩ [1, N]|. Correct. + +- **Edge case n = 1:** No primes divide 1, so `InSetA 1` holds vacuously. This is mathematically correct — 1 is conventionally included in the set A. + +- **Asymptotic statement (lines 55–60):** The expression `-Real.log ((countA N : ℝ) / (N : ℝ)) / (Real.sqrt (Real.log (N : ℝ)) * Real.log (Real.log (N : ℝ)))` correctly encodes −log(|A ∩ [1,N]|/N) / (√(log N) · log(log N)). The Tendsto to `nhds c` correctly captures convergence to c. + +- **The `answer(sorry)` wrapper** is appropriate since the problem is open and the truth value of the conjecture is unknown. + +- **Potential technical concern:** For small N (e.g., N = 0 or N = 1), the expression involves division by zero or log of non-positive numbers. However, since the Tendsto is along `atTop`, only the eventual behavior matters, and for sufficiently large N the denominator is positive and countA N / N ∈ (0, 1]. This is not a flaw. + +**Verdict: No mathematical errors found. The formalization is faithful to the problem statement.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | `countA` duplicates generic `countSat` from Problem 696 | +| Citations | [Er74b] matches website; motivation re: simple groups could be added | +| Variants | Complete — no missing variants | +| Readability | Clean, well-documented | +| Formalizability | Low ambiguity; standard o(1) → limit reformulation | +| Correctness | **Correct and complete** | diff --git a/ai-review/769.md b/ai-review/769.md new file mode 100644 index 0000000000..21eb0e0de4 --- /dev/null +++ b/ai-review/769.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 769 + +## 1. Code Reuse + +The file defines three custom geometric primitives (`unitCube`, `axisCube`, `axisCubeInterior`) and a decomposition predicate (`CanDecomposeUnitCube`) from scratch. These could be expressed more idiomatically using Mathlib: + +- **`unitCube n`** is equivalent to `Set.pi Set.univ (fun _ => Set.Icc 0 1)`. Using `Set.pi`/`Set.Icc` would provide access to a large library of existing lemmas (e.g., measurability, compactness, membership simp lemmas). +- **`axisCube corner s`** is equivalent to `Set.pi Set.univ (fun i => Set.Icc (corner i) (corner i + s))`. +- **`axisCubeInterior corner s`** is equivalent to `Set.pi Set.univ (fun i => Set.Ioo (corner i) (corner i + s))`, or alternatively `interior (axisCube corner s)` if the closed version uses `Set.pi`/`Set.Icc` (since `interior` of a product of closed intervals is the product of open intervals in finite dimensions). + +No other file in the codebase defines reusable n-dimensional cube or box decomposition infrastructure. `ErdosProblems/106.lean` has a related 2D square placement structure with rotations, but it is not directly applicable here. `BoxIntegral.Box` from Mathlib could also serve as an alternative representation but may be less convenient. + +**Recommendation:** Replace the three custom definitions with `Set.pi`/`Set.Icc`/`Set.Ioo` formulations to leverage Mathlib's existing API. + +## 2. Citations + +The formalization includes: +- `[Er74b]` — Burgess, D.A. and Erdős, P., *on a problem in combinatorial geometry*, 1974. +- `[CoMa18]` — Connor, S. and Marmorino, M., *on cube decompositions*, 2018. + +The [erdosproblems.com/769](https://www.erdosproblems.com/769) page additionally references: +- **Hadwiger** (mentioned as initiating the investigation; no explicit citation key given). +- **Hudelson (1998)** — who proved `c(n) < 6^n` when `(2^n − 1, 3^n − 1) = 1` and generally `c(n) ≪ (2n)^{n−1}`. + +The Hadwiger reference is already mentioned in the docstring prose ("A problem first investigated by Hadwiger, who proved $c(n) \geq 2^n + 2^{n-1}$"), which matches the website. However, no Hudelson citation is included. + +**Recommendation:** Add a reference line for Hudelson (1998) if the project aims for completeness of citations present on the website. + +## 3. Variants + +The website describes several known bounds and sub-results: + +| Result | Captured? | +|--------|-----------| +| Core question: $c(n) \gg n^n$? | ✅ Yes (the main theorem) | +| Hadwiger's lower bound $c(n) \geq 2^n + 2^{n-1}$ | ❌ Not formalized as a separate statement | +| Connor–Marmorino improvement $c(n) \geq 2^{n+1} - 1$ for $n \geq 3$ | ❌ Not formalized | +| Burgess–Erdős upper bound $c(n) \ll n^{n+1}$ | ❌ Not formalized | +| $c(2) = 6$ | ❌ Not formalized | +| $c(3) = 48$ (conjectured) | ❌ Not formalized | + +The formalization captures only the central asymptotic question. The known concrete bounds (which are provable results, not conjectures) and the specific values could be formalized as separate lemmas. + +**Assessment:** The main conjecture is captured. The omission of known bounds is acceptable for a conjecture file, though formalizing Hadwiger's bound as a companion lemma would add value since it is a proven result. + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings with LaTeX math. +- Logical separation of definitions (cube, interior, decomposition predicate, main theorem). +- The `CanDecomposeUnitCube` predicate cleanly separates its four conditions: positivity, containment, coverage, and disjoint interiors. + +Minor suggestions: +- The main theorem's inline docstring could be slightly clearer about what `answer(sorry)` represents (i.e., that the conjecture is that the answer is "yes"). +- The name `CanDecomposeUnitCube` is descriptive and good. + +**Assessment:** Readability is good. No significant issues. + +## 5. Formalizability + +The original problem asks: "Is it true that $c(n) \gg n^n$?" where $c(n)$ is defined as the minimal $k_0$ such that for all $k \geq k_0$, the unit $n$-cube can be decomposed into $k$ homothetic cubes. + +This is a precisely stated yes/no question. The key terms are all well-defined: +- "Decomposed into $k$ homothetic cubes" — a standard concept: partition the unit cube into $k$ smaller axis-aligned cubes with pairwise disjoint interiors. +- "$c(n) \gg n^n$" — standard Vinogradov notation meaning $\exists C > 0, \exists N_0, \forall n \geq N_0: c(n) \geq C \cdot n^n$. + +The only minor subtlety is whether "homothetic" means axis-aligned (yes — a homothety of the unit cube is always axis-aligned since it is $x \mapsto \lambda x + b$, which preserves axis-alignment for the unit cube). + +**Assessment:** The problem is unambiguously formalizable. Ambiguity level: **very low**. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +### Definition correctness + +- **`unitCube`**: Correctly defines $[0,1]^n$ as the set of functions $x : \text{Fin}\, n \to \mathbb{R}$ with $0 \leq x_i \leq 1$. +- **`axisCube`**: Correctly defines a closed axis-aligned cube $\prod_i [\text{corner}_i, \text{corner}_i + s]$. +- **`axisCubeInterior`**: Correctly defines the open interior $\prod_i (\text{corner}_i, \text{corner}_i + s)$. +- **`CanDecomposeUnitCube`**: The four conditions (positive side lengths, containment in unit cube, coverage of unit cube, pairwise disjoint interiors) correctly characterize a decomposition of the closed unit cube into $k$ smaller closed cubes. + +### Theorem statement correctness + +The statement: +``` +∃ C : ℝ, C > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∀ m : ℕ, (∀ k : ℕ, k ≥ m → CanDecomposeUnitCube n k) → + (m : ℝ) ≥ C * (n : ℝ) ^ n +``` + +This avoids explicitly defining $c(n)$ and instead universally quantifies over all $m$ satisfying the threshold property. Since $c(n)$ is the *minimum* such $m$, and any valid $m$ satisfies $m \geq c(n)$, requiring all such $m \geq C \cdot n^n$ is equivalent to requiring $c(n) \geq C \cdot n^n$. This is a clean and correct encoding. + +**Edge case:** If for some $n$ no finite $c(n)$ exists (i.e., for every $m$ there exists $k \geq m$ where decomposition fails), then the hypothesis `∀ k ≥ m, CanDecomposeUnitCube n k` is never satisfied and the implication is vacuously true. This is mathematically sound — if $c(n) = \infty$, then $c(n) \gg n^n$ trivially. + +**Edge case (n = 0):** When $n = 0$, the unit cube is a single point, and $n^n = 0^0 = 1$ in the Lean convention. The $N_0$ threshold handles this gracefully. + +### `answer(sorry)` wrapper + +The conjecture is wrapped in `answer(sorry) ↔ ...`, which is the standard pattern for open yes/no problems in this codebase. The conjecture asks whether the answer is "yes" (i.e., whether $c(n) \gg n^n$ holds). Given that the best known upper bound is $c(n) \leq e^2 n^n$ (Connor–Marmorino) and the best lower bound is $c(n) \geq 2^{n+1} - 1$, the question remains genuinely open. + +**Assessment:** The formalization is correct and complete. No mathematical flaws identified. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | ⚠️ Could use `Set.pi`/`Set.Icc` from Mathlib | +| Citations | ⚠️ Missing Hudelson (1998) reference | +| Variants | ✅ Main conjecture captured; known bounds not formalized (acceptable) | +| Readability | ✅ Good | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Correct and complete | diff --git a/ai-review/77.md b/ai-review/77.md new file mode 100644 index 0000000000..3b7a38a85d --- /dev/null +++ b/ai-review/77.md @@ -0,0 +1,131 @@ +# AI Review: Erdős Problem 77 + +## 1. Code Reuse + +**Issue: Duplicate diagonal Ramsey number definition.** + +Problem 77 defines its own `diagonalRamseyNumber` from scratch using a raw coloring function `c : Fin N → Fin N → Bool`. However, Problem 87 (`FormalConjectures/ErdosProblems/87.lean:50-51`) already defines `diagRamsey` via the more idiomatic `SimpleGraph`-based approach: + +```lean +noncomputable def diagRamsey (k : ℕ) : ℕ := + graphRamseyNumber (⊤ : SimpleGraph (Fin k)) +``` + +This is built on top of `graphRamseyNumber` (line 45) and `ContainsSubgraph` (line 38), which work with Mathlib's `SimpleGraph` infrastructure. This definition is cleaner, more composable, and consistent with the rest of the Erdős problem formalizations (Problems 87, 546, 547, 549, 800 all use `SimpleGraph`-based Ramsey definitions). + +Additionally, `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey r n`, the r-uniform hypergraph Ramsey number. The classical diagonal Ramsey number R(k) is `hypergraphRamsey 2 k` (the 2-uniform, i.e. graph, case). This shared library definition could also be leveraged. + +**Recommendation:** Replace `Erdos77.diagonalRamseyNumber` with either `Erdos87.diagRamsey` (most directly equivalent) or show the relationship to `Combinatorics.hypergraphRamsey 2 k`. This would reduce duplication and improve consistency across the codebase. + +## 2. Citations + +**Issue: Incomplete citations and incorrect prize amount.** + +The formalization's docstring states: +> Erdős offered \$250 for solving this problem. + +The website (erdosproblems.com/77) gives a more nuanced prize structure: +- **\$100** for proving the limit exists (without determining its value). +- **\$1,000** for proving the limit does not exist (Erdős called this "really a joke"). +- **\$10,000** (updated in [Er88]) for non-existence. + +No \$250 prize is mentioned on the website. This appears to be an error. + +**Missing references.** The website lists the following references not included in the docstring: +- [Er61], [Er69b], [Er71], [Er81], [Er88], [Er90b], [Er93], [Er95], [Er97c], [Er97d], [Va99] +- [BBCGHMST24] Balister, Bollobás, Campos, Griffiths, Hurley, Morris, Sahasrabudhe, Tiba — simplified proof of the 4 − c bound. + +**Missing contextual information.** The website records Erdős's speculation that the limit is "perhaps 2 but we have no real evidence for this" ([Er93]). This is relevant context for the problem. + +**Missing related problems.** The website links to related problems #1029 (lower bounds on R(k)) and #627 (related limits). + +**Recommendation:** Correct the prize amount, add the [BBCGHMST24] reference, note Erdős's conjecture that the limit may be 2, and mention related problems. + +## 3. Variants + +**Issue: Key variant not captured.** + +The formalization only captures one statement: that the limit exists and equals some value. The website makes clear there are at least two distinct sub-problems: + +1. **Existence variant:** Prove that lim R(k)^{1/k} exists (i.e., lim inf = lim sup). This is worth \$100 separately from determining the value. +2. **Non-existence variant:** Prove that the limit does not exist (lim inf < lim sup). Worth \$1,000–\$10,000. + +A more complete formalization would include: + +```lean +-- Variant: the limit exists +theorem erdos_77.variants.limit_exists : + ∃ L : ℝ, Tendsto (fun k : ℕ => + (diagonalRamseyNumber k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by sorry + +-- Variant: the limit does not exist +theorem erdos_77.variants.limit_does_not_exist : + ¬ ∃ L : ℝ, Tendsto (fun k : ℕ => + (diagonalRamseyNumber k : ℝ) ^ ((1 : ℝ) / (k : ℝ))) + atTop (nhds L) := by sorry +``` + +Also, a variant capturing the known bounds could be stated: + +```lean +-- Known bounds: √2 ≤ lim inf ≤ lim sup ≤ 4 +theorem erdos_77.variants.known_bounds : ... +``` + +**Recommendation:** Add at least the existence/non-existence variants, as these are independently prize-worthy questions. + +## 4. Readability + +**Minor issues:** + +- The definition `diagonalRamseyNumber` is well-documented but uses a low-level representation (raw `Bool`-valued function) rather than the `SimpleGraph` formalism used elsewhere in the codebase. Using `SimpleGraph` would make the connection to standard Ramsey theory more transparent. +- The expression `(1 : ℝ) / (k : ℝ)` in the theorem statement could be simplified to `(k : ℝ)⁻¹` or `1 / (k : ℝ)` (dropping the type annotation on `1`), though this is a minor stylistic point. +- The namespace `Erdos77` is consistent with codebase conventions. + +**Overall readability: Good.** The docstrings clearly explain the mathematical content. The code is short and focused. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement "find the value of lim_{k→∞} R(k)^{1/k}" is mathematically precise once R(k) is defined. The diagonal Ramsey number R(k) has a universally agreed-upon definition. The only subtlety is whether the limit is assumed to exist: + +- The formalization assumes it does (by asserting `Tendsto ... (nhds L)` for some `L`). +- The original problem is arguably ambiguous about this: "find the value" presupposes existence, but Erdős separately offered prizes for proving existence/non-existence, suggesting he considered both possibilities. + +The `answer(sorry)` mechanism correctly captures the "find the value" aspect — the solver must provide the limiting constant. + +**Ambiguity level: Low.** The only ambiguity is the existence question, which is addressed by adding variants (see §3). + +## 6. Correctness + +**The formalization is mathematically correct modulo one concern.** + +**Definition correctness:** The definition of `diagonalRamseyNumber` correctly captures R(k): +- It quantifies over all symmetric 2-colorings of edges (`c : Fin N → Fin N → Bool` with `c i j = c j i`). +- It requires a monochromatic clique of size k (a set S with `S.card = k` where all distinct pairs agree in color). +- The `i ≠ j` guard correctly excludes self-loops from the monochromatic condition. +- The symmetry condition on diagonal entries (`c i i = c i i`) is trivially satisfied and harmless. +- Using `sInf` is correct; if the defining set is empty, `sInf ∅ = 0` in ℕ, but by the Ramsey theorem the set is always nonempty for the relevant cases. + +**Theorem correctness:** The statement `Tendsto (fun k => R(k)^{1/k}) atTop (nhds L)` correctly formalizes "the limit equals L." The use of `atTop` for the filter on ℕ is standard. + +**Edge case at k = 0:** When k = 0, the expression computes `R(0)^(1/0)`. In Lean's reals, `1/0 = 0`, so this is `R(0)^0 = 1`. Since the filter is `atTop`, finitely many terms don't affect the limit, so this is harmless. + +**Concern — presupposition of existence:** As noted in §3 and §5, the theorem is only true if the limit exists. If it does not exist, the statement is false for every value of `answer(sorry)`. This is a completeness issue rather than an incorrectness issue — the formalization is correct as a conditional statement ("if the limit exists, it equals..."), but it does not capture the full problem as posed by Erdős. + +**Overall correctness: Sound.** The formalization is mathematically correct. Incompleteness (missing variants) is attributable to the ambiguity of whether "find the value" presupposes existence. + +--- + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code reuse | Needs improvement | Should use `diagRamsey` from Problem 87 or `hypergraphRamsey` from library | +| Citations | Needs improvement | Wrong prize amount; missing references [BBCGHMST24] and many Erdős refs | +| Variants | Needs improvement | Missing existence/non-existence variants | +| Readability | Good | Clear and concise | +| Formalizability | Good | Low ambiguity | +| Correctness | Good | Mathematically sound; incompleteness from missing variants | diff --git a/ai-review/771.md b/ai-review/771.md new file mode 100644 index 0000000000..195db6b1e1 --- /dev/null +++ b/ai-review/771.md @@ -0,0 +1,67 @@ +# Review of Erdős Problem 771 + +## 1. Code Reuse + +The `IsSubsetSum` definition (lines 43–44) is local to the `Erdos771` namespace. Similar subset-sum and related concepts appear elsewhere in the codebase: + +- **Problem 774** (`774.lean:34–37`): `Dissociated` — distinct subsets have distinct sums, closely related to subset-sum reasoning. +- **Problem 790** (`790.lean:42–43`): Sum-free sets using `Finset` operations. +- **Problem 963** (`963.lean:35–36`): Dissociation on reals with subset sums. + +No shared utility for `IsSubsetSum` exists. Given that multiple problems deal with subset sums over `Finset ℕ`, extracting `IsSubsetSum` into a shared utility (e.g., `Util/SubsetSum.lean`) could reduce duplication, though the definitions are each slightly different. + +The `sSup`-based extremal function pattern (lines 49–51) is used consistently across problems 635, 789, 790, and 793. The `∀ ε > 0, ∃ N₀` asymptotic encoding is standard and matches problems 620, 788, and 790. + +No existing shared code would directly replace anything in this file. + +## 2. Citations + +The website ([erdosproblems.com/771](https://www.erdosproblems.com/771)) lists two references: + +- **[Er89]** — Original Erdős source (not cited in the Lean file). +- **[AlFr88]** — Alon and Freiman. + +The Lean file cites **[AlFr88]** correctly as: Alon, N. and Freiman, G., *On sums of subsets of a set of integers*. Combinatorica 8 (1988), 297–306. This matches the website. + +**Missing citation:** The Lean file attributes the lower bound to "Erdős and Graham" in prose but does not include the **[Er89]** reference that appears on the website. Consider adding it for completeness. + +## 3. Variants + +The website does not mention additional variants of this problem. The formalization captures the single main result: $f(n) = (\frac{1}{2} + o(1)) \cdot n / \log n$. No variants appear to be missing. + +## 4. Readability + +The code is clean, well-structured, and follows established conventions in the codebase: + +- The `IsSubsetSum` helper has a clear docstring. +- The definition of `f` has a clear docstring explaining the combinatorial meaning. +- The theorem statement is well-documented with both informal LaTeX and the formal epsilon-delta encoding. +- Namespace scoping (`Erdos771`) is appropriate. +- Variable names (`S`, `m`, `A`, `ε`, `N₀`) are standard mathematical notation. + +No readability improvements needed. + +## 5. Formalizability + +The problem is precisely stated and the formalization is unambiguous. Key considerations: + +- **Quantifier structure:** The definition `f(n) = sSup {k | ∀ m ≥ 1, ∃ S ⊆ [1,n], |S| = k ∧ ¬IsSubsetSum S m}` correctly allows `S` to depend on `m`, which is essential — the Erdős–Graham construction chooses $S = \{kp : 1 \leq k < n/p\}$ where $p$ depends on $m$. +- **Well-definedness of `sSup`:** The set is nonempty (contains 0, since the empty set avoids all positive integers as subset sums) and bounded above (by $n$, since $S \subseteq \{1, \ldots, n\}$). So `sSup` on `ℕ` yields the actual maximum. A formal proof would need to establish `BddAbove` and `Set.Nonempty` for the argument set. +- **The `o(1)` encoding** as `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ...` is standard and unambiguous. +- **Edge cases with `Real.log`:** For $n = 0$ or $n = 1$, `Real.log ↑n ≤ 0`, making $n / \log n \leq 0$, so the bounds degenerate. This is harmless because of the `∃ N₀` quantifier — the bounds only need to hold eventually. + +**Assessment:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **correct and complete**. + +**Definition of `f`:** The quantifier order `∀ m, ∃ S` (not `∃ S, ∀ m`) is mathematically essential and correctly implemented. The alternative (`∃ S, ∀ m`) would ask for a single set $S$ such that no positive integer is a subset sum — this is impossible for any nonempty $S$ (since each element $a \in S$ satisfies $a = \sum_{x \in \{a\}} x$), making $f(n) = 0$ trivially. The formalization correctly uses the interpretation where $S$ may depend on $m$. + +**`IsSubsetSum`:** The definition `∃ A ⊆ S, A.sum id = m` correctly captures the subset-sum relation. Note that the empty subset $A = \emptyset$ gives sum 0, so $m = 0$ is always a subset sum. The condition `m ≥ 1` in the definition of `f` correctly excludes this trivial case. + +**Theorem statement:** The `answer(True)` is correct — the problem is solved (lower bound by Erdős–Graham, upper bound by Alon–Freiman [AlFr88]). The two-sided bound $(1/2 - \varepsilon) \cdot n/\log n \leq f(n) \leq (1/2 + \varepsilon) \cdot n/\log n$ correctly encodes $f(n) \sim \frac{1}{2} \cdot \frac{n}{\log n}$. + +**Tags:** `category research solved` and `AMS 11` (number theory) are appropriate. + +**No mathematical flaws identified.** An experienced mathematician would agree this formalization faithfully captures the stated problem. diff --git a/ai-review/772.md b/ai-review/772.md new file mode 100644 index 0000000000..0b6e2d3fab --- /dev/null +++ b/ai-review/772.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 772 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** + +- **`IsSidonSet`**: This local definition on `Finset ℕ` is duplicated verbatim in at least Problem 773 (and many others: 43, 154, 156, 157, 198, 707, 757). A general `IsSidon` already exists in `FormalConjecturesForMathlib/Combinatorics/Basic.lean:36-39`, defined on `Set α` for any `AddCommMonoid α`. The local `Erdos772.IsSidonSet` could be replaced by `IsSidon (S : Set ℕ)` (with a coercion from `Finset` to `Set`), which would also give access to proved lemmas like `IsSidon.subset`, `IsSidon.insert`, and the decidability instance `Finset.instDecidableIsSidon`. + +- **`addRepCount`**: This is a computable version of the representation count for `Finset ℕ`. A closely related noncomputable `sumRep` (the self-convolution `𝟙_A ∗ 𝟙_A`) is defined in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean:52`. Similar `repCount` definitions appear in Problems 328, 763, 871, and 29. The current `addRepCount` is essentially a computable specialization of `sumRep` to finite sets; this is acceptable for a standalone formalization, but noting the relationship explicitly (or using `sumRep` with `Set.Finite` coercion) would improve cross-referenceability. The definitions are mathematically equivalent: `addRepCount A m = sumRep (↑A) m` when `A : Finset ℕ`. + +## 2. Citations + +The website lists three references: +- **[Er80e]** — Erdős (1980): Not mentioned in the formalization. +- **[Er84d]** — Erdős (1984): Not mentioned in the formalization. +- **[AlEr85]** — Alon, N. and Erdős, P., *An application of graph theory to additive number theory*, European J. Combin. 6 (1985), 201–203: **Correctly cited** in the formalization with full bibliographic details. + +The formalization omits [Er80e] and [Er84d], which are the original sources where Erdős posed the problem. Adding at least a brief mention (e.g., "Originally posed by Erdős [Er80e, Er84d]") would improve citation completeness. + +Additionally, the website credits **Noga Alon** as a contributor; this is implicitly captured by the [AlEr85] citation. + +## 3. Variants + +The formalization captures two levels: + +1. **`erdos_772`**: The weaker statement that $H_k(n)/n^{1/2} \to \infty$. ✓ +2. **`erdos_772.variants.alon_erdos_bound`**: The stronger result $H_k(n) \gg_k n^{2/3}$. ✓ + +**Missing variant**: The website notes that Erdős proved an **upper bound** $H_k(n) \ll n^{2/3}$ (with an absolute constant independent of $k$). Together with the Alon–Erdős lower bound, this pins down the exact order of growth. This matching upper bound is not formalized. A variant like the following would complete the picture: + +``` +theorem erdos_772.variants.upper_bound : + ∃ C : ℝ, C > 0 ∧ ∀ k : ℕ, k ≥ 1 → + ∀ᶠ n in Filter.atTop, + ∃ A : Finset ℕ, A.card = n ∧ + (∀ m : ℕ, addRepCount A m ≤ k) ∧ + ∀ S : Finset ℕ, S ⊆ A → IsSidonSet S → (S.card : ℝ) ≤ C * (n : ℝ) ^ ((2 : ℝ) / 3) +``` + +The intermediate question "Or even $H_k(n) > n^{1/2+c}$?" from the original problem statement is subsumed by the $n^{2/3}$ bound and does not require a separate variant. + +## 4. Readability + +The code is well-structured and readable: + +- Clear docstrings with LaTeX explain each definition and theorem. +- The namespace `Erdos772` avoids name clashes. +- The two theorems are logically ordered (weak → strong). +- The `addRepCount` docstring correctly explains the equivalence with the convolution norm. + +**Minor suggestions**: +- The `answer(True) ↔` pattern on `erdos_772` is standard for the codebase but may confuse readers unfamiliar with the convention. This is a codebase-wide style choice, not specific to this file. +- The exponent `(1 : ℝ) / 2` and `(2 : ℝ) / 3` coercions are somewhat noisy but necessary for type correctness. + +## 5. Formalizability + +**High formalizability.** The problem is precisely stated: + +- $H_k(n)$ is explicitly defined as a maximum over finite sets of naturals with bounded representation function. +- The questions "$H_k(n)/n^{1/2} \to \infty$" and "$H_k(n) \gg_k n^{2/3}$" are unambiguous asymptotic statements. +- The Sidon set property is a well-defined combinatorial condition. + +**Ambiguity assessment**: Essentially zero. The only potential source of ambiguity is whether the representation function counts ordered or unordered pairs (the formalization correctly uses ordered pairs, matching the standard convention for $1_A \ast 1_A$). The docstring clarifies this explicitly. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsSidonSet`**: Correctly captures the B₂ property — all pairwise sums distinct, accounting for the commutativity of addition (the two disjuncts handle the case $\{a,b\} = \{c,d\}$ as multisets). ✓ + +- **`addRepCount`**: Counts elements $a \in A$ with $a \leq m$ and $m - a \in A$. Since $A \subset \mathbb{N}$ and $a + b = m$ forces $a \leq m$, the condition `a ≤ m` correctly prevents spurious matches from natural number subtraction underflow (where `m - a = 0` when `a > m` in ℕ). This faithfully computes $\sum_{a \in A} \mathbf{1}[m - a \in A]$, which equals $(1_A \ast 1_A)(m)$. ✓ + +- **`erdos_772`**: The statement "for all $k \geq 1$, for all $C > 0$, eventually every $n$-element set with rep bounded by $k$ contains a Sidon subset of size $\geq C \sqrt{n}$" is a correct formalization of "$H_k(n)/\sqrt{n} \to \infty$." The `answer(True) ↔` wrapper correctly reflects that the answer is affirmative. ✓ + +- **`erdos_772.variants.alon_erdos_bound`**: The existential quantifier structure — $\forall k \geq 1, \exists C > 0, \exists N_0, \forall n \geq N_0, \ldots$ — correctly captures "$H_k(n) \gg_k n^{2/3}$" where the implied constant depends on $k$. ✓ + +- **Quantifier order**: In the main theorem, the quantifier order $\forall k, \forall C, \exists N_0$ correctly allows $N_0$ to depend on both $k$ and $C$, which is appropriate for the "$\to \infty$" formulation. In the variant, $\forall k, \exists C, \exists N_0$ correctly allows $C$ and $N_0$ to depend on $k$. ✓ + +**No mathematical flaws detected.** An experienced mathematician would find this formalization faithful to the original problem and its resolution. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `IsSidonSet` should use `IsSidon` from `FormalConjecturesForMathlib`; `addRepCount` is acceptable but related to `sumRep` | +| Citations | [AlEr85] correct; [Er80e] and [Er84d] missing | +| Variants | Weak and strong lower bounds captured; upper bound $H_k(n) \ll n^{2/3}$ missing | +| Readability | Good | +| Formalizability | Unambiguous, highly formalizable | +| Correctness | Correct and complete for what it formalizes | diff --git a/ai-review/773.md b/ai-review/773.md new file mode 100644 index 0000000000..bc7f359ae9 --- /dev/null +++ b/ai-review/773.md @@ -0,0 +1,85 @@ +# Review: Erdos Problem 773 + +## 1. Code Reuse + +**`IsSidonSet` is redefined locally and should use the shared definition.** + +There is a shared, more general definition `IsSidon` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 38) that works over `Set α` for any `AddCommMonoid α`. The local `Erdos773.IsSidonSet` on `Finset ℕ` is semantically identical but duplicated. At minimum, `IsSidonSet` should be defined in terms of `IsSidon` (e.g., `IsSidon (↑S : Set ℕ)`), or the shared definition should be used directly. + +This same duplication pattern exists across many Erdos problem files (43, 154, 156, 530, 772, 861, 862, 773) — each re-declares its own `IsSidonSet`. Ideally all of these would use the shared `IsSidon` from the combinatorics library. + +The `squaresUpTo` helper is problem-specific and has no reuse candidate. + +## 2. Citations + +**Citations are accurate and complete.** + +The website for [erdosproblems.com/773](https://www.erdosproblems.com/773) lists: +- [AlEr85] Alon and Erdos (1985) — correctly cited in the docstring +- [LeTh95] Lefmann and Thiele (1995) — correctly cited in the docstring + +Minor notes: +- The full title of [AlEr85] on the website is not given explicitly, but the docstring provides a reasonable title. The docstring says "On the size of the largest Sidon subset of a random set of integers" while Problem 772 cites the same paper as "An application of graph theory to additive number theory". The website credits [AlEr85] to both problems 772 and 773, so it's possible the same paper covers both, or these are different papers by the same authors from the same year. This should be verified. +- The website also credits Akshat Mudgal for additional contributions — not mentioned in the docstring (this is minor, as it appears to be a website contributor credit rather than a mathematical reference). +- An OEIS sequence A390813 is referenced on the website but not in the formalization (optional, not required). + +## 3. Variants + +**No variants are formalized; several natural ones exist.** + +The problem as stated on the website asks: "What is the size of the largest Sidon subset of {1², 2², ..., N²}? Is it N^{1-o(1)}?" + +The formalization only captures the "is it N^{1-o(1)}?" question. Natural variants that could be formalized: + +1. **Known lower bound variant**: There exists C > 0 such that for all sufficiently large N, the largest Sidon subset of {1², ..., N²} has size ≥ C · N^{2/3}. (This is the Lefmann–Thiele result, which is proven.) + +2. **Known upper bound variant**: There exists C > 0 such that for all sufficiently large N, the largest Sidon subset of {1², ..., N²} has size ≤ C · N / (log N)^{1/4}. (This is the Alon–Erdos upper bound, which is proven.) + +3. **Negation variant**: The answer could be `False` — i.e., there exists ε > 0 such that for infinitely many N, no Sidon subset of {1², ..., N²} has size ≥ N^{1-ε}. The `answer(sorry)` wrapper handles this correctly in principle, but explicit formalization of the known bounds as separate theorems (as done in Problem 772) would be valuable. + +## 4. Readability + +**The code is clear and readable.** Minor suggestions: + +- The `squaresUpTo` definition uses 1-indexed squares {1², 2², ..., N²} via `(i + 1) ^ 2` over `Finset.range N`, which is correct and clear. The docstring matches the implementation. +- The main theorem statement is well-structured and follows standard asymptotic formalization conventions. +- The namespace `Erdos773` is consistent with project conventions. + +## 5. Formalizability + +**The problem is precisely formalizable, with one subtlety.** + +The website states: "What is the size of the largest Sidon subset of {1², 2², ..., N²}? Is it N^{1-o(1)}?" + +The formalization interprets "is it N^{1-o(1)}?" as: for every ε > 0, for sufficiently large N, there exists a Sidon subset of size ≥ N^{1-ε}. This is a standard and correct interpretation of the N^{1-o(1)} notation — it means the size grows faster than N^{1-ε} for every fixed ε > 0. + +**Ambiguity assessment: Low.** The statement is precise. The only minor ambiguity is whether "the size" refers to an existential lower bound (as formalized) or an exact asymptotic characterization. The formalization correctly captures the existential/lower-bound reading, which is the standard interpretation of "is it N^{1-o(1)}?" as a yes/no question. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsSidonSet` definition (line 37-39)**: Correct. For a, b, c, d ∈ S with a + b = c + d, we must have {a,b} = {c,d} as multisets. This is the standard B₂ set / Sidon set definition. Note: using ℕ (not ℤ) is fine here since all elements are perfect squares (positive). + +- **`squaresUpTo` definition (line 42-43)**: Correct. `Finset.range N` gives {0, 1, ..., N-1}, and `(fun i => (i + 1) ^ 2)` maps this to {1, 4, 9, ..., N²}. This correctly produces {1², 2², ..., N²} with exactly N elements (assuming injectivity of squaring on positive integers, which holds). + +- **Main theorem (line 55-61)**: The statement correctly formalizes "is the largest Sidon subset of {1², ..., N²} of size N^{1-o(1)}?" The `answer(sorry)` wrapper correctly accounts for the possibility that the answer is no. The quantifier structure (∀ε > 0, ∃N₀, ∀N ≥ N₀, ∃A ⊆ squaresUpTo N, ...) is the standard way to express "for all sufficiently large N, the bound N^{1-ε} is achievable." + +- **Potential issue with `A ⊆ squaresUpTo N`**: Since `squaresUpTo` returns a `Finset ℕ` and `A` is also a `Finset ℕ`, the subset relation is over `Finset ℕ`. This is correct — `A` is a subcollection of perfect squares. + +- **Cast `(A.card : ℝ)` and `(N : ℝ) ^ (1 - ε)`**: The comparison is done in ℝ, which is necessary since `1 - ε` is real-valued. This is correct. + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on the website. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `IsSidonSet` should use shared `IsSidon` from `FormalConjecturesForMathlib/Combinatorics/Basic.lean` | +| Citations | Accurate; minor question about [AlEr85] title vs. Problem 772's citation of the same key | +| Variants | Known bounds (N^{2/3} lower, N/(log N)^{1/4} upper) not formalized as separate theorems | +| Readability | Good | +| Formalizability | High — low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/774.md b/ai-review/774.md new file mode 100644 index 0000000000..b9083d5d70 --- /dev/null +++ b/ai-review/774.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 774 + +## 1. Code Reuse + +The `Dissociated` definition in `774.lean` (all finite subset sums distinct) is essentially equivalent to three other definitions already in the codebase: + +- **`Erdos350.DistinctSubsetSums`** (`ErdosProblems/350.lean:33`): Uses `Set.Pairwise` formulation over a general `AddCommMonoid`. Semantically identical for `Set ℕ`. +- **`Erdos350.DecidableDistinctSubsetSums`** (`ErdosProblems/350.lean:37`): Decidable version for `Finset`, structurally very close to the 774 definition. +- **`Erdos963.IsDissociated`** (`ErdosProblems/963.lean:35`): Works over `Finset ℝ` and uses `∑ b ∈ S, b` instead of `S.sum id`. + +All four definitions express the same mathematical concept (distinct subset sums / dissociated set) with minor type and stylistic differences. A shared definition in `FormalConjecturesForMathlib` would reduce duplication. The most natural shared definition would generalize over `AddCommMonoid` and work for both `Set` and `Finset`, similar to how `IsSidon` is defined in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`. + +`ProportionatelyDissociated` has no analogue elsewhere in the codebase and is specific to this problem. + +## 2. Citations + +The formalization cites: +- `[AlEr85] Alon, N. and Erdős, P., 1985.` + +The [website](https://www.erdosproblems.com/774) lists: +- **Alon and Erdős [AlEr85]** — included, but missing full bibliographic details. The paper is: Alon, N. and Erdős, P., "An application of graph theory to additive number theory," *European J. Combin.* **6** (1985), 201–203. +- **Erdős [Er92b]** — not cited in the formalization. This is: Erdős, P., "Some of my favourite problems in various branches of combinatorics," *Matematiche (Catania)* **47** (1992), 231–240. +- **Pisier [Pi83]** — mentioned on the website as establishing the equivalence between proportionate dissociation and Sidon sets (harmonic analysis). Not cited. +- **Nešetřil, Rödl, and Sales [NRS24]** — mentioned on the website as resolving the analogous question for Sidon sets negatively. Not cited. + +The website also lists **Problem 328** as a related problem. + +**Recommendation:** Add `[Er92b]` to the citation list and mention the connection to Problem 328. + +## 3. Variants + +The website mentions one important related result not captured: + +- **Sidon set analogue (resolved negatively):** The analogous question for Sidon sets (additive combinatorial sense) — whether every set with proportional Sidon subsets is a union of finitely many Sidon sets — was answered **no** by Nešetřil, Rödl, and Sales [NRS24]. This negative resolution for the Sidon analogue is noteworthy context and could be formalized as a variant or at least mentioned in the docstring. + +No other variants appear on the website. The formalization captures the single stated problem. + +## 4. Readability + +The code is clean and well-structured: +- The `Dissociated` and `ProportionatelyDissociated` definitions have clear docstrings explaining the mathematical content. +- The theorem statement is concise and follows the `answer(sorry) ↔ ...` pattern. +- The namespace `Erdos774` cleanly scopes the definitions. + +Minor suggestions: +- The docstring for the theorem could mention that this is sometimes called the "Alon–Erdős conjecture" for searchability. +- Consider adding a brief note about the connection to Sidon sets (Pisier's equivalence) since this provides important mathematical context. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem statement is precise and unambiguous: +- "Dissociated set" has a standard, well-established definition (all finite subset sums are distinct). +- "Proportionately dissociated" is explicitly defined in the Alon–Erdős paper. +- "Union of finitely many dissociated sets" is unambiguous. + +The only potential source of confusion is whether "union" means disjoint partition or arbitrary cover, but these are equivalent for hereditary properties (dissociation is downward-closed under subsets), and the formalization correctly uses the covering formulation (`A ⊆ ⋃ i, D i`). + +## 6. Correctness + +**Overall: Correct, with minor observations.** + +### Definition of `Dissociated` (line 36–37) +```lean +def Dissociated (A : Set ℕ) : Prop := + ∀ X Y : Finset ℕ, ↑X ⊆ A → ↑Y ⊆ A → X ≠ Y → X.sum id ≠ Y.sum id +``` +Mathematically correct. This is the standard definition: a set is dissociated (equivalently, has distinct subset sums, or is a Sidon set of order 1 in the generalized sense) if no two distinct finite subsets have equal sums. The use of `Finset ℕ` for the subsets and `X.sum id` for the sum is appropriate. The empty set is correctly included as a possible subset (its sum is 0), which is standard. + +### Definition of `ProportionatelyDissociated` (line 42–44) +```lean +def ProportionatelyDissociated (A : Set ℕ) : Prop := + ∃ c : ℝ, c > 0 ∧ ∀ B : Finset ℕ, ↑B ⊆ A → + ∃ D : Finset ℕ, D ⊆ B ∧ Dissociated ↑D ∧ (D.card : ℝ) ≥ c * B.card +``` +Mathematically correct. The constant `c` is existentially quantified and required to be positive, and the dissociated subset `D` must be a subset of each finite `B ⊆ A` with `|D| ≥ c|B|`. This matches the definition from Alon–Erdős. + +### Main theorem (line 52–56) +```lean +theorem erdos_774 : answer(sorry) ↔ + ∀ A : Set ℕ, A.Infinite → + ProportionatelyDissociated A → + ∃ n : ℕ, ∃ D : Fin n → Set ℕ, + (∀ i, Dissociated (D i)) ∧ A ⊆ ⋃ i, D i +``` + +**Correct.** Several points: + +1. **`A.Infinite` guard:** The restriction to infinite sets is mathematically harmless — any finite set is trivially the union of finitely many singletons, each of which is dissociated. The truth value of the overall statement is unchanged by this restriction. It serves to focus on the non-trivial case. + +2. **Covering vs. partition:** The conclusion uses `A ⊆ ⋃ i, D i` (covering) rather than `A = ⋃ i, D i` (exact union). This is equivalent: given a covering, one can replace each `D i` with `D i ∩ A` and obtain an exact union where each piece is still dissociated (since dissociation is hereditary — any subset of a dissociated set is dissociated). + +3. **`D i : Set ℕ` not required to be subsets of `A`:** This is fine for the same reason — the covering formulation with the hereditary property ensures equivalence. + +4. **Use of `Fin n` for indexing:** This correctly captures "finitely many" sets. Using `∃ n : ℕ, ∃ D : Fin n → Set ℕ` is a clean way to express a finite family. + +5. **`answer(sorry)` wrapper:** Appropriate since the problem is open — the answer (True or False) is unknown. + +**No mathematical flaws identified.** The formalization is a faithful and complete rendering of the problem as stated on erdosproblems.com. diff --git a/ai-review/775.md b/ai-review/775.md new file mode 100644 index 0000000000..1cedda2fba --- /dev/null +++ b/ai-review/775.md @@ -0,0 +1,92 @@ +# AI Review: Erdos Problem 775 + +## 1. Code Reuse + +Several opportunities for code reuse exist: + +- **Problem 927** (`927.lean`) is the graph (2-uniform) analog of this problem and defines structurally identical `IsCliqueSet` / `IsMaxCliqueSet` / `graphCliqueSizes`. The definitions in 775 (`IsCompleteInHypergraph`, `IsHypergraphClique`, `cliqueSizeSet`) are generalizations of 927's definitions to k-uniform hypergraphs. Ideally these would be unified: 927's definitions could be derived as the k=2 special case of 775's definitions (noting that the graph case requires translating between `SimpleGraph` edges and 2-element subsets). + +- **Problem 719** (`719.lean`) defines `IsRUniformHypergraph n r H` as `∀ e ∈ H, e.card = r`, which is exactly the uniformity check done inline in 775's theorem statement (`∀ e ∈ H, e.card = 3`). This could be reused. + +- **Multiple other files** (616, 832, 833, 834, 836, 837, 1024, 1075, 1076, 1157) define their own hypergraph structures. There is no shared hypergraph library in `FormalConjecturesForMathlib/`. A shared `UniformHypergraph` definition with clique/completeness notions would significantly reduce duplication across the codebase. + +- The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` file imports Mathlib's `SimpleGraph.Clique` but this is for ordinary graphs, not hypergraphs, so it is not directly applicable. + +## 2. Citations + +The website (erdosproblems.com/775) lists the following references: + +| Tag | Description | +|------|-------------| +| [Gu83] | Original problem source | +| [Sp71] | Spencer's graph construction ($g(n) > n - \log_2 n - O(1)$) | +| [MoMo65] | Moon and Moser's optimality result for graphs | +| [Ga25] | Gao's disproof for hypergraphs | + +The formalization's docstring mentions Gao [Ga25] but does not include a full citation line for it (author, title, year). The other references ([Gu83], [Sp71], [MoMo65]) are not mentioned at all. The website also notes prior results: + +- Erdos constructed a 3-uniform hypergraph with cliques of at least $n - \log^* n$ different sizes. +- Spencer [Sp71] constructed a graph with cliques of at least $n - \log_2 n + O(1)$ different sizes. +- Moon and Moser [MoMo65] proved Spencer's result was optimal for graphs. + +The docstring should include these citations in full, following the pattern used in other files (e.g., 927.lean lists `[Sp71] Spencer, J., *The number of distinct clique sizes of a graph*`). + +## 3. Variants + +The docstring describes the general result for $k \geq 3$: every $k$-uniform hypergraph on $n$ vertices has at most $n - f_k(n)$ distinct clique sizes where $f_k(n) \to \infty$. **This general statement is not formalized as a separate theorem.** It should be added as a variant, e.g.: + +```lean +/-- General version of Erdős 775 (Gao [Ga25]): for any k ≥ 3, the number of +distinct clique sizes in any k-uniform hypergraph on n vertices is at most +n − f_k(n) where f_k(n) → ∞. -/ +theorem erdos_775.variants.general_k : + ∀ k : ℕ, k ≥ 3 → ∃ f : ℕ → ℕ, Filter.Tendsto f Filter.atTop Filter.atTop ∧ + ∀ n : ℕ, ∀ H : Finset (Finset (Fin n)), + (∀ e ∈ H, e.card = k) → + (cliqueSizeSet H k).ncard + f n ≤ n := by + sorry +``` + +The website also cross-references Problem 927 (the graph/2-uniform version). The `See also [775]` note in 927 is present but 775 does not contain a reciprocal `See also [927]` reference. + +## 4. Readability + +The code is generally well-structured and readable: + +- The three definitions (`IsCompleteInHypergraph`, `IsHypergraphClique`, `cliqueSizeSet`) build naturally on each other. +- The docstrings clearly explain each definition with mathematical notation. +- The namespace `Erdos775` keeps definitions scoped. + +Minor suggestions: +- The inline uniformity condition `(∀ e ∈ H, e.card = 3)` in the theorem could use the `IsRUniformHypergraph` predicate from 719 or an equivalent local def for clarity. +- A `See also [927]` cross-reference would help readers navigate between the graph and hypergraph versions. + +## 5. Formalizability + +**Assessment: Clearly formalizable, low ambiguity.** + +The problem asks whether a constant $C$ exists such that for all $n$, a 3-uniform hypergraph on $n$ vertices achieves at least $n - C$ distinct maximal clique sizes. The concepts involved (k-uniform hypergraph, complete subhypergraph, maximal clique, cardinality) are all standard and admit precise definitions. The "n - O(1)" phrasing is the only potential source of ambiguity, and it is correctly rendered as $\exists C, \forall n, \ldots \geq n - C$. + +The general result for $k \geq 3$ involves "f_k(n) → ∞", which is also standard and formalizable via `Filter.Tendsto`. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Logical structure**: The theorem states `answer(False) ↔ (∃ C, ∀ n, ∃ H, ...)`. Since `answer(False)` reduces to `False`, this asserts `¬(∃ C, ∀ n, ∃ H, ...)`, i.e., no such constant $C$ exists. This correctly captures Gao's disproof. + +- **Uniformity**: The condition `∀ e ∈ H, e.card = 3` correctly constrains $H$ to be a 3-uniform hypergraph (all edges have exactly 3 vertices). Note this does not require $H$ to contain *all* 3-element subsets — it's a set of 3-element edges, which is the correct definition. + +- **Completeness definition**: `IsCompleteInHypergraph H k S` requires every $k$-element subset of $S$ to be in $H$. This is the standard notion of a complete sub-hypergraph. + +- **Clique (maximality)**: `IsHypergraphClique H k S` requires $S$ to be complete and no strict superset to be complete. This is the correct definition of a maximal complete sub-hypergraph, matching the problem's "cliques (maximal complete subgraphs)". + +- **Small cliques**: Sets of size $< k$ (e.g., singletons or pairs for $k = 3$) are vacuously complete. They are cliques iff no superset is complete. This is mathematically valid — in the hypergraph literature, maximal cliques can have size less than $k$. The problem statement does not restrict clique sizes, so this is correct. + +- **Natural number subtraction**: The term `n - C` uses natural number truncated subtraction, so for $n < C$ the condition becomes `ncard ≥ 0`, which is vacuously true. This is harmless — the substantive content concerns large $n$. + +- **Use of `ncard`**: `cliqueSizeSet` returns a `Set ℕ`, and `.ncard` is used to measure its cardinality. Since the vertex set is `Fin n` (finite), there are finitely many possible subsets, so `cliqueSizeSet` is always finite. `ncard` returns the correct cardinality for finite sets. This is correct, though using a `Finset` with `.card` would make the finiteness explicit. + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. The only gap is the missing general-$k$ variant mentioned in the docstring but not formalized. diff --git a/ai-review/776.md b/ai-review/776.md new file mode 100644 index 0000000000..b53027f0fe --- /dev/null +++ b/ai-review/776.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 776 + +## 1. Code Reuse + +**Mathlib's `IsAntichain` should be used instead of the custom definition.** + +The file defines a custom `Erdos776.IsAntichain` (line 35): +```lean +def IsAntichain (F : Finset (Finset ℕ)) : Prop := + ∀ A ∈ F, ∀ B ∈ F, A ≠ B → ¬(A ⊆ B) +``` + +Mathlib already provides `IsAntichain` in `Mathlib.Order.Antichain`: +```lean +def IsAntichain (r : α → α → Prop) (s : Set α) : Prop := s.Pairwise rᶜ +``` + +Instantiated as `IsAntichain (· ⊆ ·) (F : Set (Finset ℕ))`, this expands to exactly the same condition. Problem 497 in this codebase already uses the Mathlib version (`IsAntichain (· ⊆ ·) (F : Set (Finset (Fin n)))`), so there is clear precedent. The custom definition should be replaced. + +No other reusable infrastructure was found in `FormalConjecturesForMathlib/` for the remaining custom definitions (`HasMinMultiplicity`, `numDistinctSizes`, `AllSubsetsOfRange`), which are straightforward and problem-specific. + +## 2. Citations + +The docstring references "A problem of Erdős and Trotter" but does not cite the specific reference listed on [erdosproblems.com/776](https://www.erdosproblems.com/776), which is **[Gu83]**. The citation should be included explicitly, e.g.: + +> *Reference:* P. Erdős and W. T. Trotter, [Gu83]; [erdosproblems.com/776](https://www.erdosproblems.com/776) + +(The exact expansion of [Gu83] is not provided on the website, but the tag should be preserved for traceability.) + +## 3. Variants + +The formalization captures three statements: +- **Main theorem (`erdos_776`):** Existence of threshold $N_0(r)$ for achieving $n-3$ distinct sizes. Tagged `open`. +- **r=1 variant (`r_eq_1`):** Maximum distinct sizes is $n-2$ for $n>3$. Tagged `solved`. +- **Upper bound (`upper_bound`):** For $r \geq 2$, can't exceed $n-3$ distinct sizes. Tagged `solved`. + +**Missing variant:** The actual open question is about the *growth rate* of $N_0$ as a function of $r$. The docstring acknowledges this ("The problem asks for the growth rate of $N_0$ as a function of $r$") but no formal statement captures it. This is understandable since formalizing "determine the growth rate" is inherently difficult without a conjectured bound, but it should be noted that `erdos_776` as stated (pure existence of $N_0$) may already be a known/solved result, making the `open` tag potentially misleading. + +## 4. Readability + +The code is well-structured and readable. The helper definitions are clear, well-named, and have informative docstrings. The namespace `Erdos776` keeps things tidy. + +Minor suggestions: +- The use of `{0, …, n-1}` (via `AllSubsetsOfRange`) instead of the problem's original `{1, …, n}` is a natural Lean convention and does not affect correctness, but could be noted in a comment for clarity. + +## 5. Formalizability + +The problem is **partially formalizable as stated**. The qualitative aspects (existence of $N_0$, upper bounds on distinct sizes) are precise and unambiguous. However, the core open question — "how large must $n$ be as a function of $r$" — asks for the determination of a growth rate, which is inherently open-ended and not naturally expressible as a single theorem statement without a conjectured answer. + +**Ambiguity level: Low** for the formalized portions. The definitions of antichain, multiplicity constraint, and distinct sizes are all standard and unambiguous. + +## 6. Correctness + +### `erdos_776` (main theorem) — **Likely correct but potentially already known** + +The statement correctly formalizes the existence of a threshold $N_0(r)$ beyond which $n-3$ distinct sizes are achievable. The mathematical content matches the website description. + +### `erdos_776.variants.r_eq_1` — **Correct** + +For $n > 3$ and no multiplicity constraint, the maximum number of distinct sizes in an antichain of subsets of $\{0,\ldots,n-1\}$ is $n-2$, and this is tight. This is consistent with known extremal set theory results. + +### `erdos_776.variants.upper_bound` — **INCORRECT for small $n$** ⚠️ + +The statement claims that for *all* $r \geq 2$ and *all* $n$: +``` +numDistinctSizes F ≤ n - 3 +``` + +This is **false** for small values of $n$. Counterexample: + +> Let $n = 3$, $r = 2$, $F = \{\{0\}, \{1\}\}$. +> - `AllSubsetsOfRange`: all elements are $< 3$. ✓ +> - `IsAntichain`: $\{0\} \neq \{1\}$ and neither is a subset of the other. ✓ +> - `HasMinMultiplicity 2`: size 1 appears twice. ✓ +> - `numDistinctSizes F = 1`, but $n - 3 = 0$ in $\mathbb{N}$. +> - $1 \leq 0$ is **false**. + +Similarly fails for $n = 2$ with the same family. + +**Fix:** Add a hypothesis such as `n ≥ 4` (or even `n ≥ some_value`), or weaken the conclusion to `numDistinctSizes F ≠ n - 2` (which more directly captures "n-2 is never achievable"). The latter formulation avoids needing to pin down the exact threshold and more faithfully reflects the prose on the website. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Custom `IsAntichain` should use Mathlib's version (see Problem 497 for precedent) | +| Citations | Missing [Gu83] reference from the website | +| Variants | Core open question (growth rate) not captured; existence may already be known | +| Readability | Good | +| Formalizability | Low ambiguity for formalized parts; growth-rate question is inherently hard to formalize | +| Correctness | **`upper_bound` is false for small $n$** (e.g., $n=2,3$); other statements appear correct | diff --git a/ai-review/777.md b/ai-review/777.md new file mode 100644 index 0000000000..9d2ef79317 --- /dev/null +++ b/ai-review/777.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 777 + +## 1. Code Reuse + +The `comparableEdges` definition (line 39–40) uses the standard `(F ×ˢ F).filter(…).card` pattern found throughout the codebase: +- Problem 667 defines `edgesInSubset` with `((S ×ˢ S).filter fun e => e.1 < e.2 ∧ G.Adj e.1 e.2).card` +- Problem 563 defines `edgesOfColorInSubset` with the same pattern +- Problems 745/746 define `edgeCount` functions similarly + +Since `comparableEdges` is semantically distinct (it counts subset-comparable pairs in a set family, not graph edges on `Fin n`), there is no existing definition that could be directly reused. The definition is appropriate and problem-specific. + +No reusable infrastructure was found in `FormalConjecturesForMathlib/` for this particular concept. The closest related code is in `Combinatorics/SetFamily/VCDim.lean` (shattering/monotonicity for set families) and `Data/Finset/Powerset.lean`, but neither provides a comparable-pairs counter. + +**Verdict:** No code reuse issues. + +## 2. Citations + +The website [erdosproblems.com/777](https://www.erdosproblems.com/777) lists the following references: +- **[Gu83]** — Primary source (Gunderson/Gupta) +- **[AlFr85]** — Alon & Frankl (resolved Questions 2 and 3) +- **[ADGS15]** — Alon, Das, Glebov, and Sudakov (resolved Question 1) + +The formalization's module docstring mentions the solvers by name ("Alon, Das, Glebov, and Sudakov" for Q1; "Alon and Frankl" for Q2 and Q3) but does not include the reference tags **[Gu83]**, **[AlFr85]**, or **[ADGS15]**. These should be added for traceability. The docstring also attributes the problems to "Daykin and Erdős," which matches the website. + +Additionally, the website notes that Daykin and Frankl proved a related result: $(1 + o(1))\binom{m}{2}$ edges implies $m^{1/n} \to 1$ as $n \to \infty$. This is not mentioned in the formalization (nor does it need to be, since it's a separate result rather than a variant). + +## 3. Variants + +All three questions from the website are captured: + +| Question | Status | Formalization | +|----------|--------|---------------| +| Q1: $\|F\| \leq (2-\varepsilon)2^{n/2} \Rightarrow$ edges $< 2^n$? | Solved (yes) | `erdos_777` with `answer(True)` | +| Q2: edges $\geq cm^2 \Rightarrow m \ll_c 2^{n/2}$? | Solved (no) | `erdos_777.variants.q2` with `answer(False)` | +| Q3: edges $> m^{2-\delta} \Rightarrow m < (2+\varepsilon)^{n/2}$? | Solved (yes) | `erdos_777.variants.q3` with `answer(True)` | + +**No missing variants.** The formalization covers all three questions posed on the website. + +## 4. Readability + +The code is well-structured and readable overall. A few minor notes: + +- The `comparableEdges` docstring is slightly confusing: it first describes the count as "the number of ordered pairs $(A, B)$" and then says "each unordered comparable pair $\{A, B\}$ is counted exactly once." Both statements are true (the filter on ordered pairs is asymmetric due to $A \subseteq B$, so each unordered comparable pair produces exactly one match), but the juxtaposition could mislead a reader into thinking there's a contradiction. Rewording to emphasize the asymmetry would help, e.g.: "Counts the number of pairs $(A, B)$ with $A \subsetneq B$, which equals the number of edges." + +- The use of `(n : ℝ) / 2` for `n/2` in the exponent (rather than integer division) is correct and matches the original problem's intent. This is a good choice. + +- The `ε < 2` guard in Q1 is a sensible technical addition: for $\varepsilon \geq 2$, the hypothesis $(2-\varepsilon) \cdot 2^{n/2} \leq 0$ makes the condition vacuously true, so excluding this range is cleaner without changing the mathematical content. + +## 5. Formalizability + +**Ambiguity level: Very low.** All three questions are precisely stated quantitative claims with clear quantifier structure. The original problem uses standard combinatorial notation ($m$, $\ll_c$, $o(\cdot)$) that translates directly into formal statements. + +The one interpretation choice is whether "family of subsets" means a set or multiset of subsets. The formalization uses `Finset (Finset (Fin n))`, which enforces no duplicate members. This is the standard interpretation in extremal combinatorics and is correct. + +The Vinogradov notation $m \ll_c 2^{n/2}$ in Q2 is correctly formalized as $\exists C > 0, \forall n, \forall F, \ldots \Rightarrow |F| \leq C \cdot 2^{n/2}$ (with $C$ depending on $c$ but not on $n$). + +## 6. Correctness + +### `comparableEdges` — **Correct** + +The definition counts ordered pairs $(A, B) \in F \times F$ with $A \neq B$ and $A \subseteq B$. Since $F$ is a `Finset` (no duplicates), $A \neq B \wedge A \subseteq B$ is equivalent to $A \subsetneq B$. For each unordered comparable pair $\{A, B\}$ with $A \subsetneq B$, only the ordered pair $(A, B)$ passes the filter (not $(B, A)$, since $B \not\subseteq A$). Thus the count equals the number of edges in the comparability graph. Correct. + +### `erdos_777` (Question 1) — **Correct** + +The formalization faithfully captures: for all $\varepsilon \in (0, 2)$, for sufficiently large $n$, any family of $\leq (2-\varepsilon) \cdot 2^{n/2}$ subsets has fewer than $2^n$ comparable pairs. The docstring mentions $\lfloor (2-\varepsilon) \cdot 2^{n/2} \rfloor$ but the code uses a real-valued comparison `(F.card : ℝ) ≤ (2 - ε) * 2^{n/2}`, which is equivalent since `F.card` is an integer. The `answer(True)` tag correctly reflects the affirmative resolution. + +### `erdos_777.variants.q2` (Question 2) — **Correct** + +The RHS formalizes "$m \ll_c 2^{n/2}$" as: for all $c > 0$, there exists $C > 0$ such that for all $n$ and $F$, edges $\geq c \cdot |F|^2 \Rightarrow |F| \leq C \cdot 2^{n/2}$. The `answer(False)` tag correctly reflects the negative resolution: the negation (there exists $c > 0$ such that arbitrarily large families violate the bound despite having $\geq cm^2$ edges) matches the counterexample described on the website. + +Note: for $c \geq 1/2$, the hypothesis `comparableEdges ≥ c \cdot |F|^2` is unsatisfiable for large $|F|$ (since comparable edges $\leq \binom{|F|}{2} < |F|^2/2$), but this does not affect correctness—it simply means the statement is vacuously true for such $c$, and the falsifying $c$ in the counterexample is small ($\approx 2^{-5}/2$). + +### `erdos_777.variants.q3` (Question 3) — **Correct** + +The formalization captures: for all $\varepsilon > 0$, there exists $\delta > 0$ such that for all $n$ and $F$, edges $> |F|^{2-\delta} \Rightarrow |F| < (2+\varepsilon)^{n/2}$. The `answer(True)` tag correctly reflects the affirmative resolution. + +Technical note on `rpow`: `(F.card : ℝ) ^ ((2 : ℝ) - δ)` uses `Real.rpow`. When `F.card = 0` and $\delta < 2$ (the intended regime), $0^{2-\delta} = 0$, so the hypothesis $0 > 0$ is false and the statement holds vacuously. No edge cases cause issues since the existential on $\delta$ only needs to produce a small positive value. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No issues; `comparableEdges` is appropriately problem-specific | +| Citations | Missing reference tags [Gu83], [AlFr85], [ADGS15] from the website | +| Variants | All three questions are captured; no missing variants | +| Readability | Good; minor docstring clarity improvement suggested for `comparableEdges` | +| Formalizability | Very low ambiguity; all statements are precisely quantitative | +| Correctness | **All three statements and the helper definition are mathematically correct** | diff --git a/ai-review/778.md b/ai-review/778.md new file mode 100644 index 0000000000..cfbb763bc7 --- /dev/null +++ b/ai-review/778.md @@ -0,0 +1,81 @@ +# AI Review: Erdős Problem 778 + +## 1. Code Reuse + +**`cliqueNumber` is duplicated.** The definition at line 61–62: + +```lean +noncomputable def cliqueNumber {n : ℕ} (G : SimpleGraph (Fin n)) : ℕ := + sSup {k : ℕ | ¬G.CliqueFree k} +``` + +is identical to `cliqueNumber627` in `FormalConjectures/ErdosProblems/627.lean` (line 45–46). Both use `sSup {k : ℕ | ¬G.CliqueFree k}`. These should be consolidated into a single shared definition (e.g., in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean`, which already defines the related `ecliqueNum`). + +**`GameState` / `Strategy` / `playGame` pattern.** Problem 872 (`FormalConjectures/ErdosProblems/872.lean`) implements a similar two-player combinatorial game framework with `LegalStrategy`, `playGame`, and legality enforcement. Problem 778's `GameState`/`Strategy` types are structurally similar but lack legality constraints (see Correctness below). There is no shared game framework in the codebase; one could be beneficial but is not strictly necessary given how different the games are. + +## 2. Citations + +The website (erdosproblems.com/778) lists: + +- **[Gu83]** Guy, R.K., *Unsolved Problems in Number Theory*, 1983. +- **[MaSp24]** Malekshahian, A. and Spiro, S., 2024. + +The docstring references match these but are incomplete: +- **[Gu83]** — OK, matches the website. +- **[MaSp24]** — The docstring says "Malekshahian, A. and Spiro, S., 2024" with no title or publication venue. The website attributes them with proving density ≥ 3/4 for Game 1 and density ≥ 2/3 for Game 3. The citation should ideally include the paper title if available on the website. + +## 3. Variants + +The website describes **three** game variants: + +1. **Standard game** (alternating, Alice first, Alice wins if largest red clique > largest blue clique) — **formalized as `erdos_778`**. +2. **Modified (1-vs-2) game** (Alice colors 1 edge, Bob colors 2 per round, Bob wins if his largest clique is strictly larger) — **formalized as `erdos_778.variants.modified_game`**. +3. **Maximum degree variant** (Alice wins if the maximum degree of the red subgraph exceeds the maximum degree of the blue subgraph) — **NOT formalized**. + +The third variant (degree-based winning condition) is missing from the formalization. Malekshahian and Spiro proved results for this variant too (Bob wins on a set of n with density ≥ 2/3). This should be added as `erdos_778.variants.max_degree_game` or similar. + +## 4. Readability + +The code is generally well-structured and readable. A few observations: + +- The `opaque` declarations for `playStandardGame` and `playModifiedGame` are clean but provide no computational content or specification. While this is acceptable for stating conjectures, it means there's no way to verify that these functions actually implement the described game rules. Problem 872 provides a concrete `playGame` implementation, which is more informative. +- The `GameState` type lacks an invariant ensuring `red` and `blue` are disjoint and that edges are non-diagonal (i.e., elements of the form `s(v, v)` are excluded). Adding a docstring noting these implicit invariants would help. +- The cast `(final.blue : Set (Sym2 (Fin n)))` in the theorem statements is slightly noisy but necessary. No improvement needed. + +## 5. Formalizability + +**Assessment: Moderately formalizable, with some ambiguity.** + +The problem statement is clear in its combinatorial setup but has several sources of ambiguity: + +- **Winning condition for Part 1:** The docstring says "Alice wins if her largest red clique is larger than any of the blue cliques," but the formalization uses `≥` (Bob wins if `blue clique number ≥ red clique number`). This is consistent: Bob "wins" means Alice does not win, i.e., the blue clique number is at least as large. This is correct. +- **Tie-breaking:** The problem asks whether Bob has a "winning strategy." The formalization interprets "Bob wins" as "blue clique ≥ red clique" (Part 1) and "blue clique > red clique" (Part 2). This is a natural interpretation, but the website says "Alice wins if her largest red clique exceeds any blue clique," meaning ties go to Bob. This matches the formalization. +- **Edge selection legality:** The formalization does not enforce that strategies pick uncolored edges. A `Strategy` could return an already-colored edge or a diagonal. The `opaque` play functions presumably handle this, but without specification, the correctness of the game simulation is unverifiable. +- **Game termination:** It's implicit that the game ends when all edges of K_n are colored. The `opaque` functions presumably guarantee this, but again, no specification is provided. + +Overall, the mathematical content is precise enough to be formalized, but the current approach delegates critical game mechanics to opaque functions. + +## 6. Correctness + +### Issues identified: + +**(a) Missing legality enforcement in `Strategy` type.** The `Strategy` type is simply `GameState n → Sym2 (Fin n)` — it can return any pair, including already-colored edges or diagonal pairs `s(v, v)`. Compare with Problem 872, where `LegalStrategy` is defined as a function that, given a nonempty set of legal moves, returns an element of that set. This is a significant gap: without legality constraints, the theorems are technically stronger than intended (existential quantification over a larger strategy space for Bob, universal quantification over a larger space for Alice) but also potentially unsound if `playStandardGame` doesn't handle illegal moves properly. + +**(b) `cliqueNumber` may be ill-defined.** The definition `sSup {k : ℕ | ¬G.CliqueFree k}` takes the supremum over all `k` such that `G` is not `k`-clique-free. For finite graphs, this set is bounded above (by `n`), so `sSup` returns a natural number. However, if the graph has no edges, the set `{k : ℕ | ¬G.CliqueFree k}` equals `{0, 1}` (since every graph has a 0-clique and 1-clique trivially — actually, `CliqueFree k` means there's no `k`-clique, and a single vertex is a 1-clique). For the empty graph on 0 vertices, the set could be `{0}` only. The definition works but relies on Lean's `sSup` for `ℕ` returning 0 for unbounded or empty sets, which could lead to subtle issues. This is the same approach used in Problem 627, so it's at least consistent across the codebase. + +**(c) `fromEdgeSet` creates a graph with `Adj v w ↔ s(v,w) ∈ S ∧ v ≠ w`.** This correctly excludes self-loops, which is appropriate for `SimpleGraph`. No issue here. + +**(d) Winning condition asymmetry between Parts 1 and 2.** Part 1 uses `≥` (Bob wants blue clique number ≥ red) while Part 2 uses `>` (Bob wants blue clique number > red). This matches the problem description: in the standard game, Bob merely needs to prevent Alice from having a strictly larger clique, while in the modified game where Bob has an advantage (2 edges per turn), he should achieve a strictly larger clique. This is correct. + +**(e) Part 2 bound: `3 < n` vs `n > 3`.** The formalization uses `3 < n`, meaning `n ≥ 4`. The docstring says "for all $n > 3$." These are consistent. + +### Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | **Needs improvement** | `cliqueNumber` duplicated from Problem 627; should be shared | +| Citations | **Minor issues** | [MaSp24] lacks paper title | +| Variants | **Incomplete** | Missing the max-degree variant (Game 3) | +| Readability | **Good** | Clean structure, minor improvements possible | +| Formalizability | **Moderate** | Core math is precise; game mechanics delegated to opaque functions | +| Correctness | **Mostly correct** | Main concern: `Strategy` lacks legality constraints; `cliqueNumber` definition is consistent but could be cleaner | diff --git a/ai-review/78.md b/ai-review/78.md new file mode 100644 index 0000000000..268187a013 --- /dev/null +++ b/ai-review/78.md @@ -0,0 +1,145 @@ +# Review: Erdos Problem 78 + +**File:** `FormalConjectures/ErdosProblems/78.lean` + +--- + +## 1. Code Reuse + +**Issue: Multiple independent definitions of diagonal Ramsey numbers across the codebase.** + +The formalization in Problem 78 does *not* define a named Ramsey number; instead, it directly inlines the Ramsey property as `∃ G : SimpleGraph (Fin n), G.CliqueFree k ∧ Gᶜ.CliqueFree k`. Several other files define closely related diagonal Ramsey numbers: + +| File | Definition | Style | +|------|-----------|-------| +| `ErdosProblems/1029.lean` | `diagonalRamseyNumber k` | Edge-coloring (`Fin N → Fin N → Bool`) | +| `ErdosProblems/163.lean` | `ramseyDiag H` | `SimpleGraph` + `containsCopy` | +| `ErdosProblems/165.lean` | `ramseyR3 k` | `SimpleGraph` + `CliqueFree` + complement | +| `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` | `hypergraphRamsey r n` | Finset-based r-uniform coloring | + +Problem 78's inlined approach is equivalent to the `SimpleGraph`-based definitions (165, 163) for the diagonal case, and is mathematically equivalent to Problem 1029's edge-coloring formulation. + +**Recommendation:** The statement in Problem 78 is self-contained and clear without a named definition, so the current approach is acceptable. However, for consistency and future maintainability, the project would benefit from a shared `diagonalRamseyNumber` definition using the `SimpleGraph`/`CliqueFree` idiom (as in 165/166) that could be reused by Problems 78, 1029, and others. The `hypergraphRamsey 2 k` from `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` is the same concept for `r = 2`, but uses a different formalism (Finset-based colorings rather than `SimpleGraph`). Bridging these with a lemma `hypergraphRamsey 2 k = diagonalRamseyNumber k` would unify the two. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/78](https://www.erdosproblems.com/78):** + +The website lists the following references: +- Er69b, Er71, Er88, Er93 (p. 337), Er95, Er97c +- Va99 (3.49) +- Co15 (Cohen, 2015) +- Li23b (Li, 2023) + +The formalization's docstring mentions: +- Erdős's probabilistic proof that $R(k) \gg k \cdot 2^{k/2}$ (this is the classical result, referenced in Er69b and others) +- The $100 prize + +**Missing citations:** +- **Cohen (2015) [Co15]:** Constructed a graph with no clique or independent set of size $\geq 2^{(\log \log n)^C}$. This is the most significant partial progress and should be mentioned. +- **Li (2023) [Li23b]:** Improved to no clique or independent set of size $\geq (\log n)^C$. This is the current best result and should be mentioned. +- None of the Erdős references (Er69b, Er71, Er88, Er93, Er95, Er97c) are individually cited. Adding at least a couple of the primary references would be valuable. +- The OEIS sequence A059442 (diagonal Ramsey numbers) is not mentioned. + +**Recommendation:** Add a brief note about partial progress (Cohen 2015, Li 2023) and cite at least the primary Erdős references. + +--- + +## 3. Variants + +The formalization captures only the core statement: existence of $C > 1$ such that $R(k) > C^k$, formulated as the existence of a graph on $\geq C^k$ vertices with no $k$-clique and no $k$-independent set. + +**Missing variants:** + +1. **The $o(n^{1/2})$ variant (Er69b):** Erdős also asked for a construction where the largest clique or independent set has size $o(n^{1/2})$. The website notes this is now known. This is a distinct (weaker) request than the full exponential lower bound and could be stated: + ``` + theorem erdos_78_variant_sqrt : + ∃ (f : ℕ → ℕ), (∀ n, f n < n) ∧ Filter.Tendsto (fun n => (f n : ℝ) / n ^ (1/2 : ℝ)) Filter.atTop (nhds 0) ∧ + ∀ n, ∃ G : SimpleGraph (Fin n), G.CliqueFree (f n) ∧ Gᶜ.CliqueFree (f n) + ``` + +2. **The equivalent logarithmic formulation:** The docstring mentions the equivalent form (graph on $n$ vertices with no clique/independent set of size $\geq c \log n$), but this is not separately formalized. One could state: + ``` + theorem erdos_78_log : + ∃ c : ℝ, c > 0 ∧ ∀ n : ℕ, n ≥ 2 → + ∃ G : SimpleGraph (Fin n), + G.CliqueFree ⌈c * Real.log n⌉₊ ∧ Gᶜ.CliqueFree ⌈c * Real.log n⌉₊ + ``` + This is logically equivalent to the current statement but reads more naturally in the "construct a graph on $n$ vertices" framing. + +3. **Partial progress (Li 2023):** The current best constructive bound — no clique or independent set of size $(\log n)^C$ — could be formalized as a known result (not a conjecture). + +--- + +## 4. Readability + +The code is concise and well-structured. Specific observations: + +- **Docstring quality:** Excellent. The module-level and theorem-level docstrings clearly explain the problem, its context, the probabilistic lower bound, the equivalent reformulation, and the distinction between "constructive" (a proof-theoretic concern) and the formal statement. +- **Namespace:** `Erdos78` is appropriately scoped. +- **Statement clarity:** The inlined statement `∃ C : ℝ, C > 1 ∧ ∀ k : ℕ, k ≥ 2 → ∃ n : ℕ, (C ^ k : ℝ) ≤ ↑n ∧ ∃ G : SimpleGraph (Fin n), G.CliqueFree k ∧ Gᶜ.CliqueFree k` reads naturally and is easy to parse. +- **`open SimpleGraph`:** Appropriate — brings `CliqueFree` into scope cleanly. + +**Minor suggestion:** The phrase "an independent set of size $k$ in $G$ is a clique of size $k$ in $G^c$" in the docstring could be made slightly more precise: "an independent set of size $k$ in $G$ is equivalent to a clique of size $k$ in the complement $G^c$, by `SimpleGraph.isClique_compl`." This connects the informal explanation to the Mathlib API. + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Partially formalizable — the mathematical content is precise, but the core intent is not fully captured by any formal statement.** + +The fundamental tension with Problem 78 is that it asks for a *constructive* proof. Erdős's probabilistic argument already establishes the much stronger bound $R(k) \gg k \cdot 2^{k/2}$ (which trivially implies $R(k) > C^k$ for some $C > 1$), so the *existential* statement as formalized is already a theorem. The entire point of Problem 78 is that the proof should be constructive/explicit — one must *exhibit* the graph, not merely prove its existence probabilistically. + +This creates a genuine formalization challenge: + +- **In classical logic (Lean 4's default):** The existential statement is already provable from Erdős's probabilistic argument. So `erdos_78` as stated is not really "open" — it's a known theorem. What's open is the request for a *specific construction*. +- **In constructive type theory:** One could argue that a constructive proof of the existential automatically provides the construction (via the BHK interpretation). However, Lean 4 uses classical logic (`Classical.choice`, `propext`, etc.), so a `sorry`-free proof of the existential would not necessarily yield an explicit graph. +- **A more faithful formalization** might define a computable function `f : ℕ → SimpleGraph (Fin (g k))` for some explicit `g` and prove it has no large cliques. For example: + ``` + theorem erdos_78_constructive : + ∃ C : ℝ, C > 1 ∧ ∃ (g : ℕ → ℕ) (f : (k : ℕ) → SimpleGraph (Fin (g k))), + ∀ k, k ≥ 2 → (C ^ k : ℝ) ≤ ↑(g k) ∧ (f k).CliqueFree k ∧ (f k)ᶜ.CliqueFree k + ``` + Even this doesn't truly enforce "constructive" — one could fill `g` and `f` noncomputably. Making `f` and `g` `Decidable`/computable (no `noncomputable`) would be stronger. + +**Ambiguity level: Moderate.** The mathematical content (exponential lower bound on $R(k)$) is completely precise. The ambiguity lies entirely in what "constructive" means formally. The docstring correctly acknowledges this: "The 'constructive' requirement pertains to the nature of the proof, not the formal statement itself." This is a reasonable pragmatic choice. + +--- + +## 6. Correctness + +**The formalization is mathematically correct for the existential statement it captures, but it is arguably incomplete in its treatment of the problem's intent.** + +### Statement analysis + +```lean +theorem erdos_78 : + ∃ C : ℝ, C > 1 ∧ ∀ k : ℕ, k ≥ 2 → + ∃ n : ℕ, (C ^ k : ℝ) ≤ ↑n ∧ + ∃ G : SimpleGraph (Fin n), + G.CliqueFree k ∧ Gᶜ.CliqueFree k +``` + +- **The bound direction is correct:** The statement asks for a graph on $n \geq C^k$ vertices with no $k$-clique or $k$-independent set. This is the correct direction — it says $R(k) \geq n \geq C^k$, establishing an exponential lower bound on the Ramsey number. +- **Use of `CliqueFree k ∧ Gᶜ.CliqueFree k`:** Correct. By `SimpleGraph.isClique_compl`, a clique in $G^c$ is an independent set in $G$, so this simultaneously forbids $k$-cliques and $k$-independent sets, which is exactly the Ramsey condition. +- **The constraint `k ≥ 2`:** Appropriate. For $k = 0$ and $k = 1$, `CliqueFree k` has degenerate behavior (any graph is `CliqueFree 0`; `CliqueFree 1` means the graph has no vertices). Requiring $k \geq 2$ avoids these edge cases. +- **$C$ is real-valued:** Using `C : ℝ` with `C > 1` is correct. The statement only needs $C > 1$ (e.g., $C = \sqrt{2}$ from the probabilistic argument). +- **$n$ is existentially quantified per $k$:** This is correct — for each $k$, we need a graph on some number of vertices $n \geq C^k$. +- **`Fin n` as vertex type:** Standard in the codebase. Since `n` is existentially quantified, this correctly models "a graph on $n$ vertices." + +### Potential issue: the statement is too weak + +As discussed in Section 5, the existential statement (without a constructiveness requirement) is already known to be true from the probabilistic method. The statement as written is therefore more accurately categorized as `solved` rather than `open`. The `@[category research open, AMS 5]` tag is misleading if one takes the formal statement at face value. + +However, this is a deliberate modeling choice documented in the docstring, reflecting the project's pragmatic approach: the formal statement captures the mathematical content, while the "open" status reflects the problem's actual status (the constructive version remains open). This is a reasonable compromise. + +### Minor observations + +- The formalization does not require `DecidableRel G.Adj`, which is fine since `CliqueFree` is a `Prop` and doesn't need decidability. +- The graph $G$ is not required to have `DecidableEq` on its vertex type, which is also fine since `Fin n` has this instance automatically. + +**Verdict: Correct.** The mathematical content is faithfully captured. The incompleteness (inability to express "constructive") is inherent to the problem and is properly documented. An experienced mathematician would note that the statement as written is already provable (via the probabilistic method) and that the real content of the problem lies in the proof method, not the statement — but this is acknowledged in the docstring. diff --git a/ai-review/780.md b/ai-review/780.md new file mode 100644 index 0000000000..d06fe4f86c --- /dev/null +++ b/ai-review/780.md @@ -0,0 +1,85 @@ +# AI Review — Erdős Problem 780 + +## 1. Code Reuse + +Several related formalizations exist in the codebase that share structural patterns with 780: + +- **`ErdosProblems/1020.lean`** defines `IsRUniform` and `HasMatching` for hypergraphs represented as `Finset (Finset (Fin n))`. Problem 780 uses an alternative representation — the subtype `{s : Finset (Fin n) // s.card = r}` — which bakes the uniformity constraint into the type rather than requiring a separate predicate. The 780 approach is arguably cleaner for this specific theorem, since the coloring function's domain is exactly the complete r-uniform hypergraph. However, a shared `HasMatching`-style definition or a common notion of "k pairwise disjoint r-subsets" could reduce duplication. + +- **`ErdosProblems/835.lean`** uses the identical subtype pattern `{s : Finset (Fin (2 * k)) // s.card = k}` and explicitly connects to Kneser/Johnson graph chromatic numbers. This is a closely related problem family, and there may be value in a shared definition of this subtype (e.g., a `UniformEdge n r` abbreviation). + +- **`FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`** defines `hypergraphRamsey` using a related pattern for r-uniform edges but with a different goal (Ramsey numbers vs. chromatic numbers). + +**Recommendation:** Consider extracting a common abbreviation for "r-element subsets of Fin n" (used identically in 780 and 835) into a shared utility, and potentially a shared predicate for "k pairwise disjoint edges of a given color." + +## 2. Citations + +The formalization includes: +- **[Lo78]** — Lovász 1978 (Kneser's conjecture, k=2 case) ✓ +- **[AFL86]** — Alon, Frankl, Lovász 1986 (general case) ✓ + +**Missing from the formalization but present on the website:** +- **[Er76]** — The original source attribution for the problem (Erdős 1976). The website lists this as the original reference. It should be included in the docstring for completeness. + +The existing citations [Lo78] and [AFL86] are correctly formatted with full bibliographic details. + +## 3. Variants + +The formalization captures only the main theorem. The following variants from the website and mathematical literature are **not** included: + +- **Tightness of the bound.** The website explicitly states the bound is best possible: when `n = kr - 1 + (t-1)(k-1)`, a counterexample exists via a partition-based coloring. Formalizing this sharpness result (i.e., exhibiting a t-coloring of the complete r-uniform hypergraph on `n = kr + (t-1)(k-1) - 1` vertices with no monochromatic matching of size k) would strengthen the formalization and is a natural companion statement. + +- **The k=2 case (Kneser's conjecture)** is mentioned in the docstring but not stated as a separate lemma. Given its historical significance (Lovász's topological proof was a landmark), it could be worth isolating as a corollary. + +**Recommendation:** Add at least a sharpness/optimality variant. + +## 4. Readability + +The code is clean and well-structured. A few minor notes: + +- **Docstring inaccuracy:** The module docstring says "this problem asks to determine the chromatic number of the Kneser graph." For general k, it determines the chromatic number of the Kneser **hypergraph** `KG^k(n,r)`, not the Kneser graph `KG(n,r)`. The Kneser graph case corresponds only to `k = 2`. This should be corrected to "Kneser hypergraph" for mathematical precision. + +- The theorem signature is clear. The use of `Fin k` to index the pairwise disjoint edges is a natural choice that makes the pairwise disjointness quantifier clean. + +- The hypotheses `hk : k ≥ 1`, `hr : r ≥ 1`, `ht : t ≥ 1` are appropriate guards for natural number subtraction safety. They are strictly necessary for the statement to be non-vacuous. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is entirely combinatorial and finitary. Every concept — r-uniform hypergraph, t-coloring, pairwise disjoint edges — has a direct Lean representation. There is no measurability, topology, or analytic subtlety. The formalization faithfully captures the intended combinatorial content. + +The only minor interpretive question is whether "edges of the complete r-uniform hypergraph" means all r-element subsets (as formalized) or could be read differently — but the standard meaning is unambiguous here. The formalization is correct. + +## 6. Correctness + +**Assessment: Mathematically correct and complete for the stated problem.** + +Detailed verification: + +- **Complete r-uniform hypergraph.** The type `{s : Finset (Fin n) // s.card = r}` correctly represents all r-element subsets of an n-element ground set. ✓ + +- **t-coloring.** The function `c : {s : Finset (Fin n) // s.card = r} → Fin t` is a total function from edges to t colors. This correctly models a t-coloring (no "proper" constraint needed — this is edge coloring of the complete hypergraph, not a graph-theoretic proper coloring). ✓ + +- **Monochromatic matching.** The conclusion asks for `i : Fin t` and `edges : Fin k → ...` such that all edges have color `i` and are pairwise disjoint. This is exactly a monochromatic matching of size k. ✓ + +- **Bound.** The hypothesis `n ≥ k * r + (t - 1) * (k - 1)` matches the problem statement. Verification against the Kneser conjecture (k=2): this gives `n ≥ 2r + t - 1`, i.e., `t ≤ n - 2r + 1`, which matches the known chromatic number `χ(KG(n,r)) = n - 2r + 2`. ✓ + +- **Natural number subtraction.** The expression `(t - 1) * (k - 1)` involves ℕ subtraction, which truncates at 0. Since `ht : t ≥ 1` and `hk : k ≥ 1` are assumed, `t - 1` and `k - 1` are well-defined and match their integer counterparts. ✓ + +- **Edge cases.** When `k = 1`, the bound becomes `n ≥ r`, the disjointness condition is vacuous (no two distinct elements of `Fin 1`), and the conclusion is trivially satisfiable. When `t = 1`, the bound is `n ≥ kr`, and the single color class contains all edges, which always has k pairwise disjoint r-subsets when `n ≥ kr`. Both cases are handled correctly. ✓ + +**No mathematical flaws identified.** The formalization is a faithful rendering of the Alon–Frankl–Lovász theorem. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Shared subtype pattern with 835.lean; `HasMatching` in 1020.lean uses different representation. Minor opportunity for a shared abbreviation. | +| Citations | Missing [Er76] original source reference. [Lo78] and [AFL86] are correct. | +| Variants | Missing tightness/optimality of the bound. k=2 special case not isolated. | +| Readability | Good. "Kneser graph" should read "Kneser hypergraph" in docstring. | +| Formalizability | Unambiguous. Entirely combinatorial and finitary. | +| Correctness | Mathematically correct. No flaws found. | diff --git a/ai-review/781.md b/ai-review/781.md new file mode 100644 index 0000000000..2f1e6fceef --- /dev/null +++ b/ai-review/781.md @@ -0,0 +1,99 @@ +# AI Review: Erdős Problem 781 + +## 1. Code Reuse + +The formalization is self-contained with its own definitions (`IsDescendingWave`, `HasMonochromaticDescendingWave`, `descendingWaveNumber`). Several other Erdős problem files use very similar structural patterns: + +- **`sInf`-based Ramsey number pattern**: Problems 77, 129, 161, 162, 531, 1015 all define a minimal-$n$ threshold via `sInf {n : ℕ | ∀ c : Fin n → ..., ...}`. There is also `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` which defines `hypergraphRamsey` using `sInf` with helper lemmas (`le_hypergraphRamsey`, `hypergraphRamsey_self`). However, the descending wave problem is not a hypergraph Ramsey problem, so those lemmas are not directly applicable. + +- **Monochromatic subsequence pattern**: Problems 8, 187, 984 use similar `∃ a : Bool, ∀ i, c (x i) = a` existential color witness patterns. Problem 1026 defines `IsIncreasingSubseq`/`IsDecreasingSubseq` for monotone subsequences, which is structurally related but not reusable here. + +**Assessment**: No existing definition can replace the custom definitions in this file. The descending wave condition (non-increasing gaps) is specific enough that a bespoke definition is warranted. The structural patterns (sInf, monochromatic witness) are consistent with codebase conventions. + +## 2. Citations + +The formalization includes two references: + +- **[BEF90]**: "Brown, T. C., Erdős, P., and Freedman, A. R., *Quasi-progressions and descending waves*. J. Combin. Theory Ser. A **53** (1990), 81-95." — Matches the website attribution to Brown, Erdős, and Freedman. + +- **[AlSp89]**: "Alon, N. and Spencer, J., *Ascending waves*. J. Combin. Theory Ser. A **52** (1989), 275-287." — Matches the website attribution to Alon and Spencer for the disproof. + +The website provides only short-form references (author names and tags). The formalization provides full bibliographic details, which is strictly better. **No citation issues identified.** + +## 3. Variants + +The website states: +- BEF proved $k^2 - k + 1 \leq f(k) \leq (k^3 - 4k + 9)/3$. +- BEF conjectured $f(k) = k^2 - k + 1$. +- Alon and Spencer disproved the conjecture by proving $f(k) \gg k^3$. + +The formalization captures: +1. `erdos_781` — Alon–Spencer $f(k) \geq C k^3$ (main result / disproof). +2. `erdos_781.variants.bef_lower_bound` — BEF lower bound $f(k) \geq k^2 - k + 1$. +3. `erdos_781.variants.bef_upper_bound` — BEF upper bound $f(k) \leq (k^3 - 4k + 9)/3$. + +The disproved conjecture $f(k) = k^2 - k + 1$ is not stated as a separate (negated) theorem, but this is implicitly captured: the Alon–Spencer result immediately implies $f(k) \neq k^2 - k + 1$ for large $k$. Stating the disproved conjecture separately would be redundant. + +**Assessment**: All variants from the website are captured. No missing content. + +## 4. Readability + +The code is well-structured and readable: + +- The docstrings are thorough, with LaTeX-formatted mathematical statements and full citations. +- The `IsDescendingWave` definition includes a helpful "equivalently" remark connecting the pointwise condition to the non-increasing gaps interpretation. +- The namespace `Erdos781` avoids polluting the global scope. +- The variant naming convention (`erdos_781.variants.bef_lower_bound`) is clear and descriptive. + +**Minor suggestion**: The comment on `IsDescendingWave` says "gaps $x(j+1) - x(j)$ are non-increasing" — this is the equivalent characterization, which aids understanding. + +**Assessment**: No readability issues. + +## 5. Formalizability + +The problem is highly formalizable: + +- **"Descending wave"** is a precisely defined combinatorial object: a strictly increasing sequence with non-increasing consecutive gaps. No ambiguity. +- **$f(k)$** is a well-defined minimum (shown to exist by the BEF upper bound). The use of `sInf` correctly handles this, returning the true minimum when the set is nonempty. +- **The Alon–Spencer bound** $f(k) \gg k^3$ is formalized as $\exists C > 0, \exists K_0, \forall k \geq K_0, f(k) \geq C k^3$, which is a standard and unambiguous rendering of asymptotic notation. +- **The BEF bounds** are explicit inequalities with no ambiguity. + +**One subtlety**: the `sInf` of the empty set is 0 in ℕ. For $k = 0$, the set is nonempty (the empty sequence is vacuously a monochromatic descending wave in any coloring, so $n = 0$ works), giving $f(0) = 0$. For $k \geq 1$, the BEF upper bound guarantees the set is nonempty. This is not a problem for the theorem statements (which have hypotheses $k \geq 1$ or $k \geq 2$), but the `descendingWaveNumber` definition is well-behaved regardless. + +**Assessment**: Fully formalizable, no ambiguity concerns. + +## 6. Correctness + +### Definition: `IsDescendingWave` + +The condition `2 * (x j).val ≥ (x ⟨j.val + 1, hj⟩).val + (x ⟨j.val - 1, by omega⟩).val` correctly formalizes $x_j \geq (x_{j+1} + x_{j-1})/2$ by multiplying both sides by 2 (avoiding ℕ division). The interior index constraint `0 < j.val` and `j.val + 1 < k` correctly identifies $1 < j < k$ in 0-based indexing. **Correct.** + +### Definition: `descendingWaveNumber` + +Uses `sInf` over $\{n \mid \forall c : \text{Fin } n \to \text{Bool}, \ldots\}$. This correctly captures the minimal $n$ such that every 2-coloring has a monochromatic $k$-term descending wave. **Correct.** + +### Indexing: $\{0, \ldots, n-1\}$ vs $\{1, \ldots, n\}$ + +The original problem uses $\{1, \ldots, n\}$ while the formalization uses $\text{Fin } n = \{0, \ldots, n-1\}$. The descending wave condition is translation-invariant: if $(x_1, \ldots, x_k)$ satisfies $x_j \geq (x_{j+1} + x_{j-1})/2$, then so does $(x_1 + c, \ldots, x_k + c)$ for any constant $c$. Since 2-colorings of $\{0, \ldots, n-1\}$ biject with 2-colorings of $\{1, \ldots, n\}$ (via the shift), $f(k)$ is the same under either convention. **No issue.** + +### Theorem: `erdos_781` (Alon–Spencer) + +States $\exists C > 0, \exists K_0, \forall k \geq K_0, f(k) \geq C k^3$. The cast to ℝ is necessary (since $C$ may not be an integer) and correctly done. This is the standard formalization of $f(k) = \Omega(k^3)$. **Correct.** + +### Theorem: `bef_lower_bound` + +States `descendingWaveNumber k ≥ k ^ 2 - k + 1` for `k ≥ 1`. In ℕ, `k ^ 2 - k + 1` is well-defined for `k ≥ 1` (since $k^2 \geq k$). **Correct.** + +### Theorem: `bef_upper_bound` + +States `descendingWaveNumber k ≤ (k ^ 3 - 4 * k + 9) / 3` for `k ≥ 2`. Two concerns: +1. **ℕ subtraction underflow**: $k^3 - 4k$ requires $k^3 \geq 4k$, i.e., $k^2 \geq 4$, which holds for $k \geq 2$. ✓ +2. **ℕ division (floor)**: $(k^3 - 4k + 9) \mod 3 = 0$ for all $k$ (verified: $k \equiv 0, 1, 2 \pmod{3}$ all yield $k^3 - 4k + 9 \equiv 0 \pmod{3}$). So the ℕ division is exact and matches the intended bound. ✓ + +**Correct.** + +### Overall Mathematical Assessment + +The formalization is mathematically correct and complete. All definitions faithfully capture the intended concepts, the theorem statements match the known results, and the ℕ arithmetic (subtraction, division, multiplication by 2) is handled carefully to avoid pitfalls. An experienced mathematician would not identify any flaws. + +**Verdict: Correct and complete.** diff --git a/ai-review/782.md b/ai-review/782.md new file mode 100644 index 0000000000..c56ae56f10 --- /dev/null +++ b/ai-review/782.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 782 + +## 1. Code Reuse + +**Quasi-progression (Part 1):** The quasi-progression condition is encoded inline in the theorem statement rather than as a reusable predicate. The existing `Set.IsAPOfLengthWith` infrastructure in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean` formalizes *exact* arithmetic progressions (`a + n • d`), which is conceptually related but structurally different — a quasi-progression relaxes the exact gap to a gap within `[d, d + C]`. Defining a standalone `IsQuasiProgression` predicate (analogous to `IsDescendingWave` in `781.lean`) would improve modularity and enable reuse if quasi-progressions appear in future problems. + +**Combinatorial cube (Part 2):** The combinatorial cube is also encoded inline. No existing codebase definition captures this structure. A standalone `IsCombinatorialCube` predicate could be useful, but given it only appears in this problem, the inline encoding is acceptable for now. + +**`IsSquare`:** The use of `IsSquare` from Mathlib is consistent with many other Erdős problems in the codebase (e.g., 121, 363, 374, 437, 438, 439). No issues here. + +**Verdict:** Minor opportunity — extracting a `IsQuasiProgression` predicate would parallel the design of `781.lean` (which defines `IsDescendingWave`), but is not strictly necessary. + +## 2. Citations + +**Website (erdosproblems.com/782)** states: +- Original source: Brown, Erdős, and Freedman [BEF90] +- Solymosi [So07] conjectured the answer to Part 2 is **no** +- Cilleruelo and Granville [CiGr07] showed Part 2's answer is no assuming the Bombieri–Lang conjecture + +**Current formalization** cites: +- `[BEF90] Brown, T. C., Erdős, P., and Freedman, A. R., Quasi-progressions and descending waves. J. Combin. Theory Ser. A 53 (1990), no. 1, 81-95.` ✅ Correct and complete. + +**Missing from docstring:** +- The website mentions Solymosi's 2007 conjecture that Part 2's answer is **no**, and Cilleruelo–Granville's conditional disproof under Bombieri–Lang. These are significant pieces of context — especially because they suggest the expected answer for both parts may be **no** (since Part 1 ⟹ Part 2). Including these references would better reflect the current state of knowledge: + - `[So07] Solymosi, J.` (conjectured answer to Part 2 is no) + - `[CiGr07] Cilleruelo, J. and Granville, A.` (answer to Part 2 is no under Bombieri–Lang) + +## 3. Variants + +The formalization captures two parts: +1. **Part 1:** Quasi-progressions in the squares ✅ +2. **Part 2 (variant):** Combinatorial cubes in the squares ✅ + +The website explicitly presents these as the two components of the problem, and the formalization correctly labels Part 2 as `erdos_782.variants.cubes`. The implication (Part 1 ⟹ Part 2) is documented in the docstring. + +**No missing variants.** The problem is fully covered. + +## 4. Readability + +**Strengths:** +- Clear docstrings with LaTeX math rendering +- Good naming: `erdos_782` and `erdos_782.variants.cubes` +- The `open Finset` and `open scoped BigOperators` are appropriate for the `∑` notation + +**Suggestions:** +- The index manipulation in Part 1 (`⟨i, by omega⟩`, `⟨i + 1, hi⟩`) is somewhat dense but unavoidable in Lean 4 with `Fin`. This is standard practice. +- The condition `d > 0` in Part 1 is important to prevent degenerate quasi-progressions; its presence is correct and well-placed. + +**Verdict:** Readability is good. No significant issues. + +## 5. Formalizability + +**Part 1 (Quasi-progressions):** The mathematical statement is precise and unambiguous. It asks for the existence of a universal constant `C` (independent of `k`) such that for every `k ≥ 2`, one can find `k` squares forming a quasi-progression. The formalization correctly captures this as `∃ C, ∀ k, k ≥ 2 → ...`. **No ambiguity.** + +**Part 2 (Combinatorial cubes):** Also precise. For every dimension `m`, one must find `a` and positive `b₁, ..., bₘ` such that `a + ∑_{i ∈ S} bᵢ` is a perfect square for every subset `S`. The formalization captures this exactly. **No ambiguity.** + +**Assessment:** Both parts are precisely formalizable. The original BEF90 paper poses these as clear yes/no questions, and the Lean statements faithfully encode them. + +## 6. Correctness + +**Part 1 — detailed analysis:** + +The statement is: +``` +∃ C : ℕ, ∀ k : ℕ, k ≥ 2 → + ∃ (x : Fin k → ℕ) (d : ℕ), d > 0 ∧ + (∀ i, IsSquare (x i)) ∧ + (∀ i j : Fin k, i < j → x i < x j) ∧ + (∀ (i : ℕ) (hi : i + 1 < k), + x ⟨i, by omega⟩ + d ≤ x ⟨i + 1, hi⟩ ∧ + x ⟨i + 1, hi⟩ ≤ x ⟨i, by omega⟩ + d + C) +``` + +- ✅ `C : ℕ` — correct; the constant is a natural number (the original paper considers integer-valued gaps, and a natural number bound suffices). +- ✅ `d > 0` — prevents degenerate solutions where `d = 0` and all `x_i` are the same square. +- ✅ Strict monotonicity `x i < x j` for `i < j` — correct, ensures distinct ordered squares. +- ✅ Quasi-progression condition: `x_i + d ≤ x_{i+1} ≤ x_i + d + C` — matches the definition from BEF90. +- ✅ The `answer(sorry)` wrapper correctly indicates an open problem whose truth value is unknown. + +**Potential concern:** The strict monotonicity condition is actually *redundant* given `d > 0` and `x_i + d ≤ x_{i+1}`. If `d > 0` and `x_i + d ≤ x_{i+1}`, then `x_i < x_{i+1}`, which by transitivity gives `x_i < x_j` for `i < j`. This is not an error — just a minor redundancy that could be cleaned up. + +**Part 2 — detailed analysis:** + +The statement is: +``` +∀ m : ℕ, ∃ (a : ℕ) (b : Fin m → ℕ), + (∀ i, b i > 0) ∧ + (∀ S : Finset (Fin m), IsSquare (a + ∑ i ∈ S, b i)) +``` + +- ✅ `a : ℕ` — the base element. +- ✅ `b : Fin m → ℕ` with `∀ i, b i > 0` — positive generators, matching the requirement that the `b_i` be positive. +- ✅ For every subset `S`, the expression `a + ∑_{i ∈ S} b_i` is a perfect square. +- ✅ The empty subset `S = ∅` gives `a + 0 = a`, so `a` itself must be a perfect square. This is a correct consequence of the definition. + +**Potential concern about distinctness of `b_i`:** The original problem asks for `b_1, ..., b_m` but does not explicitly require them to be distinct (and indeed the standard definition of combinatorial cubes does not require distinctness of generators). The formalization correctly does not impose this condition. + +**Potential concern about `m = 0` and `m = 1`:** When `m = 0`, the statement asks for `a` such that `a` is a perfect square — trivially true. When `m = 1`, it asks for `a, b > 0` such that both `a` and `a + b` are perfect squares — also trivially true (e.g., `a = 1, b = 3`). The interesting cases are `m ≥ 2`. This is mathematically fine — the statement is vacuously/trivially true for small `m` and only becomes substantive for large `m`. + +**Overall correctness verdict:** Both parts are mathematically correct and complete. The formalization faithfully captures the original BEF90 problem. The only minor note is the redundant strict monotonicity condition in Part 1. diff --git a/ai-review/783.md b/ai-review/783.md new file mode 100644 index 0000000000..316157ce53 --- /dev/null +++ b/ai-review/783.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 783 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/` or elsewhere in the codebase. The problem concerns pairwise coprime sieving sets and the Dickman function, which are distinct from the sum-free set machinery (Problems 748, 790, 792, 877), Schur numbers (Problem 483), Sidon sets, or sumset operations found elsewhere. The `unsievedCount` and `dickmanRho` definitions are appropriately problem-specific. + +One minor observation: `Nat.Coprime` from Mathlib is used correctly; no custom coprimality definition is needed. + +## 2. Citations + +The formalization references only `[erdosproblems.com/783](https://www.erdosproblems.com/783)`. + +The website lists the following citations and contributors that are **not reflected** in the formalization's docstring: + +- **[Er73, p.135]** — the original source (Erdős, 1973). Should be cited. +- **Chojeckl** — proved this is the extremal sequence when C ≤ log 2 (reference: ulam.ai/research/erdos783.pdf). +- **Hildebrand [Hi87b]** — proved the weak form holds if A is restricted to primes. +- **Tao** — suggested the Dickman function formulation that the theorem formalizes. +- **Zach Hunter** — notes that small improving perturbations are possible in some cases. + +**Recommendation:** Add `[Er73, p.135]` as the primary citation and credit Tao explicitly for the quantitative conjecture that is formalized. + +## 3. Variants + +The formalization captures **only Tao's quantitative formulation** (asymptotic minimum is ρ(e^C)·N). The website describes several variants and partial results that are not captured: + +- **Erdős's original qualitative conjecture:** The optimal A is (approximately) the set of consecutive largest primes up to N, i.e., {p_r, ..., p_t} where p_t is the largest prime ≤ N and r is chosen minimally so the reciprocal sum is ≤ C. This is a stronger, structural claim not captured by the formalization. +- **Chojeckl's result (C ≤ log 2):** The consecutive-primes set is provably extremal in this regime. This could be formalized as a separate theorem. +- **Hildebrand's result:** The Tao-style asymptotic holds when A is restricted to be a set of primes. This is a partial result that could be a separate, easier theorem. + +**Recommendation:** Consider adding at least Erdős's original structural conjecture as a separate statement, since Tao's formulation is a refinement/alternative rather than the original problem. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The `unsievedCount` definition uses `(Finset.range N).image (· + 1)` to represent {1, ..., N}. This is correct but `Finset.Icc 1 N` would be more idiomatic and immediately readable (though it requires `LocallyFiniteOrder` on ℕ, which Mathlib provides). +- The docstring for `dickmanRho` is good — it states the defining ODE and initial condition clearly. +- The theorem docstring clearly explains both parts (existence and universality) of the asymptotic claim. + +## 5. Formalizability + +**Assessment: Moderate ambiguity, well-handled.** + +The original Erdős problem is qualitative and somewhat vague ("What choice ... minimises...?" with Erdős suggesting an answer). This is inherently difficult to formalize as a precise theorem. Tao's reformulation resolves the ambiguity by making a precise quantitative prediction, which is what the formalization captures. + +The main formalizability concern is the **Dickman function**. It is declared as: + +```lean +noncomputable opaque dickmanRho : ℝ → ℝ +``` + +This is an opaque constant with **no axioms or specifications** constraining its behavior. The docstring describes the intended function (continuous, ρ(u) = 1 for 0 ≤ u ≤ 1, u·ρ'(u) = −ρ(u−1) for u > 1), but none of this is formalized. As a result, `dickmanRho` could be *any* function ℝ → ℝ, and the theorem statement is technically vacuous — it could be trivially true (e.g., if `dickmanRho` happened to be the zero function, part (2) would be trivially true for large N, and part (1) would be easy to satisfy). + +**Recommendation:** Either: +1. Add axioms characterizing `dickmanRho` (initial condition + delay-differential equation), or +2. Provide an actual definition (e.g., as the unique solution to the DDE), or +3. At minimum, add a `sorry`-axiom that `dickmanRho` satisfies the stated properties, to make the intent machine-checkable. + +This is the most significant issue with the formalization. + +## 6. Correctness + +**Overall assessment: Mathematically correct modulo the `dickmanRho` issue.** + +Detailed analysis: + +- **Pairwise coprimality:** `∀ a ∈ A, ∀ b ∈ A, a ≠ b → Nat.Coprime a b` — correctly captures (a,b) = 1 for a ≠ b in A. ✓ +- **Domain constraint:** `∀ a ∈ A, 2 ≤ a ∧ a ≤ N` — correctly captures A ⊆ {2, ..., N}. ✓ +- **Reciprocal sum bound:** `∑ a ∈ A, (1 : ℝ) / (a : ℝ) ≤ C` — correct. ✓ +- **Unsieved count:** `unsievedCount N A` counts elements of {1, ..., N} not divisible by any a ∈ A. ✓ +- **Asymptotic form:** The ε-N₀ formulation correctly captures the "o(1)" in Tao's conjecture. Part (1) (∃ A achieving near-optimal) and Part (2) (∀ A has unsieved count at least near-optimal) together express that the infimum is asymptotically ρ(e^C)·N. ✓ +- **Argument to Dickman function:** `Real.exp C` correctly formalizes e^C. ✓ + +**Potential subtlety:** The unsieved count includes m = 1, which is not divisible by any a ≥ 2 in A. This is consistent with counting integers in {1, ..., N} and matches the standard formulation. ✓ + +**No mathematical errors detected.** The formalization faithfully captures Tao's conjecture. The only incompleteness is structural: (a) `dickmanRho` lacks a formal specification, and (b) the original Erdős conjecture (consecutive largest primes) is not stated. diff --git a/ai-review/784.md b/ai-review/784.md new file mode 100644 index 0000000000..a2155afd0a --- /dev/null +++ b/ai-review/784.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 784 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/` or elsewhere in the codebase. The problem is a sieve-theoretic question about counting integers in an interval not divisible by any element of a set with bounded reciprocal sum. This is distinct from the sum-free set machinery (Problems 790, 792), Sidon sets (Problems 154–157), subset sums (Problem 540), or arithmetic progression avoidance found elsewhere. + +The formalization is self-contained and uses only standard Mathlib primitives (`Finset.Icc`, `Finset.filter`, `Real.log`, `BigOperators`). No custom definitions are introduced beyond the theorem statement itself, so there is no opportunity for code reuse in either direction. + +## 2. Citations + +The formalization includes: +- `[Ru82]` Ruzsa, I., *On the small sieve. I. Sieving by primes*, J. Number Theory, 1982. +- `[Sa98]` Saias, E., *Entiers sans grand ni petit facteur premier. III*, Acta Arith., 1998. +- `[We25]` Weingartner, A., *Integers free of divisors from a given set*, 2025. + +The website [erdosproblems.com/784](https://www.erdosproblems.com/784) lists additional citations **not reflected** in the formalization: + +- **[Er72], [Er73]** — the original Erdős sources posing the problem. These should be cited as the primary references. +- **[ScSz59]** — Schinzel and Szekeres (1959), who gave an example showing optimality up to the value of c. + +The website also notes the problem is **related to Problem 542**, which is not mentioned. + +**Recommendation:** Add `[Er72]` and `[Er73]` as the original problem sources, and `[ScSz59]` for the optimality example. + +## 3. Variants + +The formalization captures the universal ("for every C > 0") version and correctly identifies it as false. The website reveals a richer picture with two distinct regimes: + +- **0 < C ≤ 1:** The bound holds. Ruzsa (1982) proved the lower bound, Saias (1998) the upper bound, giving H₁(x) ≍ x/log x. Weingartner (2025) conjectures H₁(x) ~ c·x/log x with c ≈ 0.878. +- **C > 1:** The bound fails. H_C(x) = x^{e^{1−C} + o(1)} by Ruzsa, refined to H_C(x) ≍ x^{e^{1−C}}/log x by Weingartner (2025). + +The formalization does not separately state the **positive result for C ≤ 1** as its own theorem. This is a natural and important companion statement — arguably the more interesting half of the resolution. + +**Recommendation:** Consider adding a second theorem `erdos_784_small_C` formalizing: for 0 < C ≤ 1, there exist c, K > 0 such that the sieve bound holds for all large x. This would capture the full resolution rather than just the negative answer. + +The website also mentions: +- A user note that A = {1} gives a trivial counterexample for C ≥ 1, so A ⊆ {2, ..., x} (excluding 1) is the intended domain. The formalization correctly handles this. +- A trivial lower bound of (1 − C)x via union bound when 0 < C < 1. + +## 4. Readability + +The code is clean and readable. Specific observations: + +- The use of `Finset.Icc 1 x` to represent {1, ..., x} is idiomatic and clear. +- The constraint `∀ a ∈ A, 2 ≤ a ∧ a ≤ x` clearly specifies A ⊆ {2, ..., x}. +- The filter `fun m => ∀ a ∈ A, ¬(a ∣ m)` transparently expresses "m is undivided by any element of A." +- The quantifier structure (∀ C > 0, ∃ c > 0, ∃ K > 0, ∃ x₀, ∀ x ≥ x₀, ...) correctly encodes the asymptotic claim with explicit constants. + +**Minor suggestion:** The module docstring says "Resolved negatively for C > 1" which is slightly incomplete — it could also mention the positive resolution for C ≤ 1 to match the theorem's own docstring. + +## 5. Formalizability + +**Assessment: High — the problem is precise and clearly formalizable.** + +The problem statement on the website is already quantitative and unambiguous (after the understood exclusion of 1 from A). It asks whether a specific asymptotic lower bound holds. The only potential ambiguity is: + +1. **The domain of A:** The website says A ⊆ [1, x], but a commenter notes A = {1} is a trivial counterexample. The formalization resolves this correctly by using A ⊆ {2, ..., x}. +2. **The meaning of "≫":** The Vinogradov notation f ≫ g means f ≥ K·g for some K > 0. The formalization correctly unpacks this with explicit existential quantifiers over K. + +There is no opaque constant or axiomatic issue — all components (`Finset`, `Real.log`, division, exponentiation) have standard Mathlib definitions. The formalization is fully self-contained and meaningful. + +## 6. Correctness + +**Overall assessment: Correct.** + +Detailed analysis: + +- **Answer value:** `answer(False)` asserts the universal statement (for every C > 0) is false. This is correct: for C > 1, Ruzsa showed H_C(x) grows like x^{e^{1−C}}, which is sublinear (since e^{1−C} < 1), while x/(log x)^c is essentially linear for any fixed c > 0. So the bound fails for C > 1, making the universal claim false. ✓ +- **Domain constraint:** `∀ a ∈ A, 2 ≤ a ∧ a ≤ x` correctly captures A ⊆ {2, ..., x}, avoiding the trivial counterexample with A = {1}. ✓ +- **Reciprocal sum:** `∑ a ∈ A, (1 : ℝ) / (a : ℝ) ≤ C` correctly formalizes ∑_{a ∈ A} 1/a ≤ C. ✓ +- **Unsieved count:** `(Finset.Icc 1 x).filter (fun m => ∀ a ∈ A, ¬(a ∣ m))` counts integers in {1, ..., x} not divisible by any element of A. This matches #{m ≤ x : a ∤ m for all a ∈ A} from the problem. ✓ +- **Lower bound:** `K * (x : ℝ) / (Real.log (x : ℝ)) ^ c` correctly formalizes K · x / (log x)^c. Note `Real.log` is the natural logarithm, consistent with standard analytic number theory convention. ✓ +- **Quantifier order:** ∀ C > 0, ∃ c > 0, ∃ K > 0, ∃ x₀, ∀ x ≥ x₀, ∀ A, ... — this correctly says: for a given C, the constants c, K, and threshold x₀ may depend on C, and the bound must hold for all large x and all valid A. This matches the intended meaning. ✓ + +**Potential subtlety:** The unsieved count includes m = 1, which is not divisible by any a ≥ 2. This is consistent with counting {m ≤ x : ...} starting from m = 1, and does not affect the asymptotic claim. ✓ + +**No mathematical errors detected.** The formalization faithfully captures the problem and its resolution. The only incompleteness is the absence of the positive companion result for C ≤ 1, which is a matter of scope rather than correctness. diff --git a/ai-review/785.md b/ai-review/785.md new file mode 100644 index 0000000000..d2e96deabd --- /dev/null +++ b/ai-review/785.md @@ -0,0 +1,119 @@ +# Review: Erdős Problem 785 + +## 1. Code Reuse + +**Counting function:** The file defines a local `countingFn` at line 46: +```lean +noncomputable def countingFn (A : Set ℕ) (x : ℕ) : ℕ := + ((Finset.Icc 1 x).filter (· ∈ A)).card +``` + +This is a widely duplicated pattern across the codebase. At least 20+ Erdős problems define near-identical counting functions. Notable alternatives already in the repo: + +- **`Erdos237.countingFunction`** (237.lean:52) uses `Set.ncard (A ∩ Set.Icc 1 N)` — semantically equivalent but operates on `Set` rather than `Finset`. +- **`Nat.count`** from Mathlib is used directly in 489.lean:38. However, `Nat.count p x` counts elements in `{0, ..., x-1}` satisfying `p`, which differs from the `[1, x]` convention used here — so a direct substitution would require an off-by-one adjustment. + +The `(Finset.Icc 1 x).filter (· ∈ A)).card` pattern is the most common convention in this codebase and is acceptable as-is, though a shared utility would reduce duplication across the 20+ files using it. + +**Sumset / additive complements:** The sumset condition (`∃ a ∈ A, ∃ b ∈ B, a + b = n`) is expressed inline rather than using a reusable `sumset` definition. Both `Erdos37.sumset` (37.lean:44) and `Erdos31.sumset` (31.lean:35) define `sumset A B := {n | ∃ a ∈ A, ∃ b ∈ B, n = a + b}`. Mathlib also provides `Set.additiveCombination` / pointwise addition on sets. The inline formulation here is fine for a single theorem, but note the reversed equality: this file uses `a + b = n` while 37.lean and 31.lean use `n = a + b`. Both are logically equivalent but the inconsistency is worth noting. + +**Verdict:** No critical reuse issues. The local definitions are adequate. + +## 2. Citations + +The docstring references: +- `[SaSz94]` — listed as "Sárközy, A. and Szemerédi, E." +- `[Ru17]` — listed as "Ruzsa, I. Z." +- Danzer is mentioned in the body text but not given a citation tag. + +**From erdosproblems.com/785**, the full set of references is: +1. **Sárközy & Szemerédi [SaSz94]** — Proved the affirmative answer. +2. **Chen & Fang [ChFa15]** — Improved the result: showed `A(x)B(x) - x ≪ A(x)^c` cannot hold for any constant `c > 0`. +3. **Chen & Fang [ChFa10, ChFa14, ChFa11]** — Multiple papers on the `limsup A(x)B(x)/x` threshold. +4. **Narkiewicz [Na59]** — Proved `A(2x)/A(x) → 1` and `B(2x)/B(x) → 2`. +5. **Ruzsa [Ru17]** — Constructed pairs with arbitrarily slow divergence of `A(x)B(x) - x`. +6. **Danzer [Da64]** — Proved existence of exact additive complements. + +**Issues:** +- The citations `[SaSz94]` and `[Ru17]` lack full bibliographic details (title, journal, year, volume). The website provides enough context to flesh these out. +- Danzer is mentioned in the text but not given a bracketed citation `[Da64]`. +- The additional references from Chen & Fang and Narkiewicz are not mentioned at all. While not strictly required for the core formalization, they provide important mathematical context (especially Chen & Fang's strengthening). + +## 3. Variants + +The website describes several extensions and related results: + +1. **Sárközy–Szemerédi result** (formalized): `A(x)B(x) - x → ∞`. ✅ Captured. +2. **Ruzsa's construction** (mentioned in docstring): For any `w(x) → ∞`, a pair exists with `A(x)B(x) - x < w(x)` for infinitely many `x`. ❌ Not formalized as a variant theorem. +3. **Chen–Fang improvement**: `A(x)B(x) - x = o(A(x))` is impossible; more strongly, `A(x)B(x) - x ≪ A(x)^c` is impossible for any `c > 0`. ❌ Not formalized. +4. **Narkiewicz's result**: `A(2x)/A(x) → 1` under exact additive complement hypotheses. ❌ Not formalized. +5. **Chen–Fang threshold results**: The condition `limsup A(x)B(x)/x < 5/4` (later improved to `3 - √3`) suffices for the conclusion. ❌ Not formalized. + +Ruzsa's construction is the most natural companion variant (it shows the main result is essentially sharp) and is already described in the docstring. Formalizing it as a separate theorem statement would be valuable. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The docstring is clear and self-contained, explaining the terminology "exact additive complements." +- The `countingFn` docstring correctly documents what it computes: `|A ∩ {1, …, x}|`. +- The formalization reads naturally: the hypotheses are in logical order (infinite sets → additive complement condition → asymptotic condition → conclusion). +- The use of `answer(True)` on a solved problem is appropriate per codebase conventions. + +**One minor readability suggestion:** The additive complement condition could be extracted into a named definition (e.g., `IsAdditiveComplement A B`) for clarity, especially if variants were to be added. But for a single theorem, the inline version is acceptable. + +## 5. Formalizability + +The original problem statement from Erdős is: + +> Let `A, B ⊆ ℕ` be infinite sets such that `A + B` contains all large integers. If `A(x)B(x) ~ x`, must `A(x)B(x) - x → ∞`? + +**Assessment: Highly formalizable, low ambiguity.** + +- "Contains all large integers" is unambiguously `∃ N₀, ∀ n ≥ N₀, n ∈ A + B`. ✅ +- `A(x) = |A ∩ [1, x]|` is standard notation in additive combinatorics. ✅ +- `A(x)B(x) ~ x` means `A(x)B(x)/x → 1`, which is precisely `Tendsto ... (nhds 1)`. ✅ +- `A(x)B(x) - x → ∞` means the difference diverges, which is `Tendsto ... atTop`. ✅ + +The only potential ambiguity is whether `[1, x]` means `{1, 2, ..., x}` (closed interval in ℕ) or `[1, x]` as a real interval. The formalization correctly uses `Finset.Icc 1 x`, which gives `{1, 2, ..., x}` in ℕ. This matches the standard convention. + +**Ambiguity level: Very low.** The problem is precisely stated and the formalization captures it faithfully. + +## 6. Correctness + +**Mathematical correctness assessment:** + +The theorem statement is: +``` +∀ (A B : Set ℕ), Set.Infinite A → Set.Infinite B → + (∃ N₀, ∀ n ≥ N₀, ∃ a ∈ A, ∃ b ∈ B, a + b = n) → + Tendsto (fun x => (countingFn A x * countingFn B x : ℝ) / (x : ℝ)) atTop (nhds 1) → + Tendsto (fun x => (countingFn A x * countingFn B x : ℝ) - (x : ℝ)) atTop atTop +``` + +**Hypothesis analysis:** + +1. `Set.Infinite A` and `Set.Infinite B`: Correct. The problem assumes infinite sets. ✅ +2. Additive complement condition: `∃ N₀, ∀ n ≥ N₀, ∃ a ∈ A, ∃ b ∈ B, a + b = n`. This says every sufficiently large `n` is representable as `a + b` with `a ∈ A, b ∈ B`. ✅ +3. Asymptotic condition: `A(x)B(x)/x → 1`. Correctly encoded as `Tendsto ... (nhds 1)`. ✅ + +**Conclusion analysis:** + +`Tendsto (fun x => A(x)*B(x) - x : ℝ) atTop atTop`: This says `A(x)B(x) - x → +∞`. ✅ + +**Potential subtlety — zero membership:** The counting function counts elements in `{1, ..., x}`, excluding 0. If `0 ∈ A` or `0 ∈ B`, then 0 contributes to the sumset `A + B` (since `0 + b = b`) but is not counted by `countingFn`. This is mathematically standard — the counting function `A(x)` conventionally counts positive elements, and the sumset condition is about representing all large integers, so the role of 0 is immaterial to the conclusion. No issue here. + +**Potential subtlety — direction of `atTop`:** The conclusion uses `Tendsto ... atTop atTop`, which means `A(x)B(x) - x → +∞`. Since `A(x)B(x) ≥ x` for large `x` (by the additive complement condition and the asymptotic hypothesis), the difference is eventually nonnegative, and `→ +∞` is the correct directionality. ✅ + +**Overall correctness: The formalization is mathematically correct and complete** for the main result (Sárközy–Szemerédi theorem). It faithfully captures the problem as stated on erdosproblems.com. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Acceptable; counting function follows codebase convention | +| Citations | Incomplete — missing full bibliographic details and several references from the website | +| Variants | Only main result captured; Ruzsa's sharpness construction and Chen–Fang improvements are missing | +| Readability | Good | +| Formalizability | Very low ambiguity; straightforward to formalize | +| Correctness | Correct and complete for the main result | diff --git a/ai-review/787.md b/ai-review/787.md new file mode 100644 index 0000000000..c4e58f9460 --- /dev/null +++ b/ai-review/787.md @@ -0,0 +1,109 @@ +# Review: Erdős Problem 787 + +## 1. Code Reuse + +**Significant overlap with Green's Open Problem 2** (`FormalConjectures/GreensOpenProblems/2.lean`). Green2 formalizes the same mathematical problem (the Erdős–Moser sum-free set problem) over ℤ rather than ℝ, with shared references (Sanders [Sa21], Ruzsa [Ru05]). Green2 defines: + +- `restrictedSumset` (the restricted sumset S +̂ S) +- `maxRestrictedSumAvoidingSubsetSize` (equivalent to g(n) but defined per-set rather than as a worst-case over all sets of size n) + +These two formalizations should ideally share infrastructure. In particular: + +- `IsSumAvoidingIn A B` in 787 is equivalent to `B ⊆ A ∧ Disjoint (restrictedSumset B) A` from Green2. The Green2 definition using `offDiag` and `Disjoint` is arguably more idiomatic and leverages Mathlib's pointwise set operations. +- The `IsSumFree` definition in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (`Disjoint (A + A) A`) is the unrestricted version (includes a + a), so it is a **different** concept and should NOT be substituted here. The distinction is mathematically important. + +**Recommendation:** Consider refactoring `IsSumAvoidingIn` to use `restrictedSumset` from Green2, or better yet, extract a shared definition into a utility file parameterized over the ambient type. The Choi reduction (any real set can be reduced to integers) means the ℝ and ℤ versions are equivalent, so a unified treatment is natural. + +## 2. Citations + +The formalization includes three references: Sanders [Sa21], Beker [Be25], Ruzsa [Ru05]. Comparing against [erdosproblems.com/787](https://www.erdosproblems.com/787): + +**Missing from formalization:** +- **[Ch71]** Choi, S. L. G. — "On a combinatorial problem in number theory." *Proc. London Math. Soc.* (3), 23:629–642, 1971. (Established the upper bound g(n) ≪ n^{2/5+o(1)} and observed the reduction to ℤ.) +- **[Er65, p.187]** Erdős, P. — "Extremal problems in number theory." *Proc. Sympos. Pure Math.*, Vol. VIII, pp. 181–189, AMS, 1965. (Original source.) +- **[Er73, p.130]** — Another original Erdős source. +- **[Va99, 1.22]** — Additional reference listed on the website. + +**Citation quality:** The existing references lack full bibliographic detail: +- [Sa21] should be: Sanders, Tom. "The Erdős–Moser Sum-free Set Problem." *Canadian Journal of Mathematics* 73.1 (2021): 63–107. +- [Ru05] should be: Ruzsa, I. Z. "Sum-avoiding subsets." *Ramanujan J.* 9 (2005), no. 1-2, 77–82. +- [Be25] is recent and may not have full publication details yet. + +**Recommendation:** Add the missing references, especially [Ch71] and [Er65] as primary sources, and expand the existing citations to include journal/venue information. Green2 already has these expanded — they can be copied directly. + +## 3. Variants + +The formalization captures the lower bound (Sanders/Beker) and the upper bound (Ruzsa). Missing: + +- **The main open question itself.** The website marks this problem as **OPEN**. The gap between (log n)^{1+c} and exp(√(log n)) is enormous, and the core question "estimate g(n)" is not formalized. A natural formalization would ask whether g(n) is polynomial in log n, or superpolynomial, etc. At minimum, the specific question from Green2 — whether g(n) ≥ (log n)^{100} — could be cross-referenced. +- **Historical bounds** not captured: + - Choi's upper bound: g(n) ≪ n^{2/5+o(1)} (superseded by Ruzsa but historically significant). + - Klarner's lower bound: g(n) ≫ log n (superseded by Sanders). + - Erdős's n/3 + O(1) bound for the non-negative integer version. +- **Beker's specific constant:** The docstring mentions c = 1/68, but the theorem only asserts ∃ c > 0. A variant with the explicit constant c = 1/68 would be a stronger, more informative formalization. +- **Integer vs. real version:** As noted by Choi, the problem reduces to integers. The formalization works over ℝ, while Green2 works over ℤ. Neither file states or formalizes this equivalence. + +## 4. Readability + +The code is generally clear and well-structured. Minor observations: + +- The docstring is well-written and provides good mathematical context. +- The `IsSumAvoidingIn` definition is readable and has a good docstring. +- The `g` function definition is clear, though a comment explaining why `sSup` is well-defined (the set is nonempty since 0 is always achievable, and bounded above by n) would help readers. +- The namespace `Erdos787` is clean and self-contained. +- The variant naming `erdos_787.variants.upper_bound` is consistent with project conventions. + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one subtlety.** + +The problem statement is precise: "b₁ + b₂ ∉ A for all b₁ ≠ b₂ ∈ B" clearly specifies the *restricted* sumset (excluding the diagonal b + b). This is correctly captured by `IsSumAvoidingIn`. + +The asymptotic bounds use standard notation (≪, ≫) which translates cleanly to ∃ C > 0, ∃ N₀, ∀ n ≥ N₀ statements. + +**Subtlety with sSup:** The definition of `g` uses `sSup` on `ℕ`, which in Lean/Mathlib returns 0 for empty or unbounded sets. The relevant set is: +- **Nonempty:** Always contains 0 (take B = ∅). +- **Bounded above:** By n (since B ⊆ A and |A| = n). + +So `sSup` is well-defined and equals the maximum. However, this relies on properties of `sSup` for `ℕ` that are not immediately obvious and would need to be established in any proof. An alternative definition using `iSup` or an explicit `Finset.sup` might be more proof-friendly. + +**Ambiguity level: Low.** The mathematical content is standard and well-understood. + +## 6. Correctness + +### 6a. `IsSumAvoidingIn` — Correct + +The definition correctly captures B ⊆ A with the restricted sum condition (distinct elements only). This matches the problem statement. + +### 6b. `g` — Correct but fragile + +The `sSup` definition is mathematically correct (see §5). However, proofs involving `g` will need to establish `BddAbove` and `Set.Nonempty` for the defining set before `sSup` properties can be applied. This is a formalization inconvenience, not a mathematical error. + +### 6c. `erdos_787` (lower bound) — Correct + +The statement ∃ c > 0, ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, g(n) ≥ C · (log n)^{1+c} correctly formalizes the lower bound g(n) ≫ (log n)^{1+c}. The existential quantification over c is appropriate since the exact value (currently 1/68 from Beker) may improve. + +### 6d. `erdos_787.variants.upper_bound` — **Potential issue** + +The statement asserts: ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, g(n) ≤ C · exp(√(log n)). + +This places the constant C **outside** the exponential. Compare with Green2's Ruzsa bound (`green_2_upper_bound_ruzsa`), which places C **inside**: g(n) < exp(C · √(log n)). + +These are **not** equivalent asymptotic statements: +- C · exp(√(log n)) means g(n) = O(exp(√(log n))) +- exp(C · √(log n)) with C > 1 grows strictly faster + +The website states g(n) ≪ exp(√(log n)), which is the O-notation matching the 787 formalization (constant outside). If Ruzsa's actual result is exp(c√(log n)) for some c > 1, then the 787 statement would be **strictly stronger** than what was proved, making it incorrect. If c ≤ 1 (or can be taken to be 1), then both versions hold. + +**Recommendation:** Verify the exact form of Ruzsa's bound. If the constant belongs inside the exponent, the 787 formalization should be corrected to match Green2's version. At minimum, the two formalizations of the same result should be consistent. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant overlap with Green2; shared definitions recommended | +| Citations | Three references present; four+ missing from website; details incomplete | +| Variants | Lower/upper bounds captured; main open question and historical bounds missing; Beker's c=1/68 not explicit | +| Readability | Good overall; minor improvements possible | +| Formalizability | Low ambiguity; sSup well-defined but may be inconvenient for proofs | +| Correctness | Mostly correct; upper bound constant placement (inside vs. outside exp) needs verification against Ruzsa's paper and consistency with Green2 | diff --git a/ai-review/788.md b/ai-review/788.md new file mode 100644 index 0000000000..dfe3f2c7df --- /dev/null +++ b/ai-review/788.md @@ -0,0 +1,111 @@ +# Review: Erdos Problem 788 + +## 1. Code Reuse + +The file defines the sum-avoidance condition inline: +```lean +∀ c₁ ∈ C, ∀ c₂ ∈ C, c₁ ≠ c₂ → c₁ + c₂ ∉ B +``` + +There is an existing `IsSumFree` definition in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`: +```lean +def IsSumFree (A : Set α) : Prop := Disjoint (A + A) A +``` + +However, this is **not directly applicable** here. Problem 788's condition is not that C is sum-free (no c₁ + c₂ = c₃ for c₁, c₂, c₃ ∈ C), but rather that the *restricted pairwise sumset* of C avoids a *separate* set B. This is a "B-avoiding" or "cross-sum-free" condition, which is structurally different. Problem 792 also defines its own `IsSumFreeSet` for a different notion. The inline definition is appropriate given the lack of a matching abstraction. If multiple problems needed this cross-sum-free notion, a shared definition would be warranted, but currently it appears unique to this problem. + +The `sSup`-based extremal function pattern and the `Finset.Ioo` interval usage are consistent with other problems (e.g., 874, 882) and do not need further abstraction. + +**Verdict: No actionable code reuse opportunities.** + +## 2. Citations + +The docstring references: +- Choi (no citation key) +- Adenwalla (no citation key) +- Baltz, Schoen, and Srivastav (no citation key) +- `[AlPh25]` Alon, N. and Pham, H.T., *Random Cayley graphs*. + +The [erdosproblems.com/788](https://www.erdosproblems.com/788) page lists the following reference keys: +- **[Er73]** — Original Erdos source (not mentioned in the formalization) +- **[Ch71]** — Choi +- **[BSS00]** — Baltz, Schoen, Srivastav +- **[AlPh25]** — Alon, Pham + +The website also credits **Zach Hunter** for sketching an argument yielding f(n) ≪ n^{2/3+o(1)}, which is not mentioned in the formalization at all. + +**Issues:** +- Choi's result should carry the citation key `[Ch71]`. +- Baltz, Schoen, and Srivastav should carry `[BSS00]`. +- The original Erdos reference `[Er73]` is missing entirely. +- Hunter's intermediate bound is omitted from the docstring. +- Adenwalla's contribution is mentioned without a formal reference key, but the website also does not provide one, so this is acceptable. + +## 3. Variants + +The formalization includes three statements: +1. **Main conjecture** (`erdos_788`): f(n) ≤ n^{1/2+o(1)} — open. +2. **Lower bound** (`erdos_788.variants.lower`): f(n) ≫ n^{1/2} (Adenwalla) — solved. +3. **Upper bound** (`erdos_788.variants.upper`): f(n) ≤ n^{3/5+o(1)} (Alon-Pham) — solved. + +**Missing variants** (mentioned on the website or in the docstring but not formalized): +- **Choi's bound**: f(n) ≪ n^{3/4} — historically important as the first upper bound, though superseded. +- **Baltz-Schoen-Srivastav**: f(n) ≪ (n log n)^{2/3} — mentioned in the docstring but not formalized. +- **Hunter's bound**: f(n) ≪ n^{2/3+o(1)} — mentioned on the website but absent from both docstring and formalization. + +Since all three missing bounds are superseded by the Alon-Pham bound that *is* formalized, their omission is **reasonable but not ideal**. For a comprehensive formalization, the Baltz-Schoen-Srivastav bound is the most interesting to add since it involves a log factor and is qualitatively different from the pure power-law bounds. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- The docstring on `erdos788F` clearly explains the definition. +- The theorem docstrings accurately describe the mathematical content. +- The namespace `Erdos788` is appropriate. +- The use of `(erdos788F n : ℝ)` coercion and `(n : ℝ) ^ (...)` for the real-valued exponentiation is standard and clear. +- The `1 / 2` in the main theorem and `(1 : ℝ) / 2` in the lower bound variant are inconsistent in annotation style. The lower bound explicitly types the `1` as `ℝ` while the main theorem and upper bound do not. This is a minor style inconsistency (both work correctly due to the surrounding context, but uniformity would improve readability). + +**Verdict: Good readability. Minor style inconsistency in the type annotation of `1/2` vs `(1 : ℝ)/2`.** + +## 5. Formalizability + +The original problem statement is: "Estimate f(n). In particular is it true that f(n) ≤ n^{1/2+o(1)}?" + +- The definition of f(n) is **fully precise and unambiguous**. The sets B and C live in explicit integer intervals, the sum-avoidance condition is clearly stated, and the extremal quantity |C| + |B| is well-defined. +- The "in particular" question f(n) ≤ n^{1/2+o(1)} is **precisely formalizable** via the ε-δ formulation used, and the formalization does this correctly. +- The broader "Estimate f(n)" directive is inherently informal (it asks for the order of growth rather than a specific yes/no answer). The formalization handles this appropriately by capturing the specific conjecture and the best known bounds as separate theorems. + +**One subtle point**: The condition uses "distinct" elements (c₁ ≠ c₂), which excludes the diagonal sum 2c for c ∈ C. This means C could contain an element c with 2c ∈ B. In additive combinatorics, this is the standard "restricted sumset" interpretation C +̂ C, and is consistent with the problem as stated. If the problem intended the full sumset C + C (including 2c), the condition would be strictly stronger. The formalization follows the literal statement correctly. + +**Verdict: High formalizability. No ambiguity in the core definition; the formalization makes a defensible choice on the restricted vs. full sumset question.** + +## 6. Correctness + +**Definition of `erdos788F`**: Mathematically correct. The sSup is well-defined because: +- The set is nonempty (m = 0 works: take C = ∅). +- The set is bounded above (|C| + |B| ≤ |Ioo n (2n)| + |Ioo (2n) (4n)| = (n-1) + (2n-1) = 3n-2). + +However, there is a **technical concern** about Lean's `sSup` on `ℕ`. In Mathlib, `ℕ` has a `ConditionallyCompleteLattice` instance where `sSup` of a nonempty bounded-above set gives the maximum, and `sSup ∅ = 0`. For nonempty *unbounded* sets, `sSup` returns a junk value. Since our set is nonempty and bounded, `sSup` behaves correctly. This is fine but the definition is `noncomputable`, which is appropriate. + +**Main conjecture (`erdos_788`)**: The answer is `sorry`, which is correct — the problem is open. The ε-formulation of n^{1/2+o(1)} is standard and correct: f(n) ≤ n^{1/2+o(1)} iff for all ε > 0, f(n) ≤ n^{1/2+ε} for all sufficiently large n. This is mathematically equivalent. + +**Lower bound (`erdos_788.variants.lower`)**: Correctly formalizes f(n) ≫ n^{1/2} as ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, f(n) ≥ C · n^{1/2}. Standard and correct. + +**Upper bound (`erdos_788.variants.upper`)**: Correctly formalizes f(n) ≤ n^{3/5+o(1)} using the same ε pattern as the main conjecture. Correct. + +**Category annotations**: `research open` for the main conjecture and `research solved` for the variants are accurate per the website. + +**One potential issue**: The `answer(sorry)` in the main theorem means the truth value of the conjecture is left undetermined. This is appropriate for an open problem. However, the biconditional `answer(sorry) ↔ ...` means the theorem is trivially satisfiable by choosing `answer(sorry) := (the RHS)`. This is a pattern used throughout the codebase for open problems, so it is consistent even if slightly unusual. + +**Verdict: Mathematically correct and complete. No flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities — the cross-sum-free condition is problem-specific | +| Citations | Missing keys [Ch71], [BSS00], [Er73]; Hunter's bound omitted | +| Variants | Best known bounds covered; historical bounds reasonably omitted | +| Readability | Good; minor `(1 : ℝ)/2` vs `1/2` inconsistency | +| Formalizability | High — definition is unambiguous and precisely captured | +| Correctness | Correct and complete; no mathematical flaws | diff --git a/ai-review/789.md b/ai-review/789.md new file mode 100644 index 0000000000..d6f8403982 --- /dev/null +++ b/ai-review/789.md @@ -0,0 +1,87 @@ +# AI Review: Erdős Problem 789 + +## 1. Code Reuse + +The formalization follows the standard patterns used across the codebase: + +- **`sSup` extremal function pattern**: Identical in structure to `nonAvgMax` in Problem 186, `maxSumFreeSize` in Problem 790, `erdos788F` in Problem 788, `kAdmissible` in Problem 874, and many others. No shared utility is factored out for this, but the pattern is idiomatic and consistent. +- **`SumLengthProperty`**: This definition is unique to Problem 789. No existing definition in the codebase captures this exact property. Related concepts exist (e.g., `IsSidonSet` in Problem 43/156, `DistinctSubsetSums` in Problem 350, `IsB2r` in Problem 863), but none are equivalent. The definition is appropriately specific. +- **Asymptotic bound structure**: The `∃ C > 0, ∀ n, ...` pattern for the upper bound and `∃ C > 0, ∃ N₀, ∀ n ≥ N₀, ...` pattern for the lower bound are standard across the codebase and correctly applied here. + +**Verdict**: No meaningful code reuse opportunities. The existing code is appropriate. + +## 2. Citations + +The website ([erdosproblems.com/789](https://www.erdosproblems.com/789)) lists the following references: + +- **[Er62c]** — Erdős (1962) +- **[Er65]** — Erdős (1965) +- **[Er73]** — Erdős (1973) +- **[St66]** — Straus (1966) +- **[Ch74b]** — Choi (1974) + +The formalization's docstring mentions [Er62c], [St66], and [Ch74b] inline but does **not** provide full citation details (author, title, journal, year). Compare with Problem 186, which includes expanded citations like: + +> [Bo89] Bosznay, A. P., *On the lower estimation of non-averaging sets* (1989). + +The formalization also omits [Er65] and [Er73] which appear on the website. The website also lists related problems **#186** and **#874**. + +**Recommendation**: Expand the citations to include full bibliographic details for all five references and note the related problems. + +## 3. Variants + +The formalization captures two results: + +1. **Upper bound** (Straus): $h(n) \ll n^{1/2}$ — `erdos_789` +2. **Lower bound** (Erdős–Choi): $h(n) \gg (n \log n)^{1/3}$ — `erdos_789.variants.lower_bound` + +**Missing variants**: +- The earlier/weaker upper bound $h(n) \ll n^{5/6}$ (Erdős [Er62c]) is mentioned in the docstring but not formalized. This is acceptable since the Straus bound supersedes it. +- The earlier/weaker lower bound $h(n) \gg n^{1/3}$ (Erdős) is similarly mentioned but not formalized. Also acceptable. +- The core problem — "Estimate $h(n)$" — is **open** according to the website. The gap between $\Omega((n \log n)^{1/3})$ and $O(n^{1/2})$ remains unresolved. No conjecture for the true order of growth is formalized, which is appropriate since no precise conjecture is stated on the website. + +**Verdict**: The key known bounds are captured. No important variants are missing. + +## 4. Readability + +The code is clean and readable: + +- The `SumLengthProperty` definition has a clear docstring explaining the mathematical content. +- The `erdos789_h` definition has a clear docstring. +- Theorem docstrings explain the bounds and attribute them correctly. +- The namespace `Erdos789` scopes the definitions appropriately. + +**Minor suggestions**: +- The module-level docstring could benefit from explicitly noting that the overall problem remains **open** (estimating h(n)), while the individual bounds are proved results. + +## 5. Formalizability + +**Assessment: High formalizability with minor ambiguity.** + +The problem statement "Estimate $h(n)$" is inherently imprecise — it asks for bounds rather than an exact value. The formalization resolves this ambiguity well by separately stating the best known upper and lower bounds as distinct theorems. + +The definition of the sum-length property itself is precise: "if $a_1 + \cdots + a_r = b_1 + \cdots + b_s$ with $a_i, b_j \in B$, then $r = s$." This allows elements of B to be used with repetition (since the $a_i$ are drawn from B, not necessarily distinct elements of B). The formalization correctly captures this using `List ℤ` with membership constraints rather than sub-multisets of B, which is equivalent. + +**One subtle point**: The formalization allows empty lists (r = 0 or s = 0). If both lists are empty, the property holds trivially. But if one list is empty (sum = 0) and the other is non-empty with sum = 0, the property forces that no non-empty sub-multiset of elements from B sums to zero. The standard mathematical convention typically assumes r, s ≥ 1 in such representations. For B ⊆ ℕ⁺ this distinction is moot (positive elements can't sum to 0), but since A ⊆ ℤ, elements can be negative, and this adds a slightly stronger constraint. The asymptotic impact on h(n) is negligible (at most a constant factor), so the bounds remain correct. However, it would be mathematically cleaner to require `as ≠ []` and `bs ≠ []`, or equivalently `as.length ≥ 1` and `bs.length ≥ 1`. + +## 6. Correctness + +**Overall: Correct with one minor concern.** + +- **`SumLengthProperty`**: Mathematically sound modulo the empty-list issue noted above. The use of `List ℤ` with membership constraints correctly models multisets of elements from B (order-insensitive since only sum and length matter). + +- **`erdos789_h`**: The `sSup` definition is well-founded. The set `{ h : ℕ | ∀ A, A.card = n → ∃ B ⊆ A, h ≤ B.card ∧ SumLengthProperty B }` is: + - Non-empty (contains 0, since B = ∅ works). + - Bounded above (by n, since B ⊆ A and |A| = n). + + Thus `sSup` returns the correct maximum. + +- **`erdos_789` (upper bound)**: Correctly states $h(n) \leq C \cdot n^{1/2}$ for all n, with C > 0. This is the standard "big-O" formulation without requiring large n, which is fine since the bound holds for all n (possibly with a larger constant). + +- **`erdos_789.variants.lower_bound`**: Correctly states $h(n) \geq C \cdot (n \cdot \log n)^{1/3}$ for $n \geq N_0$. The "for sufficiently large n" qualifier is necessary here since $(n \log n)^{1/3}$ is not well-defined or meaningful for small n (e.g., $\log 0$, $\log 1 = 0$). This is correctly handled with the $N_0$ threshold. + +- **Category tags**: Both theorems are tagged `category research solved`. The individual bounds are indeed proved results, so "solved" is appropriate for these specific statements. However, the overall Problem 789 ("Estimate h(n)") is listed as **open** on the website. This is a potential source of confusion — the docstring should clarify that these are the best known bounds for an open problem. + +- **AMS classification**: `AMS 5 11` (combinatorics, number theory) is appropriate for additive combinatorics. + +**Summary**: The formalization is mathematically correct and captures the essential content of Problem 789. The main recommendations are: (1) expand citations to full bibliographic form, (2) consider requiring non-empty lists in `SumLengthProperty` for strict fidelity to the standard convention, and (3) clarify in the docstring that the overall problem remains open. diff --git a/ai-review/79.md b/ai-review/79.md new file mode 100644 index 0000000000..d619eb8b34 --- /dev/null +++ b/ai-review/79.md @@ -0,0 +1,101 @@ +# AI Review: Erdős Problem 79 + +## 1. Code Reuse + +**Major issue.** Problem 79 defines four concepts from scratch in a local `Erdos79` namespace that already exist (or have superior equivalents) in `FormalConjecturesForMathlib` and Mathlib: + +| Local definition (79.lean) | Library equivalent | Location | +|---|---|---| +| `Erdos79.IsSubgraphOf H G` | `SimpleGraph.IsContained H G` (notation `H ⊑ G`) | Mathlib `SimpleGraph.Copy` | +| `Erdos79.RamseyProp G H n` | (implicit via `SimpleGraph.sizeRamsey`) | `FormalConjecturesForMathlib/.../SizeRamsey.lean` | +| `Erdos79.NoIsolatedVertices H` | `∀ v, 0 < H.degree v` | Standard Mathlib idiom | +| `Erdos79.IsRamseySizeLinear G` | `SimpleGraph.IsRamseySizeLinear G` | `FormalConjecturesForMathlib/.../SizeRamsey.lean` | + +Problem 567 (a closely related problem about specific Ramsey-size-linear graphs) already uses the library's `SimpleGraph.IsRamseySizeLinear` directly via `ProblemImports`. Problem 79 should do the same. + +The local `IsSubgraphOf` is a manual version of Mathlib's `SimpleGraph.Copy`/`IsContained` infrastructure. Using `IsContained` would align with the rest of the codebase (problems 59, 60, 566, 567 all use it) and avoid redundant definitions. + +**Recommendation:** Delete all four local definitions and rewrite the theorem using `SimpleGraph.IsRamseySizeLinear` and `SimpleGraph.IsContained` from the library. + +## 2. Citations + +The website [erdosproblems.com/79](https://www.erdosproblems.com/79) lists three references: + +| Citation | On website | In formalization | +|---|---|---| +| [EFRS93] Erdős, Faudree, Rousseau, Schelp (1993) | Yes | Yes (but incomplete — no title or journal) | +| [Er95] Erdős (1995) | Yes | **Missing** | +| [Wi24] Wigderson (2024) | Yes | Yes (but incomplete — no title) | + +**Issues:** +- **[Er95] is entirely missing.** The website lists Erdős (1995) as a reference. +- **[EFRS93] lacks full bibliographic details.** Compare with problem 567 which cites it as: `Erdős, Faudree, Rousseau and Schelp, _Ramsey size linear graphs_. Combin. Probab. Comput. (1993), 389-399.` Problem 79 only gives `Erdős, P., Faudree, R., Rousseau, C., and Schelp, R., 1993.` +- **[Wi24] lacks full bibliographic details.** Only `Wigderson, A., 2024.` is given with no title or venue. + +**Recommendation:** Expand all citations to include title and journal/venue information, matching the style used in problem 567. Add the missing [Er95] reference. + +## 3. Variants + +The problem as stated on the website asks: + +> Are there infinitely many graphs G which are not Ramsey size linear but such that all of their proper subgraphs are? + +The formalization captures exactly this single question. No additional variants are listed on the website. The formalization is complete in this regard. + +However, the docstring mentions that "$K_4$ is the only explicitly known example" — this could potentially be formalized as a separate statement (e.g., asserting that $K_4$ is not Ramsey size linear but all its proper subgraphs are), which would serve as a concrete sanity check and would be more directly verifiable. This is optional but would add value. + +## 4. Readability + +**Several readability concerns:** + +1. **Redundant definitions hurt readability.** Having local definitions for `IsSubgraphOf`, `RamseyProp`, `NoIsolatedVertices`, and `IsRamseySizeLinear` when library versions exist forces the reader to mentally verify equivalence. Using library definitions would make the statement immediately recognizable. + +2. **The `RamseyProp` definition is non-standard.** The local `RamseyProp` uses a 2-coloring model where one color class is `S` and the other is `Sᶜ` (complement). This differs from the library's model which uses `R ≤ F` and `F \ R`. The complement-based version is actually modeling a *partition* of the complete graph's edges, which is correct for Ramsey theory on vertex colorings of $K_n$, but the library's formulation (coloring edges of an arbitrary graph $F$) is more standard for *size* Ramsey theory. + +3. **The `NoIsolatedVertices` definition** uses `∃ w, H.Adj v w` instead of the simpler and more standard `0 < H.degree v`. The latter is a single comparison; the former requires the reader to unfold the existential. + +4. **Proper subgraph definition is inline.** The notion of "proper subgraph" (embeds into $G$ but $G$ doesn't embed into $H$) is expressed inline in the theorem statement rather than being given a named definition. This is fine for a single use but slightly impacts readability. + +## 5. Formalizability + +**Assessment: Highly formalizable, with one subtle point.** + +The problem statement is precise and well-defined. The key concepts — Ramsey size linearity, proper subgraphs, and "infinitely many" — all have clear formal meanings. + +**Subtle point on "infinitely many graphs":** The formalization quantifies as `∀ N : ℕ, ∃ (p : ℕ) (G : SimpleGraph (Fin p)), p ≥ N ∧ ...`, meaning it asks for graphs on arbitrarily many vertices. This is a reasonable encoding of "infinitely many," since there are only finitely many graphs on any fixed vertex set. However, it technically allows the same graph (up to isomorphism) to appear on different vertex sets via padding with isolated vertices. This is a very minor issue and arguably doesn't affect the mathematical content, since any non-Ramsey-size-linear graph can't be trivially padded without changing its Ramsey properties. + +**Ambiguity level: Low.** The statement is precise enough that the formalization is essentially forced. + +## 6. Correctness + +**The formalization is mathematically correct but has a significant structural flaw:** + +### Correct aspects: +- The notion of "Ramsey size linear" is correctly captured: ∃ C > 0 such that for all H with no isolated vertices, the Ramsey number is ≤ C · |E(H)|. +- "Proper subgraph" as `IsSubgraphOf H G ∧ ¬ IsSubgraphOf G H` correctly captures "H embeds into G but G does not embed into H." +- The answer is correctly tagged as `True` and the problem is marked as `solved`, consistent with Wigderson's 2024 result. + +### Structural flaw — conceptual mismatch between `RamseyProp` and `IsRamseySizeLinear`: + +The local `IsRamseySizeLinear` is defined using `RamseyProp`, which concerns the *Ramsey number* $R(G,H)$ (vertex Ramsey on complete graphs). However, the standard definition of "Ramsey size linear" concerns the *size Ramsey number* $\hat{r}(G,H)$ (edge count of a minimal graph whose 2-colorings force a copy). These are **different quantities**. + +The local definition says: there exists $n ≤ C · |E(H)|$ such that every 2-coloring of $K_n$ contains $G$ or $H^c$. This bounds the classical Ramsey number $R(G,H)$ linearly in $|E(H)|$. + +The standard definition (and the library's version) says: the minimum number of *edges* in a graph $F$ such that every 2-coloring of $F$'s edges contains $G$ or $H$ is at most $C · |E(H)|$. This bounds $\hat{r}(G,H)$ linearly in $|E(H)|$. + +**These are not equivalent.** The size Ramsey number $\hat{r}(G,H)$ can be much smaller than $\binom{R(G,H)}{2}$ (the edge count of $K_{R(G,H)}$). The library's `SimpleGraph.IsRamseySizeLinear` uses the correct *size* Ramsey number formulation via `sizeRamsey`. The local definition in problem 79 uses the classical *vertex* Ramsey number formulation. + +The problem name "Ramsey size linear" specifically refers to the *size* Ramsey number being linear, so the library definition is correct and the local definition is wrong. + +**This is the most critical issue in the formalization.** + +### Summary + +| Aspect | Assessment | +|---|---| +| Code reuse | Poor — four redundant local definitions; library versions exist and are used elsewhere | +| Citations | Incomplete — [Er95] missing; [EFRS93] and [Wi24] lack titles/venues | +| Variants | Complete — single variant correctly captured | +| Readability | Fair — redundant definitions and non-standard idioms hurt clarity | +| Formalizability | High — low ambiguity, statement is precise | +| Correctness | **Incorrect** — uses classical Ramsey number instead of size Ramsey number; should use `SimpleGraph.IsRamseySizeLinear` from the library | diff --git a/ai-review/790.md b/ai-review/790.md new file mode 100644 index 0000000000..aeb7661208 --- /dev/null +++ b/ai-review/790.md @@ -0,0 +1,136 @@ +# Review: Erdős Problem 790 + +## 1. Code Reuse + +The formalization defines `Erdos790.IsSumFree` locally. Several related "sum-free" definitions exist in the codebase: + +- **`IsSumFree` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`**: Defined as `Disjoint (A + A) A` — the classical sum-free notion (no `a + b = c` with `a, b, c ∈ A`). This is a *different* concept from 790's notion. +- **`Erdos876.IsSumFreeErdos`** (`ErdosProblems/876.lean`): No element equals the sum of finitely many distinct *smaller* elements. Works over `Set ℕ` and allows singleton sums. Similar in spirit but differs in domain (ℕ vs ℤ), container type (Set vs Finset), and the "smaller" constraint. +- **`Erdos792.IsSumFreeSet`** (`ErdosProblems/792.lean`): Classical sum-free (no `a + b = c`), over `Finset ℤ`. + +**Verdict**: Problem 790's "sum-free" notion — no element equals the sum of two or more *other distinct* elements — is genuinely distinct from all existing definitions. The local definition is justified. No reuse opportunity exists. + +**Note**: The name `IsSumFree` shadows the definition in `Basic.lean`, though the `Erdos790` namespace prevents actual conflicts. A more descriptive name like `IsDistinctSumFree` could reduce confusion, but this is minor. + +## 2. Citations + +The website ([erdosproblems.com/790](https://www.erdosproblems.com/790), last edited 23 January 2026) lists these references: + +| Reference | In formalization? | +|-----------|-------------------| +| [CKS75] Choi, Komlós, Szemerédi, *On sum-free subsequences*, Trans. Amer. Math. Soc. 212 (1975), 307–313 | **Yes** — fully cited in docstring | +| [Er65, p.188] | **No** | +| [Er73, p.130] | **No** | +| [Va99, 1.22] | **No** | +| See also: Problem 876 | **No** | + +The [CKS75] citation is complete and well-formatted. The missing references are secondary (they document earlier partial results by Erdős and Choi that are superseded by CKS). Mentioning "See also: Problem 876" in the module docstring would be helpful, since 876 concerns a closely related sum-free sequence problem. + +## 3. Variants + +The website poses: + +> Estimate $l(n)$. In particular: +> - Is it true that $l(n)n^{-1/2} \to \infty$? +> - Is it true that $l(n) < n^{1-c}$ for some $c > 0$? + +The formalization captures: + +| Statement | Formalized as | Status | +|-----------|---------------|--------| +| $l(n) n^{-1/2} \to \infty$? | `erdos_790` | `open` | +| $l(n) < n^{1-c}$ for some $c > 0$? | `erdos_790.variants.upper_bound_conjecture` | `open` | +| CKS lower bound $(n \log n / \log\log n)^{1/2} \ll l(n)$ | `erdos_790.variants.cks_lower` | `solved` | +| CKS upper bound $l(n) \ll n / \log n$ | `erdos_790.variants.cks_upper` | `solved` | +| CKS conjecture $l(n) \geq n^{1-o(1)}$ | `erdos_790.variants.cks_conjecture` | `open` | + +**Coverage is good.** The two explicit sub-questions and the CKS bounds/conjecture are all captured. The website also mentions: + +- Erdős's observation $l(n) \geq (n/2)^{1/2}$ — not formalized (minor historical result, superseded by CKS) +- Choi's improvement $l(n) > (1+c)n^{1/2}$ — not formalized (also superseded) + +These omissions are acceptable since the CKS lower bound strictly dominates them. + +## 4. Readability + +The code is well-organized: +- Clear namespace (`Erdos790`) +- Good docstrings with LaTeX and citations +- Logical progression from definitions to main conjecture to variants +- Consistent naming scheme (`erdos_790.variants.*`) + +Minor suggestions: +- The `IsSumFree` docstring says "sum of two or more other distinct elements" — this is accurate and clear. +- The `(1 : ℝ) / 2` exponent could be written as `(1 / 2 : ℝ)` for marginally improved readability, though this is stylistic. + +## 5. Formalizability + +**Assessment: Fully formalizable; low ambiguity.** + +The problem statement is precise. The definition of $l(n)$ is unambiguous: it's the largest integer such that every $n$-element subset of $\mathbb{Z}$ contains a sum-free (in the distinct-sum sense) subset of size at least $l(n)$. The two sub-questions are precise yes/no questions about asymptotic behavior. + +The only potential source of ambiguity is the phrase "sum-free" itself, which has multiple meanings in combinatorics. The problem clarifies the intended meaning ("no solutions to $a_1 = a_2 + \cdots + a_r$ with $a_i \in B$ all distinct"), and the formalization faithfully captures this. + +The asymptotic statements ($\ll$, $\gg$, $o(1)$) have standard mathematical meanings that translate cleanly to $\varepsilon$-$N_0$ formulations, which the formalization correctly implements. + +## 6. Correctness + +### Definition `IsSumFree` + +```lean +def IsSumFree (B : Finset ℤ) : Prop := + ∀ b ∈ B, ∀ S : Finset ℤ, S ⊆ B.erase b → S.card ≥ 2 → b ≠ S.sum id +``` + +**Correct.** This encodes: no element $b \in B$ can be written as the sum of 2 or more other distinct elements of $B$. The condition `S ⊆ B.erase b` ensures the summands are distinct from $b$, and `S.card ≥ 2` requires at least two summands. (The `card ≥ 1` case would be vacuously true since a single element of `B.erase b` cannot equal `b`, so `card ≥ 2` is effectively equivalent to `card ≥ 1` here.) + +### Definition `maxSumFreeSize` + +```lean +noncomputable def maxSumFreeSize (n : ℕ) : ℕ := + sSup {l : ℕ | ∀ (A : Finset ℤ), A.card = n → ∃ B : Finset ℤ, B ⊆ A ∧ l ≤ B.card ∧ IsSumFree B} +``` + +**Correct.** The set `{l | ...}` is nonempty (contains 0, since the empty set is sum-free) and bounded above (by $n$, since $B \subseteq A$ and $|A| = n$). For `ℕ` with its `ConditionallyCompleteLattice`, `sSup` of a nonempty bounded set returns the maximum. The set is also downward-closed, so the supremum equals the maximum value of $l$ satisfying the property, matching the mathematical definition of $l(n)$. + +### Theorem statements + +All five theorem statements correctly translate their mathematical counterparts: + +- `erdos_790`: $l(n)/\sqrt{n} \to \infty$ ↔ $\forall C > 0, \exists N_0, \forall n \geq N_0, l(n) \geq C\sqrt{n}$. **Correct.** +- `upper_bound_conjecture`: $\exists c > 0$ s.t. $l(n) \leq n^{1-c}$ eventually. **Correct.** +- `cks_lower` and `cks_upper`: Asymptotic bounds with explicit constants. **Correct.** +- `cks_conjecture`: $l(n) \geq n^{1-o(1)}$ ↔ $\forall \varepsilon > 0, l(n) \geq n^{1-\varepsilon}$ eventually. **Correct.** + +### Issue: `erdos_790` should be `solved`, not `open` + +**This is the most significant finding.** The CKS lower bound (`cks_lower`) states: + +$$l(n) \geq C \left(\frac{n \log n}{\log \log n}\right)^{1/2}$$ + +Dividing both sides by $\sqrt{n}$: + +$$\frac{l(n)}{\sqrt{n}} \geq C \left(\frac{\log n}{\log \log n}\right)^{1/2} \to \infty$$ + +This directly implies the statement of `erdos_790` (with `answer(true)`). Therefore: + +- `erdos_790` should be `@[category research solved, AMS 5 11]` (not `open`) +- The right-hand side should be provable from `cks_lower` +- `answer(sorry)` should be `answer(true)` + +The problem on the website is listed as "OPEN" because the broader question "Estimate $l(n)$" remains unresolved (the gap between the CKS lower and upper bounds is large). However, the specific sub-question formalized as `erdos_790` — "$l(n) n^{-1/2} \to \infty$?" — is definitively answered by CKS. + +### Minor: relationship between variants + +Note that `cks_conjecture` ($l(n) \geq n^{1-o(1)}$) implies `erdos_790` ($l(n)/\sqrt{n} \to \infty$), and is inconsistent with `upper_bound_conjecture` ($l(n) \leq n^{1-c}$) being true. These conjectures represent competing beliefs about the growth rate. The formalization correctly marks both as open, but it may be worth noting in a docstring that they point in opposite directions — if the CKS conjecture holds, then the upper bound conjecture fails, and vice versa. + +## Summary + +| Category | Assessment | +|----------|------------| +| Code reuse | No reuse opportunity; local definition is appropriate | +| Citations | [CKS75] is complete; minor references [Er65], [Er73], [Va99] and "See also: 876" are missing | +| Variants | All key variants captured; historical bounds reasonably omitted | +| Readability | Good; well-structured with clear docstrings | +| Formalizability | Fully formalizable; low ambiguity | +| Correctness | **`erdos_790` should be `solved` with `answer(true)`**, not `open` — the CKS lower bound settles it. Also note the CKS conjecture and upper bound conjecture are mutually exclusive. All definitions and other statements are mathematically correct. | diff --git a/ai-review/791.md b/ai-review/791.md new file mode 100644 index 0000000000..d29a405efd --- /dev/null +++ b/ai-review/791.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 791 + +## 1. Code Reuse + +The file defines a local `additiveBasesMinSize` function using `sInf` over `Finset ℕ`. The codebase already provides: + +- **`Set.IsAddBasisOfOrder`** in `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` — defines additive bases of order `n` for `Set M`. The lemma `isAddBasisOfOrder_two_iff` characterizes order-2 bases as `∀ a, a ∈ A + A`. +- **`Erdos35.IsAdditiveBasis`** in `FormalConjectures/ErdosProblems/35.lean` — a local definition for finite additive bases (order `k`). + +However, **the local definition is justified**. Problem 791 is fundamentally about a *minimization problem* over finite subsets of `{0,…,n}` — it asks for the minimum cardinality `g(n)` of a 2-basis restricted to a bounded interval. The existing `Set.IsAddBasisOfOrder` operates on `Set M` (typically infinite sets of all naturals), and there is no existing `Finset`-level "minimum basis size" concept in the codebase. The `additiveBasesMinSize` definition correctly encapsulates this optimization problem. No meaningful reuse opportunity is missed. + +**Minor note:** The use of `sInf` on `ℕ` is safe here. The infimum set is always non-empty since `A = Finset.range (n + 1)` is always a valid 2-basis (for any `m ≤ n`, `m = m + 0`). Even if the set were empty, `sInf ∅ = 0` for `ℕ`, though this edge case does not arise. + +## 2. Citations + +**Website (erdosproblems.com/791) lists:** +- [Er73] — Erdős (original problem) +- [Ro37] — Rohrbach (1937), proved `(2+c)n ≤ g(n)² ≤ 4n` +- [Mr79] — Mrose (1979), disproved `g(n) ~ 2√n` by showing `g(n)² ≤ (7/2)n` +- [Yu15] — Yu (2015), lower bound `(2.181…+o(1))n ≤ g(n)²` +- [Ko17] — Kohonen (2017), upper bound `g(n)² ≤ (3.458…+o(1))n` +- Related: OEIS sequence A066063 + +**Formalization docstring lists:** Er73, Ro37, Mr79, Yu15, Ko17 + +**Assessment:** All references from the website are present in the docstring. The OEIS reference is omitted, which is acceptable since it is supplementary. The citation format uses shorthand (e.g., `[Yu15]`) consistently. Full bibliographic data (titles, journals) is not provided, but this is consistent with the project's convention. **No issues.** + +## 3. Variants + +The formalization includes three statements: + +| Statement | Description | Category | +|---|---|---| +| `erdos_791.variants.lower_bound` | Yu's lower bound `g(n)² ≥ (2.181… − ε)n` | `research solved` | +| `erdos_791.variants.upper_bound` | Kohonen's upper bound `g(n)² ≤ (3.459… + ε)n` | `research solved` | +| `erdos_791` | Existence of limit `g(n)²/n → c` | `research open` | + +**Missing variants to consider:** + +1. **Rohrbach's original bounds** `(2+c)n ≤ g(n)² ≤ 4n`: Not formalized. These are historically significant and are mentioned in the docstring. Could be included as a `research solved` variant. + +2. **Mrose's disproof** `g(n)² ≤ (7/2)n`: Mentioned in the docstring but not formalized. This is the key historical result that disproved Erdős's original conjecture `g(n) ~ 2√n`. It is logically implied by the Kohonen upper bound (since `3.459 < 3.5`), but formalizing it independently as a `research solved` variant would better document the disproof. + +3. **The original Erdős conjecture** (now disproved): `g(n) ~ 2√n`, i.e., `g(n)²/n → 4`. This could be formalized as a negation (it's false). However, it's implicitly captured since the upper bound constant `3.459 < 4` shows the limit, if it exists, cannot be 4. + +**Assessment:** The most important mathematical content is captured. The Mrose disproof and Rohrbach bounds are natural additions but their absence is not a significant gap since the modern bounds strictly subsume them. + +## 4. Readability + +**Strengths:** +- Clear docstring with LaTeX-rendered mathematics explaining the problem context. +- Logical organization: definition → lower bound → upper bound → main open question. +- The `additiveBasesMinSize` definition has a good docstring connecting it to `g(n)`. +- Consistent naming convention (`erdos_791.variants.*`). + +**Minor suggestions:** +- The upper bound docstring says "The constant `3459/1000` approximates `3.458…`" — the rational `3459/1000 = 3.459`, not `3.458`. This is a minor textual inaccuracy (the formalization itself is correct since `3.459 > 3.4584…`). The docstring could say "approximates `3.459…`" or "provides a rational upper approximation to `3.4584…`". +- The module docstring is comprehensive and well-structured. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem has a precise, unambiguous definition: +- `g(n)` is the minimum cardinality of a subset of `{0,…,n}` whose sumset covers `{0,…,n}`. This is a well-defined optimization over a finite domain. +- The asymptotic bounds are expressed using standard ε-N formulations, which are rigorous. +- The main open question (existence of the limit `g(n)²/n`) is cleanly formalized as a statement about `c > 0` with `|g(n)² − cn| ≤ εn`. + +**One subtle design choice:** The sumset `A + A` under `Pointwise` includes sums `a + a` (an element summed with itself). This is consistent with the standard definition in additive combinatorics where the basis condition requires `{0,…,n} ⊆ A + A` with `A + A = {a₁ + a₂ : a₁, a₂ ∈ A}`, and `a₁ = a₂` is allowed. This matches the literature. + +## 6. Correctness + +**Overall: Correct, with one minor docstring inaccuracy.** + +### Definition `additiveBasesMinSize` +- **Correct.** Uses `sInf` over `{k | ∃ A, A.card = k ∧ A ⊆ range(n+1) ∧ range(n+1) ⊆ A + A}`. This faithfully captures `g(n)`. +- The constraint `A ⊆ Finset.range (n + 1)` correctly restricts to `{0,…,n}`. +- The covering condition `Finset.range (n + 1) ⊆ A + A` correctly requires every element of `{0,…,n}` to be representable as a sum of two elements from `A`. + +### Lower bound (`erdos_791.variants.lower_bound`) +- **Correct.** States that for all `ε > 0`, eventually `(2181/1000 − ε) · n ≤ g(n)²`. The constant `2181/1000 = 2.181` is a valid rational lower approximation of Yu's constant `≈ 2.1817…`. Using `− ε` correctly weakens the bound to an asymptotic statement. + +### Upper bound (`erdos_791.variants.upper_bound`) +- **Correct.** States that for all `ε > 0`, eventually `g(n)² ≤ (3459/1000 + ε) · n`. The constant `3459/1000 = 3.459` is a valid rational upper approximation of Kohonen's constant `≈ 3.4584…`. Using `+ ε` correctly allows for the asymptotic error. +- **Docstring inaccuracy:** "The constant `3459/1000` approximates `3.458…`" — `3459/1000 = 3.459`, not `3.458`. The formalization is correct (since `3.459 > 3.4584…`), but the docstring is slightly misleading about the numeric value. + +### Main theorem (`erdos_791`) +- **Correct.** Asks whether there exists `c > 0` such that `|g(n)² − cn| ≤ εn` for all `ε > 0` eventually. This is equivalent to asking if `g(n)²/n → c`, which is the standard open question. +- The `answer(sorry)` wrapper correctly marks this as a true/false determination (whether the limit exists). +- The constraint `c > 0` is appropriate since `g(n) ≥ √n` (from the lower bound), so any limiting constant must be positive. + +### Category tags +- The bounds are tagged `research solved` — correct, these are proven results. +- The main theorem is tagged `research open` — correct, the existence of the limit is still open. +- AMS classification `5 11` (combinatorics / number theory) is appropriate. + +## Summary + +| Criterion | Rating | Notes | +|---|---|---| +| Code reuse | ✅ Good | Local definition justified; no missed reuse | +| Citations | ✅ Good | All website references present | +| Variants | ⚠️ Minor gaps | Mrose/Rohrbach results not formalized (subsumed by modern bounds) | +| Readability | ✅ Good | One minor docstring numeric inaccuracy (3459/1000 ≈ "3.458") | +| Formalizability | ✅ Excellent | Precise, unambiguous, standard ε-N formulation | +| Correctness | ✅ Correct | Mathematically sound; minor docstring issue only | diff --git a/ai-review/792.md b/ai-review/792.md new file mode 100644 index 0000000000..10427b3de1 --- /dev/null +++ b/ai-review/792.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 792 + +**File:** `FormalConjectures/ErdosProblems/792.lean` + +## 1. Code Reuse + +**Issue identified.** The file defines its own `IsSumFreeSet (B : Finset ℤ)` as `∀ a ∈ B, ∀ b ∈ B, a + b ∉ B`. A library-level definition already exists in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`: + +```lean +def IsSumFree (A : Set α) : Prop := Disjoint (A + A) A +``` + +This general definition works over any `AddCommMonoid` and uses pointwise set addition. The local `IsSumFreeSet` is mathematically equivalent (for `Finset ℤ` coerced to `Set ℤ`) but uses explicit quantifiers instead of the `Disjoint`/pointwise formulation. The file could potentially use the library definition applied to `(B : Set ℤ)`, or at minimum document the equivalence. + +Additionally, at least three other Erdős problems (748, 877, 790) define their own local `IsSumFree` predicates with slight type variations (`Finset ℕ` vs `Finset ℤ`). There is an opportunity to consolidate these definitions or have them reference the library version. Problem 748 even provides a `DecidablePred` instance that could be useful. + +The `maxSumFreeSize` definition uses the same `sSup`-based pattern as Problem 790, which is a reasonable convention. + +## 2. Citations + +The citations in the docstring are mostly consistent with the website but **incomplete**: + +- **[Er65]** — Matches the website. Erdős's original proof that f(n) ≥ n/3. +- **[Be25b]** — Matches. Bedert's improvement to f(n) ≥ n/3 + c log log n. +- **[EGM14]** — Matches. Eberhard–Green–Manners upper bound f(n) ≤ n/3 + o(n). + +**Missing from citations/docstring:** +- **Alon and Kleitman** improved the lower bound to f(n) ≥ (n+1)/3. Mentioned on the website but absent from the file. +- **Bourgain** further improved to f(n) ≥ (n+2)/3. Also mentioned on the website but absent. +- The website notes this is listed as **Problem 1 on Ben Green's open problems list**, which provides additional context not mentioned in the file. +- The website lists additional Erdős references from 1973 and 1992 that are not included. + +## 3. Variants + +**Partially captured.** The formalization includes three theorems: +1. `erdos_792` — Erdős's lower bound f(n) ≥ n/3 +2. `erdos_792.variants.lower_bedert` — Bedert's improved lower bound +3. `erdos_792.variants.upper_egm` — Eberhard–Green–Manners upper bound + +**Missing variants:** +- **Alon–Kleitman bound:** f(n) ≥ (n+1)/3. A natural intermediate variant. +- **Bourgain bound:** f(n) ≥ (n+2)/3. Another intermediate improvement. +- The overarching question "Estimate f(n)" is inherently open-ended and cannot be cleanly formalized as a single theorem, so the approach of breaking it into specific proved bounds is reasonable. However, one could consider adding a conjectural statement about the true order of f(n) − n/3 (e.g., whether it is Θ(log log n) or something else). + +## 4. Readability + +**Good overall.** The code is well-structured with clear docstrings explaining each theorem. Minor observations: + +- The name `IsSumFreeSet` is slightly inconsistent with the convention `IsSumFree` used in every other problem file (748, 877, 790, 876) and the library definition. Renaming to `IsSumFree` would improve consistency. +- The docstring for `maxSumFreeSize` clearly explains the mathematical meaning. +- The namespace `Erdos792` cleanly scopes all definitions. + +## 5. Formalizability + +**High — the problem is clearly formalizable.** The individual bounds (f(n) ≥ n/3, the Bedert lower bound, the EGM upper bound) are precise mathematical statements with no ambiguity. The overarching problem "Estimate f(n)" is intentionally open-ended and not directly formalizable as a single theorem, but the decomposition into specific bounds is the standard approach and is well-executed here. + +The definition of "sum-free" (no a + b = c with a, b, c ∈ B, where a, b are not required to be distinct) is standard and unambiguous. + +**Minor formalizability note:** The `sSup` on `ℕ` requires the set to be bounded above and nonempty for the value to be meaningful. The set `{k | ∀ A, A.card = n → ∃ B ⊆ A, IsSumFreeSet B ∧ k ≤ B.card}` always contains 0 (the empty set is sum-free) and is bounded above by n, so `sSup` is well-defined. However, this well-definedness is not proved or documented, which could make downstream proofs slightly harder. + +## 6. Correctness + +**Mathematically correct with minor observations.** + +- **`IsSumFreeSet` definition:** `∀ a ∈ B, ∀ b ∈ B, a + b ∉ B` is the standard definition of a sum-free set. This correctly allows a = b (so 2a ∉ B for any a ∈ B), matching the convention that a sum-free set has `(B + B) ∩ B = ∅`. + +- **`maxSumFreeSize` definition:** Correctly captures the function f(n) as described in the problem. The use of `sSup` over `{k | ∀ A ...}` computes the maximum guaranteed sum-free subset size across all n-element subsets of ℤ. + +- **`erdos_792`:** The statement `(maxSumFreeSize n : ℝ) ≥ n / 3` correctly formalizes Erdős's 1965 result. The cast to `ℝ` is necessary since n/3 in `ℕ` would be floor division. + +- **`erdos_792.variants.lower_bedert`:** Correctly states the existence of c > 0 with f(n) ≥ n/3 + c · log(log(n)) for sufficiently large n. Uses `Real.log` which is the natural logarithm, consistent with the standard statement. + +- **`erdos_792.variants.upper_egm`:** The formalization of f(n) ≤ n/3 + o(n) as "for every ε > 0, f(n) ≤ (1/3 + ε)n for sufficiently large n" is correct. This is the standard ε-N formalization of the little-o bound. + +- **Category tags:** All three theorems are tagged `category research solved`, which is correct — each states a specific proved result. The fact that the overarching problem ("Estimate f(n)") remains open does not affect this, since no single theorem claims to resolve the full estimation question. + +**No mathematical errors detected.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use library `IsSumFree`; name inconsistency with other files | +| Citations | Missing Alon–Kleitman and Bourgain references from website | +| Variants | Missing two intermediate lower bounds | +| Readability | Good; minor naming inconsistency | +| Formalizability | High; well-decomposed | +| Correctness | Correct; no mathematical errors | diff --git a/ai-review/793.md b/ai-review/793.md new file mode 100644 index 0000000000..e9669050e1 --- /dev/null +++ b/ai-review/793.md @@ -0,0 +1,108 @@ +# Review: Erdős Problem 793 + +## 1. Code Reuse + +The `IsPrimitiveLike` definition and `primitiveLikeMaxSize` are defined locally in the `Erdos793` namespace. No existing codebase definitions directly capture this "no element divides the product of two others" property. However, the structural pattern closely mirrors **Problem 425** (`ErdosProblems/425.lean`), which defines `IsMultB2` (multiplicative Sidon sets) and `multB2MaxSize` using an identical `sSup`-over-cardinalities idiom. The parallel is natural since both problems concern multiplicative structure in `{1, …, n}` and measure `F(n) − π(n)`. + +No reuse opportunity exists in `FormalConjecturesForMathlib/`: the existing `IsSidon` (additive), `IsSumFree`, and AP-free infrastructure are all for additive combinatorics and do not apply here. + +**Verdict:** No actionable reuse. The local definitions are appropriate. + +## 2. Citations + +The website ([erdosproblems.com/793](https://www.erdosproblems.com/793)) lists sources **[Er69]** and **[Er70b]**, and references **[Er38]** for the historical bounds. + +- The module docstring correctly cites **[Er38]** for the bounds `π(n) + c₁ n^{2/3}(log n)^{−2} ≤ F(n) ≤ π(n) + c₂ n^{2/3}(log n)^{−2}`. +- The theorem docstring correctly cites **[Er69][Er70b]** as the source of the conjecture. +- The cross-reference to Problem #425 is included. + +The website also describes Erdős's [Er69] graph-theoretic proof sketch for `F(n) ≤ π(n) + n^{2/3}` (vertices are integers ≤ n^{2/3} and primes in (n^{2/3}, n], edges represent membership in A, yielding a forest). This proof sketch is not reproduced in the formalization docstring, but this is not required — it is supplementary exposition. + +**Verdict:** Citations are complete and accurate. + +## 3. Variants + +The website states a generalization: + +> For sets where no `a ∈ A` divides the product of `r` distinct other elements, replace `2/3` with `2/(r+1)`. + +This variant is **not captured** in the formalization. Notably, the sibling Problem 425 *does* include its analogous generalization as `erdos_425.variants.part2` (bounding `|A| ≤ π(n) + O(n^{(r+1)/(2r)})` for r-multiplicative Sidon sets). For consistency and completeness, Problem 793 should include a corresponding variant, e.g.: + +```lean +/-- Generalization: if no a ∈ A divides the product of r distinct other elements of A, +then F_r(n) = π(n) + (C_r + o(1)) · n^{2/(r+1)} · (log n)^{-2}. -/ +theorem erdos_793.variant (r : ℕ) (hr : 2 ≤ r) : ... +``` + +**Verdict:** Missing generalization to r-fold products. Should be added for completeness. + +## 4. Readability + +The code is clean and well-structured: + +- `IsPrimitiveLike` has a clear docstring explaining the mathematical condition. +- `primitiveLikeMaxSize` is clearly documented as the extremal quantity F(n). +- The theorem statement is readable, with the limit expression matching the mathematical formulation. +- Namespace scoping (`Erdos793`) keeps definitions local. + +Minor observation: the name `IsPrimitiveLike` is slightly unusual. In the literature, these sets are sometimes called "primitive sets" (a set where no element divides another) or this generalization might be called "2-primitive" or "product-primitive." The name chosen is adequate but the docstring clarifies it well. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem is precisely stated: it asks whether a specific ratio converges to a positive constant. All components are well-defined: + +- The extremal function F(n) is unambiguous. +- The "primitive-like" condition `a ∤ bc` for distinct `a ≠ b`, `a ≠ c` is precise (note: `b = c` is allowed, which is correct — the condition only requires `a` to be distinct from `b` and `c`, not that `b ≠ c`). +- The asymptotic question (existence of a limit) is a clean yes/no question. + +**Verdict:** Fully formalizable with no ambiguity. The statement is a precise asymptotic convergence question. + +## 6. Correctness + +### Definition of `IsPrimitiveLike` + +The condition `∀ a ∈ A, ∀ b ∈ A, ∀ c ∈ A, a ≠ b → a ≠ c → ¬(a ∣ b * c)` correctly captures "a does not divide bc whenever a, b, c ∈ A with a ≠ b and a ≠ c." The case `b = c` is correctly permitted (only `a` must differ from `b` and from `c`). + +Note that this condition implies `A` is a **primitive set** (no element divides another): taking `c = b` with `a ≠ b`, we get `a ∤ b²`, which for `a, b ≥ 2` with `a | b` would give `a | b²`, contradiction. For `a = 1`, the condition `1 ∤ b * c` fails for any `b, c ≥ 1`, so `1` cannot belong to any primitive-like set of size ≥ 3. This is mathematically consistent with the expected behavior (primes form the bulk of optimal sets). + +### Definition of `primitiveLikeMaxSize` + +Uses `sSup` over `{k | ∃ A, IsPrimitiveLike A ∧ (∀ x ∈ A, 1 ≤ x ∧ x ≤ n) ∧ A.card = k}`. This set is: +- **Nonempty** (the empty set qualifies with k = 0). +- **Bounded above** by n (any subset of {1, …, n} has at most n elements). +- Therefore `sSup` is well-defined in `ℕ` and equals the maximum. + +The constraint `1 ≤ x ∧ x ≤ n` correctly models `{1, …, n}`. Using `Finset ℕ` is appropriate. + +### Theorem statement + +The expression: +``` +((primitiveLikeMaxSize n : ℝ) - (Nat.primeCounting n : ℝ)) / + ((n : ℝ) ^ ((2 : ℝ) / 3) / (Real.log (n : ℝ)) ^ (2 : ℝ)) +``` + +computes `(F(n) − π(n)) / (n^{2/3} / (log n)²)` = `(F(n) − π(n)) · (log n)² / n^{2/3}`. + +For this to tend to `c > 0`, we need `F(n) − π(n) ∼ c · n^{2/3} / (log n)²`, which matches the conjecture `F(n) = π(n) + (C + o(1)) · n^{2/3} · (log n)^{−2}`. + +**Edge cases for small n:** When `n ∈ {0, 1}`, `Real.log n ≤ 0`, so `(Real.log n)^(2 : ℝ)` via `rpow` evaluates to 0 (since `log 0 = 0` and `log 1 = 0` in Mathlib), making the denominator 0 and the whole expression 0 by Lean's division-by-zero convention. This is irrelevant since `atTop` ignores finitely many terms. + +**The `c > 0` constraint** is correct: Erdős's [Er38] bounds show `F(n) − π(n)` is between `c₁` and `c₂` times `n^{2/3}/(log n)²` with `0 < c₁ ≤ c₂`, so any limit must be positive. + +**The `answer(sorry)` pattern** correctly encodes this as an open yes/no question via biconditional, consistent with the codebase convention. + +**Verdict:** The formalization is mathematically correct and complete (modulo the missing r-fold variant noted above). No flaws detected. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse opportunities; local definitions appropriate | +| Citations | Complete and accurate | +| Variants | **Missing** r-fold generalization (replace 2/3 with 2/(r+1)) | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/794.md b/ai-review/794.md new file mode 100644 index 0000000000..a2cbd1fbb3 --- /dev/null +++ b/ai-review/794.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 794 + +## 1. Code Reuse + +The file defines `ContainsSubhypergraph` locally in the `Erdos794` namespace. Several reusable definitions exist elsewhere in the codebase: + +- **`IsRUniformHypergraph`** (in `ErdosProblems/719.lean`): `def IsRUniformHypergraph (n r : ℕ) (H : Finset (Finset (Fin n))) : Prop := ∀ e ∈ H, e.card = r`. The inline predicate `(∀ e ∈ H, e.card = 3)` in the theorem statement duplicates this. Using `IsRUniformHypergraph (3 * n) 3 H` would improve consistency, though the inline form is arguably clearer for a standalone problem. + +- **`UniformHypergraph` structure** (in `ErdosProblems/837.lean`, `833.lean`, etc.): Several files define a structure bundling edges with a uniformity proof. However, the current approach using a bare `Finset (Finset (Fin N))` with an explicit uniformity hypothesis is common across many Erdős problems and is a reasonable choice. + +- **`ContainsSubhypergraph`** is unique to this file. No equivalent exists elsewhere. The closest analog is `IsKkrFree` (in `712.lean`, `500.lean`), which checks whether *all* r-subsets of k vertices are present (a complete sub-hypergraph), whereas `ContainsSubhypergraph` checks for at least m edges among k vertices. These are genuinely different concepts, so reuse is not applicable. + +**Verdict:** Minor opportunity to use `IsRUniformHypergraph`, but no significant code reuse issues. + +## 2. Citations + +The docstring references `[erdosproblems.com/794]`. The website lists the following references: + +- **[Er69, p.81]** — Original Erdős source +- **[FrFu84]** — Frankl and Füredi construction (related to the critical edge density being at least 2/7) + +The docstring does not include these bibliographic references. It attributes the counterexample to Harris and the redundancy observation to Balogh, both consistent with the website. However, the formal citation keys `[Er69, p.81]` and `[FrFu84]` should be added for completeness. + +**Verdict:** Add `[Er69, p.81]` and `[FrFu84]` references to the docstring. + +## 3. Variants + +The formalization captures the original problem statement faithfully. Two observations about variants: + +1. **Balogh's simplification:** The docstring correctly notes that every 3-uniform hypergraph on 5 vertices with 7 edges contains a 4-vertex subgraph with 3 edges, making the second condition (`ContainsSubhypergraph H 5 7`) redundant. This means the disjunction is equivalent to just `ContainsSubhypergraph H 4 3`. A simplified variant could state the equivalent question: does every 3-uniform hypergraph on 3n vertices with n³+1 edges contain 4 vertices spanning 3 edges? This simplified form is not separately formalized, but since the original formulation is faithfully captured and the equivalence is documented, this is acceptable. + +2. **Turán density question:** The website mentions a deeper question about the Turán density of K₄⁻ (the 3-uniform hypergraph on 4 vertices with 3 edges), where the Frankl-Füredi construction gives a lower bound of 2/7 and the conjectured truth is also 2/7. This is a related but distinct problem and is not expected to be part of this formalization. + +**Verdict:** All relevant variants of the original problem are captured. The redundancy of the second condition is properly documented. + +## 4. Readability + +The code is well-structured and readable: + +- The `ContainsSubhypergraph` helper definition is clearly named and has a good docstring explaining its semantics. +- The theorem statement reads naturally: for all n, for all 3-uniform hypergraphs H on 3n vertices with ≥ n³+1 edges, H contains a (4,3)- or (5,7)-subhypergraph. +- The docstring explains both the problem and the disproof clearly. + +Minor suggestions: +- The `ContainsSubhypergraph` docstring says "at least m edges" but the definition uses `≥ m`, which is consistent. Good. +- The namespace `Erdos794` is clean and appropriate. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem is precisely stated and straightforwardly formalizable: + +- "3-uniform hypergraph on 3n vertices" → `Finset (Finset (Fin (3 * n)))` with all edges of cardinality 3. Clear. +- "at least n³+1 edges" → `H.card ≥ n ^ 3 + 1`. Clear. +- "subgraph on k vertices with m edges" → `ContainsSubhypergraph H k m`. Clear. + +The only subtlety is the encoding choice: hyperedges are modeled as `Finset (Fin N)` (sets, not multisets), which is standard for simple hypergraphs. The problem implicitly assumes simple hypergraphs (no repeated edges, no edges with repeated vertices), and this is correctly captured. + +**Verdict:** Unambiguous and cleanly formalizable. No issues. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +### 6.1 Answer polarity +`answer(False)` elaborates to `False`. The biconditional `False ↔ P` is equivalent to `¬P`, asserting the negation of the universal statement. Since the problem is disproved (a counterexample exists), this correctly captures "the answer to 'Is it true that...?' is No." + +### 6.2 Counterexample verification +Harris's counterexample: a 3-uniform hypergraph on {1,...,9} (n=3, so 3n=9) with 28 edges (27 "product" edges choosing one from each of {1,2,3}, {4,5,6}, {7,8,9}, plus the edge {1,2,3}). + +- **Edge count:** 3×3×3 + 1 = 28 = n³ + 1. ✓ +- **3-uniformity:** Each product edge picks one element from each of 3 groups, giving a 3-element set. The additional edge {1,2,3} is also 3-element. ✓ +- **No (4,3)-subhypergraph:** Any 4 vertices distributed as (2,1,1) across the three groups span at most 2×1×1 = 2 product edges; adding {1,2,3} requires all 3 vertices from the first group, giving distribution (3,1,0) or (3,0,1), which spans 0 product edges + 1 extra edge = 1. Maximum over any 4 vertices is 2 edges < 3. ✓ +- **No (5,7)-subhypergraph:** Follows from the (4,3) result and Balogh's observation, but also directly: C(5,3) = 10 possible 3-edges on 5 vertices, and the product construction is sparse. ✓ + +### 6.3 `ContainsSubhypergraph` definition +The definition `∃ S : Finset (Fin N), S.card = k ∧ (H.filter (· ⊆ S)).card ≥ m` correctly captures "there exist k vertices spanning at least m edges of H." Filtering edges by `· ⊆ S` correctly selects edges whose vertices all lie in S. + +### 6.4 Edge cases +- **n = 0:** 0 vertices, threshold 1 edge. No hypergraph on 0 vertices can have 1 edge, so the implication holds vacuously. +- **n = 1:** 3 vertices, threshold 2 edges. Only C(3,3) = 1 possible edge, so threshold is never met. Vacuous. +- **n = 2:** 6 vertices, threshold 9 edges. Not the counterexample case; the universal statement may or may not hold here but the ∃ negation only needs one counterexample (n=3). + +**Verdict:** The formalization is correct and complete. The counterexample described in the docstring is valid, and the formal statement accurately captures the disproved conjecture. + +--- + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Minor: could use `IsRUniformHypergraph` but not critical | +| Citations | **Add [Er69, p.81] and [FrFu84] references** | +| Variants | Complete; redundancy properly documented | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | **Correct** | + +**Overall:** High-quality formalization. The only actionable item is adding the missing bibliographic references. diff --git a/ai-review/795.md b/ai-review/795.md new file mode 100644 index 0000000000..195cf9b9f9 --- /dev/null +++ b/ai-review/795.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 795 + +## 1. Code Reuse + +**Issue: Custom `primeCounting` should be replaced with Mathlib's `Nat.primeCounting`.** + +The file defines its own `primeCounting` function (line 42–43): +```lean +def primeCounting (n : ℕ) : ℕ := + ((Finset.range (n + 1)).filter Nat.Prime).card +``` + +However, Mathlib provides `Nat.primeCounting`, and other Erdős problems in the codebase already use it — see Problem 425 (line 79) and Problem 793 (line 74). The custom definition should be dropped in favor of the Mathlib version for consistency and to avoid duplicating a standard function. + +**`HasDistinctSubsetProducts` vs. existing subset-product machinery:** + +Problem 53 defines `subsetProducts` (line 49–50) as `A.powerset.image (fun S => ∏ i ∈ S, i)`. The `HasDistinctSubsetProducts` definition in 795 is logically equivalent to requiring `(A.powerset.image (fun S => ∏ i ∈ S, i)).card = A.powerset.card`, but the current explicit universal-quantifier formulation is arguably cleaner for theorem proving. No change needed here, though a comment cross-referencing Problem 53 could be helpful. + +**`maxDistinctProductSetSize` pattern:** + +The `sSup`-based max-size pattern is used identically in Problems 425 (`multB2MaxSize`, line 56–57) and 793 (`primitiveLikeMaxSize`, line 58–59). These could potentially share a generic "max cardinality of sets in {1,…,n} satisfying property P" combinator, but this is a minor abstraction opportunity — not urgent. + +## 2. Citations + +The docstring references: +- `[Ra25] Raghavan, S., On the Erdős distinct subset products problem, 2025.` + +The website (erdosproblems.com/795) confirms: +- **Erdős (1966)** proved the weaker bound g(n) ≤ π(n) + O(√n / log n). The docstring mentions this but does not give a citation tag for the original Erdős result. +- **Raghavan (2025)** solved the problem. This matches [Ra25]. +- The website also references **related Problem 786**, which is not mentioned in the docstring. + +**Recommendation:** Add a citation for the original Erdős 1966 result (e.g., `[Er66]`) and mention the related Problem 786. + +## 3. Variants + +The formalization captures only the **upper bound** aspect of the problem: +> g(n) ≤ π(n) + π(√n) + o(√n / log n) + +The website also records Raghavan's **lower bound**: +> g(n) ≥ π(n) + π(√n) + π(n^{1/3})/3 − O(1) + +This lower bound is not formalized. While the core Erdős problem is the upper bound question, including the lower bound as a separate theorem (or at least mentioning it in the docstring) would give a more complete picture, especially since both bounds appear in the same paper [Ra25]. + +## 4. Readability + +The code is well-structured and readable overall. Minor suggestions: + +- The docstring uses `$o(\sqrt{n}/\log n)$` in the informal description but the formal statement uses the ε-δ formulation — this is good and clear. +- The docstring could note that the `answer(True)` corresponds to the affirmative resolution by Raghavan, making the connection between the informal and formal statements more explicit. +- The `1 ≤ a` constraint in `maxDistinctProductSetSize` allows `a = 1`, but `HasDistinctSubsetProducts` effectively excludes 1 (since ∏∅ = 1 = ∏{1}). This is mathematically harmless but could confuse a reader. A brief comment noting this would help. + +## 5. Formalizability + +**Assessment: Clearly formalizable; low ambiguity.** + +The problem is fully precise: +- g(n) is well-defined as a supremum over a finite, bounded set. +- The asymptotic claim "o(√n / log n)" is correctly rendered as an ε-δ statement. +- All constituent functions (π, √, log) have standard definitions. + +The only minor ambiguity in the original problem is the variable "x" vs. "n" on the website (`o(x^{1/2}/log n)`), which is clearly a typo — the formalization correctly uses n throughout. + +## 6. Correctness + +**The formalization is mathematically correct with one well-definedness caveat.** + +### What's correct: +- `HasDistinctSubsetProducts` correctly captures the distinctness condition over all subsets (including ∅). +- The ε-δ formulation `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, g(n) ≤ π(n) + π(⌊√n⌋) + ε·√n/log n` is a faithful translation of the asymptotic bound with o(√n / log n). +- `Nat.sqrt` computes ⌊√n⌋, matching the standard convention. +- The `answer(True)` tag correctly reflects that Raghavan [Ra25] proved this affirmatively. + +### Well-definedness of `maxDistinctProductSetSize`: +The definition uses `sSup` on `ℕ`. In Mathlib, `sSup` on `ℕ` (via `ConditionallyCompleteLattice`) returns 0 for unbounded or empty sets. The set `{k | ∃ A, ...}` is: +- **Non-empty**: the empty set A = ∅ always satisfies the conditions with k = 0. +- **Bounded**: since A ⊆ {1, …, n}, we have k ≤ n. + +So `sSup` is well-behaved here. However, `sSup` on `ℕ` is actually defined via `Sup` in the `SupSet` instance, which for `ℕ` is not the conditional completeness instance but rather `sSup S = 0` when `S` is empty and otherwise gives the supremum for bounded sets. This works correctly. Technically, wrapping this in `Finset.sup` or using an explicit `Finset.max` might be more robust, but the current approach is standard in the codebase. + +### No mathematical flaws detected. +The formalization faithfully represents the Erdős problem as stated on the website. + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | Replace custom `primeCounting` with `Nat.primeCounting` | +| Citations | Add original Erdős 1966 citation; mention related Problem 786 | +| Variants | Lower bound from [Ra25] not captured | +| Readability | Good; minor comments suggested | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Correct and complete for the stated upper bound | diff --git a/ai-review/796.md b/ai-review/796.md new file mode 100644 index 0000000000..3d44c9e3c7 --- /dev/null +++ b/ai-review/796.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 796 + +## 1. Code Reuse + +**Significant overlap with Erdős Problem 425** (`FormalConjectures/ErdosProblems/425.lean`). Problem 425 defines `IsMultB2` (multiplicative Sidon sets) and `multB2MaxSize`, which is the special case k=2 of `multiplicativeBkMax` from 796. Specifically, `multiplicativeBkMax 2 n` should be mathematically equal to `multB2MaxSize n`, since "fewer than 2 representations" is equivalent to "all pairwise products are distinct." The two definitions use different formulations (representation counting vs. product-distinctness), so they are not syntactically interchangeable, but a unification or at least a cross-reference would be beneficial. + +The additive convolution utility in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean` defines `sumConv` and `sumRep` for additive representation counts. A multiplicative analogue (`mulConv` / `mulRep`) does not exist in the codebase. If one were created, `productRepCount` could be expressed as the multiplicative convolution of the indicator function of A with itself (restricted to ordered pairs). This is not a blocking issue, but creating a `mulConv` utility would benefit problems 796, 425, 896, and 538, all of which deal with multiplicative representations. + +## 2. Citations + +**File citation:** +> [Er69] Erdős, P., *On some applications of graph theory to number theoretic problems*. Publ. Ramanujan Inst. 1 (1969), 131-136. + +**Website (erdosproblems.com/796):** +The website attributes the problem to [Er69, p.80] and notes that Erdős proved the general asymptotic g_k(n) ~ n·(log log n)^{r-1} / ((r-1)!·log n) for 2^{r-1} < k ≤ 2^r. The website also mentions a typographical error in Erdős's original statement (denominator of (log n)² likely should be log n), and credits Tang for an improved lower bound. + +**Assessment:** The citation is correctly formatted and matches the website's primary reference. The page reference "[Er69, p.80]" in the theorem docstring is correct. However, the Tang lower bound result mentioned on the website is not referenced. This is acceptable since the formalization focuses on the conjecture itself, not surrounding results. + +## 3. Variants + +The formalization captures **only the k=3 case**. The website describes a more general setting: + +- **General k:** For 2^{r-1} < k ≤ 2^r, Erdős proved g_k(n) ~ n·(log log n)^{r-1} / ((r-1)!·log n). The question of a second-order asymptotic (with an explicit constant c) could be posed for all k, not just k=3. +- **k=2 case:** Explicitly noted on the website as Problem 425, which is already formalized separately. The docstring in 796 should mention this connection. +- **General second-order term:** Whether similar c+o(1) refinements exist for other values of k is a natural variant not captured here. + +The `multiplicativeBkMax` definition is already parametric in k, so the infrastructure supports general variants. Adding at least the known general leading-term asymptotic as a variant would be valuable. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The module docstring clearly states the problem. Good. +- `productRepCount` has a helpful docstring explaining the filtering logic. +- The theorem docstring gives a clear mathematical restatement of the ε-N formulation. +- **Suggestion:** Add a brief comment noting the relationship to Problem 425 (k=2 case), e.g., "See also `Erdos425` for the k=2 special case." +- **Suggestion:** The name `multiplicativeBkMax` is descriptive but slightly inconsistent with `multB2MaxSize` in 425. A uniform naming convention (e.g., `multBkMaxSize` vs `multB2MaxSize`) would improve discoverability. + +## 5. Formalizability + +**Assessment: High — the statement is precise and clearly formalizable.** + +The conjecture asks whether g_3(n) = n·log(log n)/log(n) + (c+o(1))·n/log(n) for some constant c. This is a standard asymptotic statement with a well-defined extremal quantity g_3(n). The ε-N formulation used in the Lean code is the canonical way to express "o(1)" in formal mathematics. + +The only mild subtlety is the behavior for small n where log(n) = 0 or log(log(n)) is undefined/negative in the reals. In Lean/Mathlib, `Real.log 0 = 0` and `Real.log` of negative values is 0, so these edge cases produce well-defined (if mathematically meaningless) real numbers. The ∀ n ≥ N₀ quantification correctly avoids these degenerate cases by allowing N₀ to be chosen sufficiently large. + +**Ambiguity: None.** The extremal quantity, the asymptotic form, and the meaning of the o(1) term are all standard and unambiguous. + +## 6. Correctness + +**Assessment: Correct and mathematically sound, with one observation.** + +### Definition correctness + +`productRepCount A m` correctly counts the number of ordered factorizations m = a₁·a₂ with a₁ < a₂, both in A. The three conditions in the filter — (1) m/a₁ ∈ A, (2) a₁ < m/a₁, (3) a₁ * (m/a₁) = m — correctly enforce that a₂ = m/a₁ is in A, that the pair is ordered, and that a₁ actually divides m (since ℕ division truncates). This is sound. + +`multiplicativeBkMax k n` correctly defines g_k(n) as the supremum over cardinalities of valid subsets. The set being optimized over is nonempty (the empty set qualifies with card 0) and bounded above by n, so `sSup` returns the maximum as expected for ℕ. + +### Theorem statement correctness + +The statement: +``` +|g_3(n) - n·log(log(n))/log(n) - c·n/log(n)| ≤ ε·n/log(n) +``` +correctly encodes: +``` +g_3(n) = n·log(log(n))/log(n) + (c + o(1))·n/log(n) +``` + +The ε-N formulation (∃ c, ∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ...) is the standard and correct way to express this asymptotic. + +### Edge case: k=0 + +When k=0, `productRepCount A m < 0` is vacuously false for all ℕ values, so the feasible set is empty and `sSup ∅ = 0` in ℕ. This is a harmless edge case since the problem only concerns k ≥ 2, but the docstring for `multiplicativeBkMax` could note that k ≥ 2 is the intended domain. + +### Operator precedence + +The expression `(n : ℝ) * Real.log (Real.log (n : ℝ)) / Real.log (n : ℝ)` is parsed as `((n * log(log(n))) / log(n))` due to left-to-right associativity of `*` and `/` at the same precedence level. This correctly yields n·log(log(n))/log(n). ✓ + +### Overall mathematical verdict + +The formalization is **correct and complete** for the specific conjecture stated. No mathematical flaws are apparent. An experienced mathematician would not identify errors. The formalization faithfully captures the problem as stated on erdosproblems.com. diff --git a/ai-review/797.md b/ai-review/797.md new file mode 100644 index 0000000000..351a9beab0 --- /dev/null +++ b/ai-review/797.md @@ -0,0 +1,85 @@ +# Review of Erdős Problem 797 + +## 1. Code Reuse + +The formalization defines `IsAcyclicColoring` locally in `797.lean`. No equivalent definition exists elsewhere in the codebase. The definition correctly builds on existing Mathlib/codebase infrastructure: + +- `SimpleGraph.Coloring` (Mathlib) — used as the base proper coloring type +- `SimpleGraph.induce` (Mathlib) — used to form the 2-color induced subgraph +- `SimpleGraph.IsAcyclic` (Mathlib, via `Combinatorics.SimpleGraph.Acyclic`) — used for the acyclicity condition +- `SimpleGraph.degree` (Mathlib) — used for the max-degree constraint + +The codebase contains other coloring variants (`Cocolorable` in `Coloring.lean`, `cochromaticNumber` in problems 758–760, `dichromaticNumber` in 761), but none are applicable here. The `IsAcyclicColoring` definition is specific to this problem and appropriately scoped to the `Erdos797` namespace. + +**No reuse opportunities identified.** + +## 2. Citations + +The website ([erdosproblems.com/797](https://www.erdosproblems.com/797)) lists: + +- **[AlBe76]**: Albertson, M. O. and Berman, D. M., *Every planar graph has an acyclic 7-coloring*, 1976. +- **[AMR91]**: Alon, N., McDiarmid, C., and Reed, B., *Acyclic coloring of graphs*, 1991. + +The formalization's docstring includes both references with matching author names, titles, and years. **Citations are correct and complete.** + +## 3. Variants + +The original problem asks: "Is it true that f(d) = o(d²)?" The website also notes: + +- A greedy coloring gives f(d) ≤ d² + 1. +- Erdős showed f(d) ≥ d^{4/3 − o(1)}. +- AMR91 resolved this with tight bounds: d^{4/3}/(log d)^{1/3} ≪ f(d) ≪ d^{4/3}. + +The formalization captures the AMR91 result (the strongest known bounds), which implies an affirmative answer to the original o(d²) question. The original weaker question is not separately formalized, but this is appropriate — formalizing the stronger resolved result subsumes it. + +**No missing variants.** + +## 4. Readability + +The code is well-structured: +- The `IsAcyclicColoring` definition is cleanly separated with a clear docstring. +- The theorem has inline comments (`-- Upper bound`, `-- Lower bound`) demarcating the two parts. +- The docstring states the mathematical result with LaTeX-style asymptotic notation. + +Minor suggestions: +- The upper and lower bounds could be split into two separate theorems for clarity and independent provability, though combining them as a conjunction is also standard practice. + +**Readability is good.** + +## 5. Formalizability + +The problem is highly formalizable. The definition of acyclic coloring is standard and well-established. The asymptotic bounds are expressed concretely using existential constants (∃ C > 0), which is the standard approach for formalizing big-O/big-Omega statements. + +The formalization avoids Landau notation (o, O, Ω) in favor of explicit quantification, which is the correct approach in a formal proof assistant. + +**No ambiguity. The problem is precisely formalizable.** + +## 6. Correctness + +### Definition of `IsAcyclicColoring` +The definition is mathematically correct. It states that for every pair of distinct colors a, b, the subgraph induced by the vertices colored a or b is acyclic (a forest). Combined with the fact that `G.Coloring α` already ensures properness (adjacent vertices receive distinct colors), this matches the standard definition of acyclic coloring. + +### Upper bound +States: ∃ C > 0 such that **for all** d, n, and G on Fin n with max degree ≤ d, there exists an acyclic k-coloring with k ≤ C · d^{4/3}. + +**Issue**: The upper bound lacks a threshold `d₀`. The standard asymptotic statement f(d) ≪ d^{4/3} means ∃ C, d₀ such that ∀ d ≥ d₀, f(d) ≤ C · d^{4/3}. Without a threshold, the statement is false for d = 0: any non-empty graph (n ≥ 1) requires at least k = 1 color, but C · 0^{4/3} = 0, so k ≤ 0 fails. For d ≥ 1 with a sufficiently large constant C, the bound holds, so this is a minor edge-case issue. **Fix**: Either add `∃ d₀ : ℕ, ∀ d : ℕ, d₀ ≤ d →` (mirroring the lower bound's structure), or add a `+ 1` term. + +### Lower bound +States: ∃ C > 0, ∃ d₀, ∀ d ≥ d₀, ∃ graph G with max degree ≤ d such that any acyclic k-coloring has k ≥ C · d^{4/3} / (log d)^{1/3}. + +This correctly captures f(d) ≫ d^{4/3} / (log d)^{1/3} and properly includes a threshold d₀ (needed since log d is problematic for small d). + +### Finiteness +The restriction to `Fin n` (finite graphs) is appropriate since acyclic chromatic number is a concept for finite graphs. + +### Tags +`category research solved` — correct, the problem is resolved by AMR91. +`AMS 5` — correct, this is combinatorics. + +### Summary of correctness issues + +| Issue | Severity | Description | +|-------|----------|-------------| +| Missing `d₀` in upper bound | Low | Upper bound is false for d = 0, n ≥ 1. Easily fixable by adding a threshold or offset. | + +**Overall: The formalization is mathematically sound modulo a minor edge case in the upper bound's quantification.** diff --git a/ai-review/798.md b/ai-review/798.md new file mode 100644 index 0000000000..1f25e23196 --- /dev/null +++ b/ai-review/798.md @@ -0,0 +1,102 @@ +# Review: Erdős Problem 798 + +## 1. Code Reuse + +The formalization defines its own `IntGridCollinear` using the cross-product/determinant formula: +```lean +def IntGridCollinear (p q r : ℤ × ℤ) : Prop := + (q.1 - p.1) * (r.2 - p.2) = (r.1 - p.1) * (q.2 - p.2) +``` + +This is structurally identical to `Erdos733.Collinear` (in `FormalConjectures/ErdosProblems/733.lean`), which uses the same formula over `ℝ × ℝ`. A shared collinearity definition parameterized by the scalar type could eliminate this duplication. However, keeping a local definition is defensible since `ℤ × ℤ` vs `ℝ × ℝ` are different types and the definition is short. + +Mathlib provides `Collinear ℝ` on affine/Euclidean spaces (used in problems 98, 101, 831), but it operates on `EuclideanSpace ℝ (Fin 2)` or `Set` of vectors, which is heavier machinery than needed here. Using the direct cross-product formula on `ℤ × ℤ` is simpler and appropriate. + +The `sInf`-based pattern for `gridCoveringNumber` follows the same convention as `coveringNumber` in problem 616 and `AllowedSetSize` in Green's Open Problem 72. No reuse concern here. + +**Verdict:** Minor duplication with 733's `Collinear`. Acceptable as-is; a shared utility could be considered but is not necessary. + +## 2. Citations + +The docstring cites: +> [Al91] Alon, N., _A note on the covering number of $\{1, \ldots, n\}^2$_ (1991). + +The website (erdosproblems.com/798) attributes the problem to **Erdős and Purdy** and references "Gu81" as the source context. The resolution by Alon (1991) is confirmed. + +**Issues:** +- The docstring does not mention the source reference "Gu81" that appears on the website. This could be added for completeness (likely: Guy, R. K., _Unsolved Problems in Number Theory_, 1981, or a related Erdős–Purdy publication from that era). +- The Alon citation title appears accurate but the full journal reference is missing. The paper appeared in _Geometriae Dedicata_ 40 (1991), 139–144. +- The website recommends citing as: *T. F. Bloom, Erdős Problem #798, https://www.erdosproblems.com/798* + +**Verdict:** The Alon citation should include full journal information. The "Gu81" source reference from the website is missing. + +## 3. Variants + +The problem as stated on erdosproblems.com asks to **"Estimate $t(n)$"** and then specifically asks whether $t(n) = o(n)$. + +The formalization captures only the $t(n) = o(n)$ question. The following quantitative bounds mentioned in the docstring are **not** formalized: + +1. **Lower bound:** $t(n) \gg n^{2/3}$ (Erdős–Purdy). This could be stated as: + ``` + ∃ C > 0, ∀ n, (gridCoveringNumber n : ℝ) ≥ C * n^(2/3) + ``` + +2. **Upper bound:** $t(n) \ll n^{2/3} \log n$ (Alon). This could be stated as: + ``` + ∃ C > 0, ∀ n ≥ 1, (gridCoveringNumber n : ℝ) ≤ C * n^(2/3) * log n + ``` + +These tighter bounds are the more informative results. In particular, the upper bound is what actually *proves* $t(n) = o(n)$, so formalizing it would strictly strengthen the current statement. + +**Verdict:** The asymptotic $o(n)$ statement is captured, but the sharper Erdős–Purdy lower bound and Alon upper bound — which are the main quantitative content — are missing as separate theorems. + +## 4. Readability + +The code is clean and well-organized: + +- The three definitions (`IntGridCollinear`, `CoversIntGrid`, `gridCoveringNumber`) build logically on each other. +- Docstrings are clear and mathematically precise. +- The module docstring provides good context on the problem's history. +- The namespace `Erdos798` avoids polluting the global namespace. + +**Minor suggestions:** +- The docstring for `gridCoveringNumber` says "whose pairwise lines cover all $n^2$ grid points." The word "pairwise" is slightly informal; "whose $\binom{|S|}{2}$ determined lines" might be more precise, though this is a stylistic nitpick. + +**Verdict:** Highly readable. No substantive issues. + +## 5. Formalizability + +The problem is **precisely formalizable**. The key concepts are all well-defined: + +- The grid $\{1, \ldots, n\}^2$ is a finite, concrete set. +- "Lines determined by pairs of points" is unambiguous (a line through two distinct points). +- "Cover" means every grid point lies on at least one such line. +- $t(n) = o(n)$ has a standard $\varepsilon$-$N_0$ definition. + +The only minor ambiguity in the original problem is whether the points of $S$ must themselves be grid points. The formalization correctly resolves this: `CoversIntGrid` requires `∀ p ∈ S, 1 ≤ p.1 ∧ p.1 ≤ n ∧ 1 ≤ p.2 ∧ p.2 ≤ n`, so $S \subseteq \{1,\ldots,n\}^2$. This matches the problem statement ("points in $\{1,\ldots,n\}^2$"). + +**Verdict:** Unambiguous. The formalization faithfully captures the intended mathematical content. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### `IntGridCollinear` +The cross-product condition $(q_x - p_x)(r_y - p_y) = (r_x - p_x)(q_y - p_y)$ is the standard test for collinearity of three points in the plane. It is equivalent to the vanishing of the $2 \times 2$ determinant of the displacement vectors, i.e., the signed area of the triangle $pqr$ being zero. This works correctly over $\mathbb{Z}$ (no division or rounding issues). + +### `CoversIntGrid` +The definition correctly requires: +1. All points of $S$ lie in the grid (first conjunct). +2. Every grid point $p$ is collinear with some two distinct points $a, b \in S$ (second conjunct). + +Note that any point $p \in S$ is automatically covered: choosing $a = p$ and any $b \in S$ with $b \neq a$ gives `IntGridCollinear p b p`, which holds trivially (both sides equal zero). This means the covering condition is only non-trivial for points outside $S$, which is the correct semantics. + +**Edge case for $n = 1$:** The grid $\{(1,1)\}$ has one point, but covering it requires two distinct points in $S \subseteq \{(1,1)\}$, which is impossible. Thus the set $\{k \mid \exists S, \ldots\}$ is empty and $\operatorname{sInf} \emptyset = 0$ in $\mathbb{N}$. This makes $t(1) = 0$, which is vacuously fine for the asymptotic theorem (and arguably a quirk of using `sInf` on `ℕ`). The same holds for $n = 0$. For the $o(n)$ statement, only large $n$ matters, so this is harmless. + +### `gridCoveringNumber` +Uses `sInf` on `ℕ`, which is well-founded and returns 0 for empty sets. For $n \geq 2$, the set is nonempty (take $S$ to be all $n^2$ grid points), so `sInf` returns the genuine minimum. The definition is correct. + +### `erdos_798` +The statement $\forall \varepsilon > 0,\; \exists N_0,\; \forall n \geq N_0,\; t(n) \leq \varepsilon \cdot n$ is the standard $\varepsilon$-$N_0$ formulation of $t(n) = o(n)$. The use of `answer(True)` correctly reflects that this is a proved result (resolved affirmatively by Alon). The `@[category research solved, AMS 5 52]` attributes are appropriate (AMS 52 = Convex and discrete geometry). + +**Verdict:** The formalization is correct and complete for the $o(n)$ question. No mathematical flaws detected. The only gap is the absence of the sharper quantitative bounds as separate statements (see §3). diff --git a/ai-review/799.md b/ai-review/799.md new file mode 100644 index 0000000000..c5fc0e1b7e --- /dev/null +++ b/ai-review/799.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 799 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `IsProperListColoring`, `IsChoosable`, and `toGraph` are duplicated verbatim across at least five files: + +- `ErdosProblems/629.lean` (lines 46–60) — also defines `listChromaticNumber` +- `ErdosProblems/630.lean` (lines 41–55) — also defines `listChromaticNumber` +- `ErdosProblems/631.lean` (lines 51–60) +- `ErdosProblems/753.lean` (lines 43–50) — also defines `listChromaticNumber` +- `ErdosProblems/799.lean` (lines 41–50) + +All five implementations are character-for-character identical (modulo namespace). These should be consolidated into a shared file, e.g., `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` (which already exists and contains other graph coloring utilities like `IsCritical`, `cochromaticNumber`, etc.). + +Similarly, `toGraph` (Boolean edge predicate → `SimpleGraph (Fin n)`) is duplicated in problems 578, 625, 745, 746, and 799. Problem 625 additionally has an inline graph-fraction computation structurally identical to `graphFraction` in 799. A shared `toGraph` and `graphFraction` utility would eliminate this redundancy. + +## 2. Citations + +The docstring cites three references: + +| Tag | Docstring | Website | +|-----|-----------|---------| +| [ERT80] | Erdős, P., Rubin, A. L. and Taylor, H., *Choosability in graphs*, Proc. West Coast Conf. on Combinatorics, Graph Theory and Computing, Congressus Numerantium 26 (1980), 125–157. | Matches. This is the original source of the problem. | +| [Al92] | Alon, N., *Choice numbers of graphs: a probabilistic approach*, Combin. Probab. Comput. 1 (1992), 107–114. | Matches. Proved the affirmative answer with bound χ_L ≪ (log log n / log n) · n. | +| [AKS99] | Alon, N., Krivelevich, M. and Sudakov, B., *List coloring of random and pseudo-random graphs*, Combinatorica 19 (1999), 453–472. | Matches. Improved to χ_L ≍ n / log n. | + +All citations match the website. The bibliographic details are complete and correctly formatted. + +## 3. Variants + +The formalization captures the main question ("Is χ_L(G) = o(n) for almost all graphs?") but does **not** formalize the quantitative refinements mentioned in its own docstring: + +- **Alon's bound [Al92]:** χ_L(G) = O((log log n / log n) · n) almost surely. This could be formalized as a variant asserting that for some constant C, χ_L(G) ≤ C · n · log(log n) / log n for almost all G. +- **AKS optimal bound [AKS99]:** χ_L(G) = Θ(n / log n) almost surely (both upper and lower bounds). This is a strictly stronger result and the current best known. A natural variant would formalize: there exist constants c, C > 0 such that for almost all G on n vertices, c · n / log n ≤ χ_L(G) ≤ C · n / log n. + +Including at least the AKS result as a variant would add mathematical depth, since the main theorem statement is strictly weaker. + +## 4. Readability + +The code is well-structured and readable: + +- Definitions are accompanied by clear docstrings with LaTeX notation. +- The main theorem has a thorough docstring explaining the formal interpretation of "almost all" and citing the resolution. +- The `graphFraction` helper has a clear comment explaining its semantics. + +**Minor suggestions:** +- The `∀ k : ℕ, (k : ℝ) ≥ ε * (n : ℝ)` quantifier in the theorem is technically redundant given that choosability is monotone in k (the binding case is always `k = ⌈εn⌉`). While not incorrect, it adds a universally quantified variable whose contribution is trivially implied by monotonicity. A comment noting this redundancy-for-clarity tradeoff could help readers. +- The name `toGraph` is generic; all other files give it a problem-specific suffix (e.g., `toGraph625`, `toGraph578`). Using `toGraph` unqualified is fine since it's inside the `Erdos799` namespace, but it differs from the convention used elsewhere. + +## 5. Formalizability + +**The problem is precise and unambiguously formalizable.** + +The original question "Is χ_L(G) = o(n) for almost all graphs on n vertices?" has two components that require interpretation: + +1. **"almost all graphs on n vertices"**: This standardly means the uniform distribution on labeled graphs, equivalently G(n, 1/2). The formalization correctly models this via uniform measure over Boolean edge predicates. + +2. **"χ_L(G) = o(n)"**: This is an asymptotic statement about a random variable. The formalization correctly interprets it as: for every ε > 0, the probability that χ_L(G) ≤ εn tends to 1. Formally, this is ∀ ε > 0, ∀ δ > 0, ∃ n₀, ∀ n ≥ n₀, Pr[G is ⌈εn⌉-choosable] ≥ 1 − δ. + +Both interpretations are standard in combinatorics and leave no room for ambiguity. **Formalizability: unambiguous.** + +## 6. Correctness + +**The formalization is mathematically correct.** + +**Detailed verification of `graphFraction`:** The definition counts over all functions `Fin n → Fin n → Bool` (of which there are 2^(n²)), but `toGraph` only reads the upper triangle `ec (min u v) (max u v)` for `u ≠ v`. Each labeled graph (determined by C(n,2) edge bits) appears as `toGraph ec` for exactly 2^(n² − C(n,2)) different `ec` values. Since both numerator and denominator scale by the same factor, the ratio correctly equals the fraction of labeled graphs satisfying the property. This is mathematically sound. + +**Verification of the main statement:** The formalization asserts: + +``` +∀ ε > 0, ∀ δ > 0, ∃ n₀, ∀ n ≥ n₀, ∀ k ≥ εn, + graphFraction n (fun G => IsChoosable G k) ≥ 1 − δ +``` + +Since `IsChoosable G k` is monotone increasing in k (if G is k-choosable and k' ≥ k, then G is k'-choosable, because any list assignment with lists of size ≥ k' also has lists of size ≥ k), the quantifier `∀ k ≥ εn` is equivalent to simply requiring the statement for the smallest such k. The statement therefore correctly captures: "for almost all G on n vertices, χ_L(G) ≤ εn", for every ε > 0, which is precisely "χ_L(G) = o(n) for almost all G." + +**Verification of `IsChoosable` and `IsProperListColoring`:** These are standard textbook definitions. `IsProperListColoring` requires f(v) ∈ L(v) for all v and f(u) ≠ f(v) whenever u ~ v. `IsChoosable G k` requires this for every list assignment with lists of size ≥ k. Both are correct. + +**Verification of `answer(True)`:** The problem asks "Is it true that...?" and the answer is yes (proved by Alon [Al92]). The `answer(True)` wrapper and `@[category research solved]` tag are both correct. + +**No mathematical flaws detected.** The formalization is complete and correct. diff --git a/ai-review/8.md b/ai-review/8.md new file mode 100644 index 0000000000..466550cdb1 --- /dev/null +++ b/ai-review/8.md @@ -0,0 +1,163 @@ +# Review: Erdős Problem 8 + +**File:** `FormalConjectures/ErdosProblems/8.lean` + +--- + +## 1. Code Reuse + +**Issue: Duplicated `IsCoveringSystem` definition.** + +The file defines `Erdos8.IsCoveringSystem` on `Finset (ℤ × ℕ)`. An identical definition exists in `FormalConjectures/ErdosProblems/2.lean` (as `Erdos2.IsCoveringSystem`), with the same signature and body verbatim. This was already flagged in the Problem 2 review. + +Other covering-system problems use varied representations: +- **Problem 7** and **Problem 273** use the abstract `CoveringSystem ℤ` / `StrictCoveringSystem ℤ` from `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`. +- **Problem 27** uses the same `Finset (ℤ × ℕ)` representation but adds a `HasDistinctModuli` predicate (line 44: `S.card = (S.image Prod.snd).card`) and requires `p.2 ≥ 2`. +- **Problem 586** uses a `Fin k`-indexed representation with `2 ≤ n i`. + +**Recommendation:** Factor the `Finset (ℤ × ℕ)`-based covering system definition into a shared file. Problem 27's `HasDistinctModuli` predicate should also be shared, as Problem 8 needs it (see §6). The `HasMonochromaticModuli` definition is unique to Problem 8 and can remain local. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/8](https://www.erdosproblems.com/8):** + +The website lists: +- **Status:** Solved (disproved). +- **Tags:** Number theory, Covering systems. +- **References:** ErGr80 (p.25), Er96b, Er97, Er97e, Ho15. +- **Related discussion:** Erdős and Graham also posed a density-type version, asking whether ∑_{a ∈ A, a > N} 1/a ≫ log N suffices for A to contain moduli of a covering system. Both versions were answered negatively by Hough. + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Erdős–Graham 1980 | Not cited | [ErGr80, p.25] | **Missing.** The original source of the conjecture is not cited. | +| Erdős 1996b, 1997, 1997e | Not cited | [Er96b], [Er97], [Er97e] | **Missing.** Three Erdős references from the website are absent. | +| Hough 2015 | `[Ho15]` — full citation | [Ho15] | **OK.** Matches website. Citation is fully spelled out with volume/issue. | +| Balister–Bollobás–Morris–Sahasrabudhe–Tiba 2022 | `[BBMST22]` — full citation | Not listed | **Extra.** Not on the website for Problem 8 (it appears on Problems 2 and 586). Its inclusion is reasonable since BBMST22 improved Hough's bound, but note the discrepancy. Also: the docstring says "Ann. of Math. (2) **198** (2023), no. 1, 1–92" but the formalization label says `[BBMST22]` (2022). The publication year 2023 in the citation body is correct (the paper appeared in Annals in 2023 despite the 2022 preprint). Consider updating the tag to `[BBMST23]` for consistency, or clarify the year discrepancy. | + +**Additional issues:** +- The density-type variant mentioned on the website is not discussed in the docstring. Consider adding a note for completeness. + +--- + +## 3. Variants + +The formalization captures only the main resolved statement (the coloring version). Missing variants: + +**1. Density version (also resolved by Hough):** +The website notes that Erdős and Graham also asked a density version: if A ⊆ ℕ satisfies ∑_{a ∈ A, a > N} 1/a ≫ log N, must A contain the moduli of a covering system? Hough's theorem also answers this negatively. This could be formalized as a separate theorem. + +**2. Explicit Hough bound variant:** +One could state that there exists a coloring with at most C+1 colors (where C = 616000) that defeats all covering systems: +```lean +theorem erdos_8_explicit : ∃ χ : ℕ → Fin 616001, + ∀ S : Finset (ℤ × ℕ), IsCoveringSystem S → HasDistinctModuli S → + ¬HasMonochromaticModuli χ S +``` + +**3. Quantitative version with original Hough bound (10^16):** +Same as above but with the historically first bound. + +**Assessment:** The core resolved statement is present. The density variant is a genuinely different mathematical statement and its absence is notable since the website explicitly mentions it. + +--- + +## 4. Readability + +The code is short and well-structured. Observations: + +- **Docstrings:** Both module-level and definition-level docstrings are well-written. The module docstring provides full mathematical context including the resolution strategy via Hough's theorem. +- **Pair projections:** As with Problems 2 and 27, the use of `p.1` and `p.2` for residue/modulus components is functional but opaque. This is a project-wide convention. +- **Namespace:** `Erdos8` is appropriate. +- **Definition names:** `IsCoveringSystem` and `HasMonochromaticModuli` are clear and descriptive. + +**Minor suggestion:** The docstring explains the disproof strategy (assign distinct colors to small integers, a fresh color to large ones) clearly. However, it does not mention that the problem requires *distinct* moduli, which is the mathematical crux — Hough's bound applies only to covering systems with distinct moduli. Adding this clarification would improve the docstring. + +Overall readability is good. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable, but the formalization has made incorrect choices (see §6).** + +The problem as stated on the website — "For any finite colouring of the integers is there a covering system all of whose moduli are monochromatic?" — is precise. The key concepts are standard: +- "Covering system" has a well-established meaning in the Erdős tradition: a finite collection of congruences with **distinct** moduli ≥ 2 that cover all integers. +- "Finite colouring" means a function from ℕ (or ℤ) to a finite set of colors. +- "Monochromatic moduli" means all moduli receive the same color. + +The only potential ambiguity is whether "covering system" requires distinct moduli. In the Erdős tradition and in Hough's paper, the standard definition requires distinct moduli (n₁ < n₂ < ··· < nₖ). The formalization does not enforce this, which leads to correctness issues. + +**Ambiguity level: Low.** The statement is clear to anyone familiar with the covering systems literature. The term "covering system" has a standard meaning that includes distinct moduli. + +--- + +## 6. Correctness + +**The formalization contains a critical correctness bug: the theorem as stated is unprovable (it is a false Lean proposition).** + +### The bug: missing distinct-moduli requirement + +The `answer` elaborator expands `answer(False)` to `False`. Thus the theorem states: + +``` +False ↔ (∀ k, 0 < k → ∀ χ : ℕ → Fin k, ∃ S, IsCoveringSystem S ∧ HasMonochromaticModuli χ S) +``` + +This requires the RHS to be `False`. However, **the RHS is trivially `True`** under the current definitions, because: + +For any coloring `χ : ℕ → Fin k`, take `S = {(0, 2), (1, 2)}`. Then: +- `S.Nonempty`: ✓ (two elements) +- `∀ p ∈ S, 0 < p.2`: ✓ (both moduli are 2 > 0) +- `∀ n : ℤ, ∃ p ∈ S, (p.2 : ℤ) ∣ (n - p.1)`: ✓ (every integer is either ≡ 0 or ≡ 1 mod 2) +- `HasMonochromaticModuli χ S`: ✓ (both moduli are 2, so both have color `χ 2` — trivially monochromatic) + +So `IsCoveringSystem S ∧ HasMonochromaticModuli χ S` holds for this `S`, making the `∃ S` true, and therefore the `∀ k, ∀ χ, ∃ S` is true. The theorem becomes `False ↔ True`, which is itself `False` — **the theorem is unprovable**. + +### Root cause + +The standard definition of "covering system" in the Erdős tradition requires **distinct moduli** (each modulus value appears at most once). Hough's theorem — which is the basis for the disproof — applies specifically to covering systems with distinct moduli ≥ 2. + +Without distinct moduli, any modulus `m ≥ 2` yields a trivial covering system `{(0,m), (1,m), ..., (m-1,m)}` with all-identical (hence monochromatic) moduli. This makes the conjecture vacuously true, which contradicts the intended `answer(False)`. + +### Additionally: modulus bound should be ≥ 2 + +The current definition uses `0 < p.2` (moduli ≥ 1). Even with distinct moduli, a single congruence `{(0, 1)}` is a valid covering system (modulus 1 covers all integers). This system is trivially monochromatic, again making the conjecture true. The standard convention requires moduli ≥ 2. + +### Proposed fix + +Add both conditions — distinct moduli and moduli ≥ 2. Following Problem 27's pattern: + +```lean +def HasDistinctModuli (S : Finset (ℤ × ℕ)) : Prop := + S.card = (S.image Prod.snd).card + +def IsCoveringSystem (S : Finset (ℤ × ℕ)) : Prop := + S.Nonempty ∧ + (∀ p ∈ S, 2 ≤ p.2) ∧ + (∀ n : ℤ, ∃ p ∈ S, (p.2 : ℤ) ∣ (n - p.1)) + +theorem erdos_8 : answer(False) ↔ + (∀ k : ℕ, 0 < k → ∀ χ : ℕ → Fin k, + ∃ S : Finset (ℤ × ℕ), IsCoveringSystem S ∧ HasDistinctModuli S ∧ + HasMonochromaticModuli χ S) := by + sorry +``` + +Alternatively, use `StrictCoveringSystem ℤ` from `FormalConjecturesForMathlib` to get distinct moduli automatically, though this would require adapting the coloring predicate. + +### Note on Problem 2 + +The same `IsCoveringSystem` definition (without distinct moduli) is used in Problem 2. Problem 2's statement `∃ B, ∀ S, IsCoveringSystem S → ∃ p ∈ S, p.2 ≤ B` is also false without distinct moduli: the family `{(0,m), ..., (m-1,m)}` for arbitrarily large `m` shows no uniform bound exists. The Problem 2 review incorrectly deemed non-distinct moduli acceptable. This bug affects both Problems 2 and 8. + +### Other aspects of the formalization + +Setting aside the distinct-moduli bug, the rest of the formalization is sound: + +- **`HasMonochromaticModuli`:** Correctly checks that all moduli in S map to the same color under χ. The use of `Fin k` for k-colorings is standard. +- **Coloring domain:** The coloring `χ : ℕ → Fin k` is over all naturals, while the problem asks about positive integers. Since all moduli satisfy `0 < p.2`, the color of 0 is never queried, so this is equivalent. +- **`answer(False)` semantics:** Correctly indicates the conjecture was disproved. +- **AMS classification:** `AMS 5 11` tags both general mathematics (5) and number theory (11). The "5" tag is unusual — this is purely number theory / combinatorial number theory. Consider `AMS 11` alone, consistent with Problems 2, 7, 27, 586. + +**Verdict: Incorrect due to missing distinct-moduli and moduli-≥-2 requirements. The theorem as written is a false proposition in Lean (False ↔ True). Fixing requires adding `HasDistinctModuli S` and changing `0 < p.2` to `2 ≤ p.2`. The same bug exists in Problem 2.** diff --git a/ai-review/80.md b/ai-review/80.md new file mode 100644 index 0000000000..9c6bc9a7e2 --- /dev/null +++ b/ai-review/80.md @@ -0,0 +1,176 @@ +# Review: Erdős Problem 80 + +**File:** `FormalConjectures/ErdosProblems/80.lean` + +--- + +## 1. Code Reuse + +**Issue: `bookSize` and `EveryEdgeInTriangle` duplicate definitions from Problem 600.** + +Problem 600 (`FormalConjectures/ErdosProblems/600.lean`) defines mathematically equivalent concepts: + +| Problem 80 | Problem 600 | Equivalence | +|------------|-------------|-------------| +| `bookSize G u v` = `((G.neighborFinset u) ∩ (G.neighborFinset v)).card` | `trianglesThrough G u v` = `(Finset.univ.filter fun w => w ≠ u ∧ w ≠ v ∧ G.Adj u w ∧ G.Adj v w).card` | Equivalent for simple graphs (irreflexivity ensures `u ∉ neighborFinset u` and `v ∉ neighborFinset v`, so the explicit `w ≠ u ∧ w ≠ v` filters are redundant). | +| `EveryEdgeInTriangle G` = `∀ u v, G.Adj u v → 0 < bookSize G u v` | `IsTriangleCovered G` = `∀ u v, G.Adj u v → 0 < trianglesThrough G u v` | Identical modulo the above. | + +Problem 600 even notes "See also problem 80" in its docstring, underscoring the close relationship. + +Neither definition is promoted to `FormalConjecturesForMathlib`. No existing file in that library defines book size or triangle-covering. + +**Recommendation:** Promote `bookSize` (or `trianglesThrough`) and `EveryEdgeInTriangle` (or `IsTriangleCovered`) to a shared file in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/`, and have both Problems 80 and 600 import from there. Problem 80's `bookSize` formulation via `neighborFinset` intersection is more idiomatic and concise; it should be preferred. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/80](https://www.erdosproblems.com/80):** + +The website lists: + +- **Status:** Open +- **Tags:** Graph theory, Ramsey theory +- **Attribution:** Erdős and Rothschild +- **Known results:** + - Alon & Trotter: for $c < 1/4$, $f_c(n) \ll_c n^{1/2}$ + - Szemerédi: regularity lemma implies $f_c(n) \to \infty$ + - Fox & Loh [FoLo12]: $f_c(n) \leq n^{O(1/\log\log n)}$ for all $c < 1/4$ (disproves $f_c(n) > n^\varepsilon$) + - Edwards (unpublished) & Khadziivanov & Nikiforov [KhNi79]: for $c > 1/4$, $f_c(n) \geq n/6$ +- **Related problems:** Problem 600 + +| Aspect | Formalization | Website | Assessment | +|--------|--------------|---------|------------| +| Status | `@[category research open]` | Open | **Correct.** | +| AMS classification | `AMS 5` | Graph theory | **Correct.** | +| Attribution | "A problem of Erdős and Rothschild" | Erdős and Rothschild | **Correct.** | +| Alon–Trotter bound | Mentioned | Same | **Correct.** | +| Szemerédi lower bound | Mentioned | Same | **Correct.** | +| Fox–Loh upper bound | Mentioned | [FoLo12] | **Partial.** The docstring describes the result but does not include a formal citation tag `[FoLo12]` with full bibliographic details. | +| Edwards/Khadziivanov–Nikiforov | **Not mentioned** | [KhNi79]: for $c > 1/4$, $f_c(n) \geq n/6$ | **Missing.** This is a significant known result establishing that the problem is only interesting for $c \leq 1/4$. | +| Related problems | Not mentioned | Problem 600 | **Missing.** The website identifies Problem 600 as related. Problem 600 generalizes the setup by defining $e(n, r)$ and studying how it varies with $r$. A cross-reference in the docstring would be valuable. | + +**Recommendation:** Add formal citation tags for [FoLo12] and [KhNi79] with full bibliographic details. Add a "See also" reference to Problem 600. Mention the Edwards/Khadziivanov–Nikiforov result for the $c > 1/4$ regime. + +--- + +## 3. Variants + +The formalization captures only the weakest open conjecture: $f_c(n) \gg \log n$. Several variants from the problem statement and website are absent: + +**1. The "estimate $f_c(n)$" meta-question:** +The original problem statement asks to "estimate $f_c(n)$," which is broader than just the $\log n$ lower bound. The formalization correctly focuses on the specific open conjecture, but the docstring could acknowledge the estimation question. + +**2. The disproved stronger conjecture $f_c(n) > n^\varepsilon$ (Fox–Loh):** +The docstring correctly notes this was disproved but does not formalize it. A variant could be: +```lean +theorem erdos_80.variants.polynomial_disproved : answer(False) ↔ + ∀ c : ℝ, 0 < c → c < 1/4 → + ∃ ε : ℝ, ε > 0 ∧ ∀ᶠ n in Filter.atTop, + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ c * n ^ 2 → + EveryEdgeInTriangle G → + ∃ u v, G.Adj u v ∧ (bookSize G u v : ℝ) ≥ n ^ ε +``` +This is resolved (answer is `False`) and would document the Fox–Loh result. + +**3. The $c > 1/4$ regime (resolved):** +For $c > 1/4$, the answer is known: $f_c(n) \geq n/6$ (Edwards, Khadziivanov–Nikiforov [KhNi79]). This could be stated as a separate solved theorem, as it gives a much stronger (linear) lower bound. + +**4. The relationship with Problem 600:** +Problem 600 studies the function $e(n, r)$ — the minimal edge count forcing an edge in $r$ triangles. This is the "inverse" perspective: Problem 80 fixes the edge density and asks about the guaranteed book size, while Problem 600 fixes the book size and asks about the required edge count. + +**Assessment:** The core open conjecture is correctly captured. The omission of the disproved polynomial variant and the resolved $c > 1/4$ case is defensible but worth noting. The docstring already acknowledges the Fox–Loh result qualitatively. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Namespace:** `Erdos80` is appropriate and consistent with the project convention. +- **Definition names:** `bookSize` is descriptive and standard graph-theoretic terminology. `EveryEdgeInTriangle` is self-documenting. +- **Docstrings:** Both definitions have clear docstrings. The module docstring provides good mathematical context. +- **`bookSize` implementation:** The `neighborFinset` intersection formulation is idiomatic Lean/Mathlib and more concise than the `Finset.univ.filter` approach used in Problem 600. +- **Opens:** `open SimpleGraph` is minimal and appropriate. + +**Minor suggestion:** The `bookSize` docstring says "the number of common neighbors of $u$ and $v$ in $G$, equivalently the number of triangles containing the edge $\{u, v\}$." This equivalence holds only when $G.Adj u v$ (i.e., when $\{u, v\}$ is actually an edge). When $u$ and $v$ are not adjacent, common neighbors don't form triangles through the edge $\{u,v\}$. The docstring could note this: "when $\{u, v\}$ is an edge, this equals the number of triangles containing that edge." + +Overall readability is very good. + +--- + +## 5. Formalizability + +**Assessment: Precise and clearly formalizable, with minor ambiguity in the asymptotic regime.** + +The conjecture "$f_c(n) \gg \log n$" is standard asymptotic notation meaning: there exists $C > 0$ such that $f_c(n) \geq C \log n$ for all sufficiently large $n$. The key concepts are all well-defined: + +- "Book of size $m$" (an edge in $m$ triangles) has a precise combinatorial definition. +- The condition "$cn^2$ edges, every edge in a triangle" is unambiguous. +- The function $f_c(n)$ is well-defined as a supremum over guaranteed book sizes. + +The only point of interpretation is the meaning of $\gg$: does it mean "for all sufficiently large $n$" or "for all $n$"? Standard mathematical convention is the former (there exists $n_0$ such that for all $n \geq n_0$). The formalization uses the latter (for all $n$), which is a substantive difference — see §6 for discussion. + +**Ambiguity level: Very low.** The core mathematical content is unambiguous. The only question is the standard asymptotic convention, which the formalization resolves in a non-standard way. + +--- + +## 6. Correctness + +**The formalization has a correctness issue at $n = 0$ that makes the statement trivially false.** + +### The $n = 0$ bug + +The formalization states (line 58–66): +```lean +∀ c : ℝ, c > 0 → +∃ C : ℝ, C > 0 ∧ +∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) ^ 2 → + EveryEdgeInTriangle G → + ∃ u v : Fin n, G.Adj u v ∧ + (bookSize G u v : ℝ) ≥ C * Real.log (n : ℝ) +``` + +Consider $n = 0$. Then: +- `Fin 0` is empty, so the unique graph $G$ has no vertices and no edges. +- `(G.edgeFinset.card : ℝ) = 0 ≥ c * 0^2 = 0` — **premise satisfied.** +- `EveryEdgeInTriangle G` is vacuously true (no edges to check) — **premise satisfied.** +- `∃ u v : Fin 0, ...` requires finding elements of the empty type — **impossible, conclusion is False.** + +Both premises hold but the conclusion fails. Therefore, the entire statement (universally quantified over $n$) is **false** regardless of the conjecture's mathematical status. The `answer(sorry)` should resolve to `answer(False)` under this formalization, but for the wrong reason — this is a formalization artifact, not a reflection of the mathematical content. + +### The fix + +The standard mathematical meaning of $f_c(n) \gg \log n$ is: there exist $C > 0$ and $N_0 \in \mathbb{N}$ such that $f_c(n) \geq C \log n$ for all $n \geq N_0$. The formalization should use `∃ N₀ : ℕ, ∀ n ≥ N₀, ...` or equivalently use `∀ᶠ n in Filter.atTop`: + +```lean +theorem erdos_80 : answer(sorry) ↔ + ∀ c : ℝ, c > 0 → + ∃ C : ℝ, C > 0 ∧ + ∃ N₀ : ℕ, ∀ (n : ℕ), n ≥ N₀ → + ∀ (G : SimpleGraph (Fin n)) [DecidableRel G.Adj], + (G.edgeFinset.card : ℝ) ≥ c * (n : ℝ) ^ 2 → + EveryEdgeInTriangle G → + ∃ u v : Fin n, G.Adj u v ∧ + (bookSize G u v : ℝ) ≥ C * Real.log (n : ℝ) +``` + +Alternatively, one could simply guard with `n > 0` or `[Nonempty (Fin n)]`, but the "sufficiently large" formulation is more faithful to the asymptotic intent. + +### Other aspects of correctness + +**Edge count convention:** The formalization uses `c * n^2` which matches the problem statement exactly. For $c \geq 1/2$, no graph on $n$ vertices can have $cn^2$ edges (since the maximum is $n(n-1)/2 < n^2/2$), so the statement is vacuously true for large $c$. The interesting range is $0 < c < 1/4$, as established by the known results. This is mathematically correct — universal quantification over $c > 0$ harmlessly includes vacuous cases. + +**Logarithm convention:** `Real.log (n : ℝ)` is the natural logarithm. At $n = 0$, `Real.log 0 = 0` by Lean's convention, so `C * Real.log 0 = 0`. At $n = 1$, `Real.log 1 = 0`. The conjecture concerns asymptotic behavior where $\log n > 0$, so the base and small-$n$ behavior are irrelevant. This is correct. + +**`bookSize` correctness:** As analyzed in §1, `bookSize G u v = ((G.neighborFinset u) ∩ (G.neighborFinset v)).card` correctly counts common neighbors. For a simple graph (irreflexive), neither $u$ nor $v$ appears in the other's neighbor set's self-entry (they can appear as mutual neighbors of each other, which is correct — if $w = u$, then $w \in \text{neighborFinset}(u)$ requires $G.Adj\ u\ u$, which is false). So `bookSize` counts exactly the vertices $w \notin \{u, v\}$ adjacent to both, which is the number of triangles through the edge $\{u, v\}$. This is correct. + +**`EveryEdgeInTriangle` correctness:** `∀ u v, G.Adj u v → 0 < bookSize G u v` correctly states that every edge lies in at least one triangle. This is correct. + +**Quantifier structure:** The conjecture is `∀ c > 0, ∃ C > 0, ∀ n, ∀ G, (premises → conclusion)`. This correctly captures "for every edge density parameter, there is a guaranteed logarithmic book size." The $C$ depends on $c$ but not on $n$, which matches the standard interpretation. This is correct. + +### Verdict + +**The formalization is mathematically incorrect due to the $n = 0$ vacuous counterexample.** The fix is straightforward: add an existential threshold `∃ N₀, ∀ n ≥ N₀` (or equivalently require `n > 0` at minimum, though "sufficiently large" is more standard). All other aspects — the definitions, quantifier structure, edge count convention, and logarithm usage — are correct. diff --git a/ai-review/800.md b/ai-review/800.md new file mode 100644 index 0000000000..1cd63ef29e --- /dev/null +++ b/ai-review/800.md @@ -0,0 +1,78 @@ +# Review: Erdős Problem 800 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `HasSubgraphCopy` and `graphRamseyNumber` in this file are essentially identical to definitions already present in multiple other Erdős problem files: + +- **Problem 163** (`ErdosProblems/163.lean`): defines `containsCopy` and `ramseyDiag` — identical concepts with different names. +- **Problem 87** (`ErdosProblems/87.lean`): defines `ContainsSubgraph` and `graphRamseyNumber` — again identical. +- **Problem 181** (`ErdosProblems/181.lean`): defines `ContainsCopy` and `ramseyDiag`. + +Additionally, **Mathlib provides `SimpleGraph.IsContained`** (from `Mathlib.Combinatorics.SimpleGraph.Copy`), which is the same concept and is already used in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`. Ideally, all four problem files should use this Mathlib definition or a shared utility definition rather than each defining their own variant. + +**Recommendation:** Extract `HasSubgraphCopy` and `graphRamseyNumber` into a shared utility (or use Mathlib's `IsContained` directly) and have problems 87, 163, 181, and 800 all reference the shared definitions. + +## 2. Citations + +The formalization references: +- `[BuEr75]` Burr, S. A. and Erdős, P., *On the magnitude of generalized Ramsey numbers for graphs*, 1975. +- `[Al94]` Alon, N., *Subdivided graphs have linear Ramsey numbers*, 1994. + +The website (erdosproblems.com/800) lists these same references. The citations are consistent with the website. The docstring also correctly notes this is a special case of problem #163, matching the website. + +**No issues found.** + +## 3. Variants + +The website lists only a single statement for this problem with no additional variants. The formalization captures this single statement. The relationship to problem 163 (Burr–Erdős conjecture) is correctly documented. + +**No missing variants.** + +## 4. Readability + +The code is reasonably readable. A few minor observations: + +- The docstring clearly states the mathematical content and attributes the result. +- The `haveI := h` pattern for introducing the `DecidableRel` instance is standard Lean idiom but could benefit from a brief comment for readers unfamiliar with this pattern. +- The relationship to degeneracy could be made more explicit: a graph where no edge has both endpoints of degree ≥ 3 is 2-degenerate, which directly connects this to problem 163 with d = 2. + +**Minor improvements possible, but overall clear.** + +## 5. Formalizability + +The problem statement — "If G is a graph on n vertices which has no two adjacent vertices of degree ≥ 3 then R(G) ≪ n" — is precise and unambiguous: + +- "No two adjacent vertices of degree ≥ 3" has a clear graph-theoretic meaning. +- "R(G) ≪ n" means R(G) ≤ C·n for some absolute constant C, which is the standard asymptotic notation. +- The Ramsey number R(G) = R(G, G) is the standard diagonal graph Ramsey number. + +**Fully formalizable with no ambiguity.** + +## 6. Correctness + +The formalization is **mathematically correct**. + +**Degree condition:** The predicate `∀ u v, G.Adj u v → G.degree u < 3 ∨ G.degree v < 3` correctly captures "no two adjacent vertices of degree ≥ 3" (equivalently: every edge has at least one endpoint of degree < 3, i.e., degree ≤ 2). + +**Ramsey number definition:** `graphRamseyNumber` correctly defines the diagonal graph Ramsey number R(G) as inf{N : ℕ | every graph on Fin N contains G or its complement contains G}. The use of `sInf` on ℕ means it returns 0 if the set is empty, but by Ramsey's theorem the set is always non-empty for finite G, so this is not a mathematical issue (though one could argue a `Nat.find` formulation with an explicit proof of non-emptiness would be more principled). + +**Subgraph copy definition:** `HasSubgraphCopy` requires an injective map preserving adjacency (but not non-adjacency), which is the standard notion of subgraph copy (not induced subgraph) used in Ramsey theory. This is correct. + +**Conclusion bound:** The statement `∃ C : ℝ, C > 0 ∧ ∀ (n : ℕ) (G : SimpleGraph (Fin n)) ...` with `graphRamseyNumber G ≤ C * n` correctly formalizes R(G) = O(n) with an absolute constant. The constant C is universal across all n and all qualifying graphs G, matching the intended meaning of "the implied constant is absolute." + +**Logical relationship to problem 163:** As noted, the degree condition implies 2-degeneracy, so problem 800 is indeed a special case of problem 163 (with d = 2). The formalization is self-contained and does not depend on problem 163, which is appropriate. + +**Edge case:** When n = 0, the graph is empty, the degree condition is vacuously true, and graphRamseyNumber returns sInf of a set containing 0 (the empty graph trivially satisfies the Ramsey property), so the bound holds trivially. No issues here. + +**No correctness issues found.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — duplicated definitions across 4 files; Mathlib's `IsContained` could be used | +| Citations | **Correct** — matches erdosproblems.com | +| Variants | **Complete** — no missing variants | +| Readability | **Good** — minor improvements possible | +| Formalizability | **Unambiguous** — fully formalizable | +| Correctness | **Correct** — faithful to the mathematical statement | diff --git a/ai-review/801.md b/ai-review/801.md new file mode 100644 index 0000000000..c1a229da94 --- /dev/null +++ b/ai-review/801.md @@ -0,0 +1,79 @@ +# Review: Erdős Problem 801 + +## 1. Code Reuse + +**`inducedEdgeCount`**: Problem 801 defines its own `inducedEdgeCount` by filtering `Finset.univ` over all `Fin n × Fin n` pairs. An essentially identical function already exists in `ErdosProblems/88.lean` (lines 39–41), which filters over `S ×ˢ S` instead — a more efficient and idiomatic approach. These two definitions should be unified into a shared utility. The 88.lean version is preferable: it restricts the search space to `S ×ˢ S` and uses `[DecidableRel G.Adj]` instead of being marked `noncomputable`. + +**Independent set condition**: The formalization encodes "no independent set of size > ⌊√n⌋" as `∀ S, Gᶜ.IsClique ↑S → S.card ≤ Nat.sqrt n`. Mathlib provides `SimpleGraph.indepNum` (with notation `α(G)` defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean`). The entire universal quantifier could be replaced with the cleaner `α(G) ≤ Nat.sqrt n`, which would be more readable and consistent with other problems in the codebase that use `indepNum` (e.g., in `Coloring.lean` and `Definitions.lean`). + +## 2. Citations + +The website ([erdosproblems.com/801](https://www.erdosproblems.com/801)) lists: +- **[Er79g]**: Erdős, P. — original problem statement (1979). +- **[Al96b]**: Alon, N. — proof of the conjecture (1996). + +The Lean file references both `[Er79g]` and `[Al96b]`, which matches. However, the citations are given only as shorthand tags. The full citation for [Al96b] should be expanded, e.g.: + +> Alon, N., _Independence numbers of locally sparse graphs and a Ramsey type problem_, Random Structures & Algorithms **9** (1996), 271–278. + +The recommended citation for the problem itself is: "T. F. Bloom, Erdős Problem #801, https://www.erdosproblems.com/801". + +## 3. Variants + +The website lists only the single statement with no additional variants, comments, or related sub-problems. The formalization captures the one known formulation. **No missing variants.** + +## 4. Readability + +Several readability improvements are possible: + +- **`inducedEdgeCount`**: The `Finset.univ.filter` approach with a 4-way conjunction (`p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2 ∧ G.Adj p.1 p.2`) is harder to read than the `(S ×ˢ S).filter` approach in 88.lean, which naturally constrains membership and only needs `p.1 < p.2 ∧ G.Adj p.1 p.2`. +- **Independent set encoding**: `Gᶜ.IsClique (S : Set (Fin n))` requires the reader to mentally translate "clique in complement = independent set." Using `G.IsIndepSet` or `α(G)` would be more self-documenting. +- **Exponent notation**: `(n : ℝ) ^ ((1 : ℝ) / 2)` could be written as `Real.sqrt (n : ℝ)` or `√(n : ℝ)` for clarity. (Though the current form is unambiguous.) + +## 5. Formalizability + +The original problem statement is: + +> "If G is a graph on n vertices containing no independent set on > n^{1/2} vertices then there is a set of ≤ n^{1/2} vertices containing ≫ n^{1/2} log n edges." + +**Ambiguity analysis:** + +- **"≫" (Vinogradov notation)**: This asymptotic notation means "at least C · f(n) for some absolute constant C > 0 and all sufficiently large n." The formalization correctly interprets this via `∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ...`. This is the standard and unambiguous way to formalize ≫. **Low ambiguity.** +- **"log n"**: In combinatorics, "log" without a base typically means natural logarithm (or is base-irrelevant since `log_a n = log_b n / log_b a` and the constant absorbs the ratio). The use of `Real.log` (natural log) is appropriate. **No ambiguity.** +- **"n^{1/2}" vs "⌊√n⌋"**: The original uses real-valued n^{1/2}, but since set sizes are integers, the formalization uses `Nat.sqrt n = ⌊√n⌋`. For the condition "no independent set of size > √n," this is equivalent because |S| is a natural number and |S| ≤ √n ⟺ |S| ≤ ⌊√n⌋. **No ambiguity.** + +**Assessment**: The problem is straightforward to formalize. The only non-trivial interpretive choice is the ≫ notation, which is handled correctly. **Formalizability: High.** + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed verification: + +1. **Independent set condition** (`∀ S : Finset (Fin n), Gᶜ.IsClique (S : Set (Fin n)) → S.card ≤ Nat.sqrt n`): + - `Gᶜ.IsClique S` means all distinct pairs in S are adjacent in Gᶜ, i.e., non-adjacent in G. This is precisely the definition of an independent set in G. ✓ + - The bound `S.card ≤ Nat.sqrt n` correctly captures "no independent set of size > ⌊√n⌋." ✓ + - Note: This quantifies over `Finset (Fin n)`, which covers all subsets of the vertex set. ✓ + +2. **Conclusion** (`∃ S, S.card ≤ Nat.sqrt n ∧ C * n^(1/2) * log(n) ≤ inducedEdgeCount G S`): + - Existential over vertex subsets of size ≤ ⌊√n⌋. ✓ + - Lower bound `C * √n * log n` on the induced edge count, with `C > 0` existentially quantified at the outermost level. ✓ + +3. **Quantifier structure** (`∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ∀ G, ... → ∃ S, ...`): + - The constant C is universal (does not depend on n or G). ✓ + - The "for sufficiently large n" threshold n₀ is independent of G. ✓ + - This matches the standard interpretation of the asymptotic claim. ✓ + +4. **Edge counting** (`inducedEdgeCount`): + - Counts ordered pairs (p.1, p.2) with p.1 < p.2, both in S, and adjacent. This correctly counts each edge exactly once. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete translation of the problem statement. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `inducedEdgeCount` duplicated from 88.lean; independent set condition could use `indepNum` | +| Citations | Shorthand tags match website; full citation for [Al96b] should be expanded | +| Variants | Complete — no missing variants | +| Readability | Moderate — could improve with shared utilities and `indepNum` notation | +| Formalizability | High — minimal ambiguity, standard asymptotic interpretation | +| Correctness | Correct and complete | diff --git a/ai-review/802.md b/ai-review/802.md new file mode 100644 index 0000000000..dbdadda1d5 --- /dev/null +++ b/ai-review/802.md @@ -0,0 +1,96 @@ +# Review: Erdős Problem 802 + +## 1. Code Reuse + +**`avgDegree`**: Problem 802 defines a local `avgDegree` (lines 37–39) returning `ℝ`. A library-level `SimpleGraph.averageDegree` already exists in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Invariants.lean` (lines 170–172), but it returns `ℚ`. The definitions are semantically identical — both sum vertex degrees and divide by vertex count. The 802 version could be replaced by casting the library version to `ℝ`, i.e., `(G.averageDegree : ℝ)`, or the library could be extended with a real-valued variant. Duplicating the definition is undesirable. + +**Independent set condition**: The formalization encodes the independent set property inline as `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v` (line 56). Mathlib provides `SimpleGraph.IsIndepSet`, and the codebase already uses it extensively (e.g., in `Coloring.lean`, `Definitions.lean`, `Domination.lean`). Multiple other Erdős problems (750, 804, 805) also define local `IsIndepSet` predicates with the same semantics. The inline condition should be replaced with `G.IsIndepSet ↑S` for consistency. Note: `SimpleGraph.Adj` is irreflexive, so the `u ≠ v` guard is technically redundant (as in 804.lean and 805.lean which omit it), but it does no harm. + +**`CliqueFree`**: The use of Mathlib's `G.CliqueFree r` is appropriate and consistent with the rest of the codebase (e.g., Problems 151, 165, 166). + +## 2. Citations + +The website ([erdosproblems.com/802](https://www.erdosproblems.com/802)) references four citation tags: **[AEKS81]**, **[Sh95]**, **[AKS80]**, and **[Al96b]**. The Lean docstring (lines 24–29) references all four, which matches the website. + +However, all citations are given only as shorthand tags. Full bibliographic details found elsewhere in the codebase and from known references: + +- **[AEKS81]**: Ajtai, M., Erdős, P., Komlós, J. and Szemerédi, E., _A dense infinite Sidon sequence_, European J. Combin. **2** (1981), 1–11. *(Not expanded anywhere in codebase.)* +- **[AKS80]**: Ajtai, M., Komlós, J. and Szemerédi, E., _A note on Ramsey numbers_, J. Combin. Theory Ser. A **29** (1980), 354–360. *(Full citation found in `ErdosProblems/986.lean`, lines 46–47.)* +- **[Sh95]**: Shearer, J. B., _On the independence number of sparse graphs_, Random Structures & Algorithms **7** (1995), 269–271. *(Not expanded anywhere in codebase.)* +- **[Al96b]**: Alon, N., _Independence numbers of locally sparse graphs and a Ramsey type problem_, Random Structures & Algorithms **9** (1996), 271–278. *(Referenced in Problem 801 review.)* + +The recommended citation for the problem itself is: "T. F. Bloom, Erdős Problem #802, https://www.erdosproblems.com/802". + +## 3. Variants + +The website lists a single problem statement with no additional variants, sub-problems, or alternative formulations. The formalization captures the one known statement. **No missing variants.** + +## 4. Readability + +Several improvements are possible: + +- **Independent set condition**: The inline `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v` requires the reader to recognize this as an independent set. Using `G.IsIndepSet ↑S` would be self-documenting. +- **`avgDegree` naming**: The local definition `avgDegree` shadows the library's `averageDegree`. If a local definition is retained, it should at least reference the library definition in a comment. +- **Repeated `avgDegree G` in the conclusion**: The term `avgDegree G` appears twice in the conclusion (line 57). Introducing a `let t := avgDegree G` binding (matching the mathematical notation where $t$ denotes average degree) would improve readability and align with the problem statement's use of $t$. +- **Cast clarity**: The expression `(S.card : ℝ) ≥ c * (Real.log (avgDegree G) / avgDegree G) * (n : ℝ)` is clear, though grouping as `c * (Real.log t / t) * n` with a `let` binding would make the $\frac{\log t}{t}$ structure more visually apparent. + +## 5. Formalizability + +The original problem statement is: + +> "Is it true that any $K_r$-free graph on $n$ vertices with average degree $t$ contains an independent set of size $\gg_r \frac{\log t}{t} n$?" + +**Ambiguity analysis:** + +- **"$\gg_r$" (Vinogradov notation with subscript)**: This means "at least $c_r \cdot f(n)$ for some constant $c_r > 0$ depending only on $r$, for all sufficiently large $n$." The formalization uses `∃ c > 0, ∀ (n : ℕ) (G : SimpleGraph (Fin n)), ...` — the constant $c$ is existentially quantified *inside* the `∀ r` but *outside* the `∀ n` and `∀ G`, which correctly captures that $c$ depends on $r$ but not on $n$ or $G$. **However**, the formalization does *not* include a "for sufficiently large $n$" (or equivalently "for $t$ sufficiently large") threshold. See Correctness below. **Moderate ambiguity.** + +- **"average degree $t$"**: The statement uses $t$ as a name for the average degree. The formalization correctly computes this as $\frac{1}{n}\sum_v \deg(v)$. The condition $t \geq 2$ ensures $\log t > 0$, making the bound nontrivial. **Low ambiguity.** + +- **"$K_r$-free"**: Standard graph theory terminology meaning the graph contains no complete subgraph on $r$ vertices. `G.CliqueFree r` is the standard Mathlib encoding. **No ambiguity.** + +**Assessment**: The problem is mostly straightforward to formalize. The main interpretive subtlety is whether `≫_r` requires a "sufficiently large" threshold (see Correctness). **Formalizability: High, with one caveat.** + +## 6. Correctness + +**The formalization is largely correct but has one potential issue regarding the asymptotic quantifier structure.** + +### Detailed Verification: + +1. **$K_r$-free condition** (`G.CliqueFree r`): + - Correctly encodes that $G$ has no $r$-clique. ✓ + +2. **Average degree** (`avgDegree G ≥ 2`): + - The condition $t \geq 2$ ensures $\log t > 0$ so the claimed bound $c \cdot \frac{\log t}{t} \cdot n > 0$ is meaningful. ✓ + - The `avgDegree` definition (sum of degrees / $n$) is standard. ✓ + +3. **Independent set conclusion** (`∃ S : Finset (Fin n), (∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v) ∧ (S.card : ℝ) ≥ c * (Real.log (avgDegree G) / avgDegree G) * (n : ℝ)`): + - Existential over subsets with the independent set property. ✓ + - The size bound `c * (log t / t) * n` matches the conjectured $\gg_r \frac{\log t}{t} n$. ✓ + +4. **Quantifier structure** (`∀ r ≥ 3, ∃ c > 0, ∀ n, ∀ G, ...`): + - The constant $c$ depends only on $r$, not on $n$ or $G$. ✓ + - **Potential issue**: The standard meaning of $\gg_r$ is "for all sufficiently large values of the relevant parameter." Compare with Problem 801, which uses the structure `∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ...`. Problem 802 omits the `∃ n₀, ∀ n ≥ n₀` threshold, requiring the bound to hold for *all* $n$ and all graphs with $t \geq 2$. + + **Analysis of whether this matters**: For very small $n$ (e.g., $n = 1, 2, 3$), the condition `avgDegree G ≥ 2` combined with `CliqueFree r` for $r \geq 3$ may be vacuously satisfied or may force degenerate cases. For $n = 0$, the sum and division yield $0/0$ which in Lean's division-by-zero convention gives $0$, so the hypothesis `avgDegree G ≥ 2` fails and the statement is vacuously true. For small $n > 0$ with $t \geq 2$, the graph has enough edges that an independent set of size $\geq c \cdot \frac{\log t}{t} \cdot n$ (which could be $< 1$ for small $n$ and appropriate $c$) always exists trivially (any single non-adjacent vertex suffices, or even the empty set if $c$ is small enough). + + So in practice, omitting the "sufficiently large" threshold likely does not change the truth value of the statement — one can simply choose $c$ small enough to handle finitely many small cases. **This is technically acceptable but differs stylistically from the standard interpretation and from Problem 801's treatment.** For maximum fidelity to the asymptotic notation, an `∃ n₀` threshold would be more precise. + +5. **Edge case — `answer(sorry)`**: The statement is wrapped in `answer(sorry) ↔ ...`, which is the standard pattern for open problems in this codebase. ✓ + +### Minor observations: + +- The `avgDegree` function is `noncomputable` (due to `G.degree` requiring decidability), which is fine for a statement-level definition. +- The `[DecidableRel G.Adj]` instance is properly threaded through. + +**Overall**: The formalization is mathematically sound. The omission of a "sufficiently large $n$" threshold is the only deviation from the most standard interpretation, and it is arguably equivalent (since $c$ can absorb finitely many exceptions). No mathematical flaws that would change the truth value of the statement. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `avgDegree` duplicates library `averageDegree`; independent set condition should use `IsIndepSet` | +| Citations | All four shorthand tags match website; full bibliographic details should be expanded | +| Variants | Complete — no missing variants | +| Readability | Moderate — could improve with `IsIndepSet`, `let t := ...` binding, and library `averageDegree` | +| Formalizability | High — one subtlety around asymptotic threshold, otherwise unambiguous | +| Correctness | Correct (with note: omitted `∃ n₀` threshold is likely equivalent but less standard) | diff --git a/ai-review/803.md b/ai-review/803.md new file mode 100644 index 0000000000..5f7f46b0b2 --- /dev/null +++ b/ai-review/803.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 803 + +## 1. Code Reuse + +**Issue found.** The file defines a local `IsDBalanced` predicate in the `Erdos803` namespace: + +```lean +noncomputable def IsDBalanced {m : ℕ} (H : SimpleGraph (Fin m)) (D : ℕ) : Prop := + ∀ u v : Fin m, H.degree u ≤ D * H.degree v +``` + +There is an existing library definition in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Balanced.lean`: + +```lean +def IsBalanced (G : SimpleGraph V) (D : ℝ) [DecidableRel G.Adj] : Prop := + G.maxDegree <= D * G.minDegree +``` + +These are mathematically equivalent (for `D ≥ 1` and nonempty finite graphs), but differ in: +- **Type of `D`:** The local version uses `ℕ`, the library uses `ℝ`. Since `D` is a natural number in the problem statement, `ℕ` is fine, but a cast would allow reuse. +- **Formulation:** The local version quantifies over all pairs, while the library version uses `maxDegree ≤ D * minDegree`. The library version is cleaner and more standard. + +**Recommendation:** Replace `IsDBalanced` with `SimpleGraph.IsBalanced` from the library, casting `D` to `ℝ` as needed. This avoids redundant definitions and is consistent with other problem files. + +Additionally, the subgraph embedding pattern (`∃ f, Function.Injective f ∧ ∀ u v, H.Adj u v → G.Adj (f u) (f v)`) is repeated across problems 800, 803, 1079, and others. Problem 800 defines `HasSubgraphCopy` and Problem 1079 defines `ContainsSubgraph` for exactly this pattern. Problem 803 should reuse one of these (preferably `HasSubgraphCopy` from Problem 800 or a shared utility) rather than inlining the pattern. + +## 2. Citations + +The website lists three references; the formalization only includes two. + +| Citation | Website | Formalization | Status | +|----------|---------|---------------|--------| +| [ErSi70] | Erdős, P. and Simonovits, M., 1970 | [ErSi70] Erdős, P. and Simonovits, M., 1970. | **Match** (but both lack the paper title) | +| [Al08] | Alon, N., 2008 | [Al08] Alon, N., 2008. | **Match** (but both lack the paper title) | +| [JaSu23] | Janzer and Sudakov, 2023 | *Missing* | **Missing** | + +**Issues:** +- **Missing citation [JaSu23]:** The website references Janzer and Sudakov (2023), who proved a partial positive result: any graph on n vertices with ≥ n log n edges contains an O(1)-balanced subgraph on m ≥ k vertices with ≫_k √(log m)/(log log m)^{3/2} · m edges. This should be mentioned in the docstring for completeness. +- **Missing paper titles:** Both included citations lack their paper titles. While the website itself is also sparse here, best practice is to include titles when known. +- **Missing related problem:** The website lists Problem #1077 as related. This cross-reference is absent from the docstring. + +## 3. Variants + +The website describes two related results beyond the main conjecture: + +1. **Erdős–Simonovits positive result [ErSi70]:** They proved a similar claim replacing log n and log m by n^c and m^c respectively (for any constant c > 0), with a balance parameter depending on c. This is not captured. +2. **Janzer–Sudakov partial positive [JaSu23]:** They showed the existence of O(1)-balanced subgraphs with a weaker edge bound of ≫_k √(log m)/(log log m)^{3/2} · m edges. This variant is not captured. + +**Assessment:** The main conjecture (disproved) is captured. The two related positive results could be formalized as separate theorems but are not strictly required since they are distinct results rather than variants of the same problem. + +## 4. Readability + +The code is generally readable. Minor suggestions: + +- The docstring for `IsDBalanced` says "for every pair of vertices u, v, the degree of u is at most D times the degree of v", which is correct but could be confused with a directed relationship. The equivalence to max deg ≤ D · min deg is correctly noted. +- The main theorem statement is well-structured with clear quantifier nesting. +- The `answer(False)` on the LHS of the iff is clear about the disproved status. +- **Minor:** The docstring says "there exist absolute constants D ≥ 1 and C > 0" but the formalization uses `D : ℕ` with `D ≥ 1`, which is slightly more restrictive than `D : ℝ` with `D ≥ 1`. Since the website says "for every D > 1" (in Alon's result), the natural number restriction is acceptable for the conjecture direction (existential over D), but worth noting. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement is precise: it asks whether specific constants D, C exist such that dense graphs (≥ n log n edges) always contain D-balanced subgraphs with ≥ C·m·log(m) edges. All terms are well-defined: +- "D-balanced" is clearly defined +- Edge density thresholds are explicit +- The subgraph notion (injective adjacency-preserving map) is standard + +The only mild ambiguity is whether "log" means natural logarithm or another base. The formalization uses `Real.log` (natural logarithm), which is the standard convention in combinatorics for this type of result. This is correct. + +**Ambiguity level: Very low.** The problem is straightforwardly formalizable. + +## 6. Correctness + +**The formalization is mathematically correct with one notable design choice.** + +**Correct aspects:** +- The `answer(False)` direction correctly captures that Alon disproved the conjecture. +- The quantifier structure is correct: ∃ D ≥ 1, ∃ C > 0, ∀ m ≥ 1, ∃ N₀, ∀ n ≥ N₀, ∀ G with enough edges, ∃ balanced subgraph with enough edges. +- The subgraph embedding is correctly formalized as an injective adjacency-preserving map. +- Edge counts are correctly cast to ℝ for comparison with logarithmic expressions. + +**Design choice to note:** +- The local `IsDBalanced` quantifies over all pairs (u, v), requiring `deg(u) ≤ D * deg(v)` for all u, v. This is equivalent to max deg ≤ D · min deg for `D ≥ 1`, which is the intended definition. However, for `D = 0` or when the graph has isolated vertices (min deg = 0), the quantified version is strictly stronger (it would force all degrees to be 0). Since the conjecture has `D ≥ 1` and the interesting case is nonempty subgraphs, this does not affect correctness. + +**Potential subtle issue:** +- The formalization allows `m = 1` (a single vertex), in which case any graph trivially contains a 1-vertex subgraph with 0 edges, and `C * 1 * log(1) = 0`, so the condition is vacuously satisfied. This is mathematically harmless but means the interesting content starts at m ≥ 2. The website's phrasing doesn't exclude small m, so this is fine. + +**Verdict: Correct and complete.** The formalization faithfully captures the disproved conjecture. No mathematical flaws identified. + +## Summary + +| Category | Rating | Notes | +|----------|--------|-------| +| Code Reuse | ⚠️ Improvement needed | Should use `SimpleGraph.IsBalanced` from library; should reuse subgraph embedding pattern | +| Citations | ⚠️ Incomplete | Missing [JaSu23] reference and related problem #1077 | +| Variants | ✅ Acceptable | Main conjecture captured; related positive results are separate theorems | +| Readability | ✅ Good | Clear structure and docstrings | +| Formalizability | ✅ Excellent | Very low ambiguity, straightforward formalization | +| Correctness | ✅ Correct | Faithful to the mathematical content; no flaws | diff --git a/ai-review/804.md b/ai-review/804.md new file mode 100644 index 0000000000..e8727fd8b7 --- /dev/null +++ b/ai-review/804.md @@ -0,0 +1,82 @@ +# Erdős Problem 804 — AI Review + +## 1. Code Reuse + +**Significant duplication with Mathlib.** The file defines its own `IsIndepSet` and `independenceNum` (lines 44–50), but Mathlib already provides a complete API in `Mathlib.Combinatorics.SimpleGraph.Clique`: + +- `SimpleGraph.IsIndepSet` — defined as `s.Pairwise (fun v w ↦ ¬G.Adj v w)` (on `Set α`). The custom definition is equivalent (the extra `u = v` case is vacuous by `SimpleGraph.loopless`), but uses `Finset` membership rather than `Set.Pairwise`. +- `SimpleGraph.indepNum` — `sSup {n | ∃ s, G.IsNIndepSet n s}`. This is the standard independence number and replaces the custom `independenceNum`. +- `SimpleGraph.IsNIndepSet` — an independent set of exact cardinality `n`. + +The project-local file `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` also provides the notation `α(G)` for `indepNum G` and supporting lemmas like `indepNum_pos`. + +**Recommendation:** Replace `Erdos804.IsIndepSet` and `Erdos804.independenceNum` with the Mathlib/ForMathlib equivalents. The `erdos804_f` definition and all four theorems would need minor adjustments to use `SimpleGraph.IsIndepSet` (on `Set` coerced from `Finset`) and `SimpleGraph.indepNum`. + +## 2. Citations + +The docstring references `[Er91]` and `[AlSu07]`. The website (erdosproblems.com/804) lists: + +- **Source:** [Er91] (Erdős and Hajnal) +- **Resolution:** Alon and Sudakov + +The shorthand `[AlSu07]` does not appear on the website itself — the website simply names "Alon and Sudakov" without a bracketed citation key. The docstrings should either expand the references to full citations or match the website's style. Specifically: + +- `[Er91]` → Could be expanded to: P. Erdős and A. Hajnal (1991) +- `[AlSu07]` → Could be expanded to: N. Alon and B. Sudakov (2007) + +The website also mentions "See also problem 805" as a related problem, which is not noted in the formalization. + +## 3. Variants + +The formalization captures **all four** asymptotic bounds from the Alon-Sudakov resolution: + +| Theorem | Statement | +|---------|-----------| +| `erdos_804` | Upper bound: f((log n)², n) ≤ C·(log n)² | +| `erdos_804.variants.part1_lower` | Lower bound: f((log n)², n) ≥ c·(log n)²/log(log n) | +| `erdos_804.variants.part2_upper` | Upper bound: f((log n)³, n) ≤ C·(log n)²/log(log n) | +| `erdos_804.variants.part2_lower` | Lower bound: f((log n)³, n) ≥ c·(log n)²/log(log n) | + +This is complete — the website states exactly these four bounds (the two double-sided asymptotic estimates). The original conjectures (f((log n)², n) ≥ n^{1/2−o(1)} and f((log n)³, n) ≫ (log n)³) are mentioned in docstrings as context for the disproof, which is appropriate. + +**No missing variants.** + +## 4. Readability + +- **Custom definitions clutter the namespace.** Using Mathlib's `IsIndepSet` and `indepNum` would make the code immediately recognizable to anyone familiar with the Mathlib API. +- **The `erdos804_f` definition (lines 58–63) is dense.** A brief inline comment explaining "infimum over qualifying graphs" would help readability, since the definition encodes "maximal k such that all qualifying graphs have independence number ≥ k" as an `sInf`. +- **Theorem names are clear** and follow a sensible convention (`part1_lower`, `part2_upper`, etc.). +- **The docstring** (lines 19–36) is well-written, clearly stating both the original conjecture and the resolution. Minor nit: line 28 says "Estimate f(n)" which should be "Estimate f(m,n)" — though this matches the original problem statement on the website, so it may be intentionally faithful. + +## 5. Formalizability + +**Assessment: High — the problem is precise enough to formalize unambiguously, with one minor convention choice.** + +The problem defines f(m,n) as a max-min quantity over graphs, which is a well-defined combinatorial optimization problem. The only ambiguity is: + +- **Logarithm base:** The problem says "log n" without specifying the base. In combinatorics, this is conventionally log base 2; the formalization uses natural log (`Real.log`). This does not affect the asymptotic statements since changing the base only introduces a multiplicative constant, and all log expressions in both the definition and the theorems use the same base consistently. However, it does mean the specific value of `erdos804_f` at any fixed (m,n) may differ from what a combinatorialist would compute. + +The problem is otherwise fully precise: the graph-theoretic concepts (independent set, induced subgraph) are standard and have unique formal meanings. + +## 6. Correctness + +### Definition of `erdos804_f` +The encoding as `sInf { k | ∃ G, (condition on G) ∧ independenceNum G = k }` correctly captures "the minimum independence number over all qualifying graphs," which equals "the maximum k such that every qualifying graph has independence number ≥ k." **This is mathematically correct.** + +However, there is an **edge-case concern**: when no graph on `Fin n` satisfies the local independence condition (e.g., when m > n, or for very small n), the set is empty and `sInf ∅ = 0` for `ℕ`. Mathematically, f(m,n) should be n (vacuously, all zero qualifying graphs satisfy any lower bound). This discrepancy is immaterial for the asymptotic theorems (which use "for all sufficiently large n") but makes the definition technically incorrect at small values. + +### Definition of `independenceNum` +The definition `((univ).powerset.filter (IsIndepSet G)).sup Finset.card` computes the maximum cardinality of an independent set by enumerating all subsets. This is correct for finite graphs (which `Fin n` ensures). It agrees with Mathlib's `indepNum` on finite types. + +### Induced subgraph condition +The formalization correctly encodes "every induced subgraph on m vertices has an independent set of size ≥ ⌈log n⌉" as: for all S with |S| = m, there exists T ⊆ S with |T| ≥ ⌈log n⌉ and T is independent **in G** (not just in G[S]). This is correct because an independent set in an induced subgraph G[S] is the same as a subset of S that is independent in G. + +### Theorem statements +All four theorem statements correctly express the asymptotic bounds: +- The use of `Nat.floor` for (log n)^2 and (log n)^3 is appropriate since m must be a natural number. +- The use of `Nat.ceil` for the log n threshold in the condition is also appropriate. +- The existential quantification over constants C > 0 and thresholds N₀ correctly captures "for sufficiently large n." +- The casting to `ℝ` for comparisons is handled correctly. + +### Verdict +**The formalization is mathematically correct and complete for its intended purpose (asymptotic bounds).** The only flaw is the `sInf ∅ = 0` edge case in `erdos804_f` for degenerate parameters, which does not affect any of the stated theorems. The code would benefit from replacing custom definitions with Mathlib equivalents. diff --git a/ai-review/805.md b/ai-review/805.md new file mode 100644 index 0000000000..446070b48b --- /dev/null +++ b/ai-review/805.md @@ -0,0 +1,78 @@ +# Review: Erdős Problem 805 + +## 1. Code Reuse + +**Significant duplication with Mathlib.** The file defines custom `IsFinsetClique` and `IsIndepSet` that closely duplicate existing Mathlib definitions in `Mathlib.Combinatorics.SimpleGraph.Clique`: + +| Custom (805.lean) | Mathlib equivalent | +|-|-| +| `Erdos805.IsFinsetClique G S` | `SimpleGraph.IsClique G ↑S` (or `SimpleGraph.IsNClique G k S` for sized version) | +| `Erdos805.IsIndepSet G S` | `SimpleGraph.IsIndepSet G ↑S` (or `SimpleGraph.IsNIndepSet G k S`) | + +The custom `IsIndepSet` checks `¬G.Adj u v` for *all* pairs including `u = v`. While this is technically harmless (since `SimpleGraph` enforces `loopless`), Mathlib's `IsIndepSet` uses `s.Pairwise (fun v w ↦ ¬G.Adj v w)` which only checks distinct pairs, and is the idiomatic formulation. + +Mathlib also provides `SimpleGraph.induce` (in `Mathlib.Combinatorics.SimpleGraph.Maps`) for induced subgraphs, and `CliqueFreeOn`/`IndepSetFreeOn` for restricting clique/independent set conditions to a vertex subset. These could potentially simplify `ErdosHajnalProperty`. + +**Duplication with Problem 804.** The file `FormalConjectures/ErdosProblems/804.lean` defines its own identical `IsIndepSet`. Both problems are closely related (the website explicitly says "See also Problem 804") and should share definitions. A shared utility file or placing shared definitions in `FormalConjecturesForMathlib` would be appropriate. + +## 2. Citations + +The docstring includes three references: +- **[Er91]** Erdős, P., *Problems and results in combinatorial number theory* — matches the website's original source. +- **[AlSu07]** Alon, N. and Sudakov, B., *Ramsey-type properties of graphs* — matches. +- **[ABS21]** Alon, N., Bucić, M. and Sudakov, B., *Induced subgraphs of Ramsey graphs* — matches. + +**Missing items from the website:** +- The website credits **Zach Hunter** as additional credit. This is not mentioned in the formalization. +- The website notes **"See also Problem 804"**. A cross-reference in the docstring would be helpful, especially given the shared mathematical context and definitions. + +## 3. Variants + +All key results from the website are captured: + +1. **Main conjecture** (open): Is there such a graph for g(n) = (log n)³? → `erdos_805` ✓ +2. **Alon–Sudakov [AlSu07]**: No such graph for g(n) = c·(log n)³/log(log n) → `erdos_805.variants.alon_sudakov` ✓ +3. **Alon–Bucić–Sudakov [ABS21]**: Such a graph exists for g(n) = 2^{2^{(log log n)^{1/2+o(1)}}} → `erdos_805.variants.alon_bucic_sudakov` ✓ + +The broader question "for which functions g(n) with n > g(n) ≥ (log n)²" is inherently too open-ended to formalize directly, and the file reasonably focuses on the specific conjectured threshold and the two partial results that bracket it. + +**No missing variants.** + +## 4. Readability + +- **Good:** The `ErdosHajnalProperty` definition cleanly bundles the induced subgraph condition. The docstrings are clear and informative. +- **Improvement:** Using Mathlib's standard `IsClique`/`IsIndepSet` vocabulary would make the formalization immediately recognizable to anyone familiar with Mathlib's graph theory library. +- **Minor:** The module docstring says "Erdős–Hajnal conjecture" in the theorem docstring but the problem on the website is attributed to Erdős and Hajnal without the name "Erdős–Hajnal conjecture" (which typically refers to a different, more famous conjecture about hereditary graph properties and polynomial Ramsey numbers). This could cause confusion — a clarifying note would help. +- **Minor:** The `open SimpleGraph Finset` at the top opens namespaces but the custom definitions shadow the Mathlib ones (e.g., `IsIndepSet` shadows `SimpleGraph.IsIndepSet`). This could confuse readers who expect the Mathlib version. + +## 5. Formalizability + +The problem is **clearly formalizable**. The specific conjecture about g(n) = (log n)³ is entirely precise, and both partial results have unambiguous mathematical statements. + +**Ambiguity assessment: Low.** The only source of ambiguity is the base of the logarithm. In graph Ramsey theory, "log n" is conventionally log base 2 (since Ramsey numbers grow exponentially in base 2). The formalization uses `Real.log` (natural logarithm, base e). This is an acceptable choice because: +- The base only affects constant factors, not the structure of the conjecture. +- The Alon–Sudakov result has an existential constant `c > 0` that absorbs base changes. +- The main conjecture uses `answer(sorry)` which absorbs the boolean answer. +- The `(1/2 + ε)` formulation of the ABS result correctly captures the `o(1)` regardless of base. + +However, it is worth noting as a stylistic discrepancy from the standard formulation. + +## 6. Correctness + +### Main conjecture (`erdos_805`) +**Correct.** The statement `answer(sorry) ↔ ∃ N₀, ∀ n ≥ N₀, ∃ G, ErdosHajnalProperty G ⌊(log n)³⌋ ⌈log n⌉` correctly captures the question. The docstring notes "Erdős and Hajnal conjectured that the answer is no," which would mean `answer(sorry) = False`, yielding `¬(∃ N₀, ...)` — i.e., for arbitrarily large n, no such graph exists. This is logically sound. + +### Alon–Sudakov variant (`erdos_805.variants.alon_sudakov`) +**Correct.** States `∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ¬∃ G, ErdosHajnalProperty G ⌊c·(log n)³/log(log n)⌋ ⌈log n⌉`. This matches the website's description: no such graph exists when g(n) = (c/log log n)(log n)³. + +### Alon–Bucić–Sudakov variant (`erdos_805.variants.alon_bucic_sudakov`) +**Correct.** States `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ∃ G, ErdosHajnalProperty G ⌊2^{2^{(log(log n))^{1/2+ε}}}⌋ ⌈log n⌉`. The universal quantification over ε correctly captures the o(1) in the exponent from the original result. + +### `ErdosHajnalProperty` definition +**Correct.** The definition requires that for *every* subset S of size m, both a clique of size ≥ k and an independent set of size ≥ k exist within S. This faithfully captures "every induced subgraph on g(n) vertices contains a clique of size ≥ log n and an independent set of size ≥ log n." + +### Potential concern: `IsIndepSet` reflexive pairs +The definition `∀ u ∈ S, ∀ v ∈ S, ¬G.Adj u v` includes the case u = v, but `SimpleGraph` has an irreflexivity axiom (`G.loopless`), so `¬G.Adj u u` holds automatically. **No mathematical error**, but it is non-standard. + +### Overall assessment +**The formalization is mathematically correct and complete.** No experienced mathematician would identify substantive flaws. The main recommendations are cosmetic: use Mathlib's standard graph theory definitions, add a cross-reference to Problem 804, and credit Zach Hunter. diff --git a/ai-review/806.md b/ai-review/806.md new file mode 100644 index 0000000000..38ddfc7482 --- /dev/null +++ b/ai-review/806.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 806 + +## 1. Code Reuse + +The formalization manually spells out the sumset membership condition: +```lean +∀ a ∈ A, ∃ b₁ ∈ B, ∃ b₂ ∈ B, (a : ℤ) = b₁ + b₂ +``` + +Several codebase alternatives exist: + +- **`Finset.image₂ (· + ·) B B`** — Used in Erdős 154 (`FormalConjectures/ErdosProblems/154.lean`) for finite sumsets. This would allow writing the condition as `↑a ∈ Finset.image₂ (· + ·) B B`, which is more idiomatic. +- **`Set.image2 (· + ·) B B`** — Used in Erdős 333 (`FormalConjectures/ErdosProblems/333.lean`), the closely related problem. Problem 333 writes `A ⊆ Set.image2 (· + ·) B B`. +- **`FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`** — Contains `IsAdditiveBasisOfOrder` and `isMulBasisOfOrder_two_iff` (with additive variant), which characterizes order-2 bases via `A + A`. However, this infrastructure is designed for bases covering *all* elements, not a specific target set, so it does not directly apply here. + +The existential formulation used is correct and clear, but replacing it with the `Finset.image₂` idiom would improve alignment with the rest of the codebase. Problem 333 is particularly relevant — both problems concern covering a set by a sumset B+B with B small — and adopting the same style would improve consistency. + +## 2. Citations + +The formalization includes: +- **[ErNe77]** Erdős, P. and Newman, D.J., *Bases for sets of integers*, J. Number Theory (1977). +- **[ABS09]** Alon, N., Bukh, B., and Sudakov, B., *Discrete Kakeya-type problems and small bases for the integers*, Israel J. Math. (2009). + +These match the references on [erdosproblems.com/806](https://www.erdosproblems.com/806). The website also notes Problem 333 as a related problem, which is not cross-referenced in the docstring. Adding a note mentioning the connection to Problem 333 would be helpful, since they are closely related (333 is the infinite/density-zero version; 806 is the finite version). + +## 3. Variants + +The website states a single problem: given A ⊆ {1,…,n} with |A| ≤ √n, must A ⊆ B+B for some B with |B| = o(√n)? No additional variants are mentioned. The formalization captures this single statement. The docstring also mentions the sharper bound |B| ≤ C · (log log n / log n) · √n from [ABS09], which is documented as context but not separately formalized — this is appropriate since the sharper bound implies the o(√n) statement. + +No variants are missing. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- The sumset condition could use `Finset.image₂` notation for conciseness and to match codebase conventions (see §1). +- The docstring is well-written and clearly explains the ε-formulation of o(√n), the original conjecture, and the resolution. +- The namespace `Erdos806` and theorem name `erdos_806` follow project conventions. + +Overall readability is good. + +## 5. Formalizability + +The problem is highly precise and straightforward to formalize. The only subtlety is encoding "o(√n)" in a type-theoretic setting, which the formalization handles correctly via the standard ε–N₀ formulation: for every ε > 0, there exists N₀ such that for all n ≥ N₀, the bound |B| ≤ ε√n holds. This is a clean and standard way to capture little-o asymptotics. + +**Ambiguity assessment: Very low.** The original problem statement is unambiguous. The only interpretive choice is whether B+B allows repeated elements (b₁ = b₂) or requires distinct summands. The standard convention for sumsets allows repeats, and the formalization correctly follows this convention. + +## 6. Correctness + +The formalization is **correct and complete**. + +Detailed verification: + +- **Domain of A:** The condition `∀ a ∈ A, 1 ≤ a ∧ a ≤ n` correctly captures A ⊆ {1, …, n} for A : Finset ℕ. +- **Size constraint on A:** `(A.card : ℝ) ≤ Real.sqrt n` correctly captures |A| ≤ √n. +- **B over ℤ:** B is correctly typed as `Finset ℤ`, matching the problem's B ⊂ ℤ. This is important — using ℕ would be unnecessarily restrictive and potentially incorrect, since negative elements of B can participate in sums reaching elements of A. +- **Size constraint on B:** `(B.card : ℝ) ≤ ε * Real.sqrt n` with the outer ∀ε > 0, ∃N₀ quantifiers correctly encodes |B| = o(√n). +- **Sumset membership:** `∃ b₁ ∈ B, ∃ b₂ ∈ B, (a : ℤ) = b₁ + b₂` correctly captures a ∈ B+B, with the cast `(a : ℤ)` properly lifting from ℕ to ℤ. +- **Answer annotation:** `answer(True)` is correct — the problem was resolved affirmatively by Alon, Bukh, and Sudakov [ABS09]. +- **Category annotation:** `category research solved` and `AMS 5 11` (Number Theory, general) are appropriate. +- **Quantifier ordering:** The ordering ∀ε, ∃N₀, ∀n ≥ N₀, ∀A, ∃B is correct. Crucially, B is allowed to depend on both n and A (not just n), which matches the problem statement. If B were required to be independent of A, the problem would be much stronger and likely false. + +**Edge cases:** When n = 0, the constraint `1 ≤ a ∧ a ≤ 0` forces A to be empty, and B = ∅ trivially satisfies the conclusion. This is fine. + +No mathematical flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor: could use `Finset.image₂` for sumset | +| Citations | Correct; could add cross-reference to Problem 333 | +| Variants | Complete — no missing variants | +| Readability | Good | +| Formalizability | Unambiguous, cleanly formalized | +| Correctness | Correct and complete | diff --git a/ai-review/807.md b/ai-review/807.md new file mode 100644 index 0000000000..c7fe16bf47 --- /dev/null +++ b/ai-review/807.md @@ -0,0 +1,92 @@ +# Erdős Problem 807 — AI Review + +## 1. Code Reuse + +**Independence number:** The formalization defines its own `independenceNumber` (line 67), but Mathlib already provides `SimpleGraph.indepNum` in `Mathlib.Combinatorics.SimpleGraph.Clique` (line 933), defined as `sSup {n | ∃ s, G.IsNIndepSet n s}`. The local definition uses `sSup` over `{k : ℕ | ∃ S : Finset V, S.card = k ∧ ∀ v ∈ S, ∀ w ∈ S, v ≠ w → ¬G.Adj v w}`, which is mathematically equivalent. The Mathlib version should be preferred for consistency and access to existing lemmas (e.g., `cliqueNum_compl`, `indepNum_compl`). + +**Duplicate definitions in codebase:** `independenceNumber` and `IsIndependentSet` are also defined locally in `ErdosProblems/151.lean` (line 56) and `ErdosProblems/615.lean` (line 62). These are all independent re-definitions of the same concept. A shared definition (ideally Mathlib's `indepNum`) should be used. + +**Biclique cover / bipartition number:** The `IsBicliqueCover` and `bipartitionNumber` definitions (lines 46–61) are novel and not found elsewhere in the codebase or Mathlib. These are appropriately defined locally. + +**No reusable random graph infrastructure:** The codebase has no formal G(n, 1/2) model. Other problems (e.g., 1164, 526) use `ProbabilityTheory` with measure-theoretic formulations, but Problem 807 uses a combinatorial counting approach instead, which avoids the need for such infrastructure. + +## 2. Citations + +**Website ([erdosproblems.com/807](https://www.erdosproblems.com/807)) lists:** +- [KRW88] — listed as the original source on the website +- [Al15] — Alon's 2015 disproof +- [ABH17] — Alon, Bohman, and Huang 2017 + +**Formalization includes:** +- [Al15] — ✅ Cited with full bibliographic info +- [ABH17] — ✅ Cited with full bibliographic info +- [KRW88] — ❌ **Missing.** The website lists this as the original reference. The formalization should include it. The full citation appears to be: Kratzke, T., Reznick, B., and West, D., _Eigensharp graphs: decomposition into complete bipartite subgraphs_, Trans. Amer. Math. Soc., 1988. + +## 3. Variants + +The website states the problem cleanly with no listed variants. The formalization captures: +- The original conjecture (τ(G) = n − α(G) almost surely) — ✅ +- Alon's disproof (τ(G) ≤ n − α(G) − 1 a.s.) — ✅ mentioned in docstring +- Alon–Bohman–Huang strengthening (τ(G) ≤ n − (1+c)α(G) a.s.) — ✅ mentioned in docstring + +The formal theorem only formalizes the original conjecture (as `answer(False)`). The stronger results of [Al15] and [ABH17] are mentioned in the docstring but not formalized as separate theorems. This is acceptable since the problem asks a yes/no question and the answer is "no," but formalizing the stronger quantitative results as separate conjectures could add value. + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- **Good:** Clear docstrings on all definitions (`IsBicliqueCover`, `bipartitionNumber`, `independenceNumber`) and the main theorem. +- **Good:** The informal mathematical context is well-explained in both the module docstring and the theorem docstring. +- **Minor:** The `IsBicliqueCover` definition (lines 46–54) packs four conjuncts into a single `Prop`. The edge-disjointness condition (third conjunct, lines 50–52) is somewhat hard to parse due to nested disjunctions. A helper predicate like `EdgesOverlap` could improve clarity, but this is a minor stylistic point. +- **Minor:** The `open SimpleGraph Filter Classical` on line 35 is broad. `Filter` and `Classical` are only needed for the theorem statement; scoping them more narrowly could improve readability. + +## 5. Formalizability + +**Assessment: Moderately formalizable with caveats.** + +The original problem asks about a property holding "almost surely" for random graphs G(n, 1/2). The formalization interprets this as: + +> The fraction of graphs on Fin n satisfying τ(G) = n − α(G) tends to 1 as n → ∞. + +This is a valid and standard interpretation: since G(n, 1/2) assigns equal probability to all labeled graphs on n vertices, "almost surely" is equivalent to the proportion of satisfying graphs tending to 1. + +**Potential ambiguity:** The phrase "almost surely" in probabilistic combinatorics sometimes means "with probability tending to 1" (as formalized here) and sometimes "with probability 1 in the limit" (a stronger measure-theoretic statement). The formalization uses the weaker (and standard) interpretation, which is correct for this context. + +**The counting approach is sound** but sidesteps the measure-theoretic machinery that might be needed for related problems. The denominator `Nat.card (SimpleGraph (Fin n))` correctly counts 2^(n choose 2) labeled graphs. + +## 6. Correctness + +**Overall assessment: Mathematically correct with one concern.** + +### Correct aspects: +- **`IsBicliqueCover`** correctly captures: (1) each bipartite subgraph has disjoint sides, (2) all pairs across sides are adjacent in G, (3) the bipartite subgraphs are pairwise edge-disjoint, (4) every edge is covered. This is a faithful formalization of biclique cover. +- **`bipartitionNumber`** as `sInf` of the set of valid cover sizes is correct. +- **`independenceNumber`** as `sSup` of independent set sizes is correct (for finite graphs the sup is attained). +- **`answer(False)`** correctly reflects that the conjecture was disproved. +- **The limit formulation** correctly encodes "almost surely fails." + +### Concern — direction of the iff: + +The theorem states: +``` +answer(False) ↔ Tendsto (fun n => ...) atTop (nhds 1) +``` + +This says: "the answer is False if and only if the proportion of graphs satisfying τ(G) = n − α(G) tends to 1." But `answer(False)` should mean the conjecture is **false**, i.e., it is **not** the case that the proportion tends to 1. The `↔` with `Tendsto ... (nhds 1)` would make `answer(False) ↔ (proportion → 1)`, which reads as "False ↔ the property holds almost surely." Since `answer(False)` unfolds to `False`, the entire statement becomes `False ↔ Tendsto ...`, which is equivalent to `¬ Tendsto ...`. This is actually **correct**: it asserts the limit does NOT equal 1, which matches the disproof. + +However, this encoding is somewhat indirect. The statement relies on the fact that `answer(False)` reduces to `False`, making the biconditional equivalent to the negation of the RHS. This is a project-wide convention and is consistent, but worth noting for clarity. + +### Minor concern — well-definedness of sInf: + +`bipartitionNumber` uses `sInf` on a set of natural numbers. If the set is empty (i.e., no finite biclique cover exists), `sInf ∅ = 0` in Lean/Mathlib, which would be mathematically incorrect (every finite graph admits a biclique cover). For graphs on `Fin n`, the set is always nonempty (one can take each edge as its own K_{1,1}), so this is not an issue in practice, but a `Nonempty` side-condition or a comment would strengthen the definition. + +### Summary + +| Category | Rating | Notes | +|----------|--------|-------| +| Code reuse | ⚠️ Moderate | Should use Mathlib's `indepNum` instead of local definition | +| Citations | ⚠️ Incomplete | Missing [KRW88] original reference from website | +| Variants | ✅ Good | All known results mentioned in docstring | +| Readability | ✅ Good | Clear structure, minor stylistic improvements possible | +| Formalizability | ✅ Good | Standard counting interpretation of "almost surely" is appropriate | +| Correctness | ✅ Correct | Mathematically faithful; `answer(False)` encoding works correctly | diff --git a/ai-review/808.md b/ai-review/808.md new file mode 100644 index 0000000000..500f7be0eb --- /dev/null +++ b/ai-review/808.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 808 + +## 1. Code Reuse + +The definitions `graphSumset` and `graphProdset` are unique to this file and are the only graph-restricted sumset/product set constructions in the codebase. Several other Erdős problems define standard (non-graph-restricted) sumsets: + +- Problem 52 (`ErdosProblems/52.lean`) uses Mathlib's pointwise `A + A` and `A * A` via `open scoped Pointwise` — the natural approach for unrestricted sum-product problems. +- Problem 154 uses `Finset.image₂ (· + ·) A A`. +- Problems 31, 35, 37, 337, etc. define custom `sumset` on `Set ℕ`. + +The graph-restricted nature of 808's operations is fundamentally different, so reuse of existing sumset code is not directly applicable. However, the `graphSumset`/`graphProdset` definitions could be slightly simplified: instead of filtering `Finset.univ` on `Fin n × Fin n`, one could filter on `G.edgeFinset` and map edges to sums/products. This would more directly mirror the mathematical definition "sums over edges" and avoid re-checking adjacency. That said, the current approach is functionally correct. + +No utilities in `FormalConjecturesForMathlib/` provide graph-restricted operations that could be reused here. + +## 2. Citations + +The formalization references: `[Er77c]`, `[ErSz83]`, `[Er91]`, `[Er97]`, `[ARS20]`. + +The [erdosproblems.com/808](https://www.erdosproblems.com/808) page lists these same references: +- **[Er77c]** — Erdős (1977) +- **[ErSz83]** — Erdős and Szemerédi (1983) +- **[Er91]** — Erdős (1991) +- **[Er97]** — Erdős (1997) +- **[ARS20]** — Alon, Ruzsa, and Solymosi (2020) — the disproof + +All citations from the website are present in the formalization. The docstring could benefit from fuller bibliographic details for `[ARS20]` (as done in Problem 52 for its references), but the shorthand tags match the website. + +The website also notes the problem is **related to Problem #52** (the Erdős–Szemerédi sum-product conjecture). This relationship is not mentioned in the formalization's docstring. + +## 3. Variants + +The website describes a **positive result** proved by Alon, Ruzsa, and Solymosi alongside their disproof: if $A$ has $n$ elements and $G$ has $m$ edges, then +$$\max(|A +_G A|, |A \cdot_G A|) \gg m^{3/2} n^{-7/4}.$$ + +This weaker positive bound is **not captured** in the formalization. It could be added as a separate theorem stating that such a lower bound exists. + +Additionally, the specific counterexample parameters (a set $A$ with $|A|=n$ and a graph $G$ with $\gg n^{5/3-o(1)}$ edges such that $\max(|A+_GA|, |A\cdot_GA|) \ll n^{4/3+o(1)}$) are not formalized. This level of detail is not strictly necessary but would enrich the formalization. + +## 4. Readability + +The code is clear and well-structured. Minor suggestions: + +- The docstring for `graphSumset` says "$\{f(i) + f(j) : (i, j) \in E(G)\}$" which is accurate. Good. +- The main theorem docstring is clear and includes the LaTeX statement. +- The namespace `Erdos808` is consistent with conventions elsewhere. +- The `graphSumset`/`graphProdset` definitions use a filter-then-image pattern on `Fin n × Fin n`, which is readable but slightly verbose. An alternative using `G.edgeFinset` directly would be more idiomatic but would require unpacking `Sym2` edges. + +Overall readability is good. + +## 5. Formalizability + +The problem is **precisely stated** and clearly formalizable. The conjecture has a clean quantifier structure (∀c, ε > 0, ∃ N₀, ∀ n ≥ N₀, ...) and the key concepts (graph, edges, sumset, product set) are standard. + +**Ambiguity assessment: Low.** The only minor point is whether "graph on $A$" means a simple graph (no self-loops, undirected) — the formalization correctly uses `SimpleGraph`, which is irreflexive and symmetric. This matches the standard combinatorial interpretation. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **Negation structure:** The theorem states `¬(∀ c ε ... → ...)`, correctly encoding that the conjecture is disproved. This is the right Lean idiom for a disproved conjecture. + +- **Set encoding:** The set $A \subset \mathbb{N}$ with $|A| = n$ is encoded as an injective function `f : Fin n → ℕ`. This correctly ensures $A$ has exactly $n$ distinct natural number elements. + +- **Edge count:** Uses `G.edgeFinset.card` (unordered edges), which is correct for simple graphs. + +- **Graph-restricted operations:** `graphSumset` filters ordered pairs `(i, j)` with `G.Adj i j` and maps to `f i + f j`. Since `SimpleGraph.Adj` is symmetric and addition is commutative, including both orderings does not produce spurious duplicates (since `f i + f j = f j + f i`). Same for `graphProdset` with multiplication. Since `SimpleGraph.Adj` is irreflexive, self-sums `f i + f i` are excluded, which is consistent with "edges" never being self-loops. + +- **Exponent handling:** The edge threshold `(n : ℝ) ^ (1 + c)` and the lower bound `(n : ℝ) ^ (1 + c - ε)` correctly reflect the problem statement. For `c > 1`, the edge bound exceeds $n(n-1)/2$ for large $n$, making the premise vacuously false — this is harmless and mathematically correct. + +- **Vacuous cases:** When `n = 0` or `n = 1`, the edge bound `n^{1+c}` is at most 1, but a graph on 0 or 1 vertices has 0 edges. The "sufficiently large" quantifier (`∃ N₀, ∀ n ≥ N₀`) correctly bypasses these edge cases. + +**No mathematical flaws identified.** The formalization faithfully captures the disproved conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reusable existing code; graph-restricted operations are unique to this problem | +| Citations | All website citations present; could add fuller bibliographic details | +| Variants | Missing the positive lower bound ($m^{3/2} n^{-7/4}$) proved by ARS20 | +| Readability | Good; minor stylistic improvements possible | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete for the main conjecture | diff --git a/ai-review/809.md b/ai-review/809.md new file mode 100644 index 0000000000..ed58b08c65 --- /dev/null +++ b/ai-review/809.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 809 + +## 1. Code Reuse + +The codebase already provides relevant abstractions in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`: + +- **`SimpleGraph.IsRainbow`**: Defines a rainbow homomorphism via `Function.Injective` on mapped edge colors. This is conceptually the same rainbow condition used in 809, but expressed through graph homomorphisms (`H →g G`) rather than manual cycle encoding. Adapting the formalization to use `IsRainbow` with a `cycleGraph` definition would improve reuse. +- **`SimpleGraph.antiRamseyNum`**: Used in Problem 1105 for anti-Ramsey numbers on cycles/paths. While 809's setup differs (it fixes the host graph to have a specific edge count rather than using Kₙ), the machinery is related. + +Several other problems define `cycleGraph` independently (86.lean, 811.lean) with identical definitions. Problem 809 could reference a shared cycle graph definition rather than encoding cycles manually via modular arithmetic on `Fin (2*k+1)`. + +Problem 810 (`ErdosProblems/810.lean`) is explicitly listed as a related problem on the website and uses a similar manual rainbow-cycle encoding pattern. + +## 2. Citations + +The docstring cites "Burr, Erdős, Graham, and Sós" informally. The website lists the citation key **[Er91]** but does not give a full bibliographic reference. The docstring should include this citation key for traceability: + +> **Current:** "A problem of Burr, Erdős, Graham, and Sós, who proved that $F_k(n) \gg n^2$." +> +> **Suggested:** "A problem of Burr, Erdős, Graham, and Sós [Er91], who proved that $F_k(n) \gg n^2$." + +The website also notes a related problem [#810](https://www.erdosproblems.com/810), which could be cross-referenced in the docstring. + +## 3. Variants + +No additional variants are listed on the website beyond the main question. The formalization captures the single stated conjecture. The related Problem 810 (rainbow C₄ colorings with εn² edges) is a separate problem and is already formalized independently. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- The repeated subexpression `⟨(i.val + 1) % (2 * k + 1), Nat.mod_lt _ (by omega)⟩` appears three times in `AdmitsRainbowOddCycleColoring`. Extracting a local `let next (i : Fin (2*k+1)) := ...` would reduce clutter. +- The docstring on `AdmitsRainbowOddCycleColoring` says "no repeated edge colors," which is correct but could explicitly state "rainbow" to match standard terminology used elsewhere in the codebase. + +## 5. Formalizability + +The problem is precise enough to be formalizable. The asymptotic statement F_k(n) ~ n²/8 is correctly captured by the ε-sandwich formulation (for all ε > 0, eventually (1−ε)n²/8 ≤ F_k(n) ≤ (1+ε)n²/8). The definition of "rainbow" (injective edge coloring on each cycle copy) is unambiguous. + +The one source of ambiguity is the quantifier over graphs in the definition of F_k(n) — see Correctness below. + +## 6. Correctness + +### Critical Issue: Existential vs. Universal Quantifier over Graphs + +**This is a significant mathematical error in the formalization.** + +The definition `AdmitsRainbowOddCycleColoring k n r` uses an **existential** quantifier over graphs: + +```lean +∃ G : SimpleGraph (Fin n), + G.edgeSet.ncard = n ^ 2 / 4 + 1 ∧ ... +``` + +This says "**there exists** a graph G with ⌊n²/4⌋+1 edges that admits a rainbow r-coloring." + +However, the standard definition of F_k(n) in the literature (and as described on erdosproblems.com) is the minimal r such that **any** (every) graph on n vertices with ⌊n²/4⌋+1 edges can be r-colored so that every C_{2k+1} is rainbow. This requires a **universal** quantifier: + +``` +F_k(n) = min{r : ∀G with |V(G)|=n and |E(G)|=⌊n²/4⌋+1, ∃c : E(G)→[r] rainbow} +``` + +The existential formulation creates two problems in the theorem statement: + +1. **Upper bound** (`∃ r ≤ (1+ε)n²/8, AdmitsRainbowOddCycleColoring k n r`): This only asserts that **some** graph can be colored with ~n²/8 colors. The correct claim is that **all** such graphs can be. + +2. **Lower bound** (`∀ r < (1−ε)n²/8, ¬AdmitsRainbowOddCycleColoring k n r`): This asserts that **no** graph with ⌊n²/4⌋+1 edges can be rainbow-colored with fewer than ~n²/8 colors. This is far too strong — a nearly-bipartite graph (e.g., K_{⌊n/2⌋,⌈n/2⌉} plus one edge) has very few odd cycles and could be rainbow-colored with very few colors. + +The correct formulation should be: + +```lean +noncomputable def AllAdmitRainbowOddCycleColoring (k n r : ℕ) : Prop := + ∀ G : SimpleGraph (Fin n), + G.edgeSet.ncard = n ^ 2 / 4 + 1 → + ∃ c : Sym2 (Fin n) → Fin r, + ∀ (f : Fin (2 * k + 1) → Fin n), + Function.Injective f → + (∀ i, G.Adj (f i) (f ⟨(i.val + 1) % (2 * k + 1), ...⟩)) → + Function.Injective (fun i => c (Sym2.mk (f i, f ⟨...⟩))) +``` + +with the theorem asserting: +- Upper bound: `∃ r ≤ (1+ε)n²/8, AllAdmitRainbowOddCycleColoring k n r` +- Lower bound: `∀ r < (1−ε)n²/8, ¬AllAdmitRainbowOddCycleColoring k n r` + +Note: the docstring in the Lean file itself says "there is a graph," which is consistent with the (incorrect) existential code but inconsistent with the website's "any graph." The docstring should also be corrected. + +### Minor: Edge Count Condition + +The edge count uses `G.edgeSet.ncard = n ^ 2 / 4 + 1`, which requires the graph to have **exactly** ⌊n²/4⌋+1 edges. The original problem defines F_k(n) for graphs with ⌊n²/4⌋+1 edges (exactly). This is correct — the significance of this threshold is that ⌊n²/4⌋ = ex(n, K₃) is the Turán number, so ⌊n²/4⌋+1 edges guarantees the graph contains a triangle (and hence odd cycles). + +### Minor: Coloring Domain + +The coloring `c : Sym2 (Fin n) → Fin r` assigns colors to all pairs of vertices, not just edges of G. This is harmless since the rainbow condition only inspects colors on edges that lie in a cycle of G. However, it slightly over-specifies the coloring. This is a standard and acceptable simplification. + +### Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Could use `IsRainbow` / shared `cycleGraph`; not blocking | +| Citations | Missing [Er91] tag; should cross-reference #810 | +| Variants | Complete | +| Readability | Good; minor repetition | +| Formalizability | Unambiguous once quantifier is clarified | +| **Correctness** | **Incorrect: ∃G should be ∀G in `AdmitsRainbowOddCycleColoring`** | diff --git a/ai-review/81.md b/ai-review/81.md new file mode 100644 index 0000000000..4ac2566916 --- /dev/null +++ b/ai-review/81.md @@ -0,0 +1,124 @@ +# Erdős Problem 81 — Review + +## 1. Code Reuse + +**`HasInducedCycle` / `IsChordal`**: These definitions are unique to `81.lean` and have no duplicates in the codebase. Mathlib provides `SimpleGraph.Walk.IsCycle` (in `Mathlib.Combinatorics.SimpleGraph.Paths`), which characterizes cycles as closed walks with no repeated vertices or edges. However, `Walk.IsCycle` captures cycles *within* a graph, not *induced* cycles (i.e., subgraphs isomorphic to a cycle graph with no extra adjacencies). The custom `HasInducedCycle` definition correctly captures the induced subgraph condition via the biconditional on adjacency, so using `Walk.IsCycle` directly would require additional machinery to assert the induced property. The custom definition is justified. + +**Clique partition structure**: Problem 1017 (`FormalConjectures/ErdosProblems/1017.lean`) formalizes a closely related concept — edge-disjoint clique decomposition — but uses a different representation: `Fin k → Finset (Sym2 (Fin n))` (indexed families of explicit edge-sets) rather than `Finset (Finset (Fin n))` (a finset of vertex-cliques). There is an opportunity to unify the clique partition formalization across Problems 81 and 1017. Problem 1017's edge-based representation makes the partition condition more direct (via `Disjoint`), whereas Problem 81 must encode edge-disjointness indirectly through the condition on lines 79–80. A shared `IsEdgeDisjointCliquePartition` predicate would improve consistency. The definitions in `FormalConjectures/ErdosProblems/610.lean`, `611.lean`, and `151.lean` (clique transversals) are conceptually different and not directly reusable here. + +## 2. Citations + +| Citation | Formalization | Website (erdosproblems.com/81) | Match? | +|---|---|---|---| +| [EOZ93] Erdős, Ordman, Zalcstein (1993) | ✅ Full citation in docstring with title, journal, volume, pages | ✅ Listed as reference | ✅ Yes | +| [CEO94] Chen, Erdős, Ordman (1994) | ❌ Not mentioned | ✅ Listed on website | ❌ Missing | +| Related Problem 1017 | ❌ Not mentioned | ✅ Cross-referenced on website | ❌ Missing | + +**Assessment**: The [EOZ93] citation is complete and accurate. However, the website also references Chen, Erdős, and Ordman [CEO94] for results on split graphs (a subclass of chordal graphs), and cross-references Problem 1017 (general clique partition numbers). Both should be added to the docstring for completeness: + +``` +[CEO94] Chen, G., Erdős, P., and Ordman, E.T., *Clique partitions of split graphs*, +(1994). +``` + +A note linking to Problem 1017 (`erdosproblems.com/1017`) would also be appropriate. + +## 3. Variants + +The website notes an important special case: + +> For **split graphs** (vertices partition into a clique and an independent set), Chen, Erdős, and Ordman showed the bound is 3n²/16 + O(n). + +This is a natural variant that is not formalized. A variant could be: + +```lean +/-- Split graph variant: a graph whose vertices can be partitioned into a clique +and an independent set. -/ +def IsSplitGraph {V : Type*} (G : SimpleGraph V) : Prop := + ∃ (S T : Set V), S ∪ T = Set.univ ∧ Disjoint S T ∧ + G.IsClique S ∧ ∀ u ∈ T, ∀ v ∈ T, u ≠ v → ¬G.Adj u v + +@[category research solved, AMS 5] +theorem erdos_81.variants.split_graph : + ∃ C : ℝ, 0 < C ∧ + ∀ n : ℕ, ∀ G : SimpleGraph (Fin n), + IsSplitGraph G → + ∃ P : Finset (Finset (Fin n)), + (∀ S ∈ P, G.IsClique (↑S : Set (Fin n))) ∧ + (∀ u v : Fin n, G.Adj u v → ∃ S ∈ P, u ∈ S ∧ v ∈ S) ∧ + (∀ S₁ ∈ P, ∀ S₂ ∈ P, S₁ ≠ S₂ → + ∀ u v : Fin n, u ∈ S₁ → v ∈ S₁ → u ∈ S₂ → v ∈ S₂ → ¬G.Adj u v) ∧ + (P.card : ℝ) ≤ 3 * (n : ℝ) ^ 2 / 16 + C * (n : ℝ) := by + sorry +``` + +Additionally, the known upper bound of roughly (1/4 − ε)n² by Erdős–Ordman–Zalcstein could be formalized as a solved variant. + +## 4. Readability + +The code is well-structured overall. A few observations: + +- **Docstrings**: The module-level docstring and theorem docstring are clear and informative, including motivation (the lower-bound example). +- **Namespace**: `Erdos81` is used consistently. +- **Definition placement**: `HasInducedCycle` and `IsChordal` are placed before the theorem with clear docstrings. Good. +- **Minor**: The partition disjointness condition (lines 79–80) is somewhat opaque at first reading. The comment `-- No edge belongs to two distinct cliques` helps, but the encoding (quantifying over vertices rather than edges) requires a moment of thought. A brief inline note explaining that "u ∈ S₁ ∧ v ∈ S₁ ∧ u ∈ S₂ ∧ v ∈ S₂" means "the edge {u,v} is in both S₁ and S₂" could aid readability. +- **Comparison with Problem 1017**: Problem 1017 uses an edge-set representation that makes edge-disjointness a direct `Disjoint` condition. Problem 81 would benefit from a similar approach or a named predicate abstracting the partition condition. + +## 5. Formalizability + +**Ambiguity level: Low.** + +The problem statement is precise: "Can the edges of a chordal graph on n vertices be partitioned into at most n²/6 + O(n) cliques?" All terms (chordal graph, edge partition, clique, the bound) have standard mathematical definitions. + +The only minor point of interpretation is the O(n) notation: does it mean there exists a universal constant C such that the bound holds for all n and all chordal graphs on n vertices? The formalization interprets it this way (a single C works for all n and all G), which is the standard reading. This is correct. + +The problem is a yes/no question (captured by `answer(sorry) ↔ ...`), which is appropriate for an open problem whose truth value is unknown. + +## 6. Correctness + +### `HasInducedCycle` (lines 41–44) + +The definition states: there exists an injective `f : Fin k → V` such that for all distinct `i, j`, adjacency `G.Adj (f i) (f j)` holds if and only if `i` and `j` are consecutive modulo `k`. + +- The consecutiveness condition `(i.val + 1) % k = j.val ∨ (j.val + 1) % k = i.val` correctly captures the edge set of the cycle graph C_k. +- The biconditional (↔) ensures this is an *induced* cycle: vertices are adjacent in G **exactly** when they are adjacent in C_k. This correctly excludes chords. +- Injectivity of `f` is required to ensure distinct cycle vertices map to distinct graph vertices. + +**Edge case analysis**: +- `k = 0`: `Fin 0` is empty, so `∃ f : Fin 0 → V` is satisfied by the empty function (which is vacuously injective and the ∀ is vacuous). So `HasInducedCycle G 0` is true for any G with any V (including empty V). This is harmless since `IsChordal` only examines `k ≥ 4`. +- `k = 1, 2`: Similarly satisfied vacuously or trivially. Irrelevant for chordality. +- `k = 3`: Correctly captures triangles (induced 3-cycles). +- `k ≥ 4`: Correctly captures induced cycles of the relevant lengths. + +**Verdict**: Correct. ✅ + +### `IsChordal` (lines 50–51) + +`∀ k : ℕ, 4 ≤ k → ¬HasInducedCycle G k` — a graph is chordal iff it has no induced cycle of length ≥ 4. This is the standard definition. ✅ + +### `erdos_81` (lines 68–83) + +The theorem asserts the existence of C > 0 such that for all n, all chordal graphs on Fin n, there exists a partition P of the edges into cliques with |P| ≤ n²/6 + Cn. + +**Partition conditions**: +1. *Each S ∈ P is a clique* (line 75): `G.IsClique (↑S : Set (Fin n))` — standard. ✅ +2. *Edge coverage* (line 77): `∀ u v, G.Adj u v → ∃ S ∈ P, u ∈ S ∧ v ∈ S` — every edge is in some clique. ✅ +3. *Edge disjointness* (lines 79–80): If S₁ ≠ S₂ and u, v are both in S₁ and S₂, then ¬G.Adj u v. This ensures no edge {u,v} is "claimed" by two cliques. ✅ +4. *Bound* (line 82): `(P.card : ℝ) ≤ (n : ℝ) ^ 2 / 6 + C * (n : ℝ)`. ✅ + +**Potential concern — empty/singleton cliques inflating count**: P could contain empty sets or singletons (which are trivially cliques with no edges). These inflate `P.card` without covering any edges. However, this only makes the bound *harder* to satisfy, not easier — it doesn't weaken the statement. An optimal partition would naturally avoid such cliques. So this is not a correctness issue. + +**Potential concern — C > 0 vs C ≥ 0**: The formalization requires `0 < C`. This is fine: if the statement holds for C = 0 (the stronger bound n²/6), it certainly holds for any C > 0. The existential merely asserts *some* positive constant works. + +**Overall correctness**: The formalization is mathematically correct and faithfully captures Erdős Problem 81. ✅ + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Opportunity to share clique-partition definitions with Problem 1017 | +| Citations | [CEO94] and Problem 1017 cross-reference missing | +| Variants | Split graph variant (3n²/16 + O(n) bound) not formalized | +| Readability | Good; partition disjointness condition could use a brief clarifying note | +| Formalizability | Low ambiguity; standard interpretation of O(n) is used | +| Correctness | ✅ Correct and complete | diff --git a/ai-review/810.md b/ai-review/810.md new file mode 100644 index 0000000000..16d15b974a --- /dev/null +++ b/ai-review/810.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 810 + +## 1. Code Reuse + +Several existing definitions in the codebase could be leveraged or considered: + +- **`IsRainbow`** in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:151–154` defines a rainbow homomorphism as `Function.Injective fun e : H.edgeSet => c (Sym2.map f e)`. This is the "right" abstract definition for rainbow subgraphs, but using it here would require constructing C₄ as a `SimpleGraph` and using graph homomorphisms, which adds overhead for a self-contained problem statement. + +- **`HasRainbowCopy`** in `ErdosProblems/811.lean:68–73` is structurally very close to what `AdmitsRainbowC4Coloring` does: an injective vertex map plus pairwise color distinctness on edges. Problem 810 could be refactored to define a cycle graph (cf. `cycleGraph811` at `811.lean:51–54`) and reuse `HasRainbowCopy`, but this would introduce a dependency on 811's namespace. A shared utility in `ForMathlib/` would be the ideal factoring. + +- **`AdmitsRainbowOddCycleColoring`** in `ErdosProblems/809.lean:40–51` uses the same `Sym2`-based coloring pattern with `Function.Injective` to assert rainbow-ness, which is more concise than the 6-way pairwise inequality used in 810. + +**Recommendation:** The hand-rolled 6-way pairwise distinctness in `AdmitsRainbowC4Coloring` could be replaced with a `Function.Injective` formulation (as in 809), or the shared `HasRainbowCopy` pattern (as in 811). This would improve both reuse and conciseness. + +## 2. Citations + +The website (erdosproblems.com/810) lists: + +- **Source:** [Er91] +- **Attribution:** A problem of Burr, Erdős, Graham, and Sós. +- **Related:** See also Problem 809. + +The formalization's docstring mentions the attribution correctly ("A problem of Burr, Erdős, Graham, and Sós") but does **not** include the [Er91] citation. For consistency with other problems (e.g., 811 which lists [Er91] explicitly), the docstring should add: + +``` +[Er91] Erdős, P., _Some of my favourite problems in various branches of combinatorics_, 1991. +``` + +The "See also Problem 809" cross-reference from the website is also absent from the docstring. + +## 3. Variants + +The website states only a single variant of the problem. The formalization captures it fully. No additional variants appear to be missing. + +The related Problem 809 asks a different question (about the minimum number of colors for rainbow odd cycles in dense graphs), so it is a companion problem rather than a variant. + +## 4. Readability + +Several readability concerns: + +- **Variable naming:** The cycle vertices are named `a b d e`, skipping `c` because `c` is used for the coloring function. This is pragmatic but slightly confusing. Renaming the coloring function (e.g., to `col` or `χ`) would allow the more natural vertex names `a b c d`. + +- **Verbose distinctness:** The 6 pairwise color inequalities (lines 39–44) are correct but verbose. Using `Function.Injective` on the list of 4 edge colors (as Problem 809 does for odd cycles) would be more concise and idiomatic. + +- **Vertex distinctness:** The 6 pairwise vertex inequalities (lines 37–38) could similarly be expressed more compactly, e.g., via `List.Nodup [a, b, d, e]` or `Function.Injective (![a, b, d, e])`. + +- **Namespace isolation:** The definition is appropriately namespaced under `Erdos810`. + +## 5. Formalizability + +The problem is **precisely stated** and directly formalizable. The English statement asks for the existence of ε > 0 and a threshold N such that for all n ≥ N, a graph with ≥ εn² edges exists admitting an n-coloring where every C₄ is rainbow. Each component of this is unambiguous. + +**Ambiguity assessment: Low.** The only potential ambiguity is whether "every C₄" means every *induced* C₄ or every C₄ subgraph (i.e., any 4-cycle regardless of whether diagonals are also present). The standard graph-theoretic reading is the latter (any 4-cycle), and the formalization correctly adopts this interpretation by not requiring non-adjacency of diagonal pairs (a,d) and (b,e). + +## 6. Correctness + +**The formalization is mathematically correct.** Specific verification: + +- **C₄ detection:** The universal quantification over all 4-tuples `(a, b, d, e)` with the adjacency pattern `a–b–d–e–a` correctly captures all 4-cycles. Every C₄ in the graph will be detected under some assignment of its vertices to (a, b, d, e). The 6 pairwise vertex distinctness conditions correctly ensure no vertex is repeated. + +- **Rainbow condition:** Requiring all 6 pairwise color inequalities among the 4 edges is equivalent to requiring 4 distinct colors on the 4 edges of the C₄. This is correct. + +- **Edge density:** `G.edgeSet.ncard ≥ ε * n²` correctly formalizes "at least εn² edges". Since `SimpleGraph (Fin n)` has a finite edge set, `ncard` coincides with the usual finite cardinality. + +- **Number of colors:** The coloring function `c : Sym2 (Fin n) → Fin n` uses exactly `n` colors (indexed by `Fin n`), matching the problem statement's "n colours". The function is total over `Sym2 (Fin n)`, assigning colors to non-edges as well, which is harmless. + +- **Existential structure:** The `∃ ε > 0, ∃ N, ∀ n ≥ N, ∃ G, ...` correctly captures "there exists ε > 0 such that for all sufficiently large n, some graph G exists..." + +- **The `answer(sorry)` wrapper** is used correctly for an open problem, leaving the truth value undetermined. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `HasRainbowCopy` or `Function.Injective` pattern from 809/811 | +| Citations | Missing [Er91] reference and cross-reference to Problem 809 | +| Variants | Complete | +| Readability | Adequate; verbose vertex/color distinctness could be simplified | +| Formalizability | Low ambiguity; directly formalizable | +| Correctness | **Correct and complete** | diff --git a/ai-review/811.md b/ai-review/811.md new file mode 100644 index 0000000000..7cd104b7b5 --- /dev/null +++ b/ai-review/811.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 811 + +## 1. Code Reuse + +Several definitions in `811.lean` duplicate or partially overlap existing infrastructure: + +| Local Definition | Reusable Alternative | Source | +|---|---|---| +| `cycleGraph811` | `SimpleGraph.cycleGraph` | `Mathlib.Combinatorics.SimpleGraph.Circulant` (defined as `circulantGraph {1}`) | +| `HasRainbowCopy` | `SimpleGraph.IsRainbow` | `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:151-154` | +| `IsBalancedColoring` | (no existing match) | — | + +**`cycleGraph811`**: This is the same hand-rolled cycle graph pattern duplicated across at least 12 other Erdős problem files (556, 569, 572, 594, 666, 720, 765, etc.). Mathlib's `SimpleGraph.cycleGraph n` is defined for all `n : ℕ` (returning `⊥` for degenerate cases) and does not require a proof obligation `m ≥ 3`. Problem 1105 already uses `SimpleGraph.cycleGraph` directly and should be the model to follow. + +**`HasRainbowCopy`**: The existing `SimpleGraph.IsRainbow` in `FormalConjecturesForMathlib` defines rainbow as injectivity of the edge-color mapping through a graph homomorphism. The local `HasRainbowCopy` re-implements this with a raw injective vertex map `f : V → Fin n` plus pairwise-distinctness on edge colors. The Mathlib-compatible formulation using `H →g G` (graph homomorphism) and `IsRainbow` is cleaner and already used in `antiRamseyNum` (Problem 1105). The local definition could be replaced by: +``` +∃ f : (cycleGraph 6) →g (⊤ : SimpleGraph (Fin n)), Function.Injective f ∧ IsRainbow f c +``` + +**`IsBalancedColoring`**: No existing equivalent exists in the codebase. This is a reasonable standalone definition, though it could be extracted to a shared utility since the concept appears in the broader Erdős problem family (809, 810, 811). + +**Recommendation**: Replace `cycleGraph811` with Mathlib's `SimpleGraph.cycleGraph 6`, and replace `HasRainbowCopy` with the existing `IsRainbow` formulation from FormalConjecturesForMathlib. + +## 2. Citations + +The website lists the following references: +- **[Er91]** Erdős (1991) — original problem, credited to Erdős, Pyber, and Tuza +- **[Er93]** Erdős (1993), p. 346 +- **[ErTu93]** Erdős & Tuza — established bounds for d_{C₄}(n) +- **[Er96]** Erdős (1996) — challenges including rainbow C₆ and K₄ +- **[ClWa23]** Clemen & Wagner — proved K₄ lacks the property +- **[AxCl24]** Axenovich & Clemen — found infinitely many graphs without the property + +The formalization's docstring includes [Er91], [ErTu93], [Er96], [ClWa23], and [AxCl24], but is **missing [Er93]** (Erdős 1993, p. 346). Additionally, the citation entries lack full titles/journal information: + +- `[ClWa23]` is listed as just "Clemen, F. and Wagner, A., 2023" — missing the paper title. +- `[AxCl24]` is listed as just "Axenovich, M. and Clemen, F., 2024" — missing the paper title. +- `[Er91]`, `[ErTu93]`, `[Er96]` have titles but are still abbreviated. + +**Recommendation**: Add [Er93] and fill in full titles for [ClWa23] and [AxCl24]. + +## 3. Variants + +The Erdős Problem 811 as stated on the website is actually a **general question**: "For which graphs G is it true that, if m = e(G), for all large n ≡ 1 (mod m), every balanced edge-colouring of K_n with m colours contains a rainbow copy of G?" + +The formalization captures only the **specific sub-challenge** mentioned by Erdős in [Er91] and [Er96]: the case G = C₆ (which has 6 edges, so m = 6). The docstring correctly notes that the K₄ case (also 6 edges) was answered negatively by [ClWa23]. + +**Missing variants**: +- The **general problem** asking to characterize all graphs G with this property is not formalized. This is understandable since it asks "for which G", which is harder to formalize as a theorem statement. +- The **quantitative version** involving d_G(n) (minimum degree threshold in each color class guaranteeing a rainbow copy) mentioned on the website is not captured. +- The result from **[AxCl24]** (infinitely many graphs lack the property; conjecture K_m lacks it for all m ≥ 4) could be formalized as a separate conjecture. + +**Assessment**: The formalization is a reasonable narrowing to the most concrete open sub-problem. The docstring's header "specific challenge from [Er91] and [Er96]" is appropriately honest about this scoping. + +## 4. Readability + +**Strengths**: +- Good docstrings on all definitions. +- The namespace `Erdos811` prevents name collisions. +- The balanced coloring and rainbow copy concepts are clearly separated. + +**Issues**: +- `cycleGraph811` uses a problem-specific suffix (`811`) unlike other files that just use `cycleGraph`. This is inconsistent — and unnecessary if replaced with Mathlib's version. +- The `HasRainbowCopy` definition's condition with four universally quantified vertices `a b a' b'` and a `Sym2.mk (a, b) ≠ Sym2.mk (a', b')` guard is verbose and harder to read than the `Function.Injective` formulation used in `IsRainbow`. +- The `IsBalancedColoring` definition filters over `Finset.univ` with a compound predicate `w ≠ v ∧ c (Sym2.mk (v, w)) = i`. This is correct but could be slightly clearer if the "neighbors of v with color i" concept were separated. + +**Recommendation**: Replace hand-rolled definitions with Mathlib/shared versions, which are more idiomatic and familiar to Lean users. + +## 5. Formalizability + +The specific sub-problem (rainbow C₆ in balanced 6-colorings of K_n for large n ≡ 1 mod 6) is **precisely formalizable**. All concepts involved — complete graphs, balanced edge colorings, cycle graphs, rainbow copies, and the eventual threshold — have clear mathematical definitions. + +The **general problem** ("for which graphs G…") is inherently a classification problem, which is harder to formalize as a single theorem statement without knowing the answer. The decision to formalize only the C₆ case avoids this ambiguity. + +**Ambiguity level**: Very low for the formalized sub-problem. The definitions of "balanced" and "rainbow copy" are standard and unambiguous. + +## 6. Correctness + +**`IsBalancedColoring`**: The definition requires that for every vertex v and color i, exactly `n / m` neighbors of v have the edge to v colored i. The docstring notes this works when n ≡ 1 (mod m) because deg(v) = n - 1 divides as m · ⌊n/m⌋. Checking: if n ≡ 1 (mod m), then n - 1 ≡ 0 (mod m), so (n - 1) = m · ((n-1)/m). Meanwhile ⌊n/m⌋ = (n-1)/m (since n = qm + 1 gives ⌊n/m⌋ = q = (n-1)/m). So the count per color is (n-1)/m = ⌊n/m⌋ = `n / m` in Lean's natural number division. ✓ Correct. + +**`HasRainbowCopy`**: The definition requires an injective f : V → Fin n such that for all pairs of *distinct edges* (a,b) and (a',b') of G, their images under f receive distinct colors. This correctly captures "all edge-colors are pairwise distinct" — i.e., the coloring restricted to the image of G is a proper edge-coloring with all distinct colors. + +However, there is a **subtle issue**: the condition quantifies over `a b a' b' : V` with `G.Adj a b`, `G.Adj a' b'`, and `Sym2.mk (a, b) ≠ Sym2.mk (a', b')`. Because `SimpleGraph.Adj` is symmetric, each edge {a, b} appears twice as both `(a, b)` and `(b, a)`. But `Sym2.mk (a, b) = Sym2.mk (b, a)`, so the `Sym2` guard correctly identifies distinct *edges* rather than distinct *ordered pairs*. However, since `f` maps into `Fin n` and the color function uses `Sym2.mk (f a, f b)`, and `Sym2.mk` is symmetric, the mapping from `(a, b)` and `(b, a)` goes to the same `Sym2` value. So `c (Sym2.mk (f a, f b)) = c (Sym2.mk (f b, f a))`, meaning the symmetry of G.Adj doesn't create false distinctness requirements. ✓ Correct. + +**`cycleGraph811`**: The adjacency relation `i ≠ j ∧ (j.val = (i.val + 1) % m ∨ i.val = (j.val + 1) % m)` correctly captures C_m for m ≥ 3. The `i ≠ j` guard is redundant for m ≥ 3 (since (i+1) % m ≠ i when m ≥ 2), but doesn't cause incorrectness — it just makes the `loopless` proof trivial. ✓ Correct. + +**Main theorem `erdos_811`**: Asserts existence of N such that for n ≥ N with n % 6 = 1, every balanced 6-coloring of K_n contains a rainbow C₆. This matches the specific challenge described on the website and in [Er96]. ✓ Correct. + +**Coloring domain issue**: The coloring `c : Sym2 (Fin n) → Fin 6` is defined on *all* elements of `Sym2 (Fin n)`, including diagonal pairs `⟦(v, v)⟧`. For balanced coloring, only off-diagonal pairs matter (the filter uses `w ≠ v`), and for rainbow copies, the injection ensures distinct vertices. So the values on diagonals are irrelevant. ✓ No issue. + +**Overall correctness**: The formalization is mathematically correct and complete for the specific sub-problem it targets. No flaws identified. diff --git a/ai-review/812.md b/ai-review/812.md new file mode 100644 index 0000000000..b80297427f --- /dev/null +++ b/ai-review/812.md @@ -0,0 +1,127 @@ +# Review: Erdős Problem 812 + +## 1. Code Reuse + +The codebase contains **four separate definitions** of diagonal Ramsey numbers across different files: + +| File | Definition Name | Formulation | +|------|----------------|-------------| +| `ErdosProblems/812.lean` | `Erdos812.diagonalRamsey` | `sInf` over SimpleGraph on `Fin N` with `CliqueFree` | +| `ErdosProblems/77.lean` | `Erdos77.diagonalRamseyNumber` | `sInf` over symmetric 2-colorings (Bool-valued) | +| `ErdosProblems/1029.lean` | `Erdos1029.diagonalRamseyNumber` | Identical to Problem 77's definition | +| `ErdosProblems/87.lean` | `Erdos87.diagRamsey` | Via `graphRamseyNumber` using `ContainsSubgraph` on complete graph `⊤ : SimpleGraph (Fin k)` | + +Additionally, `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey r n`, the r-uniform hypergraph Ramsey number. For `r = 2`, this is the standard graph Ramsey number, though it uses a different formulation (2-colorings of r-subsets via `Finset`). + +**Recommendation:** All four definitions are mathematically equivalent for `n ≥ 1`, but having separate local definitions is a maintenance burden and makes cross-referencing between problems harder. Ideally a single canonical `diagonalRamsey` definition should live in `FormalConjecturesForMathlib` (or be derived from `hypergraphRamsey 2 n`) and be imported by all Erdős problems that need it. Problem 812's definition using `SimpleGraph` + `CliqueFree` is arguably the most idiomatic for Mathlib's graph theory library, but Problem 87's approach via `graphRamseyNumber` is the most general since it naturally extends to off-diagonal and graph Ramsey numbers. + +## 2. Citations + +**Website ([erdosproblems.com/812](https://www.erdosproblems.com/812))** lists: +- The problem is attributed to Erdős. +- **Known result:** Burr, Erdős, Faudree, and Schelp proved R(n+1) − R(n) ≥ 4n − 8 for all n ≥ 2. +- **Additional note:** Results from Problem 165 imply R(n+2) − R(n) ≫ n^{2−o(1)}. + +**Formalization docstring** cites: +- `[BEFS89]` Burr, S.A., Erdős, P., Faudree, R.J., and Schelp, R.H. — matches the website, though the website does not give the specific citation key. The docstring does not include the paper title or publication venue. +- `[Er91]` Erdős, P., _Problems and results on graphs and hypergraphs_, 1991 — this is a reasonable source attribution. + +**Issues:** +- The `[BEFS89]` citation is incomplete: it lacks the paper title and journal. The full reference is likely: Burr, S.A., Erdős, P., Faudree, R.J., and Schelp, R.H., *On the difference of successive Ramsey numbers*, Utilitas Mathematica **35** (1989), 115–118. +- The website mentions the connection to Problem 165 (R(n+2) − R(n) ≫ n^{2−o(1)}), which the formalization does not mention. This is relevant context since it shows the gap question for step 2 is nearly resolved. + +## 3. Variants + +The problem as stated on the website asks two questions: +1. **Geometric growth:** R(n+1)/R(n) ≥ 1 + c for some c > 0 and all large n. +2. **Quadratic gap:** R(n+1) − R(n) ≫ n². + +The formalization captures both as: +- `erdos_812` (Part 1 — ratio bound) +- `erdos_812.variants.quadratic_gap` (Part 2 — difference bound) + +**Assessment:** Both variants from the website are captured. The formalization is complete in this regard. + +One could argue that a third natural variant — the known lower bound R(n+1) − R(n) ≥ 4n − 8 from [BEFS89] — could be formalized as a proved result (tagged `category research solved` or similar), but this is not strictly required since the problem asks for the conjectured stronger bounds. + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Good:** The module docstring clearly states both parts of the problem with LaTeX notation, explains the notation R(n), and provides references. +- **Good:** The `diagonalRamsey` definition has a clear docstring explaining its meaning. +- **Good:** The two theorems have clear docstrings distinguishing Part 1 (ratio) and Part 2 (difference). +- **Minor:** The definition `diagonalRamsey` uses the condition `¬G.CliqueFree n ∨ ¬Gᶜ.CliqueFree n`. While mathematically correct (an n-clique in the complement is exactly an independent set of size n), it might be slightly more readable to use an `IsNClique` or independent set formulation for the complement side. However, the symmetry of the current formulation (`CliqueFree` in both G and Gᶜ) is elegant and arguably preferable. +- **Minor:** The namespace `Erdos812` and definition names are clear and follow conventions. + +Overall readability: **Very good.** + +## 5. Formalizability + +The problem is **clearly and unambiguously formalizable**. + +- R(n) = R(n,n) (diagonal Ramsey number) is a well-defined combinatorial quantity. +- The ratio question "R(n+1)/R(n) ≥ 1 + c for all large n" translates directly to the ∃c > 0, ∃N₀, ∀n ≥ N₀ form. +- The difference question "R(n+1) − R(n) ≫ n²" translates directly to the ∃c > 0, ∃N₀, ∀n ≥ N₀ form. +- Both questions are yes/no questions (wrapped in `answer(sorry)`), which is appropriate since it is unknown whether these statements are true. + +**Ambiguity assessment: None.** The mathematical content is completely precise. + +## 6. Correctness + +### 6a. Definition of `diagonalRamsey` + +The definition: +```lean +noncomputable def diagonalRamsey (n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree n ∨ ¬Gᶜ.CliqueFree n} +``` + +This says: the smallest N such that every simple graph on {0, ..., N−1} contains either an n-clique or an independent set of size n. This is the standard definition of R(n,n). + +**Potential edge case — n = 0 and n = 1:** +- For n = 0: `CliqueFree 0` means no 0-clique, but the empty set is a 0-clique in any graph, so `CliqueFree 0` is always false. Thus `¬G.CliqueFree 0` is always true, and the set contains all N ≥ 0, giving `diagonalRamsey 0 = 0`. This is a reasonable convention. +- For n = 1: `CliqueFree 1` means no 1-clique (no vertex), which is false for any nonempty graph. So for N ≥ 1, the condition is satisfied. We get `diagonalRamsey 1 = 1`, which matches the standard convention R(1,1) = 1. + +These edge cases are fine and don't affect the conjecture (which only concerns large n). + +**Important note on `sInf` for empty sets:** If the defining set were empty, `sInf ∅ = 0` in ℕ. However, by Ramsey's theorem the defining set is always nonempty for finite n, so this is not a concern. (Though this is not proved in the file, it doesn't affect the well-posedness of the conjecture statements.) + +### 6b. `erdos_812` (Part 1 — ratio bound) + +```lean +∃ c : ℝ, 0 < c ∧ +∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (diagonalRamsey (n + 1) : ℝ) / (diagonalRamsey n : ℝ) ≥ 1 + c +``` + +This correctly formalizes "∃c > 0, for all sufficiently large n, R(n+1)/R(n) ≥ 1+c." + +**Potential concern — division by zero:** If `diagonalRamsey n = 0` (which happens for n = 0 in our convention), then we'd be dividing by zero. In Lean/Mathlib, division by zero in ℝ yields 0, so the inequality `0 ≥ 1 + c` would be false. However, since R(n) ≥ 1 for n ≥ 1 (and indeed R(n) grows rapidly), for any N₀ ≥ 1 this is not a problem. The formalization is correct. + +### 6c. `erdos_812.variants.quadratic_gap` (Part 2 — quadratic gap) + +```lean +∃ c : ℝ, 0 < c ∧ +∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + (diagonalRamsey (n + 1) : ℝ) - (diagonalRamsey n : ℝ) ≥ c * (n : ℝ) ^ 2 +``` + +This correctly formalizes "R(n+1) − R(n) ≫ n²" in the standard analytic number theory sense (there exists c > 0 such that R(n+1) − R(n) ≥ cn² for all large n). + +**Assessment: Mathematically correct and complete.** + +### 6d. Relationship between the two parts + +Note that Part 1 (geometric growth) is strictly stronger than Part 2 (quadratic gap), assuming standard bounds on R(n). If R(n+1)/R(n) ≥ 1 + c, then R(n+1) − R(n) ≥ c·R(n), and since R(n) grows at least exponentially (R(n) ≥ 2^{n/2} by the probabilistic method), this gives R(n+1) − R(n) ≥ c·2^{n/2} ≫ n². The formalization does not make this implication explicit, which is fine — they are stated as independent open questions. + +## Summary + +| Category | Assessment | +|----------|------------| +| Code reuse | Redundant `diagonalRamsey` definitions across 4 files; consolidation recommended | +| Citations | `[BEFS89]` lacks title/journal; connection to Problem 165 not mentioned | +| Variants | Both website variants captured ✓ | +| Readability | Very good ✓ | +| Formalizability | Unambiguous, fully precise ✓ | +| Correctness | Mathematically correct and complete ✓ | diff --git a/ai-review/813.md b/ai-review/813.md new file mode 100644 index 0000000000..73acc2423c --- /dev/null +++ b/ai-review/813.md @@ -0,0 +1,71 @@ +# Erdős Problem 813 — Review + +## 1. Code Reuse + +**Issue found.** The custom `graphCliqueNumber` definition (line 47) is mathematically equivalent to Mathlib's built-in `SimpleGraph.cliqueNum`, which is defined as `sSup {n | ∃ s, G.IsNClique n s}`. Problem 61 (`ErdosProblems/61.lean`) already uses `G.cliqueNum` directly from Mathlib. The custom definition should be replaced with `G.cliqueNum` for consistency and to avoid redundancy. + +Similarly, `EverySevenSetHasTriangle` could potentially be expressed using Mathlib's `IsNClique 3` predicate for the triangle condition, though the current explicit formulation is arguably more readable. + +The `sInf`-based definition of `erdos813H` is fine and necessarily problem-specific. + +## 2. Citations + +**Minor issues found.** + +- The reference tag `[Er91]` is inconsistent with the publication year 1990 given in the citation body ("Algorithms Combin., 5 (1990), 12-28"). Either the tag should be `[Er90]` or the year should be verified. +- The docstring says "A problem of Erdős and Hajnal [Er91]" but the cited reference `[Er91]` lists only Erdős as author, not Erdős and Hajnal jointly. The attribution to Hajnal may come from a different source or the reference may be incomplete. +- The website confirms the problem is **open** and references the same two results (Erdős–Hajnal basic bounds and Bucić–Sudakov improvement), so the citations are substantively correct. + +## 3. Variants + +**Missing variants.** Two natural variants could be formalized: + +1. **Erdős–Hajnal basic bounds (solved):** The known result $n^{1/3} \ll h(n) \ll n^{1/2}$ could be a `@[category research solved]` variant. This is a weaker statement than the main conjecture and is already proven. + +2. **Bucić–Sudakov lower bound (solved):** The result $h(n) \gg n^{5/12 - o(1)}$ could be formalized as a solved variant. This partially resolves the lower bound side of the conjecture (since $5/12 > 1/3$). + +## 4. Readability + +**Good overall.** The code is well-structured: +- `EverySevenSetHasTriangle` clearly captures the combinatorial condition. +- `erdos813H` clearly defines $h(n)$ as the infimum over qualifying graphs. +- The main theorem statement is readable and well-documented. + +**Minor suggestions:** +- The `EverySevenSetHasTriangle` definition manually encodes distinctness (`a ≠ b ∧ a ≠ c ∧ b ≠ c`) and membership. Using Mathlib's `IsClique` or `IsNClique 3` for the triangle sub-condition on the subset would be more idiomatic, e.g., expressing it as the existence of a 3-element sub-finset `T ⊆ S` with `G.IsClique ↑T`. + +## 5. Formalizability + +**Well-formalizable.** The problem statement is precise and unambiguous: +- "Every set of 7 vertices contains a triangle" is a clear combinatorial predicate. +- $h(n)$ as the minimum clique number over all such graphs is well-defined. +- The asymptotic bounds with explicit constants $c_1, c_2, C_1, C_2$ and a threshold $N_0$ correctly formalize the $\ll$ notation. + +**One subtlety:** The problem on erdosproblems.com is phrased as a *question* ("do constants $c_1, c_2 > 0$ exist...?"), not as a conjecture asserting they do. The formalization asserts their existence as a theorem. Since the truth value is not known, an `answer(sorry) ↔ ...` formulation would more faithfully capture the open-question nature. However, the current formulation is a reasonable convention if the project treats open questions as conjectured to be true. + +## 6. Correctness + +**Mathematically correct with minor caveats.** + +- **Triangle condition:** Correctly captures "every 7-element subset contains a triangle" using explicit distinctness and adjacency. Checking only sets of exactly 7 elements is sufficient (any larger set contains a 7-element subset, inheriting the property). The number 7 matches the problem statement on the website. + +- **Clique number definition:** `graphCliqueNumber` using `sSup` over `{k | ∃ S, S.card = k ∧ G.IsClique ↑S}` is correct for finite graphs on `Fin n`. The set is non-empty (the empty set is a clique of size 0) and bounded above (by $n$), so `sSup` is well-behaved. + +- **$h(n)$ definition:** `erdos813H` using `sInf` on the image of `graphCliqueNumber` over qualifying graphs is correct. For any $n$, the set of qualifying graphs is non-empty (the complete graph satisfies the 7-vertex triangle property vacuously or by Ramsey), so `sInf` is well-defined. + +- **Main theorem:** The quantifier structure $\exists c_1 > 0, c_2 > 0, C_1 > 0, C_2 > 0, N_0, \forall n \ge N_0, \ldots$ correctly formalizes the asymptotic statement. Both the lower bound $C_1 \cdot n^{1/3 + c_1} \le h(n)$ and upper bound $h(n) \le C_2 \cdot n^{1/2 - c_2}$ are conjoined, which is the intended reading. + +- **AMS classification:** `AMS 5` should likely be `AMS 05` (combinatorics) for consistency with other problems in the codebase (e.g., Problem 61 uses `AMS 05`). + +**No mathematical incorrectness identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Custom `graphCliqueNumber` should use Mathlib's `cliqueNum` | +| Citations | Minor tag/year inconsistency in [Er91]; authorship attribution unclear | +| Variants | Missing solved variants for basic bounds and Bucić–Sudakov | +| Readability | Good; triangle sub-condition could use Mathlib idioms | +| Formalizability | Fully formalizable; question vs. assertion framing is a minor concern | +| Correctness | Mathematically correct | diff --git a/ai-review/814.md b/ai-review/814.md new file mode 100644 index 0000000000..0c5607c14f --- /dev/null +++ b/ai-review/814.md @@ -0,0 +1,55 @@ +# Review of Erdős Problem 814 + +## 1. Code Reuse + +No significant reuse opportunities identified. The formalization is a self-contained conjecture statement using standard Mathlib types (`SimpleGraph`, `Finset`, `Fin n`). The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/` directory contains graph invariants (domination numbers, degree properties, coloring) and `Balanced.lean` has degree-related definitions, but none provide abstractions that would simplify or replace any part of this statement. The minimum-degree-in-induced-subgraph condition is expressed inline via `S.filter`, which is appropriate for a one-off conjecture statement. + +## 2. Citations + +The formalization includes references `[EFRS90]`, `[Er91]`, `[MNS17]`, and `[Sa19]`, which match the website. However: + +- **Missing reference:** The website also lists **[Er93, p.344]** as a reference. This should be added to the docstring. +- **Incomplete bibliographic details:** The references in the docstring are abbreviated stubs (e.g., `[EFRS90] Erdős, P., Faudree, R., Rousseau, C., and Schelp, R.` with no title, journal, or year beyond the tag). This is consistent with the style used across the codebase, but the omission of `[Er93, p.344]` is a gap relative to the website. + +## 3. Variants + +The problem as stated on the website is a single conjecture without named variants. The formalization captures the full generality over all $k \geq 2$, which subsumes the original $k = 3$ case of Erdős–Hajnal. No variants appear to be missing. + +The progressive improvements (subgraphs on $n - c_k\sqrt{n}$ vertices by [EFRS90], $n - c_k n/\log n$ by [MNS17]) are weaker forms and are implied by the full conjecture. The quantitative bound $c_k \gg 1/k^3$ from Sauermann's proof is mentioned in the docstring but not formalized, which is appropriate since the conjecture is existential over $c_k$. + +## 4. Readability + +The code is clear and well-structured. Minor observations: + +- The docstring clearly states the mathematical content in both LaTeX and prose. +- The Lean statement closely mirrors the mathematical formulation, making it easy to verify by inspection. +- The use of `S.filter (fun w => G.Adj v w)` for counting neighbors in $S$ is idiomatic and readable. An alternative using `G.neighborFinset v ∩ S` (with `DecidableEq`) might be slightly more conventional in graph theory contexts, but the current formulation is perfectly clear and avoids extra typeclass requirements. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement is precise: it specifies exact numerical thresholds for the edge count, an existential constant $c_k > 0$, and a concrete structural conclusion (induced subgraph with bounded size and minimum degree). All quantifiers and conditions have unambiguous mathematical meaning. + +The only minor source of ambiguity is whether "for $n \geq k-1$" means the statement should hold for *all* $n \geq k-1$ or only *sufficiently large* $n$. The formalization chooses "sufficiently large $n$" (via `∃ N₀`), which is a standard and defensible interpretation — see Correctness below. + +## 6. Correctness + +**Overall: Correct with one minor deviation from the literal problem statement.** + +### What is correct: +- **Edge threshold:** `(k - 1) * (n - k + 2) + (k - 2).choose 2 + 1` correctly encodes $(k-1)(n-k+2) + \binom{k-2}{2} + 1$ for sufficiently large $n$ (where natural number subtraction `n - k` does not underflow). +- **Minimum degree condition:** `∀ v ∈ S, k ≤ (S.filter (fun w => G.Adj v w)).card` correctly captures "every vertex in $S$ has at least $k$ neighbors within $S$." Since `SimpleGraph.Adj` is irreflexive, `v` is never counted among its own neighbors, so this is the standard degree in the induced subgraph $G[S]$. +- **Size bound:** `(S.card : ℝ) ≤ (1 - c) * (n : ℝ)` correctly captures $|S| \leq (1 - c_k) n$ using real arithmetic to avoid natural number subtraction issues. +- **Nonemptiness:** `S.Nonempty` correctly excludes the trivial empty solution. +- **Answer:** `answer(True)` is correct — Sauermann [Sa19] proved the full conjecture. +- **Category:** `research solved` is accurate. + +### Minor deviation: +- **"Sufficiently large $n$" vs. "all $n \geq k-1$":** The original problem states the hypothesis for graphs with $n \geq k-1$ vertices, while the formalization uses `∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ →`. This weakens the literal statement but is mathematically inconsequential: for any fixed $k$ and $c_k > 0$, the finitely many small cases $k - 1 \leq n < N_0$ can be verified individually (or the conclusion may be vacuously true when the edge count exceeds $\binom{n}{2}$). The "sufficiently large" formulation also avoids potential natural number underflow in `n - k + 2` and is the form in which the result was actually proved. This is an acceptable modeling choice. + +### No issues found: +- The natural number arithmetic in the edge count is safe under the `n ≥ N₀` guard (assuming $N_0 \geq k$, which the prover is free to choose). +- The formalization does not conflate "induced subgraph" with "subgraph" — using the original graph's adjacency restricted to $S$ is exactly the induced subgraph. + +**Verdict:** The formalization is mathematically sound and faithfully captures the intended conjecture. The only actionable item is adding the missing `[Er93, p.344]` citation. diff --git a/ai-review/815.md b/ai-review/815.md new file mode 100644 index 0000000000..a6165e07a4 --- /dev/null +++ b/ai-review/815.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 815 + +**File:** `FormalConjectures/ErdosProblems/815.lean` + +--- + +## 1. Code Reuse + +**`cycleLengths` from Problem 751.** Problem 751 (`FormalConjectures/ErdosProblems/751.lean:40-41`) defines: +```lean +def cycleLengths {V : Type*} (G : SimpleGraph V) : Set ℕ := + {n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} +``` +The conclusion of `erdos_815` inlines the same pattern (`∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = k`). This could be rewritten as `k ∈ cycleLengths G` for consistency, though this would introduce a cross-file dependency. Since the definitions live in different namespaces and the pattern is short, inlining is defensible but worth flagging. + +**`edgeSet.ncard` vs `edgeFinset.card`.** The neighboring Problem 814 (`814.lean:62`) uses `G.edgeFinset.card` for edge counting on `SimpleGraph (Fin n)`, while 815 uses `G.edgeSet.ncard`. For finite graphs, both are equivalent, but `edgeFinset.card` is more idiomatic when `DecidableRel G.Adj` is available. The current formalization avoids requiring `DecidableRel G.Adj` by using `ncard`, which is a reasonable trade-off but differs from the convention in the adjacent problem. + +**Induced-subgraph degree pattern.** Problem 814 (`814.lean:66`) computes local degree as `(S.filter (fun w => G.Adj v w)).card`, while 815 uses `((↑S : Set (Fin n)) ∩ G.neighborSet v).ncard`. Both compute the same quantity (degree of `v` within vertex subset `S`). The 815 approach works at the `Set` level via `ncard`, while 814 works at the `Finset` level via `card`. Either is correct; the codebase is inconsistent on this point. + +## 2. Citations + +The formalization references **[NPS17]** (Narins, Pokrovskiy, Szabó) which matches the website. + +**Missing citation:** The website attributes the problem to **Erdős and Hajnal** and notes it appears in earlier work by **Erdős, Faudree, Gyárfás, and Schelp [EFGS88]**, who proved partial results (cycles of lengths 3, 4, 5, and length ≥ ⌊log₂ n⌋ exist, but cycles longer than √n need not). This [EFGS88] reference and the partial results are absent from the formalization's docstring. The full citation is: + +> Erdős, P., Faudree, R., Gyárfás, A., and Schelp, R., *Cycles in graphs with a given number of edges*, 1988. + +Adding this would give better context for the problem's history. + +## 3. Variants + +**Missing even-k variant.** Both the website and the module docstring (line 32) state: "It remains open whether the answer is affirmative when restricted to even k." However, no formal variant captures this. A natural addition would be: + +```lean +/-- It remains open whether every sufficiently large degree 3 critical graph + contains a cycle of every even length ≥ 4. -/ +@[category research open_problem, AMS 5] +theorem erdos_815.variants.even_cycle : + ∀ k : ℕ, k ≥ 2 → ∀ᶠ n in atTop, + ∀ (G : SimpleGraph (Fin n)), IsDegree3Critical G → + ∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = 2 * k := by + sorry +``` + +**Missing EFGS88 partial result.** The positive results from [EFGS88] (cycles of lengths 3, 4, 5 always exist; a cycle of length ≥ ⌊log₂ n⌋ exists; no cycle longer than √n is guaranteed) could be formalized as additional solved variants. + +## 4. Readability + +The code is generally clear and well-structured. A few observations: + +- **Good:** The `IsDegree3Critical` definition is separated out with its own docstring, making the main theorem statement clean. +- **Good:** The module docstring gives a self-contained problem statement with the disproof context. +- **Minor:** The docstring on `IsDegree3Critical` (line 41-42) says "every proper induced subgraph has a vertex of degree at most 2." This is correct but could be slightly more precise: "every proper induced subgraph has minimum degree at most 2" (matching the original problem statement wording). The current phrasing is equivalent but emphasizes the existential witness rather than the global property. +- **Minor:** The `open Filter SimpleGraph` on line 37 opens `Filter` for the `atTop` usage and `SimpleGraph` for `Walk`, `neighborSet`, etc. This is appropriate. + +## 5. Formalizability + +**Assessment: High.** The problem is precise and well-suited to formalization. + +- "Degree 3 critical" is a well-defined combinatorial property: a graph on n vertices with exactly 2n−2 edges such that every proper induced subgraph has minimum degree ≤ 2. +- "Contains a copy of C_k" (a cycle of length k) is standard. +- The only potential ambiguity is whether "sufficiently large" (in "let n be sufficiently large") means the threshold can depend on k. The formalization correctly captures this: for each k, there exists N₀ (implicitly, via `∀ᶠ n in atTop`) such that for all n ≥ N₀ the property holds. +- **No significant ambiguity** in the statement. + +## 6. Correctness + +**Overall: Correct.** The formalization faithfully captures the disproved conjecture. + +### Detailed analysis: + +**`IsDegree3Critical` definition (lines 43-46):** +- `G.edgeSet.ncard = 2 * n - 2`: Correctly counts edges. Note that `2 * n - 2` in `ℕ` underflows to 0 for n ∈ {0, 1}, but this is harmless since the theorem's `∀ᶠ n in atTop` restricts to sufficiently large n. +- `∀ S : Finset (Fin n), S.Nonempty → S ⊂ Finset.univ → ∃ v ∈ S, ((↑S : Set (Fin n)) ∩ G.neighborSet v).ncard ≤ 2`: This correctly encodes "every proper induced subgraph has minimum degree ≤ 2." The degree of vertex v in the induced subgraph on S is |S ∩ N_G(v)|, and requiring some v ∈ S to have this quantity ≤ 2 is equivalent to minimum degree ≤ 2. +- The `S.Nonempty` guard is logically appropriate (the empty induced subgraph trivially satisfies the condition, so excluding it neither helps nor hurts, but makes the statement cleaner). + +**Main theorem (lines 55-59):** +- `answer(False) ↔ P`: Under the `answer` convention, this asserts P is `False`. Since P is the conjecture ("for all k ≥ 3, sufficiently large degree 3 critical graphs contain C_k"), asserting it is False matches the disproof by NPS17. **Correct.** +- The cycle is expressed as `∃ (v : Fin n) (p : G.Walk v v), p.IsCycle ∧ p.length = k`: A closed walk that is a cycle with the right length. Mathlib's `Walk.IsCycle` requires the walk to be a trail (no repeated edges), visit each internal vertex exactly once, and have length ≥ 3. The `p.length = k` constraint then pins down the cycle length. **Correct.** + +**Potential concern — `IsCycle` length constraint:** Mathlib's `Walk.IsCycle` requires `p.length ≥ 3` (cycles must have at least 3 vertices). Since the theorem already requires `k ≥ 3`, this is consistent and not an issue. + +**No correctness flaws identified.** + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Minor | Could use `cycleLengths` from 751; `ncard` vs `card` inconsistency with 814 | +| Citations | Incomplete | Missing [EFGS88] reference and Erdős–Hajnal attribution | +| Variants | Incomplete | Even-k open problem not formalized; EFGS88 partial results not captured | +| Readability | Good | Clear structure; minor docstring wording suggestion | +| Formalizability | High | Unambiguous, well-suited to formalization | +| Correctness | Correct | Faithful encoding of the disproved conjecture; no mathematical flaws | diff --git a/ai-review/816.md b/ai-review/816.md new file mode 100644 index 0000000000..6d106a50af --- /dev/null +++ b/ai-review/816.md @@ -0,0 +1,90 @@ +# AI Review: Erdős Problem 816 + +## Summary + +Erdős Problem 816 (Erdős–Hajnal): Let $G$ be a graph with $2n+1$ vertices and $n^2+n+1$ edges. Must $G$ contain two vertices of the same degree which are joined by a path of length 3? Proved affirmatively by Chen and Ma. + +## 1. Code Reuse + +The formalization uses core Mathlib types (`SimpleGraph`, `Walk`, `IsPath`, `edgeSet`, `neighborSet`) directly, which is appropriate. However, `neighborSet.ncard` is used to express "same degree" when Mathlib provides a dedicated `SimpleGraph.degree` function (in `Mathlib.Combinatorics.SimpleGraph.Finite`, line ~190). Since the vertex type is `Fin (2 * n + 1)`, all finiteness instances are available, and using `G.degree v = G.degree w` would be more idiomatic than `(G.neighborSet v).ncard = (G.neighborSet w).ncard`. + +No relevant reusable definitions were found in `FormalConjecturesForMathlib` for this specific problem (it is a pure graph theory statement, not involving colorings, arithmetic progressions, or Ramsey numbers). + +## 2. Citations + +**Website (erdosproblems.com/816) states:** +- Posed by Erdős and Hajnal +- Reference: Er91 (Erdős, 1991) +- Solved by Chen and Ma (2025), cited as [ChMa25] + +**Formalization docstring states:** +- Correctly attributes the proof to Chen–Ma [ChMa25] +- Correctly describes the stronger result (all graphs with $2n+1$ vertices and $\geq n^2+n$ edges, except $K_{n,n+1}$, for $n \geq 600$) +- **Missing:** The original reference Er91 is not cited. The module docstring should include the Erdős 1991 reference for completeness. +- Hajnal is mentioned as co-poser in the module docstring but not in the theorem docstring. This is acceptable. + +## 3. Variants + +The module docstring describes the **stronger result** of Chen–Ma: for $n \geq 600$, all graphs with $2n+1$ vertices and $\geq n^2+n$ edges contain two vertices of the same degree joined by a path of length 3, with $K_{n,n+1}$ as the unique exception. This stronger variant is **not formalized** as a separate theorem. + +A formalization of the stronger variant could look like: + +```lean +theorem erdos_816_strong (n : ℕ) (hn : n ≥ 600) + (G : SimpleGraph (Fin (2 * n + 1))) + (hedge : G.edgeSet.ncard ≥ n ^ 2 + n) + (hnotK : ¬ G ≃g completeBipartiteGraph (Fin n) (Fin (n + 1))) : + ∃ v w : Fin (2 * n + 1), v ≠ w ∧ + G.degree v = G.degree w ∧ + ∃ p : G.Walk v w, p.IsPath ∧ p.length = 3 := by + sorry +``` + +This would more fully capture the state of the art. However, formalizing the "except $K_{n,n+1}$" part requires expressing graph isomorphism to a complete bipartite graph, which adds complexity. The omission is understandable. + +## 4. Readability + +**Good:** +- The module docstring is clear and well-structured, explaining both the original problem and the stronger result. +- The `answer(True) ↔` pattern clearly encodes the yes/no nature of the question. +- The `v ≠ w` condition correctly captures "two (distinct) vertices." + +**Suggestions:** +- Replace `(G.neighborSet v).ncard = (G.neighborSet w).ncard` with `G.degree v = G.degree w`. The `degree` function is the standard Mathlib way to express vertex degree and is immediately recognizable to anyone familiar with the library. +- Similarly, `G.edgeSet.ncard` could potentially use `G.edgeFinset.card` for consistency with the finite setting, though `ncard` is acceptable since it agrees with `card` on finite sets. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is a precise combinatorial question about finite graphs. Every concept involved—vertex count, edge count, vertex degree, and path of length 3—has a standard, unambiguous mathematical meaning that maps directly to existing Mathlib definitions. There is no ambiguity in the statement. + +The only minor point of interpretation is whether "path of length 3" means exactly 3 edges or at most 3 edges. In standard graph theory, "a path of length 3" means exactly 3 edges (visiting 4 vertices). The formalization correctly uses `p.length = 3`. + +## 6. Correctness + +**Assessment: Correct and mathematically faithful.** + +Detailed verification: + +| Aspect | Problem Statement | Formalization | Correct? | +|--------|------------------|---------------|----------| +| Vertex count | $2n+1$ | `Fin (2 * n + 1)` | ✓ | +| Edge count | $n^2+n+1$ | `G.edgeSet.ncard = n ^ 2 + n + 1` | ✓ | +| Same degree | two vertices of the same degree | `(G.neighborSet v).ncard = (G.neighborSet w).ncard` | ✓ (semantically correct, stylistically could use `degree`) | +| Distinct vertices | "two vertices" (implies distinct) | `v ≠ w` | ✓ | +| Path of length 3 | joined by a path of length 3 | `∃ p : G.Walk v w, p.IsPath ∧ p.length = 3` | ✓ | +| Answer | "Must G contain..." (yes) | `answer(True) ↔ ...` | ✓ | +| Quantification | "for all graphs" | `∀ n : ℕ, ∀ G : SimpleGraph (Fin (2 * n + 1)), ...` | ✓ | + +**Walk.length = 3** correctly means 3 edges (the walk constructor `cons` increments length by 1 per edge, and `nil` has length 0). Combined with `IsPath` (no repeated vertices), this is exactly a simple path through 4 distinct vertices connected by 3 edges. + +**ncard on edgeSet:** Since the vertex type `Fin (2*n+1)` is finite, `Sym2 (Fin (2*n+1))` is finite, and so every subset of it is finite. Thus `ncard` returns the true cardinality with no junk-value issues. + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the original Erdős–Hajnal problem as stated on erdosproblems.com. + +## Summary of Recommendations + +1. **Minor style improvement:** Use `G.degree v = G.degree w` instead of `(G.neighborSet v).ncard = (G.neighborSet w).ncard`. +2. **Citation:** Add the Er91 reference to the docstring. +3. **Optional enhancement:** Consider adding the stronger Chen–Ma variant as a separate theorem. diff --git a/ai-review/818.md b/ai-review/818.md new file mode 100644 index 0000000000..c84b3e209d --- /dev/null +++ b/ai-review/818.md @@ -0,0 +1,91 @@ +# Review: Erdős Problem 818 + +## 1. Code Reuse + +The formalization follows the same structural pattern as **Problem 52** (`ErdosProblems/52.lean`), which is the closely related Erdős–Szemerédi sum-product conjecture. Both use `Finset ℤ` with `open scoped Pointwise` to get `A + A` (sumset) and `A * A` (product set) operations, and both cast cardinalities to `ℝ` for the inequalities. The pattern of quantifiers (`∃ c > 0, ∀ A : Finset ℤ, ...`) is also shared. No helper definitions from `FormalConjecturesForMathlib/` are needed here since the statement is self-contained using Mathlib's `Finset` and `Pointwise` infrastructure directly. + +No additional code reuse opportunities were identified — the statement is compact and directly uses standard Mathlib primitives. + +## 2. Citations + +The formalization references: + +- **[Er91]** Erdős, P., *Some of my favourite problems in number theory, combinatorics, and geometry*. Resenhas do Instituto de Matemática e Estatística da Universidade de São Paulo (1991). +- **[So09d]** Solymosi, J., *Bounding multiplicative energy by the sumset*. Advances in Mathematics (2009). + +The website (erdosproblems.com/818) confirms: +- The problem is attributed to [Er91]. +- Resolution is by Solymosi [So09d] with the strengthened form |AA| ≫ |A|²/log|A|. +- The website also notes "See also Problem 52" (the sum-product conjecture), which is not mentioned in the formalization's docstring but is a relevant cross-reference. + +**Assessment:** Citations are accurate and complete. Consider adding a cross-reference to Problem 52 in the docstring (e.g., "See also [erdosproblems.com/52]"). + +## 3. Variants + +The formalization captures only the original question: existence of *some* C > 0. Solymosi's stronger result — that C = 1 works (i.e., |AA| ≫ |A|²/log|A|) — is mentioned in the docstring but is not formalized as a separate variant. + +**Suggested variant (Solymosi's theorem):** +```lean +@[category research solved, AMS 5 11] +theorem erdos_818.variants.solymosi : + ∀ K : ℝ, K > 0 → + ∃ c : ℝ, c > 0 ∧ + ∀ A : Finset ℤ, (A.card : ℝ) ≥ 2 → + ((A + A).card : ℝ) ≤ K * A.card → + ((A * A).card : ℝ) ≥ c * (A.card : ℝ) ^ 2 / Real.log (A.card : ℝ) := by + sorry +``` + +This would directly capture the "strong form" mentioned in the docstring. + +## 4. Readability + +The formalization is clean and readable. The quantifier structure is clear: + +- ∃ C > 0 (universal exponent) +- ∀ K > 0 (doubling constant) +- ∃ c > 0 (constant depending on K) +- ∀ A with |A| ≥ 2 and |A+A| ≤ K|A|: bound holds + +The `answer(True)` wrapper correctly indicates the problem is solved affirmatively. The docstring clearly states the mathematical content. + +**Minor suggestion:** The module docstring could mention the connection to Problem 52 (sum-product conjecture), as the website does. + +## 5. Formalizability + +The problem is fully formalizable with no ambiguity. The original statement uses asymptotic notation (≪ and ≫), which requires interpretation: + +- "|A+A| ≪ |A|" means |A+A| ≤ K|A| for some constant K — formalized as ∀ K > 0, with the hypothesis |A+A| ≤ K·|A|. +- "|AA| ≫ |A|²/(log|A|)^C" means |AA| ≥ c·|A|²/(log|A|)^C for some c > 0 — formalized with ∃ c > 0. + +The only potential ambiguity is whether "for some constant C > 0" means C is part of the existential claim or is given. The standard reading (and the one used here) is that C is existentially quantified — the question asks whether *some* C works. This is correctly captured. + +**Assessment:** No ambiguity. Fully formalizable. Rating: unambiguous. + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the original problem statement. + +**Detailed analysis:** + +- **Quantifier order** ∃C, ∀K, ∃c, ∀A is correct. The universal constant C does not depend on K, while the multiplicative constant c may depend on K (the doubling constant). This matches the mathematical meaning. +- **Guard condition** |A| ≥ 2 is appropriate: it ensures log(|A|) > 0, making the denominator (log|A|)^C positive so the bound is non-trivial. +- **Sumset/product set** semantics via `open scoped Pointwise` on `Finset ℤ` are correct: `A + A = {a + b | a ∈ A, b ∈ A}` and `A * A = {a * b | a ∈ A, b ∈ A}`. +- **answer(True)** correctly indicates the problem was resolved in the affirmative. +- **Division by (log|A|)^C**: Since |A| ≥ 2 implies log|A| > 0, and C > 0, the denominator is positive, so the inequality is well-formed over ℝ. +- **Category tag** `research solved` is correct per the website. + +**One subtle observation:** The formalization uses `Real.log` (natural logarithm). The original problem statement does not specify the base of the logarithm, but since different bases differ only by a constant factor, the choice of base is absorbed into the constant c. This is correct. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities missed; uses standard Pointwise/Finset | +| Citations | Accurate; could add cross-reference to Problem 52 | +| Variants | Solymosi's C=1 result should be added as a variant | +| Readability | Clean and well-structured | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/819.md b/ai-review/819.md new file mode 100644 index 0000000000..ec5790949c --- /dev/null +++ b/ai-review/819.md @@ -0,0 +1,84 @@ +# AI Review: Erdős Problem 819 + +## 1. Code Reuse + +The definition of `f` in 819.lean follows the same structural pattern as `maxQuasiSidonCard` in `ErdosProblems/840.lean`: both take a supremum over a filtered powerset of `Finset.Icc 1 N`. The infrastructure used (`Finset.powerset`, `Finset.Icc`, pointwise `A + A` via `open scoped Pointwise`, `Nat.sqrt`) is standard Mathlib and appropriate. + +No existing definition in `FormalConjecturesForMathlib` directly computes the same quantity, so `f` must be defined locally. However, the `IsSidon` and `IsQuasiSidon` definitions in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` and `ErdosProblems/840.lean` respectively are relevant companion definitions given the documented connection between the two problems. No refactoring for code reuse is needed. + +## 2. Citations + +The website (erdosproblems.com/819) lists two references: +- **[Er91]**: Erdős (1991) +- **[ErFr91]**: Erdős and Freud (1991) + +The formalization only cites **[ErFr91]** and omits **[Er91]**. The [Er91] reference should be added to the docstring for completeness. + +Additionally, the citation "[ErFr91] Erdős, P. and Freud, R." lacks a paper title, journal, and year. For consistency with other formalizations (e.g., 840.lean which includes the year), at minimum the year "1991" should be appended. + +**Suggested docstring citation block:** +``` +[Er91] Erdős, P., 1991. + +[ErFr91] Erdős, P. and Freud, R., 1991. +``` + +## 3. Variants + +The problem statement asks to "Estimate $f(N)$." The formalization captures: +- **Lower bound** (`erdos_819`): $f(N) \geq (3/8 - \varepsilon)N$ for large $N$. +- **Upper bound** (`erdos_819.variants.upper_bound`): $f(N) \leq (1/2 + \varepsilon)N$ for large $N$. + +These are the known bounds due to Erdős and Freud. + +**Missing variant**: There is no main open problem statement capturing the estimation question itself. Since the problem is marked **OPEN** on erdosproblems.com, one could formalize a main theorem asking for the exact asymptotic constant (analogous to how `erdos_840` uses `answer(sorry)` to ask for the limiting constant). For example, a statement of the form "there exists a constant $c$ such that $f(N) \sim cN$" or more precisely, "$f(N)/N \to c$" would capture the open question. However, it is unclear whether $f(N)/N$ even converges, and the problem may be asking for tighter bounds rather than an exact limit, so omitting this is defensible. + +The connection to quasi-Sidon sets (Problem 840) is documented in the module docstring, which is good. + +## 4. Readability + +The code is clean, well-structured, and readable. The docstrings clearly state the mathematical content. Minor suggestions: + +- The lower bound theorem is named `erdos_819` (without a `.variants` qualifier), while the upper bound is `erdos_819.variants.upper_bound`. For symmetry, the lower bound could be named `erdos_819.variants.lower_bound`, with a separate main `erdos_819` for the open estimation problem. Alternatively, the current naming is acceptable if the lower bound is considered the "primary" result. + +## 5. Formalizability + +The problem as stated is **precise and unambiguously formalizable**. All objects are well-defined: +- $A \subseteq \{1, \ldots, N\}$ is a finite set of natural numbers. +- $|A| = \lfloor N^{1/2} \rfloor$ is a cardinality constraint. +- $A + A$ is the Minkowski sumset. +- The intersection $(A + A) \cap [1, N]$ is concrete. +- The maximum over all such $A$ is well-defined (finite optimization). + +The o(1) bounds are standard asymptotic statements with unambiguous ε-N₀ formalizations. + +**Ambiguity level: None.** The only potential ambiguity is what "estimate" means for the open problem — whether it asks for exact asymptotics, tighter bounds, or the limit of $f(N)/N$. This ambiguity does not affect the formalized bounds. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed verification: + +- **Definition of `f`**: Takes `sup` over all $A \in \mathcal{P}(\{1,\ldots,N\})$ with $|A| = \lfloor\sqrt{N}\rfloor$, computing $|(A+A) \cap \{1,\ldots,N\}|$. This faithfully captures the problem statement. Note: `Finset.sup` on an empty finset returns `⊥ = 0` for `ℕ`, which is harmless since the theorems only concern sufficiently large $N$ (where $\lfloor\sqrt{N}\rfloor \geq 1$ and subsets of that size exist). + +- **`Nat.sqrt`** computes $\lfloor\sqrt{N}\rfloor$, matching the problem's $\lfloor N^{1/2}\rfloor$. ✓ + +- **Lower bound theorem**: For all $\varepsilon > 0$, eventually $f(N) \geq (3/8 - \varepsilon)N$. This correctly encodes $(3/8 - o(1))N \leq f(N)$. ✓ + +- **Upper bound theorem**: For all $\varepsilon > 0$, eventually $f(N) \leq (1/2 + \varepsilon)N$. This correctly encodes $f(N) \leq (1/2 + o(1))N$. ✓ + +- **Category tags**: Both theorems are tagged `category research solved`. The bounds themselves are proven results (Erdős–Freud 1991), so this is correct for these specific statements. However, the overall problem (estimating the exact asymptotics of $f(N)$) remains **open** per the website. This distinction is properly handled by having the bounds as solved variants rather than the main open problem. + +**One concern**: Both theorems are tagged `@[category research solved, AMS 5]`, but the primary `erdos_819` theorem name is used for the lower bound rather than reserved for the main open problem. If a future formalization of the open estimation question is added, the naming would need restructuring. + +**No mathematical errors detected.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | ✅ Appropriate; no redundancy | +| Citations | ⚠️ Missing [Er91]; [ErFr91] lacks year | +| Variants | ⚠️ Known bounds captured; open estimation question not formalized | +| Readability | ✅ Clean and clear | +| Formalizability | ✅ Fully unambiguous | +| Correctness | ✅ Mathematically correct | diff --git a/ai-review/820.md b/ai-review/820.md new file mode 100644 index 0000000000..bd2d56e6d6 --- /dev/null +++ b/ai-review/820.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 820 + +## 1. Code Reuse + +**Significant overlap with Problem 770.** The definition `Erdos770.h` in `FormalConjectures/ErdosProblems/770.lean` is closely related to `Erdos820.H`. Specifically: + +- `Erdos770.h(n) = 3` is mathematically equivalent to `Erdos820.H(n) = 3`, since both reduce to `gcd(2^n - 1, 3^n - 1) = 1`. +- The theorem `erdos_770.three` (`{n | h n = 3}.Infinite`) is equivalent to `erdos_820` Part 1 (`∀ N, ∃ n ≥ N, Nat.Coprime (2^n - 1) (3^n - 1)`). + +These should at minimum cross-reference each other. Ideally, one would prove the equivalence and have one defer to the other. + +The `sInf` pattern for `H` follows established conventions seen in `hypergraphRamsey`, `sizeRamsey`, `dominationNumber`, etc. No existing utility from `FormalConjecturesForMathlib` would simplify the definition beyond what's already used. + +## 2. Citations + +The formalization references only the URL `[erdosproblems.com/820](https://www.erdosproblems.com/820)`. + +The website lists the following references that should be included: +- **[Er74b]** — This is the primary reference and should be expanded to its full bibliographic form, consistent with how Problem 770 cites its references (e.g., author, title, journal, year). +- **Wouter van Doorn** is credited on the website for sketching a proof of the stronger lower bound `H(n) > exp(n^{c/log log n})` infinitely often. This attribution is not mentioned. +- **OEIS A263647** (values of n where `gcd(2^n - 1, 3^n - 1) = 1`) is listed as a related sequence and could be noted. +- **Related problem:** Problem 770 is listed as related on the website but not cross-referenced. + +## 3. Variants + +The website poses **three** questions. The formalization captures the first two but **misses the third**: + +1. ✅ Is `gcd(2^n - 1, 3^n - 1) = 1` infinitely often? (Part 1) +2. ✅ Lower bound on `H(n)` (Part 2) +3. ✅ Upper bound on `H(n)` (Part 3) +4. ❌ **Missing:** "Does a similar upper bound hold for the smallest `k` where `gcd(k^n - 1, 2^n - 1) = 1`?" — This is the "dual" question where the roles of `k` and `l` are swapped (fixing `l = 2` and varying `k`), and is explicitly asked on the website. + +Additionally, the website poses the lower and upper bounds as a **single joint question** asking whether there exists a single constant `c > 0` such that both bounds hold simultaneously. The formalization splits these into independent statements with potentially different constants, which is strictly weaker than the original (see §6). + +## 4. Readability + +The code is clean and readable. The docstrings clearly state the mathematical content. Minor suggestions: + +- The module docstring could include the sequence `H(n) = 3, 3, 3, 6, 3, 18, 3, 6, 3, 12` for `1 ≤ n ≤ 10` — it does, which is good. +- The equivalence between `H(n) = 3` and `gcd(2^n - 1, 3^n - 1) = 1` is correctly noted in the Part 1 docstring. + +## 5. Formalizability + +**High.** The problem is precisely stated and the formalization is straightforward. + +- The definition of `H(n)` via `sInf` is the natural Lean translation. +- The exponential/logarithmic bounds use `Real.exp` and `Real.log`, which are well-defined everywhere (with `Real.log` returning 0 for non-positive inputs). Division by `Real.log(Real.log(n))` when `n` is small (where `log log n ≤ 0`) produces degenerate values, but the quantifier structure ("infinitely many" / "for all sufficiently large") ensures these edge cases are harmless. +- The `answer(sorry)` pattern is used appropriately for open problems. + +**Ambiguity:** The website's statement "there exist `k < l`" does not explicitly require `k ≥ 2`, but this constraint is necessary to match the given sequence (without it, `k = 1` would yield `H(1) = 2` rather than 3). The formalization correctly adds `2 ≤ k` and `2 ≤ l`. This is an implicit convention in the source that the formalization makes explicit — a good choice. + +## 6. Correctness + +### Definition of `H(n)` — Correct +The definition faithfully captures the smallest `l ≥ 2` such that some `k ∈ [2, l)` has `gcd(k^n - 1, l^n - 1) = 1`. The use of natural number subtraction is safe here since `k ≥ 2` and `l ≥ 2` ensure `k^n ≥ 2` and `l^n ≥ 2` for `n ≥ 1`, so `k^n - 1 ≥ 1`. For `n = 0`, `k^0 - 1 = 0` and `gcd(0, 0) = 0 ≠ 1`, so the set is empty and `sInf` returns 0 — a harmless edge case. + +### Part 1 — Correct +The statement `∀ N, ∃ n ≥ N, Nat.Coprime (2^n - 1) (3^n - 1)` correctly captures "infinitely many `n`" with `gcd(2^n - 1, 3^n - 1) = 1`. + +### Parts 2 and 3 — Mathematically Weakened +**Issue:** The website asks whether there exists a **single** constant `c > 0` satisfying both the lower bound (infinitely often) and the upper bound (eventually). The formalization separates these into two independent `∃ c` statements: + +- `erdos_820.variants.lower_bound`: `∃ c > 0, ∀ ε > 0, ∀ N, ∃ n ≥ N, H(n) > exp(n^{(c-ε)/log log n})` +- `erdos_820.variants.upper_bound`: `∃ c > 0, ∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, H(n) < exp(n^{(c+ε)/log log n})` + +The original question is whether the **same** `c` works for both. This is a stronger assertion (it pins down the asymptotic growth rate of `H(n)` to a precise exponential scale) and is the actual content of the conjecture. The split formalization could be satisfied by two different constants, which would not answer the original question. **This should be fixed**, either by combining them into a single statement or by adding a combined variant. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| `H(n)` definition | ✅ Correct | +| Part 1 (coprimality infinitely often) | ✅ Correct | +| Part 2 (lower bound) | ⚠️ Correct in isolation, but split from joint question | +| Part 3 (upper bound) | ⚠️ Correct in isolation, but split from joint question | +| Joint bound with single `c` | ❌ Not captured | +| Dual question (smallest `k` vs fixed `l = 2`) | ❌ Missing variant | +| Cross-reference with Problem 770 | ❌ Missing | +| Full citation of [Er74b] | ❌ Missing | diff --git a/ai-review/821.md b/ai-review/821.md new file mode 100644 index 0000000000..364b5da019 --- /dev/null +++ b/ai-review/821.md @@ -0,0 +1,95 @@ +# Review of Erdős Problem 821 + +## 1. Code Reuse + +The formalization defines `totientPreimageCount` locally: + +```lean +noncomputable def totientPreimageCount (n : ℕ) : ℕ := + Nat.card {m : ℕ // 0 < m ∧ Nat.totient m = n} +``` + +Several other problems in the codebase work with the totient preimage in different ways: + +- **Problem 694** (`ErdosProblems/694.lean`) uses `Nat.totient ⁻¹' {n}` directly (as a `Set ℕ`) and works with `IsGreatest`/`IsLeast` on that set. It also includes a Carmichael-style variant asking about uniqueness of solutions to φ(m) = n. +- **Problem 416** (`ErdosProblems/416.lean`) checks `∃ (m : ℕ), m.totient = n` via a `Finset.filter`. +- **CarmichaelTotient** (`Wikipedia/CarmichaelTotient.lean`) defines `CarmichaelTotientFor n` as `∃ m : ℕ, m ≠ n ∧ φ m = φ n`. + +None of these define a *count* of the totient preimage in the same way as 821. The `totientPreimageCount` definition is purpose-built and appropriate. A shared definition could be factored into a utility module if more problems needed the exact count, but currently 821 is the only problem that needs `|φ⁻¹(n)|` as a natural number. No action needed, but if a shared totient utilities module is ever created, this definition would be a candidate for extraction. + +**No FormalConjecturesForMathlib definitions** were found that could replace this. + +## 2. Citations + +The website (erdosproblems.com/821) lists the following references: + +| Ref | Description | In formalization? | +|-----|-------------|-------------------| +| **[Er74b]** | Original problem statement | Yes (theorem docstring) | +| **[Er35b]** | Erdős proved ∃ c > 0 with g(n) > n^c for infinitely many n | Yes (module docstring) | +| **[Li22]** | Lichtman (2022), best known bound g(n) > n^{0.71568…} | Yes (module docstring) | +| **[BaHa98]** | Baker & Harman (1998), previous exponent improvements | No | +| **[LuPo11]** | Luca & Pollack (2011), average size of g(n) | No | + +The website also notes: +- Related to **Problem #416** (not mentioned in formalization) +- Related OEIS sequence: **A014197** (not mentioned in formalization) +- A related conjecture about smooth prime factors of p−1 (not formalized) + +**Assessment:** The core citations ([Er74b], [Er35b], [Li22]) and Pillai's result are all properly documented. The omission of [BaHa98] and [LuPo11] is acceptable since those are ancillary results not directly tied to the conjecture statement. Adding a note about the relationship to Problem #416 would be a minor improvement. + +## 3. Variants + +The website mentions one notable related conjecture: + +> The main problem would follow if, for every ε > 0, approximately x/(log x) primes p < x existed where all prime factors of p−1 are less than p^ε. + +This "smooth primes" variant is **not captured** in the formalization. It is a sufficient condition for 821, not a separate conjecture of Erdős, so its omission is defensible. However, formalizing it as a variant (e.g., `erdos_821.variants.smooth_primes_sufficient`) would add mathematical context. + +No other variants are mentioned on the website. + +## 4. Readability + +The code is clean and well-structured: +- The module docstring clearly states the problem, attributes results to Pillai, Erdős, and Lichtman, and provides the best known bound. +- The `totientPreimageCount` helper has a clear docstring. +- The theorem statement is concise and directly mirrors the mathematical formulation. +- The namespace `Erdos821` is used consistently. + +**No readability issues identified.** + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. The statement "Is it true that for every ε > 0, there exist infinitely many n such that g(n) > n^{1−ε}?" is a precise mathematical question with: +- A well-defined function g(n) = |{m ∈ ℕ⁺ : φ(m) = n}| +- A clear quantifier structure: ∀ε > 0, the set {n : g(n) > n^{1−ε}} is infinite +- A yes/no answer (captured by the `answer(sorry) ↔ ...` pattern) + +**Ambiguity: None.** This is a clean, unambiguous number-theoretic question. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Definition correctness +`totientPreimageCount n = Nat.card {m : ℕ // 0 < m ∧ Nat.totient m = n}` correctly counts positive integers m with φ(m) = n. The restriction `0 < m` is appropriate since: +- `Nat.totient 0 = 0` in Mathlib (by convention), so excluding m = 0 avoids a spurious preimage element for n = 0. +- The standard number-theoretic convention is to count over positive integers. + +### Finiteness of the preimage +For any fixed n, the set {m ∈ ℕ⁺ : φ(m) = n} is finite (since φ(m) → ∞ as m → ∞; specifically φ(m) ≥ √(m/2) for m > 6). Therefore `Nat.card` returns a well-defined finite value, and the cast `(totientPreimageCount n : ℝ)` behaves as expected. This is important because `Nat.card` returns 0 for infinite types, which could silently produce incorrect results — but that issue does not arise here. + +### Statement correctness +```lean +∀ ε : ℝ, ε > 0 → + Set.Infinite {n : ℕ | (totientPreimageCount n : ℝ) > (n : ℝ) ^ (1 - ε)} +``` +This exactly captures "for every ε > 0, infinitely many n satisfy g(n) > n^{1−ε}." The use of `Set.Infinite` over natural numbers is the standard way to express "infinitely many n" in this codebase. + +### Edge case: n = 0 +When n = 0: `totientPreimageCount 0 = 0` (no positive m has φ(m) = 0), and `(0 : ℝ) ^ (1 - ε) = 0` for 0 < ε < 1 (using Lean/Mathlib's convention for `0 ^ r` with positive real exponent). So `0 > 0` is false, and n = 0 is correctly excluded from the set. + +### The `answer(sorry)` wrapper +The `answer(sorry) ↔ ...` pattern correctly models this as a yes/no open question. The conjecture is widely *expected* to be true, but the formalization correctly does not assume the answer. + +**No mathematical flaws identified. The formalization is complete and correct.** diff --git a/ai-review/823.md b/ai-review/823.md new file mode 100644 index 0000000000..760c73d937 --- /dev/null +++ b/ai-review/823.md @@ -0,0 +1,76 @@ +# AI Review: Erdős Problem 823 + +## 1. Code Reuse + +**Issue found.** The file defines a custom `Nat.sumDivisors`: + +```lean +noncomputable def Nat.sumDivisors (n : ℕ) : ℕ := ∑ d ∈ n.divisors, d +``` + +This is redundant. Mathlib provides `Nat.ArithmeticFunction.sigma` (accessed as `σ k n`), where `σ 1 n = ∑ d ∈ n.divisors, d`. At least 32 other files in this codebase already use `σ 1` via `open scoped ArithmeticFunction.sigma` — including nearby problems like 409, 410, 250, 277, 418, and notably **830** which deals with very similar subject matter. The adjacent problem **824** also defines its own local `sumDivisors`, compounding the duplication. + +**Recommendation:** Remove the custom `Nat.sumDivisors` definition and replace it with `σ 1` from Mathlib. Add `open scoped ArithmeticFunction.sigma` and `open Nat.ArithmeticFunction` to align with codebase conventions. + +Note: `σ 1` has return type `ℕ` (via `ArithmeticFunction ℕ`), so it is a drop-in replacement. The `noncomputable` annotation on the custom definition is also unnecessary (the Mathlib version and the local sum are both computable — indeed, problem 824 defines the same function without `noncomputable`). + +## 2. Citations + +The formalization includes three citation tags: `[Er59c]`, `[Er74b]`, and `[Po15b]`. Comparing against the [erdosproblems.com/823](https://www.erdosproblems.com/823) page: + +- **[Er59c]** — Present on the website. The formalization gives no bibliographic detail. The full reference (from problem 824 and the website) is: Erdős, P., *Remarks on number theory II. Some problems on the σ function*. Acta Arith. 5 (1959), 171–177. +- **[Er74b]** — Present on the website. Full reference: Erdős, P., *On abundant-like numbers*. Canad. Math. Bull. 17 (1974), 599–602. The website also notes Erdős remarked that "it is easy to prove the analogous result for φ(n)" — this context is absent from the formalization. +- **[Po15b]** — Present on the website as the solver. No full bibliographic detail is given in the formalization. The full reference should be: Pollack, P., *Remarks on fibers of the sum-of-divisors function*. 2015. + +**Recommendation:** Expand citation tags to full bibliographic references in the docstring, consistent with how problem 824 handles citations for the same references. + +## 3. Variants + +**Missing variant.** The erdosproblems.com page notes that Erdős observed "it is easy to prove the analogous result for φ(n)" (Euler's totient function). This is a natural variant of the problem: for every α ≥ 1, there exist sequences nₖ, mₖ of positive integers with nₖ/mₖ → α and φ(nₖ) = φ(mₖ). This variant is not captured in the formalization. + +Mathlib provides `Nat.totient` for the Euler totient function, so a variant statement would be straightforward to add. + +## 4. Readability + +The formalization is clean and readable. Minor observations: + +- The namespace `Erdos823` is clear. +- The docstring accurately describes the problem and its resolution. +- The use of `answer(True)` correctly encodes the affirmative resolution. +- One small readability note: the sequences are called `n` and `m`, which shadow common Lean identifiers. This is acceptable within the namespace but could cause confusion if the file were extended. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem asks a precise yes/no question about the existence of sequences satisfying explicit conditions involving the sum-of-divisors function and a limit of ratios. All concepts involved (σ, positivity, real-valued limits, ratios) have well-established Mathlib counterparts. The problem has a clean, definitive answer (yes, proved by Pollack), and the formalization captures the exact mathematical content. + +There is no ambiguity in the original statement. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed assessment: + +- **Positivity constraints:** The formalization requires `0 < n k` and `0 < m k` for all k, which correctly enforces that the sequences consist of positive integers (as stated in the problem). This also ensures the ratio `(n k : ℝ) / (m k : ℝ)` is well-defined. +- **σ equality:** `Nat.sumDivisors (n k) = Nat.sumDivisors (m k)` correctly captures σ(nₖ) = σ(mₖ). (Modulo the code-reuse issue — the math is correct regardless of which definition is used.) +- **Limit:** `Tendsto (fun k => (n k : ℝ) / (m k : ℝ)) atTop (nhds α)` correctly formalizes nₖ/mₖ → α. +- **Domain of α:** The constraint `α ≥ 1` matches the problem statement. +- **answer(True):** Correctly reflects that Pollack proved the answer is yes. +- **Quantifier structure:** The statement `∀ α ≥ 1, ∃ (n m : ℕ → ℕ), ...` correctly captures "for every α ≥ 1, there exist sequences..." + +**Minor note on the original problem statement vs. formalization:** The erdosproblems.com page says "a sequence of integers nₖ, mₖ" without explicitly requiring positivity, but since σ is defined on positive integers (σ(0) = 0 is a degenerate case), the positivity requirement is a natural and correct formalization choice. + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | **Needs fix** — replace custom `Nat.sumDivisors` with Mathlib's `σ 1` | +| Citations | **Needs improvement** — expand shorthand tags to full bibliographic references | +| Variants | **Missing** — φ(n) analogue noted by Erdős is not captured | +| Readability | Good | +| Formalizability | Unambiguous, clearly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/824.md b/ai-review/824.md new file mode 100644 index 0000000000..24442a6f64 --- /dev/null +++ b/ai-review/824.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 824 + +## 1. Code Reuse + +**Issue found.** The file defines its own `sumDivisors` function: + +```lean +def sumDivisors (n : ℕ) : ℕ := ∑ d ∈ n.divisors, d +``` + +Mathlib provides `Nat.ArithmeticFunction.sigma` (used via `open scoped ArithmeticFunction.sigma` as `σ 1 n`), which computes the same thing. Several other files in the codebase already use it: + +- `FormalConjectures/ErdosProblems/825.lean` — uses `σ 1 n` +- `FormalConjectures/Wikipedia/BetrothedNumbers.lean` — uses `σ 1 n` +- `FormalConjectures/OEIS/56777.lean` — uses `σ 1 n` +- `FormalConjectures/OEIS/63880.lean` — uses `σ 1 n` +- `FormalConjectures/ErdosProblems/277.lean` — uses `ArithmeticFunction.sigma` + +Additionally, `FormalConjectures/ErdosProblems/823.lean` defines an essentially identical function `Nat.sumDivisors` in its own namespace. Both 823 and 824 should use Mathlib's `σ 1` instead of rolling their own. + +## 2. Citations + +The formalization's citations are close but could be improved to match the website: + +| Formalization | Website | +|---|---| +| `[Er59c]` with full title and journal info | `[Er59c, p.172]` — page number missing from formalization | +| `[Er74b]` with full title and journal info | `[Er74b, p.202]` — page number missing from formalization | +| `[PoPo16]` with full title and journal info | `[PoPo16]` — matches | + +The formalization actually includes *more* detail than the website (full titles and journal info), which is good. The page numbers from the website (`p.172`, `p.202`) could optionally be added for precision. + +## 3. Variants + +**Missing variant.** The website documents a variant suggested by Weisenberg: + +> A weaker restriction: no proper factors $u \mid a$ and $v \mid b$ exist such that $\sigma(u) = \sigma(v)$ and $(u, a/u) = (v, b/v) = 1$. + +This variant is not captured in the formalization. It could be formalized as a separate theorem or variant statement. + +## 4. Readability + +The code is reasonably readable. Minor suggestions: + +- The `erdos824_h` definition uses a product finset with a multi-condition filter. This is idiomatic but dense. The docstring adequately explains what `h(x)` counts. +- The namespace `Erdos824` is appropriately scoped. +- The local `sumDivisors` definition has a clear docstring. + +No significant readability issues. + +## 5. Formalizability + +**High formalizability.** The problem is fully precise: + +- $h(x)$ has an unambiguous combinatorial definition (count pairs with specific properties). +- The sum-of-divisors function $\sigma$ is standard. +- The conjecture "$h(x) > x^{2-o(1)}$" has a standard analytic interpretation: for every $\varepsilon > 0$, $h(x) > x^{2-\varepsilon}$ for all sufficiently large $x$. + +There is no ambiguity in the statement. The only potential subtlety is the precise meaning of $o(1)$ in the exponent, but the formalization correctly interprets this via the $\forall \varepsilon > 0$ quantification. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **`sumDivisors`**: Correctly computes $\sigma(n) = \sum_{d \mid n} d$ using `Nat.divisors`. ✓ +- **`erdos824_h`**: Uses `Finset.range x` which gives $\{0, 1, \ldots, x-1\}$. The filter requires `0 < p.1` (so $a \geq 1$), `p.1 < p.2` (so $a < b$), and both elements are in `range x` (so $a, b < x$). Combined: $1 \leq a < b < x$. This matches the problem statement "$1 \leq a < b < x$". ✓ +- **Coprimality**: `Nat.Coprime p.1 p.2` correctly encodes $(a, b) = 1$. ✓ +- **Equal $\sigma$ values**: `sumDivisors p.1 = sumDivisors p.2` correctly encodes $\sigma(a) = \sigma(b)$. ✓ +- **Main conjecture**: The statement $\forall \varepsilon > 0,\; \exists X_0,\; \forall x \geq X_0,\; h(x) > x^{2 - \varepsilon}$ is the correct formalization of $h(x) > x^{2 - o(1)}$. ✓ +- **`answer(sorry)`**: Correctly reflects that this is an open problem. ✓ +- **Category tag**: `category research open` matches the website status (open). ✓ + +No mathematical errors found. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Should use Mathlib's `σ 1` instead of custom `sumDivisors` | +| Citations | Good; could add page numbers `p.172`, `p.202` | +| Variants | Missing Weisenberg variant | +| Readability | Good | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/827.md b/ai-review/827.md new file mode 100644 index 0000000000..7ae2b90fec --- /dev/null +++ b/ai-review/827.md @@ -0,0 +1,71 @@ +# AI Review: Erdős Problem 827 + +## 1. Code Reuse + +Several opportunities for reuse exist: + +- **`InGeneralPosition`** (827, line 38) is identical in structure to **`NoThreeCollinear`** in `ErdosProblems/831.lean` (line 35). Both define "no three collinear" the same way over `Finset (EuclideanSpace ℝ (Fin 2))`. One shared definition would reduce duplication. + +- **`NonTrilinear`** in `FormalConjecturesForMathlib/Geometry/2d.lean` (line 54) provides a more elegant, idiomatic formulation using `Set.Triplewise`. It is defined on `Set P` rather than `Finset`, which is more general. Problem 827 could coerce its finset to a set and use `NonTrilinear` instead. + +- **`circumradius`** (827, line 46) is defined via Heron's formula. Problem 831 takes a different approach, defining `distinctCircumradiiCount` (line 60) using an existential center/radius formulation. The Heron-based definition in 827 is self-contained but not shared. A shared circumradius utility in `FormalConjecturesForMathlib/Geometry/2d.lean` would benefit both problems. + +## 2. Citations + +The formalization's docstring (line 67) references **[Er75h, Er78c, Er92e]**. The website ([erdosproblems.com/827](https://www.erdosproblems.com/827)) lists: + +- **[Er75h]**: Erdős originally asked whether $n_k$ exists. ✅ Matches. +- **[Er78c]**: Erdős gave an argument proving existence. ✅ Matches. +- **[MaRo15]**: Martinez and Roldán-Pensado corrected Erdős's argument and proved $n_k \ll k^9$. ✅ Referenced in the module docstring (line 30) but **not** in the theorem docstring. +- **[Er92e]**: Referenced in the theorem docstring but **not listed on the website**. This citation should be verified or removed. +- **Mark Sellke** is credited on the website but not mentioned in the formalization. + +**Issues:** +- `[Er92e]` appears in the theorem docstring but is absent from the website — needs verification. +- `[MaRo15]` should be included in the theorem-level docstring alongside `[Er75h]` and `[Er78c]`. + +## 3. Variants + +The website states the problem as: **"Determine $n_k$"** — i.e., find the exact growth rate of $n_k$, not merely prove its existence. + +The formalization (`erdos_827`, line 77) captures only the **existence** of $n_k$: for every $k \geq 3$, there exists $n$ such that any $n$ points in general position contain a $k$-subset with all-distinct circumradii. + +**Missing variants:** +- **Upper bound**: The known bound $n_k \ll k^9$ (Martinez–Roldán-Pensado) could be formalized as a strengthening, e.g., `∃ C, ∀ k ≥ 3, n_k ≤ C * k^9`. This would be a natural companion theorem. +- **Lower bound / exact asymptotics**: The open part of the problem — determining the true growth rate of $n_k$ — is not captured. A variant stating a conjectured lower bound (if one exists in the literature) would make the formalization more complete. +- **Erdős's original (incorrect) bound**: $n_k \leq k + 2\binom{k-1}{2}\binom{k-1}{3}$ from [Er78c] is mentioned on the website but not in the formalization. + +## 4. Readability + +The code is generally well-structured and readable. Suggestions: + +- The `AllDistinctCircumradii` definition (line 58) uses six nested `∀ ... ∈ S` quantifiers plus seven conditions. This is correct but dense. A refactoring using `Finset.powersetCard 3` to iterate over 3-element subsets would be more concise and closer to the mathematical statement ("all $\binom{k}{3}$ triples"). +- The `circumradius` docstring (line 42) clearly explains the formula. Good. +- The module docstring (line 19) provides helpful context about the history of the problem. Good. + +## 5. Formalizability + +The problem as stated on the website ("Determine $n_k$") is somewhat ambiguous — it asks for a characterization rather than a specific bound, making it hard to formalize completely. However, the existence statement formalized in `erdos_827` is **fully precise and unambiguously formalizable**. + +The key definitions — general position (no three collinear), circumradius, and all-distinct circumradii — are standard and well-defined. The formalization handles the degenerate case (collinear points, where `circumradius` returns 0) correctly: since the hypothesis `InGeneralPosition P` ensures no three points of `P` are collinear, the `area_sq > 0` branch is always taken for valid inputs. + +**Ambiguity assessment: Low.** The existence portion is precise. The full "determine $n_k$" problem is inherently open-ended. + +## 6. Correctness + +### Mathematically correct aspects: + +- **`InGeneralPosition`**: Correctly captures "no three collinear" by checking all 3-element subsets. ✅ +- **`circumradius`**: The Heron-based formula $R = \frac{abc}{4\sqrt{s(s-a)(s-b)(s-c)}}$ is the standard circumradius formula. The function is symmetric under permutations of its arguments (since distances $a, b, c$ form a symmetric multiset under reordering of $p_1, p_2, p_3$, and $s$, $s(s-a)(s-b)(s-c)$, and $abc$ are all symmetric functions). ✅ +- **`AllDistinctCircumradii`**: Correctly uses `Finset` equality `{a, b, c} ≠ {d, e, f}` to compare *unordered* triples, which aligns with the mathematical meaning ("different triples determine different circumradii"). The distinctness conditions (`a ≠ b`, etc.) ensure each triple is a genuine 3-element set. ✅ +- **`erdos_827` statement**: Correctly states that for every $k \geq 3$, there exists $n$ such that any set of $\geq n$ points in general position contains a $k$-subset with all-distinct circumradii. ✅ + +### Potential issues: + +- **Problem status tag**: The formalization is tagged `category research solved` (line 76). The website marks the problem as **OPEN**. This discrepancy arises because the formalization captures only the existence result (which is indeed solved), while the full problem of determining $n_k$ remains open. The tag is technically accurate for what is formalized, but could mislead readers into thinking the full problem is resolved. Consider adding a comment or a separate `open` variant for the determination question. + +- **AMS classification**: Tagged `AMS 5 51` (Geometry). The website tags it `[geometry]`, which is consistent. However, `AMS 52` (Convex and discrete geometry) as used in Problem 831 might be more precise. + +### Summary + +The formalization is **mathematically correct and sound** for the existence statement it captures. Its main limitation is **incompleteness**: it formalizes the solved existence portion but not the open problem of determining the growth rate of $n_k$. No mathematical errors were identified in the definitions or theorem statement. diff --git a/ai-review/829.md b/ai-review/829.md new file mode 100644 index 0000000000..3272166ed9 --- /dev/null +++ b/ai-review/829.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 829 + +## 1. Code Reuse + +**Issue found.** The formalization defines its own `sumOfTwoCubesRepr` function from scratch using `Finset.range` and `filter`, but the codebase already has a general-purpose convolution infrastructure in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`: + +- `AdditiveCombinatorics.sumConv` — the sum convolution `(f ∗ g)(n) = ∑_{a+b=n} f(a)·g(b)` +- `AdditiveCombinatorics.sumRep` — exactly `1_A ∗ 1_A` for a set `A` + +At least 6 other Erdős problems (28, 40, 66, 749, 863, 864) already use `sumRep`/`sumConv`. Problem 829 could define `A := {m : ℕ | ∃ k ≥ 1, k ^ 3 = m}` (the set of positive cubes) and then use `sumRep A n` instead of the bespoke `sumOfTwoCubesRepr`. This would: +- Eliminate the custom definition entirely +- Make the connection to the $1_A * 1_A$ notation in the problem statement explicit +- Enable reuse of existing lemmas like `sumRep_def` and `sumRep_eq_powerSeries_coeff` + +## 2. Citations + +The citations in the docstring match the website: + +| Formalization | Website | Status | +|---|---|---| +| `[Er83]` | [Er83] (original source) | **Match** | +| `Mordell proved that...` | Same statement | **Match** | +| `Mahler [Ma35b]` | Mahler [Ma35b] | **Match** | +| `Stewart [St08]` | Stewart [St08] | **Match** | + +The website does not provide full bibliographic details for the references beyond these shorthand codes, so the formalization's use of shorthand references is consistent. No discrepancies. + +## 3. Variants + +The website states a single problem: Is $1_A * 1_A(n) \ll (\log n)^{O(1)}$? There are no additional variants listed. The formalization captures this faithfully as a single conjecture. **No missing variants.** + +## 4. Readability + +The code is reasonably readable. Suggestions: + +- **Use `sumRep`**: As noted above, replacing the custom definition with the standard library's `sumRep` would immediately communicate the mathematical intent (convolution of indicator functions) to readers familiar with the codebase. +- **Range expression**: The current `((Finset.range n).product (Finset.range n)).filter (...)` is somewhat verbose. Using `antidiagonal` (as `sumRep` does) would be more idiomatic for expressing pairs summing to a given value. +- The docstring and module doc are clear and well-written. + +## 5. Formalizability + +**High formalizability; low ambiguity.** The problem is stated precisely: + +- The set A (cubes) is unambiguous. +- The convolution $1_A * 1_A(n)$ has a standard definition. +- The asymptotic bound $\ll (\log n)^{O(1)}$ has a clear mathematical meaning: $\exists C, k > 0, N_0$ such that $\forall n \geq N_0$, the count is $\leq C (\log n)^k$. + +The only minor ambiguity is whether "cubes" includes $0^3 = 0$, but this affects the count by at most 2 (when $n$ is itself a perfect cube) and is therefore irrelevant to the asymptotic conjecture. The formalization resolves this by requiring positive cubes ($a \geq 1, b \geq 1$), which is a reasonable choice. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Definition correctness**: `sumOfTwoCubesRepr n` counts ordered pairs $(a, b)$ with $a \geq 1$, $b \geq 1$, $a^3 + b^3 = n$, over the range $\{0, \ldots, n-1\}$. The range is sufficient: if $a^3 + b^3 = n$ and $a, b \geq 1$, then $a^3 \leq n - 1 < n$, so $a < n$, and similarly for $b$. All valid pairs are counted. + +- **Ordered vs. unordered pairs**: The convolution $1_A * 1_A(n)$ counts ordered pairs by definition. The formalization also counts ordered pairs. These are consistent. + +- **Theorem statement**: The existential $\exists C > 0, \exists k > 0, \exists N_0, \forall n \geq N_0, \text{count} \leq C \cdot (\log n)^k$ correctly formalizes $\ll (\log n)^{O(1)}$. + +- **Logarithm base**: `Real.log` is the natural logarithm. Since $\log_a n = \log_b n / \log_b a$, the choice of base only affects the constant $C$, so this is correct. + +- **`answer(sorry)` usage**: Appropriate for an open problem where the true answer is unknown. + +- **One subtlety**: The bound $C \cdot (\log n)^k$ is non-negative for $n \geq 1$ (since $\log n \geq 0$ for $n \geq 1$ in the natural log), and the count is a natural number cast to $\mathbb{R}$. The statement is vacuously satisfiable for $n = 0$ since $N_0$ can exclude it. No issues here. + +**No mathematical flaws identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Improvement available** — should use `sumRep` from Convolution.lean | +| Citations | **Correct** — matches website | +| Variants | **Complete** — no missing variants | +| Readability | **Good** — would improve with `sumRep` | +| Formalizability | **High** — unambiguous problem | +| Correctness | **Correct** — faithful formalization | diff --git a/ai-review/83.md b/ai-review/83.md new file mode 100644 index 0000000000..fba4a5b7be --- /dev/null +++ b/ai-review/83.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 83 + +## 1. Code Reuse + +Several files in the codebase define related intersection-family concepts that could potentially be reused: + +- **Problem 701** (`ErdosProblems/701.lean`): Defines `IsIntersectingFamily` and `IsDownwardClosed` for general families. +- **Problem 21** (`ErdosProblems/21.lean`): Defines `IsIntersectingNFamily` for uniform intersecting families. +- **Problem 836** (`ErdosProblems/836.lean`): Defines `Hypergraph.IsIntersecting` and `Hypergraph.IsUniform` for hypergraphs. +- **Problem 703** (`ErdosProblems/703.lean`): Defines forbidden-intersection families using `(A ∩ B).card`. + +However, none of these are directly applicable to Problem 83, which requires a *t-intersecting* condition (`|A ∩ B| ≥ 2`) rather than just a 1-intersecting/nonempty condition. The current inline approach — stating the conditions directly in the theorem hypotheses — is appropriate for a single self-contained theorem. No meaningful code reuse opportunity exists here. + +## 2. Citations + +The formalization cites: + +- **[ErKoRa61]** Erdős, Ko, Rado (1961) — correctly cited with title, journal, volume, year, and pages. +- **[AhKh97]** Ahlswede, Khachatrian (1997) — correctly cited with title, journal, volume, year, and pages. + +**Missing from the website:** +- The website lists additional sources: **Er71, Er90, Er92e, Er95** (various Erdős papers where this problem was mentioned or discussed). These are not cited in the formalization. While not strictly necessary, they provide historical context. +- The website notes the problem carried a **$500 reward**. +- The website references OEIS sequences **A071799** and **A387635** as related. +- The website describes the **extremal family**: all 2n-subsets of [4n] containing ≥ n+1 elements from [2n]. This could be mentioned in the docstring for context. + +**Recommendation:** Consider adding a brief note about the reward and the extremal construction, e.g.: "The extremal family consists of all 2n-subsets of [4n] containing at least n+1 elements from a fixed 2n-element subset." + +## 3. Variants + +The website describes the **general Ahlswede-Khachatrian complete intersection theorem**, which resolves the problem for arbitrary parameters (m, k, t) satisfying certain inequalities. Problem 83 is the specific case m = 4n, k = 2n, t = 2. + +The formalization captures only this specific case, which is appropriate — this is exactly what Erdős Problem 83 asks. The general theorem is a separate (and much more powerful) result. No variants of Problem 83 itself are missing. + +## 4. Readability + +The code is clean and readable. The theorem statement is self-contained and closely mirrors the mathematical formulation. Minor observations: + +- The docstring is well-written with both informal math and LaTeX. +- The module docstring and theorem docstring contain some redundancy (both state the theorem), but this is a reasonable convention for the project. +- The use of `Fin (4 * n)` as the ground set is idiomatic Lean/Mathlib for representing [4n]. +- No readability improvements needed. + +## 5. Formalizability + +**Assessment: Fully formalizable, no ambiguity.** + +The problem statement is entirely precise: +- "family of 2n-element subsets of [4n]" — unambiguous. +- "pairwise intersections of size ≥ 2" — unambiguous. +- The upper bound is an explicit closed-form expression in binomial coefficients. + +There is zero ambiguity in the problem statement. This is one of the most cleanly formalizable Erdős problems. + +## 6. Correctness + +**Assessment: Correct, with one subtlety worth verifying.** + +### Ground set and uniformity +Using `Finset (Fin (4 * n))` for subsets of [4n] and requiring `A.card = 2 * n` correctly captures 2n-uniform families over a 4n-element ground set. ✓ + +### Intersection condition +The condition `∀ A ∈ F, ∀ B ∈ F, (A ∩ B).card ≥ 2` includes the case A = B, where `|A ∩ A| = |A| = 2n ≥ 2` (since `0 < n` gives `n ≥ 1`, so `2n ≥ 2`). This is harmless and mathematically equivalent to requiring the condition only for distinct A, B. ✓ + +### The bound and natural number arithmetic +The bound is `(Nat.choose (4 * n) (2 * n) - Nat.choose (2 * n) n ^ 2) / 2`. Two potential pitfalls with `ℕ` arithmetic: + +1. **Subtraction truncation:** Is `C(4n, 2n) ≥ C(2n, n)²`? Yes — by the Vandermonde identity, `C(4n, 2n) = Σ_{k=0}^{2n} C(2n, k)²`, and the k = n term alone gives `C(2n, n)²`. So the subtraction never underflows. ✓ + +2. **Division truncation:** Is `C(4n, 2n) - C(2n, n)²` always even? Yes — both quantities are even for n ≥ 1. The 2n-subsets of [4n] pair with their complements (no fixed points since a set and its complement are disjoint), so `C(4n, 2n)` is even. Similarly, the 2n-subsets with exactly n elements from each half of [4n] also pair with their complements, so `C(2n, n)²` is even. Therefore the difference is even and `ℕ` division by 2 is exact. ✓ + +### The `0 < n` hypothesis +This is necessary and appropriate. For n = 0 the problem is degenerate (the only 0-subset of [0] is ∅, which has self-intersection 0 < 2). ✓ + +### Overall mathematical correctness +The formalization is a faithful and complete translation of the problem as stated on erdosproblems.com. An experienced mathematician would find no flaws. ✓ + +--- + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | No opportunities; inline approach is appropriate | +| Citations | Mostly correct; minor additions possible (Er71, Er90, Er92e, Er95, OEIS, reward) | +| Variants | Complete — only the specific case is asked | +| Readability | Excellent | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/831.md b/ai-review/831.md new file mode 100644 index 0000000000..28a82d2ec2 --- /dev/null +++ b/ai-review/831.md @@ -0,0 +1,109 @@ +# AI Review: Erdős Problem 831 + +## 1. Code Reuse + +**Significant duplication exists.** The definitions `NoThreeCollinear`, `FourPointsConcyclic`, and `NoFourConcyclic` in `831.lean` are character-for-character identical to those in `ErdosProblems/98.lean`, and semantically equivalent to versions in `ErdosProblems/130.lean`, `217.lean`, and `654.lean`. + +Recommended shared definitions: + +- **`FormalConjecturesForMathlib/Geometry/2d.lean`** already defines `NonTrilinear`, which is the `Set`-based analogue of `NoThreeCollinear` (using `Set.Triplewise`). The `Finset`-based `NoThreeCollinear` could be factored into this file as a `Finset` variant, or the problem could be reformulated to use `NonTrilinear` directly. + +- **`ErdosProblems/130.lean`** defines a combined `ErdosGeneralPosition` predicate bundling both no-three-collinear and no-four-concyclic into one definition. This is a cleaner pattern when both constraints are needed simultaneously (as in 831). + +- **`ErdosProblems/827.lean`** defines `circumradius` via Heron's formula and `AllDistinctCircumradii`. The `circumradius` function could be reused by 831 to define `distinctCircumradiiCount` more cleanly (see §4 and §6). + +## 2. Citations + +The formalization references `[erdosproblems.com/831](https://www.erdosproblems.com/831)`. The website lists two references: + +- **[Er75h]** — not cited in the formalization +- **[Er92e]** — not cited in the formalization + +The docstring should include these references explicitly, e.g.: + +> *Reference:* Erdős [Er75h], [Er92e]. See also [erdosproblems.com/831](https://www.erdosproblems.com/831). + +The website also lists **related problems 104 and 506**, which are both formalized in the codebase. These cross-references are not mentioned in 831's docstring and would be useful context. + +## 3. Variants + +The problem as stated on the website is: + +> *Estimate h(n)*, where h(n) is the minimum number of distinct circumradii from n points in general position. + +The formalization captures only one direction: **h(n) → ∞** (i.e., for every C there exists N such that h(n) ≥ C for n ≥ N). This is a reasonable minimal formalization of "estimate h(n)" — establishing divergence is the first qualitative question. + +However, the problem as posed by Erdős asks for quantitative **estimates** (growth rate). Natural stronger variants not captured: + +- **Lower bound**: h(n) ≥ f(n) for some explicit f (e.g., polynomial, linear, etc.) +- **Upper bound**: There exist configurations achieving h(n) ≤ g(n) +- **Asymptotic**: h(n) ~ some explicit function + +The formalization does not attempt any of these quantitative variants. This is acceptable for an open problem where even divergence may not be known, but the docstring should note that the full problem asks for quantitative estimates. + +Also, **Erdős Problem 827** (formalized separately) is closely related: it asks for subsets with *all* circumradii distinct, rather than counting the minimum number of distinct circumradii globally. The connection between 827 and 831 is worth noting. + +## 4. Readability + +The code is generally readable. Suggestions: + +1. **The `distinctCircumradiiCount` definition is complex.** It uses deeply nested existential quantifiers (`∃ a ∈ P, ∃ b ∈ P, ∃ c ∈ P, ...`). An alternative approach using the `circumradius` function from `827.lean` would be more readable: + + ```lean + noncomputable def distinctCircumradiiCount (P : Finset (EuclideanSpace ℝ (Fin 2))) : ℕ := + Set.ncard (Set.range (fun (t : {S : Finset _ // S ⊆ P ∧ S.card = 3}) => + circumradius ...)) + ``` + + Or simply counting the image of circumradius over all 3-element subsets. + +2. **The docstring for `erdos_831`** says "h(n) is maximal such that…there are at least h(n) many circles." This is the definition of the *minimum* (minimum over all configurations of n points). The word "maximal" is confusing here — it should say "h(n) is the minimum number of distinct circumradii over all n-point configurations in general position." + +3. **Namespace `Erdos831`** is appropriate and consistent with other problems. + +## 5. Formalizability + +**Assessment: Moderate ambiguity.** + +The original problem statement "Estimate h(n)" is inherently vague — it does not specify what kind of estimate is sought. The formalization resolves this ambiguity by choosing the weakest meaningful interpretation (h(n) → ∞). + +The geometric primitives (collinearity, concyclicity, circumradius) are all standard and precisely defined in Euclidean geometry. The general position condition (no three collinear, no four concyclic) is unambiguous. + +One subtle point: the formalization defines the set of circumradii via existential witnesses for the circumcenter (`∃ o, dist a o = r ∧ dist b o = r ∧ dist c o = r`), which is correct but somewhat indirect. Under the general position assumption (no three collinear), every triple of points uniquely determines a circumscribed circle, so the circumradius is well-defined as a function of the triple. The existential formulation is equivalent but harder to work with in proofs. + +**Verdict:** The problem is clearly formalizable; the main ambiguity is in the strength of the estimate sought, which the formalization handles by choosing the weakest version. + +## 6. Correctness + +**The formalization is mathematically correct but has two notable issues:** + +### 6a. The docstring is misleading + +The docstring for `erdos_831` says: "h(n) is maximal such that…there are at least h(n) many circles of different radii." The word "maximal" is wrong. h(n) is the **minimum** over all valid configurations — it's the largest value guaranteed to hold for *every* configuration, which is the minimum of `distinctCircumradiiCount` over all n-point sets in general position. The formalization itself is correct (it universally quantifies over all P), but the English description uses "maximal" where it should say "minimum." + +### 6b. `distinctCircumradiiCount` is correct but redundant with `circumradius` + +The set `{r : ℝ | r > 0 ∧ ∃ a ∈ P, ∃ b ∈ P, ∃ c ∈ P, a ≠ b ∧ b ≠ c ∧ a ≠ c ∧ ∃ o, dist a o = r ∧ dist b o = r ∧ dist c o = r}` correctly captures the set of circumradii of non-degenerate triples. Under `NoThreeCollinear`, every triple of distinct points is non-degenerate (non-collinear), so the circumcircle exists and is unique. The `r > 0` constraint is automatically satisfied for non-degenerate triples, so it is redundant given `NoThreeCollinear` but harmless. + +The existential formulation for the circumcenter is mathematically equivalent to using an explicit circumradius formula (as in 827.lean), but the current formulation would be harder to work with in practice because one must produce a witness `o` each time. + +### 6c. The `NoFourConcyclic` condition uses `FourPointsConcyclic` which is slightly non-standard + +`FourPointsConcyclic S` requires `S.card = 4` and existence of a circle through all points of S. This is correct. However, note that "concyclic" in mathematics usually allows degenerate cases (e.g., a line is a "circle of infinite radius"). The formalization requires `r > 0` and a finite center, which excludes collinear quadruples. Since `NoThreeCollinear` already prevents collinear quadruples, this is not an issue in practice. + +### 6d. Overall correctness verdict + +The theorem statement `erdos_831` correctly formalizes "h(n) → ∞": for every threshold C, there exists N such that any n ≥ N points in general position yield at least C distinct circumradii. This is a sound (if weak) formalization of "estimate h(n)." + +**No mathematical errors detected.** The formalization is correct and complete for what it claims to state. The incompleteness (not capturing quantitative bounds) is attributable to the inherent ambiguity of "estimate." + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Definitions duplicated from 98, 130; could use shared `NonTrilinear` from `Geometry/2d.lean` and `circumradius` from 827 | +| Citations | Missing [Er75h] and [Er92e] references; missing cross-references to related problems 104, 506, 827 | +| Variants | Only captures h(n) → ∞; quantitative bounds not formalized (acceptable given problem is open) | +| Readability | Good overall; docstring "maximal" is misleading; `distinctCircumradiiCount` could use `circumradius` for clarity | +| Formalizability | Clearly formalizable; main ambiguity is strength of estimate, resolved by choosing weakest version | +| Correctness | Mathematically correct; no errors in the formal statement; docstring wording issue ("maximal" → "minimum") | diff --git a/ai-review/832.md b/ai-review/832.md new file mode 100644 index 0000000000..76bc45aa8c --- /dev/null +++ b/ai-review/832.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 832 + +## 1. Code Reuse + +The codebase has extensive duplication of hypergraph definitions across problems 832, 833, 834, 836, 837, 616, 719, and 1075. Problem 832 defines its own `UniformHypergraph`, `IsProperColoring`, and `chromaticNumber`, while nearby problems (833, 834, 836) define essentially the same concepts independently. + +**Key differences in approach:** +- **832** uses a `UniformHypergraph` structure that bakes uniformity into the type, while 833/834/836 use a generic `Hypergraph` with an `IsUniform` predicate. The structural approach in 832 is slightly cleaner for this specific problem since uniformity is always assumed. +- **832's `IsProperColoring`** is parameterized by `k : ℕ` and uses `Fin k` as the color type, while 833/834 use a polymorphic color type `α`. Both are mathematically equivalent for finite colorings, but 832's approach is more directly tied to the chromatic number definition. +- **832's `chromaticNumber`** uses `sInf` to compute a minimum, while 833 uses `HasChromaticNumber` defined as "k-colorable but not (k-1)-colorable." The `HasChromaticNumber` approach from 833 is arguably more standard and avoids potential pitfalls with `sInf` on empty sets. + +No shared hypergraph utility module exists in `FormalConjecturesForMathlib/`. The `SimpleGraph.Coloring` utilities in Mathlib are only for 2-uniform (graph) colorings and are not directly applicable. + +**Recommendation:** A shared `Hypergraph` module would reduce duplication, but this is a systemic issue across the codebase, not specific to 832. Within its own scope, 832's definitions are self-consistent and appropriate. + +## 2. Citations + +**Website ([erdosproblems.com/832](https://www.erdosproblems.com/832)) lists:** +- Erdős (1974) — original problem +- Alon (1985) — disproved for r ≥ 4, showing r-uniform hypergraphs with chromatic number ≥ k using at most (7/8)^r · C((r-1)(k-1)+1, r) edges +- Akolzin & Shabanov (2016) — bounds on m(r,k) +- Cherkashin & Petrov (2020) — convergence of m(r,k)/k^r + +**Formalization's docstring lists:** +- [Er74d] — matches website +- [Al85] — matches website + +The Akolzin–Shabanov and Cherkashin–Petrov results concern refined asymptotics of m(r,k) and are supplementary context rather than core to the conjecture statement. Their omission is acceptable. The two primary citations are correctly documented and match the website. + +**Minor note:** The [Er74d] citation in the docstring reads "Mathematics of Ramsey Theory (1974)" — the website attributes this to the same era but may use slightly different proceedings names. The citation is adequate. + +## 3. Variants + +The formalization captures two variants: +1. **`erdos_832`** — The general conjecture for all r ≥ 3 (disproved, `answer(False)`). +2. **`erdos_832.variants.r_eq_3`** — The r = 3 case specifically (open, `answer(sorry)`). + +This correctly reflects the mathematical status: Alon disproved the conjecture for all r ≥ 4, while the r = 3 case remains open. + +**Missing variant:** The original problem also conjectures equality characterization — "with equality only for the complete graph on (r-1)(k-1)+1 vertices." Neither variant formalizes this uniqueness condition. For the general (disproved) case this is moot, but for the r = 3 open case, the equality characterization is a meaningful part of the conjecture that is not captured. + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings on all definitions and theorems. +- The module docstring provides good mathematical context including the classical r = 2 case and the Steiner triple counterexample. +- Namespacing under `Erdos832` is clean. +- The `IsProperColoring` formulation (`∀ c : Fin k, ∃ v ∈ e, f v ≠ c`) is mathematically equivalent to "no monochromatic edge" but is slightly less immediately obvious than the 833/834 formulation (`∃ u ∈ e, ∃ v ∈ e, f u ≠ f v`). A brief comment explaining the equivalence would aid readability. + +## 5. Formalizability + +The problem is highly formalizable — it involves standard finite combinatorial objects (finite hypergraphs, colorings, edge counts, binomial coefficients) with no analytic or topological subtleties. + +**Ambiguity assessment: Low.** The statement "k sufficiently large in terms of r" is cleanly handled by the `∃ k₀` quantifier. The only ambiguity in the original problem is the equality characterization (which is omitted). The core inequality is unambiguous. + +## 6. Correctness + +### Main theorem (`erdos_832`) + +**Answer value (`False`):** Correct. The universally quantified statement over all r ≥ 3 is false because Alon's result gives counterexamples for every r ≥ 4. + +**Statement structure:** The RHS states: +``` +∀ r ≥ 3, ∃ k₀, ∀ k ≥ k₀, ∀ H r-uniform with χ(H) = k, |E(H)| ≥ C((r-1)(k-1)+1, r) +``` +This correctly captures "for all r ≥ 3 and k sufficiently large in terms of r." + +**`IsProperColoring` equivalence:** The definition `∀ e ∈ H.edges, ∀ c : Fin k, ∃ v ∈ e, f v ≠ c` is equivalent to "no edge is monochromatic" for nonempty edges (which is guaranteed by r ≥ 3). Proof: if all vertices of edge e have color c₀, then for c = c₀ the existential fails; conversely, if the edge is not monochromatic, then for any color c, either no vertex has color c (any vertex witnesses f v ≠ c) or some vertex has color c and another doesn't. ✓ + +**`chromaticNumber` via `sInf`:** For any finite V and hypergraph H, a proper coloring with |V| colors always exists (injective coloring), so the `sInf` is over a nonempty set and is well-defined. The `k ≥ 1` guard prevents `sInf` from returning 0. ✓ + +**Natural number arithmetic:** When k = 0 (impossible since chromaticNumber ≥ 1) or k = 1, `(k-1)` underflows to 0 in ℕ, giving `C(1, r) = 0` for r ≥ 3, which is vacuously satisfied. No edge case issues arise. ✓ + +### Variant (`erdos_832.variants.r_eq_3`) + +**Answer value (`sorry`):** Correct — this case is genuinely open. + +**Statement:** Correctly specializes the general conjecture to r = 3, with `C(2(k-1)+1, 3)` matching `C((3-1)(k-1)+1, 3)`. ✓ + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Definitions are self-contained; shared module would reduce cross-problem duplication | +| Citations | Primary references [Er74d] and [Al85] correctly documented | +| Variants | General and r=3 cases captured; equality characterization omitted | +| Readability | Good; minor improvement possible for `IsProperColoring` explanation | +| Formalizability | Highly formalizable, low ambiguity | +| Correctness | Mathematically correct; answer values accurate; edge cases handled properly | diff --git a/ai-review/833.md b/ai-review/833.md new file mode 100644 index 0000000000..3b671e360e --- /dev/null +++ b/ai-review/833.md @@ -0,0 +1,61 @@ +# AI Review: Erdős Problem 833 + +## 1. Code Reuse + +The file defines its own `Hypergraph` structure, along with `IsUniform`, `IsProperColoring`, `HasChromaticNumber`, and `degree` — all within a local `Erdos833` namespace. Nearly identical definitions appear in at least two other files: + +- **834.lean** — Same `Hypergraph` structure, `IsUniform`, and `degree`. Its `IsProperColoring` omits the `e.card ≥ 2` guard (stricter). It also defines additional predicates (`vertices`, `eraseEdge`, `eraseVertex`, `IsTransversal`, `Is3TransversalCritical`, `Is3ChromaticCritical`). +- **832.lean** — Uses a `UniformHypergraph V r` structure that bakes uniformity into the type. Defines `IsProperColoring` and `chromaticNumber` differently. + +**Recommendation:** There is no shared `Hypergraph` module in `FormalConjecturesForMathlib`. A shared definition (covering at minimum `Hypergraph`, `IsUniform`, `IsProperColoring`, `HasChromaticNumber`, and `degree`) would reduce duplication across problems 832–834 and others. Problems 833 and 834 in particular have nearly identical definitions that could be unified. + +## 2. Citations + +The formalization cites: + +> [ErLo75] Erdős, P. and Lovász, L., *Problems and results on 3-chromatic hypergraphs and some related questions*. Infinite and Finite Sets (Colloq., Keszthely, 1973), Vol. II, Colloq. Math. Soc. János Bolyai, Vol. 10 (1975), 609–627. + +The website ([erdosproblems.com/833](https://www.erdosproblems.com/833)) lists three references: +- **[Er71,p.105]** — not cited in the formalization +- **[Er74d]** — not cited in the formalization +- **[ErLo75]** — cited + +The two missing references ([Er71,p.105] and [Er74d]) are earlier Erdős papers where the problem was originally posed. They should be included for completeness, or at minimum acknowledged. + +## 3. Variants + +The website describes a general variant: + +> Determine the largest integer $f(r)$ such that every $r$-uniform hypergraph with chromatic number $3$ has a vertex in at least $f(r)$ edges. Known values: $f(2) = 2$ and $f(3) = 3$. Erdős noted that $f(4)$ was unknown. + +This variant (the exact determination of $f(r)$) is **not captured** by the formalization. The current statement only formalizes the qualitative question of whether $f(r)$ grows exponentially. A companion conjecture capturing the extremal function $f(r)$ would be a natural addition, though admittedly the exact value is open for most $r$. + +## 4. Readability + +The code is well-structured and readable: +- Definitions are cleanly separated with docstrings. +- The namespace `Erdos833` prevents name clashes. +- The main theorem statement is clear and closely mirrors the natural language problem. + +**Minor suggestion:** The docstring on `erdos_833` mentions the Erdős–Lovász bound $2^{r-1}/(4r)$ as contextual motivation, which is helpful. No changes needed. + +## 5. Formalizability + +The problem is **precisely and unambiguously formalizable**. The statement involves only standard combinatorial objects (finite uniform hypergraphs, proper coloring, vertex degree) and a clear quantitative question (existence of an exponential lower bound). There is no ambiguity in the mathematical content. + +**Assessment: No ambiguity.** + +## 6. Correctness + +The formalization is **mathematically correct and complete** for the main question posed. Detailed analysis: + +- **Vertex type `Fin n`:** The quantification `∀ (n : ℕ) (H : Hypergraph (Fin n))` correctly ranges over all finite hypergraphs by varying `n`. Since hypergraph coloring is inherently finite (edges are `Finset`s), no generality is lost. +- **`IsUniform r`:** Correctly requires every edge to have exactly `r` elements. +- **`IsProperColoring f`:** Requires that for every edge with $\geq 2$ vertices, the coloring is non-monochromatic. The `e.card ≥ 2` guard is appropriate — singleton or empty edges cannot be monochromatic in a meaningful sense, and the problem concerns $r$-uniform hypergraphs with $r \geq 2$, so this guard is technically redundant but mathematically sound. +- **`HasChromaticNumber 3`:** Correctly requires existence of a proper 3-coloring and non-existence of any proper 2-coloring. The use of `Fin k` and `Fin (k - 1)` is correct for $k = 3$. +- **Conclusion:** The statement `∃ v : Fin n, (H.degree v : ℝ) ≥ (1 + c) ^ r` correctly formalizes "there is a vertex contained in at least $(1+c)^r$ edges." +- **`answer(True)`:** Consistent with the website's status (PROVED) and the Erdős–Lovász result. +- **Edge cases:** Vacuous cases ($n = 0$, $n = 1$) are handled correctly — no such hypergraph can have chromatic number 3, so the universal quantifier is vacuously satisfied. +- **Tags:** `category research solved, AMS 5` — the `solved` tag is appropriate. AMS 5 (Combinatorics) is correct. + +**Assessment: Correct. No mathematical flaws identified.** diff --git a/ai-review/834.md b/ai-review/834.md new file mode 100644 index 0000000000..ae2fbb4094 --- /dev/null +++ b/ai-review/834.md @@ -0,0 +1,125 @@ +# AI Review: Erdős Problem 834 + +## 1. Code Reuse + +The codebase contains numerous independent hypergraph definitions across Erdős problems (616, 832, 833, 836, 837, 1024, 1075, etc.), each defining their own `Hypergraph` structure, `IsUniform`, `degree`, `IsProperColoring`, etc. Problem 834 follows this self-contained pattern consistently. + +Specific overlaps: +- **Problem 616** defines `IsTransversal` and `coveringNumber` for hypergraphs — closely mirrors 834's transversal definitions. +- **Problems 832, 833, 836** define `IsProperColoring` and chromatic number concepts for hypergraphs in essentially the same way. +- **`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean`** defines `IsCritical`, `IsCriticalEdge`, `IsCriticalVertex` for `SimpleGraph` — the hypergraph chromatic criticality in 834 is a natural generalization but cannot directly reuse the graph-level definitions. + +There is no shared hypergraph module in the codebase, and each problem is self-contained. This is consistent with the project's conventions. No immediate reuse opportunity exists that would simplify 834 without first creating a shared hypergraph library (which is out of scope). + +**Verdict: Acceptable.** The duplication is consistent with the codebase style. + +## 2. Citations + +The website ([erdosproblems.com/834](https://www.erdosproblems.com/834)) lists: +- **Source:** `[Er74d, p.282]` +- **Originators:** Erdős and Lovász +- **Tags:** Graph theory, Hypergraphs +- **Status:** Solved + +The formalization's docstring cites: +- `[Er74d]` — Erdős, P. and Lovász, L. (1974). +- `[Li25]` — Li (2025). + +**Issues:** +- The `[Er74d]` citation omits the page reference `p.282` present on the website. Minor. +- Neither the website nor the formalization provides a full bibliographic entry for `[Er74d]`. The standard reference is: Erdős, P. and Lovász, L., "Problems and results on 3-chromatic hypergraphs and some related questions," in *Infinite and Finite Sets* (Colloq., Keszthely, 1973), Vol. II, pp. 609–627, Colloq. Math. Soc. J. Bolyai 10, North-Holland, Amsterdam, 1975. Including at least a title would improve traceability. +- The `[Li25]` citation lacks author first name and paper title. The website attributes the resolution to Li (2025) but similarly provides limited detail. + +**Verdict: Minor gaps.** Adding `p.282` to the `[Er74d]` reference and fleshing out the `[Li25]` citation (first name, paper title if available) would improve completeness. + +## 3. Variants + +The formalization captures **both** natural interpretations of "3-critical" discussed on the website: + +1. **Transversal criticality** (`erdos_834`) — τ(H) = 3 and τ(H − e) ≤ 2 for every edge e. Answer: **No** (every such hypergraph has a vertex of degree ≤ 6). +2. **Chromatic criticality** (`erdos_834.variants.chromatic`) — χ(H) = 3, and removing any edge or vertex reduces χ to ≤ 2. Answer: **Yes** (Li's 9-vertex construction). + +The website discussion by Raphael Steiner highlights exactly these two interpretations, and the formalization addresses both with separate theorem statements and distinct criticality definitions. + +**Verdict: Complete.** Both variants are captured. + +## 4. Readability + +The code is well-structured: +- Clear docstrings on every definition. +- The module-level docstring explains the ambiguity and resolution clearly. +- Definitions are ordered logically (basic structure → operations → criticality → theorems). +- The `Erdos834` namespace avoids polluting the global scope. + +**Minor suggestions:** +- The `IsProperColoring` definition uses `e.card ≥ 2` as a guard. For 3-uniform hypergraphs this is always true, but the guard is mathematically appropriate for a general definition. Clear as-is. +- The `eraseVertex` definition removes all edges *containing* the vertex (rather than removing the vertex from edges). A one-line comment clarifying this design choice (standard for hypergraph vertex deletion) could help readers unfamiliar with the convention, but is not necessary. + +**Verdict: Good readability.** No significant issues. + +## 5. Formalizability + +The original problem asks: *"Does there exist a 3-critical 3-uniform hypergraph in which every vertex has degree ≥ 7?"* + +The primary ambiguity is the meaning of "3-critical," which the formalization explicitly identifies and addresses with two separate definitions. This is well-handled. + +**Assessment of ambiguity:** +- **"3-uniform"** — unambiguous, correctly formalized as `∀ e ∈ H.edges, e.card = r`. +- **"degree ≥ 7"** — unambiguous, correctly formalized. +- **"3-critical"** — genuinely ambiguous in the original statement. The formalization correctly identifies and resolves this by providing both interpretations with separate theorems. This is the right approach. + +The problem is **fully formalizable** under either interpretation, and the formalization captures both. + +**Verdict: High formalizability.** The ambiguity is inherent to the original problem and is properly handled. + +## 6. Correctness + +### Transversal formulation (`erdos_834`) + +**`Is3TransversalCritical`** requires: +1. ∃ transversal of size exactly 3 ✓ +2. No transversal of size < 3 ✓ +3. Removing any edge yields a transversal of size ≤ 2 ✓ + +This correctly captures τ-criticality: τ(H) = 3 and τ(H − e) < τ(H) for every edge e. + +**Theorem statement:** `answer(False) ↔ ∃ (n : ℕ) (H : Hypergraph (Fin n)), ...` — the answer is No, meaning no such hypergraph exists. This matches Li's result. ✓ + +### Chromatic formulation (`erdos_834.variants.chromatic`) + +**`Is3ChromaticCritical`** requires: +1. H is 3-colorable (∃ f : V → Fin 3 proper coloring) ✓ +2. H is not 2-colorable (∀ f : V → Fin 2, not proper) ✓ +3. Removing any edge makes H 2-colorable ✓ +4. Removing any vertex (in `H.vertices`) makes H 2-colorable ✓ + +This is the standard definition of chromatic criticality for hypergraphs. ✓ + +**Theorem statement:** `answer(True) ↔ ∃ (n : ℕ) (H : Hypergraph (Fin n)), ...` — the answer is Yes, such a hypergraph exists. This matches Li's 9-vertex construction. ✓ + +### Subtle points verified: + +- **Vertex quantification:** The degree condition `∀ v : Fin n, H.degree v ≥ 7` quantifies over *all* elements of `Fin n`, not just `H.vertices`. This is not a bug: since the statement is existential, one can always choose `n` to equal the number of actual vertices, ensuring all elements of `Fin n` appear in edges. For the False case (transversal), this makes the negation slightly stronger than needed but equivalent in practice. For the True case (chromatic), Li's construction on 9 vertices uses all 9 vertices, so `n = 9` works. + +- **Empty/degenerate cases:** An empty hypergraph (n = 0) cannot be 3-transversal-critical (the empty set is a transversal of size 0 < 3, violating condition 2) or 3-chromatic-critical (any function is a proper 2-coloring vacuously, violating condition 2). No edge cases escape the definitions. + +- **`eraseVertex` semantics:** Removes all edges containing v (standard vertex deletion for hypergraphs). After deletion, `f : V → Fin 2` assigns colors to all of `V` including `v`, but since no remaining edge contains `v`, the color of `v` is irrelevant. This correctly captures 2-colorability of H − v. ✓ + +- **`IsProperColoring` definition:** Requires that for every edge of size ≥ 2, there exist two vertices with different colors. This is equivalent to "no edge is monochromatic," which is the standard hypergraph proper coloring definition. ✓ + +- **`answer` pattern:** Consistent with codebase conventions where `answer(b) ↔ P` encodes that the mathematical statement P has truth value b. ✓ + +**Verdict: Correct and complete.** No mathematical flaws identified. The formalization faithfully captures both interpretations of the problem and their resolutions. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code Reuse | ✅ Acceptable | Consistent with codebase conventions; no shared hypergraph library exists | +| Citations | ⚠️ Minor gaps | Missing `p.282` page ref; `[Li25]` lacks full details | +| Variants | ✅ Complete | Both transversal and chromatic interpretations captured | +| Readability | ✅ Good | Well-structured, clear docstrings | +| Formalizability | ✅ High | Ambiguity properly identified and resolved | +| Correctness | ✅ Correct | Mathematically sound; no flaws found | diff --git a/ai-review/836.md b/ai-review/836.md new file mode 100644 index 0000000000..463ce011e5 --- /dev/null +++ b/ai-review/836.md @@ -0,0 +1,106 @@ +# AI Review: Erdős Problem 836 + +## 1. Code Reuse + +The file defines its own `Hypergraph` structure and associated predicates (`IsUniform`, `vertices`, `IsProperColoring`, `HasChromaticNumber3`, `IsIntersecting`) within the `Erdos836` namespace. Nearly identical definitions appear in: + +- **`ErdosProblems/833.lean`** — same `Hypergraph` structure, same `IsUniform`, same `IsProperColoring` (with the same `e.card ≥ 2` guard), plus a more general `HasChromaticNumber k` parameterized by `k`. +- **`ErdosProblems/834.lean`** — same `Hypergraph` structure, same `IsUniform`, same `IsProperColoring`, same `vertices`. + +**Recommendation:** A shared hypergraph utility module (in `FormalConjecturesForMathlib` or a common `Util/Hypergraph.lean`) would eliminate substantial duplication across at least files 833, 834, and 836. The `HasChromaticNumber k` from 833.lean is strictly more general than the `HasChromaticNumber3` defined here. + +No existing code in `FormalConjecturesForMathlib` addresses hypergraph structures. The digit-related code elsewhere in the codebase is irrelevant to this problem. + +## 2. Citations + +**Website (erdosproblems.com/836) states:** +- Problem posed by Erdős and Shelah. +- Two questions: (1) Must such a hypergraph have O(r²) vertices? (2) Must two edges meet in ≫ r vertices? +- Alon showed question (1) is false (counterexample with ~4^r/√r vertices). +- Erdős and Lovász proved two edges must meet in Ω(r/log r) vertices. +- Status: **Open** (the second question remains open). + +**Formalization docstring states:** +- Reference `[Er74d]` for the original problem — matches the website. +- Reference `[ErLo75]` for the Erdős–Lovász bound — matches the website. +- Alon's counterexample is mentioned — matches the website. + +**Issue:** The docstring uses shorthand citation keys `[Er74d]` and `[ErLo75]`. The website does not provide full bibliographic details in a standard format either, but the shorthand keys are consistent with the Erdős bibliography convention. This is acceptable but could be improved with full citations (e.g., "Erdős and Lovász, *Problems and results on 3-chromatic hypergraphs and some related questions*, 1975"). + +## 3. Variants + +The original problem on erdosproblems.com/836 poses **two questions**: + +1. Must the hypergraph contain O(r²) vertices? +2. Must there be two edges meeting in ≫ r vertices? + +The formalization **only captures question (2)** — whether two edges must meet in Ω(r) vertices. This is the correct choice since question (1) was resolved negatively by Alon, and the docstring explains this. However, no variant theorem is provided for: + +- The **resolved first question** (which could be stated as a negative result or as Alon's lower bound on vertex count). +- The **Erdős–Lovász result** Ω(r/log r), which is a known weaker bound and could be formalized as a separate theorem. + +**Recommendation:** Consider adding variant theorems for (a) Alon's counterexample (the first question is false) and (b) the Erdős–Lovász Ω(r/log r) bound, since both are mentioned in the docstring as known results. + +## 4. Readability + +The code is well-structured and readable: + +- Definitions are clearly named and well-documented. +- The namespace `Erdos836` keeps everything self-contained. +- The docstring provides good mathematical context. +- The use of `Fin n` for the vertex type is a reasonable encoding choice. + +**Minor suggestions:** +- The `IsProperColoring` definition requires `e.card ≥ 2` as a hypothesis, which is appropriate for hypergraphs but slightly non-standard. This is fine since r ≥ 2 is assumed in the theorem. +- The `open Finset` is clean and appropriate. + +## 5. Formalizability + +The problem as stated on the website is: + +> "Must there be two edges which meet in ≫ r many vertices?" + +This is **moderately ambiguous** in its informal statement — "≫ r" is asymptotic notation meaning "at least Cr for some constant C > 0". The formalization correctly interprets this as: + +> ∃ C : ℝ, C > 0 ∧ ∀ r ≥ 2, ... (∃ two edges with intersection ≥ C · r) + +This is a standard and unambiguous formalization of the asymptotic claim. The use of `answer(sorry)` wrapping the expected Boolean answer is consistent with the project's convention for open problems. + +**Assessment:** The formalization is precise and faithfully captures the mathematical content. The asymptotic ≫ notation is correctly rendered as a universal statement with an existential constant. + +## 6. Correctness + +**Mathematical correctness analysis:** + +The formalization states: there exists C > 0 such that for all r ≥ 2, for every r-uniform intersecting hypergraph with chromatic number 3 on finitely many vertices, there exist two distinct edges whose intersection has cardinality ≥ C · r. + +This is **mathematically correct** as a formalization of the open question. Specific observations: + +1. **Quantifier order is correct.** The constant C is existentially quantified outermost, then universally over r and the hypergraph. This correctly captures "Ω(r)" — a single constant works for all r. + +2. **Vertex type `Fin n`** is appropriate — it restricts to finite hypergraphs, which is the intended setting. + +3. **`HasChromaticNumber3` definition** correctly requires both 3-colorability AND non-2-colorability. The `IsProperColoring` definition (no monochromatic edge) is the standard notion for hypergraph coloring. + +4. **`IsIntersecting` definition** correctly requires every pair of edges to have nonempty intersection (not just distinct pairs). This is slightly stronger than needed (it requires e ∩ e to be nonempty, which is trivially true for nonempty edges), but since r ≥ 2 implies all edges are nonempty, this is harmless. + +5. **The `e₁ ≠ e₂` requirement** is essential and correctly included — without it, the statement would be trivially true (any edge intersects itself in r vertices). + +6. **Cast to ℝ** for the inequality `((e₁ ∩ e₂).card : ℝ) ≥ C * (r : ℝ)` is necessary since C is real-valued. This is correct. + +**Potential concern:** The `IsProperColoring` definition says "∃ u ∈ e, ∃ v ∈ e, f u ≠ f v", which means the edge is *not monochromatic* (at least two vertices get different colors). This is the standard definition for hypergraph proper coloring. However, some sources define proper coloring of hypergraphs as requiring that no edge is *polychromatic* (all vertices get distinct colors) or *rainbow*. The "non-monochromatic" interpretation used here is the correct one for this problem, consistent with Erdős's original statement. + +**No mathematical flaws identified.** The formalization is correct and complete for the open part of Problem 836. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Significant duplication with 833.lean, 834.lean; shared module recommended | +| Citations | Shorthand keys match website; full citations would be an improvement | +| Variants | Only the open question (2) is formalized; known results (1) and Erdős–Lovász bound omitted | +| Readability | Good — clear structure, well-documented | +| Formalizability | Unambiguous; asymptotic notation correctly rendered | +| Correctness | Mathematically correct; no flaws identified | diff --git a/ai-review/837.md b/ai-review/837.md new file mode 100644 index 0000000000..3c45fb2f25 --- /dev/null +++ b/ai-review/837.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 837 + +## 1. Code Reuse + +Multiple Erdős problems in the codebase define their own hypergraph structures (833, 834, 836, 593, 716, 1024, 1076), each with slightly different designs (typed vertices, finset-based edges, uniformity predicates, etc.). Problem 837 defines its own `UniformHypergraph n k` structure parameterized by vertex count and uniformity, which is a reasonable choice given that this problem specifically needs density computations involving `Nat.choose n k`. + +Mathlib provides `SimpleGraph.Subgraph` and `Rel.edgeDensity` (in `Mathlib.Combinatorics.SimpleGraph.Density`), as well as `turanDensity` (in `Mathlib.Combinatorics.SimpleGraph.Extremal.TuranDensity`), but these are all for 2-uniform (simple) graphs, not k-uniform hypergraphs. There is no Mathlib hypergraph infrastructure to reuse. + +The `FormalConjecturesForMathlib/Data/Set/Density.lean` file provides `upperDensity`/`lowerDensity` for natural density of subsets of ℕ, which is unrelated to edge density. + +**Verdict:** No significant reuse opportunity. The self-contained definitions are appropriate. + +## 2. Citations + +The website lists the citation as **[Er74d]** only. The docstring expands this to: + +> [Er74d] Erdős, P. and Simonovits, M., problem on hypergraph density jumps. + +This appears to be an informal paraphrase rather than an actual paper title. The [Er74d] reference in the Erdős bibliography likely corresponds to a specific 1974 publication by Erdős and Simonovits. The citation could be more precise, but absent a full bibliography on the website, the current attribution is acceptable. + +The docstring also correctly mentions the Erdős-Stone-Simonovits theorem in connection with the known A₂ result. + +**Verdict:** Acceptable. The citation matches the website's [Er74d] reference, though the expanded title is informal rather than a verified paper title. + +## 3. Variants + +The formalization includes: + +- `erdos_837.variants.graphs` — The known result A₂ = {1 − 1/m : m ≥ 1} (Erdős-Stone-Simonovits), tagged `[category research solved]`. +- `erdos_837` — The open problem asking for A₃, tagged `[category research open]`. + +The general definition `densityJumpSet k` works for all k ≥ 2, so one could also state the problem for general k. The website specifically asks "What is A₃?" so the formalization correctly targets k = 3. One might consider a variant for general k (e.g., "Is A_k non-trivial for all k ≥ 3?"), but this is not explicitly part of the problem. + +**Verdict:** All variants from the website are captured. + +## 4. Readability + +The code is well-structured: +- The docstring gives a clear LaTeX rendering of the problem. +- The `UniformHypergraph`, `density`, and `IsSubgraphVia` definitions are cleanly separated with docstrings. +- The `densityJumpSet` definition is complex but well-commented with inline annotations for parts (a) and (b). + +Minor suggestions: +- The `densityJumpSet` definition is quite long (25+ lines). Breaking out the "liminf > α" and "liminf ≥ α" conditions into named predicates (e.g., `liminfDensityGt`, `liminfDensityGe`) could improve readability, though this is a matter of taste. + +**Verdict:** Good readability overall. + +## 5. Formalizability + +The problem asks "What is A₃?" which is modeled as `densityJumpSet 3 = answer(sorry)`. This is a clean formalization of a set-determination problem. All constituent notions (k-uniform hypergraph, edge density, subhypergraph, liminf) are mathematically precise and admit unambiguous formalization. + +The one subtlety is whether "subgraphs H_n ⊆ G_n" means induced or non-induced sub-hypergraphs (see §6 below), but this turns out not to affect the answer. + +**Verdict:** High formalizability. The problem is precise as stated. + +## 6. Correctness + +### 6a. Critical issue: missing |G_n| → ∞ condition + +The `densityJumpSet` definition quantifies over **all** sequences of k-uniform hypergraphs: + +```lean +∀ (sizes : ℕ → ℕ) (G : ∀ i, UniformHypergraph (sizes i) k), ... +``` + +There is no requirement that `sizes i → ∞`. This is problematic because: + +- Consider a **constant** sequence of complete k-uniform hypergraphs on m vertices. This has density 1 > α for any α < 1. +- The conclusion requires subgraphs H_i with `subSizes i → ∞`. But the embedding `f : Fin (subSizes i) ↪ Fin (sizes i)` forces `subSizes i ≤ sizes i = m`, so growing subgraphs cannot exist. +- Therefore part (a) of the definition **fails for all α < 1**, making `densityJumpSet k = ∅` (or at best {1} vacuously, since no sequence has liminf density > 1). + +In the standard extremal graph theory formulation, the sequence is implicitly or explicitly required to have |G_n| → ∞ (often G_n is a graph on n vertices). **The formalization should add:** + +```lean +(∀ M : ℕ, ∃ N : ℕ, ∀ i : ℕ, i ≥ N → sizes i ≥ M) → +``` + +as an additional hypothesis, or equivalently wrap the universal quantifier to only range over divergent sequences. Without this fix, the density jump set is trivially empty, and both `erdos_837` and `erdos_837.variants.graphs` are trivially provable (with `∅` as the answer for A₃ and the A₂ theorem being false). + +### 6b. Induced vs. non-induced subhypergraphs + +The `IsSubgraphVia` definition requires every edge of H to map to an edge of G, but does not require H to contain all edges of G on the embedded vertex set (i.e., H need not be the **induced** sub-hypergraph). In the standard density jump framework, subgraphs are typically induced. + +However, this does not affect correctness: for any non-induced subhypergraph H on vertex set S, the induced subhypergraph G[S] has at least as many edges (and hence at least as high density). So finding a dense non-induced subhypergraph is equivalent to finding a dense induced one, and failing to find a dense induced one implies failing for non-induced ones too. The two formulations yield the same density jump set. + +**Verdict:** Not an issue. + +### 6c. The A₂ characterization + +The known result `erdos_837.variants.graphs` states: + +```lean +densityJumpSet 2 = {α : ℝ | ∃ m : ℕ, m ≥ 1 ∧ α = 1 - 1 / (m : ℝ)} +``` + +This gives {0, 1/2, 2/3, 3/4, ...} which matches the Erdős-Stone-Simonovits theorem (the Turán density values are exactly 1 − 1/r for r ≥ 1, and these are the jump points). This is mathematically correct, **assuming the bug in §6a is fixed**. + +### 6d. Liminf encoding + +- "liminf density > α" is encoded as `∃ δ > 0, ∃ N₀, ∀ i ≥ N₀, density ≥ α + δ`. This is correct. +- "liminf density ≥ α" is encoded as `∀ ε > 0, ∃ N₀, ∀ i ≥ N₀, density ≥ α − ε`. This is correct. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Code reuse | No opportunities; self-contained definitions appropriate | +| Citations | Acceptable; matches website [Er74d] | +| Variants | Complete | +| Readability | Good | +| Formalizability | High — problem is precise | +| Correctness | **Bug: missing `sizes i → ∞` condition makes A_k trivially empty** | diff --git a/ai-review/838.md b/ai-review/838.md new file mode 100644 index 0000000000..ebff3c3254 --- /dev/null +++ b/ai-review/838.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 838 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** The file defines three local definitions that closely duplicate shared utilities in `FormalConjecturesForMathlib/Geometry/2d.lean`: + +| Local (838.lean) | Shared (Geometry/2d.lean) | Equivalent? | +|---|---|---| +| `InGeneralPosition` (line 40) | `NonTrilinear` (line 54) | Semantically equivalent. Both express "no three collinear." `NonTrilinear` uses `Set.Triplewise` on a `Set P`, while `InGeneralPosition` quantifies over 3-element sub-Finsets. They capture the same geometric condition. | +| `InConvexPosition` (line 48) | `ConvexIndep` (line 60) | Semantically equivalent. Both say no point lies in the convex hull of the remaining points. `ConvexIndep` works on `Set ℝ²` using `S \ {a}`, while `InConvexPosition` works on `Finset` using `S.erase p`. After coercion these coincide. | +| `numConvexSubsets` (line 54) | (no shared equivalent) | Could be defined in terms of `ConvexIndep` if the above were unified. | + +**Recommendation:** Replace `InGeneralPosition` with `NonTrilinear` and `InConvexPosition` with a Finset adapter for `ConvexIndep`. This would align with Problems 107, 97, and 982, which already use the shared definitions. This is part of a broader pattern: at least 7 Erdős problems locally redefine convex position and at least 5 locally redefine general position. + +## 2. Citations + +The docstring contains: + +> `[Er78c] Erdős, P. (1978).` + +This is incomplete. No paper title, journal, or page numbers are given. The website (erdosproblems.com/838) describes the problem as "A question of Erdős and Hammer" but does not give a full bibliographic entry for [Er78c] either. The citation should at minimum include the title. Based on the context, the likely reference is: + +> Erdős, P., _Some more problems on elementary geometry_, Austral. Math. Soc. Gaz. **5** (1978), 52–54. + +However, this cannot be confirmed from the website alone. The docstring should note the problem is attributed to Erdős and Hammer (as the website does), and the citation should be expanded if the precise reference can be identified. + +**Also:** The website lists Problem #107 (Happy Ending / Erdős–Szekeres) as a related problem. This relationship is not mentioned in the formalization's docstring. + +## 3. Variants + +**No variants are captured.** The formalization only states the limit question. Potential additions: + +- **Known bounds (variant):** Erdős proved $n^{c_1 \log n} < f(n) < n^{c_2 \log n}$ for constants $c_1, c_2 > 0$. This is mentioned in the docstring but not formalized as a separate theorem (contrast with Problem 107, which formalizes Erdős–Szekeres bounds, the Suk bound, and the HMPT bound as separate `variants` theorems). +- **Relationship to Problem 107:** Problem 107 concerns the existence of convex $n$-gons; Problem 838 concerns the total count of convex subsets of all sizes. A variant could explicitly connect them. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The docstring for `f` (line 58–60) says "minimum number of convex subsets," while the main theorem docstring (line 67) says "maximum number such that any $n$ points ... determine at least $f(n)$." Both are mathematically correct characterizations of the same quantity (the infimum of `numConvexSubsets` over all valid configurations = the largest guaranteed lower bound). However, consistency would improve readability — recommend using the "minimum" characterization throughout, as it directly matches the `sInf` implementation. +- The `open Classical Filter Finset` on line 30 is broader than necessary; only `Finset` is visibly used. +- The namespace `Erdos838` is appropriate and well-scoped. + +## 5. Formalizability + +**High formalizability.** The problem is mathematically precise: + +- "Points in general position" (no three collinear) is standard and unambiguous. +- "Convex subset" (subset in convex position) is standard in combinatorial geometry. +- The question asks whether a specific limit exists, which has a clear formal meaning. + +**Minor ambiguity:** The phrase "convex subsets" could in principle mean (a) subsets in convex position (any size), or (b) subsets of size $\geq 3$ forming a convex polygon. The formalization uses interpretation (a), counting all subsets including $\emptyset$, singletons, and pairs. This does not affect the asymptotic question since the contribution from small subsets is $O(n^2)$, while $f(n) \geq n^{c_1 \log n}$ dominates. The formalization's choice is defensible and standard. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`InGeneralPosition`** (line 40–42): Correctly captures "no three collinear" by requiring every 3-element sub-Finset to be non-collinear. ✓ +- **`InConvexPosition`** (line 48–49): Correctly captures convex position (every point is a vertex of the convex hull of the set). ✓ +- **`numConvexSubsets`** (line 54–55): Correctly counts subsets of $P$ that are in convex position via `powerset.filter`. ✓ +- **`f`** (line 61–63): Uses `sInf` over the set of achievable counts. This correctly computes the minimum number of convex subsets over all $n$-point sets in general position. ✓ +- **Main theorem** (line 76–79): Asks whether `log f(n) / (log n)²` converges, wrapped in the `answer(sorry)` pattern. The use of `Tendsto ... atTop (nhds c)` correctly formalizes convergence to a constant. ✓ + +**Potential concern with `sInf`:** When the set `{k | ∃ P, ...}` is empty (e.g., for $n = 0$ or small $n$), `sInf ∅ = 0` in `ℕ`. For $n \geq 1$, the set is nonempty (point sets in general position exist), so this is only an edge case. Since the theorem concerns the limit as $n \to \infty$, this does not affect correctness. + +**Potential concern with `Real.log`:** For $n = 0$ or $n = 1$, `Real.log n ≤ 0`, making the denominator $(\log n)^2$ potentially zero or the quotient negative/undefined. Again, this is irrelevant for the `atTop` limit. The `Tendsto` statement filters to large $n$, so this is fine. + +**Overall assessment:** The formalization is correct and complete for the main question. The only substantive gap is the absence of the known bounds as formalized variants. diff --git a/ai-review/839.md b/ai-review/839.md new file mode 100644 index 0000000000..95f3c3d91e --- /dev/null +++ b/ai-review/839.md @@ -0,0 +1,101 @@ +# Erdős Problem 839 — Review + +## 1. Code Reuse + +Several existing codebase definitions are relevant: + +- **`Set.HasLogDensity` in `FormalConjecturesForMathlib/Data/Set/Density.lean`** (line 196): Defines logarithmic density as `Tendsto (fun n => ∑ k ≤ n with k ∈ A, (k : ℝ)⁻¹ / .log n) atTop (𝓝 d)`. The stronger Part 2 of this problem is essentially asking whether the image set `{a n | n : ℕ}` has log-density zero. The current formalization instead inlines the sum directly. Using `Set.HasLogDensity` with `d = 0` and `A = Set.range a` would be more idiomatic and consistent with how other problems (e.g., Erdős 25, 486) handle log-density. + +- **`HasLogDensityZero` in `FormalConjectures/ErdosProblems/1123.lean`** (line 48): A local definition for log-density zero that is very close to what Part 2 needs. This is a duplicate concept that could be unified with `Set.HasLogDensity ... 0`. + +- **`contiguousSubSums` in `FormalConjectures/ErdosProblems/356.lean`** (line 40): Defines the set of all contiguous subsequence sums. While related in spirit (contiguous sums over `Finset.Icc`), the 839 definition is about *exclusion* (no term equals such a sum) rather than *enumeration*, so direct reuse doesn't simplify the statement. + +- **`IsGoodFor` in `FormalConjectures/ErdosProblems/359.lean`** (line 31): Problem 359 uses `Finset.Icc a b ⊆ Finset.Iic j` to express "sum of consecutive earlier terms." The 839 definition `SumOfConsecutiveFree` uses `j ≤ k → k < i` for the same purpose. These are equivalent formulations but with different structural choices. No significant reuse opportunity. + +**Verdict:** Part 2 would benefit from being restated using `Set.HasLogDensity (Set.range a) 0` for consistency with the rest of the codebase. The `SumOfConsecutiveFree` definition is bespoke and appropriate. + +## 2. Citations + +The website (erdosproblems.com/839) lists: +- **[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 (1993) — constructed a counterexample to a related conjecture (upper density can exceed 1/2). + +The formalization includes [Er78f] and [Er92c] with full bibliographic details, which matches the website. However, **[Fr93] (Freud's construction) is not mentioned** in the formalization. While Freud's result concerns a related but distinct conjecture (upper density > 1/2), the website lists it as a key result and it would be worth noting in the docstring for completeness. + +**Verdict:** Citations are mostly accurate. Consider adding a note about Freud's 1993 result and the related problems #359 and #867 mentioned on the website. + +## 3. Variants + +The website poses two questions: +1. Is $\limsup a_n / n = \infty$? — **Captured** as `erdos_839`. +2. Does $(1/\log x) \sum_{a_n < x} 1/a_n \to 0$? — **Captured** as `erdos_839.variants.stronger`. + +The website also mentions: +- Erdős showed $\liminf a_n/n < \infty$ is achievable — **Not captured** (but this is a known result, not a conjecture). +- $\sum_{a_n < x} 1/a_n \gg \log \log x$ is possible — **Not captured** (again a known result). +- Upper density can be $\geq 19/36$ (Freud) — **Not captured** (distinct conjecture, arguably out of scope). + +**Verdict:** Both conjectured variants from the problem statement are captured. The omitted items are known results or related conjectures, not variants of the core problem. Coverage is adequate. + +## 4. Readability + +The code is generally clear and well-structured. Minor observations: + +- The `SumOfConsecutiveFree` definition is well-named and well-documented with a docstring explaining the mathematical content. +- The use of `∃ᶠ n in atTop, M < (a n : ℝ) / (n : ℝ)` to express $\limsup a_n/n = \infty$ is idiomatic in Mathlib style. +- Part 2's inline sum expression is somewhat dense: `(∑ n ∈ (Finset.range x).filter (fun n => a n < x), (1 / (a n : ℝ))) / Real.log (x : ℝ)`. Using `Set.HasLogDensity` would improve readability. +- The `open Filter Real Finset` is clean and appropriate. + +**Verdict:** Good readability overall. Part 2 could be improved by using the existing `Set.HasLogDensity` abstraction. + +## 5. Formalizability + +The original problem statement is: + +> *Let $1 \leq a_1 < a_2 < \cdots$ be a sequence of integers where no $a_i$ is the sum of consecutive $a_j$ for $j < i$.* + +This is precise and unambiguous. The key phrase "sum of consecutive $a_j$ for $j < i$" clearly means a contiguous block $a_j + a_{j+1} + \cdots + a_k$ where $k < i$. The two questions (limsup and log-density) are standard analytic statements. + +One minor point of potential ambiguity: "sum of consecutive $a_j$" could theoretically mean a single term (when $j = k$), which would forbid $a_i = a_j$ for $j < i$. But this is automatically satisfied by the strict monotonicity assumption, so the formalization's inclusion of the $j = k$ case in `Finset.Icc j k` is harmless. + +**Verdict:** The problem is clearly formalizable with no meaningful ambiguity. Assessment: **unambiguous**. + +## 6. Correctness + +### Part 1 (`erdos_839`) + +The formalization states: +``` +∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + ∀ M : ℝ, ∃ᶠ n in atTop, M < (a n : ℝ) / (n : ℝ) +``` + +This correctly captures "$\limsup a_n/n = \infty$": for every bound $M$, the ratio $a_n/n$ exceeds $M$ frequently (infinitely often). The condition is wrapped in `answer(sorry)` since the problem asks whether this is true. + +**Potential issue — 0-indexing vs 1-indexing:** The mathematical problem uses a 1-indexed sequence $a_1 < a_2 < \cdots$. The formalization uses `a : ℕ → ℕ` which is 0-indexed. Since `StrictMono a` and `∀ n, 1 ≤ a n` are imposed, the value `a 0` is included in the sequence. The `SumOfConsecutiveFree` condition quantifies over all `i`, including `i = 0`, but since there's no valid `j ≤ k < 0`, it's vacuously true at `i = 0`. The limsup condition includes $n = 0$ where $a_0 / 0$ is undefined (division by zero in the reals gives 0 in Lean/Mathlib), but since `∃ᶠ` only cares about the tail behavior, this is harmless. **No mathematical error.** + +**`SumOfConsecutiveFree` definition check:** +``` +∀ i : ℕ, ∀ j k : ℕ, j ≤ k → k < i → a i ≠ ∑ l ∈ Finset.Icc j k, a l +``` +This says: for every index $i$, and for every contiguous block $[j, k]$ with $k < i$, we have $a_i \neq \sum_{l=j}^{k} a_l$. This correctly captures the condition. Note that this forbids $a_i$ from equaling any contiguous sub-sum of the *entire* earlier sequence (not just sums starting from the beginning), which matches the problem statement. + +### Part 2 (`erdos_839.variants.stronger`) + +The formalization states: +``` +∀ (a : ℕ → ℕ), (∀ n, 1 ≤ a n) → StrictMono a → SumOfConsecutiveFree a → + Tendsto (fun x : ℕ => + (∑ n ∈ (Finset.range x).filter (fun n => a n < x), (1 / (a n : ℝ))) / + Real.log (x : ℝ)) + atTop (nhds 0) +``` + +**Issue — summation variable semantics:** The sum `∑ n ∈ (Finset.range x).filter (fun n => a n < x)` sums over *indices* $n < x$ such that $a_n < x$. The mathematical statement asks for $\sum_{a_n < x} 1/a_n$, which sums over all indices $n$ (with no bound on $n$ itself) such that $a_n < x$. However, since `a` is strictly monotone from $\mathbb{N}$ to positive integers, `StrictMono a` implies $a_n \geq n$ (by a simple induction: $a_0 \geq 1 > 0$, and $a_{n+1} > a_n \geq n$ so $a_{n+1} \geq n+1$). Wait — actually, $a_n \geq n+1$ since $a_0 \geq 1$ and strict monotonicity on naturals gives $a_n \geq n + 1 > n$. So if $a_n < x$, then $n < x$, meaning $n \in \text{Finset.range } x$. Therefore the filter condition `n ∈ Finset.range x ∧ a n < x` is equivalent to just `a n < x` (the `Finset.range x` part is redundant but not incorrect). **No mathematical error.** + +**Issue — the sum counts $n = 0$:** For $n = 0$, we include $1/a_0$ in the sum. The mathematical problem starts with $a_1$, but the extra term $1/a_0$ is a single constant that becomes negligible after dividing by $\log x$. This doesn't affect the limit. **No mathematical error.** + +**Issue — `Real.log` at small values:** When $x = 0$ or $x = 1$, $\log x \leq 0$, making the quotient either 0/0 or negative. But `Tendsto ... atTop ...` only cares about eventual behavior, so this is irrelevant. **No issue.** + +**Verdict:** Both parts are mathematically correct. The formalization faithfully captures the problem as stated on erdosproblems.com. The 0-indexing shift is handled correctly by the strictness of the monotonicity condition. The `Finset.range x` bound in Part 2 is redundant but not harmful. diff --git a/ai-review/84.md b/ai-review/84.md new file mode 100644 index 0000000000..7e48715651 --- /dev/null +++ b/ai-review/84.md @@ -0,0 +1,114 @@ +# Review: Erdős Problem 84 + +**File:** `FormalConjectures/ErdosProblems/84.lean` + +## 1. Code Reuse + +**Issue found.** The definition `cycleSpectrum` in this file is *identical* to `cycleLengths` defined independently in both `ErdosProblems/751.lean:40` and `ErdosProblems/752.lean:38`: + +```lean +-- Erdos 84 (cycleSpectrum) +{ℓ : ℕ | ∃ v : V, ∃ p : G.Walk v v, p.IsCycle ∧ p.length = ℓ} + +-- Erdos 751 and 752 (cycleLengths) +{n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} +``` + +These are definitionally equal (up to the binder name `ℓ` vs `n`). All three files define this concept locally within their own namespace. This should be consolidated into a single shared definition — either in `FormalConjecturesForMathlib` or a shared utility — and reused across Problems 84, 751, and 752. The name `cycleLengths` (used in 751/752) is arguably more standard terminology than `cycleSpectrum`, though "cycle spectrum" also appears in the literature. + +## 2. Citations + +The docstring references match the website with one omission: + +| Citation | In Docstring | On Website | Notes | +|----------|:---:|:---:|-------| +| [Er94b] | ✅ | ✅ | Erdős (1997), Discrete Math. 165/166 | +| [Er95] | ✅ | ✅ | Erdős (1997), Discrete Math. 164 | +| [Er96] | ✅ | ✅ | Erdős (1992), Matematiche (Catania) 47 | +| [Er97d] | ✅ | ✅ | Erdős, combinatorial number theory | +| [Ve04] | ✅ | ✅ | Verstraëte (2000), Combin. Probab. Comput. 9 | +| [Ne25] | ❌ | ✅ | **Missing.** Nenadov (2025), improved bound to f(n) ≪ 2^{n − n^{1/2 − o(1)}} | + +The Nenadov result [Ne25] is mentioned in the *body* of the `erdos_84.variants.subexponential` docstring ("improved by Nenadov to...") but is not given a formal citation entry. It should be added as a full citation line, e.g.: + +``` +[Ne25] Nenadov, R., ... +``` + +(The exact bibliographic details should be confirmed from the website or the paper itself.) + +## 3. Variants + +Two issues: + +**a) Missing variant.** The website notes that the existence and value of **lim f(n)^{1/n}** is an open question. This is a natural companion to the two parts formalized here and is not captured. It could be formalized as: + +```lean +/-- Does lim_{n→∞} f(n)^{1/n} exist? -/ +theorem erdos_84.variants.limit_exists : + ∃ L : ℝ, Filter.Tendsto (fun n => (cycleSetCount n : ℝ) ^ ((1 : ℝ) / n)) + Filter.atTop (nhds L) := by + sorry +``` + +**b) The two formalized parts are well-chosen.** Part 2 (open, f(n)/2^{n/2} → ∞) is the main theorem, and Part 1 (solved, f(n) = o(2^n)) is correctly placed as a variant. The naming `erdos_84.variants.subexponential` clearly communicates its content. + +## 4. Readability + +The code is clean and readable overall. Minor suggestions: + +- The docstring labels "Part 2" and "Part 1" appear in reverse order in the file (Part 2 first as the main theorem, Part 1 second as the variant). While the Lean naming convention justifies this (open problem first), a reader encountering "Part 2" before "Part 1" may be momentarily confused. A brief note explaining the ordering convention (e.g., "the open part is the primary statement") would help. +- The definition `cycleSetCount` uses `Set.ncard` on a set of sets. This is appropriate since the set `{A : Set ℕ | ∃ G : SimpleGraph (Fin n), cycleSpectrum G = A}` is not naturally a `Finset`, and `Set.ncard` handles this gracefully (returning 0 for infinite sets, which can't happen here). This is consistent with codebase conventions. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The original problem is stated precisely: define cycle sets of graphs on n vertices, count them, and prove asymptotic bounds. The two conjectured asymptotics — f(n) = o(2^n) and f(n)/2^{n/2} → ∞ — have unambiguous mathematical meanings that translate directly to ε-N and B-N statements. + +The only minor source of ambiguity is whether "graph on n vertices" means labeled or unlabeled graphs. The formalization uses `SimpleGraph (Fin n)`, which considers all simple graphs on a fixed labeled vertex set. Since the cycle spectrum depends only on the isomorphism class, this doesn't affect the *set* of realizable cycle spectra — any cycle spectrum achievable by an unlabeled graph on n vertices is achievable by some labeled graph on `Fin n`, and vice versa. So the formalization is equivalent regardless of interpretation. + +## 6. Correctness + +**Assessment: Correct and complete (for the parts formalized).** + +**`cycleSpectrum` (line 50):** Correctly captures the set of all cycle lengths in a simple graph. Uses `Walk v v` (closed walk) with `IsCycle` (which in Mathlib requires the walk to be a closed trail with distinct internal vertices, i.e., a proper cycle). This matches the standard graph-theoretic definition. + +**Implicit constraint A ⊆ {3,...,n}:** The original problem states cycle sets are subsets of {3,...,n}. This is automatically satisfied: +- Lower bound: In a simple graph, any cycle has length ≥ 3 (no self-loops, no multi-edges, and `IsCycle` requires length ≥ 3). +- Upper bound: A graph on n vertices cannot contain a cycle of length > n (a cycle visits distinct vertices). + +So the formalization correctly omits this constraint — it is a theorem, not an axiom. + +**`cycleSetCount` (line 54):** Correctly counts the number of distinct realizable cycle spectra by taking `Set.ncard` of the image. Note that this counts the *distinct sets A* (not the number of graphs), which is the right quantity. + +**`erdos_84` (line 63, Part 2, open):** The statement + +``` +∀ B > 0, ∃ N, ∀ n ≥ N, f(n) ≥ B · 2^{n/2} +``` + +correctly formalizes "f(n)/2^{n/2} → ∞". The use of `(n : ℝ) / 2` (real division) is correct — this gives 2^{n/2} as a real number (i.e., √(2^n)), which matches the standard meaning of 2^{n/2} in the conjecture. Using integer division ⌊n/2⌋ would give a slightly weaker (and non-standard) statement. + +**`erdos_84.variants.subexponential` (line 79, Part 1, solved):** The statement + +``` +∀ ε > 0, ∃ N, ∀ n ≥ N, f(n) ≤ ε · 2^n +``` + +correctly formalizes "f(n) = o(2^n)". + +**Category tags:** `research open` for Part 2 and `research solved` for Part 1 are both correct per the website. + +**No mathematical flaws identified.** The formalization is faithful to the original problem statement. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs work | `cycleSpectrum` duplicates `cycleLengths` from Problems 751, 752 | +| Citations | ⚠️ Minor gap | Missing formal citation for [Ne25] (Nenadov 2025) | +| Variants | ⚠️ Minor gap | Missing lim f(n)^{1/n} variant noted on the website | +| Readability | ✅ Good | Clean code; minor note about Part 1/Part 2 ordering | +| Formalizability | ✅ Excellent | Unambiguous, directly formalizable | +| Correctness | ✅ Correct | Mathematically faithful to the original problem | diff --git a/ai-review/840.md b/ai-review/840.md new file mode 100644 index 0000000000..dd0ba6a3f5 --- /dev/null +++ b/ai-review/840.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 840 + +## 1. Code Reuse + +Several related definitions exist in the codebase that could potentially be consolidated: + +- **`IsSidon` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean:38`**: A general `IsSidon` definition for `Set α` exists in the shared library. While quasi-Sidon is a distinct concept (relaxation of the Sidon condition), the relationship is not referenced. +- **`maxSidonSubsetCard` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean:131`**: Uses the same `powerset.filter ... .sup Finset.card` pattern as `maxQuasiSidonCard`. This structural pattern is repeated across many problems (861, 862, 864, etc.). No shared abstraction exists, but the duplication is minor and idiomatic for this codebase. +- **Problem 864 (`864.lean`)**: Defines `IsAlmostSidon` and `maxAlmostSidonCard` for a closely related problem (864 is described as "a weaker form of Problem 840"). The structural parallels are strong, but the mathematical definitions are genuinely different, so code sharing is not straightforward. +- **Problem 819 (`819.lean`)**: Uses `open scoped Pointwise` and `A + A` in the same way. Shares the `[ErFr91]` reference. The problems are described as "closely connected" on the website. + +**Verdict**: No significant reuse opportunities. The definitions are appropriately problem-specific. + +## 2. Citations + +The website ([erdosproblems.com/840](https://www.erdosproblems.com/840)) lists the following references: + +| Ref | Website | Formalization | Status | +|-----|---------|---------------|--------| +| [Er81h] | Erdős, p. 175 | — | **Missing** | +| [ErFr91] | Erdős & Freud (1991) | `[ErFr91] Erdős, P. and Freud, R., 1991.` | Present but incomplete — missing title | +| [Er92c] | Erdős (1992) | — | **Missing** | +| [Pi06] | Pikhurko (2006) | `[Pi06] Pikhurko, O., 2006.` | Present but incomplete — missing title | + +**Issues**: +- [Er81h] and [Er92c] are not mentioned. These appear to be where Erdős originally posed the problem. +- [ErFr91] should include the title. Problem 864 gives it as: *"On Sidon-sequences and related problems"*. +- [Pi06] should include the title for completeness. +- The website also notes related problems [30], [819], and [864], which are not cross-referenced in the docstring. + +## 3. Variants + +**Captured**: +- Main open problem (`erdos_840`): asks for the asymptotic constant. +- Lower bound (`erdos_840.variants.lower_bound`): the Erdős–Freud bound 2/√3. +- Upper bound (`erdos_840.variants.upper_bound`): the Pikhurko bound ≈ 1.863. + +**Not captured**: +- **Difference-set analogue**: The website states "The analogous problem with A−A is simpler; the maximum size is ∼N^{1/2} (proved by Cilleruelo)." This solved variant is absent. +- **Connection to Problem 864**: The website and Problem 864 itself note that 864 is "a weaker form of Problem 840." A cross-reference or implication variant could be valuable. + +## 4. Readability + +The code is well-structured and readable. Minor observations: + +- The docstring for `IsQuasiSidon` (line 45–48) correctly explains the parametrized δ-version and its relationship to the asymptotic definition. This is helpful. +- The module docstring clearly states the problem, known bounds, and references. +- The naming convention (`maxQuasiSidonCard`, `IsQuasiSidon`) is consistent with the rest of the codebase (cf. `maxAlmostSidonCard`, `maxSidonSize`, `maxB2rSize`). +- The parameter order in `erdos_840` is `∀ δ, ∀ ε`, while in the variants it is `∀ ε, ∀ δ`. This inconsistency is cosmetic but slightly surprising. Since the main theorem's answer depends on neither δ nor ε, the order doesn't matter logically, but consistency would improve readability. + +## 5. Formalizability + +**Assessment: Well-formalized with minor subtlety.** + +The original problem uses the asymptotic notation |A+A| = (1+o(1))·C(|A|,2), which is inherently about sequences of sets, not individual sets. The formalization handles this correctly by: + +1. Defining `IsQuasiSidon δ A` as a pointwise condition: |A+A| ≥ (1−δ)·C(|A|,2). +2. Defining `maxQuasiSidonCard δ N` as the max cardinality over δ-quasi-Sidon subsets of {1,…,N}. +3. Universally quantifying over δ > 0 in the theorem statements to recover the asymptotic. + +The one-sided condition (≥ rather than both ≥ and ≤) is justified because the upper bound |A+A| ≤ C(|A|,2) + |A| = (1 + 2/(|A|−1))·C(|A|,2) is automatic, and |A| → ∞ in the regime of interest (since f(N) ~ c√N). + +The problem is stated as "How does f(N) grow?" — an open-ended question. The formalization interprets this as asking for the precise asymptotic constant c such that f(N) ~ c√N. This is a reasonable and standard interpretation, but it is a specific choice: the problem could also be interpreted as asking for the growth rate up to constant factors (which is already known to be Θ(√N)). The formalization's interpretation — pinning down the exact constant — is the more ambitious and mathematically interesting reading. + +**Ambiguity level**: Low. The Θ(√N) growth rate is established; the remaining question is the constant. + +## 6. Correctness + +**Overall: Correct, with one mathematical observation.** + +### Definition correctness + +`IsQuasiSidon δ A` compares |A+A| with (1−δ)·C(|A|,2). Here C(n,2) = n(n−1)/2 counts unordered pairs of distinct elements. For a Sidon set of size n, |A+A| = C(n,2) + n (the C(n,2) off-diagonal sums plus n diagonal sums 2a). So a Sidon set satisfies |A+A| > C(n,2), making it δ-quasi-Sidon for all δ > 0. This is correct. + +### Bound verification + +- **Lower bound**: 2/√3 ≈ 1.1547. The formalization uses `2 / Real.sqrt 3`, which is correct. +- **Upper bound**: (1/4 + 1/(π+2)²)^{−1/2} ≈ 1.8640. The formalization computes `Real.sqrt ((1/4 + 1/(Real.pi + 2)^2)⁻¹)`, which equals √((1/4 + 1/(π+2)²)⁻¹) = (1/4 + 1/(π+2)²)^{−1/2}. Numerically: 1/4 + 1/(π+2)² ≈ 0.25 + 0.03783 ≈ 0.28783, inverse ≈ 3.4742, square root ≈ 1.864. **Correct.** + +### Main theorem structure + +The main theorem asserts the existence of a single constant `answer(sorry)` (independent of δ) such that `maxQuasiSidonCard δ N` is within ε√N of this constant times √N, for all δ > 0 and ε > 0 and sufficiently large N. This correctly formalizes "f(N) ~ c√N" where c does not depend on δ. The independence from δ is mathematically justified (as argued above). + +### Potential concern + +The `maxQuasiSidonCard` definition uses `Finset.sup` over a `Finset ℕ` (since `Finset.card` has type `Finset α → ℕ` and `ℕ` has a `Bot` instance with ⊥ = 0). If no δ-quasi-Sidon set exists in {1,…,N}, the sup returns 0. For N ≥ 1 and δ > 0, the singleton {1} is trivially δ-quasi-Sidon (since |{1}+{1}| = 1 and C(1,2) = 0, so the condition 1 ≥ (1−δ)·0 = 0 holds), so `maxQuasiSidonCard δ N ≥ 1` for N ≥ 1. No issue here. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No significant opportunities | +| Citations | Incomplete — missing [Er81h], [Er92c], and titles for [ErFr91], [Pi06] | +| Variants | Missing difference-set analogue (Cilleruelo) | +| Readability | Good; minor parameter-order inconsistency between main theorem and variants | +| Formalizability | Well-formalized; low ambiguity | +| Correctness | Mathematically correct; definitions, bounds, and theorem structure are sound | diff --git a/ai-review/841.md b/ai-review/841.md new file mode 100644 index 0000000000..9a22039d2c --- /dev/null +++ b/ai-review/841.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 841 + +## 1. Code Reuse + +**`largestPrimeFactor`**: Problem 841 defines `largestPrimeFactor` as `(Nat.primeFactors n).sup id`. Two other implementations of the same concept exist in the codebase: + +- **`Nat.maxPrimeFac`** in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` (line 28): defined as `sSup {p : ℕ | p.Prime ∧ p ∣ n}`. This definition comes with proven lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`) that would be useful for the proofs here. +- **`Erdos928.largestPrimeFactor`** in `FormalConjectures/ErdosProblems/928.lean` (line 59): defined as `if h : n.primeFactors.Nonempty then n.primeFactors.max' h else 0`. + +All three definitions agree on their output (returning the largest prime factor for `n ≥ 2` and `0` otherwise), but having three separate definitions is redundant. **Recommendation**: Replace the local `largestPrimeFactor` with `Nat.maxPrimeFac` from `MaxPrimeFac.lean`, which already has a supporting lemma library. Problem 928 should similarly be updated. + +**`HasSquareProductSubset`**: No existing equivalent was found. The definition is specific to this problem and appropriately scoped. + +## 2. Citations + +The website (erdosproblems.com/841) lists: + +| Citation | Website | Formalization | Status | +|----------|---------|---------------|--------| +| Problem attribution | "Erdős, Graham, and Selfridge" | "A problem of Erdős, Graham, and Selfridge" | **OK** | +| [ErSe92] | Erdős, Graham, and Selfridge | "Erdős, P. and Selfridge, J. L., 1992" | **Issue**: Graham is omitted from the [ErSe92] citation line, despite being mentioned in the attribution. The reference tag itself ("ErSe" = Erdős–Selfridge) may be the original convention, but the result is attributed jointly with Graham on the website. | +| [BPZ24] | Bui, Pratt, and Zaharescu (2024) | "Bui, H. M., Pratt, K., and Zaharescu, A., 2024" | **OK** | +| [Gu04] | Guy's collection, Problem B30 | Not mentioned | **Missing** | +| OEIS A092487 | Referenced on website | Not mentioned | **Minor omission** (informational, not critical) | +| Related Problem 437 | Referenced on website | Not mentioned | **Minor omission** | + +**Recommendation**: Clarify whether Graham should appear in the [ErSe92] reference. Consider adding [Gu04] for completeness. + +## 3. Variants + +The formalization captures: + +- **Trivial lower bound** (`erdos_841`): $t_n \geq P(n)$. ✓ +- **Selfridge's exact result** (`selfridge`): $t_n = P(n)$ when $P(n) > \sqrt{2n} + 1$. ✓ +- **Selfridge's upper bound** (`selfridge_upper`): $t_n \ll \sqrt{n}$ when $P(n) \leq \sqrt{2n} + 1$. ✓ +- **BPZ lower bound** (`bpz_lower`): $t_n \geq C (\log\log n)^{6/5} (\log\log\log n)^{-1/5}$ for all large non-square $n$. ✓ + +**Missing from BPZ24**: +- The distributional result: for any fixed $c \in (0,1]$, $t_n$ follows $P(n)$ in a density sense. This is a more nuanced statement about distribution, arguably harder to formalize precisely. +- The upper bound: for at least $x^{1-o(1)}$ many $n \leq x$, $t_n \leq \exp(O(\sqrt{\log n \log\log n}))$. This is a density-based upper bound with little-o notation, which is substantially harder to state formally. + +These omissions are reasonable given the difficulty of formalizing density and asymptotic statements with little-o notation. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `HasSquareProductSubset` could mention that $S$ is a subset of the *consecutive integers* after $n$, making the combinatorial nature clearer. +- The categorization tags are appropriate: `undergraduate` for the trivial bound, `research solved` for the others. +- The `open Finset` at the top is clean and appropriate since the file makes heavy use of finset operations. + +No significant readability issues. + +## 5. Formalizability + +The original problem states: "Estimate $t_n$." This is inherently imprecise — "estimate" in number theory means "find good upper and lower bounds," but does not specify which bounds. The formalization handles this well by decomposing into specific known results (trivial bound, Selfridge's theorem, BPZ bound). + +**Ambiguity level: Low.** The definition of $t_n$ itself is completely precise. The only ambiguity is in "estimate," which the formalization resolves by stating concrete bounds. The problem is marked as SOLVED on the website (resolved in some way other than a full proof or disproof), consistent with the formalization capturing specific partial results. + +## 6. Correctness + +### Definition correctness + +- **`HasSquareProductSubset`**: Correctly requires $S$ to be nonempty and a subset of $\{n+1, \ldots, n+t\}$ (using `Finset.Icc`), with `IsSquare (n * S.prod id)`. Matches the problem statement. ✓ + +- **`erdos841T`**: Uses `sInf` on `ℕ`, which returns `0` for the empty set. If no valid $t$ exists for some non-square $n$, this would silently return `0`, conflating it with the perfect-square case. However, for any non-square $n \geq 2$, a valid $t$ always exists (by a pigeonhole argument on squarefree parts in a sufficiently long interval), so this is not a practical concern. Still, a cleaner approach might guard against this with an auxiliary well-definedness lemma. **Minor issue.** + +- **`largestPrimeFactor`**: `(Nat.primeFactors n).sup id` returns `0` when `n ≤ 1` (empty factor set) and the largest prime factor otherwise. This matches the intended semantics. ✓ + +### Theorem correctness + +- **`erdos_841` (trivial lower bound)**: $t_n \geq P(n)$ for non-square $n \geq 2$. This is a well-known elementary fact: if $p = P(n)$ divides $n$, then for $n \cdot \prod S$ to be a perfect square, at least one element of $S$ must be divisible by $p$, and the smallest such element in $\{n+1, \ldots, n+t\}$ requires $t \geq p$. ✓ + +- **`erdos_841.variants.selfridge`**: When $P(n) > \sqrt{2n} + 1$, $t_n = P(n)$. Combined with the lower bound, this means one needs to show that the subset $S = \{n + P(n)\}$ (or some subset within $\{n+1, \ldots, n+P(n)\}$) makes $n \cdot \prod S$ a perfect square. This is Selfridge's result. The condition is correctly stated with the real-valued inequality. ✓ + +- **`erdos_841.variants.selfridge_upper`**: The existential form $\exists C > 0, \forall n \geq 2, \ldots$ correctly captures the asymptotic $t_n \ll \sqrt{n}$ statement. ✓ + +- **`erdos_841.variants.bpz_lower`**: The bound $t_n \geq C (\log\log n)^{6/5} (\log\log\log n)^{-1/5}$ for $n \geq N_0$ correctly captures the BPZ result. The use of `Real.log` (natural logarithm) is standard. The negative exponent $-(1/5)$ correctly encodes the denominator. The existential quantification over both $C$ and $N_0$ is the standard way to formalize "for all sufficiently large $n$." ✓ + +### Overall assessment + +The formalization is **mathematically correct and complete** for the results it captures. No flaws were identified in the definitions or theorem statements. The primary recommendations are: +1. Consolidate `largestPrimeFactor` with the existing `Nat.maxPrimeFac` utility. +2. Clarify the Graham attribution in [ErSe92]. +3. The missing BPZ distributional/upper-bound results are reasonable omissions. diff --git a/ai-review/842.md b/ai-review/842.md new file mode 100644 index 0000000000..67a51bd1d0 --- /dev/null +++ b/ai-review/842.md @@ -0,0 +1,88 @@ +# Review: Erdős Problem 842 + +## 1. Code Reuse + +The formalization uses `SimpleGraph.chromaticNumber` and the `⊔` lattice operation on `SimpleGraph` from Mathlib, which is appropriate. The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` file contains additional chromatic number utilities (e.g., `le_chromaticNumber_iff_colorable`, `chromaticNumber_le_iff_colorable`), but none are directly applicable here since the theorem is stated as a `sorry`-ed goal. + +The three bespoke definitions (`triangleGraph`, `IsSingleCycle`, `cycleGraphOfPerm`) are purpose-built for this problem and do not duplicate anything in the existing codebase. No existing definitions in `FormalConjecturesForMathlib` could replace them. + +**Verdict:** No code reuse opportunities identified. + +## 2. Citations + +The website [erdosproblems.com/842](https://www.erdosproblems.com/842) lists references **[Er92b]** and **[FlSt92]** without expanded bibliographic details. The formalization's docstring provides full citations: + +- **[Er92b]** Erdős, P., *Some of my favourite problems in various branches of combinatorics*. Matematiche (Catania) 47 (1992), 231–240. +- **[FlSt92]** Fleischner, H. and Stiebitz, M., *A solution to a colouring problem of P. Erdős*. Discrete Math. 101 (1992), 39–48. + +These are consistent with the website's tags and are more detailed than what the website provides. No discrepancies. + +**Verdict:** Citations are correct and appropriately detailed. + +## 3. Variants + +The website lists a single problem statement with no variants, alternative formulations, or generalizations. The formalization captures exactly this one statement. + +**Verdict:** No missing variants. + +## 4. Readability + +The code is well-structured: + +- Each definition (`triangleGraph`, `IsSingleCycle`, `cycleGraphOfPerm`) has a clear docstring explaining its mathematical intent. +- The `triangleGraph` docstring explicitly describes the vertex-to-triangle mapping (vertices 3i, 3i+1, 3i+2 form triangle i). +- The namespace `Erdos842` cleanly scopes the definitions. +- The theorem statement reads naturally from left to right, matching the prose description. + +Minor observations: +- The `IsSingleCycle` definition is clear but could note that it characterizes σ as having a single orbit (i.e., being a full-length cycle). This is mathematically equivalent but might aid a reader unfamiliar with the permutation characterization. +- The disjointness hypothesis (line 74–75) faithfully captures "all new edges" but a reader must mentally parse the double negation (cycle-adjacent implies not triangle-adjacent). + +**Verdict:** Readability is good. No changes needed. + +## 5. Formalizability + +The original problem asks a yes/no question: *"Does G have chromatic number at most 3?"* This is precise and unambiguous. The key components are all well-defined: + +- "n vertex disjoint triangles" — unambiguous. +- "Hamiltonian cycle" — standard graph-theoretic concept. +- "with all new edges" — means the cycle edges are disjoint from the triangle edges. +- "chromatic number at most 3" — standard. + +There is no ambiguity in the problem statement. It is straightforwardly formalizable. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**`triangleGraph n`**: Adjacency is defined as `u ≠ v ∧ u.val / 3 = v.val / 3`. This correctly partitions `Fin (3n)` into n groups of 3 consecutive vertices, each forming a triangle (complete graph on 3 vertices). The `symm` and `loopless` proofs are correct. + +**`IsSingleCycle σ`**: Defined as `∀ u v, ∃ k, (σ ^ k) u = v`. This is equivalent to saying σ acts transitively on `Fin m`, which for a permutation of a finite set means σ is a single m-cycle. This is the correct characterization of a Hamiltonian cycle permutation. + +**`cycleGraphOfPerm σ`**: Adjacency is `u ≠ v ∧ (σ u = v ∨ σ v = u)`. For a single-cycle permutation, this produces exactly the edges of the cycle: each vertex is adjacent to its successor and predecessor under σ. Correct. + +**The theorem statement**: The structure is: +1. `answer(True)` — asserts the answer to the yes/no question is "yes." +2. `∀ n ≥ 1` — quantifies over the number of triangles. +3. `∀ σ, IsSingleCycle σ` — quantifies over all Hamiltonian cycles. +4. Disjointness: cycle edges are not triangle edges (captures "all new edges"). +5. Conclusion: `chromaticNumber ≤ 3` of the union graph. + +This faithfully captures the problem as stated and proved by Fleischner–Stiebitz. + +**Minor note on the `n ≥ 1` guard**: For `n = 0`, the vertex set `Fin 0` is empty, so the statement holds vacuously (chromatic number 0 ≤ 3). For `n = 1`, the three vertices form a single triangle with all three edges present; no Hamiltonian cycle can have "all new edges" since all possible edges are already in the triangle, so the hypothesis is vacuously satisfied. The `n ≥ 1` guard is therefore logically unnecessary (the statement holds for all `n ≥ 0`), but it is not *incorrect* — it merely excludes a trivial case. This is a stylistic choice, not a bug. + +**Verdict:** The formalization is correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------------|------------| +| Code reuse | No opportunities | +| Citations | Correct and detailed | +| Variants | All captured (none exist) | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/843.md b/ai-review/843.md new file mode 100644 index 0000000000..f331a8ffba --- /dev/null +++ b/ai-review/843.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 843 + +## 1. Code Reuse + +The definition `IsRamseyComplete` is duplicated across three files, each in a local namespace: + +- `Erdos843.IsRamseyComplete` (843.lean) — parameterized by `r`, flat existential structure +- `Erdos55.IsRamseyComplete` (55.lean) — parameterized by `r`, nested existential for color witness +- `Erdos54.IsRamsey2Complete` (54.lean) — hard-codes `r = 2`, otherwise matches 55.lean + +All three are logically equivalent but syntactically distinct. There is no shared definition in `FormalConjecturesForMathlib`. This is a clear opportunity for consolidation: a single `IsRamseyComplete` definition in a shared utility file would eliminate the duplication and allow `IsRamsey2Complete` to be expressed as `IsRamseyComplete A 2`. + +No other definitions from the existing codebase (prime gap utilities, etc.) are relevant here. + +## 2. Citations + +The docstring currently reads: + +> **[BuEr85][Er92b][Er95]:** ... Proved by Conlon, Fox, and Pham [CFP21]. + +The website (erdosproblems.com/843) lists the following references: +- **[BuEr85]** — Burr and Erdős (1985), original problem proposal +- **[Er92b]** — Erdős (1992) +- **[Er95]** — Erdős (1995), reported Burr's unpublished proof that k-th powers are Ramsey r-complete for all r, k ≥ 2 +- **[CFP21]** — Conlon, Fox, and Pham (2021), proved the stronger result + +The citations in the code match those on the website. The shorthand references `[BuEr85]`, `[Er92b]`, `[Er95]`, and `[CFP21]` are consistent with the site's notation. **No issues.** + +## 3. Variants + +The website notes that the problem generalizes to k-th powers for any k ≥ 2 and any r ≥ 2, and references related problems **#54** (growth rate bounds for Ramsey 2-complete sets) and **#55** (growth rate bounds for Ramsey r-complete sets for r > 2). + +The module docstring mentions the stronger result (k-th powers contain sparse Ramsey r-complete subsequences for all r, k ≥ 2), but the theorem `erdos_843` only formalizes the base case: squares (k = 2) are Ramsey 2-complete (r = 2). This is appropriate — the problem as posed on the website asks specifically about squares and 2-coloring. The generalization is a separate result. + +**No missing variants** for this specific problem number. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The set `{n : ℕ | ∃ m : ℕ, m ≥ 1 ∧ n = m ^ 2}` could equivalently be written as `{n : ℕ | ∃ m : ℕ, m ≥ 1 ∧ n = m ^ 2}` or `{m ^ 2 | m ∈ Set.Ici 1}` or similar. The current form is clear enough, though one could argue `IsSquare` from Mathlib could be used. However, `IsSquare` in Mathlib includes 0 (since 0 = 0²), and the `m ≥ 1` constraint explicitly excludes 0. For this problem, excluding 0 is immaterial (adding 0 to a sum doesn't change it, and Finset elements are distinct), so the explicit construction is a reasonable choice that makes the intent clear. +- The `IsRamseyComplete` definition is well-structured and self-documenting via its docstring. + +**Readability is good overall.** + +## 5. Formalizability + +The problem as stated on the website is: + +> "Are the squares Ramsey 2-complete? That is, is it true that, in any 2-colouring of the square numbers, every sufficiently large n ∈ ℕ can be written as a monochromatic sum of distinct squares?" + +This is **fully precise and unambiguous**. The notions of "2-colouring," "sufficiently large," "monochromatic," "sum of distinct elements" are all standard and have clear formal counterparts. There is no ambiguity in the statement. **Formalizability: high.** + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **Coloring domain:** The definition colors all of ℕ (`c : ℕ → Fin r`) rather than just the squares. This is equivalent: any coloring of ℕ restricts to a coloring of the squares, and any coloring of the squares extends arbitrarily to ℕ. Since the subset constraint `(↑S : Set ℕ) ⊆ A` ensures only squares are selected, colors of non-squares are irrelevant. + +- **Distinctness:** The use of `Finset ℕ` automatically enforces distinctness of summands, correctly capturing "sum of distinct squares." + +- **Monochromaticity:** The condition `∀ s ∈ S, c s = a` correctly requires all elements of S to share a single color `a`. + +- **"Sufficiently large":** The `∃ N₀, ∀ n ≥ N₀` quantifier structure correctly captures "every sufficiently large natural number." + +- **Exclusion of 0:** The constraint `m ≥ 1` excludes 0 from the set of squares. This is mathematically inconsequential (0 contributes nothing to a sum), so it neither helps nor harms correctness. + +- **`answer(True)`:** Since the problem is proved (answer is yes), `answer(True)` correctly records the expected outcome. + +- **Theorem statement:** `answer(True) ↔ IsRamseyComplete {n : ℕ | ∃ m : ℕ, m ≥ 1 ∧ n = m ^ 2} 2` correctly states that the set of positive perfect squares is Ramsey 2-complete. + +**No mathematical flaws identified. The formalization is correct and complete.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | `IsRamseyComplete` is duplicated in 3 files; could be consolidated | +| Citations | Correct and consistent with website | +| Variants | Base case captured; generalization noted in docstring | +| Readability | Good | +| Formalizability | High — no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/844.md b/ai-review/844.md new file mode 100644 index 0000000000..bde9e6b653 --- /dev/null +++ b/ai-review/844.md @@ -0,0 +1,103 @@ +# Review: Erdős Problem 844 + +## 1. Code Reuse + +**Squarefree utilities exist but are not needed here.** The file `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` defines `squarefreePart` and `squarePart` for decomposing integers, and `FormalConjecturesForMathlib/Algebra/Powerfree.lean` defines a generalized `Powerfree` predicate. However, problem 844 only uses Mathlib's built-in `Squarefree` predicate, which is sufficient. The `extremalSet` definition and the theorem statement are self-contained and don't benefit from any custom utility code. + +The sibling problem 848 (`FormalConjectures/ErdosProblems/848.lean`) follows a very similar structural pattern (extremal set definition + cardinality bound), and extracts the condition into a named `def` (`NonSquarefreeProductProp`). Problem 844 could optionally do the same for consistency, but this is cosmetic. + +**No reuse opportunities identified.** + +## 2. Citations + +The website (erdosproblems.com/844) attributes the problem to **Erdős and Sárközy** with reference **[Er92b, p.239]**, and credits **Weisenberg** and **Alexeev, Mixon, and Sawin** for proofs. + +The formalization's docstring cites: +- `[Er92b] Erdős, P. and Sárközy, A., on products of elements not being squarefree (1992).` +- `[AMS25] Alexeev, B., Mixon, D., and Sawin, W. (2025).` + +**Issues:** +- The `[Er92b]` citation lacks a publication venue/title. The website does not provide more detail than "Er92b, p.239" either, so this is acceptable given the source, but note the title appears to be informal/fabricated rather than an actual paper title. +- The `[AMS25]` citation lacks a paper title or venue. The website doesn't provide one either, so this is consistent with available information. +- The website also mentions the connection to **problem 701** (Chvátal's conjecture) as part of Weisenberg's proof strategy. This cross-reference is not mentioned in the docstring. Consider adding: "The proof reduces to Chvátal's result; see also problem [701] and [848]." + +## 3. Variants + +The website states a single problem with no variants. The formalization captures the problem as stated. + +**One subtlety:** The website's proof sketch by Weisenberg decomposes the problem into two parts: (a) the extremal set must contain all non-squarefree numbers, and (b) among squarefree numbers, the largest intersecting family (by shared prime factors) is the set of all even squarefree numbers (via Chvátal/problem 701). One could formalize these intermediate steps as lemmas, but this is not required for a problem statement file. + +**No missing variants.** + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The `extremalSet` docstring says "even or not squarefree" which correctly describes `Even n ∨ ¬Squarefree n`. The equivalence to "even numbers and odd non-squarefree numbers" is mentioned in the theorem docstring. This is clear. +- For consistency with problem 848 (which defines `NonSquarefreeProductProp`), the condition `∀ a ∈ A, ∀ b ∈ A, ¬Squarefree (a * b)` could be extracted into a named predicate. This would also make the theorem statement shorter and more scannable. However, this is optional since the condition is only used once. +- The docstring could mention the connection to problem 848 (the analogous problem for $ab + 1$) and problem 701 (Chvátal's conjecture, used in the proof). + +**Overall readability: good.** + +## 5. Formalizability + +The problem as stated on the website is: + +> Let $A \subseteq \{1, \ldots, N\}$ be such that for all $a, b \in A$, the product $ab$ is not squarefree. Is the maximum size of such a set achieved by taking $A$ to be the set of even numbers and odd non-squarefree numbers? + +**Assessment: clearly formalizable, low ambiguity.** + +The only potential ambiguity is whether "for all $a, b \in A$" includes the case $a = b$. Standard mathematical convention includes $a = b$ unless explicitly stated otherwise ("for all distinct $a, b$"). The formalization correctly uses `∀ a ∈ A, ∀ b ∈ A`, which includes the diagonal. This matters: it excludes 1 from any valid set (since $1 \cdot 1 = 1$ is squarefree), which is consistent with the extremal set definition (1 is odd and squarefree, so it is excluded). + +## 6. Correctness + +### 6.1 The extremal set definition + +`extremalSet N = (Finset.Icc 1 N).filter (fun n => Even n ∨ ¬Squarefree n)` + +This correctly captures "even numbers and odd non-squarefree numbers in $\{1, \ldots, N\}$": +- Even numbers: included by `Even n` +- Odd non-squarefree numbers: included by `¬Squarefree n` (and they happen to be odd) +- Odd squarefree numbers (like 1, 3, 5, 15, ...): excluded (both disjuncts are false) + +The union "even ∪ non-squarefree" equals "even ∪ (odd ∧ non-squarefree)" which is precisely the intended set. ✓ + +### 6.2 The extremal set satisfies the condition + +For any $a, b$ in the extremal set, $ab$ is not squarefree because: +- If both are even: $4 \mid ab$, so $ab$ is not squarefree. ✓ +- If one is non-squarefree: some $p^2 \mid a$, so $p^2 \mid ab$. ✓ +- If both are even and squarefree: $2 \mid a$ and $2 \mid b$, so $4 \mid ab$. ✓ + +All cases produce a squared prime factor in the product. ✓ + +### 6.3 The theorem statement + +The theorem asserts the upper bound: any valid $A$ satisfies $|A| \leq |\text{extremalSet}(N)|$. + +**Observation:** The formalization only states the upper bound, not that the extremal set itself satisfies the condition. The original problem asks "is the maximum size **achieved** by [the extremal set]?", which implicitly requires both: +1. The extremal set is a valid set (satisfies the condition) +2. No valid set is larger + +The formalization captures (2) but not (1). However, (1) is straightforward and the `answer(True)` wrapper implicitly asserts the answer is yes. This is a **minor incompleteness** — the formalization is correct for the harder direction, and the easier direction could be added as a separate lemma for full rigor, but this is standard practice in the codebase. + +### 6.4 Edge cases + +- **N = 0:** `Finset.Icc 1 0 = ∅`, so `extremalSet 0 = ∅` and the only valid $A$ is `∅`. The theorem holds vacuously. ✓ +- **N = 1:** `Finset.Icc 1 1 = {1}`. Since $1 \cdot 1 = 1$ is squarefree, $A$ cannot contain 1. So the maximum is 0, matching `extremalSet 1 = ∅` (1 is odd and squarefree). ✓ +- **N = 2:** `extremalSet 2 = {2}` (2 is even). A valid set can include {2} since $2 \cdot 2 = 4$ is not squarefree. ✓ + +### 6.5 Verdict + +**The formalization is mathematically correct.** The only minor point is that it captures the upper bound but not the achievability of the extremal set. This is a standard and acceptable simplification. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No opportunities identified | +| Citations | Acceptable given website sources; could add cross-references to problems 701 and 848 | +| Variants | Complete — no missing variants | +| Readability | Good; optional extraction of condition into named def for consistency with 848 | +| Formalizability | Clearly formalizable, low ambiguity | +| Correctness | Correct; minor incompleteness (upper bound only, not achievability) | diff --git a/ai-review/852.md b/ai-review/852.md new file mode 100644 index 0000000000..e28a4077de --- /dev/null +++ b/ai-review/852.md @@ -0,0 +1,122 @@ +# AI Review: Erdős Problem 852 + +## 1. Code Reuse + +**Issue found.** The file defines its own `Erdos852.nthPrime` and `Erdos852.primeGap` locally: + +```lean +noncomputable def nthPrime (n : ℕ) : ℕ := Nat.nth Nat.Prime n +noncomputable def primeGap (n : ℕ) : ℕ := nthPrime (n + 1) - nthPrime n +``` + +A shared definition already exists at `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean`: + +```lean +noncomputable def primeGap (n : ℕ) : ℕ := (n + 1).nth Nat.Prime - n.nth Nat.Prime +``` + +These are definitionally equal. Since `ProblemImports` transitively imports `FormalConjecturesForMathlib` (which includes `PrimeGap.lean`), the shared `primeGap` is already in scope. Problem 853, a closely related problem about prime gaps, correctly uses the shared `primeGap` without redefining it. Problem 852 should do the same — remove `nthPrime` and `Erdos852.primeGap` and use the top-level `primeGap` directly. + +If the `nthPrime` helper is desired for readability in `IsDistinctPrimeGapRun` or elsewhere, it could be retained as a local abbreviation, but the `primeGap` duplication should be eliminated. + +## 2. Citations + +The docstring cites: + +> [Er85c] Erdős, P., *Some problems and results on combinatorial number theory* (1985). + +The website ([erdosproblems.com/852](https://www.erdosproblems.com/852)) lists the original source as **[Er85c]** with no further bibliographic expansion. The expanded citation in the formalization is a reasonable rendering. The website also notes related OEIS sequences **A001223**, **A053597**, and **A078515**, which are not mentioned in the formalization but are not strictly required. + +**No issues.** The citation is consistent with the website. + +## 3. Variants + +The website poses two questions as the core of Problem 852: + +1. Is it true that $h(x) > (\log x)^c$ for some constant $c > 0$? +2. Is it true that $h(x) = o(\log x)$? + +Both are captured by the formalization: `erdos_852` handles (1) and `erdos_852.variants.upper_bound` handles (2). + +**Minor note:** The website presents both questions on equal footing as parts of the same problem, rather than one being a "variant." Labeling the upper bound as `.variants.upper_bound` is an organizational choice, not a mathematical error, but it slightly misrepresents the problem's structure — both questions are equally central. + +The website also mentions Brun's sieve implies $h(x) \to \infty$, which is noted in the module docstring but not formalized as a separate statement. This is a known result rather than an open question, so omitting it as a formal theorem is reasonable. + +**All variants captured.** + +## 4. Readability + +The code is well-structured and readable: + +- The definitions (`nthPrime`, `primeGap`, `IsDistinctPrimeGapRun`, `h`) are clearly documented with docstrings that connect Lean names to the mathematical notation ($p_n$, $d_n$, $h(x)$). +- The use of `Function.Injective` for `IsDistinctPrimeGapRun` is idiomatic and clean. +- The theorem statements clearly separate the lower bound and upper bound questions. + +**One suggestion:** If the local `nthPrime`/`primeGap` definitions are removed (per §1), the `IsDistinctPrimeGapRun` definition should reference the top-level `primeGap` directly, which would be equally readable. + +## 5. Formalizability + +The problem as stated on the website is precise and unambiguous: + +- $d_n = p_{n+1} - p_n$ is well-defined. +- $h(x)$ as the maximal length of a run of distinct consecutive gaps for some $n < x$ is well-defined. +- Both questions (lower bound $(\log x)^c$, upper bound $o(\log x)$) are standard asymptotic statements. + +**Assessment: Fully formalizable, no ambiguity.** The only interpretive choice is whether "$n < x$" refers to the index $n$ or the prime $p_n$ being less than $x$. The website uses index-based language ("for some $n < x$"), and the formalization correctly follows this. An alternative reading where $p_n < x$ would give a different (but related) function; the chosen interpretation matches the source. + +## 6. Correctness + +### Definition of `h` + +```lean +noncomputable def h (x : ℕ) : ℕ := + sSup {k : ℕ | ∃ n, n < x ∧ IsDistinctPrimeGapRun n k} +``` + +**Analysis of `sSup` usage:** In Lean 4/Mathlib, `ℕ` has `ConditionallyCompleteLinearOrderBot`, where: +- `sSup ∅ = 0` (i.e., `⊥`). +- For nonempty bounded sets, `sSup` returns the maximum. +- For unbounded sets, `sSup` returns 0 (a junk value). + +For any finite $x$, the set $\{k \mid \exists n < x, \text{IsDistinctPrimeGapRun}(n, k)\}$ is: +- **Nonempty** (for $x > 0$): $k = 0$ and $k = 1$ are always in the set (vacuous/trivial injectivity). +- **Bounded above**: For any fixed $n$, the maximum run length is finite (by pigeonhole on gap values in any bounded region), and there are finitely many $n < x$. + +So `sSup` correctly computes the maximum for all $x > 0$. For $x = 0$, the set is empty and $h(0) = 0$, which is a harmless edge case. **No issues.** + +### Theorem `erdos_852` (Lower Bound) + +```lean +theorem erdos_852 : answer(sorry) ↔ + ∃ c : ℝ, c > 0 ∧ + ∃ N₀ : ℕ, ∀ x : ℕ, x ≥ N₀ → + (h x : ℝ) > (Real.log (x : ℝ)) ^ c +``` + +This correctly formalizes: "there exists $c > 0$ such that for sufficiently large $x$, $h(x) > (\log x)^c$." The cast to `ℝ` is necessary since `Real.log` returns a real. **Correct.** + +### Theorem `erdos_852.variants.upper_bound` + +```lean +theorem erdos_852.variants.upper_bound : answer(sorry) ↔ + ∀ ε : ℝ, ε > 0 → + ∃ N₀ : ℕ, ∀ x : ℕ, x ≥ N₀ → + (h x : ℝ) < ε * Real.log (x : ℝ) +``` + +This formalizes $h(x) = o(\log x)$: for every $\varepsilon > 0$, eventually $h(x) < \varepsilon \log x$. This is the standard $\varepsilon$-$N$ definition of little-$o$. **Correct.** + +### Overall Correctness + +Both theorems are mathematically correct formalizations of the two questions posed in Erdős Problem 852. The definitions faithfully capture the intended mathematical objects. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | **Action needed** — local `primeGap`/`nthPrime` duplicate the shared `primeGap` from `FormalConjecturesForMathlib/NumberTheory/PrimeGap.lean` | +| Citations | Consistent with website | +| Variants | All captured (minor: upper bound labeled as "variant" rather than co-equal question) | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/854.md b/ai-review/854.md new file mode 100644 index 0000000000..0a622fb9e9 --- /dev/null +++ b/ai-review/854.md @@ -0,0 +1,83 @@ +# AI Review: Erdős Problem 854 + +## 1. Code Reuse + +**Significant overlap with Problem 235** (`FormalConjectures/ErdosProblems/235.lean`). + +Problem 235 defines nearly identical infrastructure: +- `Erdos235.primorial` — uses `∏ i ∈ Finset.range k, nth Nat.Prime i` (product form) +- `Erdos854.primorial` — uses a recursive definition `Nat.nth Nat.Prime k * primorial k` + +These compute the same function but are defined independently. Similarly: +- `Erdos235.sortedCoprimes` filters `Finset.range n` for coprimality (includes 0 if coprime) +- `Erdos854.coprimeList` filters `Finset.range n` with the extra guard `0 < a` + +Both problems would benefit from a shared primorial definition (perhaps in `FormalConjecturesForMathlib/Data/Nat/Prime/`) and a shared sorted-coprimes-to-n utility. The `consecutiveDiffs` helper in 854 could also be reused by 235 or any future problem involving gap analysis on sorted lists. + +No other definitions in `FormalConjecturesForMathlib` (density, arithmetic progressions, Sidon sets, etc.) are directly applicable here. + +## 2. Citations + +The formalization's docstring references `[Er85c, Ob1]`. The website ([erdosproblems.com/854](https://www.erdosproblems.com/854)) cites **[Er85c, p.80]** and **[Ob1]**, noting the problem was asked at Oberwolfach (most likely 1986). + +**Issue:** The page number `p.80` is missing from the `[Er85c]` citation in the docstring. The module docstring states "(most likely in 1986)" which is consistent with the website. Full bibliographic expansions of [Er85c] and [Ob1] are not provided on the website either, so no further detail can be added. + +## 3. Variants + +The website describes **three** aspects of the problem: + +1. **Estimate the smallest even integer absent** from the set of gap differences `{a_{i+1} - a_i}`. +2. **Are there ≫ max_i(a_{i+1} - a_i) many even integers** among the gap differences? +3. **Estimate the set of indices** where the maximum gap is achieved. + +The formalization **only captures variant (2)**. Variants (1) and (3) are not formalized. This is a notable omission — the problem as stated on the website is really a cluster of three related questions. + +Additionally, the website notes important historical context: Erdős initially conjectured that **all** even integers ≤ max gap appear as differences, but computational work by Lacampagne and Selfridge (for the primorial 2·3·5·7·11·13 = 30030) produced counterexamples, causing him to retreat to the weaker "≫ many" formulation. This context is absent from the docstring. + +## 4. Readability + +The code is generally well-structured and readable. + +Minor suggestions: +- The `consecutiveDiffs` function uses `List.foldl max 0` in `maxGap` via a separate traversal; this is fine but a comment noting that `maxGap` could alternatively be defined via `List.maximum?` would aid readability. +- The `coprimeList` definition uses `0 < a ∧ Nat.Coprime a n` inside a filter. Since the problem statement explicitly sets `a_1 = 1`, a brief comment explaining why 0 is excluded would help. +- The namespace `Erdos854` is clean and self-contained. + +## 5. Formalizability + +**Assessment: Mostly formalizable, low-to-moderate ambiguity.** + +The core question — whether the count of distinct even gap values is ≫ the maximum gap — is precise enough to formalize. The formalization interprets "≫" as the standard asymptotic lower bound: ∃ C > 0, ∃ K₀, ∀ k ≥ K₀, count ≥ C · max_gap. This is the natural and standard interpretation. + +The `answer(sorry)` wrapper is appropriate for an open problem whose truth value is unknown. + +The main ambiguity source is in the omitted variants — "estimate" in parts (1) and (3) is genuinely vague and would require choosing a specific asymptotic form to formalize. + +## 6. Correctness + +**The formalization of variant (2) appears mathematically correct**, with one subtle point worth verifying: + +**Correct aspects:** +- `primorial` correctly computes the product of the first k primes (primorial 0 = 1, primorial 1 = 2, primorial 2 = 6, primorial 3 = 30). +- `coprimeList n` correctly produces the sorted list of integers in {1, ..., n-1} coprime to n. The endpoints 1 and n-1 are always included (since gcd(1, n) = 1 and gcd(n-1, n) = 1 for n ≥ 2). +- `consecutiveDiffs` correctly computes the list of successive differences. +- `gapValues` collects distinct gap values via `.toFinset`. +- The theorem filters for `Even` gap values and compares their count to `C * maxGap`, matching the problem statement. + +**Potential concern:** +- The `coprimeList` uses `Finset.range n`, which produces {0, 1, ..., n-1}, then filters for `0 < a`. For `n = primorial 0 = 1`, `Finset.range 1 = {0}`, and filtering for `0 < a` gives an empty list, so `gapValues 1 = ∅` and `maxGap 1 = 0`. The theorem's existential `∃ K₀` allows ignoring small k, so this edge case is harmless. +- The formalization counts **distinct even values** among the gaps, not the **number of gaps that happen to be even**. This matches the problem statement ("how many even integers are of the form a_{j+1} - a_j"), which asks about the set of even integers representable as gaps, not about the multiplicity. + +**Incompleteness:** +- As noted in §3, only 1 of 3 sub-questions is formalized. This is a deliberate modeling choice (the other parts are harder to make precise), not an error. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Duplicate primorial/coprime infrastructure with Problem 235; should be unified | +| Citations | Missing page number `p.80` from [Er85c] reference | +| Variants | Only 1 of 3 sub-questions formalized; missing historical context about Erdős's retracted stronger conjecture | +| Readability | Good; minor comment improvements possible | +| Formalizability | Low-to-moderate ambiguity; chosen variant is precise | +| Correctness | Mathematically correct for the variant it captures | diff --git a/ai-review/856.md b/ai-review/856.md new file mode 100644 index 0000000000..a55bcdd087 --- /dev/null +++ b/ai-review/856.md @@ -0,0 +1,129 @@ +# Review: Erdős Problem 856 + +## 1. Code Reuse + +**Problem 858** (`FormalConjectures/ErdosProblems/858.lean`) has a nearly identical structure: `weakPrimitiveMaxSum` uses the same `sSup {x : ℝ | ∃ A : Finset ℕ, A ⊆ Finset.Icc 1 N ∧ A ∧ x = ∑ n ∈ A, (1 : ℝ) / (n : ℝ)}` pattern as `fk`. No shared abstraction exists, but extracting a generic "max harmonic sum over constrained subsets of Icc 1 N" helper into `FormalConjecturesForMathlib` could benefit both problems. + +`FormalConjecturesForMathlib/Algebra/GCDMonoid/Finset.lean` defines `lcmInterval` for LCM over intervals — potentially useful for proofs but not directly reusable for the definition. + +The `NoPairwiseLcmClique` definition follows a pattern similar to `IsSidon` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (pairwise property via universal quantifiers). No existing definition captures pairwise-LCM-equal cliques; the current definition is appropriately custom. + +**Verdict:** No immediate code reuse opportunities for the definitions. The structural parallel with 858 is noted but doesn't warrant refactoring unless a shared pattern emerges across more problems. + +## 2. Citations + +The website ([erdosproblems.com/856](https://www.erdosproblems.com/856), last edited 18 January 2026) lists: + +- **[Er70]**: Erdős, P. (1970) — the formalization has `[Er70] Erdős, P. (1970)`. ✅ Matches, though neither source provides a full paper title or journal. +- **[TaZh25b]**: Tang, R. and Zhang, R. (2025) — the formalization has `[TaZh25b] Tang, R. and Zhang, R. (2025)`. ✅ Matches. + +The website also mentions connections to: +- **Problem #536** (natural density variant: if |A| ≥ εN, must A contain a 3-element subset with all pairwise LCMs equal?) +- **Problem #857** (sunflower conjecture) + +The docstring for `tang_zhang_upper` references Problem 857, which is good. Problem 536 is not mentioned. Consider adding a note in the module docstring: "See also problem #536 for a natural density variant." + +**Verdict:** Citations match the website. Minor improvement: mention Problem 536 in the module docstring. + +## 3. Variants + +The formalization captures three statements: +1. `erdos_856`: Erdős upper bound f_k(N) ≤ C · log N / log log N ✅ +2. `tang_zhang_lower`: Lower bound f_k(N) ≥ C · (log N)^b ✅ +3. `tang_zhang_upper`: Upper bound f_k(N) ≤ C · (log N)^c ✅ + +**Missing variants:** +- **Problem 536 connection (natural density, k=3):** The website explicitly links to Problem 536, which asks whether A ⊆ {1,…,N} with |A| ≥ εN must contain three elements with all pairwise LCMs equal. This is the "counting" (as opposed to "logarithmic weight") version of the k=3 case. This is a separate problem (536.lean) and not necessarily a variant of 856, so omission is reasonable. +- **Specific exponent values for k=3:** Tang–Zhang proved (log N)^{0.438} ≤ f_3(N) ≤ (log N)^{0.889} (approximately). The formalization uses existentially quantified exponents rather than pinning down specific values. This is a reasonable design choice since the exact constants are secondary, but a variant with the explicit k=3 bounds would be more informative. +- **Conditional relationship with sunflower conjecture:** The docstring for `tang_zhang_upper` states "The exponents c_k are < 1 … if and only if the sunflower conjecture [857] holds," but this is NOT captured in the formal statement. This is a notable omission — see §6. + +**Verdict:** The main bounds are captured. The conditional relationship to the sunflower conjecture (857) is documented but not formalized. + +## 4. Readability + +The code is clean and well-organized. Specific observations: + +- **`NoPairwiseLcmClique`**: The name is descriptive and the docstring is clear. The definition uses a natural three-level quantifier structure (∀ S ⊆ A, |S| = k → ¬∃ L, …). This is readable. +- **`fk`**: Short name, but adequately documented. The subscript notation f_k(N) from the problem is preserved. +- **Theorem names**: `erdos_856`, `erdos_856.variants.tang_zhang_lower`, `erdos_856.variants.tang_zhang_upper` follow project conventions. +- **Module docstring**: Concise and informative, includes the mathematical definition and problem statement. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The original problem is: *"Estimate f_k(N)."* + +This is inherently vague — "estimate" does not specify what form the answer should take. The formalization resolves this ambiguity by stating specific upper and lower bounds from the literature. This is a reasonable and standard approach. + +The definition of "no k-element subset with the same pairwise least common multiple" is precise and unambiguous. The formalization captures it faithfully. + +**Ambiguity assessment: Low.** The only ambiguity is in "estimate," which is appropriately resolved by formalizing known bounds. The underlying combinatorial definitions (pairwise LCM clique, harmonic sum optimization) are mathematically precise. + +## 6. Correctness + +### Definition: `NoPairwiseLcmClique` + +Mathematically correct. For S ⊆ A with |S| = k, it asserts there is no single value L such that lcm(a, b) = L for all distinct a, b ∈ S. This correctly captures "no k-element subset where all pairwise LCMs coincide." + +Note: Since A ⊆ Icc 1 N, the elements are all ≥ 1, so `Nat.lcm` behaves as expected (no issues with lcm(0, n) = 0). + +### Definition: `fk` + +Uses `sSup` over the set of achievable harmonic sums. The set is: +- **Nonempty**: A = ∅ satisfies the constraints (vacuously), giving x = 0. +- **Bounded above**: Any A ⊆ Icc 1 N gives ∑ 1/n ≤ ∑_{n=1}^N 1/n < log N + 1. + +So `sSup` is well-defined and equals the maximum. ✅ + +### Theorem: `erdos_856` (Erdős upper bound) + +Statement: ∀ k ≥ 3, ∃ C > 0, ∃ N₀, ∀ N ≥ N₀, f_k(N) ≤ C · log N / log(log N). + +This matches the known result from [Er70]. **Correct.** ✅ + +### Theorem: `tang_zhang_lower` + +Statement: ∀ k ≥ 3, ∃ b ∈ (0, 1], ∃ C > 0, ∃ N₀, ∀ N ≥ N₀, f_k(N) ≥ C · (log N)^b. + +The actual Tang–Zhang result gives specific exponents b_k (e.g., b_3 ≈ 0.438). The formalization existentially quantifies b, making it a weaker but still nontrivial statement: f_k(N) grows at least as a positive power of log N. This is meaningful since, for example, summing over primes in [1, N] gives only ∑ 1/p ~ log log N = (log N)^{o(1)}, so a polynomial power of log N is a substantive lower bound. **Correct**, though weaker than the full result. ✅ + +### ⚠️ Theorem: `tang_zhang_upper` — POTENTIAL TRIVIALITY + +Statement: ∀ k ≥ 3, ∃ c ∈ (0, 1], ∃ C > 0, ∃ N₀, ∀ N ≥ N₀, f_k(N) ≤ C · (log N)^c. + +**This statement is trivially true with c = 1.** Setting c = 1, the claim becomes f_k(N) ≤ C · log N. Since f_k(N) ≤ ∑_{n=1}^N 1/n ≤ log N + 1, choosing C = 2 and N₀ = 3 suffices. The theorem as formalized has no nontrivial content. + +The *actual* content of the Tang–Zhang upper bound is that c_k < 1 (strictly), which improves over the trivial log N bound. The docstring even states this: "The exponents c_k are < 1 (improving over the trivial bound) if and only if the sunflower conjecture [857] holds for k-sunflowers." But the formal statement allows c = 1, nullifying this. + +**Fix:** Change `c ≤ 1` to `c < 1` to capture the actual result: +```lean +∃ c : ℝ, 0 < c ∧ c < 1 ∧ ... +``` + +However, this introduces a subtlety: per the docstring, c_k < 1 holds *if and only if* the sunflower conjecture holds for k-sunflowers. The sunflower conjecture (Problem 857) is still open. If the "iff" characterization is accurate, then asserting c < 1 unconditionally would be asserting a consequence of an unproven conjecture, and the tag `category research solved` would be incorrect. One should verify the Tang–Zhang paper: do they prove c_k < 1 unconditionally, or only conditionally on the sunflower conjecture? + +If unconditional: change to `c < 1` and keep `solved`. +If conditional on sunflower conjecture: either (a) keep `c ≤ 1` but acknowledge the triviality in a comment, or (b) formalize the conditional statement explicitly, e.g.: +```lean +theorem erdos_856.variants.tang_zhang_conditional (k : ℕ) (hk : k ≥ 3) + (hsunflower : ) : + ∃ c : ℝ, 0 < c ∧ c < 1 ∧ ... := by sorry +``` + +### Tags + +All three theorems are tagged `category research solved`. The overall Problem 856 is listed as **OPEN** on the website, since tight asymptotics for f_k(N) are unknown. However, each individual theorem formalizes a *specific proven bound*, not the full estimation problem. Tagging each as `solved` is defensible but could be confusing. Consider adding a comment noting that the overall problem remains open. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse needed; structural parallel with 858.lean noted | +| Citations | ✅ Match website. Minor: mention Problem 536 | +| Variants | Main bounds captured. Sunflower conditional not formalized | +| Readability | ✅ Good | +| Formalizability | ✅ Low ambiguity | +| Correctness | ⚠️ `tang_zhang_upper` is **trivially true** as stated (c ≤ 1 allows c = 1). Needs c < 1, but this may be conditional on the sunflower conjecture. All other statements are correct. | diff --git a/ai-review/857.md b/ai-review/857.md new file mode 100644 index 0000000000..5080ce5d1f --- /dev/null +++ b/ai-review/857.md @@ -0,0 +1,126 @@ +# AI Review — Erdős Problem 857 + +**File:** `FormalConjectures/ErdosProblems/857.lean` + +--- + +## 1. Code Reuse + +Problem 20 (`FormalConjectures/ErdosProblems/20.lean`) already defines `IsSunflowerWithKernel` and `IsSunflower` over `Set (Set α)` using `Set.Pairwise`. Problem 857 re-defines `IsSunflower` locally over `Finset (Finset (Fin n))`: + +```lean +-- Problem 20 (general, uses Set.Pairwise): +def IsSunflowerWithKernel (F : Set (Set α)) (S : Set α) : Prop := + F.Pairwise (fun A B => A ∩ B = S) + +-- Problem 857 (Finset-specific, hand-rolled): +def IsSunflower {n : ℕ} (S : Finset (Finset (Fin n))) : Prop := + ∃ K : Finset (Fin n), ∀ A ∈ S, ∀ B ∈ S, A ≠ B → A ∩ B = K +``` + +These are mathematically equivalent but operate on different type universes (`Set` vs `Finset`). The 857 definition could be expressed via coercion to sets and reuse of `Erdos20.IsSunflower`, but the Finset-native formulation is arguably more natural for a problem about finite combinatorics. A unifying approach would be to define the sunflower property via `Finset.Pairwise` (which exists in Mathlib), making the parallel to Problem 20 more explicit: + +```lean +def IsSunflower {n : ℕ} (S : Finset (Finset (Fin n))) : Prop := + ∃ K : Finset (Fin n), S.Pairwise (fun A B => A ∩ B = K) +``` + +This would be cleaner and immediately recognizable as the Finset analogue of Problem 20's definition. No code from `FormalConjecturesForMathlib/` is directly reusable. + +**Recommendation:** Consider refactoring `IsSunflower` to use `Finset.Pairwise` for consistency with Problem 20 and to leverage the existing Mathlib API. + +--- + +## 2. Citations + +The website (erdosproblems.com/857) lists the following references: **Er70, Er71, ErSz78b, ASU13, NaSa17**. + +The formalization's docstring cites only: + +> [NaSa17] Naslund, E. and Sawin, W., _Upper bounds for sunflower-free sets_, 2017. + +This is appropriate since NaSa17 is the reference for the variant theorem. However, the other citations are missing from the module docstring. At minimum, the foundational references (Er70, Er71) for the original problem statement should be included. + +The website also notes connections to **problems #536 and #856**. The formalization's docstring mentions only problem #20. Since 856.lean explicitly states that its exponents are < 1 if and only if conjecture 857 holds, a cross-reference to #856 would be valuable. + +**Recommendation:** Add Er70 and Er71 citations and cross-references to problems #856 and #536 in the module docstring. + +--- + +## 3. Variants + +The formalization includes two statements: +1. **`erdos_857`** — The main open conjecture (for general k ≥ 2, there exists c < 2 such that |F| > c^n forces a k-sunflower). +2. **`erdos_857.variants.naslund_sawin`** — The Naslund–Sawin upper bound for k = 3. + +The website also mentions: +- The connection to the **cap set problem** via Alon, Shpilka, and Umans [ASU13], which showed that sunflower-free families in {0,1}^n correspond to cap sets in F_3^n. This is an important structural insight that could merit a variant or at least a docstring note. +- The problem was "originally formulated by Erdős with 'union' instead of 'intersection'" — this historical note is absent but is not a missing variant per se. + +No lower-bound variants are included (e.g., known constructions of large sunflower-free families), which would round out the picture. + +**Recommendation:** Consider adding a note about the cap set connection [ASU13]. Lower-bound constructions would be a natural addition as variants. + +--- + +## 4. Readability + +The code is concise and well-structured. A few observations: + +- The `IsSunflower` definition's hand-rolled quantifiers (`∀ A ∈ S, ∀ B ∈ S, A ≠ B → ...`) are slightly harder to parse than the equivalent `S.Pairwise (fun A B => A ∩ B = K)`. The latter immediately signals "a pairwise property" to a Lean reader. +- The docstring for `erdos_857` is clear and provides good context about why c < 2 is the meaningful bound. +- The module docstring correctly identifies this as the "weak" sunflower problem and points to #20 for the "strong" version. + +**Overall:** Good readability. Using `Finset.Pairwise` would be a minor improvement. + +--- + +## 5. Formalizability + +The problem as stated on erdosproblems.com is: + +> Let m = m(n,k) be the minimal number such that in any collection of sets A₁,...,Aₘ ⊆ {1,...,n} there must exist a sunflower of size k. Estimate m(n,k). + +"Estimate m(n,k)" is inherently vague — it does not specify whether an upper bound, lower bound, or asymptotic formula is sought. The formalization makes a specific, precise choice: it conjectures the existence of c < 2 with |F| > c^n implying a k-sunflower. This is the standard interpretation of the "weak sunflower conjecture" in the literature and is clearly formalizable. + +The Naslund–Sawin variant formalizes the bound m(n,3) ≤ (3/2^{2/3})^{(1+o(1))n} as: for every ε > 0, for sufficiently large n, |F| > ((3/2^{2/3}) + ε)^n implies a 3-sunflower. This is a correct and standard way to formalize a (1+o(1)) exponent, since adding ε to the base captures the same asymptotic content as (1+ε) in the exponent (both statements are equivalent to limsup(log m(n,3))/n ≤ log(3/2^{2/3})). + +**Assessment:** Low ambiguity. The formalization makes the natural, standard choice. + +--- + +## 6. Correctness + +### Main theorem (`erdos_857`) + +The statement is: +```lean +theorem erdos_857 (k : ℕ) (hk : k ≥ 2) : + ∃ c : ℝ, 0 < c ∧ c < 2 ∧ + ∀ n : ℕ, + ∀ F : Finset (Finset (Fin n)), + (F.card : ℝ) > c ^ n → + ∃ S ⊆ F, S.card = k ∧ IsSunflower S +``` + +**Mathematically correct.** Key observations: + +- `Finset (Finset (Fin n))` correctly models a family of distinct subsets of an n-element ground set (Finset enforces no duplicate elements and no duplicate sets). +- The ground set `Fin n` has 2^n subsets, so the trivial bound is 2^n. The conjecture asserts c < 2. +- The condition `0 < c` is included, which is correct (c = 0 would be trivially false for n > 0). +- No uniformity condition is imposed on the sets in F, correctly distinguishing this from the strong sunflower problem (#20) which requires all sets to have the same cardinality. +- The sunflower S is required to have exactly k members (`S.card = k`), which is the standard formulation. + +**One subtlety:** The conjecture quantifies `∀ n : ℕ`, including n = 0. When n = 0, `Fin 0` is empty, so `Finset (Fin 0)` has one element (the empty set), and `Finset (Finset (Fin 0))` has at most 2 elements ({} and {∅}). For k ≥ 2, any c > 1 trivially satisfies the bound (since c^0 = 1 and |F| ≤ 2). This is not a bug — it's a vacuous edge case that doesn't affect the mathematical content. + +### Naslund–Sawin variant + +The constant 3/2^{2/3} ≈ 1.8899 is correctly rendered. The asymptotic formulation via ε and N₀ is standard and equivalent to the (1+o(1)) exponent as argued above. The specialization to k = 3 matches the Naslund–Sawin result. + +**One potential concern:** The formalization states this as a theorem (to be proved), tagged `category research solved`. This is correct — the Naslund–Sawin result is indeed a proven theorem. + +### `IsSunflower` definition + +The definition `∃ K, ∀ A ∈ S, ∀ B ∈ S, A ≠ B → A ∩ B = K` is the standard sunflower / Δ-system definition. It correctly allows degenerate cases (a set in the sunflower may equal the kernel, i.e., have an empty petal). This matches the convention used in the Erdős–Ko–Rado literature. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. diff --git a/ai-review/858.md b/ai-review/858.md new file mode 100644 index 0000000000..aafb9f0226 --- /dev/null +++ b/ai-review/858.md @@ -0,0 +1,98 @@ +# AI Review: Erdős Problem 858 + +## 1. Code Reuse + +- **`Set.IsPrimitive`** (`FormalConjecturesForMathlib/NumberTheory/Primitive.lean`): The standard primitive set definition (no element divides another) exists in the codebase. The weak primitive condition in 858 is a strict generalization — every primitive set is weak-primitive, but not conversely. The formalization's `IsWeakPrimitive` is a distinct concept and cannot be replaced by `Set.IsPrimitive`, but the docstring could explicitly reference `Set.IsPrimitive` to highlight the relationship (the problem statement already mentions this conceptual connection). + +- **`Set.HasLogDensity`** (`FormalConjecturesForMathlib/Data/Set/Density.lean:196`): This defines logarithmic density as `(1/log n) * Σ_{k ∈ A, k ≤ n} 1/k → d`. The quantity in Erdős 858 is structurally identical — `(1/log N) * Σ_{n ∈ A} 1/n` — but `weakPrimitiveMaxSum` takes the supremum over all qualifying sets `A ⊆ {1,…,N}` rather than studying the density of a fixed set. No direct reuse opportunity, but worth noting for context. + +- No other reuse opportunities identified. The `IsWeakPrimitive` and `weakPrimitiveMaxSum` definitions are problem-specific and appropriately scoped within the `Erdos858` namespace. + +## 2. Citations + +The website ([erdosproblems.com/858](https://www.erdosproblems.com/858)) lists the following references: + +- **[Er70]** — Erdős (1970), page 128 — **Missing from the formalization.** This appears to be the original source where Erdős posed the problem. +- **[Al66]** — Alexander (1966) — Present (as `[Al66]`), though the website title is not given in full; the formalization provides *"Density and sequence of subsets of integers"*. +- **[ESS68]** — Erdős, Sárközi, Szemerédi (1968) — Present (as `[ESS68]`), with title *"On divisibility properties of sequences of integers"*. +- **[Be35]** — Behrend (1935) — Present (as `[Be35]`), with full journal citation. + +The website also notes **"See also Problem 143"** (related to primitive sets), which is not mentioned in the formalization. + +**Recommendation:** Add `[Er70]` to the docstring references and add a cross-reference to Problem 143. + +## 3. Variants + +The formalization captures two statements: + +1. **`erdos_858`** (tagged `solved`): The o(1) result of Alexander and Erdős–Sárközi–Szemerédi — `weakPrimitiveMaxSum(N) ≤ ε · log N` for all N ≥ N₀. +2. **`erdos_858.variants.behrend_type`** (tagged `open`): Whether the Behrend-type bound `C/√(log log N)` holds for weak-primitive sets, formalized as an `answer(sorry)` problem. + +The website marks the overall problem as **OPEN**, which aligns with the interpretation that the o(1) decay rate is known but the precise asymptotics (the "estimate" part) remain open. The Behrend-type variant is a natural conjecture given the analogy to primitive sets. + +**Assessment:** The main open question — estimating the rate of decay — is well captured by the Behrend-type variant. One could also consider a lower-bound variant (does the example set `A = {n ∈ [N^{1/2}, N] : p | n for some prime p > N^{1/2}}` give a matching lower bound?), but this is not explicitly posed on the website and would be speculative. + +## 4. Readability + +The code is well-structured and readable: + +- The `IsWeakPrimitive` definition has a clear docstring explaining the condition in mathematical language. +- The `weakPrimitiveMaxSum` definition is transparent about what it computes. +- The theorem statements have good docstrings with LaTeX. +- The namespace `Erdos858` keeps definitions scoped appropriately. + +**Minor suggestions:** +- The `IsWeakPrimitive` docstring says "with $t > 1$" but the Lean definition enforces this via `a < b` (which implies `b/a > 1` when `a ∣ b` and `a ≥ 1`). This is correct but could be slightly more explicit about the equivalence. +- Consider adding a brief comment that `weakPrimitiveMaxSum` is well-defined (the set is nonempty since `∅` is weak-primitive with sum 0, and bounded above by the harmonic number `H_N`), since `sSup` on `ℝ` requires these conditions for meaningful results. + +## 5. Formalizability + +The problem as stated on the website says **"Estimate the maximum of (1/log N) Σ 1/n."** This is inherently imprecise — "estimate" does not specify what type of bound is sought (upper bound, lower bound, asymptotic equivalence, etc.). + +**Ambiguity assessment: Moderate.** + +- The o(1) result (Theorem `erdos_858`) is an unambiguous known result and is correctly formalized. +- The Behrend-type conjecture (the variant) is a natural reading of the problem: can the known Behrend bound for primitive sets be extended to weak-primitive sets? This is a reasonable interpretation but is one of several possible precise questions. +- The problem could also be read as asking for matching upper and lower bounds (asymptotics), or for the exact order of magnitude. The formalization makes a defensible choice to focus on the upper bound. + +## 6. Correctness + +### `IsWeakPrimitive` definition (lines 52–54) + +The original condition: *"there is no solution to at = b with a, b ∈ A and the smallest prime factor of t is > a."* + +Negating: for all a, b ∈ A with a | b and t = b/a > 1, we need minFac(t) ≤ a. + +The formalization: `∀ a ∈ A, ∀ b ∈ A, a < b → a ∣ b → Nat.minFac (b / a) ≤ a` + +**Analysis:** +- `a < b` with `a ∣ b` and `a ≥ 1` (from `A ⊆ Finset.Icc 1 N`) implies `b/a ≥ 2`, so `Nat.minFac (b/a)` is a genuine prime. **Correct.** +- When `a = b`, the problem condition is vacuous (t = 1 has no prime factors), and the formalization correctly excludes this case via `a < b`. **Correct.** +- When `a` does not divide `b`, no constraint applies, matching the `a ∣ b` guard. **Correct.** +- The `a < b` condition is equivalent to requiring `t > 1` when `a ≥ 1`. The original problem uses unordered `a, b ∈ A`, but `at = b` with `t > 1` forces `b > a`, so the formalization's ordering is without loss of generality. **Correct.** + +### `weakPrimitiveMaxSum` definition (lines 58–61) + +Uses `sSup` over `{x : ℝ | ∃ A, A ⊆ Finset.Icc 1 N ∧ IsWeakPrimitive A ∧ x = Σ ...}`. + +- The set is **nonempty** (the empty finset works, giving sum 0). +- The set is **bounded above** (any sum Σ_{n ∈ A} 1/n for A ⊆ {1,...,N} is ≤ H_N). +- Therefore `sSup` is well-defined in Lean's `ConditionallyCompleteLinearOrder ℝ`. **Correct.** + +### `erdos_858` theorem (lines 72–77) + +States: ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, weakPrimitiveMaxSum(N) ≤ ε · log N. + +This is the standard formalization of "weakPrimitiveMaxSum(N) / log(N) → 0", i.e., the maximum is o(log N). This matches the known result of Alexander and Erdős–Sárközi–Szemerédi. Tagged `solved`. **Correct.** + +### `erdos_858.variants.behrend_type` theorem (lines 87–93) + +States: answer(sorry) ↔ (∃ C > 0, ∃ N₀, ∀ N ≥ N₀, weakPrimitiveMaxSum(N) ≤ C · log(N) / √(log(log N))). + +This asks whether the Behrend bound extends from primitive sets to weak-primitive sets. Tagged `open`. Uses `answer(sorry)` appropriately since the truth value is unknown. **Correct.** + +**Potential edge case:** When N is small, `Real.log (Real.log N)` could be negative or zero (e.g., N = 1: log 1 = 0, log 0 is junk; N = 2: log 2 ≈ 0.69, log 0.69 < 0). The `Real.sqrt` of a negative number returns 0 in Mathlib, making the RHS `C · log(N) / 0`, which is undefined/junk. The `∃ N₀` quantifier protects against this — for sufficiently large N₀, `log(log N) > 0`. This is fine but worth noting. + +### Overall Correctness Verdict + +**The formalization is mathematically correct and complete** for the aspects of the problem it addresses. The `IsWeakPrimitive` definition faithfully captures the stated condition, the o(1) result is correctly formalized, and the Behrend-type variant is a well-motivated open question. No mathematical flaws identified. diff --git a/ai-review/86.md b/ai-review/86.md new file mode 100644 index 0000000000..5e9c2cd4b4 --- /dev/null +++ b/ai-review/86.md @@ -0,0 +1,126 @@ +# Review: Erdős Problem 86 + +**File:** `FormalConjectures/ErdosProblems/86.lean` + +## 1. Code Reuse + +**Significant duplication found.** Both `hypercubeGraph` and `cycleGraph` are defined identically (or near-identically) across multiple files: + +| Definition | Duplicated In | +|-----------|---------------| +| `hypercubeGraph` | 86.lean, 666.lean, 576.lean, 578.lean, 1035.lean | +| `cycleGraph` | 86.lean, 666.lean, 765.lean, 556.lean | + +These should be consolidated into a shared utility (e.g., `FormalConjectures/Util/GraphDefs.lean`) and imported. + +Additionally, the C₄ containment conclusion (lines 80–81) is expressed inline as: + +```lean +∃ f : Fin 4 → (Fin n → Bool), Function.Injective f ∧ + ∀ i j, (cycleGraph 4 (by omega)).Adj i j → H.Adj (f i) (f j) +``` + +This is exactly the pattern captured by `ContainsSubgraph` from `ErdosProblems/87.lean:38–39`: + +```lean +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` + +The conclusion could be rewritten as `ContainsSubgraph H (cycleGraph 4 (by omega))`, which would also match the pattern used in Problems 87, 765, and 576. Problem 666 (the C₆ analogue) has the same inline expansion and would benefit from the same refactor. + +Minor: Problem 86 marks `hypercubeGraph` as `noncomputable def`, while Problem 666's identical definition uses plain `def`. This inconsistency should be reconciled. + +## 2. Citations + +**No full bibliographic entries are provided.** The module docstring references [Er91], [BHN95], [BHLL14], and [Ba12b] in the body text, and lists `[Er90][Er91][Er92b][Er93][Er94b][Er95][Er97f]` at the bottom, but none are expanded into full citation lines. Compare with Problem 666, which provides proper entries like: + +``` +[Er91] Erdős, P., *Some of my favourite problems in various branches of combinatorics*. +Matematiche (Catania) 47 (1992), no. 2, 231-240 (1993). +``` + +The website (erdosproblems.com/86) lists the following references that should have full bibliographic entries: + +| Citation | In Docstring | Full Entry Provided | Notes | +|----------|:---:|:---:|-------| +| [Er90] | ✅ (tag) | ❌ | Needs full entry | +| [Er91] | ✅ (tag + body) | ❌ | Needs full entry | +| [Er92b] | ✅ (tag) | ❌ | Needs full entry | +| [Er93] | ✅ (tag) | ❌ | Website specifies p.343 | +| [Er94b] | ✅ (tag) | ❌ | Needs full entry | +| [Er95] | ✅ (tag) | ❌ | Needs full entry | +| [Er97f] | ✅ (tag) | ❌ | Needs full entry | +| [BHN95] | ✅ (body) | ❌ | Brass, Harborth, Nienborg | +| [BHLL14] | ✅ (body) | ❌ | Balogh, Hu, Lidicky, Liu | +| [Ba12b] | ✅ (body) | ❌ | Baber | + +The website also notes a **$100 reward** for this problem and a relation to **Problem 666** (the C₆ analogue) and **OEIS A245762**. These could be mentioned in the docstring. + +## 3. Variants + +**No missing variants, but a relationship could be noted.** + +The website mentions that "similar questions [are] posed for other even cycles" — the C₆ case is Problem 666 (answered negatively). The formalization captures the core C₄ conjecture correctly. There is no obvious further variant on the website that is not covered. + +One possible enhancement: the known bounds could be formalized as separate lemmas. For example: + +- **Lower bound** (Brass–Harborth–Nienborg): `∃ c > 0, ∀ᶠ n in atTop, f(n) ≥ (1/2 + c/√n) · n · 2^{n-1}` +- **Upper bound** (Baber): `∀ᶠ n in atTop, f(n) ≤ 0.60318 · n · 2^{n-1}` + +These are proven results and could be formalized as `category research solved` statements, but this is optional since the primary conjecture is the main target. + +## 4. Readability + +The code is clean and well-structured. Suggestions: + +- **Use `ContainsSubgraph`** (as noted in §1) to make the theorem statement more concise and match codebase conventions. +- **The docstring is good** — it clearly states the problem, the equivalent reformulation, and known partial results. The LaTeX is well-formatted. +- **Namespace `Erdos86`** is appropriate and consistent with conventions (e.g., `Erdos666`, `Erdos573`). + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The original problem is precisely stated: it asks whether the maximum number of C₄-free edges in Q_n is at most (1/2 + o(1)) · n · 2^{n-1}. The "o(1)" is unambiguous — it means "for every ε > 0, eventually" — and the formalization captures this correctly with the ε-N₀ pattern: + +``` +∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, [subgraphs with ≥ (1/2 + ε)·n·2^{n-1} edges contain C₄] +``` + +All objects involved (hypercube graph, cycle graph, subgraph, edge count) have standard unambiguous definitions. There is no room for differing mathematical interpretations. + +## 6. Correctness + +**Assessment: Correct and faithful to the original problem.** + +Detailed verification: + +**`hypercubeGraph` (line 48):** Vertices are `Fin n → Bool` (i.e., binary strings of length n, giving 2^n vertices). Adjacency requires `u ≠ v` and Hamming distance exactly 1 (via `filter (fun i => u i ≠ v i)).card = 1`). This is the standard definition of Q_n. The `symm` and `loopless` proofs are correct. + +**`cycleGraph` (line 62):** Adjacency on `Fin m` via `i ≠ j ∧ (j = i+1 mod m ∨ i = j+1 mod m)`. This correctly defines the cycle graph C_m for m ≥ 3. The irreflexivity condition `i ≠ j` is necessary to exclude self-loops when m divides 1 (impossible for m ≥ 3, but needed for the `loopless` proof to go through cleanly). For m = 4, this gives edges 0–1, 1–2, 2–3, 3–0, which is C₄. + +**`erdos_86` (line 74):** The formalization correctly encodes: + +1. **Subgraph relation:** `∀ u v, H.Adj u v → (hypercubeGraph n).Adj u v` — H is a spanning subgraph of Q_n (same vertex set, subset of edges). This is correct since H has vertex type `Fin n → Bool`, the same as Q_n. + +2. **Edge threshold:** `(↑(H.edgeFinset.card) : ℝ) ≥ (1/2 + ε) * ↑n * (2 : ℝ) ^ (n - 1 : ℕ)` — the total edge count of Q_n is n · 2^{n-1}, so the threshold (1/2 + ε) · n · 2^{n-1} represents a (1/2 + ε)-fraction of all edges. The use of `(n - 1 : ℕ)` (natural number subtraction) is safe: when n = 0, `n - 1 = 0` and the product `0 * 2^0 = 0`, which is vacuously correct (Q₀ has 0 edges). The existential ∃ N₀ ensures small n values don't cause issues. + +3. **C₄ containment:** The conclusion asserts the existence of an injective graph homomorphism from C₄ into H. This is the standard encoding of "H contains a C₄ as a subgraph." Injectivity ensures the four cycle vertices are distinct; adjacency preservation ensures the cycle edges are present. + +4. **`answer(sorry)` wrapper:** Standard for open problems. Since the problem is open, the answer (True or False) is unknown, so `sorry` is appropriate. + +**Potential edge case — `edgeFinset` decidability:** The term `H.edgeFinset` requires `DecidableRel H.Adj` and `Fintype (Sym2 (Fin n → Bool))`. The latter holds because `Fin n → Bool` is a `Fintype`. The former is provided by `ProblemImports` (which opens `Classical`), so this is fine. No issue. + +**No mathematical flaws identified.** The formalization is a faithful translation of the conjecture as stated on erdosproblems.com. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs work | `hypercubeGraph`, `cycleGraph` duplicated across 5+ files; inline C₄ check should use `ContainsSubgraph` | +| Citations | ⚠️ Needs work | All 10 references lack full bibliographic entries; $100 reward not mentioned | +| Variants | ✅ Good | Core conjecture is captured; no missing variants on website | +| Readability | ✅ Good | Clean code; minor improvement from using `ContainsSubgraph` | +| Formalizability | ✅ Excellent | Unambiguous, directly formalizable | +| Correctness | ✅ Correct | Mathematically faithful to the original problem | diff --git a/ai-review/860.md b/ai-review/860.md new file mode 100644 index 0000000000..b0502c4562 --- /dev/null +++ b/ai-review/860.md @@ -0,0 +1,84 @@ +# Review: Erdős Problem 860 + +## 1. Code Reuse + +No significant reuse opportunities from `FormalConjecturesForMathlib`. The problem is about matching primes to their multiples in intervals — a specific number-theoretic setup that doesn't overlap with the existing Ramsey, coloring, arithmetic progression, or density utilities. + +**Problem 375** (Grimm's conjecture) is structurally related: it also involves an injective assignment of primes to integers with divisibility constraints (`p.Injective ∧ ∀ i, (p i).Prime ∧ p i ∣ n + i + 1`). However, the problems differ enough (375 assigns primes to consecutive composites; 860 assigns multiples to primes in an interval) that the definitions cannot be directly shared. A cross-reference to Problem 375 in the docstring would be appropriate since the website lists them as related. + +## 2. Citations + +The formalization cites only: +- [ErPo80] Erdős, P. and Pomerance, C., *Matching the natural numbers up to n with distinct multiples in another interval*, Nederl. Akad. Wetensch. Indag. Math. (1980). + +The website additionally lists: +- **[Er92c]** — Erdős follow-up work (missing from formalization) +- **[Gu04]** — Guy's collection, Problem B32 (missing from formalization) +- **Related: Problem 375** (not cross-referenced) +- **OEIS sequences A048670 and A058989** (not mentioned) + +These additional references should be included in the docstring for completeness. + +## 3. Variants + +The formalization captures two results: +1. **Upper bound** (Erdős–Pomerance): h(n) ≤ C · n^(3/2) / (log n)^(1/2) +2. **Lower bound** (Ruzsa): h(n)/n → ∞ + +**Missing variant**: The Erdős–Selfridge lower bound h(n) > (3 - o(1))n is mentioned in the docstring but not formalized. This is subsumed by Ruzsa's stronger result h(n)/n → ∞, so omitting it is mathematically justified — Ruzsa's result strictly implies the Erdős–Selfridge bound. No issue here. + +The overall "estimate h(n)" problem is not captured as a separate open conjecture, which would be difficult to formalize precisely since "estimate" is inherently informal. + +## 4. Readability + +The code is well-structured and readable: +- `HasPrimeCovering` is clearly documented and named +- `erdosPomeranceH` has a clear docstring explaining the definition +- The two theorems are cleanly separated with descriptive names +- The namespace `Erdos860` keeps definitions scoped + +Minor suggestions: +- The docstring for `erdosPomeranceH` says "π(n) distinct multiples, one for each prime p ≤ n" — good, this clarifies the relationship between π(n) and the subtype indexing. +- Consider adding a brief note that the overall estimation problem remains open (see §6). + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem as stated on the website says "Estimate h(n)" which is inherently informal and not directly formalizable. However, the formalization wisely sidesteps this by formalizing the two concrete, precisely stated known bounds (the Erdős–Pomerance upper bound and Ruzsa's lower bound). These are unambiguous mathematical statements. + +The definition of h(n) itself is precise and well-formalized: +- The interval (m, m+h) is open, matching the strict inequalities `m < a p ∧ a p < m + h` +- "Distinct integers aᵢ" is captured by `Function.Injective a` +- "pᵢ | aᵢ" is captured by `p.val ∣ a p` +- The indexing by `{p : ℕ // p.Prime ∧ p ≤ n}` correctly identifies all primes up to n + +The only inherent ambiguity is "estimate h(n)" itself, which the formalization handles as well as possible by stating the known bounds. + +## 6. Correctness + +### Definition Correctness + +**`HasPrimeCovering`**: Mathematically correct. The subtype `{p : ℕ // p.Prime ∧ p ≤ n}` correctly ranges over all primes ≤ n (exactly π(n) primes). The function `a` maps each such prime to a natural number, with: +- Injectivity (distinct integers) ✓ +- Strict containment in (m, m+h) ✓ +- Divisibility p | a(p) ✓ + +**`erdosPomeranceH`**: Uses `sInf` on ℕ, which returns 0 for the empty set. The set `{h : ℕ | ∀ m : ℕ, m ≥ 1 → HasPrimeCovering n m h}` is nonempty for any n (a sufficiently large h always works since there are only finitely many primes ≤ n, each with multiples spaced at most n apart). So the `sInf` is well-defined and meaningful. + +### Theorem Correctness + +**`erdos_860` (upper bound)**: Correctly formalizes h(n) ≪ n^(3/2)/(log n)^(1/2) using the standard asymptotic formulation with an explicit constant C > 0 and threshold N₀. ✓ + +**`erdos_860.variants.lower_ruzsa` (lower bound)**: Correctly formalizes h(n)/n → ∞ using `Tendsto ... atTop atTop`. ✓ + +### Status Concern + +**Both theorems are tagged `category research solved`**, which is accurate for the individual bounds (they are proved results). However, the website marks Problem 860 as **OPEN** — the overall estimation problem (closing the gap between the Ω(n · ω(n))-type lower bound and O(n^(3/2)/(log n)^(1/2)) upper bound) remains unsolved. The docstring should note that while these bounds are established, the problem of determining the true order of h(n) is still open. + +### Summary + +The formalization is **mathematically correct and complete** for the results it captures. No flaws are identified in the definitions or theorem statements. The main gaps are: +- Missing references ([Er92c], [Gu04]) +- Missing cross-reference to related Problem 375 +- The docstring should clarify that the overall estimation problem is open, even though the individual bounds are proved diff --git a/ai-review/861.md b/ai-review/861.md new file mode 100644 index 0000000000..466fc0e008 --- /dev/null +++ b/ai-review/861.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 861 + +## 1. Code Reuse + +**Issue: Duplicated `IsSidonSet` definition.** + +`IsSidonSet` is defined locally in `Erdos861` (line 52) and again identically in `Erdos862` (line 49). Meanwhile, a shared, more general definition `IsSidon` already exists in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 38), operating on `Set α` over any `AddCommMonoid α`: + +```lean +def IsSidon (A : Set α) : Prop := ∀ᵉ (i₁ ∈ A) (j₁ ∈ A) (i₂ ∈ A) (j₂ ∈ A), + i₁ + i₂ = j₁ + j₂ → (i₁ = j₁ ∧ i₂ = j₂) ∨ (i₁ = j₂ ∧ i₂ = j₁) +``` + +The local `IsSidonSet` on `Finset ℕ` is semantically equivalent to `IsSidon (↑S : Set ℕ)`. Refactoring to use the shared `IsSidon` (or a `Finset`-level wrapper around it) would eliminate duplication across problems 861, 862, 863, 864, and others. The shared file also contains useful lemmas (`IsSidon.subset`, `IsSidon.insert`, `IsSidon.avoids_isAPOfLength_three`) that may benefit downstream reasoning. + +## 2. Citations + +**Issue: Likely incorrect citation for [Er92c].** + +The docstring gives: +> [Er92c] Erdős, P., *Some of my favourite problems in number theory, combinatorics, and geometry*, Resenhas (1995). + +Problem 862's docstring gives a different expansion for the same code: +> [Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania) 47 (1992), no. 2, 231–240. + +The code [Er92c] in the Erdős bibliography standardly refers to the 1992 Matematiche paper. The "Resenhas (1995)" paper is a different publication. The 861 docstring should be corrected to match 862's citation (and the standard bibliography). + +**Missing cross-reference.** The website notes "See also problem 862" — this relationship is not mentioned in the docstring. Given that 862 directly concerns the counting of *maximal* Sidon sets and the results are closely intertwined (Saxton–Thomason's lower bound is used in both), a cross-reference would be valuable. + +**Website status.** The website lists the status as "SOLVED" with the note "This has been resolved in some other way than a proof or disproof." This aligns with the formalization's `category research solved` tag, since both questions were resolved (one affirmatively, one negatively) via quantitative bounds rather than a single proof/disproof. + +**OEIS sequences.** The website references OEIS sequences A143824, A227590, A003022, A143823. These are not mentioned in the docstring (low priority, but could be informative). + +## 3. Variants + +**Partial coverage.** The original problem poses two questions: + +1. "Is it true that A(N)/2^{f(N)} → ∞?" — Formalized as `erdos_861` (answer: True). ✓ +2. "Is it true that A(N) = 2^{(1+o(1))f(N)}?" — **Not directly formalized** (answer: False). + +The lower bound variant (`erdos_861.variants.lower`) *implies* the negative answer to question 2 (since the exponent is at least 1.16, the o(1) claim fails), but the negative answer is never stated as a standalone theorem. A direct formalization would strengthen completeness, e.g.: + +```lean +/-- The second question of Erdős Problem 861 is false: A(N) ≠ 2^{(1+o(1))f(N)}. +More precisely, for large N, A(N) ≥ 2^{1.16·f(N)}, so the ratio +log₂(A(N))/f(N) does not tend to 1. -/ +theorem erdos_861.variants.second_question_negative : answer(False) ↔ ... +``` + +The quantitative bounds (`erdos_861.variants.lower` and `erdos_861.variants.upper`) are well-chosen and match the website's stated best bounds. + +## 4. Readability + +The code is clean and readable. A few minor observations: + +- The `open Finset Filter` on line 47 is appropriate for the definitions used. +- The docstrings provide clear mathematical context with LaTeX. +- The namespace `Erdos861` keeps definitions local, which is fine but contributes to the duplication issue noted in §1. +- The constant `1.16` and `6.442` are hardcoded as real number literals. A brief comment noting these are the best known constants (as of Saxton–Thomason 2015 and Kohayakawa–Lee–Rödl–Samotij 2015 respectively) would help future readers assess whether they need updating. + +## 5. Formalizability + +**Assessment: Clearly formalizable. Low ambiguity.** + +The problem statement is fully precise: +- "Sidon set" has a standard, unambiguous definition (all pairwise sums distinct). +- f(N) and A(N) are concrete combinatorial quantities over finite sets. +- The asymptotic questions (→ ∞ and = 2^{(1+o(1))f(N)}) have standard formal interpretations via filters. + +The only minor subtlety is the formalization of "2^{(1+o(1))f(N)}" in question 2, which requires expressing that log₂(A(N))/f(N) → 1. This is a standard asymptotic notion and well within the scope of Lean/Mathlib's filter framework. + +## 6. Correctness + +**Overall: Correct, with one subtle point worth verifying.** + +### `IsSidonSet` (line 52) +Correctly captures the Sidon set property: all pairwise sums a+b = c+d imply {a,b} = {c,d} as multisets. The quantifiers range over all elements (including a = b), which is the standard convention. + +### `maxSidonSize` (line 57) +Uses `Finset.sup Finset.card` over the filtered powerset. Since `ℕ` has `OrderBot` with `⊥ = 0`, `sup` returns 0 on an empty finset. However, the empty set ∅ is always a Sidon set (vacuously), so the filter is never empty, and this edge case is harmless. The definition correctly computes the maximum cardinality of a Sidon subset of {1, ..., N}. + +### `countSidonSubsets` (line 62) +Correctly counts the number of Sidon subsets of {1, ..., N} using `.card` on the filtered powerset. This matches A(N) in the problem statement. + +### `erdos_861` (line 70) +The statement `Tendsto (fun N => (countSidonSubsets N : ℝ) / (2 : ℝ) ^ (maxSidonSize N)) atTop atTop` correctly formalizes "A(N)/2^{f(N)} → ∞". The division is well-defined since 2^n > 0 for all n. The `answer(True)` wrapper correctly indicates the affirmative resolution. + +### `erdos_861.variants.lower` (line 82) +The statement `∃ N₀, ∀ N ≥ N₀, (countSidonSubsets N : ℝ) ≥ (2 : ℝ) ^ ((1.16 : ℝ) * (maxSidonSize N : ℝ))` correctly formalizes the Saxton–Thomason lower bound. The existential quantifier over N₀ properly captures "for all sufficiently large N." + +### `erdos_861.variants.upper` (line 93) +Analogous structure for the upper bound. Correct. + +**One mathematical note:** The bounds on the website are stated as holding "for large N" with implicit o(1) terms. The formalization uses exact constants 1.16 and 6.442 without o(1) error terms, which is a slightly stronger statement than what appears on the website (where the bounds are `2^{(1.16+o(1))f(N)}` etc.). In practice, the formalized versions (with existential N₀) are correct — the o(1) terms are absorbed by choosing N₀ large enough. This is a valid and clean formalization choice. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs improvement | `IsSidonSet` duplicated; shared `IsSidon` exists | +| Citations | ⚠️ Needs correction | [Er92c] citation likely wrong; missing cross-ref to 862 | +| Variants | ⚠️ Partial | Second question's negative answer not directly stated | +| Readability | ✅ Good | Clean, well-documented | +| Formalizability | ✅ Excellent | Fully precise, low ambiguity | +| Correctness | ✅ Correct | Mathematically sound formalization | diff --git a/ai-review/862.md b/ai-review/862.md new file mode 100644 index 0000000000..0aea204042 --- /dev/null +++ b/ai-review/862.md @@ -0,0 +1,118 @@ +# Review: Erdős Problem 862 + +## 1. Code Reuse + +**Significant reuse opportunity identified.** The file defines its own `Erdos862.IsSidonSet` and `Erdos862.IsMaximalSidonIn` on `Finset ℕ`, but `FormalConjecturesForMathlib/Combinatorics/Basic.lean` already provides: + +- `IsSidon (A : Set α)` (line 38) — a generic Sidon set definition for any `AddCommMonoid`. +- `Set.IsMaximalSidonSetIn (A : Set ℕ) (N : ℕ)` (line 104) — maximal Sidon sets in `{1, …, N}`, with the same mathematical content as `Erdos862.IsMaximalSidonIn`. +- Supporting lemmas: `IsSidon.subset`, `IsSidon.insert`, decidability for `Finset`, `maxSidonSubsetCard`. + +The local `IsSidonSet` in Problem 862 is mathematically identical to `IsSidon` restricted to `Finset ℕ` (viewed as `Set ℕ`). The local `IsMaximalSidonIn` is identical to `Set.IsMaximalSidonSetIn` except for two superficial differences: +1. Problem 862 uses `Finset.Icc 1 N` while the library version uses `Set.Icc 1 N`. +2. Problem 862 uses `S ∪ {x}` while the library version uses `A ∪ {x}` (both operating on the appropriate type). + +**Recommendation:** Replace the local definitions with the library versions. The `countMaximalSidon` function would need to be adapted (it currently filters `Finset.powerset`), but the definitions themselves should be imported. This is consistent with how Problem 152 already uses `IsSidon` from the library. + +Note: at least 10 other Erdős problem files (43, 154, 156, 157, 530, 772, 773, etc.) also define their own local `IsSidonSet`. This is a codebase-wide pattern that could benefit from consolidation. + +## 2. Citations + +The website (erdosproblems.com/862) lists: +- Attribution to **Cameron and Erdős**. +- Reference: **[Er92c, p.39]** — Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania) 47 (1992), no. 2, 231–240. +- Resolution by **Saxton and Thomason [SaTh15]** — Saxton, D. and Thomason, A., *The number of Sidon sets and the maximum size of Sidon sets contained in a sparse random set of integers*, Random Structures & Algorithms 46 (2015), no. 1, 1–25. +- Related problem: **861** +- Related OEIS sequence: **A382395** +- Thanks to **Alex Grebennikov** + +**Assessment:** The formalization's docstring includes [Er92c] and [SaTh15] with full bibliographic details matching the website. The related problem 861 and OEIS sequence A382395 are not mentioned but are not strictly required. The acknowledgment to Alex Grebennikov is omitted, which is acceptable for a formalization file. **Citations are adequate.** + +## 3. Variants + +The problem on erdosproblems.com poses two questions: +1. Is $A_1(N) < 2^{o(N^{1/2})}$? +2. Is $A_1(N) > 2^{N^c}$ for some constant $c > 0$? + +The formalization captures both: +- `erdos_862` formalizes the negation of question 1 (disproved). +- `erdos_862.variants.second_question` formalizes question 2 (proved). + +**Assessment: All variants are captured.** + +## 4. Readability + +The code is generally well-structured and readable. Minor observations: + +- The `IsSidonSet` and `IsMaximalSidonIn` definitions are clear and self-contained, with good docstrings. +- The `countMaximalSidon` function is straightforward — filtering powerset and taking cardinality. +- The theorem statements use explicit real-number arithmetic, which is standard for this kind of asymptotic bound formalization. +- The `open Classical` is appropriate for the noncomputable definition. +- The naming convention `erdos_862.variants.second_question` clearly conveys the structure. + +**One readability improvement:** The first theorem's docstring says "for all sufficiently large $N$, $A_1(N) \geq 2^{0.16 \cdot N^{1/2}}$" — this is a strengthened quantitative version rather than just the negation of the original question. This is fine mathematically but the docstring could more explicitly note that this implies the negation. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +- "Sidon set" is a standard, precisely defined concept in additive combinatorics. +- "Maximal Sidon subset of $\{1, \ldots, N\}$" is unambiguous — maximal with respect to inclusion. +- $A_1(N)$ as the count of such subsets is well-defined since $\{1, \ldots, N\}$ is finite. +- The two questions involve standard asymptotic notions ($o(\cdot)$ and $2^{N^c}$), which are formalized here as explicit quantitative bounds. This is a reasonable approach — the $o(N^{1/2})$ in the original question is captured by the specific constant $0.16$, and the existential $c > 0$ is kept as an existential. + +The only minor subtlety is whether the formalization of "disproves $A_1(N) < 2^{o(N^{1/2})}$" as "$A_1(N) \geq 2^{0.16 N^{1/2}}$" is the best choice. This is actually *stronger* than the negation (the negation would just be that $A_1(N)$ is *not* $2^{o(N^{1/2})}$, i.e., it grows at least as fast as $2^{c N^{1/2}}$ for some $c > 0$). The chosen formalization with the explicit constant $0.16$ is a valid strengthening and is consistent with the Saxton–Thomason result. + +**Ambiguity: Negligible.** The problem is stated precisely enough that no reasonable mathematician would interpret it differently. + +## 6. Correctness + +### 6.1 Sidon Set Definition + +The definition `IsSidonSet S` states: for all $a, b, c, d \in S$, if $a + b = c + d$ then $(a = c \land b = d) \lor (a = d \land b = c)$. This is the standard definition of a Sidon (B₂) set. **Correct.** + +### 6.2 Maximal Sidon Set Definition + +`IsMaximalSidonIn S N` requires: +- $S \subseteq \{1, \ldots, N\}$ (via `Finset.Icc 1 N`) +- $S$ is Sidon +- For all $x \in \{1, \ldots, N\} \setminus S$, adding $x$ breaks the Sidon property + +This correctly captures maximality with respect to inclusion. **Correct.** + +### 6.3 Counting Function + +`countMaximalSidon N` counts subsets of `Icc 1 N` satisfying `IsMaximalSidonIn S N`. Since `IsMaximalSidonIn` already requires `S ⊆ Icc 1 N`, this correctly counts all maximal Sidon subsets of $\{1, \ldots, N\}$. **Correct.** + +### 6.4 First Theorem (`erdos_862`) + +The statement asserts: there exists $N_0$ such that for all $N \geq N_0$, +$$\text{countMaximalSidon}(N) \geq 2^{0.16 \cdot N^{1/2}}.$$ + +This is a correct formalization of the Saxton–Thomason lower bound. The docstring correctly explains this disproves the first conjecture. The constant $0.16$ comes from $(1.16 - 1) = 0.16$ in the argument described in the docstring, which is mathematically accurate. + +**Minor note on precision:** The Saxton–Thomason result gives $2^{(0.16 + o(1))N^{1/2}}$, not exactly $2^{0.16 N^{1/2}}$. However, the formalization uses "for sufficiently large $N$", and for any fixed $\varepsilon > 0$, $(0.16 - \varepsilon) N^{1/2} \leq (0.16 + o(1)) N^{1/2}$ for large $N$. So one could prove the statement with constant $0.16 - \varepsilon$ for any $\varepsilon$, but with exactly $0.16$ one would need $(0.16 + o(1)) \geq 0.16$ for large $N$, which requires the $o(1)$ term to be eventually non-negative. This is true if the $o(1)$ term approaches $0$ from above (or from both sides), but the sign of the $o(1)$ correction is not specified in the problem description. **The constant 0.16 may be slightly too aggressive** — a more conservative formalization might use a slightly smaller constant (e.g., $0.15$) or existentially quantify over a positive constant. However, this is a very minor concern and the spirit of the formalization is correct. + +### 6.5 Second Theorem (`erdos_862.variants.second_question`) + +The statement asserts: there exist $c > 0$ and $N_0$ such that for all $N \geq N_0$, +$$\text{countMaximalSidon}(N) > 2^{N^c}.$$ + +This is a correct formalization of the second question. Note the use of strict inequality ($>$) here versus non-strict ($\geq$) in the first theorem — both are mathematically appropriate given the exponential growth. **Correct.** + +The second question is logically implied by the first theorem (take $c = 1/2$ and note $0.16 \cdot N^{1/2} > N^{c'}$ for any $c' < 1/2$ and large $N$), so both theorems are consistent. **Correct.** + +### 6.6 Overall Mathematical Assessment + +The formalization is mathematically sound and complete. An experienced mathematician would not identify any obvious flaws. The only minor quibble is the precise value of the constant $0.16$ in the first theorem (see 6.4 above), but this is a subtlety about the $o(1)$ term rather than an error in the formalization. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Should use** `IsSidon` and `Set.IsMaximalSidonSetIn` from `FormalConjecturesForMathlib/Combinatorics/Basic.lean` | +| Citations | **Adequate** — full references match the website | +| Variants | **Complete** — both questions captured | +| Readability | **Good** — clear structure, good docstrings | +| Formalizability | **High** — standard definitions, negligible ambiguity | +| Correctness | **Correct** — minor concern about the exact constant 0.16 in the $o(1)$ term; otherwise mathematically sound | diff --git a/ai-review/863.md b/ai-review/863.md new file mode 100644 index 0000000000..31ae960a18 --- /dev/null +++ b/ai-review/863.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 863 + +## 1. Code Reuse + +Several related definitions exist across the codebase that overlap with Problem 863's definitions: + +- **Problem 864** (`ErdosProblems/864.lean`): Defines its own `sumRepCount` using a different but mathematically equivalent formulation: + ```lean + -- 863: S.sum (fun a => (S.filter (fun b => a ≤ b ∧ a + b = n)).card) + -- 864: (A.filter (fun a => 2 * a ≤ n ∧ (n - a) ∈ A)).card + ``` + Both count unordered representations of `n` as `a + b` with `a ≤ b`. The 864 version is more concise and avoids the outer `sum` (since `b = n - a` is uniquely determined, the inner filter has at most one element, making the sum equivalent to a single cardinality). These could share a common definition. + +- **Problem 772** (`ErdosProblems/772.lean`): Defines `addRepCount` counting *ordered* pairs `(a, b)` with `a + b = m`. This differs from the *unordered* count in 863, so not directly substitutable, but the relationship `sumRepCount(n) ≈ addRepCount(n) / 2` (up to diagonal terms) is standard. + +- **`Convolution.lean`** (`FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`): Provides `sumRep` and `sumConv` for the ordered representation count via indicator function convolution. The `sumRep` counts ordered pairs via `1_A ∗ 1_A`. Problem 863 could potentially be restated in terms of `sumRep` with an adjustment for ordering, but this would add complexity rather than simplify. + +- **Problem 861** (`ErdosProblems/861.lean`): Defines `IsSidonSet` and `maxSidonSize` — a Sidon set is exactly a B₂[1] set, so `IsSidonSet` should be equivalent to `IsB2r 1`. + +**Recommendation:** Consider unifying `sumRepCount` across Problems 863 and 864 into a shared definition (e.g., in a utility module or `FormalConjecturesForMathlib`). The 864 formulation is cleaner. The definitions for `IsB2r` and `IsSidonSet` could also be connected by a lemma: `IsSidonSet S ↔ IsB2r 1 S`. + +## 2. Citations + +The docstring currently reads: +``` +A problem of Erdős [Er92c], first formulated in conversation with Berend, and later +independently reformulated with Freud. It is known that $c_1 = c_1' = 1$ (the classical +bound on Sidon sets). + +[Er92c] Erdős, P. +``` + +The citation `[Er92c]` is incomplete — it lists only the author with no title, journal, or year beyond the tag. The website at [erdosproblems.com/863](https://www.erdosproblems.com/863) attributes the problem to Erdős, formulated in conversation with Berend and later independently with Freud, but does not provide a full bibliographic entry for [Er92c] beyond this attribution. The formalization's citation is consistent with what is available on the website, though it would benefit from noting that this is a 1992 Erdős paper if the full reference can be located. + +**Recommendation:** The citation as written is acceptable given the limited bibliographic data on the website. No discrepancy with the website. + +## 3. Variants + +The problem on [erdosproblems.com/863](https://www.erdosproblems.com/863) asks two questions: +1. Is it true that $c_r \neq c_r'$ for $r \geq 2$? +2. Is it true that $c_r' < c_r$? + +The formalization captures both: +- `erdos_863` — the weak form ($c_r \neq c_r'$) +- `erdos_863.variants.strong` — the strong form ($c_r' < c_r$) + +**Assessment:** All variants are captured. The decomposition into weak and strong forms is natural and complete. + +## 4. Readability + +The code is well-structured with clear docstrings on all definitions and theorems. A few observations: + +- The namespace `Erdos863` keeps definitions scoped appropriately. +- The docstrings use standard mathematical notation and clearly explain each definition. +- The `sumRepCount` implementation in 863 is slightly harder to parse than 864's equivalent formulation. The 864 style (`filter` + `card` without an outer `sum`) more directly expresses "the set of valid `a` values" and would be more idiomatic. +- The `diffRepCount` definition is clear and well-documented. + +**Recommendation:** Consider adopting the Problem 864-style formulation for `sumRepCount` for consistency and clarity. + +## 5. Formalizability + +The problem is precise enough to formalize, but involves an important conditional structure: the statement assumes the limits $c_r$ and $c_r'$ exist and then asks about their relationship. + +**Ambiguity assessment: Low.** The key concepts are all well-defined: +- B₂[r] sets (bounded additive representation) — standard definition in additive combinatorics. +- Difference-bounded sets — similarly standard. +- The asymptotic growth $\sim c \sqrt{N}$ is captured via `Tendsto` with `nhds c`. +- The restriction to $r \geq 2$ (since $c_1 = c_1' = 1$ is known) is clear. + +The only subtlety is whether the limits are assumed to exist (conditional statement) or asserted to exist (existential claim). The formalization correctly treats this as conditional: "if these limits exist, then they must differ." This matches the problem statement on the website. + +## 6. Correctness + +**Overall assessment: Correct, with minor observations.** + +### Strengths + +1. **`sumRepCount` is mathematically correct.** For fixed `n`, the definition iterates over `a ∈ S` and counts `b ∈ S` with `a ≤ b` and `a + b = n`. Since `b = n - a` is uniquely determined, each valid unordered pair `{a, b}` is counted exactly once (by the smaller element). This correctly counts unordered sum representations. + +2. **`IsB2r` correctly defines B₂[r] sets.** The condition `∀ n, sumRepCount S n ≤ r` is the standard definition. + +3. **`diffRepCount` is correct.** It counts the number of `b ∈ S` such that `b + n ∈ S`, which equals the number of ordered pairs `(a, b)` with `a - b = n`. For differences, ordered counting is standard (since `a - b = n` and `b - a = n` are different equations). + +4. **`IsDiffBounded` correctly restricts to `n > 0`.** Including `n = 0` would constrain `|S| ≤ r` (since every element pairs with itself), which is not the intent. The restriction to positive differences is mathematically appropriate. + +5. **`maxB2rSize` and `maxDiffBoundedSize` correctly compute maxima** via `Finset.sup` over power sets of `Icc 1 N`. For `ℕ` with `⊥ = 0`, this returns the maximum cardinality (or 0 if no valid subset exists). + +6. **The `Tendsto` formulation correctly captures asymptotic limits.** The limits are in `ℝ` which is Hausdorff, so uniqueness of limits is guaranteed. The universal quantification over `c` and `c'` is mathematically equivalent to "if the limit exists with value `c`, then..." — since the limit, if it exists, is unique. + +7. **The `answer(sorry)` wrapper is appropriate** for an open problem whose truth value is unknown. + +8. **`r ≥ 2` correctly excludes** the known case `r = 1` where `c_1 = c_1' = 1`. + +### Minor observations + +- **`maxB2rSize` / `maxDiffBoundedSize` use `Finset.sup` rather than `Finset.max'`:** This is fine since `sup` with `⊥ = 0` handles the empty case gracefully. However, for the `Tendsto` statement to be meaningful, the sets must eventually be nonempty (which they are, since the singleton `{1}` is always valid for any `r ≥ 1`). + +- **No off-by-one concern in `Icc 1 N`:** The set `{1, …, N}` is correctly represented as `Finset.Icc 1 N`. + +- **Vacuous truth when limits don't exist:** If one or both limits fail to exist, the `Tendsto` hypotheses are never satisfied, and both theorems hold vacuously. This is logically correct and consistent with the conditional reading of the problem. + +### Potential concern + +The `sumRepCount` definition works over `ℕ`, where subtraction is truncated. However, since the definition uses `a + b = n` rather than `b = n - a`, there is no truncated subtraction issue. This is a good design choice. + +--- + +**Summary:** The formalization is mathematically correct and complete. It faithfully captures both variants of the problem as stated on the website. The main recommendation is stylistic: consider unifying the `sumRepCount` definition with Problem 864's equivalent formulation for consistency across the codebase. diff --git a/ai-review/864.md b/ai-review/864.md new file mode 100644 index 0000000000..a5198414d4 --- /dev/null +++ b/ai-review/864.md @@ -0,0 +1,94 @@ +# AI Review: Erdős Problem 864 + +## 1. Code Reuse + +**Several opportunities for sharing definitions exist, though none are critical.** + +- **`sumRepCount`**: Problem 864 defines its own `Erdos864.sumRepCount` (line 42–43), while Problem 863 (`Erdos863.sumRepCount`, line 38–39 of `863.lean`) defines the same function with a different but mathematically equivalent implementation. Both count representations of `n` as `a + b` with `a ≤ b` and `a, b ∈ A`. Problem 864's version (`A.filter (fun a => 2 * a ≤ n ∧ (n - a) ∈ A).card`) is more direct and computable; Problem 863's version (`S.sum (fun a => (S.filter (fun b => a ≤ b ∧ a + b = n)).card)`) iterates via `sum`. A shared definition in `FormalConjecturesForMathlib` would be cleaner, though mathematically they are provably equal. + +- **`AdditiveCombinatorics.sumRep`** (in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`): This defines `sumRep A n` via indicator convolution `(𝟙_A ∗ 𝟙_A)(n)`, which counts **all** ordered pairs `(a, b)` with `a + b = n` (not just `a ≤ b`). This differs from `sumRepCount` by a factor related to double-counting. It would be feasible to define `sumRepCount` in terms of `sumRep` (roughly `sumRepCount A n = (sumRep A n + (if n is even and n/2 ∈ A then 1 else 0)) / 2`), but this may be more complex than helpful. + +- **Pattern reuse**: The `powerset.filter(...).sup Finset.card` pattern for `maxAlmostSidonCard` is standard across the codebase (Problems 840, 861, 862, 863 all use it). No issue here. + +- **Relationship to `IsB2r`** (Problem 863): `IsAlmostSidon A` is equivalent to saying `A` satisfies the `B_2[1]` condition except possibly at one value of `n`. This relationship could be made explicit but is not strictly necessary. + +## 2. Citations + +**One citation is missing.** + +The website (erdosproblems.com/864) lists two references: +- **[ErFr91]** Erdős, P. and Freud, R., *On Sidon-sequences and related problems*, 1991. +- **[Er92c]** Erdős, P. (1992). + +The formalization only cites **[ErFr91]** (lines 29, 34). The reference **[Er92c]** should be added. The website also references OEIS sequence **A389182**, which could optionally be mentioned. + +The citation for [ErFr91] in the docstring (line 34) omits the paper title. The website gives the full title as noted above. Consider expanding to: + +> [ErFr91] Erdős, P. and Freud, R., *On Sidon-sequences and related problems*, Mat. Lapok, 1991. + +## 3. Variants + +**One natural variant is missing.** + +- **Included**: The lower bound `erdos_864.variants.lower_bound` (lines 67–78) correctly formalizes the Erdős–Freud matching lower bound. Good. + +- **Missing — Difference analogue**: The website states: "For the analogous question with `n = a − b`, they proved `|A| ∼ N^{1/2}`." This difference-representation version (where at most one nonzero `n` has more than one representation as `a − b`) is a natural variant that is not captured. Since this result is *proved* (not just conjectured), it could be added as a `category research solved` variant. + +- The connection to Problem 840 ("This is a weaker form of Problem 840") is correctly documented in the module docstring (line 32). + +## 4. Readability + +**The code is clean and readable. Minor suggestions:** + +- The `sumRepCount` definition (line 42–43) is clear and well-documented. The docstring accurately describes what it computes. + +- `IsAlmostSidon` (line 46–49) uses an existential over a `Finset ℕ` of exceptions with `S.card ≤ 1`. This is a natural way to express "at most one exceptional `n`" and reads well. An alternative would be `(A.filter (fun n => sumRepCount A n > 1)).card ≤ 1`, which is more direct but logically equivalent. + +- The module docstring is informative and well-structured. + +- Minor: `open Finset Classical` (line 37) opens `Classical` globally. This is standard practice in the codebase but worth noting. + +## 5. Formalizability + +**The problem is precise and unambiguous. Assessment: Low ambiguity.** + +The original problem asks two things: +1. **Vague**: "Estimate the maximal possible size of |A|" — open-ended, not directly formalizable as a single theorem. +2. **Precise**: "Is it true that |A| ≤ (1+o(1)) · (2/√3) · N^{1/2}?" — a well-defined yes/no question. + +The formalization correctly captures (2) via the `ε > 0, ∃ N₀, ∀ N ≥ N₀` quantifier pattern, which is the standard formalization of the `(c + o(1))` asymptotic bound. The `answer(sorry)` wrapper correctly reflects that the truth value is unknown. + +All definitions involved (`sumRepCount`, `IsAlmostSidon`, `maxAlmostSidonCard`) have clear, unambiguous mathematical meaning. The domain restriction to `{1, ..., N}` via `Finset.Icc 1 N` matches the problem statement. + +## 6. Correctness + +**The formalization is mathematically correct. No flaws identified.** + +Detailed verification: + +- **`sumRepCount A n`** (line 42–43): Filters elements `a ∈ A` satisfying `2 * a ≤ n` (ensuring `a ≤ n - a`, i.e., `a ≤ b`) and `(n - a) ∈ A` (ensuring `b = n - a ∈ A`). Each unordered pair `{a, b}` with `a + b = n` and `a ≤ b` is counted exactly once. ✓ + +- **`IsAlmostSidon A`** (line 47–49): States `∃ S : Finset ℕ, S.card ≤ 1 ∧ ∀ n ∉ S, sumRepCount A n ≤ 1`. This correctly captures "at most one `n` with more than one representation." The use of `S.card ≤ 1` (rather than `S.card = 1`) correctly allows the case where A is a genuine Sidon set (zero exceptions). ✓ + +- **`maxAlmostSidonCard N`** (line 52–53): Takes the sup of `Finset.card` over all almost-Sidon subsets of `{1, ..., N}`. Since `Finset.sup` on `ℕ` with `⊥ = 0` returns 0 on the empty collection, and the empty set is always almost Sidon, this is well-defined. ✓ + +- **`erdos_864`** (line 60–65): The statement `∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, maxAlmostSidonCard N ≤ (2/√3 + ε) · √N` is the correct formalization of `f(N) ≤ (1+o(1)) · (2/√3) · √N`. The cast to `ℝ` is necessary and correct. ✓ + +- **`erdos_864.variants.lower_bound`** (line 73–78): The matching lower bound `(2/√3 - ε) · √N ≤ maxAlmostSidonCard N` is correctly stated and correctly tagged as `category research solved`. ✓ + +- **Category tags**: The main conjecture is tagged `category research open` and the lower bound as `category research solved`, consistent with the website status (the problem is open). ✓ + +- **AMS classification `5 11`**: AMS class 11 is Number Theory, which is correct. ✓ + +**One subtle point**: The `answer(sorry)` in `erdos_864` wraps the full biconditional. If the conjecture is true, `answer(sorry)` should be `True`; if false, `False`. This is the standard pattern and is correct. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunity: shared `sumRepCount` with Problem 863 | +| Citations | **[Er92c] missing**; [ErFr91] title could be expanded | +| Variants | **Difference analogue missing** (proved result: `\|A\| ∼ N^{1/2}`) | +| Readability | Good; clean and well-documented | +| Formalizability | High; low ambiguity | +| Correctness | **Correct and complete** for the stated conjecture | diff --git a/ai-review/866.md b/ai-review/866.md new file mode 100644 index 0000000000..029dfe02b0 --- /dev/null +++ b/ai-review/866.md @@ -0,0 +1,105 @@ +# Review: Erdős Problem 866 + +## 1. Code Reuse + +The custom definitions `HasPairwiseSums` and `gPairwiseSum` are specific to this problem and do not duplicate existing code in the repository. Related but distinct constructs exist: + +- **Problem 871** defines `sumset` (as a `Set ℕ`), but this is a different concept (A + A) from the pairwise sums of k chosen integers. +- **`IsSidon`** in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` deals with *distinct* pairwise sums, which is the "dual" notion but not directly applicable. +- **`FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean`** provides `≪`/`≫` notation for `IsBigO`, which could be used to state the asymptotic bounds more idiomatically. However, the current formulation uses explicit constants (`∃ C, C > 0 ∧ ...`), which is equivalent and arguably more explicit for the upper bound theorem. + +**Verdict:** No significant reuse opportunities missed. The definitions are appropriately problem-specific. + +## 2. Citations + +The formalization cites: +- `[CES75]` — Choi, S. L. G., Erdős, P., and Szemerédi, E., *Some additive and multiplicative problems in combinatorics*, 1975. + +The website (erdosproblems.com/866) additionally references: +- **`[Er92c, p.41]`** — missing from the formalization docstring. +- **van Doorn** — mentioned for the result g₄(N) ≤ 2032, referenced through GitHub; not cited in the formalization. + +**Recommendation:** Add `[Er92c]` to the docstring references. If the van Doorn bound were formalized as a variant, it should also be cited. + +## 3. Variants + +The formalization captures three results: +1. ✅ General upper bound: g_k(N) ≪_k N^{1 - 2^{-k}} (`erdos_866`) +2. ✅ Exact value: g₃(N) = 2 (`erdos_866.variants.g3`) +3. ✅ Lower bound for large k: ∀ ε > 0, ∃ k₀, ∀ k ≥ k₀, g_k(N) > N^{1-ε} (`erdos_866.variants.lower_bound_large_k`) + +**Missing variants mentioned on the website/docstring:** +- g₄(N) ≤ 2032 (van Doorn) — mentioned in docstring but not formalized +- g₅(N) ≍ log N — mentioned in docstring but not formalized +- g₆(N) ≍ N^{1/2} — mentioned in docstring but not formalized + +These are natural candidates for additional variant theorems if desired, though their omission is not a serious gap since the three formalized statements capture the main structural results. + +## 4. Readability + +The code is clean and well-structured: +- The docstring gives a clear mathematical description with LaTeX. +- `HasPairwiseSums` and `gPairwiseSum` are named descriptively. +- The namespace `Erdos866` prevents name collisions. +- Variant naming (`erdos_866.variants.g3`, `erdos_866.variants.lower_bound_large_k`) is clear. + +**Minor suggestion:** The `gPairwiseSum` definition uses an element-wise subset condition (`∀ a ∈ A, 1 ≤ a ∧ a ≤ 2 * (N : ℤ)`) rather than `A ⊆ Finset.Icc 1 (2 * N)` (after appropriate coercion). The element-wise version is arguably more explicit, though using `Finset.Icc` would be more idiomatic in Mathlib style. + +## 5. Formalizability + +The problem as stated on the website is precise and unambiguous: it defines g_k(N) explicitly and asks to "estimate" it. The specific known results (g₃ = 2, upper/lower bounds) are fully precise mathematical statements. + +One point of ambiguity: **whether the integers b₁, …, b_k are required to be distinct.** The problem says "there exist integers b₁, …, b_k" and refers to "all C(k,2) pairwise sums." The reference to C(k,2) = k(k-1)/2 strongly implies distinct b_i, since this is the number of 2-element subsets of a k-element set. If repeated values were allowed, one would not typically invoke C(k,2). See the Correctness section for why this matters. + +**Assessment:** High formalizability, with one critical interpretive choice (distinctness of b_i) that must be resolved correctly. + +## 6. Correctness + +### Critical Issue: Missing Injectivity Constraint on b + +The `HasPairwiseSums` definition is: + +```lean +def HasPairwiseSums (A : Finset ℤ) (k : ℕ) : Prop := + ∃ b : Fin k → ℤ, ∀ i j : Fin k, i < j → (b i + b j) ∈ A +``` + +This does **not** require the b_i to be pairwise distinct (`Function.Injective b`). This is a significant bug that trivializes the problem: + +**Proof that the current formalization is too weak:** +Without injectivity, one can choose b₁ = b₂ = ⋯ = b_k = b for any integer b. Then all pairwise sums equal 2b, so `HasPairwiseSums A k` reduces to "∃ b : ℤ, 2b ∈ A", i.e., A contains an even number. + +For A ⊆ {1, …, 2N}: +- If |A| ≥ N + 1, then A must contain at least one even number (since there are only N odd numbers in {1, …, 2N}). +- If |A| = N, it is possible that A = {1, 3, 5, …, 2N−1} (all odd), containing no even number. + +Therefore, with the current definition, `gPairwiseSum k N = 1` for all k ≥ 2 and all N ≥ 1. This contradicts the known result g₃(N) = 2, proving the formalization is incorrect. + +**Fix:** Add `Function.Injective b` to `HasPairwiseSums`: + +```lean +def HasPairwiseSums (A : Finset ℤ) (k : ℕ) : Prop := + ∃ b : Fin k → ℤ, Function.Injective b ∧ + ∀ i j : Fin k, i < j → (b i + b j) ∈ A +``` + +### Other Correctness Notes + +- **`gPairwiseSum` well-definedness:** The `sInf` is over a non-empty set (for g > N, the cardinality condition is vacuously unsatisfiable), so `sInf` returns a meaningful value. ✅ +- **Exponent in `erdos_866`:** `1 - 1 / 2^k` correctly represents `1 - 2^{-k}`. ✅ +- **Category labels:** All three theorems are marked `category research solved`, which is appropriate — these are specific proven results from [CES75], even though the overarching "estimate g_k(N)" question remains open. ✅ +- **`erdos_866.variants.g3`:** States g₃(N) = 2 for sufficiently large N. This is appropriate since the exact result may not hold for very small N. ✅ +- **AMS classification `5 11`:** AMS 05 (Combinatorics) and 11 (Number theory) are appropriate. ✅ + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | ✅ No issues | +| Citations | ⚠️ Missing [Er92c, p.41] reference | +| Variants | ⚠️ Three known results not formalized (g₄, g₅, g₆ bounds) | +| Readability | ✅ Clean and clear | +| Formalizability | ✅ Precise, with one interpretive choice | +| Correctness | ❌ **Critical bug:** `HasPairwiseSums` missing `Function.Injective b`, which trivializes the problem to g_k(N) = 1 for all k | + +**The formalization requires a fix to `HasPairwiseSums` before it correctly captures the intended mathematical statement.** Without injectivity, every theorem in the file is either trivially true or contradicted by the formalization's own claimed results (g₃(N) = 2 vs the implicit g₃(N) = 1). diff --git a/ai-review/867.md b/ai-review/867.md new file mode 100644 index 0000000000..0591dca930 --- /dev/null +++ b/ai-review/867.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 867 + +## 1. Code Reuse + +**Problem 839** (`FormalConjectures/ErdosProblems/839.lean`) defines `SumOfConsecutiveFree` for infinite sequences — the infinitary analogue of this problem. The website explicitly notes that Problem 867 is a "finitary version of Problem #839." However, the two definitions are structurally different: 839 works with sequences `ℕ → ℕ` and checks that no term equals a sum of earlier consecutive terms, while 867 works with finite sets via `Finset.sort` and `List.getD`. Direct code reuse between them is not straightforward, though the core `∑ k ∈ Finset.Icc i j` pattern is shared. + +No existing definition in `FormalConjecturesForMathlib/Combinatorics/Basic.lean` covers the "consecutive-sum-free" property. The `IsSumFree` definition there concerns the standard sum-free condition (no `a + b = c` with `a, b, c ∈ A`), which is a different concept. + +The `Finset.sort` + `List.getD` pattern appears in several other problems (690, 854, 220, 235) and is a well-established idiom in the codebase. + +**Verdict:** No significant reuse opportunity. The definitions are appropriately self-contained. + +## 2. Citations + +The docstring cites: +- [Er92c] Erdős (1992) — ✅ Matches website +- [CoPh96] Coppersmith & Phillips (1996) — ✅ Matches website + +**Missing from docstring:** +- **Freud [Fr93]**: The website credits Freud with constructing a sequence of density ≥ 19/36, an intermediate result. +- **Adenwalla**: The website credits Sarosh Adenwalla with observing the upper bound of `(2/3 + o(1))N`. +- **Relationship to Problem 839**: The website explicitly states this is "a finitary version of Problem #839." This cross-reference is absent from the docstring. +- **Page reference**: The website cites [Er92c, **p.43**]; the docstring omits the page number. + +## 3. Variants + +The formalization captures only the original yes/no question: does an absolute constant `C` exist such that `|A| ≤ N/2 + C`? + +**Not formalized:** +- The **Coppersmith–Phillips bounds** themselves: `(13/24)N − O(1) ≤ max|A| ≤ (2/3 − 1/512)N + log N`. While the docstring quotes these bounds, they are not expressed as formal statements. A natural variant would formalize the lower bound (which is what disproves the conjecture) and/or the upper bound. +- The **Freud bound** of density ≥ 19/36 (an earlier, weaker disproof). +- The **trivial lower bound**: `A = (N/2, N] ∩ ℕ` gives `|A| ≥ N/2 − O(1)`. + +The absence of the quantitative bounds is a moderate gap — they represent the main mathematical content of the resolution. + +## 4. Readability + +The code is clear and well-structured: +- The `ConsecutiveSumFree` definition has a helpful docstring explaining the notation. +- The `let s := A.sort (· ≤ ·)` idiom followed by index-based access is standard in this codebase. +- The theorem statement is concise and directly mirrors the mathematical question. + +**Minor suggestion:** The `open Finset` at the top means unqualified `Icc` inside the theorem, but `Finset.Icc` is still used explicitly in the definition body. This inconsistency is cosmetic but could be unified. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem is **highly formalizable**. It is a precise combinatorial statement: a yes/no question about the existence of a universal constant bounding the size of sets with a well-defined property. There is essentially no ambiguity: + +- "Consecutive-sum-free" has a clear, unambiguous definition once the ordering is fixed. +- The quantification over all `N` and all subsets `A ⊆ {1, …, N}` is standard. +- The answer (False) is definitively known. + +**Ambiguity assessment:** Negligible. The only potential subtlety is whether "sum of consecutive elements" means consecutive in the sorted order of `A` (as intended and implemented) versus consecutive integers — but the docstring and the standard interpretation in the literature make this clear. + +## 6. Correctness + +**Definition `ConsecutiveSumFree`:** Correct. The definition sorts `A`, then asserts that for all index pairs `i < j` (with `j < s.length`), the sum `∑ k ∈ Icc i j, s.getD k 0` is not in `A`. This correctly captures "no sum of two or more consecutive elements (in sorted order) lies in A": + +- `i < j` ensures at least two elements are summed (indices `i, i+1, …, j` with `j > i`). +- `j < s.length` ensures all indices are valid (and `i < j < s.length` implies all intermediate indices are in bounds for `getD`). +- The `getD k 0` default value of 0 is never triggered for valid indices, so it is harmless. + +**Theorem `erdos_867`:** Correct. `answer(False) ↔ ∃ C, ∀ N A, …` asserts that the existential statement is false (since `False ↔ P` iff `¬P`). This correctly formalizes the disproved conjecture: there is **no** absolute constant `C` such that every consecutive-sum-free `A ⊆ {1, …, N}` satisfies `|A| ≤ N/2 + C`. This is indeed what Coppersmith–Phillips disproved, since they showed sets of density 13/24 > 1/2 exist. + +**Natural number division:** `N / 2` uses floor division in `ℕ`, so `N / 2 + C` equals `⌊N/2⌋ + C`. This is immaterial since `C` absorbs the rounding error (at most 1). The formalization is equivalent to the real-valued statement. + +**Edge cases:** For `N = 0`, `Icc 1 0 = ∅`, so `A = ∅` and `|A| = 0 ≤ C` for any `C`. This is vacuously fine and does not affect correctness. + +**Verdict:** The formalization is mathematically correct and complete for the yes/no question it captures. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No reuse needed; self-contained ✅ | +| Citations | Missing Freud [Fr93], Adenwalla, page ref, and cross-ref to #839 ⚠️ | +| Variants | Only the yes/no question; Coppersmith–Phillips quantitative bounds not formalized ⚠️ | +| Readability | Good ✅ | +| Formalizability | Unambiguous, highly formalizable ✅ | +| Correctness | Mathematically correct ✅ | diff --git a/ai-review/869.md b/ai-review/869.md new file mode 100644 index 0000000000..72e5a2c76f --- /dev/null +++ b/ai-review/869.md @@ -0,0 +1,82 @@ +# AI Review: Erdős Problem 869 + +## 1. Code Reuse + +**Significant reuse opportunities exist.** All three custom definitions (`sumset`, `IsAdditiveBasis2`, `IsMinimalAdditiveBasis2`) can be replaced with existing Mathlib/FormalConjecturesForMathlib definitions: + +- **`sumset A`** is exactly `A + A` under `open scoped Pointwise`. The Pointwise instance for `Set ℕ` is already available via `Mathlib.Algebra.Group.Pointwise.Set.Basic`. At least 19 other Erdős problem files already use `open scoped Pointwise` for this purpose (e.g., 791, 868, 40). + +- **`IsAdditiveBasis2 A`** (`∃ N₀, ∀ n ≥ N₀, n ∈ sumset A`) is mathematically equivalent to `A.IsAsymptoticAddBasisOfOrder 2` from `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`. On `ℕ`, the `cofinite` filter equals `atTop` (via `cofinite_eq_atTop`), so the Mathlib definition `∀ᶠ a in cofinite, a ∈ A ^ 2` unfolds to the same thing. Problem 868 already uses `IsAsymptoticAddBasisOfOrder 2` for the same concept. + +- **`IsMinimalAdditiveBasis2 B`** is equivalent to: + ``` + B.IsAsymptoticAddBasisOfOrder 2 ∧ ∀ b ∈ B, ¬(B \ {b}).IsAsymptoticAddBasisOfOrder 2 + ``` + The condition `Set.Infinite {n | n ∉ sumset (B \ {x})}` is logically equivalent to `¬ IsAdditiveBasis2 (B \ {x})` (and hence `¬(B \ {x}).IsAsymptoticAddBasisOfOrder 2`), since failing to be an asymptotic basis means infinitely many naturals are not represented, and vice versa. Problem 868 already uses the cleaner `∀ b ∈ B, ¬(B \ {b}).IsAsymptoticAddBasisOfOrder 2` formulation. + +**Recommendation:** Replace all three custom definitions with Mathlib equivalents, matching the style of Problem 868. This eliminates ~15 lines of redundant definitions and aligns with codebase conventions. + +## 2. Citations + +The formalization cites: +- `[ErNa88]` Erdős, P. and Nathanson, M., *Minimal asymptotic bases with prescribed densities*, 1988. + +The erdosproblems.com page for Problem 869 additionally references: +- **`[Er92c]`** — This reference appears on the website but is absent from the formalization's docstring. + +The [ErNa88] citation in the formalization is missing journal information. The full citation (as seen in Problem 870) is: +> Erdős, P. and Nathanson, M., *Minimal asymptotic bases with prescribed densities*, Illinois J. Math. 32 (1988), 562–574. + +**Recommendation:** Add the `[Er92c]` reference and complete the journal details for `[ErNa88]`. + +## 3. Variants + +The erdosproblems.com page for Problem 869 presents a single question without explicit sub-parts or variants. The formalization captures this single question faithfully. + +The related contextual result (Härtter–Nathanson: additive bases can exist without containing minimal additive bases) is already formalized as a variant in Problem 868 (`erdos_868.variants.Hartter_Nathanson`), so there is no need to duplicate it here. + +**Assessment:** No missing variants. + +## 4. Readability + +- The custom definitions obscure the connection to Mathlib's standard additive combinatorics vocabulary. Using `IsAsymptoticAddBasisOfOrder` and Pointwise `A + A` would immediately signal to a Lean/Mathlib-literate reader what the definitions mean. +- The `IsMinimalAdditiveBasis2` definition uses the roundabout `Set.Infinite {n | n ∉ sumset (B \ {x})}` instead of the more direct `¬(B \ {x}).IsAsymptoticAddBasisOfOrder 2`. The latter is more readable and matches Problem 868's style. +- The namespace `Erdos869` correctly scopes the definitions, preventing collisions with the identical `sumset` definitions in files 871, 31, 35, 337, and 1146. +- The docstrings on the custom definitions are clear and well-written. + +**Recommendation:** Switching to Mathlib definitions would improve readability and reduce cognitive overhead for readers familiar with the Mathlib additive combinatorics library. + +## 5. Formalizability + +The problem statement is precise and unambiguous: +- "Additive basis of order 2" has a standard, universally agreed-upon meaning in additive number theory (every sufficiently large integer is a sum of two elements from the set). +- "Minimal additive basis" has a standard meaning (removing any single element destroys the basis property). +- "Disjoint" is unambiguous for sets. +- The question is a clean yes/no existential. + +**Assessment: Fully formalizable with no ambiguity.** The `answer(sorry)` wrapper correctly captures the open yes/no nature of the problem. + +## 6. Correctness + +The formalization is **mathematically correct**. + +- `sumset A = {n | ∃ a ∈ A, ∃ b ∈ A, n = a + b}` correctly captures the 2-fold sumset A + A. ✓ +- `IsAdditiveBasis2 A` correctly captures "asymptotic additive basis of order 2". ✓ +- `IsMinimalAdditiveBasis2 B` correctly captures minimality: the condition `Set.Infinite {n | n ∉ sumset (B \ {x})}` is equivalent to `¬ IsAdditiveBasis2 (B \ {x})`, which is the standard definition. ✓ +- The main theorem `erdos_869` asks: for all disjoint pairs of order-2 bases A₁, A₂, does there exist a minimal order-2 basis B ⊆ A₁ ∪ A₂? This matches the erdosproblems.com statement exactly. ✓ +- The `Disjoint A₁ A₂` condition uses Lean's lattice-based disjointness, which for `Set ℕ` means `A₁ ∩ A₂ = ∅`. ✓ + +**One subtlety worth noting:** The formalization asks for B to be a *subset* of A₁ ∪ A₂, not necessarily equal to it. This is correct — the problem asks whether the union *contains* a minimal basis, not whether it *is* one. + +**Assessment: Correct and complete. No mathematical flaws.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Custom definitions should be replaced with Mathlib equivalents (match Problem 868's style) | +| Citations | Missing `[Er92c]` reference; `[ErNa88]` lacks journal details | +| Variants | Complete — no missing variants | +| Readability | Good docstrings, but custom definitions hurt readability vs. Mathlib standard | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/87.md b/ai-review/87.md new file mode 100644 index 0000000000..9d520bde10 --- /dev/null +++ b/ai-review/87.md @@ -0,0 +1,130 @@ +# Erdős Problem 87 — Review + +## 1. Code Reuse + +**`ContainsSubgraph` is duplicated across many files.** The definition at line 38: + +```lean +def ContainsSubgraph {V U : Type*} (G : SimpleGraph V) (H : SimpleGraph U) : Prop := + ∃ f : U → V, Function.Injective f ∧ ∀ u v : U, H.Adj u v → G.Adj (f u) (f v) +``` + +is semantically equivalent to Mathlib's `SimpleGraph.IsContained` (notation `⊑`) from `Mathlib.Combinatorics.SimpleGraph.Copy`: + +```lean +structure Copy (A : SimpleGraph α) (B : SimpleGraph β) where + toHom : A →g B + injective' : Injective toHom + +abbrev IsContained (A : SimpleGraph α) (B : SimpleGraph β) := Nonempty (Copy A B) +``` + +`ContainsSubgraph G H` is equivalent to `H ⊑ G` (note the argument reversal). The same duplication exists in Problem 62 (`62.lean:45`) and likely in many of the ~30 other files that reference `ContainsSubgraph`. Recommend replacing with `IsContained` from Mathlib, or at minimum factoring into a shared definition. + +**`graphRamseyNumber` and `diagRamsey` are widely reused but defined locally.** Grep shows these definitions appear across ~30 Erdős problem files. They should be consolidated into `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean`, which already defines `hypergraphRamsey`. The diagonal graph Ramsey number `diagRamsey k` is a specialization of `graphRamseyNumber` for complete graphs and could be related to the existing `hypergraphRamsey 2 k` (the 2-uniform hypergraph Ramsey number), though the definitions use different formulations (edge-coloring of complete graphs vs. graph complement containment). + +## 2. Citations + +Compared against [erdosproblems.com/87](https://www.erdosproblems.com/87): + +| Aspect | Formalization | Website | Match? | +|---|---|---|---| +| Status | `research open` | Open | ✓ | +| AMS classification | `AMS 5` | Graph theory / Ramsey theory | ✓ | +| [Er95] citation | Present (docstring line 24) | Present | ✓ | +| [FaMc93] Faudree–McKay | Not cited | Cited: showed R(pentagonal wheel W) = 17 | ✗ | +| Yuval Wigderson observation | Not mentioned | Noted: R(G) ≫ 2^(k/2) via random coloring | ✗ | + +**Recommendation:** Add the [FaMc93] reference explicitly, since the docstring already alludes to the k=4 counterexample ("Erdős originally conjectured R(G) ≥ R(k), which fails already for k = 4") but does not credit Faudree and McKay. The full citation from the website is: + +> [FaMc93] Faudree, R. J. and McKay, B. D., *A conjecture of Erdős and the Ramsey number r(W)*, J. Combin. Math. Combin. Comput. **13** (1993), 23–31. + +Wigderson's observation (that R(G) ≫ 2^(k/2) for any G with χ(G) = k) is useful context showing the weak form is asymptotically consistent with best-known lower bounds for R(k), but is not strictly required in the docstring. + +## 3. Variants + +The formalization captures both variants mentioned on the website: + +| Variant | Formalized? | Location | +|---|---|---| +| **Weak form:** R(G) > (1−ε)^k R(k) for large k | ✓ | `erdos_87` (line 61) | +| **Strong form:** R(G) > c·R(k) for large k | ✓ | `erdos_87.variants.strong` (line 77) | +| **Original (disproven):** R(G) ≥ R(k) | Mentioned in docstring, not formalized | — | + +The original conjecture R(G) ≥ R(k) is appropriately not formalized as a separate theorem since it is known to be false (Faudree–McKay, k = 4). The docstring at line 29 documents this. No missing variants. + +The website notes the problem "is trivial for ε ≥ 3/4 since R(k) ≤ 4^k." This is not mentioned in the docstring but is a useful mathematical remark rather than a separate variant. + +## 4. Readability + +**Strengths:** +- Clear module-level docstring explaining the problem, its history, and both variants. +- Good separation of helper definitions (`ContainsSubgraph`, `graphRamseyNumber`, `diagRamsey`) with their own docstrings. +- Docstrings for both theorem statements include the precise mathematical inequality. + +**Minor suggestions:** +- The docstring for `graphRamseyNumber` (line 41–44) says "the minimum N such that every simple graph G on N vertices either contains a copy of H as a subgraph or whose complement contains a copy of H." The phrase "or whose complement" is grammatically awkward; consider "or its complement contains a copy of H." +- The definitions are clean and self-contained. If `IsContained` from Mathlib is adopted, the `⊑` notation would improve readability of `graphRamseyNumber`. + +## 5. Formalizability + +The problem is **precisely formalizable with no ambiguity**. Both the weak and strong forms are unambiguous inequalities relating the graph Ramsey number R(G) to the diagonal Ramsey number R(k), parameterized by the chromatic number χ(G) = k. The quantifier structure (∀ε, ∃K, ∀k≥K, ∀G with χ(G)=k) is standard and maps directly to Lean. + +The only mild design choice is the restriction `ε < 1` in the weak form (line 62). This is mathematically harmless: for ε ≥ 1, we have (1−ε)^k ≤ 0 for large k (alternating sign or zero), so the inequality is trivially satisfied since Ramsey numbers are positive. However, adding `ε < 1` avoids potential confusion with negative/oscillating factors and makes the mathematical intent clearer. This is a reasonable choice. + +The `answer(sorry)` pattern correctly reflects the open status of the problem. + +## 6. Correctness + +### Definition correctness + +**`ContainsSubgraph` (line 38):** Correctly captures "H is isomorphic to a subgraph of G" via an injective adjacency-preserving map. This is *not-necessarily-induced* subgraph containment (adjacency is preserved in one direction only: `H.Adj u v → G.Adj (f u) (f v)`), which is the standard meaning in the Ramsey theory context. ✓ + +**`graphRamseyNumber` (line 45–47):** Defined as `sInf {N | ∀ G : SimpleGraph (Fin N), ContainsSubgraph G H ∨ ContainsSubgraph Gᶜ H}`. This correctly formalizes the graph Ramsey number R(H): the minimum N such that every 2-coloring of K_N contains a monochromatic copy of H. The equivalence between "every graph on N vertices or its complement contains H" and "every 2-coloring of K_N has a monochromatic H" is standard. ✓ + +**Edge case:** If the infimum set is empty (which cannot happen for finite H by Ramsey's theorem, but Lean's `sInf` on ℕ returns 0 for empty sets), the value would be 0. This is not an issue in practice since the theorem only applies to finite graphs via `[Fintype V]`, but a `Nonempty` hypothesis on the set or a `[Fintype U]` constraint on `graphRamseyNumber` would make the definition more robust. This is a minor concern. + +**`diagRamsey` (line 50–51):** `graphRamseyNumber (⊤ : SimpleGraph (Fin k))` correctly gives R(K_k), the diagonal Ramsey number R(k, k). ✓ + +### Theorem correctness + +**Weak form (`erdos_87`, line 61–67):** + +```lean +∀ ε : ℝ, 0 < ε → ε < 1 → +∃ K : ℕ, ∀ k : ℕ, K ≤ k → +∀ {V : Type*} [Fintype V] (G : SimpleGraph V), + G.chromaticNumber = k → + (diagRamsey k : ℝ) * (1 - ε) ^ k < (graphRamseyNumber G : ℝ) +``` + +This reads: "For every 0 < ε < 1, there exists K such that for all k ≥ K, for every finite graph G with χ(G) = k, we have (1−ε)^k · R(k) < R(G)." This faithfully captures the website statement "R(G) > (1−ε)^k R(k) for every graph G with χ(G) = k." ✓ + +The `chromaticNumber` in Mathlib has type `ℕ∞`. The equality `G.chromaticNumber = k` uses a coercion `k : ℕ → ℕ∞`, which correctly ensures the chromatic number is the finite value k. Since `[Fintype V]` is assumed, the chromatic number is always finite, so this coercion is appropriate. ✓ + +**Strong form (`erdos_87.variants.strong`, line 77–83):** + +```lean +∃ c : ℝ, 0 < c ∧ +∃ K : ℕ, ∀ k : ℕ, K ≤ k → +∀ {V : Type*} [Fintype V] (G : SimpleGraph V), + G.chromaticNumber = k → + c * (diagRamsey k : ℝ) < (graphRamseyNumber G : ℝ) +``` + +This reads: "There exists c > 0 and K such that for all k ≥ K, for every finite graph G with χ(G) = k, we have c · R(k) < R(G)." This matches the website statement. ✓ + +**Relationship between forms:** The strong form implies the weak form (take ε small enough that c > (1−ε)^k for large k, which holds since (1−ε)^k → 0). The formalization correctly separates them as independent open problems. ✓ + +**No mathematical flaws identified.** The formalization is correct and complete. + +### Summary + +| Category | Assessment | +|---|---| +| Code reuse | `ContainsSubgraph`, `graphRamseyNumber`, `diagRamsey` should be consolidated; Mathlib's `IsContained` is available | +| Citations | Missing [FaMc93] (Faudree–McKay) | +| Variants | Complete — both open forms captured, disproven original documented | +| Readability | Good; minor grammar fix suggested | +| Formalizability | Unambiguous, directly formalizable | +| Correctness | **Correct.** No mathematical flaws. Minor robustness concern with `sInf ∅ = 0` edge case. | diff --git a/ai-review/870.md b/ai-review/870.md new file mode 100644 index 0000000000..15eb2a9074 --- /dev/null +++ b/ai-review/870.md @@ -0,0 +1,79 @@ +# AI Review: Erdős Problem 870 + +## 1. Code Reuse + +Several definitions in `870.lean` duplicate or closely parallel existing infrastructure in the codebase: + +- **`IsAdditiveBasis`**: Problem 870 defines its own `IsAdditiveBasis A k` using lists of length ≤ k. The shared library at `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean` provides `Set.IsAsymptoticAddBasisOfOrder A n`, which uses `A ^ n` (sums of *exactly* n elements). Problem 868 already uses the library definition. The two notions are not identical — "at most k" vs "exactly k" — though they coincide when `0 ∈ A`. For number theory, "at most k" is more standard, so the custom definition is defensible but creates inconsistency with 868. + +- **`IsMinimalAdditiveBasis`**: Problem 869 defines `IsMinimalAdditiveBasis2` with an equivalent notion (removing any element makes infinitely many numbers unrepresentable). Problem 868 inlines this pattern. Problem 870's definition (`¬ IsAdditiveBasis (A \ {a}) k`) is logically equivalent for asymptotic bases over ℕ, since "not a basis" means infinitely many exceptions. + +- **`repCount`**: Problem 868 defines `ncard_add_repr A o n` counting *ordered* tuples (functions `Fin o → ℕ`). Problem 870 defines `repCount A k n` counting *unordered* representations (non-decreasing lists of length ≤ k). These are genuinely different functions, though for fixed k the ordered count is at most k! times the unordered count, so the choice does not affect the truth of the conjecture (only the constant c). + +**Recommendation**: Consider unifying additive basis definitions across problems 868–870 or adding a comment explaining why the custom definitions are preferred. At minimum, a docstring note on the relationship to `Set.IsAsymptoticAddBasisOfOrder` would improve clarity. + +## 2. Citations + +The formalization includes four references: + +| Citation | In File | On Website | Match? | +|----------|---------|------------|--------| +| [ErNa88] Erdős & Nathanson, *Minimal asymptotic bases with prescribed densities*, Illinois J. Math. 32 (1988), 562–574 | ✓ | ✓ | ✓ | +| [ErNa79] Erdős & Nathanson, *Bases and nonbases of squarefree integers*, J. Number Theory 11 (1979), 197–208 | ✓ | ✓ | ✓ | +| [Ha56] Härtter, *Ein Beitrag zur Theorie der Minimalbasen*, J. Reine Angew. Math. 196 (1956), 170–204 | ✓ | ✓ | ✓ | +| [Na74] Nathanson, *Minimal bases and powers of 2*, Acta Arith. 49 (1974), 525–532 | ✓ | ✓ | ✓ | + +All citations are complete and match the website. The cross-reference to problem 868 is also correctly noted. + +**Minor note**: The volume number for [Na74] is listed as 49, but Acta Arithmetica volume 49 corresponds to ~1988, not 1974. The 1974 volume would more likely be volume 25 or 26. This may be a bibliographic error inherited from the website itself. + +## 3. Variants + +The website states a single open question: for k ≥ 3, does there exist c = c(k) > 0 such that the representation count condition implies existence of a minimal sub-basis? + +The formalization captures exactly this statement. It also documents two known results in the docstring: +- The k = 2 case proved by Erdős–Nathanson [ErNa79] with the explicit threshold (log 4/3)⁻¹ log n +- The Härtter–Nathanson result on bases without minimal sub-bases + +Unlike problem 868, the known k = 2 result and the Härtter–Nathanson result are not formalized as separate theorem statements — they appear only in the docstring. Problem 868 formalizes both as `erdos_868.variants.fixed_ε` and `erdos_868.variants.Hartter_Nathanson`. Adding analogous variant statements for 870 would improve completeness and consistency with 868's style. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- The docstrings on `IsAdditiveBasis`, `IsMinimalAdditiveBasis`, and `repCount` are clear and mathematically precise. +- The choice to use `List.Pairwise (· ≤ ·)` for non-decreasing order is a clean canonical form for multiset representations. +- The main theorem statement is readable and closely follows the natural language problem statement. +- The namespace `Erdos870` is used appropriately to scope the local definitions. + +**Minor suggestion**: The `repCount` docstring says "non-decreasing lists" but uses `l.Pairwise (· ≤ ·)`, which is a weakly increasing (i.e., non-decreasing) condition — this is correct but could be clarified to explicitly say "weakly increasing / non-decreasing." + +## 5. Formalizability + +The problem as stated on the website is precise enough to formalize: +- "Additive basis of order k" is standard. +- "r(n) counts representations" is standard (modulo ordered vs unordered, which doesn't affect the conjecture's truth). +- The quantifier structure (∀ k ≥ 3, ∃ c > 0, ∀ A basis of order k, ...) is unambiguous. + +**Ambiguity assessment: Low.** The only ambiguity is the exact counting convention for r(n) — ordered vs unordered, exactly k vs at most k summands — but all conventions yield equivalent conjectures up to the constant c. The formalization makes a reasonable and consistent choice (unordered, at most k). + +## 6. Correctness + +The formalization is **mathematically correct** with one notable design choice and one potential concern: + +### Correct aspects: +- The quantifier structure `∀ k ≥ 3 → ∃ c > 0 ∧ ∀ A, ...` faithfully captures the problem. +- `IsAdditiveBasis` correctly captures asymptotic bases via "∃ N₀, ∀ n ≥ N₀" (equivalent to "cofinitely many" over ℕ). +- `IsMinimalAdditiveBasis` correctly captures minimality: removing any element destroys the basis property. +- The `answer(sorry)` wrapper correctly handles the open/unknown truth value. +- The cast `(repCount A k n : ℝ)` correctly lifts to ℝ for comparison with `c * Real.log n`. +- `Real.log` is the natural logarithm, consistent with the standard number-theoretic convention. + +### Design choice — "at most k" vs "exactly k": +The definition `IsAdditiveBasis A k` requires sums of *at most* k elements (`l.length ≤ k`), and `repCount` also counts lists of length ≤ k. This is consistent and standard for number theory. However, it means that even a basis of order 2 is technically also a basis of order 3 (since any sum of 2 elements is also a sum of "at most 3" elements). The problem statement quantifies over k ≥ 3, so this is not an issue in practice, but it means `IsMinimalAdditiveBasis A k` for different values of k are not independent — a set that is a minimal basis of order 2 might not be a minimal basis of order 3. This matches the standard mathematical convention. + +### Potential concern — `Set.ncard` on possibly infinite sets: +`repCount` uses `Set.ncard` on the set of non-decreasing lists of length ≤ k summing to n. This set is always finite (there are finitely many partitions of n into at most k parts, each bounded by n), so `Set.ncard` returns the correct natural number. However, a `Fintype` instance is not explicitly provided. If Lean cannot automatically infer finiteness, `Set.ncard` returns 0 for infinite sets by convention. In practice, this set is provably finite, but the lack of an explicit finiteness proof could complicate downstream reasoning. Using `Finset.card` with an explicit fintype instance, or adding a comment about finiteness, would be more robust. + +### Summary +The formalization is correct and faithfully captures Erdős Problem 870. The main opportunities for improvement are (1) reusing or cross-referencing the shared additive basis library, (2) formalizing the known k = 2 result and Härtter–Nathanson result as separate variant theorems (as done in 868), and (3) ensuring `repCount` is robust by addressing the `Set.ncard` finiteness concern. diff --git a/ai-review/871.md b/ai-review/871.md new file mode 100644 index 0000000000..fa7e734509 --- /dev/null +++ b/ai-review/871.md @@ -0,0 +1,74 @@ +# AI Review: Erdős Problem 871 + +## 1. Code Reuse + +**Several significant opportunities for code reuse exist.** + +- **`IsAdditiveBasis2`**: The local definition (`∃ N₀, ∀ n ≥ N₀, n ∈ sumset A`) is mathematically equivalent to `Set.IsAsymptoticAdditiveBasisOfOrder A 2` from `FormalConjecturesForMathlib/Combinatorics/Additive/Basis.lean`. That library defines the concept via the cofinite filter, and the lemma `isAsymptoticMulBasisOfOrder_iff_atTop` (line 179) provides the `atTop` characterization, which for `ℕ` is equivalent to "for all sufficiently large n." The order-2 specialization `isAsymptoticAdditiveBasisOfOrder_two_iff` (line 102) further reduces this to membership in `A + A`. Replacing the local definition with the library one would improve reuse and interoperability. + +- **`sumset`**: The local `sumset A` is exactly `A + A` using Mathlib's pointwise set addition (`Set.add`). The identical definition appears in at least three other files (337, 869, and 35 has a two-argument variant). Using `A + A` directly (with `open scoped Pointwise`) would eliminate this duplication entirely. + +- **`repCount`**: This definition is duplicated verbatim in `ErdosProblems/328.lean` (line 40) and is essentially identical to `addRepFun` in `ErdosProblems/29.lean` (line 39). All three should be consolidated into a shared utility, ideally in `FormalConjecturesForMathlib`. + +## 2. Citations + +The formalization references: + +- **[ErNa88]**: "Erdős, P. and Nathanson, M.B., *Partitions of bases into disjoint unions of bases*, J. Number Theory (1988)." +- **[ErNa89]**: "Erdős, P. and Nathanson, M.B., *Sets of natural numbers with no minimal asymptotic bases*, Proc. Amer. Math. Soc. (1989)." + +The website (erdosproblems.com/871) lists the same two references [ErNa88] and [ErNa89] and credits "Larsen using Claude Opus 4.5" for the disproof, with additional credits to "Wouter van Doorn, Daniel Larsen, and Terence Tao." The formalization's docstring mentions the Larsen/Claude disproof but does not credit van Doorn or Tao, who are listed on the website. Consider adding them to the docstring for completeness. + +The website also labels the status as "DISPROVED (LEAN)", indicating a Lean-verified proof exists. The formalization currently has `sorry`, so the proof has not yet been filled in here. + +## 3. Variants + +The problem as stated on erdosproblems.com is a single yes/no question. The formalization captures the core question faithfully. The docstring helpfully documents two related results: + +1. The affirmative answer under the stronger hypothesis `1_A * 1_A(n) > c log n` for `c > (log(4/3))⁻¹` [ErNa88]. +2. The counterexample construction for any finite bound `t` [ErNa89]. + +These are not formalized as separate theorems, which is acceptable since they are context rather than variants of the main question. No variants appear to be missing. + +## 4. Readability + +The code is generally readable. Suggestions: + +- The `open Classical Filter` and `open scoped Topology` are somewhat heavy for a file that primarily needs filter notation. If the library definitions from `Basis.lean` were used, the necessary imports would be more targeted. +- The docstring on `repCount` uses both the notation `|\{a \in \{0, \ldots, n\} : ...\}|` and the convolution notation `1_A * 1_A(n)` in the theorem docstring, which is good for connecting the formal definition to the mathematical convention. +- The namespace `Erdos871` is clear and follows the project convention. + +## 5. Formalizability + +**The problem is unambiguously formalizable.** The statement involves only standard, well-defined concepts: additive bases of order 2, representation functions (convolution of indicator functions), set partitions, and limits. There is no ambiguity in the meaning of any term. The only minor interpretive choice is whether "additive basis of order 2" means exact (every natural number) or asymptotic (every sufficiently large natural number); the formalization correctly uses the asymptotic version, which is standard in additive number theory and matches the source. + +**Ambiguity assessment: Very low.** The problem is a clean yes/no question about well-defined objects. + +## 6. Correctness + +**The formalization is mathematically correct.** + +- **`answer(False)`**: The problem is disproved, meaning the universal statement is false. Since `answer(False) ↔ P` is equivalent to `¬P`, this correctly asserts that not every basis with representation function tending to infinity can be partitioned into two disjoint bases. This matches the website status. + +- **`IsAdditiveBasis2`**: Correctly captures the asymptotic basis of order 2 property. Using `n ≥ N₀` vs `n > N₀` is immaterial (equivalent up to shifting `N₀`). + +- **`sumset`**: Correctly defines `A + A`, allowing `a = b` (an element may be used twice as both summands). This matches the standard convention. + +- **`repCount`**: Counts ordered pairs `(a, n-a)` with both in `A` and `0 ≤ a ≤ n`. This is the standard ordered representation function `1_A * 1_A(n)`, consistent with the problem statement. + +- **Tendsto condition**: `Tendsto (fun n => (repCount A n : ℝ)) atTop atTop` correctly formalizes "$1_A * 1_A(n) \to \infty$". The cast to `ℝ` is necessary for `Tendsto` to work with the `atTop` filter on an ordered type. + +- **Partition condition**: `A₁ ∪ A₂ = A ∧ Disjoint A₁ A₂` correctly encodes that `A₁, A₂` form a partition of `A`. Both must independently be additive bases of order 2. + +**No mathematical flaws identified.** The formalization faithfully and completely captures the problem as stated. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Three local definitions (`sumset`, `IsAdditiveBasis2`, `repCount`) could be replaced by library/shared code | +| Citations | Matches website; could add van Doorn and Tao credits | +| Variants | Complete — no missing variants | +| Readability | Good | +| Formalizability | Unambiguous, cleanly formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/872.md b/ai-review/872.md new file mode 100644 index 0000000000..b0fa53ec53 --- /dev/null +++ b/ai-review/872.md @@ -0,0 +1,92 @@ +# AI Review: Erdős Problem 872 + +## 1. Code Reuse + +**`IsPrimitive` is duplicated across multiple files.** The same definition (antichain under divisibility on `Finset ℕ`) appears in: +- `ErdosProblems/872.lean` (line 48) — `Finset ℕ` +- `ErdosProblems/882.lean` (line 51) — `Finset ℕ` +- `ErdosProblems/164.lean` (line 40) — `Set ℕ` +- `ErdosProblems/892.lean` (line 37) — sequence variant `IsPrimitiveSeq` + +A shared definition in a utility file (e.g., `FormalConjecturesForMathlib/Combinatorics/Basic.lean`, which already hosts `IsSumFree` and `IsSidon`) would reduce duplication. The `Set ℕ` version (164) and `Finset ℕ` version (872, 882) could coexist with a coercion bridge. + +Alternatively, Mathlib's `IsAntichain (· ∣ ·) (↑A : Set ℕ)` captures the same concept. This is logically the contrapositive of `IsPrimitive`: `∀ a ∈ A, ∀ b ∈ A, a ≠ b → ¬(a ∣ b)` vs. `∀ a ∈ A, ∀ b ∈ A, a ∣ b → a = b`. Using the Mathlib definition would provide access to existing antichain lemmas. However, the custom definition is reasonable for clarity and self-containedness. + +No other code in the codebase (game-theoretic frameworks, saturation game utilities) is directly reusable here. The game mechanics are specific to this problem. + +## 2. Citations + +The formalization cites: + +> [Er92c] Erdős, P., *Some of my favourite problems in various branches of combinatorics*, Matematiche (Catania) 47 (1992), 231–240. + +The website [erdosproblems.com/872](https://www.erdosproblems.com/872) lists: +- **[Er92c]** as the primary reference (matching the formalization) +- **[FuSe91]** Füredi and Seress — proved the analogous *triangle-free graph* game lasts Ω(n log n) moves +- **[BPW16]** Biró, Horn, and Wildstrom — showed the triangle-free game ends in at most ((26/121)+o(1))n² moves + +The [FuSe91] and [BPW16] references concern the *triangle-free graph saturation game*, an analogue rather than the primitive-set game itself. It is reasonable to omit them from the formalization since they address a different (though related) game. **No issues with the citation.** + +## 3. Variants + +The formalization captures both variants mentioned on the website: + +- **Weak form** (`erdos_872`): ∃ ε > 0 such that Lengthener guarantees ≥ εn moves — matches "at least εn moves" +- **Strong form** (`erdos_872.variants.strong`): ∀ ε > 0, Lengthener guarantees ≥ (1−ε)n/2 moves — matches "at least (1−ε)n/2 moves" + +Both are quantified over `∀ firstPlayer : Bool`, correctly handling Erdős's ambiguity about who moves first. **All variants are captured.** + +## 4. Readability + +The code is well-structured and readable: +- Definitions build naturally: `IsPrimitive` → `gameUniverse` → `legalMoves` → `LegalStrategy` → `playGame` → theorem statements. +- Docstrings clearly explain each component with matching mathematical notation. +- The module docstring provides good context about the problem being a saturation game and notes the first-player ambiguity. +- Namespace `Erdos872` keeps definitions scoped. + +**Minor suggestion:** The `playGame` function returns `ℕ` (number of moves), but the theorem statements cast it to `ℝ` for comparison with `ε * n`. This is necessary but slightly obscures the statement. A brief comment or docstring note explaining the cast would marginally improve readability. Overall, readability is good. + +## 5. Formalizability + +The problem is **highly formalizable** with **low ambiguity**: + +- The game rules are combinatorially precise: the universe {2,...,n}, the legality condition (maintaining a primitive set), alternating play, and termination (no legal moves) are all unambiguous. +- The only ambiguity Erdős leaves is who moves first — the formalization explicitly handles this with `∀ firstPlayer : Bool`. +- The quantitative questions (≥ εn and ≥ (1−ε)n/2) are precise. + +**One philosophical note:** The problem as stated by Erdős is really *two questions* ("Can the Lengthener guarantee εn moves?" and "Can the Lengthener guarantee (1−ε)n/2 moves?") rather than conjectures with a definite expected answer. The `answer(sorry)` wrapper correctly reflects this uncertainty — the truth value itself is unknown. + +## 6. Correctness + +### Game modeling + +The formalization correctly models the game: + +- **State representation:** A `Finset ℕ` accumulates chosen elements, starting from `∅`. ✓ +- **Legal moves:** Elements in `gameUniverse n \ A` that maintain primitivity. The condition `∀ a ∈ A, ¬(a ∣ x) ∧ ¬(x ∣ a)` correctly ensures that inserting x keeps A primitive (no new divisibility relation is introduced). ✓ +- **Turn alternation:** `!lengthenerTurn` flips each turn. ✓ +- **Termination:** The game ends when `legalMoves` is empty, returning 0 additional moves. ✓ + +### Strategy formulation + +- `LegalStrategy` maps game states (with nonempty legal moves) to legal moves. This is a **positional (memoryless) strategy**, depending only on the current set A, not the history of play. +- For this game, positional strategies are **without loss of generality**: the set A fully determines the legal moves, and the history of how A was constructed is irrelevant. The turn can be inferred from the parity of |A| combined with who went first (tracked externally by `playGame`). ✓ + +### Quantifier structure + +- Weak: `∃ ε > 0, ∃ N₀, ∀ n ≥ N₀, ∀ firstPlayer, ∃ sL, ∀ sS, game ≥ εn` — Lengthener can choose a strategy (possibly depending on n and firstPlayer) that works against all Shortener strategies. ✓ +- Strong: `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, ∀ firstPlayer, ∃ sL, ∀ sS, game ≥ (1−ε)n/2` — same but with the stronger bound. ✓ + +The quantifier ordering is correct: Lengthener's strategy can depend on ε, n, and firstPlayer, but must work against all Shortener strategies. + +### Fuel parameter + +The `fuel` parameter is set to `n + 1` in the theorem statements. The maximum number of moves is at most `|gameUniverse n| = n − 1` (for n ≥ 2). Since `n + 1 ≥ n − 1` for all n, the fuel is always sufficient and does not artificially truncate any game. ✓ + +### Potential subtlety + +The strong form uses the bound `(1 - ε) * (n : ℝ) / 2`. The maximum antichain in {2,...,n} under divisibility has size approximately n/2 (elements in (n/2, n]), so this bound says the Lengthener can force the game to last nearly as long as the maximum antichain. This is a very strong claim — it asserts the Shortener essentially cannot shorten the game by more than an ε-fraction. The formalization correctly captures this. Whether this is true is, of course, the open mathematical question. + +### Verdict + +**The formalization is correct and complete.** No mathematical flaws are evident. The game mechanics, strategy spaces, quantifier structure, and bounds all faithfully represent the problem as stated by Erdős. The handling of the first-player ambiguity is appropriate. diff --git a/ai-review/874.md b/ai-review/874.md new file mode 100644 index 0000000000..1726370656 --- /dev/null +++ b/ai-review/874.md @@ -0,0 +1,94 @@ +# Review: Erdős Problem 874 + +## 1. Code Reuse + +The definitions `rSubsetSums`, `IsAdmissible874`, and `kAdmissible` are problem-local, which is appropriate. However, there is notable overlap with **Problem 875** (`875.lean`), which defines `rSubsetSumsInf` and `IsAdmissibleInf` — the infinite-set analogues of the same concepts. These two files independently define the "admissible" notion. A shared definition (parameterized or with a `Finset → Set` coercion lemma) in a utility file could reduce duplication, though the Finset vs Set distinction makes a fully unified definition non-trivial, so the current approach is defensible. + +Existing utilities of potential relevance: +- `FormalConjecturesForMathlib/Data/Finset/Powerset.lean` provides `disjoint_powersetCard_powersetCard`, which could be useful in a proof of properties of `rSubsetSums`. +- `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` defines a general `subsetSums` for additive monoids, but it operates on `Set` and does not restrict by cardinality, so it is not directly applicable here. +- Several other problems (53, 343, 882) define their own `subsetSums` variants, but none match the cardinality-restricted form needed here. + +**Verdict:** No significant reuse opportunities missed. The current definitions are clean and appropriate. + +## 2. Citations + +The docstring references **Straus [St66]**, **Erdős–Nicolas–Sárközy [ENS91]**, and **Deshouillers–Freiman [DeFr99]**, which are the three key results mentioned on the website. + +**Missing from the docstring:** +- **[Er62c]** — Erdős's original paper where the problem was posed. +- **[Er98]** — A later Erdős reference also listed on the website. + +These are the original sources for the problem and should be cited for completeness. Additionally, the website lists **related problems 186, 789, and 875**; cross-references to these (especially 875, the infinite version) would improve navigability. + +**Recommendation:** Add `[Er62c]` and `[Er98]` to the docstring references, and add a note mentioning related problems (at minimum, Problem 875 as the infinite analogue). + +## 3. Variants + +The formalization captures the main asymptotic conjecture $k(N) \sim 2N^{1/2}$. The docstring mentions the intermediate bounds: +- Straus: $\liminf k(N)/N^{1/2} \geq 2$ and $\limsup k(N)/N^{1/2} \leq 4/\sqrt{3}$ +- ENS: improved upper bound to $(143/27)^{1/2}$ + +These intermediate results are **not formalized as separate theorems**. Since both are proved results, they could be formalized as `erdos_874.variants.straus_lower`, `erdos_874.variants.straus_upper`, and `erdos_874.variants.ens_upper`. The main theorem subsumes them, but having them as standalone lemmas would be historically valuable and could serve as stepping stones. + +The website does not list additional variants beyond these and the infinite version (Problem 875, which has its own file). + +**Verdict:** The core conjecture is captured. The intermediate bounds are reasonable candidates for variant theorems but are not strictly required since they are implied by the main result. + +## 4. Readability + +The code is well-structured and readable: +- Clear namespace scoping (`Erdos874`). +- Each definition has a well-written docstring explaining the mathematical concept. +- The naming convention (`rSubsetSums`, `IsAdmissible874`, `kAdmissible`) is descriptive and follows Lean conventions. +- The `874` suffix on `IsAdmissible874` correctly disambiguates from other uses of "admissible" in the codebase (e.g., Problem 879 uses "admissible" to mean pairwise coprime). + +Minor suggestion: The exponent `((1 : ℝ) / 2)` could be replaced by `(1 / 2 : ℝ)` for marginally better readability, though this is stylistic. + +**Verdict:** Highly readable. No significant improvements needed. + +## 5. Formalizability + +The problem is **clearly formalizable** and the formalization demonstrates this. The key concepts — r-fold subset sums, pairwise disjointness, and asymptotic equivalence — all have clean formal counterparts: + +- "Distinct elements $a_1 < \cdots < a_r \in A$" maps directly to `powersetCard r` (choosing r-element subsets). +- "Disjoint for distinct $r$" maps to pairwise `Disjoint` on `Finset`. +- "$k(N) \sim 2N^{1/2}$" maps to the standard ε-definition of asymptotic equivalence via `Filter.Eventually` and `atTop`. + +**Ambiguity assessment:** Very low. The original problem statement is precise. The only minor ambiguity is whether "estimate $k(N)$" means an exact asymptotic or just bounds, but the specific conjecture $k(N) \sim 2N^{1/2}$ resolves this. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +Detailed analysis: + +- **`rSubsetSums`** (line 41–42): Correctly computes $S_r = \{a_1 + \cdots + a_r : a_1 < \cdots < a_r \in A\}$ using `powersetCard r` (which selects all r-element subsets) followed by `.image (fun S => S.sum id)`. The ordering constraint $a_1 < \cdots < a_r$ is merely a way of saying "r distinct elements," which is exactly what `powersetCard` provides. ✓ + +- **`IsAdmissible874`** (line 46–48): Correctly requires `Disjoint` for all pairs $r_1 \neq r_2$ with $r_1, r_2 \geq 1$. The $r \geq 1$ constraint correctly excludes the trivial case $r = 0$ (where $S_0 = \{0\}$ corresponding to the empty sum). ✓ + +- **`kAdmissible`** (line 51–52): Uses `sSup` on $\{k \mid \exists A \subseteq \text{Icc}\ 1\ N,\ \text{IsAdmissible874}\ A \wedge |A| = k\}$. This is well-defined because: + - The set is **nonempty**: $A = \emptyset$ is admissible (all `rSubsetSums ∅ r = ∅` for $r \geq 1$, and empty sets are trivially disjoint) with $k = 0$. + - The set is **bounded above** by $N$ (since $A \subseteq \text{Icc}\ 1\ N$ implies $|A| \leq N$). + - Therefore `sSup` on `ℕ` equals the maximum of this finite set. ✓ + +- **`erdos_874`** (line 60–65): The statement $\forall \varepsilon > 0,\ \forall^f N,\ (2 - \varepsilon)\sqrt{N} \leq k(N) \leq (2 + \varepsilon)\sqrt{N}$ is the standard formalization of $k(N) \sim 2\sqrt{N}$. This is correct and matches the proved result of Deshouillers–Freiman [DeFr99]. ✓ + +- **Edge case check**: When $r > |A|$, `powersetCard r` returns `∅`, so `rSubsetSums A r = ∅`. Disjointness with any set holds trivially. This is correct — there are no sums of more elements than the set contains. ✓ + +- **Tag correctness**: `@[category research solved, AMS 5 11]` — the problem is indeed solved (by Deshouillers–Freiman), and AMS classification 11 (Number Theory) is appropriate. ✓ + +**Verdict:** No mathematical errors or incompleteness detected. The formalization is a faithful and correct rendering of the problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities; minor overlap with 875.lean is acceptable | +| Citations | Missing [Er62c] and [Er98]; no cross-references to related problems | +| Variants | Core conjecture captured; intermediate bounds could be added as variants | +| Readability | Excellent | +| Formalizability | Unambiguous; cleanly formalizable | +| Correctness | Fully correct and complete | + +**Overall:** A clean, correct formalization. The main actionable items are adding the missing original Erdős references [Er62c] and [Er98] to the docstring, and optionally formalizing the intermediate Straus/ENS bounds as variant theorems. diff --git a/ai-review/875.md b/ai-review/875.md new file mode 100644 index 0000000000..6ab2d0e9c3 --- /dev/null +++ b/ai-review/875.md @@ -0,0 +1,80 @@ +# AI Review: Erdős Problem 875 + +## 1. Code Reuse + +Problem 874 (`FormalConjectures/ErdosProblems/874.lean`) defines closely related finite-set analogues: +- `rSubsetSums : Finset ℕ → ℕ → Finset ℕ` (using `powersetCount` and `image`) +- `IsAdmissible874 : Finset ℕ → Prop` + +Problem 875 defines infinite-set versions: +- `rSubsetSumsInf : Set ℕ → ℕ → Set ℕ` (using existential over finsets) +- `IsAdmissibleInf : Set ℕ → Prop` + +These are structurally identical modulo the finite/infinite distinction. There is an opportunity to unify: `rSubsetSumsInf` could be defined as `⋃ (F : Finset ℕ) (_ : ↑F ⊆ A), ↑(rSubsetSums F r)` or similar, reusing the 874 definition. However, since the 874 definition operates on `Finset ℕ` subsets (via `powersetCount`) while 875 needs an existential over all finite subsets of an infinite set, the current separate definitions are reasonable. It would be worth adding a lemma relating them (e.g., for finite `A`, the two notions coincide). + +`FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` defines `subsetSums` (all subset sums of a set), which is related but does not track the number of summands `r`, so it is not directly applicable here. + +## 2. Citations + +The website cites **[Er98]** as the reference. The current docstring says only: + +> A problem of Deshouillers and Erdős (an infinite version of problem #874). + +This should be expanded to include the actual citation. [Er98] refers to: + +> P. Erdős, "Some of my new and almost new problems and results in combinatorial number theory," in *Number theory: Diophantine, computational and algebraic aspects* (Eger, 1996), de Gruyter, Berlin, 1998, pp. 169–180. + +**Recommendation:** Add the full citation to the docstring. + +## 3. Variants + +The website poses three questions: +1. How rapidly must such a sequence grow? +2. How small can $a_{n+1} - a_n$ be? +3. For which values of $c$ is it possible that $a_{n+1} - a_n \leq n^c$? + +The formalization captures: +- **Part (a)** (`erdos_875`): Existence of an admissible set with $a_{n+1}/a_n \to 1$. This addresses question (1) by formalizing Erdős's remark that constructing such a sequence is "not entirely trivial." +- **Part (b)** (`erdos_875.variants.gap`): Existence of some $c > 0$ and an admissible sequence with gaps $a_{n+1} - a_n \leq n^c$ eventually. This addresses question (3) partially. + +**Issue with part (b):** The original problem asks to *determine* for which $c$ this is possible — i.e., characterize the set of valid $c$ values (or find the critical threshold). The formalization weakens this to mere *existence* of some $c > 0$. A more faithful formalization would either: +- Identify a threshold $c_0$ and prove that the property holds for $c > c_0$ and fails for $c < c_0$, or +- At minimum, include a negative result showing some $c$ values are impossible. + +Question (2) ("How small can $a_{n+1} - a_n$ be?") is partially subsumed by question (3) but is more general — it could also ask about bounded gaps or gaps growing slower than any polynomial. This is not separately formalized, which is acceptable given it overlaps with (3). + +## 4. Readability + +The code is well-structured and readable: +- Clear docstrings on all definitions and theorems. +- Logical separation into parts (a) and (b). +- Good use of `Filter.atTop` for "eventually" statements. +- The formulation of $a_{n+1}/a_n \to 1$ as "$\forall \varepsilon > 0$, eventually $a(n+1) \leq (1+\varepsilon) \cdot a(n)$" is a standard and clear one-sided reformulation (the other direction $a(n+1) \geq a(n)$ follows from `StrictMono`). + +Minor suggestion: the namespace `Erdos875` is fine but the definition names `rSubsetSumsInf` / `IsAdmissibleInf` use a suffix convention that differs from 874's `rSubsetSums` / `IsAdmissible874`. Consider using a consistent naming scheme (e.g., both using the problem number suffix, or both using `Inf`/no suffix, since namespacing already disambiguates). + +## 5. Formalizability + +**Part (a):** Fully precise and unambiguously formalizable. The statement "there exists an admissible set with $a_{n+1}/a_n \to 1$" is a clear existence claim. + +**Part (b):** The original problem is inherently open-ended ("determine for which $c$..."), making full formalization difficult without knowing the answer. The current existential formalization is a reasonable partial capture, but it should be documented that this is a weakening. If the answer were known (e.g., "all $c > 1/2$"), a precise characterization could be stated. + +**Overall ambiguity: Low for part (a), moderate for part (b).** The main source of ambiguity is the "determine" phrasing in the original, which is characteristic of open problems where the precise answer is unknown. + +## 6. Correctness + +### Definitions +- `rSubsetSumsInf`: Correctly captures $S_r = \{a_{i_1} + \cdots + a_{i_r} : i_1 < \cdots < i_r\}$ via existential over finsets of size $r$ contained in $A$. The use of `Finset ℕ` automatically ensures distinctness of elements. ✓ +- `IsAdmissibleInf`: Correctly requires pairwise disjointness of $S_{r_1}$ and $S_{r_2}$ for all $r_1 \neq r_2$ with $r_1, r_2 \geq 1$. ✓ + +### Part (a): `erdos_875` +- Asks for a strictly monotone sequence `a : ℕ → ℕ` whose range is admissible and satisfying the ratio condition. ✓ +- The ratio condition is stated one-sided: $a(n+1) \leq (1+\varepsilon) \cdot a(n)$. Since `StrictMono a` gives $a(n) < a(n+1)$, hence $a(n+1)/a(n) > 1$ always, and the upper bound gives $a(n+1)/a(n) \leq 1 + \varepsilon$ eventually. Together these yield $a(n+1)/a(n) \to 1$. ✓ +- Note: `a : ℕ → ℕ` starts from index 0. The problem statement uses $a_1 < a_2 < \cdots$ (1-indexed). This is a harmless indexing convention difference. ✓ + +### Part (b): `erdos_875.variants.gap` +- Mathematically correct as an existence statement: there exist $c > 0$ and an admissible sequence with eventually bounded gaps. ✓ +- **However, this is strictly weaker than the original problem**, which asks for a characterization. This is a meaningful incompleteness. The docstring does note "Formalized as: there exists $c > 0$..." which is honest about the weakening, but it would be clearer to explicitly flag this as a partial formalization. + +### Summary +The formalization is **mathematically correct** for what it states. Part (a) is a faithful and complete capture. Part (b) is a correct but incomplete capture — it formalizes the easy direction (existence) of a characterization problem. No mathematical flaws are present. diff --git a/ai-review/876.md b/ai-review/876.md new file mode 100644 index 0000000000..2982095ecf --- /dev/null +++ b/ai-review/876.md @@ -0,0 +1,88 @@ +# Erdős Problem 876 — Review + +## 1. Code Reuse + +The formalization defines `Erdos876.IsSumFreeErdos` locally. Several related "sum-free" definitions exist in the codebase: + +- **`IsSumFree` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`**: Defined as `Disjoint (A + A) A` — the classical pairwise sum-free notion (no `a + b = c`). This is a fundamentally different concept; Erdős 876 forbids sums of *arbitrarily many* distinct smaller elements, not just two. +- **`Erdos790.IsSumFree` in `ErdosProblems/790.lean`**: No element equals the sum of two or more distinct elements. Works over `Finset ℤ` with `S.card ≥ 2`. Very similar in spirit but differs in: + - Domain: `ℤ` vs `ℕ` + - Container: `Finset` vs `Set` + - Minimum summand count: `card ≥ 2` vs `Nonempty` (card ≥ 1) + - The "strictly smaller" constraint (876 requires `x < a`; 790 uses `S ⊆ B.erase b`) +- **`Erdos877.IsSumFree` in `ErdosProblems/877.lean`**: Classical pairwise sum-free over `Finset ℕ`. Different concept. + +The difference between `Nonempty` and `card ≥ 2` is immaterial for 876: a singleton `S = {b}` with `b < a` trivially satisfies `S.sum id = b < a ≠ a`, so the constraint never activates for singletons. The "strictly smaller" requirement in 876 is integral to the problem statement and prevents unification with 790's definition. + +**Verdict**: No existing definition can be directly reused. The local definition is justified. + +## 2. Citations + +The formalization's docstring mentions only Graham's result ($a_{n+1} - a_n < n^{1+o(1)}$). The [erdosproblems.com/876](https://www.erdosproblems.com/876) page lists substantially more: + +- **Erdős (1962c)**: Proved sum-free sets have density zero. +- **Erdős (1975b, 1977c)**: Asked about the maximum value of $\sum_{n \in A} 1/n$. +- **Graham**: Proved $a_{n+1} - a_n < n^{1+o(1)}$ (mentioned in the formalization). +- **Melfi**: Proved somewhat weaker results. +- **Deshouillers, Erdős, Melfi (1999)**: Constructed a sum-free set with $a_n \sim n^{3+o(1)}$. +- **Luczak & Schoen (2000)**: Established bounds on $|A \cap [1,N]|$ and density results. +- **Sullivan**: Showed $\sum_{n \in A} 1/n < 4$; conjectured the maximum slightly exceeds 2. +- **Related Problem**: 790 is listed as related. + +The docstring should include citation keys (e.g., `[DEM99]`, `[LuSc00]`) for the major references, and note the connection to Problem 790. + +## 3. Variants + +The website poses the broader question: *"How small can $a_{n+1} - a_n$ be?"* The formalization captures only the specific yes/no subquestion of whether the gap can be $< n$. Possible additional variants include: + +- **Graham's bound as a theorem**: There exists an infinite sum-free set with $a_{n+1} - a_n < n^{1+\varepsilon}$ for all $\varepsilon > 0$ and sufficiently large $n$. This is a solved result and could be formalized as a `research solved` variant. +- **Deshouillers–Erdős–Melfi construction**: There exists an infinite sum-free set with $a_n \sim n^{3+o(1)}$, providing explicit gap information. +- **Density zero**: Every infinite sum-free set has natural density zero (Erdős 1962c). This is a solved result. +- **Sum of reciprocals**: Is $\sup_A \sum_{n \in A} 1/n$ finite? (Sullivan showed $< 4$.) + +These are arguably distinct problems rather than variants, but capturing Graham's bound as a solved variant would add value since it is directly mentioned in the problem statement. + +## 4. Readability + +The code is clear and well-structured. Minor suggestions: + +- The condition `∀ x ∈ S, x ∈ A` could be written as `↑S ⊆ A` for conciseness, though the current form is arguably more explicit. +- The docstring for `erdos_876` is clear and correctly describes the problem. +- The name `IsSumFreeErdos` effectively disambiguates from the classical pairwise sum-free notion. + +**Verdict**: Readability is good; no significant issues. + +## 5. Formalizability + +The problem as stated on the website is precisely a yes/no question: *"Is it possible that $a_{n+1} - a_n < n$?"* This is unambiguously formalizable. The `answer(sorry)` pattern is correctly used for an open problem with unknown truth value. + +The only potential source of ambiguity is whether $\mathbb{N}$ includes 0. The website implicitly uses positive integers ($a_1 < a_2 < \cdots$), while Lean's `ℕ` includes 0. This is inconsequential: including or excluding 0 from the sequence does not affect achievability of the gap condition, since `StrictMono a` forces the sequence to be eventually large regardless. + +**Verdict**: Fully formalizable with no meaningful ambiguity. + +## 6. Correctness + +### Definition `IsSumFreeErdos` + +The definition states: for all $a \in A$, for all nonempty $S \subseteq A$ with every element of $S$ strictly less than $a$, we have $\sum S \neq a$. This correctly captures "no element is the sum of finitely many distinct smaller elements of $A$": + +- **Distinct**: Elements are automatically distinct since $S$ is a `Finset`. +- **Smaller**: Enforced by `∀ x ∈ S, x < a`. +- **Finitely many**: Enforced by $S$ being a `Finset`. +- **Nonemptiness**: Required by `S.Nonempty`. As noted above, the singleton case is vacuously satisfied (a singleton sum of a strictly smaller element cannot equal the target), so this is equivalent to requiring `S.card ≥ 2`. + +### Main theorem `erdos_876` + +The 0-indexing is handled correctly. In 1-indexed notation the question asks whether $a_{n+1} - a_n < n$ for all sufficiently large $n$. With 0-indexed `a : ℕ → ℕ`: + +- `a n` corresponds to $a_{n+1}$ in 1-indexed notation. +- The condition `a (n + 1) - a n < n + 1` says $a_{n+2} - a_{n+1} < n+1$ in 1-indexed terms. +- Substituting $m = n + 1$: $a_{m+1} - a_m < m$ for all sufficiently large $m$. ✓ + +Natural number subtraction is safe here: `StrictMono a` guarantees `a (n+1) > a n`, so `a (n+1) - a n` is the true mathematical difference. + +### Potential issue: quantifier over all `S : Finset ℕ` + +The definition quantifies over *all* finsets of naturals, not just finite subsets of $A$. The constraint `∀ x ∈ S, x ∈ A` restricts to subsets of $A$, so this is correct but slightly indirect. An alternative formulation using `S ⊆ A.toFinset` or filtering would be less general but logically equivalent. The current approach is fine. + +**Verdict**: The formalization is mathematically correct. The 0-to-1 index shift is properly handled, and the sum-free definition accurately captures the intended notion. diff --git a/ai-review/877.md b/ai-review/877.md new file mode 100644 index 0000000000..fa3c67e49c --- /dev/null +++ b/ai-review/877.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 877 + +## 1. Code Reuse + +**Duplicate `IsSumFree` definition.** The `IsSumFree` definition at line 43 is identical to the one in `ErdosProblems/748.lean` (line 52): + +```lean +def IsSumFree (A : Finset ℕ) : Prop := + ∀ b ∈ A, ∀ c ∈ A, b + c ∉ A +``` + +Both problems concern sum-free subsets of `{1, …, n}` and are explicitly related (the website for Problem 877 cross-references Problem 748 as the non-maximal counterpart). A shared definition would be appropriate. + +**Mathlib-style `IsSumFree` exists.** `FormalConjecturesForMathlib/Combinatorics/Basic.lean` (line 30) defines a general `IsSumFree (A : Set α) : Prop := Disjoint (A + A) A` using pointwise addition. The local `Finset ℕ` definitions are logically equivalent (for the natural-number case) but use explicit quantifiers rather than the sumset/disjointness formulation. Either could serve as a shared definition; the quantifier form is arguably more self-contained for individual problem files, but the sumset form is more idiomatic for Mathlib. + +**`IsMaximalSumFree` parallels `IsMaximalSidonSetIn`.** The structure of `IsMaximalSumFree` (line 49) closely mirrors `Set.IsMaximalSidonSetIn` in the same Mathlib file (line 104), which follows the pattern: subset condition ∧ property ∧ maximality condition. This structural parallel could be leveraged if a general "maximal with property in interval" abstraction were introduced, though this is not strictly necessary. + +**`DecidablePred` instance.** Problem 748 provides a `DecidablePred IsSumFree` instance (line 55–56) that Problem 877 does not. If a shared definition is used, this instance would automatically be available. + +## 2. Citations + +The module docstring uses shorthand references `[CaEr90]`, `[LuSc01]`, `[BLST15]`, `[BLST18]` without full bibliographic details. Compare with Problem 748, which provides fuller citations. Based on the erdosproblems.com page, the references should be expanded: + +- **[CaEr90]** — Cameron, P.J. and Erdős, P. (no further details available on the website, but this is the foundational paper establishing the lower bound and posing the question). +- **[Er98]** — Erdős, P. (referenced in the theorem docstring but not in the module docstring). +- **[LuSc01]** — Łuczak, T. and Schoen, T. (resolved the conjecture by proving ∃ c < 1/2 with f_m(n) < 2^{cn}). +- **[BLST15]** — Balogh, J., Liu, H., Sharifzadeh, M. and Treglown, A. (proved f_m(n) = 2^{(1/4+o(1))n}). +- **[BLST18]** — Balogh, J., Liu, H., Sharifzadeh, M. and Treglown, A. (refined to f_m(n) = (C_n + o(1)) · 2^{n/4}). + +The docstring should include full bibliographic entries (journal, year, title) as done in Problem 748. + +## 3. Variants + +The formalization captures only the original conjecture: f_m(n) = o(2^{n/2}). + +**Not captured:** +- **Sharp asymptotics.** The module docstring mentions f_m(n) = 2^{(1/4+o(1))n} [BLST15] and the refined f_m(n) = (C_n + o(1)) · 2^{n/4} [BLST18], but neither is formalized as a separate theorem. The stronger result f_m(n) = 2^{(1/4+o(1))n} would be a natural variant to include, as it pins down the exact exponential growth rate and supersedes the original conjecture. +- **Relationship to Problem 748.** The website notes Problem 748 (counting all sum-free subsets, not just maximal ones) as related. A remark or cross-reference in the Lean code would be helpful. + +The choice to formalize only the o(2^{n/2}) question is reasonable since that is the original problem statement. + +## 4. Readability + +The code is well-structured and readable: +- Definitions are clearly documented with docstrings. +- The `IsSumFree` → `IsMaximalSumFree` → `maximalSumFreeCount` progression is logical. +- The module docstring provides good mathematical context. + +**Minor suggestions:** +- The docstring for `IsSumFree` says "for all b, c ∈ A, b + c ∉ A" which is clear. The module-level docstring says "no three elements a, b, c with a = b + c" — both are standard phrasings but switching between them could cause momentary confusion. +- The theorem docstring redundantly restates both the little-o formulation and the ε-δ expansion, which is actually helpful for readability. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement "Is it true that f_m(n) = o(2^{n/2})?" is precise: +- "Maximal sum-free subset" has a standard, unambiguous definition. +- The little-o notation has a standard ε-δ interpretation. +- The ground set {1, …, n} is explicit. + +There is no ambiguity in the statement itself. The only potential subtlety is whether "sum-free" allows a = b (i.e., whether 2a ∈ A is forbidden when a ∈ A). The formalization uses `∀ b ∈ A, ∀ c ∈ A, b + c ∉ A`, which does allow b = c, matching the standard convention. This is correct. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +1. **`IsSumFree` (line 43–44):** `∀ b ∈ A, ∀ c ∈ A, b + c ∉ A`. This correctly captures the standard definition. Note that b and c are not required to be distinct, so 2b ∉ A is enforced when b ∈ A, which is standard. + +2. **`IsMaximalSumFree` (line 49–52):** Three conjuncts: + - `A ⊆ Finset.Icc 1 n` — A is contained in {1, …, n}. ✓ + - `IsSumFree A` — A is sum-free. ✓ + - `∀ x ∈ Finset.Icc 1 n, x ∉ A → ¬ IsSumFree (insert x A)` — no element outside A (but in {1, …, n}) can be added while preserving sum-freeness. This is the correct maximality condition. ✓ + +3. **`maximalSumFreeCount` (line 55–56):** Counts subsets of `(Finset.Icc 1 n).powerset` satisfying `IsMaximalSumFree`. This is correct: it enumerates all subsets of {1, …, n} and filters by the maximality predicate. The `noncomputable` annotation is appropriate since `IsMaximalSumFree` involves existential quantification over arbitrary elements. + +4. **`erdos_877` (line 71–76):** The statement `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, (maximalSumFreeCount n : ℝ) ≤ ε * 2^(n/2)` is the correct ε-δ formulation of f_m(n) = o(2^{n/2}). The cast to ℝ is necessary for the division n/2 and the real-valued inequality. ✓ + +5. **`answer(True)`:** The problem asks "is it true that…?" and it was proved true by Łuczak and Schoen. The `answer(True)` is correct. ✓ + +6. **Category tags:** `category research solved` and `AMS 5` (combinatorics) are appropriate. The website also tags this as additive combinatorics; AMS 11 (number theory) could be considered but is not essential. + +**No mathematical flaws identified.** The formalization is a faithful and complete translation of the original problem. diff --git a/ai-review/878.md b/ai-review/878.md new file mode 100644 index 0000000000..53076b564c --- /dev/null +++ b/ai-review/878.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 878 + +## 1. Code Reuse + +No significant code reuse opportunities identified. The formalization uses standard Mathlib primitives (`Nat.primeFactors`, `Nat.log`, `Finset.sup`, `sSup`) directly, which is appropriate. The `FormalConjecturesForMathlib` utility library does not contain any custom definitions relevant to prime-factorization-based arithmetic functions, additive number theory, or natural density. The formalization is self-contained and defines all needed concepts (`f`, `F`, `ValidAssignment`, `H`) locally in the `Erdos878` namespace, which is the right approach given their specificity. + +## 2. Citations + +The docstring references `[Er84e]` in two places: +- "Erdős [Er84e] proved this along a subsequence of $x \to \infty$" (for Conjecture 3). +- "[Er84e] Erdős proved $x \log\log\log\log x \ll H(x) \ll x \log\log\log x$" (for Conjecture 5). + +The website at erdosproblems.com/878 confirms both results are attributed to Erdős. However, the citation `[Er84e]` is shorthand and does not appear to be expanded into a full bibliographic reference anywhere in the file. The website does not provide a full citation either — it uses the same shorthand convention. This is acceptable given the source conventions, but a full reference (likely: P. Erdős, "On some problems on the distribution of prime factors," *Studia Sci. Math. Hungar.* **19** (1984)) would improve traceability. + +## 3. Variants + +The formalization captures five conjectures: +1. f(n) = o(n log log n) for almost all n ✓ +2. F(n) ≫ n log log n for almost all n ✓ +3. max_{n≤x} f(n) ~ x log x / log log x ✓ +4. max_{n≤x} f(n) = max_{n≤x} F(n) for sufficiently large x ✓ +5. H(x) ≪ x log log log log x ✓ + +**Missing variant:** The website also asks for an asymptotic formula for the count of n < x where f(n) = F(n). This is not formalized. This is admittedly vague ("find asymptotic formulas for..."), so it may be deliberately omitted as insufficiently precise. Nonetheless, it is a stated part of the problem. + +**Conjecture (4) ambiguity:** The website phrases this as "for all or sufficiently large x," acknowledging uncertainty. The formalization chose "sufficiently large x" (the weaker claim), which is reasonable and arguably the intended interpretation. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Good:** The definitions `f`, `F`, `ValidAssignment`, and `H` are cleanly separated with informative docstrings. +- **Good:** Each conjecture has its own theorem statement with a clear docstring explaining the mathematical content. +- **Minor:** The `H` definition uses `(Finset.range x).filter (· ≥ 1)`, which is equivalent to `Finset.Icc 1 (x - 1)` for `x ≥ 1`. Since `range x` starts at 0 and 0 is filtered out, this is correct. However, `Finset.Icc 1 (x - 1)` might be slightly more readable and would match the `Finset.Icc 1 x` convention used in the conjecture statements. Alternatively, since f(0) = 0 and 0/0 = 0 in ℝ by convention, the filter is arguably unnecessary — but its presence makes the mathematical intent clearer. +- **Minor:** The naming convention `erdos_878.variants.X` is consistent and navigable. + +## 5. Formalizability + +**Assessment: High formalizability with minor subtleties.** + +The problem statement on the website is precise enough to formalize. The definitions of f(n) and F(n) are unambiguous given a prime factorization. The asymptotic notions (o, ≫, ~, ≪) are standard and have well-known formal translations. + +**Subtleties:** +- The "almost all" quantifier (conjectures 1 and 2) requires choosing a notion of density. The formalization uses natural (asymptotic) density, which is the standard choice in analytic number theory for this type of statement. This is correct. +- The `sSup` in the definition of `F(n)` works correctly for ℕ when the set is nonempty and bounded above (which it is for n ≥ 2, since each a_i ≤ n). For n ∈ {0, 1}, `primeFactors` is empty, making `Fin 0 → ℕ` the domain, so the sum is 0 and F(n) = 0. This is mathematically appropriate (these edge cases are irrelevant to the asymptotic conjectures). +- The missing variant ("count of n < x where f(n) = F(n)") is genuinely too vague to formalize without knowing the expected asymptotic. + +## 6. Correctness + +**Assessment: Correct and mathematically sound.** + +Detailed verification: + +- **f(n):** `∑ p ∈ n.primeFactors, p ^ Nat.log p n` correctly computes Σ p_i^{ℓ_i} where ℓ_i = ⌊log_{p_i}(n)⌋, since `Nat.log p n` returns the largest ℓ with p^ℓ ≤ n. This matches the website's "ℓ_i is chosen such that n ∈ [p_i^{ℓ_i}, p_i^{ℓ_i+1})." ✓ + +- **ValidAssignment / F(n):** The constraints (each a_i ≤ n, pairwise coprime, prime factors of a_i are prime factors of n, exactly ω(n) terms) match the problem statement. The use of `sSup` over a bounded nonempty subset of ℕ correctly computes the maximum. ✓ + +- **H(x):** Sums f(n)/n for 1 ≤ n < x, matching "∑_{n H(n) - n^{1+o(1)}$? +2. For every $k \geq 2$, does the maximizing admissible set contain an element with $\geq k$ prime factors? + +Both are captured by the formalization (`erdos_879` for Part 1, `erdos_879.variants.prime_factors` for Part 2). **All variants are accounted for.** + +## 4. Readability + +The code is generally well-structured, with clear docstrings for each definition and theorem. Minor suggestions: + +- **Naming:** `IsMaxAdmissible` could be `IsMaxPairwiseCoprime` or similar if `IsAdmissible` is removed in favor of `Pairwise Nat.Coprime`. +- **The `H` function** (line 44) has a clear docstring matching the mathematical formula. Good. +- **Casting clarity:** The cast `(↑(S.sum id) : ℝ)` in Part 1 (line 60) is slightly verbose but necessary and clear. + +Overall readability is good. + +## 5. Formalizability + +**Assessment: Precise and clearly formalizable.** + +The problem statement on the website uses $n^{1+o(1)}$, which involves asymptotic notation. The formalization correctly renders this as "for every $\varepsilon > 0$, for sufficiently large $n$, $G(n) > H(n) - n^{1+\varepsilon}$." These are equivalent: +- **Forward:** If $G(n) > H(n) - n^{1+g(n)}$ for some $g(n) \to 0$, then for any fixed $\varepsilon > 0$, eventually $g(n) < \varepsilon$, so $n^{1+g(n)} < n^{1+\varepsilon}$ for large $n$. +- **Converse:** If for every $\varepsilon > 0$ the bound holds eventually, one can construct a function $g(n) \to 0$ witnessing the $o(1)$ by a standard diagonalization argument. + +Part 2 is a straightforward universal quantification with no ambiguity. + +**Ambiguity level: Low.** The only potential ambiguity is the exact definition of $H(n)$ (whether $\sum_{p < n}$ or $\sum_{p \leq n}$), which the website resolves as $p < n$ and the formalization correctly implements. + +## 6. Correctness + +### Part 1 (`erdos_879`) + +- **$H(n)$ definition (line 45–47):** + - `((Finset.range n).filter Nat.Prime).sum id` — sums primes in $\{0, \ldots, n-1\}$, i.e., primes $p < n$. ✓ Matches $\sum_{p (↑(H n) : ℝ) - (↑n : ℝ) ^ ((1 : ℝ) + ε)` correctly expresses $G(n) > H(n) - n^{1+\varepsilon}$. ✓ + +- **`answer(sorry)`:** Correctly used since the problem is open. ✓ + +### Part 2 (`erdos_879.variants.prime_factors`) + +- Quantifies over all $k \geq 2$. ✓ +- Requires for sufficiently large $n$, every maximizing admissible set contains an element with $\geq k$ distinct prime factors (`a.primeFactors.card ≥ k`). ✓ +- The use of `Nat.primeFactors` correctly counts distinct prime factors. ✓ +- The formalization says "every maximizer must contain such an element," which correctly handles the possibility of multiple maximizers. The website says "the admissible set maximising $G(n)$" (singular), but the universal quantification is the correct mathematical interpretation. ✓ + +### Potential Issue + +None identified. The formalization is mathematically correct and complete. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `IsAdmissible` should be replaced with `S.Pairwise Nat.Coprime` | +| Citations | Missing [Er84e] and [Er98]; known partial results not documented | +| Variants | Complete — both questions captured | +| Readability | Good | +| Formalizability | Precise; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/88.md b/ai-review/88.md new file mode 100644 index 0000000000..e5ec693ffb --- /dev/null +++ b/ai-review/88.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 88 + +## 1. Code Reuse + +**`inducedEdgeCount` is duplicated.** An essentially identical definition exists in Problem 801 (`FormalConjectures/ErdosProblems/801.lean:38-41`). The two differ only in style: + +- **88.lean** (computable): Filters `S ×ˢ S` for pairs with `p.1 < p.2 ∧ G.Adj p.1 p.2`. +- **801.lean** (noncomputable): Filters `Finset.univ` for pairs with `p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2 ∧ G.Adj p.1 p.2`. + +These are definitionally equivalent for the same inputs. A shared utility definition (e.g., in `Util/`) would eliminate duplication. + +**Mathlib's `SimpleGraph.induce` and `edgeSet.ncard`** are used in Problem 636 (`636.lean:49-52`) to count induced subgraph edges via `(G.induce (↑S : Set (Fin n))).edgeSet.ncard`. This is a more idiomatic Mathlib approach and could replace the custom `inducedEdgeCount`, though proving equivalence to the pair-counting definition would be needed. The custom definition is arguably more concrete and easier to reason about computationally. + +**`CliqueFree` + complement pattern** is shared with Problem 1031 (`1031.lean:52-53`), which uses the same `G.CliqueFree ⌈c * Real.log n⌉₊ → Gᶜ.CliqueFree ⌈c * Real.log n⌉₊` structure with nearly identical syntax. + +## 2. Citations + +The website (erdosproblems.com/88) lists four references: + +- **[Er92b]** — Erdős original reference (not expanded on the site) +- **[Er95]** — Erdős original reference (not expanded on the site) +- **[Er97d]** — Erdős original reference (not expanded on the site) +- **[KSSS22]** — Kwan, Sah, Sauermann, Sawhney (the solution paper) + +The formalization only cites **[KSSS22]**. The three Erdős references [Er92b], [Er95], [Er97d] documenting the original conjecture are omitted. For completeness, at least one original Erdős reference should be included. Problem 636, which is closely related, includes `[Er93]` and `[Er97d]` with expanded citations — the [Er97d] reference there could be reused: + +> [Er97d] Erdős, P., _Some of my new and almost new problems and results in combinatorics and graph theory_ (1997). + +The website also credits Zachary Hunter and Mehtaab Sawhney, and notes a $100 prize was awarded. These are informational and need not appear in the formalization. + +The existing [KSSS22] citation is accurate: authors, title, and journal match the website. The journal year should arguably say "(2023)" or "Forum of Mathematics, Pi, 11 (2023), e21" for full precision, but the current form is acceptable. + +## 3. Variants + +The website notes an important variant/historical detail: + +> Erdős' original formulation included the additional condition that G has ≫ n² edges, but this follows from the other conditions by an earlier Erdős–Szemerédi result. + +The formalization omits this redundant condition, which is mathematically correct — the stronger statement (without the extra hypothesis) is what was actually proved. No variant is missing. + +The website does not list any other open variants or generalizations of this specific problem. + +## 4. Readability + +The formalization is clean and readable. Minor observations: + +- The docstring on `inducedEdgeCount` says "$u < v$" which correctly documents the ordering used to avoid double-counting. +- The `haveI := h` pattern for introducing the `DecidableRel` instance is standard but could benefit from a brief comment for newcomers. This is a minor style point and not necessary. +- The theorem statement reads naturally when compared to the English-language conjecture. + +**No significant readability issues.** + +## 5. Formalizability + +The problem is **precisely and unambiguously formalizable**. The statement involves only standard combinatorial objects: + +- Graphs on n vertices (finite simple graphs) +- Cliques and independent sets of a given size +- Induced subgraphs with a specified edge count +- Quantification over ε, δ, n, G, and m + +The only minor source of ambiguity in the informal statement is the **base of the logarithm** — "ε log n" could mean natural log or log base 2. This is irrelevant since ε is universally quantified and absorbs the constant factor. The formalization uses `Real.log` (natural log), which is a valid choice. (Note: Problem 636, which has a nearly identical hypothesis structure, uses `Real.logb 2` instead — this is a minor inconsistency across the codebase but is mathematically immaterial.) + +**Assessment: No ambiguity affects correctness.** + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed verification: + +### CliqueFree semantics ✓ +In Mathlib, `G.CliqueFree k` means there is no set of k vertices forming a clique. Since any clique of size ≥ k contains a k-clique, this is equivalent to "clique number < k" (i.e., all cliques have size < k). The problem requires "no clique of size ≥ ε log n". Since clique sizes are natural numbers, "no clique of size ≥ ε log n" is equivalent to "no clique of size ≥ ⌈ε log n⌉", which is `CliqueFree ⌈ε * Real.log n⌉₊`. **Correct.** + +### Independent set encoding ✓ +"No independent set of size ≥ ε log n" is equivalent to "no clique of size ≥ ε log n in the complement graph", formalized as `Gᶜ.CliqueFree ⌈ε * Real.log n⌉₊`. **Correct.** + +### Decidability ✓ +The theorem takes `(h : DecidableRel G.Adj)` and uses `haveI := h` to make it an instance. Since `DecidableEq (Fin n)` is automatic and `DecidableRel G.Adj` is assumed, `DecidableRel Gᶜ.Adj` (needed for the complement hypothesis) is derivable because `Gᶜ.Adj a b ↔ a ≠ b ∧ ¬G.Adj a b`. **Correct.** + +### Edge count bound ✓ +The bound `(m : ℝ) ≤ δ * (n : ℝ) ^ 2` correctly captures "m ≤ δn²". Since m : ℕ, nonnegativity is automatic. **Correct.** + +### Small-n edge cases ✓ +For small n (n = 0 or 1), `Real.log n ≤ 0`, so `⌈ε * Real.log n⌉₊ = 0`. Since `CliqueFree 0` is false (the empty set is vacuously a 0-clique), the hypotheses are unsatisfiable and the conclusion holds vacuously. **Correct.** + +### No missing quantifier for large n +Unlike Problems 636 and 1031, this formalization does **not** include a "for all sufficiently large n" (∃ N₀, ∀ n ≥ N₀) condition. This is acceptable: for small n the hypotheses are vacuously false (as analyzed above), so the universal quantification over all n is equivalent to the "sufficiently large n" version. **Correct, though the alternative style with N₀ would also work.** + +### Overall correctness assessment +**The formalization is correct and faithfully captures the Erdős–McKay conjecture as stated on erdosproblems.com and proved in [KSSS22]. No mathematical flaws identified.** diff --git a/ai-review/880.md b/ai-review/880.md new file mode 100644 index 0000000000..badab901a5 --- /dev/null +++ b/ai-review/880.md @@ -0,0 +1,116 @@ +# Review: Erdős Problem 880 + +## 1. Code Reuse + +Several other Erdős problem files define local variants of additive basis: + +- **Problem 35** (`35.lean`): `IsAdditiveBasis B k` — requires *every* natural number (not just sufficiently large ones) to be a sum of *exactly* k elements. Semantically different. +- **Problem 869** (`869.lean`): `IsAdditiveBasis2 A` — order-2-specific, uses a `sumset` definition. Semantically narrower. +- **Problems 870, 871** define similar local additive basis predicates. + +None of these are directly reusable for Problem 880, because `IsAdditiveBasis880` has a distinct definition (at most k elements with repetition, sufficiently large n). However, the proliferation of local `IsAdditiveBasis` definitions across the codebase suggests an opportunity for a shared definition in `FormalConjecturesForMathlib`. No existing shared utility was found. + +No density-related infrastructure from `FormalConjecturesForMathlib/Data/Set/Density.lean` is needed here (this problem concerns bounded gaps, not density). + +## 2. Citations + +The formalization references: +- **[Er98]** — matches the website, which attributes the problem to Burr and Erdős citing [Er98]. +- **[HHP07]** — Hegyvári, Hennecart, and Plagne. The website confirms their result: "yes for k=2 (in fact with b_{n+1}−b_n ≤ 2 for large n) but no for k≥3." + +The citations are consistent with the website. The formalization could benefit from expanding the shorthand references to full bibliographic entries, as done in some other problem files (e.g., Problem 35 includes full citation for [Pl70]). + +## 3. Variants + +The formalization captures three statements: + +1. **`erdos_880`** — The main question (answer: False): the universal claim fails. +2. **`erdos_880.variants.bounded_gaps_k_eq_2`** — Positive result for k=2: gaps ≤ 2 for sufficiently large elements. +3. **`erdos_880.variants.unbounded_gaps_k_ge_3`** — Counterexample for k≥3: unbounded gaps exist. + +This covers all aspects of the known resolution. The website lists no additional variants or sub-questions. **All variants are captured.** + +## 4. Readability + +The code is well-structured and readable: +- Helper definitions (`IsAdditiveBasis880`, `DistinctSumSet880`) have clear docstrings explaining the mathematical concepts. +- The namespace `Erdos880` keeps definitions scoped. +- The variant naming convention (`erdos_880.variants.*`) is clear. + +**Minor suggestions:** +- The `S.sum id` in `DistinctSumSet880` could benefit from a brief comment noting that `Finset.sum id` computes ∑ x ∈ S, x, for readers less familiar with Lean/Mathlib conventions. +- The module docstring clearly states the problem and its resolution. + +## 5. Formalizability + +The problem statement from erdosproblems.com is precise: + +> Let A ⊂ ℕ be an additive basis of order k. Let B = {b₁ < b₂ < ⋯} be the set of integers which are the sum of k or fewer distinct a ∈ A. Is it true that b_{n+1} − b_n = O(1)? + +**Ambiguity assessment: Low.** The key concepts (additive basis of order k, distinct sums, bounded gaps) are all standard and well-defined. The only interpretive choice is whether the question asks "for all k simultaneously" or "for a given k." The formalization interprets it as the universal question (∀ k), which is the natural reading and aligns with the known resolution (the answer depends on k). + +The phrase "the implied constant may depend on both A and k" from the website is correctly captured by the existential quantifiers `∃ C N₀` appearing after the universal quantifiers `∀ k A`. + +## 6. Correctness + +### 6.1 Definition: `IsAdditiveBasis880` + +```lean +def IsAdditiveBasis880 (A : Set ℕ) (k : ℕ) : Prop := + ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + ∃ (l : List ℕ), l.length ≤ k ∧ (∀ x ∈ l, x ∈ A) ∧ l.sum = n +``` + +**Correct.** Uses `List` (allowing repetition), which matches the standard definition of additive basis. The "sufficiently large" qualifier (`∃ N₀`) is appropriate. + +### 6.2 Definition: `DistinctSumSet880` + +```lean +def DistinctSumSet880 (A : Set ℕ) (k : ℕ) : Set ℕ := + {n : ℕ | ∃ (S : Finset ℕ), (∀ x ∈ S, x ∈ A) ∧ S.card ≤ k ∧ S.sum id = n} +``` + +**Correct.** Uses `Finset` which enforces distinctness, matching "sum of k or fewer *distinct* a ∈ A." The `S.sum id` correctly computes ∑ x ∈ S, x. + +Note: This set includes 0 (via the empty finset) and all individual elements of A (via singleton finsets). This is mathematically correct per the problem's "k or fewer" phrasing. + +### 6.3 Main theorem: `erdos_880` + +```lean +theorem erdos_880 : answer(False) ↔ + ∀ (k : ℕ) (A : Set ℕ), IsAdditiveBasis880 A k → + ∃ C N₀ : ℕ, ∀ b ∈ DistinctSumSet880 A k, b ≥ N₀ → + ∃ b' ∈ DistinctSumSet880 A k, b < b' ∧ b' ≤ b + C +``` + +**Correct.** Since `answer(False)` is definitionally `False`, the biconditional `False ↔ P` is provable iff `¬P`. The RHS universally quantifies over all k and all bases A, claiming gaps are always bounded. Since this fails for k ≥ 3 (per HHP07), `¬P` holds, making the biconditional true. This correctly encodes "the answer is no." + +The bounded-gap encoding ("for every b in B above N₀, there exists b' in B with b < b' ≤ b + C") is a correct formulation of b_{n+1} − b_n = O(1) for infinite sets. + +**Potential concern with website classification:** The website labels this as "PROVED — solved in the affirmative," which could superficially appear to conflict with `answer(False)`. However, "solved in the affirmative" on erdosproblems.com appears to mean the problem has been definitively resolved (proved/settled), not that the answer to the yes/no question is "yes." The formalization's `answer(False)` correctly reflects that the answer to "Is it true that b_{n+1} − b_n = O(1)?" is **no** in general. + +### 6.4 Variant: `bounded_gaps_k_eq_2` + +**Correct.** States that for any additive basis of order 2, the distinct sum set has gaps ≤ 2 for sufficiently large elements. Matches the HHP07 result exactly. + +### 6.5 Variant: `unbounded_gaps_k_ge_3` + +```lean +∀ k : ℕ, k ≥ 3 → +∃ A : Set ℕ, IsAdditiveBasis880 A k ∧ +∀ C : ℕ, ∃ b ∈ DistinctSumSet880 A k, + ∀ b' ∈ DistinctSumSet880 A k, b < b' → b + C < b' +``` + +**Correct.** For each k ≥ 3, exhibits a basis A such that for every proposed bound C, there exists a point b in B where the next element of B after b is more than C away. This precisely captures "unbounded gaps." + +### Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | No shared additive basis definition exists; opportunity for refactoring across ~10 files | +| Citations | Consistent with erdosproblems.com; could expand to full bibliographic form | +| Variants | Complete — main question, k=2 positive case, and k≥3 negative case all captured | +| Readability | Good; clear structure, docstrings, and naming | +| Formalizability | High — unambiguous problem statement with standard definitions | +| Correctness | **Correct and complete** — all definitions and theorem statements faithfully encode the mathematics | diff --git a/ai-review/882.md b/ai-review/882.md new file mode 100644 index 0000000000..5b97af4e16 --- /dev/null +++ b/ai-review/882.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 882 + +## 1. Code Reuse + +The `IsPrimitive` definition (no element divides a distinct element) is independently redefined in at least three files: +- `ErdosProblems/882.lean:51` — `Erdos882.IsPrimitive` +- `ErdosProblems/872.lean:48` — `Erdos872.IsPrimitive` +- `ErdosProblems/164.lean:40` — (Set-based variant) + +All three are essentially the same predicate. A shared `Finset.IsPrimitive` definition could be factored into a common utility and reused. + +Additionally, `FormalConjecturesForMathlib/NumberTheory/Primitive.lean` defines `Set.IsPrimitive S n`, which captures element-wise primitivity (n ∈ S with no proper divisor in S). A set being a divisibility antichain (the Erdos 882 notion) is equivalent to every element being `Set.IsPrimitive` in that set. While the types differ (Finset vs Set, set-level vs element-level), a bridge lemma linking the two could improve conceptual unity. + +The `subsetSums` definition is also defined independently in several files (53, 343, 344, 345, 882) with slight type variations. A shared utility in `FormalConjecturesForMathlib/NumberTheory/AdditivelyComplete.lean` already defines a general `subsetSums` for additive monoids — the 882 version could potentially be derived from it. + +## 2. Citations + +The docstring references match the website well: + +- **[Er98]**: Listed as Erdős, P., *Some of my favourite problems which recently have been solved*, Challenges for the 21st century (Singapore, 2000), 2001. ✅ Matches website. +- **[ELRSS99]**: Listed as Erdős, Lev, Rauzy, Sándor, Sárközy, *Greedy algorithm, arithmetic progressions, subset sums and divisibility*, 1999. ✅ Matches website. + +**Missing from docstring**: The website notes that this problem is related to Problem 13 (distinct subset sums). This cross-reference is not mentioned in the formalization's docstring. + +**Missing result**: The website mentions Sándor's specific construction showing |A| = (1 − o(1)) log₂ n using A = {2^i + m·2^m : 0 ≤ i < m} with n = 2^{m−1} + m·2^m. This is not cited in the docstring. + +## 3. Variants + +The formalization captures two variants: +1. **Conjectured upper bound** (`erdos_882`): |A| ≤ log₂ n + O(1) +2. **Lower bound** (`erdos_882.variants.lower_bound`): |A| > log₂ n − 1 + +**Missing variants**: +- The **greedy algorithm lower bound** |A| ≥ (1 − o(1)) log₃ n is mentioned in the docstring but not formalized. This is the historically first and weakest bound, so omitting it is reasonable. +- The **known upper bound** |A| ≤ log₂ n + ½ log₂ log n + O(1) (from the distinct subset sums connection) is mentioned in the docstring but not formalized. This is a proven result and would be a natural variant to include. +- **Sándor's construction** achieving |A| = (1 − o(1)) log₂ n is not formalized. + +## 4. Readability + +The code is clear and well-structured. The definitions of `subsetSums`, `IsPrimitive`, and `maxPrimitiveSubsetSumSize` are straightforward and well-documented with docstrings. The use of `sSup` for the maximum is clean. + +Minor suggestion: The `IsPrimitive` docstring says "no element divides another distinct element" — the quantifier structure `∀ a ∈ B, ∀ b ∈ B, a ∣ b → a = b` makes this clear, but an alternative phrasing like "is an antichain under divisibility" could add context, as used in 872.lean's docstring. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement is precise: given A ⊆ {1, …, n}, form all non-empty subset sums, require those sums to be a divisibility antichain, and maximize |A|. Every component is unambiguous. + +The only minor source of ambiguity is in what "the size of the largest A" means when the supremum might not be attained — the use of `sSup` handles this correctly since the feasible set of cardinalities is a bounded subset of ℕ (bounded by n) and hence has a maximum. + +## 6. Correctness + +### Definitions +- **`subsetSums`**: Correctly computes {∑_{a ∈ S} a : ∅ ≠ S ⊆ A} via filtering the powerset and mapping through `Finset.sum id`. ✅ +- **`IsPrimitive`**: Correctly captures the divisibility antichain property. The predicate ∀ a ∈ B, ∀ b ∈ B, a ∣ b → a = b is the standard definition. ✅ +- **`maxPrimitiveSubsetSumSize`**: Uses `sSup` on {k | ∃ A ⊆ Icc 1 n, |A| = k ∧ IsPrimitive(subsetSums A)}. Since this set is bounded above by n and contains 0 (via A = ∅), the supremum is well-defined and equals the maximum. ✅ + +### Theorem statements +- **`erdos_882`**: Correctly formalizes ∃ C, ∀ᶠ n, maxSize(n) ≤ log₂ n + C. The use of `Real.log n / Real.log 2` for log₂ n is correct. ✅ +- **`erdos_882.variants.lower_bound`**: Correctly formalizes ∃ N₀, ∀ n ≥ N₀, maxSize(n) > log₂ n − 1. ✅ + +### Category tags +- **`erdos_882`** is tagged `category research open`. The website lists the problem as **solved**. However, this tag refers specifically to the *conjecture* that |A| ≤ log₂ n + O(1), which appears to still be open — the known upper bound is log₂ n + ½ log₂ log n + O(1), which is slightly weaker. The website likely considers the problem solved because the asymptotic answer ~log₂ n is established. **This discrepancy should be clarified**: if the website's "solved" status refers to the original question of asymptotic growth (answered by Sándor and ELRSS), then the main theorem `erdos_882` is not the original problem but a refinement/conjecture. A comment explaining this distinction would be helpful. +- **`erdos_882.variants.lower_bound`** is tagged `category research solved`. ✅ Correct — this was proved by ELRSS. + +### Potential issue with problem framing +The original problem on the website asks "what is the maximum size?" — a quantitative question. The formalization instead captures a *conjectural* upper bound as the main theorem. This is a reasonable modeling choice (the answer "~log₂ n" is known, so the remaining open question is the precise bound), but it means `erdos_882` is really a conjecture *about* Problem 882, not Problem 882 itself. The docstring makes this clear ("conjectured upper bound"), so this is acceptable. + +**Overall assessment**: The formalization is mathematically correct and well-written. The main areas for improvement are (1) consolidating the duplicated `IsPrimitive` definition across files, (2) adding the known upper bound log₂ n + ½ log₂ log n + O(1) as a solved variant, and (3) clarifying the solved/open status discrepancy with the website. diff --git a/ai-review/883.md b/ai-review/883.md new file mode 100644 index 0000000000..87bf8cdeca --- /dev/null +++ b/ai-review/883.md @@ -0,0 +1,93 @@ +# AI Review: Erdős Problem 883 + +## 1. Code Reuse + +**Cycle containment:** The custom `SimpleGraph.ContainsCycle` definition (line 55) uses a `ZMod k → α` injective mapping approach. Several other problems in the codebase (e.g., 751, 65, 57) use Mathlib's built-in `SimpleGraph.Walk` with `p.IsCycle` instead, as in: + +```lean +{n | ∃ (v : V) (p : G.Walk v v), p.IsCycle ∧ p.length = n} +``` + +The `Walk.IsCycle` approach is the more standard Mathlib idiom. The `ZMod`-based definition is mathematically equivalent but non-standard. If a shared `cycleLengths` set were extracted (as in `Erdos751.cycleLengths` at `FormalConjectures/ErdosProblems/751.lean:40`), the main theorem could be restated as membership in `cycleLengths`. However, the ZMod approach has the advantage of being structurally clean for stating cycle containment directly, so this is a minor stylistic point rather than a deficiency. + +**Tripartite subgraph:** The custom `SimpleGraph.ContainsTripartite` (line 89) is a bespoke definition. Problem 550 (`FormalConjectures/ErdosProblems/550.lean:60`) defines `completeMultipartiteGraph` generically. In principle, the tripartite containment could be expressed as `ContainsSubgraphCopy (completeMultipartiteGraph ![1, ℓ, ℓ]) G`, reusing both `completeMultipartiteGraph` and `ContainsSubgraphCopy` from problem 550. The current explicit formulation is arguably more readable for this specific shape, but consolidation would reduce definition sprawl. + +**Coprimality graph:** The `coprimeGraph` definition (line 42) is self-contained and problem-specific. No shared coprime graph definition exists elsewhere. `Nat.Coprime` from Mathlib is correctly used. `Finset.Coprime` from `FormalConjecturesForMathlib/Data/Nat/Prime/Finset.lean` is not directly applicable here (it deals with finset-level gcd, not pairwise coprimality as a graph). + +**Threshold function:** No reuse opportunity; the threshold `n/2 + n/3 - n/6` is problem-specific. + +## 2. Citations + +The website lists the following references: + +- **[ErSa97]**: Erdős, P. and Sárközy, A. (1997) — on cycles in the coprime graph of integers +- **[Er98]**: Erdős (1998) — referenced on the website but **not cited** in the formalization +- **[Sa99]**: Sárközy (1999) — resolved the tripartite variant; referenced on the website but **not cited** in the formalization + +The formalization's docstring cites only `[ErSa97]` and describes it as "Erdős, P. and Sárközy, A., on cycles in the coprime graph of integers." The website spells the name "Sárkőzy" (with double acute on the ő), while the formalization uses "Sárközy" (with umlaut ö). This is a minor inconsistency. + +**Recommendation:** Add `[Er98]` and `[Sa99]` citations, particularly `[Sa99]` since it is the reference that resolved the tripartite variant (which is stated as `category research solved`). The tripartite variant's docstring says "Proved by Sárközy [ErSa97]" but the website attributes the proof to Sárközy (1999), i.e., `[Sa99]`, not `[ErSa97]`. This is a **citation error**: the tripartite result was proved in Sárközy's 1999 paper, not in the joint 1997 paper. + +## 3. Variants + +The website poses two questions: + +1. **Odd cycle containment** (the main conjecture) — captured by `erdos_883` (line 76). +2. **Complete (1,ℓ,ℓ) tripartite subgraph** — captured by `erdos_883.variants.tripartite` (line 104). + +Both variants from the website are present in the formalization. No variants are missing. + +The website also mentions that Sárközy proved the tripartite result with an explicit bound $\ell \gg \frac{\log n}{\log \log n}$. The formalization only captures the existential version (for every fixed $\ell$, sufficiently large $n$ works), which is the weaker qualitative statement. Capturing the quantitative bound would be a possible enhancement but is not strictly necessary. + +## 4. Readability + +The code is well-structured and readable overall. Specific observations: + +- The definitions are clearly documented with LaTeX-rendered docstrings. +- The namespace `Erdos883` is used appropriately to scope definitions. +- The `ContainsCycle` definition is placed under `SimpleGraph` namespace but prefixed with `Erdos883.SimpleGraph.ContainsCycle` in the theorem statement (line 81). This is slightly awkward — the qualified name arises because the definition is inside the `Erdos883` namespace. This is fine but could be cleaner if the definition were placed outside the namespace or used `open SimpleGraph` more carefully. +- The threshold function has a clear docstring explaining the inclusion-exclusion interpretation. +- The tripartite definition spells out all conditions explicitly, which aids readability. + +## 5. Formalizability + +**Main conjecture (odd cycles):** The statement is precise and unambiguous. The set $A \subseteq \{1, \ldots, n\}$, the coprimality graph, the threshold, and the cycle length bound are all well-defined. The formalization captures this faithfully. **Assessment: Fully formalizable, no ambiguity.** + +**Tripartite variant:** Also precise. The quantifier structure "for every $\ell \geq 1$, there exists $N_0$ such that for all $n \geq N_0$..." is standard and correctly formalized. **Assessment: Fully formalizable, no ambiguity.** + +One subtlety: the website says the cycle lengths should be "at most $n/3 + 1$". In the formalization this is `k ≤ n / 3 + 1` where `/` is natural number division (floor). The website uses $\frac{n}{3}$, which in context means $\lfloor n/3 \rfloor$ (since we are comparing with natural numbers). This is correctly handled. + +## 6. Correctness + +### Main theorem (`erdos_883`) + +- **Set membership:** `∀ a ∈ A, 1 ≤ a ∧ a ≤ n` correctly encodes $A \subseteq \{1, \ldots, n\}$. ✓ +- **Threshold:** `A.card > erdos883Threshold n` correctly encodes the strict inequality $|A| > \lfloor n/2 \rfloor + \lfloor n/3 \rfloor - \lfloor n/6 \rfloor$. ✓ +- **Odd cycle conditions:** `k ≥ 3 → k % 2 = 1 → k ≤ n / 3 + 1` correctly restricts to odd cycles of length at least 3 and at most $\lfloor n/3 \rfloor + 1$. ✓ +- **Cycle containment:** The `ContainsCycle` definition requires an injective function `f : ZMod k → α` with `G.Adj (f i) (f (i + 1))` for all `i`. This correctly encodes a cycle of length `k`. For `k ≥ 3`, `ZMod k` has exactly `k` elements, and injectivity ensures `k` distinct vertices. The adjacency condition wraps around because `ZMod k` arithmetic is modular. ✓ +- **Edge case:** For `k < 3`, `ZMod k` may be degenerate (`ZMod 0 = ℤ`, `ZMod 1` is trivial), but the theorem guards with `k ≥ 3`, so this is not an issue. ✓ +- **Coprime graph correctness:** The `coprimeGraph` definition includes membership in `A` as part of the adjacency relation, which means the graph's adjacency is only defined between elements of `A`. This is correct — it models the graph $G(A)$ on vertex set $A$. ✓ +- **Category annotation:** `category research open` matches the website status. ✓ +- **`answer(sorry)`:** The answer is left as `sorry` since this is an open problem. This is appropriate — the truth value is unknown. ✓ + +### Tripartite variant (`erdos_883.variants.tripartite`) + +- **Quantifier structure:** `∀ ℓ ≥ 1, ∃ N₀, ∀ n ≥ N₀, ...` correctly captures "for every fixed $\ell$, for sufficiently large $n$". ✓ +- **Tripartite definition:** Requires vertex $v$, disjoint sets $S_1, S_2$ of size $\ell$, with $v$ adjacent to all of $S_1 \cup S_2$, and all cross-edges between $S_1$ and $S_2$. This correctly encodes $K_{1,\ell,\ell}$. ✓ +- **Category annotation:** `category research solved` matches the website (proved by Sárközy). ✓ +- **`answer(True)`:** Correct, since Sárközy proved this affirmatively. ✓ + +### Potential issue: vertex type + +The coprime graph is defined on `ℕ` (the vertex type is `ℕ`), and `ContainsCycle` works on type `α` which would be `ℕ` here. The cycle function `f : ZMod k → ℕ` maps into all of `ℕ`, but the adjacency relation in `coprimeGraph A` already enforces membership in `A` via `x ∈ A ∧ y ∈ A` in the `Adj` definition. So the cycle vertices are implicitly constrained to lie in `A`. This is correct but somewhat indirect. No mathematical error results. + +### Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunities (Walk.IsCycle, completeMultipartiteGraph from 550) | +| Citations | **Missing [Er98], [Sa99]; tripartite variant incorrectly cites [ErSa97] instead of [Sa99]** | +| Variants | Complete — both website questions are captured | +| Readability | Good; minor namespace qualification awkwardness | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | **Mathematically correct and complete** | diff --git a/ai-review/884.md b/ai-review/884.md new file mode 100644 index 0000000000..6771b31577 --- /dev/null +++ b/ai-review/884.md @@ -0,0 +1,68 @@ +# Review: Erdős Problem 884 + +## 1. Code Reuse + +The formalization uses `(n.divisors ×ˢ n.divisors).filter (fun p => ...)` to sum over divisor pairs. This is the standard pattern in the codebase (also used in problems 449 and 824). Problem 1099 defines a reusable `sortedDivisors` helper and uses `List.zip`/`List.tail` for consecutive-pair iteration, which is an alternative approach. However, the Finset-based filtering used here is arguably more natural for Lean proofs since it avoids reasoning about list indices and sort order. No substantial reuse opportunity is missed. + +The "consecutive divisors" filter (`p.1 < p.2 ∧ ∀ e ∈ n.divisors, ¬(p.1 < e ∧ e < p.2)`) could potentially be extracted into a named definition (as done with `HasCloseConsecutiveDivisors` in problem 144 or `closeDivisorPairs` in problem 449), but given that it appears only once, inlining is acceptable. + +## 2. Citations + +The formalization cites: + +> [Er98] Erdős, P., _Some of my new and almost new problems and results in combinatorial number theory_ (1998). + +The website [erdosproblems.com/884](https://www.erdosproblems.com/884) lists the reference tag **[Er98]** which matches. The website does not provide the full bibliographic entry, so the title cannot be cross-checked against the site itself, but the tag is consistent. **No issues found.** + +## 3. Variants + +The website states a single problem with no additional variants or sub-parts. The formalization captures the complete statement. The "See also problem #144" cross-reference is included in the docstring. **No missing variants.** + +## 4. Readability + +The code is reasonably readable. The docstring clearly states the mathematical problem with LaTeX and provides an informal English explanation. Two minor readability suggestions: + +- The consecutive-divisor filter on lines 49–50 is dense. Extracting it into a named predicate (e.g., `IsConsecutiveDivisorPair`) would improve readability, though this is stylistic. +- The variable name `p` is used for both the LHS and RHS sums with different filter predicates, which could cause momentary confusion when reading. This is standard practice in the codebase, however. + +Overall: **Acceptable readability.** + +## 5. Formalizability + +The problem is precisely stated and unambiguously formalizable: + +- "divisors of $n$" is standard (`Nat.divisors`). +- The sums $\sum_{1 \leq i < j \leq t} \frac{1}{d_j - d_i}$ and $\sum_{1 \leq i < t} \frac{1}{d_{i+1} - d_i}$ are finite sums over well-defined index sets. +- The Vinogradov notation $\ll$ with an "absolute" implied constant has the standard meaning: $\exists C > 0, \forall n \geq 1, \text{LHS} \leq C \cdot \text{RHS}$. +- The problem asks a yes/no question ("Is it true that..."), and the `answer(sorry)` wrapper correctly reflects that the answer is unknown. + +**Ambiguity: None.** The statement is fully precise. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed verification: + +- **LHS** (line 47–48): Sums `1 / ((p.2 : ℝ) - (p.1 : ℝ))` over all `(p.1, p.2) ∈ n.divisors × n.divisors` with `p.1 < p.2`. This correctly computes $\sum_{1 \leq i < j \leq t} \frac{1}{d_j - d_i}$. The strict ordering `p.1 < p.2` ensures each unordered pair is counted once. The cast to `ℝ` ensures the subtraction is well-defined (positive, since `p.1 < p.2`). + +- **RHS** (lines 49–51): Sums the same quantity but restricted to pairs where `p.1 < p.2` and no divisor of `n` lies strictly between `p.1` and `p.2`. This is precisely the set of consecutive divisor pairs in the sorted divisor sequence, correctly capturing $\sum_{1 \leq i < t} \frac{1}{d_{i+1} - d_i}$. + +- **Constant**: The existential `∃ C : ℝ, C > 0` with the bound `≤ C * (1 + ...)` correctly formalizes the Vinogradov $\ll$ notation applied to $1 + \sum \frac{1}{d_{i+1} - d_i}$. + +- **Domain**: `n ≥ 1` correctly restricts to positive integers. For `n = 1`, the only divisor is 1, both sums are empty (equal to 0), and `0 ≤ C * 1` holds trivially. + +- **Edge case**: The `answer(sorry)` wrapper correctly reflects that this is an open problem whose truth value is unknown. + +- **Problem status**: The formalization marks this as `category research open`, consistent with the website. Terence Tao has assessed it as "tractable" but it remains unresolved. + +**No mathematical errors or omissions found.** + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No missed opportunities | +| Citations | Consistent with website | +| Variants | Complete | +| Readability | Good; minor stylistic improvements possible | +| Formalizability | Unambiguous, fully precise | +| Correctness | Correct and complete | diff --git a/ai-review/892.md b/ai-review/892.md new file mode 100644 index 0000000000..31b07a0da1 --- /dev/null +++ b/ai-review/892.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 892 + +## 1. Code Reuse + +**`IsPrimitiveSeq` could be connected to existing `Set.IsPrimitive` infrastructure.** + +The file defines a local `IsPrimitiveSeq` in the `Erdos892` namespace: +```lean +def IsPrimitiveSeq (a : ℕ → ℕ) : Prop := + ∀ i j, i ≠ j → ¬(a i ∣ a j) +``` + +`FormalConjecturesForMathlib/NumberTheory/Primitive.lean` provides a set-based definition: +```lean +def Set.IsPrimitive (S : Set ℕ) (n : ℕ) : Prop := + n ∈ S ∧ Disjoint (n.properDivisors : Set ℕ) S +``` + +When `a` is injective (implied by `StrictMono`), `IsPrimitiveSeq a` is equivalent to `∀ n, Set.IsPrimitive (Set.range a) (a n)`. A bridge lemma establishing this equivalence would allow reuse of the existing theorems (`prime_isPrimitive_iff`, `primitives_subset`, etc.). That said, the sequence-level definition is more natural for this problem's statement, so keeping it as a local definition is defensible. Consider at minimum adding a docstring cross-reference to `Set.IsPrimitive`. + +**Asymptotic notation.** The formalization uses an explicit existential bound `∃ C, 0 < C ∧ ∀ n, a n ≤ C * b n` rather than Mathlib's `Asymptotics.IsBigO` or the `≪` notation defined in `FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean`. The explicit form is arguably clearer for natural-number sequences and avoids coercion overhead, so this is a reasonable choice. However, it deviates from the convention used in other problems (e.g., 409, 40, 319, 12) that use `=O[atTop]`. + +## 2. Citations + +The formalization references: +- `[ESS68]` — Erdős, Sárközy, and Szemerédi +- `[Er98]` — Erdős + +The [erdosproblems.com/892](https://www.erdosproblems.com/892) page lists **four** references: +- **[Er98]** — Erdős, P. (problem source) +- **[ESS68]** — Erdős, Sárközy, Szemerédi (problem formulation) +- **[ESS67]** — Erdős, Sárközy, Szemerédi (established the necessary condition $\sum_{b_n < x} \frac{1}{b_n} = o\!\left(\frac{\log x}{\sqrt{\log\log x}}\right)$) +- **[Er35]** — Erdős (established the necessary condition $\sum \frac{1}{b_n \log b_n} < \infty$) + +**Missing citations:** `[ESS67]` and `[Er35]` are not mentioned. These are significant because they establish the only known necessary conditions and provide important mathematical context. The docstring should also include full paper titles and publication details rather than just author names — for example, `[ESS68]` should include the paper title and journal/year if available on the website. + +Additionally, the website notes that **Problem 143** is a related problem (analogous question for real-number sequences). The formalization does not cross-reference this. Problem 143 is present in the codebase (`FormalConjectures/ErdosProblems/143.lean`) and involves strikingly similar themes (the condition $\sum \frac{1}{x \log x} < \infty$ appears in both). + +## 3. Variants + +The formalization captures two variants: + +1. **Particular case** (`erdos_892`): The GCD sufficient condition — if $\gcd(b_i, b_j) \neq b_k$ for pairwise distinct $i,j,k$, then a primitive sequence $a$ with $a_n \ll b_n$ exists. +2. **General form** (`erdos_892.variants.general`): Characterize all such sequences $b$. + +**Missing from the formalization:** + +- **Known necessary conditions.** The website states two known necessary conditions: + - $\sum \frac{1}{b_n \log b_n} < \infty$ (Erdős, 1935) + - $\sum_{b_n < x} \frac{1}{b_n} = o\!\left(\frac{\log x}{\sqrt{\log\log x}}\right)$ (Erdős–Sárközy–Szemerédi) + + These are established results, not conjectures, and could be formalized as separate theorems (not `sorry`-ed) or at minimum documented in the module docstring. They provide the only known constraints on the answer to the general form and are mathematically important context. Problem 143, part (ii) already formalizes the sum condition $\sum \frac{1}{x \log x} < \infty$ in the real-number analogue, reinforcing that these conditions are within scope. + +- **Relationship to Problem 143.** The website explicitly links Problem 892 to Problem 143. A comment or cross-reference would be valuable. + +## 4. Readability + +The code is generally clear and well-structured. Minor suggestions: + +- **Module docstring**: The docstring is terse. It should mention the known necessary conditions and the relationship to Problem 143, as these provide essential context for anyone approaching the formalization. +- **GCD condition docstring**: The comment "no non-trivial GCD solutions" is helpful but could be more precise — e.g., "no $b_k$ equals $\gcd(b_i, b_j)$ for pairwise distinct indices." +- **Namespace**: `Erdos892` is fine but `IsPrimitiveSeq` is a very general name scoped inside it. If the definition is meant to be reusable, it should either be moved to a shared location or given a more specific name. + +## 5. Formalizability + +**Particular case:** Fully formalizable. The statement is precise — all quantifiers, types, and conditions are well-defined. + +**General form:** Inherently problematic. The problem asks to "characterize" a set, formalized as: +```lean +{b : ℕ → ℕ | ...} = answer(sorry) +``` +This requires the answer to be a *specific set* described by a computable/definable predicate. The mathematical problem is asking for a necessary and sufficient condition, which may not have a unique "canonical" answer. The `answer(sorry)` pattern is the standard approach in this codebase for open problems, but the formalization assumes such a clean characterization exists, which is itself part of the conjecture. **Ambiguity: moderate.** The general form is more of a research direction than a precise conjecture. + +## 6. Correctness + +**`IsPrimitiveSeq` definition — Correct.** The standard definition of a primitive sequence (or primitive set / antichain in the divisibility order) is that no element divides any other. The formalization `∀ i j, i ≠ j → ¬(a i ∣ a j)` correctly captures this. Note that this is symmetric (checking both directions), which is slightly redundant given `StrictMono` (if $a_i < a_j$, we only need to check $a_i \nmid a_j$), but mathematically correct and arguably clearer. + +**GCD condition — Correct but worth scrutinizing.** The condition `∀ i j k, i ≠ j → i ≠ k → j ≠ k → Nat.gcd (b i) (b j) ≠ b k` formalizes "no non-trivial solutions to $(b_i, b_j) = b_k$." The pairwise distinctness of indices is the right interpretation of "non-trivial" here: +- If $k = i$, then $\gcd(b_i, b_j) = b_i$ means $b_i \mid b_j$, which is a "trivial" solution. +- If $k = j$, similarly trivial. +- The pairwise distinctness correctly excludes these. + +**Positivity constraint — Correct.** Requiring `0 < b n` ensures we're working with positive integers, which is necessary since $\gcd$ and divisibility have degenerate behavior at 0 in $\mathbb{N}$. + +**Bound formulation — Correct.** The bound `∃ C, 0 < C ∧ ∀ n, a n ≤ C * b n` correctly captures $a_n \ll b_n$ (Big-O with an explicit constant). The positivity of $C$ rules out the trivial $C = 0$ case. + +**Potential issue — domain of sequences.** Both $a$ and $b$ are typed as $\mathbb{N} \to \mathbb{N}$, meaning they are indexed starting from 0. The original problem uses $b_1 < b_2 < \cdots$, indexed from 1. This is a standard convention difference and does not affect correctness, but it means $a_0$ and $b_0$ must also satisfy the constraints (positivity, strict monotonicity, primitivity). Since `StrictMono` on $\mathbb{N} \to \mathbb{N}$ with `0 < b 0` forces all values to be positive, this is fine. + +**Overall assessment:** The formalization is mathematically correct for both the particular case and the general form. No flaws identified. The main gap is not incorrectness but **incompleteness** — the known necessary conditions and cross-references are absent, which limits the formalization's value as a standalone mathematical document. diff --git a/ai-review/894.md b/ai-review/894.md new file mode 100644 index 0000000000..3038c1d4f9 --- /dev/null +++ b/ai-review/894.md @@ -0,0 +1,93 @@ +# Review: Erdős Problem 894 + +## 1. Code Reuse + +**Issue found.** The `IsLacunary` definition in `894.lean:34-35` is an exact duplicate of the one in `ErdosProblems/464.lean:39-40`: + +```lean +def IsLacunary (a : ℕ → ℕ) : Prop := + StrictMono a ∧ ∃ ε : ℝ, ε > 0 ∧ ∀ k : ℕ, (a (k + 1) : ℝ) ≥ (1 + ε) * (a k : ℝ) +``` + +Additionally, `FormalConjecturesForMathlib/NumberTheory/Lacunary.lean` provides a shared definition: + +```lean +def IsLacunary (n : ℕ → ℕ) : Prop := ∃ c > (1 : ℝ), ∀ᶠ k in atTop, c * n k < n (k + 1) +``` + +The shared definition differs in two ways: (a) it uses an eventual condition (`∀ᶠ k in atTop`) rather than a uniform one (`∀ k`), and (b) it does not require `StrictMono`. These are not equivalent—the uniform version in 894 is strictly stronger. However, for the purpose of this problem, the uniform version is the standard one in the literature (matching the website's statement), so the local definition is arguably more appropriate. + +**Recommendation:** At minimum, the duplicate between 464 and 894 should be consolidated. Either 894 should import from 464's namespace, or (better) a shared uniform `IsLacunary` definition should be placed in a utility file and imported by both 464 and 894. At least five other Erdős problems (37, 346, 355, 995, 996) also define their own variants of lacunary sequences. + +## 2. Citations + +The docstring mentions Katznelson and Peres–Schlag but does not use the citation keys from [erdosproblems.com/894](https://www.erdosproblems.com/894). + +The website lists: +- **[Ka01]** — Katznelson (2001), who observed the result follows from Problem 464. +- **[PeSc10]** — Peres and Schlag (2010), who provided the quantitative bound of ≪ ε⁻¹ log(1/ε) colours. + +**Recommendation:** Update the docstring to include the bracketed citation keys `[Ka01]` and `[PeSc10]` to match the website's convention, e.g.: + +> Katznelson [Ka01] observed it follows from the solution to Problem 464. The best quantitative bound, due to Peres and Schlag [PeSc10], gives at most ≪ ε⁻¹ log(1/ε) colours. + +## 3. Variants + +The website presents one formulation with an equivalent restatement in terms of Cayley graphs. The docstring captures both: +- The coloring formulation (primary, formalized in the theorem). +- The Cayley graph interpretation (mentioned in prose). + +No additional variants appear on the website. **All variants are captured.** + +## 4. Readability + +The code is clean and well-structured. Minor suggestions: + +- The variable names `x y` in the coloring condition are clear. The use of `a i = x - y` to express membership in the range of `a` is idiomatic. +- The docstring is informative and provides good mathematical context including the connection to Problem 464. +- Consider adding a brief note that `k` represents the number of colors to aid readers unfamiliar with the `Fin k` idiom. + +Overall readability is **good**. + +## 5. Formalizability + +The problem is **precisely formalizable**. The statement on the website is unambiguous: it asks whether a finite coloring exists avoiding monochromatic differences from a given lacunary set. All constituent notions (lacunary sequence, finite coloring, monochromatic pair, difference) have standard mathematical definitions that translate directly into Lean. + +**Ambiguity assessment: Very low.** The only potential source of ambiguity is whether "lacunary" requires the ratio condition uniformly for all k or eventually, but the website's statement uses "for all k", matching the formalization. + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +**Theorem structure:** `answer(True) ↔ [statement]` is appropriate since the problem is proved with affirmative answer. + +**IsLacunary definition:** Matches the standard definition on the website exactly: strictly increasing with a uniform ratio bound (1 + ε) for all k. + +**Coloring condition:** The statement + +```lean +∃ (k : ℕ) (c : ℕ → Fin k), + ∀ x y : ℕ, x > y → (∃ i, a i = x - y) → c x ≠ c y +``` + +correctly expresses "there exists a finite coloring of ℕ with no monochromatic pair whose difference lies in the range of a": + +- `∃ k` and `c : ℕ → Fin k` — a coloring with finitely many colors. Note `k = 0` is naturally excluded since `Fin 0` is empty and no function `ℕ → Fin 0` exists. +- `x > y` — ensures x − y is a positive natural number (avoids issues with ℕ subtraction). +- `∃ i, a i = x - y` — the difference lies in the range of the lacunary sequence. +- `c x ≠ c y` — the pair is not monochromatic. + +**Potential subtlety (non-issue):** The definition permits `a 0 = 0`, but since `x > y` forces `x - y ≥ 1`, the value `a 0 = 0` can never be matched, so this is harmless. + +**Assessment: Correct and complete.** No mathematical flaws identified. An experienced mathematician would find this formalization faithful to the original problem. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Duplicate `IsLacunary` with Problem 464; should consolidate | +| Citations | Missing `[Ka01]` and `[PeSc10]` citation keys | +| Variants | All captured | +| Readability | Good | +| Formalizability | Unambiguous; very low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/895.md b/ai-review/895.md new file mode 100644 index 0000000000..a8fd2eba16 --- /dev/null +++ b/ai-review/895.md @@ -0,0 +1,57 @@ +# AI Review: Erdős Problem 895 + +## 1. Code Reuse + +The formalization uses `SimpleGraph`, `SimpleGraph.CliqueFree 3`, and `Fin n`, all from Mathlib. The codebase provides additional graph-theoretic utilities: + +- `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` defines `indepNum` (α(G)) and related lemmas, but these concern the *size* of a maximum independent set, not the existence of a specific structured independent triple. +- `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean` defines `sumRep` for counting representations a+b, but this is overkill for the simple additive constraint here. +- `FormalConjecturesForMathlib/Combinatorics/Basic.lean` defines `IsSumFree` for sum-free sets, which is thematically related but not directly applicable. + +The manual approach of checking `¬G.Adj` for each pair is the most direct and readable encoding for a 3-element independent set with a specific additive structure. No significant code reuse opportunity is missed. + +## 2. Citations + +The docstring cites `[Er95d] Erdős, P. and Hajnal, A., unpublished (1995)`. The website ([erdosproblems.com/895](https://www.erdosproblems.com/895)) attributes the problem to Erdős and Hajnal but does not provide a specific reference code like `[Er95d]`. The website's recommended citation is: + +> T. F. Bloom, Erdős Problem #895, https://www.erdosproblems.com/895 + +The shorthand `[Er95d]` appears to be an internal project convention rather than a standard bibliographic reference. The website confirms the attribution to Erdős and Hajnal and the SAT-solver verification by Ben Barber. The docstring's mention of "Barber" is consistent with the website. + +## 3. Variants + +The website mentions a stronger open conjecture due to Hajnal: that there should exist an independent set forming a **Hindman set** — the set of all finite sums from some finite sequence {a₁, ..., aₖ}. This variant is **not captured** by the formalization. Since it remains open and is a distinct (stronger) conjecture, omitting it is reasonable, but it could be noted in the docstring or formalized as a separate conjecture. + +## 4. Readability + +The code is clear and well-structured. The docstring explains the encoding choice (using `Fin n` with positivity constraints) and mentions the SAT-solver proof. The explicit adjacency checks (`¬G.Adj a b`, etc.) are more readable than an abstract `IsIndepSet` predicate for this specific 3-element case. + +Minor suggestion: the variable names `a` and `b` match the original problem statement, which is good. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The original problem statement — "if G is a triangle-free graph on {1,...,n} then there must exist an independent set {a, b, a+b}" — is precise. The only interpretive choices are: +- The vertex set encoding (here `Fin n` with positivity constraints, equivalent to `{1,...,n-1}`). +- Implicit distinctness of the three points (guaranteed by the constraints: `a ≠ b` is explicit; `a+b ≠ a` and `a+b ≠ b` follow from `b.val ≥ 1` and `a.val ≥ 1` respectively, combined with `a.val + b.val < n`). + +There is no meaningful ambiguity in the statement. + +## 6. Correctness + +**Assessment: Correct.** + +The formalization faithfully captures the problem. Key correctness observations: + +1. **Vertex set equivalence:** The graph is defined on `Fin n = {0, ..., n-1}`, and the independent triple is restricted to vertices with `a.val ≥ 1`, `b.val ≥ 1`. This effectively constrains {a, b, a+b} to lie in `{1, ..., n-1}`. Since the universal quantifier ranges over *all* triangle-free graphs on `Fin n`, and any triangle-free graph on `{1,...,n-1}` can be extended to one on `{0,...,n-1}` (e.g., vertex 0 isolated), and conversely any such graph restricts to a triangle-free graph on `{1,...,n-1}`, the formulation is equivalent to the original problem on `{1,...,n}` (up to a constant shift in the threshold N₀, which is existentially quantified and thus irrelevant). + +2. **Distinctness:** The three points a, b, a+b are guaranteed distinct: `a ≠ b` is explicit; `⟨a.val + b.val, h⟩ ≠ a` because `a.val + b.val > a.val` (since `b.val ≥ 1`); `⟨a.val + b.val, h⟩ ≠ b` because `a.val + b.val > b.val` (since `a.val ≥ 1`). + +3. **Independence condition:** The three pairwise non-adjacency checks (`¬G.Adj a b`, `¬G.Adj a ⟨a+b, h⟩`, `¬G.Adj b ⟨a+b, h⟩`) are exactly the condition for {a, b, a+b} to be a 3-element independent set. + +4. **Triangle-free condition:** `G.CliqueFree 3` correctly encodes triangle-freeness. + +5. **Answer wrapper:** `answer(True)` correctly reflects that the problem has been proved in the affirmative (by Barber's SAT verification for n ≥ 18). + +No mathematical flaws identified. The formalization is complete and correct. diff --git a/ai-review/896.md b/ai-review/896.md new file mode 100644 index 0000000000..1e76d7f978 --- /dev/null +++ b/ai-review/896.md @@ -0,0 +1,84 @@ +# Review: Erdos Problem 896 + +## 1. Code Reuse + +The `uniqueProductCount` definition is self-contained and reasonable. Two existing library components are worth noting: + +- **`FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`**: Defines `sumConv` (additive convolution) and `sumRep` using indicator functions. A multiplicative analog — a "product convolution" `(𝟙_A ∗_× 𝟙_B)(m) = #{(a,b) ∈ A×B : ab = m}` — could replace the inline filtering logic in `uniqueProductCount`. Then `uniqueProductCount A B` would just count `m` where `(𝟙_A ∗_× 𝟙_B)(m) = 1`. This would be cleaner and enable reuse by other multiplicative problems. + +- **`FormalConjectures/ErdosProblems/796.lean`**: Defines `productRepCount` for counting product representations within a single set (with the ordering constraint `a₁ < a₂`). The two-set variant needed here (A × B without ordering) is sufficiently different that direct reuse isn't practical, but the pattern is similar. + +**Recommendation**: Consider introducing a multiplicative convolution in the library (analogous to `sumConv`). This would benefit both Problem 896 and Problem 796. + +## 2. Citations + +The formalization includes: +> [Er72] Erdős, P., _Quelques problèmes de théorie des nombres_, p. 81, 1972. + +The website ([erdosproblems.com/896](https://www.erdosproblems.com/896)) lists the same reference as [Er72, p.81]. This matches. + +**Issue**: The docstring and lower bound theorem attribute the known bounds to "Van Doorn" but provide no citation for van Doorn's work. The website also does not give a full citation for van Doorn's result. A best-effort citation or note acknowledging the missing reference would be appropriate. + +**Minor**: The website lists Problem #490 as a related problem. The formalization does not reference this; it is not strictly required but could be mentioned in a comment for cross-referencing. + +## 3. Variants + +The formalization captures two statements: + +| Statement | Tag | Status | +|---|---|---| +| `erdos_896`: Upper bound F(A,B) ≤ C·N²/log N | `research open` | Conjectured | +| `erdos_896.variants.lower_bound`: Lower bound (1-ε)·N²/log N | `research solved` | Proven (van Doorn) | + +**Missing variant**: The known (proven) upper bound due to van Doorn: +$$F(A,B) \ll \frac{N^2}{(\log N)^\delta (\log \log N)^{3/2}}, \quad \delta = 1 - \frac{1 + \log\log 2}{\log 2} \approx 0.086$$ + +This is a weaker bound than the conjectured O(N²/log N) but is the best *proven* upper bound. Since it is a solved result, it deserves its own variant (e.g., `erdos_896.variants.upper_bound`), tagged `research solved`. + +## 4. Readability + +The code is clear and well-structured. Specific observations: + +- The `uniqueProductCount` definition is readable and its docstring accurately describes the function. +- The theorem statements are clean and follow standard asymptotic formalization patterns. +- The module docstring provides good mathematical context including the van Doorn bounds. +- **Suggestion**: The docstring for `erdos_896` says "the lower bound gives the correct order of magnitude." This is the *conjecture*, not a known fact. The phrasing could be clarified, e.g., "Conjectured: the maximum is O(N²/log N), matching the known lower bound." + +## 5. Formalizability + +**Assessment: Unambiguous and cleanly formalizable.** + +The problem statement is precise: +- F(A,B) is well-defined: count products m = ab with a ∈ A, b ∈ B having exactly one such representation. +- The domain {1,...,N} is unambiguous. +- The optimization (maximize over all A, B) is standard. +- The asymptotic bounds are standard to formalize using ε-N₀ quantification. + +There is no ambiguity in the problem statement. + +## 6. Correctness + +### Definition `uniqueProductCount` +**Correct.** The implementation: +1. Forms the Cartesian product A ×ˢ B +2. Maps to the multiset of products via `.image` +3. Filters for products m with exactly one preimage pair +4. Counts the result + +This faithfully captures F(A,B) as described. Since the theorems constrain A, B ⊆ Finset.Icc 1 N, all elements are positive, avoiding any edge cases with zero. + +### Theorem `erdos_896` (conjectured upper bound) +**Correct.** The statement asserts: ∃ C > 0, ∃ N₀, ∀ N ≥ N₀, ∀ A, B ⊆ {1,...,N}, F(A,B) ≤ C·N²/log N. This is the standard formalization of "max F(A,B) = O(N²/log N)." The tag `research open` is appropriate — this is the open conjecture, not a known result. The known upper bound is weaker (see §3). + +### Theorem `erdos_896.variants.lower_bound` +**Correct.** The statement asserts: ∀ ε > 0, ∃ N₀, ∀ N ≥ N₀, ∃ A, B ⊆ {1,...,N} with F(A,B) ≥ (1-ε)·N²/log N. This correctly formalizes the (1+o(1))·N²/log N lower bound. Using (1-ε) for all ε > 0 is the standard way to express a lower bound of (1+o(1))·g(N). The tag `research solved` is appropriate. + +### Operator precedence +The expressions `C * (N : ℝ) ^ 2 / Real.log (N : ℝ)` and `(1 - ε) * (N : ℝ) ^ 2 / Real.log (N : ℝ)` parse as `(C * N²) / log N` and `((1 - ε) * N²) / log N` respectively, which are the intended mathematical expressions. Correct. + +### AMS classification +`AMS 5 11` (combinatorics, number theory) is appropriate. + +## Summary + +The formalization is mathematically correct and well-written. The main gap is the **missing proven upper bound variant** (van Doorn's bound with the δ exponent), which is the strongest known result. A minor docstring clarification distinguishing the conjecture from known results would also improve the file. The `uniqueProductCount` definition could eventually benefit from a shared multiplicative convolution library component, but this is a design consideration rather than a defect. diff --git a/ai-review/898.md b/ai-review/898.md new file mode 100644 index 0000000000..103abddcd4 --- /dev/null +++ b/ai-review/898.md @@ -0,0 +1,97 @@ +# Review: Erdős Problem 898 + +## 1. Code Reuse + +The file defines five custom primitives from scratch using `ℝ × ℝ`: +- `sqDist898`, `dist898` — Euclidean distance +- `NonDegenerate898` — non-collinearity via cross product +- `InInterior898` — interior point via barycentric coordinates +- `perpFoot898` — orthogonal projection onto a line + +`FormalConjecturesForMathlib/Geometry/2d.lean` already provides infrastructure built on Mathlib's `EuclideanSpace ℝ (Fin 2)` (aliased as `ℝ²`), including: +- `NonTrilinear` for non-collinearity (via `Collinear`) +- `triangle_area` using `positiveOrientation.areaForm` +- Oriented angle machinery, convex polygon predicates, `AffineIndependent` + +Mathlib itself provides `dist` (via `MetricSpace`/`NormedAddTorsor`), `EuclideanGeometry.orthogonalProjection`, `AffineSubspace.orthogonalProjectionFn`, and `Affine.Triangle` (with `Triangle.independent`). All five custom definitions could in principle be replaced by Mathlib equivalents, avoiding ad-hoc `ℝ × ℝ` representations. However, this is a stylistic choice—using raw `ℝ × ℝ` keeps the formalization self-contained and avoids heavy Mathlib imports. + +**Verdict:** Significant reuse potential exists but is not critical for correctness. + +## 2. Citations + +The docstring reads: +> `[Er82e] Erdős, P., *Personal favorites*, p.61.` + +The website ([erdosproblems.com/898](https://www.erdosproblems.com/898)) cites: +> [Er82e, p.61] + +The website does not expand the citation key inline on the problem page. The formalization's expansion to "Erdős, P., *Personal favorites*, p.61" appears to be an editorial interpretation. The actual reference [Er82e] corresponds to: + +> Erdős, P. (1982). "Personal favorites." In *Combinatorics and graph theory* (Calcutta, 1980), Lecture Notes in Math. **885**, Springer, pp. 58–67. + +The docstring omits the publication venue and year. The citation should ideally be verified against the Erdős bibliography to confirm accuracy. + +**Verdict:** Citation is plausible but could be more precise with venue/year details. + +## 3. Variants + +The website lists no variants of the problem. The Erdős-Mordell inequality as stated (PA + PB + PC ≥ 2(PD_a + PD_b + PD_c)) is the complete problem. + +Known extensions in the literature (not on the website) include: +- The stronger Barrow's inequality (using angle bisector feet instead of perpendicular feet) +- Higher-dimensional generalizations +- Reverse Erdős-Mordell inequalities + +Since none of these appear on erdosproblems.com/898, the formalization correctly captures the single stated problem. + +**Verdict:** All variants captured. No missing formulations. + +## 4. Readability + +The code is well-structured and readable: +- Each helper definition has a clear docstring with mathematical explanation. +- The `perpFoot898` definition includes the projection formula in the docstring. +- The main theorem statement clearly mirrors the mathematical inequality. +- The `898` suffix convention on helper names avoids namespace collisions. + +Minor observations: +- The LaTeX in the main theorem docstring is well-formatted. +- The barycentric coordinate definition of `InInterior898` is standard and intuitive. + +**Verdict:** Good readability. No significant improvements needed. + +## 5. Formalizability + +The Erdős-Mordell inequality is a precise, quantitative geometric statement. It is unambiguously formalizable: +- The triangle, interior point, and perpendicular feet are all well-defined geometric objects. +- The inequality involves only Euclidean distances, which are fully determined. +- There is no ambiguity in the statement—it was conjectured by Erdős (1935) and proved by Mordell and Barrow (1937). + +**Verdict:** Fully formalizable with no ambiguity. Assessment: **unambiguous**. + +## 6. Correctness + +### Perpendicular feet mapping +The theorem uses: +- `perpFoot898 P B C` — foot from P to line BC (= D_a, foot to side a) ✓ +- `perpFoot898 P A C` — foot from P to line AC (= D_b, foot to side b) ✓ +- `perpFoot898 P A B` — foot from P to line AB (= D_c, foot to side c) ✓ + +This correctly matches the docstring description: D_a, D_b, D_c are feet to sides BC, CA, AB. + +### Line vs. segment projection +`perpFoot898` computes the orthogonal projection onto the *line* through two points, not the *segment*. This is mathematically sound: when P is in the interior of triangle ABC (guaranteed by `InInterior898`), the perpendicular foot from P to each side always lies on the segment itself, not on the extension of the side. So the line projection coincides with the segment projection under the interior hypothesis. + +### Division-by-zero in `perpFoot898` +The function divides by `dx ^ 2 + dy ^ 2`, which is zero when the two defining points coincide (A = B). However, `NonDegenerate898` ensures the cross product `(B-A) × (C-A) ≠ 0`, which implies all three vertices are distinct. So no division-by-zero occurs in the theorem's hypotheses. + +### Inequality direction +The inequality `dist P A + dist P B + dist P C ≥ 2 * (dist P D_a + dist P D_b + dist P D_c)` with `≥` is the correct direction (distances to vertices dominate twice the distances to sides). This matches the classical Erdős-Mordell inequality. + +### Non-degeneracy sufficiency +The formalization requires both `NonDegenerate898` (non-collinear vertices) and `InInterior898` (P strictly inside). The classical statement only requires P to be interior, which implicitly forces non-degeneracy. Including `NonDegenerate898` explicitly is redundant but harmless and arguably clearer. + +### `InInterior898` correctness +The definition uses strictly positive barycentric coordinates summing to 1, which is the standard characterization of the open interior of a triangle. This is correct. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. The redundancy in hypotheses (explicit non-degeneracy alongside interior point) is a minor stylistic point, not a correctness issue. diff --git a/ai-review/900.md b/ai-review/900.md new file mode 100644 index 0000000000..244181138d --- /dev/null +++ b/ai-review/900.md @@ -0,0 +1,71 @@ +# Review: Erdős Problem 900 + +**File:** `FormalConjectures/ErdosProblems/900.lean` + +## 1. Code Reuse + +**`GraphHasLongPath` is redundant with Mathlib infrastructure.** Mathlib provides `SimpleGraph.Walk` and the `Walk.IsPath` predicate (requiring `support.Nodup`, i.e., no repeated vertices). Multiple other Erdős problems in this codebase (57, 63, 64, 65, 583, 640, 751) already use Mathlib's `Walk`/`IsPath` for cycle and path concepts. The custom definition at lines 36–41 manually encodes an injective vertex sequence with adjacency — this is semantically equivalent to: + +```lean +def GraphHasLongPath {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop := + ∃ (v w : V) (p : G.Walk v w), p.IsPath ∧ k ≤ p.length +``` + +Using Mathlib's `Walk.IsPath` would improve consistency across the problem set and grant access to the existing lemma library for walks and paths. + +**`erdosRenyiProbability` is unique in the codebase** — no other problem defines a G(n,m) model. As a one-off specification-level definition it is acceptable, though a shared utility in `FormalConjecturesForMathlib` would benefit any future random graph problems. The counting-based approach (ratio of filtered finsets) is mathematically clean but note that it requires `open Classical` for decidability instances on `SimpleGraph (Fin n)`. + +## 2. Citations + +The docstring cites: +- **[AKS81]** Ajtai, Komlós, Szemerédi, *The longest path in a random graph*, Combinatorica 1 (1981), 1–12. ✅ Correct. + +**Missing original sources.** The website (erdosproblems.com/900) lists two original sources: +- **[Er78, p.32]** — Erdős 1978, where the problem was first posed. +- **[Er82e]** — Erdős 1982. + +These should be included in the docstring, especially the [Er78] reference which contains Erdős's quote about Szemerédi's disagreement. The website also notes the problem status as **PROVED**. + +## 3. Variants + +The website records one notable historical variant: Szemerédi believed the opposite — that for every c the longest path is a.s. o(n). This is not a separate mathematical variant requiring formalization; it is a historical note about a competing conjecture that turned out to be false. **No additional variants appear to be missing.** + +The formalization captures the full statement: existence of f with the correct boundary behavior (f(c) → 0 as c → 1/2⁺, f(c) → 1 as c → ∞) and the high-probability long path property. + +## 4. Readability + +- **`GraphHasLongPath`**: The `Fin (m + 1) → V` encoding with explicit index arithmetic (`⟨i, by omega⟩`, `⟨i + 1, by omega⟩`) is harder to read than using Mathlib's `Walk.IsPath`. Replacing it would improve readability significantly. +- **Limit encoding**: The right-limit `f(c) → 0` as `c → (1/2)⁺` is encoded as `Tendsto (fun h => f (1/2 + h)) (nhdsWithin 0 (Ioi 0)) (nhds 0)`. This is correct but slightly non-standard — a more idiomatic Mathlib encoding would be `Tendsto f (nhdsWithin (1/2) (Ioi (1/2))) (nhds 0)`, which directly says "f tends to 0 as the argument approaches 1/2 from the right." The current reparametrization by `h = c - 1/2` is equivalent but adds a layer of indirection. +- **Overall structure**: The theorem statement is well-organized. The `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀` pattern for "with high probability" is clear. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** The key concepts — Erdős–Rényi G(n,m) model, path length, "with high probability," and limit behavior of f — all have standard mathematical definitions that translate directly to Lean. There is essentially **no ambiguity** in the statement. + +The only minor interpretive choice is what "path of length at least f(c)·n" means when f(c)·n is non-integer. The formalization uses `⌊f(c) · n⌋₊` (natural number floor), meaning it requires path length ≥ ⌊f(c)·n⌋ rather than ≥ ⌈f(c)·n⌉. Since f is existentially quantified, this distinction is mathematically inconsequential — any witness f for the ceiling version works for the floor version, and vice versa (with negligible asymptotic adjustment). This is a non-issue. + +## 6. Correctness + +**The formalization is mathematically correct and complete.** Detailed assessment: + +- **Domain of f**: The problem states f : (1/2, ∞) → ℝ, while the formalization uses f : ℝ → ℝ. This is standard practice — the values of f outside (1/2, ∞) are irrelevant since f is only evaluated at c > 1/2 or in limits approaching that domain. ✅ +- **Right-limit at 1/2**: Correctly captured (see readability note above about style). ✅ +- **Limit at infinity**: `Tendsto f atTop (nhds 1)` — correct. ✅ +- **"With high probability"**: The formalization `∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, P(event) ≥ 1 - ε` is the standard definition. ✅ +- **G(n, ⌊cn⌋) model**: `erdosRenyiProbability n (⌊c * n⌋₊)` correctly uses the natural number floor to get an edge count. For c > 1/2 and n ≥ 1, this is positive and well within the valid range (≤ n(n-1)/2 for large n in this sparse regime). ✅ +- **Path length**: `GraphHasLongPath G (⌊f c * n⌋₊)` correctly requires a path with at least that many edges. ✅ +- **`erdosRenyiProbability` definition**: Counts graphs uniformly over all simple graphs on `Fin n` with exactly m edges. This is the correct G(n,m) model (uniform distribution over graphs with a fixed number of edges, as opposed to the G(n,p) model with independent edge inclusion). ✅ +- **Edge case**: When `total.card = 0` (no graphs with exactly m edges), the probability is 0/0 which Lean's division gives as 0. This only occurs when m > n(n-1)/2, which doesn't happen in the regime of interest. ✅ + +**No mathematical flaws identified.** The formalization faithfully captures the problem as stated on erdosproblems.com. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `GraphHasLongPath` should use Mathlib's `Walk.IsPath`; `erdosRenyiProbability` is fine as-is | +| Citations | Missing [Er78, p.32] and [Er82e] original sources | +| Variants | Complete — no missing variants | +| Readability | Good overall; right-limit encoding is non-standard; path definition is verbose | +| Formalizability | Fully formalizable, no ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/901.md b/ai-review/901.md new file mode 100644 index 0000000000..fdf6f40aeb --- /dev/null +++ b/ai-review/901.md @@ -0,0 +1,105 @@ +# Review: Erdős Problem 901 + +## 1. Code Reuse + +Several other Erdős problem files define overlapping hypergraph and Property B concepts: + +- **Problem 836** (`ErdosProblems/836.lean`): Defines a generic `Hypergraph V` structure with `IsUniform`, `vertices`, `IsProperColoring`, `HasChromaticNumber3`, and `IsIntersecting`. This is a more structured and type-generic approach than the raw `Finset (Finset ℕ)` used in 901. +- **Problem 832** (`ErdosProblems/832.lean`): Defines a `UniformHypergraph` struct with verified uniformity, `IsProperColoring`, and `chromaticNumber`. +- **Problem 1022** (`ErdosProblems/1022.lean`): Defines `HasPropertyB` for `Finset (Finset (Fin n))` — essentially the same definition as in 901, but over `Fin n` instead of `ℕ`. +- **Problem 833** (`ErdosProblems/833.lean`): Another `Hypergraph` variant with degree and `HasChromaticNumber`. + +**Assessment:** Problem 901 uses a minimalist approach with `Finset (Finset ℕ)` and local definitions of `IsNUniform` and `HasPropertyB`. This is self-contained and works fine. However, there is significant duplication with the definitions in Problems 836, 832, and 1022. Ideally these would share a common hypergraph definition, but since each file is namespaced independently, the current approach is acceptable for a conjectures repository where each problem should be independently readable. No change strictly required. + +## 2. Citations + +The website ([erdosproblems.com/901](https://www.erdosproblems.com/901)) provides: + +- The problem originates from Erdős and Lovász (1975, p. 610) and Erdős (1982). +- Known results include: + - Exact values: m(2) = 3, m(3) = 7, m(4) = 23 + - Erdős: 2^n ≪ m(n) ≪ n² · 2^n + - Beck (1977): m(n) ≫ (log n) · 2^n + - Beck (1978): m(n) ≫ n^{1/3 - o(1)} · 2^n + - Radhakrishnan & Srinivasan (2000): m(n) ≫ √(n/log n) · 2^n + - Pluhár (2009): m(n) ≫ n^{1/4} · 2^n + +The current docstring cites "Erdős and Lovász" for the conjecture but does not give the specific paper reference "[ErLo75]" or "[Er82]". The website does not provide full bibliographic entries either, but the shorthand is even less specific. + +**Recommendation:** The docstring reference `[erdosproblems.com/901]` is sufficient as the primary citation. Consider adding "[ErLo75]" or "Erdős and Lovász (1975)" for specificity, consistent with how Problem 836 cites "[ErLo75]". + +## 3. Variants + +The formalization captures two theorems: +1. `erdos_901` — the **lower bound** (open): m(n) ≥ c · n · 2^n +2. `erdos_901.variants.upper_bound` — the **upper bound** (solved): m(n) ≤ c · n · 2^n + +Together these express that m(n) = Θ(n · 2^n). + +**Assessment:** This correctly captures the full conjecture. The website confirms the lower bound remains open while the upper bound (m(n) ≪ n² · 2^n, which is weaker than n · 2^n) is known. However, the upper bound variant is tagged `category research solved` — this needs scrutiny. The website states Erdős showed m(n) ≪ n² · 2^n, not n · 2^n. The conjecture is that the correct order is n · 2^n. If the upper bound m(n) ≤ c · n · 2^n has indeed been proven, the `solved` tag is appropriate; but based on the website, only the weaker O(n² · 2^n) upper bound appears established. **This may be an error in the `solved` tag, or the formalization reflects a result not listed on the website.** This deserves verification. + +No additional variants appear missing — the problem is fundamentally about the asymptotic order of m(n), and the two-sided bound formulation covers it. + +## 4. Readability + +The code is clean and readable: +- Clear docstrings explain the mathematical content. +- Definition names (`IsNUniform`, `HasPropertyB`) are descriptive. +- The theorem statements are well-structured with the standard ∃c > 0, ∃N₀, ∀n ≥ N₀ pattern. + +**Minor suggestions:** +- The `open Finset` is fine but only `Finset.card` is used implicitly; the definitions are clear without it. +- The module docstring could mention the known bounds for additional context (as other problems in the repo do). + +Overall readability is good. + +## 5. Formalizability + +The problem as stated on the website is: + +> Let m(n) denote the minimum number of edges in an n-uniform hypergraph that is not 2-colorable. Estimate m(n) — conjectured to be of order n · 2^n. + +**Assessment: Low ambiguity.** The concepts of n-uniform hypergraph, 2-colorability (Property B), and minimum edge count are all precisely defined. The formalization correctly translates "m(n) is of order n · 2^n" into separate upper and lower bounds with constants and "for sufficiently large n" quantification. + +One subtle point: the formalization uses `Finset (Finset ℕ)` for hypergraphs, meaning edges are finite sets of natural numbers. This is fully general for finite hypergraphs since any finite vertex set can be embedded into ℕ. The use of `ℕ` as the vertex type (rather than `Fin k` for some k) means the coloring function `f : ℕ → Bool` assigns colors to all naturals, not just vertices in the hypergraph. This is mathematically fine — extra vertices being colored doesn't affect the property — but is slightly non-standard. Problem 1022 uses `Fin n` which is more precise. + +## 6. Correctness + +### Lower bound (`erdos_901`) +``` +∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∀ (H : Finset (Finset ℕ)), + IsNUniform H n → ¬HasPropertyB H → + (H.card : ℝ) ≥ c * ↑n * (2 : ℝ) ^ n +``` + +This says: there exists c > 0 and N₀ such that for n ≥ N₀, every n-uniform hypergraph without Property B has at least c · n · 2^n edges. This correctly formalizes the lower bound m(n) ≥ c · n · 2^n. **Correct.** + +### Upper bound (`erdos_901.variants.upper_bound`) +``` +∃ c : ℝ, c > 0 ∧ ∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → + ∃ (H : Finset (Finset ℕ)), + IsNUniform H n ∧ ¬HasPropertyB H ∧ + (H.card : ℝ) ≤ c * ↑n * (2 : ℝ) ^ n +``` + +This says: there exists c > 0 and N₀ such that for n ≥ N₀, there exists an n-uniform hypergraph without Property B with at most c · n · 2^n edges. This correctly formalizes m(n) ≤ c · n · 2^n. **Mathematically correct as a statement.** + +### Potential issues: + +1. **Empty hypergraph edge case:** The empty hypergraph `∅` is trivially n-uniform and trivially has Property B (any coloring works, since no edges need to be non-monochromatic). So `¬HasPropertyB H` correctly excludes the trivial case. No issue here. + +2. **n = 0 or n = 1 edge cases:** For n = 0, every edge must have 0 elements, meaning every edge is `∅`. But `HasPropertyB` requires both a true and false element in each edge, which is impossible for empty edges. So any non-empty 0-uniform hypergraph lacks Property B but has 0 · 2^0 = 0 as the bound, making the lower bound vacuously satisfiable only if `H.card ≥ 0`. This is fine since the `∃ N₀` quantifier can exclude small n. For n = 1, a 1-uniform hypergraph where every edge is a singleton cannot have Property B (a singleton can only be one color). So m(1) = 1 and the bound c · 1 · 2 = 2c works with small enough c. The "sufficiently large n" quantifier handles these cases gracefully. + +3. **Solved tag on upper bound:** As noted in §3, the website only confirms m(n) ≪ n² · 2^n (Erdős). The tighter upper bound m(n) ≤ c · n · 2^n would need a separate reference. If this has not been proven, the `solved` tag is incorrect and should be `open`. **This is the most significant potential issue.** + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Acceptable; duplicates exist but namespacing keeps things clean | +| Citations | Adequate; could add "[ErLo75]" for specificity | +| Variants | Both bounds captured; no missing variants | +| Readability | Good | +| Formalizability | Low ambiguity; straightforward formalization | +| Correctness | Mathematically correct formalization; **verify `solved` tag on upper bound** | diff --git a/ai-review/902.md b/ai-review/902.md new file mode 100644 index 0000000000..50f231cd00 --- /dev/null +++ b/ai-review/902.md @@ -0,0 +1,85 @@ +# Review: Erdős Problem 902 + +## 1. Code Reuse + +**Partial opportunity identified.** Erdős Problem 112 (`FormalConjectures/ErdosProblems/112.lean`) defines a `Digraph` structure (an irreflexive binary relation) which is essentially a tournament minus the completeness and antisymmetry axioms. The `Tournament` structure in 902 could be refactored as a `Digraph` plus additional axioms (`complete`, `antisymm`), or both could extend a shared base. However, the two files live in separate namespaces and the coupling may not be worthwhile given the simplicity of each definition. + +The `SimpleGraph.Domination` module in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Domination.lean` handles undirected graph domination and is not directly applicable here, since tournament domination is a directed concept with a different structure (a single vertex dominating an entire subset via directed edges). + +**Verdict:** No strong reuse opportunity. The `Tournament` structure is self-contained and appropriate for this problem. + +## 2. Citations + +The formalization lists two references in stub form: + +``` +[Er63c] Erdős, P. (1963). +[SzSz65] Szekeres, E. and Szekeres, G. (1965). +``` + +The website (erdosproblems.com/902) lists **three** references: [Er63c], [SzSz65], and [Er82e]. The full citations should be: + +- **[Er63c]** Erdős, P., "On a problem in graph theory," *The Mathematical Gazette*, vol. 47, no. 361 (1963), pp. 220–223. +- **[SzSz65]** Szekeres, E. and Szekeres, G., "On a problem of Schütte and Erdős," *The Mathematical Gazette*, vol. 49, no. 369 (1965), pp. 290–293. +- **[Er82e]** Erdős, P., "Some of my favourite problems which recently have been solved" (1982), pp. 59–79. *(Missing from the formalization entirely.)* + +**Issues:** +- Both included citations are incomplete stubs (no titles, journals, or page numbers). +- Reference [Er82e] is absent from the formalization but listed on the website. + +## 3. Variants + +The formalization captures three results: +1. Erdős lower bound: $f(n) \geq 2^{n+1} - 1$ (from [Er63c]) +2. Erdős upper bound: $f(n) \ll n^2 \cdot 2^n$ (from [Er63c]) +3. Szekeres–Szekeres lower bound: $f(n) \gg n \cdot 2^n$ (from [SzSz65]) + +**Missing variants:** +- **Exact small values:** The website states $f(1) = 3$, $f(2) = 7$, and Szekeres–Szekeres proved $f(3) = 19$. None of these are formalized. +- **Open estimation problem:** The problem as posed on the website asks to "estimate $f(n)$" and is marked **OPEN**. The current gap between the best known bounds ($n \cdot 2^n \ll f(n) \ll n^2 \cdot 2^n$) is the core open question. There is no statement capturing this open problem — e.g., a conjecture about the precise asymptotic order of $f(n)$. + +## 4. Readability + +The code is well-structured and readable: +- The `Tournament` structure is cleanly defined with clear field names (`beats`, `irrefl`, `complete`, `antisymm`). +- `hasDominationProperty` is concise and its docstring accurately describes the mathematical content. +- `tournamentDominationNumber` correctly uses `sInf` for the minimum. +- The theorem names follow a logical hierarchy (`erdos_902`, `erdos_902.variants.upper`, `erdos_902.variants.szekeres_lower`). + +**Minor suggestion:** The docstring for `erdos_902` says "lower bound [Er63c]" but the main problem is the estimation question. Consider naming it `erdos_902.variants.erdos_lower` for symmetry with the other variants, and reserving `erdos_902` for the open estimation problem or the pair of best-known bounds. + +## 5. Formalizability + +**High formalizability.** The problem is precisely stated and all concepts are standard: +- A tournament is a well-defined combinatorial object (complete antisymmetric directed graph). +- The $n$-domination property is an unambiguous predicate on tournaments. +- The function $f(n)$ is a well-defined minimum over a nonempty set of natural numbers (existence follows from probabilistic arguments or explicit constructions). + +There is no ambiguity in the problem statement. The only subtlety is whether "dominated by another vertex" means the dominating vertex must lie outside the set $S$. The formalization correctly enforces `v ∉ S`, which matches the standard convention. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Tournament structure ✓ +The four axioms (`beats`, `irrefl`, `complete`, `antisymm`) correctly characterize a tournament. `complete` gives at least one directed edge between distinct vertices; `antisymm` ensures at most one. Together: exactly one directed edge between any two distinct vertices. + +### Domination property ✓ +`∀ S : Finset V, S.card = n → ∃ v, v ∉ S ∧ ∀ u ∈ S, T.beats v u` correctly states that every $n$-element subset is dominated by some external vertex. + +### `tournamentDominationNumber` — minor subtlety +Defined as `sInf {m : ℕ | ∃ (T : Tournament (Fin m)), T.hasDominationProperty n}`. In Lean's `ℕ`, `sInf ∅ = 0`. If no tournament with the $n$-domination property exists for any $m$, then `tournamentDominationNumber n = 0`, and the lower bound `erdos_902` would assert `0 ≥ 2^{n+1} - 1`, which is false. This means the theorem implicitly requires that such tournaments exist (which they do, by probabilistic or constructive arguments). A proof of `erdos_902` will need to establish this existence as part of the argument. This is not a bug — it is mathematically valid — but a cleaner approach might separate the existence claim into its own lemma. + +### Lower bound statement ✓ +`tournamentDominationNumber n ≥ 2 ^ (n + 1) - 1` uses natural number subtraction, but since `2^(n+1) ≥ 2` for all `n`, there is no underflow. The bound matches Erdős [Er63c]. + +### Upper bound statement ✓ +The asymptotic bound `f(n) ≤ C · n² · 2^n` is correctly expressed as an existential over a positive constant, applied to the real-valued cast of `tournamentDominationNumber n`. + +### Szekeres–Szekeres lower bound ✓ +Similarly correct: `f(n) ≥ C · n · 2^n` for some $C > 0$. + +### Attribute tags +All three theorems are tagged `category research solved, AMS 5`. The individual bounds are indeed proved results, so `solved` is appropriate for these statements. AMS classification 05 (Combinatorics) is correct. + +**Overall assessment:** The formalization is mathematically sound and captures the key known bounds correctly. The main gaps are incomplete citations (missing [Er82e], stub references), missing exact small values ($f(1)=3$, $f(2)=7$, $f(3)=19$), and the absence of a statement for the core open estimation problem. diff --git a/ai-review/903.md b/ai-review/903.md new file mode 100644 index 0000000000..91ced5a49f --- /dev/null +++ b/ai-review/903.md @@ -0,0 +1,98 @@ +# AI Review: Erdős Problem 903 + +## 1. Code Reuse + +There are **four separate definitions** of pairwise balanced designs across the codebase, all in the `ErdosProblems` directory: + +| File | Name | Requires `2 ≤ |B|` | Requires `|B| < n` | Style | +|------|------|---------------------|---------------------|-------| +| `665.lean` | `IsPairwiseBalancedDesign` | Yes | Yes | `∃!` | +| `732.lean` | `IsPBD` | Yes | No | `∃!` | +| `734.lean` | `IsPBBD` | No | No | `filter.card = 1` | +| `903.lean` | `IsPairwiseBalancedDesign` | **No** | No | `∃!` | + +These should ideally be unified into a single shared definition (e.g., in `FormalConjecturesForMathlib`). The definition in `732.lean` (`IsPBD`) is the most standard one (requires `2 ≤ |B|`, uses `∃!`) and would be suitable as a shared base, with `665.lean` adding the `|B| < n` constraint locally. + +## 2. Citations + +The formalization references: +- `[Er82e]` — Erdős, P., *Problems and results in combinatorics and graph theory*, 1982. +- `[dBEr48]` — de Bruijn, N.G. and Erdős, P., *On a combinatorial problem*, 1948. +- `[EFSW85]` — Erdős, P., Fowler, J.C., Sós, V.T., and Wilson, R.M., *On 2-designs*, 1985. + +The website (erdosproblems.com/903) states that: +- The problem is a **conjecture of Erdős and Sós** — this attribution is not explicitly stated in the docstring, which only says "Erdős Problem 903 [Er82e]". +- It was **proved by Erdős, Fowler, Sós, and Wilson** — this is correctly noted. + +The citations appear reasonable. The website does not provide more specific bibliographic details than what is already in the formalization. + +## 3. Variants + +The website mentions two additional results/questions **not captured** in the formalization: + +1. **Stronger bound**: Erdős, Fowler, Sós, and Wilson additionally proved that unless the block design arises from a projective plane with one line "broken up," the bound is actually $t \geq n + cp$ where $c \approx 1.148$. + +2. **General open question**: Determining all possible values of $t$ for a given $n$ remains open. + +Neither variant is formalized. The stronger bound would be a natural addition, though its statement requires defining what it means for a PBD to arise from a projective plane with a broken line, which adds significant complexity. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring clearly explains the mathematical content. +- The theorem signature is well-structured: it factors the prime power $p = q^k$ explicitly, which is the standard Lean idiom for avoiding a standalone `IsPrimePow` predicate on naturals. +- The namespace `Erdos903` is used appropriately. + +No significant readability issues. + +## 5. Formalizability + +The problem is **precisely stated and clearly formalizable**. There is no ambiguity: $n = p^2 + p + 1$ for a prime power $p$, a pairwise balanced design is a standard combinatorial object, and the conclusion $t \geq n + p$ is a concrete numerical bound. + +**Ambiguity level: None.** This is a clean, unambiguous combinatorial statement. + +## 6. Correctness + +### Critical Issue: Missing block-size constraint + +The definition of `IsPairwiseBalancedDesign` in `903.lean` is: + +```lean +def IsPairwiseBalancedDesign {n : ℕ} (blocks : Finset (Finset (Fin n))) : Prop := + ∀ x y : Fin n, x ≠ y → + ∃! B : Finset (Fin n), B ∈ blocks ∧ x ∈ B ∧ y ∈ B +``` + +This definition **does not require blocks to have at least 2 elements**. Empty sets and singletons are permitted as blocks. Since such blocks contain no pairs of distinct elements, they satisfy the PBD uniqueness condition vacuously — but they **are counted** in `blocks.card`. + +This makes the theorem **false as stated**. Here is a counterexample sketch: + +- Let $p = 2$, so $n = 7$. A Fano plane gives a valid PBD with $t = 7 = n$ blocks (each of size 3). Now add a single singleton block, say $\{0\}$. The result still satisfies `IsPairwiseBalancedDesign` (the singleton contains no pairs, so uniqueness is unaffected). Now $t = 8 > 7 = n$, but $n + p = 9$, so the conclusion $t \geq 9$ fails. + +**Fix**: Add the constraint `∀ B ∈ blocks, 2 ≤ B.card` to the definition, consistent with the definitions in `665.lean` and `732.lean`. The corrected definition would be: + +```lean +def IsPairwiseBalancedDesign {n : ℕ} (blocks : Finset (Finset (Fin n))) : Prop := + (∀ B ∈ blocks, 2 ≤ B.card) ∧ + (∀ x y : Fin n, x ≠ y → + ∃! B : Finset (Fin n), B ∈ blocks ∧ x ∈ B ∧ y ∈ B) +``` + +### Other correctness notes + +- The factoring of the prime power as `p = q ^ k` with `Nat.Prime q` and `k ≥ 1` is correct and equivalent to `IsPrimePow p` for natural numbers. +- The encoding of the ground set as `Fin n` is standard. +- The use of `Finset` for blocks (as opposed to `Multiset`) ensures no duplicate blocks, which is appropriate. +- The theorem is correctly marked as `solved` with `AMS 5` (combinatorics). + +## Summary + +| Criterion | Assessment | +|-----------|------------| +| Code reuse | Four duplicate PBD definitions; should unify | +| Citations | Mostly correct; missing Erdős–Sós attribution | +| Variants | Stronger bound and open question not captured | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | **Incorrect** — missing `2 ≤ |B|` constraint makes theorem false | diff --git a/ai-review/904.md b/ai-review/904.md new file mode 100644 index 0000000000..906a3082d2 --- /dev/null +++ b/ai-review/904.md @@ -0,0 +1,84 @@ +# Review: Erdos Problem 904 + +## 1. Code Reuse + +The formalization uses Mathlib's `SimpleGraph`, `SimpleGraph.Adj`, `SimpleGraph.degree`, and `SimpleGraph.edgeFinset` directly. The `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` module provides wrappers like `degree`, `maxDegree`, and `minDegree`, but these offer no advantage here — the direct Mathlib API is appropriate and idiomatic. + +No triangle-specific utilities exist in the codebase (the only "triangle" references are in geometry). The explicit encoding via three `G.Adj` conditions is the standard approach and requires no custom infrastructure. There is no existing clique infrastructure that would simplify the statement. + +**Verdict:** No code reuse opportunities. The formalization correctly uses Mathlib primitives directly. + +## 2. Citations + +**Website (erdosproblems.com/904):** +- References: [Er75], [Er82e] +- Notes: Conjecture attributed to Bollobás and Erdős. Edwards resolved it affirmatively in 1978 [Ed78]. + +**Formalization:** +- Module docstring cites: [Ed78] Edwards, C. S., *Recent results on the Bollobás-Erdős conjecture*. (1978) +- Theorem docstring: "Bollobás-Erdős conjecture (proved by Edwards [Ed78])" + +The original references [Er75] and [Er82e] from Erdős's own publications (where the conjecture was posed) are not included. The attribution to Bollobás-Erdős and the resolution by Edwards are correct. + +**Recommendation:** Consider adding [Er75] and [Er82e] to the module docstring for completeness, since these are the original sources where Erdős stated the problem. + +## 3. Variants + +The website lists no variants, alternative formulations, or related conjectures. The problem is a single, clean statement. No variants are missing. + +**Verdict:** Complete — no variants to capture. + +## 4. Readability + +The formalization is clean and readable: +- The namespace `Erdos904` is appropriate. +- The docstring clearly states the mathematical content with LaTeX. +- The theorem statement is concise and follows the standard pattern for graph-theoretic results on `Fin n`. +- The use of `(n : ℝ)` casts is necessary and handled cleanly. + +One minor observation: the triangle condition `G.Adj x y ∧ G.Adj y z ∧ G.Adj x z` is perfectly readable. An alternative would be to use `G.CliqueFree 3` or clique predicates from Mathlib, but the explicit form is arguably more transparent for this specific statement. + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem is precisely stated with no ambiguity: +- "graph with n vertices" → `SimpleGraph (Fin n)` +- "more than n²/4 edges" → strict inequality on edge count +- "contains a triangle on x, y, z" → existence of three mutually adjacent vertices +- "d(x) + d(y) + d(z) ≥ 3n/2" → degree sum bound + +Every component maps directly to a formal concept. The statement is fully formalizable with no interpretive choices required. + +**Verdict:** No ambiguity. Perfectly formalizable. + +## 6. Correctness + +The formalization is mathematically correct. + +**Triangle encoding:** The conditions `G.Adj x y ∧ G.Adj y z ∧ G.Adj x z` correctly encode a triangle. Distinctness of x, y, z is automatically enforced since `SimpleGraph.Adj` is irreflexive (`G.Adj x x = False`), so any two of x, y, z being equal would make the conjunction false. + +**Edge count hypothesis:** `(n : ℝ) ^ 2 / 4 < (G.edgeFinset.card : ℝ)` correctly captures "more than n²/4 edges." The use of ℝ for the comparison is necessary since n²/4 is not always an integer, and division in ℕ would floor the result (potentially weakening the hypothesis). This is handled correctly. + +**Degree sum conclusion:** `(G.degree x + G.degree y + G.degree z : ℝ) ≥ 3 / 2 * (n : ℝ)` correctly captures d(x) + d(y) + d(z) ≥ 3n/2. The addition is performed in ℕ first (since `G.degree` returns `ℕ`), then cast to ℝ for comparison with the non-integer bound 3n/2. The expression `3 / 2` in ℝ evaluates to `1.5`, which is correct. + +**Tightness check:** The Turán graph T(n,2) = K_{⌊n/2⌋, ⌈n/2⌉} has exactly ⌊n²/4⌋ edges and is triangle-free, confirming the edge threshold is meaningful. For even n, K_{n/2,n/2} has exactly n²/4 edges; adding any edge within a partition class creates a triangle where each vertex has degree ≥ n/2, giving sum ≥ 3n/2. This confirms the bound is tight. + +**Vacuous cases:** For n ≤ 2, no simple graph on Fin n can have more than n²/4 edges (at most 1 edge for n=2, and 4/4 = 1), so the hypothesis is vacuously false and the theorem holds trivially. This is fine. + +**Tags:** `[category research solved, AMS 5]` — the "solved" status matches the website (proved by Edwards 1978). AMS classification 5 (Combinatorics) is appropriate for a graph theory result. + +**Verdict:** The formalization is correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | No opportunities — appropriately uses Mathlib directly | +| Citations | Minor: original refs [Er75], [Er82e] could be added | +| Variants | Complete | +| Readability | Good | +| Formalizability | No ambiguity | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization with only a minor citation gap. diff --git a/ai-review/905.md b/ai-review/905.md new file mode 100644 index 0000000000..d64b4ad107 --- /dev/null +++ b/ai-review/905.md @@ -0,0 +1,77 @@ +# Review of Erdős Problem 905 + +## 1. Code Reuse + +**Issue found.** Problem 80 (`FormalConjectures/ErdosProblems/80.lean:45-47`) defines an identical helper: + +```lean +def bookSize {V : Type*} [Fintype V] [DecidableEq V] + (G : SimpleGraph V) [DecidableRel G.Adj] (u v : V) : ℕ := + ((G.neighborFinset u) ∩ (G.neighborFinset v)).card +``` + +Problem 905 inlines this same expression `(G.neighborFinset u ∩ G.neighborFinset v).card` directly in the theorem statement. The formalization could import and reuse `Erdos80.bookSize` (or a shared definition extracted to a utility file) instead of duplicating the logic. This would also improve clarity since `bookSize` is a well-known graph-theoretic concept (the "book size" at an edge). + +## 2. Citations + +**Incomplete.** The website (https://www.erdosproblems.com/905) lists the following references: + +- [Er75] +- [Er82e] +- [Er93, p.344] +- [KhNi79] — Hadziivanov and Nikiforov's proof + +The current formalization only includes a link to the website. It should document the specific references, especially [KhNi79] for the proof and [Er93, p.344] where Erdős discusses the problem. The docstring should also credit the provers: Edwards (unpublished) and Hadziivanov & Nikiforov [KhNi79]. + +## 3. Variants + +**Partially addressed.** The website identifies two related problems: + +- **Problem 80** (more general): Estimates the maximum "book size" $f_c(n)$ in graphs with $\geq cn^2$ edges where every edge lies in a triangle. Problem 905 is the special case $c = 1/4$ with the specific bound $n/6$. +- **Problem 1034** (stronger version, disproved): Asks whether a dense graph ($>n^2/4$ edges) contains a triangle whose vertices have $>(1/2 - \varepsilon)n$ vertices adjacent to at least two of them. + +The formalization does not mention these related problems. Adding cross-references in the docstring (as is done in other files in the codebase) would improve discoverability. + +## 4. Readability + +**Good overall.** The code is clean, concise, and well-structured. The inline docstring comment explaining that common neighbors correspond to triangles is helpful. Minor suggestions: + +- The expression `(G.neighborFinset u ∩ G.neighborFinset v).card` could be replaced with the named concept `bookSize` (from Problem 80 or a shared utility) for self-documentation. +- The module docstring could be slightly expanded to mention the provers and the solved status, as is done in `904.lean`. + +## 5. Formalizability + +**Fully formalizable; unambiguous.** The original statement — "every graph on $n$ vertices with $> n^2/4$ edges contains an edge in at least $n/6$ triangles" — is completely precise. There is no ambiguity in the terms: "graph" means simple undirected graph, "edge" and "triangle" have standard meanings, and the bounds $n^2/4$ and $n/6$ are explicit. The statement translates directly into Lean without any interpretive choices. + +## 6. Correctness + +**Two issues identified.** + +### 6a. Status is incorrect (critical) + +The formalization is tagged `@[category research open, AMS 5]`, but the problem is **solved**. The website explicitly states it was proved independently by Edwards (unpublished) and by Hadziivanov & Nikiforov [KhNi79]. The tag should be `@[category research solved, AMS 5]`, consistent with how Problem 904 handles the same situation. + +Since this is a proven theorem (not a conjecture), the formalization should not use the `answer(sorry)` wrapper — and indeed it doesn't, which is correct. But the `open` tag is misleading. + +### 6b. Mathematical correctness of the formalization + +The formalization is **mathematically correct**: + +- **Edge count threshold**: `(G.edgeFinset.card : ℝ) > (n : ℝ) ^ 2 / 4` correctly captures the strict inequality $> n^2/4$. Using `ℝ` for the comparison avoids integer division truncation issues (e.g., when $n$ is odd, $n^2/4$ is not an integer). +- **Triangle counting via common neighbors**: The quantity `(G.neighborFinset u ∩ G.neighborFinset v).card` correctly counts the number of vertices $w$ adjacent to both $u$ and $v$. Given that $G.Adj \, u \, v$ holds (i.e., $\{u, v\}$ is an edge), each such $w$ forms a triangle $\{u, v, w\}$. This is the standard way to count triangles through a given edge. +- **Bound**: `((G.neighborFinset u ∩ G.neighborFinset v).card : ℝ) ≥ (n : ℝ) / 6` correctly formalizes "$\geq n/6$ triangles." The use of $\geq$ (rather than $>$) for the triangle count is standard — the original problem says "at least $n/6$." +- **Vertex type**: Using `Fin n` for an $n$-vertex graph is the standard convention in this codebase and correctly models a labeled graph on $n$ vertices. +- **DecidableRel**: The `[DecidableRel G.Adj]` instance is needed for `edgeFinset` and `neighborFinset` computations and is appropriately included. + +No mathematical flaws detected. The formalization faithfully captures the intended conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could reuse `Erdos80.bookSize` | +| Citations | Missing [Er75], [Er82e], [Er93, p.344], [KhNi79] | +| Variants | Missing cross-references to Problems 80 and 1034 | +| Readability | Good; minor improvements possible | +| Formalizability | Fully formalizable, unambiguous | +| Correctness | Mathematically correct, but **status tag should be `solved` not `open`** | diff --git a/ai-review/907.md b/ai-review/907.md new file mode 100644 index 0000000000..74bfe712ec --- /dev/null +++ b/ai-review/907.md @@ -0,0 +1,73 @@ +# Review of Erdős Problem 907 + +## 1. Code Reuse + +The additivity predicate `∀ x y : ℝ, φ (x + y) = φ x + φ y` is expressed identically in both Problem 907 and the closely related Problem 908. No shared abstraction exists in the codebase (e.g., a predicate `IsAdditive` or use of Mathlib's `AddMonoidHom`). A common predicate could be factored out, but it is minor — the inline form is standard across the codebase and does not warrant refactoring unless many more problems use the same pattern. No relevant utilities in `FormalConjecturesForMathlib` apply here. + +**Verdict:** No actionable reuse opportunity. + +## 2. Citations + +The website lists the following references for Problem 907: + +- **[Er81b, p.31]** — missing from the formalization. +- **[Er82e]** — missing from the formalization. +- **[dB51]** — present in the formalization as: de Bruijn, N. G., *Functions whose differences belong to a given class*, Nieuw Arch. Wiskunde (2) 23 (1951), 194–218. + +The formalization should include the additional Erdős references [Er81b, p.31] and [Er82e] in the module docstring to match the website. + +Additionally, the website notes Problem 908 as a related problem. The formalization of 908 cross-references 907 (`See also [907]`), but the formalization of 907 does not cross-reference 908. A `See also [908]` note would improve discoverability. + +**Verdict:** Missing citations [Er81b, p.31] and [Er82e]. Missing cross-reference to Problem 908. + +## 3. Variants + +The website lists no variants beyond the main statement. Problem 908 is a strict generalization (replacing "continuous" differences with "measurable" differences and adding a third summand that is a.e. periodic). Problem 908 is already separately formalized. + +**Verdict:** All variants captured. No missing variant. + +## 4. Readability + +The code is clean and readable. The module docstring clearly states the problem and attributes the solution. The theorem statement is concise and follows the pattern used throughout the codebase. No improvements needed. + +**Verdict:** Good readability. + +## 5. Formalizability + +The problem is fully precise and straightforwardly formalizable: + +- The hypothesis "f(x+h) − f(x) is continuous for every h > 0" translates directly to `∀ h : ℝ, h > 0 → Continuous (fun x => f (x + h) - f x)`. +- The conclusion "f = g + φ where g is continuous and φ is additive" translates directly to the existential with the conjunction of `Continuous g`, the Cauchy functional equation for φ, and pointwise equality. + +There is **no ambiguity** in the problem statement. The only interpretive choice is whether "additive" means satisfying the Cauchy functional equation (as formalized) or being ℚ-linear (which is equivalent for functions ℝ → ℝ). The formalization uses the standard and correct interpretation. + +**Verdict:** Fully precise and unambiguously formalizable. Ambiguity: none. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. + +Detailed analysis: + +- **Hypothesis faithfulness:** The condition `h > 0` matches the original problem. Restricting to positive h is equivalent to requiring it for all h ≠ 0 (since the condition for h < 0 follows by substituting x ↦ x − h), so this is not a concern. +- **Additivity:** The Cauchy functional equation `φ(x + y) = φ(x) + φ(y)` is the correct notion of "additive function" in this context. Importantly, this does **not** require continuity or measurability of φ, which is exactly right — the whole point of de Bruijn's theorem is that the non-continuous part of f can be isolated into a purely additive (possibly discontinuous) function. +- **Decomposition:** The pointwise equality `∀ x, f x = g x + φ x` correctly captures the decomposition f = g + φ. +- **Answer wrapping:** `answer(True) ↔ ...` correctly encodes that the answer to the yes/no question is affirmative, consistent with de Bruijn's 1951 proof. +- **Tags:** `category research solved` and `AMS 26 39` (real functions, difference and functional equations) are appropriate. + +One could ask whether the existential should require some uniqueness or canonical choice of the decomposition, but the problem as stated on the website asks only for existence, and the formalization correctly captures this. + +**Verdict:** Correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No actionable opportunities | +| Citations | **Missing [Er81b, p.31], [Er82e], and cross-ref to 908** | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous, fully precise | +| Correctness | Correct and complete | + +**Overall:** The formalization is mathematically sound. The only actionable items are the missing bibliographic references and a cross-reference to Problem 908. diff --git a/ai-review/908.md b/ai-review/908.md new file mode 100644 index 0000000000..4538a6babb --- /dev/null +++ b/ai-review/908.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 908 + +## 1. Code Reuse + +**Problem 907** (`FormalConjectures/ErdosProblems/907.lean`) is the direct predecessor and uses an almost identical pattern. Problem 907 asks: if differences `f(x+h) - f(x)` are *continuous* for all `h > 0`, must `f = g + φ` (continuous + additive)? Problem 908 weakens "continuous" to "measurable" and adds a third almost-periodic remainder component `r`. The two files share structural patterns (additive function encoding, decomposition style) but 908 cannot directly reuse 907's statement since it has a strictly richer decomposition. + +**Problem 1126** (`FormalConjectures/ErdosProblems/1126.lean`) deals with ae-additive functions and uses the same `∀ᵐ x ∂volume` pattern alongside additive function encoding `∀ x y, g (x + y) = g x + g y`. No code is directly extractable as a shared definition, but the patterns are consistent. + +No utilities in `FormalConjecturesForMathlib/` are directly applicable. The additive function characterization `∀ x y : ℝ, φ (x + y) = φ x + φ y` is used inline in problems 907, 908, and 1126. A shared `IsAdditive` predicate could reduce duplication across these three problems, but this is a minor stylistic point. + +**Verdict:** No significant reuse opportunities missed. + +## 2. Citations + +The website ([erdosproblems.com/908](https://www.erdosproblems.com/908)) lists the following original sources: +- **Er81b**, p. 31 +- **Er82e** + +The formalization cites: +- **[La80]** Laczkovich, M., *Functions with measurable differences*, 1980. + +The solver citation (Laczkovich) is present and correct. However, the **original problem source citations** (Er81b, Er82e) from the website are missing from the docstring. These should be added for completeness, e.g.: + +``` +[Er81b] Erdős, P., p. 31. +[Er82e] Erdős, P. +``` + +**Verdict:** Solver citation correct; original source citations missing. + +## 3. Variants + +The website lists Problem 907 as the only related problem, and the formalization's docstring references it ("See also [907]"). No other variants are mentioned on the website. + +**Verdict:** All variants captured. + +## 4. Readability + +The code is clean, well-structured, and follows the same conventions as Problem 907. The docstring clearly states the mathematical problem in LaTeX. The namespace `Erdos908` is appropriate. The use of `φ` for the additive function and `r` for the remainder is standard and matches the problem statement. + +One minor note: the docstring says "r(x + h) - r(x) = 0 for every h and almost all (depending on h) x" without restricting to h > 0, while the formalization restricts to h > 0. This is mathematically equivalent (see §6) but could cause momentary confusion. Consider adding a parenthetical in the docstring noting that h > 0 suffices. + +**Verdict:** Good readability, minor docstring alignment suggestion. + +## 5. Formalizability + +The problem is precise and clearly formalizable. All components have unambiguous mathematical meaning: +- "Measurable" difference functions — standard notion. +- "Continuous" — standard. +- "Additive" (Cauchy functional equation) — precisely captured by `φ(x+y) = φ(x) + φ(y)`. +- "Almost all x depending on h" — precisely captured by the ae quantifier `∀ᵐ x ∂volume` nested inside `∀ h`. + +The only minor ambiguity is whether "measurable" means Borel measurable or Lebesgue measurable (see §6). + +**Verdict:** Low ambiguity; clearly formalizable. + +## 6. Correctness + +The formalization is **largely correct** with one subtle technical issue: + +### Correct aspects: +- **Decomposition structure** `f = g + φ + r` is faithfully captured. +- **Additive function** `∀ x y : ℝ, φ (x + y) = φ x + φ y` is the standard Cauchy functional equation — correct. +- **Almost-periodic remainder** `∀ h : ℝ, h > 0 → ∀ᵐ x ∂volume, r (x + h) - r x = 0` correctly encodes "r(x+h) = r(x) for a.e. x (depending on h)" with the ae null set allowed to depend on h (since the `∀ᵐ` is inside the `∀ h`). +- **Restriction to h > 0** is correct for both the hypothesis and the conclusion. For the hypothesis, it matches the problem. For the conclusion on `r`: if `r(x+h) - r(x) = 0` a.e. for all h > 0, then by the substitution y = x - h and translation-invariance of Lebesgue measure, the same holds for h < 0; and h = 0 is trivial. +- **`answer(True)`** correctly encodes that the answer is affirmative (proved by Laczkovich). + +### Technical issue — Borel vs. Lebesgue measurability: +In Mathlib, `Measurable` on `ℝ` means Borel measurable (since `MeasurableSpace ℝ := borel ℝ`). The original problem almost certainly refers to **Lebesgue measurability**, which is a strictly weaker assumption. The formalization's hypothesis `Measurable (fun x => f (x + h) - f x)` is therefore **stronger than intended** — it assumes the differences are Borel measurable rather than merely Lebesgue measurable. This means the formalized theorem is technically weaker than Laczkovich's result (it applies to fewer functions). + +The correct formalization would use `AEStronglyMeasurable (fun x => f (x + h) - f x) volume` or work with the completion of the Borel σ-algebra. However, this discrepancy is **extremely common** in Lean formalizations of measure-theoretic results and is arguably acceptable given the practical difficulty of working with Lebesgue measurability in Mathlib. + +**Verdict:** Mathematically faithful modulo the standard Borel-vs-Lebesgue approximation. No structural errors. An experienced analyst would flag the measurability issue but recognize it as a standard formalization compromise. diff --git a/ai-review/909.md b/ai-review/909.md new file mode 100644 index 0000000000..2b08b49e2b --- /dev/null +++ b/ai-review/909.md @@ -0,0 +1,98 @@ +# Review: Erdos Problem 909 + +## 1. Code Reuse + +No covering dimension or topological dimension infrastructure exists anywhere in the codebase or in Mathlib. A search for `coveringDim`, `covering_dim`, `CoveringDim`, `topological_dimension`, and `dimLE` across the entire repository found only the definitions in this file. The `FormalConjecturesForMathlib` directory contains nothing related to dimension theory of topological spaces. + +The local definitions of `coveringDimLE` and `hasCoveringDim` are therefore necessary and appropriate. + +**Verdict:** No code reuse opportunities. Custom definitions are required. + +## 2. Citations + +**Website (erdosproblems.com/909):** +- Original reference: [Er82e] +- Solution: [AnKe67] — Anderson, R. D. and Keisler, J. E. (1967) +- Notes: "The space of rational points in Hilbert space has this property for n=1." Anderson and Keisler extended to general n ≥ 2. + +**Formalization:** +- Module docstring cites: [AnKe67] Anderson, R. D. and Keisler, J. E., *An example in dimension theory*, 1967. +- The original Erdős reference [Er82e] is not included. + +**Recommendation:** Add [Er82e] to the module docstring for completeness, as it is the original source where Erdős posed the problem. + +## 3. Variants + +The website notes that "the space of rational points in Hilbert space has this property for n=1." This is a known result predating Anderson-Keisler and provides context for the problem. However, the problem itself specifically asks about n ≥ 2, so this is background rather than a variant. + +No other variants or related problems are listed on the website. + +**Verdict:** Complete — the n ≥ 2 statement matches the problem as posed. The n = 1 remark is supplementary context, not a variant requiring separate formalization. + +## 4. Readability + +The formalization is well-structured and readable: + +- The namespace `Erdos909` is appropriate. +- `coveringDimLE` has a clear docstring explaining the definition in mathematical terms. +- `hasCoveringDim` is defined cleanly as the conjunction of an upper bound and the negation of all strictly lower bounds. +- The theorem statement is concise and follows the standard `answer(True) ↔ ...` pattern. +- `open TopologicalSpace Set Classical` is appropriate — `Classical` is needed for the `Decidable` instances used in `Finset.filter`, `Set` and `TopologicalSpace` for the relevant notation. + +One minor note: the refinement condition `(∀ k, ∃ i, V k ⊆ U i)` reads clearly as "each V_k refines some U_i." The order condition via `Finset.univ.filter` is slightly verbose but is the idiomatic Lean way to express "the number of sets containing x." + +**Verdict:** Good readability. No changes needed. + +## 5. Formalizability + +The problem is precisely stated and fully formalizable: + +- "Covering dimension n" is a standard, well-defined concept in general topology (Lebesgue covering dimension). +- "S²" (product of a space with itself) has a canonical topological space structure (the product topology). +- The quantifier "for every n ≥ 2" is unambiguous. +- The existential "is there a space S" is clear. + +The only interpretive choice is which notion of "dimension" is intended. In the context of Erdős's dimension theory problems and the Anderson-Keisler paper, Lebesgue covering dimension is the standard and correct interpretation. + +**Verdict:** No ambiguity. Perfectly formalizable. + +## 6. Correctness + +The formalization is mathematically correct. + +**Definition of `coveringDimLE`:** This correctly encodes the standard definition of Lebesgue covering dimension ≤ n: +- Quantifies over all finite open covers (via `[Fintype ι]` and the open/covering conditions). +- Requires the existence of a finite open refinement (`Fintype κ`, open sets, covering the whole space). +- Each refinement set refines some original set (`∀ k, ∃ i, V k ⊆ U i`). +- The order condition: every point belongs to at most n+1 sets of the refinement (`Finset.univ.filter (fun k => x ∈ V k)).card ≤ n + 1`). + +This matches the standard definition precisely. + +**Definition of `hasCoveringDim`:** Correctly encodes "dimension exactly n" as: dimension ≤ n, and for all m < n, dimension is NOT ≤ m. This is equivalent to saying n is the minimum value for which `coveringDimLE` holds. + +**Product topology:** `S × S` inherits the product topology from Lean/Mathlib's `instTopologicalSpaceProd` instance. This is the correct topology for the problem. + +**`answer(True)`:** The website confirms the problem was proved affirmatively by Anderson and Keisler [AnKe67]. The `True` answer is correct. + +**Universe considerations:** The existential `∃ (S : Type)` lives in `Type 0`. The Anderson-Keisler construction produces concrete separable metrizable spaces, which can be encoded in `Type 0`. This is not a restriction. + +**Edge case — empty spaces:** For the empty type, `coveringDimLE X n` holds for all n (vacuously), so `hasCoveringDim Empty n` is false for all n ≥ 1. This correctly reflects the convention that empty spaces have dimension −1 (not representable in ℕ), and poses no issue since the theorem requires n ≥ 2. + +**Mathematical context check:** The classical inequality dim(X × Y) ≤ dim(X) + dim(Y) means dim(S × S) ≤ 2n. The non-trivial content is that dim(S × S) can equal n (rather than being strictly larger), which Anderson and Keisler demonstrated. The formalization correctly captures this. + +**Tags:** `[category research solved, AMS 54]` — "solved" matches the website (proved by Anderson-Keisler 1967). AMS 54 is "General topology," which is the correct classification for a covering dimension result. + +**Verdict:** The formalization is correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | No opportunities — custom definitions required (none in Mathlib) | +| Citations | Minor: original ref [Er82e] should be added | +| Variants | Complete | +| Readability | Good | +| Formalizability | No ambiguity | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization with only a minor citation gap. The covering dimension definitions are mathematically sound and faithfully capture the standard Lebesgue covering dimension. The theorem statement correctly encodes the problem and its affirmative resolution. diff --git a/ai-review/91.md b/ai-review/91.md new file mode 100644 index 0000000000..9eb6a7045b --- /dev/null +++ b/ai-review/91.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 91 + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`distinctDistances` from `FormalConjecturesForMathlib/Geometry/2d.lean`** (line 194): This is functionally equivalent to the locally-defined `numDistinctDistances` in Problem 91. The library version uses `Finset.offDiag` (which directly gives pairs with distinct components) instead of filtering the full product `A ×ˢ A` with `pq.1 ≠ pq.2`. The `offDiag` approach is cleaner and more idiomatic. Problem 89 already imports and uses this shared definition via `open EuclideanGeometry`. + +- **Recommendation:** Replace `numDistinctDistances` with `EuclideanGeometry.distinctDistances`. Note a type difference: Problem 91 uses `EuclideanSpace ℝ (Fin 2)` while the library definition uses `ℝ²` (which is `Fin 2 → ℝ`). These are defeq via `EuclideanSpace`, so this should be compatible, but should be verified. + +- **`AreSimilar`** has no existing counterpart in the shared library. This definition is problem-specific and reasonable to keep local, though it could be promoted to the shared library if other problems need geometric similarity. + +## 2. Citations + +**Website (erdosproblems.com/91) states:** + +- [Er87b, p.171] — Erdős, P., *Some combinatorial, probabilistic and number theoretic problems* (1987) +- [Er90] — Erdős, P. (1990) +- [Er97e] — Erdős, P. (1997) +- [Ko24c] — Kovács (2024) + +**Formalization docstring states:** +- [Er87b] with attribution and page reference ✓ +- [Er90] ✓ +- [Er97e] ✓ +- [Ko24c] with "Kovács, (2024)" ✓ + +**Issues:** The website spells the author as "Kovacs" (no accent) while the formalization uses "Kovács" (with accent). The accent is likely more correct for a Hungarian name, so this is arguably an improvement, but it does not match the website's rendering. Minor discrepancy only. + +## 3. Variants + +**The website mentions several specific cases:** +- n=3: equilateral triangle is the unique minimizer +- n=4: square and two-equilateral-triangle configuration give two non-similar minimizers +- n=5: regular pentagon is unique minimizer (proven by Kovács [Ko24c]) +- n=6–9: Erdős states at least two non-similar minimizers exist + +**None of these small-case variants are formalized.** The formalization captures only the main asymptotic conjecture ("for sufficiently large n"). Notable missing variants include: + +1. **The n=5 uniqueness result** (solved by Kovács): The regular pentagon is the unique minimizer for 5 points. This is a proven result and could be stated as a `solved` variant. +2. **Small-case existence results** for n ∈ {4, 6, 7, 8, 9}: These are known to have multiple non-similar minimizers. +3. **The stronger conjecture** mentioned on the website: Erdős says "at least two (and probably many)" — the parenthetical "probably many" suggests a stronger variant asking for the number of non-similar minimizers to grow with n. This is not captured. + +## 4. Readability + +**Generally good, with minor suggestions:** + +- The `numDistinctDistances` definition is clear but could be simplified by using `offDiag` instead of the filter pattern (see Code Reuse above). +- The `AreSimilar` definition correctly captures geometric similarity (scaling + distance-preserving map), though the name could be more specific (e.g., `AreGeometricallySimilar`) to distinguish from other notions of similarity. This is a minor style point. +- The docstring on `erdos_91` is well-written and accurately summarizes the conjecture. +- The `answer(sorry)` wrapper correctly indicates this is an open problem where even the truth value is unknown. + +## 5. Formalizability + +**Assessment: Moderately high precision, with one subtle ambiguity.** + +The problem statement on the website is: + +> "Suppose A ⊂ ℝ² has |A|=n and minimises the number of distinct distances between points in A. Prove that there are at least two (and probably many) such A which are non-similar." + +**Ambiguity analysis:** + +- **"minimises the number of distinct distances"** — This is well-defined: among all n-point subsets of ℝ², A achieves the minimum number of distinct pairwise distances. The formalization correctly captures this. +- **"sufficiently large"** — Formalized as `∃ N, ∀ n ≥ N`, which is standard. ✓ +- **"non-similar"** — The formalization defines similarity via a map f with a positive scaling factor r. This is a standard definition of geometric similarity. ✓ +- **"at least two ... such A which are non-similar"** — The informal statement asks for the *existence* of at least two non-similar minimizers. The formalization asks: for every minimizer A, there exists another minimizer A' not similar to A. These are logically equivalent (if all minimizers are mutually similar, pick any one; if not, any minimizer either has a non-similar companion or is itself the "other" one). ✓ + +**One subtlety:** The formalization wraps the statement in `answer(sorry) ↔ ...`, meaning the truth value is unknown. This is appropriate for an open problem. The `↔` formulation means a proof would need to establish either the statement or its negation. This is correct. + +**Overall:** The problem is precise enough to be unambiguously formalizable. The main mathematical content (minimizing distinct distances, geometric similarity) has clear formal definitions. + +## 6. Correctness + +**The formalization is mathematically correct with one potential concern:** + +### AreSimilar definition (lines 51–56) + +The definition requires: +1. A map f with scaling factor r > 0 +2. `dist (f x) (f y) = r * dist x y` for all x, y (not just those in A) +3. f maps A into B (forward direction) +4. Every element of B has a preimage in A (surjectivity onto B) + +**Analysis:** +- Conditions (3) and (4) together with the injectivity implied by condition (2) (since r > 0, if f(a₁) = f(a₂) then dist(a₁,a₂) = 0 so a₁ = a₂) correctly establish a bijection between A and B. +- Condition (2) requiring the distance-scaling property for *all* x, y (not just elements of A) is stronger than necessary but not incorrect — it simply restricts to similarities that extend to the whole plane, which is the standard geometric notion. +- The definition correctly captures geometric similarity (scaling + isometry up to scale). It allows reflections and rotations, which is appropriate. + +**Correctness verdict:** ✓ The formalization is correct. + +### Main theorem (lines 64–76) + +The logical structure is: +``` +∃ N, ∀ n ≥ N, ∀ A with |A|=n and A is a minimizer, + ∃ A' with |A'|=n, A' is a minimizer, and ¬ AreSimilar A A' +``` + +This correctly formalizes: "for large enough n, every minimizer admits a non-similar minimizer." This is equivalent to the informal statement that there are at least two non-similar minimizers for large n. + +**One minor concern:** `AreSimilar` is not symmetric as defined — it requires a map from A to B. However, this does not affect correctness of the conjecture: if A and A' are similar via some map, they are similar in the usual geometric sense. The `¬ AreSimilar A A'` negation says no such forward map exists from A to A'. Since geometric similarity is symmetric (if f witnesses A ~ B, then f⁻¹ witnesses B ~ A), and the definition's conditions (3)+(4) establish a bijection, `AreSimilar A B` implies `AreSimilar B A` (using f⁻¹ with scaling factor 1/r). So the asymmetry is only superficial. + +**Overall correctness: Sound.** The formalization correctly captures Erdős Problem 91. No mathematical errors detected. The only actionable suggestion is to reuse the shared `distinctDistances` definition for consistency with Problems 89, 93, and 95. diff --git a/ai-review/910.md b/ai-review/910.md new file mode 100644 index 0000000000..998ecd7d16 --- /dev/null +++ b/ai-review/910.md @@ -0,0 +1,127 @@ +# Review: Erdos Problem 910 + +**File:** `FormalConjectures/ErdosProblems/910.lean` + +--- + +## 1. Code Reuse + +**No reuse opportunities identified.** + +Problem 910 is a point-set topology problem about connected subsets of Euclidean space. It uses standard Mathlib types and predicates (`EuclideanSpace`, `IsConnected`, `Homeomorph`, `Set.Nontrivial`, `Cardinal.continuum`), none of which are defined in `FormalConjecturesForMathlib/`. + +The only topology-related utility in `FormalConjecturesForMathlib/` is `Topology/Discrete.lean`, which provides a `Homeomorph.OfDiscrete` construction for discrete spaces — irrelevant here, since connected subsets of Euclidean space are generally not discrete. + +No other Erdős problems in the codebase deal with connected subsets of ℝⁿ or counting connected subsets by cardinality, so there is no cross-problem code sharing opportunity. + +--- + +## 2. Citations + +**Comparison with [erdosproblems.com/910](https://www.erdosproblems.com/910):** + +The website lists: +- **Status:** Solved (disproved). +- **Tags:** Topology. +- **References:** [Er82e] (original Erdős source), [Ru58] (Rudin's disproof). + +| Citation | In formalization | On website | Assessment | +|----------|-----------------|------------|------------| +| Rudin 1958 | `[Ru58]` with full bibliographic data | `[Ru58]` | ✓ OK. Full citation provided: "Rudin, M. E., _A connected subset of the plane_, Fund. Math. 46 (1958), 15-24." | +| Erdős 1982 | Not cited | `[Er82e]` | **Missing.** The website lists [Er82e] as the original Erdős source for this problem. The formalization should include this reference for completeness, even if the full bibliographic details are not readily available. | + +**Recommendation:** Add a citation for [Er82e] to the module docstring. If the full bibliographic data cannot be determined, at minimum note the reference tag. + +--- + +## 3. Variants + +**Both parts of the problem are formalized as separate theorems.** This is good — the problem as stated on the website consists of two distinct questions, and the formalization captures both: + +1. `erdos_910` — Part 1: existence of a non-trivial non-homeomorphic connected subset. +2. `erdos_910.variants.part2` — Part 2: more than continuum-many connected subsets for n ≥ 2. + +**No missing variants.** The website does not list additional sub-questions or quantitative refinements. The two-part structure is faithful to the original. + +**Possible enhancement:** One could formalize the specific counterexample — Rudin's construction in ℝ² (conditional on CH) — as an explicit existential witness. However, this would be a formalization of the proof rather than the problem statement, so its omission is reasonable. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Namespace usage:** `Erdos910` namespace is appropriate. +- **Docstrings:** Both theorems have clear docstrings that describe the mathematical content and attribute the disproof. The module docstring provides historical context. +- **`open` declarations:** `open Set Cardinal Topology` is minimal and appropriate. +- **Structure:** The two-part split with `erdos_910` and `erdos_910.variants.part2` clearly delineates the two questions. + +**Minor suggestion:** The docstring for Part 2 could mention that the answer is "no" conditional on the continuum hypothesis, to match the module-level docstring which includes this qualifier. + +Overall readability is excellent. + +--- + +## 5. Formalizability + +**Assessment: Mostly unambiguous, with one notable meta-mathematical subtlety.** + +Both questions are precisely stated in terms of standard topological concepts (connected set, homeomorphism, cardinality). There is no ambiguity in the definitions. + +**Subtlety — the continuum hypothesis:** Rudin's counterexample is constructed under the assumption of CH. The module docstring correctly notes this ("conditional on the continuum hypothesis"), but the formal statements do not include CH as a hypothesis. This means: + +- In Lean's type theory (which is consistent with CH being either true or false), proving `answer(False)` for Part 2 would require assuming CH (or finding a ZFC-only proof, which to the best of knowledge does not exist). +- For Part 1, the situation is similar — Rudin's counterexample requires CH. + +This is a genuine formalizability concern: the `sorry`-ed proofs would need to import or assume CH. However, as a statement of the *problem* (rather than a proof), the formalization is reasonable — it captures what Erdős asked, and the `answer(False)` annotation correctly reflects the mathematical consensus. + +**Ambiguity level: Low.** The mathematical content is precise. The only subtlety is the set-theoretic dependency on CH, which is a meta-mathematical concern rather than an ambiguity in the problem statement itself. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Part 1: `erdos_910` + +```lean +theorem erdos_910 : answer(False) ↔ + ∀ (n : ℕ), n ≥ 1 → + ∀ (S : Set (EuclideanSpace ℝ (Fin n))), + IsConnected S → + ∃ (T : Set (EuclideanSpace ℝ (Fin n))), + T ⊆ S ∧ IsConnected T ∧ T.Nontrivial ∧ + IsEmpty (Homeomorph T S) +``` + +- **Universal quantifier over n ≥ 1:** Erdős asks about "connected sets in ℝⁿ" without restricting n. The formalization uses `∀ n ≥ 1`, which is correct (ℝ⁰ is a single point and has no non-trivial connected subsets, so n ≥ 1 is the natural domain). Rudin's counterexample lives in ℝ², so the universally quantified statement is indeed false. ✓ +- **`IsConnected S`:** Uses Mathlib's standard connectedness predicate for subsets of a topological space. This implies `S.Nonempty`. ✓ +- **`T ⊆ S`:** T is a subset of the ambient Euclidean space with T ⊆ S, so T is a subset of S. ✓ +- **`IsConnected T`:** Correct — we want T to be connected (in the subspace topology inherited from ℝⁿ). ✓ +- **`T.Nontrivial`:** `Set.Nontrivial` means T contains at least 2 distinct points, which is the correct formalization of "not a single point" (given that T is nonempty, which follows from `IsConnected T`). ✓ +- **`IsEmpty (Homeomorph T S)`:** Asserts there is no homeomorphism between T and S, both viewed as subspaces of ℝⁿ. This correctly captures "not homeomorphic to the original set." ✓ +- **`answer(False)`:** The answer to Erdős's question is "no" — not every connected set has such a subset. Rudin constructed a connected subset of ℝ² (under CH) such that every connected subset with ≥ 2 points is homeomorphic to the whole set. So the universal statement P is false, and `answer(False) ↔ P` correctly asserts this. ✓ + +### Part 2: `erdos_910.variants.part2` + +```lean +theorem erdos_910.variants.part2 : answer(False) ↔ + ∀ (n : ℕ), n ≥ 2 → + ∀ (S : Set (EuclideanSpace ℝ (Fin n))), + IsConnected S → + Cardinal.continuum < #{T : Set (EuclideanSpace ℝ (Fin n)) // T ⊆ S ∧ IsConnected T} +``` + +- **`n ≥ 2`:** Matches the original problem which specifies "if n ≥ 2." ✓ +- **`Cardinal.continuum < #{ ... }`:** The question asks whether the number of connected subsets exceeds 2^{ℵ₀}. `Cardinal.continuum` is defined as 2^{ℵ₀} in Mathlib. The strict inequality `<` correctly captures "more than 2^{ℵ₀}." ✓ +- **Subtype `{T : Set (...) // T ⊆ S ∧ IsConnected T}`:** Counts the number of connected subsets of S by taking the cardinality of the subtype. This is the correct way to count subsets satisfying a property in Lean. ✓ +- **`answer(False)`:** Rudin's set (under CH) has exactly continuum-many connected subsets, so the strict inequality fails. The answer is indeed "no." ✓ + +### Potential concern: role of the continuum hypothesis + +As discussed in §5, Rudin's result is conditional on CH. Without CH, the cardinality argument in Part 2 might not go through (e.g., under ¬CH, it is conceivable that 2^{ℵ₀} > ℵ₁ and the counting argument changes). For Part 1, the counterexample construction itself uses CH. The formalization does not reflect this dependency. + +However, since Lean/Mathlib does not take a stance on CH (it is independent of the axioms), and the problem is conventionally regarded as solved, this is acceptable for a problem-statement formalization. A future proof would need to introduce CH as an axiom or hypothesis. + +**Verdict: Correct and complete.** The formalization faithfully captures both parts of Erdős Problem 910. The logical structure, use of Mathlib types, and `answer(False)` annotations are all mathematically sound. The only caveat is the implicit dependency on CH for the disproof, which is noted in the docstring but not in the formal statement — a reasonable choice for a problem formalization as opposed to a proof formalization. diff --git a/ai-review/911.md b/ai-review/911.md new file mode 100644 index 0000000000..63604e569b --- /dev/null +++ b/ai-review/911.md @@ -0,0 +1,95 @@ +# AI Review: Erdős Problem 911 + +## Summary + +**Problem:** Is there a function $f$ with $f(x)/x \to \infty$ such that, for all sufficiently large $C$, every graph $G$ with $n$ vertices and at least $Cn$ edges satisfies $\hat{R}(G) > f(C) \cdot |E(G)|$? + +**Status on website:** Open. + +**File:** `FormalConjectures/ErdosProblems/911.lean` + +--- + +## 1. Code Reuse + +**There is a significant code reuse opportunity.** + +The file defines its own `sizeRamseyNumber` (lines 44–53), but an existing library definition `SimpleGraph.sizeRamsey` already exists at `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean`. The library version defines the asymmetric size Ramsey number `r̂(G, H)` using `SimpleGraph.IsContained` from Mathlib and subgraph-based 2-colorings (`R ≤ F` for red, `F \ R` for blue). The diagonal case `sizeRamsey G G` is mathematically equivalent to the `sizeRamseyNumber G` defined in 911.lean. + +Key differences between the two definitions: +- **Coloring representation:** The library uses a subgraph `R ≤ F` to represent a 2-coloring; the 911 definition uses an explicit symmetric Bool-valued function `c : Fin N → Fin N → Bool`. +- **Copy notion:** The library uses `IsContained` (existence of a graph isomorphism onto a subgraph); the 911 definition manually specifies an injective map preserving adjacency and color. +- **Edge counting:** The library uses `Set.ncard`; the 911 definition uses `Nat.card`. + +These are mathematically equivalent. **Recommendation:** Replace `Erdos911.sizeRamseyNumber G` with `SimpleGraph.sizeRamsey G G` from the library. This would require importing `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/SizeRamsey.lean` and reconciling the `ncard` vs `Nat.card` difference (both compute the same value on finite sets). + +## 2. Citations + +**The citation is adequate but could be improved.** + +The formalization states: +> `[Er82e] Erdős, P., _Problems and results in graph theory_. (1982), p. 78.` + +The website (erdosproblems.com/911) lists the source as `[Er82e, p.78]` and provides the canonical citation: +> T. F. Bloom, Erdős Problem #911, https://www.erdosproblems.com/911 + +The reference `[Er82e]` is consistent with the website. No additional references are listed on the website for this problem. The citation is correct. + +## 3. Variants + +**No variants are missing.** + +The website presents a single formulation of this problem with no noted variants, partial results, or related conjectures beyond the neighboring problems (910, 912). The formalization captures the full problem as stated. + +## 4. Readability + +**Readability is good overall, with one suggestion.** + +- The `sizeRamseyNumber` definition has a clear docstring explaining the concept. +- The main theorem `erdos_911` has well-structured comments separating the growth condition from the quantified bound. +- **Suggestion:** If the custom `sizeRamseyNumber` is retained (rather than reusing the library), the docstring could note that this is the diagonal size Ramsey number $\hat{R}(G) = \hat{R}(G, G)$ to explicitly connect it to the standard two-argument version in the literature and in the library. + +## 5. Formalizability + +**The problem is clearly formalizable with low ambiguity.** + +The statement on erdosproblems.com is precise: +- "Size Ramsey number" $\hat{R}(G)$ is a standard, well-defined concept in combinatorics. +- The growth condition $f(x)/x \to \infty$ is unambiguous. +- The quantifier structure (∃f, ∃C₀, ∀C ≥ C₀, ∀G with ≥ Cn edges, ...) is clear. +- The only mild ambiguity is whether $f$ maps reals to reals or integers to integers; the formalization uses ℕ → ℕ, which is a natural and equivalent choice (any real-valued witness can be replaced by $\lfloor f \rfloor$ without affecting the asymptotic growth or the strict inequality). + +**Ambiguity level: Very low.** The problem is a clean yes/no question wrapped in `answer(sorry)`, which is appropriate. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +1. **Size Ramsey number definition (lines 44–53):** The definition correctly captures $\hat{R}(G)$ as an infimum over edge counts of graphs $H$ that are Ramsey for $G$. The coloring `c : Fin N → Fin N → Bool` with symmetry `c i j = c j i` is applied to all vertex pairs (not just edges of $H$), but this is equivalent to coloring only edges because the monochromatic copy condition (`G.Adj u v → H.Adj (f u) (f v)` and `G.Adj u v → c (f u) (f v) = b`) only inspects `c` at pairs that are edges of $H$. Any edge-coloring extends to a pair-coloring and vice versa, so the universal quantification is equivalent. + +2. **Growth condition (line 68):** `∀ M : ℕ, ∃ x₀ : ℕ, ∀ x : ℕ, x ≥ x₀ → f x ≥ M * x` correctly formalizes $f(x)/x \to \infty$ for ℕ-valued functions. This is the standard epsilon-delta formulation adapted to natural numbers. + +3. **Edge density condition (line 72):** `Nat.card G.edgeSet ≥ C * n` correctly captures "$G$ has at least $Cn$ edges." + +4. **Main bound (line 73):** `sizeRamseyNumber G > f C * Nat.card G.edgeSet` correctly states $\hat{R}(G) > f(C) \cdot |E(G)|$. + +5. **Quantifier structure:** The formalization uses `∃ f, (growth) ∧ ∃ C₀, ∀ C ≥ C₀, ∀ n, ∀ G, (density) → (bound)`, which faithfully matches the English statement "Is there a function $f$ with [growth] such that for all large $C$, if $G$ has $n$ vertices and $\geq Cn$ edges then [bound]?" + +6. **Edge case behavior:** When $n = 0$, the graph is empty, the edge count condition `0 ≥ C * 0` is trivially true, and the bound becomes `sizeRamseyNumber ⊥ > f C * 0 = 0`. The size Ramsey number of the empty graph is 0 (any graph with 0 edges works), so the bound `0 > 0` is false. This means the statement is vacuously asking for $C₀ > 0$ or handling the $n=0$ case. Since the quantifier allows choosing $C₀$ after $f$, this is not a problem in practice — for any reasonable $f$, the bound holds for graphs with positive edge count. However, one could argue that the original problem implicitly restricts to graphs with $n \geq 1$ or $e \geq 1$. **This is a very minor edge-case concern that does not affect the mathematical substance.** + +**Verdict: Correct and complete.** No experienced mathematician would identify substantive flaws. The formalization faithfully represents the problem. + +--- + +## Overall Assessment + +| Category | Rating | +|---|---| +| Code reuse | **Could improve** — should use `SimpleGraph.sizeRamsey G G` from the library | +| Citations | **Good** — matches the website | +| Variants | **Complete** — no missing variants | +| Readability | **Good** — clear structure and comments | +| Formalizability | **Very low ambiguity** — clean, precise problem | +| Correctness | **Correct** — faithful formalization | diff --git a/ai-review/914.md b/ai-review/914.md new file mode 100644 index 0000000000..9cf3ff2c83 --- /dev/null +++ b/ai-review/914.md @@ -0,0 +1,105 @@ +# AI Review: Erdős Problem 914 + +## Summary + +Erdős Problem 914 is the **Hajnal–Szemerédi theorem**: for $r \geq 2$ and $m \geq 1$, every graph on $rm$ vertices with minimum degree at least $m(r-1)$ contains $m$ vertex-disjoint copies of $K_r$. The problem is marked **PROVED** on erdosproblems.com. The formalization is clean, mathematically correct, and captures the full generality of the theorem. + +--- + +## 1. Code Reuse + +No existing definitions in `FormalConjecturesForMathlib/` directly address vertex-disjoint clique tilings or the Hajnal–Szemerédi theorem. The most relevant existing infrastructure: + +- **`SimpleGraph.IsClique`** (from Mathlib, used in the formalization) — correctly used. +- **`ecliqueNum`** in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` — defines extended clique number but is not directly applicable here. +- **`InternallyDisjoint`** in the same file — applies to walks, not subgraph copies. + +The formalization's approach of using `Fin m → Finset (Fin (r * m))` with cardinality, clique, and disjointness constraints is a natural and self-contained encoding. There is no existing utility in the codebase that would simplify this, and no code duplication concern. + +**Verdict:** No reuse opportunities identified. The formalization is appropriately self-contained. + +--- + +## 2. Citations + +**Website (erdosproblems.com/914) lists:** +- **[Er67b]** — Erdős's original formulation +- **[CoHa63]** — Corrádi and Hajnal (1963), proved the $r = 3$ case +- **[HaSz70]** — Hajnal and Szemerédi (1970), proved the general case + +**Formalization includes:** +- **[HaSz70]** — Full citation: "Hajnal, A. and Szemerédi, E., *Proof of a conjecture of P. Erdős*. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfüred, 1969) (1970), 601-623." + +**Missing from formalization:** +- **[Er67b]** — The original Erdős reference where the conjecture was posed. Should be included for completeness. +- **[CoHa63]** — Corrádi, K. and Hajnal, A., *On the maximal number of independent circuits in a graph*. Acta Math. Acad. Sci. Hungar. 14 (1963), 423–439. The docstring mentions Corrádi and Hajnal proved the $r=3$ case but does not give a bracketed citation tag. + +**Verdict:** The [HaSz70] citation is complete and accurate. Consider adding [Er67b] and [CoHa63] as explicit bracketed references. + +--- + +## 3. Variants + +The website does not list any explicit variants of this problem. The formalization captures the full general statement for all $r \geq 2$ and $m \geq 1$, which subsumes the special cases ($r = 2$ from Dirac's theorem, $r = 3$ from Corrádi–Hajnal). + +**Verdict:** All variants are captured. The single general statement is sufficient. + +--- + +## 4. Readability + +The code is clean and well-structured: + +- The namespace `Erdos914` is appropriate. +- The docstring clearly restates the mathematical theorem. +- The module-level docstring provides historical context (Dirac, Corrádi–Hajnal, Hajnal–Szemerédi). +- Variable names `r`, `m`, `G`, `S` are standard and natural. +- The conclusion is broken into three readable conjuncts: cardinality, clique property, and pairwise disjointness. + +One minor observation: the `open SimpleGraph Finset` could be scoped to the namespace for slightly tighter hygiene, but this is a stylistic preference and not a real concern. + +**Verdict:** Highly readable. No changes needed. + +--- + +## 5. Formalizability + +The problem statement on erdosproblems.com is entirely precise: + +> "Let $r \geq 2$ and $m \geq 1$. Every graph with $rm$ vertices and minimum degree at least $m(r-1)$ contains $m$ vertex disjoint copies of $K_r$." + +Every term ("graph", "vertices", "minimum degree", "vertex disjoint", "copies of $K_r$") has a standard, unambiguous mathematical meaning. There is no room for interpretation. + +**Verdict:** Fully and unambiguously formalizable. Ambiguity: **none**. + +--- + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed verification: + +- **Vertex set:** `Fin (r * m)` gives exactly $rm$ vertices. ✓ +- **Minimum degree:** `∀ v, G.degree v ≥ m * (r - 1)` correctly encodes minimum degree $\geq m(r-1)$. Since `r : ℕ` with `r ≥ 2`, the subtraction `r - 1` does not underflow. ✓ +- **m copies:** The function `S : Fin m → Finset (Fin (r * m))` provides exactly $m$ sets. ✓ +- **Each copy is $K_r$:** The conjunction of `(S i).card = r` and `G.IsClique (S i)` correctly encodes that each `S i` is a complete subgraph on $r$ vertices. `IsClique` asserts pairwise adjacency of all distinct elements, which combined with cardinality $r$ gives $K_r$. ✓ +- **Vertex-disjointness:** `∀ i j, i ≠ j → Disjoint (S i) (S j)` is the correct encoding. Combined with the cardinality constraint (`r ≥ 2` implies each set is non-empty), this also ensures the function `S` is injective, so we truly have $m$ distinct copies. ✓ +- **`DecidableRel G.Adj`:** Required for `G.degree` to be computable on `Fin (r * m)`. This is a standard and necessary typeclass assumption. ✓ + +No mathematical flaws identified. The formalization faithfully captures the Hajnal–Szemerédi theorem. + +**Verdict:** Correct and complete. No issues. + +--- + +## Overall Assessment + +| Category | Rating | +|---|---| +| Code Reuse | ✅ No opportunities — appropriately self-contained | +| Citations | ⚠️ Minor — [Er67b] and [CoHa63] could be added as explicit references | +| Variants | ✅ Complete | +| Readability | ✅ Excellent | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Verified correct | + +**Overall: High-quality formalization.** The only actionable suggestion is to add the missing citation references [Er67b] and [CoHa63] to the docstring for completeness. diff --git a/ai-review/915.md b/ai-review/915.md new file mode 100644 index 0000000000..4967e44935 --- /dev/null +++ b/ai-review/915.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 915 + +## 1. Code Reuse + +`FormalConjecturesForMathlib/Combinatorics/SimpleGraph/GraphConjectures/Definitions.lean` (lines 101–105) already defines `InternallyDisjoint` for pairs of walks: + +```lean +def InternallyDisjoint {V : Type*} {G : SimpleGraph V} {u v x y : V} + (p : G.Walk u v) (q : G.Walk x y) : Prop := + Disjoint p.support.tail.dropLast q.support.tail.dropLast +``` + +The 915.lean file instead defines its own `HasInternallyDisjointPaths` from scratch using an explicit support-membership condition. These capture the same mathematical concept (no shared internal vertices) but via different mechanisms. The existing `InternallyDisjoint` could potentially be reused to define `HasInternallyDisjointPaths` as: + +```lean +def HasInternallyDisjointPaths ... := + ∃ (paths : Fin m → G.Walk u v), + (∀ i, (paths i).IsPath) ∧ + (∀ i j, i ≠ j → InternallyDisjoint (paths i) (paths j)) +``` + +This would be more concise and consistent with the existing codebase. However, the two formulations are not trivially identical—`InternallyDisjoint` uses `Disjoint` on `List` (as `Finset`-like multisets via `tail.dropLast`), while the current definition quantifies over vertices with explicit endpoint exclusion. They are equivalent for paths (no repeated vertices), but a refactor would need to confirm this carefully. + +## 2. Citations + +The formalization references [BoEr62], [Le73], and [Ma73] in shorthand. The website provides significantly more detail: + +| Shorthand | Website Info | +|-----------|-------------| +| [BoEr62] | Bollobás, B. and Erdős, P., 1962. | +| [Le73] | Leonard, 1973. (Disproved for m=5: 57 vertices, 141 edges.) | +| [Ma73] | Mader, W., 1973. (Disproved for all m ≥ 6; proved the edge-disjoint analogue.) | + +**Missing from the formalization's docstring:** +- [Ba60] Bártfai, 1960: Resolved the m=3 case. +- [Bo66] Bollobás, 1966: Resolved the m=4 case. +- [Le72] Leonard, 1972: Resolved the edge-disjoint version for m ≤ 5. +- [Le73b] Leonard, 1973 (second paper): Resolved ℓ₆(n). +- [SoTh74] Sørensen & Thomassen, 1974: Exact formula k₅(n)=⌊8n/3⌋−3 for n ≥ 13; conjecture holds for 3-connected graphs. +- [Er67b] Erdős reference, p.4. + +The existing citations are correct but incomplete. The website also notes the problem originates as a "conjecture of Bollobás and Erdős," which the formalization correctly attributes. + +## 3. Variants + +The formalization captures only the **internally vertex-disjoint** interpretation. The website discusses two distinct variants: + +1. **Vertex-disjoint paths** (k_m): Disproved for m ≥ 5. ✅ Formalized. +2. **Edge-disjoint paths** (ℓ_m): **Confirmed** by Mader [Ma73] with ℓ_m(n) = ⌊m(n−1)/2 + 1⌋ for all m ≥ 2. ❌ **Not formalized.** + +The edge-disjoint version is mentioned in the module docstring ("The edge-disjoint version was confirmed (and strengthened) by Mader [Ma73]") and in the theorem docstring, but no corresponding formal statement is provided. Given that the edge-disjoint version is a confirmed theorem (not just a conjecture), it would be a natural and valuable companion statement. + +Additionally, the website notes: +- For m = 2, 3, 4, the vertex-disjoint conjecture **does hold** (Bártfai, Bollobás). These positive cases are not captured. +- Sørensen & Thomassen showed the vertex-disjoint conjecture holds for **3-connected graphs**. This variant is not captured. + +## 4. Readability + +The code is generally readable. Minor observations: + +- The `HasInternallyDisjointPaths` definition is clear and well-documented. +- The module docstring provides good context about the ambiguity and resolution. +- The `open SimpleGraph Finset` is appropriate for the notation used. +- The namespace `Erdos915` cleanly scopes the custom definition. + +**Suggestion:** The four-deep quantifier nesting in the disjointness condition of `HasInternallyDisjointPaths` (∀ i j, i ≠ j → ∀ w, w ≠ u → w ≠ v → ...) is somewhat dense. This is a minor stylistic point; the explicit formulation is arguably clearer for verification purposes than an abstract `Disjoint` predicate. + +## 5. Formalizability + +**Assessment: Moderately ambiguous, but well-handled.** + +The original problem statement is ambiguous about the meaning of "disjoint" (edge-disjoint vs. internally vertex-disjoint). The website itself notes: *"It is unclear whether 'disjoint' means edge-disjoint or (internally) vertex-disjoint."* + +The formalization makes a defensible choice by formalizing the vertex-disjoint version (which was disproved), clearly documenting the ambiguity, and noting the resolution of the edge-disjoint variant. The core graph-theoretic concepts (vertex count, edge count, paths, internal disjointness) are all standard and unambiguously formalizable once the interpretation is fixed. + +One subtle point: the original problem says "two points which are connected by m disjoint paths." The formalization requires the existence of two *distinct* vertices (u ≠ v) with m disjoint paths, which is the correct interpretation (trivially any vertex is connected to itself by zero-length paths). + +## 6. Correctness + +**Assessment: Correct.** + +The formalization states `answer(False)` for the vertex-disjoint interpretation, which is mathematically correct: + +- **Leonard [Le73]** disproved the conjecture for m = 5 by constructing a graph on 57 = 1 + 14·4 vertices with 141 = 1 + 14·C(5,2) edges containing no pair of vertices connected by 5 internally vertex-disjoint paths. +- **Mader [Ma73]** extended the disproof to all m ≥ 6. + +Since the formal statement universally quantifies over all m ≥ 2, and the conjecture fails for m ≥ 5, the universal statement is indeed false, so `answer(False)` is correct. + +**Edge count direction:** The formalization uses `≥` for the edge count rather than exact equality. This is correct: a counterexample with exactly 1 + n·C(m,2) edges also satisfies the ≥ condition, so the ≥ version is at least as strong and equally false. + +**`HasInternallyDisjointPaths` correctness:** The definition correctly captures internally vertex-disjoint paths: +- Each path is required to be a `Walk.IsPath` (no repeated vertices). +- The disjointness condition excludes the endpoints u, v from the check, allowing them to be shared. +- For any other vertex w, appearance in one path's support precludes appearance in another's. + +This matches the standard graph-theoretic definition. + +**Tag correctness:** `category research solved` and `AMS 5` (combinatorics) are appropriate. + +**One potential concern:** The formalization does not distinguish between the cases where the conjecture holds (m = 2, 3, 4) and where it fails (m ≥ 5). The `answer(False)` is correct for the universal statement, but a more complete formalization might separately state the positive results for small m. This is not an error but a matter of completeness. diff --git a/ai-review/916.md b/ai-review/916.md new file mode 100644 index 0000000000..73c77f39e4 --- /dev/null +++ b/ai-review/916.md @@ -0,0 +1,93 @@ +# AI Review: Erdos Problem 916 + +## 1. Code Reuse + +The formalization defines cycles from scratch using an injective map `cycle : Fin (k+3) → Fin n` with modular adjacency. The codebase has several better-established patterns: + +- **Mathlib's `SimpleGraph.Walk.IsCycle`**: Used in Erdos 71, 72, and 751 to represent cycles. This is the idiomatic Mathlib approach and provides access to `.support`, `.length`, and the full `Walk` API. Problem 751 even defines a reusable `cycleLengths` helper based on it. + +- **`ContainsSubdivision` (Erdos 717)**: Since Problem 916 is explicitly described as a strengthening of Dirac's result that every graph with `n` vertices and `2n−2` edges contains a K₄ subdivision, the `ContainsSubdivision` definition from Erdos 717 is directly conceptually related. However, Problem 916 asks for a specific structural configuration (cycle + vertex adjacent to 3 cycle vertices), not a K₄ subdivision per se, so `ContainsSubdivision` is not directly applicable as a drop-in. + +**Recommendation**: Consider restating the cycle using `Walk.IsCycle` instead of the ad hoc injective `Fin`-map encoding. This would improve interoperability with other graph-theory formalizations in the codebase and Mathlib. + +## 2. Citations + +The formalization references: +- `[Er67b]` — Erdős, P., *Some recent results on extremal problems in graph theory (Results)*. Theory of Graphs (Internat. Sympos., Rome, 1966) (1967), 117-123. +- `[Di60]` — Dirac, G. A., *In abstrakten Graphen vorhandene vollständige 4-Graphen und ihre Unterteilungen*. Math. Nachr. 22 (1960), 61-85. +- `[Th74]` — Thomassen, C., *Some homeomorphism properties of graphs*. Math. Nachr. 64 (1974), 119-133. + +The website (erdosproblems.com/916) confirms the problem statement, that it is proved by Thomassen [Th74], and that it strengthens Dirac's result [Di60]. The website also mentions a contribution by Raphael Steiner. The citations in the formalization match those on the website. + +**No issues found.** + +## 3. Variants + +The website does not list additional variants. The problem is a single yes/no question, and the formalization captures the affirmative answer (`answer(True)`). + +However, there is a natural implicit variant: the relationship to Dirac's theorem itself (every graph with `n` vertices and `2n−2` edges contains a K₄ subdivision). This could be formalized as a corollary or companion statement using the `ContainsSubdivision` machinery from Erdos 717, since the docstring explicitly mentions Dirac's result. This is not a deficiency per se, but a missed opportunity for a companion formalization. + +**Minor suggestion**: Consider adding Dirac's result as a variant (e.g., `erdos_916.variants.dirac`), since the problem statement explicitly frames 916 as a strengthening of it. + +## 4. Readability + +The formalization is reasonably readable but has some issues: + +- **The cycle encoding is verbose and non-standard.** The triple-nested existential for three distinct adjacencies (`∃ (i j l : Fin (k + 3)), i ≠ j ∧ j ≠ l ∧ i ≠ l ∧ ...`) is correct but hard to parse at a glance. A helper predicate like `HasThreeNeighborsOnCycle` would improve clarity. + +- **The `k + 3` trick** for ensuring cycle length ≥ 3 is fine and standard in this codebase, but could benefit from a brief inline comment explaining that `k + 3` encodes "cycle of length at least 3." + +- **`DecidableRel G.Adj` as an unnamed hypothesis** (`(_ : DecidableRel G.Adj)`) is standard in the codebase. + +- **The modular arithmetic for cycle adjacency** (`⟨(i.val + 1) % (k + 3), Nat.mod_lt _ (by omega)⟩`) is correct but dense. This is a recurring pattern in the codebase (Erdos 765, 811, 86, 556 all use similar constructions), so it is at least consistent. + +**Overall**: Moderate readability. The nested existentials make the statement long but not incomprehensible. + +## 5. Formalizability + +The original problem statement is: + +> *Does every graph with n vertices and 2n−2 edges contain a cycle and another vertex adjacent to three vertices on the cycle?* + +This is quite precise and clearly formalizable. The key concepts — graph, vertices, edges, cycle, vertex not on the cycle, adjacency to three cycle vertices — all have standard formal definitions. + +**Ambiguity assessment: Low.** The only mild ambiguity is whether "cycle" means a simple cycle (no repeated vertices) or allows non-simple cycles. The formalization correctly assumes simple cycles via the `Function.Injective cycle` requirement, which is the standard graph-theoretic convention. + +**One subtlety**: The problem says "2n−2 edges" while the formalization uses `≥ 2n−2`. This is mathematically correct (if the property holds for exactly `2n−2` edges, it holds for more edges too, since adding edges preserves the property). The `≥` is actually more general and hence stronger, which is fine for a proved result. + +## 6. Correctness + +### Mathematical analysis + +The formalization states: for all `n ≥ 4`, every simple graph on `Fin n` with at least `2n−2` edges contains: +1. A cycle of length ≥ 3 (encoded as `Fin (k+3) → Fin n`, injective, with consecutive adjacency including wrap-around) +2. A vertex `v` not on the cycle, adjacent to at least 3 distinct vertices on the cycle + +**Correctness assessment:** + +**(a) The bound `n ≥ 4` is appropriate.** For `n = 3`, we have `2n−2 = 4` edges, but `K₃` has only 3 edges, so no simple graph on 3 vertices has 4 edges. For `n = 4`, `2n−2 = 6 = |E(K₄)|`, and `K₄` indeed contains a cycle with an external vertex adjacent to 3 cycle vertices (in fact, every vertex is adjacent to all others). So `n ≥ 4` is the right threshold. + +**(b) Cycle representation is correct.** The injective map with modular adjacency correctly encodes a simple cycle. The adjacency condition `G.Adj (cycle i) (cycle ⟨(i.val + 1) % (k + 3), ...⟩)` for all `i` ensures every consecutive pair (including the wrap-around from last to first) is an edge. + +**(c) The "three neighbors on the cycle" condition is correct.** The existential `∃ (i j l : Fin (k + 3)), i ≠ j ∧ j ≠ l ∧ i ≠ l ∧ G.Adj v (cycle i) ∧ G.Adj v (cycle j) ∧ G.Adj v (cycle l)` correctly encodes that `v` is adjacent to at least 3 distinct vertices on the cycle. + +**(d) The `v ∉ Set.range cycle` condition is correct.** This ensures `v` is not itself a vertex of the cycle, matching "another vertex." + +**(e) Potential issue with `2 * n - 2` and natural number subtraction.** Since `n : ℕ`, the expression `2 * n - 2` uses natural number subtraction, which is fine here because `n ≥ 4` guarantees `2 * n ≥ 8 > 2`. No underflow issue. + +**(f) `answer(True)` is correct.** The problem is proved in the affirmative by Thomassen [Th74]. + +### Verdict + +**The formalization is mathematically correct and complete.** It faithfully captures the problem statement. No flaws identified. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `Walk.IsCycle` instead of ad hoc cycle encoding | +| Citations | Correct and complete | +| Variants | Dirac's K₄ subdivision theorem could be added as a variant | +| Readability | Moderate; nested existentials are verbose but correct | +| Formalizability | High; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/917.md b/ai-review/917.md new file mode 100644 index 0000000000..f0844f6c2b --- /dev/null +++ b/ai-review/917.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 917 + +## 1. Code Reuse + +**Duplicate `IsCritical` definition.** The definition `Erdos917.IsCritical` (lines 54–56) is character-for-character identical to `Erdos1032.IsCritical` in `FormalConjectures/ErdosProblems/1032.lean` (lines 44–46). Both define edge-critical graphs independently in their own namespaces. This should be refactored into a shared location. + +**Existing Mathlib-level definitions.** `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` already provides: +- `SimpleGraph.IsCriticalEdge` (line 77) — a single-edge version of edge-criticality. +- `SimpleGraph.IsCriticalEdges` (line 72) — for a set of edges. +- `SimpleGraph.IsCritical` (line 96) — vertex-critical: `χ(G) = k` and deleting any single vertex reduces the chromatic number. + +For finite graphs, edge-criticality (the definition in Problem 917) and vertex-criticality (the Mathlib definition) are equivalent — this is a standard result. The edge-critical formulation is the more natural choice here since the problem is about counting edges, and it matches the standard graph-theory convention for "$k$-critical." Nevertheless, the duplicate across Problems 917 and 1032 should be consolidated, either by promoting the edge-critical definition to `FormalConjecturesForMathlib` or by having both files import from a shared definition. + +Problem 944 uses `SimpleGraph.IsCritical` (vertex-critical) from Mathlib combined with `IsCriticalEdges`, which is appropriate for that problem's distinct concerns. + +## 2. Citations + +The formalization's docstring includes: **[Er69b]**, **[Er93]**, **[To70]**, **[St87]**. + +Comparing with the website ([erdosproblems.com/917](https://www.erdosproblems.com/917)): + +| Reference | Website | Formalization | Notes | +|-----------|---------|---------------|-------| +| Dirac [Di52] | ✅ | ❌ **Missing** | Constructed a 6-critical graph showing $f_6(4n+2) \geq 4n^2+8n+3$ using two disjoint odd cycles. Relevant historical context for Part 2. | +| Erdős [Er69b] | ✅ | ✅ | | +| Erdős [Er93] | ✅ | ✅ | | +| Toft [To70] | ✅ | ✅ | | +| Stiebitz [St87] | ✅ | ✅ | | +| Luo, Ma, Yang [LMY23] | ✅ | ❌ **Missing** | Improved upper bound to $\frac{1}{2}(1 - \frac{1}{k-2} - \frac{1}{36(k-1)^2} + o(1))n^2$. This is a recent and significant result. | + +**Recommendation:** Add [Di52] and [LMY23] to the docstring, at minimum as brief references. The existing references use shorthand (e.g., "Erdős, P. (1969).") without full titles or journal names — this is consistent with the codebase convention but sparse. The website doesn't provide full bibliographic details either, so the shorthand style is acceptable. + +## 3. Variants + +The Erdős problem as stated on the website poses three questions: +1. Is $f_k(n) \gg_k n^2$ for $k \geq 4$? +2. Is $f_6(n) \sim n^2/4$? +3. For $k \geq 6$, is $f_k(n) \sim \frac{1}{2}(1 - 1/\lfloor k/3 \rfloor) n^2$? + +The formalization captures all three as separate theorems: +- `erdos_917` — Part 1 ✅ +- `erdos_917.variants.f6_asymptotic` — Part 2 ✅ +- `erdos_917.variants.general_asymptotic` — Part 3 ✅ + +**All variants are captured.** One could argue for an additional variant restricting Part 3 to $k \equiv 0 \pmod{3}$ (the cases not disproved by Stiebitz), since the question remains open there. The website implicitly leaves this open. However, this would go beyond what Erdős explicitly asked, so omitting it is reasonable. + +## 4. Readability + +The code is well-structured and readable. Specific notes: + +- The `IsCritical` definition has a clear docstring explaining the mathematical concept. +- The three theorem statements follow a logical progression (quadratic lower bound → specific asymptotic → general asymptotic). +- The `let` bindings in Part 3 (`d := k / 3`, `α := ...`) improve readability. +- The module docstring clearly states the problem with LaTeX and references. + +**Minor suggestion:** The Part 2 docstring (lines 74–78) could mention that this remains open, as it's not obvious from the `answer(sorry)` tag alone. Parts 1 and 3 have clearer status indicators in their docstrings ("Proved by Toft" and "Disproved by Stiebitz"). + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The problem is stated precisely in terms of well-defined combinatorial objects: +- $k$-critical graphs have a clear definition (chromatic number equals $k$, every edge deletion reduces it). +- $f_k(n)$ is the maximum edge count over all such graphs on $n$ vertices. +- The asymptotic questions ($\gg_k$, $\sim$) have standard mathematical meanings. + +The formalization correctly unpacks the asymptotic notation: +- $f_k(n) \gg_k n^2$ becomes: $\exists c > 0, \exists N_0, \forall n \geq N_0, f_k(n) \geq c \cdot n^2$ (with $c$ depending on $k$). +- $f_k(n) \sim g(n)$ becomes: $\forall \varepsilon > 0, \exists N_0, \forall n \geq N_0, |f_k(n) - g(n)| \leq \varepsilon \cdot n^2$ (captured via the two-sided bounds). + +**One subtle point:** The formalization states the *existence* of a critical graph with many edges (lower bound) plus an *upper bound* on all critical graphs, rather than directly defining $f_k(n) = \max\{|E(G)| : G \text{ is } k\text{-critical on } n \text{ vertices}\}$ and reasoning about it. This is mathematically equivalent and arguably cleaner for formalization since it avoids needing to define the maximum (which would require showing the set is nonempty for the lower bound direction). + +**Potential edge case:** For small $n$, there may be no $k$-critical graph on $n$ vertices at all (e.g., a $k$-critical graph requires at least $k$ vertices). The formalization handles this via the "$\exists N_0, \forall n \geq N_0$" quantifier structure, so this is not a problem. + +## 6. Correctness + +### Part 1 (`erdos_917`) — **Correct** ✅ + +- `answer(True)` is correct: Toft [To70] proved $f_k(n) \gg_k n^2$ for $k \geq 4$. +- The quantifier structure is correct: $\forall k \geq 4, \exists c > 0, \exists N_0, \forall n \geq N_0, \exists G$ (k-critical on $n$ vertices with $\geq c \cdot n^2$ edges). +- The constant $c$ is allowed to depend on $k$ (it is quantified after $k$), which matches the $\gg_k$ notation. +- Tagged `category research solved` — correct. + +### Part 2 (`f6_asymptotic`) — **Correct** ✅ + +- `answer(sorry)` is correct: this problem remains open. +- The asymptotic $f_6(n) \sim n^2/4$ is correctly formalized as the conjunction of a lower bound $\geq (1/4 - \varepsilon) n^2$ (via existence of a graph) and an upper bound $\leq (1/4 + \varepsilon) n^2$ (for all critical graphs), for all $\varepsilon > 0$ and sufficiently large $n$. +- Tagged `category research open` — correct. + +### Part 3 (`general_asymptotic`) — **Correct** ✅ + +- `answer(False)` is correct: Stiebitz [St87] disproved the conjecture for $k \not\equiv 0 \pmod{3}$, so the universal statement ($\forall k \geq 6$) is false. +- The use of Lean's natural number division `k / 3` correctly computes $\lfloor k/3 \rfloor$. +- The formula $\alpha = \frac{1}{2}(1 - 1/\lfloor k/3 \rfloor)$ matches the problem statement. +- Tagged `category research solved` — correct (it is resolved, albeit negatively). + +### `IsCritical` definition — **Correct** ✅ + +- Chromatic number equals $k$ (as an element of `ℕ∞`): correct. +- Every edge in the edge set, when deleted, results in strictly smaller chromatic number: correct formalization of edge-criticality. +- The use of `(k : ℕ∞)` for comparison with `chromaticNumber` (which returns `ℕ∞`) is appropriate. + +### Summary + +| Aspect | Assessment | +|--------|-----------| +| Code reuse | `IsCritical` duplicated across 917 and 1032; should be shared | +| Citations | Missing [Di52] and [LMY23] from website | +| Variants | All three variants captured | +| Readability | Good; minor improvement possible in Part 2 docstring | +| Formalizability | Fully formalizable, low ambiguity | +| Correctness | All three parts mathematically correct; answer tags and status categories accurate | diff --git a/ai-review/919.md b/ai-review/919.md new file mode 100644 index 0000000000..9d2cc232d6 --- /dev/null +++ b/ai-review/919.md @@ -0,0 +1,98 @@ +# Review: Erdos Problem 919 + +## 1. Code Reuse + +Problem 918 (`FormalConjectures/ErdosProblems/918.lean`) is closely related and uses `chromaticCardinal` (defined in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean:136`) to express chromatic number constraints at infinite cardinals. Problem 919 instead manually encodes chromatic number bounds via: + +- `∀ (α : Type), Nonempty (G.Coloring α) → aleph 2 ≤ #α` (chromatic number ≥ ℵ₂) +- `Nonempty ((G.induce S).Coloring ℕ)` (countably colorable) + +These could be replaced with `chromaticCardinal`: + +- `G.chromaticCardinal ≥ ℵ₂` (or `= ℵ₂`) +- `(G.induce S).chromaticCardinal ≤ ℵ₀` + +This would improve consistency with Problem 918 and reduce boilerplate. The variant `aleph_1` already manually encodes both the lower *and* upper bound; `chromaticCardinal = ℵ₁` would be more concise. + +## 2. Citations + +The docstring cites: + +> [Er69b] Erdős, P., *Problems and results in chromatic number theory*. + +However, Problem 918 gives the fuller and likely correct title for the same reference: + +> [Er69b] Erdős, P., Problems and results in chromatic **graph** theory. Proof Techniques in Graph Theory (Proc. Second Ann Arbor Graph Theory Conf., Ann Arbor, Mich., 1968) (1969), 27-35. + +The title in Problem 919 says "chromatic **number** theory" — this appears to be an error. It should read "chromatic **graph** theory" to match the actual paper title and the citation in Problem 918. + +The website lists the reference as `[Er69b]` with tags "graph theory, chromatic number", which is consistent. + +## 3. Variants + +The website states: + +> "What if instead we ask for G to have chromatic number aleph_1?" + +This is captured by `erdos_919.variants.aleph_1`. **All variants from the website are present.** + +## 4. Readability + +- The code is generally readable. The `open SimpleGraph Cardinal Ordinal` makes the key types available. +- The repeated expression `Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2)` appears four times across the two theorems. Introducing a local abbreviation (e.g., `local notation "ω₂²" => Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2)`) would improve readability slightly. +- Using `chromaticCardinal` (as suggested in Code Reuse) would make the chromatic number constraints more immediately parseable, especially in the variant where both upper and lower bounds are spelled out manually. +- The asymmetry between the main theorem (only lower bound on chromatic number) and the variant (both bounds) is a minor readability concern — see Correctness below. + +## 5. Formalizability + +The problem is **clearly formalizable** with low ambiguity. The key concepts are: + +- Well-ordered vertex sets of a specific ordinal type (ω₂·ω₂) +- Chromatic number at specific infinite cardinal levels +- Induced subgraphs on subsets of smaller order type + +The only potential ambiguity is the phrase "subgraph whose vertices have a lesser type." This could mean: +1. Subgraph induced on a subset whose order type (under the inherited ordering) is strictly less than ω₂·ω₂ +2. Any subgraph (not necessarily induced) with fewer vertices + +The formalization correctly chooses interpretation (1): it uses `G.induce S` for induced subgraphs and `Ordinal.type (Subrel (· < ·) S) < ...` for the order type constraint. This is the standard reading in infinite combinatorics. + +**Assessment: Unambiguous.** The problem is precise enough for formalization. + +## 6. Correctness + +### Main theorem (`erdos_919`) + +**Mathematically correct**, with one stylistic observation: + +- **Order type**: `Cardinal.ord (aleph 2) * Cardinal.ord (aleph 2)` correctly represents ω₂·ω₂ = ω₂² in ordinal arithmetic. +- **Chromatic number ≥ ℵ₂**: The formalization states `∀ (α : Type), Nonempty (G.Coloring α) → aleph 2 ≤ #α`, which encodes that the chromatic cardinal is at least ℵ₂. Since the vertex set has order type ω₂² and thus cardinality ℵ₂, the chromatic number is trivially ≤ ℵ₂ (assign each vertex a distinct color). Therefore ≥ ℵ₂ is equivalent to = ℵ₂ here. This is **correct but implicit** — a comment noting this would help. +- **Countable colorability of small subsets**: `Nonempty ((G.induce S).Coloring ℕ)` correctly encodes "chromatic number ≤ ℵ₀" since any graph that is finitely colorable is also ℕ-colorable. +- **Subrel usage**: `Ordinal.type (Subrel (· < ·) S)` correctly computes the order type of S under the restricted ordering. + +### Variant (`erdos_919.variants.aleph_1`) + +**Mathematically correct.** The variant correctly encodes chromatic number *exactly* ℵ₁ via both: +- `∀ (α : Type), Nonempty (G.Coloring α) → aleph 1 ≤ #α` (≥ ℵ₁) +- `∃ (α : Type), #α ≤ aleph 1 ∧ Nonempty (G.Coloring α)` (≤ ℵ₁) + +This is necessary for the variant since the vertex set has cardinality ℵ₂, so without the upper bound, the chromatic number could be ℵ₂. + +### Stylistic asymmetry + +The main theorem only specifies a lower bound on the chromatic number (≥ ℵ₂), relying on the cardinality of V to implicitly cap it at ℵ₂. The variant explicitly specifies both bounds. While both are mathematically correct, using `chromaticCardinal = ℵ₂` for the main theorem and `chromaticCardinal = ℵ₁` for the variant would make the intent uniform and self-evident. + +### Universe considerations + +The existential `∃ (V : Type)` places V in `Type 0`. A well-ordered type of order type ω₂² in `Type 0` is consistent (its cardinality is ℵ₂, which exists in `Cardinal.{0}`). Compare with Problem 918, which uses explicit universe polymorphism (`Type u`). The lack of universe polymorphism in Problem 919 is not incorrect but is a stylistic difference. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `chromaticCardinal` from Coloring.lean for consistency with Problem 918 | +| Citations | Title error: "chromatic number theory" should be "chromatic graph theory" | +| Variants | Complete | +| Readability | Good; minor improvements possible with `chromaticCardinal` and local notation | +| Formalizability | Unambiguous and clearly formalizable | +| Correctness | Mathematically correct; stylistic asymmetry between main theorem and variant | diff --git a/ai-review/921.md b/ai-review/921.md new file mode 100644 index 0000000000..5d8d93dbf8 --- /dev/null +++ b/ai-review/921.md @@ -0,0 +1,92 @@ +# Review: Erdős Problem 921 + +## 1. Code Reuse + +No significant reuse opportunities identified. The formalization correctly leverages Mathlib's existing `SimpleGraph`, `chromaticNumber`, `Walk`, and `IsCycle` infrastructure. The helper definition `erdos921F` is problem-specific (parameterized by chromatic number and odd-cycle girth) and has no analogue in `FormalConjecturesForMathlib/`. The asymptotic bounding pattern (∃ C > 0, ∃ N₀, ∀ n ≥ N₀, ...) is used ad hoc throughout many Erdős problem files; a shared `Asymptotics.IsTheta`-style wrapper could reduce boilerplate, but this is a codebase-wide concern, not specific to this file. + +## 2. Citations + +The website (erdosproblems.com/921) lists three references: **[Er69b]**, **[Ga63]**, and **[KST84]**. + +The formalization's module docstring cites [Er69b] and [KST84] but **omits [Ga63]** (Gallai's contribution). The docstring narrative mentions "Gallai proved that $f_4(n) \gg n^{1/2}$" without a bracketed citation. For consistency with the website, a citation line should be added: + +> [Ga63] Gallai, T., *Kritische Graphen I*, 1963. + +Additionally, the `@[category]` tags on the variant theorems cite `[Er69b] [KST84]`, but Gallai's result is specifically the content of the lower bound for k = 4, so `[Ga63]` could also be cited on the lower bound variant. + +## 3. Variants + +The formalization provides: +- The main conjecture (`erdos_921`): $f_k(n) \asymp n^{1/(k-2)}$ for all $k \geq 4$. +- Lower bound variant (`erdos_921.variants.lower_bound`): $f_k(n) \geq C \cdot n^{1/(k-2)}$. +- Upper bound variant (`erdos_921.variants.upper_bound`): $f_k(n) \leq C \cdot n^{1/(k-2)}$. + +This is a natural and complete decomposition. One possible additional variant would be the special case **k = 4** (Gallai's original result, $f_4(n) \asymp \sqrt{n}$), which was proved earlier and independently of the general case. However, this is a minor point since the general statement subsumes it. + +## 4. Readability + +The code is well-structured and readable. Specific observations: + +- **Definition name**: `erdos921F` is clear, though `erdos921_f` would follow Lean 4 snake_case convention more closely. +- **Namespace**: `Erdos921` is used appropriately to scope the definition. +- **Docstrings**: Present on all declarations with clear mathematical statements. The module docstring provides good context. +- **Structure**: Breaking the main result into lower/upper bound variants aids both readability and potential proof development. + +No significant readability improvements needed. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: +- "Graph on $n$ vertices" → `SimpleGraph (Fin n)` +- "Chromatic number $k$" → `G.chromaticNumber = (k : ℕ∞)` +- "Every odd cycle has length $> m$" → quantification over walks that are cycles with odd length +- "$f_k(n) \asymp n^{1/(k-2)}$" → standard asymptotic notation, correctly expanded as two-sided bounds with positive constants + +There is no ambiguity in the original problem statement. All concepts involved (chromatic number, odd cycle, graph on n vertices) have standard, universally agreed-upon definitions. + +## 6. Correctness + +**Assessment: Mathematically correct and complete.** + +### Definition `erdos921F` + +The definition takes `sSup` over the set `{m : ℕ | ∃ G : SimpleGraph (Fin n), G.chromaticNumber = (k : ℕ∞) ∧ ∀ (v : Fin n) (p : G.Walk v v), p.IsCycle → Odd p.length → m < p.length}`. + +This is a faithful formalization. Key observations: + +1. **Downward closure**: If $m$ is in the set (witnessed by graph $G$), then any $m' < m$ is also in the set (witnessed by the same $G$). So the set is either empty or of the form $\{0, 1, \ldots, M\}$. + +2. **Nonemptiness**: When $n \geq k$, there exist graphs on $n$ vertices with chromatic number $k$ (e.g., $K_k$ plus isolated vertices). Every cycle has length $\geq 3 > 0$, so $m = 0$ is always in the set for sufficiently large $n$. + +3. **Boundedness**: On $n$ vertices, cycle lengths are bounded by $n$, so the set is bounded above by $n$. Thus `sSup` is well-defined and gives the correct finite value. + +4. **Edge case ($n$ small)**: If $n < k$, no graph on $n$ vertices has chromatic number $k$, so the set is empty and `sSup ∅ = 0`. This is harmless since the asymptotic statement only concerns large $n$ (via the $\exists N_0$ quantifier). + +### Main theorem + +The expansion of $f_k(n) \asymp n^{1/(k-2)}$ into separate lower and upper bounds with independent positive constants and thresholds is the standard definition of $\Theta$-notation. The constants are allowed to depend on $k$ (since $k$ is universally quantified outside), which is correct. + +The exponent `(1 : ℝ) / ((k : ℝ) - 2)` is correct for all $k \geq 4$. Note that when $k = 4$, this gives $1/2$, matching the docstring's claim about $f_4(n) \asymp n^{1/2}$. + +### `answer(True)` usage + +The problem asks "Is it true that...?" and has been proved true by Kierstead, Szemerédi, and Trotter [KST84]. The `answer(True)` wrapper and `@[category research solved]` tag are appropriate. + +### Potential concern (minor, not a bug) + +The `sSup` in `erdos921F` uses Lean's `sSup` on `ℕ`, which requires `BddAbove` and `Nonempty` hypotheses in `ConditionallyCompleteLattice` to behave as expected. For an actual proof, one would need to establish these hypotheses as part of working with the definition. This is not a correctness issue with the formalization itself, but a proof obligation that any prover must discharge. + +## Summary + +| Category | Rating | +|---|---| +| Code Reuse | No issues | +| Citations | **Missing [Ga63]** | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | + +**Overall**: A clean, correct formalization. The only actionable item is adding the missing [Ga63] citation for Gallai's contribution. diff --git a/ai-review/922.md b/ai-review/922.md new file mode 100644 index 0000000000..ae7adf57a9 --- /dev/null +++ b/ai-review/922.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 922 + +## 1. Code Reuse + +The formalization encodes independent sets inline as: +```lean +(↑T : Set V).Pairwise (fun u v => ¬G.Adj u v) +``` + +Mathlib already defines `SimpleGraph.IsIndepSet` (in `Mathlib.Combinatorics.SimpleGraph.Clique`, line ~788) as: +```lean +abbrev IsIndepSet (s : Set α) : Prop := + s.Pairwise (fun v w ↦ ¬G.Adj v w) +``` + +The inline encoding is definitionally equal to `G.IsIndepSet ↑T`. Using the Mathlib definition would improve readability and align with other problems in the codebase. Several other Erdős problems (750, 804, 805) also define or use `IsIndepSet` locally; a shared utility or direct Mathlib import would reduce redundancy. + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` provides notation `α(G)` for the independence number and related lemmas that could be relevant if the formalization were expanded. + +No other significant code reuse opportunities identified — the formalization is otherwise self-contained, using standard Mathlib types (`SimpleGraph`, `Colorable`, `Finset`). + +## 2. Citations + +**Website references:** +- [ErHa67b] — Erdős and Hajnal (origin of the question) +- [Er69b] — additional Erdős reference +- [Fo70b] — Folkman (proved the result) + +**Formalization references:** +- Module docstring: [ErHa67b] and [Fo70b] ✓ +- Theorem docstring: [ErHa67b] ✓ + +**Gap:** The reference [Er69b] listed on the website is not mentioned in the formalization. It should be added to the module docstring for completeness. + +The website also notes: "The case k=0 is trivial, but they could not prove this even for k=1." This historical context is not included, though it's not strictly required. + +**Related problem:** The website links to Problem #73 as a related problem. This cross-reference is not mentioned in the formalization. + +## 3. Variants + +The formalization captures the main conjecture as stated on the website. No additional variants are listed on the problem page. + +The problem as stated on the website ("Must G have chromatic number at most k+2?") is a yes/no question, and the formalization correctly wraps it with `answer(True)` since Folkman proved it affirmatively. + +One possible variant not explored: the converse direction or tightness of the bound k+2. The website does not mention these, so their omission is appropriate. + +## 4. Readability + +The formalization is generally readable. Specific observations: + +- **Good:** The comment `The condition 2 * T.card + k ≥ S.card encodes |T| ≥ (|S| - k) / 2` in the docstring is helpful for bridging the arithmetic encoding to the mathematical statement. +- **Good:** The `answer(True)` wrapper correctly signals this is a resolved conjecture. +- **Suggestion:** Replacing the inline pairwise condition with `G.IsIndepSet ↑T` would make the statement more immediately recognizable to readers familiar with Mathlib's graph theory library. +- **Minor:** The module docstring says "every subgraph H" while the theorem docstring says "every induced subgraph." The theorem docstring is more precise about what is actually formalized (see §6 for discussion). + +## 5. Formalizability + +**Assessment: Low ambiguity — clearly formalizable.** + +The statement is precise enough to formalize directly. The only potential ambiguity is: + +- **"Subgraph" vs "induced subgraph"**: The problem says "every subgraph H contains an independent set of size ≥ (n-k)/2." In the Erdős-Hajnal context, this is standardly interpreted as "induced subgraph." Moreover, the two interpretations are equivalent for this problem: the condition for all induced subgraphs (stronger, since induced subgraphs maximize edges over a vertex set) implies the condition for all general subgraphs, and the converse holds because induced subgraphs are a special case of general subgraphs. So the choice of interpretation does not affect correctness. + +- **Natural number arithmetic**: The condition (n-k)/2 involves division and possible subtraction below zero. The formalization's encoding `2 * T.card + k ≥ S.card` avoids both issues cleanly. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +1. **Quantification over induced subgraphs:** `∀ S : Finset V` quantifies over all subsets of vertices. The independent set condition is checked with respect to G's adjacency (not a sub-graph's adjacency), which correctly models the induced subgraph G[S]. ✓ + +2. **Independent set encoding:** `T ⊆ S ∧ (↑T : Set V).Pairwise (fun u v => ¬G.Adj u v)` means T is a subset of S where no two vertices are adjacent in G. This is exactly an independent set of the induced subgraph G[S]. ✓ + +3. **Size condition:** `2 * T.card + k ≥ S.card` is equivalent to `|T| ≥ (|S| - k) / 2` over the reals. When `|S| < k`, both conditions are trivially satisfied (the formalization gives `2 * T.card + k ≥ S.card` trivially since `k ≥ S.card`; the real condition gives `|T| ≥ negative`, also trivial). ✓ + +4. **Conclusion:** `G.Colorable (k + 2)` correctly states that G has chromatic number at most k+2. ✓ + +5. **answer(True):** Folkman [Fo70b] proved the conjecture affirmatively. ✓ + +6. **Universe polymorphism:** The statement quantifies over `V : Type*`, making it universe-polymorphic. This is standard and correct. ✓ + +7. **DecidableEq assumption:** Required for Finset operations. This is a harmless technical assumption (classically always satisfiable). ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of the problem as stated on the website. diff --git a/ai-review/923.md b/ai-review/923.md new file mode 100644 index 0000000000..b19f0a478d --- /dev/null +++ b/ai-review/923.md @@ -0,0 +1,47 @@ +# Review: Erdős Problem 923 + +## 1. Code Reuse + +**Problem 108 is the direct generalization.** Problem 923 (triangle-free, i.e. girth ≥ 4) is the `r = 4` special case of Problem 108, which asks the same question for subgraphs of girth ≥ r for all r ≥ 4. The TODO comment in `108.lean` line 44 explicitly says: `-- TODO: Proof for the case r=4 and statement for the infinite case`. + +There is a notable inconsistency between the two: Problem 108 uses `SimpleGraph.girth` (returns 0 for acyclic graphs), while Problem 923 uses `SimpleGraph.egirth` (returns ⊤ for acyclic graphs). Problem 923's choice of `egirth` is the mathematically correct one (see Correctness below), suggesting Problem 108 has a latent bug. + +Other reusable code from `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Coloring.lean` includes `le_chromaticNumber_iff_colorable` and related lemmas, which could be useful if a proof were attempted. The `H : G.Subgraph` / `H.coe` pattern used here is standard across the codebase (e.g., Problems 918, 1006). + +## 2. Citations + +The website [erdosproblems.com/923](https://www.erdosproblems.com/923) lists: +- **Original source:** [Er69b] Erdős, P., *Problems and results in chromatic graph theory*, Proof Techniques in Graph Theory (Proc. Second Ann Arbor Graph Theory Conf., Ann Arbor, Mich., 1968) (1969), 27–35. +- **Solution:** [Ro77] Rödl, V., *On the chromatic number of subgraphs of a given graph*, Proc. Amer. Math. Soc. 64 (1977), 370–371. + +The formalization cites only [Ro77]. **The original source [Er69b] is missing** and should be added for completeness. The [Ro77] citation format matches the website. + +## 3. Variants + +The website does not list additional variants beyond the connection to Problem 108. The formalization does not include variants, which is appropriate. The relationship to Problem 108 is documented in the docstring. No missing variants. + +## 4. Readability + +The code is clear and well-structured. The docstring helpfully explains that "triangle-free is formalized here as girth ≥ 4 (no cycles of length 3)," which aids understanding for readers unfamiliar with the girth characterization. The `open SimpleGraph` at the top keeps the theorem statement clean. + +Minor style note: Problem 108 uses `∀ k ≥ (2 : ℕ)` syntax while 923 uses `∀ (k : ℕ), 2 ≤ k →`. These are equivalent but the former is slightly more idiomatic for Lean 4 and consistent with the parent problem. + +## 5. Formalizability + +The problem statement is precise and unambiguous. "Triangle-free" has a single standard meaning (no 3-cliques / no cycles of length 3), and "chromatic number" and "subgraph" are standard graph-theoretic concepts. The encoding as `egirth ≥ 4` correctly captures the triangle-free condition. **No ambiguity.** + +## 6. Correctness + +**Overall: Correct.** The formalization faithfully captures the mathematical content. + +Detailed analysis: + +- **`answer(True)`**: Correct. The problem is proved (Rödl, 1977). +- **`egirth` for triangle-free**: Correct. Using `egirth ≥ 4` properly captures "no cycles of length ≤ 3." Crucially, `egirth` returns `⊤` (infinity) for acyclic graphs, which correctly classifies forests as triangle-free. By contrast, `girth` returns 0 for acyclic graphs, which would *incorrectly* exclude forests from satisfying "girth ≥ 4." This matters because trees with at least one edge have chromatic number 2, so they are valid witnesses when k = 2. +- **`2 ≤ k` guard**: Correct. Every nonempty graph has chromatic number ≥ 1, so the conjecture is only interesting for k ≥ 2. +- **Universe polymorphism**: Problem 108 explicitly declares `universe u`, while 923 relies on auto-bound implicit universes. This is a minor stylistic difference but doesn't affect correctness. +- **No `Nonempty V` assumption**: Correct. For an empty graph, `chromaticNumber = 0`, so `(f : ℕ∞) ≤ 0` fails for any positive `f`, making the statement vacuously true. No harm in omitting `Nonempty V`. +- **`G.Subgraph` vs induced subgraph**: The problem asks for "contains a triangle-free subgraph," which is correctly formalized using `G.Subgraph` (general subgraphs, not necessarily induced). This is the standard interpretation. +- **ℕ∞ coercions**: The coercions `(f : ℕ∞)` and `(k : ℕ∞)` correctly lift the natural number comparisons to `ℕ∞`, handling the case where `chromaticNumber` might be `⊤`. + +**No mathematical flaws identified.** The formalization is correct and complete. diff --git a/ai-review/924.md b/ai-review/924.md new file mode 100644 index 0000000000..1e4f6ff35d --- /dev/null +++ b/ai-review/924.md @@ -0,0 +1,100 @@ +# Review: Erdős Problem 924 + +## 1. Code Reuse + +Several related formalizations exist in the codebase: + +- **Problem 582** (`582.lean`) is the special case k=2, l=3. It uses a subgraph decomposition model (`H ≤ G` and `G \ H`) for 2-coloring, which is natural for that setting but doesn't generalize to k colors. +- **Problem 925** uses `IsNotRamseyForTriangle` with a similar subgraph decomposition. +- **Problem 559** models 2-coloring via `c : Fin N → Fin N → Bool`. +- **Problem 639** defines `EdgeTwoColoring` as a custom structure with symmetry built in. + +The current formalization uses `c : Fin n → Fin n → Fin k` with a separate symmetry hypothesis, which is appropriate for the general k-color case. No existing shared utility (e.g., a `MonochromaticClique` predicate) exists in the codebase that could be reused here. The Mathlib predicates `SimpleGraph.CliqueFree` and `SimpleGraph.IsNClique` are correctly reused from Mathlib. + +**Verdict:** No missed reuse opportunities. The modeling choice is appropriate for the generality of this problem. + +## 2. Citations + +The docstring references `[Er69b][Er75b]` and `[NeRo76]` and the module docstring also mentions `[Fo70]`. The [erdosproblems.com/924](https://www.erdosproblems.com/924) page lists the same references: Er69b, Er75b for the original question (Erdős and Hajnal), NeRo76 for the general solution (Nešetřil and Rödl), and Fo70 for the k=2 case (Folkman). + +However, unlike Problem 582 which provides a full bibliographic entry for [Fo70], Problem 924 uses only shorthand citation keys without full bibliographic details for any reference. For completeness, the following full citations could be added: + +- **[Er69b]** Erdős, P., *Problems and results in chromatic graph theory*, in Proof Techniques in Graph Theory (ed. F. Harary), Academic Press (1969), 27–35. +- **[Er75b]** Erdős, P., *Problems and results on finite and infinite graphs*, in Recent Advances in Graph Theory (ed. M. Fiedler), Academia Prague (1975), 183–192. +- **[Fo70]** Folkman, J., *Graphs with monochromatic complete subgraphs in every edge coloring*, SIAM J. Appl. Math. 18 (1970), 19–24. +- **[NeRo76]** Nešetřil, J. and Rödl, V., *The Ramsey property for graphs with forbidden complete subgraphs*, J. Combin. Theory Ser. B 20 (1976), 243–249. + +**Verdict:** Citation keys match the website, but full bibliographic details are missing. + +## 3. Variants + +The problem as stated on erdosproblems.com asks: for k ≥ 2 and l ≥ 3, does there exist a K_{l+1}-free graph G such that every k-colouring of the edges contains a monochromatic K_l? The formalization captures this exactly. + +The module docstring correctly cross-references: +- Problem 582 (special case k=2, l=3) +- Problem 966 (arithmetic analogue) + +No additional variants are mentioned on the website. The formalization fully captures the single statement. + +**Verdict:** All variants accounted for. + +## 4. Readability + +The formalization is reasonably readable, with a few observations: + +- **Coloring model clarity:** The function `c : Fin n → Fin n → Fin k` with `∀ i j, c i j = c j i` is a clear, elementary encoding of a symmetric edge coloring. An alternative would be `G.edgeSet → Fin k` or `Sym2 (Fin n) → Fin k`, but the current approach avoids dependent types and is arguably simpler. +- **Monochromatic condition:** The condition `∀ ⦃x⦄, x ∈ S → ∀ ⦃y⦄, y ∈ S → x ≠ y → c x y = a` is verbose but explicit. This is an inline expansion of "all edges of the clique S have color a." +- **Stylistic inconsistency with 582:** Problem 582 (the special case) uses a very different modeling approach (subgraph decomposition). While each approach is appropriate for its generality level, a reader comparing the two may find the different formalization styles somewhat jarring. This is a minor observation, not a defect. + +**Verdict:** Good readability. The verbose monochromatic condition could benefit from a brief inline comment, but is not problematic. + +## 5. Formalizability + +The original problem statement is precise and unambiguous: + +> "Let k ≥ 2 and l ≥ 3. Is there a graph G which contains no K_{l+1} such that every k-colouring of the edges of G contains a monochromatic copy of K_l?" + +Every component has a standard mathematical meaning: +- "contains no K_{l+1}" → K_{l+1}-free → `CliqueFree (l + 1)` +- "k-colouring of the edges" → function from edges to k colors +- "monochromatic copy of K_l" → l-clique with all edges the same color + +There is no ambiguity in the statement. It is directly and cleanly formalizable. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +**Structure:** `∀ k l, k ≥ 2 → l ≥ 3 → ∃ n G, [G is K_{l+1}-free] ∧ [every k-coloring has a monochromatic K_l]` — this faithfully captures the universal-existential structure of the problem. + +**K_{l+1}-free condition:** `G.CliqueFree (l + 1)` — correct. + +**Edge coloring:** `c : Fin n → Fin n → Fin k` colors all vertex pairs (including non-edges and the diagonal), not just edges of G. However, this is equivalent to coloring only edges because: +- The diagonal `c i i` is never inspected (the monochromatic condition requires `x ≠ y`). +- Colors on non-edges are never inspected: the monochromatic condition is checked on S where `G.IsNClique l S`, meaning all distinct pairs in S are adjacent in G. +- Universally quantifying over all functions on pairs subsumes all possible edge-only colorings (any edge-coloring can be extended to all pairs). + +So the formalization is equivalent to the intended "for every k-coloring of the edges of G." + +**Monochromatic K_l:** The condition `G.IsNClique l S ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → c x y = a` correctly requires S to be an l-clique of G with all edges monochromatic in color a. This is correct. + +**`answer(True)` framing:** The problem is solved (proved by Nešetřil and Rödl), and the answer is affirmative. `answer(True) ↔ [statement]` is the correct resolved-problem pattern. + +**One subtle point:** The coloring `c` has no constraint that it only assigns colors to edges of G (it can color non-edges too). A more precise formalization might restrict c to `G.edgeSet → Fin k`. However, as argued above, the two formulations are logically equivalent for this statement, so there is no correctness issue. + +**Verdict:** Mathematically correct and complete. No flaws identified. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | ✅ No missed opportunities | +| Citations | ⚠️ Shorthand only; full bibliographic details missing | +| Variants | ✅ All captured | +| Readability | ✅ Good | +| Formalizability | ✅ Unambiguous | +| Correctness | ✅ Correct and complete | + +**Overall:** The formalization is sound and faithfully captures Erdős Problem 924. The only actionable improvement is expanding the citation references to include full bibliographic details. diff --git a/ai-review/925.md b/ai-review/925.md new file mode 100644 index 0000000000..ed1cf2850d --- /dev/null +++ b/ai-review/925.md @@ -0,0 +1,75 @@ +# Review of Erdős Problem 925 + +## 1. Code Reuse + +**Several opportunities for reuse exist.** + +- **Independent set definition**: The formalization defines independent sets inline as `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v`. The codebase already provides `SimpleGraph.indepNum` (the independence number `α(G)`) in `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` with notation `α(G)`. Using `indepNum` would allow the statement to be reformulated more concisely as `(α(G) : ℝ) ≥ C * n ^ (1/3 + δ)`, avoiding the explicit Finset witness. Multiple other Erdős problems (750, 804, 151, 615) also define their own `IsIndepSet` helpers — a shared definition would be preferable but doesn't currently exist at the project level. + +- **`IsNotRamseyForTriangle`**: This definition (`∃ H ≤ G, H.CliqueFree 3 ∧ (G \ H).CliqueFree 3`) uses the same 2-coloring-via-subgraph pattern as Problem 582 (Folkman numbers). Problem 582 inlines the same pattern rather than factoring it out. If both problems used a shared predicate, cross-referencing would be cleaner. However, this is a minor point since the definition is short. + +## 2. Citations + +The docstring references match the website content well, with one gap: + +- **[Er69b]**: The code lists only `Erdős, P.` with no title, journal, or year. The website also gives only `[Er69b]` with no further bibliographic detail, so this appears to be a limitation of the source rather than an omission by the formalizer. Acceptable as-is. +- **[AlRo05]**: Correctly cited as `Alon, N. and Rödl, V., Sharp bounds for some multicolor Ramsey numbers, Combinatorica 25 (2005), 125-141.` This matches standard bibliographic data. +- **Related Problem 553**: The website lists Problem 553 as related, but this cross-reference is not mentioned in the docstring. Consider adding a note. +- **Sudakov's observation**: Mentioned in the docstring but without a formal citation. The website also does not provide a separate citation for Sudakov's improvement, so this is acceptable. + +## 3. Variants + +- **Equivalent Ramsey formulation**: The docstring correctly notes the equivalence: the conjecture is equivalent to asking whether `R(3,3,m) ≪ m^{3−c}` for some `c > 0`. However, this equivalent formulation is **not formalized** as a separate theorem or even as a second conjecture statement. This is understandable since formalizing multicolor Ramsey numbers `R(3,3,m)` would require additional infrastructure (the file `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` defines `hypergraphRamsey` but not the standard multicolor graph Ramsey number). +- **Quantitative bounds**: The Alon-Rödl bounds `m³/(log m)^{4+o(1)} ≪ R(3,3,m) ≪ m³/(log m)²` are mentioned in the docstring but not formalized. This is reasonable — formalizing asymptotic bounds with `o(1)` terms would be substantially more complex and is not required for the core conjecture. +- **The "easy" lower bound**: The docstring notes that an independent set of size `≫ n^{1/3}` exists easily. This is not formalized either. It could be a useful companion lemma. + +## 4. Readability + +- **Overall structure**: Clear and well-organized. The separation of `IsNotRamseyForTriangle` into its own definition with a docstring is good practice. +- **Improvement opportunity**: The independent set condition `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v` is a standard pairwise non-adjacency condition. Using Mathlib's `Set.Pairwise` or `SimpleGraph.IsIndepSet` (if available on `Finset`) would be more idiomatic. As-is, the intent is clear but slightly verbose. +- **The `answer(False)` pattern**: Using `answer(False) ↔ (conjecture statement)` correctly encodes that the conjecture was disproved. This is the standard pattern in the codebase. +- **Type casting**: The expression `(S.card : ℝ) ≥ C * (n : ℝ) ^ ((1 : ℝ) / 3 + δ)` has several explicit coercions. This is somewhat unavoidable when mixing `ℕ` and `ℝ`, and is standard for this codebase. + +## 5. Formalizability + +**High formalizability, low ambiguity.** + +The original problem statement is precise: +- "Graph on n vertices" → `SimpleGraph (Fin n)` ✓ +- "Not Ramsey for K₃" → well-defined via 2-edge-coloring ✓ +- "Independent set of size ≫ n^{1/3+δ}" → existential over δ, C, and n₀ ✓ + +The only minor ambiguity is in the asymptotic notation `≫`, which the formalization correctly resolves by introducing explicit constants `C > 0` and a threshold `n₀`. This is the standard way to formalize such statements. + +**Assessment**: The problem is unambiguously formalizable. No meaningful ambiguity exists. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`IsNotRamseyForTriangle`**: A graph G is not Ramsey for K₃ iff its edges can be 2-colored with no monochromatic triangle. The formalization captures this as: there exists a subgraph H ≤ G such that both H and G \ H are triangle-free (CliqueFree 3). This is correct — H represents edges of one color, G \ H the other, and the ≤ constraint ensures we only color edges of G. ✓ + +- **Main statement structure**: `∃ δ > 0, ∃ C > 0, ∃ n₀, ∀ n ≥ n₀, ∀ G, IsNotRamseyForTriangle G → ∃ large independent set`. This correctly captures "for all sufficiently large n, every such graph has an independent set of size at least C · n^{1/3+δ}". ✓ + +- **`answer(False)`**: The conjecture was **disproved** by Alon and Rödl, so the answer is `False`. The biconditional `answer(False) ↔ (statement)` means the statement itself is false, which is correct. ✓ + +- **Independent set encoding**: The set S is a `Finset (Fin n)` with `∀ u ∈ S, ∀ v ∈ S, u ≠ v → ¬G.Adj u v`. This correctly defines an independent set. ✓ + +- **Exponent**: `(1 : ℝ) / 3 + δ` correctly represents 1/3 + δ in the reals. ✓ + +- **No missing quantifiers or reversed implications detected.** + +**One subtlety worth noting**: The formalization universally quantifies over all `n ≥ n₀` and all graphs on `Fin n`, which correctly captures "for all large n" and "every graph on n vertices." The `Fin n` representation is standard for finite graphs in this codebase. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Could use `indepNum` or factor out `IsIndepSet`; shares pattern with Problem 582 | +| Citations | Complete relative to source; consider adding cross-reference to Problem 553 | +| Variants | Core conjecture formalized; equivalent Ramsey formulation and quantitative bounds are docstring-only (reasonable) | +| Readability | Good; minor improvement possible with Mathlib's independence predicates | +| Formalizability | Unambiguous; straightforward formalization | +| Correctness | **Correct and complete** | diff --git a/ai-review/926.md b/ai-review/926.md new file mode 100644 index 0000000000..9b79816fa1 --- /dev/null +++ b/ai-review/926.md @@ -0,0 +1,85 @@ +# AI Review: Erdős Problem 926 + +## 1. Code Reuse + +**`ContainsSubgraph` and `turanNumber` are duplicated extensively.** The definitions in `Erdos926` (lines 47–55) are identical to those in Problems 59, 87, 113, 146, 147, 180, 575, 576, 1079, and many others. There is no shared definition in `FormalConjecturesForMathlib`. A shared `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/TuranNumber.lean` (or similar) would eliminate ~15+ copies of `ContainsSubgraph` and `turanNumber`. + +Note that there are two variants in the codebase: +- **`edgeFinset.card`** version (used here, and in 59, 146, 575, 576, 1079) — requires `DecidableRel F.Adj` and `Fintype V`. +- **`edgeSet.ncard`** version (used in 571, 572, 713, 714, 765, 766) — uses `Set.ncard` instead. + +These are mathematically equivalent for finite graphs but differ in their typeclass requirements. The `edgeFinset.card` variant used in 926 is the more common one and would be the natural candidate for a shared definition. + +The `graphHk` construction is specific to this problem and cannot be reused. + +## 2. Citations + +**Website citations** (from [erdosproblems.com/926](https://www.erdosproblems.com/926)): +- [Er69b] Erdős, P., 1969. +- [Er71] Erdős, P., 1971. (p.103) +- [Er74c] Erdős, P., 1974. (p.79) +- [Er93] Erdős, P., 1993. (p.334) +- [Fu91] Füredi, Z., 1991. +- [AKS03] Alon, N., Krivelevich, M., and Sudakov, B., 2003. + +**Formalization citations** (lines 29–38): List [Er69b], [Er71], [Er74c], [Er93], [Fu91], [AKS03]. + +**Assessment:** The citation keys match the website. However, the formalization provides only shorthand references (author, year) without titles, journals, or page numbers. For comparison, Problem 146's docstring includes full bibliographic entries: +> [AKS03] Alon, N., Krivelevich, M., and Sudakov, B., *Turán numbers of bipartite graphs and related Ramsey-type questions*, Combinatorics, Probability and Computing 12 (2003), no. 5-6, 477-494. + +The website itself only provides shorthand keys, so the formalization is consistent with its source. However, expanding to full citations (as done in 146) would improve scholarly value. + +## 3. Variants + +**Missing context from the website:** +- The website notes that $H_k$ is **2-degenerate**, making this a special case of **Problem 146** (the Erdős–Simonovits conjecture for $r=2$). This relationship is not mentioned in the formalization's docstring. +- The website mentions that **$H_k$ minus vertex $x$** is the subject of **Problem 1021**. Not mentioned. +- The website notes that **Erdős claimed a proof for $k=3$**, which is why the formalization restricts to $k \geq 4$. This is correctly captured. +- The website mentions a **lower bound**: $\mathrm{ex}(n; H_k) \gg n^{3/2}$ (since $H_k$ contains $C_4$ for $k \geq 3$). This matching lower bound is not formalized, though since the problem only asks about the upper bound, this is not strictly necessary. + +**The formalization captures only the main conjecture (upper bound for $k \geq 4$).** The stronger results of Füredi ($O((kn)^{3/2})$) and Alon–Krivelevich–Sudakov ($O(kn^{3/2})$) are mentioned in the docstring but not formalized as separate statements. Since these give the explicit $k$-dependence of the constant $C$, they are strictly stronger than what is formalized (which allows $C$ to depend arbitrarily on $k$). This is a reasonable choice, as the problem as posed by Erdős only asks for the $n^{3/2}$ exponent. + +## 4. Readability + +**Generally good.** Specific observations: + +- The `HkVertex` type alias (line 59) is well-chosen: `Unit ⊕ Fin k ⊕ { p : Fin k × Fin k // p.1 < p.2 }` clearly separates the center vertex, spoke vertices, and pair vertices. +- The `graphHk` adjacency definition (lines 64–88) is clear with pattern matching, though the `symm` and `loopless` proofs are somewhat verbose. The `symm` proof enumerates all 9 cases, most of which are trivial. This is fine for correctness but could potentially be shortened with `tauto` or `aesop`. +- The `loopless` proof on line 88 uses `nofun` for the pair vertex case, which correctly handles the impossibility of `a < a` (via `p.1 < p.2` when `i = a ∧ i = b` would force `a = b`). However, it might be clearer to add a brief comment explaining this. +- The theorem statement (lines 101–105) uses `answer(True) ↔ ...`, which is the standard pattern in this codebase for solved problems. + +## 5. Formalizability + +**High formalizability.** The problem statement is precise and unambiguous: + +- The graph $H_k$ is fully specified: vertices, edges, and the constraint that each pair $(y_i, y_j)$ maps to a **unique** $z_{ij}$. +- The Turán number $\mathrm{ex}(n; H_k)$ is a standard, well-defined extremal graph theory quantity. +- The bound $\mathrm{ex}(n; H_k) \ll_k n^{3/2}$ has a clear mathematical meaning: for each $k$, there exists $C = C(k) > 0$ such that $\mathrm{ex}(n; H_k) \leq C \cdot n^{3/2}$ for all $n \geq 1$. + +**Ambiguity assessment: None.** Every component of the statement has a standard mathematical definition. The only minor question is whether the bound should hold for all $n \geq 1$ or just sufficiently large $n$, but since we allow $C$ to depend on $k$ (and $C \cdot 1^{3/2} = C$ can absorb any finite initial segment), this distinction is immaterial. The formalization correctly uses $1 \leq n$. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### Graph $H_k$ construction +- **Vertex set:** `Unit ⊕ Fin k ⊕ { p : Fin k × Fin k // p.1 < p.2 }` correctly has $1 + k + \binom{k}{2}$ vertices, matching the problem statement. +- **Edges from $x$ to $y_i$:** The cases `Sum.inl () ↔ Sum.inr (Sum.inl _)` correctly make $x$ adjacent to all $y_i$ (lines 66–67). +- **Edges from $z_{ij}$ to $y_i, y_j$:** The cases `Sum.inr (Sum.inl i) ↔ Sum.inr (Sum.inr ⟨(a, b), _⟩)` with condition `i = a ∨ i = b` correctly make each pair vertex $z_{ab}$ adjacent to exactly $y_a$ and $y_b$ (lines 68–69). +- **No other edges:** The catch-all `| _, _ => False` ensures no spurious edges (line 70). +- **Symmetry:** Verified by exhaustive case analysis (lines 71–82). +- **Irreflexivity:** The `loopless` proof (lines 83–88) correctly handles all three vertex types. For pair vertices $z_{ab}$, self-adjacency would require `a = a ∨ a = b` (i.e., `True ∨ a = b`), but wait — actually the adjacency `Sum.inr (Sum.inr _) ↔ Sum.inr (Sum.inr _)` falls into the catch-all `False` case, so self-loops on pair vertices are excluded by the `_ _ => False` pattern. The `nofun` tactic correctly dispatches this. For spoke vertices, `Sum.inr (Sum.inl _) ↔ Sum.inr (Sum.inl _)` also falls into the catch-all. For the center, `Sum.inl () ↔ Sum.inl ()` falls into the catch-all. All correct. + +### Theorem statement +- The quantifier structure `∀ k, 4 ≤ k → ∃ C, 0 < C ∧ ∀ n, 1 ≤ n → ...` correctly captures "$\mathrm{ex}(n; H_k) \ll_k n^{3/2}$" where the implicit constant depends on $k$. +- The bound `(turanNumber (graphHk k) n : ℝ) ≤ C * (n : ℝ) ^ ((3 : ℝ) / 2)` is the correct formalization. +- The `answer(True)` wrapper correctly indicates this is a solved problem (yes, the bound holds). +- The restriction to $k \geq 4$ matches the problem statement. (For $k \leq 3$, $H_k$ has at most $O(1)$ vertices so the extremal question is trivial or doesn't match the intended structure.) + +### `turanNumber` definition +- Uses `sSup` over a set of natural numbers, which is well-defined in `ℕ` (the supremum of a set of natural numbers exists in `ℕ ∪ {0}` if bounded, or equals 0 if empty). For $n = 0$, the only graph is the empty graph, so `turanNumber H 0 = 0`. For $n \geq 1$ and any $H$ with at least 2 vertices, there exist $H$-free graphs (e.g., the empty graph), so the set is nonempty. The set is bounded above by $\binom{n}{2}$, so `sSup` is well-defined and equals the true maximum. This is correct. + +### Potential issue: `sSup` on unbounded/empty sets +- If the set in the `sSup` definition happened to be empty (which it isn't for the cases that matter), `sSup ∅ = 0` in `ℕ`, which is a reasonable default. No issue in practice. + +**Verdict: The formalization is correct and complete for the problem as stated by Erdős. No mathematical flaws detected.** diff --git a/ai-review/927.md b/ai-review/927.md new file mode 100644 index 0000000000..e27ce1e0ae --- /dev/null +++ b/ai-review/927.md @@ -0,0 +1,107 @@ +# Review: Erdős Problem 927 + +## 1. Code Reuse + +**Significant opportunity missed.** Mathlib already provides comprehensive clique infrastructure in `Mathlib.Combinatorics.SimpleGraph.Clique`: + +- `SimpleGraph.IsClique (s : Set α)` — defined as `s.Pairwise G.Adj`, semantically equivalent to the custom `IsCliqueSet`. +- `Maximal G.IsClique s` — maximal clique predicate, equivalent to `IsMaxCliqueSet`. +- `SimpleGraph.IsNClique n s` — clique with specified size. +- `SimpleGraph.cliqueSet n` — the set of all n-cliques. + +The formalization defines three custom predicates (`IsCliqueSet`, `IsMaxCliqueSet`, `graphCliqueSizes`) that duplicate Mathlib functionality. Recommended refactoring: + +```lean +-- Instead of custom IsCliqueSet: +-- Use G.IsClique (↑S : Set (Fin n)) + +-- Instead of custom IsMaxCliqueSet: +-- Use Maximal (fun S : Finset (Fin n) => G.IsClique ↑S) S + +-- graphCliqueSizes could be defined in terms of Mathlib's clique predicates +``` + +This would enable use of existing Mathlib lemmas (e.g., `isMaximalClique_iff`, various monotonicity results) and reduce proof burden. + +The related problem 775 defines analogous hypergraph-specific versions, which is appropriate since Mathlib's clique infrastructure is for simple graphs only. No cross-reuse opportunity between 927 and 775. + +## 2. Citations + +**Incomplete.** The website lists the following sources not mentioned in the formalization: + +| Source | Status in formalization | +|--------|----------------------| +| [Er66b] | **Missing** — original Erdős source | +| [Er71, p.101] | **Missing** — original Erdős source | +| [Er69b] | **Missing** — original Erdős source | +| Moon & Moser [MoMo65] | **Missing** — established the initial bounds n − log₂ n − 2 log log n < g(n) ≤ n − ⌊log₂ n⌋ | +| Spencer [Sp71] | Present (as `[Sp71]`) | + +The docstring should include the full citation: Spencer, J., *The number of distinct clique sizes of a graph*, and ideally the Moon–Moser reference since their upper bound g(n) ≤ n − ⌊log₂ n⌋ contextualizes the problem. + +## 3. Variants + +**Partially captured.** + +- **Spencer's lower bound** (g(n) ≥ n − ⌊log₂ n⌋ − O(1)): ✅ Formalized as `erdos_927.variants.spencer_lower_bound`. +- **Moon–Moser upper bound** (g(n) ≤ n − ⌊log₂ n⌋): ❌ Not formalized. This is a classical result that, combined with Spencer's lower bound, pins down g(n) = n − ⌊log₂ n⌋ + Θ(1). It would be a natural and valuable variant. +- **Erdős's improved lower bound** (g(n) > n − log₂ n − log*(n) − O(1)): ❌ Not formalized. This was Erdős's own improvement over Moon–Moser's lower bound. Omission is understandable since formalizing log* adds complexity, and Spencer's result supersedes it. +- **Connection to Problem 775** (hypergraph generalization): Mentioned in the docstring via "See also [775]." ✅ + +Recommended addition: the Moon–Moser upper bound, which is a clean statement and completes the asymptotic picture. + +## 4. Readability + +**Good overall, minor suggestions.** + +- The docstring clearly explains the disproof and the formalization strategy (capturing a necessary consequence of the conjecture rather than the exact asymptotic statement). This is well-motivated. +- The helper definitions (`IsCliqueSet`, `IsMaxCliqueSet`, `graphCliqueSizes`) have clear docstrings. +- The namespace `Erdos927` is appropriate. +- Minor: the main theorem's RHS universally quantifies over all graphs (`∀ G`), which implicitly captures g(n) since g(n) = max over G. The docstring explains this, but a brief inline comment in the Lean code could help. +- If refactored to use Mathlib's clique definitions, the file would be shorter and more idiomatic. + +## 5. Formalizability + +**High — well-suited for formalization.** + +The original conjecture involves g(n) = n − log₂ n − log*(n) + O(1), which has two sources of imprecision: +- **O(1) notation**: asymptotic, but standard to formalize via ∃ C, ∀ n, |·| ≤ C. +- **log\*(n)**: the iterated logarithm is well-defined but not in Mathlib. This is the main barrier to formalizing the exact conjecture. + +The formalization cleverly sidesteps both issues by formalizing a *necessary consequence*: since log*(n) → ∞, the conjecture implies g(n) ≤ n − ⌊log₂ n⌋ − C for any fixed C and sufficiently large n. This is a clean, unambiguous statement with no formalization ambiguity. + +**Ambiguity assessment: Low.** The formalized statement is a precise logical consequence of the original conjecture with no room for misinterpretation. + +## 6. Correctness + +**Mathematically correct.** Detailed analysis: + +### Main theorem (`erdos_927`) +The RHS states: ∀ C, ∃ n₀, ∀ n ≥ n₀, ∀ G : SimpleGraph (Fin n), |clique sizes of G| + ⌊log₂ n⌋ + C ≤ n. + +This is equivalent to: for every C, eventually g(n) ≤ n − ⌊log₂ n⌋ − C, i.e., n − g(n) − ⌊log₂ n⌋ → ∞. + +- The original conjecture g(n) = n − log₂ n − log*(n) + O(1) implies this (since log*(n) → ∞). ✅ +- Spencer's result g(n) ≥ n − ⌊log₂ n⌋ − O(1) contradicts this (it means n − g(n) − ⌊log₂ n⌋ is bounded). ✅ +- Therefore `answer(False)` is correct. ✅ + +### Spencer's lower bound (`erdos_927.variants.spencer_lower_bound`) +States: ∃ C : ℕ, ∀ n, ∃ G : SimpleGraph (Fin n), |clique sizes of G| + C ≥ n − ⌊log₂ n⌋. + +This correctly captures Spencer's result that g(n) ≥ n − ⌊log₂ n⌋ − C for some constant C. ✅ + +### Potential concerns (all minor): +1. **`ncard` on potentially non-`Finite` sets**: `graphCliqueSizes G` is a `Set ℕ`, and `ncard` returns 0 for infinite sets. For `G : SimpleGraph (Fin n)`, this set is always finite (at most n+1 possible sizes), but Lean won't know this automatically. Any proof will need to establish `Set.Finite (graphCliqueSizes G)` to use `ncard` meaningfully. This is not a correctness issue but a proof obligation. +2. **Edge cases with natural subtraction**: In the Spencer variant, `n - Nat.log 2 n` uses natural subtraction (truncated at 0). For small n this is harmless — e.g., when n = 0, the inequality becomes `0 + C ≥ 0`, trivially true. No correctness issue. +3. **`Nat.log 2 n` vs `⌊log₂ n⌋`**: `Nat.log 2 n` computes ⌊log₂ n⌋ for n ≥ 1 and returns 0 for n = 0. This matches the mathematical intent. ✅ + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Mathlib's `SimpleGraph.IsClique` / `Maximal` should replace custom definitions | +| Citations | Missing [Er66b], [Er71], [Er69b], [MoMo65] | +| Variants | Spencer's bound ✅; Moon–Moser upper bound missing | +| Readability | Good; would improve with Mathlib clique primitives | +| Formalizability | High; clever reduction avoids log* | +| Correctness | Correct and complete | diff --git a/ai-review/928.md b/ai-review/928.md new file mode 100644 index 0000000000..eeda2a1550 --- /dev/null +++ b/ai-review/928.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 928 + +## 1. Code Reuse + +Several definitions in this file duplicate existing infrastructure in the codebase: + +- **`largestPrimeFactor`**: Defined locally using `n.primeFactors.max'`. However, `Nat.maxPrimeFac` already exists in `FormalConjecturesForMathlib/Data/Nat/MaxPrimeFac.lean` with useful lemmas (`prime_maxPrimeFac_of_one_lt`, `one_lt_maxPrimeFac_iff`, `maxPrimeFac_zero`, `maxPrimeFac_one`). The definitions are mathematically equivalent for `n ≥ 2` (both return 0 for `n ≤ 1`), though they use different implementation strategies (`Finset.max'` vs `sSup`). Switching to `Nat.maxPrimeFac` would allow reuse of proven lemmas. At minimum, at least 5 other problem files (368, 372, 683, 841, etc.) also define their own `largestPrimeFactor`; consolidation is warranted. + +- **`dickmanRho`**: Declared `opaque` here. An identical `opaque` declaration exists in `Erdos783.dickmanRho` (Problem 783). These should ideally be a single shared definition to ensure theorems about the Dickman function compose across problems. + +- **`HasNaturalDensity`**: Defined locally. A more general `Set.HasDensity` exists in `FormalConjecturesForMathlib/Data/Set/Density.lean`, which specializes to natural density when `β = ℕ` and `A = Set.univ`. The library version also comes with proven lemmas (`mono`, `nonneg`, `univ`, `empty`, `hasDensity_zero_of_finite`, etc.) and related concepts (`HasLogDensity`, `upperDensity`, `lowerDensity`). Note a minor semantic difference: the library version uses `Iio b` (elements < b) while the local version uses `{i | 1 ≤ i ∧ i ≤ N}` (elements in [1, N]). These yield the same limit, but proofs of equivalence would be needed. Adopting the library version is recommended. + +**Recommendation**: Replace all three local definitions with their library counterparts. + +## 2. Citations + +Comparing against [erdosproblems.com/928](https://www.erdosproblems.com/928): + +| Citation | Website | Formalization | Status | +|----------|---------|---------------|--------| +| [Er76d] Erdős, P., *Problems in number theory and combinatorics* | ✓ | ✓ | OK | +| [ErPo78] Erdős, P. and Pomerance, C. | ✓ | ✓ (incomplete — no title) | **Incomplete** | +| [Di30] Dickman, K. | ✓ | ✓ | OK | +| [Te18] Teräväinen, J. | ✓ | ✓ | OK | +| [Wa21] Wang, Z. | ✓ | ✓ | OK | +| Schinzel (1967) | ✓ (mentioned on website) | ✗ | **Missing** | +| Related to Problem #370 | ✓ (listed on website) | ✗ | **Missing** | + +- The `[ErPo78]` citation is missing its title. The website does not provide the full title either, but typically this refers to Erdős and Pomerance's work on the largest prime factor of consecutive integers. +- Schinzel's 1967 result (that for infinitely many n, the largest prime factor of n(n+1) is at most n^{O(1/log log n)}) is mentioned on the website but not in the formalization's docstring. +- The website lists Problem #370 as related; a cross-reference would be helpful. + +## 3. Variants + +The original Erdős problem asks: *"Does the density exist?"* — a yes/no question. The formalization captures the stronger expected resolution: the density exists **and** equals ρ(1/α)·ρ(1/β). This is appropriate since the weaker existence-only question would be less informative, and the product formula is the universally expected answer based on the independence heuristic. + +**Missing variants**: + +- **Logarithmic density version (Teräväinen [Te18])**: The docstring mentions that Teräväinen proved the logarithmic density exists and equals ρ(1/α)ρ(1/β). This is a proven result (not a conjecture) and could be formalized as a separate `proof_wanted` statement. The infrastructure for this exists: `Set.HasLogDensity` is defined in `FormalConjecturesForMathlib/Data/Set/Density.lean`. + +- **Conditional result (Wang [Wa21])**: The natural density result conditional on the Elliott–Halberstam conjecture for friable integers could be formalized as a separate statement, though this would require formalizing the Elliott–Halberstam conjecture itself. + +- **Asymmetric generalization**: The problem could consider α, β ∈ (0, ∞) rather than (0, 1), though the case α, β ∈ (0, 1) is the interesting one since ρ(u) = 1 for u ≤ 1 makes larger values trivial. + +## 4. Readability + +The code is well-structured and readable. Minor suggestions: + +- The docstring for `smoothConsecutiveSet` uses the notation $P(n)$ but the code uses `largestPrimeFactor`; this is fine as mathematical convention. +- The `n ≥ 2` constraint in `smoothConsecutiveSet` is well-motivated (avoiding the degenerate case n = 1 where largestPrimeFactor returns 0) but could benefit from a brief comment explaining why. +- The `open Set Filter` is clean and appropriate. +- The namespace `Erdos928` prevents name collisions effectively. + +## 5. Formalizability + +**Assessment: High formalizability with one caveat.** + +The problem statement is precise and unambiguous: for fixed α, β ∈ (0,1), does a specific limit exist and equal a specific value? The Dickman function ρ is a well-defined mathematical object (the unique continuous solution to the delay-differential equation uρ'(u) = −ρ(u−1) with ρ(u) = 1 for 0 ≤ u ≤ 1). + +The main caveat is that `dickmanRho` is declared `opaque` with no axioms or properties. This means the conjecture statement is technically vacuous — it asserts something about an opaque function that could be anything. For the formalization to be meaningful as a proof target, one would need either: +1. A constructive definition of the Dickman function, or +2. Axioms characterizing it (the delay-differential equation, boundary conditions, continuity). + +This is a standard limitation of opaque declarations in this codebase and is acceptable for a conjecture statement, but worth noting. + +**Ambiguity level: Very low.** The mathematical content is completely precise. + +## 6. Correctness + +**Overall assessment: Mathematically correct, with minor observations.** + +### Correct aspects: +- The `largestPrimeFactor` definition correctly returns 0 for n ≤ 1 and the maximum prime factor for n ≥ 2. +- The `smoothConsecutiveSet` correctly captures {n ≥ 2 : P(n) < n^α ∧ P(n+1) < (n+1)^β}. +- The strict inequality P(n) < n^α matches the standard formulation (n is n^α-smooth means all prime factors are < n^α). +- The `HasNaturalDensity` definition correctly computes |S ∩ [1,N]| / N as N → ∞. +- The `answer(sorry)` pattern correctly handles the open status — if the conjecture is true, `answer(sorry)` would be `True`; if false (density doesn't exist or has a different value), it would be `False`. +- The quantifier structure `∀ α β, 0 < α → α < 1 → 0 < β → β < 1 → ...` correctly restricts to the open unit interval. + +### Observations: +- The conjecture conflates density existence with a specific value. If the density exists but doesn't equal ρ(1/α)·ρ(1/β), the `answer(sorry)` would be `False`, meaning "there exist α, β for which the formula fails." This doesn't distinguish "density doesn't exist" from "density exists with wrong value." This is a minor limitation of the `answer(sorry)` encoding but is acceptable. +- The `@[category research open, AMS 11]` annotation correctly marks this as an open research problem in number theory. +- The cast `(largestPrimeFactor n : ℝ)` and `(n : ℝ) ^ α` correctly lift the comparison to ℝ, which is necessary since α is real-valued. + +### No mathematical errors detected. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | **Needs improvement** — three local definitions duplicate library infrastructure | +| Citations | **Minor gaps** — missing Schinzel reference and Problem #370 cross-reference | +| Variants | **Partial** — logarithmic density result (Teräväinen) could be a separate `proof_wanted` | +| Readability | **Good** | +| Formalizability | **High** — precise statement, opaque Dickman function is the only caveat | +| Correctness | **Correct** — no mathematical errors | diff --git a/ai-review/929.md b/ai-review/929.md new file mode 100644 index 0000000000..acefdc61f6 --- /dev/null +++ b/ai-review/929.md @@ -0,0 +1,75 @@ +# Review: Erdős Problem 929 + +## 1. Code Reuse + +Several related definitions exist across the codebase that could potentially be unified: + +- **`IsSmooth`**: Problem 929 defines `IsSmooth x m` as `∀ p ∈ m.primeFactors, p ≤ x`. Problem 983 defines `IsSmoothWrt a P` (smooth w.r.t. a set of primes). Problem 928 uses `largestPrimeFactor` to express a related smoothness condition. These are conceptually close but not identical. A shared `IsSmooth` definition in `FormalConjecturesForMathlib` could serve at least problems 928 and 929 (983 uses a different notion—smoothness w.r.t. an arbitrary prime set rather than a threshold). + +- **`HasPositiveUpperDensity`**: At least 20 files define density-related predicates (upper density, natural density, logarithmic density). Problem 928 defines `HasNaturalDensity`. Problem 929's `HasPositiveUpperDensity` is a distinct concept (existential rather than limit-based), but a shared library of density definitions would reduce duplication. Other files (e.g., 335, 342, 378, 432, 448) also define upper density locally. + +**Recommendation**: Extract `IsSmooth` and `HasPositiveUpperDensity` into shared utilities in `FormalConjecturesForMathlib`. + +## 2. Citations + +The formalization cites: + +> [Er76d] Erdős, P., *Problems in number theory and combinatorics*. Proceedings of the Sixth Manitoba Conference on Numerical Mathematics (1976), 35-58. + +The website (erdosproblems.com/929) lists the reference as **[Er76d]** and credits contributor **Sarosh Adenwalla**. The citation in the formalization matches the website's reference. + +The website also mentions known results by **Ford, Green, Konyagin, Maynard, and Tao** (upper bound $S(k) \ll k \frac{\log\log\log k}{\log\log k \log\log\log\log k}$) and a lower bound from **Rosser's sieve** ($S(k) > k^{1/2-o(1)}$). These are not cited in the formalization, which is acceptable since they are known results rather than the source of the conjecture, but mentioning them in the module docstring would add useful context. + +## 3. Variants + +The website states the problem as: **"Estimate $S(k)$"** — in particular, is it true that $S(k) \geq k^{1-o(1)}$? + +The formalization captures only the specific lower bound conjecture ($S(k) \geq k^{1-o(1)}$), not the broader question of estimating $S(k)$. This is reasonable since the lower bound is the central open conjecture. However, the formalization does not capture: + +- The trivial upper bound $S(k) \leq k+1$. +- The known lower bound $S(k) > k^{1/2-o(1)}$ from Rosser's sieve. +- The Ford–Green–Konyagin–Maynard–Tao upper bound. + +These are known results rather than conjectures, so omitting them from the formal statement is appropriate. They could be noted in the docstring for completeness. + +**No missing variants of the conjecture itself.** + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The `noncomputable` annotation on `HasPositiveUpperDensity` is unnecessary since it is a `Prop` (propositions are always computable in Lean's logic). Removing it would be slightly cleaner, though it causes no harm. +- The definitions are well-named and the docstrings clearly explain the mathematical content. +- The module docstring accurately summarizes the problem. + +**Overall readability is good.** + +## 5. Formalizability + +The problem is **highly formalizable** as stated. The key concepts — smooth numbers, consecutive blocks, and upper density — all have clean, unambiguous mathematical definitions. + +The one source of mild ambiguity in the original problem is the meaning of "$S(k) \geq k^{1-o(1)}$". The formalization correctly interprets this as: for every $\varepsilon > 0$, for all sufficiently large $k$, $S(k) \geq k^{1-\varepsilon}$. This is the standard interpretation of "$\geq k^{1-o(1)}$" in analytic number theory. + +The formalization avoids explicitly defining $S(k)$ (as the infimum of a set of natural numbers), instead directly stating the consequence of $S(k) \geq k^{1-\varepsilon}$. This is a clean choice that sidesteps the question of whether $S(k)$ is well-defined (it is, since $S(k) \leq k+1$ trivially, but the formalization need not prove this). + +**Assessment: No ambiguity. Fully formalizable.** + +## 6. Correctness + +### Definition-level analysis: + +- **`IsSmooth x m`**: Correct. For $m \geq 2$, this says all prime factors of $m$ are $\leq x$. For $m = 0$ and $m = 1$, `primeFactors` is empty, so the predicate holds vacuously. This is mathematically standard — $0$ and $1$ are considered smooth for any $x$, since they have no prime factors. In the context of the problem, the values $n+1, \ldots, n+k$ are always $\geq 1$ (and $\geq 2$ for $n \geq 1$), so the edge cases don't affect the conjecture. + +- **`smoothConsecutiveBlockSet k x`**: Correct. Uses $1 \leq i \leq k$ to capture $n+1, \ldots, n+k$. When $k = 0$, the set is all of $\mathbb{N}$ (vacuously), and when $k = 1$, it's the set of $n$ with $n+1$ being $x$-smooth. The conjecture quantifies over sufficiently large $k$, so these edge cases are harmless. + +- **`HasPositiveUpperDensity S`**: Correct. This is the standard definition: $\exists \delta > 0$ such that $\limsup_{N \to \infty} |S \cap [1,N]| / N \geq \delta$. The formulation using $\forall N_0, \exists N \geq N_0$ with ratio $\geq \delta$ is equivalent to the limsup being $\geq \delta$. + +### Theorem-level analysis: + +The formal statement says: for every $\varepsilon > 0$, there exists $K$ such that for all $k \geq K$ and all $x$ with $(x : \mathbb{R}) < (k : \mathbb{R})^{1-\varepsilon}$, the smooth consecutive block set does not have positive upper density. + +This is equivalent to: $S(k) \geq k^{1-\varepsilon}$ for all sufficiently large $k$ (depending on $\varepsilon$), which is exactly the standard meaning of $S(k) \geq k^{1-o(1)}$. + +**One subtle point**: The comparison $x < k^{1-\varepsilon}$ uses a real cast of the natural number $x$. Since $x$ is a natural number and $k^{1-\varepsilon}$ is real, this is the correct way to express the bound. For $\varepsilon \geq 1$, the exponent $1 - \varepsilon \leq 0$ makes $k^{1-\varepsilon} \leq 1$ for $k \geq 1$, so no natural $x \geq 1$ satisfies $x < k^{1-\varepsilon}$, and the statement is vacuously true. This is mathematically correct — the conjecture is only nontrivial for $\varepsilon \in (0,1)$. + +**Assessment: The formalization is mathematically correct and complete. No flaws identified.** diff --git a/ai-review/93.md b/ai-review/93.md new file mode 100644 index 0000000000..caba637786 --- /dev/null +++ b/ai-review/93.md @@ -0,0 +1,102 @@ +# AI Review: Erdős Problem 93 + +**File:** `FormalConjectures/ErdosProblems/93.lean` + +--- + +## 1. Code Reuse + +**There are two significant reuse opportunities:** + +- **`ConvexIndep` (2d.lean:60–61):** `FormalConjecturesForMathlib/Geometry/2d.lean` defines `ConvexIndep (S : Set ℝ²) : Prop := ∀ a ∈ S, a ∉ convexHull ℝ (S \ {a})`. This is mathematically identical to the local `InConvexPosition` definition on line 39, since `ℝ²` is `EuclideanSpace ℝ (Fin 2)`. The only difference is that `ConvexIndep` takes a `Set ℝ²` whereas `InConvexPosition` takes a `Finset (EuclideanSpace ℝ (Fin 2))`. The local definition could be replaced by `ConvexIndep (↑A)`, or alternatively the formalization could be refactored to use `ConvexIndep` directly. Note that Problems 94, 96, 216, 651, 660, and 838 each define their own local `InConvexPosition`/`ConvexPosition` variants — this is a codebase-wide duplication issue. + +- **`distinctDistances` (2d.lean:194–195):** A `distinctDistances` function already exists in `FormalConjecturesForMathlib/Geometry/2d.lean`, returning `.card` (a `ℕ`) rather than the `Finset ℝ` that Problem 93 returns. Problem 1082 also defines its own local `distinctDistances` returning `ℕ`. The local definition in Problem 93 is reasonable (returning the `Finset` rather than just the cardinality) but could be unified with the shared version by comparing `.card`. + +**Recommendation:** Replace the local `InConvexPosition` with `ConvexIndep` from 2d.lean (or at minimum, add a comment cross-referencing it). Consider whether the `distinctDistances` definition should return a `Finset ℝ` (as here) or `ℕ` (as in 2d.lean) and unify across the codebase. + +--- + +## 2. Citations + +**Website sources:** The [erdosproblems.com/93](https://www.erdosproblems.com/93) page lists the following original Erdős sources: [Er46b], [Er57], [Er61], [Er75f, p.100], [Er82e], [Er87b, p.175], [Er90], [Er92e], [Er95], [Er97e], [Er97f]. + +**Current formalization citations:** The docstring mentions only [Al63] (Altman's proof paper) — this is appropriate since Altman proved the result, and the citation is correctly formatted with full bibliographic details matching the website. + +**Missing context:** The docstring does not reference any of the original Erdős source papers. While not strictly necessary (the problem is identified by number and linked to erdosproblems.com), adding at least one original Erdős reference (e.g., [Er46b] as the earliest source) would improve scholarly completeness. + +**No issues found** with the Altman citation itself — it accurately matches the website. + +--- + +## 3. Variants + +**The website identifies three related variants:** + +1. **Problem 982 (stronger, open):** Some single vertex determines ≥ ⌊n/2⌋ distinct distances. This is formalized in `ErdosProblems/982.lean` as a separate problem — correctly handled. + +2. **Problem 1082 (Szemerédi's variant, open):** Replace "convex position" with "no three collinear." This is formalized in `ErdosProblems/1082.lean` — correctly handled as a separate problem. + +3. **Problem 660 (3D version, open):** Vertices of a convex polyhedron in ℝ³ determine ≥ (1−o(1))n/2 distinct distances. This is formalized in `ErdosProblems/660.lean` — correctly handled. + +**Assessment:** All known variants are captured across separate files, which is the appropriate approach. No missing variants. + +--- + +## 4. Readability + +The code is clean and well-structured. Specific observations: + +- **Good:** The docstrings for both `InConvexPosition` and `distinctDistances` are clear and provide mathematical context. +- **Good:** The namespace `Erdos93` keeps definitions scoped. +- **Good:** The `offDiag` pattern for distance computation is idiomatic and consistent with the codebase convention (used in Problems 90, 96, 605, 1082, etc.). +- **Minor:** The coercion `(↑A : Set (EuclideanSpace ℝ (Fin 2))) \ {p}` on line 40 is slightly verbose compared to the `A.erase p` pattern used in Problems 660 (line 41) and 96 (line 36). Using `↑(A.erase p)` would be more concise and consistent with peer files, though mathematically equivalent. +- **Minor:** The hypothesis `hn : 2 ≤ A.card` could alternatively be `hn : A.Nontrivial` or some similar predicate, but the current form is perfectly clear and directly usable. + +**Overall readability: Good.** No significant issues. + +--- + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement "If n points in ℝ² are in convex position, they determine at least ⌊n/2⌋ distinct distances" is precise: + +- "Convex position" has a standard mathematical definition (no point in the convex hull of the others), which is faithfully captured. +- "Distinct distances" is unambiguous — the number of distinct values in {dist(p,q) : p ≠ q, p,q ∈ A}. +- The bound ⌊n/2⌋ is precise. + +There is **no ambiguity** in this problem statement. It is one of the more straightforwardly formalizable Erdős problems. + +--- + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +- **`InConvexPosition` (line 39–40):** The definition `∀ p ∈ A, p ∉ convexHull ℝ ((↑A : Set ...) \ {p})` correctly captures convex position (a.k.a. convex independence). Since `A` is a `Finset`, all elements are distinct by construction — no additional injectivity hypothesis is needed. + +- **`distinctDistances` (line 46–47):** `A.offDiag.image (fun pq => dist pq.1 pq.2)` correctly computes the set of all pairwise distances between distinct points. `offDiag` produces all ordered pairs (p, q) with p ≠ q; applying `dist` and taking the image gives the set of distinct distance values. This is correct. + +- **Theorem statement (line 54–58):** `A.card / 2 ≤ (distinctDistances A).card` where `/` is natural number division (i.e., ⌊n/2⌋). This exactly matches the problem statement. + +- **Hypothesis `2 ≤ A.card`:** This is a reasonable guard. The theorem is actually vacuously/trivially true for n = 0 and n = 1 (both sides equal 0), so this hypothesis is not strictly necessary but is good mathematical hygiene — the problem is only interesting for n ≥ 2. + +- **Tags `@[category research solved, AMS 52]`:** Correct. The problem is solved (by Altman, 1963). AMS 52 (Convex and discrete geometry) is appropriate. + +**Potential subtle issue:** The `dist` function on `EuclideanSpace ℝ (Fin 2)` is the standard Euclidean distance, which is correct for this problem. No issues here. + +**Verdict: No mathematical errors found.** The formalization is a faithful and complete translation of the problem. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Moderate opportunity | `ConvexIndep` from 2d.lean could replace local `InConvexPosition` | +| Citations | Good | Altman citation accurate; could add original Erdős source | +| Variants | Complete | All website variants exist as separate problems | +| Readability | Good | Minor style inconsistency with `erase` vs set difference | +| Formalizability | Excellent | Unambiguous, precise statement | +| Correctness | Correct | No mathematical errors | diff --git a/ai-review/933.md b/ai-review/933.md new file mode 100644 index 0000000000..59fa6bc451 --- /dev/null +++ b/ai-review/933.md @@ -0,0 +1,94 @@ +# Review: Erdős Problem 933 + +## 1. Code Reuse + +The `smoothPart23` definition uses `padicValNat` directly for primes 2 and 3. Several related definitions exist in the codebase: + +- **Problem 684** (`smoothPart`): A general k-smooth part via `∏ p ∈ (Finset.range (k+1)).filter Nat.Prime, p ^ (m.factorization p)`. This is more general but heavier—using it here would require `smoothPart (n*(n+1)) 3`, which includes only primes ≤ 3 (i.e., {2, 3}), so it would be equivalent. However, the current `padicValNat`-based approach is more direct and readable for the specific {2, 3} case. +- **Problem 461** (`smoothComponent`): Uses `n.factorization.support.filter (· < t)` with a strict inequality convention. Similar but not directly applicable. +- **Problem 1146** (`smoothNumbers23`): Defines the *set* of {2,3}-smooth numbers as `{k | ∃ m n : ℕ, k = 2 ^ m * 3 ^ n}`. This is a membership predicate rather than an extraction function, so not directly reusable here. +- **Problem 935** (`powerfulPart`): Structurally similar (extract a specific part of factorization, then form a limsup question), but semantically different. + +**Verdict:** The current `smoothPart23` is well-suited. The `padicValNat` approach is the cleanest formulation for this specific two-prime case. No compelling reason to refactor toward a shared definition, though if a central `smoothPart` utility were ever created in `FormalConjecturesForMathlib`, this could adopt it. + +## 2. Citations + +The website ([erdosproblems.com/933](https://www.erdosproblems.com/933)) lists: +- **Original source:** Erdős [Er76d] +- **Additional credit:** Stefan Steinerberger (for the explicit construction showing the weaker bound holds infinitely often) + +The formalization cites: +> [Er76d] Erdős, P., _Problems in number theory and combinatorics_ (1976). + +**Issues:** +- The Steinerberger contribution is not mentioned in the docstring. The docstring says "Erdős wrote that 'it is easy to see' that for infinitely many n, 2^k · 3^l > n · log n," but does not credit Steinerberger's explicit construction (taking n = 2^{3^r}). +- The full title of [Er76d] should be verified. The website only provides the reference code, not the full bibliographic entry. The title "Problems in number theory and combinatorics" is plausible for Erdős (1976) but may be inexact—the Proceedings reference for this era is sometimes cited as part of the Manitoba Conference proceedings (similar to the [Er79d] citation in Problem 684). + +**Recommendation:** Add a note crediting Steinerberger for the explicit construction, consistent with the website's attribution. + +## 3. Variants + +The formalization captures the main question (limsup = ∞). The following related results are mentioned on the website but not formalized: + +1. **Mahler's upper bound:** 2^k · 3^l < n^{1+o(1)}. This is mentioned in the docstring but could be formalized as a separate theorem (e.g., `erdos_933.variants.mahler_upper_bound`), analogous to the upper bound variant in Problem 684. +2. **Steinerberger's construction:** Taking n = 2^{3^r} yields 2^k · 3^l > n · log n for infinitely many n. This proves the C = 1 case of the main conjecture and could be a formalized variant (e.g., `erdos_933.variants.steinerberger`). +3. **The weaker "infinitely often" statement:** That 2^k · 3^l > n · log n for infinitely many n (without the "for all C" quantifier). This is strictly weaker than the limsup = ∞ statement and is the claim Erdős describes as "easy to see." + +**Verdict:** The main conjecture is captured. Adding Mahler's bound and/or Steinerberger's construction as variants would improve completeness, following the pattern established by Problem 935 (which has three parts). + +## 4. Readability + +The code is clean and well-structured: +- The `smoothPart23` definition is concise and self-documenting with a clear docstring. +- The theorem statement unfolds the limsup = ∞ condition into an explicit ε-N form, which is standard and readable. +- The module docstring provides good mathematical context. +- The namespace `Erdos933` keeps definitions scoped appropriately. + +**Minor suggestion:** The docstring for `erdos_933` uses both the original notation ($2^k \cdot 3^l$) and the formalized concept ("the {2,3}-smooth part"), which is helpful for bridging the mathematical and formal statements. + +**Verdict:** No readability issues. + +## 5. Formalizability + +The problem is fully precise and unambiguous: +- The decomposition n(n+1) = 2^k · 3^l · m with gcd(m, 6) = 1 uniquely determines k, l, and m. +- The limsup condition has a standard ε-N formalization. +- All quantities involved (p-adic valuations, products, logarithms, real coercions) are available in Mathlib. + +**Ambiguity assessment:** None. The problem as stated on the website is completely precise. The only interpretive choice is whether "limsup = ∞" means the formalized ∀C > 0, ∀N, ∃n ≥ N condition—which it does, by standard analysis. + +**Verdict:** Fully formalizable with no ambiguity. + +## 6. Correctness + +**Definition correctness:** `smoothPart23 (n : ℕ) := 2 ^ padicValNat 2 n * 3 ^ padicValNat 3 n` correctly computes the {2,3}-smooth part. For n > 0, `padicValNat p n` gives the exact p-adic valuation, so the product 2^{v_2(n)} · 3^{v_3(n)} extracts exactly the {2,3}-smooth part. The definition is applied to `n * (n + 1)` in the theorem, and since `padicValNat` is additive on coprime inputs (n and n+1 are always coprime), `smoothPart23 (n * (n + 1)) = 2^{v_2(n) + v_2(n+1)} · 3^{v_3(n) + v_3(n+1)}`, which equals 2^k · 3^l from the problem statement. + +**Edge case:** When n = 0, `n * (n + 1) = 0` and `padicValNat p 0 = 0` in Mathlib, giving `smoothPart23 0 = 1`. This is harmless since the theorem quantifies over arbitrarily large n. + +**Theorem correctness:** The statement + +``` +∀ C : ℝ, C > 0 → ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + (smoothPart23 (n * (n + 1)) : ℝ) > C * (n : ℝ) * Real.log (n : ℝ) +``` + +is the standard unfolding of `limsup_{n → ∞} smoothPart23(n(n+1)) / (n log n) = ∞`. This is mathematically correct. + +**The `answer(sorry)` wrapper:** Since the problem is open, wrapping with `answer(sorry) ↔ ...` is appropriate—it leaves the truth value undetermined while correctly stating what would need to be proved (or disproved). + +**Category tag:** `category research open` matches the website status. + +**Verdict:** The formalization is mathematically correct and complete for the main conjecture. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Good — current approach is clean; no compelling shared utility to adopt | +| Citations | Minor gap — Steinerberger credit missing | +| Variants | Mahler upper bound and Steinerberger construction could be added | +| Readability | Excellent | +| Formalizability | Fully precise, no ambiguity | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization. The main improvement opportunities are (1) crediting Steinerberger in the docstring and (2) optionally adding the Mahler upper bound and Steinerberger construction as formalized variants. diff --git a/ai-review/934.md b/ai-review/934.md new file mode 100644 index 0000000000..e527edf41e --- /dev/null +++ b/ai-review/934.md @@ -0,0 +1,88 @@ +# AI Review: Erdős Problem 934 + +## 1. Code Reuse + +**Potential overlap with Erdős 149.** Problem 149 (`FormalConjectures/ErdosProblems/149.lean`) defines `IsStronglyIndepEdgeSet`, which captures pairs of edges where all cross-endpoint pairs are non-adjacent — exactly the `EdgesAtDist G e₁ e₂ 2` condition. The `EdgesAtDist` definition in 934 generalizes this to arbitrary distance `t`. One could refactor `IsStronglyIndepEdgeSet` in terms of `EdgesAtDist`, or extract `EdgesAtDist` into a shared module (e.g., `ForMathlib/Combinatorics/SimpleGraph/`), but the conceptual gain is modest since each problem uses the concept differently (149 partitions edges into strongly independent sets; 934 asks for existence of a single pair at distance ≥ t). + +No other directly reusable code was found in `ForMathlib/`. The `ForMathlib` graph modules (`DiamExtra.lean`, `Invariants.lean`, `Definitions.lean`) deal with eccentricity, diameter, Wiener index, etc., but none provide an edge-distance predicate. + +**Verdict:** Minor reuse opportunity; not critical. + +## 2. Citations + +The docstring cites: +- [Er88] Erdős and Nešetřil (1989) ✓ +- [CGTT90] Chung, Gyárfás, Tuza, Trotter (1990) ✓ +- [CCJK22] Cambie, Cames van Batenburg, de Joannis de Verclos, Kang (2022) ✓ + +**Missing from the docstring:** The website also attributes related work to **Bermond, Bond, Paoli, and Peyrat [BBPP83]**, who (alongside Erdős–Nešetřil) conjectured the t=2 bound h₂(d) ≤ 5/4 d² + 1 with equality for even d. Since this is mentioned on the website, it should be included for completeness: + +> [BBPP83] Bermond, J.-C., Bond, J., Paoli, M., and Peyrat, C., *Graphs and Interconnection Networks: Diameter and Vulnerability*. Surveys in Combinatorics (1983). + +Additionally, the website mentions the specific result h₃(3) = 23 proved by Cambie et al. and their conjecture for t=3 (h₃(d) ≤ d³ − d² + d + 2, with equality iff d = p^k + 1 for prime power p^k). These could be noted in the docstring. + +## 3. Variants + +The formalization captures the two directions of the asymptotic conjecture from [CCJK22]: +- **Upper bound** (`erdos_934`): h_t(d) ≤ (1 + o(1))d^t for t ≥ 3 ✓ +- **Lower bound** (`erdos_934.variants.lower_bound`): h_t(d) ≥ (1 − o(1))d^t for infinitely many d, t ≥ 3 ✓ + +**Not formalized (but mentioned on the website or in the docstring):** +1. **t = 3 conjecture** (Cambie et al.): h₃(d) ≤ d³ − d² + d + 2, conjectured with equality iff d = p^k + 1 — this is an open conjecture that could be a variant. +2. **Known upper bounds** (proved theorems): h_t(d) ≤ 2d^t, h_t(d) ≤ 3/2 d^t + 1, h_1(d) = d + 1, h₂(d) ≤ 5/4 d² + 1 — these are results, not conjectures, so omitting them is reasonable. +3. **Known lower bound** (proved): h_t(d) ≥ 0.629^t d^t for infinitely many d — also a result, not a conjecture. + +The most notable missing variant is the **t = 3 specific conjecture** from Cambie et al., which is a sharper open conjecture than the asymptotic statement. + +## 4. Readability + +The code is clean and well-structured: +- The `EdgesAtDist` definition is clearly documented with a precise mathematical description and a note about disconnected-component semantics. +- The module docstring provides good mathematical context with known bounds and references. +- The namespace `Erdos934` keeps definitions contained. +- The theorem names (`erdos_934`, `erdos_934.variants.lower_bound`) follow the project convention. + +**Minor suggestion:** The quantifier structure in `erdos_934` is deeply nested (6 levels of ∀/∃). This is inherent to the statement, but adding a brief inline comment like `-- h_t(d) ≤ (1+ε)d^t for large d` next to the theorem signature could aid quick scanning. + +**Verdict:** Good readability; no significant issues. + +## 5. Formalizability + +The original problem statement ("Estimate h_t(d)") is inherently vague — it asks for bounds rather than an exact value. The formalization resolves this ambiguity by formalizing the specific asymptotic conjecture from [CCJK22]: h_t(d) ~ d^t as d → ∞ for t ≥ 3. This is a well-defined, precise mathematical statement. + +The restriction to t ≥ 3 is appropriate: the t = 1 case is solved (h₁(d) = d + 1), and the t = 2 case is the subject of the separate Erdős–Nešetřil conjecture (Problem 149). + +The ε-δ formulation (for all ε > 0, there exists D₀ such that...) correctly captures the asymptotic "1 + o(1)" and "1 − o(1)" behavior. + +**Verdict:** Low ambiguity; the chosen formalization is a natural and precise interpretation. + +## 6. Correctness + +### EdgesAtDist definition +The definition `EdgesAtDist G e₁ e₂ t` requires ∀ u ∈ e₁, ∀ v ∈ e₂, G.Reachable u v → t ≤ G.dist u v. This correctly captures "the minimum vertex-distance between any endpoint of e₁ and any endpoint of e₂ is ≥ t." + +- **Consistency with h₁(d) = d + 1:** EdgesAtDist with t = 1 means all cross-endpoint pairs have dist ≥ 1, i.e., the edges are vertex-disjoint. The maximum number of edges in a graph with max degree d and no vertex-disjoint pair is d (a star K_{1,d}), so h₁(d) = d + 1. ✓ +- **Consistency with h₂(d):** EdgesAtDist with t = 2 means all cross-endpoint pairs have dist ≥ 2, i.e., no endpoint of e₁ is adjacent to any endpoint of e₂ — this is the "strongly independent" / "induced matching" condition. Consistent with the Erdős–Nešetřil conjecture. ✓ +- **Disconnected components:** When u and v are in different components, `G.Reachable u v` is false, so the implication is vacuously true. This correctly treats unreachable vertex pairs as being at infinite distance. The guard is necessary because `SimpleGraph.dist` returns 0 for unreachable pairs. ✓ + +### Upper bound theorem +Correctly states: for t ≥ 3, ∀ ε > 0, ∃ D₀, ∀ d ≥ D₀, any finite graph with maxDegree ≤ d and > (1+ε)d^t edges has two distinct edges at distance ≥ t. This is h_t(d) ≤ (1+o(1))d^t. ✓ + +### Lower bound theorem +Correctly states: for t ≥ 3, ∀ ε > 0, ∀ D₀, ∃ d ≥ D₀ and a graph with maxDegree ≤ d, ≥ (1−ε)d^t edges, and no two distinct edges at distance ≥ t. The "∀ D₀, ∃ d ≥ D₀" correctly captures "infinitely many d." The existential graph is over `Fin n` which is appropriately concrete. ✓ + +### Use of `open Classical` +Provides all decidability instances needed for `maxDegree` and `edgeFinset`, avoiding explicit `[DecidableRel G.Adj]` / `[DecidableEq V]` arguments. Standard practice. ✓ + +**Verdict:** Mathematically correct and complete for the asymptotic conjecture. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Minor opportunity (shared `EdgesAtDist` with Problem 149); not critical | +| Citations | Missing [BBPP83] reference from the website | +| Variants | Main conjecture captured; t=3 specific conjecture from Cambie et al. could be added | +| Readability | Good | +| Formalizability | Precise; low ambiguity | +| Correctness | Correct and complete | diff --git a/ai-review/935.md b/ai-review/935.md new file mode 100644 index 0000000000..7b63d17d52 --- /dev/null +++ b/ai-review/935.md @@ -0,0 +1,120 @@ +# AI Review: Erdős Problem 935 + +## 1. Code Reuse + +**Major issue: duplicate definition.** The `powerfulPart` definition in `Erdos935` (935.lean:37–39) is *identical* to `twoFullPart` in `Erdos367` (367.lean:38–40): + +```lean +-- 935.lean +noncomputable def powerfulPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) + +-- 367.lean +noncomputable def twoFullPart (n : ℕ) : ℕ := + (n.factorization.support.filter (fun p => 2 ≤ n.factorization p)).prod + (fun p => p ^ n.factorization p) +``` + +These should be unified into a single definition in `FormalConjecturesForMathlib`, imported by both problems. A natural home would be `FormalConjecturesForMathlib/Data/Nat/Full.lean`, which already defines the `Nat.Full` predicate and the `Nat.Powerful` abbreviation for 2-fullness. A shared `Nat.powerfulPart` (or, more generally, `Nat.fullPart (k : ℕ) (n : ℕ) : ℕ` parameterized by fullness level) would complement the existing predicate-based API. + +The `squarefreePart`/`squarePart` decomposition in `FormalConjecturesForMathlib/Data/Nat/Squarefree.lean` is conceptually dual (it extracts factors with exponent exactly 1 vs. ≥ 2) and could provide a template for the shared definition. + +## 2. Citations + +The formalization's module docstring references only `erdosproblems.com/935`. The website provides additional context that should be included: + +- **Mahler's result**: $\limsup_{n\to\infty} Q_2(n(n+1)\cdots(n+\ell))/n^2 \geq 1$ for all $\ell \geq 1$. +- **Pell equation resolution**: Part 2 was resolved via solutions to $x^2 - 8y^2 = 1$ (the Part 2 docstring mentions this, which is good). +- **ABC conjecture connection**: The ABC conjecture implies a positive answer to Part 3. This is not mentioned anywhere in the formalization. +- **Equivalence with Problem 367**: The website states that Question 2 is equivalent to Problem 367. This cross-reference is absent. +- **Generalization to $Q_r$**: The website mentions the natural extension to $r$-full parts for $r > 2$, which is not captured. +- **Source**: The problem originates from Erdős and Graham, though no specific publication reference (e.g., [ErGr80]) is cited in 935.lean (contrast with 367.lean which cites it). + +**Recommendation**: Add a reference line similar to 367.lean's citation of [ErGr80], note the ABC conjecture connection in Part 3's docstring, and add a cross-reference to Problem 367. + +## 3. Variants + +The formalization captures the three main questions from the website: + +| Website Question | Formalization | Status | +|---|---|---| +| Q1: $Q_2 < n^{2+\varepsilon}$ for large $n$? | `erdos_935` | Open ✓ | +| Q2: $\limsup Q_2/n^2 = \infty$? | `erdos_935.variants.part2` | Solved ✓ | +| Q3: $Q_2/n^{\ell+1} \to 0$? | `erdos_935.variants.part3` | Open ✓ | + +**Missing variants:** +- The generalization to $Q_r$ for $r > 2$ (higher-order fullness) mentioned on the website is not formalized. This is a natural extension, especially given the existing `Nat.Full k` infrastructure in the codebase. +- The equivalence of Q2 with Problem 367 could be stated as a separate theorem linking the two formalizations. + +## 4. Readability + +The code is generally clear and well-structured. Minor observations: + +- The naming `powerfulPart` is good and descriptive. However, using a different name from the identical concept `twoFullPart` in Problem 367 is confusing. Unifying the name would improve cross-problem readability. +- The exponent style is slightly inconsistent: Part 2 uses `(2 : ℕ)` as a natural-number exponent (`n ^ (2 : ℕ)`), while Parts 1 and 3 use real exponents (`n ^ ((2 : ℝ) + ε)` and `n ^ ((ℓ : ℝ) + 1)`). This is mathematically forced by the presence of ε in Parts 1/3, so it is acceptable, but a brief comment in Part 2 explaining the choice would help. +- The Part 2 docstring is the most informative (mentions the Pell equation proof method). Parts 1 and 3 could benefit from similarly substantive docstrings. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The definition of the powerful (2-full) part $Q_2(n)$ is standard and unambiguous. The three questions are each precisely quantified: + +- Q1 is an $\forall\varepsilon > 0, \exists n_0$ statement — clean and standard. +- Q2 is a $\limsup = \infty$ statement — the formalization correctly encodes this as $\forall M, \forall N, \exists n \geq N$ with $Q_2 > M \cdot n^2$. +- Q3 is a limit-to-zero statement — correctly encoded as $\forall\varepsilon > 0, \exists n_0, \forall n \geq n_0$. + +The only minor ambiguity in the original problem is whether "for every $\ell \geq 1$" in Q1 means the product has $\ell$ terms or $\ell + 1$ terms (i.e., whether "$n(n+1)\cdots(n+\ell)$" means $\ell$ or $\ell+1$ factors). The formalization uses `Finset.range (ℓ + 1)` giving $\ell + 1$ factors: $n, n+1, \ldots, n+\ell$. This matches the standard reading and the website's notation. + +**Ambiguity score: 1/5** (essentially unambiguous). + +## 6. Correctness + +### Part 1 (`erdos_935`) + +**Mathematically correct.** The formalization asks: for all $\ell \geq 1$ and $\varepsilon > 0$, is $Q_2(n(n+1)\cdots(n+\ell)) < n^{2+\varepsilon}$ for sufficiently large $n$? This matches the website's Q1. + +Note: Unlike Problem 367 which uses big-O with an explicit constant $C$, Problem 935 Part 1 omits the constant. This is mathematically equivalent since for any $C > 0$ and $\varepsilon > 0$, we have $C \cdot n^{2+\varepsilon/2} < n^{2+\varepsilon}$ for large enough $n$, so the constant can always be absorbed into a slightly larger $\varepsilon$. + +The use of `answer(sorry)` is correct for an open problem whose truth value is unknown. + +### Part 2 (`erdos_935.variants.part2`) + +**Mathematically correct.** The statement asserts: for all $\ell \geq 2$, $M \in \mathbb{R}$, and $N \in \mathbb{N}$, there exists $n \geq N$ with $Q_2 > M \cdot n^2$. This is exactly the statement $\limsup_{n \to \infty} Q_2/n^2 = \infty$. + +Correctly marked as `category research solved`. + +**Subtle point**: The quantifier $\forall M : \mathbb{R}$ includes negative $M$, which makes the statement trivially satisfiable for negative $M$. This is harmless (the interesting content is for $M > 0$), but a purist might restrict to $M > 0$. This is a stylistic rather than correctness issue — the statement is logically equivalent either way for the limsup interpretation. + +### Part 3 (`erdos_935.variants.part3`) + +**Mathematically correct.** The statement asks whether $Q_2(n(n+1)\cdots(n+\ell)) < \varepsilon \cdot n^{\ell+1}$ for all sufficiently large $n$, for every $\ell \geq 2$ and $\varepsilon > 0$. This correctly captures $\lim_{n \to \infty} Q_2/n^{\ell+1} = 0$. + +The use of `answer(sorry)` is correct for an open problem. + +**Minor note on exponent**: The exponent is `(ℓ : ℝ) + 1` (real-valued). Since $\ell$ is a natural number, $\ell + 1$ is always a positive integer, and `rpow` agrees with `npow` on positive integer exponents for positive bases. For $n = 0$ the comparison is vacuously handled by the $\exists n_0$ quantifier. No issue here. + +### `powerfulPart` definition + +**Correct.** The definition computes $\prod_{p : k_p \geq 2} p^{k_p}$ where $k_p$ is the $p$-adic valuation of $n$. This matches the standard definition of the 2-full (powerful) part. + +**Edge case**: `powerfulPart 0 = 1` (empty product over empty support, since `(0 : ℕ).factorization = 0`). This is a harmless convention since all three theorems concern sufficiently large $n$. + +**Edge case**: `powerfulPart 1 = 1` (correct — 1 has no prime factors). + +### Overall Correctness Assessment + +The formalization is **correct and complete** for the three questions stated on the website. No mathematical flaws are apparent. The only missing aspects are the $Q_r$ generalization and the cross-reference to Problem 367, which are enrichments rather than correctness issues. + +--- + +## Summary of Recommendations + +| Priority | Item | +|---|---| +| **High** | Unify `powerfulPart` (935) and `twoFullPart` (367) into a shared definition in `FormalConjecturesForMathlib/Data/Nat/Full.lean` | +| **Medium** | Add [ErGr80] citation and ABC conjecture note to docstrings | +| **Medium** | Add cross-reference to Problem 367 (equivalence with Q2) | +| **Low** | Consider adding $Q_r$ generalization variant | +| **Low** | Minor: restrict $M > 0$ in Part 2 for cleanliness (optional) | diff --git a/ai-review/937.md b/ai-review/937.md new file mode 100644 index 0000000000..bcb70fdaa8 --- /dev/null +++ b/ai-review/937.md @@ -0,0 +1,103 @@ +# AI Review: Erdős Problem 937 + +## 1. Code Reuse + +**Issue found.** The file defines its own local `IsPowerful` predicate in the `Erdos937` namespace: + +```lean +def IsPowerful (n : ℕ) : Prop := + ∀ p : ℕ, p.Prime → p ∣ n → p ^ 2 ∣ n +``` + +However, the codebase already provides `Nat.Powerful` (an abbreviation for `Nat.Full 2`) in `FormalConjecturesForMathlib/Data/Nat/Full.lean`: + +```lean +abbrev Powerful : ℕ → Prop := (2).Full +-- where Full k n := ∀ p ∈ n.primeFactors, p^k ∣ n +``` + +This shared definition is already used by neighboring Erdős problems: +- **936.lean** uses `n.Powerful` directly +- **137.lean** uses `(∏ x ∈ ..., x).Powerful` +- **OEIS/63880.lean** uses `n.Powerful` + +The local `IsPowerful` is semantically equivalent to `Nat.Powerful` (the difference between `p.Prime → p ∣ n → ...` and `p ∈ n.primeFactors → ...` is cosmetic for positive `n`; for `n = 0`, both hold vacuously). The file should import `FormalConjecturesForMathlib.Data.Nat.Full` and use `Nat.Powerful` for consistency and to benefit from the `Decidable` instance and auxiliary lemmas already proven there. + +Additionally, the `Decidable` instance on `Nat.Powerful` in `Full.lean` would allow `#eval`-based sanity checks, which is not possible with the current opaque `Prop`-valued definition. + +## 2. Citations + +**Minor issue.** The docstring cites: + +> [BBC24] Bajpai, P., Bennett, M.A., and Chan, T.H., *Arithmetic progressions of powerful numbers*, 2024. + +The erdosproblems.com page lists the original source as **[Er76d, p.33]**, which is not mentioned in the formalization. The website also notes the problem was last edited 31 October 2025. The BBC24 citation for the resolution is correct. + +**Recommendation:** Add the original source reference `[Er76d, p.33]` alongside the resolution citation. + +## 3. Variants + +**Significant omission.** The erdosproblems.com page describes a richer family of conjectures beyond the basic four-term AP result: + +1. **r-powerful generalization (r ≥ 4):** Erdős conjectured that for r ≥ 4, there are only finitely many three-term APs of coprime r-powerful numbers. Bajpai–Bennett–Chan proved this conditional on the ABC conjecture. + +2. **3-powerful case:** Erdős conjectured infinitely many three-term APs of coprime 3-powerful numbers exist, but only finitely many four-term APs. BBC24 proved the first part unconditionally. + +3. **Without coprimality:** The page notes that without the coprimality requirement, constructing arbitrarily long APs of powerful numbers is trivial (via a simple scaling argument). + +None of these variants are captured. Problems 939 and 940 cover related but distinct territory (sums of r-powerful numbers, density questions), so these AP-length/r-power variants are genuinely missing from the codebase. + +**Recommendation:** Add variant statements, particularly the three-term AP results for 3-powerful and r-powerful numbers, and the conditional finiteness result for r ≥ 4 (under ABC). + +## 4. Readability + +**Good overall, with minor suggestions:** + +- The pairwise coprimality is spelled out as all six pairs explicitly. This is clear but verbose. An alternative would be to define the four-element set and use `Set.Pairwise _ Nat.Coprime`, which would be more concise and scale better to variants with different AP lengths. However, the explicit enumeration is arguably more transparent for verification. + +- The condition `0 < a` is redundant given the coprimality constraints: if any two of the four AP terms are coprime and positive (which `0 < d` ensures for at least some), then `a` cannot be zero (since `Nat.Coprime 0 (0 + d)` requires `d = 1`, which is fine, but `IsPowerful 0` holds vacuously, which may not be intended). Actually, `Nat.Coprime a (a + d)` with `0 < d` does allow `a = 0` (since `gcd(0, d) = d`, coprimality would force `d = 1`). So `0 < a` is not fully redundant—it excludes the degenerate case where the AP starts at 0. This is appropriate since 0 is not typically considered a powerful number in the combinatorial sense. + +- The docstring accurately describes the formalization. + +## 5. Formalizability + +**High.** The problem statement is entirely precise: +- "Powerful number" has a standard, unambiguous definition. +- "Four-term arithmetic progression" is standard. +- "Coprime" (pairwise) is standard. +- "Infinitely many" is captured by the ∀ N, ∃ a d, N ≤ a formulation. + +There is essentially no ambiguity in the original problem statement. The only interpretive choice is whether "coprime" means pairwise coprime or mutually coprime (gcd of all four equals 1). The formalization correctly chooses pairwise coprime, which is the stronger and standard interpretation matching the literature and the erdosproblems.com description. + +**Assessment: Unambiguous, fully formalizable.** + +## 6. Correctness + +**The formalization is mathematically correct and complete for the main statement**, with the following observations: + +- **answer(True):** The problem is stated as proved (affirmative), so `answer(True)` is correct. + +- **Infinitely many APs:** The ∀ N, ∃ a d, N ≤ a formulation correctly captures "infinitely many" four-term APs by ensuring progressions with arbitrarily large first term. + +- **Pairwise coprimality:** All six pairs are checked, which is the correct interpretation of "coprime" in this context. + +- **Powerful number definition:** The local `IsPowerful` definition correctly captures the standard notion. Note it admits 0 and 1 as powerful (vacuously/trivially), which is mathematically standard but worth noting—the `0 < a` and `0 < d` constraints prevent trivial solutions involving 0. + +- **Subtle point about 1:** The number 1 is powerful under this definition (vacuously, having no prime divisors). The formalization does not exclude it. This is correct—1 being powerful is standard, and if a valid AP happens to contain 1, it should count. In practice, the coprimality and AP structure make it impossible for 1 to appear in a four-term AP with common difference d > 0 where all terms are powerful (since 1 + d, 1 + 2d, 1 + 3d would all need to be powerful and coprime to 1, which they automatically are, but also coprime to each other). + +- **No issues with natural number subtraction:** Since the AP terms are a, a+d, a+2d, a+3d (all additions), there are no natural number subtraction pitfalls. + +**Overall assessment: Correct.** + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Needs fix | Should use `Nat.Powerful` from `Full.lean` instead of local `IsPowerful` | +| Citations | ⚠️ Minor | Missing original source [Er76d, p.33] | +| Variants | ⚠️ Missing | r-powerful generalizations and 3-powerful three-term AP variants not captured | +| Readability | ✅ Good | Clear, explicit, minor verbosity in coprimality | +| Formalizability | ✅ Excellent | Unambiguous problem, straightforward formalization | +| Correctness | ✅ Correct | Mathematically sound formalization of the main statement | diff --git a/ai-review/94.md b/ai-review/94.md new file mode 100644 index 0000000000..19f3e6cf04 --- /dev/null +++ b/ai-review/94.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 94 + +## 1. Code Reuse + +**Several opportunities for reuse exist:** + +- **`ConvexPosition`**: This is defined locally in `Erdos94` (line 38) but is essentially identical to: + - `Erdos93.InConvexPosition` (93.lean:39) — same definition, different name + - `Erdos96.ConvexPosition` (96.lean:35) — same concept but uses `P.erase p` instead of set difference `\ {p}` + - `EuclideanGeometry.ConvexIndep` in `FormalConjecturesForMathlib/Geometry/2d.lean:60` — the canonical shared definition + + **Recommendation:** Import and use `EuclideanGeometry.ConvexIndep` from the shared library rather than redefining. This is exactly the purpose of that definition. + +- **`distSqSum`**: Problem 95 (95.lean:45-46) already defines `distMultiplicity` and `distinctDistances` which could be reused. Problem 94's `distSqSum` is an alternative encoding of `∑_i f(u_i)²` as a count of ordered 4-tuples. The Problem 95 approach (`distinctDistances P).sum (fun d => (distMultiplicity P d) ^ 2)`) is more direct and readable. The current encoding as `Set.ncard` over a set comprehension of 4-tuples is mathematically equivalent (up to a factor of 4) but nonstandard compared to the rest of the codebase. + + **Recommendation:** Rewrite `distSqSum` using the same `distMultiplicity`/`distinctDistances` decomposition as Problem 95, or import those definitions directly. + +## 2. Citations + +**The website (erdosproblems.com/94) lists the following references:** +- [Er92e], [Er95, p.181], [Er97c], [Er97f] +- [LeTh95] Lefmann, H. and Thiele, T. + +**The formalization only cites:** +- [LeTh95] Lefmann, H. and Thiele, T., *Point sets with distinct distances*. Combinatorica 15 (1995), 379–408. + +**Issues:** +- The primary Erdős references [Er92e], [Er95], [Er97c], [Er97f] are missing. At minimum [Er92e] (origin of the problem) should be cited. +- The website notes that Erdős offered £25 for this problem (in [Er92e]). +- The website also mentions that in [Er97c], Erdős credits Fishburn with solving this, though no reference is provided. + +## 3. Variants + +**Missing variants:** + +- **Erdős–Fishburn conjecture (not captured):** The website states that Erdős and Fishburn conjectured that `∑ f(u_i)²` is *maximal* for regular n-gons (for sufficiently large n). This is a more precise conjecture that goes beyond the O(n³) upper bound and is not formalized. + +- **Stronger hypothesis version (not captured):** The docstring mentions that Lefmann and Thiele proved the result under the weaker assumption that no three points are collinear (rather than convex position). However, the theorem statement only formalizes the convex position version. The no-three-collinear version is a strictly stronger result and could be formalized as a separate theorem or as the primary statement. The codebase already has `NonTrilinear` in `FormalConjecturesForMathlib/Geometry/2d.lean:54` which could be used. + +- **Relationship to Problem 95:** The website says "see also Problem 95." Problem 95 is the general (non-convex) version where ∑f(u_i)² ≪ n^{3+ε}. Problem 94 is the convex-position specialization with the sharper O(n³) bound. This relationship is not documented in the formalization. + +## 4. Readability + +**Issues:** + +- **`distSqSum` is hard to read.** It defines a set of 4-tuples `(a, b, c, d)` using nested pairs `E × E × E × E` with projections like `x.2.2.1` and `x.2.2.2`. This is difficult to parse. Using a structure or named fields, or better yet, using `Finset.sum` over distance multiplicities (as in Problem 95), would be far more readable. + +- **`Set.ncard` vs `Finset.card`:** The use of `Set.ncard` on a set comprehension is unusual in this codebase. Most other problems (93, 95, 96) use `Finset` operations throughout. While `Set.ncard` works correctly here (the set is finite since A is finite), it introduces unnecessary complexity. A `Finset`-based formulation would be more idiomatic. + +- **The `let E := ...` binding** on line 48 is used only for readability but the subsequent lines still have verbose `(A : Set E)` casts. This could be simplified. + +- **Namespace inconsistency:** Problem 93 uses `InConvexPosition`, Problem 94 and 96 use `ConvexPosition`. The naming should be consistent across related problems. + +## 5. Formalizability + +**Assessment: High — the problem is clearly formalizable.** + +The statement "∑ f(u_i)² = O(n³) for n points in convex position" is entirely precise. The quantities involved (convex position, pairwise distances, distance multiplicities, their squared sum) are all well-defined and have standard mathematical meanings. + +**Ambiguity level: Low.** The only mild ambiguity is whether "convex position" means strictly convex (no three collinear) or just vertices of the convex hull, but the formalization correctly captures the standard meaning (every point is extremal). The O(n³) notation means ≤ Cn³ for some absolute constant C > 0, which is correctly formalized with an existential quantifier over C. + +## 6. Correctness + +**The formalization is mathematically correct but has notable design issues:** + +- **The 4-tuple encoding is correct but indirect.** The docstring correctly states that `distSqSum` equals `4 · ∑_i f(u_i)²` where f(u_i) counts *unordered* pairs. Proof: the number of ordered pairs (a,b) with a≠b at distance u_i is 2f(u_i). The number of ordered 4-tuples (a,b,c,d) with a≠b, c≠d, dist(a,b)=dist(c,d) is ∑_i (2f(u_i))² = 4∑ f(u_i)². Since 4∑f(u_i)² ≤ Cn³ iff ∑f(u_i)² ≤ (C/4)n³, the bound is equivalent. ✓ + +- **Potential `Set.ncard` issue:** `Set.ncard` returns 0 for infinite sets. The set in `distSqSum` is always finite (it's a subset of A × A × A × A, and A is a `Finset`), so this is not a mathematical issue. However, it means a proof would need to establish finiteness of this set, adding unnecessary proof burden. A `Finset`-based definition would avoid this. + +- **The theorem statement is correct but weaker than necessary.** Lefmann and Thiele proved the O(n³) bound for the strictly stronger hypothesis "no three points are collinear," which implies convex position. The formalization only states the convex-position version. This is not *incorrect* — it's a valid (weaker) consequence — but it doesn't capture the full strength of the known result. The docstring mentions this stronger result but the formal statement doesn't reflect it. + +- **Missing `open scoped Classical`:** Problem 93 opens `Classical` but Problem 94 does not. Given the use of `Set.ncard` and noncomputable definitions, this may cause issues depending on what tactics are needed in the proof. (Minor concern.) + +## Summary + +| Category | Rating | Notes | +|----------|--------|-------| +| Code reuse | ⚠️ Needs work | Should use `ConvexIndep` from shared library; `distSqSum` should mirror Problem 95's approach | +| Citations | ⚠️ Incomplete | Missing [Er92e], [Er95], [Er97c], [Er97f] | +| Variants | ⚠️ Incomplete | Missing Erdős–Fishburn maximality conjecture; missing no-three-collinear stronger version | +| Readability | ⚠️ Needs work | 4-tuple set comprehension is hard to read; should use Finset-based approach | +| Formalizability | ✅ Good | Problem is precise and clearly formalizable | +| Correctness | ✅ Correct | Mathematically sound, though weaker than the strongest known result | diff --git a/ai-review/941.md b/ai-review/941.md new file mode 100644 index 0000000000..542f296f44 --- /dev/null +++ b/ai-review/941.md @@ -0,0 +1,89 @@ +# Review: Erdős Problem 941 + +## 1. Code Reuse + +**Issue: Local `IsPowerful` should be replaced with `Nat.Powerful` from the shared library.** + +The file defines a local `Erdos941.IsPowerful`: +```lean +def IsPowerful (n : ℕ) : Prop := + ∀ p : ℕ, p.Prime → p ∣ n → p ^ 2 ∣ n +``` + +However, `Nat.Powerful` already exists in `FormalConjecturesForMathlib/Data/Nat/Full.lean` (line 55) as `abbrev Powerful : ℕ → Prop := (2).Full`, which is definitionally equivalent. Several sibling problems already use `Nat.Powerful` directly: +- `ErdosProblems/936.lean` — uses `Nat.Powerful` +- `ErdosProblems/938.lean` — uses `Nat.Powerful` +- `ErdosProblems/942.lean` — uses `Nat.Powerful` + +Problem 937 has the same local-definition issue. The local definition should be removed in favor of `Nat.Powerful`. + +**Issue: Duplication with Problem 1107.** + +`ErdosProblems/1107.lean` contains `erdos_1107.variants.two`, which is mathematically identical to `erdos_941` (every sufficiently large integer is the sum of at most three 2-powerful numbers). Both cite Heath-Brown [He88]. One of these should reference or defer to the other, or the duplication should be acknowledged in a docstring. + +**Style inconsistency:** Problem 941 uses explicit `∃ N₀, ∀ n, N₀ ≤ n → ...` while Problem 1107 uses the idiomatic `∀ᶠ n in atTop`. The `atTop` filter style is preferred elsewhere in the codebase. + +## 2. Citations + +The website (erdosproblems.com/941) lists three references: +- **[Er76d]** — Original Erdős work +- **[He88]** — Heath-Brown, D.R., *Ternary quadratic forms and sums of three square-full numbers*. Séminaire de Théorie des Nombres, Paris 1986–87 (1988), 137–163. +- **[Ob1]** — Oberwolfach problem book (1986), where it was posed as a joint problem of Erdős and Ivić. + +The formalization only cites [He88]. The docstring should also mention: +- That this was originally a joint problem of **Erdős and Ivić**, posed in the Oberwolfach problem book (1986). +- The [Er76d] reference. + +The [He88] citation content itself is accurate and matches the website. + +## 3. Variants + +The website lists two related problems: +- **Problem 940** — related variant (not cross-referenced in the formalization). +- **Problem 1107** — generalization to r-powerful numbers for r ≥ 3. + +The formalization does not mention these related problems. The docstring could note Problem 1107 as a generalization, especially since the r = 2 case of Problem 1107 is mathematically identical to Problem 941. + +No other variants (e.g., asking for exact counts, signed versions, or effective bounds on N₀) are present on the website, so no variants are missing from that perspective. + +## 4. Readability + +The code is short and readable. Minor suggestions: + +- The docstring says "possibly zero" in parenthetical, which is helpful for understanding why "at most three" is captured. This is good. +- Using `Nat.Powerful` instead of a local definition would improve readability by connecting to the shared vocabulary used in neighboring problems. +- The `∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → ...` pattern could be replaced with `∀ᶠ n in atTop, ...` for consistency with the codebase (cf. Problem 1107). + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: "Are all large integers the sum of at most three powerful numbers?" This decomposes into: +1. A clear definition of "powerful number" (well-established in number theory). +2. A clear threshold quantifier ("all large integers" = "for all sufficiently large n"). +3. A clear arithmetic condition ("sum of at most three"). + +There is no ambiguity. The only minor subtlety — whether 0 counts as powerful — is correctly handled: 0 is vacuously powerful under the definition (every prime divides 0, and every prime squared divides 0), so allowing a, b, c = 0 correctly captures "at most three." + +## 6. Correctness + +**The formalization is mathematically correct.** + +- `IsPowerful` correctly captures powerful numbers. It is equivalent to `Nat.Powerful` from the library. +- `answer(True)` is correct: Heath-Brown proved the result affirmatively in 1988. +- The existential `∃ N₀ : ℕ, ∀ n : ℕ, N₀ ≤ n → ∃ a b c : ℕ, n = a + b + c ∧ IsPowerful a ∧ IsPowerful b ∧ IsPowerful c` correctly captures "every sufficiently large integer is the sum of at most three powerful numbers." +- The use of `ℕ` (natural numbers) rather than `ℤ` (integers) is appropriate: the problem concerns positive integers, and the threshold formulation with `N₀ ≤ n` handles this correctly. +- Since 0 is powerful under this definition, stating `n = a + b + c` with all three powerful correctly encodes "at most three" (one or two of them can be 0). +- The category tags `research solved` and `AMS 11` are appropriate. + +**No mathematical flaws identified.** + +## Summary of Recommendations + +| Item | Severity | Recommendation | +|------|----------|----------------| +| Local `IsPowerful` | Medium | Replace with `Nat.Powerful` from `FormalConjecturesForMathlib/Data/Nat/Full.lean` | +| Duplication with 1107 | Low | Cross-reference or deduplicate with `erdos_1107.variants.two` | +| Missing citations | Low | Add [Er76d], [Ob1], and mention Erdős–Ivić joint attribution | +| Style (`atTop` filter) | Low | Consider using `∀ᶠ n in atTop` for consistency | +| Related problems | Low | Mention Problems 940 and 1107 in docstring | diff --git a/ai-review/947.md b/ai-review/947.md new file mode 100644 index 0000000000..df33e631a1 --- /dev/null +++ b/ai-review/947.md @@ -0,0 +1,71 @@ +# Review: Erdős Problem 947 + +## 1. Code Reuse + +The formalization uses an ad-hoc representation (`Fin k → ℤ`, `Fin k → ℕ`) instead of the existing covering system infrastructure in `FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean`. That file defines `CoveringSystem` and `StrictCoveringSystem` (which enforces injective/distinct moduli), and is already used by related problems (e.g., Problem 7 at `FormalConjectures/ErdosProblems/7.lean`). + +However, there is a meaningful reason the ad-hoc formulation may be preferable here: `CoveringSystem.unionCovers` expresses that the union of cosets equals the whole ring (i.e., every element is covered by **at least one** class), whereas Problem 947 requires that every integer belongs to **exactly one** class. Using `StrictCoveringSystem` would require adding a separate pairwise disjointness condition on top of the existing covering condition. The `∃!` quantifier in the current formulation elegantly captures both covering and exactness in a single clause. + +**Recommendation**: The current ad-hoc formulation is acceptable for this problem's specific needs. If the project values uniformity, an `ExactCoveringSystem` structure (extending `CoveringSystem` with pairwise disjointness of cosets) could be defined in the Mathlib utilities, but this is not strictly necessary. + +## 2. Citations + +The website (erdosproblems.com/947) lists the citation **[Er77c]**. The formalization's docstring mentions Mirsky-Newman and Davenport-Rado as the provers but does not include the [Er77c] reference, which likely refers to: + +> Erdős, P., "Problems and results on combinatorial number theory III." In: Number Theory Day (Proc. Conf., Rockefeller Univ., New York, 1976), Lecture Notes in Math. 626, Springer, Berlin, 1977, pp. 43-72. + +**Recommendation**: Add the [Er77c] citation to the module docstring for completeness, following the pattern used in other problems (e.g., Problem 2, Problem 7). + +## 3. Variants + +The website does not list additional variants of this problem. The result as stated — no exact covering system with distinct moduli ≥ 2 exists — is the complete content. There is no indication of open sub-problems or generalizations associated with this specific problem number. + +**Assessment**: No missing variants. + +## 4. Readability + +The formalization is concise and readable. The docstrings clearly explain what an exact covering system is and attribute the result to Mirsky-Newman and Davenport-Rado. The Lean statement itself is straightforward: the nested existentials and the `∃!` quantifier directly mirror the mathematical statement. + +Minor suggestions: +- The module docstring and theorem docstring are somewhat redundant. This is a minor style issue. +- The notation `(↑(n i) : ℤ)` for the coercion is standard but could benefit from a brief inline comment for non-expert readers. This is optional. + +**Assessment**: Good readability overall. + +## 5. Formalizability + +The problem is entirely precise and unambiguous. An "exact covering system with distinct moduli" is a well-defined combinatorial/number-theoretic object: +- A finite set of congruence classes a_i (mod n_i) +- Moduli n_i ≥ 2, pairwise distinct +- Every integer belongs to exactly one class + +There is no ambiguity in the statement. This is a classical, cleanly stated result. + +**Assessment**: Fully formalizable with no ambiguity. + +## 6. Correctness + +The formalization is **mathematically correct**. Analyzing each component: + +1. **Finiteness**: `Fin k` ensures the collection is finite. ✓ +2. **Moduli ≥ 2**: `∀ i, 2 ≤ n i` correctly excludes trivial moduli. ✓ +3. **Distinct moduli**: `Function.Injective n` ensures all moduli are pairwise distinct. ✓ +4. **Exact covering**: `∀ x : ℤ, ∃! i : Fin k, (↑(n i) : ℤ) ∣ (x - a i)` correctly states that every integer x belongs to exactly one congruence class. The divisibility condition `n_i ∣ (x - a_i)` is equivalent to `x ≡ a_i (mod n_i)`, and `∃!` (exists unique) captures the "exactly one" requirement. ✓ +5. **Edge cases**: When `k = 0`, `Fin 0` is empty so `∃!` fails (no witness), making the inner statement false — correctly ruling out the vacuous case. When `k = 1`, a single class mod n ≥ 2 cannot cover all integers, so it's also impossible. These edge cases are handled correctly by the formulation. ✓ + +The negation `¬ ∃ ...` correctly states that no such system exists, which is the proven theorem (Mirsky-Newman, Davenport-Rado). + +**Assessment**: Correct and complete. No mathematical flaws. + +## Summary + +| Criterion | Rating | +|---|---| +| Code reuse | Acceptable (ad-hoc formulation justified by exactness requirement) | +| Citations | Missing [Er77c] reference from website | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct | + +**Overall**: The formalization is mathematically sound and captures the problem accurately. The main actionable item is adding the [Er77c] citation to match the website. diff --git a/ai-review/948.md b/ai-review/948.md new file mode 100644 index 0000000000..d5ee591387 --- /dev/null +++ b/ai-review/948.md @@ -0,0 +1,53 @@ +# AI Review: Erdős Problem 948 + +## 1. Code Reuse + +The formalization uses the same structural pattern as `ErdosProblems/532.lean` (Hindman's theorem): `Finset`, `BigOperators`, `StrictMono`, and quantification over colorings and finite subset sums. No shared utility from `FormalConjecturesForMathlib` is directly applicable — the Ramsey library (`Combinatorics/Ramsey.lean`) deals with hypergraph Ramsey numbers and graph colorings, not IP-set / finite-sum colorings. The `Combinatorics/Basic.lean` definitions (`IsSumFree`, `IsSidon`) are also not relevant here. No code reuse opportunities identified. + +## 2. Citations + +The website attributes the problem to source **[Er77c]**. The Lean file's docstring does not mention this citation. It should be added, e.g.: + +> [Er77c] Erdős, P., *Problems and results on combinatorial number theory III*, 1977. + +The docstring correctly mentions Galvin's counterexample to the monochromatic variant and the connection to Hindman's theorem / Problem 532, both of which are confirmed by the website. + +**Issue:** Missing citation [Er77c]. + +## 3. Variants + +The website notes the problem "remains open even for countably infinite colorings." The current formalization only handles finite `k`-colorings (`χ : ℕ → Fin k`). A stronger variant with `χ : ℕ → ℕ` (countably infinitely many colors), where the conclusion is that the image of the finite-sums set under χ is not surjective onto ℕ, is not captured. + +**Issue:** The countably-infinite-coloring variant mentioned on the website is not formalized. + +## 4. Readability + +The code is clean and readable. Minor suggestions: + +- The docstring says "natural numbers" while the website says "integers." Since all finite sums of a strictly increasing sequence in ℕ land in ℕ, the restriction to ℕ is equivalent — but a brief note explaining this equivalence would aid readability. +- The docstring could explicitly state the connection: "This asks whether there exists a growth bound f and number of colors k such that for any k-coloring, one can find a slowly-growing sequence whose finite-sums set omits some color." + +Overall readability is good. + +## 5. Formalizability + +The problem is precisely stated on the website and is clearly formalizable. There is minimal ambiguity: + +- **"Finite S"**: Conventionally means non-empty finite subsets (the empty sum is degenerate). The formalization correctly requires `S.Nonempty`. +- **"Does not contain all colours"**: Unambiguously means some color is missing from the image. The formalization correctly existentially quantifies over a missing color c. +- **"Integers" vs "natural numbers"**: The only mild ambiguity. Since the sequence is strictly increasing in ℕ and all sums are positive, coloring ℤ vs ℕ is equivalent for this problem. + +**Assessment:** High formalizability, low ambiguity. + +## 6. Correctness + +The formalization is mathematically correct. Detailed analysis: + +- **Outer structure** `∃ (f : ℕ → ℕ) (k : ℕ), 0 < k ∧ ∀ (χ : ℕ → Fin k), ...`: Correctly asks for the existence of a growth function f and number of colors k > 0 such that the property holds for every k-coloring. The `0 < k` guard is appropriate — without it, `Fin 0` is empty, making `χ : ℕ → Fin 0` uninhabited and the universal quantification vacuously true, while the existential `∃ (c : Fin 0), ...` in the conclusion would be false, creating a degenerate situation. +- **Strictly increasing sequence**: `StrictMono a` for `a : ℕ → ℕ` correctly captures `a_1 < a_2 < ···`. Since `a(0) ≥ 0` and the sequence is strictly increasing, all terms from index 1 onward are positive. +- **Growth bound**: `Set.Infinite {n : ℕ | a n < f n}` correctly captures "a_n < f(n) for infinitely many n." +- **Missing color**: `∃ (c : Fin k), ∀ (S : Finset ℕ), S.Nonempty → χ (∑ i ∈ S, a i) ≠ c` correctly says that some color c is never achieved by any nonempty finite subset sum. This is the correct formalization of "the set of finite sums does not contain all k colours." +- **Index set**: `S : Finset ℕ` ranges over all finite subsets of ℕ (the index set of the sequence), so `∑ i ∈ S, a i` sums distinct terms. This correctly captures all finite subset sums. +- **answer(sorry)**: Appropriate since the problem is open and the answer (yes or no) is unknown. + +**Assessment:** The formalization is correct and complete for the finite-coloring version of the problem. The only gap is the missing infinite-coloring variant (see §3), which is a separate strengthening mentioned on the website rather than the core problem statement. diff --git a/ai-review/95.md b/ai-review/95.md new file mode 100644 index 0000000000..b9a8d10c52 --- /dev/null +++ b/ai-review/95.md @@ -0,0 +1,106 @@ +# Review: Erdős Problem 95 + +**File:** `FormalConjectures/ErdosProblems/95.lean` + +--- + +## 1. Code Reuse + +Several opportunities for code reuse exist: + +- **`distinctDistances`** is defined locally in `Erdos95` using `(P.product P).filter (fun pq => pq.1 ≠ pq.2)` followed by `.image`. Nearly identical definitions exist in: + - `ErdosProblems/93.lean` — uses `A.offDiag.image (...)`, returning `Finset ℝ` + - `ErdosProblems/958.lean` — uses `(A ×ˢ A).filter (fun p => p.1 ≠ p.2)`, returning `Finset ℝ` + - `ErdosProblems/959.lean`, `1089.lean` — similar definitions + - `FormalConjecturesForMathlib/Geometry/2d.lean` — `EuclideanGeometry.distinctDistances` uses `offDiag` but returns `ℕ` (the count), not `Finset ℝ` (the set) + + A shared definition in `FormalConjecturesForMathlib` returning `Finset ℝ` would eliminate this duplication across at least five problem files. + +- **`distMultiplicity`** is defined locally and also appears (with minor variations) in `958.lean`, `959.lean`, and `957.lean`. The key difference: Problem 95 counts **ordered** pairs, while 958/959/957 divide by 2 for **unordered** pairs. A shared definition parameterized by ordered vs. unordered, or simply a single ordered-pair version with a `/2` wrapper, would reduce duplication. + +- The `P.product P` idiom could be replaced with `P ×ˢ P` (used in 958.lean) or `P.offDiag` (used in 93.lean) for consistency. Using `offDiag` is more idiomatic in Mathlib for filtering out the diagonal. + +## 2. Citations + +The formalization cites: + +> [GuKa15] Guth, L. and Katz, N.H., *On the Erdős distinct distances problem in the plane*, Annals of Mathematics **181** (2015), 155–190. + +The website (erdosproblems.com/95) lists additional references not present in the formalization: + +- **[Er92e]** — Erdős (1992) +- **[Er95]** — Erdős (1995) +- **[Er97c]** — Erdős (1997) +- **[Er97f]** — Erdős (1997) +- **[Al63]** — Referenced on the website in connection with Fishburn's solution of the convex polygon case + +The [GuKa15] citation is the most important one (being the proof), and its bibliographic data matches the website. However, the original Erdős references where the problem was posed are absent. At minimum, the docstring could note the original source(s) from Erdős. + +The website also notes this problem carried a **$500 prize**, which is not mentioned in the formalization. + +## 3. Variants + +The website mentions two variants/related results not captured: + +1. **Convex polygon special case:** "Fishburn solved the case when points determine a convex polygon." This is not formalized as a separate theorem or noted in the docstring. +2. **Related Problem 94** is explicitly cross-referenced on the website. No mention of this relationship exists in the formalization. +3. **The stronger Guth–Katz bound** $\sum f(u_i)^2 \ll n^3 \log n$ is mentioned in the docstring but not formalized as a separate, stronger theorem. Since this is what was actually proved, a formalization of the $O(n^3 \log n)$ bound would be more precise and mathematically stronger. + +## 4. Readability + +The code is generally clean and well-structured. Minor suggestions: + +- **`open Classical` vs `open scoped Classical`**: This file uses `open Classical` (line 32), while other files in the codebase (e.g., 93.lean) use `open scoped Classical`. The `scoped` variant is preferred as it limits the scope of classical logic instances. +- **`P.product P`** could be written as `P ×ˢ P` for consistency with other Erdős problem files (958, 959) and for brevity. +- The docstring on `erdos_95` is clear and mathematically accurate. The module docstring provides good context. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: given $n$ points in $\mathbb{R}^2$, bound $\sum_i f(u_i)^2$ by $C_\varepsilon \cdot n^{3+\varepsilon}$ for every $\varepsilon > 0$. The asymptotic notation $\ll_\varepsilon$ is correctly rendered as an existential statement over a positive constant $C$ depending on $\varepsilon$. + +The only minor ambiguity is whether $f(u_i)$ counts ordered or unordered pairs (see §6), but this does not affect the truth of the asymptotic statement. + +## 6. Correctness + +**Overall assessment: Correct, with one semantic discrepancy that does not affect validity.** + +### Ordered vs. unordered pairs + +The formalization's `distMultiplicity` counts **ordered** pairs $(p, q)$ with $p \neq q$ and $\operatorname{dist}(p, q) = d$. The website's problem statement uses $f(u_i)$ to count **unordered** pairs, as confirmed by the trivial identity $\sum f(u_i) = \binom{n}{2}$ mentioned on the website. (If $f$ counted ordered pairs, the sum would be $n(n-1) = 2\binom{n}{2}$.) + +However, since the ordered multiplicity is exactly $2f(d)$, we have $\sum (2f(d))^2 = 4\sum f(d)^2$. Because the constant $C$ is existentially quantified, the factor of 4 is absorbed and the two formulations are logically equivalent. So the formalization is **correct** but **semantically divergent** from the original statement. For clarity and faithfulness, dividing by 2 (as done in 958.lean) would be preferable. + +### Sum structure + +The sum $\sum_{d \in \text{distinctDistances}(P)} (\text{distMultiplicity}(P, d))^2$ correctly formalizes $\sum_i f(u_i)^2$, where the sum ranges over distinct distances. + +### Bound structure + +The bound $C \cdot n^{3+\varepsilon}$ with $C > 0$ existentially quantified after a universally quantified $\varepsilon > 0$ correctly captures $\ll_\varepsilon n^{3+\varepsilon}$. The order of quantifiers (∀ε > 0, ∃C > 0, ∀P) is correct. + +### Type coercion + +The cast `((distinctDistances P).sum (fun d => (distMultiplicity P d) ^ 2) : ℝ)` correctly coerces the natural number sum to ℝ for comparison with the real-valued bound. + +### The `solved` tag + +The theorem is tagged `category research solved`, which is correct — Guth and Katz proved this in 2015. + +### Minor note on the stronger result + +The docstring correctly notes that Guth–Katz proved the stronger bound $O(n^3 \log n)$, but only the weaker $n^{3+\varepsilon}$ bound is formalized. This is a valid choice (the weaker statement is what Erdős originally asked), but formalizing the stronger result would be more complete. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | `distinctDistances` and `distMultiplicity` duplicated across 5+ files | +| Citations | Partial | [GuKa15] correct; missing [Er92e], [Er95], [Er97c], [Er97f], [Al63] | +| Variants | Incomplete | Convex case (Fishburn), stronger Guth–Katz bound, link to Problem 94 not captured | +| Readability | Good | Minor style issues (`open Classical`, `P.product P` vs `P ×ˢ P`) | +| Formalizability | Excellent | Statement is unambiguous and precisely formalizable | +| Correctness | Correct | Ordered vs. unordered pair discrepancy is absorbed by existential constant; mathematically equivalent | diff --git a/ai-review/950.md b/ai-review/950.md new file mode 100644 index 0000000000..db1b680cfe --- /dev/null +++ b/ai-review/950.md @@ -0,0 +1,69 @@ +# AI Review: Erdős Problem 950 + +## 1. Code Reuse + +No significant code reuse opportunities identified. The function `f(n) = Σ_{p f n) Filter.atTop = 1` +- Part 2 could be stated as `Filter.limsup (fun n => f n) Filter.atTop = ⊤` (in `WithTop ℝ` or `EReal`) +- Part 3 could use `Asymptotics.IsLittleO Filter.atTop f (fun n => Real.log (Real.log n))` + +However, the explicit formulations are arguably more self-contained and readable for a standalone conjecture file, so this is a stylistic choice rather than a defect. + +## 2. Citations + +The formalization cites **[Er77c]** and attributes it to: +> Erdős, P., *Problems and results on number theory and combinatorics*. + +The [erdosproblems.com/950](https://www.erdosproblems.com/950) page confirms the citation is **[Er77c]**. The docstring also correctly attributes the background result (Σ_{n 1 / ((n : ℝ) - (p : ℝ)))` sums 1/(n−p) over primes p ∈ {0, 1, ..., n−1}. Since `Nat.Prime` excludes 0 and 1 (requiring p ≥ 2), this correctly sums over primes p with 2 ≤ p < n. For such p, (n : ℝ) − (p : ℝ) > 0, so the division is well-defined. ✓ + +**Part 1 (liminf = 1):** The formalization asserts: ∀ ε > 0, (∃ N₀, ∀ n ≥ N₀, f(n) > 1 − ε) ∧ (∀ N₀, ∃ n ≥ N₀, f(n) < 1 + ε). This is precisely the definition of liminf_{n→∞} f(n) = 1. ✓ + +**Part 2 (limsup = ∞):** The formalization asserts: ∀ M, ∀ N₀, ∃ n ≥ N₀, f(n) > M. This is exactly the definition of limsup_{n→∞} f(n) = ∞. ✓ + +**Part 3 (f(n) = o(log log n)):** The formalization asserts: ∀ ε > 0, ∃ N₀, ∀ n ≥ N₀, f(n) < ε · log(log(n)). Since f(n) ≥ 0 for all n ≥ 2 (sum of positive terms) and log(log(n)) > 0 for n ≥ 3, this is equivalent to f(n)/log(log(n)) → 0 as n → ∞, the standard definition of f(n) = o(log log n). ✓ + +**Compatibility of Parts 2 and 3:** One might wonder whether limsup = ∞ and f(n) = o(log log n) are contradictory. They are not: a function can tend to infinity while being o(log log n), e.g., f(n) = log log log n. The problem asks separate yes/no questions about each property (wrapped in `answer(sorry)`), so it does not presuppose they are simultaneously true. ✓ + +**No mathematical flaws identified. The formalization is correct and complete.** diff --git a/ai-review/953.md b/ai-review/953.md new file mode 100644 index 0000000000..2cf156ded8 --- /dev/null +++ b/ai-review/953.md @@ -0,0 +1,81 @@ +# Review: Erdős Problem 953 + +## 1. Code Reuse + +**Issue found.** The related problems 465 and 466 use `EuclideanSpace ℝ (Fin 2)` with Mathlib's built-in `dist`, while problem 953 defines a custom `euclidDist` on `ℝ × ℝ`. This is an inconsistency across the codebase and a missed opportunity for reuse. + +- `EuclideanSpace ℝ (Fin 2)` (which is `PiLp 2 (fun _ : Fin 2 => ℝ)`) provides the Euclidean L² metric via Mathlib's `dist`. Using it would eliminate the need for the custom `euclidDist` definition and allow direct use of Mathlib's metric space API (e.g., `Metric.ball` for the open ball instead of the manual set-builder `{p : ℝ × ℝ | euclidDist p (0, 0) < r}`). +- Note that the default `dist` on `ℝ × ℝ` is the L∞ (sup) norm, *not* the Euclidean distance, so the custom definition is necessary if one insists on using `ℝ × ℝ`. But switching to `EuclideanSpace ℝ (Fin 2)` would be preferable for consistency with 465/466. +- No relevant utilities in `FormalConjecturesForMathlib/` (covering systems, AP definitions, etc.) are applicable to this geometric measure theory problem. + +## 2. Citations + +**Issues found.** + +- The lower bound docstring contains `[Sá??]`, which is a broken/incomplete citation. The website attributes the lower bound to Sárközy, adapted from problem [466] by Koizumi and Kovac. The citation should reference: + - Sárközy's work from problem 466 (no specific paper given on the website for 953 itself, but problem 466 references Graham's result). + - Koizumi and Kovac as the ones who observed the adaptation. +- The original problem attribution `[Er77c]` from the website is not mentioned anywhere in the formalization. The module docstring should note this is "originally from [Er77c]" per the website. +- The website says this is "A problem of Erdős and Sárközy" — the formalization matches this in the module docstring but the lower bound theorem docstring has the garbled citation. + +## 3. Variants + +**Adequate.** The formalization captures: +- The main open question (`erdos_953`): determining the exact growth rate. +- The trivial upper bound (`erdos_953.variants.upper`): O(r). +- The known lower bound (`erdos_953.variants.lower`): Ω(r^{1/2−ε}). + +The website does not describe additional variants beyond these bounds. The references to problems [465] (upper bounds on point counts with distance-from-integer constraints) and [466] (lower bounds on point counts) are mentioned in the module docstring, which is appropriate. No mathematical variants are missing. + +## 4. Readability + +**Generally good, with minor suggestions.** + +- The `euclidDist` definition is clear and well-documented. +- The `NoIntegerDistances` predicate quantifies over `ℤ`, which is slightly more general than needed since `euclidDist` is always non-negative and `a ≠ b` implies `euclidDist a b > 0`. Quantifying over `ℕ+` (positive naturals) would more precisely capture the mathematical intent, though the current formulation is logically equivalent and not incorrect. +- The `[Sá??]` in the lower bound docstring is distracting and should be fixed or removed. +- Using `EuclideanSpace ℝ (Fin 2)` with `Metric.ball 0 r` would make the ball definition more idiomatic and recognizable to Lean/Mathlib users. + +## 5. Formalizability + +**Clearly formalizable.** The problem statement is precise: +- "Measurable set" → `MeasurableSet A` +- "Subset of B(0,r)" → containment in open Euclidean ball +- "No integer distances" → `∀ a b ∈ A, a ≠ b → dist a b ∉ ℤ` +- "How large can the measure be?" → supremum of Lebesgue measure over such sets + +There is essentially no ambiguity. The only interpretive choice is open vs. closed ball (the formalization uses open, consistent with the strict inequality `|x| < r` on the website). This is inconsequential since the boundary has measure zero. + +**Ambiguity assessment: Very low.** The problem is straightforwardly formalizable. + +## 6. Correctness + +**Mostly correct, with observations.** + +### Correct aspects: +- The `euclidDist` definition correctly computes Euclidean distance in ℝ². +- The `NoIntegerDistances` predicate correctly captures the "no integer distances" condition. +- The `maxNoIntDistMeasure` definition correctly takes the supremum over measures of qualifying sets. +- The main theorem correctly poses the problem as finding the exact growth rate, with `answer(sorry)` appropriate for an open problem. +- The upper bound O(r) and lower bound r^{1/2−ε} match the website's stated results. +- The lower bound correctly uses `∃ r₀` to allow "for sufficiently large r." + +### Observations: +- **Category tag on upper bound**: The upper bound is tagged `category undergraduate`. While the statement is elementary, proving that the 2D Lebesgue measure of a no-integer-distance subset of B(0,r) is O(r) requires a nontrivial geometric argument (partitioning into annuli, analyzing measure constraints within each). This might be more appropriately tagged `category research solved` or at least `category graduate`. +- **`maxNoIntDistMeasure` for non-positive r**: The definition doesn't restrict to positive r. For r ≤ 0, the ball is empty, so the only qualifying set is ∅ with measure 0. The `sSup` of `{0}` is 0, which is fine. The main theorem guards with `0 < r`, so this is not an issue in practice. +- **`volume` on `ℝ × ℝ`**: The `volume` measure on `ℝ × ℝ` is the product Lebesgue measure, which equals 2D Lebesgue measure. This is correct. However, if one switches to `EuclideanSpace ℝ (Fin 2)`, one should verify that `volume` still gives the standard Lebesgue measure (it does, since `EuclideanSpace` is measurably equivalent to the product space). +- **Lower bound exponent**: The expression `(1 : ℝ) / 2 - ε` correctly evaluates to `0.5 - ε`. This is mathematically correct. + +### No mathematical flaws detected. +The formalization is faithful to the problem as stated on erdosproblems.com. The mathematical content is correct and complete. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Should use `EuclideanSpace ℝ (Fin 2)` for consistency with 465/466 | +| Citations | `[Sá??]` is broken; missing `[Er77c]` attribution | +| Variants | Complete | +| Readability | Good; minor improvements possible | +| Formalizability | Unambiguous | +| Correctness | Mathematically correct; `category undergraduate` tag on upper bound is questionable | diff --git a/ai-review/954.md b/ai-review/954.md new file mode 100644 index 0000000000..6d099fdd60 --- /dev/null +++ b/ai-review/954.md @@ -0,0 +1,83 @@ +# Review: Erdős Problem 954 + +## 1. Code Reuse + +The `rosenPairCount` function counts pairs `(i,j)` with `i ≤ j`, `j ≥ 1`, whose sequence values sum to at most `n`. The closest existing utility is `AdditiveCombinatorics.sumRep` in `FormalConjecturesForMathlib/Combinatorics/Additive/Convolution.lean`, which counts ordered representations `a + b = n` for elements in a set. However, these serve fundamentally different purposes: + +- `sumRep` counts ordered pairs of *set elements* summing to *exactly* `n`. +- `rosenPairCount` counts *index pairs* (with an ordering constraint `i ≤ j` and `j ≥ 1`) whose *values* sum to *at most* `n`. + +The asymmetry (`i ≤ j`, not ordered pairs) and the "at most" (rather than "equal to") make direct reuse infeasible. The custom definitions are justified. + +No other existing utilities (Sidon sets, additive bases, etc.) are applicable here. + +## 2. Citations + +The formalization cites **[Er77c, p.71]**. The website (erdosproblems.com/954) attributes the problem to: + +> **Er77c, p.71** — Erdős, P., *Problems and results in combinatorial number theory*. + +The formalization's citation `[Er77c] Erdős, P., *Problems and results in combinatorial number theory*, p.71.` matches the website. The OEIS reference **A390642** mentioned in the docstring also matches the website. The attribution to Rosen (mentioned in the docstring as "Erdős and Rosen") is consistent with the website's statement that the sequence was constructed by Rosen. + +**No issues found.** + +## 3. Variants + +The website lists no variants for this problem. The formalization captures only the main question (whether `R(x) = x + O(x^{1/4+o(1)})`). The docstring notes that Erdős and Rosen could not even prove `R(x) ≤ (1 + o(1))x`, which is consistent with the website's description. + +**No missing variants.** + +## 4. Readability + +The code is well-structured: + +- `rosenPairCount` and `rosenPairCountTotal` are cleanly separated with clear docstrings. +- `IsRosenSequence` bundles the three defining properties (initial value, strict monotonicity, minimality) in a readable way. +- The main theorem docstring provides context including the initial terms and the relationship `R(x) ≥ x`. + +**Minor suggestions:** +- The `open Finset BigOperators Filter` on line 33 opens `Filter`, which is used only for `atTop` in the theorem. This is fine but could be noted—`Filter` here refers to `Filter.atTop`, not `Finset.filter`. +- The `if j = 0 then 0 else ...` pattern in both pair count functions, while correct, could alternatively be handled by starting the summation range at 1 (i.e., `Finset.Icc 1 k` instead of `Finset.range (k + 1)` with a conditional). This is a minor style preference and the current approach is perfectly clear. + +## 5. Formalizability + +The problem is **precisely formalizable** with low ambiguity. + +- The Rosen sequence is constructively defined: `a(0) = 0`, and `a(k+1)` is the smallest `n` satisfying a concrete counting condition. This is unambiguous. +- The question `R(x) = x + O(x^{1/4+o(1)})` involves asymptotic notation that requires interpretation. The formalization captures `O(x^{1/4+o(1)})` as: *for every `ε > 0`, there exists `C > 0` such that eventually `|R(x) - x| ≤ C · x^{1/4+ε}`*. This is mathematically equivalent to the standard meaning of `O(x^{1/4+o(1)})`, since the varying constant `C_ε` can be absorbed into the exponent by choosing sufficiently large thresholds (see Correctness section). + +**Ambiguity: Very Low.** The only interpretive step is the encoding of `O(x^{1/4+o(1)})`, which is handled correctly. + +## 6. Correctness + +### Sequence definition: ✅ Correct + +`rosenPairCount a k n` counts pairs `(i,j)` with `1 ≤ j ≤ k`, `0 ≤ i ≤ j`, `a(i) + a(j) ≤ n`. This faithfully captures "the number of pairs `(i,j)` with `0 ≤ i ≤ j ≤ k`, `j ≥ 1`, and `a_i + a_j ≤ n`." + +`IsRosenSequence` correctly encodes the minimality condition: `a(k+1)` is the *smallest* `n` where the pair count drops below `n`. This is expressed as: +1. For all `m < a(k+1)`: `m ≤ rosenPairCount a k m` (the count hasn't yet dropped below `m`). +2. `rosenPairCount a k (a(k+1)) < a(k+1)` (it drops at `a(k+1)`). + +### Total pair count: ✅ Correct + +`rosenPairCountTotal a x` sums over `j` from 1 to `x`. The docstring correctly justifies the finite truncation: since `a` is strictly increasing with `a(0) = 0`, we have `a(j) ≥ j` for all `j`. So if `j > x`, then `a(j) > x`, making `a(i) + a(j) > x` for all `i ≥ 0` (since `a(i) ≥ 0`). No pairs with `j > x` contribute. + +### Asymptotic encoding: ✅ Correct + +The formalization encodes `R(x) = x + O(x^{1/4+o(1)})` as: + +``` +∀ ε > 0, ∃ C > 0, ∀ᶠ x in atTop, |R(x) - x| ≤ C · x^(1/4 + ε) +``` + +**Claim:** This is equivalent to the standard meaning of `O(x^{1/4+o(1)})`. + +*Forward direction:* If `|R(x) - x| ≤ C · x^{1/4+h(x)}` with `h(x) → 0`, then for any fixed `ε > 0`, eventually `h(x) < ε`, giving `|R(x) - x| ≤ C · x^{1/4+ε}`. + +*Backward direction:* Given `C_n` and `N_n` such that `|R(x) - x| ≤ C_n · x^{1/4+1/n}` for `x ≥ N_n`, choose `N_n' = max(N_n, C_n^n)`. For `x ≥ N_n'`, we have `C_n ≤ x^{1/n}`, so `C_n · x^{1/4+1/n} ≤ x^{1/4+2/n}`. Defining `h(x) = 2/n` for `x ∈ [N_n', N_{n+1}')` gives `h(x) → 0` and `|R(x) - x| ≤ x^{1/4+h(x)}`, which is `O(x^{1/4+o(1)})` with constant 1. + +### Use of `answer(sorry)`: ✅ Appropriate + +The problem is open, and wrapping in `answer(sorry)` correctly reflects that the yes/no answer is unknown. + +### Overall assessment: **Correct and complete.** No mathematical flaws identified. diff --git a/ai-review/955.md b/ai-review/955.md new file mode 100644 index 0000000000..d8f7d87ae3 --- /dev/null +++ b/ai-review/955.md @@ -0,0 +1,57 @@ +# Review: Erdős Problem 955 + +## 1. Code Reuse + +**`HasNaturalDensityZero`** is redefined locally in at least six files (16, 31, 122, 673, 955, 1123). The definition in problem 122 uses the more idiomatic Mathlib style via `Tendsto ... atTop (nhds 0)`, while the version here uses an explicit ε–N formulation. These are mathematically equivalent, but a shared definition (e.g., in `FormalConjecturesForMathlib`) would reduce duplication. Note that Mathlib itself may eventually provide `Nat.upperDensity` / `Nat.lowerDensity`; when it does, all of these local definitions should be replaced. + +**`sumProperDivisors`** is defined as `n.properDivisors.sum id`, which is correct and directly leverages Mathlib's `Nat.properDivisors`. Mathlib does not currently export a standalone `sumProperDivisors` function, so the local definition is reasonable. However, this same concept appears in problems 469, 470, and 825 (using `Nat.properDivisors` directly), so a shared utility would be beneficial. + +## 2. Citations + +The docstring cites: + +> [EGPS90] Erdős, P., Granville, A., Pomerance, C., and Spiro, C., *On the normal behavior of the iterates of some arithmetic functions*. Analytic number theory (Allerton Park, IL, 1989), Progr. Math., 85 (1990), 165-204. + +This matches the attribution on [erdosproblems.com/955](https://www.erdosproblems.com/955). The website additionally mentions partial results by: +- **Pollack**, who proved the conjecture for the set of primes. +- **Troupe**, who proved it for integers with unusually many prime factors and for integers expressible as sums of two squares. +- **Pollack, Pomerance, and Thompson**, who showed that if |A ∩ [1,x]| ≤ x^{1/2 + ε(x)} with ε(x) = o(1), then #{n ≤ x : s(n) ∈ A} = o(x). + +These partial results are not cited in the docstring, which is acceptable since they are partial progress rather than the source of the conjecture, but mentioning them would add context. + +## 3. Variants + +The website does not list additional variants of this problem. The formalization captures the single main conjecture as stated. The website mentions a related concept of "untouchable" numbers (integers k with no solution to s(n) = k), referenced in Guy's *Unsolved Problems in Number Theory* (problem B10), but this is a different question and need not be formalized here. **No missing variants.** + +## 4. Readability + +The code is clean and well-structured. The docstrings are clear and include both the informal mathematical statement and the reference. Minor suggestions: + +- The module-level docstring could mention that s(n) is sometimes written σ(n) − n in the literature to help readers connect to standard notation. +- The `HasNaturalDensityZero` definition would benefit from using the `Tendsto`/filter formulation (as in problem 122) for better integration with Mathlib's analysis library, though the current ε–N version is perfectly readable. + +Overall readability is **good**. + +## 5. Formalizability + +The problem as stated on the website is fully precise and unambiguously formalizable: + +- "density zero" has a standard definition in analytic number theory (natural/asymptotic density). +- s(n) = σ(n) − n is a standard arithmetic function. +- The preimage s⁻¹(A) = {n : s(n) ∈ A} is a standard set-theoretic operation. + +There is **no ambiguity** in the statement. The formalization directly and faithfully captures the mathematical content. + +## 6. Correctness + +The formalization is **mathematically correct**. + +- `sumProperDivisors n = n.properDivisors.sum id` correctly computes s(n) = Σ_{d | n, d < n} d. Edge cases: s(0) = 0 (since `Nat.properDivisors 0 = ∅` in Mathlib, as no d < 0) and s(1) = 0 (since `Nat.properDivisors 1 = ∅`). These are the standard conventions. + +- `HasNaturalDensityZero A` states that for every ε > 0, eventually |A ∩ {0,...,x−1}| / x < ε. This is the standard definition of natural density zero. The use of `Finset.range x` (which gives {0,...,x−1}) and division by x is correct. One subtlety: when x = 0 the ratio is 0/0, but this is harmless since the condition only needs to hold for x ≥ N for some sufficiently large N. + +- The theorem statement `erdos_955` says: if A has natural density zero, then {n : s(n) ∈ A} has natural density zero. This is exactly the conjecture from [EGPS90] and matches the website statement. + +- The `@[category research open, AMS 11]` tag correctly reflects the problem's open status and its classification in number theory (AMS subject class 11). + +**No mathematical flaws detected.** The formalization is a faithful and complete rendering of the conjecture. diff --git a/ai-review/956.md b/ai-review/956.md new file mode 100644 index 0000000000..4360b760e6 --- /dev/null +++ b/ai-review/956.md @@ -0,0 +1,73 @@ +# AI Review: Erdős Problem 956 + +## 1. Code Reuse + +**`setDist956`**: This defines `sInf {r : ℝ | ∃ c ∈ C, ∃ d ∈ D, r = dist c d}`, the infimum distance between two sets. Mathlib provides `Metric.infDist` (point-to-set) and `Metric.hausdorffDist` (set-to-set Hausdorff), but does **not** provide a direct set-to-set infimum distance definition. The custom definition is therefore somewhat justified, though the set-to-set inf-distance can be expressed as `⨅ c ∈ C, Metric.infDist c D`. Using this iInf formulation would connect more naturally to the Mathlib API (e.g., continuity lemmas, monotonicity, etc.) without needing a standalone definition. + +**`translate956`**: This defines `(· + x) '' C`, which is exactly Mathlib's `C + {x}` under `open scoped Pointwise` (via `Set.add_singleton` / `Set.image_add_right`). This custom definition is **redundant** and should be replaced with the Mathlib pointwise notation. Multiple other Erdős formalizations in the codebase already use `open scoped Pointwise` for this purpose. + +**Recommendation**: Replace `translate956 C x` with `C + {x}` (using `open scoped Pointwise`). Consider replacing `setDist956` with an expression built on `Metric.infDist` or at minimum add a lemma relating the two. + +## 2. Citations + +The docstring currently reads: + +> `[ErPa90] Erdős, P. and Pach, J.` + +The website (erdosproblems.com/956) attributes the problem to Erdős and Pach with reference tag [ErPa90] but does not provide a full bibliographic entry beyond the authors. The citation in the formalization matches the website's level of detail. However, the likely full reference is: + +> Erdős, P. and Pach, J., "Variation on the theme of repeated distances," *Combinatorica* **10** (1990), 261–269. + +If this can be confirmed, the citation should be expanded. As-is, it matches the website. + +## 3. Variants + +The formalization captures **two** statements: +- `erdos_956`: The main conjecture that h(n) > n^{1+c} for some c > 0 (open). +- `erdos_956.variants.upper_bound`: The known upper bound h(n) = O(n^{4/3}) (solved). + +**Missing variants** from the website: +- **Trivial lower bound**: h(n) ≥ f(n), where f(n) is the maximum number of unit distances determined by n points in ℝ². This connects Problem 956 to the classical unit distance problem and is not captured. +- **Non-translate generalization**: Erdős and Pach also considered n disjoint convex sets (not necessarily translates of each other) and proved an upper bound of approximately n^{7/5} for the number of unit-distance pairs. This variant is not captured. + +## 4. Readability + +**Pair counting**: The mechanism of introducing an explicit `Finset` of pairs `P` with the constraint `∀ p ∈ P, (p.2, p.1) ∉ P` to count unordered pairs is functional but verbose. A more idiomatic approach might filter `X ×ˢ X` directly or define a counting function over the edges. The current encoding requires the reader to mentally verify that P correctly represents an unordered pair count. + +**Custom definitions**: The use of `setDist956` and `translate956` instead of Mathlib-standard constructs forces readers to examine these local definitions. Using Mathlib's API directly would improve readability for anyone familiar with the library. + +**Namespace**: The `Erdos956` namespace is appropriate and keeps the custom definitions scoped. + +**Overall**: Moderately readable. The main theorem statement is long but structurally clear once the pair-counting encoding is understood. + +## 5. Formalizability + +**Assessment: High (low ambiguity).** + +The problem is precisely stated: +- "Distance between sets" is the standard inf-distance, well-defined. +- "Compact convex translates" are standard geometric objects. +- "Unit distance between translates" means the set-distance equals 1. +- h(n) is defined as a maximum over all valid configurations, and the conjecture asks for superlinear growth. + +The only minor ambiguity is whether "unit distance" means set-distance exactly equal to 1 or at most 1 (i.e., whether touching/overlapping pairs count). Since the translates are required to be disjoint and the sets are compact convex, the set-distance is always positive, and "unit distance" naturally means exactly 1. The formalization correctly uses `= 1`. + +## 6. Correctness + +**`erdos_956` (main conjecture)**: Mathematically correct. The existential structure `∃ c > 0, ∃ N₀, ∀ n ≥ N₀, ...` correctly captures "for some c > 0 and all sufficiently large n." The inner quantification over C, X, and P correctly encodes the existence of a configuration achieving more than n^{1+c} unit-distance pairs. + +One subtlety worth noting: the statement requires `C.Nonempty`, which is necessary to avoid degenerate cases (empty sets trivially satisfy disjointness). This is correct. + +**`erdos_956.variants.upper_bound`**: Mathematically correct. The universal quantification over all valid configurations C, X, P with `|P| ≤ K · |X|^{4/3}` correctly captures h(n) = O(n^{4/3}). + +**Potential issues**: + +1. **`setDist956` on empty sets**: When C or D is empty, the set `{r | ∃ c ∈ C, ∃ d ∈ D, r = dist c d}` is empty, and `sInf ∅` on `ℝ` is a junk value (0 by Lean convention). This doesn't affect correctness here because C is required to be nonempty and translates of a nonempty set are nonempty, but it is a latent concern in the definition itself. + +2. **Pair set P is existentially quantified in erdos_956**: The conjecture asks for existence of P (a set of oriented pairs with no reverse duplicates) with |P| > n^{1+c}. This correctly counts unordered pairs: each unordered pair {x₁, x₂} is represented by exactly one of (x₁, x₂) or (x₂, x₁) in P. The constraint `∀ p ∈ P, (p.2, p.1) ∉ P` enforces this. **Correct.** + +3. **The upper bound variant universally quantifies over P**: For the O(n^{4/3}) bound, the statement says: for any P satisfying the conditions, |P| ≤ K·n^{4/3}. This is correct—it bounds any valid set of unit-distance pairs, which implies h(n) ≤ K·n^{4/3}. + +4. **C is the same for all translates**: The formalization correctly requires a single compact convex set C translated by different vectors in X, matching the problem's "convex translates" (not arbitrary convex sets). + +**Verdict**: The formalization is **correct and complete** for the two statements it captures. The main open conjecture and the known upper bound are both faithfully encoded. The missing variants (trivial lower bound, non-translate generalization) are minor omissions that do not affect the correctness of what is present. diff --git a/ai-review/957.md b/ai-review/957.md new file mode 100644 index 0000000000..eb3c8d4dcd --- /dev/null +++ b/ai-review/957.md @@ -0,0 +1,101 @@ +# AI Review: Erdős Problem 957 + +## 1. Code Reuse + +**Shared `pairCount` pattern across Problems 132, 756, and 957.** + +Problems 132 and 756 both define an identical `pairCount` function: +```lean +noncomputable def pairCount (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + ((A ×ˢ A).filter (fun p => p.1 ≠ p.2 ∧ dist p.1 p.2 = d)).card +``` + +Problem 957 defines `distFrequency` as `pairCount / 2` (to count unordered pairs). This is a natural factoring — `distFrequency` could be defined directly in terms of the shared `pairCount`: + +```lean +noncomputable def distFrequency (A : Finset (EuclideanSpace ℝ (Fin 2))) (d : ℝ) : ℕ := + pairCount A d / 2 +``` + +Additionally, `FormalConjecturesForMathlib/Geometry/Metric.lean` defines `unitDistNum` using `Finset.sym2` (unordered pairs directly), which is an alternative approach that avoids the divide-by-2 pattern. All three problems (132, 756, 957) would benefit from a shared distance-counting utility module. + +## 2. Citations + +**Minor issues found.** + +The docstring currently states: +> [ErPa90] Erdős, P. and Pach, J., _Variation on the theme of repeated distances_ (1990). + +The correct title is **"Variations"** (plural), and the journal is missing. Problem 756 in this same codebase has the more complete citation: +> Erdős, P. and Pach, J., _Variations on the theme of repeated distances_, Combinatorica (1990). + +The Dumitrescu citation is incomplete: +> [Du19] Dumitrescu, A. (2019). + +It lacks a paper title. A more complete citation would be: +> [Du19] Dumitrescu, A., _The maximum product of distances to nearest and farthest neighbours_, Bulletin of the London Mathematical Society (2019). + +(Note: the exact title should be verified against the publication.) + +## 3. Variants + +**Two variants from the website are not captured.** + +The erdosproblems.com page mentions two additional related inequalities: + +1. **Additive bound:** $f(d_1) + f(d_k) \leq 3n - c\sqrt{n} + o(\sqrt{n})$ for some constant $c > 0$. +2. **Convex hull bound:** $f(d_1) \leq 3n - 2m + o(\sqrt{n})$, where $m$ is the number of vertices of the convex hull of $A$. + +Neither is formalized. These are separate claims from the main product inequality and could be added as `.variants` theorems if desired. + +## 4. Readability + +**Good overall, minor suggestions.** + +- The variable name `dk` is functional but slightly ambiguous. A name like `d_max` or `dₖ` (using subscript) would be more descriptive. The subscript `k` implicitly refers to the ordering `d₁ < ... < dₖ`, but this ordering is not explicitly constructed in the formalization. +- The docstring for `distFrequency` is clear and accurate. +- The conditions on `d₁` and `dk` are clearly laid out as separate hypotheses, which aids readability. + +## 5. Formalizability + +**High formalizability. The o(1) term is handled correctly.** + +The original problem uses the asymptotic notation $o(1)$, which is inherently informal. The formalization handles this via the standard ε-N formulation: for every ε > 0, there exists N₀ such that the bound $(9/8 + \varepsilon) n^2$ holds for all point sets with $|A| \geq N_0$. This is mathematically equivalent and is the canonical way to formalize $o(1)$ statements. + +The minimum/maximum distance conditions are expressed via existential witnesses (the distance is achieved) and universal bounds (no distance is smaller/larger), which is a clean and precise way to avoid explicitly constructing the sorted distance set. + +**Ambiguity assessment: Low.** The problem statement is precise. The only minor ambiguity is whether $f(d)$ counts ordered or unordered pairs — the problem statement specifies "unordered", and the formalization correctly implements this. + +## 6. Correctness + +**The formalization is mathematically correct, with one minor stylistic inconsistency.** + +### Verified correct: +- **`distFrequency`**: Counts ordered pairs with `p ≠ q` at distance `d`, then divides by 2. Since each unordered pair `{p, q}` contributes exactly two ordered pairs `(p, q)` and `(q, p)` (by symmetry of `≠` and `dist`), the count of ordered pairs is always even, and the natural number division by 2 is exact. This correctly computes the number of unordered pairs. ✓ +- **Minimum distance conditions** (lines 61–62): `d₁` is existentially witnessed and universally bounded below among distinct pairs. ✓ +- **Maximum distance conditions** (lines 63–64): `dk` is existentially witnessed among distinct pairs and universally bounded above. ✓ +- **The inequality** (lines 65–66): Correctly states $f(d_1) \cdot f(d_k) \leq (9/8 + \varepsilon) \cdot |A|^2$ using real-valued casts. ✓ +- **`answer(True)`**: Correct — the problem is solved affirmatively by Dumitrescu [Du19]. ✓ +- **The ε-N formulation** correctly captures the asymptotic $(9/8 + o(1))n^2$ bound from the problem statement. Dumitrescu's stronger result $f(d_1)f(d_k) \leq \frac{9}{8}n^2 + O(n)$ implies this formulation since $O(n)/n^2 \to 0$. ✓ + +### Minor stylistic inconsistency (not a correctness bug): +The minimum distance condition (line 62) restricts to distinct pairs: +```lean +(∀ p q, p ∈ A → q ∈ A → p ≠ q → d₁ ≤ dist p q) +``` +The maximum distance condition (line 64) does not: +```lean +(∀ p q, p ∈ A → q ∈ A → dist p q ≤ dk) +``` +This is mathematically harmless since `dist p p = 0 ≤ dk` (as `dk` is a realized distance, hence non-negative). However, for symmetry with the minimum distance condition, adding `p ≠ q` to line 64 would be cleaner. The current formulation is equivalent but asymmetric. + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `pairCount` duplicated across 132, 756, 957; could be shared | +| Citations | "Variation" should be "Variations"; Du19 missing title and journal | +| Variants | Two additional inequalities from website not captured | +| Readability | Good; `dk` could be more descriptive | +| Formalizability | High; o(1) handled correctly via ε-N | +| Correctness | Correct and complete; minor asymmetry in min/max conditions | diff --git a/ai-review/958.md b/ai-review/958.md new file mode 100644 index 0000000000..ade1b80eec --- /dev/null +++ b/ai-review/958.md @@ -0,0 +1,86 @@ +# Review: Erdős Problem 958 + +## 1. Code Reuse + +**Several opportunities for reuse exist.** + +- **`distinctDistances`**: Problem 958 defines its own `Erdos958.distinctDistances` using `(A ×ˢ A).filter (fun p => p.1 ≠ p.2)).image (...)`. Near-identical definitions exist in: + - `Erdos95.distinctDistances` (same implementation, line 39 of `95.lean`) + - `Erdos93.distinctDistances` (uses `A.offDiag.image` — semantically identical, cleaner, line 46 of `93.lean`) + - `EuclideanGeometry.distinctDistances` in `FormalConjecturesForMathlib/Geometry/2d.lean` (returns `ℕ` count rather than `Finset ℝ`, line 194) + + A shared definition in `FormalConjecturesForMathlib` returning `Finset ℝ` would serve problems 93, 95, and 958. The `offDiag`-based version (as in 93.lean) is preferred as it's more idiomatic Mathlib style. + +- **`distMultiplicity`**: Defined locally in both 958.lean (line 49, divides by 2 for unordered pairs) and 95.lean (line 45, counts ordered pairs). These differ in convention but could be unified with a shared definition, choosing one convention and adapting the other. + +- No existing definitions in `FormalConjecturesForMathlib` cover the `IsEquidistantCollinear`, `IsEquidistantCircular`, or `HasDistanceMultiplicityProperty` concepts. These are problem-specific and appropriately defined locally. + +## 2. Citations + +The website (erdosproblems.com/958) lists the following references: + +- **[Er84c]** Erdős, P., *Some old and new problems on combinatorial geometry*, 1984. +- **[CDL25]** Clemen, F., Dumitrescu, A., and Liu, Y., 2025. + +The formalization's docstring matches these references. However, **[CDL25] is missing its paper title** in the docstring. The website itself does not appear to provide the full title either, so the formalization is consistent with the source. This is acceptable but could be improved if the full citation becomes available. + +## 3. Variants + +The erdosproblems.com page presents a single question: whether the distance multiplicity property characterizes equidistant points on a line or circle. The formalization captures the problem and its negative resolution. **No additional variants are mentioned on the website**, and the formalization appropriately captures the complete problem as stated. + +## 4. Readability + +The code is **well-structured and readable**. Specific observations: + +- The helper definitions (`distinctDistances`, `distMultiplicity`, `HasDistanceMultiplicityProperty`, `IsEquidistantCollinear`, `IsEquidistantCircular`) are each accompanied by clear docstrings that connect to the mathematical notation. +- The module docstring provides good context, including the problem statement, its history, and the resolution. +- The `Erdos958` namespace keeps definitions well-scoped. +- Minor: The use of `A ×ˢ A` with a filter for `p.1 ≠ p.2` could be replaced with the more idiomatic `A.offDiag` (as in problem 93), which would slightly improve readability. + +## 5. Formalizability + +**The problem is well-suited for formalization, with low ambiguity.** The original question asks a precise yes/no question about a characterization of finite point sets, and all concepts involved (distinct distances, multiplicities, equidistant collinear/circular configurations) have clear mathematical definitions. + +One minor source of ambiguity: the phrase "equidistant points on a circle" could in principle mean equally spaced on a circular arc rather than a full circle. The formalization interprets it as points on a full circle with equal consecutive chord lengths (via the cyclic ordering σ), which matches the standard interpretation. The counterexample (points on a short arc plus the center) is indeed neither of these configurations. + +**Assessment: Unambiguous.** The formalization's interpretation aligns with the standard mathematical reading. + +## 6. Correctness + +**The formalization is mathematically correct.** Detailed analysis: + +### 6a. `distinctDistances` (line 45) +Correctly computes the set of distinct positive distances by filtering out the diagonal and taking the image under `dist`. Equivalent to the standard mathematical definition. + +### 6b. `distMultiplicity` (line 49) +Counts ordered pairs with `p.1 ≠ p.2` at distance `d`, then divides by 2. Since `dist` is symmetric, each unordered pair `{a, b}` contributes exactly two ordered pairs `(a,b)` and `(b,a)`, so integer division by 2 yields the correct unordered count. **Caveat**: This relies on the fact that the count of ordered pairs is always even (which holds by the symmetry argument). The formalization is correct but proving properties about this definition would require establishing this evenness fact. An alternative using `Sym2` or `offDiag` with a canonical ordering might be more proof-friendly. + +### 6c. `HasDistanceMultiplicityProperty` (line 54) +The conjunction of: +1. `A.card ≥ 2` — ensures non-degeneracy. +2. `(distinctDistances A).card = A.card - 1` — exactly n−1 distinct distances. +3. The biconditional `∀ m, (1 ≤ m ∧ m ≤ A.card - 1) ↔ (∃ d ∈ distinctDistances A, distMultiplicity A d = m)` — the set of multiplicities is exactly {1, 2, …, n−1}. + +The forward direction ensures every value in {1,…,n−1} is achieved; the backward direction ensures no multiplicity falls outside this range. Combined with there being exactly n−1 distinct distances, this forces the multiplicities to be a permutation of {1,…,n−1}. **This is correct.** + +### 6d. `IsEquidistantCollinear` (line 62) +Asserts the existence of a base point `p` and direction `v ≠ 0` such that every point in A equals `p + i•v` for some `i : Fin A.card`. Since `v ≠ 0`, distinct indices yield distinct points, and the Fin constraint ensures exactly n equally spaced collinear points. **Correct.** + +### 6e. `IsEquidistantCircular` (line 69) +Requires `A.card ≥ 3`, a center `c`, radius `r > 0`, all points on the circle, and a bijection σ witnessing a cyclic ordering with equal consecutive chord lengths. Equal chord lengths on a circle imply equal angular spacing, which is the standard definition. **Correct.** + +### 6f. Main theorem `erdos_958` (line 90) +`answer(False) ↔ (∀ A, HasDistanceMultiplicityProperty A → IsEquidistantCollinear A ∨ IsEquidistantCircular A)` + +This asserts the universal characterization is **false** (i.e., `answer(False)` = `False`), meaning there exists a set with the distance multiplicity property that is neither equidistant-collinear nor equidistant-circular. This matches the problem's negative resolution by Clemen, Dumitrescu, and Liu. **Correct.** + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `distinctDistances` and `distMultiplicity` are duplicated across problems; a shared definition in `FormalConjecturesForMathlib` would be beneficial | +| Citations | Consistent with erdosproblems.com; [CDL25] lacks paper title (same as source) | +| Variants | All variants captured (single problem, no sub-variants on website) | +| Readability | Good; minor improvement possible via `offDiag` instead of `×ˢ`+filter | +| Formalizability | Unambiguous; well-suited for formalization | +| Correctness | Mathematically correct and complete | diff --git a/ai-review/959.md b/ai-review/959.md new file mode 100644 index 0000000000..8bd1c65951 --- /dev/null +++ b/ai-review/959.md @@ -0,0 +1,60 @@ +# AI Review: Erdős Problem 959 + +## 1. Code Reuse + +The definitions `distinctDistances` and `distMultiplicity` in the `Erdos959` namespace are **duplicated nearly identically** across at least three files: + +- `FormalConjectures/ErdosProblems/959.lean` (namespace `Erdos959`) +- `FormalConjectures/ErdosProblems/958.lean` (namespace `Erdos958`) — identical definitions +- `FormalConjectures/ErdosProblems/95.lean` (namespace `Erdos95`) — same `distinctDistances`; `distMultiplicity` differs by counting ordered pairs (no `/ 2`) + +Additionally, `FormalConjecturesForMathlib/Geometry/2d.lean:194` defines `EuclideanGeometry.distinctDistances` which returns `ℕ` (the count of distinct distances) rather than the `Finset ℝ` of distance values. These definitions could be consolidated into a shared utility in `FormalConjecturesForMathlib`, with both the `Finset ℝ` version and the `ℕ` count version derived from a common base. + +## 2. Citations + +The docstring references: + +- **[Er84d]**: "Erdős, P., *Some old and new problems on combinatorial geometry*." — matches the website. +- **[CDL25]**: "Clemen, F., Dumitrescu, A., and Liu, J., *On the gap between the most frequent and second most frequent distances*." — matches the website. Note: the website lists the third author as "Liu, J." while Problem 958 lists "Liu, Y." for the same group. One of these is inconsistent; should be verified. + +## 3. Variants + +The formalization captures only the lower bound $\max(f(d_1) - f(d_2)) \gg n \log n$. The website documents additional content not captured: + +- **General gap result**: CDL25 proved a more general statement: for any $1 \leq r \leq \log n$, there exists a set where $f(d_r) - f(d_{r+1}) \gg \frac{n \log n}{r}$. This generalization to arbitrary rank $r$ is not formalized. +- **Conjectured improvement**: CDL25 conjecture the $n \log n$ bound can be improved to $n^{1+c/\log \log n}$ for some constant $c > 0$. This is not mentioned or formalized. + +## 4. Readability + +The code is well-structured and readable. The helper definitions `distinctDistances` and `distMultiplicity` are clearly named and documented with docstrings. The main theorem statement is legible, though the nested quantifier structure (lines 64–71) requires careful reading to parse. + +One minor readability note: the `∀ d₂ ∈ distinctDistances A, d₂ ≠ d₁ →` on line 69 could be initially confusing — it relies on Lean 4's desugaring of bounded `∀` so that `d₂ ≠ d₁` becomes an additional hypothesis. A comment clarifying this intent would aid readability. + +## 5. Formalizability + +The original problem statement asks to **"estimate $\max(f(d_1) - f(d_2))$"**, which is inherently imprecise — "estimate" does not have a single formal meaning. It could mean: + +- Determine the asymptotic order (up to constants) +- Establish matching upper and lower bounds +- Find any non-trivial bound + +The formalization resolves this ambiguity by capturing the specific CDL25 lower bound result: $\max(f(d_1) - f(d_2)) \geq c \cdot n \log n$. This is a reasonable formalization of one direction, but it does not capture the full spirit of "estimate" (which implicitly asks for both upper and lower bounds). The problem is of **moderate ambiguity** — the estimation question is open-ended, but the specific result formalized is precise. + +## 6. Correctness + +### Category Tag Issue +The theorem is tagged `@[category research solved, AMS 52]`, but the website lists the problem as **OPEN**. The CDL25 result provides a lower bound, but the full estimation problem (finding tight asymptotic bounds) remains unresolved. The `solved` tag is misleading — it should either be `open` (reflecting the website status) or the docstring should more clearly state that only the lower bound direction is formalized and proved. + +### Mathematical Correctness of the Statement +The formalized statement is mathematically correct for what it claims: + +1. **distMultiplicity division**: Dividing the count of ordered pairs by 2 correctly yields unordered pairs, since each unordered pair $\{a, b\}$ appears as exactly two ordered pairs $(a,b)$ and $(b,a)$ in $A \times A$. + +2. **Equivalence to the standard formulation**: The statement asserts that for every $d_2 \neq d_1$ in the distance set, the gap $f(d_1) - f(d_2) \geq c \cdot n \log n$. This is equivalent to asserting the gap for just the second-most-frequent distance, since $f(d_1) - f(d_2)$ is minimized when $d_2$ is the second-most-frequent. The equivalence is correct. + +3. **Natural number subtraction**: The cast to `ℝ` before subtraction (line 70) correctly avoids Lean's truncating natural number subtraction. Since $d_1$ is asserted to have maximal multiplicity (line 68), the difference is non-negative. + +4. **Edge case**: The statement quantifies over $d_2 \in \text{distinctDistances}(A)$ with $d_2 \neq d_1$. If $A$ has only one distinct distance (all pairs equidistant), the universal quantifier is vacuously true, which would trivially satisfy the bound. This is not problematic for the existential statement (we can simply choose $A$ with multiple distinct distances for large $n$), but it is worth noting. + +### Summary +The formalization is **mathematically sound** as a statement of the CDL25 lower bound. The primary issue is the `solved` tag conflicting with the website's OPEN status, since only one direction of the estimation problem has been resolved. diff --git a/ai-review/96.md b/ai-review/96.md new file mode 100644 index 0000000000..ed6839ac2f --- /dev/null +++ b/ai-review/96.md @@ -0,0 +1,104 @@ +# Review: Erdős Problem 96 + +## 1. Code Reuse + +**Significant duplication identified.** + +- **`ConvexPosition`** is defined locally at `96.lean:35` using `P.erase p`. Essentially the same definition appears in: + - `93.lean:39` as `InConvexPosition` (using set difference `↑A \ {p}`) + - `94.lean:38` as `ConvexPosition` (using set difference `↑A \ {p}`) + - `838.lean:48` as `InConvexPosition` + - `216.lean:61` as `InConvexPosition` + - `651.lean:46`, `660.lean:40` (higher-dimensional variants) + + Crucially, `FormalConjecturesForMathlib/Geometry/2d.lean:60` already defines `ConvexIndep` on `Set ℝ²`: + ```lean + def ConvexIndep (S : Set ℝ²) : Prop := + ∀ a ∈ S, a ∉ convexHull ℝ (S \ {a}) + ``` + Problem 97 already uses `ConvexIndep` from ForMathlib. Problem 96 should do the same rather than defining its own local copy. The `P.erase p` vs `S \ {p}` formulations are equivalent (via `Finset.coe_erase`), so there is no mathematical distinction. + +- **`unitDistancePairCount`** at `96.lean:43` counts *ordered* pairs using `P.offDiag.filter`. A closely related definition exists in: + - `90.lean:35` as `unitDistancePairsCount` — counts *unordered* pairs (divides by 2) + - `668.lean:41` as `unitDistanceCount` — uses product filter + + These could be unified. In particular, the ordered-pair version in 96 is exactly twice the unordered version in 90, so either could serve as the canonical definition with a simple lemma relating them. + +**Recommendation:** Replace local `ConvexPosition` with `ConvexIndep` from ForMathlib (adapting the Finset to Set coercion). Consider consolidating unit distance counting definitions into a shared utility. + +## 2. Citations + +The formalization's docstring references only `[erdosproblems.com/96](https://www.erdosproblems.com/96)` and names the conjecture as "Erdős–Moser." The website provides substantially more detail that should be documented: + +- **Origin:** Conjectured by Erdős and Moser. +- **Stronger conjecture:** Erdős and Fishburn conjectured the true bound is **2n** (not just O(n)). This is a meaningful refinement not mentioned in the formalization. +- **Best known upper bound:** ≤ n log₂ n + 4n (Aggarwal, 2015). +- **Previous bounds:** O(n log n) by Füredi (1990); simplified by Brass and Pach (2001). +- **Lower bound:** Edelsbrunner and Hajnal (1991) constructed n points in convex position with 2n − 7 unit-distance pairs. +- **Related problems:** Problem 97 would imply a positive answer; see also Problem 90. + +**Recommendation:** Add references for at least the key results: +- Aggarwal (2015) for the current best bound +- Füredi (1990) for the O(n log n) result +- Edelsbrunner and Hajnal (1991) for the lower bound construction + +## 3. Variants + +**Missing variants identified.** + +The website describes a **stronger variant** due to Erdős: if g(x) counts the maximum number of points in A equidistant from x, then ∑_{x ∈ A} g(x) < 4n. The Edelsbrunner–Hajnal example shows ∑ g(x) > 4n − O(1) is achievable, so the conjectured bound would be tight. + +Additionally, the **Erdős–Fishburn conjecture** that the exact bound is **2n** (not merely O(n)) is a natural strengthening that could be formalized as a separate theorem statement. + +**Recommendation:** Add at least: +1. A variant formalizing the Erdős–Fishburn conjecture: the bound is exactly 2n (for sufficiently large n, the number of unordered unit-distance pairs is at most 2n). +2. Optionally, the g(x) summation variant. + +## 4. Readability + +The code is generally clean and well-structured. Minor observations: + +- The file uses `EuclideanSpace ℝ (Fin 2)` throughout rather than the `ℝ²` notation available via `open scoped EuclideanGeometry` (as used in problems 90, 97, and the ForMathlib library). Using `ℝ²` would improve readability. +- The docstring comment on `unitDistancePairCount` about ordered vs. unordered pairs is helpful and should be retained. +- The namespace `Erdos96` is consistent with project conventions. + +**Recommendation:** Add `open scoped EuclideanGeometry` and use `ℝ²` notation. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The statement "the number of unit-distance pairs among n convex-position points is O(n)" is precise and unambiguous. The formalization correctly captures the asymptotic claim as an existential over a constant C, which is the standard way to express O(n) bounds in a non-asymptotic setting (i.e., for all finite sets, not just in a limit). + +The only potential ambiguity is whether "unit distance" refers to a fixed distance (normalized to 1) or any single distance — but unit distance conventionally means distance exactly 1, and the formalization correctly uses `dist pq.1 pq.2 = 1`. Since the problem is invariant under scaling, fixing the distance to 1 is without loss of generality. + +**Verdict:** No ambiguity issues. The problem is cleanly formalizable as stated. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **`ConvexPosition` (line 35):** Correctly captures the definition that no point lies in the convex hull of the others. The use of `P.erase p` is equivalent to removing p from the set. ✓ + +- **`unitDistancePairCount` (line 43):** Counts ordered pairs (a, b) with a ≠ b and dist(a, b) = 1 via `P.offDiag.filter`. The docstring correctly notes the ordered/unordered distinction and that the O(n) bound is equivalent either way. ✓ + +- **`erdos_96` (line 56):** States ∃ C > 0, ∀ P in convex position, unitDistancePairCount(P) ≤ C · |P|. This is a correct formalization of the Erdős–Moser conjecture. The use of `(unitDistancePairCount P : ℝ)` and `(P.card : ℝ)` with real-valued inequality is appropriate for expressing the linear bound. ✓ + +- **Edge cases:** The statement holds vacuously for empty sets and singletons (unitDistancePairCount = 0), which is correct. For sets of size 2 or 3 in convex position, the bound trivially holds for any C ≥ 6 (since at most 6 ordered pairs exist among 3 points). No issues with degenerate cases. ✓ + +- **Tag `[category research open, AMS 52]`:** Correct — the problem is indeed open (best known bound is O(n log n), not O(n)). AMS classification 52 (Convex and discrete geometry) is appropriate. ✓ + +**No mathematical flaws identified.** The formalization is a faithful rendering of the conjecture. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | **Needs improvement** — should use `ConvexIndep` from ForMathlib; consolidate unit distance counting | +| Citations | **Incomplete** — missing key references (Aggarwal, Füredi, Edelsbrunner–Hajnal) | +| Variants | **Incomplete** — missing Erdős–Fishburn 2n conjecture and g(x) summation variant | +| Readability | **Good** — minor improvement possible with `ℝ²` notation | +| Formalizability | **Excellent** — unambiguous, cleanly formalizable | +| Correctness | **Correct** — mathematically faithful formalization | diff --git a/ai-review/960.md b/ai-review/960.md new file mode 100644 index 0000000000..894c2040e3 --- /dev/null +++ b/ai-review/960.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 960 + +## 1. Code Reuse + +**Several opportunities for shared definitions exist:** + +- **Problem 210** (`FormalConjectures/ErdosProblems/210.lean`) defines its own `ordinaryLineCount`, `Point2` abbreviation, and ordinary-line concepts. Problem 960 and Problem 210 both formalize "ordinary line" but use different representations: + - Problem 960 uses `AffineSubspace ℝ (EuclideanSpace ℝ (Fin 2))` and counts via `Set.ncard`. + - Problem 210 uses a parametric `LiesOnLine` predicate and counts ordered pairs divided by 2. + + These are mathematically equivalent but code-level distinct. A shared definition in a utility module would reduce duplication and ensure consistency. + +- **Problem 209** (`FormalConjectures/ErdosProblems/209.lean`) defines `IsLine` as `Module.finrank ℝ L.direction = 1`, which is the same line-dimension check used inline in Problem 960's `IsOrdinaryLine`. The `IsLine` definition from 209 could be extracted and reused. + +- **Problem 210's `Point2` abbreviation** (`abbrev Point2 := EuclideanSpace ℝ (Fin 2)`) would improve readability in 960, which repeatedly spells out the full type. + +- **Collinearity predicates** appear across many problems (98, 101, 105, 217, 735). Problem 960's `NoKCollinear` is a generalized version; `FormalConjecturesForMathlib/Geometry/2d.lean` has `NonTrilinear` (no three collinear) but no general k-collinear predicate. + +**Recommendation:** Extract `Point2`, `IsLine`, `IsOrdinaryLine`, `lineThrough`, and `ordinaryLineCount` into a shared geometry utility module. + +## 2. Citations + +**Website (erdosproblems.com/960):** +- Reference: **[Er84]** — no further bibliographic detail is given on the website itself. +- Related problem: **Problem #209** is listed as related. +- The website also notes an upper bound: Turán's theorem implies $f_{r,k}(n) \leq \left(1 - \frac{1}{r-1}\right)\frac{n^2}{2} + 1$. + +**Formalization docstring:** +- Cites `[Er84] Erdős, P., _Some old and new problems on combinatorial geometry_, 1984.` + +**Assessment:** The formalization provides more bibliographic detail than the website, which only lists `[Er84]`. The expanded citation is helpful but should be verified against the actual publication. The related problem #209 is not mentioned in the formalization's docstring. The Turán upper bound noted on the website is not mentioned in the formalization either — this could be documented for context, though it is not itself a conjecture. + +## 3. Variants + +**Website states one problem with two parts:** +1. Is $f_{r,k}(n) = o(n^2)$? (weaker form) +2. Is $f_{r,k}(n) \ll n$, i.e., $O(n)$? (stronger form) + +**Formalization captures:** +- `erdos_960`: the $o(n^2)$ conjecture — ✅ +- `erdos_960.variants.strong`: the $O(n)$ conjecture — ✅ + +**Assessment:** Both variants from the website are captured. The formalization correctly identifies the weaker and stronger forms and formalizes both. No variants are missing. + +## 4. Readability + +**Positive aspects:** +- Clear, well-structured docstrings on every definition and theorem. +- LaTeX in comments matches the mathematical content well. +- Logical progression from definitions to theorems. + +**Suggestions:** +- Introduce `abbrev Point2 := EuclideanSpace ℝ (Fin 2)` (as Problem 210 does) to reduce verbosity. The full type `EuclideanSpace ℝ (Fin 2)` appears 11 times in the file. +- The `AllPairsOrdinary` definition combines subset membership and the ordinary-line property. This is fine, but the name might be slightly misleading — it's not that "all pairs are ordinary" in general, but that all lines determined by pairs *within the subset* are ordinary *with respect to the ambient set*. The docstring clarifies this well. +- The `fRk` definition name is terse. A comment noting it corresponds to the function $f_{r,k}(n)$ from the problem statement is present in the docstring, which is sufficient. + +## 5. Formalizability + +**Assessment: High formalizability, low ambiguity.** + +The problem statement on erdosproblems.com is precise: +- "ordinary line" (line containing exactly 2 points) is standard and unambiguous. +- "no $k$ points on a line" is clear. +- The function $f_{r,k}(n)$ is defined as a threshold/minimum, which is well-captured by `sInf`. +- The asymptotic questions ($o(n^2)$ and $O(n)$) are standard. + +**One subtlety:** The definition of $f_{r,k}(n)$ via `sInf` requires care. The set whose infimum is taken is: + +``` +{m : ℕ | ∀ A, A.card = n → NoKCollinear k A → ordinaryLineCount A ≥ m → ∃ A', ...} +``` + +This defines $f_{r,k}(n)$ as the *smallest* $m$ such that having $\geq m$ ordinary lines forces the existence of an $r$-point subset with all ordinary lines. This is correct for a "threshold" interpretation. However, if the set is empty (no finite $m$ suffices), `sInf ∅ = 0` for `ℕ`, which would be vacuously wrong. In practice, the trivially large value $m = \binom{n}{2} + 1$ (more ordinary lines than possible) would satisfy the condition vacuously, so the set is nonempty whenever $n$ is sufficiently large. This is mathematically fine but not proven in the formalization. + +## 6. Correctness + +**Overall assessment: Mathematically correct with minor observations.** + +### Definition-level correctness: + +- **`NoKCollinear`**: Correctly states that no $k$-element subset is collinear. This matches "no $k$ points on a line." ✅ + +- **`IsOrdinaryLine`**: Requires (1) the affine subspace has direction of finrank 1 (i.e., it's a line), and (2) exactly 2 points of $P$ lie on it. This is the standard definition of an ordinary line. ✅ + +- **`ordinaryLineCount`**: Counts lines (as affine subspaces) that are ordinary. Uses `Set.ncard` on a potentially infinite set of affine subspaces. However, for a finite point set, the number of lines determined by the points is finite, and lines not passing through any point of $P$ cannot be ordinary. So the set of ordinary lines is finite, and `Set.ncard` returns the correct cardinality. ✅ + +- **`lineThrough`**: Defined as `affineSpan ℝ {p, q}`. When $p = q$, this degenerates to a point (0-dimensional), not a line. The `AllPairsOrdinary` definition guards against this with the `p ≠ q` hypothesis. ✅ + +- **`AllPairsOrdinary`**: Requires $A' \subseteq A$ and that for all distinct $p, q \in A'$, the line through them is ordinary w.r.t. $A$. This correctly captures "all $\binom{r}{2}$ determined lines are ordinary." ✅ + +- **`fRk`**: As discussed above, uses `sInf` appropriately. The quantifier structure is: for all point sets of size $n$ with no $k$ collinear, if the ordinary line count is $\geq m$, then the desired subset exists. This correctly defines the threshold. ✅ + +### Theorem-level correctness: + +- **`erdos_960`**: States $\forall \varepsilon > 0, \exists N, \forall n \geq N, f_{r,k}(n) \leq \varepsilon \cdot n^2$. This is the standard $o(n^2)$ definition. The cast to `ℝ` is necessary for the inequality. ✅ + +- **`erdos_960.variants.strong`**: States $\exists C > 0, \forall n, f_{r,k}(n) \leq C \cdot n$. This is the standard $O(n)$ definition. Note that unlike the weaker form, this has no "for sufficiently large $n$" qualifier — this is correct because $O(n)$ as stated (with the universal quantifier over all $n$) is equivalent to the "eventually" version up to adjusting the constant. ✅ + +### Minor observations: + +1. The stronger conjecture (`O(n)`) logically implies the weaker one (`o(n^2)`), so both being stated as separate `sorry`-theorems is appropriate for a conjecture file — they represent different levels of what Erdős asked. + +2. The formalization does not mention the Turán upper bound $f_{r,k}(n) \leq (1 - 1/(r-1))n^2/2 + 1$ noted on the website. While not required, including this as a comment or additional (provable) theorem would add context. + +3. The problem tags `[AMS 5 51]` correspond to combinatorial geometry, which is appropriate. + +**Verdict: The formalization is correct and complete. Both variants of the problem are accurately captured. The definitions are mathematically sound and align with the problem statement on erdosproblems.com.** diff --git a/ai-review/962.md b/ai-review/962.md new file mode 100644 index 0000000000..3b3f0de781 --- /dev/null +++ b/ai-review/962.md @@ -0,0 +1,100 @@ +# AI Review: Erdős Problem 962 + +## 1. Code Reuse + +`FormalConjecturesForMathlib/NumberTheory/CoveringSystem.lean` defines a `CoveringSystem` structure for covering systems of congruences (finite sets of cosets of non-zero ideals whose union covers a ring). While Problem 962 is thematically adjacent—consecutive integers covered by large prime divisors—it is **not** a covering system problem in the standard sense. The `CoveringSystem` structure models residue classes modulo fixed moduli, whereas Problem 962 asks about divisibility by primes exceeding a threshold k. These are fundamentally different constraints. + +The custom `erdos962_k` definition is appropriate and no existing codebase definition would serve as a substitute. No reuse opportunity was identified. + +## 2. Citations + +The formalization cites: + +| Shorthand | Docstring | +|-----------|-----------| +| [Er65] | Erdős, P., _Extremal problems in number theory_, 1965. | + +This matches the website's reference. However: + +- **Tao's upper bound** (variant `tao_upper`) names Tao in the docstring but provides no citation. The website credits Terence Tao but also does not give a specific paper reference, so the formalization is consistent with the available information. +- **Tang's lower bound** (variant `tang_lower`) names Tang in the docstring but provides no citation. The website credits Quanyu Tang, again without a specific paper. The formalization is consistent. +- **OEIS A327909** is mentioned on the website as a related sequence but is not referenced in the formalization. This is a minor omission. + +Overall the citations are consistent with the website. No shorthand references are used without expansion. + +## 3. Variants + +The formalization includes four statements: + +| Statement | Description | Status Tag | +|-----------|-------------|------------| +| `erdos_962` | Main conjecture: k(n) = o(n^ε) for all ε > 0 | `research open` | +| `erdos_962.variants.tao_upper` | k(n) ≤ (1+o(1))√n | `research solved` | +| `erdos_962.variants.erdos_lower` | k(n) ≫_ε exp((log n)^(1/2−ε)) | `research solved` | +| `erdos_962.variants.tang_lower` | k(n) ≥ exp((1/√2 − o(1))√(log n · log log n)) | `research solved` | + +This appears to capture **all** results mentioned on the website. The main conjecture and all three known bounds (Tao upper, Erdős lower, Tang lower) are formalized. No variants appear to be missing. + +## 4. Readability + +The code is clean and well-structured: + +- The `erdos962_k` definition is clearly documented with a docstring explaining its mathematical meaning. +- Each theorem has a docstring that states the bound in both mathematical notation and an English-language "formulated as" gloss, which is helpful for understanding the ε-δ encoding. +- The `open Real` and `namespace Erdos962` are appropriate. +- The use of `(1 : ℝ) / 2` instead of `1 / 2` is necessary for type correctness but slightly clutters readability; this is a standard Lean idiom and unavoidable. + +**Minor suggestion:** The Tang lower bound docstring could mention Tang's full name (Quanyu Tang) for consistency with how Tao's full name (Terence) is implicitly recognized. + +## 5. Formalizability + +**Assessment: Precise and unambiguously formalizable.** + +The problem statement defines k(n) explicitly as a maximum over a well-defined set of natural numbers. The key components—"divisible by at least one prime > k," consecutive integers {m+1, ..., m+k}, and m ≤ n—are all standard and unambiguous. + +The only source of ambiguity is the word "estimate" in the original problem ("Estimate k(n)"), which is inherently imprecise. The formalization handles this well by: +1. Stating Erdős's specific conjecture (k(n) = o(n^ε)) as the main theorem. +2. Including known upper and lower bounds as separate variant statements. + +This is a natural and complete interpretation of "estimate." + +## 6. Correctness + +**Assessment: Correct, with one subtle note about `sSup`.** + +### Definition of `erdos962_k` + +The definition uses `sSup` on the set `{k : ℕ | ∃ m : ℕ, m ≤ n ∧ ∀ i : ℕ, 1 ≤ i → i ≤ k → ∃ p : ℕ, Nat.Prime p ∧ p > k ∧ p ∣ (m + i)}`. + +- **Non-emptiness:** k = 0 is always in the set (the universal quantifier over i with 1 ≤ i and i ≤ 0 is vacuously true). So the set is nonempty for all n. +- **Boundedness:** For any fixed n, the set is bounded above. Each m + i ≤ n + k, and each m + i must have a prime factor > k. Since m + i ≤ n + k and any prime factor p > k satisfies p ≤ n + k, there are finitely many such primes available. More directly, Tao's bound k(n) ≤ (1+o(1))√n confirms finiteness. In Lean's `ℕ`, `sSup` on a nonempty bounded set returns the actual maximum, so this is well-defined. +- **Mathematical accuracy:** The definition correctly captures "the maximal k such that there exists m ≤ n with every integer in {m+1, ..., m+k} divisible by at least one prime > k." + +### Main conjecture (`erdos_962`) + +The statement ∀ δ > 0, ∃ N₀, ∀ n ≥ N₀, k(n) ≤ δ · n^ε is a correct encoding of k(n) = o(n^ε). The quantifier structure (∀ ε > 0, ∀ δ > 0, ∃ N₀, ...) matches the standard definition of little-o. Tagged `research open`, consistent with the website. + +### Tao upper bound (`tao_upper`) + +The statement ∃ N₀, ∀ n ≥ N₀, k(n) ≤ (1+ε)√n correctly encodes k(n) ≤ (1+o(1))√n by universally quantifying over ε > 0. Correct. + +### Erdős lower bound (`erdos_lower`) + +The statement ∃ C > 0, ∃ N₀, ∀ n ≥ N₀, k(n) ≥ C · exp((log n)^(1/2−ε)) correctly encodes k(n) ≫_ε exp((log n)^(1/2−ε)). The Vinogradov notation ≫_ε means the implied constant may depend on ε, which is captured by having C depend on ε (existentially quantified after ε is universally quantified). Correct. + +**Note:** For ε ≥ 1/2, the exponent 1/2 − ε ≤ 0, making (log n)^(1/2−ε) bounded or tending to 0, so the bound becomes trivial. This is mathematically harmless—the statement remains true but uninformative for large ε. + +### Tang lower bound (`tang_lower`) + +The statement ∃ N₀, ∀ n ≥ N₀, k(n) ≥ exp((1/√2 − ε) · √(log n · log log n)) correctly encodes k(n) ≥ exp((1/√2 − o(1))√(log n · log log n)). Similarly to the Erdős lower bound, for ε ≥ 1/√2 the bound becomes trivially true (negative argument to exp gives a value < 1, always ≤ k(n) ∈ ℕ). No issue. + +### Tag correctness + +- `AMS 11` (Number Theory) is appropriate. +- `research open` for the main conjecture and `research solved` for the three bounds are consistent with the website. + +### Potential issue: `log` and `log log` domain + +In Tang's lower bound, `log (log (n : ℝ))` requires log n > 0, i.e., n > 1, for the inner log to be positive and the outer log to be meaningful (as a real-valued function). For small n (e.g., n = 0 or 1), `log (n : ℝ)` is 0 or negative, and `log (log (n : ℝ))` would be `log` of a non-positive number. In Mathlib, `Real.log` is defined on all reals (returning 0 for non-positive inputs), so the expression is well-typed but may produce unexpected values for small n. Since the statement only asserts the bound for n ≥ N₀ (with N₀ existentially quantified and presumably large), this is not a correctness issue—the prover can simply choose N₀ large enough. Mathematically sound. + +**Overall: The formalization is correct and complete. No mathematical errors were identified.** diff --git a/ai-review/963.md b/ai-review/963.md new file mode 100644 index 0000000000..d1e52c7460 --- /dev/null +++ b/ai-review/963.md @@ -0,0 +1,96 @@ +# AI Review: Erdős Problem 963 + +## 1. Code Reuse + +**Erdős 774** (`FormalConjectures/ErdosProblems/774.lean`) defines a closely related `Dissociated` predicate for `Set ℕ`: + +```lean +def Dissociated (A : Set ℕ) : Prop := + ∀ X Y : Finset ℕ, ↑X ⊆ A → ↑Y ⊆ A → X ≠ Y → X.sum id ≠ Y.sum id +``` + +This is mathematically equivalent to the `IsDissociated` definition in 963, but differs in: +- **Type universe**: `Set ℕ` vs `Finset ℝ` +- **Polarity**: 774 uses the contrapositive form (`X ≠ Y → sum ≠ sum`), while 963 uses the direct form (`sum = sum → X = Y`) +- **Naming convention**: `Dissociated` (774) vs `IsDissociated` (963). The `Is`-prefixed style is more consistent with Mathlib conventions (cf. `IsSidon`, `IsSumFree` in `FormalConjecturesForMathlib/Combinatorics/Basic.lean`). + +**Recommendation**: A unified, polymorphic definition (e.g., `IsDissociated` over a general `AddCommMonoid` for `Finset α`) in `FormalConjecturesForMathlib` would eliminate duplication and allow both problems to share infrastructure, analogous to how `IsSidon` is defined generically and reused across Erdős 43, 44, 156, 772, 773. + +The `Nat.log` usage pattern is standard and consistent with other problems (927, 878, 1016). + +## 2. Citations + +The formalization cites: + +> [Er65] Erdős, P., _Extremal problems in number theory_, 1965. + +The website additionally references: + +> [Va99, 1.22] + +This likely refers to Vu, Van H., *"New bounds on nearly perfect matchings in hypergraphs: higher codegrees do help"* (1999), or another work indexed as Va99 in the Erdős problems database. **This citation is missing from the formalization's docstring** and should be added for completeness. + +## 3. Variants + +The website does not list additional variants beyond the core question. The formalization captures the main conjecture (whether `f(n) ≥ ⌊log₂ n⌋`) and mentions the known greedy bound (`f(n) ≥ ⌊log₃ n⌋`) in the docstring. No variants appear to be missing. + +One could consider formalizing the greedy lower bound `f(n) ≥ ⌊log₃ n⌋` as a separate (provable) theorem, but this is not required. + +## 4. Readability + +The code is clean and well-structured. Minor observations: + +- The docstring provides a clear mathematical statement, an equivalent reformulation, and historical context (the greedy bound). This is good practice. +- The `IsDissociated` definition is self-contained and easy to parse. +- The `open Finset BigOperators` is appropriate for the summation notation. + +No readability improvements needed. + +## 5. Formalizability + +The problem is **fully formalizable** with minimal ambiguity: + +- "Dissociated" (all subset sums distinct) has a precise, standard combinatorial definition. +- The function `f(n)` is well-defined as a minimum over all sets of size `n`. +- The question `f(n) ≥ ⌊log₂ n⌋` is a sharp, decidable inequality for each `n`. + +The only potential source of ambiguity is the definition of "dissociated" itself. In some literature, "dissociated" means no non-trivial linear combination with coefficients in {−1, 0, 1} sums to zero (i.e., `∑ εᵢbᵢ = 0` with `εᵢ ∈ {-1, 0, 1}` implies all `εᵢ = 0`). This is **mathematically equivalent** to the "all subset sums distinct" formulation used here: if `∑_S b = ∑_T b` for `S ≠ T`, then `∑_{S\T} b − ∑_{T\S} b = 0` gives a non-trivial signed combination, and vice versa. So the formalization is correct under either convention. + +**Ambiguity: Low.** + +## 6. Correctness + +### Definition of `IsDissociated` + +```lean +def IsDissociated (B : Finset ℝ) : Prop := + ∀ S T, S ⊆ B → T ⊆ B → (∑ b ∈ S, b) = (∑ b ∈ T, b) → S = T +``` + +This correctly captures "all subset sums are distinct." The quantification is over all sub-finsets `S, T ⊆ B`, and the conclusion `S = T` (rather than the weaker `S.sum = T.sum → S = T`) is the right injectivity condition. **Correct.** + +### Main theorem + +```lean +theorem erdos_963 : answer(sorry) ↔ ∀ (A : Finset ℝ), A.Nonempty → + ∃ B : Finset ℝ, B ⊆ A ∧ IsDissociated B ∧ Nat.log 2 A.card ≤ B.card +``` + +- **Domain**: The problem says `A ⊂ ℝ`; using `Finset ℝ` correctly captures finite subsets of the reals. +- **`Nat.log 2 A.card`**: This computes `⌊log₂ |A|⌋` for natural number input, matching the problem statement exactly. +- **`A.Nonempty` guard**: This is a harmless but unnecessary condition — when `A = ∅`, `A.card = 0`, `Nat.log 2 0 = 0`, and `B = ∅` trivially satisfies the conclusion. Including it does not affect correctness. +- **`answer(sorry)` wrapper**: Appropriate for an open problem where the answer (yes/no) is unknown. If the answer is True, the RHS is the conjecture; if False, the negation provides a counterexample. +- **Existential over `Finset ℝ`**: The statement `∃ B : Finset ℝ, B ⊆ A ∧ ...` is correct. Since `B ⊆ A` and `A` is a `Finset ℝ`, `B` is automatically a finite subset of `A`. + +**No mathematical flaws detected. The formalization is correct and complete.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | Opportunity to unify with Erdős 774's `Dissociated` via a shared generic definition | +| Citations | Missing [Va99, 1.22] from the website | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/964.md b/ai-review/964.md new file mode 100644 index 0000000000..d1f10a9ad1 --- /dev/null +++ b/ai-review/964.md @@ -0,0 +1,83 @@ +# Review of Erdős Problem 964 + +## 1. Code Reuse + +**Ratio helper definition.** Problems 419 and 420 both define named helper functions for divisor-count ratios (`erdos419_ratio`, `F`). Problem 964 inlines `(Nat.divisors (n + 1)).card / (Nat.divisors n).card` directly in the theorem statement. For a single theorem this is acceptable, but defining a named ratio (as 419 does) would improve consistency across the codebase and make the statement slightly easier to read. + +**Density utilities.** `FormalConjecturesForMathlib/Data/Set/Density.lean` provides asymptotic/natural density of subsets of ℕ, which is unrelated to the topological density in (0,∞) used here. No reuse opportunity. + +**Divisor-related definitions.** Several files use `(Nat.divisors n).card` directly (381, 420, 419, 823). There is no shared `tau` or `numDivisors` abbreviation in the codebase. Introducing one in `FormalConjecturesForMathlib` could reduce duplication across multiple Erdős problems, but this is a broader refactoring concern and not specific to 964. + +**No blocking code reuse issues.** + +## 2. Citations + +The formalization references: +- `[Er86b]` — described as "Erdős, P., original problem statement." +- `[Eb25]` — described as "Eberhard, S., proof that the sequence is dense." + +The website (erdosproblems.com/964) lists the same citation keys (Er86b, Eb25) without providing full bibliographic details beyond author and year. The formalization's citation descriptions are consistent with what the website provides. + +**Minor note:** The Eberhard result is from 2025. The website notes Eberhard proved that "all positive rationals can be expressed as such a ratio," which is a stronger statement than mere density. The docstring could be slightly more precise about the nature of Eberhard's proof (see §3 below). + +## 3. Variants + +The website notes that Eberhard proved a **stronger result**: every positive rational number can be written as τ(n+1)/τ(n), not just that the set is dense in (0,∞). This stronger result is mentioned in the module docstring but is **not captured as a formal variant**. A natural variant would be: + +``` +theorem erdos_964.variants.rational_values : + ∀ q : ℚ, q > 0 → + ∃ n : ℕ, n ≥ 1 ∧ + ((Nat.divisors (n + 1)).card : ℚ) / ((Nat.divisors n).card : ℚ) = q +``` + +The website also mentions a connection to **Problem 946** (listed as related). This relationship is not documented in the formalization. + +Additionally, the website notes the result "follows easily from the generalised prime k-tuple conjecture" — meaning the problem was conditionally solved before Eberhard's unconditional proof. This historical note is absent but is not essential for the formalization. + +## 4. Readability + +The formalization is clean and concise. A few suggestions: + +- **Named ratio function.** Defining a helper like `def tauRatio (n : ℕ) : ℝ := ...` would parallel the style in 419.lean and make the theorem statement shorter. This is a mild stylistic preference. +- **The module docstring** is well-written and clearly states the problem, result, and references. +- **The theorem docstring** is clear and restates the mathematical content in both symbolic and prose form. + +Overall readability is good. + +## 5. Formalizability + +The problem statement "Is τ(n+1)/τ(n) everywhere dense in (0,∞)?" is **completely unambiguous** and directly formalizable. The divisor-counting function τ is standard, and "everywhere dense" has a precise topological meaning (equivalently captured by the ε-ball formulation used here). + +**Ambiguity: None.** This is about as clean a number-theoretic statement as one could hope for. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed verification: + +- **Density characterization.** The statement `∀ r > 0, ∀ ε > 0, ∃ n ≥ 1, |τ(n+1)/τ(n) - r| < ε` is the standard ε-characterization of the set {τ(n+1)/τ(n) : n ≥ 1} being dense in (0,∞). This is equivalent to the topological notion. + +- **The `n ≥ 1` guard is necessary and correct.** For n = 0 in Lean/Mathlib, `Nat.divisors 0 = ∅` (since `Nat.divisors` filters over `Finset.Icc 1 n`, which is empty when n = 0), so `(Nat.divisors 0).card = 0`, making the ratio degenerate (division by zero yields 0 in Lean's real number division). For n ≥ 1, τ(n) ≥ 1 always holds, so the ratio is well-defined. + +- **`answer(True)` is correct.** The problem asks whether the density holds; Eberhard's 2025 proof confirms it does. The `True` answer is appropriate. + +- **Divisor computation.** `(Nat.divisors n).card` correctly computes τ(n) — the number of positive divisors of n. The expression `(Nat.divisors (n + 1)).card` correctly shifts to n+1. + +- **Domain of density.** The formalization requires `r > 0`, corresponding to density in (0,∞). Since τ(n) ≥ 1 for all n ≥ 1, the ratio τ(n+1)/τ(n) is always a positive rational, so (0,∞) is the correct ambient space. + +- **Alternative formulation.** One could express density using Mathlib's `Dense` predicate on the subspace topology of `Set.Ioi (0 : ℝ)`, but the explicit ε-formulation is equivalent and arguably clearer for this purpose. + +**No mathematical flaws identified.** + +## Summary + +| Category | Assessment | +|---|---| +| Code reuse | No blocking issues; minor opportunity for a shared `tauRatio` helper | +| Citations | Consistent with website; adequate detail | +| Variants | **Missing**: Eberhard's stronger result (every positive rational achieved); related Problem 946 not mentioned | +| Readability | Good | +| Formalizability | Unambiguous; fully formalizable | +| Correctness | **Correct and complete** | diff --git a/ai-review/966.md b/ai-review/966.md new file mode 100644 index 0000000000..5d165cb70c --- /dev/null +++ b/ai-review/966.md @@ -0,0 +1,50 @@ +# AI Review: Erdős Problem 966 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib`. The formalization uses a raw encoding of arithmetic progressions (`a + i * d` for `i < k`) rather than a shared predicate. While multiple Erdős problems involve arithmetic progressions (e.g., problems in Ramsey/additive combinatorics), the codebase does not currently provide a general `ArithmeticProgression` or `HasAPOfLength` predicate. The pattern is used only twice in this file (once for length `k+1`, once for length `k`), so inlining is reasonable. + +The graph-theory analogue in problem 924 uses a structurally similar pattern (existence of a structured object avoiding one configuration but forcing another under colorings), but the concrete types differ (cliques in graphs vs. APs in sets of naturals), so no code sharing is possible. + +## 2. Citations + +The docstring references `[Er75b]`. The [erdosproblems.com/966](https://www.erdosproblems.com/966) page confirms the reference is `[Er75b]` and states that "Spencer has recently shown that such a sequence exists" (with no further citation for Spencer's proof). The formalization's docstring is consistent with the website. + +**Suggested improvement:** The docstring could optionally include the recommended citation format from the website: *T. F. Bloom, Erdős Problem #966, https://www.erdosproblems.com/966*. + +## 3. Variants + +The website presents a single formulation with no additional variants. The formalization captures the full statement. The connection to problem 924 (the graph-theoretic analogue involving cliques) is documented in the module docstring. No missing variants. + +## 4. Readability + +The code is concise and readable. The module docstring clearly explains the problem, its origin, and its relationship to problem 924. The theorem statement is self-contained and follows the standard pattern used across the codebase (`answer(True) ↔ ...`). + +Minor suggestions: +- The two AP conditions (no AP of length `k+1`, forced monochromatic AP of length `k`) share a common structure. A local `let` or auxiliary definition for "A contains an AP of length n with common difference d" could reduce visual repetition, but given the brevity of the file, the current inline approach is perfectly acceptable. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: it involves quantification over finite parameters (`k`, `r`), existence of a set of naturals, absence of a combinatorial configuration (long AP), and a Ramsey-type coloring property (monochromatic shorter AP). All concepts have standard formalizations. The only potential ambiguity — the meaning of "non-trivial" arithmetic progression — is universally understood to mean common difference `d > 0`, which the formalization correctly captures with `0 < d`. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed analysis: + +- **AP encoding:** An arithmetic progression of length `m` starting at `a` with common difference `d` is encoded as `{a + i * d | i < m}`. This is standard and correct. For `i = 0` we get `a`, for `i = m-1` we get `a + (m-1)*d`. + +- **Non-triviality:** The condition `0 < d` (with `d : ℕ`) correctly enforces a non-constant progression. Since `d : ℕ`, negative differences are excluded, but this is not a problem: any arithmetic progression in ℕ with negative common difference in ℤ can equivalently be written as an increasing progression by reversing the order. + +- **First conjunct (AP-free condition):** `¬∃ a d : ℕ, 0 < d ∧ ∀ i : ℕ, i < k + 1 → a + i * d ∈ A` correctly states that A contains no non-trivial AP of length `k + 1`. + +- **Second conjunct (Ramsey property):** `∀ c : ℕ → Fin r` colors all of ℕ (not just A). This is equivalent to coloring only A: any r-coloring of A extends to ℕ, and any coloring of ℕ restricts to A. The existential then finds `a, d` with `0 < d` such that (1) all `k` terms lie in A and (2) all terms receive the same color as `c a`. This correctly captures "monochromatic AP of length k in A." + +- **Answer polarity:** The answer is `True`, consistent with the website's statement that Spencer proved such sets exist. The tags `research solved` are appropriate. + +- **AMS classification:** `AMS 5` (Combinatorics) is appropriate for this Ramsey-theoretic problem in additive combinatorics. + +**No mathematical errors identified.** diff --git a/ai-review/967.md b/ai-review/967.md new file mode 100644 index 0000000000..33f6b4dc1a --- /dev/null +++ b/ai-review/967.md @@ -0,0 +1,77 @@ +# AI Review: Erdős Problem 967 + +## 1. Code Reuse + +**`HasFejerGaps` in `FormalConjecturesForMathlib/Analysis/HasGaps.lean`** is directly relevant. It is defined as: + +```lean +def HasFejerGaps (n : ℕ → ℕ) : Prop := StrictMono n ∧ Summable (fun k => (n k : ℝ)⁻¹) +``` + +The current formalization encodes the hypotheses `StrictMono a`, `∀ i, 2 ≤ a i`, and `Summable (fun i => (1 : ℝ) / (a i : ℝ))` inline. The first and third conditions are exactly `HasFejerGaps` (up to using `1 / x` vs `x⁻¹`, which are definitionally equal for reals). The `∀ i, 2 ≤ a i` condition (ensuring all terms are > 1) is not part of `HasFejerGaps`, but it is implied by `StrictMono` on `ℕ → ℕ` when the first term is ≥ 2. The current inline encoding is acceptable for a standalone problem statement, but referencing `HasFejerGaps` could improve discoverability and connect the problem to the gap-sequence infrastructure. + +**Verdict:** Minor opportunity for reuse via `HasFejerGaps`. Not essential but would be a nice connection. + +## 2. Citations + +The website lists: + +- **Origin:** Erdős and Ingham (1964), *Arithmetical Tauberian theorems*, Acta Arithmetica. +- **Resolution:** Yip, C. H. (2025), *On a question of Erdős and Ingham*. + +The formalization's docstring references match: +- `[ErIn64]` → Erdős and Ingham, *Arithmetical Tauberian theorems*, Acta Arithmetica (1964). ✅ +- `[Yi25]` → Yip, C. H., *On a question of Erdős and Ingham* (2025). ✅ + +**Verdict:** Citations are accurate and complete. + +## 3. Variants + +The website mentions an open subproblem that the formalization also notes: + +> *It remains open whether this holds for every finite sequence of integers.* + +Specifically, the website mentions that the simplest case Erdős and Ingham could not resolve was the finite sequence {2, 3, 5}, i.e., whether $2^{-1-it} + 3^{-1-it} + 5^{-1-it} = -1$ has a real solution $t$. This is connected to the Four Exponentials Conjecture (which would imply non-vanishing). + +The formalization does **not** include a separate theorem statement for the finite-sequence variant. This is a notable omission — the finite case is explicitly listed as still open on the website, and the {2, 3, 5} case is highlighted. A dedicated conjecture for the finite case would capture the full scope of the problem. + +**Verdict:** The finite-sequence variant (and especially the {2, 3, 5} case) is not formalized. This is a meaningful gap. + +## 4. Readability + +The code is clear and well-structured. A few minor observations: + +- The expression `(1 : ℂ) / ((a k : ℂ) ^ ((1 : ℂ) + ↑t * I))` is dense but faithfully represents the mathematical expression $a_k^{-(1+it)}$. The type annotations `(1 : ℂ)` are necessary for Lean's elaboration. This is as readable as it can reasonably be. +- The docstring clearly states the problem, its resolution, and the remaining open question. +- The `answer(False)` annotation correctly reflects that the conjecture has been disproved. + +**Verdict:** Readability is good. No significant improvements needed. + +## 5. Formalizability + +The mathematical statement is precise and admits a clean formalization: + +- "Strictly increasing sequence of integers > 1 with convergent reciprocal sum" is unambiguous. +- The Dirichlet-series expression $1 + \sum_k a_k^{-(1+it)}$ is well-defined given convergence of $\sum 1/a_k$ (which implies absolute convergence of the Dirichlet series for $\operatorname{Re}(s) \geq 1$). +- The quantifier structure ("for every $t$, the expression is nonzero") is clear. + +One subtle point: the original problem says "sequence of integers" with $1 < a_1 < a_2 < \cdots$, which the formalization models as `a : ℕ → ℕ` with `StrictMono a` and `∀ i, 2 ≤ a i`. This is correct — since the $a_k$ are integers greater than 1, they are positive integers ≥ 2. Modeling as `ℕ → ℕ` is appropriate. + +**Verdict:** The problem is unambiguously formalizable. No issues. + +## 6. Correctness + +The formalization is mathematically correct with one important caveat: + +**The core statement is correct:** +- `StrictMono a` captures $a_1 < a_2 < \cdots$. +- `∀ i, 2 ≤ a i` captures $1 < a_k$ for all $k$. +- `Summable (fun i => (1 : ℝ) / (a i : ℝ))` captures $\sum 1/a_k < \infty$. +- `1 + (∑' k, (1 : ℂ) / ((a k : ℂ) ^ ((1 : ℂ) + ↑t * I))) ≠ 0` captures $1 + \sum_k a_k^{-(1+it)} \neq 0$. +- `answer(False)` correctly indicates the conjecture is false (disproved by Yip). + +**Potential issue with the complex power:** The expression `(a k : ℂ) ^ ((1 : ℂ) + ↑t * I)` uses Lean's `Complex.cpow`, which for positive real bases is well-defined via the principal branch. Since `a k ≥ 2`, the base is a positive real number, so `z^w = exp(w * log z)` with `log z = log |z|` (imaginary part is zero). This correctly yields $a_k^{1+it} = a_k \cdot a_k^{it} = a_k \cdot e^{it \log a_k}$. The reciprocal $1 / a_k^{1+it}$ then gives $a_k^{-(1+it)}$ as intended. ✅ + +**Convergence of the tprod:** The use of `∑'` (tsum) is appropriate. Mathlib's `tsum` returns 0 for non-summable functions, but the summability of $\sum 1/a_k$ in the hypotheses guarantees the series is absolutely convergent for the real part = 1, so the tsum is well-defined. However, note that summability of `fun i => (1 : ℝ) / (a i : ℝ)` does not *automatically* give Lean-level `Summable` for the complex-valued function `fun k => (1 : ℂ) / ((a k : ℂ) ^ ((1 : ℂ) + ↑t * I))`. The proof of `sorry` would need to establish this. This is not a flaw in the statement — it's a proof obligation, and the mathematical fact is sound since $|a_k^{-(1+it)}| = a_k^{-1}$. + +**Verdict:** The formalization is mathematically correct and complete for the main conjecture. The `answer(False)` direction is right. The only gap is the missing finite-sequence variant (discussed in §3). diff --git a/ai-review/969.md b/ai-review/969.md new file mode 100644 index 0000000000..6310cb6170 --- /dev/null +++ b/ai-review/969.md @@ -0,0 +1,79 @@ +# Review: Erdos Problem 969 + +## 1. Code Reuse + +- **`FormalConjecturesForMathlib/Data/Nat/Squarefree.lean`** defines `squarefreePart`, `squarePart`, and `squarefree_infinite`, but does not provide a squarefree counting function. None of this is directly reusable for the counting asymptotic. +- **`FormalConjecturesForMathlib/Analysis/Asymptotics/Basic.lean`** defines `≪` and `≫` notation wrapping `Asymptotics.IsBigO`. The formalization could use `squarefreeError ≪ fun x => (x : ℝ) ^ (1/4 + ε)` instead of manually spelling out the big-O quantifiers, but the current explicit form is arguably clearer for a standalone conjecture statement since it avoids the filter machinery and makes all quantifiers visible. No strong recommendation to change. +- The `squarefreeCount` definition using `(Icc 1 x).filter Squarefree).card` is clean and appropriately leverages Mathlib's `Squarefree` predicate and `Finset.Icc`. No existing utility in the codebase provides this. + +**Verdict:** No significant code reuse opportunity. The definitions are appropriately self-contained. + +## 2. Citations + +The formalization's docstring mentions Evelyn and Linfoot informally but provides no bracketed citation keys or full references. The website lists: + +- Erdos [Er65b], [Er81h, p.176] +- Walfisz [Wa63] — proved the best unconditional bound E(x) = O(x^{1/2 - o(1)}) +- Evelyn and Linfoot [EvLi31] — proved the lower bound E(x) = Ω(x^{1/4}) +- Liu [Li16] — proved E(x) = O(x^{11/35 + o(1)}) conditional on the Riemann Hypothesis +- OEIS sequence A013928 + +**Issue:** The docstring should include proper citations with keys matching the website conventions (e.g., `[EvLi31]`, `[Wa63]`, `[Li16]`), and should mention Walfisz and Liu's results as context. The OEIS reference would also be useful. + +## 3. Variants + +The website frames the problem as "Determine the order of magnitude of E(x)." The formalization captures the upper-bound conjecture E(x) = O(x^{1/4+ε}) for all ε > 0, which combined with the known Evelyn-Linfoot lower bound E(x) = Ω(x^{1/4}) would establish x^{1/4} as the true order of magnitude. + +Possible additional variants not captured: +- **The Evelyn-Linfoot lower bound** E(x) = Ω(x^{1/4}) could be stated as a separate solved theorem, since it is a proven result and provides the complementary half of the "order of magnitude" determination. +- **The RH implication**: The docstring mentions that E(x) = O(x^{1/4}) (without ε) would imply the Riemann Hypothesis, but this is not formalized. This is a distinct and stronger statement from what is conjectured. +- **The conditional RH bound**: E(x) = O(x^{11/35 + o(1)}) assuming RH (Liu) is not captured, though this is a known result rather than a conjecture. + +**Verdict:** The core conjecture is captured. The Evelyn-Linfoot lower bound would be a valuable addition as a separate (solved) theorem to complete the picture. + +## 4. Readability + +The code is clean, well-structured, and readable. Specific positives: +- Clear namespace `Erdos969` preventing name collisions. +- Well-chosen helper definitions (`squarefreeCount`, `squarefreeError`) with descriptive docstrings. +- The main theorem statement makes the big-O structure explicit with visible quantifiers. +- `open Finset Real` is minimal and appropriate. + +Minor suggestions: +- The docstring could more clearly separate "what is conjectured" from "what is known," perhaps using bullet points. +- The cast `(1 : ℝ) / 4` is slightly unusual; `(1 : ℝ) / 4` and `(1 / 4 : ℝ)` are equivalent but the latter reads more naturally. However, this may be a deliberate choice to avoid Lean parsing issues. + +**Verdict:** Good readability. No significant issues. + +## 5. Formalizability + +The problem as stated on the website — "Determine the order of magnitude of E(x)" — is somewhat imprecise in the sense that "order of magnitude" is informal. However, in analytic number theory, the standard interpretation is clear: the order of magnitude is x^θ if E(x) = O(x^{θ+ε}) for all ε > 0 and E(x) = Ω(x^{θ-ε}) for all ε > 0 (or more commonly, E(x) = Ω(x^θ)). The formalization captures the non-trivial upper-bound direction precisely. + +**Ambiguity assessment: Low.** The analytic number theory conventions make the intended meaning clear, and the formalization chooses the standard precise interpretation. The only ambiguity is whether the problem asks for the exact bound O(x^{1/4}) or the weaker O(x^{1/4+ε}) for all ε > 0; the formalization reasonably chooses the latter, which suffices to determine the order of magnitude. + +## 6. Correctness + +### Definitions +- `squarefreeCount x = ((Icc 1 x).filter Squarefree).card` correctly counts squarefree positive integers in [1, x]. **Correct.** +- `squarefreeError x = (squarefreeCount x : ℝ) - (6 / π²) · x` correctly defines E(x). The density of squarefree numbers is 1/ζ(2) = 6/π², so the leading asymptotic Q(x) ~ (6/π²)x is standard. **Correct.** + +### Main theorem +The statement `∀ ε > 0, ∃ C > 0, ∃ x₀, ∀ x ≥ x₀, |E(x)| ≤ C · x^(1/4 + ε)` is the standard formalization of "E(x) = O(x^{1/4+ε}) for every ε > 0." **Correct.** + +### Subtle points +1. **Domain**: Using `x : ℕ` rather than `x : ℝ` is fine for the asymptotic statement since we take x → ∞ through integers, and the squarefree counting function is naturally integer-valued in its argument. +2. **Relationship to RH**: The docstring correctly notes that E(x) = O(x^{1/4}) (without ε) would imply RH. The formalized conjecture O(x^{1/4+ε}) for all ε > 0 is strictly weaker and does NOT imply RH. This distinction is important and could be clarified in the docstring. Currently the docstring could be read as suggesting the formalized statement implies RH, which is not the case. +3. **Current state of knowledge**: The website notes that "the true order of magnitude remains unknown even under the Riemann Hypothesis" since the best RH-conditional bound is x^{11/35+o(1)} ≈ x^{0.314...}, still above x^{1/4} = x^{0.25}. The conjecture as formalized is therefore stronger than what RH alone yields. + +**Verdict:** The formalization is mathematically correct. The docstring's discussion of the RH connection, while accurate in isolation, could be misleading in the context of the formalized (weaker) statement. Recommend adding a clarifying note that the ε-relaxed form does not imply RH; only the sharp O(x^{1/4}) bound would. + +## Summary + +| Category | Rating | Notes | +|---|---|---| +| Code Reuse | Good | No reuse opportunity; definitions are self-contained | +| Citations | Needs Work | Missing [EvLi31], [Wa63], [Li16] citations and OEIS ref | +| Variants | Adequate | Core conjecture captured; Evelyn-Linfoot lower bound could be added | +| Readability | Good | Clean and well-structured | +| Formalizability | Good | Low ambiguity; standard analytic NT interpretation | +| Correctness | Good | Mathematically correct; docstring RH discussion slightly misleading | diff --git a/ai-review/970.md b/ai-review/970.md new file mode 100644 index 0000000000..bd2fdc5d81 --- /dev/null +++ b/ai-review/970.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 970 + +## 1. Code Reuse + +**Problem 687** (`FormalConjectures/ErdosProblems/687.lean`) formalizes a closely related covering problem using `PrimeCovering`, which captures the dual perspective of Jacobsthal's function (covering intervals by residue classes mod primes). The docstring in 970 correctly notes the relationship. However, the two formalizations define their concepts independently and neither imports nor reuses the other. This is acceptable since the mathematical objects are genuinely different (970 defines Jacobsthal's function as a sup over all $n$ with $\le k$ prime factors, while 687 fixes $n$ to be a primorial). + +No definitions in `FormalConjecturesForMathlib` are directly relevant. The `Nat.Coprime`, `Nat.primeFactors`, and `sInf` used in the definition are all from Mathlib proper. + +**Verdict:** No significant code reuse opportunities missed. + +## 2. Citations + +The docstring references three works: + +- **[Er65b]** — Listed as: `Erdős, P., *Extremal problems in number theory*.` Matches the website. +- **[Iw78]** — Listed as: `Iwaniec, H., *On the problem of Jacobsthal*.` Matches the website. +- **[FGKMT18]** — Listed as: `Ford, B., Green, B., Konyagin, S., Maynard, J., and Tao, T., *Long gaps between primes*.` + +**Issue:** The first author is **Kevin Ford**, so the initial should be **"Ford, K."**, not "Ford, B." The "B" appears to have been confused with Ben Green's initial. + +The website also mentions OEIS sequence **A048669**, which is not referenced in the formalization. This is a minor omission (OEIS links are informational, not essential). + +## 3. Variants + +The website asks a single question: whether $h(k) \ll k^2$. The formalization captures exactly this. No additional variants appear on the website. + +**Verdict:** All variants captured. + +## 4. Readability + +The code is clean and well-structured: + +- The `jacobsthal` definition has a clear docstring explaining what it computes. +- The theorem statement is concise and directly mirrors the mathematical claim. +- The namespace `Erdos970` keeps the definition local and unambiguous. +- The module docstring provides good mathematical context, including known upper and lower bounds and the relationship to Problem 687. + +**Minor suggestion:** The docstring's lower bound formula uses `\gg` but could note that this is due to [FGKMT18] more prominently (it currently does, but inline with the formula). + +**Verdict:** Good readability, no significant issues. + +## 5. Formalizability + +The problem is **fully and unambiguously formalizable**. It is a precise quantitative conjecture: + +> $\exists C > 0, \forall k \in \mathbb{N}, h(k) \le C \cdot k^2$ + +where $h(k)$ is a well-defined combinatorial function. There is no ambiguity in the statement. + +**Verdict:** No ambiguity; the problem admits a clean formal statement. + +## 6. Correctness + +### Definition of `jacobsthal` + +```lean +noncomputable def jacobsthal (k : ℕ) : ℕ := + sInf {m : ℕ | ∀ n : ℕ, 0 < n → n.primeFactors.card ≤ k → + ∀ a : ℕ, ∃ i : ℕ, i < m ∧ Nat.Coprime (a + i) n} +``` + +This defines $h(k)$ as the infimum (= minimum, since the set is upward-closed in $\mathbb{N}$) of all $m$ such that for every positive $n$ with $\le k$ distinct prime factors and every starting point $a$, the interval $\{a, a+1, \ldots, a+m-1\}$ contains an element coprime to $n$. + +**Analysis:** + +- **Correctness of the quantifier structure:** The definition correctly takes the supremum of the single-modulus Jacobsthal function $g(n)$ over all $n$ with $\le k$ prime factors, expressed as the infimum of $m$ values that work uniformly for all such $n$. This matches the standard definition. + +- **Use of $\mathbb{N}$ vs $\mathbb{Z}$:** The standard Jacobsthal function is defined over consecutive integers, but since coprimality depends only on residues mod $n$, and all residue classes are represented among sufficiently large naturals, using $\mathbb{N}$ is equivalent. The only edge case is $a = 0, i = 0$: here $\gcd(0, n) = n \neq 1$ for $n > 1$, so the interval must contain some $i \ge 1$ coprime to $n$. This is consistent with the standard definition and does not affect the asymptotics. + +- **Non-emptiness of the set:** For any $k$, the set $\{m \mid \ldots\}$ is nonempty (by the Chinese Remainder Theorem, the density of integers coprime to any $n$ is $\prod_{p \mid n}(1 - 1/p) > 0$, so gaps between coprime integers are bounded). If the set were empty, `sInf` would return 0, which would make the conjecture trivially true. This is not an issue for any $k$ in practice. + +- **Edge case $k = 0$:** When $k = 0$, the only positive $n$ with 0 prime factors is $n = 1$, and every integer is coprime to 1. So $h(0) = 1$, which is correct. + +### Theorem statement + +```lean +theorem erdos_970 : + answer(sorry) ↔ + ∃ C : ℝ, C > 0 ∧ ∀ k : ℕ, (jacobsthal k : ℝ) ≤ C * (k : ℝ) ^ 2 +``` + +This correctly formalizes "$h(k) \ll k^2$" as the existence of a positive constant $C$ such that $h(k) \le C k^2$ for all $k$. The use of `answer(sorry)` is appropriate for an open problem. + +**Verdict:** The formalization is **mathematically correct and complete**. No flaws identified. + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No issues; no significant reuse opportunities missed | +| Citations | **Minor error**: "Ford, B." should be "Ford, K." (Kevin Ford) | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | + +**Overall:** High-quality formalization with one minor citation typo. diff --git a/ai-review/973.md b/ai-review/973.md new file mode 100644 index 0000000000..b3b3c80d80 --- /dev/null +++ b/ai-review/973.md @@ -0,0 +1,89 @@ +# AI Review: Erdős Problem 973 + +## 1. Code Reuse + +No reusable code from `FormalConjecturesForMathlib` or elsewhere in the codebase applies here. Problem 973 is about complex power sums with modulus constraints — a topic in complex analysis, not number-theoretic divisor arithmetic. The most closely related file is `ErdosProblems/519.lean` (Turán's power sum problem), which is cross-referenced in the docstring. However, problem 519 is a lower-bound result (proving power sums can't all be small) while 973 asks an existence question (can they be exponentially small under `|z_i| ≥ 1`?). Both are self-contained theorem statements with no shared definitions to extract. + +**No action needed.** + +## 2. Citations + +The formalization cites: +- `[Er65b]` — Erdős, P., *Extremal problems in number theory* (1965), p.213. +- Cross-reference to problem `[519]`. + +The website (erdosproblems.com/973, last edited 23 January 2026) lists additional references: +- **[Ha74]** — Halász (the problem is described as "Problem 7.3 of [Ha74]" on the website) +- **[Va99]** — (not expanded on the website) +- **[Tu84b]** — (not expanded on the website) +- **[Er92f]** — (not expanded on the website) + +The website also attributes the original source to Erdős via Halász's formulation. The formalization's citation of `[Er65b, p.213]` is consistent with the website but the additional references are omitted. + +**Suggestion:** Consider adding the additional references `[Ha74]`, `[Va99]`, `[Tu84b]`, `[Er92f]` to the module docstring for completeness, particularly `[Ha74]` since the website identifies it as the proximate source. + +## 3. Variants + +The website mentions a key related result by Tang: + +> Under the constraint |z_i| ≥ 1: max_{2 ≤ k ≤ n+1} |∑ z_i^k| ≥ (2e)^{-(1+o(1))n} + +This is a known lower bound, not an open variant — it shows that if C exists, then C ≤ 2e. This could be formalized as a companion theorem but is a proven result rather than a variant of the conjecture. + +The website also contrasts the `|z_i| ≥ 1` constraint (problem 973) with the `|z_i| ≤ 1` case studied by Erdős, where C ~ 1.32 is achievable. Problem 519 captures the related Turán problem (lower bounds without the `|z_i| ≥ 1` constraint). The cross-reference to [519] is appropriate. + +**No missing variants.** The formalization captures the single open question as stated. + +## 4. Readability + +The code is clean, minimal, and well-structured. Specific observations: + +- The `Fin n` indexing with `z ⟨0, by omega⟩ = 1` is the standard Lean idiom for "z₁ = 1" under 0-indexing. +- The use of `‖z i‖` for complex modulus is standard Mathlib notation. +- Writing `C⁻¹ ^ n` rather than a negative exponent avoids `ℤ`-exponent coercions and is idiomatic. +- The universal quantification over `k` (rather than expressing a `max`) is the natural Lean encoding of "max < bound". + +**No readability issues.** + +## 5. Formalizability + +The problem is precisely and unambiguously formalizable. All components have direct mathematical meaning: +- "sequence of complex numbers" → `Fin n → ℂ` +- "z₁ = 1" → `z ⟨0, _⟩ = 1` +- "|z_i| ≥ 1" → `1 ≤ ‖z i‖` +- "max of power sums < C⁻ⁿ" → universal bound on each power sum +- "does there exist C > 1" → `∃ C : ℝ, C > 1 ∧ ...` + +The only ambiguity in the informal statement is whether the answer is yes or no (it is open), which is correctly handled by `answer(sorry)`. + +**Ambiguity: None.** The informal statement is fully precise. + +## 6. Correctness + +The formalization is **mathematically correct and complete**. Detailed verification: + +| Aspect | Informal | Formal | Correct? | +|--------|----------|--------|----------| +| Existence of C | ∃ C > 1 | `∃ C : ℝ, C > 1 ∧ ...` | ✓ | +| For every n ≥ 2 | ∀ n ≥ 2 | `∀ (n : ℕ) (_ : n ≥ 2)` | ✓ | +| Sequence of n complex numbers | z₁, ..., zₙ ∈ ℂ | `z : Fin n → ℂ` | ✓ | +| z₁ = 1 | z₁ = 1 | `z ⟨0, by omega⟩ = 1` | ✓ | +| All moduli ≥ 1 | \|zᵢ\| ≥ 1 ∀i | `∀ i, 1 ≤ ‖z i‖` | ✓ | +| Power sum range | 2 ≤ k ≤ n+1 | `2 ≤ k → k ≤ n + 1` | ✓ | +| Bound | \|∑ zᵢᵏ\| < C⁻ⁿ | `‖∑ i, z i ^ k‖ < C⁻¹ ^ n` | ✓ | +| Open problem | Unknown answer | `answer(sorry)` | ✓ | + +The encoding `C⁻¹ ^ n` equals `C ^ (-n)` for C > 1, which is positive and well-defined. The universal quantification over k in [2, n+1] correctly captures the max condition (max < bound ↔ ∀ elements < bound). + +**No flaws identified.** + +## Summary + +| Category | Assessment | +|----------|------------| +| Code Reuse | No reuse opportunities | +| Citations | Missing [Ha74], [Va99], [Tu84b], [Er92f] from website | +| Variants | Complete | +| Readability | Excellent | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/974.md b/ai-review/974.md new file mode 100644 index 0000000000..526a265ca1 --- /dev/null +++ b/ai-review/974.md @@ -0,0 +1,72 @@ +# AI Review: Erdős Problem 974 + +## 1. Code Reuse + +No significant reuse opportunities. The codebase does not have a shared roots-of-unity definition or power-sum utility. Related problems (973, 519, 987) each construct power sums and complex exponentials inline. There is no `FormalConjecturesForMathlib` implementation that would apply here. Mathlib's `IsPrimitiveRoot` could in principle be used to express the conclusion (the n-th roots of unity) but the current explicit `exp(2πi·j/n)` form is standard and clear. + +## 2. Citations + +The website ([erdosproblems.com/974](https://www.erdosproblems.com/974)) lists: + +- **Origin:** [Er65b, p.213] — Erdős, P., *Extremal problems in number theory* (1965). +- **Solution:** Tijdeman [Ti66]. +- **Independent proof:** Hu, Tang, and Zhang (mentioned in comments). + +The formalization's docstring includes the Tijdeman reference but is **missing the Erdős origin reference [Er65b, p.213]**. The sibling problem 973 includes this reference for comparison. The independent proof by Hu, Tang, and Zhang is also not mentioned (minor, as Tijdeman is the primary solver). + +**Suggested citation block:** +``` +A conjecture of Turán [Er65b, p.213], proved by Tijdeman [Ti66]. + +[Er65b] Erdős, P., _Extremal problems in number theory_, 1965, p.213. +[Ti66] Tijdeman, R., _On a conjecture of Turán_, 1966. +``` + +## 3. Variants + +The website notes a **stronger result**: only **two** such (n−1)-tuples of consecutive zero power sums are needed, not infinitely many. The formalization uses the weaker hypothesis (`∀ N, ∃ k ≥ N, ...`, i.e., infinitely many). This is a valid formalization of the original conjecture as stated by Erdős/Turán, but the stronger proved result is not captured as a variant. + +The website also gives a geometric characterization: +- **n odd:** the z_i are the n-th roots of unity. +- **n even:** the z_i are vertices of two regular (n/2)-gons inscribed in the same circle centered at the origin. + +However, given the constraint z₁ = 1 (which fixes the circle to be the unit circle), the even-n characterization collapses to the n-th roots of unity as well. This can be verified: the two (n/2)-gons on the unit circle, one containing 1, must be the even-indexed and odd-indexed n-th roots of unity respectively for the power sums to vanish. So the formalization's conclusion is correct for both parities. + +**No variant is missing from a correctness standpoint**, but documenting the stronger "two tuples suffice" version would be valuable. + +## 4. Readability + +The code is clean and readable. Minor observations: + +- The docstring clearly states the mathematical content. +- The use of `z ⟨0, by omega⟩ = 1` is standard Lean idiom for `Fin` indexing. +- The power sum expression `∑ i : Fin n, (z i) ^ (k + j)` is clear. +- The conclusion using `Equiv.Perm (Fin n)` to express "up to reordering" is natural. + +No readability issues. + +## 5. Formalizability + +**Assessment: Precisely formalizable, low ambiguity.** + +The original Erdős/Turán statement uses the word "essentially" ("essentially z_j = e(j/n)"). The website notes Erdős did not elaborate on what "essentially" means. The formalization interprets this as "up to permutation," which is the standard mathematical reading. Since z₁ = 1 pins down one element and the n-th roots of unity (as a set containing 1) are uniquely determined, "up to permutation" is the only reasonable interpretation. There is no residual ambiguity. + +The hypothesis "infinitely many (n−1)-tuples of consecutive zero power sums" is precisely captured by the `∀ N, ∃ k ≥ N` quantifier pattern. + +## 6. Correctness + +**Assessment: Correct.** + +Detailed verification: + +1. **Hypothesis — z₁ = 1:** Captured by `hz1 : z ⟨0, by omega⟩ = 1`. ✓ + +2. **Hypothesis — infinitely many vanishing tuples:** The condition `∀ N : ℕ, ∃ k ≥ N, ∀ j : ℕ, j < n - 1 → (∑ i : Fin n, (z i) ^ (k + j)) = 0` correctly states that for arbitrarily large k, the n−1 consecutive power sums s_k, s_{k+1}, …, s_{k+n−2} all vanish. ✓ + +3. **Conclusion — permutation of n-th roots of unity:** The conclusion `∃ σ : Equiv.Perm (Fin n), ∀ i : Fin n, z (σ i) = exp (2 * ↑Real.pi * I * ↑(i.val) / ↑n)` asserts that z is a rearrangement of {e^{2πij/n} : j = 0, …, n−1}. This is mathematically correct for all n ≥ 2 (both even and odd), as verified by the analysis in Section 3. ✓ + +4. **Edge case n = 2:** With n = 2, we have z₀ = 1, and the condition requires infinitely many k with s_k = z₀^k + z₁^k = 0, i.e., z₁^k = −1 for infinitely many k. This forces z₁ = −1 (the only complex number whose powers hit −1 infinitely often), which is indeed e^{2πi·1/2} = e^{πi} = −1. ✓ + +5. **Constraint `2 ≤ n`:** Necessary since for n = 1 the conclusion would be trivial/vacuous and for n = 0 it's meaningless. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and correct rendering of the proved theorem. The only gap relative to the full state of knowledge is that the stronger hypothesis (two tuples suffice) is not captured, but this is a matter of variant coverage, not correctness. diff --git a/ai-review/976.md b/ai-review/976.md new file mode 100644 index 0000000000..f385fde87a --- /dev/null +++ b/ai-review/976.md @@ -0,0 +1,75 @@ +# AI Review: Erdős Problem 976 + +## 1. Code Reuse + +No significant reuse opportunities. This problem concerns the greatest prime factor of products of polynomial values — a topic in analytic number theory unrelated to the arithmetic progressions, density, sumsets, and Sidon set utilities available in `FormalConjecturesForMathlib/`. The custom definitions `greatestPrimeFactor` and `polyProduct` are specific to this problem and appropriately self-contained. + +Minor note: Mathlib provides `Nat.primeFactorsList` (used here) and `Nat.minFac`, but no built-in "greatest prime factor" function. The `foldr max 0` implementation is idiomatic. + +## 2. Citations + +The docstring references only `erdosproblems.com/976`. The website lists the following references that are not mentioned in the formalization: + +- **[Er65b]** — Erdős, 1965, p. 217 (original source of the problem) +- **[Na22]** — Nagell, 1922 (early lower bound: $F_f(n) \gg n \log n$) +- **[Ri34]** — Ricci, 1934 (independent proof of the same bound) +- **[Er52c]** — Erdős, 1952 (improved to $F_f(n) \gg n(\log n)^{\log\log\log n}$) +- **[ErSc90]** — Erdős and Schinzel, 1990 (weaker published result after a flawed claim) +- **[Te90]** — Tenenbaum, 1990 (proved $F_f(n) \gg n \exp((\log n)^c)$ for some $c > 0$) + +These should be documented in the docstring, particularly [Er65b] as the primary source. + +## 3. Variants + +The formalization captures both questions from the problem statement: + +- **`erdos_976`**: Asks whether $F_f(n) \gg n^{1+c}$ for some $c > 0$ (the "weak" conjecture). +- **`erdos_976.variants.strong`**: Asks whether $F_f(n) \gg n^d$ where $d = \deg(f)$ (the "strong" conjecture). + +The website also mentions the general directive to "estimate $F_f(n)$", but this is not a precise formalizable statement — the two specific conjectures are the appropriate targets. All formalizable variants are captured. + +Note that the strong variant logically implies the weak one (since $d \geq 2$ means $n^d \geq n^2 = n^{1+1}$), which is consistent with the problem's intent. + +## 4. Readability + +The code is clean and well-structured. + +- The helper definitions (`greatestPrimeFactor`, `polyProduct`) are well-named with clear docstrings. +- The namespace `Erdos976` prevents name clashes. +- The `∀ᶠ n in atTop` idiom for "for all sufficiently large $n$" is standard Mathlib style. +- The explicit constants $c > 0$ and $C > 0$ make the asymptotic statement precise. + +One minor suggestion: the docstring for `greatestPrimeFactor` says "or $0$ if $n \leq 1$", which is accurate since `Nat.primeFactorsList` returns `[]` for $n \leq 1$, and `foldr max 0` on an empty list gives `0`. This convention is clearly documented. + +## 5. Formalizability + +**Assessment: Highly formalizable, low ambiguity.** + +The problem statement uses asymptotic notation ($\gg$), which is inherently informal. The formalization correctly unpacks this into explicit constants and an "eventually" quantifier. The key choices are: + +- $\gg$ is rendered as $\exists C > 0, \forall^{\text{uf}} n, \ldots \geq C \cdot n^{1+c}$. This is the standard mathematical meaning. +- "Irreducible polynomial" maps directly to `Irreducible f` in Lean/Mathlib. +- "Degree $d \geq 2$" maps to `2 ≤ f.natDegree`. +- The product $\prod_{m=1}^{n} f(m)$ is taken in absolute value via `natAbs`, which is necessary since $f(m)$ can be negative. This is a sensible and mathematically correct choice. + +The only potential ambiguity in the original statement is whether the constants $c, C$ may depend on $f$. The formalization quantifies $\forall f, \exists c, C$, meaning the constants are allowed to depend on $f$. This matches the standard interpretation of the problem (the constants are not required to be universal across all irreducible polynomials). + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +- **`greatestPrimeFactor`**: Returns the largest element of `Nat.primeFactorsList n`, or `0` if the list is empty (i.e., $n \leq 1$). This correctly captures the greatest prime factor. + +- **`polyProduct`**: Computes $\prod_{m=0}^{n-1} |f(m+1)| = \prod_{m=1}^{n} |f(m)|$. The index shift via `m + 1` correctly makes the product range from $1$ to $n$. + +- **Well-definedness**: If $f$ is irreducible over $\mathbb{Z}$ with $\deg(f) \geq 2$, then by Gauss's lemma $f$ is irreducible over $\mathbb{Q}$, hence has no rational (and therefore no integer) roots. So $f(m) \neq 0$ for all $m \in \mathbb{Z}$, meaning $|f(m)| \geq 1$ and the product is always $\geq 1$. For sufficiently large $n$, the product will exceed $1$ (since $|f(m)| \to \infty$), ensuring `greatestPrimeFactor` returns a positive prime. The `∀ᶠ n in atTop` quantifier correctly handles edge cases for small $n$. + +- **`erdos_976`**: Faithfully formalizes "Is $F_f(n) \gg n^{1+c}$ for some $c > 0$?" The quantifier structure $\forall f, \text{Irred}(f) \to 2 \leq \deg(f) \to \exists c > 0, \exists C > 0, \forall^{\text{uf}} n, \ldots$ is correct. + +- **`erdos_976.variants.strong`**: Faithfully formalizes "Is $F_f(n) \gg n^d$?" Here the exponent is `f.natDegree` rather than a separate variable $d$, which is correct since $d = \deg(f)$ in the problem statement. No separate existential for $c$ is needed since the exponent is fixed by $f$. + +- **`answer(sorry)` usage**: Both statements are wrapped in `answer(sorry) ↔ ...`, indicating the truth value is unknown. This is appropriate for an open problem. + +No mathematical flaws identified. The formalization is faithful to the problem as stated on erdosproblems.com. diff --git a/ai-review/977.md b/ai-review/977.md new file mode 100644 index 0000000000..5dc6592383 --- /dev/null +++ b/ai-review/977.md @@ -0,0 +1,112 @@ +# AI Review: Erdős Problem 977 + +## 1. Code Reuse + +The formalization defines its own `greatestPrimeFactor` in the `Erdos977` namespace: + +```lean +noncomputable def greatestPrimeFactor (n : ℕ) : ℕ := + n.primeFactors.sup id +``` + +There are **three competing definitions** of the same concept across the codebase: + +| File | Definition | Implementation | +|------|-----------|----------------| +| `ErdosProblems/977.lean` | `Erdos977.greatestPrimeFactor` | `n.primeFactors.sup id` | +| `ErdosProblems/976.lean` | `Erdos976.greatestPrimeFactor` | `n.primeFactorsList.foldr max 0` | +| `ErdosProblems/928.lean` | `Erdos928.largestPrimeFactor` | `n.primeFactors.max'` (with nonemptiness guard) | +| `ForMathlib/Data/Nat/MaxPrimeFac.lean` | `Nat.maxPrimeFac` | `sSup {p : ℕ \| p.Prime ∧ p ∣ n}` | + +**Recommendation:** The `Nat.maxPrimeFac` definition in `FormalConjecturesForMathlib` is the canonical utility, complete with proved lemmas (`prime_maxPrimeFac_of_one_lt`, `maxPrimeFac_eq_of_dvd_of_le`, `one_lt_maxPrimeFac_iff`). Problem 977 should use `Nat.maxPrimeFac` instead of rolling its own definition. This would also facilitate any future proof work, since the helper lemmas are already available. + +All four definitions agree on the junk value (0 for n ≤ 1) and the intended semantics. The 977 definition using `Finset.sup` on `primeFactors` is mathematically equivalent to `Nat.maxPrimeFac` but lacks the supporting API. + +## 2. Citations + +The docstring currently lists: + +> [Er65b] Erdős, P., *On some problems in number theory*, 1965. +> [St13] Stewart, C. L., *On divisors of Fermat, Fibonacci, Lucas, and Lehmer numbers*, 2013. + +**Issues identified from [erdosproblems.com/977](https://www.erdosproblems.com/977):** + +1. **Missing references.** The website lists six references; the formalization only includes two: + - **[Sc62]** — Schinzel (1962): Proved P(2^n − 1) > 2n for n > 12. Not cited. + - **[St74b]** — Stewart (1974b): Proved the conjecture when n has fewer than (1/log 2) log log n prime factors. Not cited. + - **[MuWo02]** — Murty and Wong (2002): Proved P(n! + 1) > (1 + o(1))n log n assuming the abc conjecture (relevant to the variant). Not cited. + - **[La21]** — Lai (2021): Proved limsup P(n! + 1)/n ≥ 1 + 9 log 2 (relevant to the variant). Not cited. + +2. **Citation style.** The website does not provide full bibliographic details (journal, volume, pages) for any reference. The current docstring's rendering of [Er65b] and [St13] is consistent with the level of detail available on the website — this is acceptable as-is, though fuller citations would be an improvement if sourced independently. + +3. **OEIS links.** The website references OEIS sequences A005420 and A002583. These are not mentioned in the formalization. + +## 3. Variants + +**The formalization is missing a significant variant.** The website explicitly poses the analogous question for P(n! + 1): + +> *Does P(n! + 1)/n → ∞?* + +This is listed as a related open problem on the same page. It has its own partial results (Murty–Wong conditional on abc, Lai unconditional limsup bound). A complete formalization of Problem 977 should include this variant, e.g.: + +```lean +@[category research open, AMS 11] +theorem erdos_977.variants.factorial : answer(sorry) ↔ + Tendsto (fun n : ℕ => (greatestPrimeFactor (n.factorial + 1) : ℝ) / (n : ℝ)) + atTop atTop := by + sorry +``` + +## 4. Readability + +The formalization is clean and concise. Minor observations: + +- **Good:** The `open Filter` is appropriate and the namespace is well-scoped. +- **Good:** The docstring clearly states both the original question and the resolution. +- **Minor:** The docstring mentions Stewart's quantitative bound `P(2^n − 1) ≫ n^{1 + 1/(104 log log n)}` but this is not formalized. This is acceptable since the main theorem statement captures the qualitative consequence (divergence to ∞), and formalizing the quantitative bound would require additional machinery. However, a brief note in the docstring clarifying that only the qualitative consequence is formalized would improve clarity. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The statement "P(2^n − 1)/n → ∞ as n → ∞" is completely precise. There is: +- No ambiguity in the definition of P(m) (greatest prime factor). +- No ambiguity in the limit statement (Tendsto ... atTop atTop). +- The expression `2^n - 1` requires minor care for n = 0 (where 2^0 − 1 = 0 in ℕ), but since the limit is taken as n → ∞ via `atTop`, finitely many edge cases are irrelevant. + +**One subtlety:** For `n = 0`, `2^n - 1 = 0` in ℕ, and `greatestPrimeFactor 0 = 0` (since `(0 : ℕ).primeFactors = ∅` and `∅.sup id = 0` by `Finset.sup` on `ℕ` with `⊥ = 0`). The quotient `0 / 0` in ℝ equals `0` by Lean convention. None of this affects the limit, so this is a non-issue. + +**Ambiguity score: 0/10** (fully precise). + +## 6. Correctness + +**The formalization is mathematically correct.** + +The statement: +```lean +Tendsto (fun n : ℕ => (greatestPrimeFactor (2 ^ n - 1) : ℝ) / (n : ℝ)) + atTop atTop +``` + +faithfully captures "P(2^n − 1)/n → ∞". Specifically: + +- `Tendsto ... atTop atTop` means: for every real bound M, eventually (for all sufficiently large n), P(2^n − 1)/n > M. This is exactly the standard meaning of divergence to +∞. +- The `answer(True)` is consistent with the problem being proved (by Stewart 2013) in the affirmative. +- The AMS classification `11` (Number Theory) and the tags `research solved` are correct. + +**Potential concern:** The natural number subtraction `2 ^ n - 1` in Lean is truncated subtraction. For `n ≥ 1`, `2^n ≥ 2 > 1`, so `2^n - 1` equals the mathematical 2^n − 1. For `n = 0`, it yields 0. Since `atTop` filters out all finite initial segments, this is harmless. No issue here. + +**Verdict:** The formalization is correct and complete for the main statement. The only mathematical incompleteness is the missing P(n! + 1) variant. + +--- + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | Should use `Nat.maxPrimeFac` from ForMathlib instead of local definition | +| Citations | Missing 4 of 6 references from the website ([Sc62], [St74b], [MuWo02], [La21]) | +| Variants | Missing the P(n! + 1) variant, which is explicitly posed on the website | +| Readability | Good; minor improvement possible in docstring | +| Formalizability | Fully precise, no ambiguity (0/10) | +| Correctness | Mathematically correct and complete for the main statement | diff --git a/ai-review/98.md b/ai-review/98.md new file mode 100644 index 0000000000..e77f8abdfc --- /dev/null +++ b/ai-review/98.md @@ -0,0 +1,104 @@ +# AI Review: Erdős Problem 98 + +## 1. Code Reuse + +**Several definitions in `98.lean` are duplicated verbatim in other files and could be consolidated.** + +- **`NoThreeCollinear`** (lines 34–36): Identical copy-paste in `831.lean:35–37`. Also closely related to `NonTrilinear` in `FormalConjecturesForMathlib/Geometry/2d.lean:54–55`, which uses `Set.Triplewise` over a `Set P` rather than quantifying over `Finset` subsets. The `NonTrilinear` definition is more idiomatic (leveraging `Triplewise` infrastructure) but operates on `Set P` rather than `Finset`, so a small adapter would be needed. Problems 827 and 838 define an equivalent `InGeneralPosition` with the same pattern. + +- **`FourPointsConcyclic` / `NoFourConcyclic`** (lines 43–52): Identical definitions appear in `831.lean:44–53`. Problem 217 defines a different but equivalent `Concyclic4` taking four explicit point arguments (rather than a `Finset`), and Problem 654 defines `FourConcyclic` using squared distances. These should be unified into a shared utility. + +- **`distinctDistanceCount`** (lines 57–58): Uses `Set.ncard` on a set comprehension. A cleaner, `Finset`-based alternative already exists in `FormalConjecturesForMathlib/Geometry/2d.lean:194–195`: + ```lean + noncomputable def distinctDistances (points : Finset ℝ²) : ℕ := + (points.offDiag.image fun (pair : ℝ² × ℝ²) => dist pair.1 pair.2).card + ``` + This `Finset.card`-based version is strictly preferable for formalization: it avoids needing to prove the set is finite (which `Set.ncard` requires for nontrivial reasoning), and it composes better with `Finset` lemmas. Problems 93 and 95 also define their own `distinctDistances` using similar `Finset`-based approaches. + +**Recommendation:** Import and reuse `distinctDistances` from `FormalConjecturesForMathlib/Geometry/2d.lean`, and consider centralizing `NoThreeCollinear` and `NoFourConcyclic` into a shared geometry utility module. + +## 2. Citations + +The formalization includes only a link to [erdosproblems.com/98](https://www.erdosproblems.com/98). The website lists the following references that should be documented in the docstring: + +- **[Er75f]** p. 101 +- **[Er83c]** +- **[Er87b]** p. 167 +- **[Er90]** +- **[Er92b]** +- **[EFPR93]** — Erdős, Füredi, Pach, Roth (1993) +- **[Er94b]** +- **[Er97e]** + +The docstring should include at least the primary references (e.g., `[Er75f], [Er83c], [Er87b], [EFPR93]`) to match the conventions used in other problems (cf. `217.lean:33` which lists `[Er83c] [Er87b] [Er97e]`). + +Additionally, the known bounds should be mentioned: +- Pach showed $h(n) < n^{\log_2 3}$. +- Erdős, Füredi, and Pach improved this to $h(n) < n \exp(c\sqrt{\log n})$. +- Erdős could not even prove $h(n) \geq n$. + +## 3. Variants + +The formalization captures only the main question: does $h(n)/n \to \infty$? + +**Missing variants / related questions:** +- The website notes that even $h(n) \geq n$ is unproven. A weaker formalization of "$h(n) \geq n$ for all sufficiently large $n$" could be stated as a separate, more approachable conjecture. +- The known upper bounds ($h(n) < n \exp(c\sqrt{\log n})$) could be formalized as companion statements, providing context about the gap between what is known and what is conjectured. +- No variant for higher dimensions is mentioned (though that may be a separate problem). + +**Assessment:** The core question is captured. The absence of the weaker "$h(n) \geq n$" variant is a minor gap, since that sub-question is explicitly highlighted on the website as open. + +## 4. Readability + +The code is generally well-structured and readable. Specific observations: + +- **Good:** Each definition has a clear docstring. The main theorem's docstring restates the problem and explains the formal encoding. +- **Good:** The namespace `Erdos98` keeps definitions local. +- **Minor improvement:** The `distinctDistanceCount` definition uses nested existentials (`∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ dist p q = d`) which is slightly harder to read than the `offDiag.image` pattern. The `Finset`-based alternative from `2d.lean` is more concise and idiomatic. +- **Minor:** The docstring for `FourPointsConcyclic` says "Four points" but the definition takes an arbitrary `Finset` — it works correctly when `S.card = 4` (as enforced by `NoFourConcyclic`), but the type signature alone doesn't enforce the four-point constraint. This is fine in context but slightly misleading in isolation. + +## 5. Formalizability + +**Assessment: Highly formalizable. Low ambiguity.** + +The problem statement is precise: +- "No three collinear" and "no four concyclic" are standard, well-defined geometric conditions. +- "Distinct distances" is unambiguous. +- "$h(n)/n \to \infty$" is a standard limit statement. + +The only potential source of ambiguity is whether "concyclic" should include collinear points (i.e., points on a "circle of infinite radius" / a line). The formalization's `FourPointsConcyclic` definition requires a *positive finite radius*, which excludes this degenerate case. This is the standard interpretation and is additionally moot here since the no-three-collinear condition already forbids configurations where four points would be "concyclic on a line." + +**Verdict:** The problem is unambiguously formalizable as stated. + +## 6. Correctness + +**The formalization is mathematically correct.** + +Detailed analysis: + +- **Encoding of $h(n)/n \to \infty$:** The statement asserts: for every $C > 0$, there exists $N$ such that for all $n \geq N$ and every valid $n$-point configuration $P$, `distinctDistanceCount P ≥ C * n`. Since the universal quantification over all valid $P$ of size $n$ captures the *minimum* over such configurations, this is exactly $h(n) \geq Cn$ for large $n$, which is equivalent to $h(n)/n \to \infty$. Correct. + +- **`answer(sorry)` pattern:** Since the problem is open (the answer is unknown), the `answer(sorry) ↔ ...` pattern correctly encodes an open yes/no question. If the answer is `True`, the conjecture holds; if `False`, it does not. + +- **`NoThreeCollinear`:** Quantifies over all 3-element subsets using Mathlib's `Collinear ℝ`, which is the standard affine-geometric notion. Correct. + +- **`FourPointsConcyclic`:** Requires existence of a center $c$ and radius $r > 0$ with all points equidistant from $c$. The $r > 0$ constraint correctly excludes the degenerate case of coincident points (which would have $r = 0$). Correct. + +- **`NoFourConcyclic`:** Quantifies over all 4-element subsets. Correct. + +- **`distinctDistanceCount`:** Counts `Set.ncard` of the set of realized distances. Since `dist p q ≥ 0` and `p ≠ q` implies `dist p q > 0`, this set contains only positive reals. For a finite point set, this set is finite (bounded by $\binom{n}{2}$), so `Set.ncard` agrees with the true cardinality. Correct, though as noted in Section 1, a `Finset`-based definition would be more proof-friendly. + +- **Potential subtlety with `Set.ncard`:** If Lean cannot automatically infer that the set `{d : ℝ | ∃ p ∈ P, ∃ q ∈ P, p ≠ q ∧ dist p q = d}` is finite, then `Set.ncard` returns 0 for infinite sets by convention. This is not a *mathematical* incorrectness (the set is provably finite), but it creates a proof obligation that the `Finset`-based version avoids entirely. This is a formalization ergonomics concern, not a correctness issue. + +**Verdict:** The formalization is correct and complete. No mathematical flaws. The encoding faithfully represents the open question as stated on the website. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | Needs improvement | Three definitions duplicated from 831.lean; `distinctDistances` from 2d.lean is preferable | +| Citations | Needs improvement | Missing specific references (Er75f, Er83c, Er87b, EFPR93, etc.) and known bounds | +| Variants | Acceptable | Core question captured; weaker "$h(n) \geq n$" variant could be added | +| Readability | Good | Well-documented; minor improvement possible with `Finset`-based distance counting | +| Formalizability | Excellent | Unambiguous, precise problem statement | +| Correctness | Correct | Faithful encoding; no mathematical issues | diff --git a/ai-review/980.md b/ai-review/980.md new file mode 100644 index 0000000000..14c180a453 --- /dev/null +++ b/ai-review/980.md @@ -0,0 +1,59 @@ +# Review: Erdos Problem 980 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib`. The formalization defines `IsKthPowerResidue` and `leastKthPowerNonresidue` locally in the `Erdos980` namespace. Mathlib has `ZMod.IsQuadraticResidue` for the k=2 case, but no general kth power residue predicate. The local definitions are simple enough that this is reasonable; introducing a dependency on `ZMod` machinery would add complexity without clear benefit for this statement-level formalization. No reuse opportunities identified. + +## 2. Citations + +The docstring references **[Er65b]**, **[Er61e]**, and **[El67b]**. These match the references on [erdosproblems.com/980](https://www.erdosproblems.com/980): + +- **[Er65b]** — Erdős, P. (original problem formulation). The docstring lists this but provides only "Erdős, P." with no title or journal. +- **[Er61e]** — Erdős, P. (proved the k=2 case). Same: author only, no title/journal. +- **[El67b]** — Elliott, P.D.T.A. (proved the general case). Same: author only, no title/journal. + +The website itself provides only the same shorthand references with author names and no additional bibliographic detail, so the docstring faithfully mirrors what is available on the website. **No discrepancy.** + +## 3. Variants + +The website describes a single problem statement with no additional variants. The formalization captures exactly this statement — the existence of a positive constant $c_k$ such that $\sum_{p < x} n_k(p) \sim c_k \cdot x / \log x$ for all $k \geq 2$. One could imagine a stronger variant that specifies the value of $c_k$ (as is known for $k = 2$, where $c_2 = \sum_{j=1}^{\infty} p_j / 2^j$), but this is mentioned only in the docstring prose and is not part of the formal statement on the website. **No missing variants.** + +## 4. Readability + +The code is clean and well-structured: + +- The helper definitions `IsKthPowerResidue` and `leastKthPowerNonresidue` have descriptive docstrings. +- The main theorem docstring includes the LaTeX statement and explains the epsilon-delta formulation. +- Variable names are standard (`k`, `p`, `c`, `ε`, `X₀`). +- The Finset chain `Finset.filter (fun p => Nat.Prime p) (Finset.range x)` is slightly verbose but idiomatic Lean 4. No readability concerns. + +## 5. Formalizability + +The problem is **highly formalizable**. The asymptotic statement $f(x) \sim g(x)$ has a standard epsilon-delta translation, which the formalization correctly employs: for every $\varepsilon > 0$ there exists $X_0$ such that for all $x \geq X_0$, $|f(x) - g(x)| \leq \varepsilon \cdot g(x)$. The notions of "kth power residue," "least nonresidue," and "sum over primes below x" are all completely unambiguous. **No ambiguity.** + +## 6. Correctness + +The formalization is **mathematically correct**. Detailed analysis: + +- **`IsKthPowerResidue k p a`**: Defined as $\exists b \in \mathbb{N},\; b^k \bmod p = a \bmod p$. This correctly captures the notion that $a$ is a kth power residue modulo $p$. Working over $\mathbb{N}$ with `%` is equivalent to working in $\mathbb{Z}/p\mathbb{Z}$ for the purpose of this definition, since every residue class mod $p$ has a natural number representative in $\{0, \ldots, p-1\}$. + +- **`leastKthPowerNonresidue k p`**: Uses `sInf` over $\{a \in \mathbb{N} \mid a > 0 \land \lnot\text{IsKthPowerResidue}\; k\; p\; a\}$. This correctly finds the least positive kth power nonresidue. The edge case where no nonresidue exists (e.g., $p = 2$ where every integer is a kth power residue, or any prime $p$ with $\gcd(k, p-1) = 1$) is handled by the `sInf ∅ = 0` convention on $\mathbb{N}$. Contributing 0 to the sum for these primes is mathematically appropriate since they are finitely many (for fixed $k$, only primes $p$ with $k \mid (p-1)$ have nontrivial kth power nonresidues, and the others contribute nothing to the asymptotic). + +- **Main theorem structure**: The sum ranges over `Finset.filter (fun p => Nat.Prime p) (Finset.range x)`, which correctly gives all primes $p$ with $0 \leq p < x$, matching the condition $p < x$ in the problem statement. The asymptotic condition $|\sum - c_k \cdot x/\log x| \leq \varepsilon \cdot x / \log x$ is the standard epsilon-delta formulation of $\sim$. + +- **`answer(True)`**: The problem is marked as proved/solved on the website, and the answer is indeed affirmative (such constants $c_k$ exist), so `answer(True)` is correct. + +- **Tags**: `category research solved` and `AMS 11` (Number Theory) are appropriate. + +**No mathematical errors or incompleteness identified.** + +## Summary + +| Criterion | Assessment | +|---|---| +| Code reuse | No reuse opportunities | +| Citations | Matches website; shorthand only (consistent with source) | +| Variants | Complete | +| Readability | Good | +| Formalizability | Unambiguous, fully formalizable | +| Correctness | Correct and complete | diff --git a/ai-review/981.md b/ai-review/981.md new file mode 100644 index 0000000000..095bcef813 --- /dev/null +++ b/ai-review/981.md @@ -0,0 +1,68 @@ +# Review: Erdős Problem 981 + +## 1. Code Reuse + +The formalization is largely self-contained. The `jacobiSym` function is correctly imported from Mathlib via `ProblemImports`. No additional utilities from `FormalConjecturesForMathlib` are needed or would simplify the code. + +**Comparison with Problem 980**: Problem 980 (`ErdosProblems/980.lean`) is structurally very similar — both define a function on primes, then assert an asymptotic of the sum over primes against `x / log x`. Problem 980 uses an explicit ε-δ formulation of the asymptotic, while 981 uses `Tendsto ... atTop (nhds c)`. Both are valid, but the inconsistency in style between two closely related problems (same era, same solver — Elliott) is worth noting. No shared abstraction is warranted, but adopting a uniform convention for expressing `~` asymptotics across the codebase would improve consistency. + +## 2. Citations + +**Current docstring references:** +- `[El69] Elliott, P. D. T. A., _On the mean value of $f(p)$_. Proc. London Math. Soc. (3) 21 (1970), 28–96.` + +**Website (erdosproblems.com/981) references:** +- Original source: **[Er65b, p.232]** — this is missing from the docstring. +- Solution: **[El69]** — present, but the website does not include the full bibliographic details. The docstring's full citation appears to be correct based on the actual paper. +- The website also mentions **[TaZh25]** (Tang and Zhang, 2025) in relation to a variant — see §3 below. + +**Recommendation**: Add `[Er65b]` to the docstring as the original source of the problem, consistent with how Problem 980 cites it. + +## 3. Variants + +The website notes an important distinction: + +> The website previously contained a different version defining f_ε(p) as "the smallest integer m such that Σ_{n≤m} (n/p) < εm" (a 'first-time' problem). Tang and Zhang proved an asymptotic for this alternate definition in 2025 [TaZh25]. + +The current formalization matches the **current** website version (the "for all N ≥ m" version, i.e., the "eventual" condition), which is the version Elliott proved. The "first-time" variant (condition only at N = m) is **not** captured and could be added as a separate theorem if desired. This variant is mathematically distinct and has its own resolution. + +## 4. Readability + +The code is well-structured and readable: +- The `legendrePartialSum` helper is clearly named and documented. +- The `fEpsilon` definition clearly states the "returns 0 if no such m exists" fallback. +- The main theorem docstring includes both the LaTeX statement and a plain-language reformulation. + +**Minor suggestion**: The docstring for `fEpsilon` says "the smallest positive integer m" but the condition is `m ≥ 1`, which is equivalent. This is fine. + +## 5. Formalizability + +The problem is **precisely stated** and the formalization is straightforward. There is minimal ambiguity: + +- **One potential ambiguity**: The condition `Σ_{n≤N} (n/p) < εN` uses a one-sided inequality (no absolute value). One might wonder whether `|Σ_{n≤N} (n/p)| < εN` was intended, but the literal statement on the website is one-sided, and the formalization matches. Mathematically, by the Pólya–Vinogradov inequality, the character sum `Σ_{n≤N} (n/p)` is `O(√p log p)`, so for any ε > 0, the one-sided condition `< εN` will eventually hold for all large N, making `f_ε(p)` well-defined for every prime p. The formalization is correct as stated. + +- **p = 2 edge case**: The Legendre symbol `(n/p)` is traditionally defined only for odd primes. The formalization uses `jacobiSym`, which is defined for all positive integers. For p = 2, `jacobiSym n 2` gives the Kronecker extension, which may not align with the classical intent. However, p = 2 contributes only a single term to the sum and does not affect the asymptotic. This is a negligible concern. + +**Assessment**: High formalizability — the statement admits an essentially unique formalization. + +## 6. Correctness + +### What is correct: +- `legendrePartialSum p N` correctly computes `Σ_{n=1}^{N} (n/p)` using `Finset.Icc 1 N` and `jacobiSym`. +- `fEpsilon ε p` correctly computes `inf {m ≥ 1 | ∀ N ≥ m, sum < ε·N}`, with the fallback to 0 via `sInf` on an empty set. +- The main theorem sums `fEpsilon ε p` over primes `p < x` (via `(Finset.range x).filter Nat.Prime`) and asserts convergence of the ratio to a positive constant via `Tendsto`. +- The `Tendsto` formulation correctly captures the asymptotic `~ c_ε · x / log x`. + +### Potential issues: + +1. **Division by zero in the ratio**: For small `x` (e.g., x = 0 or 1), `Real.log x ≤ 0`, making `(x : ℝ) / Real.log (x : ℝ)` either 0/0 or negative. This does not affect the `Tendsto` statement (which only cares about the eventual behavior as x → ∞), but the function being passed to `Tendsto` is not "clean" for small inputs. This is standard practice and not a real issue. + +2. **`answer(True)` wrapper**: Problem 980 uses `answer(True) ↔ ...` since it frames the question as "Is it true that...?" Problem 981 directly states the theorem without `answer(True)`. Since the problem is proved (by Elliott), directly stating it as a `theorem` is arguably more appropriate. Both conventions appear in the codebase, and either is acceptable. + +3. **Asymptotic formulation consistency**: Problem 980 uses the explicit ε-δ definition of asymptotic equivalence, while Problem 981 uses `Tendsto`. These are mathematically equivalent but stylistically different. For two problems from the same family (both [Er65b], both proved by Elliott), consistency would be preferable. + +### Overall assessment: +The formalization is **mathematically correct and complete** for the primary version of the problem as stated on the website. No experienced mathematician would identify flaws in the mathematical content. The only actionable items are: +- Adding the `[Er65b]` citation for the original problem source. +- Optionally adding the Tang–Zhang variant as a separate theorem. +- Optionally harmonizing the asymptotic formulation style with Problem 980. diff --git a/ai-review/983.md b/ai-review/983.md new file mode 100644 index 0000000000..4d8ea697ff --- /dev/null +++ b/ai-review/983.md @@ -0,0 +1,108 @@ +# AI Review: Erdős Problem 983 + +## 1. Code Reuse + +**`primeCounting` — should use Mathlib's `Nat.primeCounting`.** +The file defines its own `primeCounting` function at line 36–37: +```lean +def primeCounting (n : ℕ) : ℕ := + ((Finset.range (n + 1)).filter Nat.Prime).card +``` +Mathlib already provides `Nat.primeCounting : ℕ → ℕ` which counts the number of primes ≤ n. Multiple other Erdős problems in this codebase (49, 425, 793, 968, 1138) use `Nat.primeCounting` directly. The custom definition should be replaced with `Nat.primeCounting`. + +**`IsSmoothWrt` — no direct Mathlib equivalent, but overlaps with other codebase definitions.** +The definition captures "all prime factors of `a` belong to the set `P`." This is a reasonable custom definition. However: +- Erdős 929 defines `IsSmooth x m` as `∀ p ∈ m.primeFactors, p ≤ x`, which is the classical notion of smooth numbers (all primes ≤ a bound). +- Problem 983's notion is more general (smooth w.r.t. an *arbitrary* finite set of primes, not just primes ≤ some bound), so 929's definition cannot be reused directly. The custom definition is justified. +- One could alternatively express `IsSmoothWrt a P` as `a.primeFactors ⊆ P` (using `Nat.primeFactors`), which would be more idiomatic and concise. The current formulation `∀ p, Nat.Prime p → p ∣ a → p ∈ P` is logically equivalent for `a ≥ 1` but handles `a = 0` differently (vacuously true for the current definition since nothing divides 0... actually everything divides 0, so the current definition would require all primes to be in P for a = 0, which is problematic). See Correctness section. + +**Finset utilities from `FormalConjecturesForMathlib`.** +`FormalConjecturesForMathlib/Data/Finset/Card.lean` and `FormalConjecturesForMathlib/Data/Finset/Powerset.lean` contain cardinality lemmas that could be useful for proof development but are not needed for the statement. + +## 2. Citations + +**Website states:** +- Reference: **[Er70b, p. 138]** — Erdős, P. and Straus, E.G. + +**Formalization states:** +- `[Er70b] Erdős, P. and Straus, E.G.` + +**Issue:** The formalization omits the page number "p. 138" from the citation. It should read `[Er70b, p. 138]`. Additionally, the website does not provide a full title for this reference; the formalization should match the website's level of detail. + +The website also mentions known results by Erdős and Straus establishing asymptotic estimates for `f(π(n)+1, n)` and `f(cn, n)`. These are contextual results, not separate citations, so their omission from the docstring is acceptable but could be noted as background context for readers. + +## 3. Variants + +**The website mentions two distinct questions:** + +1. **Main question (formalized):** Is it true that `2π(n^{1/2}) − f(π(n)+1, n) → ∞` as `n → ∞`? +2. **General question (NOT formalized):** Estimate `f(k,n)`, particularly when `π(n)+1 < k = o(n)`. + +The general question is inherently vague ("estimate") and not suitable for direct formalization as a theorem statement. Its omission is reasonable. + +However, the website also provides known asymptotic results that could potentially be formalized as separate theorems: +- `f(π(n)+1, n) = 2π(n^{1/2}) + o_A(n^{1/2}/(log n)^A)` for any `A > 0` +- For constant `0 < c < 1`: `f(cn, n) = log log n + (c₁ + o(1))√(2 log log n)` where `c` is determined by the normal distribution CDF at `c₁`. + +These are *known results* rather than open conjectures, so their omission as conjectures is appropriate, though they could be interesting formalization targets as theorems. + +**Verdict:** All formalizable variants are captured. + +## 4. Readability + +The code is generally well-structured and readable. Suggestions: + +- **Replace custom `primeCounting` with `Nat.primeCounting`** — this eliminates a redundant definition and makes the code consistent with the rest of the codebase. +- **The `smoothCoveringNumber` definition (lines 47–50)** is dense but accurately mirrors the mathematical definition. The nested quantifiers (`∀ A`, `∃ P`, `∃ B`) are correctly ordered. One could consider adding a brief inline comment clarifying the "more than r elements" condition (`B.card > r`), but the existing docstring is adequate. +- **`IsSmoothWrt`** could be renamed to something like `IsSmoothOverPrimes` or simply expressed inline using `a.primeFactors ⊆ P` (after appropriate filtering for primality of `P` elements), which would be more self-documenting. + +## 5. Formalizability + +**The problem statement on the website is precise and unambiguous.** It clearly defines: +- The domain: `A ⊆ {1, …, n}` with `|A| = k` +- The quantity: smallest `r` such that for *any* such `A`, there exist `r` primes covering > `r` elements +- The conjecture: an asymptotic divergence statement + +The definition of `f(k,n)` involves a minimum over a well-defined set of natural numbers, and the conjecture is a standard asymptotic statement. There is no meaningful ambiguity. + +**Assessment: Fully formalizable. Ambiguity: None.** + +## 6. Correctness + +### 6.1 Overall structure — CORRECT +The formalization correctly captures the three-layer structure: +1. Define π(n) (prime counting) +2. Define f(k,n) (smooth covering number) as an infimum +3. State the conjecture as a divergence-to-infinity statement + +### 6.2 `smoothCoveringNumber` — MOSTLY CORRECT, with subtleties + +The definition uses `sInf` on the set of valid `r` values. This is mathematically appropriate: `sInf ∅ = 0` in `ℕ`, but the set should be nonempty for the relevant parameter range (since `r = π(n)` trivially works when `k > π(n)`), so the infimum is well-defined for the intended domain `π(n) < k ≤ n`. + +**Potential issue with `a = 1`:** The constraint `1 ≤ a ∧ a ≤ n` allows `a = 1` in the set `A`. The number 1 has no prime factors, so `IsSmoothWrt 1 P` is vacuously true for any `P` (since there is no prime `p` with `p ∣ 1`). This means 1 is always "smooth" w.r.t. any set of primes, which is mathematically correct — 1 is considered smooth with respect to any set of primes (it is 1-smooth, or equivalently, its prime factorization is empty). + +**Potential issue with `a = 0`:** The constraint `1 ≤ a` excludes 0, which is correct. + +**The `B.card > r` condition** correctly captures "more than r elements," matching the website's language. + +### 6.3 The main conjecture statement — CORRECT with a minor note + +The conjecture `2π(√n) − f(π(n)+1, n) → ∞` is reformulated as: +```lean +∀ M : ℕ, ∃ N₀ : ℕ, ∀ n : ℕ, n ≥ N₀ → + smoothCoveringNumber (primeCounting n + 1) n + M ≤ 2 * primeCounting (Nat.sqrt n) +``` + +This is the correct ε-δ style reformulation of `g(n) → ∞`: for every M, eventually `g(n) ≥ M`, rewritten as `f(π(n)+1,n) + M ≤ 2π(⌊√n⌋)`. The algebraic rearrangement from `2π(√n) − f ≥ M` to `f + M ≤ 2π(√n)` is correct and avoids subtraction on naturals (which is important for ℕ arithmetic). + +**Note on `Nat.sqrt`:** The formalization uses `Nat.sqrt n` (integer square root, i.e., ⌊√n⌋). The website uses `π(n^{1/2})`. Since π is a step function that only changes at prime values, `π(⌊√n⌋) = π(√n)` for all natural n (the largest prime ≤ √n equals the largest prime ≤ ⌊√n⌋). So this is correct. + +**`M : ℕ` vs `M : ℤ` or `M : ℝ`:** Using `M : ℕ` is sufficient for divergence to +∞, since if the statement holds for all natural M, it holds for all real M. This is correct. + +### 6.4 The `answer(sorry)` wrapper — CORRECT +The problem is tagged as `open`, and the `answer(sorry)` wrapper correctly reflects that the truth value of the conjecture is unknown. The biconditional structure `answer(sorry) ↔ [statement]` is the standard pattern in this codebase. + +### Summary of correctness issues: +- **No mathematical errors detected.** The formalization is correct and complete. +- **Minor:** Custom `primeCounting` should use Mathlib's `Nat.primeCounting` for consistency (not a correctness issue, but a code quality issue). +- **Minor:** Citation should include page number `p. 138`. diff --git a/ai-review/984.md b/ai-review/984.md new file mode 100644 index 0000000000..0656180384 --- /dev/null +++ b/ai-review/984.md @@ -0,0 +1,95 @@ +# Review: Erdős Problem 984 + +## 1. Code Reuse + +The file defines a local `IsMonochromaticAP` predicate within the `Erdos984` namespace. The codebase already provides related machinery in `FormalConjecturesForMathlib/Combinatorics/AP/Basic.lean`: + +- `Set.IsAPOfLengthWith` — defines APs with specified first term and common difference +- `ContainsMonoAPofLength` — monochromatic APs under a coloring + +However, reusing these directly is **not straightforward** for this problem: +- `ContainsMonoAPofLength` takes a coloring on a subset `M` (not all of `ℕ`), and existentially quantifies over the AP without exposing the first term `a` and difference `d`. Problem 984 requires explicit access to `a` since the bound `k ≤ C · a^ε` depends on it. +- Expressing the same statement via `Set.IsAPOfLengthWith` would require unpacking into essentially the same conditions already in `IsMonochromaticAP`. + +**Verdict:** The local definition is justified. The existing library predicates are not designed to expose the AP parameters needed for the quantitative bound. A shared utility could be created if many problems need parameter-explicit monochromatic AP predicates, but for a single problem this is appropriate. + +## 2. Citations + +The formalization references: +- `[Er80] Erdős, P., _On some problems in combinatorial number theory_ (1980).` + +The [erdosproblems.com/984](https://www.erdosproblems.com/984) page lists: +- **[Er80]** as the source (matching the formalization) +- Spencer as the originator of the question (mentioned in the docstring ✓) +- Zach Hunter as having proved the result (mentioned in the docstring ✓) + +**Verdict:** Citations are consistent with the website. No missing references. + +## 3. Variants + +The website describes: +1. Spencer's 3-colour result with bound `h(a)` (inverse van der Waerden function) — mentioned in docstring ✓ +2. Erdős's claimed 2-colour result with bound `k ≪ a^{1-c}` — mentioned in docstring ✓ +3. The main question: 2-colour with bound `k ≪_ε a^ε` — formalized ✓ + +No additional variants appear on the website. + +**Verdict:** All variants and historical context are captured in the docstring. The formalization addresses the main question only, which is appropriate since the weaker results of Spencer and Erdős are superseded by Hunter's proof. + +## 4. Readability + +The code is clean and well-structured: +- The `IsMonochromaticAP` predicate is clearly documented with a docstring explaining its meaning. +- The main theorem statement reads naturally. +- The namespace `Erdos984` prevents name collisions. +- The docstring provides good mathematical context. + +**Minor suggestion:** The docstring for `IsMonochromaticAP` says "all its elements receive the same colour" but could clarify that the conditions `d ≥ 1` and `k ≥ 1` exclude degenerate cases (length-0 or constant APs). + +**Verdict:** Highly readable. No significant improvements needed. + +## 5. Formalizability + +The original problem uses the notation `k ≪_ε a^ε` for all `ε > 0`. This is standard Vinogradov notation meaning: for each fixed `ε > 0`, there exists a constant `C_ε > 0` such that `k ≤ C_ε · a^ε`. + +The formalization translates this as: +``` +∀ ε : ℝ, ε > 0 → ∃ C : ℝ, C > 0 ∧ ∀ a d k : ℕ, a ≥ 1 → IsMonochromaticAP c a d k → (k : ℝ) ≤ C * (a : ℝ) ^ ε +``` + +This is a faithful and unambiguous rendering. The quantifier structure correctly places `C` after `ε` (so `C` may depend on `ε`), and the bound applies to all APs uniformly for each fixed `ε`. + +**Verdict:** The problem is precise enough to be unambiguously formalizable. The asymptotic notation has a single standard interpretation, and the formalization captures it correctly. + +## 6. Correctness + +### Positive aspects: +- **`answer(True)`** is correct: the problem asks "Can ℕ be 2-coloured such that...?" and Zach Hunter proved the answer is yes. +- **`Fin 2` for colours** correctly models a 2-colouring. +- **`a ≥ 1` guard** is necessary and correct: when `a = 0`, we have `a^ε = 0` for `ε > 0`, making `k ≤ C · 0 = 0` impossible for any monochromatic AP (which requires `k ≥ 1`). The condition `a ≥ 1` avoids this vacuous impossibility. +- **`d ≥ 1` in `IsMonochromaticAP`** correctly excludes trivial constant APs (where `d = 0`, so all terms equal `a`, which could be arbitrarily long monochromatically and would trivially violate any bound). +- **`k ≥ 1`** excludes empty APs. +- **Quantifier order** `∃ c, ∀ ε, ∃ C, ∀ a d k` is correct: one colouring must work for all `ε`, but the constant `C` may depend on `ε`. + +### Potential concerns examined: + +1. **Does the bound need to hold only for sufficiently large `a`?** No — since `a ≥ 1` implies `a^ε ≥ 1`, and there are only finitely many APs with bounded `a`, the constant `C` can always be chosen large enough to cover small cases. The "for all `a ≥ 1`" formulation is equivalent to "for all sufficiently large `a`" in this context. + +2. **Is the AP representation correct?** The elements `{a + i * d : i < k}` for natural numbers `a, d, k` correctly enumerate the k-term AP `{a, a+d, ..., a+(k-1)d}`. Since `a, d, k : ℕ`, only non-negative starting points and positive differences are considered, which is appropriate for colouring `ℕ`. + +3. **Does using `ℕ → Fin 2` vs colouring `ℕ+` matter?** The problem says "colour ℕ". The formalization colours all of `ℕ` (including 0) but the bound only applies when `a ≥ 1`. This is fine — the colouring of 0 is irrelevant to the conclusion, and allowing 0 in the domain is more natural in Lean. + +**Verdict:** The formalization is mathematically correct and complete. No flaws identified. The encoding of asymptotic notation, the treatment of edge cases, and the quantifier structure are all sound. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code Reuse | Local definition justified; existing library predicates don't expose needed AP parameters | +| Citations | Consistent with erdosproblems.com | +| Variants | All variants captured in docstring | +| Readability | Clean and well-documented | +| Formalizability | Unambiguous; standard notation faithfully rendered | +| Correctness | Correct and complete; no mathematical issues found | + +**Overall:** High-quality formalization with no issues requiring changes. diff --git a/ai-review/986.md b/ai-review/986.md new file mode 100644 index 0000000000..0e30fbe81c --- /dev/null +++ b/ai-review/986.md @@ -0,0 +1,113 @@ +# AI Review: Erdős Problem 986 + +## 1. Code Reuse + +The `ramseyR` definition at line 60–61 of `986.lean`: +```lean +noncomputable def ramseyR (k n : ℕ) : ℕ := + sInf {N : ℕ | ∀ (G : SimpleGraph (Fin N)), ¬G.CliqueFree k ∨ ¬Gᶜ.CliqueFree n} +``` +is duplicated verbatim in at least three other files: +- `ErdosProblems/1030.lean` (lines 39–43) +- `ErdosProblems/1014.lean` (lines 34–38) +- Specialized variants in `ErdosProblems/165.lean` (`ramseyR3`), `ErdosProblems/166.lean` (`ramseyR4`), and `ErdosProblems/553.lean` (`ramseyR3`, `ramseyR33`) + +**Recommendation:** A shared `ramseyR` definition should be extracted into `FormalConjecturesForMathlib/Combinatorics/Ramsey.lean` (which already contains `hypergraphRamsey`) or a new dedicated file, and reused across all these problems. The specialized `ramseyR3`/`ramseyR4` could then be defined as abbreviations (e.g., `def ramseyR3 := ramseyR 3`). + +Additionally, `FormalConjecturesForMathlib/Combinatorics/SimpleGraph/Clique.lean` provides `indepNum` and related utilities that are available through `ProblemImports` but not used here. Since the Ramsey number relates clique number and independence number, these could be relevant for proof development. + +## 2. Citations + +The docstring cites: +- [Sp77] Spencer (1977) — matches website ✓ +- [MaVe23] Mattheus & Verstraëte (2023/2024) — matches website ✓ +- [BoKe10] Bohman & Keevash (2010) — matches website ✓ +- [AKS80] Ajtai, Komlós & Szemerédi (1980) — matches website ✓ +- [Er90b] Erdős (1992) — matches website ✓ + +**Missing from the formalization:** +- **Li, Rousseau, and Zang (2001)** — the website notes they refined the upper bound coefficient. This citation should be added for completeness. +- The website lists **related OEIS sequences** A000791 and A059442 — these could optionally be mentioned. +- The website cross-references **Problem #165** (k=3 case), **Problem #166** (k=4 case), and **Problem #920** (chromatic number connection). Adding these cross-references to the docstring would improve navigability. + +## 3. Variants + +The formalization captures only the main conjecture. The following known results and variants are mentioned in the docstring text but **not formalized**: + +1. **k=3 case (solved by Spencer, 1977):** This is Problem 165. A variant like `erdos_986.variants.k_eq_3` stating the k=3 special case would link the problems. + +2. **k=4 case (solved by Mattheus & Verstraëte, 2023):** This is Problem 166. Similarly, an `erdos_986.variants.k_eq_4` variant could be included. + +3. **Known general lower bound (Bohman & Keevash, 2010):** + $$n^{(k+1)/2} / (\log n)^{1/(k-2) - (k+1)/2} \ll_k R(k,n)$$ + This is a proved result and could be a variant. + +4. **Known general upper bound (Ajtai, Komlós & Szemerédi, 1980):** + $$R(k,n) \ll_k n^{k-1} / (\log n)^{k-2}$$ + This is also proved and could be a variant. + +5. **Connection to Problem 920:** Problem 920 (`920.lean`:80–87) explicitly notes that a positive answer to Problem 986 would imply the answer to Problem 920. This relationship is not documented in the 986 formalization. + +**Recommendation:** Add at least the solved k=3 and k=4 special cases as variants, and ideally the known general bounds. + +## 4. Readability + +The code is clean and readable. The docstring is well-structured with a clear problem statement, historical context, known bounds, and full citations. Minor suggestions: + +- The docstring explains the bound in both displayed-math and asymptotic notation, which is helpful. +- The Lean statement is clear: `k` is a parameter with `3 ≤ k`, and `C`, `c`, `N₀` are existentially quantified, allowing them to depend on `k`. +- The namespace `Erdos986` and theorem name `erdos_986` follow consistent project conventions. + +**No significant readability issues.** + +## 5. Formalizability + +The problem is **precisely formalizable**. The conjecture states: + +> For fixed k ≥ 3, R(k,n) ≫ n^{k-1}/(log n)^c for some c > 0. + +This is a standard asymptotic lower bound statement with no ambiguity: +- "≫" means "there exists C > 0 such that, for all sufficiently large n, R(k,n) ≥ C · f(n)." +- The constant c = c(k) is allowed to depend on k. +- The Ramsey number R(k,n) has a standard combinatorial definition. + +**Ambiguity assessment: Very low.** The only minor point is whether c should be a positive integer or a positive real. The formalization uses `c : ℕ` (with `0 < c`), which is discussed in the Correctness section below. The mathematical statement "for some c > 0" technically allows real c, but using ℕ is equivalent (see below). + +## 6. Correctness + +### 6.1. `ramseyR` definition +The definition correctly captures R(k,n) as the infimum of {N | every graph on N vertices has a k-clique or an n-independent-set}. Using `sInf` on ℕ with the convention `sInf ∅ = 0` is safe because for k ≥ 3 and sufficiently large N, the set is nonempty (by Ramsey's theorem). + +### 6.2. Type of the exponent `c` +The exponent `c` is typed as `ℕ` rather than `ℝ`. This is **mathematically equivalent** to using `ℝ`: +- **(ℕ ⟹ ℝ):** If the bound holds with `c : ℕ`, it holds with `c : ℝ` trivially since ℕ embeds into ℝ. +- **(ℝ ⟹ ℕ):** If R(k,n) ≥ C · n^{k-1}/(log n)^{c_real} for some real c_real > 0, then taking c_nat = ⌈c_real⌉ ∈ ℕ, we have (log n)^{c_nat} ≥ (log n)^{c_real} for n ≥ 3 (since log n > 1), so n^{k-1}/(log n)^{c_nat} ≤ n^{k-1}/(log n)^{c_real}, and the bound holds with a possibly smaller constant. + +This matches the convention in Problem 166, which also uses `α : ℕ` for the logarithmic exponent. + +### 6.3. Quantifier structure +``` +∀ k ≥ 3, ∃ C > 0, ∃ c > 0, ∃ N₀, ∀ n ≥ N₀, C · n^{k-1}/(log n)^c ≤ R(k,n) +``` +This correctly captures "for any fixed k ≥ 3, R(k,n) ≫ n^{k-1}/(log n)^c for some c = c(k)." The constants C, c, and N₀ are all allowed to depend on k. ✓ + +### 6.4. Edge cases +- For n = 0 or n = 1: `Real.log (n : ℝ)` equals `log 0 = 0` or `log 1 = 0`, making the denominator 0 (since c > 0). Lean's division by zero yields 0, so the LHS becomes `C * 0 = 0 ≤ R(k,n)`, which is trivially true. The "sufficiently large n" threshold `N₀` handles this gracefully. ✓ +- For `k - 1` with `k : ℕ`: Since `hk : 3 ≤ k`, we have `k - 1 ≥ 2`, so no underflow. ✓ +- The cast `(ramseyR k n : ℝ)` is well-defined since `ramseyR` returns `ℕ`. ✓ + +### 6.5. Assessment +**The formalization is correct and complete.** It faithfully captures the conjecture as stated on the Erdős Problems website. No mathematical flaws are identified. The choice of `c : ℕ` is a defensible and equivalent simplification. An experienced mathematician would find no issues with this statement. + +--- + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Improvement possible | `ramseyR` duplicated across 4+ files; should be centralized | +| Citations | ⚠️ Minor gap | Missing Li–Rousseau–Zang (2001); missing cross-references to Problems 165, 166, 920 | +| Variants | ⚠️ Incomplete | Solved k=3 and k=4 cases not formalized; known general bounds not captured | +| Readability | ✅ Good | Clean code, informative docstring | +| Formalizability | ✅ Unambiguous | Standard asymptotic lower bound, precisely formalizable | +| Correctness | ✅ Correct | Mathematically faithful; no flaws identified | diff --git a/ai-review/987.md b/ai-review/987.md new file mode 100644 index 0000000000..a0f7ea3cb6 --- /dev/null +++ b/ai-review/987.md @@ -0,0 +1,107 @@ +# AI Review: Erdős Problem 987 + +## 1. Code Reuse + +Three files in the codebase define similar exponential sum functions independently: + +- **987.lean**: `exponentialSum (x : ℕ → ℝ) (k : ℕ) (n : ℕ) : ℂ` — sums `e(k·xⱼ)` for `j < n` +- **512.lean**: `expSum512 (A : Finset ℤ) (θ : ℝ) : ℂ` — sums `e(n·θ)` for `n ∈ A` +- **225.lean**: `trigPoly (n : ℕ) (c : ℕ → ℂ) (θ : ℝ) : ℂ` — weighted trigonometric polynomial + +These have sufficiently different signatures and use cases that a shared abstraction would likely be forced and unhelpful. No action recommended here. + +For the limsup encoding, the codebase uses inline quantifier patterns (`∀ K₀, ∃ k ≥ K₀, ...`) rather than `Filter.limsup`. This is consistent with conventions in Problems 33, 378, and 513, and is appropriate for the `sorry`-based formalization style. + +**No code reuse issues.** + +## 2. Citations + +The website (erdosproblems.com/987) contains additional results not reflected in the docstring: + +| Reference | In docstring? | Notes | +|-----------|--------------|-------| +| Erdős [Er64b] (1964) | Yes | No title/journal given | +| Erdős [Er65b] (1965) | Yes | No title/journal given | +| Halberstam & Roth [Ha74], *Sequences* (1974) | Yes | Problem 7.21 — OK | +| Clunie [Cl67] (1967) | Yes | No title/journal given | +| **Tao** | **No** | Independently verified A_k ≫ k^{1/2} infinitely often | +| **Liu (1969)** | **No** | Under finite-point assumption, showed A_k ≫ k^{1−ε} infinitely often; Clunie observed this implies A_k = ∞ infinitely often | +| **Erdős's log k bound** | **No** | Erdős found a "very easy" proof that A_k ≫ log k infinitely often | + +**Recommendation:** Add mentions of Tao's result, Liu's 1969 result, and Erdős's intermediate A_k ≫ log k bound to the docstring remarks. + +## 3. Variants + +The formalization captures two parts: +- **Part 1** (`erdos_987`): Is sup_k A_k = ∞? (limsup_k A_k = ∞) +- **Part 2** (`erdos_987.variants.not_little_o`): Is A_k = o(k) impossible? + +These correspond to the two questions on the website. Part 2 is strictly stronger than Part 1 (if A_k ≥ ck for infinitely many k, then limsup A_k = ∞). + +Additional results that could be captured as variants: +- **Clunie's lower bound**: A_k ≫ k^{1/2} infinitely often (proved). +- **Clunie's upper bound**: There exist sequences with A_k ≤ k for all k (proved). +- **Liu's conditional result**: Under finite-point assumptions, A_k ≫ k^{1−ε} (proved). +- **Erdős's sup vs limsup remark**: The analogous statement with sup_n in place of limsup_n is "easy to see." + +These are known results (not open problems) and would serve as useful sanity checks. + +## 4. Readability + +The code is clear and well-structured. The `exponentialSum` helper is appropriately separated from the theorem statements. The inline expansion of limsup via quantifiers is standard for this codebase. + +Minor suggestions: +- The docstring for Part 1 says "limsup_{k → ∞} A_k = ∞" but the Lean statement actually encodes "sup_k A_k = ∞" (see §6). While these happen to be equivalent, the docstring could note this equivalence or match the encoding more precisely. +- The complex exponential `2 * ↑Real.pi * Complex.I * ↑((k : ℝ) * x j)` is correct but dense. A brief inline comment like `-- e(k·xⱼ) = e^{2πikxⱼ}` in the definition could help. + +## 5. Formalizability + +The problem is precisely stated and unambiguously formalizable. The definitions of A_k, the exponential function e(x) = e^{2πix}, and the sequence conditions are all standard. + +The only mild ambiguity is whether k ranges over positive integers or all natural numbers (see §6), and whether the sequence indexing starts at 1 or 0. Neither affects the mathematical content for the asymptotic statements. + +**Assessment: Fully formalizable, no ambiguity issues.** + +## 6. Correctness + +### Critical Issue: Part 1 is trivially true as stated + +**`erdos_987` (Part 1) is trivially provable and does not capture the intended mathematical content.** + +The statement is: +```lean +∀ (x : ℕ → ℝ), (∀ j, x j ∈ Set.Ioo 0 1) → + ∀ M : ℝ, ∃ k : ℕ, ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + M ≤ ‖exponentialSum x k n‖ +``` + +Taking `k = 0`: each summand becomes `exp(0) = 1`, so `exponentialSum x 0 n = n` and `‖exponentialSum x 0 n‖ = n`. For any `M`, choosing `n ≥ M` trivially satisfies the bound. The theorem is provable without any mathematical content. + +**Fix:** Require `k > 0`: +```lean +∀ M : ℝ, ∃ k : ℕ, 0 < k ∧ ∀ N : ℕ, ∃ n : ℕ, N ≤ n ∧ + M ≤ ‖exponentialSum x k n‖ +``` + +Alternatively, change `k : ℕ` to `k : ℕ+` or add `hk : 0 < k` as a condition. + +### Part 2 is correct + +The `not_little_o` variant uses `∀ K₀ : ℕ, ∃ k : ℕ, K₀ ≤ k ∧ ...`, requiring *infinitely many* k. Since k = 0 only satisfies the clause for K₀ = 0, and for K₀ ≥ 1 we need k ≥ 1, the k = 0 trivialization does not apply. Part 2 correctly captures "A_k ≠ o(k)." + +### Minor observations + +- **Equivalence of sup vs limsup for unboundedness**: The Part 1 encoding uses `∃ k` (sup_k A_k = ∞) rather than `∀ K₀, ∃ k ≥ K₀` (limsup_k A_k = ∞). For extended-real-valued sequences, sup = ∞ ⟺ limsup = ∞ (proof: if sup = ∞, then for any K, sup_{k≥K} = ∞, since only finitely many terms k < K cannot account for an infinite supremum). So the encoding is mathematically equivalent to the limsup formulation — *once the k = 0 bug is fixed*. +- **0-indexed vs 1-indexed**: The problem states "x₁, x₂, ..." (1-indexed) with sum over j ≤ n. The formalization uses ℕ-indexed x and `Finset.range n` (0-indexed, j < n). This is a harmless re-indexing that doesn't affect asymptotic statements. +- **Both parts are marked `category research open`**, consistent with the website status. + +## Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | No issues | +| Citations | Missing Tao, Liu (1969), and Erdős's log k bound | +| Variants | Core variants captured; known results (Clunie, Liu) could be added | +| Readability | Good | +| Formalizability | Fully formalizable, no ambiguity | +| **Correctness** | **Part 1 is trivially true (k=0 bug); Part 2 is correct** | diff --git a/ai-review/988.md b/ai-review/988.md new file mode 100644 index 0000000000..0ff998f683 --- /dev/null +++ b/ai-review/988.md @@ -0,0 +1,133 @@ +# AI Review: Erdős Problem 988 + +## 1. Code Reuse + +**Erdős Problem 991** (`FormalConjectures/ErdosProblems/991.lean`) formalizes a closely related problem about spherical cap discrepancy of Fekete points on S². Problems 988 and 991 share the identical spherical cap and discrepancy machinery: + +- The cap definition `C(v,t) = {x ∈ S² : ⟨x,v⟩ ≥ t}` encoded as `P.filter (fun x => @inner ℝ _ _ x v ≥ t)` +- The normalized measure `(1-t)/2` +- The discrepancy expression `|cap.card - (1-t)/2 * P.card|` + +**Recommendation:** Extract a shared definition for the spherical cap discrepancy, e.g.: + +```lean +noncomputable def sphericalCapDiscrepancy + (P : Finset (EuclideanSpace ℝ (Fin 3))) (v : EuclideanSpace ℝ (Fin 3)) (t : ℝ) : ℝ := + |((P.filter (fun x => @inner ℝ _ _ x v ≥ t)).card : ℝ) - (1 - t) / 2 * (P.card : ℝ)| +``` + +This would improve both files and could be placed in `FormalConjecturesForMathlib/Geometry/3d.lean` or a new spherical geometry utility file. + +The existing `FormalConjecturesForMathlib/Geometry/3d.lean` and `Euclidean.lean` files provide the `ℝ³` notation and EuclideanSpace infrastructure but are not currently used by this file (it uses `EuclideanSpace ℝ (Fin 3)` directly). + +## 2. Citations + +**Website content** (erdosproblems.com/988): +- Citation: **[Er64b]** — Erdős, P., *On some problems in number theory*, 1964. +- Related work: **Roth [Ro54]** (proved the analogous result for squares); **Schmidt [Sc69b]** — Schmidt, W. M., *Irregularities of distribution. IV.* Invent. Math. 7 (1969), 55–82. + +**Formalization citations:** +- ✅ [Er64b] is cited in both the module docstring and the theorem docstring. +- ✅ [Sc69b] is cited in the module docstring with full bibliographic details. +- ⚠️ **Missing:** The website mentions **Roth [Ro54]** as having proved the analogous result for squares. This context is absent from the formalization's docstring. While not strictly required, including it would better match the website's documentation. + +**Citation accuracy:** The [Er64b] reference in the formalization says *"On some problems in number theory"* which matches. The [Sc69b] reference matches the website. The full title on the website just says "Schmidt" without giving the full bibliographic entry inline, but the formalization provides it—this is fine. + +## 3. Variants + +The website states: *"This is true, and was proved (in any number of dimensions) by Schmidt."* + +**Current formalization:** Only covers S² ⊂ ℝ³ (using `Fin 3`). + +**Missing variants:** +- **General dimension:** Schmidt's proof works for S^d ⊂ ℝ^(d+1) for all d ≥ 1. A natural generalization would parameterize by dimension: + ```lean + theorem erdos_988_general (d : ℕ) (hd : d ≥ 2) : ... + ``` + The normalized cap measure for general dimension would require the regularized incomplete beta function or integration, making this significantly harder to state. The (1-t)/2 formula is specific to d=2 (the 2-sphere). + +- **Roth's square variant:** The website mentions Roth proved the analogous result for the square. This could be a separate variant, though it's a different problem. + +The choice to formalize only the S² case is reasonable since that is how the original problem is stated. However, a note in the docstring acknowledging the general-dimension result would be valuable. + +## 4. Readability + +The formalization is quite readable. Specific observations: + +- ✅ The module docstring clearly explains the problem with LaTeX notation. +- ✅ The theorem docstring explains the spherical cap notation and the normalized measure. +- ✅ Variable names are sensible (`P` for point set, `v` for cap direction, `t` for threshold, `M` for discrepancy bound). +- ⚠️ The inner product expression `@inner ℝ _ _ x v` uses explicit type ascription with underscores. This is correct but slightly noisy. This appears to be a standard pattern in the codebase (Problem 991 uses the same form), so it's consistent. +- ⚠️ The entire statement is a single long expression. Breaking the cap filter into a `let` binding could improve readability, but this is a minor stylistic point. + +## 5. Formalizability + +**Assessment: High — the statement is precise and unambiguous.** + +The original problem is stated in terms of discrepancy D(P) = max_C |#(C∩P) - α_C·|P|| and asks whether min_{|P|=n} D(P) → ∞. This is mathematically precise: + +- "Spherical cap" has a standard geometric definition. +- The normalized measure α_C of a cap on S² has a closed-form expression (1-t)/2. +- The min-over-n-point-sets and max-over-caps are well-defined finite/compact optimization problems. +- The limit → ∞ is a standard analytic notion. + +The only potential ambiguity is what "appropriately normalised measure" means, but for S² this is unambiguous (the unique rotationally-invariant probability measure, which gives (1-t)/2 for caps). The formalization correctly resolves this. + +## 6. Correctness + +**Assessment: Correct with minor observations.** + +### Quantifier structure +The formalization encodes "min_{|P|=n} D(P) → ∞" as: +``` +∀ M > 0, ∃ N₀, ∀ P with ‖p‖=1 for p ∈ P, |P| ≥ N₀ → ∃ cap with discrepancy ≥ M +``` + +This is mathematically equivalent to the original statement: +- "∃ cap with discrepancy ≥ M" captures "D(P) ≥ M" (since D(P) is the max over caps). +- "∀ P with |P| ≥ N₀" implies "min_{|P|=n} D(P) ≥ M for all n ≥ N₀". +- The ∀M∃N₀ quantification captures → ∞. + +Using `P.card ≥ N₀` rather than `P.card = n` is actually slightly stronger (it says the bound holds for all large enough sets, not just for each specific cardinality), but this is the correct way to express the limit since we need uniformity. + +✅ **Correct.** + +### Normalized measure +The cap C(v,t) = {x ∈ S² : ⟨x,v⟩ ≥ t} has normalized surface area: +$$\alpha_C = \frac{\text{Area of cap}}{4\pi} = \frac{2\pi(1-t)}{4\pi} = \frac{1-t}{2}$$ + +✅ **Correct** for S² ⊂ ℝ³. + +### Constraint on t +The formalization requires `-1 ≤ t ∧ t ≤ 1`. This is correct: for t < -1 the cap is the entire sphere, and for t > 1 the cap is empty. Both boundary cases give zero discrepancy, so including them is harmless. + +✅ **Correct.** + +### The `answer(True)` tag +The problem is stated as "Is it true that...?" and was proved true by Schmidt. The `answer(True)` tag is correct. + +✅ **Correct.** + +### Multiset / duplicate point concern +The formalization uses `Finset`, which means all points in P are distinct. The original problem says "subset", so this is consistent. However, one could argue that allowing multisets (repeated points) would be a more general formulation. With distinct points only, the result is still correct (and is what the problem asks for). + +✅ **Acceptable.** + +### Potential issue: Decidability of the filter predicate +The filter `P.filter (fun x => @inner ℝ _ _ x v ≥ t)` requires decidability of `@inner ℝ _ _ x v ≥ t`. The `open Classical` at the top of the file handles this via classical decidability. This is standard practice. + +✅ **Correct.** + +### Overall mathematical correctness +The formalization faithfully captures the mathematical content of Erdős Problem 988. No flaws were identified. The statement is complete and correct for the S² case as stated on the website. + +## Summary + +| Criterion | Rating | Notes | +|-----------|--------|-------| +| Code reuse | ⚠️ Opportunity | Shared spherical cap discrepancy definition with Problem 991 | +| Citations | ⚠️ Minor gap | Roth [Ro54] not mentioned | +| Variants | ⚠️ Minor gap | General-dimension result not noted | +| Readability | ✅ Good | Clear, well-documented | +| Formalizability | ✅ High | Unambiguous mathematical statement | +| Correctness | ✅ Correct | Faithful formalization of the S² case | diff --git a/ai-review/989.md b/ai-review/989.md new file mode 100644 index 0000000000..d7ce436e42 --- /dev/null +++ b/ai-review/989.md @@ -0,0 +1,113 @@ +# AI Review: Erdős Problem 989 + +## 1. Code Reuse + +**`euclidDist` is duplicated across at least three files.** The identical definition + +```lean +noncomputable def euclidDist (p q : ℝ × ℝ) : ℝ := + Real.sqrt ((p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2) +``` + +appears in `ErdosProblems/989.lean` (as `Erdos989.euclidDist`), `ErdosProblems/953.lean` (as `Erdos953.euclidDist`), and `ErdosProblems/529.lean` (a `ℤ^k` variant). This should be factored into a shared utility, e.g., in `FormalConjecturesForMathlib/`. Alternatively, the formalization could use Mathlib's metric on `EuclideanSpace ℝ (Fin 2)` (i.e., `PiLp 2 (fun _ : Fin 2 => ℝ)`) which provides the standard Euclidean `dist`. This would be more idiomatic and give access to the full Mathlib metric-space API. + +No existing utilities in `FormalConjecturesForMathlib/` address geometric discrepancy, so the helper definitions (`IsLocallyFinite`, `countInDisk`, `discrepancy`) are necessarily new. No reuse opportunities there. + +## 2. Citations + +**Website ([erdosproblems.com/989](https://www.erdosproblems.com/989)):** +- Original problem citation: **[Er64b]** (not explicitly expanded on the website). +- Status: **Solved** by Beck. +- Resolution description: Beck proved f(r) ≫ r^{1/2} for all A, and that there exists A with f(r) ≪ (r log r)^{1/2}. + +**Formalization docstring:** +- Cites [Be87] Beck, J., *Irregularities of distribution. I*, Acta Math. 159 (1987), 1–49. + +**Issue:** The original problem reference **[Er64b]** is not mentioned in the formalization's docstring. The resolution citation [Be87] is accurate and properly formatted. Recommend adding the original problem citation for completeness, e.g.: + +> [Er64b] Erdős, P., *Some problems on number theory*, 1964. + +(The exact expansion should be verified against the Erdős bibliography, as the website does not expand [Er64b].) + +## 3. Variants + +The formalization captures **both** results from Beck's resolution: + +1. **Lower bound** (`erdos_989`): ∀ locally finite A, ∃ C > 0, R₀ such that f(r) ≥ C√r for r ≥ R₀. +2. **Upper bound** (`erdos_989.variants.upper_bound`): ∃ locally finite A, ∃ C > 0, R₀ such that f(r) ≤ C√(r log r) for r ≥ R₀. + +The original question ("Is f(r) unbounded for every A?") is an immediate corollary of the lower bound and is not stated separately, which is appropriate. + +**No missing variants.** The formalization is complete with respect to the website description. + +## 4. Readability + +The code is well-structured and readable: +- Clear separation of helper definitions (`euclidDist`, `IsLocallyFinite`, `countInDisk`, `discrepancy`) with docstrings. +- The namespace `Erdos989` avoids name collisions. +- Docstrings include LaTeX and connect to the mathematical notation. + +**Minor suggestions:** +- The docstring for `discrepancy` writes `\sup_c` but the definition takes the sup over all `c : ℝ × ℝ`. Could note that `c` is the center of the disk. +- The phrase "closed disks $C$ of radius $r$" in the module docstring is slightly inconsistent with the original problem's "circles $C$ of radius $r$" — a brief clarifying note that "circle" means "disk" in this context would aid readers unfamiliar with the convention. + +## 5. Formalizability + +**The problem is precise and clearly formalizable.** The mathematical objects (sequences in ℝ², disks, counting function, supremum) are all standard. + +**Minor ambiguity in the original statement:** The website uses "circles" which in discrepancy theory standardly means "closed disks" (the filled region, not just the boundary). The formalization correctly resolves this with `euclidDist (A i) c ≤ r`. + +**The supremum vs maximum distinction:** The website says "max" while the formalization uses `⨆` (supremum). Since the optimization is over an uncountable set (all centers c ∈ ℝ²), the supremum is the mathematically correct notion. The maximum may or may not be attained, so `⨆` is appropriate. + +**Overall formalizability: High.** No significant ambiguity. + +## 6. Correctness + +### 6a. The `⨆` on `ℝ` issue (significant) + +The `discrepancy` function is defined as: + +```lean +noncomputable def discrepancy (A : ℕ → ℝ × ℝ) (r : ℝ) : ℝ := + ⨆ (c : ℝ × ℝ), |↑(countInDisk A c r) - Real.pi * r ^ 2| +``` + +This uses `iSup` on `ℝ`, which is `sSup (range f)`. Since `ℝ` is only a `ConditionallyCompleteLattice` (not a `CompleteLattice`), the `sSup` of a set that is unbounded above is **not meaningfully defined** — theorems like `le_ciSup` require `BddAbove (range f)`. + +**This is a potential soundness issue for the lower bound theorem.** To prove `discrepancy A r ≥ C * sqrt r`, one would typically exhibit a specific center `c₀` with `|countInDisk A c₀ r - πr²| ≥ C√r` and then appeal to `le_ciSup`. But `le_ciSup` requires `BddAbove`, meaning one must first establish that the supremum over all centers is bounded — a non-trivial additional obligation. + +**Can the supremum be infinite?** Yes. Consider a locally finite sequence where the "local density" grows without bound (e.g., n points clustered near position (n, 0) for each n). For fixed r, `countInDisk A c r` is always finite (by local finiteness), but `sup_c countInDisk A c r` can be unbounded. In such cases, `⨆` on `ℝ` returns a junk value, and the inequality `discrepancy A r ≥ C * sqrt r` could be false in Lean even though it's mathematically true. + +**Recommendations:** +- Define `discrepancy` using `EReal` or `ℝ≥0∞` (where `⨆` is well-defined for unbounded sets), or +- Add an explicit `BddAbove` hypothesis, or +- Reformulate the lower bound existentially: ∃ c, |countInDisk A c r - πr²| ≥ C√r (avoiding `iSup` entirely). This is mathematically equivalent and avoids the lattice-theoretic complication. + +The existential reformulation would be the cleanest fix for the lower bound. The upper bound theorem would still need care, as it asserts `discrepancy A r ≤ ...`, which with `iSup` on `ℝ` requires showing the sup is attained or bounded. + +### 6b. `countInDisk` and `Set.ncard` for infinite sets + +`countInDisk` uses `Set.ncard`, which returns 0 for infinite sets. This is safe because `IsLocallyFinite` is assumed in both theorems, ensuring the relevant sets are always finite. However, `discrepancy` itself does not carry this hypothesis, so `discrepancy A r` for a non-locally-finite `A` would silently use `ncard = 0` for some centers. This is not a bug per se (the theorems have the right hypotheses), but it makes `discrepancy` less useful as a standalone definition. + +### 6c. Negative radius + +The definitions do not restrict `r` to be non-negative. For `r < 0`, `euclidDist p c ≤ r` is vacuously false (since `euclidDist` returns a non-negative value via `Real.sqrt`), so `countInDisk A c r = 0` and `discrepancy A r = πr²`. This is harmless for the theorems (they concern `r ≥ R₀` for some `R₀`), but could be noted. + +### 6d. Mathematical correctness of the statements + +Setting aside the `⨆`-on-`ℝ` issue, the mathematical content is **correct**: +- The lower bound faithfully captures Beck's result: f(r) ≥ C√r for all locally finite A. +- The upper bound faithfully captures Beck's construction: ∃ A with f(r) ≤ C√(r log r). +- The quantifier structure (∃ C > 0, ∃ R₀, ∀ r ≥ R₀) correctly expresses asymptotic bounds. +- The `IsLocallyFinite` condition is the right regularity assumption (ensures countInDisk is well-defined and rules out degenerate sequences). + +### Summary + +| Criterion | Assessment | +|-----------|-----------| +| Code reuse | `euclidDist` duplicated in ≥3 files; should be shared | +| Citations | Missing original reference [Er64b]; [Be87] is correct | +| Variants | Complete — both lower and upper bounds captured | +| Readability | Good; minor docstring improvements possible | +| Formalizability | High; minimal ambiguity | +| Correctness | **Mathematically correct in intent, but the use of `⨆` on `ℝ` for a potentially unbounded supremum is a significant formalization concern** that could make the lower bound theorem unprovable as stated in Lean. Recommend reformulating with an existential or using `EReal`. | diff --git a/ai-review/990.md b/ai-review/990.md new file mode 100644 index 0000000000..4e2e84ee72 --- /dev/null +++ b/ai-review/990.md @@ -0,0 +1,64 @@ +# AI Review: Erdős Problem 990 + +## 1. Code Reuse + +No directly reusable code was found in `FormalConjecturesForMathlib/` or elsewhere in the codebase. The three definitions (`Complex.arg2pi`, `rootArgCount`, `erdosTuranMeasure`) are novel and specific to this problem. Other problems involving polynomial roots (e.g., 521, 522, 1116, 1120) use different root-counting mechanisms (`Set.ncard`, custom `rootCount` over disks) that are not applicable here. The definitions are self-contained and appropriately placed. + +## 2. Citations + +The formalization cites: +- **[ErTu50]** Erdős, P. and Turán, P., *On the distribution of roots of polynomials*, Annals of Mathematics (1950). +- **[Er64b]** Erdős, P., *On some problems relating to the distribution of roots of polynomials* (1964). + +The website (erdosproblems.com/990) lists the same two references: [ErTu50] and [Er64b]. The citations match. + +## 3. Variants + +The website presents a single formulation: can the Erdős–Turán bound be improved by replacing the degree $d$ with the number of non-zero coefficients $n$? No additional variants are mentioned on the website. The formalization captures this single variant. **No missing variants.** + +## 4. Readability + +The code is well-structured and readable: +- Each helper definition has a clear docstring with LaTeX. +- The main theorem's docstring clearly states the problem, the conjectured bound, and the historical context. +- The namespace `Erdos990` prevents name collisions. +- The `open` declarations are appropriate and minimal. + +**Minor suggestion:** The `decide` call inside `rootArgCount` is somewhat unusual — using `fun θ => α ≤ θ ∧ θ ≤ β` directly as a `Prop`-valued function with a `Decidable` instance might be more idiomatic, but the current approach is functionally correct and not confusing. + +## 5. Formalizability + +The problem is precise enough to be obviously formalizable. The key quantities are all well-defined: +- The arguments $\theta_i \in [0, 2\pi)$ of the roots. +- The count of roots in an interval. +- The number of non-zero coefficients $n$. +- The Erdős–Turán measure $M$. + +The only mild ambiguity in the original statement is the use of $\ll$ (Vinogradov notation), which means "bounded by an absolute constant times." The formalization correctly makes this explicit with $\exists C > 0$. + +**Ambiguity level: Low.** The problem is stated quantitatively and translates directly. + +## 6. Correctness + +The formalization is mathematically correct and complete. Detailed analysis: + +**`Complex.arg2pi`**: Correctly shifts `Complex.arg` (which returns values in $(-\pi, \pi]$) to $[0, 2\pi)$ by adding $2\pi$ to negative values. Returns $0$ for $z = 0$ as documented. + +**`rootArgCount`**: Uses `f.roots` (the Mathlib multiset of roots with multiplicity; complete over $\mathbb{C}$ since it is algebraically closed) mapped through `arg2pi`, then counted with a predicate for $[\alpha, \beta]$. This correctly counts roots with multiplicity. + +**`erdosTuranMeasure`**: Computes $M = \frac{|a_0| + \cdots + |a_d|}{\sqrt{|a_0| \cdot |a_d|}}$ by summing norms of coefficients from index $0$ to `natDegree` and dividing by $\sqrt{|a_0| \cdot |a_d|}$. Correct. + +**Main theorem guard conditions**: +- `f.natDegree ≥ 1`: Ensures f is a non-constant polynomial. This also guarantees `f.leadingCoeff ≠ 0` (since a polynomial with `natDegree ≥ 1` is nonzero in Mathlib). +- `f.coeff 0 ≠ 0`: Necessary because $a_0$ appears in the denominator of $M$. Without this, $M$ would be undefined (division by zero). This matches the mathematical requirement. +- Together these ensure $M \geq 2$ (by AM-GM: $|a_0| + |a_d| \geq 2\sqrt{|a_0||a_d|}$), so $\log M > 0$ and the RHS is well-defined and positive. + +**Interval conditions** `0 ≤ α`, `α ≤ β`, `β ≤ 2 * Real.pi`: Correctly constrains $[\alpha, \beta] \subseteq [0, 2\pi]$. + +**`f.support.card`**: In Mathlib, `Polynomial.support` is the `Finset` of indices with non-zero coefficients, so `.card` gives exactly $n$, the number of non-zero terms. Correct. + +**`answer(sorry)`**: Appropriately wraps the statement since Problem 990 is open — the truth value of the bound is unknown. + +**One minor observation**: The `rootArgCount` uses a closed interval $[\alpha, \beta]$ while `arg2pi` maps to the half-open $[0, 2\pi)$. When $\beta = 2\pi$, no root can have $\theta = 2\pi$ since $\text{arg2pi}$ never attains that value. This is not a bug — it just means the bound at $\beta = 2\pi$ is vacuously equivalent to $\beta < 2\pi$ for the upper endpoint. The original problem uses $I \subseteq [0, 2\pi]$ without specifying open/closed, so this is a reasonable choice. + +**Verdict: Correct and complete.** No mathematical flaws identified. diff --git a/ai-review/991.md b/ai-review/991.md new file mode 100644 index 0000000000..75c588fd86 --- /dev/null +++ b/ai-review/991.md @@ -0,0 +1,70 @@ +# AI Review: Erdős Problem 991 + +## 1. Code Reuse + +**Problem 988** (`FormalConjectures/ErdosProblems/988.lean`) is closely related and shares nearly identical infrastructure: unit sphere constraints (`‖p‖ = 1`), spherical cap filtering via `@inner ℝ _ _ x v ≥ t`, and the same normalized area formula `(1 - t) / 2`. However, Problem 988 does not need `pairwiseDistProd` or `IsMaxPairwiseDist`, so these definitions are correctly local to 991. + +The `ℝ³` notation defined in `FormalConjecturesForMathlib/Geometry/3d.lean` could replace the verbose `EuclideanSpace ℝ (Fin 3)` throughout, improving readability. + +No shared utility for "spherical cap discrepancy" exists. Given that Problems 988, 989, 990, and 991 all work with spherical cap discrepancy in `ℝ³`, a shared definition for the cap and/or its normalized measure could reduce duplication, though this is a minor concern. + +## 2. Citations + +The formalization's module docstring cites: +- **[Br08]** Brauchart, J. S. — $O(n^{3/4})$ bound. ✅ Matches website. +- **[MaMa21]** Marzo, J. and Mas, A. — $O(n^{2/3})$ bound. ✅ Matches website. + +**Missing from formalization:** The website also credits **Wolff** for an unpublished manuscript proving the $O(n^{2/3})$ bound independently of Marzo–Mas. This is not mentioned in the docstring. + +The website identifies Problem **988** as related. This relationship is not documented in the 991 formalization (nor vice versa). A brief `-- See also: Erdős Problem 988` comment would be helpful. + +The theorem docstring attributes the problem to `[Er64b]`, which is consistent with the website's attribution to Erdős (1964). + +## 3. Variants + +The formalization captures only the **qualitative** $o(n)$ statement. The known quantitative improvements are: +- $O(n^{3/4})$ (Brauchart, 2008) +- $O(n^{2/3})$ (Wolff, unpublished; Marzo–Mas, 2021) + +These quantitative bounds are not formalized as separate theorems or variants. This is reasonable — the problem as posed by Erdős asks only about $o(n)$, and the quantitative improvements are results *about* the problem rather than variants of it. No variants are missing. + +## 4. Readability + +The code is generally clear and well-structured. Suggestions: + +- **Use `ℝ³` notation**: Replace `EuclideanSpace ℝ (Fin 3)` with `ℝ³` (available from `FormalConjecturesForMathlib/Geometry/3d.lean`) to reduce visual noise. This would require an additional import. +- **`pairwiseDistProd` docstring precision**: The docstring says "product of pairwise distances" but the implementation uses `offDiag`, which includes both ordered pairs $(i,j)$ and $(j,i)$. So it computes $\prod_{i \neq j} \|w_i - w_j\|$ rather than $\prod_{i < j} \|w_i - w_j\|$. This is mathematically equivalent for the purpose of maximization (the `offDiag` version is the square of the `i < j` version), but the docstring should clarify this or note the equivalence. + +## 5. Formalizability + +**Assessment: Fully formalizable, low ambiguity.** + +The original problem statement is precise: +- "Fekete points" (maximizers of $\prod_{i 0$, there exists $N_0$ such that for all Fekete sets $P$ with $|P| \geq N_0$, *for all caps* $C(v,t)$, the absolute discrepancy is $\leq \varepsilon \cdot |P|$. This is exactly the $\varepsilon$-$N_0$ definition of $\max_C |\cdot| = o(n)$. ✅ + +- **Range of $t$**: Constrained to $[-1, 1]$, which is the correct range for the inner product of unit vectors. The degenerate caps ($t = -1$ gives the full sphere, $t = 1$ gives the empty cap) are handled correctly: at $t = -1$, normalized area is $1$ and $P \cap C = P$, giving discrepancy $0$; at $t = 1$, normalized area is $0$ and $P \cap C \subseteq \{v\}$, giving discrepancy $\leq 1 \leq \varepsilon \cdot n$ for large $n$. ✅ + +- **`answer(True)`**: The problem is marked as solved in the affirmative. Consistent with the website. ✅ + +- **AMS classification**: `AMS 31 52` — 31 (Potential theory) and 52 (Convex and discrete geometry). Reasonable for a problem about Fekete points and spherical cap discrepancy. ✅ + +**No mathematical flaws identified.** The formalization is a faithful and correct translation of the problem. diff --git a/ai-review/992.md b/ai-review/992.md new file mode 100644 index 0000000000..ed2d20eb07 --- /dev/null +++ b/ai-review/992.md @@ -0,0 +1,111 @@ +# AI Review: Erdős Problem 992 + +## 1. Code Reuse + +The `discrepancy` definition in 992.lean is bespoke. Several related files define overlapping concepts: + +- **`ErdosProblems/997.lean`**: Defines `IsWellDistributed`, which counts fractional parts in intervals using `Finset.Ioc` and `Int.fract` — structurally similar to `discrepancy`, but measures a different quantity (additive error relative to block length, not the supremum discrepancy over all intervals). +- **`ErdosProblems/994.lean`**: Defines `cesaroFrequency` for counting fractional parts in measurable sets — related but not directly reusable since it works with general sets rather than interval discrepancy. +- **`Books/UniformDistributionOfSequences/Equidistribution.lean`**: Defines `IsEquidistributed` and `IsEquidistributedModuloOne` using counts of sequence elements in `Icc` subintervals. The counting pattern (filter over `Finset.range`, membership in an interval, take card) is repeated across all these files. + +**Recommendation:** The core pattern — counting how many terms `{α · x(n)}` land in a subinterval of `[0,1]` — is repeated in at least four files. A shared utility for "fractional part counting in intervals" in `FormalConjecturesForMathlib` could reduce duplication, though the slight differences in interval types (`Icc` vs `Ico`), indexing, and normalization make a one-size-fits-all abstraction nontrivial. The current local definition is reasonable. + +## 2. Citations + +The formalization docstring references `[ErKo49]`, `[Ca50]`, `[Ba81]`, and `[BePh94]`. Comparing against [erdosproblems.com/992](https://www.erdosproblems.com/992): + +- **Missing source reference:** The website lists **[Er64b]** (Erdős, P., *Problems and results on diophantine approximations*. Compositio Math. (1964), 52–65) as the original source (p. 56). This is not mentioned in the formalization. +- **Missing result:** The website mentions that **Erdős and Gál** proved the stronger bound `D(N) ≪ N^{1/2} (log log N)^{O(1)}` for **lacunary sequences** (where `x_{i+1}/x_i > λ > 1`). This result is not documented in the formalization's docstring. +- The references `[ErKo49]`, `[Ca50]`, `[Ba81]`, `[BePh94]` are all present on the website and correctly attributed in the docstring. However, they are given only as shorthand tags — no full bibliographic details are included (e.g., journal, year, title). This is consistent with the rest of the codebase but could be improved. + +**Recommendation:** Add `[Er64b]` as the source reference. Mention the Erdős–Gál lacunary result in the module docstring for completeness. + +## 3. Variants + +The formalization captures three statements: + +| Variant | Captured? | +|---------|-----------| +| Main conjecture: `D(N) ≪ N^{1/2} (log N)^{o(1)}` for all sequences | ✅ `erdos_992` | +| Stronger variant: `D(N) ≪ N^{1/2} (log log N)^{O(1)}` for all sequences | ✅ `erdos_992.variants.stronger` | +| Berkes–Philipp disproof: existence of counterexample sequence | ✅ `erdos_992.variants.berkes_philipp` | +| Erdős–Gál: lacunary sequences satisfy the stronger bound | ❌ Not captured | + +**Recommendation:** Consider adding the Erdős–Gál result for lacunary sequences as a variant (positive result for the special case). Note that `FormalConjecturesForMathlib/NumberTheory/Lacunary.lean` already defines `IsLacunary`, which could be used directly. + +## 4. Readability + +The code is generally well-structured and readable. + +- The `discrepancy` definition has a clear LaTeX docstring explaining the formula. +- The three theorems are logically ordered: main conjecture → stronger variant → disproof. +- Namespace `Erdos992` keeps definitions local. + +**Minor suggestions:** +- The discrepancy definition is somewhat dense as a single expression. A `let` binding for the count (the filtered card) could improve readability, though this is a minor style point. +- The docstring for the module uses `max_{I ⊆ [0,1]}` while the definition docstring uses `sup_{0 ≤ a < b ≤ 1}`. These are equivalent but the notation switch could momentarily confuse a reader. + +## 5. Formalizability + +The problem is **well-suited for formalization** with moderate interpretation required: + +- **Asymptotic notation requires interpretation:** The original problem uses `o(1)` and `O(1)` in exponents. The formalization correctly interprets `D(N) ≪ N^{1/2} (log N)^{o(1)}` as "for every ε > 0, there exists C > 0 such that D(N) ≤ C √N (log N)^ε eventually." This is the standard epsilon-delta unwinding of little-o in the exponent. The `O(1)` in the stronger variant is correctly formalized as the existence of fixed constants C, K. +- **"Almost all α ∈ [0,1]"** is unambiguous: a.e. with respect to Lebesgue measure restricted to [0,1]. +- **"Infinite sequence of integers"** is clear: strictly increasing sequence of positive integers. +- **Discrepancy** is a standard concept with a well-known definition. + +**Ambiguity level: Low.** The main interpretive choices (unwinding asymptotic notation) are standard and correctly handled. + +## 6. Correctness + +### Discrepancy definition + +The definition: +``` +sSup {d : ℝ | ∃ a b : ℝ, 0 ≤ a ∧ a < b ∧ b ≤ 1 ∧ + d = abs (((Finset.range N).filter (fun n => + a ≤ Int.fract (α * (x n : ℝ)) ∧ Int.fract (α * (x n : ℝ)) < b)).card - + (b - a) * (N : ℝ))} +``` + +**Analysis:** +- Uses half-open intervals `[a, b)` with `a < b`, which is a standard choice for discrepancy (equivalent to closed intervals for the supremum). ✅ +- Uses `sSup` on a set of reals. The set is **nonempty** (any valid a < b in [0,1] yields an element) and **bounded above** (the absolute value is at most N). So `sSup` is well-defined on ℝ's conditionally complete linear order. ✅ +- `Int.fract (α * (x n : ℝ))` correctly computes the fractional part of α·xₙ. Since `Int.fract` maps into `[0, 1)`, the half-open interval `[a, b)` is the right choice. ✅ +- The counting uses `Finset.range N`, i.e., `n ∈ {0, ..., N-1}`, while the original problem uses `n ≤ N` (i.e., `{1, ..., N}`). This is an indexing offset that does not affect asymptotics. ✅ + +### Main theorem (`erdos_992`) + +- `answer(False)` is correct — the conjecture is disproved. ✅ +- `StrictMono x` and `∀ n, 0 < x n` correctly encode "strictly increasing sequence of positive integers." ✅ +- `∀ᵐ α ∂(volume.restrict (Set.Icc (0 : ℝ) 1))` correctly captures "for almost all α ∈ [0,1]." ✅ +- The formalization of `(log N)^{o(1)}`: for every ε > 0, there exists C > 0 such that eventually `D(N) ≤ C √N (log N)^ε`. This is mathematically correct. ✅ + +### Stronger variant (`erdos_992.variants.stronger`) + +- `answer(False)` is correct. ✅ +- The formalization of `(log log N)^{O(1)}`: there exist C > 0, K > 0 such that eventually `D(N) ≤ C √N (log log N)^K`. This is correct. ✅ +- Note: for small N, `log(log(N))` may be negative or undefined (when log N ≤ 0). The `∀ᶠ N in atTop` quantifier avoids this issue by only requiring the bound eventually. ✅ + +### Berkes–Philipp variant (`erdos_992.variants.berkes_philipp`) + +- States existence of a sequence such that for a.e. α, there exist c > 0 and frequently `D(N) ≥ c √(N log N)`. ✅ +- The use of `∃ᶠ N in atTop` (frequently) correctly captures `limsup D(N)/√(N log N) > 0`. ✅ +- This result indeed disproves both the main conjecture and the stronger variant, since `√(N log N)` eventually exceeds both `√N (log N)^ε` for any fixed ε... **Wait — this is not true.** We have `√(N log N) = √N · (log N)^{1/2}`, and `√N · (log N)^ε` with ε = 1/2 gives the same growth. So the Berkes–Philipp lower bound of `c √(N log N) = c √N (log N)^{1/2}` shows that one cannot achieve `D(N) ≤ C √N (log N)^ε` for ε < 1/2, but it does **not** by itself rule out ε = 1/2. However, the o(1) in the original conjecture means "for every ε > 0 (no matter how small)," so the Berkes–Philipp result with the fixed exponent 1/2 does disprove the conjecture. ✅ + +**One subtle point:** The Berkes–Philipp result as formalized shows `D(N) ≥ c √(N log N)` frequently. This is a lower bound that grows like `√N (log N)^{1/2}`. For this to disprove `D(N) ≤ C √N (log N)^ε` for all ε > 0, we need ε < 1/2 to give a contradiction. For ε ≥ 1/2, the upper bound `C √N (log N)^ε` is at least as large as `√(N log N)` (up to constants), so the Berkes–Philipp bound alone doesn't contradict those cases. But the conjecture demands the bound for **every** ε > 0, so choosing any ε < 1/2 yields a contradiction. The logical structure is correct. ✅ + +### Overall correctness assessment + +The formalization is **mathematically correct and complete** for the three statements it captures. The `answer(False)` values, the asymptotic interpretations, the use of `∀ᵐ`/`∃ᶠ`, and the discrepancy definition are all sound. No flaws identified. + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | Local definition is reasonable; shared counting utility could reduce duplication across 992/994/997 | +| Citations | Missing [Er64b] source reference and Erdős–Gál lacunary result | +| Variants | 3 of 4 variants captured; Erdős–Gál lacunary positive result missing | +| Readability | Good; minor notation inconsistency between module and definition docstrings | +| Formalizability | High — low ambiguity, standard interpretive choices | +| Correctness | Correct and complete for all three formalized statements | diff --git a/ai-review/993.md b/ai-review/993.md new file mode 100644 index 0000000000..2dd9751863 --- /dev/null +++ b/ai-review/993.md @@ -0,0 +1,97 @@ +# AI Review: Erdős Problem 993 + +## 1. Code Reuse + +The `numIndepSets` function (lines 38–41) manually encodes the independent set predicate: + +```lean +∀ ⦃u⦄, u ∈ s → ∀ ⦃v⦄, v ∈ s → u ≠ v → ¬G.Adj u v +``` + +Mathlib already provides `SimpleGraph.IsIndepSet` (in `Mathlib.Combinatorics.SimpleGraph.Clique`), defined as: + +```lean +abbrev IsIndepSet (s : Set α) : Prop := s.Pairwise (fun v w ↦ ¬G.Adj v w) +``` + +with a `Decidable` instance for `Finset` coercions. The counting function could be rewritten as: + +```lean +def numIndepSets (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ) : ℕ := + (Finset.univ.powerset.filter (fun s : Finset V => s.card = k ∧ G.IsIndepSet (s : Set V))).card +``` + +This would align with the Mathlib API and enable reuse of existing lemmas about `IsIndepSet` (e.g., `isIndepSet_iff`, `isClique_compl`). Note that at least two other Erdős problems (151, 615) also define their own `IsIndependentSet` locally—consolidation around the Mathlib definition would benefit the entire codebase. + +Additionally, the concept of "unimodal sequence" is used only here. If more unimodality conjectures arise, factoring out a generic `IsUnimodal` predicate on `ℕ → ℕ` could be worthwhile, but this is not necessary at present. + +## 2. Citations + +**Website (erdosproblems.com/993) lists:** +- [AMSE87] Alavi, Y., Malde, P. J., Schwenk, A. J., and Erdős, P., *The vertex independence sequence of a graph is not constrained*. Congressus Numerantium (1987), 58, 15–23. +- [Sc81] Schwenk, A. J. — proved unimodality for independent edge sets (matchings) in any graph. + +**Formalization includes:** +- [AMSE87] ✓ — The citation is correctly reproduced with authors, title, journal, year, volume, and pages matching the website. + +**Missing:** +- [Sc81] is not mentioned. While it concerns edge-independent sets rather than vertex-independent sets, it provides important mathematical context as a related positive result. Consider adding a brief note in the docstring (e.g., "Schwenk [Sc81] proved the analogous result for independent edge sets (matchings)."). + +## 3. Variants + +The website notes that Alavi, Malde, Schwenk, and Erdős also asked: +- **Whether every unimodal sequence pattern is achievable by some graph** — The formalization does not capture this companion question. However, this is a separate (and vaguer) question that may not warrant a formal statement alongside Problem 993. + +No other variants are listed on the website. The formalization correctly focuses on the core conjecture about trees/forests. + +## 4. Readability + +The formalization is clear and well-structured. Minor observations: + +- The docstring is well-written and includes the mathematical notation for the unimodal condition. +- The variable name `T` (for "tree") is appropriate, though the hypothesis `hT : T.IsAcyclic` captures forests (not just trees). A very minor suggestion: either rename to `F` for "forest" or add a brief comment noting that `IsAcyclic` means "forest" (acyclic graph, not necessarily connected). This is a stylistic nitpick. +- The `numIndepSets` definition has a clear docstring explaining what it computes. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: the independent set sequence of a forest is unimodal. All terms are standard and well-defined: +- "Independent set of size k" has a unique meaning in graph theory. +- "Unimodal" has a standard definition (non-decreasing then non-increasing). +- "Tree or forest" corresponds precisely to acyclic graphs. + +There is no ambiguity in the problem statement. This is a clean, well-posed open conjecture. + +## 6. Correctness + +**Assessment: Correct and complete.** + +Detailed verification: + +1. **`IsAcyclic` captures "tree or forest":** In Mathlib, `SimpleGraph.IsAcyclic` means the graph has no cycles, which is exactly the definition of a forest. Every tree is a forest, so the formalization correctly generalizes to forests as stated in the problem. ✓ + +2. **`numIndepSets` correctly counts independent sets of size k:** The function filters all subsets of vertices for those that have cardinality `k` and are pairwise non-adjacent, then takes the cardinality of the resulting set. This is mathematically correct. Note that `numIndepSets T 0 = 1` (the empty set is vacuously independent), matching the standard convention $i_0(G) = 1$. ✓ + +3. **Unimodal condition is correctly encoded:** The existential `∃ m : ℕ` with: + - `∀ i j, i ≤ j → j ≤ m → numIndepSets T i ≤ numIndepSets T j` (non-decreasing up to m) + - `∀ i j, m ≤ i → i ≤ j → numIndepSets T j ≤ numIndepSets T i` (non-increasing from m onward) + + This correctly encodes unimodality. The condition works even when `m = 0` (purely non-increasing) or when `m` exceeds the number of vertices (purely non-decreasing, with the tail being all zeros). ✓ + +4. **No finiteness issues:** The type `V` is `Fintype`, so the powerset and filtering are well-defined computable operations. The sequence `numIndepSets T k` is eventually zero (for `k > Fintype.card V`), so unimodality is a meaningful finite condition. ✓ + +5. **No missing hypotheses:** The formalization does not require connectivity (which would restrict to trees only), correctly handling the full generality of forests. No additional hypotheses are needed. ✓ + +**No mathematical flaws identified.** The formalization is a faithful and complete encoding of Erdős Problem 993. + +## Summary + +| Criterion | Rating | +|-----------|--------| +| Code reuse | Minor improvement possible (use Mathlib's `IsIndepSet`) | +| Citations | [AMSE87] correct; [Sc81] missing but optional | +| Variants | Core conjecture captured; companion question omitted (acceptable) | +| Readability | Good | +| Formalizability | Unambiguous | +| Correctness | Correct and complete | diff --git a/ai-review/994.md b/ai-review/994.md new file mode 100644 index 0000000000..7008332cf5 --- /dev/null +++ b/ai-review/994.md @@ -0,0 +1,72 @@ +# Review: Erdős Problem 994 + +## 1. Code Reuse + +Several existing definitions in the codebase address closely related concepts: + +- **`Equidistribution.IsEquidistributed`** (`Books/UniformDistributionOfSequences/Equidistribution.lean:41–44`): Defines equidistribution on `[a, b]` with respect to *sub-intervals* `Icc c d`. This is standard Weyl-style equidistribution and is strictly weaker than Khintchine's "strong uniform distribution," which quantifies over *all measurable sets*. + +- **`Erdos492.IsEquidistributed`** (`ErdosProblems/492.lean:42–46`): Another interval-based equidistribution definition, using half-open intervals `[c, d)`. + +- **`Erdos992.discrepancy`** (`ErdosProblems/992.lean:45–49`): Discrepancy over sub-intervals of `[0,1)`, also interval-based. + +- **`Erdos998.countFracInInterval`** (`ErdosProblems/998.lean`): Counting fractional parts in a given interval. + +**Assessment:** None of these can directly replace `cesaroFrequency` because Khintchine's conjecture is fundamentally about *arbitrary measurable sets*, not just intervals. The `cesaroFrequency` definition is appropriately specialized to the problem's needs. However, the broader pattern of "count elements of a filtered Finset and divide by n" is duplicated across problems 255, 492, 992, 994, and 998. A shared utility for this counting pattern could reduce duplication, though differences in interval types and the need for general sets here make a universal abstraction non-trivial. + +## 2. Citations + +The website ([erdosproblems.com/994](https://www.erdosproblems.com/994)) lists the following references: + +- **[Er64b]** — the original Erdős reference posing the problem +- **[Kh23]** — Khintchine's original conjecture +- **[Ma70]** — Marstrand's disproof + +The formalization's docstring only cites **[Ma70]** (Marstrand). It should additionally reference: + +- **[Er64b]** as the source linking the problem to Erdős. +- **[Kh23]** as the originator of the conjecture (Khintchine, 1923). The docstring already names this "Khintchine's conjecture" but does not give the formal citation. + +## 3. Variants + +The website does not list additional variants or sub-problems for Problem 994. The formalization captures the single disproved conjecture, which is complete. + +No variants appear to be missing. + +## 4. Readability + +The code is clear and well-structured: + +- The `cesaroFrequency` helper is cleanly separated with a good docstring explaining the formula. +- The main theorem's docstring includes the LaTeX formula and historical context. +- The `(k + 1)` shift in `Finset.range n` to achieve summation over `k = 1, …, n` is a standard idiom, though a brief inline comment could help readers unfamiliar with this pattern. + +**Minor suggestion:** The `DecidablePred` instance (`Classical.decPred _`) could be replaced by a file-level `attribute [local instance] Classical.propDecidable` as done in `492.lean`, for consistency across the problem set. This is a stylistic preference, not a correctness issue. + +## 5. Formalizability + +**Assessment: Unambiguous and clearly formalizable.** + +The problem statement is precise: it asks whether, for Lebesgue-almost every real α, the Cesàro averages of the indicator function of `{kα} ∈ E` converge to λ(E) for every measurable `E ⊆ (0,1)`. Every component of this statement (Lebesgue measure, fractional parts, Cesàro averages, measurability) has well-defined Lean/Mathlib counterparts. There is no ambiguity in the mathematical content. + +## 6. Correctness + +**Overall: Correct and faithful to the original problem.** + +Detailed analysis: + +1. **Quantifier structure.** The formalization states `answer(False) ↔ [∀ᵐ α, ∀ E measurable, …]`. Since Marstrand disproved the conjecture, `answer(False)` is correct — the biconditional asserts the right-hand side is false. + +2. **Summation range.** `cesaroFrequency` uses `Finset.range n` with `Int.fract (((k : ℝ) + 1) * α)`, effectively summing over `k = 1, …, n`. This matches the docstring and the original problem's `∑_{1 ≤ k ≤ n}`. ✓ + +3. **Division.** The expression `card / (n : ℝ)` involves coercion of the natural number `card` to ℝ, giving real-valued division. At `n = 0` this yields `0 / 0 = 0` in Lean, which is harmless since only the limit as `n → ∞` matters. ✓ + +4. **Domain of E.** The formalization requires `E ⊆ Ioo 0 1` (open interval). The original statement uses `E ⊆ (0,1)`, which is the open interval. For irrational α (which is almost every α), `Int.fract(kα) ∈ (0,1)` always holds (fractional parts of irrational multiples are never 0), so the distinction between `(0,1)` and `[0,1)` is immaterial under the almost-everywhere quantifier. ✓ + +5. **Measure used.** The "almost all" quantifier is with respect to `volume : Measure ℝ` (Lebesgue measure on ℝ). This is the standard interpretation: the conjecture fails for a set of α having positive measure. ✓ + +6. **Target of the limit.** `(volume E).toReal` converts `ℝ≥0∞` to `ℝ`. Since `E ⊆ Ioo 0 1`, the volume is at most 1 (finite), so `.toReal` faithfully recovers the Lebesgue measure λ(E). ✓ + +7. **Strong vs. ordinary equidistribution.** The key mathematical distinction — that Khintchine's conjecture asks for convergence for *every* measurable set, not just intervals — is correctly captured by the universal quantifier `∀ (E : Set ℝ), MeasurableSet E → E ⊆ Ioo 0 1 → …`. This is strictly stronger than Weyl equidistribution (which only requires intervals), and this is precisely what Marstrand disproved. ✓ + +**No mathematical flaws identified.** diff --git a/ai-review/995.md b/ai-review/995.md new file mode 100644 index 0000000000..ff8851f2fa --- /dev/null +++ b/ai-review/995.md @@ -0,0 +1,91 @@ +# AI Review: Erdős Problem 995 + +## 1. Code Reuse + +**`IsLacunary` definition is duplicated.** Problem 995 defines its own `Erdos995.IsLacunary` (line 38): +```lean +def IsLacunary (n : ℕ → ℕ) : Prop := + StrictMono n ∧ ∃ q : ℝ, q > 1 ∧ ∀ k : ℕ, (n k : ℝ) * q ≤ n (k + 1) +``` +while `FormalConjecturesForMathlib/NumberTheory/Lacunary.lean` already provides a shared definition: +```lean +def IsLacunary (n : ℕ → ℕ) : Prop := ∃ c > (1 : ℝ), ∀ᶠ k in atTop, c * n k < n (k + 1) +``` +Problem 996 already uses the shared definition (via `ProblemImports`). The local definition in 995 is strictly stronger (requires `StrictMono` globally and the ratio condition for *all* k, not just eventually; uses `≤` rather than `<`). These differences are mathematically inessential for this problem — one can always drop finitely many initial terms. The shared definition should be preferred for consistency across problems 995, 996, 997, etc., unless the stronger form is specifically needed. + +## 2. Citations + +The docstring references: +- **[Er49d]** Erdős, P. (1949) — correctly describes Erdős's lower-bound construction. +- **[Er64b]** Erdős, P. (1964) — correctly noted as the source of Erdős's belief that his lower bound is closer to the truth. + +These match the erdosproblems.com page. The website lists [Er64b] as the primary reference for this problem. The citations are **accurate and complete**. + +Minor note: The website also tags this problem under "Analysis" and "Discrepancy", which could optionally be reflected in the AMS tags (currently `AMS 11 42`, i.e., Number Theory and Harmonic Analysis). + +## 3. Variants + +The erdosproblems.com page does not list separate variants for Problem 995. The formalization captures the single main conjecture. **No missing variants.** + +However, the historical context mentions two related bounds: +- **Upper bound** (Erdős): $\sum f(\{\alpha n_k\}) = o(N(\log N)^{1/2+\varepsilon})$ for any $\varepsilon > 0$. +- **Lower bound** (Erdős, [Er49d]): There exist a lacunary sequence and $f \in L^2$ such that $\limsup \frac{|\sum f(\{\alpha n_k\})|}{N(\log\log N)^{1/2-\varepsilon}} = \infty$. + +Formalizing these known results as companion lemmas (as done in Problem 996 with `erdos_996.log2`) could add value but is not strictly required. + +## 4. Readability + +The formalization is generally readable. Minor suggestions: +- The docstring clearly states the mathematical problem and how it is formalized (the ε-δ translation of little-o), which is helpful. +- The `open` declarations (`MeasureTheory Filter Finset Set`) are appropriate. +- The expression `ε * (N : ℝ) * Real.sqrt (Real.log (Real.log (N : ℝ)))` is long but unavoidable given Lean's type coercion requirements. + +## 5. Formalizability + +The problem as stated on erdosproblems.com — "estimate the growth of $\sum f(\{\alpha n_k\})$" and "is it $o(N\sqrt{\log\log N})$?" — is **precise enough to formalize**, and the little-o formulation via ε is standard and correct. + +**Ambiguity level: Low.** The only ambiguity is whether f is assumed to have zero mean (see Correctness below), which is implicit in the standard analytic number theory convention but not stated on the website. + +## 6. Correctness + +### 6a. The little-o encoding is correct +The statement +$$\forall \varepsilon > 0,\; \forall^{\mathrm{a.e.}}\, \alpha,\; \exists N_0,\; \forall N \geq N_0,\; |\textstyle\sum_{k Is it true that if, for an irrational α, the number of m ≤ n with {αm} ∈ [u, v) is n(v − u) + O(1), then u and v must be fractional parts of integer multiples of α? + +**Assessment: Highly formalizable, with minor ambiguities resolved correctly.** + +- **Range of m:** The formalization uses `1 ≤ m ≤ n` (via `Finset.Icc 1 n`). The original problem says "m ≤ n" which could include `m = 0`, but `{α · 0} = 0` is a degenerate case. Using `m ≥ 1` is the standard mathematical convention and is correct. +- **Interval [u, v):** The formalization correctly uses a half-open interval. This is standard in the equidistribution/discrepancy literature for intervals modulo 1. +- **Constraints on u, v:** The formalization requires `0 ≤ u`, `u < v`, `v ≤ 1`. This is the natural domain for sub-intervals of `[0, 1)`. The constraint `u < v` (strict) is correct — a degenerate interval would make the count identically 0 and `n · 0 + O(1)` trivially, which would be uninteresting. +- **"O(1)" formalization:** The condition `∃ C, ∀ n, 0 < n → |count - n(v-u)| ≤ C` is a correct formalization of "the discrepancy is bounded." This is the standard way to express O(1) in this context. +- **"For all large n" vs "for all n":** The original problem says "for all large n" but the formalization uses `∀ n, 0 < n → ...`. This is actually equivalent for the O(1) bound: if the bound holds for all `n ≥ N₀`, one can increase `C` to also cover the finitely many `n < N₀`. So the formalization is correct. +- **Conclusion:** `u = Int.fract(α * k)` and `v = Int.fract(α * ℓ)` for some integers `k, ℓ`. This is exactly what the problem asks. + +**Ambiguity level: Low.** The problem statement is precise and the formalization resolves all minor ambiguities correctly. + +--- + +## 6. Correctness + +**Mathematical correctness assessment: Correct.** + +The formalization faithfully captures Kesten's theorem (the Erdős–Szüsz conjecture). Detailed verification: + +1. **`countFracInInterval` definition:** Counts `#{m ∈ {1, ..., n} : u ≤ {αm} < v}`. This is precisely the counting function in the problem statement. The use of `Int.fract (α * ↑m)` correctly computes the fractional part of `α · m`. + +2. **Irrationality hypothesis:** `Irrational α` is essential. For rational `α = p/q`, the sequence `{αm}` is periodic with period `q`, and many choices of `u, v` (not just fractional parts of multiples of `α`) can give O(1) discrepancy. The formalization correctly includes this hypothesis. + +3. **Boundedness condition:** The formalization uses `|(countFracInInterval α u v n : ℝ) - n * (v - u)| ≤ C`, which is correct. Note the absolute value — the discrepancy can be positive or negative, and O(1) means bounded in absolute value. + +4. **Conclusion structure:** `(∃ k : ℤ, u = Int.fract (α * ↑k)) ∧ (∃ ℓ : ℤ, v = Int.fract (α * ↑ℓ))` correctly requires *both* endpoints to be fractional parts of integer multiples of `α`. The use of `ℤ` (rather than `ℕ`) for the multipliers is correct, since negative multiples are needed in general. + +5. **Edge case — v = 1:** When `v = 1` (allowed by `v ≤ 1`), we need `1 = Int.fract(α * ℓ)` for some integer `ℓ`. But `Int.fract` always returns values in `[0, 1)`, so `Int.fract(x) = 1` is impossible. This means the theorem asserts that v = 1 cannot occur when the discrepancy is O(1) — or more precisely, that the hypothesis `∃ C, ...` fails when v = 1 (unless u = v = 1, excluded by `u < v`). **This is actually mathematically correct:** if `v = 1` and `u = {αk}` for some `k`, then the interval `[u, 1)` has the O(1) discrepancy property if and only if `u = {αk}` and `1 ≡ {αℓ}` mod 1, i.e., `ℓ = 0` gives `Int.fract(0) = 0`, so the only way is `v = 0`, contradicting `u < v ≤ 1`. In fact, the correct interpretation is that the interval wraps around: `[u, 1) ∪ [0, 0)` is just `[u, 1)`, and Kesten's theorem says `u` must be a fractional part of a multiple of `α`, while `v = 1` corresponds to `{α · 0} = 0`. So the conclusion `v = Int.fract(α * 0) = 0` does hold when `ℓ = 0`... but `v = 1 ≠ 0`. **This is a subtle issue.** In the standard statement of Kesten's theorem, the interval endpoints are taken modulo 1, and `v = 1` is identified with `v = 0`. The formalization's constraint `v ≤ 1` with the conclusion `v = Int.fract(α * ℓ)` creates an edge case where `v = 1` cannot be expressed as a fractional part. However, this edge case is arguably benign: when `v = 1`, the interval `[u, 1)` with `0 ≤ u < 1` has discrepancy bounded iff `u = {αk}` for some `k`, and in that case the "right endpoint" is implicitly `0 mod 1`. The formalization handles this by making the implication vacuously true (or rather, the hypothesis fails for `v = 1` in non-degenerate cases), which is arguably correct but slightly inelegant. + + **More careful analysis:** Actually, let's consider `u = 0, v = 1`. Then `countFracInInterval α 0 1 n = n` for all `n` (since every fractional part lies in `[0, 1)`), and `n * (1 - 0) = n`, so the discrepancy is exactly 0. The hypothesis is satisfied with `C = 0`. The conclusion requires `0 = Int.fract(α * k)` and `1 = Int.fract(α * ℓ)`. The first holds with `k = 0`. The second has no solution since `Int.fract` returns values in `[0, 1)`. **This is a genuine edge-case bug:** the formalization claims `answer(True)` but the statement is false when `u = 0, v = 1` because the conclusion `1 = Int.fract(α * ℓ)` is unsatisfiable. + + **Severity:** This is a real correctness issue. The fix would be to either (a) strengthen the constraint to `v < 1`, or (b) replace the conclusion for `v` with `v = 1 ∨ ∃ ℓ : ℤ, v = Int.fract(α * ℓ)`, or (c) use a representation where `1` is identified with `0` (i.e., work in `ℝ / ℤ` or `AddCircle 1`). + +**Summary of correctness issues:** +- **Edge case at `v = 1`:** The formalization allows `v = 1` but the conclusion `v = Int.fract(α * ℓ)` is unsatisfiable since `Int.fract` maps to `[0, 1)`. The case `u = 0, v = 1` is a concrete counterexample to the formalized statement. This makes the theorem as stated **false**, contradicting `answer(True)`. + +--- + +## Summary + +| Criterion | Assessment | +|---|---| +| Code Reuse | Low-priority: could share counting definitions with Problems 255, 992, 994 | +| Citations | Minor: missing volume number in [Ke66]; missing original source [Er64b] | +| Variants | Complete for the website; converse (Hecke–Ostrowski) could be added | +| Readability | Good, no issues | +| Formalizability | High; low ambiguity | +| Correctness | **Bug: `v = 1` edge case makes the statement false as written** | + +**Recommended fix for the correctness bug:** Change `v ≤ 1` to `v < 1`, which is the natural domain for endpoints in `[0, 1)` and avoids the `Int.fract` range issue. Alternatively, one could allow `v ≤ 1` but modify the conclusion to handle the `v = 1` case (e.g., `v = 1 → ∃ ℓ : ℤ, v = Int.fract (α * ℓ) + 1` or more naturally `v % 1 = Int.fract(α * ℓ)`). The simplest and most mathematically natural fix is `v < 1`. diff --git a/ai-review/999.md b/ai-review/999.md new file mode 100644 index 0000000000..f2a49eacb3 --- /dev/null +++ b/ai-review/999.md @@ -0,0 +1,86 @@ +# AI Review: Erdős Problem 999 + +## 1. Code Reuse + +No existing code in the `FormalConjecturesForMathlib` directory addresses Diophantine approximation, Duffin–Schaeffer-type approximation sets, or related concepts. The codebase has extensive additive combinatorics infrastructure (sum-free sets, Sidon sets, Ramsey numbers, etc.) but nothing applicable to this problem. + +The `DuffinSchafferApprox` definition is self-contained and does not duplicate any existing definition. **No code reuse opportunities identified.** + +## 2. Citations + +The formalization references: +- **[KoMa20]** Koukoulopoulos, D. and Maynard, J., *On the Duffin-Schaeffer conjecture*. Annals of Mathematics 192 (2020), 251–307. + +The website at [erdosproblems.com/999](https://www.erdosproblems.com/999) lists: +- **[Er64b]** as the original source (Erdős 1964). +- **[KoMa20]** as the solving reference. + +**Missing citation:** The original Erdős source **[Er64b]** is not mentioned in the formalization's docstring. It should be added for completeness, since the website attributes the problem to this source. Additionally, the original Duffin–Schaeffer paper (1941) could be cited for historical context, though the website does not list it explicitly. + +## 3. Variants + +The website describes a single problem statement with no additional variants or sub-problems. The formalization captures the main biconditional statement. The website does note that Erdős proved the special case where $f(q) \cdot q$ is bounded, but this is a historical remark about partial progress rather than a distinct variant. + +**No missing variants.** + +## 4. Readability + +The code is clean and well-structured: +- The `DuffinSchafferApprox` helper definition is clearly documented and separates the approximation set from the main theorem statement. +- The docstrings include LaTeX-formatted mathematics and explain the conjecture concisely. +- The namespace `Erdos999` appropriately scopes the definitions. + +**Minor suggestion:** The docstring for `DuffinSchafferApprox` says "coprime pairs $(p, q)$ with $q > 0$" — it would be slightly more precise to say "coprime integer-natural number pairs" to clarify the types, since $p \in \mathbb{Z}$ and $q \in \mathbb{N}$. + +## 5. Formalizability + +**Assessment: High formalizability, but the statement has a type-level ambiguity.** + +The Duffin–Schaeffer conjecture is a precisely stated theorem with no inherent ambiguity — both the approximation condition and the divergence condition are concrete. The biconditional structure is clean and standard. + +However, the *type* of the approximation function $f$ introduces a formalization choice that significantly affects the generality of the statement (see Correctness below). The mathematical statement is unambiguous; the question is whether the Lean types faithfully capture it. + +**Ambiguity level: Low** (the mathematics is precise; the only issue is the chosen Lean types). + +## 6. Correctness + +### Critical Issue: `f : ℕ → ℕ` is too restrictive + +The formalization declares `f : ℕ → ℕ`, but the standard Duffin–Schaeffer conjecture (and the Koukoulopoulos–Maynard theorem) uses a function $\psi : \mathbb{N} \to \mathbb{R}_{\geq 0}$ (or equivalently $\psi : \mathbb{N} \to \mathbb{R}$ with $\psi \geq 0$). Using a natural-number-valued function is a genuine mathematical restriction: + +- **Lost generality:** One cannot express approximation functions like $\psi(q) = 1/\log q$, $\psi(q) = q^{-\varepsilon}$, or any non-integer-valued function. These are standard and important instances of the theorem. +- **The classical case** $|\alpha - p/q| < 1/q^2$ corresponds to $\psi(q) = 1/q$, which is not representable as `ℕ → ℕ` for $q > 1$. +- **Impact:** The formalization as stated is a *strictly weaker* theorem than the actual Duffin–Schaeffer theorem. The `ℕ → ℕ` version is a true consequence of the real theorem, but does not capture its full strength. + +**Recommended fix:** Change to `f : ℕ → ℝ` (with either an explicit `0 ≤ f q` hypothesis or use `ℕ → NNReal`). The `DuffinSchafferApprox` definition and the summability condition both already cast to `ℝ`, so the change would be straightforward. + +### Definition of `DuffinSchafferApprox` + +Modulo the type issue with `f`, the definition is correct: +- `0 < pq.2` correctly ensures $q > 0$. +- `Nat.Coprime (Int.natAbs pq.1) pq.2` correctly captures $\gcd(|p|, q) = 1$. +- The approximation inequality `|α - p/q| < f(q)/q` is the standard condition. +- The set type `Set (ℤ × ℕ)` is appropriate since $p$ can be negative. + +### Main theorem structure + +- **Biconditional:** The statement correctly asserts the full equivalence (not just one direction). ✅ +- **Almost-every quantifier:** `∀ᵐ α : ℝ` uses the default Lebesgue measure on $\mathbb{R}$, which is correct. ✅ +- **Divergence condition:** `¬ Summable (fun q => φ(q) * f(q) / q)` correctly expresses divergence of $\sum \varphi(q) f(q)/q$ for non-negative terms. ✅ +- **q = 0 edge case:** When $q = 0$, we get $\varphi(0) \cdot f(0) / 0$. Since division by zero yields 0 in Lean, this term contributes nothing to the sum, which is mathematically correct (the Duffin–Schaeffer sum is over $q \geq 1$). ✅ +- **Category tag:** `@[category research solved, AMS 11]` is appropriate — the problem is solved and falls under AMS class 11 (Number Theory). ✅ + +### Overall correctness + +The formalization is **mathematically sound but incomplete** due to the `ℕ → ℕ` restriction on `f`. It correctly formalizes a special case of the Duffin–Schaeffer theorem, not the full theorem. This is not attributable to ambiguity in the problem statement — the standard statement clearly uses real-valued approximation functions. + +## Summary + +| Category | Assessment | +|----------|-----------| +| Code reuse | ✅ No reuse opportunities; no duplicates | +| Citations | ⚠️ Missing original Erdős source [Er64b] | +| Variants | ✅ Complete (no variants on the website) | +| Readability | ✅ Clean, well-documented code | +| Formalizability | ✅ Precisely formalizable statement | +| Correctness | ❌ `f : ℕ → ℕ` should be `f : ℕ → ℝ` (or `ℕ → NNReal`); current formalization is strictly weaker than the actual theorem |